blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a7575b09c4407530d9416bd66a4da47a00a6c1c
|
d1d3fcc2f46df65ade6d5316d13d3e2e30e8a8dc
|
/src/main/java/com/example/android/tictactoe/FiveBoardActivity.java
|
94e77377ff796d515fae3b0d3fe5b2ea77f87c2a
|
[] |
no_license
|
Xilma/T-Cube
|
3eed6c57c38006a79cc13a1666af41c7250d2a3f
|
10a1b8f37963270488510ba5f7e4b2e883fda390
|
refs/heads/master
| 2020-03-09T18:42:24.165211 | 2018-04-18T11:50:41 | 2018-04-18T11:50:41 | 128,938,686 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 17,952 |
java
|
package com.example.android.tictactoe;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Random;
import static com.example.android.tictactoe.ThreeBoardActivity.GAME_SCORES;
public class FiveBoardActivity extends AppCompatActivity {
private Button[][] b;
private int [][] c;
private boolean playerToken;
private int gamesPlayed, gamesWon, gamesLost, gamesDraw = 0;
private SharedPreferences mPreferences;
private SharedPreferences.Editor mEditor;
private int i, j = 0;
AI ai;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_five_board);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
TextView back = findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent menu = new Intent(FiveBoardActivity.this, MainActivity.class);
startActivity(menu);
finish();
}
});
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
mPreferences = getSharedPreferences(GAME_SCORES, 0);
mEditor = mPreferences.edit();
chooseToken();
}
public void chooseToken(){
Bundle extras = getIntent().getExtras();
assert extras != null;
char lo = extras.getChar("Letter_O");
char lx = extras.getChar("Letter_X");
if (lo == 'O'){
playerToken = false;
setBoard();
}
if(lx == 'X'){
playerToken = true;
setBoard();
}
}
//Reset the board
public void resetGameFive(View view){
for (int i = 1; i < 6; i++){
for(int j = 1; j < 6; j++){
String buttonID = "r" + i + "c" + j;
int resID = getResources().getIdentifier(buttonID, "id", getPackageName());
b[i][j] = findViewById(resID);
b[i][j].setText("");
}
}
setBoard();
}
// Set up the game board.
private void setBoard() {
ai = new AI();
b = new Button[6][6];
c = new int[6][6];
//Row 1
b[1][1] = findViewById(R.id.r1c1);
b[1][2] = findViewById(R.id.r1c2);
b[1][3] = findViewById(R.id.r1c3);
b[1][4] = findViewById(R.id.r1c4);
b[1][5] = findViewById(R.id.r1c5);
//Row 2
b[2][1] = findViewById(R.id.r2c1);
b[2][2] = findViewById(R.id.r2c2);
b[2][3] = findViewById(R.id.r2c3);
b[2][4] = findViewById(R.id.r2c4);
b[2][5] = findViewById(R.id.r2c5);
//Row 3
b[3][1] = findViewById(R.id.r3c1);
b[3][2] = findViewById(R.id.r3c2);
b[3][3] = findViewById(R.id.r3c3);
b[3][4] = findViewById(R.id.r3c4);
b[3][5] = findViewById(R.id.r3c5);
//Row 4
b[4][1] = findViewById(R.id.r4c1);
b[4][2] = findViewById(R.id.r4c2);
b[4][3] = findViewById(R.id.r4c3);
b[4][4] = findViewById(R.id.r4c4);
b[4][5] = findViewById(R.id.r4c5);
//Row 5
b[5][1] = findViewById(R.id.r5c1);
b[5][2] = findViewById(R.id.r5c2);
b[5][3] = findViewById(R.id.r5c3);
b[5][4] = findViewById(R.id.r5c4);
b[5][5] = findViewById(R.id.r5c5);
for (i = 1; i < 6; i++) {
for (j = 1; j < 6; j++)
c[i][j] = 2;
}
// add the click listeners for each button
for (i = 1; i < 6; i++) {
for (j = 1; j < 6; j++) {
b[i][j].setOnClickListener(new MyClickListener(i, j));
if(!b[i][j].isEnabled()) {
b[i][j].setText(" ");
b[i][j].setEnabled(true);
}
}
}
Toast.makeText(getApplicationContext(), "Click a button to start.", Toast.LENGTH_LONG).show();
}
class MyClickListener implements View.OnClickListener {
int x;
int y;
private MyClickListener(int x, int y) {
this.x = x;
this.y = y;
}
public void onClick(View view) {
if (b[x][y].isEnabled()) {
b[x][y].setEnabled(false);
if(!playerToken) {
b[x][y].setTextColor(Color.parseColor("#673ab7"));
b[x][y].setText(R.string.letter_o);
}
if(playerToken){
b[x][y].setTextColor(Color.parseColor("#673ab7"));
b[x][y].setText(R.string.letter_x);
}
c[x][y] = 0;
if (!checkBoard()) {
ai.takeTurn();
}
}
}
}
private class AI {
public void takeTurn() {
if(c[1][1]==2 && ( (c[1][2]==0 && c[1][3]==0 && c[1][4]==0 && c[1][5]==0) ||
(c[2][2]==0 && c[3][3]==0 && c[4][4]==0 && c[5][5]==0) ||
(c[2][1]==0 && c[3][1]==0 && c[4][1]==0 && c[5][1]==0)
)) {
markSquare(1,1);
} else if (c[1][2]==2 && ( (c[2][2]==0 && c[3][2]==0 && c[4][2]==0 && c[5][2]==0) ||
(c[1][1]==0 && c[1][3]==0 && c[1][4]==0 && c[1][5]==0)
)) {
markSquare(1,2);
} else if(c[1][3]==2 && ( (c[1][1]==0 && c[1][2]==0 && c[1][4]==0 && c[1][5]==0) ||
(c[2][3]==0 && c[3][3]==0 && c[4][3]==0 && c[5][3]==0)
)) {
markSquare(1,3);
} else if(c[1][4]==2 && ( (c[1][1]==0 && c[1][2]==0 && c[1][3]==0 && c[1][5]==0) ||
(c[2][4]==0 && c[3][4]==0 && c[4][4]==0 && c[5][4]==0)
)) {
markSquare(1,4);
} else if(c[1][5]==2 && ( (c[1][1]==0 && c[1][2]==0 && c[1][3]==0 && c[1][4]==0) ||
(c[2][5]==0 && c[3][5]==0 && c[4][5]==0 && c[5][5]==0) ||
(c[2][4]==0 && c[3][3]==0 && c[4][2]==0 && c[5][1]==0)
)) {
markSquare(1,5);
} else if(c[2][1]==2 && ( (c[2][2]==0 && c[2][3]==0 && c[2][4]==0 && c[2][5]==0) ||
(c[1][1]==0 && c[3][1]==0 && c[4][1]==0 && c[5][1]==0)
)) {
markSquare(2,1);
}else if(c[2][2]==2 && ( (c[2][1]==0 && c[2][3]==0 && c[2][4]==0 && c[2][5]==0) ||
(c[1][2]==0 && c[3][2]==0 && c[4][2]==0 && c[5][2]==0)
)) {
markSquare(2,2);
}else if(c[2][3]==2 && ( (c[2][1]==0 && c[2][2]==0 && c[2][4]==0 && c[2][5]==0) ||
(c[1][3]==0 && c[3][3]==0 && c[4][3]==0 && c[5][3]==0)
)) {
markSquare(2,3);
}else if(c[2][4]==2 && ( (c[2][1]==0 && c[2][2]==0 && c[2][3]==0 && c[2][5]==0) ||
(c[1][4]==0 && c[3][4]==0 && c[4][4]==0 && c[5][4]==0)
)) {
markSquare(2,4);
}else if(c[2][5]==2 && ( (c[2][2]==0 && c[2][3]==0 && c[2][4]==0 && c[2][1]==0) ||
(c[1][5]==0 && c[3][5]==0 && c[4][5]==0 && c[5][5]==0)
)){
markSquare(2,5);
}else if(c[3][1]==2 && ( (c[3][2]==0 && c[3][3]==0 && c[3][4]==0 && c[3][5]==0) ||
(c[1][1]==0 && c[2][1]==0 && c[4][1]==0 && c[5][1]==0)
)) {
markSquare(3,1);
}else if(c[3][2]==2 && ( (c[3][1]==0 && c[3][3]==0 && c[3][4]==0 && c[3][5]==0) ||
(c[1][2]==0 && c[2][2]==0 && c[4][2]==0 && c[5][2]==0)
)) {
markSquare(3,2);
}else if(c[3][3]==2 && ( (c[3][1]==0 && c[3][2]==0 && c[3][4]==0 && c[3][5]==0) ||
(c[1][3]==0 && c[2][3]==0 && c[4][3]==0 && c[5][3]==0)
)) {
markSquare(3,3);
}else if(c[3][4]==2 && ( (c[3][1]==0 && c[3][2]==0 && c[3][3]==0 && c[3][5]==0) ||
(c[1][4]==0 && c[2][4]==0 && c[4][4]==0 && c[5][4]==0)
)) {
markSquare(3,4);
}else if(c[3][5]==2 && ( (c[3][1]==0 && c[3][2]==0 && c[3][3]==0 && c[3][4]==0) ||
(c[1][5]==0 && c[2][5]==0 && c[4][5]==0 && c[5][5]==0)
)){
markSquare(3,5);
}else if(c[4][1]==2 && ( (c[4][2]==0 && c[4][3]==0 && c[4][4]==0 && c[4][5]==0) ||
(c[1][1]==0 && c[2][1]==0 && c[3][1]==0 && c[5][1]==0)
)) {
markSquare(4,1);
}else if(c[4][2]==2 && ( (c[4][1]==0 && c[4][3]==0 && c[4][4]==0 && c[4][5]==0) ||
(c[1][2]==0 && c[2][2]==0 && c[3][2]==0 && c[5][2]==0)
)) {
markSquare(4,2);
}else if(c[4][3]==2 && ( (c[4][1]==0 && c[4][2]==0 && c[4][4]==0 && c[4][5]==0) ||
(c[1][3]==0 && c[2][3]==0 && c[3][3]==0 && c[5][3]==0)
)) {
markSquare(4,3);
}else if(c[4][4]==2 && ( (c[4][1]==0 && c[4][2]==0 && c[4][3]==0 && c[4][5]==0) ||
(c[1][4]==0 && c[2][4]==0 && c[3][4]==0 && c[5][4]==0)
)) {
markSquare(4,4);
}else if(c[4][5]==2 && ( (c[4][1]==0 && c[4][2]==0 && c[4][3]==0 && c[4][4]==0) ||
(c[1][5]==0 && c[2][5]==0 && c[3][5]==0 && c[5][5]==0)
)){
markSquare(4,5);
}else if(c[5][1]==2 && ( (c[5][2]==0 && c[5][3]==0 && c[5][4]==0 && c[5][5]==0) ||
(c[4][2]==0 && c[3][3]==0 && c[2][4]==0 && c[1][5]==0) ||
(c[4][1]==0 && c[3][1]==0 && c[2][1]==0 && c[1][1]==0)
)) {
markSquare(5,1);
}else if(c[5][2]==2 && ( (c[5][1]==0 && c[5][3]==0 && c[5][4]==0 && c[5][5]==0) ||
(c[1][2]==0 && c[2][2]==0 && c[3][2]==0 && c[4][2]==0)
)) {
markSquare(5,2);
}else if(c[5][3]==2 && ( (c[5][1]==0 && c[5][2]==0 && c[5][4]==0 && c[5][5]==0) ||
(c[1][3]==0 && c[2][3]==0 && c[3][3]==0 && c[4][3]==0)
)) {
markSquare(5,3);
}else if(c[5][4]==2 && ( (c[5][1]==0 && c[5][2]==0 && c[5][3]==0 && c[5][5]==0) ||
(c[1][4]==0 && c[2][4]==0 && c[3][4]==0 && c[4][4]==0)
)) {
markSquare(5,4);
}else if(c[5][5]==2 && ( (c[5][1]==0 && c[5][2]==0 && c[5][3]==0 && c[5][4]==0) ||
(c[4][4]==0 && c[3][3]==0 && c[2][2]==0 && c[1][1]==0) ||
(c[4][5]==0 && c[3][5]==0 && c[2][5]==0 && c[1][5]==0)
)) {
markSquare(5,5);
} else {
Random rand = new Random();
int a = rand.nextInt(6);
int b = rand.nextInt(6);
while(a==0 || b==0 || c[a][b]!=2) {
a = rand.nextInt(6);
b = rand.nextInt(6);
}
markSquare(a,b);
}
}
private void markSquare(int x, int y) {
b[x][y].setEnabled(false);
if(!playerToken){
b[x][y].setTextColor(Color.parseColor("#ffffff"));
b[x][y].setText(R.string.letter_x);}
if(playerToken){
b[x][y].setTextColor(Color.parseColor("#ffffff"));
b[x][y].setText(R.string.letter_o);
}
c[x][y] = 1;
checkBoard();
}
}
// check the board to see if someone has won
private boolean checkBoard() {
boolean gameOver = false;
if ((c[1][1] == 0 && c[2][2] == 0 && c[3][3] == 0 && c[4][4] == 0 && c[5][5] == 0)
|| (c[1][5] == 0 && c[2][4] == 0 && c[3][3] == 0 && c[4][2] == 0 && c[5][1] == 0)
|| (c[1][1] == 0 && c[1][2] == 0 && c[1][3] == 0 && c[1][4] == 0 && c[1][5] == 0)
|| (c[2][1] == 0 && c[2][2] == 0 && c[2][3] == 0 && c[2][4] == 0 && c[2][5] == 0)
|| (c[3][1] == 0 && c[3][2] == 0 && c[3][3] == 0 && c[3][4] == 0 && c[3][5] == 0)
|| (c[4][1] == 0 && c[4][2] == 0 && c[4][3] == 0 && c[4][4] == 0 && c[4][5] == 0)
|| (c[5][1] == 0 && c[5][2] == 0 && c[5][3] == 0 && c[5][4] == 0 && c[5][5] == 0)
|| (c[1][1] == 0 && c[2][1] == 0 && c[3][1] == 0 && c[4][1] == 0 && c[5][1] == 0)
|| (c[1][2] == 0 && c[2][2] == 0 && c[3][2] == 0 && c[4][2] == 0 && c[5][2] == 0)
|| (c[1][3] == 0 && c[2][3] == 0 && c[3][3] == 0 && c[4][3] == 0 && c[5][3] == 0)
|| (c[1][4] == 0 && c[2][4] == 0 && c[3][4] == 0 && c[4][4] == 0 && c[5][4] == 0)
|| (c[1][5] == 0 && c[2][5] == 0 && c[3][5] == 0 && c[4][5] == 0 && c[5][5] == 0)) {
Toast.makeText(getApplicationContext(), "Game over. You win!", Toast.LENGTH_LONG).show();
gameWin();
gamePlayed();
gameOver = true;
disableButtons();
} else if ((c[1][1] == 1 && c[2][2] == 1 && c[3][3] == 1 && c[4][4] == 1 && c[5][5] == 1)
|| (c[1][5] == 1 && c[2][4] == 1 && c[3][3] == 1 && c[4][2] == 1 && c[5][1] == 1)
|| (c[1][1] == 1 && c[1][2] == 1 && c[1][3] == 1 && c[1][4] == 1 && c[1][5] == 1)
|| (c[2][1] == 1 && c[2][2] == 1 && c[2][3] == 1 && c[2][4] == 1 && c[2][5] == 1)
|| (c[3][1] == 1 && c[3][2] == 1 && c[3][3] == 1 && c[3][4] == 1 && c[3][5] == 1)
|| (c[4][1] == 1 && c[4][2] == 1 && c[4][3] == 1 && c[4][4] == 1 && c[4][5] == 1)
|| (c[5][1] == 1 && c[5][2] == 1 && c[5][3] == 1 && c[5][4] == 1 && c[5][5] == 1)
|| (c[1][1] == 1 && c[2][1] == 1 && c[3][1] == 1 && c[4][1] == 1 && c[5][1] == 1)
|| (c[1][2] == 1 && c[2][2] == 1 && c[3][2] == 1 && c[4][2] == 1 && c[5][2] == 1)
|| (c[1][3] == 1 && c[2][3] == 1 && c[3][3] == 1 && c[4][3] == 1 && c[5][3] == 1)
|| (c[1][4] == 1 && c[2][4] == 1 && c[3][4] == 1 && c[4][4] == 1 && c[5][4] == 1)
|| (c[1][5] == 1 && c[2][5] == 1 && c[3][5] == 1 && c[4][5] == 1 && c[5][5] == 1)) {
Toast.makeText(getApplicationContext(), "Game over. You lost!", Toast.LENGTH_LONG).show();
gameLost();
gamePlayed();
gameOver = true;
disableButtons();
} else {
boolean empty = false;
for(i=1; i<=5; i++) {
for(j=1; j<=5; j++) {
if(c[i][j]==2) {
empty = true;
break;
}
}
}
if(!empty) {
gameOver = true;
Toast.makeText(getApplicationContext(), "Game over. It's a draw!", Toast.LENGTH_LONG).show();
gameDraw();
gamePlayed();
disableButtons();
}
}
return gameOver;
}
public void disableButtons(){
for (i = 1; i <= 5; i++) {
for (j = 1; j <= 5; j++) {
b[i][j].setEnabled(false);
}
}
}
public void gameWin(){
if(!mPreferences.contains("GAMES_WON_FIVE")) {
mEditor.putInt("GAMES_WON_FIVE", gamesWon);
mEditor.apply();
}
else {
int gw = mPreferences.getInt("GAMES_WON_FIVE", 0);
gamesWon = gw + 1;
mEditor.putInt("GAMES_WON_FIVE", gamesWon);
mEditor.apply();
}
}
public void gameLost(){
if (!mPreferences.contains("GAMES_LOST_FIVE")){
mEditor.putInt("GAMES_LOST_FIVE", gamesLost);
mEditor.apply();
}
else {
int gl = mPreferences.getInt("GAMES_LOST_FIVE", 0);
gamesLost = gl + 1;
mEditor.putInt("GAMES_LOST_FIVE", gamesLost);
mEditor.apply();
}
}
public void gameDraw(){
if(!mPreferences.contains("GAMES_DRAW_FIVE")) {
mEditor.putInt("GAMES_DRAW_FIVE", gamesDraw);
mEditor.apply();
}
else{
int gd = mPreferences.getInt("GAMES_DRAW_FIVE", 0);
gamesDraw = gd + 1;
mEditor.putInt("GAMES_DRAW_FIVE", gamesDraw);
mEditor.apply();
}
}
public void gamePlayed(){
if(!mPreferences.contains("GAMES_PLAYED_FIVE")) {
mEditor.putInt("GAMES_PLAYED_FIVE", gamesPlayed);
mEditor.apply();
}
else {
int gw = mPreferences.getInt("GAMES_WON_FIVE", 0);
int gl = mPreferences.getInt("GAMES_LOST_FIVE", 0);
int gd = mPreferences.getInt("GAMES_DRAW_FIVE", 0);
gamesPlayed = (gw + gl + gd);
mEditor.putInt("GAMES_PLAYED_FIVE", gamesPlayed);
mEditor.apply();
}
}
}
|
[
"[email protected]"
] | |
1c627d4655eb5d24807c300f8d5b38d527af771f
|
0f9297986b1ce2eb2d2a144ac1605dd14665cc87
|
/lingmed_lite/trunk/src/main/com/aliasi/lingmed/mesh/MeshTerm.java
|
3eb44b714adc30ce51a6a7fae729f848d51710df
|
[] |
no_license
|
lingpipe/sandbox
|
1b7b62e36f0099b9e6de21a4b61c5933e6eb6943
|
0b8042fc9c6d5dd947f41deb33af5b3c93c346ae
|
refs/heads/master
| 2021-01-14T13:39:42.509608 | 2014-11-25T18:55:57 | 2014-11-25T18:55:57 | 66,664,645 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,445 |
java
|
package com.aliasi.lingmed.mesh;
import com.aliasi.lingpipe.xml.DelegateHandler;
import com.aliasi.lingpipe.xml.DelegatingHandler;
import com.aliasi.lingpipe.xml.TextAccumulatorHandler;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
/**
* A {@code MeshTerm} is the atomic unit of the MeSH vocabulary, containing
* a free-text string as well as metadata about the term. The term and
* its unique identifier (UI) are available through the method {@link #nameUi()}.
*
* <p>Each term has a lexical type given by {@link #lexicalTag()}, which
* takes on one of the following values:
*
* <blockquote><table border="1" cellpadding="5">
* <tr><th>Lexical Type</th><th>Description</th></tr>
* <tr><td>ABB</td><td>Abbreviation</td>
* <tr><td>ABX</td><td>Embedded abbreviation</td></tr>
* <tr><td>ACR</td><td>Acronym</td></tr>
* <tr><td>ACX</td><td>Embedded acronym</td></tr>
* <tr><td>EPO</td><td>Eponym</td></tr>
* <tr><td>LAB</td><td>Lab number</td></tr>
* <tr><td>NAM</td><td>Proper name</td></tr>
* <tr><td>NON</td><td>None</td></tr>
* <tr><td>TRD</td><td>Trade name</td></tr>
* </table></blockquote>
*
* <p>Whether a term is the preferred term for a concept is
* indicated on the term using the method {@link #isConceptPreferred()}.
* For records, whether a term is preferred is indicated
* using {@link #isRecordPreferred()}.
*
* @author Bob Carpenter
* @version 1.3
* @since LingMed1.3
*/
public class MeshTerm {
private final MeshNameUi mNameUi;
private final MeshDate mDateCreated;
private final String mAbbreviation;
private final String mSortVersion;
private final String mEntryVersion;
private final List<String> mThesaurusIdList;
private final boolean mIsPreferred;
private final boolean mIsPermuted;
private final String mLexicalTag;
private final boolean mPrintFlag;
private final boolean mIsRecordPreferred;
MeshTerm(String referenceUi,
String referenceString,
MeshDate dateCreated,
String abbreviation,
String sortVersion,
String entryVersion,
List<String> thesaurusIdList,
boolean isConceptPreferred,
boolean isPermuted,
String lexicalTag,
boolean printFlag,
boolean isRecordPreferred) {
mNameUi = new MeshNameUi(referenceString,referenceUi);
mDateCreated = dateCreated;
mAbbreviation = abbreviation.length() == 0 ? null : abbreviation;
mSortVersion = sortVersion.length() == 0 ? null : sortVersion;
mEntryVersion = entryVersion.length() == 0 ? null : entryVersion;
mThesaurusIdList = thesaurusIdList;
mIsPreferred = isConceptPreferred;
mIsPermuted = isPermuted;
mLexicalTag = lexicalTag;
mPrintFlag = printFlag;
mIsRecordPreferred = isRecordPreferred;
}
/**
* Returns the official name and unique identifier (UI) for
* this term.
*
* @return Name and UI for this term.
*/
public MeshNameUi nameUi() {
return mNameUi;
}
/**
* Returns the date when the term was first entered in to the MeSH
* data entry system.
*
* @return The date this term was created.
*/
public MeshDate dateCreated() {
return mDateCreated;
}
/**
* Returns a two-letter abbreviation for this term if it is a
* qualifier or {@code null} if there is no abbreviation.
*
* @return Abbreviation for this term if it is a qualifier.
*/
public String abbreviation() {
return mAbbreviation;
}
/**
* Returns a rewritten version of this term that is used
* for alpha-numeric sorting of terms, or {@code null} if
* there is no sort version.
*
* @return Version of term for sorting.
*/
public String sortVersion() {
return mSortVersion;
}
/**
* An all uppercase custom short form of this term used for
* indexing and searching at NLM, or {@code null} if there
* is no entry version.
*
* @return Entry version for this term.
*/
public String entryVersion() {
return mEntryVersion;
}
/**
* Returns a list of free text names and years of thesauri
* in which this term occurs.
*
* @return List of thesaurus names and years.
*/
public List<String> thesaurusIdList() {
return Collections.unmodifiableList(mThesaurusIdList);
}
/**
* Returns {@code true} if this is the preferred term for
* its concept.
*
* @return {@code true} if this is the preferred term for its
* concept.
*/
public boolean isConceptPreferred() {
return mIsPreferred;
}
/**
* Returns {@code true} if the term is created automatically
* in the MeSH editing application as a variant of another term in
* the record in which it appears.
*
* @return {@code true} if the term is a variant of another term.
*/
public boolean isPermuted() {
return mIsPermuted;
}
/**
* Returns the lexical tag for the type of this term. See the
* class documentatino above for possible values.
*
* @return Lexical tag for the type of this term.
*/
public String lexicalTag() {
return mLexicalTag;
}
/**
* Return {@code true} if this term appears in the printed
* version of MeSH.
*
* @return {@code true} if this term appears in the printed
* version of MeSH.
*/
public boolean printFlag() {
return mPrintFlag;
}
/**
* Returns {@code true} if this term is the preferred term for the
* record in which it appears. Note that this method is context
* sensitive and not a property of the term per se.
*
* @return {@code true} if this term is the preferred term
* for the record in which it appears.
*/
public boolean isRecordPreferred() {
return mIsRecordPreferred;
}
/**
* Returns a complete string-based representation of this term.
* All of the information included in the string is available
* programatically from the other methods in this class.
*
* @return String representation of this term.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Name/UI=" + mNameUi.toString());
sb.append("\n Concept Preferred=" + isConceptPreferred());
sb.append("\n Is Permuted=" + isPermuted());
sb.append("\n Lexical Tag=" + lexicalTag());
sb.append("\n Print Flag=" + printFlag());
sb.append("\n Record Preferred=" + isRecordPreferred());
sb.append("\n Date Created=" + dateCreated());
sb.append("\n Abbreviation=" + abbreviation());
sb.append("\n Sort Version=" + sortVersion());
sb.append("\n Entry Version=" + entryVersion());
List<String> thesaurusIdList = thesaurusIdList();
for (int i = 0; i < thesaurusIdList.size(); ++i)
sb.append("\n Thesaurus ID[" + i + "]="
+ thesaurusIdList.get(i));
return sb.toString();
}
static class Handler extends BaseHandler<MeshTerm> {
final TextAccumulatorHandler mUiHandler;
final TextAccumulatorHandler mReferenceStringHandler;
final MeshDate.Handler mDateHandler;
final TextAccumulatorHandler mAbbreviationHandler;
final TextAccumulatorHandler mSortVersionHandler;
final TextAccumulatorHandler mEntryVersionHandler;
final Mesh.ListHandler mThesaurusIdListHandler;
boolean mIsPreferred;
boolean mIsPermuted;
String mLexicalTag;
boolean mPrintFlag;
boolean mRecordPreferred;
public Handler(DelegatingHandler parent) {
super(parent);
mUiHandler = new TextAccumulatorHandler();
setDelegate(MeshParser.TERM_UI_ELEMENT,
mUiHandler);
mReferenceStringHandler = new TextAccumulatorHandler();
setDelegate(MeshParser.STRING_ELEMENT,
mReferenceStringHandler);
mDateHandler = new MeshDate.Handler(parent);
setDelegate(MeshParser.DATE_CREATED_ELEMENT,
mDateHandler);
mAbbreviationHandler = new TextAccumulatorHandler();
setDelegate(MeshParser.ABBREVIATION_ELEMENT,
mAbbreviationHandler);
mSortVersionHandler = new TextAccumulatorHandler();
setDelegate(MeshParser.SORT_VERSION_ELEMENT,
mSortVersionHandler);
mEntryVersionHandler = new TextAccumulatorHandler();
setDelegate(MeshParser.ENTRY_VERSION_ELEMENT,
mEntryVersionHandler);
mThesaurusIdListHandler
= new Mesh.ListHandler(parent,
MeshParser.THESAURUS_ID_ELEMENT);
setDelegate(MeshParser.THESAURUS_ID_LIST_ELEMENT,
mThesaurusIdListHandler);
}
@Override
public void startElement(String url, String local, String qName,
Attributes atts) throws SAXException {
super.startElement(url,local,qName,atts);
if (!MeshParser.TERM_ELEMENT.equals(qName)) return;
mIsPreferred
= "Y".equals(atts.getValue(MeshParser.CONCEPT_PREFERRED_TERM_YN_ATT));
mIsPermuted = "Y".equals(atts.getValue(MeshParser.IS_PERMUTED_TERM_YN_ATT));
mLexicalTag = atts.getValue(MeshParser.LEXICAL_TAG_ATT);
mPrintFlag = "Y".equals(atts.getValue(MeshParser.PRINT_FLAG_YN_ATT));
mRecordPreferred = "Y".equals(atts.getValue(MeshParser.RECORD_PREFERRED_TERM_YN_ATT));
}
@Override
public void reset() {
mUiHandler.reset();
mReferenceStringHandler.reset();
mDateHandler.reset();
mAbbreviationHandler.reset();
mSortVersionHandler.reset();
mEntryVersionHandler.reset();
mThesaurusIdListHandler.reset();
}
public MeshTerm getObject() {
return new MeshTerm(mUiHandler.getText().trim(),
mReferenceStringHandler.getText().trim(),
mDateHandler.getObject(),
mAbbreviationHandler.getText().trim(),
mSortVersionHandler.getText().trim(),
mEntryVersionHandler.getText().trim(),
mThesaurusIdListHandler.getList(),
mIsPreferred,
mIsPermuted,
mLexicalTag,
mPrintFlag,
mRecordPreferred);
}
}
static class ListHandler extends BaseListHandler<MeshTerm> {
public ListHandler(DelegatingHandler parent) {
super(parent,
new Handler(parent),
MeshParser.TERM_ELEMENT);
}
}
}
|
[
"mitzi@d9cdb42f-ec5f-0410-a886-e39e85a9bf9c"
] |
mitzi@d9cdb42f-ec5f-0410-a886-e39e85a9bf9c
|
1c264a8b656a8e5e8ae38d6dd4e4047cfd57d56c
|
f464830cf9c9e750f56331c778d18c518a1733ce
|
/src/leetCode/_79_单词搜索/test.java
|
b3b64a5eb5065219cde2876f807c82bc9db528b4
|
[] |
no_license
|
scanf-liu/untitled
|
59b21d5af10a0a2f5fc7ebea31e06b8c69933894
|
925dab892ec7d65d38a2913d923d2f5ff32c234e
|
refs/heads/master
| 2023-05-08T14:25:45.304357 | 2021-05-31T09:24:25 | 2021-05-31T09:24:25 | 328,845,043 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,470 |
java
|
package leetCode._79_单词搜索;
/*给定一个二维网格和一个单词,找出该单词是否存在于网格中。
单词必须按照字母顺序,通过相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格。同一个单元格内的字母不允许被重复使用。
示例:
board =
[
['A','B','C','E'],
['S','F','C','S'],
['A','D','E','E']
]
给定 word = "ABCCED", 返回 true
给定 word = "SEE", 返回 true
给定 word = "ABCB", 返回 false
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/word-search
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。*/
public class test {
public static void main(String[] args) {
char[][] board = {{'a', 'b', 'a', 'b'}, {'a', 'd', 'a', 'b'}, {'a', 'b', 'a', 'b'}};
System.out.println(Solution.exist(board, "abda"));
}
}
class Solution {
public static boolean exist(char[][] board, String word) {
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board[0].length; j++) {
if (board[i][j] == word.charAt(0)) {
if (dfs(board, word.toCharArray(), i, j, 0) == true) return true;
}
}
}
return false;
}
static boolean dfs(char[][] board, char[] word, int i, int j, int index) {
//边界的判断,如果越界直接返回false。index表示的是查找到字符串word的第几个字符,
//如果这个字符不等于board[i][j],说明验证这个坐标路径是走不通的,直接返回false
if (i >= board.length || i < 0 || j >= board[0].length || j < 0 || board[i][j] != word[index])
return false;
//如果word的每个字符都查找完了,直接返回true
if (index == word.length - 1)
return true;
//把当前坐标的值保存下来,为了在最后复原
char tmp = board[i][j];
//然后修改当前坐标的值
board[i][j] = '.';
//走递归,沿着当前坐标的上下左右4个方向查找
boolean res = dfs(board, word, i + 1, j, index + 1) || dfs(board, word, i - 1, j, index + 1) ||
dfs(board, word, i, j + 1, index + 1) || dfs(board, word, i, j - 1, index + 1);
//递归之后再把当前的坐标复原
board[i][j] = tmp;
return res;
}
}
|
[
"[email protected]"
] | |
d2b0a9cf4fbda8c844f12cf85c225216ef89758a
|
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
|
/tags/2010-02-27/seasar2-2.4.41/seasar-benchmark/src/main/java/benchmark/wire/Bean00250B.java
|
66716e797d6dd8bfe95284ec33a84cbf4ef6aea5
|
[] |
no_license
|
svn2github/s2container
|
54ca27cf0c1200a93e1cb88884eb8226a9be677d
|
625adc6c4e1396654a7297d00ec206c077a78696
|
refs/heads/master
| 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 59 |
java
|
package benchmark.wire;
public interface Bean00250B {
}
|
[
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] |
koichik@319488c0-e101-0410-93bc-b5e51f62721a
|
6d204eab469aa79a34b19c7c9ffcabefebb4a341
|
a25933be8c74246b316470137328bffecbc88703
|
/data/src/main/java/com/utree/eightysix/data/Friend.java
|
fcefbe6703981c32c5ff9f1e2cb450fe6926569c
|
[] |
no_license
|
ccl1115/EightySix
|
67c036f24343fbca15bc2467296d57b53416e2db
|
b1a771f369cb9a300f2c23e1319e2103de75aae0
|
refs/heads/master
| 2020-12-11T03:55:49.630651 | 2015-06-23T08:23:27 | 2015-06-23T08:23:27 | 24,128,245 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 683 |
java
|
/*
* Copyright (c) 2015. All rights reserved by utree.cn
*/
package com.utree.eightysix.data;
import com.google.gson.annotations.SerializedName;
/**
*/
public class Friend extends BaseUser {
@SerializedName("name")
public String name;
@SerializedName("level")
public int level;
@SerializedName("levelIcon")
public String levelIcon;
@SerializedName("signature")
public String signature;
@SerializedName("initial")
public String initial;
@SerializedName("relation")
public String relation;
@SerializedName("type")
public String type;
@SerializedName("source")
public String source;
@SerializedName("isFriend")
public int isFriend;
}
|
[
"[email protected]"
] | |
ea6f88bfba69ebf2bfe121f00a2c4cbed42d9ef7
|
f247e2906ff0efa762e7662ff4c5c671dc88d385
|
/bolg/src/main/java/com/ishy/blog/service/typeService/TypeServiceImpl.java
|
f49bd11a1e5b95d461bfca63d13913018894a6dd
|
[] |
no_license
|
HongChenGG/blog
|
2a8b095a9934d7cae102b0b9bef51f0d0501fbc3
|
241baa4fd0c780f03cffceb68cd9be1ee0b9e4b3
|
refs/heads/master
| 2022-07-19T07:53:41.745593 | 2020-05-20T10:56:17 | 2020-05-20T10:56:17 | 265,538,520 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,826 |
java
|
package com.ishy.blog.service.typeService;
import com.ishy.blog.mapper.TTypeMapper;
import com.ishy.blog.po.TBlog;
import com.ishy.blog.po.TType;
import org.apache.ibatis.javassist.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author 红尘
* @Date 2020/5/15 19:39
*/
@Service
public class TypeServiceImpl implements TypeService {
@Autowired
TTypeMapper typedao;
@Transactional(rollbackFor = {Exception.class})
@Override
public int saveType(TType type) {
return typedao.insert(type);
}
@Transactional(rollbackFor = {Exception.class})
@Override
public TType getType(Long id) {
return typedao.selectByPrimaryKey(id);
}
@Transactional(rollbackFor = {Exception.class})
@Override
public List<TType> listType() {
return typedao.selectAll();
}
@Transactional(rollbackFor = {NotFoundException.class})
@Override
public void updateType(Long id, TType type) throws NotFoundException {
TType t = typedao.selectByPrimaryKey(id);
if(t == null){
throw new NotFoundException("不存在该类型");
}
typedao.updateByPrimaryKey(type);
}
@Transactional(rollbackFor = {Exception.class})
@Override
public void deleteType(Long id) {
typedao.deleteByPrimaryKey(id);
}
@Override
public TType findTypeByName(String name) {
return typedao.selectByName(name);
}
@Override
public List<TType> getTypeAndBolg() {
return typedao.selectTypeAndBlog();
}
@Override
public List<TBlog> listBolgType(Long id) {
return typedao.selectBolgType(id);
}
}
|
[
"[email protected]"
] | |
a2e8831605097291012fcdf0c52a49808ebcb8a9
|
b4df979f504d47aae94cbd6bdfbdcb1f436965cb
|
/app/src/main/java/com/example/chillpill_medication_tracker/ReminderDetails.java
|
49ad9bb16e3442f21c02552925c3273bc6d0e600
|
[] |
no_license
|
Dnozol/ChillPill_Medication_Tracker
|
adfff54cd2ef3f2ca9445ee544cbf968fbcee74c
|
07c9f8dbe5a748a4354738aab76b343442eb96a5
|
refs/heads/master
| 2021-04-18T01:53:16.924992 | 2020-03-28T18:41:47 | 2020-03-28T18:41:47 | 249,495,131 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,794 |
java
|
package com.example.chillpill_medication_tracker;
import android.content.Intent;
import android.os.Bundle;
import android.util.ArrayMap;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
public class ReminderDetails extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reminder_details);
Intent intent = getIntent();
String json = intent.getStringExtra("Reminder");
Gson gson = new Gson();
Type type = new TypeToken<ReminderItem>() {}.getType();
ReminderItem reminder;
reminder = gson.fromJson(json, type);
String title = intent.getStringExtra("ReminderTitle");
String time = reminder.getTime();
ArrayList<Medication> rx = reminder.getMedications();
ArrayList<String> adaptedRx = new ArrayList<>();
for(int i = 0; i < rx.size(); i++) {
Log.d("rx", rx.get(i).getName());
adaptedRx.add(rx.get(i).getName());
}
TextView tTitle = findViewById(R.id.reminder_details_title);
TextView tTime = findViewById(R.id.reminder_details_time);
ListView lv = findViewById(R.id.reminder_details_medication);
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, adaptedRx);
lv.setAdapter(adapter);
tTitle.setText(title);
tTime.setText(time);
}
}
|
[
"[email protected]"
] | |
036d7dd2dd85e03a4d42cd8d404d42c9631b4999
|
8d0cedae47e514cc842524a58f2b48e66ffdf390
|
/app/src/main/java/com/example/desent/desent/models/ScoreAdapter.java
|
5bfedb91fcbbcd6e01ba1f5a27556cab179d4377
|
[] |
no_license
|
Havfar/DesentAppV4
|
df68a90764cdd1b99fe5f371090d032dd474737f
|
c69d9aa5b5c0e270d89bbb3b878961ee2e6dbed7
|
refs/heads/master
| 2021-09-15T12:56:36.874630 | 2018-06-02T06:59:28 | 2018-06-02T06:59:28 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,638 |
java
|
package com.example.desent.desent.models;
import android.content.Context;
import android.content.res.Resources;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.desent.desent.R;
import java.util.List;
/**
* Created by ragnhildlarsen on 18.03.2018.
*/
public class ScoreAdapter extends RecyclerView.Adapter<ScoreAdapter.ScoreViewHolder> {
//this context will be used to inflate the layout
private Context context;
//storing all the friends in a list
private List<Score> scoreList;
public ScoreAdapter(Context context, List<Score> scoreList) {
this.context = context;
this.scoreList = scoreList;
}
@Override
public ScoreViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//inflating and returning our view holder
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.layout_leaderboard, null);
return new ScoreViewHolder(view);
}
@Override
public void onBindViewHolder(ScoreViewHolder holder, int position) {
int initialPosition = position + 3;
Score score = scoreList.get(position);
System.out.println("Position onbindviewholder: " + initialPosition);
//binding the data with the viewholder views
holder.tvPlaceOnLeaderboard.setText(initialPosition + 1 + ".");
holder.tvName.setText(score.getName());
holder.tvNumCoins.setText(String.valueOf(score.getNum_coins()));
Resources resources = context.getResources();
holder.tvAvgCf.setText(String.valueOf(score.getAvg_cf()) + " " + resources.getString(R.string.carbon_footprint_unit));
holder.image.setImageDrawable(context.getResources().getDrawable(score.getImage()));
}
@Override
public int getItemCount() {
return scoreList.size();
}
public class ScoreViewHolder extends RecyclerView.ViewHolder {
TextView tvName, tvNumCoins, tvAvgCf;
ImageView image;
TextView tvPlaceOnLeaderboard;
public ScoreViewHolder(View itemView) {
super(itemView);
tvName = itemView.findViewById(R.id.textViewName);
tvNumCoins = itemView.findViewById(R.id.textViewNumCoins);
tvAvgCf = itemView.findViewById(R.id.textViewAvgCf);
image = itemView.findViewById(R.id.imageView);
tvPlaceOnLeaderboard = itemView.findViewById(R.id.tvPlaceOnLeaderboard);
}
}
}
|
[
"[email protected]"
] | |
45a74ce58512d739751f19035f878479ad72e6b0
|
2149e5291d927251f1d74dcd58416a4e600ec3c6
|
/back_end_oficina/src/main/java/com/example/oficina/models/Estoque.java
|
b94be295baf62a89b07ac36225d468ce13804e26
|
[] |
no_license
|
GabrielRodrigues1215/Oficina
|
f37ee808eec192ebfe178f5ac3b70d085ed07e40
|
986f7dccaa987d74396577f14d411d35241b1ee1
|
refs/heads/main
| 2023-05-05T10:38:13.347608 | 2021-05-19T13:18:11 | 2021-05-19T13:18:11 | 368,870,832 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 863 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.oficina.models;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.OneToMany;
/**
*
* @author Cast
*/
public class Estoque implements Serializable{
@OneToMany(mappedBy = "client", cascade = CascadeType.ALL)
private List<Piece> piece;
public Estoque() {
//default
}
public Estoque(List<Piece> piece) {
this.piece = piece;
}
public List<Piece> getPiece() {
return piece;
}
public void setPiece(List<Piece> piece) {
this.piece = piece;
}
}
|
[
"[email protected]"
] | |
28322619e238aa3b53776fc4084d2dc22de03b6e
|
50d7856ef54d8ef67b9331cfa65d36bba421ac73
|
/android/app/src/main/java/com/peterdemo/MainApplication.java
|
3ba6a5bdc4ce6d3a595b9f0fe1c36ef9f8bcfe4e
|
[] |
no_license
|
AhmedAliElDiasty/PeterDemo
|
462bf12619c26c4ed7c13af1e7e3efe974ad3316
|
7d9b6842b70f5fa45454991c69ed0fef19376921
|
refs/heads/master
| 2023-03-08T08:35:00.393849 | 2021-02-24T16:53:25 | 2021-02-24T16:53:25 | 341,969,850 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,620 |
java
|
package com.peterdemo;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.reactnativenavigation.NavigationApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends NavigationApplication {
private final ReactNativeHost mReactNativeHost =
new NavigationReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.peterdemo.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
b0cf639d8833d0168e98361ebc10dc9af454b6e7
|
d3a99f17cd0a0f1ef314dbc005c37d629ff2bcd6
|
/src/main/java/com/example/demo/common/utils/OrderIdUtil.java
|
54d0ce14a8152586c929edc0f14b260108019821
|
[] |
no_license
|
Immortal-svg/springboot_pay_demo
|
5404130629af536efac8271401ac7cb7c656f360
|
6c12c857bc376b5a6b9956bce61af9bd130bbe02
|
refs/heads/master
| 2023-01-11T20:00:20.953286 | 2020-11-05T04:08:43 | 2020-11-05T04:08:43 | 310,186,436 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,004 |
java
|
package com.example.demo.common.utils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
public class OrderIdUtil {
public static String getOrderNo() {
String strDate = String.valueOf(System.currentTimeMillis());
//为了防止高并发重复,再获取3个随机数
String random = getRandom620(3);
//最后得到16位订单编号。
String orderNo = strDate + random;
return orderNo;
}
/**
* 获取6-10 的随机位数数字
* @param length 想要生成的长度
* @return result
*/
public static String getRandom620(Integer length) {
String result = "";
Random rand = new Random();
int n = 20;
if (null != length && length > 0) {
n = length;
}
int randInt = 0;
for (int i = 0; i < n; i++) {
randInt = rand.nextInt(10);
result += randInt;
}
return result;
}
}
|
[
"[email protected]"
] | |
d8efa134a708b5e4757e7d80ab8c2ec40d6a0b3f
|
3483f0bff4e09e7f93941ad4767a840a0f64550e
|
/src/main/java/io/swagger/model/Extrato.java
|
8400fe0e44dbf4a57801094ca06cde096b8ed8ba
|
[] |
no_license
|
GuilhermeSilva010/Swagger-API-Java
|
f5a3b4b089e47329b6e795746735e40d378b46cf
|
eb635aee5f7726671af4a8df24cd281e51273787
|
refs/heads/main
| 2023-02-23T20:45:21.581287 | 2021-01-26T20:19:41 | 2021-01-26T20:19:41 | 333,205,371 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,232 |
java
|
package io.swagger.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.Transacao;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* Extrato
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2021-01-26T19:11:29.582Z")
public class Extrato {
@JsonProperty("transacoes")
@Valid
private List<Transacao> transacoes = null;
public Extrato transacoes(List<Transacao> transacoes) {
this.transacoes = transacoes;
return this;
}
public Extrato addTransacoesItem(Transacao transacoesItem) {
if (this.transacoes == null) {
this.transacoes = new ArrayList<Transacao>();
}
this.transacoes.add(transacoesItem);
return this;
}
/**
* Get transacoes
* @return transacoes
**/
@ApiModelProperty(value = "")
@Valid
public List<Transacao> getTransacoes() {
return transacoes;
}
public void setTransacoes(List<Transacao> transacoes) {
this.transacoes = transacoes;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Extrato extrato = (Extrato) o;
return Objects.equals(this.transacoes, extrato.transacoes);
}
@Override
public int hashCode() {
return Objects.hash(transacoes);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Extrato {\n");
sb.append(" transacoes: ").append(toIndentedString(transacoes)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"[email protected]"
] | |
f32cbceb7c6de9c78be9605f3b3c9055b838bc66
|
7e5462f5a1c32d889b584b3f673a2c2494e3d19f
|
/netty4-demos/src/main/java/com/haoning/netty/demo/simplechat/SimpleChatClient.java
|
493f1b38fc3833fb269e6da53230f1bb08c92d5e
|
[] |
no_license
|
killinux/netty-demo
|
b7de92fb0b7c81a59892f5dda904c70b85a4c636
|
6857fac0304b5fc134ee28187498b42614661d3d
|
refs/heads/master
| 2021-06-26T17:14:34.002043 | 2017-09-16T09:12:44 | 2017-09-16T09:12:44 | 103,739,849 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,461 |
java
|
package com.haoning.netty.demo.simplechat;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
* 简单聊天服务器-客户端
*
* @author haoning.com
* @date 2015-2-26
*/
public class SimpleChatClient {
public static void main(String[] args) throws Exception{
new SimpleChatClient("localhost", 8080).run();
}
private final String host;
private final int port;
public SimpleChatClient(String host, int port){
this.host = host;
this.port = port;
}
public void run() throws Exception{
EventLoopGroup group = new NioEventLoopGroup();
try {
Bootstrap bootstrap = new Bootstrap()
.group(group)
.channel(NioSocketChannel.class)
.handler(new SimpleChatClientInitializer());
Channel channel = bootstrap.connect(host, port).sync().channel();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while(true){
channel.writeAndFlush(in.readLine() + "\r\n");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
group.shutdownGracefully();
}
}
}
|
[
"[email protected]"
] | |
dbaf758ec57d0b97a0fd9a84ac6b66a414df9f97
|
95c569dd86f8ee2542c297ff2efb33d41227629f
|
/Notificaciones.Services/src/main/java/com/ideea/api/notificaciones/model/MensajeDTO.java
|
3a64d5cf77d5affa392181c9001d98c4d1866fed
|
[] |
no_license
|
jtrujilloideea/NotificacionesServices
|
58024da857ef1fdee8acbdf3997a26e374f4d90d
|
06b1772ff28ed7d905876cf5dc251d69d0317fc8
|
refs/heads/master
| 2022-02-20T09:46:12.805378 | 2020-01-13T20:59:08 | 2020-01-13T20:59:08 | 233,689,435 | 0 | 0 | null | 2022-02-10T03:42:06 | 2020-01-13T20:42:28 |
Java
|
UTF-8
|
Java
| false | false | 568 |
java
|
package com.ideea.api.notificaciones.model;
public class MensajeDTO {
private String asunto;
private String mensajeHtml;
public MensajeDTO() {
super();
}
public MensajeDTO(String asunto, String mensajeHtml) {
super();
this.asunto = asunto;
this.mensajeHtml = mensajeHtml;
}
public String getAsunto() {
return asunto;
}
public void setAsunto(String asunto) {
this.asunto = asunto;
}
public String getMensajeHtml() {
return mensajeHtml;
}
public void setMensajeHtml(String mensajeHtml) {
this.mensajeHtml = mensajeHtml;
}
}
|
[
"[email protected]"
] | |
b9626a47ec9c2c1140b45daea0b47efd24529afb
|
be967b03bed92b4db99eb1ed934617194a064ecc
|
/src/main/java/com/korbiak/challenge/security/jwt/JwtTokenFilter.java
|
7a81e79c52b0c6d3bc4df2b495749b997f834a9e
|
[] |
no_license
|
Korbiak/code-challenge
|
b44be28597fcf53f2f0898fed22394cf6cebd6cc
|
12b5c2a96e2f4bdf4373a508a690dd21ba83c4ee
|
refs/heads/master
| 2022-12-03T23:59:06.494458 | 2020-08-23T17:27:12 | 2020-08-23T17:27:12 | 289,265,050 | 0 | 0 | null | 2020-08-23T17:00:27 | 2020-08-21T12:31:54 | null |
UTF-8
|
Java
| false | false | 1,391 |
java
|
package com.korbiak.challenge.security.jwt;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@EqualsAndHashCode(callSuper = true)
@Data
@Slf4j
public class JwtTokenFilter extends GenericFilterBean {
private final JwtTokenProvider jwtTokenProvider;
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain)
throws IOException, ServletException {
log.info("Starting filter to valid token");
String token = jwtTokenProvider.resolveToken((HttpServletRequest) req);
if (token != null && jwtTokenProvider.validateToken(token)) {
Authentication auth = jwtTokenProvider.getAuthentication(token);
if (auth != null) {
SecurityContextHolder.getContext().setAuthentication(auth);
} else {
log.warn("Authentication failed");
}
}
filterChain.doFilter(req, res);
}
}
|
[
"[email protected]"
] | |
7b199f9c3fbc6385de63fc5faa95b3e0dd9fcb9c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/19/19_512bc3381b96c08d2daecb4ce24af28d1374f174/FileFunction/19_512bc3381b96c08d2daecb4ce24af28d1374f174_FileFunction_t.java
|
79168249b499089da4a92aa8695c672959003db7
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null |
UTF-8
|
Java
| false | false | 1,631 |
java
|
package org.smoothbuild.builtin.file;
import static org.smoothbuild.builtin.file.PathArgValidator.validatedPath;
import org.smoothbuild.builtin.file.err.NoSuchPathError;
import org.smoothbuild.builtin.file.err.PathIsNotAFileError;
import org.smoothbuild.fs.base.FileSystem;
import org.smoothbuild.plugin.api.File;
import org.smoothbuild.plugin.api.Path;
import org.smoothbuild.plugin.api.Required;
import org.smoothbuild.plugin.api.SmoothFunction;
import org.smoothbuild.plugin.internal.SandboxImpl;
import org.smoothbuild.plugin.internal.StoredFile;
public class FileFunction {
public interface Parameters {
@Required
public String path();
}
@SmoothFunction("file")
public static File execute(SandboxImpl sandbox, Parameters params) {
return new Worker(sandbox, params).execute();
}
private static class Worker {
private final SandboxImpl sandbox;
private final Parameters params;
public Worker(SandboxImpl sandbox, Parameters params) {
this.sandbox = sandbox;
this.params = params;
}
public File execute() {
return createFile(validatedPath("path", params.path()));
}
private File createFile(Path path) {
FileSystem fileSystem = sandbox.projectFileSystem();
if (!fileSystem.pathExists(path)) {
sandbox.report(new NoSuchPathError("path", path));
return null;
}
if (fileSystem.pathExistsAndIsDirectory(path)) {
sandbox.report(new PathIsNotAFileError("path", path));
return null;
}
return new StoredFile(fileSystem, path);
}
}
}
|
[
"[email protected]"
] | |
44a4fc173324531509ae8cf26716fce4f3279531
|
589051bafa5f6fd8070bda4fbe2718fb72bb2288
|
/com.intel.llvm.ireditor/src-gen/com/intel/llvm/ireditor/lLVM_IR/impl/AttributeGroupImpl.java
|
cfbbe503aee70d4ad51453cf2c0b3060a7cf9a00
|
[
"BSD-3-Clause"
] |
permissive
|
cherry-wb/llvm-ir-editor
|
be127a15a89bf67cab9e099f1391d9feddd719b2
|
2c29fb65ca3e7cca562c88db7232b5ee747b1407
|
refs/heads/master
| 2021-01-16T21:00:09.344975 | 2013-09-28T19:22:54 | 2013-09-28T19:22:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,081 |
java
|
/**
*/
package com.intel.llvm.ireditor.lLVM_IR.impl;
import com.intel.llvm.ireditor.lLVM_IR.AlignStack;
import com.intel.llvm.ireditor.lLVM_IR.AttributeGroup;
import com.intel.llvm.ireditor.lLVM_IR.FunctionAttribute;
import com.intel.llvm.ireditor.lLVM_IR.LLVM_IRPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Attribute Group</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AttributeGroupImpl#getName <em>Name</em>}</li>
* <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AttributeGroupImpl#getAttributes <em>Attributes</em>}</li>
* <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AttributeGroupImpl#getAlignstack <em>Alignstack</em>}</li>
* <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AttributeGroupImpl#getAlignstackValue <em>Alignstack Value</em>}</li>
* <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AttributeGroupImpl#getTargetSpecificAttributes <em>Target Specific Attributes</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AttributeGroupImpl extends TopLevelElementImpl implements AttributeGroup
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttributes()
* @generated
* @ordered
*/
protected EList<FunctionAttribute> attributes;
/**
* The cached value of the '{@link #getAlignstack() <em>Alignstack</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlignstack()
* @generated
* @ordered
*/
protected EList<AlignStack> alignstack;
/**
* The cached value of the '{@link #getAlignstackValue() <em>Alignstack Value</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlignstackValue()
* @generated
* @ordered
*/
protected EList<String> alignstackValue;
/**
* The cached value of the '{@link #getTargetSpecificAttributes() <em>Target Specific Attributes</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTargetSpecificAttributes()
* @generated
* @ordered
*/
protected EList<String> targetSpecificAttributes;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AttributeGroupImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return LLVM_IRPackage.Literals.ATTRIBUTE_GROUP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.ATTRIBUTE_GROUP__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<FunctionAttribute> getAttributes()
{
if (attributes == null)
{
attributes = new EObjectContainmentEList<FunctionAttribute>(FunctionAttribute.class, this, LLVM_IRPackage.ATTRIBUTE_GROUP__ATTRIBUTES);
}
return attributes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<AlignStack> getAlignstack()
{
if (alignstack == null)
{
alignstack = new EObjectContainmentEList<AlignStack>(AlignStack.class, this, LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK);
}
return alignstack;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<String> getAlignstackValue()
{
if (alignstackValue == null)
{
alignstackValue = new EDataTypeEList<String>(String.class, this, LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK_VALUE);
}
return alignstackValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<String> getTargetSpecificAttributes()
{
if (targetSpecificAttributes == null)
{
targetSpecificAttributes = new EDataTypeEList<String>(String.class, this, LLVM_IRPackage.ATTRIBUTE_GROUP__TARGET_SPECIFIC_ATTRIBUTES);
}
return targetSpecificAttributes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case LLVM_IRPackage.ATTRIBUTE_GROUP__ATTRIBUTES:
return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs);
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK:
return ((InternalEList<?>)getAlignstack()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case LLVM_IRPackage.ATTRIBUTE_GROUP__NAME:
return getName();
case LLVM_IRPackage.ATTRIBUTE_GROUP__ATTRIBUTES:
return getAttributes();
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK:
return getAlignstack();
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK_VALUE:
return getAlignstackValue();
case LLVM_IRPackage.ATTRIBUTE_GROUP__TARGET_SPECIFIC_ATTRIBUTES:
return getTargetSpecificAttributes();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case LLVM_IRPackage.ATTRIBUTE_GROUP__NAME:
setName((String)newValue);
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__ATTRIBUTES:
getAttributes().clear();
getAttributes().addAll((Collection<? extends FunctionAttribute>)newValue);
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK:
getAlignstack().clear();
getAlignstack().addAll((Collection<? extends AlignStack>)newValue);
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK_VALUE:
getAlignstackValue().clear();
getAlignstackValue().addAll((Collection<? extends String>)newValue);
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__TARGET_SPECIFIC_ATTRIBUTES:
getTargetSpecificAttributes().clear();
getTargetSpecificAttributes().addAll((Collection<? extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case LLVM_IRPackage.ATTRIBUTE_GROUP__NAME:
setName(NAME_EDEFAULT);
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__ATTRIBUTES:
getAttributes().clear();
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK:
getAlignstack().clear();
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK_VALUE:
getAlignstackValue().clear();
return;
case LLVM_IRPackage.ATTRIBUTE_GROUP__TARGET_SPECIFIC_ATTRIBUTES:
getTargetSpecificAttributes().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case LLVM_IRPackage.ATTRIBUTE_GROUP__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case LLVM_IRPackage.ATTRIBUTE_GROUP__ATTRIBUTES:
return attributes != null && !attributes.isEmpty();
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK:
return alignstack != null && !alignstack.isEmpty();
case LLVM_IRPackage.ATTRIBUTE_GROUP__ALIGNSTACK_VALUE:
return alignstackValue != null && !alignstackValue.isEmpty();
case LLVM_IRPackage.ATTRIBUTE_GROUP__TARGET_SPECIFIC_ATTRIBUTES:
return targetSpecificAttributes != null && !targetSpecificAttributes.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", alignstackValue: ");
result.append(alignstackValue);
result.append(", targetSpecificAttributes: ");
result.append(targetSpecificAttributes);
result.append(')');
return result.toString();
}
} //AttributeGroupImpl
|
[
"[email protected]"
] | |
7e4fb6a56b5325eb4e7bb10837a3900bebecd19d
|
ad2212f670918355f680dcf9c5c90940c329770a
|
/app/src/test/java/com/project/sakib/task/ExampleUnitTest.java
|
3369f708e66f03e97c33a896f113fae80020d858
|
[] |
no_license
|
nazmus20000/Map-and-Other
|
554419fb06732885ea7aaa85be151eb359f9087f
|
812a549c9c4e5e12dcadfdc2522b1706093a3705
|
refs/heads/master
| 2020-12-24T21:36:44.206989 | 2016-05-17T13:51:35 | 2016-05-17T13:51:35 | 59,026,421 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 315 |
java
|
package com.project.sakib.task;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
61e3fbaf0fe59e9b7ea7a03e641fe887b246460f
|
c0075eedcf90a5aba0686c08e985535b97afe4ab
|
/springboot-drools-ruleEngine/src/main/java/com/example/demo/services/MessageRuleExecutor.java
|
bedfcb5a221b60fcbb408c19a7e87945b463f7cb
|
[] |
no_license
|
amitvermaatpl/spring-boot-examples
|
91bbbc0bf725b7344e8177d0a391c720f14abc93
|
0590f0048d2a15091c0be3832b51ede3946f085a
|
refs/heads/master
| 2020-04-17T11:14:54.983729 | 2019-04-30T01:21:42 | 2019-04-30T01:21:42 | 166,533,789 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 286 |
java
|
package com.example.demo.services;
import org.kie.api.runtime.KieContainer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Created by radugrig on 04/06/2018.
*/
@Component
public class MessageRuleExecutor {
}
|
[
"[email protected]"
] | |
15b184cb0e9e36d5a72f1f75f2f3d78f79d8bfa8
|
7a88dc2f17a044d7f97fe429e19ccf3d0be42b31
|
/src/main/java/me/brioschi/acompanytest/gameengine/io/ScreenManager.java
|
b47691f3b6f72c024c42cdfb49958fa6b419117b
|
[] |
no_license
|
marcobrioschi/acompanytest
|
1068c4fda4ebedb097add15ba360bb1c73270808
|
b3e83cec31ccc767da6036f572fde020c44a6b1b
|
refs/heads/master
| 2020-05-27T04:50:57.278358 | 2019-06-02T22:56:17 | 2019-06-02T22:56:17 | 188,490,388 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,229 |
java
|
package me.brioschi.acompanytest.gameengine.io;
import me.brioschi.acompanytest.gameengine.command.CommandResponseDTO;
import me.brioschi.acompanytest.gameengine.command.CommandResultMessage;
import me.brioschi.acompanytest.domain.character.Player;
import me.brioschi.acompanytest.domain.monster.Monster;
import me.brioschi.acompanytest.domain.monster.MonsterId;
import me.brioschi.acompanytest.persistence.MonsterRepository;
import me.brioschi.acompanytest.domain.world.WorldItem;
import me.brioschi.acompanytest.domain.world.WorldViewDTO;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.List;
import java.util.Scanner;
public class ScreenManager {
private final Scanner inputScanner;
private final PrintStream outputStream;
public ScreenManager(InputStream inputStream, PrintStream outputStream) {
this.inputScanner = new Scanner(inputStream);
this.outputStream = outputStream;
}
public String nextLine() {
return inputScanner.nextLine();
}
public void prompt(Player currentPlayer) {
if (currentPlayer != null) {
outputStream.println(" [" + currentPlayer.getCurrentExperience().getExperience() + "] " + currentPlayer.getName() + " > ");
} else {
outputStream.println(" > ");
}
}
public void printCommandResult(Player currentPlayer, MonsterRepository monsterRepository, CommandResponseDTO commandResponse) {
if (commandResponse.getVisibleWorld() != null) {
WorldViewDTO visibleWorld = commandResponse.getVisibleWorld();
printVisibleWorld(currentPlayer, monsterRepository, visibleWorld);
}
if (commandResponse.getCommandResultMessage() != null) {
printResultMessage(commandResponse.getCommandResultMessage());
}
}
public void printInvalidCommand(String cmdLine) {
outputStream.println("This isn't a valid command: " + cmdLine);
}
private void printVisibleWorld(Player currentPlayer, MonsterRepository monsterRepository, WorldViewDTO visibleWorld) {
String currentItemDescription = null;
List<MonsterId> currentItemMonsterIdList = null;
for (int y = visibleWorld.getYDim(); y >= 0; --y) {
outputStream.print(" ");
for (int x = 0; x <= visibleWorld.getXDim(); ++x) {
if (visibleWorld.getWorldItem(x, y) != null) {
WorldItem currentItem = visibleWorld.getWorldItem(x, y);
if (currentItem.getPosition().equals(currentPlayer.getCurrentPosition())) {
currentItemDescription = currentItem.getDescription();
currentItemMonsterIdList = currentItem.getMonsterIds();
outputStream.print("P");
} else if ( currentItem.getMonsterIds().size() > 0) {
outputStream.print("@");
} else if (currentItem.getWorldItemType() == WorldItem.WorldItemType.STREET) {
outputStream.print("=");
} else if (currentItem.getWorldItemType() == WorldItem.WorldItemType.FLOOR) {
outputStream.print("#");
}
} else {
outputStream.print(" ");
}
}
outputStream.println();
}
outputStream.println();
if ( (currentItemDescription != null) && (!"".equals(currentItemDescription)) ) {
outputStream.println(currentItemDescription);
outputStream.println();
}
if ( currentItemMonsterIdList != null) {
for (MonsterId monsterId : currentItemMonsterIdList) {
Monster monster = monsterRepository.load(monsterId);
outputStream.println( " @ [" + monster.getExperience().getExperience() + "] " + monster.getName() + ": " + monster.getDescription());
}
outputStream.println();
}
}
private void printResultMessage(CommandResultMessage commandResultMessage) {
outputStream.println(" ... " + commandResultMessage.getDescription());
outputStream.println();
}
}
|
[
"[email protected]"
] | |
109e75778d3fdb12a921d0e37b0079fba4f3c355
|
dcb64d4a551470dc077b6502a2fe583e78275abc
|
/Fathom_com.brynk.fathom-dex2jar.src/android/support/v4/text/TextDirectionHeuristicCompat.java
|
d404360bfb07fd7caaccf203747da17bfc332fa5
|
[] |
no_license
|
lenjonemcse/Fathom-Drone-Android-App
|
d82799ee3743404dd5d7103152964a2f741b88d3
|
f3e3f0225680323fa9beb05c54c98377f38c1499
|
refs/heads/master
| 2022-01-13T02:10:31.014898 | 2019-07-10T19:42:02 | 2019-07-10T19:42:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 514 |
java
|
package android.support.v4.text;
public abstract interface TextDirectionHeuristicCompat
{
public abstract boolean isRtl(CharSequence paramCharSequence, int paramInt1, int paramInt2);
public abstract boolean isRtl(char[] paramArrayOfChar, int paramInt1, int paramInt2);
}
/* Location: C:\Users\c_jealom1\Documents\Scripts\Android\Fathom_com.brynk.fathom\Fathom_com.brynk.fathom-dex2jar.jar
* Qualified Name: android.support.v4.text.TextDirectionHeuristicCompat
* JD-Core Version: 0.6.0
*/
|
[
"[email protected]"
] | |
bbd72f45b9067b85e9092e1cce815038da9a8906
|
c40266a8274737918fc97ce03b0b3faae326e693
|
/src/main/java/com/kaushikam/jpa/entity/inheritance/mapped_super_class/BlogPost.java
|
39e656a1b0c6d26e82c0e57baa1630325bfffdc7
|
[
"MIT"
] |
permissive
|
kaushikam/jpa-tutorial
|
cb7ec4baf21196ae12061a8e028617623fb1d874
|
c7ad03bd6439cb5d640ec2cb52c5329608938577
|
refs/heads/master
| 2020-06-19T18:24:02.020388 | 2019-07-19T09:32:34 | 2019-07-19T09:32:34 | 196,820,502 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 658 |
java
|
package com.kaushikam.jpa.entity.inheritance.mapped_super_class;
import javax.persistence.Entity;
import java.net.URL;
@Entity
public class BlogPost extends Publication {
private URL url;
public BlogPost() {}
public BlogPost(String title, URL url) {
super(title);
this.url = url;
}
public URL getUrl() {
return url;
}
public void setUrl(URL url) {
this.url = url;
}
@Override
public String toString() {
return "BlogPost{" +
"id=" + getId() +
", title='" + getTitle() + '\'' +
", url=" + url +
'}';
}
}
|
[
"[email protected]"
] | |
3972ee2bbaeeb75fb5b42ad0760adb2be6e02d8a
|
c3ed2fda020b304c8f5c6d600e1a56491744e095
|
/src/interfaz/LineNumber.java
|
140efc28e4775cf0813eac4eba624eac170a5a17
|
[] |
no_license
|
diegoauyon/Ja-Decaf
|
4a81d2f856ce1944fbb4f7475e061e779f991366
|
6227e77ef10638325ea1f1498a48fbccb859c013
|
refs/heads/master
| 2021-01-01T16:30:46.217982 | 2011-11-21T23:25:36 | 2011-11-21T23:25:36 | 2,338,681 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,181 |
java
|
package interfaz;
import java.awt.*;
import javax.swing.*;
public class LineNumber extends JComponent
{
/**
*
*/
private static final long serialVersionUID = -6291188920752821727L;
//private final static Color DEFAULT_BACKGROUND = new Color(233, 232, 226);
//private final static Color DEFAULT_FOREGROUND = Color.black;
// private final static Font DEFAULT_FONT = new Font("monospaced", Font.PLAIN, 12);
// LineNumber height (abends when I use MAX_VALUE)
private final static int HEIGHT = Integer.MAX_VALUE - 1000000;
// Set right/left margin
private final static int MARGIN = 3;
// Line height of this LineNumber component
private int lineHeight;
// Line height of this LineNumber component
private int fontLineHeight;
//
private int currentRowWidth;
// Metrics of this LineNumber component
private FontMetrics fontMetrics;
/**
* Convenience constructor for Text Components
*/
public LineNumber(JComponent component)
{
if (component == null)
{
// setBackground( DEFAULT_BACKGROUND );
// setForeground( DEFAULT_FOREGROUND );
// setFont( DEFAULT_FONT );
}
else
{
// setBackground( DEFAULT_BACKGROUND );
setForeground( component.getForeground() );
setFont( component.getFont() );
}
// setPreferredSize( 9999 );
}
public void setPreferredSize(int row)
{
int width = fontMetrics.stringWidth( String.valueOf(row) );
if (currentRowWidth < width)
{
currentRowWidth = width;
setPreferredSize( new Dimension(2 * MARGIN + width, HEIGHT) );
}
}
public void setFont(Font font)
{
super.setFont(font);
fontMetrics = getFontMetrics( getFont() );
fontLineHeight = fontMetrics.getHeight();
}
/**
* The line height defaults to the line height of the font for this
* component. The line height can be overridden by setting it to a
* positive non-zero value.
*/
public int getLineHeight()
{
if (lineHeight == 0)
return fontLineHeight;
else
return lineHeight;
}
public void setLineHeight(int lineHeight)
{
if (lineHeight > 0)
this.lineHeight = lineHeight;
}
public int getStartOffset()
{
return 4;
}
public void paintComponent(Graphics g)
{
int lineHeight = getLineHeight();
int startOffset = getStartOffset();
Rectangle drawHere = g.getClipBounds();
// System.out.println( drawHere );
// Paint the background
g.setColor( getBackground() );
g.fillRect(drawHere.x, drawHere.y, drawHere.width, drawHere.height);
// Determine the number of lines to draw in the foreground.
g.setColor( getForeground() );
int startLineNumber = (drawHere.y / lineHeight) + 1;
int endLineNumber = startLineNumber + (drawHere.height / lineHeight);
int start = (drawHere.y / lineHeight) * lineHeight + lineHeight - startOffset;
// System.out.println( startLineNumber + " : " + endLineNumber + " : " + start );
for (int i = startLineNumber; i <= endLineNumber; i++)
{
String lineNumber = String.valueOf(i);
int width = fontMetrics.stringWidth( lineNumber );
g.drawString(lineNumber, MARGIN + currentRowWidth - width, start + startOffset);
start += lineHeight;
}
setPreferredSize( endLineNumber );
}
}
|
[
"[email protected]"
] | |
6a47029c3b109f009369a50be843e209fa4c5b1f
|
3660918a0888c5fb50d2c29b6f42b56db2ac0f1c
|
/src/test/java/com/acme/mytrader/strategy/TradingStrategyTest.java
|
1d7e8000a4db12e674f41e7d01489f9c340501e3
|
[] |
no_license
|
SaiPrasadManchikatla/stock_broker
|
3487716f95e13d242f2aedacf9a6770d9c49af7d
|
e56bb4fde053d213ade7a48b989da4691240e39d
|
refs/heads/master
| 2022-11-14T07:38:32.984657 | 2020-07-09T03:36:56 | 2020-07-09T03:36:56 | 278,253,155 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,238 |
java
|
package com.acme.mytrader.strategy;
import org.junit.Assert;
import org.junit.Test;
public class TradingStrategyTest {
@Test
public void testTradingStrategySell() {
TradingStrategy tradingStrategyMock = new TradingStrategy(20.0, 10.0, 10);
TradingStrategyDecisionEnum tradingStrategyDecisionEnum = tradingStrategyMock.getTradingStrategyDecisionOnPriceChange(22.0);
Assert.assertEquals(TradingStrategyDecisionEnum.SELL, tradingStrategyDecisionEnum);
}
@Test
public void testTradingStrategyBuy() {
TradingStrategy tradingStrategyMock = new TradingStrategy(20.0, 10.0, 10);
TradingStrategyDecisionEnum tradingStrategyDecisionEnum = tradingStrategyMock.getTradingStrategyDecisionOnPriceChange(5.0);
Assert.assertEquals(TradingStrategyDecisionEnum.BUY, tradingStrategyDecisionEnum);
}
@Test
public void testTradingStrategyDoNothing() {
TradingStrategy tradingStrategyMock = new TradingStrategy(20.0, 10.0, 10);
TradingStrategyDecisionEnum tradingStrategyDecisionEnum = tradingStrategyMock.getTradingStrategyDecisionOnPriceChange(15.0);
Assert.assertEquals(TradingStrategyDecisionEnum.DO_NOTHING, tradingStrategyDecisionEnum);
}
}
|
[
"[email protected]"
] | |
00ded8bc9a25c849ddc2b8d0dfa61cfe9812b1b6
|
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
|
/program_data/JavaProgramData/97/186.java
|
dff876f02ebf295c86f7755092e4bcf08393980a
|
[
"MIT"
] |
permissive
|
qiuchili/ggnn_graph_classification
|
c2090fefe11f8bf650e734442eb96996a54dc112
|
291ff02404555511b94a4f477c6974ebd62dcf44
|
refs/heads/master
| 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,450 |
java
|
package <missing>;
public class GlobalMembers
{
public static int Main()
{
int n;
int a;
int b;
int c;
int d;
int e;
int f;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
a = n / 100;
if ((n % 100) / 10 == 9)
{
b = 1;
c = 2;
d = 0;
}
else if ((n % 100) / 10 == 8)
{
b = 1;
c = 1;
d = 1;
}
else if ((n % 100) / 10 == 7)
{
b = 1;
c = 1;
d = 0;
}
else if ((n % 100) / 10 == 6)
{
b = 1;
c = 0;
d = 1;
}
else if ((n % 100) / 10 == 5)
{
b = 1;
c = 0;
d = 0;
}
else if ((n % 100) / 10 == 4)
{
b = 0;
c = 2;
d = 0;
}
else if ((n % 100) / 10 == 3)
{
b = 0;
c = 1;
d = 1;
}
else if ((n % 100) / 10 == 2)
{
b = 0;
c = 1;
d = 0;
}
else if ((n % 100) / 10 == 1)
{
b = 0;
c = 0;
d = 1;
}
else if ((n % 100) / 10 == 0)
{
b = 0;
c = 0;
d = 0;
}
if ((n % 10) == 9)
{
e = 1;
f = 4;
}
else if ((n % 10) == 8)
{
e = 1;
f = 3;
}
else if ((n % 10) == 7)
{
e = 1;
f = 2;
}
else if ((n % 10) == 6)
{
e = 1;
f = 1;
}
else if ((n % 10) == 5)
{
e = 1;
f = 0;
}
else if ((n % 10) == 4)
{
e = 0;
f = 4;
}
else if ((n % 10) == 3)
{
e = 0;
f = 3;
}
else if ((n % 10) == 2)
{
e = 0;
f = 2;
}
else if ((n % 10) == 1)
{
e = 0;
f = 1;
}
else if ((n % 10) == 0)
{
e = 0;
f = 0;
}
System.out.printf("%d\n%d\n%d\n%d\n%d\n%d\n",a,b,c,d,e,f);
return 0;
}
}
|
[
"[email protected]"
] | |
dfb2e77bb13ab544bbe229e773585cea7571f89e
|
ae2e12ae82b9b564889e1516b70f47ada0d99f4b
|
/src/com/example/backoff_tts/MainActivity.java
|
4b6aeed10d1bc3101f51af684b930b640d7a0abd
|
[] |
no_license
|
khyathiraghavi/TTS_Backoff_Silence_prediction
|
0001f656ed73754c61148057fddbc070d003e9b5
|
878bd33394c6d9b39826733bfe51690c1b9a36bb
|
refs/heads/master
| 2021-01-10T08:23:41.146023 | 2015-11-11T06:05:14 | 2015-11-11T06:05:14 | 45,963,066 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,139 |
java
|
package com.example.backoff_tts;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.os.Build;
import java.io.IOException;
import java.io.InputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class MainActivity extends ActionBarActivity {
EditText inputText;
Button execute;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new Fragment())
.commit();
}
inputText = (EditText) findViewById(R.id.input);
execute = (Button) findViewById(R.id.synth);
public void insert_substring(String a, String b, int position)
{
StringBuffer sb = new StringBuffer(a);
sb.insert(position,b);
//System.out.println(sb);
}
public int check2(String syl , int found){
char[] temp=syl.toCharArray();
int flag=0;
if(temp[syl.length()-1]== 'w' && found==0)
{
B: temp[syl.length()-1] = 'b';
found=check1(temp,found);
flag=1;
}
if(temp[syl.length()-1]=='b' && found==0)
{
temp[syl.length()-1]='m';
found=check1(temp,found);
}
if(temp[syl.length()-1]=='m' && found==0)
{
temp[syl.length()-1]='l';
found=check1(temp,found);
}
if(found==0)
{
temp[syl.length()-1]='w';
found=check1(temp,found);
if(found==0 && flag==0)
break B;
}
return found;
}
System.out.println("jks");
execute.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
String str = inputText.getText().toString();
int k=0;
AssetManager assetManager = getAssets();
InputStream input;
String phoneset;
String syllables;
int size;
phoneset = "ppp";
syllables = "sss";
try {
input = assetManager.open("Telugu_PhoneSet_Hts.txt");
size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
phoneset = new String(buffer);
//System.out.println(phoneset);
} catch (IOException e) {
e.printStackTrace();
}
try {
input = assetManager.open("syllables.txt");
size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
syllables = new String(buffer);
//System.out.println(syllables);
} catch (IOException e) {
e.printStackTrace();
}
//System.out.println(phoneset);
//System.out.println(syllables);
///////////////////////////////////////////////////
int BUFSIZE,i,count=0,pos=0, found=0, dec=0,flag,j,prev,l,epos_i=0,len,flag1,cluster;
int vow_i=0, sym_i=0, quant_i=0, phone_i=0,cnst_i=0;
int[] epos = new int[10];
short[] final1 = new short[1000];
String syl, syl_cpy, temp, input1; //input1=input
String[] phoneset1 = new String [1000];
String[] vow = new String [1000];
String[] sym = new String [1000];
String[] const1 = new String [1000];//const1=const
String[] temp4 = new String [1000];
String[] str1 = new String [1000]; //str1=str
String[] temp5 = new String [30];
String[] temp6 = new String [30];
String[] temp7 = new String [30];
String[] quantifier = new String [1000];
String st,phn,quant;
String temp1,temp2, temp3,v; //actually char
class queue {
public static int in;
public static int out;
String[] s = new String [1000];
public queue( int in, int out){
this.in = in;
this.out = out;
this.s = s;
}
}
queue.in=0;
queue.out=-1;
File lang_file = new File("phoneset.txt");
try {
//Scanner sc = new Scanner(lang_file);
Scanner sc = new Scanner(lang_file).useDelimiter("\t");
while (sc.hasNextLine()) {
phn=sc.next();
temp2=sc.next();
quant=sc.next();
temp3=sc.next();
if(quant.equals("VOW")){
vow=phn;
}
}
// int i = sc.nextInt();
System.out.println(i);
}
sc.close();
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
//////////////////////////////////////////////
/* String res = tts (str,syllables,phoneset);
System.out.println(res);
System.out.println("ijcklsd");*/
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
return rootView;
}
}
}
|
[
"[email protected]"
] | |
30c45797fa065ebc7477607e41b65cb96ba24d81
|
7ce58f6a5306cbb943daf7feb45b865e8a6217c6
|
/QueryDSL-Project/src/main/java/study/querydsl/repository/Member4Repository.java
|
513ff2d2fd7e8acd30e5e79e09e260bb8f7ac5ee
|
[] |
no_license
|
BAEKJungHo/querydsl-study
|
940aec5e531c3d7c5da7705857e42b0b812da6c8
|
ed47a269ea4b124adcb60e0f59104c9dcced8ab4
|
refs/heads/main
| 2023-05-12T09:35:16.810420 | 2021-06-03T11:18:38 | 2021-06-03T11:18:38 | 367,625,715 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,661 |
java
|
package study.querydsl.repository;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.support.PageableExecutionUtils;
import study.querydsl.dto.MemberSearchCondition;
import study.querydsl.entity.Member;
import study.querydsl.repository.support.Querydsl4RepositorySupport;
import static study.querydsl.entity.QMember.member;
import static study.querydsl.entity.QTeam.team;
import java.util.List;
import static org.apache.logging.log4j.util.Strings.isEmpty;
public class Member4Repository extends Querydsl4RepositorySupport {
public Member4Repository(Class<?> domainClass) {
super(Member.class);
}
public List<Member> basicSelect() {
return select(member)
.from(member)
.fetch();
}
public List<Member> basicSelectFrom() {
return selectFrom(member)
.fetch();
}
public Page<Member> searchPageByApplyPage(MemberSearchCondition condition, Pageable pageable) {
JPAQuery<Member> query = selectFrom(member)
.leftJoin(member.team, team)
.where(usernameEq(condition.getUsername()),
teamNameEq(condition.getTeamName()),
ageGoe(condition.getAgeGoe()),
ageLoe(condition.getAgeLoe()));
List<Member> content = getQuerydsl().applyPagination(pageable, query).fetch();
return PageableExecutionUtils.getPage(content, pageable, query::fetchCount);
}
// searchPageByApplyPage 와 완전히 똑같은 코드이다.
public Page<Member> applyPagination(MemberSearchCondition condition, Pageable pageable) {
return applyPagination(pageable, contentQuery -> contentQuery
.selectFrom(member)
.leftJoin(member.team, team)
.where(usernameEq(condition.getUsername()),
teamNameEq(condition.getTeamName()),
ageGoe(condition.getAgeGoe()),
ageLoe(condition.getAgeLoe())));
}
public Page<Member> applyPagination2(MemberSearchCondition condition, Pageable pageable) {
return applyPagination(pageable, contentQuery -> contentQuery
.selectFrom(member)
.leftJoin(member.team, team)
.where(usernameEq(condition.getUsername()),
teamNameEq(condition.getTeamName()),
ageGoe(condition.getAgeGoe()),
ageLoe(condition.getAgeLoe())),
countQuery -> countQuery
.selectFrom(member)
.leftJoin(member.team, team)
.where(usernameEq(condition.getUsername()),
teamNameEq(condition.getTeamName()),
ageGoe(condition.getAgeGoe()),
ageLoe(condition.getAgeLoe()))
);
}
private BooleanExpression usernameEq(String username) {
return isEmpty(username) ? null : member.username.eq(username);
}
private BooleanExpression teamNameEq(String teamName) {
return isEmpty(teamName) ? null : team.name.eq(teamName);
}
private BooleanExpression ageGoe(Integer ageGoe) {
return ageGoe == null ? null : member.age.goe(ageGoe);
}
private BooleanExpression ageLoe(Integer ageLoe) {
return ageLoe == null ? null : member.age.loe(ageLoe);
}
}
|
[
"[email protected]"
] | |
4830bbfffdd0f01ff28ca63a6dd256fba1f25413
|
266a41d910bb33bfe53cd762994a3a39df24bd51
|
/easyimageloader/src/main/java/com/ebaryice/easyimageloader/ImageResizer.java
|
f507dcbada95ab7c7c22105f6cdc780925dc1b68
|
[] |
no_license
|
TheSkyToRain/EasyImageLoader
|
ce6c15a29b0efb08cc6917cf8188b711dc01b3d1
|
650f27e57009e98a44eadfa2443268e346c39e54
|
refs/heads/master
| 2020-04-07T21:15:53.262440 | 2018-11-22T16:39:07 | 2018-11-22T16:39:07 | 158,720,131 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,322 |
java
|
package com.ebaryice.easyimageloader;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import java.io.FileDescriptor;
public class ImageResizer {
private static final String TAG = "ImageResizer";
public ImageResizer(){
}
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId,
int reqWidth, int reqHeight){
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(res,resId,options);
// 计算采样率
options.inSampleSize = calculateInSampleSize(options,reqWidth,reqHeight);
options.inJustDecodeBounds = false;
return BitmapFactory.decodeResource(res,resId,options);
}
public static Bitmap decodeSampledBitmapFromFileDescriptor(FileDescriptor fd,
int reqWidth, int reqHeight){
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFileDescriptor(fd, null, options);
// 计算采样率
options.inSampleSize = calculateInSampleSize(options,reqWidth,reqHeight);
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFileDescriptor(fd, null, options);
}
/**
* 计算采样率
* @param options BitmapFactory.Options
* @param reqWidth 要求宽度
* @param reqHeight 要求高度
* @return 采样率
*/
private static int calculateInSampleSize(BitmapFactory.Options options,
int reqWidth, int reqHeight) {
if (reqHeight == 0 || reqWidth == 0){
return 1;
}
final int width = options.outWidth;
final int height = options.outHeight;
int inSampleSize = 1;
if (width > reqWidth || height > reqHeight){
final int halfWidth = width / 2;
final int halfHeight = height / 2;
while ((halfWidth / inSampleSize) >= reqWidth && (halfHeight / inSampleSize) >= reqHeight){
inSampleSize *= 2;
}
}
return inSampleSize;
}
}
|
[
"[email protected]"
] | |
01e1aa174b573965fc6b030b2de1178c60797aab
|
94d2002690323ba9367ba26cd18a9827550b51c9
|
/app/src/main/java/com/banking2fa/mainactivity/data/LoginDataSource.java
|
3aa1b7ab30d4120ff95b2bfd47a82df76f1c6668
|
[] |
no_license
|
GregRansom/2FA
|
4d92c8cfdad07c247a288aa3d3a96a67e385c1c1
|
a3f230e135a7789e19b12e2ebecd0d4f41cdbf5f
|
refs/heads/master
| 2020-08-04T16:04:17.370968 | 2019-10-07T04:59:22 | 2019-10-07T04:59:22 | 212,188,889 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,311 |
java
|
package com.banking2fa.mainactivity.data;
import android.content.Context;
import android.content.Intent;
import com.banking2fa.mainactivity.FingerprintHandler;
import com.banking2fa.mainactivity.data.model.LoggedInUser;
import java.io.IOException;
/**
* Class that handles authentication w/ login credentials and retrieves user information.
*/
public class LoginDataSource {
private Context context;
public Result<LoggedInUser> login(String username, String password) {
try {
// TODO: handle loggedInUser authentication (this referes to database authentication)
LoggedInUser fakeUser =
new LoggedInUser(
java.util.UUID.randomUUID().toString(),
" Johnathan Tester");
return new Result.Success<>(fakeUser);
} catch (Exception e) {
return new Result.Error(new IOException("Error logging in", e));
}
}
public void logout() {
// TODO: revoke authentication - this should be comlpeted, but is still not working?
//requests new authentication from the client thus requesting brand new login credentials.
Intent logout = new Intent(this.context, FingerprintHandler.class);
context.startActivity(logout);
}
}
|
[
"[email protected]"
] | |
5c295708976d3bbeafa17d75ea2bf54f6889cb5e
|
830f9e0d64a4001d40d566b37e28edc30a0cf4c1
|
/Graph/perfectFriends.java
|
8820ff14e6dfb6c973e7f9db8f9274bf7cba8a35
|
[] |
no_license
|
akkigulati/JAVA
|
9d4f39ff5a0f90728a4c191a781b99968ca0624d
|
0c11f1a99f4ba7949515a57ae005957d2da0d7ee
|
refs/heads/master
| 2021-01-06T18:16:54.670444 | 2020-07-29T08:50:11 | 2020-07-29T08:50:11 | 241,435,594 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,407 |
java
|
/*
Question
1. You are given a number n (representing the number of students). Each student will have an id from 0 to n - 1.
2. You are given a number k (representing the number of clubs)
3. In the next k lines, two numbers are given separated by a space. The numbers are ids of students belonging to same club.
4. You have to find in how many ways can we select a pair of students such that both students are from different clubs.
Input Format
Input has been managed for you
Output Format
Check the sample output
Constraints
None
Sample Input
7
5
0 1
2 3
4 5
5 6
4 6
Sample Output
16
*/
import java.io.*;
import java.util.*;
public class Main {
static class Edge {
int src;
int nbr;
int wt;
Edge(int src, int nbr, int wt) {
this.src = src;
this.nbr = nbr;
this.wt = wt;
}
}
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int vtces = Integer.parseInt(br.readLine());
ArrayList<Edge>[] graph = new ArrayList[vtces];
for (int i = 0; i < vtces; i++) {
graph[i] = new ArrayList<>();
}
int edges = Integer.parseInt(br.readLine());
for (int i = 0; i < edges; i++) {
String[] parts = br.readLine().split(" ");
int v1 = Integer.parseInt(parts[0]);
int v2 = Integer.parseInt(parts[1]);
int wt = 0;
graph[v1].add(new Edge(v1, v2, wt));
graph[v2].add(new Edge(v2, v1, wt));
}
ArrayList<ArrayList<Integer>> comps = new ArrayList<>();
boolean visited[]=new boolean[vtces];
for(int i=0;i<vtces;i++){
if(!visited[i]){
ArrayList<Integer> comp=new ArrayList<>();
gcc(graph,i,visited,comp);
comps.add(comp);
}
}
int combinations=0;
for(int i=0;i<comps.size()-1;i++){
for(int j=i+1;j<comps.size();j++){
combinations+=comps.get(i).size()*comps.get(j).size();
}
}
System.out.println(combinations);
}
public static void gcc(ArrayList<Edge>[] graph,int vertex,boolean visited[],ArrayList<Integer> comp){
visited[vertex]=true;
comp.add(vertex);
for(Edge e:graph[vertex]){
if(visited[e.nbr]==false){
gcc(graph,e.nbr,visited,comp);
}
}
}
}
|
[
"[email protected]"
] | |
ac865b9506368954f7cea7b1ac783889debb7ee2
|
a76102ac37bcf6e3f81b1cc835bf19b8da289ac0
|
/src/main/ShapeComponent.java
|
6c064af4877a8bd637899aa505ac24bc540b7e5a
|
[] |
no_license
|
CTaylor63/JPaint
|
59e59c84fd793e75a464c380c3da45bbcda1b450
|
8cc4df5a393003db8b6d6f35d8175b12793b423c
|
refs/heads/master
| 2022-07-23T13:47:10.578567 | 2020-05-24T17:05:42 | 2020-05-24T17:05:42 | 266,586,357 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 164 |
java
|
package main;
public interface ShapeComponent {
public void reDraw();
public void updateLocation(int dx, int dy);
public void setSelected(boolean flag);
}
|
[
"[email protected]"
] | |
040c1ae29f4cf7e46573979d3ea43a053ae92ab1
|
e54f6fb22418d94ce86c6841c45c0aa0af93b5ec
|
/common/src/main/java/com/rainyhon/common/vo/FaceSdkUserVo.java
|
26e9d5936d1bb3694ca26c870e73624149485ca0
|
[] |
no_license
|
xiaoxiao-xx/demo-backend
|
9149441d2059778b1e71dd064deb05404a5add3f
|
860a36a8c40f50fa6aaefc866a3b51c322e0ed28
|
refs/heads/master
| 2022-12-07T18:01:40.054261 | 2019-05-28T02:03:19 | 2019-05-28T02:27:02 | 168,655,493 | 2 | 0 | null | 2022-11-16T06:58:48 | 2019-02-01T06:53:32 |
Java
|
UTF-8
|
Java
| false | false | 243 |
java
|
package com.rainyhon.common.vo;
import lombok.Data;
@Data
public class FaceSdkUserVo {
private String seiralNo;
private String group_id;
private String image;
private String user_id;
private String face_token;
}
|
[
"[email protected]"
] | |
48f47d0adb420f07dfa5dd20a939b9a4d3c75796
|
af365a62dc4b83b0c51c446cc12908b51658f387
|
/QuickNaviStage02/src/org/androidtown/quicknavi/common/TitleBitmapButton.java
|
b13fa7319f0cbe305d3ca777466b9529082a5b4c
|
[] |
no_license
|
flaj5477/Do-it-Android
|
595aa9d15eb871253ed14058a6b2f1805a313cb2
|
c09ba68e415c32d3406a1fc36ceaa2442fbc3bff
|
refs/heads/master
| 2020-07-20T07:25:49.730456 | 2019-09-16T08:27:28 | 2019-09-16T08:27:28 | 206,597,901 | 0 | 0 | null | null | null | null |
UHC
|
Java
| false | false | 6,190 |
java
|
package org.androidtown.quicknavi.common;
import org.androidtown.quicknavi.R;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.Button;
public class TitleBitmapButton extends Button {
/**
* Base Context
*/
Context context;
/**
* Paint instance
*/
Paint paint;
/**
* Default Color
*/
int defaultColor = 0xffffffff;
/**
* Default Size
*/
float defaultSize = 18F;
/**
* Default ScaleX
*/
float defaultScaleX = 1.0F;
/**
* Default Typeface
*/
Typeface defaultTypeface = Typeface.DEFAULT;
/**
* Title Text
*/
String titleText = "";
/**
* Icon Status : 0 - Normal, 1 - Clicked
*/
int iconStatus = 0;
/**
* Icon Clicked Bitmap
*/
Bitmap iconNormalBitmap;
/**
* Icon Clicked Bitmap
*/
Bitmap iconClickedBitmap;
public static final int BITMAP_ALIGN_CENTER = 0;
public static final int BITMAP_ALIGN_LEFT = 1;
public static final int BITMAP_ALIGN_RIGHT = 2;
int backgroundBitmapNormal = R.drawable.title_button;
int backgroundBitmapClicked = R.drawable.title_button_clicked;
/**
* Alignment
*/
int bitmapAlign = BITMAP_ALIGN_CENTER;
/**
* Padding for Left or Right
*/
int bitmapPadding = 10;
/**
* Flag for paint changed
*/
boolean paintChanged = false;
private boolean selected;
private int tabId;
public TitleBitmapButton(Context context) {
super(context);
this.context = context;
init();
}
public TitleBitmapButton(Context context, AttributeSet atts) {
super(context, atts);
this.context = context;
init();
}
public void setTabId(int id) {
tabId = id;
}
public void setSelected(boolean flag) {
selected = flag;
if (selected) {
setBackgroundResource(backgroundBitmapClicked);
paintChanged = true;
defaultColor = Color.BLACK;
} else {
setBackgroundResource(backgroundBitmapNormal);
paintChanged = true;
defaultColor = Color.WHITE;
}
}
public boolean isSelected() {
return selected;
}
/**
* Initialize
*/
public void init() {
setBackgroundResource(backgroundBitmapNormal);
paint = new Paint();
paint.setColor(defaultColor);
paint.setAntiAlias(true);
paint.setTextScaleX(defaultScaleX);
paint.setTextSize(defaultSize);
paint.setTypeface(defaultTypeface);
selected = false;
}
/**
* Set icon bitmap
*
* @param icon
*/
public void setIconBitmap(Bitmap iconNormal, Bitmap iconClicked) {
iconNormalBitmap = iconNormal;
iconClickedBitmap = iconClicked;
}
public void setBackgroundBitmap(int resNormal, int resClicked) {
backgroundBitmapNormal = resNormal;
backgroundBitmapClicked = resClicked;
setBackgroundResource(backgroundBitmapNormal);
}
/**
* Handles touch event, move to main screen
*/
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_UP:
if (selected) {
} else {
setBackgroundResource(backgroundBitmapNormal);
iconStatus = 0;
paintChanged = true;
defaultColor = Color.WHITE;
// fire event
//khc 100913 - 아래코드 제거시 탭 이동현상 없어짐.
//MainScreenActivity.getInstance().tabSelected(tabId);
}
break;
case MotionEvent.ACTION_DOWN:
if (selected) {
} else {
setBackgroundResource(backgroundBitmapClicked);
iconStatus = 1;
paintChanged = true;
defaultColor = Color.BLACK;
}
break;
}
// repaint the screen
invalidate();
return true;
}
/**
* Draw the text
*/
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
int curWidth = getWidth();
int curHeight = getHeight();
// apply paint attributes
if (paintChanged) {
paint.setColor(defaultColor);
paint.setTextScaleX(defaultScaleX);
paint.setTextSize(defaultSize);
paint.setTypeface(defaultTypeface);
paintChanged = false;
}
// bitmap
Bitmap iconBitmap = iconNormalBitmap;
if (iconStatus == 1) {
iconBitmap = iconClickedBitmap;
}
if (iconBitmap != null) {
int iconWidth = iconBitmap.getWidth();
int iconHeight = iconBitmap.getHeight();
int bitmapX = 0;
if (bitmapAlign == BITMAP_ALIGN_CENTER) {
bitmapX = (curWidth-iconWidth)/2;
} else if(bitmapAlign == BITMAP_ALIGN_LEFT) {
bitmapX = bitmapPadding;
} else if(bitmapAlign == BITMAP_ALIGN_RIGHT) {
bitmapX = curWidth-bitmapPadding;
}
canvas.drawBitmap(iconBitmap, bitmapX, (curHeight-iconHeight)/2, paint);
}
// text
Rect bounds = new Rect();
paint.getTextBounds(titleText, 0, titleText.length(), bounds);
float textWidth = ((float)curWidth - bounds.width())/2.0F;
float textHeight = ((float)curHeight + bounds.height())/2.0F+4.0F;
canvas.drawText(titleText, textWidth, textHeight, paint);
}
public String getTitleText() {
return titleText;
}
public void setTitleText(String titleText) {
this.titleText = titleText;
}
public int getDefaultColor() {
return defaultColor;
}
public void setDefaultColor(int defaultColor) {
this.defaultColor = defaultColor;
paintChanged = true;
}
public float getDefaultSize() {
return defaultSize;
}
public void setDefaultSize(float defaultSize) {
this.defaultSize = defaultSize;
paintChanged = true;
}
public float getDefaultScaleX() {
return defaultScaleX;
}
public void setDefaultScaleX(float defaultScaleX) {
this.defaultScaleX = defaultScaleX;
paintChanged = true;
}
public Typeface getDefaultTypeface() {
return defaultTypeface;
}
public void setDefaultTypeface(Typeface defaultTypeface) {
this.defaultTypeface = defaultTypeface;
paintChanged = true;
}
public int getBitmapAlign() {
return bitmapAlign;
}
public void setBitmapAlign(int bitmapAlign) {
this.bitmapAlign = bitmapAlign;
}
public int getBitmapPadding() {
return bitmapPadding;
}
public void setBitmapPadding(int bitmapPadding) {
this.bitmapPadding = bitmapPadding;
}
}
|
[
"[email protected]"
] | |
fea5ae2a195e77f51d40ec709aab7086b364a523
|
aae49c4e518bb8cb342044758c205a3e456f2729
|
/GeogebraiOS/javasources/org/geogebra/common/main/AppCompanion.java
|
f0afbc96151187e1519c0df201af5486d05af833
|
[] |
no_license
|
kwangkim/GeogebraiOS
|
00919813240555d1f2da9831de4544f8c2d9776d
|
ca3b9801dd79a889da6cb2fdf24b761841fd3f05
|
refs/heads/master
| 2021-01-18T05:29:52.050694 | 2015-10-04T02:29:03 | 2015-10-04T02:29:03 | 45,118,575 | 4 | 2 | null | 2015-10-28T14:36:32 | 2015-10-28T14:36:31 | null |
UTF-8
|
Java
| false | false | 3,512 |
java
|
package org.geogebra.common.main;
import org.geogebra.common.euclidian.EuclidianViewCompanion;
import org.geogebra.common.gui.layout.DockPanel;
import org.geogebra.common.kernel.Kernel;
import org.geogebra.common.kernel.commands.CommandsConstants;
import org.geogebra.common.kernel.geos.GeoElement;
import org.geogebra.common.kernel.kernelND.ViewCreator;
import org.geogebra.common.main.settings.Settings;
/**
*
* @author mathieu
*
* Companion for application
*/
public class AppCompanion {
protected App app;
/**
* Constructor
*
* @param app
* application
*/
public AppCompanion(App app) {
this.app = app;
}
/**
*
* @return new kernel
*/
public Kernel newKernel() {
return new Kernel(app);
}
/**
* return true if commands of this table should be visible in input bar help
* and autocomplete
*
* @param table
* table number, see CommandConstants.TABLE_*
* @return true for visible tables
*/
protected boolean tableVisible(int table) {
return !(table == CommandsConstants.TABLE_CAS
|| table == CommandsConstants.TABLE_3D || table == CommandsConstants.TABLE_ENGLISH);
}
/**
* XML settings for both EVs
*
* @param sb
* string builder
* @param asPreference
* whether we need this for preference XML
*/
public void getEuclidianViewXML(StringBuilder sb, boolean asPreference) {
app.getEuclidianView1().getXML(sb, asPreference);
if (app.hasEuclidianView2EitherShowingOrNot(1)) {
app.getEuclidianView2(1).getXML(sb, asPreference);
}
}
/**
* @param plane
* plane creator
* @param panelSettings
* panel settings
* @return create a new euclidian view for the plane
*/
public EuclidianViewCompanion createEuclidianViewForPlane(
ViewCreator plane, boolean panelSettings) {
return null;
}
/**
* store view creators (for undo)
*/
public void storeViewCreators() {
// used in 3D
}
/**
* recall view creators (for undo)
*/
public void recallViewCreators() {
// used in 3D
}
/**
* reset ids for 2D view created by planes, etc. Used in 3D.
*/
public void resetEuclidianViewForPlaneIds() {
// used in 3D
}
/**
* @return new EuclidianDockPanelForPlane
*/
public DockPanel createEuclidianDockPanelForPlane(int id, String plane) {
return null;
}
/**
*
* @return new settings
*/
public Settings newSettings() {
return new Settings(2);
}
/**
* Update font sizes of all components to match current GUI font size
*/
public void resetFonts() {
app.getFontManager().setFontSize(app.getGUIFontSize());
if (app.euclidianView != null) {
app.euclidianView.updateFonts();
}
if (app.getGuiManager() != null) {
app.getGuiManager().updateFonts();
if (app.hasEuclidianView2(1)) {
app.getEuclidianView2(1).updateFonts();
}
}
}
/**
*
* @return true if some view for plane exists
*/
public boolean hasEuclidianViewForPlane() {
return false;
}
/**
* add to views for plane (if any)
*
* @param geo
* geo
*/
public void addToViewsForPlane(GeoElement geo) {
// implemented in App3DCompanion
}
/**
* remove to views for plane (if any)
*
* @param geo
* geo
*/
public void removeFromViewsForPlane(GeoElement geo) {
// implemented in App3DCompanion
}
}
|
[
"[email protected]"
] | |
d08ab6663b0788aaeddfbaf72b1a0651e8fa3fa7
|
c061f58f6f8436b999e045031193a4318a13ddae
|
/appDisney/src/main/java/com/appDisney/repositorio/RepositorioGenero.java
|
7acd5739a32ea50e6b0cddb5acc0a29f9af0533d
|
[] |
no_license
|
emitorres/AppDisney
|
9abe7cb6c10e598c689b32a0327254f30efa93b3
|
cd23d66083a7c055afaf594ca4efd9ed8dd845e4
|
refs/heads/master
| 2023-06-25T01:31:22.236555 | 2021-07-30T23:53:44 | 2021-07-30T23:53:44 | 388,966,024 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 319 |
java
|
package com.appDisney.repositorio;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.appDisney.entidad.*;
@Repository
public interface RepositorioGenero extends JpaRepository<Genero, Long>{
boolean findByNombre(String nombre);
}
|
[
"[email protected]"
] | |
19429d96c6fe920e9f2e174ce6593f3dc2f72183
|
0dab660ebb6a16c1dd06f6beb99c41c555466d8b
|
/testAutomationV2/src/test/java/generics/reporter.java
|
a26eabf0ada60a6d2948344baee110f6af20d6f2
|
[] |
no_license
|
AnantNigam0309/AutomationFrame
|
75b9eacb84464081b20fece0c9a806c5fe04082c
|
384c2af9cea2bd10fbd583b4e4a34c02aace4c31
|
refs/heads/master
| 2021-01-20T14:29:32.221396 | 2017-05-09T09:17:20 | 2017-05-09T09:17:20 | 90,619,039 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 475 |
java
|
package generics;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class reporter {
String Scenario;
String result ;
@XmlElement
public void setScenario(String scenario) {
this.Scenario=scenario;
}
@XmlElement
public void setResult(String result) {
this.result=result;
}
public String getScenario() {
return Scenario;
}
public String getResult() {
return result;
}
}
|
[
"[email protected]"
] | |
04a3481cf0305258cba2927ebc55b767e3c9b61a
|
f1e8e4e6bc2c49d880ae655b5c3bbac9568bbb7e
|
/src/main/java/org/seckill/dto/SeckillExecution.java
|
5a3986b28cbb3c5b3cbd501303a5eda8057e12af
|
[] |
no_license
|
a7956232/seckill
|
b2a9e7ad16af1fe30f7c71e673b39f89774fb869
|
f1659e28a30a40d60b69f61a8c8ce829086212e8
|
refs/heads/master
| 2021-01-11T02:56:03.271562 | 2016-10-14T12:12:44 | 2016-10-14T12:12:44 | 70,905,704 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,851 |
java
|
package org.seckill.dto;
import org.seckill.entity.SuccessKilled;
import org.seckill.enums.SeckillStateEnum;
/**
* 封装秒杀执行后结果
* Created by 95 on 2016/9/21.
*/
public class SeckillExecution {
private long seckillId;
//秒杀执行结果状态
private int state;
//状态信息
private String stateInfo;
//秒杀成功对象
private SuccessKilled successKilled;
public SeckillExecution(long seckillId, SeckillStateEnum stateEnum, SuccessKilled successKilled) {
this.seckillId = seckillId;
this.state = stateEnum.getState();
this.stateInfo = stateEnum.getStateInfo();
this.successKilled = successKilled;
}
public SeckillExecution(long seckillId, SeckillStateEnum stateEnum) {
this.seckillId = seckillId;
this.state = stateEnum.getState();
this.stateInfo = stateEnum.getStateInfo();
}
@Override
public String toString() {
return "SeckillExecution{" +
"seckillId=" + seckillId +
", state=" + state +
", stateInfo='" + stateInfo + '\'' +
", successKilled=" + successKilled +
'}';
}
public long getSeckillId() {
return seckillId;
}
public void setSeckillId(long seckillId) {
this.seckillId = seckillId;
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public String getStateInfo() {
return stateInfo;
}
public void setStateInfo(String stateInfo) {
this.stateInfo = stateInfo;
}
public SuccessKilled getSuccessKilled() {
return successKilled;
}
public void setSuccessKilled(SuccessKilled successKilled) {
this.successKilled = successKilled;
}
}
|
[
"[email protected]"
] | |
a8015e5b295088ccc640e61513acebd3eaf26bc1
|
589555d8dab0629e2d743be7e1c9e40ce0f44cb7
|
/src/employees/Employee.java
|
71e17b4c7a3cda90aa809fa3ecfa69f0f47a5716
|
[] |
no_license
|
jihee102/helpdesk-system-JAVA
|
815dc1a4bf64b44134c5c48c307f04004154ae67
|
c77a74e0fce6da80a103191b7463ea421602814d
|
refs/heads/master
| 2023-02-28T19:26:33.366535 | 2021-02-03T12:21:53 | 2021-02-03T12:21:53 | 335,609,809 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 817 |
java
|
package employees;
import org.json.JSONObject;
public class Employee {
protected String name;
private String password;
protected String department;
public Employee(String eName, String ePassword, String eDepartment){
this.name = eName;
this.password = ePassword;
this.department =eDepartment;
}
public Employee(JSONObject jo){
this.name = jo.getString("name");
this.password = jo.getString("password");
this.department = jo.getString("department");
}
public String getName() {
return name;
}
public String getDepartment() {
return department;
}
public String getPassword() {
return password;
}
@Override
public String toString(){
return name+" ("+department+") ";
}
}
|
[
"[email protected]"
] | |
ee0759e06881a9cf8af564a296943ba6b5b81db6
|
14452cc65ad3f8642cc9e7bf687f4e868406dda1
|
/src/main/java/il/ac/bgu/cs/bp/bpjs/execution/tasks/BPEngineTask.java
|
08baa42ea0b9332d98df2939fc21bead4f28f9ce
|
[
"MIT"
] |
permissive
|
potashkeren/BPjs
|
36c1ec52f495842109ec0b6822dc56a72a4f862f
|
3c89a0455d559e3f90badf38719a0b80bc9ae91e
|
refs/heads/master
| 2020-04-03T21:11:08.217849 | 2018-10-17T23:00:41 | 2018-10-17T23:00:41 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,129 |
java
|
package il.ac.bgu.cs.bp.bpjs.execution.tasks;
import il.ac.bgu.cs.bp.bpjs.model.BProgram;
import il.ac.bgu.cs.bp.bpjs.model.BSyncStatement;
import java.util.concurrent.Callable;
import il.ac.bgu.cs.bp.bpjs.model.BThreadSyncSnapshot;
import il.ac.bgu.cs.bp.bpjs.model.FailedAssertion;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContinuationPending;
import org.mozilla.javascript.WrappedException;
/**
* Base interface for a parallel task executed during the execution of a {@link BProgram}.
* @author Michael
*/
public abstract class BPEngineTask implements Callable<BThreadSyncSnapshot>{
/**
* Callback interface for when assertions fail.
*/
public static interface Listener {
public void assertionFailed( FailedAssertion fa );
}
protected final BThreadSyncSnapshot bss;
protected final Listener listener;
BPEngineTask(BThreadSyncSnapshot aBss, Listener aListener) {
listener = aListener;
bss = aBss;
}
abstract BThreadSyncSnapshot callImpl(Context jsContext);
@Override
public BThreadSyncSnapshot call() {
try {
Context jsContext = Context.enter();
return callImpl( jsContext );
} catch (ContinuationPending cbs) {
final BSyncStatement capturedStatement = (BSyncStatement) cbs.getApplicationState();
capturedStatement.setBthread(bss);
return bss.copyWith(cbs.getContinuation(), capturedStatement);
} catch ( WrappedException wfae ) {
if ( wfae.getCause() instanceof FailedAssertionException ) {
FailedAssertionException fae = (FailedAssertionException) wfae.getCause();
FailedAssertion fa = new FailedAssertion( fae.getMessage(), bss.getName() );
listener.assertionFailed( fa );
return null;
} else {
throw wfae;
}
} finally {
if (Context.getCurrentContext() != null) {
Context.exit();
}
}
}
}
|
[
"[email protected]"
] | |
8e826815c31ea4425d488fa0e000e4df7b6e9bae
|
dc446d8c5074efb11ffc749e94fa5136227bd4e1
|
/LeetCodeSol/src/com/epi/design/ArraysTest.java
|
8a532682af84ca233960f99947756d6a4b45a48f
|
[] |
no_license
|
JBaba/CgProject
|
c65ec8e40bdf98ef61e12ab0d20d103c11c53e70
|
919fa121fc5f4643d486a911214875c1a1bc4892
|
refs/heads/master
| 2021-04-22T12:51:21.353533 | 2019-09-16T01:52:03 | 2019-09-16T01:52:03 | 48,817,321 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,631 |
java
|
package com.epi.design;
import java.util.Arrays;
import java.util.List;
public class ArraysTest {
public static void main(String[] args) {
int i = 0;
Integer[] a = {5,6,7,8,9,1,2,3,4};
System.out.println(i);
List<Integer> list = Arrays.asList(a);
System.out.println(list.size());
System.out.println(Arrays.toString(a));
Arrays.sort(a);
System.out.println(Arrays.toString(a));
i = Arrays.binarySearch(a, 10);
System.out.println(i);
Arrays.fill(a, 10);
System.out.println(Arrays.toString(a));
// initializing Object array1
Object[] b1 = new Object[] { 'a', 'b' };
// let us print all the values available in array2
System.out.println("Elements of Array1 is:");
for (Object value : b1) {
System.out.println("Value = " + value);
}
// initializing Object array2
Object[] b2 = new Object[] { 'a', 'b' };
// let us print all the values available in array2
System.out.println("Elements of Array2 is:");
for (Object value : b2) {
System.out.println("Value = " + value);
}
// initializing Object array3
Object[] b3 = new Object[] { 'x', 'y' };
// let us print all the values available in array3
System.out.println("Elements of Array3 is:");
for (Object value : b3) {
System.out.println("Value = " + value);
}
// checking array1 and array2 for equality
System.out.println("Array1 and Array2 are equal:" + Arrays.deepEquals(b1,b2));
// checking array1 and array3 for equality
System.out.println("Array1 and Array3 are equal:" + Arrays.deepEquals(b1,b3));
}
}
|
[
"[email protected]"
] | |
7c389b2e474da659f3015b28edff2702a053f791
|
48c0163c42d4f3cb18f825f794cbdfc780be58f6
|
/base/src/main/java/com/example/base/loadsir/TimeoutCallback.java
|
9f1c8d369d66a61fbdc309eb4f316ea6e3c5cd21
|
[] |
no_license
|
sunbinkang/CustomWebView
|
31fef2708db2a33d6e572034e9e28563f7e479f3
|
aa08d791f71b940e7a26a66a96b4b364c65fad04
|
refs/heads/main
| 2023-03-23T06:24:57.114723 | 2021-03-17T00:45:15 | 2021-03-17T00:45:15 | 348,327,204 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 677 |
java
|
package com.example.base.loadsir;
import android.content.Context;
import android.view.View;
import android.widget.Toast;
import com.example.base.R;
import com.kingja.loadsir.callback.Callback;
/**
* Description:TODO
* Create Time:2017/9/2 16:17
* Author:KingJA
* Email:[email protected]
*/
public class TimeoutCallback extends Callback {
@Override
protected int onCreateView() {
return R.layout.layout_timeout;
}
@Override
protected boolean onReloadEvent(Context context, View view) {
Toast.makeText(context.getApplicationContext(), "Connecting to the network again!", Toast.LENGTH_SHORT).show();
return false;
}
}
|
[
"[email protected]"
] | |
cd1f8979dc31e61bf11bb55cddb59b04b9e38139
|
b5be51c61e64cc245eb8f97a50dd48e8d811b393
|
/SongLib/src/model/SongList.java
|
ca7b3d20028e5cc909461c75a72bfbab1adc4c42
|
[] |
no_license
|
JiSunPark88/SoftwareMeth
|
7b848d4eb490e0ffb406e95babcaf3dc66868767
|
a27d005c80df967d5ee1fbe8f94bc96a9ea3a5be
|
refs/heads/master
| 2020-08-03T08:02:16.429513 | 2019-12-12T00:39:40 | 2019-12-12T00:39:40 | 211,677,230 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,095 |
java
|
//SongLib Project CS213 Project 1
//Ji Sun Park and Sakar Mohamed M
package model;
public class SongList {
private String name, artist, album, year;
public SongList(String name, String artist) {
this(name, artist, "", "");
}
public SongList(String name, String artist, String album) {
this(name, artist, album, "");
}
public SongList(String name, String artist, String album, String year) {
this.name = name;
this.artist = artist;
this.album = album;
this.year = year;
}
public String getName() {
return this.name;
}
public String getArtist() {
return this.artist;
}
public String getAlbum() {
return this.album;
}
public String getYear() {
return this.year;
}
public void setTitle(String name) {
this.name = name;
}
public void setArtist(String artist) {
this.artist = artist;
}
public void setAlbum(String album) {
this.album = album;
}
public void setYear(String year) {
this.year = year;
}
public String toString() {
return name + " - " + artist;
}
}
|
[
"[email protected]"
] | |
80cb4e2ea770962df7762f4d63708b57c3ba1161
|
97af9cd24c411871d64538e13c6d6c5775f9fc2d
|
/eureka-hystrix-dashboard/src/main/java/didispace/Application.java
|
1aa82e5a05e518411ea6fda235a652cd4ed41ae0
|
[] |
no_license
|
tfchen2400/spring-cloud
|
21944505c97793e72644a7df1792d2767ebd5011
|
490690556c5a86d83f5ffcb722e3bd3f78250f3b
|
refs/heads/master
| 2020-03-30T00:55:05.135718 | 2018-09-27T08:16:34 | 2018-09-27T08:16:34 | 150,550,220 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 727 |
java
|
package didispace;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableHystrixDashboard
@EnableCircuitBreaker
public class Application {
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).web(true).run(args);
}
}
|
[
"[email protected]"
] | |
b48ca635a9cd8596183890d968f245b9a977e396
|
3c8a067f60958a53945643ac03a22401b48310ee
|
/Project/src/com/Fundamentals/Java/WelcomeToJava.java
|
a1270060c21980f64546dba9f07dc7122d30a7a2
|
[] |
no_license
|
titushale/JavaFundamentals
|
6b26d21d10e7e63d953058104d087bc7b75dc345
|
b3ea01afc93f5b2b85c111381493d42a5610b2e3
|
refs/heads/master
| 2020-03-31T01:10:02.113003 | 2018-12-03T16:39:18 | 2018-12-03T16:39:18 | 151,769,240 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,864 |
java
|
package com.Fundamentals.Java;
import java.util.*;
import com.Fundamentals.data.Apple;
import com.Fundamentals.data.Dinner;
import com.Fundamentals.data.Dinosaur;
import com.Fundamentals.data.ExceptionSample;
import com.Fundamentals.data.HolidayDinner;
import com.Fundamentals.data.Pterodactyl;
import com.Fundamentals.data.Quiz2;
import com.Fundamentals.data.Trex;
import com.Fundamentals.data.Utility;
enum iceCream{
Vanilla, Chocolate, Strawberry, Caramel;
}
public class WelcomeToJava {
public static final int MY_VALUE = 10;
public static int MY_OTHER_VALUE;
static {
MY_OTHER_VALUE = 25;
int total = MY_VALUE * MY_OTHER_VALUE;// total should be 250
// System.out.println(total);
}
public static void main(String[] args) {
MY_OTHER_VALUE = 35;
// TODO Auto-generated method stub
//someMethod();
//stringExamples();
//moreStringExamples();
//dataTypeExamples
// scannerExample();
// myOperatorExample();
// myAssignmentExample();
// myDecisionExamples();
// myHouse();
// sampleArray();
// myTwoDimensionArray();
// accessModifierExamples();
// inheritanceExample();
// overloadExample();
// overrideExample();
// myBicycle();
// sampleUtility();
// something();// can not run in a static method
// public void something() will not run in a static method
// quizTwo();
// subtractSomething();
// arraylistExamples();
// arrayListObjectExamples();
//hashMapExample();
//enumSample1();
exceptionExample();
}
/*
* HashSet ignores duplicates and also order if the item added is already in the
* collection , it will not add it or give any indication that it wont
*/
public static void exceptionExample() {
ExceptionSample es = new ExceptionSample();
//es.myException();
//es.mySecondException();
es.myThirdException();
}
public static void enumSample1() {
iceCream ic = iceCream.Strawberry;
System.out.println(ic);
HolidayDinner hd = new HolidayDinner();
hd.LetsEat();
hd.letsChoose(Dinner.Turkey);
hd.letsChoose(Dinner.Ham);
hd.letsChoose(Dinner.CornBread);
Dinner d1 = Dinner.MashedPotatoes;
System.out.println(d1);
d1.readyNow();
}
public static <E> void hashMapExample() {
HashMap<Integer, String> myMap = new HashMap<Integer, String>();
myMap.put(0, "something");
myMap.put(1, "something else");
myMap.put(2, "something");
myMap.put(3, "One More");
myMap.remove(2);
for(String value : myMap.values()) {
System.out.println(value);
}
Set<E> set = (Set<E>) myMap.entrySet();
Iterator iterate = set.iterator();
while (iterate.hasNext()) {
Map.Entry me = (Map.Entry) iterate.next();
System.out.print(me.getKey() + ";");
System.out.println(me.getValue());
}
}
public static void hashSetExample() {
HashSet<String> myString = new HashSet<String>();
myString.add("something");
myString.add("something else");
myString.add("something");
myString.add("something else");
for (String s : myString) {
System.out.println(s);
}
Dinosaur dino = new Dinosaur("sharp");
Dinosaur dino2 = new Dinosaur("serrated");
Dinosaur dino3 = new Dinosaur("dull");
HashSet<Dinosaur> myDino = new HashSet<Dinosaur>();
myDino.add(dino);
myDino.add(dino2);
myDino.add(dino3);
for (Dinosaur d : myDino) {
System.out.println(d.getTeeth() + "" + d.getSkin());
}
}
public static void arrayListObjectExamples() {
Dinosaur dino = new Dinosaur("sharp");
Dinosaur dino2 = new Dinosaur("serrated");
Dinosaur dino3 = new Dinosaur("dull");
ArrayList<Dinosaur> animal = new ArrayList<Dinosaur>();
animal.add(dino);
animal.add(dino2);
animal.add(dino3);
for (Dinosaur d : animal) {
System.out.println(d.getTeeth());
}
for (int i = 0; i < animal.size(); i++) {
System.out.println(animal.get(i).getTeeth());
}
}
public static void arraylistExamples() {
ArrayList<String> names = new ArrayList<String>();
names.add("something");
names.add("Something else");
names.add("something");
names.remove(2);
names.add("Happy");
for (int i = 0; i < names.size(); i++) {
System.out.println(names.get(i));
}
for (String string : names) {
System.out.println(string);
}
// recommend doing it with a generic parameter instead like above
ArrayList place = new ArrayList();
place.add(10);
place.add("type");
}
public static void myAbstractExample() {
// Can't create an instance of an abstract class
// Shape shape = new Shape();//Not valid
System.out.println(Shape.area(5, 10));
Square square = new Square();
System.out.println(square.draw());
Rectangle rec = new Rectangle();
System.out.println(rec.draw());
rec.setLength(10);
rec.setWidth(5);
System.out.println(Shape.area(rec.getLength(), rec.getWidth()));
}
public static void subtractSomething() {
System.out.println(Quiz2.subtractSomething(50, 25));
}
public static void quizTwo() {
System.out.println("On Foe nem ");
Dinosaur dino = new Dinosaur("Sharp");
Trex trex = new Trex("Sharp","rough");
Pterodactyl pt = new Pterodactyl("Sharp");
dino.setSkin("leathery");
dino.move();
System.out.println(dino.getSkin());
trex.move();
trex.devourPrey();
pt.nesting();
pt.move();
}
public static void sampleUtility() {
System.out.println(Utility.addSomething(5, 23));
Utility.somethingElse();
}
public static void myBicycle() {
Bicycle bicycle = new Bicycle();
MotorizedBicycle motorizedBicycle = new MotorizedBicycle();
// bicycle.pedalling();
motorizedBicycle.pedalling();
}
public static void overrideExample() {
House myHouse = new House();
Condo myCondo = new Condo();
House myOtherhouse = new Condo();// Implicit cast
Condo myotherCondo = (Condo) new House();// Explicit cast
// myHouse.openDoor();
// myCondo.openDoor();
myOtherhouse.openDoor();
}
public static void overloadExample() {
Apple myApple = new Apple();
myApple.display("Granny Smiths", 5);
myApple.display("Sour", 3, "Red");
// String show = myApple.display("Granny Smiths","Green" ;
System.out.println(Apple.SOUR_SCALE);
System.out.println(myApple.SOUR_SCALE);
System.out.println(Apple.SWEET_SCALE);
Apple.SWEET_SCALE = 25;
}
public static void inheritanceExample() {
House house = new House();
Condo condo = new Condo();
condo.setDoors("Red Door");
System.out.println(condo.getDoors());
house.setDoors("Purple Doors");
System.out.println(house.getDoors());
}
public static void accessModifierExamples() {
PrimitiveExamples pe = new PrimitiveExamples();
Apple myApple = new Apple();
pe.myProtectedMethod();
}
public static void myJaggedArray() {
int[][] anArray = new int[3][5];
anArray[0][0] = 6;
anArray[0][1] = 8;
anArray[0][2] = 10;
anArray[0][3] = 11;
anArray[0][4] = 13;
anArray[1][0] = 12;
anArray[1][1] = 14;
anArray[1][2] = 16;
anArray[1][3] = 17;
anArray[1][4] = 19;
anArray[2][0] = 18;
anArray[2][1] = 20;
anArray[2][2] = 22;
anArray[2][3] = 21;
anArray[2][4] = 23;
System.out.println(anArray.length);
for (int i = 0; i < anArray.length; i++) {
for (int j = 0; j < anArray[i].length; j++) {
System.out.println(anArray[i][j]);
}
}
}
public static void myTwoDimensionArray() {
int[][] anArray = new int[3][3];
anArray[0][0] = 6;
anArray[0][1] = 8;
anArray[0][2] = 10;
anArray[1][0] = 12;
anArray[1][1] = 14;
anArray[1][2] = 16;
anArray[2][0] = 18;
anArray[2][1] = 20;
anArray[2][2] = 22;
System.out.println(anArray.length);
for (int i = 0; i < anArray.length; i++) {
for (int j = 0; j < anArray.length; j++) {
System.out.println(anArray[i][j]);
}
}
}
public static void sampleArray() {
String[] myStringArray = { "happy", "monday", "Java" };
int[] myIntArray = new int[3];
myIntArray[0] = 5;
myIntArray[1] = 17;
myIntArray[2] = 10;
int[] mySecondIntArray = myIntArray.clone();
for (int i = 0; i < myIntArray.length; i++) {
System.out.println(myIntArray[i]);
}
for (int j = 0; j < mySecondIntArray.length; j++) {
System.out.println(mySecondIntArray[j]);
}
}
public static void myHouse() {
House myHouse = new House();
// myHouse.doors = "Red Doors";
myHouse.setDoors("Red Doors");
House myThirdHome = myHouse;
House mySecondHome = new House();
// mySecondHome.doors = "Purple Doors"
myHouse.setDoors("Purple Doors");
House[] houseArray = new House[] { myHouse, mySecondHome, myThirdHome };
System.out.println(myHouse.getDoors());
System.out.println(mySecondHome.getDoors());
System.out.println(myThirdHome.getDoors());
int i = 0;
do {
System.out.println(houseArray[i].getDoors());
i++;
} while (i < houseArray.length);
}
public static void myDecisionExamples() {
DecisionExamples de = new DecisionExamples();
de.basicIfStatement();
de.chainIfStatement();
de.switchExample(5);
LoopingExamples le = new LoopingExamples();
le.myWhileLoop();
le.myDoWhileLoop();
le.myForLoop();
le.myBranchExample();
}
public static void myAssignmentExample() {
AssignmentExample ae = new AssignmentExample();
ae.plusEqualsExample();
ae.minusEqualExample();
ae.multiplyEqualsExample();
ae.divisionEqualsExample();
ae.modulusEqualsExample();
ae.leftShiftEeualsExample();
ae.rightShftEqualsExample();
ae.bitwiseAndEqualsExample();
ae.bitwiseOrEqualsExample();
}
public static void myOperatorExample() {
OperatorExamples oe = new OperatorExamples();
oe.incrementSample();
oe.decrementsample();
oe.equalsExample();
oe.equalsExample2();
oe.logicalExamples();
}
public static void someMethod() {
System.out.println("Welcome to Java ");
}
public static void stringExamples() {
// String = Type [str1 = variable] name Welcome = string literal
String str1 = "Welcome";
String str2 = new String("Java");
System.out.println(str2);
// charAt method returns a single character at a certain position
char j = str1.charAt(2);// index is zero based
System.out.println(j);
// concat method joins two strings together; called concatenation
String name = str2.concat(" is cool");
System.out.println(name);
// equals method will check to see if an object equals the string variable
boolean isMyString = str1.equals(str2); // is str2 = str1?
System.out.println(isMyString);
// toLowerCase method will make the variable with lower case letters
String myString = str1.toLowerCase();
System.out.println(myString);
// toUpperCase method will make the variable with upper case letters
String mySecondString = str2.toUpperCase();
System.out.println(mySecondString);
}
public static void moreStringExamples() {
String myString = "My Java String";
// Are these equal?
boolean isTheSame = myString.toLowerCase().equals("my java string");
System.out.println(isTheSame);
// myString is capitalized and added to is so capitalized
String name = myString.toUpperCase().concat(" is so capatalized");
System.out.println(name);
// equalsignoreCase does not check if it has capitalization it is ignored
boolean testString = myString.equalsIgnoreCase("My java string");
System.out.println(testString);
// contains method checks to see if it matches part of the variable
boolean isContained = myString.contains("ava");
System.out.println(isContained);
}
public static void primitiveExamples() {
// Example of the use of Scanner
PrimitiveExamples pe = new PrimitiveExamples();
pe.myFirstPrimitiveMethod();
pe.myAddition();
pe.mySubtraction();
pe.myMultiplication();
pe.myDivision();
pe.myModulus();
pe.myOrderOp();
}
public static void scannerExample() {
int x, y, z;
System.out.println("Enter two integers to calculate their sum");
Scanner in = new Scanner(System.in);
x = in.nextInt();
y = in.nextInt();
z = x + y;
System.out.println("Sum of entered integers = " + z);
}
}
|
[
"[email protected]"
] | |
7aca92fb2e741dbb33bd33083f69e96469b2763c
|
b4a0979b325613f5b4a26d22b15ee9c38453f88f
|
/src/presicely1/InfogixTest3.java
|
a87ae22638e11b3ed8177d88ccc4b90d64527fd6
|
[] |
no_license
|
Aneesh9252/Precisely1
|
0ff933024823ed0d2db2aeabec696171486b7221
|
2b9e5fc43ba6d6324a5f0740fcbffce1a8f43730
|
refs/heads/main
| 2023-07-15T07:28:48.513700 | 2021-08-20T11:49:46 | 2021-08-20T11:49:46 | 398,238,026 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,396 |
java
|
package presicely1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
public class InfogixTest3 {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver","C:\\Program Files\\Eclipse\\chromedriver_win32\\chromedriver.exe");
WebDriver driver= new ChromeDriver();
driver.get("https://www.infogix.com"); // Entering into the Infogix Home Page
driver.manage().window().maximize(); // Maximizing the browser window
driver.findElement(By.id("menu-item-9950")).click(); // Clicking on "contact" in the menu item.
driver.findElement(By.name("FirstName")).sendKeys("Aneesh"); // Filling the form with the details provided
driver.findElement(By.id("LastName")).sendKeys("Aneesh");
driver.findElement(By.id("Company")).sendKeys("Infogix");
driver.findElement(By.id("Email")).sendKeys("[email protected]");
driver.findElement(By.id("Phone")).sendKeys("0123456789");
WebElement countryselect=driver.findElement(By.id("HQ_Location_Country__c")); // Selecting the country from the drop down
Select country= new Select(countryselect);
country.selectByVisibleText("United States");
WebElement industry=driver.findElement(By.id("Industry__c")); // selecting the Industry from the drop down
Select Ind= new Select(industry);
Ind.selectByVisibleText("Media & Communication");
WebElement textInput=driver.findElement(By.id("Next_Step_Comments__c")); // Entering the text sentence in the text box
textInput.sendKeys("This is a coding challenge for Test Automation position. Please disregard this message");
driver.findElement(By.xpath("//*[@id='LblConsent_to_Processing__c']")).click(); // Clicking on the accept/reject box
driver.findElement(By.xpath("//button[@type='submit']")).click(); // Clicking on the submit button
Thread.sleep(2000); // wait for 2 seconds to get the fully loaded new page.
WebElement t=driver.findElement(By.xpath("//*[text()='Thank You!']"));// Locating the Thank You element in the page
System.out.println(t.getText()); // Thank You Message is verified in the final page.
System.out.println("Test successfully passed and verified Thank You Message!");
}
}
|
[
"[email protected]"
] | |
5940c2127bb9582d8188a07d33424bdc14be7434
|
4db1126dc806501828b873f0b13f1272a341bd41
|
/app/src/main/java/com/b2b/passwork/Model/Upcoming/UpComingResponse.java
|
c8f02bdc90acb81956a5280baab8c8d6e6638253
|
[] |
no_license
|
Deepakgajjar502/Passwork
|
f05eb1e62ff9ade6666ac35ab24df52aa3508d3e
|
12c12a0540491b40e2e1a6004bf5f74fa318bdf2
|
refs/heads/master
| 2023-03-29T15:54:42.221091 | 2021-03-31T11:21:22 | 2021-03-31T11:21:22 | 333,503,597 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 509 |
java
|
package com.b2b.passwork.Model.Upcoming;
import java.util.List;
import com.google.gson.annotations.SerializedName;
public class UpComingResponse {
@SerializedName("data")
private List<upcomingDataItem> data;
@SerializedName("status")
private int status;
public void setData(List<upcomingDataItem> data){
this.data = data;
}
public List<upcomingDataItem> getData(){
return data;
}
public void setStatus(int status){
this.status = status;
}
public int getStatus(){
return status;
}
}
|
[
"[email protected]"
] | |
5e7479ec8081ba5a2ea02f5d1f725a43077a9386
|
4288933ce27f812293dd38a4b998efc60fa97140
|
/backend-manager/backend-manager-web/src/main/java/cn/yutang/backend/controller/CashierController.java
|
c13f10d3c3b2ecb9e8444ba0073356cdc6e98f64
|
[] |
no_license
|
YuTangClub/yt-catering
|
eefab6c3e486de340a186a9c86220203ce3ad81c
|
f2e3ae8029c8b3bcc0fd23d269024c803459acaf
|
refs/heads/master
| 2021-04-09T15:15:08.160363 | 2018-04-09T07:55:57 | 2018-04-09T07:55:57 | 125,480,622 | 1 | 0 | null | 2018-04-09T08:00:52 | 2018-03-16T07:36:23 |
Java
|
UTF-8
|
Java
| false | false | 3,512 |
java
|
package cn.yutang.backend.controller;
import cn.yutang.backend.pojo.dto.MessageResult;
import cn.yutang.backend.pojo.dto.Page;
import cn.yutang.backend.pojo.po.Food;
import cn.yutang.backend.pojo.po.ShopOrders;
import cn.yutang.backend.pojo.vo.DinnerTableInfo;
import cn.yutang.backend.service.IDinnerTableService;
import cn.yutang.backend.service.IOrderDishesService;
import cn.yutang.backend.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/pages/cashier")
public class CashierController {
@Autowired
IDinnerTableService dinnerTableService;
@Autowired
IOrderService orderServiceImpl;
@Autowired
IOrderDishesService orderDishesServiceImpl;
@RequestMapping("/tbList")
public String tbListPage(){
return "/pages/cashier/tbList";
}
//获得餐桌信息
@RequestMapping("/allTable.do")
public String allTables(Page page, Model model){
MessageResult<DinnerTableInfo> allTable =dinnerTableService.listTables(0,page);
//return allTable;
model.addAttribute("allTable",allTable);
model.addAttribute("allPage",page);
return "pages/cashier/allTable";
}
/* @RequestMapping("/allTable.do")
@ResponseBody
public List<DinnerTableInfo> allTables(){
return dinnerTableService.allTables();
}*/
@RequestMapping("/datingTable.do")
public String datingTables(Page page, Model model){
MessageResult<DinnerTableInfo> datingTable =dinnerTableService.listTables(1,page);
model.addAttribute("datingPage",page);
model.addAttribute("datingTable",datingTable);
return "pages/cashier/datingTable";
}
@RequestMapping("/kabaoTable.do")
public String kabaoTables(Page page, Model model){
MessageResult<DinnerTableInfo> kabaoTable = dinnerTableService.listTables(2,page);
model.addAttribute("kabaoTable",kabaoTable);
model.addAttribute("kabaoPage",page);
return "pages/cashier/kabaoTable";
}
@RequestMapping("/baoTable.do")
public String baoTables(Page page, Model model){
MessageResult<DinnerTableInfo> baoTable = dinnerTableService.listTables(3,page);
model.addAttribute("baoTable",baoTable);
model.addAttribute("baoPage",page);
return "pages/cashier/baoTable";
}
//获得菜单
@RequestMapping("/dishesMenu")
public MessageResult<Food> foodList(Page page) {
MessageResult<Food> messageResult = null;
try {
messageResult =orderServiceImpl.selectByPage(page);
} catch (Exception e) {
e.printStackTrace();
}
return messageResult;
}
//点菜
@RequestMapping("/orderDishes")
public String orderDishes(ShopOrders shopOrders){
orderDishesServiceImpl.orderDishes(shopOrders);
return "0";
}
//加菜
@RequestMapping("/addDishes")
public void addDishes(ShopOrders shopOrders){
orderDishesServiceImpl.addDishes(shopOrders);
}
//退菜
@RequestMapping("/untread")
public void untread(ShopOrders shopOrders){
orderDishesServiceImpl.untread(shopOrders);
}
//结算
@RequestMapping("/pay4Dishes")
public void payForDishes(ShopOrders shopOrders){
orderDishesServiceImpl.payForDishes(shopOrders);
}
}
|
[
"[email protected]"
] | |
c65f31a6ede05580cf78c2fca995e5b9713a2809
|
24d1ad74cb69c514490bca499ac6f9bf51294486
|
/src/java/dao/TblRolFacade.java
|
551fda323c4c0c12632972f1fd7be50f3c3d1216
|
[] |
no_license
|
AlexZepe/sigge
|
50c04aa370fed71aa3e2b5ad57327913e0e9e5b2
|
0634e2dae6b3fc89ff4fe15588dff00426c8a8a9
|
refs/heads/master
| 2021-01-19T05:42:26.850296 | 2016-06-18T01:33:48 | 2016-06-18T01:33:48 | 60,894,339 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 679 |
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 dao;
import entidades.TblRol;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author aspire e 14
*/
@Stateless
public class TblRolFacade extends AbstractFacade<TblRol> {
@PersistenceContext(unitName = "siggePU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public TblRolFacade() {
super(TblRol.class);
}
}
|
[
"[email protected]"
] | |
d3a700380bce7e150a80345c949984e40bc07513
|
6f796a5e56c17e60c61d139b941b78bcdaf665ad
|
/src/rs/media/Palette.java
|
1f5f4ce8a76fe68cd29a4608ae504c2b11968fa5
|
[] |
no_license
|
jtieri/RuneScape-Beta-Public
|
3362279889802a8462bf5a9d2e54f52c5a1caacb
|
383935d6fcc6cc795cdb9c6d61fc2f101760a9a8
|
refs/heads/master
| 2020-05-30T01:42:09.746279 | 2018-11-15T04:30:21 | 2018-11-15T04:30:21 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,881 |
java
|
package rs.media;
import rs.util.Colors;
public final class Palette {
public static int[] rgb = new int[128 * 512];
public static void setBrightness(double brightness) {
int off = 0;
for (int y = 0; y < 512; y++) {
double fGreen = ((double) (y / 8) / 64.0) + 0.0078125;
double saturation = ((double) (y & 0x7) / 8.0) + 0.0625;
for (int x = 0; x < 128; x++) {
double intensity = (double) x / 128.0;
double red = intensity;
double green = intensity;
double blue = intensity;
if (saturation != 0.0) {
double a;
if (intensity < 0.5) {
a = intensity * (1.0 + saturation);
} else {
a = (intensity + saturation) - (intensity * saturation);
}
double b = (2.0 * intensity) - a;
double fRed = fGreen + (1.0 / 3.0);
double fBlue = fGreen - (1.0 / 3.0);
if (fRed > 1.0) fRed--;
if (fBlue < 0.0) fBlue++;
red = getValue(fRed, a, b);
green = getValue(fGreen, a, b);
blue = getValue(fBlue, a, b);
}
rgb[off++] = Colors.setBrightness(((int) (red * 256.0) << 16) | ((int) (green * 256.0) << 8) | (int) (blue * 256.0), brightness);
}
}
// TODO: create TextureManager
for (int n = 0; n < 50; n++) {
if (Graphics3D.textures[n] != null) {
int[] texturePalette = Graphics3D.textures[n].palette;
Graphics3D.texturePalettes[n] = new int[texturePalette.length];
for (int i = 0; i < texturePalette.length; i++) {
Graphics3D.texturePalettes[n][i] = Colors.setBrightness(texturePalette[i], brightness);
}
}
Graphics3D.updateTexture(n);
}
}
private static double getValue(double value, double a, double b) {
if ((6.0 * value) < 1.0)
return b + ((a - b) * 6.0 * value);
if (2.0 * value < 1.0)
return a;
if (3.0 * value < 2.0)
return b + ((a - b) * ((2.0 / 3.0) - value) * 6.0);
return b;
}
private Palette() {
}
}
|
[
"[email protected]"
] | |
4a403822daa6d7d9c2da80329bbc38810d9b25d3
|
6ba4c323b18e8e2b7e3b43cc37b135a6b61f491f
|
/src/main/java/com/gnut/bidscout/controller/client/CampaignController.java
|
1b2a3c4229418cc7799d9f64ec8651c1ca8b8d5d
|
[] |
no_license
|
guitarnut/BidScout
|
cf25181155974fb8d9873fea14509574ae35ff19
|
717aeb52416ffc5849d6cc428ba888d9ba8e8e59
|
refs/heads/master
| 2022-11-29T08:19:31.313631 | 2019-08-06T11:31:02 | 2019-08-06T11:31:02 | 155,811,591 | 0 | 0 | null | 2022-11-16T11:34:45 | 2018-11-02T03:54:34 |
Java
|
UTF-8
|
Java
| false | false | 4,773 |
java
|
package com.gnut.bidscout.controller.client;
import com.gnut.bidscout.model.Campaign;
import com.gnut.bidscout.model.Limits;
import com.gnut.bidscout.model.Requirements;
import com.gnut.bidscout.service.inventory.CampaignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@RestController
@RequestMapping("/api/campaign")
public class CampaignController {
private final CampaignService campaignService;
@Autowired
public CampaignController(CampaignService campaignService) {
this.campaignService = campaignService;
}
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json")
@ResponseBody
public Campaign create(
@RequestBody Campaign campaign,
Authentication auth,
HttpServletResponse response
) {
return campaignService.createCampaign(auth, response, campaign);
}
@RequestMapping(value = "/all", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<Campaign> all(
Authentication auth
) {
return campaignService.getCampaigns(auth);
}
@RequestMapping(value = "/{id}/view", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Campaign create(
@PathVariable("id") String id,
Authentication auth
) {
return campaignService.getCampaign(auth, id);
}
@RequestMapping(value = "/{id}/save", method = RequestMethod.POST, produces = "application/json")
@ResponseBody
public Campaign save(
@PathVariable("id") String id,
@RequestBody Campaign campaign,
Authentication auth
) {
return campaignService.saveCampaign(auth, id, campaign);
}
@RequestMapping(value = "/{id}/delete", method = RequestMethod.DELETE, produces = "application/json")
@ResponseBody
public void delete(
@PathVariable("id") String id,
Authentication auth
) {
campaignService.deleteCampaign(auth, id);
}
@RequestMapping(value = "/{id}/targeting/save", method = RequestMethod.POST, produces = "application/json")
@ResponseBody
public Requirements saveTargeting(
@PathVariable("id") String id,
@RequestBody Requirements requirements,
Authentication auth
) {
return campaignService.saveCampaignRequirements(auth, id, requirements);
}
@RequestMapping(value = "/{id}/targeting/view", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Requirements saveTargeting(
@PathVariable("id") String id,
Authentication auth
) {
return campaignService.getCampaignRequirements(auth, id);
}
@RequestMapping(value = "/{id}/pacing/save", method = RequestMethod.POST, produces = "application/json")
@ResponseBody
public Limits savePacing(
@PathVariable("id") String id,
@RequestBody Limits limits,
Authentication auth
) {
return campaignService.saveCampaignLimits(auth, id, limits);
}
@RequestMapping(value = "/{id}/pacing/view", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Limits savePacing(
@PathVariable("id") String id,
Authentication auth
) {
return campaignService.getCampaignLimits(auth, id);
}
@RequestMapping(value = "/{id}/creative/add", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public void addCreative(
@PathVariable("id") String id,
@RequestParam("id") String creative,
Authentication auth,
HttpServletResponse response
) {
campaignService.addCreative(auth, response, id, creative);
}
@RequestMapping(value = "/{id}/creative/remove", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public void removeCreative(
@PathVariable("id") String id,
@RequestParam("id") String creative,
Authentication auth,
HttpServletResponse response
) {
campaignService.removeCreative(auth, response, id, creative);
}
@RequestMapping(value = "/{id}/statistics/reset", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Campaign resetStatistics(
@PathVariable("id") String id,
Authentication auth
) {
return campaignService.resetStatistics(auth, id);
}
}
|
[
"[email protected]"
] | |
31743874bf86f5105b9ec284496c91a349e7fa26
|
de179509b1b53c3753a82b57030fc06bb552d3de
|
/app/src/main/java/com/zongke/hapilolauncher/utils/ViewUtils.java
|
d93026f46894f8ef04d9243dd2215661b090f11f
|
[] |
no_license
|
13767004362/ZongKeLauncher
|
70b79a41cda3db86e43c2cc0689d4d1e285fd717
|
9e901fc9561fcb1841d49f55d7c9b8a9babad81a
|
refs/heads/master
| 2021-05-10T15:07:50.327537 | 2018-04-28T01:47:43 | 2018-04-28T01:47:43 | 118,541,291 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,532 |
java
|
package com.zongke.hapilolauncher.utils;
import android.graphics.Paint;
import android.os.Build;
import android.text.TextUtils;
import android.view.View;
import java.lang.reflect.Field;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Created by ${xingen} on 2017/6/20.
*/
public class ViewUtils {
/**
* 随机分配一个新的Id
*
* @return
*/
public static int getViewId() {
int viewId;
if (Build.VERSION.SDK_INT < 17) {
//采用View中源码
viewId = generateViewId();
} else {
//采用View中generateViewId()静态方法
viewId = View.generateViewId();
}
return viewId;
}
private static final AtomicInteger sNextGeneratedId = new AtomicInteger(1);
/**
* Generate a value suitable for use in {@link #setId(int)}.
* This value will not collide with ID values generated at build time by aapt for R.id.
*
* @return a generated ID value
*/
private static int generateViewId() {
for (; ; ) {
final int result = sNextGeneratedId.get();
// aapt-generated IDs have the high byte nonzero; clamp to the range under that.
int newValue = result + 1;
if (newValue > 0x00FFFFFF) {newValue = 1;} // Roll over to 1, not 0.
if (sNextGeneratedId.compareAndSet(result, newValue)) {
return result;
}
}
}
/**
* 计算字体的高度
*
* @param paint
* @return
*/
public static float calculationDigitalHeight(Paint paint) {
return ((-paint.ascent()) + paint.descent());
}
/**
* 计算字体的长度
* @param paint
* @param text
* @return
*/
public static float calculationDigitalWith(Paint paint, String text) {
return paint.measureText(text);
}
/**
* 检查文本是否为空
* @param msg
* @return
*/
public static boolean isNull(String msg){
return TextUtils.isEmpty(msg);
}
/**
* 反射获取状态栏高度
* @return
*/
public static int getStatusBarHeight(){
int x=0;
try {
Class<?> c = Class.forName("com.android.internal.R$dimen");
Object o = c.newInstance();
Field field = c.getField("status_bar_height");
x = (Integer) field.get(o);
} catch (Exception e) {
e.printStackTrace();
}
return x;
}
}
|
[
"[email protected]"
] | |
463337c279bd4256699b1b515c32446d8aae30e0
|
8cc09d0369479468c64f7fb0e8285f480689c2ab
|
/stock/src/com/cni/stock/service/UtilisateurService.java
|
589e322f071c1e8281e8da01bb72fa6e15d81400
|
[] |
no_license
|
SyrineByk/github2
|
c33e2c719d115de4b6748b9c9a9c39f9e4a520ed
|
5a836d2362432410f22259745bf0f19ea17e0acb
|
refs/heads/master
| 2021-07-08T16:35:09.103222 | 2019-08-30T10:43:14 | 2019-08-30T10:43:14 | 202,313,921 | 0 | 0 | null | 2020-10-13T15:39:07 | 2019-08-14T09:02:29 |
Java
|
UTF-8
|
Java
| false | false | 1,334 |
java
|
package com.cni.stock.service;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.cni.stock.dao.IUtilisateurDAO;
import com.cni.stock.model.Utilisateur;
@Service("utilisateurService")
@Transactional(readOnly = true)
public class UtilisateurService implements IUtilisateurService {
IUtilisateurDAO utilisateurDAO;
@Transactional(readOnly = false)
@Override
public void addUtilisateur(Utilisateur utilisateur) {
getUtilisateurDAO().addUtilisateur(utilisateur);
}
@Transactional(readOnly = false)
@Override
public void updateUtilisateur(Utilisateur utilisateur) {
getUtilisateurDAO().updateUtilisateur(utilisateur);
}
@Transactional(readOnly = false)
@Override
public void deleteUtilisateur(Utilisateur utilisateur) {
getUtilisateurDAO().deleteUtilisateur(utilisateur);
}
@Override
public Utilisateur findById(int id) {
return getUtilisateurDAO().findById(id);
}
@Override
public List<Utilisateur> findAll() {
return getUtilisateurDAO().findAll();
}
public IUtilisateurDAO getUtilisateurDAO() {
return utilisateurDAO;
}
public void setUtilisateurDAO(IUtilisateurDAO utilisateurDAO) {
this.utilisateurDAO = utilisateurDAO;
}
}
|
[
"[email protected]"
] | |
c828841fda3126bc33577b89dde212df3a318cb4
|
0a532b9d7ebc356ab684a094b3cf840b6b6a17cd
|
/java-source/src/main/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java
|
cc4920b3b4ac8e11b3df8a80c8342c4152b2eb6a
|
[
"Apache-2.0"
] |
permissive
|
XWxiaowei/JavaCode
|
ac70d87cdb0dfc6b7468acf46c84565f9d198e74
|
a7e7cd7a49c36db3ee479216728dd500eab9ebb2
|
refs/heads/master
| 2022-12-24T10:21:28.144227 | 2020-08-22T08:01:43 | 2020-08-22T08:01:43 | 98,070,624 | 10 | 4 |
Apache-2.0
| 2022-12-16T04:23:38 | 2017-07-23T02:51:51 |
Java
|
UTF-8
|
Java
| false | false | 19,676 |
java
|
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* 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.sun.org.apache.xml.internal.res;
import java.util.ListResourceBundle;
/**
* Set up error messages.
* We build a two dimensional array of message keys and
* message strings. In order to add a new message here,
* you need to first add a String constant. And you need
* to enter key, value pair as part of the contents
* array. You also need to update MAX_CODE for error strings
* and MAX_WARNING for warnings ( Needed for only information
* purpose )
*/
public class XMLErrorResources_es extends ListResourceBundle
{
/*
* This file contains error and warning messages related to Xalan Error
* Handling.
*
* General notes to translators:
*
* 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
* components.
* XSLT is an acronym for "XML Stylesheet Language: Transformations".
* XSLTC is an acronym for XSLT Compiler.
*
* 2) A stylesheet is a description of how to transform an input XML document
* into a resultant XML document (or HTML document or text). The
* stylesheet itself is described in the form of an XML document.
*
* 3) A template is a component of a stylesheet that is used to match a
* particular portion of an input document and specifies the form of the
* corresponding portion of the output document.
*
* 4) An element is a mark-up tag in an XML document; an attribute is a
* modifier on the tag. For example, in <elem attr='val' attr2='val2'>
* "elem" is an element name, "attr" and "attr2" are attribute names with
* the values "val" and "val2", respectively.
*
* 5) A namespace declaration is a special attribute that is used to associate
* a prefix with a URI (the namespace). The meanings of element names and
* attribute names that use that prefix are defined with respect to that
* namespace.
*
* 6) "Translet" is an invented term that describes the class file that
* results from compiling an XML stylesheet into a Java class.
*
* 7) XPath is a specification that describes a notation for identifying
* nodes in a tree-structured representation of an XML document. An
* instance of that notation is referred to as an XPath expression.
*
*/
/** Maximum error messages, this is needed to keep track of the number of messages. */
public static final int MAX_CODE = 61;
/** Maximum warnings, this is needed to keep track of the number of warnings. */
public static final int MAX_WARNING = 0;
/** Maximum misc strings. */
public static final int MAX_OTHERS = 4;
/** Maximum total warnings and error messages. */
public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
/*
* Message keys
*/
public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
// Message keys used by the serializer
public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
public static final String ER_OIERROR = "ER_OIERROR";
public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
/*
* Now fill in the message text.
* Then fill in the message text for that message code in the
* array. Use the new error code as the index into the array.
*/
// Error messages...
/** The lookup table for error messages. */
private static final Object[][] contents = {
/** Error message ID that has a null message, but takes in a single object. */
{"ER0000" , "{0}" },
{ ER_FUNCTION_NOT_SUPPORTED,
"Funci\u00F3n no soportada."},
{ ER_CANNOT_OVERWRITE_CAUSE,
"No se puede sobrescribir la causa"},
{ ER_NO_DEFAULT_IMPL,
"No se ha encontrado la implantaci\u00F3n por defecto "},
{ ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
"ChunkedIntArray({0}) no est\u00E1 soportado actualmente"},
{ ER_OFFSET_BIGGER_THAN_SLOT,
"El desplazamiento es mayor que la ranura"},
{ ER_COROUTINE_NOT_AVAIL,
"Corrutina no disponible, id={0}"},
{ ER_COROUTINE_CO_EXIT,
"CoroutineManager ha recibido la solicitud co_exit()"},
{ ER_COJOINROUTINESET_FAILED,
"Fallo de co_joinCoroutineSet()"},
{ ER_COROUTINE_PARAM,
"Error de par\u00E1metro de corrutina ({0})"},
{ ER_PARSER_DOTERMINATE_ANSWERS,
"\nINESPERADO: respuestas doTerminate del analizador {0}"},
{ ER_NO_PARSE_CALL_WHILE_PARSING,
"no se puede realizar un an\u00E1lisis mientras se lleva a cabo otro"},
{ ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
"Error: el iterador introducido para el eje {0} no se ha implantado"},
{ ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
"Error: el iterador para el eje {0} no se ha implantado "},
{ ER_ITERATOR_CLONE_NOT_SUPPORTED,
"La clonaci\u00F3n del iterador no est\u00E1 soportada"},
{ ER_UNKNOWN_AXIS_TYPE,
"Tipo transversal de eje desconocido: {0}"},
{ ER_AXIS_NOT_SUPPORTED,
"Traverser de eje no soportado: {0}"},
{ ER_NO_DTMIDS_AVAIL,
"No hay m\u00E1s identificadores de DTM disponibles"},
{ ER_NOT_SUPPORTED,
"No soportado: {0}"},
{ ER_NODE_NON_NULL,
"El nodo debe ser no nulo para getDTMHandleFromNode"},
{ ER_COULD_NOT_RESOLVE_NODE,
"No se ha podido resolver el nodo en un identificador"},
{ ER_STARTPARSE_WHILE_PARSING,
"startParse no puede llamarse durante el an\u00E1lisis"},
{ ER_STARTPARSE_NEEDS_SAXPARSER,
"startParse necesita un SAXParser no nulo"},
{ ER_COULD_NOT_INIT_PARSER,
"no se ha podido inicializar el analizador con"},
{ ER_EXCEPTION_CREATING_POOL,
"excepci\u00F3n al crear la nueva instancia para el pool"},
{ ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
"La ruta de acceso contiene una secuencia de escape no v\u00E1lida"},
{ ER_SCHEME_REQUIRED,
"Se necesita un esquema."},
{ ER_NO_SCHEME_IN_URI,
"No se ha encontrado un esquema en el URI: {0}"},
{ ER_NO_SCHEME_INURI,
"No se ha encontrado un esquema en el URI"},
{ ER_PATH_INVALID_CHAR,
"La ruta de acceso contiene un car\u00E1cter no v\u00E1lido: {0}"},
{ ER_SCHEME_FROM_NULL_STRING,
"No se puede definir un esquema a partir de una cadena nula"},
{ ER_SCHEME_NOT_CONFORMANT,
"El esquema no es v\u00E1lido."},
{ ER_HOST_ADDRESS_NOT_WELLFORMED,
"El formato de la direcci\u00F3n de host no es correcto"},
{ ER_PORT_WHEN_HOST_NULL,
"No se puede definir el puerto si el host es nulo"},
{ ER_INVALID_PORT,
"N\u00FAmero de puerto no v\u00E1lido"},
{ ER_FRAG_FOR_GENERIC_URI,
"S\u00F3lo se puede definir el fragmento para un URI gen\u00E9rico"},
{ ER_FRAG_WHEN_PATH_NULL,
"No se puede definir el fragmento si la ruta de acceso es nula"},
{ ER_FRAG_INVALID_CHAR,
"El fragmento contiene un car\u00E1cter no v\u00E1lido"},
{ ER_PARSER_IN_USE,
"El analizador ya se est\u00E1 utilizando"},
{ ER_CANNOT_CHANGE_WHILE_PARSING,
"No se puede cambiar {0} {1} durante el an\u00E1lisis"},
{ ER_SELF_CAUSATION_NOT_PERMITTED,
"La autocausalidad no est\u00E1 permitida"},
{ ER_NO_USERINFO_IF_NO_HOST,
"No se puede especificar la informaci\u00F3n de usuario si no se ha especificado el host"},
{ ER_NO_PORT_IF_NO_HOST,
"No se puede especificar el puerto si no se ha especificado el host"},
{ ER_NO_QUERY_STRING_IN_PATH,
"No se puede especificar la cadena de consulta en la ruta de acceso y en la cadena de consulta"},
{ ER_NO_FRAGMENT_STRING_IN_PATH,
"No se puede especificar el fragmento en la ruta de acceso y en el fragmento"},
{ ER_CANNOT_INIT_URI_EMPTY_PARMS,
"No se puede inicializar el URI con par\u00E1metros vac\u00EDos"},
{ ER_METHOD_NOT_SUPPORTED,
"M\u00E9todo no soportado a\u00FAn "},
{ ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
"IncrementalSAXSource_Filter no se puede reiniciar actualmente"},
{ ER_XMLRDR_NOT_BEFORE_STARTPARSE,
"XMLReader no anterior a la solicitud startParse"},
{ ER_AXIS_TRAVERSER_NOT_SUPPORTED,
"Traverser de eje no soportado: {0}"},
{ ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
"ListingErrorHandler se ha creado con un valor de PrintWriter nulo"},
{ ER_SYSTEMID_UNKNOWN,
"Identificador de Sistema Desconocido"},
{ ER_LOCATION_UNKNOWN,
"Ubicaci\u00F3n del error desconocida"},
{ ER_PREFIX_MUST_RESOLVE,
"El prefijo se debe resolver en un espacio de nombres: {0}"},
{ ER_CREATEDOCUMENT_NOT_SUPPORTED,
"createDocument() no soportado en XPathContext"},
{ ER_CHILD_HAS_NO_OWNER_DOCUMENT,
"El atributo child no tiene un documento de propietario."},
{ ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
"El atributo child no tiene un elemento de documento de propietario."},
{ ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
"Advertencia: no se puede realizar la salida de texto antes del elemento del documento. Ignorando..."},
{ ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
"No se puede tener m\u00E1s de una ra\u00EDz en un DOM."},
{ ER_ARG_LOCALNAME_NULL,
"El argumento 'localName' es nulo"},
// Note to translators: A QNAME has the syntactic form [NCName:]NCName
// The localname is the portion after the optional colon; the message indicates
// that there is a problem with that part of the QNAME.
{ ER_ARG_LOCALNAME_INVALID,
"El nombre local de QNAME debe ser un NCName v\u00E1lido"},
// Note to translators: A QNAME has the syntactic form [NCName:]NCName
// The prefix is the portion before the optional colon; the message indicates
// that there is a problem with that part of the QNAME.
{ ER_ARG_PREFIX_INVALID,
"El prefijo de QNAME debe ser un NCName v\u00E1lido"},
{ ER_NAME_CANT_START_WITH_COLON,
"El nombre no puede empezar con dos puntos"},
{ "BAD_CODE", "El par\u00E1metro para crear un mensaje est\u00E1 fuera de los l\u00EDmites"},
{ "FORMAT_FAILED", "Se ha emitido una excepci\u00F3n durante la llamada a messageFormat"},
{ "line", "N\u00BA de L\u00EDnea"},
{ "column","N\u00BA de Columna"},
{ER_SERIALIZER_NOT_CONTENTHANDLER,
"La clase de serializador ''{0}'' no implanta org.xml.sax.ContentHandler."},
{ER_RESOURCE_COULD_NOT_FIND,
"No se ha encontrado el recurso [ {0} ].\n {1}" },
{ER_RESOURCE_COULD_NOT_LOAD,
"No se ha podido cargar el recurso [ {0} ]: {1} \n {2} \t {3}" },
{ER_BUFFER_SIZE_LESSTHAN_ZERO,
"Tama\u00F1o de buffer menor o igual que 0" },
{ER_INVALID_UTF16_SURROGATE,
"\u00BFSe ha detectado un sustituto UTF-16 no v\u00E1lido: {0}?" },
{ER_OIERROR,
"Error de ES" },
{ER_ILLEGAL_ATTRIBUTE_POSITION,
"No se puede agregar el atributo {0} despu\u00E9s de nodos secundarios o antes de que se produzca un elemento. Se ignorar\u00E1 el atributo."},
/*
* Note to translators: The stylesheet contained a reference to a
* namespace prefix that was undefined. The value of the substitution
* text is the name of the prefix.
*/
{ER_NAMESPACE_PREFIX,
"No se ha declarado el espacio de nombres para el prefijo ''{0}''." },
/*
* Note to translators: This message is reported if the stylesheet
* being processed attempted to construct an XML document with an
* attribute in a place other than on an element. The substitution text
* specifies the name of the attribute.
*/
{ER_STRAY_ATTRIBUTE,
"El atributo ''{0}'' est\u00E1 fuera del elemento." },
/*
* Note to translators: As with the preceding message, a namespace
* declaration has the form of an attribute and is only permitted to
* appear on an element. The substitution text {0} is the namespace
* prefix and {1} is the URI that was being used in the erroneous
* namespace declaration.
*/
{ER_STRAY_NAMESPACE,
"Declaraci\u00F3n del espacio de nombres ''{0}''=''{1}'' fuera del elemento." },
{ER_COULD_NOT_LOAD_RESOURCE,
"No se ha podido cargar ''{0}'' (compruebe la CLASSPATH), ahora s\u00F3lo se est\u00E1n utilizando los valores por defecto"},
{ ER_ILLEGAL_CHARACTER,
"Intento de realizar la salida del car\u00E1cter del valor integral {0}, que no est\u00E1 representado en la codificaci\u00F3n de salida de {1}."},
{ER_COULD_NOT_LOAD_METHOD_PROPERTY,
"No se ha podido cargar el archivo de propiedades ''{0}'' para el m\u00E9todo de salida ''{1}'' (compruebe la CLASSPATH)" }
};
/**
* Get the association list.
*
* @return The association list.
*/
protected Object[][] getContents() {
return contents;
}
}
|
[
"[email protected]"
] | |
b49447f2a1a23f3245ae6852b1944e85eaec75e4
|
e9574a493ed899274776b58e26a763cdacd53ba0
|
/OFFLINE 3/2/src/pizza/vegPizza.java
|
2570aed9a3005e9bf84e74ed74e7cd907faa29a9
|
[] |
no_license
|
Sourov72/CSE-308-ASSIGNMENTS
|
d85167733aec1c9581d1938e7fb79b67ad72fe7f
|
ae44208461b8d1c72601d6b2d7f944a74bd0c199
|
refs/heads/master
| 2023-06-29T22:48:03.595494 | 2021-07-28T13:38:31 | 2021-07-28T13:38:31 | 363,350,258 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 236 |
java
|
package pizza;
import com.company.Pizza;
public class vegPizza implements Pizza {
@Override
public double price() {
return 300.0;
}
@Override
public String mealDesc() {
return "Veg Pizza";
}
}
|
[
"[email protected]"
] | |
7c13579044e67f456c8b5fbdb7549a557b84d274
|
b681aa823c458eb090db9a469683a41b4c88d146
|
/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/server/HashMapResourceProviderExtension.java
|
f0af71a7ac8f899914e49b5e55dc74ae43c3cd28
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
jasmdk/hapi-fhir
|
4494b1a4a92e1baa443ef72bfa9e6ca3ef647ba8
|
6cb39a14ead6b4e3830636537367a0174337c65f
|
refs/heads/master
| 2021-07-06T04:01:53.239188 | 2020-08-06T20:45:04 | 2020-08-06T20:45:04 | 180,432,303 | 0 | 1 |
Apache-2.0
| 2019-04-09T19:04:35 | 2019-04-09T19:04:30 | null |
UTF-8
|
Java
| false | false | 1,958 |
java
|
package ca.uhn.fhir.test.utilities.server;
/*-
* #%L
* HAPI FHIR Test Utilities
* %%
* Copyright (C) 2014 - 2020 University Health Network
* %%
* 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%
*/
import ca.uhn.fhir.rest.server.provider.HashMapResourceProvider;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
public class HashMapResourceProviderExtension<T extends IBaseResource> extends HashMapResourceProvider<T> implements BeforeEachCallback, AfterEachCallback {
private final RestfulServerExtension myRestfulServerExtension;
/**
* Constructor
*
* @param theResourceType The resource type to support
*/
public HashMapResourceProviderExtension(RestfulServerExtension theRestfulServerExtension, Class<T> theResourceType) {
super(theRestfulServerExtension.getFhirContext(), theResourceType);
myRestfulServerExtension = theRestfulServerExtension;
}
@Override
public void afterEach(ExtensionContext context) throws Exception {
myRestfulServerExtension.getRestfulServer().unregisterProvider(HashMapResourceProviderExtension.this);
}
@Override
public void beforeEach(ExtensionContext context) throws Exception {
clear();
myRestfulServerExtension.getRestfulServer().registerProvider(HashMapResourceProviderExtension.this);
}
}
|
[
"[email protected]"
] | |
ba62bc9746433dbc6540d717a6361508c72a6a19
|
cf866cbe3681fa5e685f0314b4636935d9ce9f7d
|
/src/es/uned/lsi/eped/pract2016/AcademiaIF.java
|
57c6c0ac9e9f46d25862dd74e2aa88912d2457ee
|
[] |
no_license
|
jorgestp/Epec
|
c3f0871de58a13423e8a42a89d82372d7ba07645
|
42af8002113e9cd74ec5fc179520baa4e462dbf9
|
refs/heads/master
| 2021-01-01T04:05:58.599078 | 2016-06-05T18:02:50 | 2016-06-05T18:02:50 | 56,065,588 | 0 | 0 | null | null | null | null |
ISO-8859-1
|
Java
| false | false | 1,462 |
java
|
package es.uned.lsi.eped.pract2016;
import es.uned.lsi.eped.DataStructures.*;
/**
* Reperesentacion de una Academis formada por una coleccion de Doctores
* @author Windows
*
*/
public interface AcademiaIF extends CollectionIF<DoctorIF>{
/*
* Consulta el doctor que fundó la Academia
* @returns el doctor fundador de la Academia
*/
public DoctorIF getFounder();
/**
* Busca un Doctor dentro de la Academia a partir de su identificador
* @pre el doctor pertenece a la Academia && id>0
* @param el identificador del doctor a buscar
* @returns el doctor buscado
*/
public DoctorIF getDoctor (int id);
/**
* Consulta el numero de doctores que pertenecen a una Academia
* @returns el numero de Doctores pertenecientes a la Academia
*
*/
public int size();
/**
* Añade un nuevo Doctor a la Academia a partir de la lectura de su Tesis.
* @paran el nuevo Doctor y su primer director de Tesis
* @pre el nuevo doctor no debe pertenecer a la Academia && el supervisor si debe pertenecer
* a la Academia
*/
public void addDoctor(DoctorIF newDoctor, DoctorIF supervisor);
/**
* Añade una relacion de direccion al Arbol Genealógico de la Academia.
* @param el nuevo Doctor y uno de sus codirectores de Tesis
* @pre ambos doctores deben pertenecer a la Academia && no existe una relacion
* de supervision previa entre ambos
*/
public void addSupervision (DoctorIF student, DoctorIF supervisor);
}
|
[
"[email protected]"
] | |
b42856d64fbb5e92b4142d88a57a26f14f1e0416
|
a93abf60476f35a035ceaf253d9b02fb36b75cb7
|
/modules-storage/prov-storage-mongodb/src/main/java/org/openprovenance/prov/storage/mongodb/MongoGenericResourceStorage.java
|
2df0fe7805d97700f91001d47c075f695a5e7506
|
[
"MIT"
] |
permissive
|
lucmoreau/ProvToolbox
|
241a4f63a1a587789740e00ec8ec3db4d4f14e76
|
8d348c8b87920aa447192e55577f2474b6b41621
|
refs/heads/master
| 2023-08-30T16:09:40.119640 | 2023-08-26T08:26:13 | 2023-08-26T08:26:13 | 2,295,667 | 51 | 34 |
NOASSERTION
| 2023-08-27T08:09:01 | 2011-08-30T15:32:29 |
Java
|
UTF-8
|
Java
| false | false | 3,869 |
java
|
package org.openprovenance.prov.storage.mongodb;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.MongoClient;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.mongojack.DBUpdate;
import org.mongojack.JacksonDBCollection;
import org.mongojack.WriteResult;
import org.openprovenance.prov.storage.api.NonDocumentGenericResourceStorage;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.function.Supplier;
public class MongoGenericResourceStorage<TYPE> implements NonDocumentGenericResourceStorage<TYPE>, Constants {
private final DB db;
private static Logger logger = LogManager.getLogger(MongoGenericResourceStorage.class);
private final JacksonDBCollection<TypeWrapper<TYPE>, String> genericCollection;
private final ObjectMapper mapper;
private final Class<TYPE> cl;
private final Supplier<TypeWrapper<TYPE>> wmake;
private final String collectionName;
public MongoGenericResourceStorage(String dbname, String collectionName, ObjectMapper mapper, Class<TYPE> cl, Supplier<TypeWrapper<TYPE>> wmake) {
this("localhost",dbname,collectionName,mapper,cl,wmake);
}
public MongoGenericResourceStorage(String host, String dbname, String collectionName, ObjectMapper mapper, Class<TYPE> cl, Supplier<TypeWrapper<TYPE>> wmake) {
MongoClient mongoClient = new MongoClient(host, 27017);
DB db = mongoClient.getDB(dbname);
this.db=db;
this.cl=cl;
this.wmake=wmake;
this.collectionName=collectionName;
TypeWrapper<TYPE> instance=wmake.get();
Class<TypeWrapper<TYPE>> wrapperClass = (Class<TypeWrapper<TYPE>>) instance.getClass();
DBCollection generic=db.getCollection(collectionName);
mapper.registerModule(org.mongojack.internal.MongoJackModule.INSTANCE);
this.genericCollection = JacksonDBCollection.wrap(generic, wrapperClass, String.class, mapper);
this.mapper=mapper;
}
public ObjectMapper getMapper() {
return mapper;
}
@Override
public String newStore(String _suggestedExtension, String _mimeType) {
TypeWrapper<TYPE> gw= wmake.get();
WriteResult<TypeWrapper<TYPE>, String> result= genericCollection.insert(gw);
String id = result.getSavedId();
return id;
}
@Override
public void copyInputStreamToStore(InputStream inputStream, String id) throws IOException {
TYPE object=mapper.readValue(inputStream,cl);
serializeObjectToStore(object,id);
}
@Override
public void copyStringToStore(CharSequence str, String id) throws IOException {
TYPE object=mapper.readValue(str.toString(),cl);
serializeObjectToStore(object,id);
}
@Override
public void serializeObjectToStore(TYPE o, String id) {
logger.debug("serializeObjectToStore " + id);
genericCollection.updateById(id, DBUpdate.set(TypeWrapper.VALUE, o));
}
@Override
public void copyStoreToOutputStream(String id, OutputStream outputStream) throws IOException {
logger.debug("copyStoreToOutputStream: deserializeObjectFromStore " + id);
TYPE object=deserializeObjectFromStore(id);
logger.debug("copyStoreToOutputStream: writeValue " + id);
mapper.writeValue(outputStream,object);
}
@Override
public TYPE deserializeObjectFromStore(String id) {
TypeWrapper<TYPE> wrapper= genericCollection.findOneById(id);
if (wrapper==null) return null;
return wrapper.value;
}
@Override
public boolean delete(String storageId) {
WriteResult<TypeWrapper<TYPE>, String> result=genericCollection.removeById(storageId);
return result.getN()==1;
}
}
|
[
"[email protected]"
] | |
9e8c93afb3a0d36d1939e76dd3a22cfa5fea8e28
|
5049eb5596de23b23026c8ea688f9e9714aba09b
|
/src/test/java/ru/job4j/loop/LeapYearTest.java
|
00c367d26a4aa2d7259f0661a27e65dbe923ea2b
|
[] |
no_license
|
RamonOga/elementary
|
63b85161481d1146f8a10b2b1b6dad4f3aae0b15
|
7c639907eb7c399410068dfa49648641258d8436
|
refs/heads/master
| 2023-01-11T21:29:02.546501 | 2020-11-14T08:14:55 | 2020-11-14T08:14:55 | 305,797,182 | 0 | 0 | null | 2020-11-14T08:15:41 | 2020-10-20T18:20:57 |
Java
|
UTF-8
|
Java
| false | false | 707 |
java
|
package ru.job4j.loop;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;
import ru.job4j.loop.LeapYear;
public class LeapYearTest {
@Test
public void checkYearFalse() {
boolean b = LeapYear.checkYear(2019);
assertThat(b, is(false));
}
@Test
public void checkYearFalse1() {
boolean b = LeapYear.checkYear(1800);
assertThat(b, is(false));
}
@Test
public void checkYearTrue() {
boolean b = LeapYear.checkYear(2020);
assertThat(b, is(true));
}
@Test
public void checkYearTrue1() {
boolean b = LeapYear.checkYear(2000);
assertThat(b, is(true));
}
}
|
[
"[email protected]"
] | |
a89b66750ceebf9f2a6c18b8cd65aeac4314097a
|
2a983ca82d81f9a4f31b3fa71f5b236d13194009
|
/instrument-modules/user-modules/module-dbcp2/src/main/java/com/pamirs/attach/plugin/dbcp2/utils/DataSourceWrapUtil.java
|
c9051f2ffeed7da033f6739db3b97669a54a52a3
|
[
"Apache-2.0"
] |
permissive
|
hengyu-coder/LinkAgent-1
|
74ea4dcf51a0a05f2bb0ff22b309f02f8bf0a1a1
|
137ddf2aab5e91b17ba309a83d5420f839ff4b19
|
refs/heads/main
| 2023-06-25T17:28:44.903484 | 2021-07-28T03:41:20 | 2021-07-28T03:41:20 | 382,327,899 | 0 | 0 |
Apache-2.0
| 2021-07-02T11:39:46 | 2021-07-02T11:39:46 | null |
UTF-8
|
Java
| false | false | 18,264 |
java
|
/**
* Copyright 2021 Shulie Technology, Co.Ltd
* Email: [email protected]
* 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,
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pamirs.attach.plugin.dbcp2.utils;
import com.pamirs.pradar.ConfigNames;
import com.pamirs.pradar.ErrorTypeEnum;
import com.pamirs.pradar.Throwables;
import com.pamirs.pradar.pressurement.agent.shared.service.DataSourceMeta;
import com.pamirs.pradar.pressurement.agent.shared.service.ErrorReporter;
import com.pamirs.pradar.pressurement.agent.shared.service.GlobalConfig;
import com.pamirs.pradar.internal.config.ShadowDatabaseConfig;
import com.pamirs.pradar.pressurement.datasource.DatabaseUtils;
import com.pamirs.pradar.pressurement.datasource.DbMediatorDataSource;
import com.pamirs.pradar.pressurement.datasource.util.DbUrlUtils;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class DataSourceWrapUtil {
private static Logger logger = LoggerFactory.getLogger(BasicDataSource.class.getName());
public static final ConcurrentHashMap<DataSourceMeta, DbcpMediaDataSource> pressureDataSources = new ConcurrentHashMap<DataSourceMeta, DbcpMediaDataSource>();
public static void destroy() {
Iterator<Map.Entry<DataSourceMeta, DbcpMediaDataSource>> it = pressureDataSources.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<DataSourceMeta, DbcpMediaDataSource> entry = it.next();
it.remove();
entry.getValue().close();
}
pressureDataSources.clear();
}
public static boolean validate(BasicDataSource sourceDataSource) {
try {
String url = sourceDataSource.getUrl();
String username = sourceDataSource.getUsername();
boolean contains = GlobalConfig.getInstance().containsShadowDatabaseConfig(DbUrlUtils.getKey(url, username));
if (!contains) {
return GlobalConfig.getInstance().containsShadowDatabaseConfig(DbUrlUtils.getKey(url, null));
}
return true;
} catch (Throwable e) {
return false;
}
}
public static boolean shadowTable(BasicDataSource sourceDataSource) {
try {
String url = sourceDataSource.getUrl();
String username = sourceDataSource.getUsername();
return DatabaseUtils.isTestTable(url, username);
} catch (Throwable e) {
return true;
}
}
/**
* 是否是影子数据源
*
* @param target 目标数据源
* @return
*/
private static boolean isPerformanceDataSource(BasicDataSource target) {
for (Map.Entry<DataSourceMeta, DbcpMediaDataSource> entry : pressureDataSources.entrySet()) {
DbcpMediaDataSource mediatorDataSource = entry.getValue();
if (mediatorDataSource.getDataSourcePerformanceTest() == null) {
continue;
}
if (StringUtils.equals(mediatorDataSource.getDataSourcePerformanceTest().getUrl(), target.getUrl()) &&
StringUtils.equals(mediatorDataSource.getDataSourcePerformanceTest().getUsername(), target.getUsername())) {
return true;
}
}
return false;
}
// static AtomicBoolean inited = new AtomicBoolean(false);
public static void init(DataSourceMeta<BasicDataSource> dataSourceMeta) {
if (pressureDataSources.containsKey(dataSourceMeta) && pressureDataSources.get(dataSourceMeta) != null) {
return;
}
BasicDataSource target = dataSourceMeta.getDataSource();
if (isPerformanceDataSource(target)) {
return;
}
if (!validate(target)) {
//没有配置对应的影子表或影子库
ErrorReporter.buildError()
.setErrorType(ErrorTypeEnum.DataSource)
.setErrorCode("datasource-0002")
.setMessage("没有配置对应的影子表或影子库!")
.setDetail("dbcp2:DataSourceWrapUtil:业务库配置:::url: " + target.getUrl())
.closePradar(ConfigNames.SHADOW_DATABASE_CONFIGS)
.report();
DbcpMediaDataSource dbMediatorDataSource = new DbcpMediaDataSource();
dbMediatorDataSource.setDataSourceBusiness(target);
DbMediatorDataSource old = pressureDataSources.put(dataSourceMeta, dbMediatorDataSource);
if (old != null) {
logger.info("[dbcp2] destroyed shadow table datasource success. url:{} ,username:{}", target.getUrl(), target.getUsername());
old.close();
}
return;
}
if (shadowTable(target)) {
//影子表
try {
DbcpMediaDataSource dbMediatorDataSource = new DbcpMediaDataSource();
dbMediatorDataSource.setDataSourceBusiness(target);
DbMediatorDataSource old = pressureDataSources.put(dataSourceMeta, dbMediatorDataSource);
if (old != null) {
logger.info("[dbcp2] destroyed shadow table datasource success. url:{} ,username:{}", target.getUrl(), target.getUsername());
old.close();
}
} catch (Throwable e) {
ErrorReporter.buildError()
.setErrorType(ErrorTypeEnum.DataSource)
.setErrorCode("datasource-0003")
.setMessage("影子表设置初始化异常!")
.setDetail("dbcp2:DataSourceWrapUtil:业务库配置:::url: " + target.getUrl() + "|||" + Throwables.getStackTraceAsString(e))
.closePradar(ConfigNames.SHADOW_DATABASE_CONFIGS)
.report();
logger.error("[dbcp2] init datasource err!", e);
}
} else {
//影子库
try {
DbcpMediaDataSource dataSource = new DbcpMediaDataSource();
BasicDataSource ptDataSource = copy(target);
dataSource.setDataSourcePerformanceTest(ptDataSource);
dataSource.setDataSourceBusiness(target);
DbMediatorDataSource old = pressureDataSources.put(dataSourceMeta, dataSource);
if (old != null) {
logger.info("[dbcp2] destroyed shadow table datasource success. url:{} ,username:{}", target.getUrl(), target.getUsername());
old.close();
}
logger.info("[dbcp2] create shadow datasource success. target:{} url:{} ,username:{} shadow-url:{},shadow-username:{}", target.hashCode(), target.getUrl(), target.getUsername(), ptDataSource.getUrl(), ptDataSource.getUsername());
} catch (Throwable t) {
logger.error("[dbcp2] init datasource err!", t);
ErrorReporter.buildError()
.setErrorType(ErrorTypeEnum.DataSource)
.setErrorCode("datasource-0003")
.setMessage("影子库设置初始化异常!")
.setDetail("dbcp2:DataSourceWrapUtil:业务库配置:::url: " + target.getUrl()
+ "|||" + Throwables.getStackTraceAsString(t))
.closePradar(ConfigNames.SHADOW_DATABASE_CONFIGS)
.report();
}
}
}
private static BasicDataSource copy(BasicDataSource source) {
BasicDataSource target = generate(source);
return target;
}
public static BasicDataSource generate(BasicDataSource sourceDatasource) {
Map<String, ShadowDatabaseConfig> conf = GlobalConfig.getInstance().getShadowDatasourceConfigs();
if (conf == null) {
return null;
}
ShadowDatabaseConfig ptDataSourceConf
= selectMatchPtDataSourceConfiguration(sourceDatasource, conf);
if (ptDataSourceConf == null) {
return null;
}
String url = ptDataSourceConf.getShadowUrl();
String username = ptDataSourceConf.getShadowUsername();
String password = ptDataSourceConf.getShadowPassword();
if (StringUtils.isBlank(url) || StringUtils.isBlank(username) || StringUtils.isBlank(password)) {
return null;
}
String driverClassName = ptDataSourceConf.getShadowDriverClassName();
if(StringUtils.isBlank(driverClassName)) {
driverClassName = sourceDatasource.getDriverClassName();
}
BasicDataSource target = new BasicDataSource();
target.setUrl(url);
target.setUsername(username);
target.setPassword(password);
target.setDriverClassName(driverClassName);
Boolean defaultAutoCommit = ptDataSourceConf.getBooleanProperty("defaultAutoCommit");
if (defaultAutoCommit != null) {
target.setDefaultAutoCommit(defaultAutoCommit);
} else {
target.setDefaultAutoCommit(sourceDatasource.getDefaultAutoCommit());
}
Boolean defaultReadOnly = ptDataSourceConf.getBooleanProperty("defaultReadOnly");
if (defaultReadOnly != null) {
target.setDefaultReadOnly(defaultReadOnly);
} else {
target.setDefaultReadOnly(sourceDatasource.getDefaultReadOnly());
}
Integer defaultTransactionIsolation = ptDataSourceConf.getIntProperty("defaultTransactionIsolation");
if (defaultTransactionIsolation != null) {
target.setDefaultTransactionIsolation(defaultTransactionIsolation);
} else {
target.setDefaultTransactionIsolation(sourceDatasource.getDefaultTransactionIsolation());
}
String defaultCatalog = ptDataSourceConf.getProperty("defaultCatalog");
if (StringUtils.isNotBlank(defaultCatalog)) {
target.setDefaultCatalog(defaultCatalog);
} else {
target.setDefaultCatalog(sourceDatasource.getDefaultCatalog());
}
String evictionPolicyClassName = ptDataSourceConf.getProperty("evictionPolicyClassName");
if (StringUtils.isNotBlank(evictionPolicyClassName)) {
target.setEvictionPolicyClassName(evictionPolicyClassName);
} else {
target.setEvictionPolicyClassName(sourceDatasource.getEvictionPolicyClassName());
}
Boolean fastFailValidation = ptDataSourceConf.getBooleanProperty("fastFailValidation");
if (fastFailValidation != null) {
target.setFastFailValidation(fastFailValidation);
} else {
target.setFastFailValidation(sourceDatasource.getFastFailValidation());
}
Integer maxIdle = ptDataSourceConf.getIntProperty("maxIdle");
if (maxIdle != null) {
target.setMaxIdle(maxIdle);
} else {
target.setMaxIdle(sourceDatasource.getMaxIdle());
}
Integer minIdle = ptDataSourceConf.getIntProperty("minIdle");
if (minIdle != null) {
target.setMinIdle(minIdle);
} else {
target.setMinIdle(sourceDatasource.getMinIdle());
}
Integer initialSize = ptDataSourceConf.getIntProperty("initialSize");
if (initialSize != null) {
target.setInitialSize(initialSize);
} else {
target.setInitialSize(sourceDatasource.getInitialSize());
}
Boolean poolPreparedStatements = ptDataSourceConf.getBooleanProperty("poolPreparedStatements");
if (poolPreparedStatements != null) {
target.setPoolPreparedStatements(poolPreparedStatements);
} else {
target.setPoolPreparedStatements(sourceDatasource.isPoolPreparedStatements());
}
Long softMinEvictableIdleTimeMillis = ptDataSourceConf.getLongProperty("softMinEvictableIdleTimeMillis");
if (softMinEvictableIdleTimeMillis != null) {
target.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
} else {
target.setSoftMinEvictableIdleTimeMillis(sourceDatasource.getSoftMinEvictableIdleTimeMillis());
}
Integer maxOpenPreparedStatements = ptDataSourceConf.getIntProperty("maxOpenPreparedStatements");
if (maxOpenPreparedStatements != null) {
target.setMaxOpenPreparedStatements(maxOpenPreparedStatements);
} else {
target.setMaxOpenPreparedStatements(sourceDatasource.getMaxOpenPreparedStatements());
}
Boolean testOnBorrow = ptDataSourceConf.getBooleanProperty("testOnBorrow");
if (testOnBorrow != null) {
target.setTestOnBorrow(testOnBorrow);
} else {
target.setTestOnBorrow(sourceDatasource.getTestOnBorrow());
}
Integer maxTotal = ptDataSourceConf.getIntProperty("maxTotal");
if (maxTotal != null) {
target.setMaxTotal(maxTotal);
} else {
target.setMaxTotal(sourceDatasource.getMaxTotal());
}
Boolean testOnCreate = ptDataSourceConf.getBooleanProperty("testOnCreate");
if (testOnCreate != null) {
target.setTestOnCreate(testOnCreate);
} else {
target.setTestOnCreate(sourceDatasource.getTestOnCreate());
}
Boolean testOnReturn = ptDataSourceConf.getBooleanProperty("testOnReturn");
if (testOnReturn != null) {
target.setTestOnReturn(testOnReturn);
} else {
target.setTestOnReturn(sourceDatasource.getTestOnReturn());
}
Long timeBetweenEvictionRunsMillis = ptDataSourceConf.getLongProperty("timeBetweenEvictionRunsMillis");
if (timeBetweenEvictionRunsMillis != null) {
target.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
} else {
target.setTimeBetweenEvictionRunsMillis(sourceDatasource.getTimeBetweenEvictionRunsMillis());
}
Integer numTestsPerEvictionRun = ptDataSourceConf.getIntProperty("numTestsPerEvictionRun");
if (numTestsPerEvictionRun != null) {
target.setNumTestsPerEvictionRun(Integer.valueOf(numTestsPerEvictionRun));
} else {
target.setNumTestsPerEvictionRun(sourceDatasource.getNumTestsPerEvictionRun());
}
Long minEvictableIdleTimeMillis = ptDataSourceConf.getLongProperty("minEvictableIdleTimeMillis");
if (minEvictableIdleTimeMillis != null) {
target.setMinEvictableIdleTimeMillis(Long.valueOf(minEvictableIdleTimeMillis));
} else {
target.setMinEvictableIdleTimeMillis(sourceDatasource.getMinEvictableIdleTimeMillis());
}
Boolean testWhileIdle = ptDataSourceConf.getBooleanProperty("testWhileIdle");
if (testWhileIdle != null) {
target.setTestWhileIdle(testWhileIdle);
} else {
target.setTestWhileIdle(sourceDatasource.getTestWhileIdle());
}
String validationQuery = ptDataSourceConf.getProperty("validationQuery");
if (StringUtils.isNotBlank(validationQuery)) {
target.setValidationQuery(validationQuery);
} else {
target.setValidationQuery(sourceDatasource.getValidationQuery());
}
Integer validationQueryTimeout = ptDataSourceConf.getIntProperty("validationQueryTimeout");
if (validationQueryTimeout != null) {
target.setValidationQueryTimeout(validationQueryTimeout);
} else {
target.setValidationQueryTimeout(sourceDatasource.getValidationQueryTimeout());
}
String connectionInitSqls = ptDataSourceConf.getProperty("connectionInitSqls");
if (StringUtils.isNotBlank(connectionInitSqls)) {
target.setConnectionInitSqls(Arrays.asList(StringUtils.split(connectionInitSqls, ';')));
} else {
target.setConnectionInitSqls(sourceDatasource.getConnectionInitSqls());
}
Boolean accessToUnderlyingConnectionAllowed = ptDataSourceConf.getBooleanProperty("accessToUnderlyingConnectionAllowed");
if (accessToUnderlyingConnectionAllowed != null) {
target.setAccessToUnderlyingConnectionAllowed(accessToUnderlyingConnectionAllowed);
} else {
target.setAccessToUnderlyingConnectionAllowed(sourceDatasource.isAccessToUnderlyingConnectionAllowed());
}
Integer removeAbandonedTimeout = ptDataSourceConf.getIntProperty("removeAbandonedTimeout");
if (removeAbandonedTimeout != null) {
target.setRemoveAbandonedTimeout(removeAbandonedTimeout);
} else {
target.setRemoveAbandonedTimeout(sourceDatasource.getRemoveAbandonedTimeout());
}
Boolean logAbandoned = ptDataSourceConf.getBooleanProperty("logAbandoned");
if (logAbandoned != null) {
target.setLogAbandoned(logAbandoned);
} else {
target.setLogAbandoned(sourceDatasource.getLogAbandoned());
}
return target;
}
@SuppressWarnings("unchecked")
private static ShadowDatabaseConfig selectMatchPtDataSourceConfiguration(BasicDataSource source, Map<String, ShadowDatabaseConfig> shadowDbConfigurations) {
BasicDataSource dataSource = source;
String key = DbUrlUtils.getKey(dataSource.getUrl(), dataSource.getUsername());
ShadowDatabaseConfig shadowDatabaseConfig = shadowDbConfigurations.get(key);
if (shadowDatabaseConfig == null) {
key = DbUrlUtils.getKey(dataSource.getUrl(), null);
shadowDatabaseConfig = shadowDbConfigurations.get(key);
}
return shadowDatabaseConfig;
}
}
|
[
"[email protected]"
] | |
d74a6cede24ff07aba3d80c86da964f1e23e0cd8
|
8c66742a996e40cf924fbccae958a11d0315fa14
|
/app/src/main/java/com/felece/hybris/UI/Adapters/CatalogsListRecylerViewAdapter.java
|
2823bbc452baedb2c2b695630a556db923d563de
|
[] |
no_license
|
hsmnzaydn/hybris-mobile-sdk
|
2237384c3764e0360293d64b21d503dfd75ccbc9
|
72674f49f5f01d3faffdd7cdaed4646768200161
|
refs/heads/master
| 2020-05-24T01:40:29.938489 | 2019-05-18T11:29:15 | 2019-05-18T11:29:15 | 187,039,130 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,646 |
java
|
package com.felece.hybris.UI.Adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.felece.hybris.R;
import com.felece.hybris_network_sdk.data.network.entities.catalog.Catalog;
import com.felece.hybris_network_sdk.data.network.entities.catalog.CategoryHierarchy;
import com.felece.hybris_network_sdk.data.network.entities.product.Category;
import com.felece.hybris_network_sdk.data.network.entities.user.Address;
import com.squareup.picasso.Picasso;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class CatalogsListRecylerViewAdapter extends RecyclerView.Adapter<CatalogsListRecylerViewAdapter.ViewHolder> {
private List<CategoryHierarchy> myItems;
private ItemListener myListener;
public CatalogsListRecylerViewAdapter(List<CategoryHierarchy> items, ItemListener listener) {
myItems = items;
myListener = listener;
}
public void setListener(ItemListener listener) {
myListener = listener;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(parent.getContext())
.inflate(R.layout.row_catalog, parent, false)); // TODO
}
@Override
public int getItemCount() {
return myItems.size();
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.setData(myItems.get(position));
}
public interface ItemListener {
void onItemClick(CategoryHierarchy item);
}
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public CategoryHierarchy item;
@BindView(R.id.row_catalog_image_view)
ImageView rowCatalogImageView;
@BindView(R.id.row_catalog_name_textview)
TextView textView;
public ViewHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);
ButterKnife.bind(this, itemView);
}
public void setData(CategoryHierarchy item) {
this.item = item;
Picasso.get().load("https://images-na.ssl-images-amazon.com/images/I/71mVF%2B93MPL._SY606_.jpg").into(rowCatalogImageView);
textView.setText(item.getName());
}
@Override
public void onClick(View v) {
if (myListener != null) {
myListener.onItemClick(item);
}
}
}
}
|
[
"hasan194"
] |
hasan194
|
abb0bfe1d5ce97d0d9d7554677aa4286796bf998
|
ceff89df6efcef627f4dbe92979bbdfc6a9a8857
|
/MediaOfTheWeek/src/mavisBeacon/motw/RecentActivity.java
|
a13edcd738c58c4316ced4581964d912a0e37648
|
[] |
no_license
|
nighthawk6389/EclipseProjects
|
ca2e30f7d3c547bff8cb0828c358616da86c087b
|
5e65048aacb18e8955699bab65150d4c2c011af5
|
refs/heads/master
| 2020-03-25T03:56:28.145091 | 2018-08-03T02:51:15 | 2018-08-03T02:51:15 | 143,369,163 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,963 |
java
|
package mavisBeacon.motw;
import java.util.List;
import java.util.Map;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
public class RecentActivity extends MediaTab {
private String titleName = "Weekly";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.updateView(false);
}
@Override
protected View getActivityStructureView(Map<String,List> holder){
LinearLayout ll = this.createMediaLinearLayout();
String date = this.getDateFromHolder(holder);
TextView title = this.createCategoryTitle(titleName + " from " + date);
TextView weeklyMessage = this.createWeeklyMessage(holder);
TextView winnersTitle = this.createCategoryTitle("Winners");
TextView videosTitle = this.createCategoryTitle("Videos");
TextView articlesTitle = this.createCategoryTitle("Articles");
TableLayout winnersTable = this.createMediaTable(holder, "winners");
TableLayout videosTable = this.createMediaTable(holder, "videos");
TableLayout articlesTable = this.createMediaTable(holder, "articles");
ll.addView(title);
if(weeklyMessage != null)
ll.addView(weeklyMessage);
ll.addView(this.createBreakLine());
ll.addView(winnersTitle);
ll.addView(this.createBreakLine());
ll.addView(winnersTable);
ll.addView(videosTitle);
ll.addView(this.createBreakLine());
ll.addView(videosTable);
ll.addView(articlesTitle);
ll.addView(this.createBreakLine());
ll.addView(articlesTable);
//SmartScrollView sv = new SmartScrollView(this,this);
//sv.addView(ll);
return ll;
}
}
|
[
"[email protected]"
] | |
00945d3d699862ef3fa4724d1b5fc8e4a725d54a
|
361d763a05fbb223ecd3a8292b227e290a3418b8
|
/firstModul/src/SwapVars.java
|
7ae435b162edb7421011229d35d64b6970b9207c
|
[] |
no_license
|
Dm-vp/firstStep
|
655dba693af11eed9ac0c4593727d797088b9df2
|
da518536899fb103a39ed22d494c625bc97df65b
|
refs/heads/master
| 2021-01-01T04:58:24.647445 | 2016-05-03T18:18:29 | 2016-05-03T18:18:29 | 56,967,875 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 306 |
java
|
/**
* Created by сони on 09.03.2016.
*/
public class SwapVars {
public static void main(String[] args) {
int i=3, j=5, n;
System.out.println("БЫЛО i= "+i+", j= "+j);
n=i;
i=j;
j=n;
System.out.println("СТАЛО i= "+i+", j= "+j);
}
}
|
[
"Dmitry Pisarenko"
] |
Dmitry Pisarenko
|
97329b0fa0aaf2cf79b6bafba62e4d5b610ca379
|
a5ae2cab0d66930e713c95187dd41f16fce91fe3
|
/src/main/java/guru/springfamework/api/v1/mapper/CategoryMapper.java
|
31c67b3756f1892878adee939b03b091ce596eab
|
[] |
no_license
|
jinxTelesis/spring5-mvc-RESTPRI
|
3ece470be2fbfd42185b78a3566825b5fb02bc28
|
8aa2590aea8c5567a02a66fd7666dbc7cda8904b
|
refs/heads/master
| 2020-04-27T23:30:48.469489 | 2019-03-16T01:07:00 | 2019-03-16T01:07:00 | 174,779,045 | 0 | 0 | null | 2019-03-16T01:07:01 | 2019-03-10T04:48:47 |
Java
|
UTF-8
|
Java
| false | false | 385 |
java
|
package guru.springfamework.api.v1.mapper;
import guru.springfamework.api.v1.model.CategoryDTO;
import guru.springfamework.domain.Category;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface CategoryMapper {
CategoryMapper INSTANCE = Mappers.getMapper(CategoryMapper.class);
CategoryDTO categoryToCategoryDTO(Category category);
}
|
[
"[email protected]"
] | |
2f936842c8571444091fb6991da474d18b525c20
|
2da02312b9fdd88303a0f96deeae341e9fd0bf0f
|
/src/ec/edu/ups/entidades/CitasMedicas.java
|
a259a0b773df63beca75423c08f50fc21b7be422
|
[] |
no_license
|
JavierYungaT/YungaTacuri-Edisson-ExamenFinal
|
e6b57a0912e171bf982e8eac41b8859019ecd85c
|
d51256c09a1115b28d98e18025043dc66557c9ec
|
refs/heads/master
| 2022-11-22T18:32:54.227853 | 2020-07-28T17:04:52 | 2020-07-28T17:04:52 | 283,235,069 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,018 |
java
|
package ec.edu.ups.entidades;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@Entity
public class CitasMedicas implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String signosVitales;
private String sintomas;
private String alergias;
private String enferPrevias;
private String fecha;
@ManyToOne
private Paciente paciente;
@Transient
private boolean editable;
public CitasMedicas() {
}
public CitasMedicas(String signosVitales, String sintomas, String alergias, String enferPrevias,
String fecha, Paciente paciente) {
this.signosVitales = signosVitales;
this.sintomas = sintomas;
this.alergias = alergias;
this.enferPrevias = enferPrevias;
this.fecha = fecha;
this.paciente = paciente;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public String getSignosVitales() {
return signosVitales;
}
public void setSignosVitales(String signosVitales) {
this.signosVitales = signosVitales;
}
public String getSintomas() {
return sintomas;
}
public void setSintomas(String sintomas) {
this.sintomas = sintomas;
}
public String getAlergias() {
return alergias;
}
public void setAlergias(String alergias) {
this.alergias = alergias;
}
public String getEnferPrevias() {
return enferPrevias;
}
public void setEnferPrevias(String enferPrevias) {
this.enferPrevias = enferPrevias;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
public Paciente getPaciente() {
return paciente;
}
public void setPaciente(Paciente paciente) {
this.paciente = paciente;
}
public boolean isEditable() {
return editable;
}
public void setEditable(boolean editable) {
this.editable = editable;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CitasMedicas other = (CitasMedicas) obj;
if (id != other.id)
return false;
return true;
}
@Override
public String toString() {
return "CitasMedicas [id=" + id + ", signosVitales=" + signosVitales + ", sintomas=" + sintomas + ", alergias="
+ alergias + ", enferPrevias=" + enferPrevias + ", fecha=" + fecha + ", paciente=" + paciente
+ ", editable=" + editable + "]";
}
}
|
[
"[email protected]"
] | |
5bc839b7f65233a6471f92dc569c3b74710b7632
|
01a70a1a9f8aaf3fc9ece67513980c4f9d33b060
|
/triaje-digital-covid19-ws/fuentes/src/main/java/pe/com/covid/api/AutenticacionApi.java
|
34f5ae8273c1b7be4ef09e4256fddf979298d143
|
[] |
no_license
|
cvalenciap/zworkspacCOVv1.1
|
bde73823e89ab45a8122846c23292ab48893b223
|
b25beb7fe75d9270cf051ea9b45e395fdac21fa1
|
refs/heads/master
| 2023-05-04T02:04:59.172442 | 2021-05-06T02:43:41 | 2021-05-06T02:43:41 | 364,761,845 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,944 |
java
|
package pe.com.covid.api;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMethod;
import pe.com.covid.model.Respuesta;
import pe.com.covid.service.AutenticacionService;
import pe.com.gmd.util.exception.GmdException;
@RestController
@RequestMapping(value = { "/api/autenticacion-usuario/" }, method = { RequestMethod.POST }, produces = {
"application/JSON" }, consumes = { "application/JSON" })
public class AutenticacionApi {
@Autowired
private AutenticacionService service;
@PostMapping(path = { "/aut-nuevo-usu" }, produces = { "application/json" })
public ResponseEntity<Respuesta> ValidarClave(@RequestBody Map<String, String> requestParm) throws GmdException {
Respuesta resultadoCons = service.validarClave(requestParm);
return new ResponseEntity<Respuesta>(resultadoCons, HttpStatus.OK);
}
@PostMapping(path = { "/recuperar-contrasena" }, produces = { "application/json" })
public ResponseEntity<Respuesta> ValidarCorreoRC(@RequestBody Map<String, String> requestParm) throws GmdException {
Respuesta resultadoCons = service.validarCorreoRecupClave(requestParm);
return new ResponseEntity<Respuesta>(resultadoCons, HttpStatus.OK);
}
@PostMapping(path = { "/actualizar-contrasena" }, produces = { "application/json" })
public ResponseEntity<Respuesta> ActualizarContrasena(@RequestBody Map<String, String> requestParm) throws GmdException {
Respuesta resultadoCons = service.actualizarClave(requestParm);
return new ResponseEntity<Respuesta>(resultadoCons, HttpStatus.OK);
}
}
|
[
"[email protected]"
] | |
8e0a26b255a05f60493302b5fdaf1fce7d77aee9
|
0a65f11414da7dd2cafb087119f828f3ba2d9b22
|
/SwipeRefreshTest/src/main/java/com/xpc/swiperefresh/BaseActivity.java
|
e7b7e4bf34aa7a1b13e8e9db25c07113a200172a
|
[] |
no_license
|
xpc254/XiepcSimpleProject
|
0c7a0e541dac4759db0f34f213bbed40a066795c
|
5669e5ddd53665ea5fe495ce23b0cbc7ab9a98fd
|
refs/heads/master
| 2020-09-16T03:57:00.870288 | 2016-09-11T16:11:31 | 2016-09-11T16:11:31 | 67,876,597 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,740 |
java
|
package com.xpc.swiperefresh;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout;
/**
* Created by xiepc on 2016/9/11 0011 23:03
*/
public class BaseActivity extends AppCompatActivity{
@Override
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
}
protected void setStatusBar(Activity activity, int color){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
activity.getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark)); //5.0以上的实现沉浸式状态栏
}else{
setColor(activity,color); //4.4版本实现沉浸式状态栏
}
}
/** * 设置状态栏颜色 * * @param activity 需要设置的activity * @param color 状态栏颜色值 */
private void setColor(Activity activity, int color) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// 设置状态栏透明
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// 生成一个状态栏大小的矩形
View statusView = createStatusView(activity, color);
// 添加 statusView 到布局中
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
decorView.addView(statusView);
// 设置根布局的参数
ViewGroup rootView = (ViewGroup) ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0);
rootView.setFitsSystemWindows(true);
rootView.setClipToPadding(true);
}
}
/** * 生成一个和状态栏大小相同的矩形条 * * @param activity 需要设置的activity * @param color 状态栏颜色值 * @return 状态栏矩形条 */
private View createStatusView(Activity activity, int color) {
// 获得状态栏高度
int resourceId = activity.getResources().getIdentifier("status_bar_height", "dimen", "android");
int statusBarHeight = activity.getResources().getDimensionPixelSize(resourceId);
// 绘制一个和状态栏一样高的矩形
View statusView = new View(activity);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
statusBarHeight);
statusView.setLayoutParams(params);
statusView.setBackgroundColor(color);
return statusView;
}
}
|
[
"[email protected]"
] | |
22faf5922e20d3f5144511680789a4f2155956b0
|
16331fa33db07fec81c43d6591fb63e940fae703
|
/Celcius.java
|
dd2f30e49fda692620d9c11fedbbee8d4b488fb3
|
[] |
no_license
|
RidwanNullah/Tugas-PBO
|
4e3610bf74d06e932a346938c41c031dc0061a80
|
51dfe2124c8606591e491ca412b70f45c23bba26
|
refs/heads/main
| 2023-02-03T16:30:36.900536 | 2020-12-19T13:01:53 | 2020-12-19T13:01:53 | 322,037,913 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 291 |
java
|
package tugas5;
import pbo.KonversiSuhu;
public class Celcius {
double toFahrenheit(){
return (KonversiSuhu.suhuAwal *1.8+32); }
double toReamur(){return (KonversiSuhu.suhuAwal*0.8); }
double toKelvin(){
return (KonversiSuhu.suhuAwal*273.15);
}
}
|
[
"[email protected]"
] | |
9330325428d98ecc5b3602d9808ed909ffced143
|
4ebda311ee7429ccdc2434258baa1ec645554c70
|
/src/com/example/android/hcgallery/WelcomeActivity.java
|
60c779665c3730579f5d9382faf063aa49371463
|
[] |
no_license
|
iantoniou1/MyLamia
|
5059e5e539014adc28e47c09cd450d9de8be7d61
|
6b51301cf3c19f0c288c7330e108cd502884ca9f
|
refs/heads/master
| 2021-01-01T05:51:56.741810 | 2015-03-07T21:09:15 | 2015-03-07T21:09:15 | 27,041,632 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 316 |
java
|
package com.example.android.hcgallery;
import android.app.Activity;
import android.os.Bundle;
public class WelcomeActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_welcome);
}
}
|
[
"[email protected]"
] | |
fb3fd9ddbebd5d92a50d59480eb5d3bf3a7233fa
|
2fc18475ffdde87d51b68b2dae825a50c283464b
|
/src/Card.java
|
44358da2384c8b3dcd133e8a1c0587066da94826
|
[] |
no_license
|
ScotsonPike/DeckOfCards
|
5895c5d2e241755b2917449c23e050f6c2e48caf
|
39b147efda90e2ccea7fa4ba05d972804c77e650
|
refs/heads/main
| 2023-01-30T09:22:43.670985 | 2020-11-17T21:40:24 | 2020-11-17T21:40:24 | 311,111,640 | 0 | 1 | null | 2020-12-10T16:38:38 | 2020-11-08T17:01:21 |
Java
|
UTF-8
|
Java
| false | false | 1,865 |
java
|
/*
* The Card class represents a playing card. These objects are
* instantiated by the Deck class. Ace's are high, the number
* field is used to compare cards.
* */
public class Card implements Comparable{
private Suit suit;
private int number; //remove, use getters from CardType
private String type; //remove
private Magic magic = null; //remove
private boolean magicInUse = false; //remove (maybe not be needed)
public Card(Suit suit, int number) {
this.suit = suit;
this.number = number;
switch(number) {
//place in CardType
case 1:
type = "Ace";
setNumber(14);
break;
case 2:
magic = Magic.startAgain;
break;
case 7:
magic = Magic.seeThrough;
break;
case 8:
magic = Magic.missAGo;
break;
case 9:
magic = Magic.playBelow;
break;
case 10:
magic = Magic.burn;
case 11:
type = "Jack";
break;
case 12:
type = "Queen";
break;
case 13:
type = "King";
break;
}
if(number > 1 && number < 11) {
type = Integer.toString(number);
}
}
public boolean getMagicInUse() {
return magicInUse;
}
public void flipMagicInUse() {
if(magicInUse == false) {
magicInUse = true;
}
else {
magicInUse = false;
}
}
public Suit getSuit() {
return suit;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public String getType() {
return type;
}
public String printCard() {
return type + " of " + suit;
}
public Magic getMagic() {
return magic;
}
@Override
public int compareTo(Object compareCard) {
int compareNum = ((Card)compareCard).getNumber();
return this.number-compareNum;
}
@Override
public String toString() {
return "[ suit= " + suit + ", number=" + number + ", type=" + type + "]";
}
}
|
[
"[email protected]"
] | |
52dd0d5e5da186e84f6cd9cbf7936ea7a55780bd
|
64f0a73f1f35078d94b1bc229c1ce6e6de565a5f
|
/dataset/Top APKs Java Files/com.greyhound.mobile.consumer-com-iovation-mobile-android-details-a-a.java
|
08d67acfcd5f926c96a5230c3673024501fa2a06
|
[
"MIT"
] |
permissive
|
S2-group/mobilesoft-2020-iam-replication-package
|
40d466184b995d7d0a9ae6e238f35ecfb249ccf0
|
600d790aaea7f1ca663d9c187df3c8760c63eacd
|
refs/heads/master
| 2021-02-15T21:04:20.350121 | 2020-10-05T12:48:52 | 2020-10-05T12:48:52 | 244,930,541 | 2 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,272 |
java
|
package com.iovation.mobile.android.details.a;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.location.Location;
import android.location.LocationManager;
import android.provider.Settings.Secure;
import android.provider.Settings.SettingNotFoundException;
import com.iovation.mobile.android.details.c;
import com.iovation.mobile.android.details.j;
import com.iovation.mobile.android.details.k;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class a
implements c
{
private static boolean b = false;
private static Location f;
protected int a = 0;
private Context c;
private long d = 0L;
private com.iovation.mobile.android.details.a.a.a e = new com.iovation.mobile.android.details.a.a.a(this);
public a() {}
public void a(int paramInt)
{
this.a = paramInt;
}
public void a(Context paramContext)
{
((LocationManager)paramContext.getSystemService("location")).removeUpdates(this.e);
}
public void a(Context paramContext, j paramJ)
{
int i = 0;
if (k.a("android.permission.ACCESS_FINE_LOCATION", paramContext))
{
LocationManager localLocationManager = (LocationManager)paramContext.getSystemService("location");
do
{
for (;;)
{
try
{
bool1 = localLocationManager.isProviderEnabled("gps");
try
{
boolean bool2 = localLocationManager.isProviderEnabled("network");
i = bool2;
}
catch (Exception localException2)
{
String str1;
Object localObject;
continue;
String str2 = "gps";
continue;
}
paramJ.a("LSEN", "TRUE");
if ((bool1) && (i == 0))
{
paramJ.a("LSG", "GPS");
str1 = "gps";
if (str1 != null) {
break;
}
return;
}
}
catch (Exception localException1)
{
boolean bool1 = false;
continue;
if ((!bool1) && (i != 0))
{
paramJ.a("LSG", "NET");
localObject = "network";
continue;
}
if ((!bool1) && (i == 0))
{
paramJ.a("LSG", "NONE");
localObject = "gps";
continue;
}
if (!bool1) {
break label334;
}
}
if (i == 0) {
break label334;
}
paramJ.a("LSG", "BOTH");
localObject = "gps";
}
if (f == null) {
f = localLocationManager.getLastKnownLocation((String)localObject);
}
if (f != null) {
break;
}
f = localLocationManager.getLastKnownLocation("network");
} while (f == null);
localObject = b(paramContext);
paramJ.a("LAT", Double.toString(f.getLatitude()));
paramJ.a("LON", Double.toString(f.getLongitude()));
paramJ.a("ALT", Double.toString(f.getAltitude()));
paramJ.a("GLA", Float.toString(f.getAccuracy()));
paramJ.a("GLD", Long.toString(f.getTime()));
paramJ.a("MOCK", Integer.toString(((ArrayList)localObject).size()));
paramJ.a("MLS", Integer.toString(c(paramContext)));
paramJ.a("NMEA", Integer.toString(this.a));
return;
}
paramJ.a("LSEN", "FALSE");
}
public void a(Location paramLocation)
{
f = paramLocation;
if (f.getAccuracy() <= 100.0F) {
a(this.c);
}
}
public ArrayList b(Context paramContext)
{
ArrayList localArrayList = new ArrayList();
PackageManager localPackageManager = paramContext.getPackageManager();
Iterator localIterator = localPackageManager.getInstalledApplications(128).iterator();
for (;;)
{
ApplicationInfo localApplicationInfo;
if (localIterator.hasNext()) {
localApplicationInfo = (ApplicationInfo)localIterator.next();
}
try
{
String[] arrayOfString = localPackageManager.getPackageInfo(localApplicationInfo.packageName, 4096).requestedPermissions;
if (arrayOfString != null)
{
int i = 0;
while (i < arrayOfString.length)
{
if ((arrayOfString[i].equals("android.permission.ACCESS_MOCK_LOCATION")) && (!localApplicationInfo.packageName.equals(paramContext.getPackageName()))) {
localArrayList.add(localApplicationInfo.packageName);
}
i += 1;
}
return localArrayList;
}
}
catch (Exception localException) {}catch (PackageManager.NameNotFoundException localNameNotFoundException) {}
}
}
public int c(Context paramContext)
{
try
{
int i = Settings.Secure.getInt(paramContext.getContentResolver(), "mock_location");
if (i == 1) {
return 1;
}
}
catch (Settings.SettingNotFoundException paramContext)
{
return -1;
}
return 0;
}
}
|
[
"[email protected]"
] | |
e72fbba1e3203406e14820587903c86bed922fb8
|
03fd9f1c914a2918eb33c6cd64c8fee94e61df86
|
/src/estudiante.java
|
5c5eab3ac01df85693d0249a81735b55e4b5232f
|
[] |
no_license
|
cheverria/Traajo-Grupo1
|
bfff406ee1d541004ebd37f4ca8cf7226f13b247
|
d188817dd366d4d6b516d0613eb1f9d270e6fdfb
|
refs/heads/master
| 2020-06-19T08:22:01.364780 | 2019-07-13T16:31:50 | 2019-07-13T16:31:50 | 196,636,456 | 2 | 0 | null | 2019-07-12T19:44:19 | 2019-07-12T19:44:19 | null |
UTF-8
|
Java
| false | false | 1,307 |
java
|
public class estudiante extends Persona {
private int numlista;
String sexo;
private float nota;
public estudiante (String nombre ,String apellido, int edad, int numlista, float nota, String sexo ) {
super ( nombre, apellido, edad );
this.numlista= numlista;
this.nota=nota;
this.sexo=sexo;
}
public void verDatos () {
System.out.println("Nombre:" + getNombre());
System.out.println("Nombre:" + getApellido());
System.out.println("Nombre:" + getEdad());
System.out.println("numlista:" + numlista );
System.out.println("sexo:" + sexo );
System.out.println("nota:" + nota );
}
public int getNumlista() {
return numlista;
}
public void setNumlista(int numlista) {
this.numlista = numlista;
}
public String getSexo() {
return sexo;
}
public void setSexo(String sexo) {
this.sexo = sexo;
}
public float getNota() {
return nota;
}
public void setNota(float nota) {
this.nota = nota;
}
}
|
[
"[email protected]"
] | |
7fff0e8c448e70674b9ebbcf31fb297756a75e1b
|
9ecbc437bd1db137d8f6e83b7b4173eb328f60a9
|
/src/javax/realtime/util/ThreadBoundExecutor.java
|
0aeec4d245dc58119dadc366ceaa2eb31507caa5
|
[] |
no_license
|
giraffe/jrate
|
7eabe07e79e7633caae6522e9b78c975e7515fe9
|
764bbf973d1de4e38f93ba9b9c7be566f1541e16
|
refs/heads/master
| 2021-01-10T18:25:37.819466 | 2013-07-20T12:28:23 | 2013-07-20T12:28:23 | 11,545,290 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 19,463 |
java
|
// ************************************************************************
// $Id: ThreadBoundExecutor.java 467 2004-12-22 21:58:06Z mdeters $
// ************************************************************************
//
// jRate
//
// Copyright (C) 2001-2004 by Angelo Corsaro.
// <[email protected]>
// All Rights Reserved.
//
// Permission to use, copy, modify, and distribute this software and
// its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. I don't make any representations
// about the suitability of this software for any purpose. It is
// provided "as is" without express or implied warranty.
//
//
// *************************************************************************
//
// *************************************************************************
package javax.realtime.util;
import javax.realtime.MemoryParameters;
import javax.realtime.ReleaseParameters;
import javax.realtime.SchedulingParameters;
import javax.realtime.MemoryArea;
import javax.realtime.ProcessingGroupParameters;
import javax.realtime.Scheduler;
import javax.realtime.RealtimeThread;
import javax.realtime.NoHeapRealtimeThread;
import javax.realtime.Schedulable;
import javax.realtime.ScopedMemory;
import javax.realtime.ImmortalMemory;
/**
* This class implements an {@link Executor} that has permanently a
* thread bound.
*
* @author <a href="mailto:[email protected]">Angelo Corsaro</a>
* @version 1.0
*/
public class ThreadBoundExecutor implements Executor {
protected RealtimeThread thread;
protected boolean active = false;
protected ExecutorLogic executorLogic = new ExecutorLogic();
protected int executionEligibility = -1;
///////////////////////////////////////////////////////////////////////////
// Inner Classes
//
static private class ExecutorLogic implements Runnable {
private Runnable task;
private boolean active;
protected EventVariable taskAvailableEvent;
protected EventVariable executorIdleEvent;
protected boolean isIdle;
ExecutorLogic() {
active = true;
this.taskAvailableEvent = new EventVariable();
this. executorIdleEvent =
new EventVariable(true); // Create a "signaled" event
this.isIdle = true;
}
void shutdown() {
if (this.active()) {
final ExecutorLogic logic = this;
Runnable shutDownLogic = new Runnable() {
public void run() {
logic.active(false);
}
};
try {
this.execute(shutDownLogic);
} catch (ShutdownExecutorException e) {
e.printStackTrace();
}
shutDownLogic = null;
}
}
void execute(Runnable task) throws ShutdownExecutorException {
// System.out.println(">> ExecutorLogic.execute()");
if (!this.active())
throw new ShutdownExecutorException(">> Unable to execute logic, ThreadBoundExecutor" +
"has been already shut down");
try {
// System.out.println(">> ExecutorLogic: Waiting for Idle Event");
executorIdleEvent.await();
this.isIdle(false);
if (!this.active())
throw new ShutdownExecutorException(">> Unable to execute logic, ThreadBoundExecutor" +
"has been already shut down");
this.task = task;
// System.out.println(">> ExecutorLogic: Signaling Available Task Event");
taskAvailableEvent.signal();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public void run() {
try {
while (this.active) {
// System.out.println("#>> ExecutorLogic: Waiting for some Task");
taskAvailableEvent.await();
// System.out.println("#>> ExecutorLogic: Running Task " + this.task);
this.task.run();
// System.out.println("#>> ExecutorLogic: Signaling Idle Event");
executorIdleEvent.signal();
this.isIdle(true);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
synchronized boolean active() {
return this.active;
}
synchronized void active(boolean bool) {
this.active = bool;
}
synchronized boolean isIdle() {
return this.isIdle;
}
private synchronized void isIdle(boolean bool) {
this.isIdle = bool;
}
}
//
///////////////////////////////////////////////////////////////////////////
/**
* Creates a new <code>ThreadBoundExecutor</code> instance with the
* specified parameters.
*
* @param schedulingParam a <code>SchedulingParameters</code> value
* which will be associated with the constructed instance of this.
* If <code>null</code> this will be assigned the reference to the
* {@link SchedulingParameters} of the current thread.
* @param releaseParam a <code>ReleaseParameters</code> value
* which will be associated with the constructed instance of this.
* If null this will have no {@link ReleaseParameters}.
* @param memoryParam a <code>MemoryParameters</code> value which
* will be associated with the constructed instance of this. If
* null this will have no {@link MemoryParameters}.
* @param memoryArea The {@link MemoryArea} for this
* <code>ThreadBoundExecutor</code>. If null, inherit the current
* memory area at the time of construction. The initial memory
* area must be a reference to a {@link ScopedMemory} or {@link
* ImmortalMemory} object if <code>noheap</code> is
* <code>true</code>.
* @param groupParam A {@link ProcessingGroupParameters} object
* to which this will be associated. If null this will not be
* associated with any processing group.
* @param noHeap A flag meaning, when <code>true</code>, that this
* will have characteristics identical to a {@link
* NoHeapRealtimeThread}. A false value means this will have
* characteristics identical to a {@link RealtimeThread}. If
* <code>true</code> and the current thread is not a {@link
* NoHeapRealtimeThread} or a {@link RealtimeThread} executing
* within a {@link ScopedMemory} or {@link ImmortalMemory} scope
* then an {@link IllegalArgumentException} is thrown.
*/
public ThreadBoundExecutor(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
boolean noHeap) throws IllegalArgumentException {
if (noHeap)
this.thread = new NoHeapRealtimeThread(schedulingParam,
releaseParam,
memoryParam,
memoryArea,
groupParam,
this.executorLogic);
else
this.thread = new RealtimeThread(schedulingParam,
releaseParam,
memoryParam,
memoryArea,
groupParam,
this.executorLogic);
this.thread.setDaemon(true);
this.thread.start();
}
/**
* Creates a new <code>ThreadBoundExecutor</code> instance with the
* specified parameters.
*
* @param schedulingParam a <code>SchedulingParameters</code> value
* which will be associated with the constructed instance of this.
* If <code>null</code> this will be assigned the reference to the
* {@link SchedulingParameters} of the current thread.
*/
public ThreadBoundExecutor(SchedulingParameters schedulingParam)
throws IllegalArgumentException
{
this(schedulingParam, null, null, null, null, false);
}
//
// -- javax.realtime.Executor Interface Methods Implementation --
//
/**
* Executes the given logic. If the logic is executed on a newly
* created thread, or of a thread is borrowed from a pool is
* implementation dependent.
*
* @param logic a <code>Runnable</code> value
* @exception ShutdownExecutorException if the
* <code>Executor</code> has already been shut down.
*/
public void execute(Runnable logic) throws ShutdownExecutorException {
// System.out.println(">> ThreadBoundExecutor.execute()");
this.executorLogic.execute(logic);
}
/**
* Releases all the resources assoiated with the executor. No
* subsequent invocation of the <code>execute()</code> method
* should be performed after the executor has been shutdown.
*
*/
public void shutdown() {
this.executorLogic.shutdown();
}
// This method is here only beacuse it is required by the
// Schedulable interface, but it not used.
public void run() { }
////////////////////////////////////////////////////////////////////////
// -- Method From javax.realtime.Schedulable --
////////////////////////////////////////////////////////////////////////
/**
* Add to the feasibility of the already set scheduler if the
* resulting feasibility set is schedulable. If successful return
* true, if not return false. If there is not an assigned
* scheduler it will return false.
*
* @return If successful return true, if not return false. If
* there is not an assigned scheduler it will return false.
*/
public boolean addIfFeasible() {
// TODO: Implement Me!!!
return false;
}
/**
* Inform the scheduler and cooperating facilities that the
* resource demands (as expressed in the associated instances of
* SchedulingParameters, ReleaseParameters,
* MemoryParameters, and ProcessingGroupParameters) of this
* instance of Schedulable will be considered in the feasibility
* analysis of the associated Scheduler until further notice.
* Whether the resulting system is feasible or not, the addition
* is completed.
*
* @return true If the resulting system is feasible.
*/
public boolean addToFeasibility() {
// TODO: Implement Me!!!
return false;
}
/**
* Get the {@link MemoryParameters} of this schedulable object.
*
* @return a <code>MemoryParameters</code> value.
*/
public MemoryParameters getMemoryParameters() {
return this.thread.getMemoryParameters();
}
/**
* Set the {@link MemoryParameters} for this schedulable object.
*
* @param memoryParam the <code>MemoryParameters</code> for this
* schedulable object.
*/
public void setMemoryParameters(MemoryParameters memoryParam) {
this.thread.setMemoryParameters(memoryParam);
}
/**
* Returns true if, after considering the value of the parameter,
* the task set would still be feasible. In this case the values
* of the parameters are changed. Returns false if, after
* considering the value of the parameter, the task set would not
* be feasible. In this case the values of the parameters are not
* changed.
*
* @param memoryParam the <code>MemoryParameters</code> for this
* schedulable object.
* @return true if the requested change keeps the system feasible.
*/
public boolean setMemoryParametersIfFeasible(MemoryParameters memoryParam) {
// TODO: Implement Me!!!
return this.thread.setMemoryParametersIfFeasible(memoryParam);
}
/**
* Get the {@link ProcessingGroupParameters} of this
* schedulable object.
*
* @return a <code>ProcessingGroupParameters</code> value
*/
public ProcessingGroupParameters getProcessingGroupParameters() {
return this.thread.getProcessingGroupParameters();
}
/**
* Set the {@link ProcessingGroupParameters} for this schedulable object.
*
* @param groupParam a <code>ProcessingGroupParameters</code> value
*/
public void setProcessingGroupParameters(ProcessingGroupParameters groupParam) {
this.thread.setProcessingGroupParameters(groupParam);
}
/**
* Set the {@link ProcessingGroupParameters} of this schedulable object
* only if the resulting task set is feasible.
*
* @param groupParam a <code>ProcessingGroupParameters</code> value
* @return Returns true if, after considering the values of the
* parameters, the task set would still be feasible. In this case
* the values of the parameters are changed. Returns false if,
* after considering the values of the parameters, the task set
* would not be feasible. In this case the values of the
* parameters are not changed.
*/
public boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters groupParam) {
return this.thread.setProcessingGroupParametersIfFeasible(groupParam);
}
/**
* Get the {@link ReleaseParameters} of this schedulable object.
*
* @return a <code>ReleaseParameters</code> value
*/
public ReleaseParameters getReleaseParameters() {
return this.thread.getReleaseParameters();
}
/**
* Set the {@link ReleaseParameters}for this schedulable object.
*
* @param releaseParam a <code>ReleaseParameters</code> value
*/
public void setReleaseParameters(ReleaseParameters releaseParam) {
this.thread.setReleaseParameters(releaseParam);
}
/**
* Returns true if, after considering the value of the parameter,
* the task set would still be feasible. In this case the values
* of the parameters are changed. Returns false if, after
* considering the value of the parameter, the task set would not
* be feasible. In this case the values of the parameters are not
* changed. the resulting task set is feasible.
*
* @param releaseParam a <code>ReleaseParameters</code> value
*/
public boolean setReleaseParametersIfFeasible(ReleaseParameters releaseParam) {
return this.thread.setReleaseParametersIfFeasible(releaseParam);
}
/**
* Get the {@link Scheduler} for this schedulable object.
*
* @return a <code>Scheduler</code> value
*/
public Scheduler getScheduler() {
return this.thread.getScheduler();
}
/**
* Set the {@link Scheduler} for this schedulable object.
*
* @param scheduler the scheduler.
* @exception IllegalThreadStateException
*/
public void setScheduler(Scheduler scheduler) throws IllegalThreadStateException {
this.thread.setScheduler(scheduler);
}
/**
* Set the {@link Scheduler} for this schedulable object.
*
* @param scheduler a <code>Scheduler</code> value
* @param schedulingParam a <code>SchedulingParameters</code> value
* @param releaseParam a <code>ReleaseParameters</code> value
* @param memoryParam a <code>MemoryParameters</code> value
* @param groupParam a <code>ProcessingGroupParameters</code> value
* @exception IllegalThreadStateException if an error occurs
*/
public void setScheduler(Scheduler scheduler,
SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
ProcessingGroupParameters groupParam)
throws IllegalThreadStateException
{
this.thread.setScheduler(scheduler,
schedulingParam,
releaseParam,
memoryParam,
groupParam);
}
/**
* Get the {@link SchedulingParameters} for this schedulable object.
*
* @return a <code>SchedulingParameters</code> value
*/
public SchedulingParameters getSchedulingParameters() {
return this.thread.getSchedulingParameters();
}
/**
* Set the {@link SchedulingParameters} for this schedulable
* object only if the resulting task set is feasible.
*
* @param schedulingParam a <code>SchedulingParameters</code> value
*/
public void setSchedulingParameters(SchedulingParameters schedulingParam) {
this.thread.setSchedulingParameters(schedulingParam);
}
/**
* Set the {@link SchedulingParameters} for this schedulable object.
*
* @param schedulingParam a <code>SchedulingParameters</code> value
* @return true if the change was feasible, false otherwise.
*/
public boolean setSchedulingParametersIfFeasible(SchedulingParameters schedulingParam) {
return this.thread.setSchedulingParametersIfFeasible(schedulingParam);
}
/**
* Inform the scheduler and cooperating facilities that the
* resource demands, as expressed in the associated instances of
* {@link SchedulingParameters}, {@link ReleaseParameters}, {@link
* MemoryParameters}, and {@link ProcessingGroupParameters}, of
* this instance of {@link Schedulable} should no longer be
* considered in the feasibility analysis of the associated {@link
* Scheduler}. Whether the resulting system is feasible or not,
* the subtrac-tion is completed.
*
* @return true If the resulting system is feasible.
*/
public boolean removeFromFeasibility() {
return this.thread.removeFromFeasibility();
}
// -- Implementation Specific Methods --
public int executionEligibility() {
if (this.executionEligibility != -1)
return this.executionEligibility;
this.executionEligibility = this.getScheduler().computeExecutionEligibility(this);
return this.executionEligibility;
}
////////////////////////////////////////////////////////////////////////////
// -- End javax.realtime.Schedulable Methods --
////////////////////////////////////////////////////////////////////////////
}
|
[
"[email protected]"
] | |
3cd61f93799a71cb461f40a52d619ae56559edae
|
e2bd6367164f2c24a2f8ae5325b9d673b2121278
|
/kodejava-2d-api/src/main/java/org/kodejava/example/geom/DrawDashedStroke.java
|
5f39c9b1622d48d35214e3353366d882bc98aa82
|
[
"BSD-2-Clause"
] |
permissive
|
kodejava/kodejava.project
|
b44d084d573ed2093340c0235dc1c36550c9623b
|
a99fdbbf5a0bca6c79dd1ee2b520d74f1d9d13d4
|
refs/heads/master
| 2022-12-24T05:59:20.518327 | 2020-03-09T23:55:01 | 2020-03-09T23:55:01 | 89,982,714 | 1 | 1 |
BSD-2-Clause
| 2022-12-06T00:41:00 | 2017-05-02T02:23:39 |
Java
|
UTF-8
|
Java
| false | false | 952 |
java
|
package org.kodejava.example.geom;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.RoundRectangle2D;
public class DrawDashedStroke extends JComponent {
@Override
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
float[] dash = {10.0f, 5.0f, 3.0f};
// Creates a dashed stroke
Stroke dashed = new BasicStroke(2.0f, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
g2.setStroke(dashed);
g2.setPaint(Color.RED);
g2.draw(new RoundRectangle2D.Double(50, 50, 300, 100, 10, 10));
}
public static void main(String[] args) {
JFrame frame = new JFrame("Draw Dashed Stroke Demo");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.getContentPane().add(new DrawDashedStroke());
frame.pack();
frame.setSize(new Dimension(420, 250));
frame.setVisible(true);
}
}
|
[
"[email protected]"
] | |
d29cafd34dc2527b2ced5e8772c1b14711639f15
|
9e195aa232bcfc6b40a6fc0648bdff8ecb36250e
|
/src/main/java/com/app/model/Product.java
|
af691fd6717c2055b9fedbd4553c660ecc3b0e2d
|
[] |
no_license
|
sivaprasad897832/SpringBootFindAllEx
|
86dc63af5d8150d6961590c07c24761d035a92bb
|
bd6cdd50fa04a414ed4dcb61471d0aa6d1e53e70
|
refs/heads/master
| 2022-06-22T01:05:10.746457 | 2019-06-14T09:57:35 | 2019-06-14T09:57:35 | 191,915,604 | 0 | 0 | null | 2022-06-21T01:16:52 | 2019-06-14T09:30:41 |
Java
|
UTF-8
|
Java
| false | false | 1,090 |
java
|
package com.app.model;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Product {
@Id
private Integer prodId;
private String prodCode;
private Double prodCost;
public Product() {
super();
}
public Product(Integer prodId, String prodCode, Double prodCost) {
super();
this.prodId = prodId;
this.prodCode = prodCode;
this.prodCost = prodCost;
}
public Product(String prodCode, Double prodCost) {
super();
this.prodCode = prodCode;
this.prodCost = prodCost;
}
public Integer getProdId() {
return prodId;
}
public void setProdId(Integer prodId) {
this.prodId = prodId;
}
public String getProdCode() {
return prodCode;
}
public void setProdCode(String prodCode) {
this.prodCode = prodCode;
}
public Double getProdCost() {
return prodCost;
}
public void setProdCost(Double prodCost) {
this.prodCost = prodCost;
}
@Override
public String toString() {
return "Product [prodId=" + prodId + ", prodCode=" + prodCode + ", prodCost=" + prodCost + "]";
}
}
|
[
"Mahendranath Reddy@DESKTOP-K0U7G4A"
] |
Mahendranath Reddy@DESKTOP-K0U7G4A
|
de34ba315f2a41a3a39cec07c47373bb10f99ecb
|
16c286845f9a0cb829e69299737753f19b73e0cb
|
/nueva iteracion/ppp/domain/src/main/java/com/abs/siif/catalog/entities/TypeConfigCatalogEntities.java
|
ac57206f1d583a0516d9db37da5e14a8a4956d03
|
[] |
no_license
|
erickone/ABSnewRepository
|
f06ab47970dac7c1553765c5b8de51b024b24c62
|
cf3edf1ac6d0d646e2666c553f426dc682f5a0ed
|
refs/heads/master
| 2020-05-17T20:06:31.193230 | 2012-09-20T15:25:13 | 2012-09-20T15:25:13 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,542 |
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.abs.siif.catalog.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
*
* @author absvalenzuela
*/
@Entity
@Table(name = "siifabstipoconfig")
public class TypeConfigCatalogEntities implements Serializable{
@Id
@GenericGenerator(name = "generator", strategy = "native")
@GeneratedValue(generator = "generator")
@Column(name = "idtipoconfig")
private Long typeConfigId;
@Column(name = "clave")
private String clave;
@Column(name = "descripcion")
private String descripcion;
@Column(name = "activo")
private boolean activo;
public Long getTypeConfigId() {
return typeConfigId;
}
public void setTypeConfigId(Long typeConfigId) {
this.typeConfigId = typeConfigId;
}
public String getClave() {
return clave;
}
public void setClave(String clave) {
this.clave = clave;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public boolean isActivo() {
return activo;
}
public void setActivo(boolean activo) {
this.activo = activo;
}
}
|
[
"[email protected]"
] | |
11ee165bbe8b8cff64ad72cbbfc9eb8aefed8578
|
58e71c6f69c0e58351bd2dcd07ae853765001d29
|
/app/src/main/java/ci/k2jts/recensement/ui/object/Recessement.java
|
91be27927f5a1c1a81f7c2860b07bec1bfcd4f70
|
[] |
no_license
|
ADOUJEAN/recensement
|
bdce84cc71c6fa7c159dbb3e9b6be4d65c087c09
|
e722be25efe936b651ce73ef987575c53ba9f181
|
refs/heads/master
| 2020-11-24T22:40:25.029880 | 2019-12-16T11:15:47 | 2019-12-16T11:15:47 | 228,368,943 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,545 |
java
|
package ci.k2jts.recensement.ui.object;
/**
* Created by ADOU JOHN on 15,décembre,2019
* K2JTS Ltd
* [email protected]
*/
public class Recessement {
public String id;
public String nom;
public String prenom;
public String datenaissance;
public String daterecensement;
public String latitude;
public String longitude;
public String contact;
public String photo;
public Recessement() {
}
public Recessement(String id, String nom, String prenom, String datenaissance, String daterecensement, String latitude, String longitude, String contact, String photo) {
this.id = id;
this.nom = nom;
this.prenom = prenom;
this.datenaissance = datenaissance;
this.daterecensement = daterecensement;
this.latitude = latitude;
this.longitude = longitude;
this.contact = contact;
this.photo = photo;
}
public Recessement(String id, String nom, String prenom, String datenaissance, String contact) {
this.id = id;
this.nom = nom;
this.prenom = prenom;
this.datenaissance = datenaissance;
this.contact = contact;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getDatenaissance() {
return datenaissance;
}
public void setDatenaissance(String datenaissance) {
this.datenaissance = datenaissance;
}
public String getDaterecensement() {
return daterecensement;
}
public void setDaterecensement(String daterecensement) {
this.daterecensement = daterecensement;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
}
|
[
"[email protected]"
] | |
920b2fb66a2b834b2471598afa08c952b951ce72
|
72fee3b1a8ed5fd5500666d1f1d424c8cf0118ae
|
/lab2/retailitem.java
|
38c8a9e525b5d9c0893802d7ae339a1645bebf4d
|
[] |
no_license
|
Rayyan1701/Java-practice
|
ba1981b9ff8cece873300d7b6aa5eae4d46d4411
|
3d27c43f98959e05d0c1a6a2b7a68e67168843de
|
refs/heads/master
| 2023-05-31T15:15:51.960401 | 2021-07-04T06:19:20 | 2021-07-04T06:19:20 | 375,243,621 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,884 |
java
|
//Design and create a class named RetailItem that holds data about an item in a retail store. The class
// should have the following fields:
// Description - The description field references a String object that holds a brief description
// of the item.
// Units - The units field is an int variable that holds the number of units currently in
// inventory.
// Price - The price field is a double that holds the item’s retail price.
// appropriate mutator methods that store values in these fields and accessor methods that return the values in these fields. Write the main method which creates a RetailItem object and invokes appropriate methods.
import java.util.*;
class retailitem
{
String description;
int units;
double price;
void read()
{
Scanner input= new Scanner(System.in) ;
System.out.println("enter description");
description=input.nextLine();
System.out.println("enter number of units");
units=input.nextInt();
System.out.println("enter price");
price=input.nextDouble();
System.out.println();System.out.println();
}
void display()
{
System.out.println("Description:-");
System.out.println(description);
System.out.println("Units:-");
System.out.println(units);
System.out.println("price:-");
System.out.println(price);
System.out.println();System.out.println();
}
public static void main(String[] args)
{
retailitem obj[]=new retailitem[5];
for(int i=0; i<3; i++)
{
obj[i]= new retailitem();
System.out.println("Enter details if item "+(i+1));
obj[i].read();
}
for(int i=0; i<3; i++)
{
System.out.println("The details of item "+(i+1));
obj[i].display();
}
}
}
|
[
"[email protected]"
] | |
de68a18cad5e282d67281c1134a25af1f535d6ab
|
e641ff90a586fb3594f2499ce3318ff7daa1ee50
|
/src/main/java/com/xxl/job/executor/util/SpringContextUtil.java
|
6852b97f6ee75b309434be295c71794dc9784325
|
[] |
no_license
|
huangyakun8690/spider
|
241dabca1e0b0a188cef276d0ef9e8a4d01feb2c
|
b92e8d8ef169ae9c4d201d2ed59ba5a0aaaf1b96
|
refs/heads/master
| 2020-03-17T13:15:59.881467 | 2018-05-16T07:06:28 | 2018-05-16T07:06:28 | 133,624,401 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 905 |
java
|
package com.xxl.job.executor.util;
import org.springframework.context.ApplicationContext;
/**
* 获取上下文类
* @author xing.hang
*
*/
public class SpringContextUtil {
private static ApplicationContext applicationContext;
//获取上下文
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
//设置上下文
public static void setApplicationContext(ApplicationContext applicationContext) {
SpringContextUtil.applicationContext = applicationContext;
}
//通过名字获取上下文中的bean
public static Object getBean(String name){
return applicationContext.getBean(name);
}
//通过类型获取上下文中的bean
public static Object getBean(Class<?> requiredType){
return applicationContext.getBean(requiredType);
}
}
|
[
"[email protected]"
] | |
65fdd19c3a74989813dc974c7c8e3af32aebd24e
|
c9b8db6ceff0be3420542d0067854dea1a1e7b12
|
/web/KoreanAir/src/main/java/com/ke/css/cimp/fwb/fwb14/Rule_Grp_Other_Participant_Office_Message_Address.java
|
51170b9d1bc9f87a5427d962a0827eceb956d346
|
[
"Apache-2.0"
] |
permissive
|
ganzijo/portfolio
|
12ae1531bd0f4d554c1fcfa7d68953d1c79cdf9a
|
a31834b23308be7b3a992451ab8140bef5a61728
|
refs/heads/master
| 2021-04-15T09:25:07.189213 | 2018-03-22T12:11:00 | 2018-03-22T12:11:00 | 126,326,291 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,259 |
java
|
package com.ke.css.cimp.fwb.fwb14;
/* -----------------------------------------------------------------------------
* Rule_Grp_Other_Participant_Office_Message_Address.java
* -----------------------------------------------------------------------------
*
* Producer : com.parse2.aparse.Parser 2.5
* Produced : Tue Mar 06 10:34:51 KST 2018
*
* -----------------------------------------------------------------------------
*/
import java.util.ArrayList;
final public class Rule_Grp_Other_Participant_Office_Message_Address extends Rule
{
public Rule_Grp_Other_Participant_Office_Message_Address(String spelling, ArrayList<Rule> rules)
{
super(spelling, rules);
}
public Object accept(Visitor visitor)
{
return visitor.visit(this);
}
public static Rule_Grp_Other_Participant_Office_Message_Address parse(ParserContext context)
{
context.push("Grp_Other_Participant_Office_Message_Address");
boolean parsed = true;
int s0 = context.index;
ParserAlternative a0 = new ParserAlternative(s0);
ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s1 = context.index;
ParserAlternative a1 = new ParserAlternative(s1);
parsed = true;
if (parsed)
{
boolean f1 = true;
int c1 = 0;
for (int i1 = 0; i1 < 1 && f1; i1++)
{
int g1 = context.index;
ArrayList<ParserAlternative> as2 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s2 = context.index;
ParserAlternative a2 = new ParserAlternative(s2);
parsed = true;
if (parsed)
{
boolean f2 = true;
int c2 = 0;
for (int i2 = 0; i2 < 1 && f2; i2++)
{
Rule rule = Rule_OTHER_PARTY_MSG_AIRPORT_CODE.parse(context);
if ((f2 = rule != null))
{
a2.add(rule, context.index);
c2++;
}
}
parsed = c2 == 1;
}
if (parsed)
{
boolean f2 = true;
int c2 = 0;
for (int i2 = 0; i2 < 1 && f2; i2++)
{
Rule rule = Rule_OTHER_PARTY_MSG_OFFICE_DESIG.parse(context);
if ((f2 = rule != null))
{
a2.add(rule, context.index);
c2++;
}
}
parsed = c2 == 1;
}
if (parsed)
{
boolean f2 = true;
int c2 = 0;
for (int i2 = 0; i2 < 1 && f2; i2++)
{
Rule rule = Rule_OTHER_PARTY_MSG_COMPANY_DESIG.parse(context);
if ((f2 = rule != null))
{
a2.add(rule, context.index);
c2++;
}
}
parsed = c2 == 1;
}
if (parsed)
{
as2.add(a2);
}
context.index = s2;
}
ParserAlternative b = ParserAlternative.getBest(as2);
parsed = b != null;
if (parsed)
{
a1.add(b.rules, b.end);
context.index = b.end;
}
f1 = context.index > g1;
if (parsed) c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.add(a1);
}
context.index = s1;
}
ParserAlternative b = ParserAlternative.getBest(as1);
parsed = b != null;
if (parsed)
{
a0.add(b.rules, b.end);
context.index = b.end;
}
Rule rule = null;
if (parsed)
{
rule = new Rule_Grp_Other_Participant_Office_Message_Address(context.text.substring(a0.start, a0.end), a0.rules);
}
else
{
context.index = s0;
}
context.pop("Grp_Other_Participant_Office_Message_Address", parsed);
return (Rule_Grp_Other_Participant_Office_Message_Address)rule;
}
}
/* -----------------------------------------------------------------------------
* eof
* -----------------------------------------------------------------------------
*/
|
[
"[email protected]"
] | |
e4e5e201a048fdd5aa3e8c868d3e419ecd022f6c
|
0e65acd9650ca58367c823c6807475046e96c435
|
/SaleLaptop/src/java/model/CustomersModel.java
|
de26b073a163bd96a40b4041ec70bcd3aa6af9a5
|
[] |
no_license
|
stevenkrb123/stevenkrb123
|
9044ea43f32b29434d81878a703ca53c689fe3a6
|
acf754c638b3acfbb82f56436fc264149cb5714b
|
refs/heads/master
| 2022-04-19T23:33:47.007698 | 2020-04-15T14:59:49 | 2020-04-15T14:59:49 | 255,950,298 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,449 |
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 model;
import entity.Customers;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.hibernate.Session;
public class CustomersModel {
public List<Customers> getAll() {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
List<Customers> list = new ArrayList<Customers>();
try {
session.beginTransaction();
list = session.createCriteria(Customers.class).list();
session.getTransaction().commit();
} catch (Exception e) {
System.out.println("Error" + e.toString());
}
return list;
}
public Boolean checkUserName(String username, String email){
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
List<Customers> list = new ArrayList<>();
try {
session.beginTransaction();
list = session.createCriteria(Customers.class).list();
session.getTransaction().commit();
for(int i =0; i<list.size();i++){
if(username.equals(list.get(i).getUserName().trim())&&email.equals(list.get(i).getEmail().trim())){
return true;
}
}
} catch (Exception e) {
System.out.println("Error" + e.toString());
}
return false;
}
static final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Random rdd = new Random();
public String randomString( int a ){
StringBuilder sb = new StringBuilder( a );
for( int i = 0; i <a; i++ )
sb.append( AB.charAt( rdd.nextInt(AB.length()) ) );
return sb.toString();
}
public int create(Customers c) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
session.beginTransaction();
session.save(c);
session.getTransaction().commit();
return 1;
} catch (Exception e) {
System.out.println("error:" + e.toString());
return 0;
}
}
public Customers getCustomers(String id) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
Customers c = new Customers();
try {
session.beginTransaction();
c = (Customers) session.get(Customers.class, id);
session.getTransaction().commit();
} catch (Exception e) {
System.out.println("error:" + e.toString());
}
return c;
}
public void edit(Customers c) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
session.beginTransaction();
session.update(c);
session.getTransaction().commit();
} catch (Exception e) {
System.out.println("error:" + e.toString());
}
}
public void remove(Customers c) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
session.beginTransaction();
session.delete(c);
session.getTransaction().commit();
} catch (Exception e) {
System.out.println("error:" + e.toString());
}
}
}
|
[
"[email protected]"
] | |
0641b5f30b77e9e1ef432cbb0a6203ee264563f3
|
4a9c788039845c9b31c05378c6f73042fc2f0695
|
/src/main/java/com/josafa/cursomc/repositories/EstadoRepository.java
|
68e276c45a352b9be67b67cce81a20455a2e0a3b
|
[] |
no_license
|
josalopes/cursomc
|
75590d338795609331fa8b9217369e7206b12085
|
d1ec7c2957a599c53e25e96994fc26f6d372aa32
|
refs/heads/master
| 2023-07-10T20:29:46.333922 | 2021-08-07T01:13:44 | 2021-08-07T01:13:44 | 392,457,261 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 287 |
java
|
package com.josafa.cursomc.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.josafa.cursomc.domain.Estado;
@Repository
public interface EstadoRepository extends JpaRepository<Estado, Integer> {
}
|
[
"[email protected]"
] | |
04ae7aa7d4df0b7f041d85590bed8c0317f5bbf9
|
95e944448000c08dd3d6915abb468767c9f29d3c
|
/sources/android/arch/p005a/p007b/C0009b.java
|
b8e27912918461079ce2cb81b2dd6314f680343c
|
[] |
no_license
|
xrealm/tiktok-src
|
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
|
90f305b5f981d39cfb313d75ab231326c9fca597
|
refs/heads/master
| 2022-11-12T06:43:07.401661 | 2020-07-04T20:21:12 | 2020-07-04T20:21:12 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 9,631 |
java
|
package android.arch.p005a.p007b;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.WeakHashMap;
/* renamed from: android.arch.a.b.b */
public class C0009b<K, V> implements Iterable<Entry<K, V>> {
/* renamed from: a */
public C0013c<K, V> f14a;
/* renamed from: b */
public C0013c<K, V> f15b;
/* renamed from: c */
public int f16c = 0;
/* renamed from: d */
private WeakHashMap<C0016f<K, V>, Boolean> f17d = new WeakHashMap<>();
/* renamed from: android.arch.a.b.b$a */
static class C0011a<K, V> extends C0015e<K, V> {
/* access modifiers changed from: 0000 */
/* renamed from: a */
public final C0013c<K, V> mo32a(C0013c<K, V> cVar) {
return cVar.f20c;
}
/* access modifiers changed from: 0000 */
/* renamed from: b */
public final C0013c<K, V> mo33b(C0013c<K, V> cVar) {
return cVar.f21d;
}
C0011a(C0013c<K, V> cVar, C0013c<K, V> cVar2) {
super(cVar, cVar2);
}
}
/* renamed from: android.arch.a.b.b$b */
static class C0012b<K, V> extends C0015e<K, V> {
/* access modifiers changed from: 0000 */
/* renamed from: a */
public final C0013c<K, V> mo32a(C0013c<K, V> cVar) {
return cVar.f21d;
}
/* access modifiers changed from: 0000 */
/* renamed from: b */
public final C0013c<K, V> mo33b(C0013c<K, V> cVar) {
return cVar.f20c;
}
C0012b(C0013c<K, V> cVar, C0013c<K, V> cVar2) {
super(cVar, cVar2);
}
}
/* renamed from: android.arch.a.b.b$c */
static class C0013c<K, V> implements Entry<K, V> {
/* renamed from: a */
final K f18a;
/* renamed from: b */
final V f19b;
/* renamed from: c */
C0013c<K, V> f20c;
/* renamed from: d */
C0013c<K, V> f21d;
public final K getKey() {
return this.f18a;
}
public final V getValue() {
return this.f19b;
}
public final String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.f18a);
sb.append("=");
sb.append(this.f19b);
return sb.toString();
}
public final V setValue(V v) {
throw new UnsupportedOperationException("An entry modification is not supported");
}
public final boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof C0013c)) {
return false;
}
C0013c cVar = (C0013c) obj;
if (!this.f18a.equals(cVar.f18a) || !this.f19b.equals(cVar.f19b)) {
return false;
}
return true;
}
C0013c(K k, V v) {
this.f18a = k;
this.f19b = v;
}
}
/* renamed from: android.arch.a.b.b$d */
public class C0014d implements C0016f<K, V>, Iterator<Entry<K, V>> {
/* renamed from: b */
private C0013c<K, V> f23b;
/* renamed from: c */
private boolean f24c;
/* access modifiers changed from: private */
/* renamed from: a */
public Entry<K, V> next() {
C0013c<K, V> cVar;
if (this.f24c) {
this.f24c = false;
cVar = C0009b.this.f14a;
} else if (this.f23b != null) {
cVar = this.f23b.f20c;
} else {
cVar = null;
}
this.f23b = cVar;
return this.f23b;
}
public final boolean hasNext() {
if (this.f24c) {
if (C0009b.this.f14a != null) {
return true;
}
return false;
} else if (this.f23b == null || this.f23b.f20c == null) {
return false;
} else {
return true;
}
}
private C0014d() {
this.f24c = true;
}
/* renamed from: a_ */
public final void mo39a_(C0013c<K, V> cVar) {
boolean z;
if (cVar == this.f23b) {
this.f23b = this.f23b.f21d;
if (this.f23b == null) {
z = true;
} else {
z = false;
}
this.f24c = z;
}
}
}
/* renamed from: android.arch.a.b.b$e */
static abstract class C0015e<K, V> implements C0016f<K, V>, Iterator<Entry<K, V>> {
/* renamed from: a */
C0013c<K, V> f25a;
/* renamed from: b */
C0013c<K, V> f26b;
/* access modifiers changed from: 0000 */
/* renamed from: a */
public abstract C0013c<K, V> mo32a(C0013c<K, V> cVar);
/* access modifiers changed from: 0000 */
/* renamed from: b */
public abstract C0013c<K, V> mo33b(C0013c<K, V> cVar);
public boolean hasNext() {
if (this.f26b != null) {
return true;
}
return false;
}
/* access modifiers changed from: private */
/* renamed from: b */
public Entry<K, V> next() {
C0013c<K, V> cVar = this.f26b;
this.f26b = m35a();
return cVar;
}
/* renamed from: a */
private C0013c<K, V> m35a() {
if (this.f26b == this.f25a || this.f25a == null) {
return null;
}
return mo32a(this.f26b);
}
/* renamed from: a_ */
public final void mo39a_(C0013c<K, V> cVar) {
if (this.f25a == cVar && cVar == this.f26b) {
this.f26b = null;
this.f25a = null;
}
if (this.f25a == cVar) {
this.f25a = mo33b(this.f25a);
}
if (this.f26b == cVar) {
this.f26b = m35a();
}
}
C0015e(C0013c<K, V> cVar, C0013c<K, V> cVar2) {
this.f25a = cVar2;
this.f26b = cVar;
}
}
/* renamed from: android.arch.a.b.b$f */
interface C0016f<K, V> {
/* renamed from: a_ */
void mo39a_(C0013c<K, V> cVar);
}
/* renamed from: b */
public final C0014d mo28b() {
C0014d dVar = new C0014d<>();
this.f17d.put(dVar, Boolean.valueOf(false));
return dVar;
}
public Iterator<Entry<K, V>> iterator() {
C0011a aVar = new C0011a(this.f14a, this.f15b);
this.f17d.put(aVar, Boolean.valueOf(false));
return aVar;
}
/* renamed from: a */
public final Iterator<Entry<K, V>> mo26a() {
C0012b bVar = new C0012b(this.f15b, this.f14a);
this.f17d.put(bVar, Boolean.valueOf(false));
return bVar;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
Iterator it = iterator();
while (it.hasNext()) {
sb.append(((Entry) it.next()).toString());
if (it.hasNext()) {
sb.append(", ");
}
}
sb.append("]");
return sb.toString();
}
/* access modifiers changed from: protected */
/* renamed from: a */
public C0013c<K, V> mo21a(K k) {
C0013c<K, V> cVar = this.f14a;
while (cVar != null && !cVar.f18a.equals(k)) {
cVar = cVar.f20c;
}
return cVar;
}
/* renamed from: b */
public V mo23b(K k) {
C0013c a = mo21a(k);
if (a == null) {
return null;
}
this.f16c--;
if (!this.f17d.isEmpty()) {
for (C0016f a_ : this.f17d.keySet()) {
a_.mo39a_(a);
}
}
if (a.f21d != null) {
a.f21d.f20c = a.f20c;
} else {
this.f14a = a.f20c;
}
if (a.f20c != null) {
a.f20c.f21d = a.f21d;
} else {
this.f15b = a.f21d;
}
a.f20c = null;
a.f21d = null;
return a.f19b;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof C0009b)) {
return false;
}
C0009b bVar = (C0009b) obj;
if (this.f16c != bVar.f16c) {
return false;
}
Iterator it = iterator();
Iterator it2 = bVar.iterator();
while (it.hasNext() && it2.hasNext()) {
Entry entry = (Entry) it.next();
Object next = it2.next();
if ((entry == null && next != null) || (entry != null && !entry.equals(next))) {
return false;
}
}
if (it.hasNext() || it2.hasNext()) {
return false;
}
return true;
}
/* renamed from: a */
public V mo22a(K k, V v) {
C0013c a = mo21a(k);
if (a != null) {
return a.f19b;
}
mo27b(k, v);
return null;
}
/* access modifiers changed from: protected */
/* renamed from: b */
public final C0013c<K, V> mo27b(K k, V v) {
C0013c<K, V> cVar = new C0013c<>(k, v);
this.f16c++;
if (this.f15b == null) {
this.f14a = cVar;
this.f15b = this.f14a;
return cVar;
}
this.f15b.f20c = cVar;
cVar.f21d = this.f15b;
this.f15b = cVar;
return cVar;
}
}
|
[
"[email protected]"
] | |
69ef1acff2b4542381cbe51d931a7a85db8dac70
|
6cae767cd14888bedae7adb11a38d28f856b77a0
|
/Kymdan/src/main/java/com/kymdan/backend/repository/NhanVienRepository.java
|
62a5d1ce7bfa14474cbbc24402d0816deb22135c
|
[] |
no_license
|
LinhhGiangg/KymDanProject
|
d7f06ec3daf3883898138cf874877876aa0d8734
|
c1f3547e26d1235a2987643210e75e1d14dacfd6
|
refs/heads/main
| 2023-08-17T12:42:47.090116 | 2021-09-11T10:33:05 | 2021-09-11T10:33:05 | 388,663,689 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 720 |
java
|
package com.kymdan.backend.repository;
import com.kymdan.backend.entity.NhanVien;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
import java.util.List;
@Repository
public interface NhanVienRepository extends JpaRepository<NhanVien, String> {
NhanVien findByTen(String ten);
NhanVien findByEmail(String email);
@Query(value = "call thong_ke(:ngayBatDau, :ngayKetThuc)", nativeQuery = true)
List<?> thongKe(@Param("ngayBatDau") LocalDate ngayBatDau, @Param("ngayKetThuc") LocalDate ngayKetThuc);
}
|
[
"[email protected]"
] | |
cca2a874f286b8f72e98a014cf2f6171da894e76
|
eaaf6a5fcf4799384bac9cfe5a5c89c8c516e2a5
|
/androidapp/customer_app/src/main/java/com/hkm/taxicallandroid/iotesting.java
|
794d87b3498f7a226a23e35de8af6d6c3f8762bb
|
[] |
no_license
|
DevHossamHassan/TaxiOneCall
|
37e8f400c842b36f1c18743f2da951d2d7ae48f1
|
e660b25aa6a795db7144c7955273f2fb9d425777
|
refs/heads/master
| 2021-01-17T23:34:07.822273 | 2015-12-23T10:57:58 | 2015-12-23T10:57:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,602 |
java
|
package com.hkm.taxicallandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import com.asynhkm.productchecker.Util.Tool;
import com.github.nkzawa.socketio.client.Socket;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;import com.hkm.taxicallandroid.life.Config;
import com.hkm.taxicallandroid.schema.ConfirmCall;
import com.koushikdutta.async.http.AsyncHttpClient;
import com.koushikdutta.async.http.socketio.Acknowledge;
import com.koushikdutta.async.http.socketio.ConnectCallback;
import com.koushikdutta.async.http.socketio.EventCallback;
import com.koushikdutta.async.http.socketio.JSONCallback;
import com.koushikdutta.async.http.socketio.SocketIOClient;
import com.koushikdutta.async.http.socketio.StringCallback;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* Created by hesk on 1/23/2015.
*/
public class iotesting extends Activity {
private String rawjson;
private TextView edtv, from, to;
private Socket socket;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.orderconfirm);
edtv = (TextView) findViewById(R.id._order_debug_line);
from = (TextView) findViewById(R.id.from_spot);
to = (TextView) findViewById(R.id.to_spot);
// GsonBuilder gb = new GsonBuilder();
// Gson gs = gb.create();
// ConfirmCall CCdata = gs.fromJson(rawjson, ConfirmCall.class);
// edtv.setText(rawjson);
// from.setText(CCdata.pickup);
// to.setText(CCdata.destination);
// socketIOInit();
getSocketWorking();
}
SocketIOClient clientio;
@Override
protected void onDestroy() {
// if (clientio != null)
// clientio.disconnect();
super.onDestroy();
}
private void socketIOInitOff() {
}
private void getSocketWorkingOff() {
}
//https://github.com/koush/AndroidAsync
private void getSocketWorking() {
SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), Config.domain, new ConnectCallback() {
@Override
public void onConnectCompleted(Exception ex, SocketIOClient client) {
if (ex != null) {
ex.printStackTrace();
return;
}
clientio = client;
client.setStringCallback(new StringCallback() {
@Override
public void onString(String string, Acknowledge acknowledge) {
System.out.println(string);
}
});
// Tool.trace(getApplicationContext(), "success connected");
client.on("ordered", new EventCallback() {
@Override
public void onEvent(JSONArray argument, Acknowledge acknowledge) {
System.out.println("args: " + argument.toString());
// Tool.trace(getApplicationContext(), argument.toString());
}
});
client.setJSONCallback(new JSONCallback() {
@Override
public void onJSON(JSONObject json, Acknowledge acknowledge) {
System.out.println("args: " + json.toString());
// Tool.trace(getApplicationContext(), json.toString());
}
});
// client.emit("ordered");
}
});
}
}
|
[
"[email protected]"
] | |
131dc0f72cda5b72d364221deecac92b3706419d
|
78c990f287df4886edc0db7094a8c2f77eb16461
|
/icetone-core/src/main/java/icetone/effects/DesaturateEffect.java
|
df0628381407a54c8df869a537dd5f6df551e51e
|
[
"BSD-2-Clause",
"LicenseRef-scancode-other-permissive"
] |
permissive
|
Scrappers-glitch/icetone
|
a91a104571fba25cacc421ef1c3e774de6769a53
|
1684c2a6da1b1228ddcabafbbbee56286ccc4adb
|
refs/heads/master
| 2022-01-08T10:53:47.263080 | 2019-06-27T11:10:54 | 2019-06-27T11:10:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 578 |
java
|
package icetone.effects;
public class DesaturateEffect extends Effect {
public DesaturateEffect(float duration) {
super(duration);
}
@Override
public void update(float tpf) {
if (!init) {
element.getMaterial().setBoolean("UseEffect", true);
element.getMaterial().setBoolean("EffectFade", false);
element.getMaterial().setBoolean("EffectPulse", false);
element.getMaterial().setBoolean("EffectSaturate", true);
init = true;
}
element.getMaterial().setFloat("EffectStep", pass);
if (pass >= 1.0) {
isActive = false;
}
updatePass(tpf);
}
}
|
[
"[email protected]"
] | |
9817171a1ee94158a6f754608d20a1c641f10fe1
|
9ea52bddd5a90731bd2fc16de760a8cd8cf018f3
|
/src/view/dialogWindow/options/groups/OptionPane.java
|
e5c66a5b2c6f8d0beebf5b709d74f2d9e0708843
|
[] |
no_license
|
stechy1/mri_tms_viewer
|
4eb4a28b60fc021b66352b8e856e6463e72f2bbf
|
55837dd4ce43c2cd085024163ac2d3ba76ed812e
|
refs/heads/master
| 2021-04-12T12:21:53.297935 | 2018-09-20T10:40:52 | 2018-09-20T10:40:52 | 126,204,040 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,718 |
java
|
package view.dialogWindow.options.groups;
import java.awt.GridLayout;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import controller.dialogWindow.group.OptionPaneController;
import controller.Configuration;
import view.MainWindow;
public class OptionPane extends JPanel {
private JCheckBox check_ruler;
private JCheckBox check_coords;
private JCheckBox check_threshold;
private JCheckBox check_explode;
public OptionPane() {
initComponents();
}
private void initComponents() {
setLayout(new GridLayout(0,1,5,5));
OptionPaneController controller = new OptionPaneController(this);
MainWindow.addController(controller);
this.check_ruler = new JCheckBox("Zobrazuj pravitko");
this.check_ruler.setSelected(Configuration.drawRulers);
this.check_ruler.addActionListener(controller);
add(this.check_ruler);
this.check_coords = new JCheckBox("Zobrazuj souradnice");
this.check_coords.setSelected(Configuration.showCoords);
this.check_coords.addActionListener(controller);
add(this.check_coords);
this.check_threshold = new JCheckBox("Prahuj snimky");
this.check_threshold.setSelected(Configuration.threshold);
this.check_threshold.addActionListener(controller);
add(this.check_threshold);
this.check_explode = new JCheckBox("Roztahnuti blizkych bodu");
this.check_explode.setSelected(Configuration.explode);
this.check_explode.addActionListener(controller);
add(this.check_explode);
}
public JCheckBox getRulers() {
return this.check_ruler;
}
public JCheckBox getCoords() {
return this.check_coords;
}
public JCheckBox getThreshold() {
return this.check_threshold;
}
public JCheckBox getExplode(){
return this.check_explode;
}
}
|
[
"[email protected]"
] | |
39c3bf3c6ecc8ec47b7cc40213f9ad849e2d2e40
|
ad1cc3693df46b397efc3fa73f923c489063ecd9
|
/app/src/main/java/sathish/ngosampleapp/fragment/FeedAudioFragment.java
|
fd2c76fa3220979e056d1a7eb2deb666647b51da
|
[] |
no_license
|
mun-sathish/NgoSampleApp
|
4476d2e98b67cb8cfc252844e201cda7b802d163
|
42f48dde3747a0e4c81346f56ca783697d4c1c16
|
refs/heads/master
| 2020-03-17T00:13:56.007567 | 2018-06-05T05:41:04 | 2018-06-05T05:41:04 | 133,107,973 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,117 |
java
|
package sathish.ngosampleapp.fragment;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.facebook.shimmer.ShimmerFrameLayout;
import com.google.gson.Gson;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import sathish.ngosampleapp.R;
import sathish.ngosampleapp.adapter.AudioAdapter;
import sathish.ngosampleapp.dto.AudioModel;
import sathish.ngosampleapp.util.GridSpacingItemDecoration;
import sathish.ngosampleapp.util.Util;
import static sathish.ngosampleapp.util.Const.TAG;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link FeedAudioFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link FeedAudioFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class FeedAudioFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private final Gson gson = new Gson();
@BindView(R.id.recycler_view)
public RecyclerView recyclerView;
@BindView(R.id.shimmer_view_container)
public ShimmerFrameLayout mShimmerViewContainer;
private AudioAdapter adapter;
private List<AudioModel> audioList;
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public FeedAudioFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment FeedAudioFragment.
*/
// TODO: Rename and change types and number of parameters
public static FeedAudioFragment newInstance(String param1, String param2) {
FeedAudioFragment fragment = new FeedAudioFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_feed_audio, container, false);
ButterKnife.bind(this, view);
audioList = new ArrayList<>();
adapter = new AudioAdapter(getContext(), audioList);
// RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getContext());
// recyclerView.setLayoutManager(mLayoutManager);
// recyclerView.setItemAnimator(new DefaultItemAnimator());
// recyclerView.setAdapter(adapter);
RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(getContext(), 2);
recyclerView.setLayoutManager(mLayoutManager);
recyclerView.addItemDecoration(new GridSpacingItemDecoration(2, Util.dpToPx(getContext(), 10), true));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(adapter);
mShimmerViewContainer.setVisibility(View.VISIBLE);
mShimmerViewContainer.startShimmerAnimation();
return view;
}
public String handleJsonResponse(JSONArray response) {
mShimmerViewContainer.setVisibility(View.GONE);
if (mShimmerViewContainer.isAnimationStarted())
mShimmerViewContainer.stopShimmerAnimation();
try {
audioList.clear();
for (int i = 0; i < response.length(); i++) {
AudioModel model = gson.fromJson(response.getJSONObject(i).toString(), AudioModel.class);
audioList.add(model);
}
Log.i(TAG, "TOTAL: " + gson.toJson(audioList));
adapter.notifyDataSetChanged();
return ("success");
} catch (JSONException ex) {
Log.e(TAG, "VOLLEY:" + ex.getMessage());
return ("exception");
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
|
[
"[email protected]"
] | |
6c1b2992564ccbf168dca2ceda39ca4473f6c442
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/orientechnologies--orientdb/73811cc450789ef070778e13693229657c3cd8c6/after/OStorageEmbedded.java
|
02704cafa43e17b685ba4103731f0d761b9cae26
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,418 |
java
|
/*
* Copyright 1999-2010 Luca Garulli (l.garulli--at--orientechnologies.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.orientechnologies.orient.core.storage;
import java.io.IOException;
import com.orientechnologies.common.concur.lock.OLockManager;
import com.orientechnologies.common.exception.OException;
import com.orientechnologies.common.log.OLogManager;
import com.orientechnologies.common.profiler.OProfiler;
import com.orientechnologies.orient.core.command.OCommandExecutor;
import com.orientechnologies.orient.core.command.OCommandManager;
import com.orientechnologies.orient.core.command.OCommandRequestText;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.ODatabaseRecord;
import com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract;
import com.orientechnologies.orient.core.exception.OCommandExecutionException;
import com.orientechnologies.orient.core.exception.OStorageException;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.id.ORecordId;
import com.orientechnologies.orient.core.iterator.ORecordIteratorCluster;
import com.orientechnologies.orient.core.record.ORecordInternal;
import com.orientechnologies.orient.core.record.impl.ODocument;
/**
* Interface for embedded storage.
*
* @see OStorageLocal, OStorageMemory
* @author Luca Garulli
*
*/
public abstract class OStorageEmbedded extends OStorageAbstract {
protected final OLockManager<ORID, Runnable> lockManager;
public OStorageEmbedded(final String iName, final String iFilePath, final String iMode) {
super(iName, iFilePath, iMode);
lockManager = new OLockManager<ORID, Runnable>(OGlobalConfiguration.STORAGE_LOCK_TIMEOUT.getValueAsInteger());
}
protected abstract ORawBuffer readRecord(final OCluster iClusterSegment, final ORecordId iRid, boolean iAtomicLock);
public abstract OCluster getClusterByName(final String iClusterName);
/**
* Execute the command request and return the result back.
*/
public Object command(final OCommandRequestText iCommand) {
final OCommandExecutor executor = OCommandManager.instance().getExecutor(iCommand);
executor.setProgressListener(iCommand.getProgressListener());
executor.parse(iCommand);
try {
return executor.execute(iCommand.getParameters());
} catch (OException e) {
// PASS THROUGHT
throw e;
} catch (Exception e) {
throw new OCommandExecutionException("Error on execution of command: " + iCommand, e);
}
}
/**
* Browse N clusters. The entire operation use a shared lock on the storage and lock the cluster from the external avoiding atomic
* lock at every record read.
*
* @param iClusterId
* Array of cluster ids
* @param iListener
* The listener to call for each record found
* @param ioRecord
*/
public void browse(final int[] iClusterId, final ORID iBeginRange, final ORID iEndRange,
final ORecordBrowsingListener iListener, ORecordInternal<?> ioRecord, final boolean iLockEntireCluster) {
checkOpeness();
final long timer = OProfiler.getInstance().startChrono();
try {
for (int clusterId : iClusterId) {
if (iBeginRange != null)
if (clusterId < iBeginRange.getClusterId())
// JUMP THIS
continue;
if (iEndRange != null)
if (clusterId > iEndRange.getClusterId())
// STOP
break;
final OCluster cluster = getClusterById(clusterId);
final long beginClusterPosition = iBeginRange != null && iBeginRange.getClusterId() == clusterId ? iBeginRange
.getClusterPosition() : 0;
final long endClusterPosition = iEndRange != null && iEndRange.getClusterId() == clusterId ? iEndRange.getClusterPosition()
: -1;
ioRecord = browseCluster(iListener, ioRecord, cluster, beginClusterPosition, endClusterPosition, iLockEntireCluster);
}
} catch (IOException e) {
OLogManager.instance().error(this, "Error on browsing elements of cluster: " + iClusterId, e);
} finally {
OProfiler.getInstance().stopChrono("OStorageLocal.foreach", timer);
}
}
public ORecordInternal<?> browseCluster(final ORecordBrowsingListener iListener, ORecordInternal<?> ioRecord,
final OCluster cluster, final long iBeginRange, final long iEndRange, final boolean iLockEntireCluster) throws IOException {
ORecordInternal<?> record;
if (iLockEntireCluster)
// LOCK THE ENTIRE CLUSTER AVOIDING TO LOCK EVERY SINGLE RECORD
cluster.lock();
try {
final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
ORecordIteratorCluster<ORecordInternal<?>> iterator = new ORecordIteratorCluster<ORecordInternal<?>>(db,
(ODatabaseRecordAbstract) db, cluster.getId(), iBeginRange, iEndRange);
// BROWSE ALL THE RECORDS
while (iterator.hasNext()) {
record = iterator.next();
if (record != null && record.getRecordType() != ODocument.RECORD_TYPE)
// WRONG RECORD TYPE: JUMP IT
continue;
ORecordInternal<?> recordToCheck = null;
try {
// GET THE CACHED RECORD
recordToCheck = record;
if (!iListener.foreach(recordToCheck))
// LISTENER HAS INTERRUPTED THE EXECUTION
break;
} catch (OCommandExecutionException e) {
// PASS THROUGH
throw e;
} catch (Exception e) {
OLogManager.instance().exception("Error on loading record %s. Cause: %s", e, OStorageException.class,
recordToCheck != null ? recordToCheck.getIdentity() : null, e);
}
}
} finally {
if (iLockEntireCluster)
// UNLOCK THE ENTIRE CLUSTER
cluster.unlock();
}
return ioRecord;
}
/**
* Check if the storage is open. If it's closed an exception is raised.
*/
protected void checkOpeness() {
if (status != STATUS.OPEN)
throw new OStorageException("Storage " + name + " is not opened.");
}
}
|
[
"[email protected]"
] | |
aac5ba7ab3bfe5afed4bd507f1806f948cc0be53
|
360655708c8e1b2cd2eeb30e9b13b5302ae84739
|
/蓝桥杯/src/算法训练/Main20.java
|
9df4da8a7ce7ea229eb6c2033d76959f5430970c
|
[] |
no_license
|
relife957/BBC
|
3440cb4fd017cc4dfafb020ecf1c440251cf41ef
|
9f12ae63bfef45bde7e3b8730ef4bb6217118944
|
refs/heads/master
| 2020-03-07T18:25:12.356470 | 2018-04-01T15:02:16 | 2018-04-01T15:02:16 | 127,637,748 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 707 |
java
|
package 算法训练;
class ListNode {
int val;
ListNode next;
ListNode(int x) { val = x; }
}
public class Main20 {
public ListNode mergeTwoLists(ListNode l1, ListNode l2) {
ListNode result = new ListNode(0);
ListNode p = result ;
while(l1!=null || l2!=null) {
if(l1==null) {
p.next = l2 ;
break ;
}else if(l2 == null) {
p.next = l1 ;
break ;
}
if(l1.val<=l2.val) {
p.next = l1 ;
p = p.next ;
l1 = l1.next ;
}else {
p.next = l2 ;
p = p.next ;
l2 = l2.next ;
}
}
return result.next ;
}
}
|
[
"[email protected]"
] | |
b5e007c3c3d2f18ff10cfffecbc010b0d87a3e2d
|
2dac0227d0502a2d535cda8dd84c724e317e4847
|
/src/test/java/com/cflint/TestCFDebugAttributeTagChecker.java
|
490311b288b3965af4fe2308c278c8a2d719478c
|
[
"BSD-3-Clause"
] |
permissive
|
NewLunarFire/CFLint
|
6b2f6d6dd0ef68023bcb80e8b91e295acbbbb621
|
0d6a2e8e34710a9fb2f1ca3fad80feb93aa8b04f
|
refs/heads/master
| 2020-12-15T14:33:05.662056 | 2020-05-21T17:59:07 | 2020-05-21T17:59:07 | 235,136,373 | 0 | 0 |
NOASSERTION
| 2020-01-20T15:41:54 | 2020-01-20T15:41:53 | null |
UTF-8
|
Java
| false | false | 2,233 |
java
|
package com.cflint;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import com.cflint.api.CFLintAPI;
import com.cflint.api.CFLintResult;
import com.cflint.config.ConfigBuilder;
import com.cflint.exception.CFLintScanException;
public class TestCFDebugAttributeTagChecker {
private CFLintAPI cfBugs;
@Before
public void setUp() throws Exception {
final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_DEBUG_ATTR","AVOID_USING_CFSETTING_DEBUG");
cfBugs = new CFLintAPI(configBuilder.build());
}
@Test
public void testDebugNoVal() throws CFLintScanException {
final String cfcSrc = "<cfquery name=\"TestQuery\" datasource=\"cfdocexamples\" debug> \n"
+ " SELECT * FROM TestTable \n" + "</cfquery>";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
assertEquals(1, lintresult.getIssues().get("AVOID_USING_DEBUG_ATTR").size());
}
@Test
public void testDebugNoValCASE() throws CFLintScanException {
final String cfcSrc = "<cfquery name=\"TestQuery\" datasource=\"cfdocexamples\" DEBUG> \n"
+ " SELECT * FROM TestTable \n" + "</cfquery>";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
assertEquals(1, lintresult.getIssues().get("AVOID_USING_DEBUG_ATTR").size());
}
@Test
public void testCfsettingDebugNo() throws CFLintScanException {
final String cfcSrc = "<cfsetting showDebugOutput=\"No\">";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
assertEquals(0, lintresult.getIssues().size());
}
@Test
public void testCfsettingDebugYes() throws CFLintScanException {
final String cfcSrc = "<cfsetting showDebugOutput=\"Yes\">";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
assertEquals(1, lintresult.getIssues().get("AVOID_USING_CFSETTING_DEBUG").size());
}
@Test
public void testCfsettingNoAttributes() throws CFLintScanException {
final String cfcSrc = "<cfset var a = 1>";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
assertEquals(0, lintresult.getIssues().size());
}
}
|
[
"[email protected]"
] | |
f1133879e57ab0d1e099d5f0ecc9a9fc683b37dd
|
fa72718dff237257ddb9c8e865979f313b881a84
|
/src/main/java/org/dxl/servlet/FaviconServlet.java
|
6590e69b23029533d48e3e2d8a57b2bc33b4f6d1
|
[] |
no_license
|
001ItSky/launcher
|
bf879b093d44bcd482c0c3c017b325351a5ebc6f
|
94fb6971f5ae77f891a48fccbd12df03aa13ccf0
|
refs/heads/master
| 2022-12-05T03:13:11.327062 | 2020-08-31T16:11:54 | 2020-08-31T16:11:54 | 291,763,436 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 427 |
java
|
package org.dxl.servlet;
import org.dxl.server.Request;
import org.dxl.server.Response;
/**
* 头像请求
* @author Administrator
*/
public class FaviconServlet extends BaseServlet {
@Override
public void doGet(Request req, Response rep) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void doPost(Request req, Response rep) throws Exception {
// TODO Auto-generated method stub
}
}
|
[
"[email protected]"
] | |
078bab36a4bbcd321398ad6b69d44851ade84cc5
|
a47fa2c34d28684fd20a273481d9a251fd0b30bb
|
/Weibo/app/src/main/java/com/example/administrator/weibo/activity/BaseActivity.java
|
adc8f8b164db407e63f48c2332931d63faac581a
|
[] |
no_license
|
wangfeihang/weibohaha
|
01bdaaf8c897a16689d765f8fcf7c58c8b52fb70
|
30075012bf28ad56585d606de0fc389e45e51cf8
|
refs/heads/master
| 2021-01-15T15:42:47.451779 | 2016-11-29T06:59:28 | 2016-11-29T06:59:28 | 54,955,698 | 0 | 1 | null | 2016-03-30T03:19:10 | 2016-03-29T07:36:19 |
Java
|
UTF-8
|
Java
| false | false | 603 |
java
|
package com.example.administrator.weibo.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.yy.androidlib.util.notification.NotificationCenter;
/**
* Created by ZZB on 2016/3/29.
*/
public class BaseActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NotificationCenter.INSTANCE.addObserver(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
NotificationCenter.INSTANCE.removeObserver(this);
}
}
|
[
"[email protected]"
] | |
33009b548e55366653b4957d39eb6e73317a5875
|
55aff9411e0bc9d4ab0e95e0c128e7d57932244a
|
/Урок 7. Reflection API и аннотации/lesson7/src/main/java/lesson7/Dog.java
|
a792f55111608766f5a3738f98fe31448ec61291
|
[] |
no_license
|
qervot/Java_core.professional
|
d4c904ed02e99ca9ed48127e5f7d58ccf27afbfb
|
96a923db58748b5fd88e2859d9f0551239b3cb88
|
refs/heads/master
| 2021-01-01T05:52:24.229172 | 2017-10-27T14:00:59 | 2017-10-27T14:00:59 | 97,293,219 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 441 |
java
|
package lesson7;
//public class Dog implements Jumpable, Swimable {
public class Dog extends Animal{
public int b;
private int c;
public Dog(int b, int c) {
this.b = b;
this.c = c;
}
public void info(String info) {
System.out.println(info);
}
public void info(int info) {
System.out.println(info);
}
private void voice() {
System.out.println("voice");
}
}
|
[
"[email protected]"
] | |
78dd87d04daca71532c2dc39184441445ada2a28
|
7060bd58c47bb36484cfaad59b50d9c0df41846d
|
/JavaRushTasks/1.JavaSyntax/src/com/javarush/task/pro/task14/task1403/Solution.java
|
cb70996b5a9c1c480b22af003cb2c51ae5929ea6
|
[] |
no_license
|
KhaliullinArR/java-rush-tasks
|
4e6a60282e4d218bd114d19e950f8bf2861d0182
|
7fa398e85c0f6d2843b74193396ec73ee3f69549
|
refs/heads/main
| 2023-04-08T09:52:02.711984 | 2021-04-20T17:41:24 | 2021-04-20T17:41:24 | 357,000,449 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,951 |
java
|
package com.javarush.task.pro.task14.task1403;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
/*
Помощник преподавателя-2
*/
public class Solution {
public static final String PROMPT_STRING = "Введите номер студента, или exit для выхода: ";
public static final String EXIT = "exit";
public static final String ANSWERING = "Отвечает ";
public static final String NOT_EXIST = "Студента с таким номером не существует";
public static final String INTEGER_REQUIRED = "Нужно ввести целое число";
static List<String> studentsJournal = Arrays.asList(
"Тимур Мясной"
, "Пенелопа Сиволап"
, "Орест Злобин"
, "Ирида Продувалова"
, "Гектор Гадюкин"
, "Электра Чемоданова"
, "Гвидон Недумов"
, "Роксана Борисенко"
, "Юлиан Мумбриков"
, "Зигфрид Горемыкин");
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.print(PROMPT_STRING);
String input = scanner.nextLine();
if (input.toLowerCase().equals(EXIT)) {
break;
}
int studentId;
try {
studentId = Integer.parseInt(input);
try {
System.out.println(ANSWERING + studentsJournal.get(studentId));
} catch (Exception e) {
System.out.println(NOT_EXIST);
}
} catch (Exception e) {
System.out.println("Нужно ввести целое число" );
}
}
}
}
|
[
"[email protected]"
] | |
3edc68bb753ca1a87fdbcd79bd78fbd5f38675f0
|
78442e3702bac6853d73b0a4eda502da91fb61d1
|
/Library/src/cn/cumt/library/form/DataForm.java
|
c4f927fb3db964b25aed9f24d7b2caefa1d0d616
|
[] |
no_license
|
Ericwst/LibraryMISWork
|
ff21ca9dc2029fdb56d3400785fd1c37355fbd25
|
d9520e5737ea0cc7e39e53e2d7686fbe0cc4b635
|
refs/heads/master
| 2021-01-15T10:58:52.086528 | 2016-05-19T11:55:14 | 2016-05-19T11:55:14 | 44,644,187 | 1 | 0 | null | 2015-10-21T01:06:12 | 2015-10-21T01:06:12 | null |
UTF-8
|
Java
| false | false | 1,946 |
java
|
package cn.cumt.library.form;
import org.apache.struts.action.ActionForm;
import org.apache.struts.upload.FormFile;
//资料bean
public class DataForm extends ActionForm {
private static final long serialVersionUID = 1L;
private Integer dataId;
private Integer dataCategoryId;
private String userId;
private String dataName;
private String dataDate;
private String dataScore;
private String dataPicture;
private FormFile dataFormFile;
private String material;
private FormFile materialFormFile;
public Integer getDataId() {
return dataId;
}
public void setDataId(Integer dataId) {
this.dataId = dataId;
}
public Integer getDataCategoryId() {
return dataCategoryId;
}
public void setDataCategoryId(Integer dataCategoryId) {
this.dataCategoryId = dataCategoryId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataScore() {
return dataScore;
}
public void setDataScore(String dataScore) {
this.dataScore = dataScore;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public String getDataDate() {
return dataDate;
}
public void setDataDate(String dataDate) {
this.dataDate = dataDate;
}
public FormFile getDataFormFile() {
return dataFormFile;
}
public void setDataFormFile(FormFile dataFormFile) {
this.dataFormFile = dataFormFile;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
public FormFile getMaterialFormFile() {
return materialFormFile;
}
public void setMaterialFormFile(FormFile materialFormFile) {
this.materialFormFile = materialFormFile;
}
}
|
[
"[email protected]"
] | |
f064b5ea2236ef6cc07abf0aee960fff5cd8b8d7
|
2e48d53bf94b0ae9dfdf5ad51cee7d5651a022d3
|
/hib/Java8StreamsNew/src/main/java/com/jenny/java8streams/controller/EmployeeController.java
|
9c5209b663d40a3cf9aad4aed9cb966ca404bac2
|
[] |
no_license
|
Jehanat/mode1-2
|
826d2c7bcccf77ba50ad71f06065e35213da7508
|
bd914ece9839682b465cae8570b0a327b62bf6fe
|
refs/heads/master
| 2022-12-20T14:38:19.345886 | 2019-10-24T13:17:41 | 2019-10-24T13:17:41 | 216,971,322 | 0 | 0 | null | 2022-12-16T10:42:46 | 2019-10-23T04:58:25 |
JavaScript
|
UTF-8
|
Java
| false | false | 1,251 |
java
|
package com.jenny.java8streams.controller;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import com.jenny.java8streams.model.Employee;
import com.jenny.java8streams.service.EmployeeService;
@Controller
public class EmployeeController {
private static final Logger logger = Logger
.getLogger(EmployeeController.class);
public EmployeeController() {
logger.info("This is Jenny's Program");
System.out.println("EmployeeController()");
}
@Autowired
private EmployeeService employeeService;
@RequestMapping(value = "/")
public ModelAndView listEmployee(ModelAndView model) throws IOException {
logger.debug("debug:" +new Date() +this.getClass()+"listEmployee()" +"entering into");
List<Employee> listEmployee = employeeService.getAllEmployees();
logger.debug("debug:" +new Date() +this.getClass()+"listEmployee()" +"Calling the employee service");
model.addObject("listEmployee", listEmployee);
logger.debug("debug:" +new Date() +this.getClass()+"listEmployee()" +"employee service calling is completed and no of employees");
model.setViewName("home");
logger.debug("debug:" +new Date() +this.getClass()+"listEmployee()" +"redirect to home");
return model;
}
}
|
[
"[email protected]"
] | |
b4a588fd1c984fca6691f18583a94e718ddb7869
|
96d71f73821cfbf3653f148d8a261eceedeac882
|
/external/tools/Bin_Coddec_2008-7-16_11.37_coddec/net/rim/tools/compiler/analysis/InstructionInts.java
|
da43467732cefa751431d57cbf4ec2ea34a8cc85
|
[] |
no_license
|
JaapSuter/Niets
|
9a9ec53f448df9b866a8c15162a5690b6bcca818
|
3cc42f8c2cefd9c3193711cbf15b5304566e08cb
|
refs/heads/master
| 2020-04-09T19:09:40.667155 | 2012-09-28T18:11:33 | 2012-09-28T18:11:33 | 5,751,595 | 2 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,671 |
java
|
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
package net.rim.tools.compiler.analysis;
import net.rim.tools.compiler.codfile.Code;
import net.rim.tools.compiler.util.CompileException;
// Referenced classes of package net.rim.tools.compiler.g:
// q, g, e
public final class InstructionInts extends InstructionBranch
{
private int z_qxaI[];
public InstructionInts(int i, int j, int ai[])
{
this(i, j, ai, false);
}
public InstructionInts(int i, int j, int ai[], boolean flag)
{
super(i, j, flag ? 1 : 0);
int k = ai.length;
if(k == 0)
{
z_qxaI = ai;
} else
{
z_qxaI = new int[k];
for(int l = 0; l < k; l++)
z_qxaI[l] = ai[l];
}
}
public Instruction _eLvg()
{
return (new InstructionInts(getIp(), getOpcode(), z_qxaI, super._op != 0)).setValueOp(super.z_qpI);
}
public int[] _eZvaI()
{
return z_qxaI;
}
public void walkInstruction(InstructionWalker e1)
throws CompileException
{
e1.walkInstruction(this);
}
public int setOffset(int i, boolean flag)
{
setIp(i);
return i + Code._aIIaII(getOpcode(), 0, z_qxaI, flag, true);
}
public boolean _eYvZ()
{
return super._op != 0;
}
public void _bNIV(int i)
{
int ai[] = z_qxaI;
int j = ai.length;
int k = j - 1;
int ai1[] = new int[k];
if(i != 0)
System.arraycopy(ai, 0, ai1, 0, i);
if(i != k)
System.arraycopy(ai, i + 1, ai1, i, j - (i + 1));
z_qxaI = ai1;
}
boolean _eXvZ()
{
if(_eYvZ())
return false;
int ai[] = z_qxaI;
int i = ai.length;
for(int j = 1; j < i; j++)
if(ai[j] <= ai[j - 1])
return false;
return true;
}
public boolean equals(Object obj)
{
if(obj instanceof InstructionInts)
{
InstructionInts h1 = (InstructionInts)obj;
if(!super.equals(h1))
return false;
int ai[] = z_qxaI;
int ai1[] = h1.z_qxaI;
if(ai == ai1)
return true;
int i = ai.length;
if(i == ai1.length)
{
for(int j = 0; j < i; j++)
if(ai[j] != ai1[j])
return false;
return true;
}
}
return false;
}
}
|
[
"[email protected]"
] | |
b2349d2e0fc7898b356996c5b71168c733ab51e5
|
7eb476d1b06c2c58dc05e869986655438232c417
|
/CustomZKLookAndFeel37/WEB-INF/src/org/eevolution/form/Period.java
|
c9c497af1999b39378214ef26ae46638e444e9f8
|
[] |
no_license
|
albertojuarez/FCAQCustomZK
|
1da7ed270829676c3bbd446a0fb4a218364c5422
|
f60cc5ec50a2e32776419b4f2258c806ce2d5685
|
refs/heads/master
| 2021-01-25T07:34:38.960112 | 2013-07-31T18:46:40 | 2013-07-31T18:46:40 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,269 |
java
|
package org.eevolution.form;
import java.util.ArrayList;
import java.util.List;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel;
import org.compiere.model.MBPartner;
import org.fcaq.model.X_CA_CourseDef;
import org.fcaq.model.X_CA_ScheduleDay;
import org.fcaq.model.X_CA_SchedulePeriod;
import org.zkoss.zhtml.Span;
public class Period extends Panel{
List<ClassRoom> classRooms = new ArrayList<ClassRoom>();
Label lPeriod = new Label();
public boolean iseditablemode = false;
String realPeriodNo = "";
MBPartner currentBPartner = null;
public Period(int periodNo, List<X_CA_ScheduleDay> days, List<X_CA_SchedulePeriod> periods, boolean iseditablemode, MBPartner teacher){
super();
this.iseditablemode = iseditablemode;
this.currentBPartner = teacher;
lPeriod.setText(String.valueOf(periodNo));
lPeriod.setStyle("font-size:20px;");
realPeriodNo = "C" + periodNo;
String style = "";
if(periodNo%2>0)
{
style="background-color:#EFEFEF;";
}
else
{
style="background-color:#FCFCFC;";
}
this.setStyle(style);
Span span = new Span();
span.setParent(this);
span.setStyle("height: 99%; display: inline-block; width: 5%; margin-left:30px; margin-right:-30px; margin-top:30px; margin-bottom:-30px;");
span.appendChild(lPeriod);
List<ClassRoom> classRooms = new ArrayList<ClassRoom>();
for(int x=0; x<=5; x++)
{
ClassRoom classRoom = new ClassRoom(style,iseditablemode);
classRoom.setDayno(x+1);
classRoom.setPeriodno(realPeriodNo);
classRoom.setTeacher(currentBPartner);
span = new Span();
span.setParent(this);
span.setStyle("height: 99%; display: inline-block; width: 14%;");
span.appendChild(classRoom);
classRooms.add(classRoom);
}
if(periods!=null)
{
for(X_CA_SchedulePeriod period : periods)
{
if(realPeriodNo.equals(period.getCA_PeriodClass().getName())){
for(ClassRoom classroom : classRooms)
{
for(int day=1; day<=6; day++) // X_CA_ScheduleDay day : days)
{
if(classroom.getPeriodno().equals(realPeriodNo) && classroom.getDayno()==day && period.getCA_ScheduleDay().getDayNo()==day)
{
classroom.setPeriod(period);
}
}
}
}
}
}
}
}
|
[
"[email protected]"
] | |
b07d3f0aa8c8ee1c2ae3ac416faa4d2df7464b9e
|
5783321a108bdc140634e988ba61554729710716
|
/OOP/HomeWork_8/src/_1_Geometry/SpaceShapes3D/SpaceShape.java
|
1dfd874faa0f6378af6f5201e5946e5bca308870
|
[] |
no_license
|
presian/HomeWorks
|
c442b15f703fc530ff192b21d01df0f548a06411
|
1f0ac46516bf49580411df62c37c11d931b60567
|
refs/heads/master
| 2021-01-13T02:14:14.140099 | 2015-04-13T20:24:32 | 2015-04-13T20:24:32 | 23,003,648 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 971 |
java
|
package _1_Geometry.SpaceShapes3D;
import _1_Geometry.Interfaces.AreaMeasurable;
import _1_Geometry.Interfaces.VolumeMeasurable;
import _1_Geometry.Shape;
public abstract class SpaceShape extends Shape implements VolumeMeasurable, AreaMeasurable {
Vertex3D[] vertex3Ds = new Vertex3D[1];
protected SpaceShape(double x, double y, double z) {
this.vertex3Ds[0] = new Vertex3D(x, y, z);
}
@Override
public abstract double getArea();
@Override
public abstract double getVolume();
@Override
public String toString() {
String type = this.getClass().toString().substring(this.getClass().toString().lastIndexOf(".") + 1, this.getClass().toString().length());
String vert = String.format("[ X: %f Y: %f Z: %f ]",this.vertex3Ds[0].getX(),this.vertex3Ds[0].getY(),this.vertex3Ds[0].getZ());
return String.format("%s\nArea: %.2f\nVolume: %.2f\n%s", type, this.getArea(), this.getVolume(),vert);
}
}
|
[
"[email protected]"
] | |
f0d5b9566178497be8d95800cf18ac3b3d9868e5
|
110819fdc4e7feea8486a1327a5c4d420d402032
|
/springboot-inventarioapp/src/main/java/com/springboot/inventarioapp/models/entity/EgresoReceta.java
|
d2de3dd834aa7bbc53286710fb6724a149227726
|
[] |
no_license
|
jitzon/proyecto-final-desarrollo-web
|
f8eb43ed5f82dcd96e7d7aa656f6480dbef1746f
|
7ab9ccff71eeb2b99259ff72e8ca8046b3882b50
|
refs/heads/main
| 2023-08-21T11:01:12.833849 | 2021-10-21T04:26:35 | 2021-10-21T04:26:35 | 308,529,189 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,323 |
java
|
package com.springboot.inventarioapp.models.entity;
import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name="egresos_receta")
public class EgresoReceta implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int id;
private Date fecha;
@ManyToOne
@JoinColumn(name="idreceta")
private Receta receta;
private int cantidad;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCantidad() {
return cantidad;
}
public void setCantidad(int cantidad) {
this.cantidad = cantidad;
}
public Date getFecha() {
return fecha;
}
public void setFecha(Date fecha) {
this.fecha = fecha;
}
public Receta getReceta() {
return receta;
}
public void setReceta(Receta receta) {
this.receta = receta;
}
@Override
public String toString() {
return "Ingreso [id=" + id + ", cantidad=" + cantidad + ", observacion=" +", producto="
+ receta + ", tienda=" + "]";
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.