blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
list
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
list
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
57830c4cd02c159bc3b04c279ceb60f57ed8376a
23,330,262,353,468
ad4f61d3803b7b6b7712757b3d5108690dbb9f9c
/java/rizsi-basic/src/main/java/rizsi/basic/BasicConsole.java
562b89e7434a3fc31f13627f5686ea1e08478f63
[]
no_license
rizsi/rbasic
https://github.com/rizsi/rbasic
2c180ffc3085e4619d4e7f1079c150b44b9ce3ae
cb9460fb4cd1ce57f96832abb61573354e4f2728
refs/heads/master
2016-08-23T18:58:33.891000
2016-08-17T02:15:36
2016-08-17T02:15:36
65,863,646
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package rizsi.basic; import java.io.IOException; import com.googlecode.lanterna.terminal.Terminal; public class BasicConsole extends Console { public BasicConsole(Terminal terminal) throws IOException { super(terminal); } }
UTF-8
Java
233
java
BasicConsole.java
Java
[]
null
[]
package rizsi.basic; import java.io.IOException; import com.googlecode.lanterna.terminal.Terminal; public class BasicConsole extends Console { public BasicConsole(Terminal terminal) throws IOException { super(terminal); } }
233
0.7897
0.7897
14
15.642858
20.204693
60
false
false
0
0
0
0
0
0
0.571429
false
false
2
2879b95ff9f4dcc314dad8a7b67b23103a6a986c
33,586,644,299,366
abae50a161981aa6e0207788d203b225337f118e
/app/src/main/java/com/example/s2784/layout/DiscussActivity.java
4e80a420d61aecf91ab561e311efc224ec30e0a5
[]
no_license
adam1214/NCKU_Line
https://github.com/adam1214/NCKU_Line
68bf46281f4737aba68c507a35cba8fd97bad7b5
7df4b256f6ff2352afe59e21b6c26e50d86ec432
refs/heads/master
2020-12-15T12:34:07.036000
2019-09-02T02:43:44
2019-09-02T02:43:44
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.s2784.layout; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.MenuItem; import android.view.View; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class DiscussActivity extends AppCompatActivity implements View.OnClickListener, PlusDialog.PlusDialogListener ,LinkModule.PListener{ private List<CardData> dataList = new ArrayList<>(); private CardDataAdapter cardDataAdapter; protected android.support.v7.widget.Toolbar toolbar; private final int space = 20; private FloatingActionButton floatingActionButton; private RoomInfo roomInfo; @RequiresApi(api = Build.VERSION_CODES.M) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_discuss); //Change status color if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(getColor(R.color.ncku_red)); } else { getWindow().setStatusBarColor(getColor(R.color.ncku_red)); } //Change status color Intent intent = getIntent(); roomInfo = intent.getParcelableExtra("roomInfo"); floatingActionButton = findViewById(R.id.fab_plus); floatingActionButton.setOnClickListener(this); cardDataAdapter = new CardDataAdapter(this,dataList,roomInfo); toolbar = findViewById(R.id.discuss_toolbar); toolbar.setTitle("討論區"); toolbar.setTitleTextColor(getResources().getColor(R.color.white)); setSupportActionBar(toolbar); if(getSupportActionBar()!=null){ getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } RecyclerView recyclerView = findViewById(R.id.discuss_recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)); recyclerView.setAdapter(cardDataAdapter); recyclerView.addItemDecoration(new SpaceItemDecoration(space)); LinkModule.getInstance().setPListener(this); Tabs.mqtt.getPoster(roomInfo.getCode()); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.fab_plus: // Toast.makeText(this,"Click",Toast.LENGTH_SHORT).show(); openDialog(); break; } } public void openDialog(){ PlusDialog plusDialog = new PlusDialog(); plusDialog.show(getSupportFragmentManager(),"Plus Dialog"); } @Override public void applyTexts(String title, String content) { if(!title.equals("") && !content.equals("")) { Tabs.mqtt.addPoster(roomInfo.getCode(), title, content, "post"); } } public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId() == android.R.id.home){ finish(); } return super.onOptionsItemSelected(item); } @Override public void fetchPoster(String record) { StringTokenizer stringTokenizer = new StringTokenizer(record,"\r"); while (stringTokenizer.hasMoreElements()){ String token = stringTokenizer.nextToken(); String token_splitLine[] = token.split("\t"); updatePost(token_splitLine[1],token_splitLine[2],token_splitLine[3],token_splitLine[0],token_splitLine[4]); } } @Override public void updatePoster(String code, String theme, String content, String type, String sender, String time) { updatePost(theme,content,time,sender,type); // Log.d("POST",theme + content + time + sender + type); } private void updatePost(String title, String content, String time, String name, String type){ CardData cardData = new CardData(title,content,time,name,type); dataList.add(cardData); cardDataAdapter.notifyDataSetChanged(); } }
UTF-8
Java
4,317
java
DiscussActivity.java
Java
[]
null
[]
package com.example.s2784.layout; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.MenuItem; import android.view.View; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class DiscussActivity extends AppCompatActivity implements View.OnClickListener, PlusDialog.PlusDialogListener ,LinkModule.PListener{ private List<CardData> dataList = new ArrayList<>(); private CardDataAdapter cardDataAdapter; protected android.support.v7.widget.Toolbar toolbar; private final int space = 20; private FloatingActionButton floatingActionButton; private RoomInfo roomInfo; @RequiresApi(api = Build.VERSION_CODES.M) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_discuss); //Change status color if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(getColor(R.color.ncku_red)); } else { getWindow().setStatusBarColor(getColor(R.color.ncku_red)); } //Change status color Intent intent = getIntent(); roomInfo = intent.getParcelableExtra("roomInfo"); floatingActionButton = findViewById(R.id.fab_plus); floatingActionButton.setOnClickListener(this); cardDataAdapter = new CardDataAdapter(this,dataList,roomInfo); toolbar = findViewById(R.id.discuss_toolbar); toolbar.setTitle("討論區"); toolbar.setTitleTextColor(getResources().getColor(R.color.white)); setSupportActionBar(toolbar); if(getSupportActionBar()!=null){ getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } RecyclerView recyclerView = findViewById(R.id.discuss_recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)); recyclerView.setAdapter(cardDataAdapter); recyclerView.addItemDecoration(new SpaceItemDecoration(space)); LinkModule.getInstance().setPListener(this); Tabs.mqtt.getPoster(roomInfo.getCode()); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.fab_plus: // Toast.makeText(this,"Click",Toast.LENGTH_SHORT).show(); openDialog(); break; } } public void openDialog(){ PlusDialog plusDialog = new PlusDialog(); plusDialog.show(getSupportFragmentManager(),"Plus Dialog"); } @Override public void applyTexts(String title, String content) { if(!title.equals("") && !content.equals("")) { Tabs.mqtt.addPoster(roomInfo.getCode(), title, content, "post"); } } public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId() == android.R.id.home){ finish(); } return super.onOptionsItemSelected(item); } @Override public void fetchPoster(String record) { StringTokenizer stringTokenizer = new StringTokenizer(record,"\r"); while (stringTokenizer.hasMoreElements()){ String token = stringTokenizer.nextToken(); String token_splitLine[] = token.split("\t"); updatePost(token_splitLine[1],token_splitLine[2],token_splitLine[3],token_splitLine[0],token_splitLine[4]); } } @Override public void updatePoster(String code, String theme, String content, String type, String sender, String time) { updatePost(theme,content,time,sender,type); // Log.d("POST",theme + content + time + sender + type); } private void updatePost(String title, String content, String time, String name, String type){ CardData cardData = new CardData(title,content,time,name,type); dataList.add(cardData); cardDataAdapter.notifyDataSetChanged(); } }
4,317
0.6836
0.680121
120
34.924999
29.54944
140
false
false
0
0
0
0
0
0
0.783333
false
false
2
3d5d94ae3dcffb9278a3553bec53cffcf1ffee3e
39,479,339,400,087
594cf8addb13959d1c1a28430dcb017a2ed8e1bd
/app/src/main/java/com/example/root/lab1/TipSuggesterActivity.java
0460a6da37d5f9339b1d7fbd72401ccc131e703c
[]
no_license
pboud071/Lab1_SEG3525
https://github.com/pboud071/Lab1_SEG3525
5ad9481ac4de251ff85b95115203226d7cfa58b4
24ae8ad1014b32bdcedb5ff55ef07c42013a5628
refs/heads/master
2021-01-10T05:26:36.873000
2015-06-18T16:35:11
2015-06-18T16:35:11
36,516,624
0
1
null
false
2015-06-06T01:37:16
2015-05-29T16:41:30
2015-05-29T16:46:23
2015-06-06T01:37:16
183
0
1
0
Java
null
null
package com.example.root.lab1; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.RatingBar; import android.widget.TextView; import android.widget.Toast; public class TipSuggesterActivity extends Activity { TextView tipCalculatedLbl; RatingBar rbTip; String tipValue_BckStr = ""; String tipValueStr = ""; String nbr_persStr = ""; String mnt_factStr = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tip_suggester); //Extract the bundle from the intent to use variables Bundle bundle = getIntent().getExtras(); //Extract each value from the bundle for usage tipValueStr = bundle.getString("TIP"); tipValue_BckStr = tipValueStr; nbr_persStr = bundle.getString("NBR_PERS"); mnt_factStr = bundle.getString("MNT_FACT"); rbTip = (RatingBar) findViewById(R.id.serviceRatingBar); rbTip.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() { @Override public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { double tipValue = 10 + (ratingBar.getRating() * 2); tipCalculatedLbl = (TextView) findViewById(R.id.tipValueLbl); tipValueStr = String.valueOf(tipValue); tipCalculatedLbl.setText(String.valueOf(tipValue)); } }); Button bckButton = (Button)findViewById(R.id.suggest_cancel); bckButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent mainAct = new Intent(TipSuggesterActivity.this, MainActivity.class); Bundle bndl = new Bundle(); bndl.putString("TIP", tipValue_BckStr); bndl.putString("NBR_PERS", nbr_persStr); bndl.putString("MNT_FACT", mnt_factStr); mainAct.putExtras(bndl); startActivity(mainAct); } }); Button confirmButton = (Button)findViewById(R.id.confirm_suggest_tip); confirmButton .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent mainAct = new Intent(TipSuggesterActivity.this, MainActivity.class); Bundle bndl = new Bundle(); bndl.putString("TIP", tipValueStr); bndl.putString("NBR_PERS", nbr_persStr); bndl.putString("MNT_FACT", mnt_factStr); mainAct.putExtras(bndl); startActivity(mainAct); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_tip_suggester, 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(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
UTF-8
Java
3,714
java
TipSuggesterActivity.java
Java
[]
null
[]
package com.example.root.lab1; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.RatingBar; import android.widget.TextView; import android.widget.Toast; public class TipSuggesterActivity extends Activity { TextView tipCalculatedLbl; RatingBar rbTip; String tipValue_BckStr = ""; String tipValueStr = ""; String nbr_persStr = ""; String mnt_factStr = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tip_suggester); //Extract the bundle from the intent to use variables Bundle bundle = getIntent().getExtras(); //Extract each value from the bundle for usage tipValueStr = bundle.getString("TIP"); tipValue_BckStr = tipValueStr; nbr_persStr = bundle.getString("NBR_PERS"); mnt_factStr = bundle.getString("MNT_FACT"); rbTip = (RatingBar) findViewById(R.id.serviceRatingBar); rbTip.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() { @Override public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { double tipValue = 10 + (ratingBar.getRating() * 2); tipCalculatedLbl = (TextView) findViewById(R.id.tipValueLbl); tipValueStr = String.valueOf(tipValue); tipCalculatedLbl.setText(String.valueOf(tipValue)); } }); Button bckButton = (Button)findViewById(R.id.suggest_cancel); bckButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent mainAct = new Intent(TipSuggesterActivity.this, MainActivity.class); Bundle bndl = new Bundle(); bndl.putString("TIP", tipValue_BckStr); bndl.putString("NBR_PERS", nbr_persStr); bndl.putString("MNT_FACT", mnt_factStr); mainAct.putExtras(bndl); startActivity(mainAct); } }); Button confirmButton = (Button)findViewById(R.id.confirm_suggest_tip); confirmButton .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent mainAct = new Intent(TipSuggesterActivity.this, MainActivity.class); Bundle bndl = new Bundle(); bndl.putString("TIP", tipValueStr); bndl.putString("NBR_PERS", nbr_persStr); bndl.putString("MNT_FACT", mnt_factStr); mainAct.putExtras(bndl); startActivity(mainAct); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_tip_suggester, 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(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
3,714
0.624933
0.623856
104
34.71154
25.228445
91
false
false
0
0
0
0
0
0
0.644231
false
false
2
86c0164d34a953471d8e09b89f522c59cbee4926
34,359,738,427,203
e414c45c9911cdbf047c5c4a993125ac2a1553fd
/Lab2/test/TransmissionBoxTest.java
c1dd62208cf2232b1d8a5ab4387fd43959e5a2aa
[]
no_license
northeastern-align/CS5004
https://github.com/northeastern-align/CS5004
a771f333397c0e2b6721865ad25a7f9fa9103fb2
c364e54997ea8e94cecb911d226e28437a4e9222
refs/heads/master
2020-06-28T05:09:17.521000
2019-08-02T12:59:13
2019-08-02T12:59:13
200,149,310
2
3
null
null
null
null
null
null
null
null
null
null
null
null
null
import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; /** * JUnit test class for TransmissionBox */ public class TransmissionBoxTest { private TransmissionBox transmission; @Before public void setUp() { transmission = new TransmissionBox(29, 10, 20, 30, 40); } @Test public void testGetSpeed() { assertEquals(29, transmission.getSpeed()); } @Test public void testGetGear() { assertEquals(3, transmission.getGear()); } @Test public void testSpeedUp() { TransmissionBox expected = new TransmissionBox(31, 10, 20, 30, 40); assertEquals(expected, transmission.speedUp()); } @Test public void testGetCurrentGear() { TransmissionBox newTransmission = transmission.speedUp(); assertEquals(4, newTransmission.getCurrentGear()); } @Test public void testSlowDown() { TransmissionBox expected = new TransmissionBox(27, 10, 20, 30, 40); assertEquals(expected, transmission.slowDown()); } @Test public void testToString() { assertEquals("Current speed is 29 and current gear is 3.", transmission.toString()); } }
UTF-8
Java
1,162
java
TransmissionBoxTest.java
Java
[]
null
[]
import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; /** * JUnit test class for TransmissionBox */ public class TransmissionBoxTest { private TransmissionBox transmission; @Before public void setUp() { transmission = new TransmissionBox(29, 10, 20, 30, 40); } @Test public void testGetSpeed() { assertEquals(29, transmission.getSpeed()); } @Test public void testGetGear() { assertEquals(3, transmission.getGear()); } @Test public void testSpeedUp() { TransmissionBox expected = new TransmissionBox(31, 10, 20, 30, 40); assertEquals(expected, transmission.speedUp()); } @Test public void testGetCurrentGear() { TransmissionBox newTransmission = transmission.speedUp(); assertEquals(4, newTransmission.getCurrentGear()); } @Test public void testSlowDown() { TransmissionBox expected = new TransmissionBox(27, 10, 20, 30, 40); assertEquals(expected, transmission.slowDown()); } @Test public void testToString() { assertEquals("Current speed is 29 and current gear is 3.", transmission.toString()); } }
1,162
0.685026
0.653184
57
19.403509
21.923199
88
false
false
0
0
0
0
0
0
0.561404
false
false
2
1158845bb0c035678346532dc98cbc7d1e3c3523
34,359,738,425,116
bda89d70329d174c4340f20d65dccf828fcf972b
/Hamka_scorpion/src/Model/WhiteSoldierTilesCriteria.java
5ce9cefdb63740ee39b80dcf0b7a47df775755c2
[]
no_license
mhahmad/Scorpion_Sw
https://github.com/mhahmad/Scorpion_Sw
b82dab20d73f33cb23877d470b666d75738b8cbd
79ed1afc768bbee0e22625e3dd16f7f2a032c57a
refs/heads/master
2023-02-12T12:22:29.424000
2021-01-10T20:51:50
2021-01-10T20:51:50
307,363,222
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Model; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import Model.Soldier; import Model.Tile; public class WhiteSoldierTilesCriteria implements TileCriteria{ @Override public ArrayList<Tile> meetCriteria(HashMap<Tile, Soldier> tiles) { ArrayList<Tile> toReturn = new ArrayList<Tile>(); //HashMap<Tile,Soldier> toReturn = new HashMap<Tile, Soldier>(); for(Map.Entry<Tile, Soldier> entry : tiles.entrySet()) { if(entry.getValue()!= null) { if(entry.getValue().getSoldierNumber() == 1 ) { toReturn.add(entry.getKey()); } } } return toReturn; } }
UTF-8
Java
715
java
WhiteSoldierTilesCriteria.java
Java
[]
null
[]
package Model; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import Model.Soldier; import Model.Tile; public class WhiteSoldierTilesCriteria implements TileCriteria{ @Override public ArrayList<Tile> meetCriteria(HashMap<Tile, Soldier> tiles) { ArrayList<Tile> toReturn = new ArrayList<Tile>(); //HashMap<Tile,Soldier> toReturn = new HashMap<Tile, Soldier>(); for(Map.Entry<Tile, Soldier> entry : tiles.entrySet()) { if(entry.getValue()!= null) { if(entry.getValue().getSoldierNumber() == 1 ) { toReturn.add(entry.getKey()); } } } return toReturn; } }
715
0.611189
0.60979
28
24.571428
24.459045
72
false
false
0
0
0
0
0
0
0.5
false
false
2
262b26693e7e8552306fc6e2e738ada5de41cf6a
29,515,015,258,781
09fd2ac1e97e8dbe707cb2eb28089872f5379102
/src/main/java/com/anita/nst2/elasticsearch/QuestionIndexer.java
c4f7201d8958c9a811da21b799527e17fdcbec09
[]
no_license
anitailic/nst
https://github.com/anitailic/nst
82ba0b5ab34a06891bf69c4883dc9788e370f9c8
33ef6b4ed4f7ac557e087148bcf0b382b0df87ef
HEAD
2018-11-30T19:42:51.121000
2018-08-31T10:04:58
2018-08-31T10:04:58
120,790,175
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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.anita.nst2.elasticsearch; import com.anita.nst2.model.Question; import com.anita.nst2.utils.Constants; import java.util.Date; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Requests; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * * @author anita */ @Component public class QuestionIndexer { @Autowired private ElasticSearchClient elasticClient; public void indexQuestion(Question question) throws Exception { IndexResponse indexResponse = elasticClient .getClient() .prepareIndex(Constants.QUESTION_INDEX, Constants.QUESTION_TYPE, String.valueOf(question.getId())) .setSource(buildQuestion(question)) .get(); } public void updateQuestion(Question question) throws Exception { elasticClient.getClient().prepareUpdate( Constants.QUESTION_INDEX, Constants.QUESTION_TYPE, String.valueOf(question.getId())) .setDoc(buildQuestion(question)).get(); } public void createQuestionIndexIfNotExists() { boolean exists = elasticClient.getClient().admin().indices() .prepareExists(Constants.QUESTION_INDEX) .execute().actionGet().isExists(); if (!exists) { CreateIndexResponse createIndexResponse = elasticClient.getClient().admin().indices(). create(Requests.createIndexRequest(Constants.QUESTION_INDEX)).actionGet(); } } public void deleteQuestionIndexes() { boolean exists = elasticClient.getClient().admin().indices() .prepareExists(Constants.QUESTION_INDEX) .execute().actionGet().isExists(); if (exists) { elasticClient.getClient(). admin().indices().delete(new DeleteIndexRequest(Constants.QUESTION_INDEX)).actionGet(); } } public void deleteQuestion(Long questionId) { elasticClient.getClient().prepareDelete(Constants.QUESTION_INDEX, Constants.QUESTION_TYPE, String.valueOf(questionId)).get(); } public XContentBuilder buildQuestion(Question question) throws Exception { XContentBuilder builder = XContentFactory.jsonBuilder(); builder.startObject(); if (question.getId() != null) { builder.field("id", question.getId()); } builder.field("acceptedAnswer", question.getAcceptedAnswer()); builder.field("body", question.getBody()); builder.field("creationDate", new Date(question.getCreationDate().getTime())); builder.field("code", question.getCode()); builder.field("tags", question.getTagss()); // for (String tag : question.getTags()) { //// builder.startObject("tag"); // builder.field("tag",tag); // builder.endObject(); // } // builder.endArray(); builder.startObject("user"); builder.field("name", question.getUser().getName()); builder.field("id", question.getUser().getId()); builder.field("image", question.getUser().getImage()); builder.field("reputation", question.getUser().getReputation()); builder.endObject(); builder.field("title", question.getTitle()); builder.startObject("category"); builder.field("name", question.getCategory().getName()); builder.field("id", question.getCategory().getId()); builder.endObject(); builder.endObject(); return builder; } }
UTF-8
Java
4,085
java
QuestionIndexer.java
Java
[ { "context": "framework.stereotype.Component;\n\n/**\n *\n * @author anita\n */\n@Component\npublic class QuestionIndexer {\n\n ", "end": 818, "score": 0.8972887992858887, "start": 813, "tag": "USERNAME", "value": "anita" } ]
null
[]
/* * 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.anita.nst2.elasticsearch; import com.anita.nst2.model.Question; import com.anita.nst2.utils.Constants; import java.util.Date; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Requests; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * * @author anita */ @Component public class QuestionIndexer { @Autowired private ElasticSearchClient elasticClient; public void indexQuestion(Question question) throws Exception { IndexResponse indexResponse = elasticClient .getClient() .prepareIndex(Constants.QUESTION_INDEX, Constants.QUESTION_TYPE, String.valueOf(question.getId())) .setSource(buildQuestion(question)) .get(); } public void updateQuestion(Question question) throws Exception { elasticClient.getClient().prepareUpdate( Constants.QUESTION_INDEX, Constants.QUESTION_TYPE, String.valueOf(question.getId())) .setDoc(buildQuestion(question)).get(); } public void createQuestionIndexIfNotExists() { boolean exists = elasticClient.getClient().admin().indices() .prepareExists(Constants.QUESTION_INDEX) .execute().actionGet().isExists(); if (!exists) { CreateIndexResponse createIndexResponse = elasticClient.getClient().admin().indices(). create(Requests.createIndexRequest(Constants.QUESTION_INDEX)).actionGet(); } } public void deleteQuestionIndexes() { boolean exists = elasticClient.getClient().admin().indices() .prepareExists(Constants.QUESTION_INDEX) .execute().actionGet().isExists(); if (exists) { elasticClient.getClient(). admin().indices().delete(new DeleteIndexRequest(Constants.QUESTION_INDEX)).actionGet(); } } public void deleteQuestion(Long questionId) { elasticClient.getClient().prepareDelete(Constants.QUESTION_INDEX, Constants.QUESTION_TYPE, String.valueOf(questionId)).get(); } public XContentBuilder buildQuestion(Question question) throws Exception { XContentBuilder builder = XContentFactory.jsonBuilder(); builder.startObject(); if (question.getId() != null) { builder.field("id", question.getId()); } builder.field("acceptedAnswer", question.getAcceptedAnswer()); builder.field("body", question.getBody()); builder.field("creationDate", new Date(question.getCreationDate().getTime())); builder.field("code", question.getCode()); builder.field("tags", question.getTagss()); // for (String tag : question.getTags()) { //// builder.startObject("tag"); // builder.field("tag",tag); // builder.endObject(); // } // builder.endArray(); builder.startObject("user"); builder.field("name", question.getUser().getName()); builder.field("id", question.getUser().getId()); builder.field("image", question.getUser().getImage()); builder.field("reputation", question.getUser().getReputation()); builder.endObject(); builder.field("title", question.getTitle()); builder.startObject("category"); builder.field("name", question.getCategory().getName()); builder.field("id", question.getCategory().getId()); builder.endObject(); builder.endObject(); return builder; } }
4,085
0.658996
0.658262
101
39.445545
27.397865
107
false
false
0
0
0
0
0
0
0.673267
false
false
2
f55123043413de17ef77fc3d884f23c737dbe20b
37,160,057,080,508
4b036ffabd1769666eea8906f53780882af23c88
/src/com/adamdcombs/model/Item.java
17a432da320af106672ca66f6620b684c3f46eff
[]
no_license
addcombs/MaterialTracking
https://github.com/addcombs/MaterialTracking
849df436bf71b6772d9b2b0a7dd430777141f53c
0c0fc1022819b3b9ec581cdab129c0e31b53dce5
refs/heads/master
2016-08-12T08:14:21.610000
2016-01-12T17:05:43
2016-01-12T17:05:43
47,418,309
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.adamdcombs.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToOne; @Entity public class Item { @Id @GeneratedValue private int cId; private String name; private int quantity; @ManyToOne @JoinTable( name = "asset_has_item", joinColumns = {@JoinColumn(name = "item_id")}, inverseJoinColumns = {@JoinColumn(name = "asset_id")} ) private Asset asset; public Item(){ } public Item(String name, int quantity, Asset asset) { super(); this.name = name; this.quantity = quantity; this.asset = asset; } public int getcId() { return cId; } public void setcId(int cId) { this.cId = cId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Asset getAsset() { return asset; } public void setAsset(Asset asset) { this.asset = asset; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } }
UTF-8
Java
1,143
java
Item.java
Java
[]
null
[]
package com.adamdcombs.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToOne; @Entity public class Item { @Id @GeneratedValue private int cId; private String name; private int quantity; @ManyToOne @JoinTable( name = "asset_has_item", joinColumns = {@JoinColumn(name = "item_id")}, inverseJoinColumns = {@JoinColumn(name = "asset_id")} ) private Asset asset; public Item(){ } public Item(String name, int quantity, Asset asset) { super(); this.name = name; this.quantity = quantity; this.asset = asset; } public int getcId() { return cId; } public void setcId(int cId) { this.cId = cId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Asset getAsset() { return asset; } public void setAsset(Asset asset) { this.asset = asset; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } }
1,143
0.697288
0.697288
64
16.859375
14.693607
56
false
false
0
0
0
0
0
0
1.5
false
false
2
2a6952427819fc792a407418eb533f4def2140fc
38,019,050,531,247
5b92092ac802faf412dcf60749ca1752e4d258a7
/stubs/android/opengl/GLES30.java
1b7191aabc4f88551612de336b7ea9604482e316
[]
no_license
kamilok1965/android-dokka-test
https://github.com/kamilok1965/android-dokka-test
f1a2984e750e855051ce60151e2e49e74a4c6e2d
37dbc30ba13070a051ada0ccb91c33993ba12e96
refs/heads/master
2020-12-18T23:35:44.688000
2020-01-22T10:45:44
2020-01-22T10:45:44
235,552,656
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* ** ** Copyright 2013, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated package android.opengl; /** OpenGL ES 3.0 @apiSince 18 */ @SuppressWarnings({"unchecked", "deprecation", "all"}) public class GLES30 extends android.opengl.GLES20 { public GLES30() { throw new RuntimeException("Stub!"); } /** @apiSince 18 */ public static native void glReadBuffer(int mode); /** @apiSince 18 */ public static native void glDrawRangeElements(int mode, int start, int end, int count, int type, java.nio.Buffer indices); /** @apiSince 18 */ public static native void glDrawRangeElements(int mode, int start, int end, int count, int type, int offset); /** @apiSince 18 */ public static native void glTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, java.nio.Buffer pixels); /** @apiSince 18 */ public static native void glTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, int offset); /** @apiSince 18 */ public static native void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, java.nio.Buffer pixels); /** @apiSince 18 */ public static native void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int offset); /** @apiSince 18 */ public static native void glCopyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height); /** @apiSince 18 */ public static native void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, java.nio.Buffer data); /** @apiSince 18 */ public static native void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int offset); /** @apiSince 18 */ public static native void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, java.nio.Buffer data); /** @apiSince 18 */ public static native void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int offset); /** @apiSince 18 */ public static native void glGenQueries(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glGenQueries(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native void glDeleteQueries(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glDeleteQueries(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native boolean glIsQuery(int id); /** @apiSince 18 */ public static native void glBeginQuery(int target, int id); /** @apiSince 18 */ public static native void glEndQuery(int target); /** @apiSince 18 */ public static native void glGetQueryiv(int target, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetQueryiv(int target, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetQueryObjectuiv(int id, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetQueryObjectuiv(int id, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native boolean glUnmapBuffer(int target); /** * The {@link java.nio.Buffer} instance returned by this method is guaranteed * to be an instance of {@link java.nio.ByteBuffer}. * @apiSince 18 */ public static native java.nio.Buffer glGetBufferPointerv(int target, int pname); /** @apiSince 18 */ public static native void glDrawBuffers(int n, int[] bufs, int offset); /** @apiSince 18 */ public static native void glDrawBuffers(int n, java.nio.IntBuffer bufs); /** @apiSince 18 */ public static native void glUniformMatrix2x3fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix2x3fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix3x2fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix3x2fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix2x4fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix2x4fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix4x2fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix4x2fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix3x4fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix3x4fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix4x3fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix4x3fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter); /** @apiSince 18 */ public static native void glRenderbufferStorageMultisample(int target, int samples, int internalformat, int width, int height); /** @apiSince 18 */ public static native void glFramebufferTextureLayer(int target, int attachment, int texture, int level, int layer); /** * The {@link java.nio.Buffer} instance returned by this method is guaranteed * to be an instance of {@link java.nio.ByteBuffer}. * @apiSince 18 */ public static native java.nio.Buffer glMapBufferRange(int target, int offset, int length, int access); /** @apiSince 18 */ public static native void glFlushMappedBufferRange(int target, int offset, int length); /** @apiSince 18 */ public static native void glBindVertexArray(int array); /** @apiSince 18 */ public static native void glDeleteVertexArrays(int n, int[] arrays, int offset); /** @apiSince 18 */ public static native void glDeleteVertexArrays(int n, java.nio.IntBuffer arrays); /** @apiSince 18 */ public static native void glGenVertexArrays(int n, int[] arrays, int offset); /** @apiSince 18 */ public static native void glGenVertexArrays(int n, java.nio.IntBuffer arrays); /** @apiSince 18 */ public static native boolean glIsVertexArray(int array); /** @apiSince 18 */ public static native void glGetIntegeri_v(int target, int index, int[] data, int offset); /** @apiSince 18 */ public static native void glGetIntegeri_v(int target, int index, java.nio.IntBuffer data); /** @apiSince 18 */ public static native void glBeginTransformFeedback(int primitiveMode); /** @apiSince 18 */ public static native void glEndTransformFeedback(); /** @apiSince 18 */ public static native void glBindBufferRange(int target, int index, int buffer, int offset, int size); /** @apiSince 18 */ public static native void glBindBufferBase(int target, int index, int buffer); /** @apiSince 18 */ public static native void glTransformFeedbackVaryings(int program, java.lang.String[] varyings, int bufferMode); /** @apiSince 18 */ public static native void glGetTransformFeedbackVarying(int program, int index, int bufsize, int[] length, int lengthOffset, int[] size, int sizeOffset, int[] type, int typeOffset, byte[] name, int nameOffset); /** * @deprecated * Use the version that takes a ByteBuffer as the last argument, or the versions that return a String. * * @apiSince 18 * @deprecatedSince 24 */ @Deprecated public static native void glGetTransformFeedbackVarying(int program, int index, int bufsize, java.nio.IntBuffer length, java.nio.IntBuffer size, java.nio.IntBuffer type, byte name); /** @apiSince 24 */ public static native void glGetTransformFeedbackVarying(int program, int index, int bufsize, java.nio.IntBuffer length, java.nio.IntBuffer size, java.nio.IntBuffer type, java.nio.ByteBuffer name); /** @apiSince 18 */ public static native java.lang.String glGetTransformFeedbackVarying(int program, int index, int[] size, int sizeOffset, int[] type, int typeOffset); /** @apiSince 18 */ public static native java.lang.String glGetTransformFeedbackVarying(int program, int index, java.nio.IntBuffer size, java.nio.IntBuffer type); /** @apiSince 18 */ public static void glVertexAttribIPointer(int index, int size, int type, int stride, java.nio.Buffer pointer) { throw new RuntimeException("Stub!"); } /** @apiSince 18 */ public static native void glVertexAttribIPointer(int index, int size, int type, int stride, int offset); /** @apiSince 18 */ public static native void glGetVertexAttribIiv(int index, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetVertexAttribIiv(int index, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetVertexAttribIuiv(int index, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetVertexAttribIuiv(int index, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glVertexAttribI4i(int index, int x, int y, int z, int w); /** @apiSince 18 */ public static native void glVertexAttribI4ui(int index, int x, int y, int z, int w); /** @apiSince 18 */ public static native void glVertexAttribI4iv(int index, int[] v, int offset); /** @apiSince 18 */ public static native void glVertexAttribI4iv(int index, java.nio.IntBuffer v); /** @apiSince 18 */ public static native void glVertexAttribI4uiv(int index, int[] v, int offset); /** @apiSince 18 */ public static native void glVertexAttribI4uiv(int index, java.nio.IntBuffer v); /** @apiSince 18 */ public static native void glGetUniformuiv(int program, int location, int[] params, int offset); /** @apiSince 18 */ public static native void glGetUniformuiv(int program, int location, java.nio.IntBuffer params); /** @apiSince 18 */ public static native int glGetFragDataLocation(int program, java.lang.String name); /** @apiSince 18 */ public static native void glUniform1ui(int location, int v0); /** @apiSince 18 */ public static native void glUniform2ui(int location, int v0, int v1); /** @apiSince 18 */ public static native void glUniform3ui(int location, int v0, int v1, int v2); /** @apiSince 18 */ public static native void glUniform4ui(int location, int v0, int v1, int v2, int v3); /** @apiSince 18 */ public static native void glUniform1uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform1uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glUniform2uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform2uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glUniform3uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform3uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glUniform4uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform4uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glClearBufferiv(int buffer, int drawbuffer, int[] value, int offset); /** @apiSince 18 */ public static native void glClearBufferiv(int buffer, int drawbuffer, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glClearBufferuiv(int buffer, int drawbuffer, int[] value, int offset); /** @apiSince 18 */ public static native void glClearBufferuiv(int buffer, int drawbuffer, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glClearBufferfv(int buffer, int drawbuffer, float[] value, int offset); /** @apiSince 18 */ public static native void glClearBufferfv(int buffer, int drawbuffer, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glClearBufferfi(int buffer, int drawbuffer, float depth, int stencil); /** @apiSince 18 */ public static native java.lang.String glGetStringi(int name, int index); /** @apiSince 18 */ public static native void glCopyBufferSubData(int readTarget, int writeTarget, int readOffset, int writeOffset, int size); /** @apiSince 18 */ public static native void glGetUniformIndices(int program, java.lang.String[] uniformNames, int[] uniformIndices, int uniformIndicesOffset); /** @apiSince 18 */ public static native void glGetUniformIndices(int program, java.lang.String[] uniformNames, java.nio.IntBuffer uniformIndices); /** @apiSince 18 */ public static native void glGetActiveUniformsiv(int program, int uniformCount, int[] uniformIndices, int uniformIndicesOffset, int pname, int[] params, int paramsOffset); /** @apiSince 18 */ public static native void glGetActiveUniformsiv(int program, int uniformCount, java.nio.IntBuffer uniformIndices, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native int glGetUniformBlockIndex(int program, java.lang.String uniformBlockName); /** @apiSince 18 */ public static native void glGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, int[] length, int lengthOffset, byte[] uniformBlockName, int uniformBlockNameOffset); /** @apiSince 18 */ public static native void glGetActiveUniformBlockName(int program, int uniformBlockIndex, java.nio.Buffer length, java.nio.Buffer uniformBlockName); /** @apiSince 18 */ public static native java.lang.String glGetActiveUniformBlockName(int program, int uniformBlockIndex); /** @apiSince 18 */ public static native void glUniformBlockBinding(int program, int uniformBlockIndex, int uniformBlockBinding); /** @apiSince 18 */ public static native void glDrawArraysInstanced(int mode, int first, int count, int instanceCount); /** @apiSince 18 */ public static native void glDrawElementsInstanced(int mode, int count, int type, java.nio.Buffer indices, int instanceCount); /** @apiSince 18 */ public static native void glDrawElementsInstanced(int mode, int count, int type, int indicesOffset, int instanceCount); /** @apiSince 18 */ public static native long glFenceSync(int condition, int flags); /** @apiSince 18 */ public static native boolean glIsSync(long sync); /** @apiSince 18 */ public static native void glDeleteSync(long sync); /** @apiSince 18 */ public static native int glClientWaitSync(long sync, int flags, long timeout); /** @apiSince 18 */ public static native void glWaitSync(long sync, int flags, long timeout); /** @apiSince 18 */ public static native void glGetInteger64v(int pname, long[] params, int offset); /** @apiSince 18 */ public static native void glGetInteger64v(int pname, java.nio.LongBuffer params); /** @apiSince 18 */ public static native void glGetSynciv(long sync, int pname, int bufSize, int[] length, int lengthOffset, int[] values, int valuesOffset); /** @apiSince 18 */ public static native void glGetSynciv(long sync, int pname, int bufSize, java.nio.IntBuffer length, java.nio.IntBuffer values); /** @apiSince 18 */ public static native void glGetInteger64i_v(int target, int index, long[] data, int offset); /** @apiSince 18 */ public static native void glGetInteger64i_v(int target, int index, java.nio.LongBuffer data); /** @apiSince 18 */ public static native void glGetBufferParameteri64v(int target, int pname, long[] params, int offset); /** @apiSince 18 */ public static native void glGetBufferParameteri64v(int target, int pname, java.nio.LongBuffer params); /** @apiSince 18 */ public static native void glGenSamplers(int count, int[] samplers, int offset); /** @apiSince 18 */ public static native void glGenSamplers(int count, java.nio.IntBuffer samplers); /** @apiSince 18 */ public static native void glDeleteSamplers(int count, int[] samplers, int offset); /** @apiSince 18 */ public static native void glDeleteSamplers(int count, java.nio.IntBuffer samplers); /** @apiSince 18 */ public static native boolean glIsSampler(int sampler); /** @apiSince 18 */ public static native void glBindSampler(int unit, int sampler); /** @apiSince 18 */ public static native void glSamplerParameteri(int sampler, int pname, int param); /** @apiSince 18 */ public static native void glSamplerParameteriv(int sampler, int pname, int[] param, int offset); /** @apiSince 18 */ public static native void glSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer param); /** @apiSince 18 */ public static native void glSamplerParameterf(int sampler, int pname, float param); /** @apiSince 18 */ public static native void glSamplerParameterfv(int sampler, int pname, float[] param, int offset); /** @apiSince 18 */ public static native void glSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer param); /** @apiSince 18 */ public static native void glGetSamplerParameteriv(int sampler, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetSamplerParameterfv(int sampler, int pname, float[] params, int offset); /** @apiSince 18 */ public static native void glGetSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer params); /** @apiSince 18 */ public static native void glVertexAttribDivisor(int index, int divisor); /** @apiSince 18 */ public static native void glBindTransformFeedback(int target, int id); /** @apiSince 18 */ public static native void glDeleteTransformFeedbacks(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glDeleteTransformFeedbacks(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native void glGenTransformFeedbacks(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glGenTransformFeedbacks(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native boolean glIsTransformFeedback(int id); /** @apiSince 18 */ public static native void glPauseTransformFeedback(); /** @apiSince 18 */ public static native void glResumeTransformFeedback(); /** @apiSince 18 */ public static native void glGetProgramBinary(int program, int bufSize, int[] length, int lengthOffset, int[] binaryFormat, int binaryFormatOffset, java.nio.Buffer binary); /** @apiSince 18 */ public static native void glGetProgramBinary(int program, int bufSize, java.nio.IntBuffer length, java.nio.IntBuffer binaryFormat, java.nio.Buffer binary); /** @apiSince 18 */ public static native void glProgramBinary(int program, int binaryFormat, java.nio.Buffer binary, int length); /** @apiSince 18 */ public static native void glProgramParameteri(int program, int pname, int value); /** @apiSince 18 */ public static native void glInvalidateFramebuffer(int target, int numAttachments, int[] attachments, int offset); /** @apiSince 18 */ public static native void glInvalidateFramebuffer(int target, int numAttachments, java.nio.IntBuffer attachments); /** @apiSince 18 */ public static native void glInvalidateSubFramebuffer(int target, int numAttachments, int[] attachments, int offset, int x, int y, int width, int height); /** @apiSince 18 */ public static native void glInvalidateSubFramebuffer(int target, int numAttachments, java.nio.IntBuffer attachments, int x, int y, int width, int height); /** @apiSince 18 */ public static native void glTexStorage2D(int target, int levels, int internalformat, int width, int height); /** @apiSince 18 */ public static native void glTexStorage3D(int target, int levels, int internalformat, int width, int height, int depth); /** @apiSince 18 */ public static native void glGetInternalformativ(int target, int internalformat, int pname, int bufSize, int[] params, int offset); /** @apiSince 18 */ public static native void glGetInternalformativ(int target, int internalformat, int pname, int bufSize, java.nio.IntBuffer params); /** @apiSince 24 */ public static native void glReadPixels(int x, int y, int width, int height, int format, int type, int offset); /** @apiSince 18 */ public static final int GL_ACTIVE_UNIFORM_BLOCKS = 35382; // 0x8a36 /** @apiSince 18 */ public static final int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 35381; // 0x8a35 /** @apiSince 18 */ public static final int GL_ALREADY_SIGNALED = 37146; // 0x911a /** @apiSince 18 */ public static final int GL_ANY_SAMPLES_PASSED = 35887; // 0x8c2f /** @apiSince 18 */ public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 36202; // 0x8d6a /** @apiSince 18 */ public static final int GL_BLUE = 6405; // 0x1905 /** @apiSince 18 */ public static final int GL_BUFFER_ACCESS_FLAGS = 37151; // 0x911f /** @apiSince 18 */ public static final int GL_BUFFER_MAPPED = 35004; // 0x88bc /** @apiSince 18 */ public static final int GL_BUFFER_MAP_LENGTH = 37152; // 0x9120 /** @apiSince 18 */ public static final int GL_BUFFER_MAP_OFFSET = 37153; // 0x9121 /** @apiSince 18 */ public static final int GL_BUFFER_MAP_POINTER = 35005; // 0x88bd /** @apiSince 18 */ public static final int GL_COLOR = 6144; // 0x1800 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT1 = 36065; // 0x8ce1 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT10 = 36074; // 0x8cea /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT11 = 36075; // 0x8ceb /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT12 = 36076; // 0x8cec /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT13 = 36077; // 0x8ced /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT14 = 36078; // 0x8cee /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT15 = 36079; // 0x8cef /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT2 = 36066; // 0x8ce2 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT3 = 36067; // 0x8ce3 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT4 = 36068; // 0x8ce4 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT5 = 36069; // 0x8ce5 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT6 = 36070; // 0x8ce6 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT7 = 36071; // 0x8ce7 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT8 = 36072; // 0x8ce8 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT9 = 36073; // 0x8ce9 /** @apiSince 18 */ public static final int GL_COMPARE_REF_TO_TEXTURE = 34894; // 0x884e /** @apiSince 18 */ public static final int GL_COMPRESSED_R11_EAC = 37488; // 0x9270 /** @apiSince 18 */ public static final int GL_COMPRESSED_RG11_EAC = 37490; // 0x9272 /** @apiSince 18 */ public static final int GL_COMPRESSED_RGB8_ETC2 = 37492; // 0x9274 /** @apiSince 18 */ public static final int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; // 0x9276 /** @apiSince 18 */ public static final int GL_COMPRESSED_RGBA8_ETC2_EAC = 37496; // 0x9278 /** @apiSince 18 */ public static final int GL_COMPRESSED_SIGNED_R11_EAC = 37489; // 0x9271 /** @apiSince 18 */ public static final int GL_COMPRESSED_SIGNED_RG11_EAC = 37491; // 0x9273 /** @apiSince 18 */ public static final int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; // 0x9279 /** @apiSince 18 */ public static final int GL_COMPRESSED_SRGB8_ETC2 = 37493; // 0x9275 /** @apiSince 18 */ public static final int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; // 0x9277 /** @apiSince 18 */ public static final int GL_CONDITION_SATISFIED = 37148; // 0x911c /** @apiSince 18 */ public static final int GL_COPY_READ_BUFFER = 36662; // 0x8f36 /** @apiSince 18 */ public static final int GL_COPY_READ_BUFFER_BINDING = 36662; // 0x8f36 /** @apiSince 18 */ public static final int GL_COPY_WRITE_BUFFER = 36663; // 0x8f37 /** @apiSince 18 */ public static final int GL_COPY_WRITE_BUFFER_BINDING = 36663; // 0x8f37 /** @apiSince 18 */ public static final int GL_CURRENT_QUERY = 34917; // 0x8865 /** @apiSince 18 */ public static final int GL_DEPTH = 6145; // 0x1801 /** @apiSince 18 */ public static final int GL_DEPTH24_STENCIL8 = 35056; // 0x88f0 /** @apiSince 18 */ public static final int GL_DEPTH32F_STENCIL8 = 36013; // 0x8cad /** @apiSince 18 */ public static final int GL_DEPTH_COMPONENT24 = 33190; // 0x81a6 /** @apiSince 18 */ public static final int GL_DEPTH_COMPONENT32F = 36012; // 0x8cac /** @apiSince 18 */ public static final int GL_DEPTH_STENCIL = 34041; // 0x84f9 /** @apiSince 18 */ public static final int GL_DEPTH_STENCIL_ATTACHMENT = 33306; // 0x821a /** @apiSince 18 */ public static final int GL_DRAW_BUFFER0 = 34853; // 0x8825 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER1 = 34854; // 0x8826 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER10 = 34863; // 0x882f /** @apiSince 18 */ public static final int GL_DRAW_BUFFER11 = 34864; // 0x8830 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER12 = 34865; // 0x8831 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER13 = 34866; // 0x8832 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER14 = 34867; // 0x8833 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER15 = 34868; // 0x8834 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER2 = 34855; // 0x8827 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER3 = 34856; // 0x8828 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER4 = 34857; // 0x8829 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER5 = 34858; // 0x882a /** @apiSince 18 */ public static final int GL_DRAW_BUFFER6 = 34859; // 0x882b /** @apiSince 18 */ public static final int GL_DRAW_BUFFER7 = 34860; // 0x882c /** @apiSince 18 */ public static final int GL_DRAW_BUFFER8 = 34861; // 0x882d /** @apiSince 18 */ public static final int GL_DRAW_BUFFER9 = 34862; // 0x882e /** @apiSince 18 */ public static final int GL_DRAW_FRAMEBUFFER = 36009; // 0x8ca9 /** @apiSince 18 */ public static final int GL_DRAW_FRAMEBUFFER_BINDING = 36006; // 0x8ca6 /** @apiSince 18 */ public static final int GL_DYNAMIC_COPY = 35050; // 0x88ea /** @apiSince 18 */ public static final int GL_DYNAMIC_READ = 35049; // 0x88e9 /** @apiSince 18 */ public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 36269; // 0x8dad /** @apiSince 18 */ public static final int GL_FLOAT_MAT2x3 = 35685; // 0x8b65 /** @apiSince 18 */ public static final int GL_FLOAT_MAT2x4 = 35686; // 0x8b66 /** @apiSince 18 */ public static final int GL_FLOAT_MAT3x2 = 35687; // 0x8b67 /** @apiSince 18 */ public static final int GL_FLOAT_MAT3x4 = 35688; // 0x8b68 /** @apiSince 18 */ public static final int GL_FLOAT_MAT4x2 = 35689; // 0x8b69 /** @apiSince 18 */ public static final int GL_FLOAT_MAT4x3 = 35690; // 0x8b6a /** @apiSince 18 */ public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 35723; // 0x8b8b /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301; // 0x8215 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300; // 0x8214 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296; // 0x8210 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297; // 0x8211 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302; // 0x8216 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299; // 0x8213 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298; // 0x8212 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303; // 0x8217 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052; // 0x8cd4 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_DEFAULT = 33304; // 0x8218 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182; // 0x8d56 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_UNDEFINED = 33305; // 0x8219 /** @apiSince 18 */ public static final int GL_GREEN = 6404; // 0x1904 /** @apiSince 18 */ public static final int GL_HALF_FLOAT = 5131; // 0x140b /** @apiSince 18 */ public static final int GL_INTERLEAVED_ATTRIBS = 35980; // 0x8c8c /** @apiSince 18 */ public static final int GL_INT_2_10_10_10_REV = 36255; // 0x8d9f /** @apiSince 18 */ public static final int GL_INT_SAMPLER_2D = 36298; // 0x8dca /** @apiSince 18 */ public static final int GL_INT_SAMPLER_2D_ARRAY = 36303; // 0x8dcf /** @apiSince 18 */ public static final int GL_INT_SAMPLER_3D = 36299; // 0x8dcb /** @apiSince 18 */ public static final int GL_INT_SAMPLER_CUBE = 36300; // 0x8dcc /** @apiSince 18 */ public static final int GL_INVALID_INDEX = -1; // 0xffffffff /** @apiSince 18 */ public static final int GL_MAJOR_VERSION = 33307; // 0x821b /** @apiSince 18 */ public static final int GL_MAP_FLUSH_EXPLICIT_BIT = 16; // 0x10 /** @apiSince 18 */ public static final int GL_MAP_INVALIDATE_BUFFER_BIT = 8; // 0x8 /** @apiSince 18 */ public static final int GL_MAP_INVALIDATE_RANGE_BIT = 4; // 0x4 /** @apiSince 18 */ public static final int GL_MAP_READ_BIT = 1; // 0x1 /** @apiSince 18 */ public static final int GL_MAP_UNSYNCHRONIZED_BIT = 32; // 0x20 /** @apiSince 18 */ public static final int GL_MAP_WRITE_BIT = 2; // 0x2 /** @apiSince 18 */ public static final int GL_MAX = 32776; // 0x8008 /** @apiSince 18 */ public static final int GL_MAX_3D_TEXTURE_SIZE = 32883; // 0x8073 /** @apiSince 18 */ public static final int GL_MAX_ARRAY_TEXTURE_LAYERS = 35071; // 0x88ff /** @apiSince 18 */ public static final int GL_MAX_COLOR_ATTACHMENTS = 36063; // 0x8cdf /** @apiSince 18 */ public static final int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379; // 0x8a33 /** @apiSince 18 */ public static final int GL_MAX_COMBINED_UNIFORM_BLOCKS = 35374; // 0x8a2e /** @apiSince 18 */ public static final int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377; // 0x8a31 /** @apiSince 18 */ public static final int GL_MAX_DRAW_BUFFERS = 34852; // 0x8824 /** @apiSince 18 */ public static final int GL_MAX_ELEMENTS_INDICES = 33001; // 0x80e9 /** @apiSince 18 */ public static final int GL_MAX_ELEMENTS_VERTICES = 33000; // 0x80e8 /** @apiSince 18 */ public static final int GL_MAX_ELEMENT_INDEX = 36203; // 0x8d6b /** @apiSince 18 */ public static final int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 37157; // 0x9125 /** @apiSince 18 */ public static final int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 35373; // 0x8a2d /** @apiSince 18 */ public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657; // 0x8b49 /** @apiSince 18 */ public static final int GL_MAX_PROGRAM_TEXEL_OFFSET = 35077; // 0x8905 /** @apiSince 18 */ public static final int GL_MAX_SAMPLES = 36183; // 0x8d57 /** @apiSince 18 */ public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 37137; // 0x9111 /** @apiSince 18 */ public static final int GL_MAX_TEXTURE_LOD_BIAS = 34045; // 0x84fd /** @apiSince 18 */ public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978; // 0x8c8a /** @apiSince 18 */ public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979; // 0x8c8b /** @apiSince 18 */ public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968; // 0x8c80 /** @apiSince 18 */ public static final int GL_MAX_UNIFORM_BLOCK_SIZE = 35376; // 0x8a30 /** @apiSince 18 */ public static final int GL_MAX_UNIFORM_BUFFER_BINDINGS = 35375; // 0x8a2f /** @apiSince 18 */ public static final int GL_MAX_VARYING_COMPONENTS = 35659; // 0x8b4b /** @apiSince 18 */ public static final int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 37154; // 0x9122 /** @apiSince 18 */ public static final int GL_MAX_VERTEX_UNIFORM_BLOCKS = 35371; // 0x8a2b /** @apiSince 18 */ public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 35658; // 0x8b4a /** @apiSince 18 */ public static final int GL_MIN = 32775; // 0x8007 /** @apiSince 18 */ public static final int GL_MINOR_VERSION = 33308; // 0x821c /** @apiSince 18 */ public static final int GL_MIN_PROGRAM_TEXEL_OFFSET = 35076; // 0x8904 /** @apiSince 18 */ public static final int GL_NUM_EXTENSIONS = 33309; // 0x821d /** @apiSince 18 */ public static final int GL_NUM_PROGRAM_BINARY_FORMATS = 34814; // 0x87fe /** @apiSince 18 */ public static final int GL_NUM_SAMPLE_COUNTS = 37760; // 0x9380 /** @apiSince 18 */ public static final int GL_OBJECT_TYPE = 37138; // 0x9112 /** @apiSince 18 */ public static final int GL_PACK_ROW_LENGTH = 3330; // 0xd02 /** @apiSince 18 */ public static final int GL_PACK_SKIP_PIXELS = 3332; // 0xd04 /** @apiSince 18 */ public static final int GL_PACK_SKIP_ROWS = 3331; // 0xd03 /** @apiSince 18 */ public static final int GL_PIXEL_PACK_BUFFER = 35051; // 0x88eb /** @apiSince 18 */ public static final int GL_PIXEL_PACK_BUFFER_BINDING = 35053; // 0x88ed /** @apiSince 18 */ public static final int GL_PIXEL_UNPACK_BUFFER = 35052; // 0x88ec /** @apiSince 18 */ public static final int GL_PIXEL_UNPACK_BUFFER_BINDING = 35055; // 0x88ef /** @apiSince 18 */ public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 36201; // 0x8d69 /** @apiSince 18 */ public static final int GL_PROGRAM_BINARY_FORMATS = 34815; // 0x87ff /** @apiSince 18 */ public static final int GL_PROGRAM_BINARY_LENGTH = 34625; // 0x8741 /** @apiSince 18 */ public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 33367; // 0x8257 /** @apiSince 18 */ public static final int GL_QUERY_RESULT = 34918; // 0x8866 /** @apiSince 18 */ public static final int GL_QUERY_RESULT_AVAILABLE = 34919; // 0x8867 /** @apiSince 18 */ public static final int GL_R11F_G11F_B10F = 35898; // 0x8c3a /** @apiSince 18 */ public static final int GL_R16F = 33325; // 0x822d /** @apiSince 18 */ public static final int GL_R16I = 33331; // 0x8233 /** @apiSince 18 */ public static final int GL_R16UI = 33332; // 0x8234 /** @apiSince 18 */ public static final int GL_R32F = 33326; // 0x822e /** @apiSince 18 */ public static final int GL_R32I = 33333; // 0x8235 /** @apiSince 18 */ public static final int GL_R32UI = 33334; // 0x8236 /** @apiSince 18 */ public static final int GL_R8 = 33321; // 0x8229 /** @apiSince 18 */ public static final int GL_R8I = 33329; // 0x8231 /** @apiSince 18 */ public static final int GL_R8UI = 33330; // 0x8232 /** @apiSince 18 */ public static final int GL_R8_SNORM = 36756; // 0x8f94 /** @apiSince 18 */ public static final int GL_RASTERIZER_DISCARD = 35977; // 0x8c89 /** @apiSince 18 */ public static final int GL_READ_BUFFER = 3074; // 0xc02 /** @apiSince 18 */ public static final int GL_READ_FRAMEBUFFER = 36008; // 0x8ca8 /** @apiSince 18 */ public static final int GL_READ_FRAMEBUFFER_BINDING = 36010; // 0x8caa /** @apiSince 18 */ public static final int GL_RED = 6403; // 0x1903 /** @apiSince 18 */ public static final int GL_RED_INTEGER = 36244; // 0x8d94 /** @apiSince 18 */ public static final int GL_RENDERBUFFER_SAMPLES = 36011; // 0x8cab /** @apiSince 18 */ public static final int GL_RG = 33319; // 0x8227 /** @apiSince 18 */ public static final int GL_RG16F = 33327; // 0x822f /** @apiSince 18 */ public static final int GL_RG16I = 33337; // 0x8239 /** @apiSince 18 */ public static final int GL_RG16UI = 33338; // 0x823a /** @apiSince 18 */ public static final int GL_RG32F = 33328; // 0x8230 /** @apiSince 18 */ public static final int GL_RG32I = 33339; // 0x823b /** @apiSince 18 */ public static final int GL_RG32UI = 33340; // 0x823c /** @apiSince 18 */ public static final int GL_RG8 = 33323; // 0x822b /** @apiSince 18 */ public static final int GL_RG8I = 33335; // 0x8237 /** @apiSince 18 */ public static final int GL_RG8UI = 33336; // 0x8238 /** @apiSince 18 */ public static final int GL_RG8_SNORM = 36757; // 0x8f95 /** @apiSince 18 */ public static final int GL_RGB10_A2 = 32857; // 0x8059 /** @apiSince 18 */ public static final int GL_RGB10_A2UI = 36975; // 0x906f /** @apiSince 18 */ public static final int GL_RGB16F = 34843; // 0x881b /** @apiSince 18 */ public static final int GL_RGB16I = 36233; // 0x8d89 /** @apiSince 18 */ public static final int GL_RGB16UI = 36215; // 0x8d77 /** @apiSince 18 */ public static final int GL_RGB32F = 34837; // 0x8815 /** @apiSince 18 */ public static final int GL_RGB32I = 36227; // 0x8d83 /** @apiSince 18 */ public static final int GL_RGB32UI = 36209; // 0x8d71 /** @apiSince 18 */ public static final int GL_RGB8 = 32849; // 0x8051 /** @apiSince 18 */ public static final int GL_RGB8I = 36239; // 0x8d8f /** @apiSince 18 */ public static final int GL_RGB8UI = 36221; // 0x8d7d /** @apiSince 18 */ public static final int GL_RGB8_SNORM = 36758; // 0x8f96 /** @apiSince 18 */ public static final int GL_RGB9_E5 = 35901; // 0x8c3d /** @apiSince 18 */ public static final int GL_RGBA16F = 34842; // 0x881a /** @apiSince 18 */ public static final int GL_RGBA16I = 36232; // 0x8d88 /** @apiSince 18 */ public static final int GL_RGBA16UI = 36214; // 0x8d76 /** @apiSince 18 */ public static final int GL_RGBA32F = 34836; // 0x8814 /** @apiSince 18 */ public static final int GL_RGBA32I = 36226; // 0x8d82 /** @apiSince 18 */ public static final int GL_RGBA32UI = 36208; // 0x8d70 /** @apiSince 18 */ public static final int GL_RGBA8 = 32856; // 0x8058 /** @apiSince 18 */ public static final int GL_RGBA8I = 36238; // 0x8d8e /** @apiSince 18 */ public static final int GL_RGBA8UI = 36220; // 0x8d7c /** @apiSince 18 */ public static final int GL_RGBA8_SNORM = 36759; // 0x8f97 /** @apiSince 18 */ public static final int GL_RGBA_INTEGER = 36249; // 0x8d99 /** @apiSince 18 */ public static final int GL_RGB_INTEGER = 36248; // 0x8d98 /** @apiSince 18 */ public static final int GL_RG_INTEGER = 33320; // 0x8228 /** @apiSince 18 */ public static final int GL_SAMPLER_2D_ARRAY = 36289; // 0x8dc1 /** @apiSince 18 */ public static final int GL_SAMPLER_2D_ARRAY_SHADOW = 36292; // 0x8dc4 /** @apiSince 18 */ public static final int GL_SAMPLER_2D_SHADOW = 35682; // 0x8b62 /** @apiSince 18 */ public static final int GL_SAMPLER_3D = 35679; // 0x8b5f /** @apiSince 18 */ public static final int GL_SAMPLER_BINDING = 35097; // 0x8919 /** @apiSince 18 */ public static final int GL_SAMPLER_CUBE_SHADOW = 36293; // 0x8dc5 /** @apiSince 18 */ public static final int GL_SEPARATE_ATTRIBS = 35981; // 0x8c8d /** @apiSince 18 */ public static final int GL_SIGNALED = 37145; // 0x9119 /** @apiSince 18 */ public static final int GL_SIGNED_NORMALIZED = 36764; // 0x8f9c /** @apiSince 18 */ public static final int GL_SRGB = 35904; // 0x8c40 /** @apiSince 18 */ public static final int GL_SRGB8 = 35905; // 0x8c41 /** @apiSince 18 */ public static final int GL_SRGB8_ALPHA8 = 35907; // 0x8c43 /** @apiSince 18 */ public static final int GL_STATIC_COPY = 35046; // 0x88e6 /** @apiSince 18 */ public static final int GL_STATIC_READ = 35045; // 0x88e5 /** @apiSince 18 */ public static final int GL_STENCIL = 6146; // 0x1802 /** @apiSince 18 */ public static final int GL_STREAM_COPY = 35042; // 0x88e2 /** @apiSince 18 */ public static final int GL_STREAM_READ = 35041; // 0x88e1 /** @apiSince 18 */ public static final int GL_SYNC_CONDITION = 37139; // 0x9113 /** @apiSince 18 */ public static final int GL_SYNC_FENCE = 37142; // 0x9116 /** @apiSince 18 */ public static final int GL_SYNC_FLAGS = 37141; // 0x9115 /** @apiSince 18 */ public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 1; // 0x1 /** @apiSince 18 */ public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 37143; // 0x9117 /** @apiSince 18 */ public static final int GL_SYNC_STATUS = 37140; // 0x9114 /** @apiSince 18 */ public static final int GL_TEXTURE_2D_ARRAY = 35866; // 0x8c1a /** @apiSince 18 */ public static final int GL_TEXTURE_3D = 32879; // 0x806f /** @apiSince 18 */ public static final int GL_TEXTURE_BASE_LEVEL = 33084; // 0x813c /** @apiSince 18 */ public static final int GL_TEXTURE_BINDING_2D_ARRAY = 35869; // 0x8c1d /** @apiSince 18 */ public static final int GL_TEXTURE_BINDING_3D = 32874; // 0x806a /** @apiSince 18 */ public static final int GL_TEXTURE_COMPARE_FUNC = 34893; // 0x884d /** @apiSince 18 */ public static final int GL_TEXTURE_COMPARE_MODE = 34892; // 0x884c /** @apiSince 18 */ public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 37167; // 0x912f /** @apiSince 18 */ public static final int GL_TEXTURE_IMMUTABLE_LEVELS = 33503; // 0x82df /** @apiSince 18 */ public static final int GL_TEXTURE_MAX_LEVEL = 33085; // 0x813d /** @apiSince 18 */ public static final int GL_TEXTURE_MAX_LOD = 33083; // 0x813b /** @apiSince 18 */ public static final int GL_TEXTURE_MIN_LOD = 33082; // 0x813a /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_A = 36421; // 0x8e45 /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_B = 36420; // 0x8e44 /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_G = 36419; // 0x8e43 /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_R = 36418; // 0x8e42 /** @apiSince 18 */ public static final int GL_TEXTURE_WRAP_R = 32882; // 0x8072 /** @apiSince 18 */ public static final int GL_TIMEOUT_EXPIRED = 37147; // 0x911b /** @apiSince 18 */ public static final long GL_TIMEOUT_IGNORED = -1L; // 0xffffffffffffffffL /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK = 36386; // 0x8e22 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_ACTIVE = 36388; // 0x8e24 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BINDING = 36389; // 0x8e25 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER = 35982; // 0x8c8e /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983; // 0x8c8f /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 35967; // 0x8c7f /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973; // 0x8c85 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START = 35972; // 0x8c84 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_PAUSED = 36387; // 0x8e23 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976; // 0x8c88 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_VARYINGS = 35971; // 0x8c83 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 35958; // 0x8c76 /** @apiSince 18 */ public static final int GL_UNIFORM_ARRAY_STRIDE = 35388; // 0x8a3c /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394; // 0x8a42 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395; // 0x8a43 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_BINDING = 35391; // 0x8a3f /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_DATA_SIZE = 35392; // 0x8a40 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_INDEX = 35386; // 0x8a3a /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_NAME_LENGTH = 35393; // 0x8a41 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398; // 0x8a46 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396; // 0x8a44 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER = 35345; // 0x8a11 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_BINDING = 35368; // 0x8a28 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380; // 0x8a34 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_SIZE = 35370; // 0x8a2a /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_START = 35369; // 0x8a29 /** @apiSince 18 */ public static final int GL_UNIFORM_IS_ROW_MAJOR = 35390; // 0x8a3e /** @apiSince 18 */ public static final int GL_UNIFORM_MATRIX_STRIDE = 35389; // 0x8a3d /** @apiSince 18 */ public static final int GL_UNIFORM_NAME_LENGTH = 35385; // 0x8a39 /** @apiSince 18 */ public static final int GL_UNIFORM_OFFSET = 35387; // 0x8a3b /** @apiSince 18 */ public static final int GL_UNIFORM_SIZE = 35384; // 0x8a38 /** @apiSince 18 */ public static final int GL_UNIFORM_TYPE = 35383; // 0x8a37 /** @apiSince 18 */ public static final int GL_UNPACK_IMAGE_HEIGHT = 32878; // 0x806e /** @apiSince 18 */ public static final int GL_UNPACK_ROW_LENGTH = 3314; // 0xcf2 /** @apiSince 18 */ public static final int GL_UNPACK_SKIP_IMAGES = 32877; // 0x806d /** @apiSince 18 */ public static final int GL_UNPACK_SKIP_PIXELS = 3316; // 0xcf4 /** @apiSince 18 */ public static final int GL_UNPACK_SKIP_ROWS = 3315; // 0xcf3 /** @apiSince 18 */ public static final int GL_UNSIGNALED = 37144; // 0x9118 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_10F_11F_11F_REV = 35899; // 0x8c3b /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_24_8 = 34042; // 0x84fa /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 33640; // 0x8368 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_5_9_9_9_REV = 35902; // 0x8c3e /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_2D = 36306; // 0x8dd2 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311; // 0x8dd7 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_3D = 36307; // 0x8dd3 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_CUBE = 36308; // 0x8dd4 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_VEC2 = 36294; // 0x8dc6 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_VEC3 = 36295; // 0x8dc7 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_VEC4 = 36296; // 0x8dc8 /** @apiSince 18 */ public static final int GL_UNSIGNED_NORMALIZED = 35863; // 0x8c17 /** @apiSince 18 */ public static final int GL_VERTEX_ARRAY_BINDING = 34229; // 0x85b5 /** @apiSince 18 */ public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 35070; // 0x88fe /** @apiSince 18 */ public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 35069; // 0x88fd /** @apiSince 18 */ public static final int GL_WAIT_FAILED = 37149; // 0x911d }
UTF-8
Java
48,203
java
GLES30.java
Java
[]
null
[]
/* ** ** Copyright 2013, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated package android.opengl; /** OpenGL ES 3.0 @apiSince 18 */ @SuppressWarnings({"unchecked", "deprecation", "all"}) public class GLES30 extends android.opengl.GLES20 { public GLES30() { throw new RuntimeException("Stub!"); } /** @apiSince 18 */ public static native void glReadBuffer(int mode); /** @apiSince 18 */ public static native void glDrawRangeElements(int mode, int start, int end, int count, int type, java.nio.Buffer indices); /** @apiSince 18 */ public static native void glDrawRangeElements(int mode, int start, int end, int count, int type, int offset); /** @apiSince 18 */ public static native void glTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, java.nio.Buffer pixels); /** @apiSince 18 */ public static native void glTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, int offset); /** @apiSince 18 */ public static native void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, java.nio.Buffer pixels); /** @apiSince 18 */ public static native void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int offset); /** @apiSince 18 */ public static native void glCopyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height); /** @apiSince 18 */ public static native void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, java.nio.Buffer data); /** @apiSince 18 */ public static native void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int offset); /** @apiSince 18 */ public static native void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, java.nio.Buffer data); /** @apiSince 18 */ public static native void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int offset); /** @apiSince 18 */ public static native void glGenQueries(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glGenQueries(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native void glDeleteQueries(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glDeleteQueries(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native boolean glIsQuery(int id); /** @apiSince 18 */ public static native void glBeginQuery(int target, int id); /** @apiSince 18 */ public static native void glEndQuery(int target); /** @apiSince 18 */ public static native void glGetQueryiv(int target, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetQueryiv(int target, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetQueryObjectuiv(int id, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetQueryObjectuiv(int id, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native boolean glUnmapBuffer(int target); /** * The {@link java.nio.Buffer} instance returned by this method is guaranteed * to be an instance of {@link java.nio.ByteBuffer}. * @apiSince 18 */ public static native java.nio.Buffer glGetBufferPointerv(int target, int pname); /** @apiSince 18 */ public static native void glDrawBuffers(int n, int[] bufs, int offset); /** @apiSince 18 */ public static native void glDrawBuffers(int n, java.nio.IntBuffer bufs); /** @apiSince 18 */ public static native void glUniformMatrix2x3fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix2x3fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix3x2fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix3x2fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix2x4fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix2x4fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix4x2fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix4x2fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix3x4fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix3x4fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glUniformMatrix4x3fv(int location, int count, boolean transpose, float[] value, int offset); /** @apiSince 18 */ public static native void glUniformMatrix4x3fv(int location, int count, boolean transpose, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter); /** @apiSince 18 */ public static native void glRenderbufferStorageMultisample(int target, int samples, int internalformat, int width, int height); /** @apiSince 18 */ public static native void glFramebufferTextureLayer(int target, int attachment, int texture, int level, int layer); /** * The {@link java.nio.Buffer} instance returned by this method is guaranteed * to be an instance of {@link java.nio.ByteBuffer}. * @apiSince 18 */ public static native java.nio.Buffer glMapBufferRange(int target, int offset, int length, int access); /** @apiSince 18 */ public static native void glFlushMappedBufferRange(int target, int offset, int length); /** @apiSince 18 */ public static native void glBindVertexArray(int array); /** @apiSince 18 */ public static native void glDeleteVertexArrays(int n, int[] arrays, int offset); /** @apiSince 18 */ public static native void glDeleteVertexArrays(int n, java.nio.IntBuffer arrays); /** @apiSince 18 */ public static native void glGenVertexArrays(int n, int[] arrays, int offset); /** @apiSince 18 */ public static native void glGenVertexArrays(int n, java.nio.IntBuffer arrays); /** @apiSince 18 */ public static native boolean glIsVertexArray(int array); /** @apiSince 18 */ public static native void glGetIntegeri_v(int target, int index, int[] data, int offset); /** @apiSince 18 */ public static native void glGetIntegeri_v(int target, int index, java.nio.IntBuffer data); /** @apiSince 18 */ public static native void glBeginTransformFeedback(int primitiveMode); /** @apiSince 18 */ public static native void glEndTransformFeedback(); /** @apiSince 18 */ public static native void glBindBufferRange(int target, int index, int buffer, int offset, int size); /** @apiSince 18 */ public static native void glBindBufferBase(int target, int index, int buffer); /** @apiSince 18 */ public static native void glTransformFeedbackVaryings(int program, java.lang.String[] varyings, int bufferMode); /** @apiSince 18 */ public static native void glGetTransformFeedbackVarying(int program, int index, int bufsize, int[] length, int lengthOffset, int[] size, int sizeOffset, int[] type, int typeOffset, byte[] name, int nameOffset); /** * @deprecated * Use the version that takes a ByteBuffer as the last argument, or the versions that return a String. * * @apiSince 18 * @deprecatedSince 24 */ @Deprecated public static native void glGetTransformFeedbackVarying(int program, int index, int bufsize, java.nio.IntBuffer length, java.nio.IntBuffer size, java.nio.IntBuffer type, byte name); /** @apiSince 24 */ public static native void glGetTransformFeedbackVarying(int program, int index, int bufsize, java.nio.IntBuffer length, java.nio.IntBuffer size, java.nio.IntBuffer type, java.nio.ByteBuffer name); /** @apiSince 18 */ public static native java.lang.String glGetTransformFeedbackVarying(int program, int index, int[] size, int sizeOffset, int[] type, int typeOffset); /** @apiSince 18 */ public static native java.lang.String glGetTransformFeedbackVarying(int program, int index, java.nio.IntBuffer size, java.nio.IntBuffer type); /** @apiSince 18 */ public static void glVertexAttribIPointer(int index, int size, int type, int stride, java.nio.Buffer pointer) { throw new RuntimeException("Stub!"); } /** @apiSince 18 */ public static native void glVertexAttribIPointer(int index, int size, int type, int stride, int offset); /** @apiSince 18 */ public static native void glGetVertexAttribIiv(int index, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetVertexAttribIiv(int index, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetVertexAttribIuiv(int index, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetVertexAttribIuiv(int index, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glVertexAttribI4i(int index, int x, int y, int z, int w); /** @apiSince 18 */ public static native void glVertexAttribI4ui(int index, int x, int y, int z, int w); /** @apiSince 18 */ public static native void glVertexAttribI4iv(int index, int[] v, int offset); /** @apiSince 18 */ public static native void glVertexAttribI4iv(int index, java.nio.IntBuffer v); /** @apiSince 18 */ public static native void glVertexAttribI4uiv(int index, int[] v, int offset); /** @apiSince 18 */ public static native void glVertexAttribI4uiv(int index, java.nio.IntBuffer v); /** @apiSince 18 */ public static native void glGetUniformuiv(int program, int location, int[] params, int offset); /** @apiSince 18 */ public static native void glGetUniformuiv(int program, int location, java.nio.IntBuffer params); /** @apiSince 18 */ public static native int glGetFragDataLocation(int program, java.lang.String name); /** @apiSince 18 */ public static native void glUniform1ui(int location, int v0); /** @apiSince 18 */ public static native void glUniform2ui(int location, int v0, int v1); /** @apiSince 18 */ public static native void glUniform3ui(int location, int v0, int v1, int v2); /** @apiSince 18 */ public static native void glUniform4ui(int location, int v0, int v1, int v2, int v3); /** @apiSince 18 */ public static native void glUniform1uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform1uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glUniform2uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform2uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glUniform3uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform3uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glUniform4uiv(int location, int count, int[] value, int offset); /** @apiSince 18 */ public static native void glUniform4uiv(int location, int count, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glClearBufferiv(int buffer, int drawbuffer, int[] value, int offset); /** @apiSince 18 */ public static native void glClearBufferiv(int buffer, int drawbuffer, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glClearBufferuiv(int buffer, int drawbuffer, int[] value, int offset); /** @apiSince 18 */ public static native void glClearBufferuiv(int buffer, int drawbuffer, java.nio.IntBuffer value); /** @apiSince 18 */ public static native void glClearBufferfv(int buffer, int drawbuffer, float[] value, int offset); /** @apiSince 18 */ public static native void glClearBufferfv(int buffer, int drawbuffer, java.nio.FloatBuffer value); /** @apiSince 18 */ public static native void glClearBufferfi(int buffer, int drawbuffer, float depth, int stencil); /** @apiSince 18 */ public static native java.lang.String glGetStringi(int name, int index); /** @apiSince 18 */ public static native void glCopyBufferSubData(int readTarget, int writeTarget, int readOffset, int writeOffset, int size); /** @apiSince 18 */ public static native void glGetUniformIndices(int program, java.lang.String[] uniformNames, int[] uniformIndices, int uniformIndicesOffset); /** @apiSince 18 */ public static native void glGetUniformIndices(int program, java.lang.String[] uniformNames, java.nio.IntBuffer uniformIndices); /** @apiSince 18 */ public static native void glGetActiveUniformsiv(int program, int uniformCount, int[] uniformIndices, int uniformIndicesOffset, int pname, int[] params, int paramsOffset); /** @apiSince 18 */ public static native void glGetActiveUniformsiv(int program, int uniformCount, java.nio.IntBuffer uniformIndices, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native int glGetUniformBlockIndex(int program, java.lang.String uniformBlockName); /** @apiSince 18 */ public static native void glGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, int[] length, int lengthOffset, byte[] uniformBlockName, int uniformBlockNameOffset); /** @apiSince 18 */ public static native void glGetActiveUniformBlockName(int program, int uniformBlockIndex, java.nio.Buffer length, java.nio.Buffer uniformBlockName); /** @apiSince 18 */ public static native java.lang.String glGetActiveUniformBlockName(int program, int uniformBlockIndex); /** @apiSince 18 */ public static native void glUniformBlockBinding(int program, int uniformBlockIndex, int uniformBlockBinding); /** @apiSince 18 */ public static native void glDrawArraysInstanced(int mode, int first, int count, int instanceCount); /** @apiSince 18 */ public static native void glDrawElementsInstanced(int mode, int count, int type, java.nio.Buffer indices, int instanceCount); /** @apiSince 18 */ public static native void glDrawElementsInstanced(int mode, int count, int type, int indicesOffset, int instanceCount); /** @apiSince 18 */ public static native long glFenceSync(int condition, int flags); /** @apiSince 18 */ public static native boolean glIsSync(long sync); /** @apiSince 18 */ public static native void glDeleteSync(long sync); /** @apiSince 18 */ public static native int glClientWaitSync(long sync, int flags, long timeout); /** @apiSince 18 */ public static native void glWaitSync(long sync, int flags, long timeout); /** @apiSince 18 */ public static native void glGetInteger64v(int pname, long[] params, int offset); /** @apiSince 18 */ public static native void glGetInteger64v(int pname, java.nio.LongBuffer params); /** @apiSince 18 */ public static native void glGetSynciv(long sync, int pname, int bufSize, int[] length, int lengthOffset, int[] values, int valuesOffset); /** @apiSince 18 */ public static native void glGetSynciv(long sync, int pname, int bufSize, java.nio.IntBuffer length, java.nio.IntBuffer values); /** @apiSince 18 */ public static native void glGetInteger64i_v(int target, int index, long[] data, int offset); /** @apiSince 18 */ public static native void glGetInteger64i_v(int target, int index, java.nio.LongBuffer data); /** @apiSince 18 */ public static native void glGetBufferParameteri64v(int target, int pname, long[] params, int offset); /** @apiSince 18 */ public static native void glGetBufferParameteri64v(int target, int pname, java.nio.LongBuffer params); /** @apiSince 18 */ public static native void glGenSamplers(int count, int[] samplers, int offset); /** @apiSince 18 */ public static native void glGenSamplers(int count, java.nio.IntBuffer samplers); /** @apiSince 18 */ public static native void glDeleteSamplers(int count, int[] samplers, int offset); /** @apiSince 18 */ public static native void glDeleteSamplers(int count, java.nio.IntBuffer samplers); /** @apiSince 18 */ public static native boolean glIsSampler(int sampler); /** @apiSince 18 */ public static native void glBindSampler(int unit, int sampler); /** @apiSince 18 */ public static native void glSamplerParameteri(int sampler, int pname, int param); /** @apiSince 18 */ public static native void glSamplerParameteriv(int sampler, int pname, int[] param, int offset); /** @apiSince 18 */ public static native void glSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer param); /** @apiSince 18 */ public static native void glSamplerParameterf(int sampler, int pname, float param); /** @apiSince 18 */ public static native void glSamplerParameterfv(int sampler, int pname, float[] param, int offset); /** @apiSince 18 */ public static native void glSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer param); /** @apiSince 18 */ public static native void glGetSamplerParameteriv(int sampler, int pname, int[] params, int offset); /** @apiSince 18 */ public static native void glGetSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer params); /** @apiSince 18 */ public static native void glGetSamplerParameterfv(int sampler, int pname, float[] params, int offset); /** @apiSince 18 */ public static native void glGetSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer params); /** @apiSince 18 */ public static native void glVertexAttribDivisor(int index, int divisor); /** @apiSince 18 */ public static native void glBindTransformFeedback(int target, int id); /** @apiSince 18 */ public static native void glDeleteTransformFeedbacks(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glDeleteTransformFeedbacks(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native void glGenTransformFeedbacks(int n, int[] ids, int offset); /** @apiSince 18 */ public static native void glGenTransformFeedbacks(int n, java.nio.IntBuffer ids); /** @apiSince 18 */ public static native boolean glIsTransformFeedback(int id); /** @apiSince 18 */ public static native void glPauseTransformFeedback(); /** @apiSince 18 */ public static native void glResumeTransformFeedback(); /** @apiSince 18 */ public static native void glGetProgramBinary(int program, int bufSize, int[] length, int lengthOffset, int[] binaryFormat, int binaryFormatOffset, java.nio.Buffer binary); /** @apiSince 18 */ public static native void glGetProgramBinary(int program, int bufSize, java.nio.IntBuffer length, java.nio.IntBuffer binaryFormat, java.nio.Buffer binary); /** @apiSince 18 */ public static native void glProgramBinary(int program, int binaryFormat, java.nio.Buffer binary, int length); /** @apiSince 18 */ public static native void glProgramParameteri(int program, int pname, int value); /** @apiSince 18 */ public static native void glInvalidateFramebuffer(int target, int numAttachments, int[] attachments, int offset); /** @apiSince 18 */ public static native void glInvalidateFramebuffer(int target, int numAttachments, java.nio.IntBuffer attachments); /** @apiSince 18 */ public static native void glInvalidateSubFramebuffer(int target, int numAttachments, int[] attachments, int offset, int x, int y, int width, int height); /** @apiSince 18 */ public static native void glInvalidateSubFramebuffer(int target, int numAttachments, java.nio.IntBuffer attachments, int x, int y, int width, int height); /** @apiSince 18 */ public static native void glTexStorage2D(int target, int levels, int internalformat, int width, int height); /** @apiSince 18 */ public static native void glTexStorage3D(int target, int levels, int internalformat, int width, int height, int depth); /** @apiSince 18 */ public static native void glGetInternalformativ(int target, int internalformat, int pname, int bufSize, int[] params, int offset); /** @apiSince 18 */ public static native void glGetInternalformativ(int target, int internalformat, int pname, int bufSize, java.nio.IntBuffer params); /** @apiSince 24 */ public static native void glReadPixels(int x, int y, int width, int height, int format, int type, int offset); /** @apiSince 18 */ public static final int GL_ACTIVE_UNIFORM_BLOCKS = 35382; // 0x8a36 /** @apiSince 18 */ public static final int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 35381; // 0x8a35 /** @apiSince 18 */ public static final int GL_ALREADY_SIGNALED = 37146; // 0x911a /** @apiSince 18 */ public static final int GL_ANY_SAMPLES_PASSED = 35887; // 0x8c2f /** @apiSince 18 */ public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 36202; // 0x8d6a /** @apiSince 18 */ public static final int GL_BLUE = 6405; // 0x1905 /** @apiSince 18 */ public static final int GL_BUFFER_ACCESS_FLAGS = 37151; // 0x911f /** @apiSince 18 */ public static final int GL_BUFFER_MAPPED = 35004; // 0x88bc /** @apiSince 18 */ public static final int GL_BUFFER_MAP_LENGTH = 37152; // 0x9120 /** @apiSince 18 */ public static final int GL_BUFFER_MAP_OFFSET = 37153; // 0x9121 /** @apiSince 18 */ public static final int GL_BUFFER_MAP_POINTER = 35005; // 0x88bd /** @apiSince 18 */ public static final int GL_COLOR = 6144; // 0x1800 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT1 = 36065; // 0x8ce1 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT10 = 36074; // 0x8cea /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT11 = 36075; // 0x8ceb /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT12 = 36076; // 0x8cec /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT13 = 36077; // 0x8ced /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT14 = 36078; // 0x8cee /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT15 = 36079; // 0x8cef /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT2 = 36066; // 0x8ce2 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT3 = 36067; // 0x8ce3 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT4 = 36068; // 0x8ce4 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT5 = 36069; // 0x8ce5 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT6 = 36070; // 0x8ce6 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT7 = 36071; // 0x8ce7 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT8 = 36072; // 0x8ce8 /** @apiSince 18 */ public static final int GL_COLOR_ATTACHMENT9 = 36073; // 0x8ce9 /** @apiSince 18 */ public static final int GL_COMPARE_REF_TO_TEXTURE = 34894; // 0x884e /** @apiSince 18 */ public static final int GL_COMPRESSED_R11_EAC = 37488; // 0x9270 /** @apiSince 18 */ public static final int GL_COMPRESSED_RG11_EAC = 37490; // 0x9272 /** @apiSince 18 */ public static final int GL_COMPRESSED_RGB8_ETC2 = 37492; // 0x9274 /** @apiSince 18 */ public static final int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; // 0x9276 /** @apiSince 18 */ public static final int GL_COMPRESSED_RGBA8_ETC2_EAC = 37496; // 0x9278 /** @apiSince 18 */ public static final int GL_COMPRESSED_SIGNED_R11_EAC = 37489; // 0x9271 /** @apiSince 18 */ public static final int GL_COMPRESSED_SIGNED_RG11_EAC = 37491; // 0x9273 /** @apiSince 18 */ public static final int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; // 0x9279 /** @apiSince 18 */ public static final int GL_COMPRESSED_SRGB8_ETC2 = 37493; // 0x9275 /** @apiSince 18 */ public static final int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; // 0x9277 /** @apiSince 18 */ public static final int GL_CONDITION_SATISFIED = 37148; // 0x911c /** @apiSince 18 */ public static final int GL_COPY_READ_BUFFER = 36662; // 0x8f36 /** @apiSince 18 */ public static final int GL_COPY_READ_BUFFER_BINDING = 36662; // 0x8f36 /** @apiSince 18 */ public static final int GL_COPY_WRITE_BUFFER = 36663; // 0x8f37 /** @apiSince 18 */ public static final int GL_COPY_WRITE_BUFFER_BINDING = 36663; // 0x8f37 /** @apiSince 18 */ public static final int GL_CURRENT_QUERY = 34917; // 0x8865 /** @apiSince 18 */ public static final int GL_DEPTH = 6145; // 0x1801 /** @apiSince 18 */ public static final int GL_DEPTH24_STENCIL8 = 35056; // 0x88f0 /** @apiSince 18 */ public static final int GL_DEPTH32F_STENCIL8 = 36013; // 0x8cad /** @apiSince 18 */ public static final int GL_DEPTH_COMPONENT24 = 33190; // 0x81a6 /** @apiSince 18 */ public static final int GL_DEPTH_COMPONENT32F = 36012; // 0x8cac /** @apiSince 18 */ public static final int GL_DEPTH_STENCIL = 34041; // 0x84f9 /** @apiSince 18 */ public static final int GL_DEPTH_STENCIL_ATTACHMENT = 33306; // 0x821a /** @apiSince 18 */ public static final int GL_DRAW_BUFFER0 = 34853; // 0x8825 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER1 = 34854; // 0x8826 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER10 = 34863; // 0x882f /** @apiSince 18 */ public static final int GL_DRAW_BUFFER11 = 34864; // 0x8830 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER12 = 34865; // 0x8831 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER13 = 34866; // 0x8832 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER14 = 34867; // 0x8833 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER15 = 34868; // 0x8834 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER2 = 34855; // 0x8827 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER3 = 34856; // 0x8828 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER4 = 34857; // 0x8829 /** @apiSince 18 */ public static final int GL_DRAW_BUFFER5 = 34858; // 0x882a /** @apiSince 18 */ public static final int GL_DRAW_BUFFER6 = 34859; // 0x882b /** @apiSince 18 */ public static final int GL_DRAW_BUFFER7 = 34860; // 0x882c /** @apiSince 18 */ public static final int GL_DRAW_BUFFER8 = 34861; // 0x882d /** @apiSince 18 */ public static final int GL_DRAW_BUFFER9 = 34862; // 0x882e /** @apiSince 18 */ public static final int GL_DRAW_FRAMEBUFFER = 36009; // 0x8ca9 /** @apiSince 18 */ public static final int GL_DRAW_FRAMEBUFFER_BINDING = 36006; // 0x8ca6 /** @apiSince 18 */ public static final int GL_DYNAMIC_COPY = 35050; // 0x88ea /** @apiSince 18 */ public static final int GL_DYNAMIC_READ = 35049; // 0x88e9 /** @apiSince 18 */ public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 36269; // 0x8dad /** @apiSince 18 */ public static final int GL_FLOAT_MAT2x3 = 35685; // 0x8b65 /** @apiSince 18 */ public static final int GL_FLOAT_MAT2x4 = 35686; // 0x8b66 /** @apiSince 18 */ public static final int GL_FLOAT_MAT3x2 = 35687; // 0x8b67 /** @apiSince 18 */ public static final int GL_FLOAT_MAT3x4 = 35688; // 0x8b68 /** @apiSince 18 */ public static final int GL_FLOAT_MAT4x2 = 35689; // 0x8b69 /** @apiSince 18 */ public static final int GL_FLOAT_MAT4x3 = 35690; // 0x8b6a /** @apiSince 18 */ public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 35723; // 0x8b8b /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301; // 0x8215 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300; // 0x8214 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296; // 0x8210 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297; // 0x8211 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302; // 0x8216 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299; // 0x8213 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298; // 0x8212 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303; // 0x8217 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052; // 0x8cd4 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_DEFAULT = 33304; // 0x8218 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182; // 0x8d56 /** @apiSince 18 */ public static final int GL_FRAMEBUFFER_UNDEFINED = 33305; // 0x8219 /** @apiSince 18 */ public static final int GL_GREEN = 6404; // 0x1904 /** @apiSince 18 */ public static final int GL_HALF_FLOAT = 5131; // 0x140b /** @apiSince 18 */ public static final int GL_INTERLEAVED_ATTRIBS = 35980; // 0x8c8c /** @apiSince 18 */ public static final int GL_INT_2_10_10_10_REV = 36255; // 0x8d9f /** @apiSince 18 */ public static final int GL_INT_SAMPLER_2D = 36298; // 0x8dca /** @apiSince 18 */ public static final int GL_INT_SAMPLER_2D_ARRAY = 36303; // 0x8dcf /** @apiSince 18 */ public static final int GL_INT_SAMPLER_3D = 36299; // 0x8dcb /** @apiSince 18 */ public static final int GL_INT_SAMPLER_CUBE = 36300; // 0x8dcc /** @apiSince 18 */ public static final int GL_INVALID_INDEX = -1; // 0xffffffff /** @apiSince 18 */ public static final int GL_MAJOR_VERSION = 33307; // 0x821b /** @apiSince 18 */ public static final int GL_MAP_FLUSH_EXPLICIT_BIT = 16; // 0x10 /** @apiSince 18 */ public static final int GL_MAP_INVALIDATE_BUFFER_BIT = 8; // 0x8 /** @apiSince 18 */ public static final int GL_MAP_INVALIDATE_RANGE_BIT = 4; // 0x4 /** @apiSince 18 */ public static final int GL_MAP_READ_BIT = 1; // 0x1 /** @apiSince 18 */ public static final int GL_MAP_UNSYNCHRONIZED_BIT = 32; // 0x20 /** @apiSince 18 */ public static final int GL_MAP_WRITE_BIT = 2; // 0x2 /** @apiSince 18 */ public static final int GL_MAX = 32776; // 0x8008 /** @apiSince 18 */ public static final int GL_MAX_3D_TEXTURE_SIZE = 32883; // 0x8073 /** @apiSince 18 */ public static final int GL_MAX_ARRAY_TEXTURE_LAYERS = 35071; // 0x88ff /** @apiSince 18 */ public static final int GL_MAX_COLOR_ATTACHMENTS = 36063; // 0x8cdf /** @apiSince 18 */ public static final int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379; // 0x8a33 /** @apiSince 18 */ public static final int GL_MAX_COMBINED_UNIFORM_BLOCKS = 35374; // 0x8a2e /** @apiSince 18 */ public static final int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377; // 0x8a31 /** @apiSince 18 */ public static final int GL_MAX_DRAW_BUFFERS = 34852; // 0x8824 /** @apiSince 18 */ public static final int GL_MAX_ELEMENTS_INDICES = 33001; // 0x80e9 /** @apiSince 18 */ public static final int GL_MAX_ELEMENTS_VERTICES = 33000; // 0x80e8 /** @apiSince 18 */ public static final int GL_MAX_ELEMENT_INDEX = 36203; // 0x8d6b /** @apiSince 18 */ public static final int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 37157; // 0x9125 /** @apiSince 18 */ public static final int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 35373; // 0x8a2d /** @apiSince 18 */ public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657; // 0x8b49 /** @apiSince 18 */ public static final int GL_MAX_PROGRAM_TEXEL_OFFSET = 35077; // 0x8905 /** @apiSince 18 */ public static final int GL_MAX_SAMPLES = 36183; // 0x8d57 /** @apiSince 18 */ public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 37137; // 0x9111 /** @apiSince 18 */ public static final int GL_MAX_TEXTURE_LOD_BIAS = 34045; // 0x84fd /** @apiSince 18 */ public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978; // 0x8c8a /** @apiSince 18 */ public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979; // 0x8c8b /** @apiSince 18 */ public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968; // 0x8c80 /** @apiSince 18 */ public static final int GL_MAX_UNIFORM_BLOCK_SIZE = 35376; // 0x8a30 /** @apiSince 18 */ public static final int GL_MAX_UNIFORM_BUFFER_BINDINGS = 35375; // 0x8a2f /** @apiSince 18 */ public static final int GL_MAX_VARYING_COMPONENTS = 35659; // 0x8b4b /** @apiSince 18 */ public static final int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 37154; // 0x9122 /** @apiSince 18 */ public static final int GL_MAX_VERTEX_UNIFORM_BLOCKS = 35371; // 0x8a2b /** @apiSince 18 */ public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 35658; // 0x8b4a /** @apiSince 18 */ public static final int GL_MIN = 32775; // 0x8007 /** @apiSince 18 */ public static final int GL_MINOR_VERSION = 33308; // 0x821c /** @apiSince 18 */ public static final int GL_MIN_PROGRAM_TEXEL_OFFSET = 35076; // 0x8904 /** @apiSince 18 */ public static final int GL_NUM_EXTENSIONS = 33309; // 0x821d /** @apiSince 18 */ public static final int GL_NUM_PROGRAM_BINARY_FORMATS = 34814; // 0x87fe /** @apiSince 18 */ public static final int GL_NUM_SAMPLE_COUNTS = 37760; // 0x9380 /** @apiSince 18 */ public static final int GL_OBJECT_TYPE = 37138; // 0x9112 /** @apiSince 18 */ public static final int GL_PACK_ROW_LENGTH = 3330; // 0xd02 /** @apiSince 18 */ public static final int GL_PACK_SKIP_PIXELS = 3332; // 0xd04 /** @apiSince 18 */ public static final int GL_PACK_SKIP_ROWS = 3331; // 0xd03 /** @apiSince 18 */ public static final int GL_PIXEL_PACK_BUFFER = 35051; // 0x88eb /** @apiSince 18 */ public static final int GL_PIXEL_PACK_BUFFER_BINDING = 35053; // 0x88ed /** @apiSince 18 */ public static final int GL_PIXEL_UNPACK_BUFFER = 35052; // 0x88ec /** @apiSince 18 */ public static final int GL_PIXEL_UNPACK_BUFFER_BINDING = 35055; // 0x88ef /** @apiSince 18 */ public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 36201; // 0x8d69 /** @apiSince 18 */ public static final int GL_PROGRAM_BINARY_FORMATS = 34815; // 0x87ff /** @apiSince 18 */ public static final int GL_PROGRAM_BINARY_LENGTH = 34625; // 0x8741 /** @apiSince 18 */ public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 33367; // 0x8257 /** @apiSince 18 */ public static final int GL_QUERY_RESULT = 34918; // 0x8866 /** @apiSince 18 */ public static final int GL_QUERY_RESULT_AVAILABLE = 34919; // 0x8867 /** @apiSince 18 */ public static final int GL_R11F_G11F_B10F = 35898; // 0x8c3a /** @apiSince 18 */ public static final int GL_R16F = 33325; // 0x822d /** @apiSince 18 */ public static final int GL_R16I = 33331; // 0x8233 /** @apiSince 18 */ public static final int GL_R16UI = 33332; // 0x8234 /** @apiSince 18 */ public static final int GL_R32F = 33326; // 0x822e /** @apiSince 18 */ public static final int GL_R32I = 33333; // 0x8235 /** @apiSince 18 */ public static final int GL_R32UI = 33334; // 0x8236 /** @apiSince 18 */ public static final int GL_R8 = 33321; // 0x8229 /** @apiSince 18 */ public static final int GL_R8I = 33329; // 0x8231 /** @apiSince 18 */ public static final int GL_R8UI = 33330; // 0x8232 /** @apiSince 18 */ public static final int GL_R8_SNORM = 36756; // 0x8f94 /** @apiSince 18 */ public static final int GL_RASTERIZER_DISCARD = 35977; // 0x8c89 /** @apiSince 18 */ public static final int GL_READ_BUFFER = 3074; // 0xc02 /** @apiSince 18 */ public static final int GL_READ_FRAMEBUFFER = 36008; // 0x8ca8 /** @apiSince 18 */ public static final int GL_READ_FRAMEBUFFER_BINDING = 36010; // 0x8caa /** @apiSince 18 */ public static final int GL_RED = 6403; // 0x1903 /** @apiSince 18 */ public static final int GL_RED_INTEGER = 36244; // 0x8d94 /** @apiSince 18 */ public static final int GL_RENDERBUFFER_SAMPLES = 36011; // 0x8cab /** @apiSince 18 */ public static final int GL_RG = 33319; // 0x8227 /** @apiSince 18 */ public static final int GL_RG16F = 33327; // 0x822f /** @apiSince 18 */ public static final int GL_RG16I = 33337; // 0x8239 /** @apiSince 18 */ public static final int GL_RG16UI = 33338; // 0x823a /** @apiSince 18 */ public static final int GL_RG32F = 33328; // 0x8230 /** @apiSince 18 */ public static final int GL_RG32I = 33339; // 0x823b /** @apiSince 18 */ public static final int GL_RG32UI = 33340; // 0x823c /** @apiSince 18 */ public static final int GL_RG8 = 33323; // 0x822b /** @apiSince 18 */ public static final int GL_RG8I = 33335; // 0x8237 /** @apiSince 18 */ public static final int GL_RG8UI = 33336; // 0x8238 /** @apiSince 18 */ public static final int GL_RG8_SNORM = 36757; // 0x8f95 /** @apiSince 18 */ public static final int GL_RGB10_A2 = 32857; // 0x8059 /** @apiSince 18 */ public static final int GL_RGB10_A2UI = 36975; // 0x906f /** @apiSince 18 */ public static final int GL_RGB16F = 34843; // 0x881b /** @apiSince 18 */ public static final int GL_RGB16I = 36233; // 0x8d89 /** @apiSince 18 */ public static final int GL_RGB16UI = 36215; // 0x8d77 /** @apiSince 18 */ public static final int GL_RGB32F = 34837; // 0x8815 /** @apiSince 18 */ public static final int GL_RGB32I = 36227; // 0x8d83 /** @apiSince 18 */ public static final int GL_RGB32UI = 36209; // 0x8d71 /** @apiSince 18 */ public static final int GL_RGB8 = 32849; // 0x8051 /** @apiSince 18 */ public static final int GL_RGB8I = 36239; // 0x8d8f /** @apiSince 18 */ public static final int GL_RGB8UI = 36221; // 0x8d7d /** @apiSince 18 */ public static final int GL_RGB8_SNORM = 36758; // 0x8f96 /** @apiSince 18 */ public static final int GL_RGB9_E5 = 35901; // 0x8c3d /** @apiSince 18 */ public static final int GL_RGBA16F = 34842; // 0x881a /** @apiSince 18 */ public static final int GL_RGBA16I = 36232; // 0x8d88 /** @apiSince 18 */ public static final int GL_RGBA16UI = 36214; // 0x8d76 /** @apiSince 18 */ public static final int GL_RGBA32F = 34836; // 0x8814 /** @apiSince 18 */ public static final int GL_RGBA32I = 36226; // 0x8d82 /** @apiSince 18 */ public static final int GL_RGBA32UI = 36208; // 0x8d70 /** @apiSince 18 */ public static final int GL_RGBA8 = 32856; // 0x8058 /** @apiSince 18 */ public static final int GL_RGBA8I = 36238; // 0x8d8e /** @apiSince 18 */ public static final int GL_RGBA8UI = 36220; // 0x8d7c /** @apiSince 18 */ public static final int GL_RGBA8_SNORM = 36759; // 0x8f97 /** @apiSince 18 */ public static final int GL_RGBA_INTEGER = 36249; // 0x8d99 /** @apiSince 18 */ public static final int GL_RGB_INTEGER = 36248; // 0x8d98 /** @apiSince 18 */ public static final int GL_RG_INTEGER = 33320; // 0x8228 /** @apiSince 18 */ public static final int GL_SAMPLER_2D_ARRAY = 36289; // 0x8dc1 /** @apiSince 18 */ public static final int GL_SAMPLER_2D_ARRAY_SHADOW = 36292; // 0x8dc4 /** @apiSince 18 */ public static final int GL_SAMPLER_2D_SHADOW = 35682; // 0x8b62 /** @apiSince 18 */ public static final int GL_SAMPLER_3D = 35679; // 0x8b5f /** @apiSince 18 */ public static final int GL_SAMPLER_BINDING = 35097; // 0x8919 /** @apiSince 18 */ public static final int GL_SAMPLER_CUBE_SHADOW = 36293; // 0x8dc5 /** @apiSince 18 */ public static final int GL_SEPARATE_ATTRIBS = 35981; // 0x8c8d /** @apiSince 18 */ public static final int GL_SIGNALED = 37145; // 0x9119 /** @apiSince 18 */ public static final int GL_SIGNED_NORMALIZED = 36764; // 0x8f9c /** @apiSince 18 */ public static final int GL_SRGB = 35904; // 0x8c40 /** @apiSince 18 */ public static final int GL_SRGB8 = 35905; // 0x8c41 /** @apiSince 18 */ public static final int GL_SRGB8_ALPHA8 = 35907; // 0x8c43 /** @apiSince 18 */ public static final int GL_STATIC_COPY = 35046; // 0x88e6 /** @apiSince 18 */ public static final int GL_STATIC_READ = 35045; // 0x88e5 /** @apiSince 18 */ public static final int GL_STENCIL = 6146; // 0x1802 /** @apiSince 18 */ public static final int GL_STREAM_COPY = 35042; // 0x88e2 /** @apiSince 18 */ public static final int GL_STREAM_READ = 35041; // 0x88e1 /** @apiSince 18 */ public static final int GL_SYNC_CONDITION = 37139; // 0x9113 /** @apiSince 18 */ public static final int GL_SYNC_FENCE = 37142; // 0x9116 /** @apiSince 18 */ public static final int GL_SYNC_FLAGS = 37141; // 0x9115 /** @apiSince 18 */ public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 1; // 0x1 /** @apiSince 18 */ public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 37143; // 0x9117 /** @apiSince 18 */ public static final int GL_SYNC_STATUS = 37140; // 0x9114 /** @apiSince 18 */ public static final int GL_TEXTURE_2D_ARRAY = 35866; // 0x8c1a /** @apiSince 18 */ public static final int GL_TEXTURE_3D = 32879; // 0x806f /** @apiSince 18 */ public static final int GL_TEXTURE_BASE_LEVEL = 33084; // 0x813c /** @apiSince 18 */ public static final int GL_TEXTURE_BINDING_2D_ARRAY = 35869; // 0x8c1d /** @apiSince 18 */ public static final int GL_TEXTURE_BINDING_3D = 32874; // 0x806a /** @apiSince 18 */ public static final int GL_TEXTURE_COMPARE_FUNC = 34893; // 0x884d /** @apiSince 18 */ public static final int GL_TEXTURE_COMPARE_MODE = 34892; // 0x884c /** @apiSince 18 */ public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 37167; // 0x912f /** @apiSince 18 */ public static final int GL_TEXTURE_IMMUTABLE_LEVELS = 33503; // 0x82df /** @apiSince 18 */ public static final int GL_TEXTURE_MAX_LEVEL = 33085; // 0x813d /** @apiSince 18 */ public static final int GL_TEXTURE_MAX_LOD = 33083; // 0x813b /** @apiSince 18 */ public static final int GL_TEXTURE_MIN_LOD = 33082; // 0x813a /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_A = 36421; // 0x8e45 /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_B = 36420; // 0x8e44 /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_G = 36419; // 0x8e43 /** @apiSince 18 */ public static final int GL_TEXTURE_SWIZZLE_R = 36418; // 0x8e42 /** @apiSince 18 */ public static final int GL_TEXTURE_WRAP_R = 32882; // 0x8072 /** @apiSince 18 */ public static final int GL_TIMEOUT_EXPIRED = 37147; // 0x911b /** @apiSince 18 */ public static final long GL_TIMEOUT_IGNORED = -1L; // 0xffffffffffffffffL /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK = 36386; // 0x8e22 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_ACTIVE = 36388; // 0x8e24 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BINDING = 36389; // 0x8e25 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER = 35982; // 0x8c8e /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983; // 0x8c8f /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 35967; // 0x8c7f /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973; // 0x8c85 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START = 35972; // 0x8c84 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_PAUSED = 36387; // 0x8e23 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976; // 0x8c88 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_VARYINGS = 35971; // 0x8c83 /** @apiSince 18 */ public static final int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 35958; // 0x8c76 /** @apiSince 18 */ public static final int GL_UNIFORM_ARRAY_STRIDE = 35388; // 0x8a3c /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394; // 0x8a42 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395; // 0x8a43 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_BINDING = 35391; // 0x8a3f /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_DATA_SIZE = 35392; // 0x8a40 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_INDEX = 35386; // 0x8a3a /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_NAME_LENGTH = 35393; // 0x8a41 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398; // 0x8a46 /** @apiSince 18 */ public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396; // 0x8a44 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER = 35345; // 0x8a11 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_BINDING = 35368; // 0x8a28 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380; // 0x8a34 /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_SIZE = 35370; // 0x8a2a /** @apiSince 18 */ public static final int GL_UNIFORM_BUFFER_START = 35369; // 0x8a29 /** @apiSince 18 */ public static final int GL_UNIFORM_IS_ROW_MAJOR = 35390; // 0x8a3e /** @apiSince 18 */ public static final int GL_UNIFORM_MATRIX_STRIDE = 35389; // 0x8a3d /** @apiSince 18 */ public static final int GL_UNIFORM_NAME_LENGTH = 35385; // 0x8a39 /** @apiSince 18 */ public static final int GL_UNIFORM_OFFSET = 35387; // 0x8a3b /** @apiSince 18 */ public static final int GL_UNIFORM_SIZE = 35384; // 0x8a38 /** @apiSince 18 */ public static final int GL_UNIFORM_TYPE = 35383; // 0x8a37 /** @apiSince 18 */ public static final int GL_UNPACK_IMAGE_HEIGHT = 32878; // 0x806e /** @apiSince 18 */ public static final int GL_UNPACK_ROW_LENGTH = 3314; // 0xcf2 /** @apiSince 18 */ public static final int GL_UNPACK_SKIP_IMAGES = 32877; // 0x806d /** @apiSince 18 */ public static final int GL_UNPACK_SKIP_PIXELS = 3316; // 0xcf4 /** @apiSince 18 */ public static final int GL_UNPACK_SKIP_ROWS = 3315; // 0xcf3 /** @apiSince 18 */ public static final int GL_UNSIGNALED = 37144; // 0x9118 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_10F_11F_11F_REV = 35899; // 0x8c3b /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_24_8 = 34042; // 0x84fa /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 33640; // 0x8368 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_5_9_9_9_REV = 35902; // 0x8c3e /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_2D = 36306; // 0x8dd2 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311; // 0x8dd7 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_3D = 36307; // 0x8dd3 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_SAMPLER_CUBE = 36308; // 0x8dd4 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_VEC2 = 36294; // 0x8dc6 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_VEC3 = 36295; // 0x8dc7 /** @apiSince 18 */ public static final int GL_UNSIGNED_INT_VEC4 = 36296; // 0x8dc8 /** @apiSince 18 */ public static final int GL_UNSIGNED_NORMALIZED = 35863; // 0x8c17 /** @apiSince 18 */ public static final int GL_VERTEX_ARRAY_BINDING = 34229; // 0x85b5 /** @apiSince 18 */ public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 35070; // 0x88fe /** @apiSince 18 */ public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 35069; // 0x88fd /** @apiSince 18 */ public static final int GL_WAIT_FAILED = 37149; // 0x911d }
48,203
0.709665
0.628737
1,918
24.131388
34.59227
210
false
false
0
0
0
0
0
0
0.50365
false
false
2
c776e3ace9726fe9f2393c0215ec12e7bfc9d601
37,314,675,902,305
b59b7ecc02ad3d156e319aac6fcca5b0835d1e1e
/dubbo-api/src/main/java/com/less/api/model/Greeting.java
3e379517ecb1dc7d101a775537b345781bdd16be
[]
no_license
woowooh/DubboStudy
https://github.com/woowooh/DubboStudy
4b66b214351f3ccb184c66e3b42a523535b95ba8
7bc07148ea4a343756e424c65efcab20b1c0ac8a
refs/heads/master
2020-09-28T02:37:13.525000
2020-06-13T16:24:24
2020-06-13T16:24:24
226,669,211
0
0
null
false
2019-12-08T15:46:04
2019-12-08T13:08:07
2019-12-08T15:25:19
2019-12-08T15:46:04
0
0
0
0
Java
false
false
package com.less.api.model; import lombok.Data; import java.io.Serializable; @Data public class Greeting implements Serializable { String message; }
UTF-8
Java
156
java
Greeting.java
Java
[]
null
[]
package com.less.api.model; import lombok.Data; import java.io.Serializable; @Data public class Greeting implements Serializable { String message; }
156
0.769231
0.769231
10
14.6
15.291828
47
false
false
0
0
0
0
0
0
0.4
false
false
2
4aa3d2b40e5c1787deb6ffd9c6c1df5cdcff8a6b
26,508,538,219,000
b039e6dd0da4840b7c4fd8a0b79a247aed4b9a17
/Algorithm/src/com/algorithm/ftrl/FTRLProximal.java
5eb89524c6b4df884f9a07b1f8911dbd4a1f2f03
[]
no_license
JanneLee/Algorithm-Java
https://github.com/JanneLee/Algorithm-Java
432f350bbca4cabddcac3b0902ea5b5e49c37352
1ae6ad2a31608d8548e855acbc27b4d558e4c5f8
refs/heads/master
2021-05-04T10:03:00.690000
2021-01-14T08:23:11
2021-01-14T08:23:11
49,769,338
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.algorithm.ftrl; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; /** * @author lijianli */ public class FTRLProximal { private FTRLParameters parameters; // parameters->alpha, beta, l1, l2, dimensions public double[] n;// n->squared sum of past gradients public double[] z;// z->weights public Map<Integer, Double> w;// w->lazy weights public FTRLProximal(FTRLParameters parameters) { this.parameters = parameters; this.n = new double[parameters.dataDimensions]; this.z = new double[parameters.dataDimensions]; this.w = null; } /** x->p(y=1|x; w) , get w, nothing is changed*/ public double predict(Map<Integer, Double> x) { w = new HashMap<>(); double decisionValue = 0.0; for (Entry<Integer, Double> e : x.entrySet()) { double sgn = sign(z[e.getKey()]); double weight = 0.0; if (sgn * z[e.getKey()] <= parameters.L1_lambda) { w.put(e.getKey(), weight); } else { weight = (sgn * parameters.L1_lambda - z[e.getKey()]) / ((parameters.beta + Math.sqrt(n[e.getKey()])) / parameters.alpha + parameters.L2_lambda); w.put(e.getKey(), weight); } decisionValue += e.getValue() * weight; } decisionValue = Math.max(Math.min(decisionValue, 35.), -35.); return 1. / (1. + Math.exp(-decisionValue)); } /** input: sample x, probability p, label y(-1(or 0) or 1) * used: w * update: n, z*/ public void updateModel(Map<Integer, Double> x, double p, double y) { for(Entry<Integer, Double> e : x.entrySet()) { double grad = p * e.getValue(); if(y == 1.0) { grad = (p - y) * e.getValue(); } double sigma = (Math.sqrt(n[e.getKey()] + grad * grad) - Math.sqrt(n[e.getKey()])) / parameters.alpha; z[e.getKey()] += (grad - sigma * w.get(e.getKey())); n[e.getKey()] += grad * grad; } } /** * N、Z、W * 模型参数保存函数 * */ public void saveModel(String filePath) throws IOException { String n_=String.valueOf(n[0]); String z_=String.valueOf(z[0]); String w_=String.valueOf(w.get(0)); for(int i=1;i<n.length;i++){ n_ = n_+" "+String.valueOf(n[i]); z_ = z_+" "+String.valueOf(z[i]); w_ = w_+" "+String.valueOf(w.get(i)); } try{ File file = new File(filePath); if(!file.exists()){ file.createNewFile(); } FileWriter fileWriter = new FileWriter(filePath); BufferedWriter bufferWriter = new BufferedWriter(fileWriter); bufferWriter.write(n_+"\r\n"); bufferWriter.write(z_+"\r\n"); bufferWriter.write(w_); bufferWriter.close(); System.out.print("Done"); }catch (IOException e){ e.printStackTrace(); } } public void loadModel(String filePath) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filePath)), "UTF-8")); String line; String[][] Str = new String[3][]; int i = 0; while((line = br.readLine()) != null) { Str[i] = line.split(" "); i++; } n = new double[n.length]; z = new double[z.length]; w = new HashMap<>(); for(int j=0;j<n.length;j++){ n[j] = Double.valueOf(Str[0][j]); z[j] = Double.valueOf(Str[1][j]); w.put(j,Double.valueOf(Str[2][j])); } } private double sign(double x) { if (x > 0) { return 1.0; } else if (x < 0) { return -1.0; } else { return 0.0; } } }
UTF-8
Java
4,215
java
FTRLProximal.java
Java
[ { "context": "l.Map;\nimport java.util.Map.Entry;\n\n/**\n * @author lijianli\n */\npublic class FTRLProximal {\n\n private FTRL", "end": 332, "score": 0.9992988705635071, "start": 324, "tag": "USERNAME", "value": "lijianli" } ]
null
[]
package com.algorithm.ftrl; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; /** * @author lijianli */ public class FTRLProximal { private FTRLParameters parameters; // parameters->alpha, beta, l1, l2, dimensions public double[] n;// n->squared sum of past gradients public double[] z;// z->weights public Map<Integer, Double> w;// w->lazy weights public FTRLProximal(FTRLParameters parameters) { this.parameters = parameters; this.n = new double[parameters.dataDimensions]; this.z = new double[parameters.dataDimensions]; this.w = null; } /** x->p(y=1|x; w) , get w, nothing is changed*/ public double predict(Map<Integer, Double> x) { w = new HashMap<>(); double decisionValue = 0.0; for (Entry<Integer, Double> e : x.entrySet()) { double sgn = sign(z[e.getKey()]); double weight = 0.0; if (sgn * z[e.getKey()] <= parameters.L1_lambda) { w.put(e.getKey(), weight); } else { weight = (sgn * parameters.L1_lambda - z[e.getKey()]) / ((parameters.beta + Math.sqrt(n[e.getKey()])) / parameters.alpha + parameters.L2_lambda); w.put(e.getKey(), weight); } decisionValue += e.getValue() * weight; } decisionValue = Math.max(Math.min(decisionValue, 35.), -35.); return 1. / (1. + Math.exp(-decisionValue)); } /** input: sample x, probability p, label y(-1(or 0) or 1) * used: w * update: n, z*/ public void updateModel(Map<Integer, Double> x, double p, double y) { for(Entry<Integer, Double> e : x.entrySet()) { double grad = p * e.getValue(); if(y == 1.0) { grad = (p - y) * e.getValue(); } double sigma = (Math.sqrt(n[e.getKey()] + grad * grad) - Math.sqrt(n[e.getKey()])) / parameters.alpha; z[e.getKey()] += (grad - sigma * w.get(e.getKey())); n[e.getKey()] += grad * grad; } } /** * N、Z、W * 模型参数保存函数 * */ public void saveModel(String filePath) throws IOException { String n_=String.valueOf(n[0]); String z_=String.valueOf(z[0]); String w_=String.valueOf(w.get(0)); for(int i=1;i<n.length;i++){ n_ = n_+" "+String.valueOf(n[i]); z_ = z_+" "+String.valueOf(z[i]); w_ = w_+" "+String.valueOf(w.get(i)); } try{ File file = new File(filePath); if(!file.exists()){ file.createNewFile(); } FileWriter fileWriter = new FileWriter(filePath); BufferedWriter bufferWriter = new BufferedWriter(fileWriter); bufferWriter.write(n_+"\r\n"); bufferWriter.write(z_+"\r\n"); bufferWriter.write(w_); bufferWriter.close(); System.out.print("Done"); }catch (IOException e){ e.printStackTrace(); } } public void loadModel(String filePath) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filePath)), "UTF-8")); String line; String[][] Str = new String[3][]; int i = 0; while((line = br.readLine()) != null) { Str[i] = line.split(" "); i++; } n = new double[n.length]; z = new double[z.length]; w = new HashMap<>(); for(int j=0;j<n.length;j++){ n[j] = Double.valueOf(Str[0][j]); z[j] = Double.valueOf(Str[1][j]); w.put(j,Double.valueOf(Str[2][j])); } } private double sign(double x) { if (x > 0) { return 1.0; } else if (x < 0) { return -1.0; } else { return 0.0; } } }
4,215
0.520858
0.511323
133
30.548872
22.633221
120
false
false
0
0
0
0
0
0
0.699248
false
false
2
3794c689c2b478bff75b1a14b3c4cc493df7dcf6
39,591,008,564,445
543187005bb7c42e01de72bc4af91314800fe716
/unter-service/src/main/java/com/ravago/unter/repository/api/CarrierRepository.java
b4ea57c705454b0f56ad86d863d4e1094be65d73
[]
no_license
vnature/unter
https://github.com/vnature/unter
749b8e31ba8af8924f54356cbdc8259431da5dd0
91dacb6244a29a6822b1be132d8494ef84989114
refs/heads/master
2020-12-25T19:39:18.269000
2016-07-01T12:36:21
2016-07-01T12:36:32
62,300,258
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ravago.unter.repository.api; import org.springframework.data.jpa.repository.JpaRepository; import com.ravago.unter.domain.Carrier; public interface CarrierRepository extends JpaRepository<Carrier, Long> { Carrier findByname(String name); }
UTF-8
Java
257
java
CarrierRepository.java
Java
[]
null
[]
package com.ravago.unter.repository.api; import org.springframework.data.jpa.repository.JpaRepository; import com.ravago.unter.domain.Carrier; public interface CarrierRepository extends JpaRepository<Carrier, Long> { Carrier findByname(String name); }
257
0.821012
0.821012
10
24.700001
26.758364
73
false
false
0
0
0
0
0
0
0.6
false
false
2
22b973b21a132c19b08ea6719c49d34982ec55ee
36,481,452,256,722
6f96620c4e4ad88e8c8f96a9cc91d4f1898204f3
/ShopMall-Android/src/lbs/goodplace/com/View/adapter/MyAdapter.java
30422d243058841524a809af24bb56ae445d47ba
[]
no_license
edwinace/projects
https://github.com/edwinace/projects
80b9ccf684b3e821ecef3db6ab1e8594b2bff035
b8b26787b75eed599c941e5ebe4d5f3c051e9df4
refs/heads/master
2016-09-13T08:31:59.781000
2016-04-30T08:00:22
2016-04-30T08:00:22
56,741,702
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package lbs.goodplace.com.View.adapter; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import com.amap.api.location.core.GeoPoint; import lbs.goodplace.com.R; import lbs.goodplace.com.component.ScoreStar; import lbs.goodplace.com.controls.GoodPlaceContants; import lbs.goodplace.com.manage.GPS.CoordinateManage; import lbs.goodplace.com.manage.imagemanage.AsyncImageManager; import lbs.goodplace.com.manage.imagemanage.AsyncImageManager.AsyncImageLoadedCallBack; import lbs.goodplace.com.manage.util.FileUtil; import lbs.goodplace.com.obj.ShopModule; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.location.Location; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageSwitcher; import android.widget.ImageView; import android.widget.TextView; public class MyAdapter extends BaseAdapter { private Context mContext = null; private LayoutInflater mInflater = null; public Handler mHandlerDelbtn; public boolean isDelShow = false; // private GeoPoint mygeppoint ; private DecimalFormat mdf = new DecimalFormat("0.0"); /** * 数据源 */ private List<ShopModule> mDataSource = new ArrayList<ShopModule>(); /** * 默认图标 */ private Bitmap mDefaultBitmap = null; private AsyncImageManager mImgManager = null; public MyAdapter(Context context) { mContext = context; mInflater = LayoutInflater.from(context); mImgManager = AsyncImageManager.getInstance(); initDefaultIcon(); // mygeppoint = new GeoPoint((int)(GoodPlaceContants.LAT* 1e6), (int)(GoodPlaceContants.LNG * 1e6)); // mygeppoint = CoordinateConver.fromWgs84ToBaidu(new GeoPoint((int)(GoodPlaceContants.LAT* 1e6), (int)(GoodPlaceContants.LNG * 1e6))); } /** * 设置列表展现的默认图标 */ public void setDefaultIcon(Drawable drawable) { if (drawable != null && drawable instanceof BitmapDrawable) { mDefaultBitmap = ((BitmapDrawable) drawable).getBitmap(); } } /** * 设置列表展现的默认图标 */ public void initDefaultIcon() { mDefaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.no_pic); } @Override public int getCount() { if (mDataSource == null) { return 0; } return mDataSource.size(); } @Override public Object getItem(int position) { try { return mDataSource.get(position); } catch (Exception e) { return null; } } @Override public long getItemId(int position) { return 0; } public void updateDataSource(List<ShopModule> dataSource) { mDataSource = dataSource; notifyDataSetChanged(); } @Override public View getView(final int position, View convertView, ViewGroup parent) { if (mDataSource == null || position < 0 || position >= mDataSource.size()) { return convertView; } FeatureViewHolder holder = null; if (convertView == null) { convertView = mInflater.inflate(R.layout.ranking_view_list_item, null); holder = new FeatureViewHolder(); holder.mImageSwitcher = (ImageSwitcher) convertView .findViewById(R.id.switcher); holder.mName = (TextView) convertView.findViewById(R.id.name); holder.mPrice = (TextView) convertView.findViewById(R.id.price); holder.mScoreStar = (ScoreStar) convertView .findViewById(R.id.scoreStar); holder.mAdress = (TextView) convertView.findViewById(R.id.adress); holder.mDistance = (TextView) convertView .findViewById(R.id.distance); holder.mIconDiscount = (ImageView) convertView .findViewById(R.id.icon_discount); holder.mIconPromo = (ImageView) convertView .findViewById(R.id.icon_promo); holder.mIconGift = (ImageView) convertView .findViewById(R.id.icon_gift); holder.mIconCard = (ImageView) convertView .findViewById(R.id.icon_card); holder.mIconHyf = (ImageView) convertView .findViewById(R.id.icon_hyf); holder.mIconDsf = (ImageView) convertView .findViewById(R.id.icon_dsf); holder.mButtonDel= (Button) convertView.findViewById(R.id.button_del); if(isDelShow) holder.mButtonDel.setVisibility(View.VISIBLE); convertView.setTag(holder); } else { holder = (FeatureViewHolder) convertView.getTag(); } ShopModule shopInfo = mDataSource.get(position); setIcon(position, holder.mImageSwitcher, shopInfo.defaultpicurl); holder.mName.setText(shopInfo.name); holder.mScoreStar.setStar(shopInfo.score); holder.mPrice.setText(shopInfo.pricetext); holder.mAdress.setText(shopInfo.regionname + " " + shopInfo.categoryname); String distanceString = getDistance(shopInfo.lat,shopInfo.lng); holder.mDistance.setText(distanceString); // GeoPoint shopgeppoint = CoordinateConver.fromWgs84ToBaidu(new GeoPoint((int)(shopInfo.lat* 1e6), (int)(shopInfo.lng * 1e6))); //// Log.i("zjj", "我的LAT:" + mygeppoint.getLatitudeE6() + ",店的LAT:" + shopgeppoint.getLatitudeE6()); // double distance = DistanceUtil.getDistance(mygeppoint, shopgeppoint); // distance = distance/1000; // // holder.mDistance.setText(distance>5?">5km":mdf.format(distance) + "km" ); setIconVisibility(shopInfo.isdiscount, holder.mIconDiscount); setIconVisibility(shopInfo.ispromo, holder.mIconPromo); setIconVisibility(shopInfo.isgift, holder.mIconGift); // setIconVisibility(shopInfo.iscard, holder.mIconCard); // setIconVisibility(shopInfo.ishyf, holder.mIconHyf); // setIconVisibility(shopInfo.isdsf, holder.mIconDsf); holder.mButtonDel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if(mHandlerDelbtn != null){ Message msg = new Message(); msg.arg1 = position; mHandlerDelbtn.sendMessage(msg); } } }); return convertView; } public void setIconVisibility(boolean show, View view) { if (show) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.GONE); } } public class FeatureViewHolder { public TextView mName; public ImageSwitcher mImageSwitcher; public ScoreStar mScoreStar; public TextView mAdress; public TextView mPrice; public TextView mDistance; public ImageView mIconDiscount; public ImageView mIconPromo; public ImageView mIconGift; public ImageView mIconCard; public ImageView mIconHyf; public ImageView mIconDsf; public Button mButtonDel; } /** * 读取图标,然后设到imageview里 */ private void setIcon(final ImageView imageView, String imgUrl, String imgPath, String imgName, boolean setDefaultIcon) { imageView.setTag(imgUrl); Bitmap bm = mImgManager.loadImage(imgPath, imgName, imgUrl, true, false, null, new AsyncImageLoadedCallBack() { @Override public void imageLoaded(Bitmap imageBitmap, String imgUrl) { if (imageView.getTag().equals(imgUrl)) { imageView.setImageBitmap(imageBitmap); } else { imageBitmap = null; imgUrl = null; } } }); if (bm != null) { imageView.setImageBitmap(bm); } else { if (setDefaultIcon) { imageView.setImageResource(android.R.drawable.sym_def_app_icon); } else { imageView.setImageDrawable(null); } } } private void setIcon(final int position, final ImageSwitcher switcher, String imgUrl) { // Log.i("lch", "setIcon"); if (switcher.getTag() != null && switcher.getTag().equals(imgUrl)) { ImageView image = (ImageView) switcher.getCurrentView(); Drawable drawable = image.getDrawable(); if (drawable != null && drawable instanceof BitmapDrawable) { BitmapDrawable bDrawable = (BitmapDrawable) drawable; if (bDrawable.getBitmap() != null && bDrawable.getBitmap() != mDefaultBitmap) { // Log.i("lch", "return"); return; } } } switcher.setTag(imgUrl); switcher.getCurrentView().clearAnimation(); switcher.getNextView().clearAnimation(); Bitmap bm = mImgManager.loadImageForList(position, FileUtil.ICON_CACHE_PATH, String.valueOf(imgUrl.hashCode()), imgUrl, true, false, null, new AsyncImageLoadedCallBack() { @Override public void imageLoaded(Bitmap imageBitmap, String imgUrl) { // Log.i("lch", "加载网络图片:" + imageBitmap.toString()); if (switcher.getTag().equals(imgUrl)) { Drawable drawable = ((ImageView) switcher .getCurrentView()).getDrawable(); if (drawable instanceof BitmapDrawable) { Bitmap bm = ((BitmapDrawable) drawable) .getBitmap(); // 如果图片是默认图片,设置下一个显示的图片 if (bm == mDefaultBitmap) { switcher.setImageDrawable(new BitmapDrawable( imageBitmap)); } } } else { imageBitmap = null; imgUrl = null; } } }); ImageView imageView = (ImageView) switcher.getCurrentView(); if (bm != null) { // Log.i("lch", "缓存图片:" + bm.toString()); imageView.setImageBitmap(bm); } else { imageView.setImageBitmap(mDefaultBitmap); } } /** * 计算2个经纬度的距离 * @param lat1 Google坐标系 * @param lng1 Google坐标系 * @return */ public String getDistance(double lat1, double lng1) { float[] results= new float[1]; //火星坐标系计算 Location.distanceBetween(CoordinateManage.getLatGG2HX(lat1, lng1), CoordinateManage.getLngGG2HX(lat1, lng1), GoodPlaceContants.HXLAT, GoodPlaceContants.HXLNG, results); DecimalFormat df = new DecimalFormat("0.0"); float distance = results[0]/1000; if (distance > 5) { return "> 5km"; }else { String distanceString = df.format(results[0]/1000) + "km"; return distanceString; } } }
UTF-8
Java
9,914
java
MyAdapter.java
Java
[]
null
[]
package lbs.goodplace.com.View.adapter; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import com.amap.api.location.core.GeoPoint; import lbs.goodplace.com.R; import lbs.goodplace.com.component.ScoreStar; import lbs.goodplace.com.controls.GoodPlaceContants; import lbs.goodplace.com.manage.GPS.CoordinateManage; import lbs.goodplace.com.manage.imagemanage.AsyncImageManager; import lbs.goodplace.com.manage.imagemanage.AsyncImageManager.AsyncImageLoadedCallBack; import lbs.goodplace.com.manage.util.FileUtil; import lbs.goodplace.com.obj.ShopModule; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.location.Location; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageSwitcher; import android.widget.ImageView; import android.widget.TextView; public class MyAdapter extends BaseAdapter { private Context mContext = null; private LayoutInflater mInflater = null; public Handler mHandlerDelbtn; public boolean isDelShow = false; // private GeoPoint mygeppoint ; private DecimalFormat mdf = new DecimalFormat("0.0"); /** * 数据源 */ private List<ShopModule> mDataSource = new ArrayList<ShopModule>(); /** * 默认图标 */ private Bitmap mDefaultBitmap = null; private AsyncImageManager mImgManager = null; public MyAdapter(Context context) { mContext = context; mInflater = LayoutInflater.from(context); mImgManager = AsyncImageManager.getInstance(); initDefaultIcon(); // mygeppoint = new GeoPoint((int)(GoodPlaceContants.LAT* 1e6), (int)(GoodPlaceContants.LNG * 1e6)); // mygeppoint = CoordinateConver.fromWgs84ToBaidu(new GeoPoint((int)(GoodPlaceContants.LAT* 1e6), (int)(GoodPlaceContants.LNG * 1e6))); } /** * 设置列表展现的默认图标 */ public void setDefaultIcon(Drawable drawable) { if (drawable != null && drawable instanceof BitmapDrawable) { mDefaultBitmap = ((BitmapDrawable) drawable).getBitmap(); } } /** * 设置列表展现的默认图标 */ public void initDefaultIcon() { mDefaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.no_pic); } @Override public int getCount() { if (mDataSource == null) { return 0; } return mDataSource.size(); } @Override public Object getItem(int position) { try { return mDataSource.get(position); } catch (Exception e) { return null; } } @Override public long getItemId(int position) { return 0; } public void updateDataSource(List<ShopModule> dataSource) { mDataSource = dataSource; notifyDataSetChanged(); } @Override public View getView(final int position, View convertView, ViewGroup parent) { if (mDataSource == null || position < 0 || position >= mDataSource.size()) { return convertView; } FeatureViewHolder holder = null; if (convertView == null) { convertView = mInflater.inflate(R.layout.ranking_view_list_item, null); holder = new FeatureViewHolder(); holder.mImageSwitcher = (ImageSwitcher) convertView .findViewById(R.id.switcher); holder.mName = (TextView) convertView.findViewById(R.id.name); holder.mPrice = (TextView) convertView.findViewById(R.id.price); holder.mScoreStar = (ScoreStar) convertView .findViewById(R.id.scoreStar); holder.mAdress = (TextView) convertView.findViewById(R.id.adress); holder.mDistance = (TextView) convertView .findViewById(R.id.distance); holder.mIconDiscount = (ImageView) convertView .findViewById(R.id.icon_discount); holder.mIconPromo = (ImageView) convertView .findViewById(R.id.icon_promo); holder.mIconGift = (ImageView) convertView .findViewById(R.id.icon_gift); holder.mIconCard = (ImageView) convertView .findViewById(R.id.icon_card); holder.mIconHyf = (ImageView) convertView .findViewById(R.id.icon_hyf); holder.mIconDsf = (ImageView) convertView .findViewById(R.id.icon_dsf); holder.mButtonDel= (Button) convertView.findViewById(R.id.button_del); if(isDelShow) holder.mButtonDel.setVisibility(View.VISIBLE); convertView.setTag(holder); } else { holder = (FeatureViewHolder) convertView.getTag(); } ShopModule shopInfo = mDataSource.get(position); setIcon(position, holder.mImageSwitcher, shopInfo.defaultpicurl); holder.mName.setText(shopInfo.name); holder.mScoreStar.setStar(shopInfo.score); holder.mPrice.setText(shopInfo.pricetext); holder.mAdress.setText(shopInfo.regionname + " " + shopInfo.categoryname); String distanceString = getDistance(shopInfo.lat,shopInfo.lng); holder.mDistance.setText(distanceString); // GeoPoint shopgeppoint = CoordinateConver.fromWgs84ToBaidu(new GeoPoint((int)(shopInfo.lat* 1e6), (int)(shopInfo.lng * 1e6))); //// Log.i("zjj", "我的LAT:" + mygeppoint.getLatitudeE6() + ",店的LAT:" + shopgeppoint.getLatitudeE6()); // double distance = DistanceUtil.getDistance(mygeppoint, shopgeppoint); // distance = distance/1000; // // holder.mDistance.setText(distance>5?">5km":mdf.format(distance) + "km" ); setIconVisibility(shopInfo.isdiscount, holder.mIconDiscount); setIconVisibility(shopInfo.ispromo, holder.mIconPromo); setIconVisibility(shopInfo.isgift, holder.mIconGift); // setIconVisibility(shopInfo.iscard, holder.mIconCard); // setIconVisibility(shopInfo.ishyf, holder.mIconHyf); // setIconVisibility(shopInfo.isdsf, holder.mIconDsf); holder.mButtonDel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if(mHandlerDelbtn != null){ Message msg = new Message(); msg.arg1 = position; mHandlerDelbtn.sendMessage(msg); } } }); return convertView; } public void setIconVisibility(boolean show, View view) { if (show) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.GONE); } } public class FeatureViewHolder { public TextView mName; public ImageSwitcher mImageSwitcher; public ScoreStar mScoreStar; public TextView mAdress; public TextView mPrice; public TextView mDistance; public ImageView mIconDiscount; public ImageView mIconPromo; public ImageView mIconGift; public ImageView mIconCard; public ImageView mIconHyf; public ImageView mIconDsf; public Button mButtonDel; } /** * 读取图标,然后设到imageview里 */ private void setIcon(final ImageView imageView, String imgUrl, String imgPath, String imgName, boolean setDefaultIcon) { imageView.setTag(imgUrl); Bitmap bm = mImgManager.loadImage(imgPath, imgName, imgUrl, true, false, null, new AsyncImageLoadedCallBack() { @Override public void imageLoaded(Bitmap imageBitmap, String imgUrl) { if (imageView.getTag().equals(imgUrl)) { imageView.setImageBitmap(imageBitmap); } else { imageBitmap = null; imgUrl = null; } } }); if (bm != null) { imageView.setImageBitmap(bm); } else { if (setDefaultIcon) { imageView.setImageResource(android.R.drawable.sym_def_app_icon); } else { imageView.setImageDrawable(null); } } } private void setIcon(final int position, final ImageSwitcher switcher, String imgUrl) { // Log.i("lch", "setIcon"); if (switcher.getTag() != null && switcher.getTag().equals(imgUrl)) { ImageView image = (ImageView) switcher.getCurrentView(); Drawable drawable = image.getDrawable(); if (drawable != null && drawable instanceof BitmapDrawable) { BitmapDrawable bDrawable = (BitmapDrawable) drawable; if (bDrawable.getBitmap() != null && bDrawable.getBitmap() != mDefaultBitmap) { // Log.i("lch", "return"); return; } } } switcher.setTag(imgUrl); switcher.getCurrentView().clearAnimation(); switcher.getNextView().clearAnimation(); Bitmap bm = mImgManager.loadImageForList(position, FileUtil.ICON_CACHE_PATH, String.valueOf(imgUrl.hashCode()), imgUrl, true, false, null, new AsyncImageLoadedCallBack() { @Override public void imageLoaded(Bitmap imageBitmap, String imgUrl) { // Log.i("lch", "加载网络图片:" + imageBitmap.toString()); if (switcher.getTag().equals(imgUrl)) { Drawable drawable = ((ImageView) switcher .getCurrentView()).getDrawable(); if (drawable instanceof BitmapDrawable) { Bitmap bm = ((BitmapDrawable) drawable) .getBitmap(); // 如果图片是默认图片,设置下一个显示的图片 if (bm == mDefaultBitmap) { switcher.setImageDrawable(new BitmapDrawable( imageBitmap)); } } } else { imageBitmap = null; imgUrl = null; } } }); ImageView imageView = (ImageView) switcher.getCurrentView(); if (bm != null) { // Log.i("lch", "缓存图片:" + bm.toString()); imageView.setImageBitmap(bm); } else { imageView.setImageBitmap(mDefaultBitmap); } } /** * 计算2个经纬度的距离 * @param lat1 Google坐标系 * @param lng1 Google坐标系 * @return */ public String getDistance(double lat1, double lng1) { float[] results= new float[1]; //火星坐标系计算 Location.distanceBetween(CoordinateManage.getLatGG2HX(lat1, lng1), CoordinateManage.getLngGG2HX(lat1, lng1), GoodPlaceContants.HXLAT, GoodPlaceContants.HXLNG, results); DecimalFormat df = new DecimalFormat("0.0"); float distance = results[0]/1000; if (distance > 5) { return "> 5km"; }else { String distanceString = df.format(results[0]/1000) + "km"; return distanceString; } } }
9,914
0.713948
0.708188
322
29.192547
23.618872
137
false
false
0
0
0
0
0
0
2.916149
false
false
2
cd9061b70ac702b6aff3a3794c7d1d8e474cd5e7
39,659,728,020,137
7f966c078b634975e06fa79fd53ddd2ef66126cb
/okdownload-filedownloader/src/main/java/com/liulishuo/filedownloader/notification/BaseNotificationItem.java
1fa49dc293ac2b7cbb79fc054bbb2ef4dcced27d
[ "Apache-2.0" ]
permissive
RomanBorisenko1991/okdownload
https://github.com/RomanBorisenko1991/okdownload
f4e851e664a89c6f1857e8c82536988a99268e37
2a0934d4626e1fd89947111e84150d3d1031b940
refs/heads/master
2021-05-18T13:51:18.947000
2020-12-11T08:35:07
2020-12-11T08:35:07
251,269,953
3
2
Apache-2.0
true
2020-12-11T08:35:08
2020-03-30T10:18:13
2020-05-09T06:47:53
2020-12-11T08:35:07
8,147
1
2
0
Java
false
false
/* * Copyright (c) 2018 LingoChamp Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.liulishuo.filedownloader.notification; import android.app.NotificationManager; import android.content.Context; import com.liulishuo.filedownloader.model.FileDownloadStatus; import com.liulishuo.filedownloader.util.FileDownloadHelper; /** * An atom notification item which identify with a downloading task, they have the same downloading * Id. * * @see FileDownloadNotificationHelper * @see FileDownloadNotificationListener */ @SuppressWarnings("WeakerAccess") public abstract class BaseNotificationItem { private int id, sofar, total; private String title, desc; private int status = FileDownloadStatus.INVALID_STATUS; private int lastStatus = FileDownloadStatus.INVALID_STATUS; public BaseNotificationItem(final int id, final String title, final String desc) { this.id = id; this.title = title; this.desc = desc; } public void show(boolean isShowProgress) { show(isChanged(), getStatus(), isShowProgress); } /** * @param isShowProgress Whether there is a need to show the progress schedule changes */ public abstract void show(boolean statusChanged, int status, boolean isShowProgress); public void update(final int sofar, final int total) { this.sofar = sofar; this.total = total; show(true); } public void updateStatus(final int status) { this.status = status; } public void cancel() { getManager().cancel(id); } private NotificationManager manager; protected NotificationManager getManager() { if (manager == null) { manager = (NotificationManager) FileDownloadHelper.getAppContext(). getSystemService(Context.NOTIFICATION_SERVICE); } return manager; } public int getId() { return this.id; } public void setId(int id) { this.id = id; } public int getSofar() { return sofar; } public void setSofar(int sofar) { this.sofar = sofar; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public int getStatus() { this.lastStatus = status; return status; } public void setStatus(int status) { this.status = status; } public int getLastStatus() { return lastStatus; } public boolean isChanged() { return this.lastStatus != status; } }
UTF-8
Java
3,370
java
BaseNotificationItem.java
Java
[]
null
[]
/* * Copyright (c) 2018 LingoChamp Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.liulishuo.filedownloader.notification; import android.app.NotificationManager; import android.content.Context; import com.liulishuo.filedownloader.model.FileDownloadStatus; import com.liulishuo.filedownloader.util.FileDownloadHelper; /** * An atom notification item which identify with a downloading task, they have the same downloading * Id. * * @see FileDownloadNotificationHelper * @see FileDownloadNotificationListener */ @SuppressWarnings("WeakerAccess") public abstract class BaseNotificationItem { private int id, sofar, total; private String title, desc; private int status = FileDownloadStatus.INVALID_STATUS; private int lastStatus = FileDownloadStatus.INVALID_STATUS; public BaseNotificationItem(final int id, final String title, final String desc) { this.id = id; this.title = title; this.desc = desc; } public void show(boolean isShowProgress) { show(isChanged(), getStatus(), isShowProgress); } /** * @param isShowProgress Whether there is a need to show the progress schedule changes */ public abstract void show(boolean statusChanged, int status, boolean isShowProgress); public void update(final int sofar, final int total) { this.sofar = sofar; this.total = total; show(true); } public void updateStatus(final int status) { this.status = status; } public void cancel() { getManager().cancel(id); } private NotificationManager manager; protected NotificationManager getManager() { if (manager == null) { manager = (NotificationManager) FileDownloadHelper.getAppContext(). getSystemService(Context.NOTIFICATION_SERVICE); } return manager; } public int getId() { return this.id; } public void setId(int id) { this.id = id; } public int getSofar() { return sofar; } public void setSofar(int sofar) { this.sofar = sofar; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public int getStatus() { this.lastStatus = status; return status; } public void setStatus(int status) { this.status = status; } public int getLastStatus() { return lastStatus; } public boolean isChanged() { return this.lastStatus != status; } }
3,370
0.654303
0.651929
137
23.605839
24.044168
99
false
false
0
0
0
0
0
0
0.386861
false
false
2
5419c8f5b1702feb246d14179b22c6322e7f1a53
36,034,775,658,547
92225460ebca1bb6a594d77b6559b3629b7a94fa
/src/com/kingdee/eas/fdc/invite/AbstractTenderAccepterResultInfo.java
e015930b5b23d3e910129d964ec4ba6d115adf60
[]
no_license
yangfan0725/sd
https://github.com/yangfan0725/sd
45182d34575381be3bbdd55f3f68854a6900a362
39ebad6e2eb76286d551a9e21967f3f5dc4880da
refs/heads/master
2023-04-29T01:56:43.770000
2023-04-24T05:41:13
2023-04-24T05:41:13
512,073,641
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.kingdee.eas.fdc.invite; import java.io.Serializable; import com.kingdee.bos.dao.AbstractObjectValue; import java.util.Locale; import com.kingdee.util.TypeConversionUtils; import com.kingdee.bos.util.BOSObjectType; public class AbstractTenderAccepterResultInfo extends com.kingdee.eas.fdc.invite.BaseInviteInfo implements Serializable { public AbstractTenderAccepterResultInfo() { this("id"); } protected AbstractTenderAccepterResultInfo(String pkField) { super(pkField); put("listEntry", new com.kingdee.eas.fdc.invite.TenderAccepterRListEntryCollection()); put("entrys", new com.kingdee.eas.fdc.invite.TenderAccepterResultEntryCollection()); } /** * Object: 中标审批 's 分录 property */ public com.kingdee.eas.fdc.invite.TenderAccepterResultEntryCollection getEntrys() { return (com.kingdee.eas.fdc.invite.TenderAccepterResultEntryCollection)get("entrys"); } /** * Object:中标审批's 市场行情property */ public String getMarket() { return getString("market"); } public void setMarket(String item) { setString("market", item); } /** * Object:中标审批's 标底property */ public java.math.BigDecimal getBasePrice() { return getBigDecimal("basePrice"); } public void setBasePrice(java.math.BigDecimal item) { setBigDecimal("basePrice", item); } /** * Object:中标审批's 成本数据库property */ public String getCostData() { return getString("costData"); } public void setCostData(String item) { setString("costData", item); } /** * Object:中标审批's 预估合同金额property */ public java.math.BigDecimal getContractPrice() { return getBigDecimal("contractPrice"); } public void setContractPrice(java.math.BigDecimal item) { setBigDecimal("contractPrice", item); } /** * Object:中标审批's 目标成本property */ public String getAimCost() { return getString("aimCost"); } public void setAimCost(String item) { setString("aimCost", item); } /** * Object:中标审批's 特别说明property */ public String getSpecialNote() { return getString("specialNote"); } public void setSpecialNote(String item) { setString("specialNote", item); } /** * Object:中标审批's 超目标成本原因property */ public String getReason() { return getString("reason"); } public void setReason(String item) { setString("reason", item); } /** * Object: 中标审批 's 目标成本调配方式 property */ public com.kingdee.eas.fdc.invite.DeployTypeInfo getDeployType() { return (com.kingdee.eas.fdc.invite.DeployTypeInfo)get("deployType"); } public void setDeployType(com.kingdee.eas.fdc.invite.DeployTypeInfo item) { put("deployType", item); } /** * Object: 中标审批 's 图纸深度 property */ public com.kingdee.eas.fdc.invite.DrawingDepthInfo getDrawingDepth() { return (com.kingdee.eas.fdc.invite.DrawingDepthInfo)get("drawingDepth"); } public void setDrawingDepth(com.kingdee.eas.fdc.invite.DrawingDepthInfo item) { put("drawingDepth", item); } /** * Object:中标审批's 参考价property */ public String getRefPrice() { return getString("refPrice"); } public void setRefPrice(String item) { setString("refPrice", item); } /** * Object:中标审批's 与目标成本比较property */ public com.kingdee.eas.fdc.invite.RangeEnum getCompareAim() { return com.kingdee.eas.fdc.invite.RangeEnum.getEnum(getString("compareAim")); } public void setCompareAim(com.kingdee.eas.fdc.invite.RangeEnum item) { if (item != null) { setString("compareAim", item.getValue()); } } /** * Object: 中标审批 's 采购明细 property */ public com.kingdee.eas.fdc.invite.TenderAccepterRListEntryCollection getListEntry() { return (com.kingdee.eas.fdc.invite.TenderAccepterRListEntryCollection)get("listEntry"); } /** * Object:中标审批's 合作时间property */ public java.util.Date getStartDate() { return getDate("startDate"); } public void setStartDate(java.util.Date item) { setDate("startDate", item); } /** * Object:中标审批's 合作时间property */ public java.util.Date getEndDate() { return getDate("endDate"); } public void setEndDate(java.util.Date item) { setDate("endDate", item); } /** * Object:中标审批's 定标规则property */ public com.kingdee.eas.fdc.invite.TenderTypeEnum getTenderType() { return com.kingdee.eas.fdc.invite.TenderTypeEnum.getEnum(getString("tenderType")); } public void setTenderType(com.kingdee.eas.fdc.invite.TenderTypeEnum item) { if (item != null) { setString("tenderType", item.getValue()); } } public BOSObjectType getBOSType() { return new BOSObjectType("6C66BD4A"); } }
GB18030
Java
5,379
java
AbstractTenderAccepterResultInfo.java
Java
[]
null
[]
package com.kingdee.eas.fdc.invite; import java.io.Serializable; import com.kingdee.bos.dao.AbstractObjectValue; import java.util.Locale; import com.kingdee.util.TypeConversionUtils; import com.kingdee.bos.util.BOSObjectType; public class AbstractTenderAccepterResultInfo extends com.kingdee.eas.fdc.invite.BaseInviteInfo implements Serializable { public AbstractTenderAccepterResultInfo() { this("id"); } protected AbstractTenderAccepterResultInfo(String pkField) { super(pkField); put("listEntry", new com.kingdee.eas.fdc.invite.TenderAccepterRListEntryCollection()); put("entrys", new com.kingdee.eas.fdc.invite.TenderAccepterResultEntryCollection()); } /** * Object: 中标审批 's 分录 property */ public com.kingdee.eas.fdc.invite.TenderAccepterResultEntryCollection getEntrys() { return (com.kingdee.eas.fdc.invite.TenderAccepterResultEntryCollection)get("entrys"); } /** * Object:中标审批's 市场行情property */ public String getMarket() { return getString("market"); } public void setMarket(String item) { setString("market", item); } /** * Object:中标审批's 标底property */ public java.math.BigDecimal getBasePrice() { return getBigDecimal("basePrice"); } public void setBasePrice(java.math.BigDecimal item) { setBigDecimal("basePrice", item); } /** * Object:中标审批's 成本数据库property */ public String getCostData() { return getString("costData"); } public void setCostData(String item) { setString("costData", item); } /** * Object:中标审批's 预估合同金额property */ public java.math.BigDecimal getContractPrice() { return getBigDecimal("contractPrice"); } public void setContractPrice(java.math.BigDecimal item) { setBigDecimal("contractPrice", item); } /** * Object:中标审批's 目标成本property */ public String getAimCost() { return getString("aimCost"); } public void setAimCost(String item) { setString("aimCost", item); } /** * Object:中标审批's 特别说明property */ public String getSpecialNote() { return getString("specialNote"); } public void setSpecialNote(String item) { setString("specialNote", item); } /** * Object:中标审批's 超目标成本原因property */ public String getReason() { return getString("reason"); } public void setReason(String item) { setString("reason", item); } /** * Object: 中标审批 's 目标成本调配方式 property */ public com.kingdee.eas.fdc.invite.DeployTypeInfo getDeployType() { return (com.kingdee.eas.fdc.invite.DeployTypeInfo)get("deployType"); } public void setDeployType(com.kingdee.eas.fdc.invite.DeployTypeInfo item) { put("deployType", item); } /** * Object: 中标审批 's 图纸深度 property */ public com.kingdee.eas.fdc.invite.DrawingDepthInfo getDrawingDepth() { return (com.kingdee.eas.fdc.invite.DrawingDepthInfo)get("drawingDepth"); } public void setDrawingDepth(com.kingdee.eas.fdc.invite.DrawingDepthInfo item) { put("drawingDepth", item); } /** * Object:中标审批's 参考价property */ public String getRefPrice() { return getString("refPrice"); } public void setRefPrice(String item) { setString("refPrice", item); } /** * Object:中标审批's 与目标成本比较property */ public com.kingdee.eas.fdc.invite.RangeEnum getCompareAim() { return com.kingdee.eas.fdc.invite.RangeEnum.getEnum(getString("compareAim")); } public void setCompareAim(com.kingdee.eas.fdc.invite.RangeEnum item) { if (item != null) { setString("compareAim", item.getValue()); } } /** * Object: 中标审批 's 采购明细 property */ public com.kingdee.eas.fdc.invite.TenderAccepterRListEntryCollection getListEntry() { return (com.kingdee.eas.fdc.invite.TenderAccepterRListEntryCollection)get("listEntry"); } /** * Object:中标审批's 合作时间property */ public java.util.Date getStartDate() { return getDate("startDate"); } public void setStartDate(java.util.Date item) { setDate("startDate", item); } /** * Object:中标审批's 合作时间property */ public java.util.Date getEndDate() { return getDate("endDate"); } public void setEndDate(java.util.Date item) { setDate("endDate", item); } /** * Object:中标审批's 定标规则property */ public com.kingdee.eas.fdc.invite.TenderTypeEnum getTenderType() { return com.kingdee.eas.fdc.invite.TenderTypeEnum.getEnum(getString("tenderType")); } public void setTenderType(com.kingdee.eas.fdc.invite.TenderTypeEnum item) { if (item != null) { setString("tenderType", item.getValue()); } } public BOSObjectType getBOSType() { return new BOSObjectType("6C66BD4A"); } }
5,379
0.623262
0.622479
198
24.797979
24.984432
120
false
false
0
0
0
0
0
0
0.328283
false
false
2
afc901199cc28287c75e0563d2fef368ad549cbf
36,034,775,660,261
3e1a28c18189466cd1872b0ebada5359ad59e601
/19/src/MathUtils.java
aed978640f590b27507f19929ad7bfd2b7473134
[]
no_license
PetrM97/prog
https://github.com/PetrM97/prog
06b03b1a3a7a6bde57910caccd55f51cca113612
fca002e8de7a63c31ad58406b20491a7ba9418c8
refs/heads/master
2018-01-08T05:52:59.449000
2016-09-15T15:24:02
2016-09-15T15:24:02
45,613,493
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class MathUtils { public static int min(int... numbers) { int x = Integer.MAX_VALUE; for (int i = 0; i < numbers.length; i++){ if( x > numbers[i] ){ x = numbers[i]; } } return x; } }
UTF-8
Java
257
java
MathUtils.java
Java
[]
null
[]
public class MathUtils { public static int min(int... numbers) { int x = Integer.MAX_VALUE; for (int i = 0; i < numbers.length; i++){ if( x > numbers[i] ){ x = numbers[i]; } } return x; } }
257
0.455253
0.451362
11
22.454546
14.944526
49
false
false
0
0
0
0
0
0
0.818182
false
false
2
4276627571e1b14f8aac8061a2f30fdd9b957bfe
35,158,602,338,536
fbfa2b64263227d0cc35ec194ad232215ea16662
/src/main/java/com/iip/datafusion/dgs/model/accuracy/ConditionValue.java
2e8504a6667ba5904ea1ea119e23e31512c750f3
[]
no_license
Viking18/DataFusion
https://github.com/Viking18/DataFusion
13462d4b2872e436981e1a5c64e6c447b3cfb0c1
0207df63ca01a395d3720f960ac0b6d93b1cbd79
refs/heads/master
2021-09-18T14:07:06.666000
2018-07-15T06:32:04
2018-07-15T06:32:04
113,149,568
2
0
null
true
2017-12-20T03:32:22
2017-12-05T07:42:55
2017-12-13T07:00:44
2017-12-20T03:32:22
58
0
0
0
Java
false
null
package com.iip.datafusion.dgs.model.accuracy; import com.fasterxml.jackson.annotation.JsonProperty; public class ConditionValue { private String condition; private String value; public ConditionValue(String condition, String value) { this.condition = condition; this.value = value; } public String getCondition() { return condition; } public void setCondition(String condition) { this.condition = condition; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
UTF-8
Java
619
java
ConditionValue.java
Java
[]
null
[]
package com.iip.datafusion.dgs.model.accuracy; import com.fasterxml.jackson.annotation.JsonProperty; public class ConditionValue { private String condition; private String value; public ConditionValue(String condition, String value) { this.condition = condition; this.value = value; } public String getCondition() { return condition; } public void setCondition(String condition) { this.condition = condition; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
619
0.654281
0.654281
30
19.633333
18.447191
59
false
false
0
0
0
0
0
0
0.366667
false
false
2
26021f1358b4f4e27104c0c18a65d5967698cbe0
35,966,056,184,084
8ae81f39306193875b22c3f58c13f8763f068ee6
/src/java/mangerBean/TipoReservaBean.java
c752863cb6529072841ef8539b25126feb0617b5
[]
no_license
SAULCONDE/Examen-Final
https://github.com/SAULCONDE/Examen-Final
ec2837f6fbd64f396a4ce9a4f6fd87db286927c4
bc163ae15b0b1ad9ea52e20530317647bb710e46
refs/heads/master
2022-02-07T21:36:01.530000
2019-07-20T17:41:30
2019-07-20T17:41:30
197,958,454
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 mangerBean; import dao.TipoReservaDao; import entidades.Tiporeserva; import java.util.ArrayList; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; /** * * @author SAUL */ @ManagedBean @ViewScoped public class TipoReservaBean { private Tiporeserva tiporeserva; private TipoReservaDao tipoReservaDao; boolean respuesta; private boolean banderaSelect = false; public TipoReservaBean() { tiporeserva = new Tiporeserva(); } public ArrayList<Tiporeserva> listTiporeserva() { ArrayList<Tiporeserva> list = new ArrayList<>(); tipoReservaDao = new TipoReservaDao(); list = tipoReservaDao.listTiporeserva(); return list; } public String insertTiporeserva() { tipoReservaDao = new TipoReservaDao(); respuesta = tipoReservaDao.insertTiporeserva(tiporeserva); if (respuesta) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registro insertado con exito", "exito")); } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error", "No se pudo registrar")); } return "/TipoReserva"; } public String clean() { return "/TipoReserva"; } public String updateTiporeserva() { tipoReservaDao = new TipoReservaDao(); respuesta = tipoReservaDao.updateTiporeserva(tiporeserva); if (respuesta) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registro actualizado con exito", "exito")); } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error", "No se pudo registrar")); } return "/TipoReserva"; } public String deleteTiporeserva(Tiporeserva tiporeserva) { tipoReservaDao = new TipoReservaDao(); respuesta = tipoReservaDao.deleteTiporeserva(tiporeserva); if (respuesta) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registro eliminado con exito", "exito")); } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error", "No se pudo registrar")); } return "/TipoReserva"; } public Tiporeserva getTiporeserva() { return tiporeserva; } public void setTiporeserva(Tiporeserva tiporeserva) { this.tiporeserva = tiporeserva; } public void selectBandera() { banderaSelect = true; } public boolean isBanderaSelect() { return banderaSelect; } public void setBanderaSelect(boolean banderaSelect) { this.banderaSelect = banderaSelect; } }
UTF-8
Java
3,170
java
TipoReservaBean.java
Java
[ { "context": "faces.context.FacesContext;\r\n\r\n/**\r\n *\r\n * @author SAUL\r\n */\r\n@ManagedBean\r\n@ViewScoped\r\npublic class TipoR", "end": 490, "score": 0.9573137760162354, "start": 486, "tag": "USERNAME", "value": "SAUL" } ]
null
[]
/* * 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 mangerBean; import dao.TipoReservaDao; import entidades.Tiporeserva; import java.util.ArrayList; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; /** * * @author SAUL */ @ManagedBean @ViewScoped public class TipoReservaBean { private Tiporeserva tiporeserva; private TipoReservaDao tipoReservaDao; boolean respuesta; private boolean banderaSelect = false; public TipoReservaBean() { tiporeserva = new Tiporeserva(); } public ArrayList<Tiporeserva> listTiporeserva() { ArrayList<Tiporeserva> list = new ArrayList<>(); tipoReservaDao = new TipoReservaDao(); list = tipoReservaDao.listTiporeserva(); return list; } public String insertTiporeserva() { tipoReservaDao = new TipoReservaDao(); respuesta = tipoReservaDao.insertTiporeserva(tiporeserva); if (respuesta) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registro insertado con exito", "exito")); } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error", "No se pudo registrar")); } return "/TipoReserva"; } public String clean() { return "/TipoReserva"; } public String updateTiporeserva() { tipoReservaDao = new TipoReservaDao(); respuesta = tipoReservaDao.updateTiporeserva(tiporeserva); if (respuesta) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registro actualizado con exito", "exito")); } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error", "No se pudo registrar")); } return "/TipoReserva"; } public String deleteTiporeserva(Tiporeserva tiporeserva) { tipoReservaDao = new TipoReservaDao(); respuesta = tipoReservaDao.deleteTiporeserva(tiporeserva); if (respuesta) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registro eliminado con exito", "exito")); } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error", "No se pudo registrar")); } return "/TipoReserva"; } public Tiporeserva getTiporeserva() { return tiporeserva; } public void setTiporeserva(Tiporeserva tiporeserva) { this.tiporeserva = tiporeserva; } public void selectBandera() { banderaSelect = true; } public boolean isBanderaSelect() { return banderaSelect; } public void setBanderaSelect(boolean banderaSelect) { this.banderaSelect = banderaSelect; } }
3,170
0.655836
0.655836
105
28.190475
32.872074
152
false
false
0
0
0
0
0
0
0.533333
false
false
2
eb12157635c8791124974ff704b2b37abd3a1fa3
27,367,531,656,463
9bacdcab0912a12844165c4e9b22f35a89907a99
/Registration/src/be/hogent/b4/service/UserService.java
285b93f670c1f3380b4930878a670ff96d72aad3
[]
no_license
SachaProg/Prog5-1920
https://github.com/SachaProg/Prog5-1920
55a91233018910eb4f650961d7f4c41e0b5e2f20
88898324524e2e8dcbf4cc41e2e464db7772e086
refs/heads/master
2020-08-06T10:40:01.456000
2020-01-07T20:38:02
2020-01-07T20:38:02
212,947,027
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package be.hogent.b4.service; import be.hogent.b4.service.dto.UserDto; import java.util.List; public interface UserService { public void saveUser(UserDto userDto); public List<UserDto> getAll(); }
UTF-8
Java
210
java
UserService.java
Java
[]
null
[]
package be.hogent.b4.service; import be.hogent.b4.service.dto.UserDto; import java.util.List; public interface UserService { public void saveUser(UserDto userDto); public List<UserDto> getAll(); }
210
0.742857
0.733333
12
16.5
17.026939
42
false
false
0
0
0
0
0
0
0.416667
false
false
2
f0b1bfc09af5bcef7aecda124f69dc3821307b53
1,202,590,895,041
11e90c11da711f66b0c0c24c4dab0107b099c0c8
/GooglePlaceAPILibrary/src/main/java/com/sn/googleplaceapilibrary/GooglePlacesAPI/Objects/Predictions_Object.java
59760397b73daa50d3844d032951fe96721cdb72
[ "MIT" ]
permissive
pchauhan/GooglePlaceLib
https://github.com/pchauhan/GooglePlaceLib
ffae47682ca8d8e38256294b6a28b75fb7024c75
dae8117c301d36b2527064e4bb1eb450bc6d8dd1
refs/heads/master
2021-01-10T20:55:48.773000
2015-08-10T10:15:39
2015-08-10T10:15:39
40,434,018
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sn.googleplaceapilibrary.GooglePlacesAPI.Objects; /** * Created by parag.chauhan on 7/31/2015. */ public class Predictions_Object { public String description,id ,place_id,reference; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } /* @SerializedName("matched_substrings") ArrayList<Matched_Substrings_Object> arrMatchedSubstrings ; @SerializedName("terms") ArrayList<Terms_Object> arrTerms ; @SerializedName("types") List<String> arrTypes ; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPlace_id() { return place_id; } public void setPlace_id(String place_id) { this.place_id = place_id; } public String getReference() { return reference; } public void setReference(String reference) { this.reference = reference; } public ArrayList<Matched_Substrings_Object> getArrMatchedSubstrings() { return arrMatchedSubstrings; } public void setArrMatchedSubstrings(ArrayList<Matched_Substrings_Object> arrMatchedSubstrings) { this.arrMatchedSubstrings = arrMatchedSubstrings; } public ArrayList<Terms_Object> getArrTerms() { return arrTerms; } public void setArrTerms(ArrayList<Terms_Object> arrTerms) { this.arrTerms = arrTerms; } public List<String> getArrTypes() { return arrTypes; } public void setArrTypes(List<String> arrTypes) { this.arrTypes = arrTypes; } */ }
UTF-8
Java
1,691
java
Predictions_Object.java
Java
[ { "context": "ibrary.GooglePlacesAPI.Objects;\n\n/**\n * Created by parag.chauhan on 7/31/2015.\n */\npublic class Predictions", "end": 86, "score": 0.6469066739082336, "start": 81, "tag": "USERNAME", "value": "parag" }, { "context": "GooglePlacesAPI.Objects;\n\n/**\n * Created by pa...
null
[]
package com.sn.googleplaceapilibrary.GooglePlacesAPI.Objects; /** * Created by parag.chauhan on 7/31/2015. */ public class Predictions_Object { public String description,id ,place_id,reference; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } /* @SerializedName("matched_substrings") ArrayList<Matched_Substrings_Object> arrMatchedSubstrings ; @SerializedName("terms") ArrayList<Terms_Object> arrTerms ; @SerializedName("types") List<String> arrTypes ; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPlace_id() { return place_id; } public void setPlace_id(String place_id) { this.place_id = place_id; } public String getReference() { return reference; } public void setReference(String reference) { this.reference = reference; } public ArrayList<Matched_Substrings_Object> getArrMatchedSubstrings() { return arrMatchedSubstrings; } public void setArrMatchedSubstrings(ArrayList<Matched_Substrings_Object> arrMatchedSubstrings) { this.arrMatchedSubstrings = arrMatchedSubstrings; } public ArrayList<Terms_Object> getArrTerms() { return arrTerms; } public void setArrTerms(ArrayList<Terms_Object> arrTerms) { this.arrTerms = arrTerms; } public List<String> getArrTypes() { return arrTypes; } public void setArrTypes(List<String> arrTypes) { this.arrTypes = arrTypes; } */ }
1,691
0.654642
0.650503
74
21.851351
22.454569
100
false
false
0
0
0
0
0
0
0.297297
false
false
2
6eff839e229a9bbb3ac4465ab10173549496627f
9,509,057,663,036
e787c556a822380e6a9d1fe9dd162fac288684f3
/plugins/field-policy-default/src/main/java/com/thinkbiganalytics/policy/validation/TimestampValidator.java
a31cfaa3c2bbb525b640ee498475842307d99c2f
[ "WTFPL", "CDDL-1.0", "MIT", "CC0-1.0", "EPL-1.0", "PostgreSQL", "BSD-3-Clause", "LGPL-2.1-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-protobuf", "OFL-1.1" ]
permissive
rohituppalapati/kylo-source
https://github.com/rohituppalapati/kylo-source
82bd8e788a14a33edcff8ac6306245c230e90665
cc794fb8a128a1bb6453e029ab7f6354e75c863e
refs/heads/master
2022-12-28T08:14:32.280000
2019-08-13T18:16:31
2019-08-13T18:16:31
200,886,840
0
0
Apache-2.0
false
2022-12-16T03:26:58
2019-08-06T16:23:27
2019-08-13T18:17:00
2022-12-16T03:26:56
13,781
0
0
15
Java
false
false
package com.thinkbiganalytics.policy.validation; /*- * #%L * thinkbig-field-policy-default * %% * Copyright (C) 2017 ThinkBig Analytics * %% * 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 com.thinkbiganalytics.policy.PolicyProperty; import com.thinkbiganalytics.policy.PolicyPropertyRef; import com.thinkbiganalytics.policy.PolicyPropertyTypes; import com.thinkbiganalytics.policy.PropertyLabelValue; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.ISODateTimeFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Validates the value is a given timestamp */ @Validator(name = "Timestamp", description = "Validate Hive-friendly timstamp format") public class TimestampValidator implements ValidationPolicy<String> { private static final Logger log = LoggerFactory.getLogger(TimestampValidator.class); private static final DateTimeFormatter DATETIME_NANOS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSSSSSSSS"); private static final DateTimeFormatter DATETIME_MILLIS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS"); private static final DateTimeFormatter DATETIME_NOMILLIS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); private static final DateTimeFormatter DATETIME_ISO8601 = ISODateTimeFormat.dateTimeParser(); private static final int MIN_LENGTH = 19; private static final int MAX_LENGTH = 29; @PolicyProperty(name = "allowNull", value = "false", displayName = "Allow Null Values", hint = "Null values are considered to be valid", type = PolicyPropertyTypes.PROPERTY_TYPE.select, labelValues = {@PropertyLabelValue(label = "Yes", value = "true"), @PropertyLabelValue(label = "No", value = "false")}) private boolean allowNull = false; public TimestampValidator(@PolicyPropertyRef(name = "allowNull") boolean allowNull) { super(); this.allowNull = allowNull; } public TimestampValidator() { super(); } @Override public boolean validate(String value) { if (!StringUtils.isEmpty(value)) { try { parseTimestamp(value); return true; } catch (IllegalArgumentException e) { log.debug("Invalid timestamp format [{}]", value); return false; } } else { return allowNull; } } /** * Parses the string date and returns the * Sqoop treats null values as \N. */ public DateTime parseTimestamp(String value) { // Check if the value is consider a null if ((allowNull) && (value.toUpperCase().equals("NULL"))) { return new DateTime(); } int cnt = value.length(); if (cnt < MIN_LENGTH || cnt > MAX_LENGTH) { throw new IllegalArgumentException("Unexpected format"); } if (value.charAt(10) == 'T') { return DATETIME_ISO8601.parseDateTime(value); } else if (cnt == MIN_LENGTH) { return DATETIME_NOMILLIS.parseDateTime(value); } else if (cnt == MAX_LENGTH) { return DATETIME_NANOS.parseDateTime(value); } else { return DATETIME_MILLIS.parseDateTime(value); } } public boolean getAllowNull() { return allowNull; } public boolean isAllowNull() { return allowNull; } public void setAllowNull(boolean allowNull) { this.allowNull = allowNull; } }
UTF-8
Java
4,189
java
TimestampValidator.java
Java
[]
null
[]
package com.thinkbiganalytics.policy.validation; /*- * #%L * thinkbig-field-policy-default * %% * Copyright (C) 2017 ThinkBig Analytics * %% * 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 com.thinkbiganalytics.policy.PolicyProperty; import com.thinkbiganalytics.policy.PolicyPropertyRef; import com.thinkbiganalytics.policy.PolicyPropertyTypes; import com.thinkbiganalytics.policy.PropertyLabelValue; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.ISODateTimeFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Validates the value is a given timestamp */ @Validator(name = "Timestamp", description = "Validate Hive-friendly timstamp format") public class TimestampValidator implements ValidationPolicy<String> { private static final Logger log = LoggerFactory.getLogger(TimestampValidator.class); private static final DateTimeFormatter DATETIME_NANOS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSSSSSSSS"); private static final DateTimeFormatter DATETIME_MILLIS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSS"); private static final DateTimeFormatter DATETIME_NOMILLIS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); private static final DateTimeFormatter DATETIME_ISO8601 = ISODateTimeFormat.dateTimeParser(); private static final int MIN_LENGTH = 19; private static final int MAX_LENGTH = 29; @PolicyProperty(name = "allowNull", value = "false", displayName = "Allow Null Values", hint = "Null values are considered to be valid", type = PolicyPropertyTypes.PROPERTY_TYPE.select, labelValues = {@PropertyLabelValue(label = "Yes", value = "true"), @PropertyLabelValue(label = "No", value = "false")}) private boolean allowNull = false; public TimestampValidator(@PolicyPropertyRef(name = "allowNull") boolean allowNull) { super(); this.allowNull = allowNull; } public TimestampValidator() { super(); } @Override public boolean validate(String value) { if (!StringUtils.isEmpty(value)) { try { parseTimestamp(value); return true; } catch (IllegalArgumentException e) { log.debug("Invalid timestamp format [{}]", value); return false; } } else { return allowNull; } } /** * Parses the string date and returns the * Sqoop treats null values as \N. */ public DateTime parseTimestamp(String value) { // Check if the value is consider a null if ((allowNull) && (value.toUpperCase().equals("NULL"))) { return new DateTime(); } int cnt = value.length(); if (cnt < MIN_LENGTH || cnt > MAX_LENGTH) { throw new IllegalArgumentException("Unexpected format"); } if (value.charAt(10) == 'T') { return DATETIME_ISO8601.parseDateTime(value); } else if (cnt == MIN_LENGTH) { return DATETIME_NOMILLIS.parseDateTime(value); } else if (cnt == MAX_LENGTH) { return DATETIME_NANOS.parseDateTime(value); } else { return DATETIME_MILLIS.parseDateTime(value); } } public boolean getAllowNull() { return allowNull; } public boolean isAllowNull() { return allowNull; } public void setAllowNull(boolean allowNull) { this.allowNull = allowNull; } }
4,189
0.663643
0.657675
119
34.201679
30.258156
119
false
false
0
0
0
0
0
0
0.462185
false
false
2
ca6d23cbeb6ae67a029071d2c2036e6d7d712176
10,823,317,605,528
aa519697ef9b50ae57135b93bfab3e26d5a1d613
/Tractor/src/main/java/com/xworkz/tractordaoimpl/TractorDAOImpl.java
6cd1974131708ba8677aaf0ddf3091f9467d184b
[]
no_license
Prerana888/Java-program
https://github.com/Prerana888/Java-program
8a1debdd705573830206093265d3ec6df1188139
1990993d8cf867390b842e96ff12ddce65f2d3ec
refs/heads/main
2023-04-20T14:38:21.124000
2021-05-24T06:13:43
2021-05-24T06:13:43
320,166,112
0
0
null
false
2020-12-18T13:57:37
2020-12-10T05:09:34
2020-12-18T13:48:27
2020-12-18T13:57:18
6
0
0
1
Java
false
false
package com.xworkz.tractordaoimpl; import java.util.Objects; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import com.xworkz.tractordao.TractorDAO; import com.xworkz.tractordto.TractorDTO; public class TractorDAOImpl implements TractorDAO { private SessionFactory factory; public TractorDAOImpl(SessionFactory factory) { super(); this.factory = factory; } @Override public void saveTractor(TractorDTO dto) { System.out.println("invoked saveTractor"); Session session = null; Transaction transcation = null; try { session = factory.openSession(); transcation = session.beginTransaction(); session.save(dto); transcation.commit(); System.out.println("transactiondto is saved"); } catch (Exception e) { transcation.rollback(); } finally { if (Objects.nonNull(session)) { session.close(); System.out.println("closed"); } else { System.out.println("not closed"); } } } }
UTF-8
Java
1,040
java
TractorDAOImpl.java
Java
[]
null
[]
package com.xworkz.tractordaoimpl; import java.util.Objects; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import com.xworkz.tractordao.TractorDAO; import com.xworkz.tractordto.TractorDTO; public class TractorDAOImpl implements TractorDAO { private SessionFactory factory; public TractorDAOImpl(SessionFactory factory) { super(); this.factory = factory; } @Override public void saveTractor(TractorDTO dto) { System.out.println("invoked saveTractor"); Session session = null; Transaction transcation = null; try { session = factory.openSession(); transcation = session.beginTransaction(); session.save(dto); transcation.commit(); System.out.println("transactiondto is saved"); } catch (Exception e) { transcation.rollback(); } finally { if (Objects.nonNull(session)) { session.close(); System.out.println("closed"); } else { System.out.println("not closed"); } } } }
1,040
0.693269
0.693269
46
20.608696
16.878695
51
false
false
0
0
0
0
0
0
1.847826
false
false
2
75fc4e60c88fa43154e76508e99fd21325dabf8a
23,089,744,190,377
157238d6dc12e09f1579d9f6575b08cea0da56f8
/src/models/database/Database.java
788eeb5fa164831d87008adaf6641f18eb42b1c0
[]
no_license
WenHuiC/PTT_System
https://github.com/WenHuiC/PTT_System
1fc91215b83c069b22a3f07d97255124a2e5a48c
86bd66e782e069123614799e7f425f0890202d1f
refs/heads/main
2023-02-19T06:06:16.877000
2021-01-19T09:20:29
2021-01-19T09:20:29
330,924,419
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package models.database; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.json.JSONObject; import models.Model; public class Database { private static final String FILE_NAME = "model.json"; public static void save(Model model) { JSONObject jsonModel = Object2Json.model2Json(model); try (FileWriter file = new FileWriter(FILE_NAME)) { file.write(jsonModel.toString()); file.flush(); } catch (IOException e) { e.printStackTrace(); } } public static JSONObject file2Json() { String content = ""; try { content = new String(Files.readAllBytes(Paths.get(FILE_NAME))); } catch (IOException e) { e.printStackTrace(); } return new JSONObject(content); } public static Model load() { return Json2Object.json2Model(Database.file2Json()); } public static boolean isDataExist() { File file = new File(FILE_NAME); if (file.exists() && file.isFile()) { return true; } return false; } }
UTF-8
Java
1,084
java
Database.java
Java
[]
null
[]
package models.database; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.json.JSONObject; import models.Model; public class Database { private static final String FILE_NAME = "model.json"; public static void save(Model model) { JSONObject jsonModel = Object2Json.model2Json(model); try (FileWriter file = new FileWriter(FILE_NAME)) { file.write(jsonModel.toString()); file.flush(); } catch (IOException e) { e.printStackTrace(); } } public static JSONObject file2Json() { String content = ""; try { content = new String(Files.readAllBytes(Paths.get(FILE_NAME))); } catch (IOException e) { e.printStackTrace(); } return new JSONObject(content); } public static Model load() { return Json2Object.json2Model(Database.file2Json()); } public static boolean isDataExist() { File file = new File(FILE_NAME); if (file.exists() && file.isFile()) { return true; } return false; } }
1,084
0.666974
0.661439
47
22.085106
18.386894
69
false
false
0
0
0
0
0
0
0.446809
false
false
2
f438bc3d6b9bf16bbb06fea497e27b303dd36048
30,494,267,815,367
822e5b071ac4079423271ac7a9cfeb9a7e901564
/ViolateCleanCode/src/Square.java
adfbdd959a6020ad65fd66d7be471d0ab88259f7
[]
no_license
shubhamchy0201/CleanCodeModule
https://github.com/shubhamchy0201/CleanCodeModule
fa41c76e30f9c601da6f3c7bf609ff98d89b8bf6
23371a32cd68ec03780829773fa1365af3dd4ff4
refs/heads/master
2023-07-30T13:08:45.208000
2021-09-27T06:04:15
2021-09-27T06:04:15
410,745,276
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Square extends Rectangle{ //Violating Liskov-substitution principle @Override public void setBreadth(int breadth) { super.setBreadth(breadth); super.setLength(breadth); } @Override public void setLength(int length) { super.setLength(length); super.setBreadth(length); } public void getDetailsOfSquare(Square sqrt) { System.out.println("length:"+sqrt.getLength()); System.out.println("width:"+sqrt.getBreadth()); System.out.println("Area of Square:"+sqrt.getBreadth()*sqrt.getLength()); } }
UTF-8
Java
595
java
Square.java
Java
[]
null
[]
public class Square extends Rectangle{ //Violating Liskov-substitution principle @Override public void setBreadth(int breadth) { super.setBreadth(breadth); super.setLength(breadth); } @Override public void setLength(int length) { super.setLength(length); super.setBreadth(length); } public void getDetailsOfSquare(Square sqrt) { System.out.println("length:"+sqrt.getLength()); System.out.println("width:"+sqrt.getBreadth()); System.out.println("Area of Square:"+sqrt.getBreadth()*sqrt.getLength()); } }
595
0.655462
0.655462
18
32.055557
21.027685
81
false
false
0
0
0
0
0
0
0.388889
false
false
2
7f06159364b5840449a7272376e256f947d9461c
28,664,611,766,050
5a8c3d8fc443ccecda68230d20cd18b9346a9f5d
/app/src/test/java/com/dsm/iriscalendar/viewModel/LoginViewModelTests.java
074cb1875d8cd894fd96e0789b4914b27a7f1b84
[]
no_license
iriscalender/IrisCalendar
https://github.com/iriscalender/IrisCalendar
376eca2cb65d5e88906cbd0f356f71cc5e37ee7b
eed1122900552fa2c45d6a6f699b92e341701290
refs/heads/master
2020-06-29T17:35:25.467000
2019-12-01T12:19:28
2019-12-01T12:19:28
200,580,368
0
0
null
false
2019-12-01T12:19:29
2019-08-05T04:09:14
2019-11-20T00:54:08
2019-12-01T12:19:29
333
0
0
0
Java
false
false
package com.dsm.iriscalendar.viewModel; import com.dsm.iriscalendar.BaseTest; import com.dsm.iriscalendar.R; import com.dsm.iriscalendar.data.repository.login.LoginRepository; import com.dsm.iriscalendar.ui.login.LoginViewModel; import com.jraska.livedata.TestObserver; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import io.reactivex.Flowable; import static org.mockito.Mockito.when; public class LoginViewModelTests extends BaseTest { @Mock private LoginRepository loginRepository; private LoginViewModel viewModel; @Before public void init() { viewModel = new LoginViewModel(loginRepository); } @Test public void loginBtnEnableTest() { viewModel.id.setValue("ID"); viewModel.password.setValue("PASSWORD"); TestObserver.test(viewModel.isLoginEnable).assertValue(true); } @Test public void loginBtnDisableTest() { viewModel.id.setValue(""); viewModel.password.setValue("PASSWORD"); TestObserver.test(viewModel.isLoginEnable).assertValue(false); } @Test public void shortIdTest() { viewModel.id.setValue("id"); viewModel.password.setValue("PASSWORDPASSWORD"); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_short_id); } @Test public void shortPasswordTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("PAS"); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_short_password); } @Test public void loginSuccessTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("PASSWORD_PASSWORD"); assert viewModel.id.getValue() != null && viewModel.password.getValue() != null; String id = viewModel.id.getValue().trim(); String password = viewModel.password.getValue().trim(); when(loginRepository.login(id, password)).thenReturn(Flowable.just(200)); viewModel.login(); TestObserver.test(viewModel.getFinishActivityEvent()).assertHasValue(); TestObserver.test(viewModel.getIntentMainEvent()).assertHasValue(); } @Test public void invalidValueTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("PASSWORD_PASSWORD"); assert viewModel.id.getValue() != null && viewModel.password.getValue() != null; String id = viewModel.id.getValue().trim(); String password = viewModel.password.getValue().trim(); when(loginRepository.login(id, password)).thenReturn(Flowable.just(400)); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_invalid_value); } @Test public void loginFailedTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("PASSWORD_PASSWORD"); assert viewModel.id.getValue() != null && viewModel.password.getValue() != null; String id = viewModel.id.getValue().trim(); String password = viewModel.password.getValue().trim(); when(loginRepository.login(id, password)).thenReturn(Flowable.error(createHttpException())); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_server_error); } }
UTF-8
Java
3,429
java
LoginViewModelTests.java
Java
[ { "context": "Value(\"ID\");\n viewModel.password.setValue(\"PASSWORD\");\n\n TestObserver.test(viewModel.isLoginEn", "end": 794, "score": 0.9991627931594849, "start": 786, "tag": "PASSWORD", "value": "PASSWORD" }, { "context": "etValue(\"\");\n viewModel.passwor...
null
[]
package com.dsm.iriscalendar.viewModel; import com.dsm.iriscalendar.BaseTest; import com.dsm.iriscalendar.R; import com.dsm.iriscalendar.data.repository.login.LoginRepository; import com.dsm.iriscalendar.ui.login.LoginViewModel; import com.jraska.livedata.TestObserver; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import io.reactivex.Flowable; import static org.mockito.Mockito.when; public class LoginViewModelTests extends BaseTest { @Mock private LoginRepository loginRepository; private LoginViewModel viewModel; @Before public void init() { viewModel = new LoginViewModel(loginRepository); } @Test public void loginBtnEnableTest() { viewModel.id.setValue("ID"); viewModel.password.setValue("<PASSWORD>"); TestObserver.test(viewModel.isLoginEnable).assertValue(true); } @Test public void loginBtnDisableTest() { viewModel.id.setValue(""); viewModel.password.setValue("<PASSWORD>"); TestObserver.test(viewModel.isLoginEnable).assertValue(false); } @Test public void shortIdTest() { viewModel.id.setValue("id"); viewModel.password.setValue("<PASSWORD>"); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_short_id); } @Test public void shortPasswordTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("PAS"); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_short_password); } @Test public void loginSuccessTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("<PASSWORD>"); assert viewModel.id.getValue() != null && viewModel.password.getValue() != null; String id = viewModel.id.getValue().trim(); String password = viewModel.password.getValue().trim(); when(loginRepository.login(id, password)).thenReturn(Flowable.just(200)); viewModel.login(); TestObserver.test(viewModel.getFinishActivityEvent()).assertHasValue(); TestObserver.test(viewModel.getIntentMainEvent()).assertHasValue(); } @Test public void invalidValueTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("<PASSWORD>"); assert viewModel.id.getValue() != null && viewModel.password.getValue() != null; String id = viewModel.id.getValue().trim(); String password = viewModel.password.getValue().trim(); when(loginRepository.login(id, password)).thenReturn(Flowable.just(400)); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_invalid_value); } @Test public void loginFailedTest() { viewModel.id.setValue("LONG_ENOUGH_ID"); viewModel.password.setValue("<PASSWORD>"); assert viewModel.id.getValue() != null && viewModel.password.getValue() != null; String id = viewModel.id.getValue().trim(); String password = viewModel.password.getValue().trim(); when(loginRepository.login(id, password)).thenReturn(Flowable.error(createHttpException())); viewModel.login(); TestObserver.test(viewModel.getToastEvent()).assertValue(R.string.error_server_error); } }
3,406
0.684456
0.682706
112
29.616072
29.405796
100
false
false
0
0
0
0
0
0
0.5
false
false
2
6d4f87f9a7f264f9312df2b8c471d8737ae3bfd8
206,158,468,331
c9d1a6ccbe1db9ce909a130ba5cef2fb38ce1b07
/src/main/java/examples/behaviouralPatterns/strategyPattern/Main.java
7a653502f4f4e5557edb2351bec07a93c5b68d9d
[]
no_license
APoorProgrammer/portfolio
https://github.com/APoorProgrammer/portfolio
4669112b5df0dc930340a4913e1d634dfebd1a9f
13d125f9987951961268f6e4b2f89e1dc155c578
refs/heads/master
2020-03-27T13:12:36.576000
2018-11-18T09:08:54
2018-11-18T09:08:54
146,596,399
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package examples.behaviouralPatterns.strategyPattern; public class Main { public static void main(String[] args) { Gala gala = new Gala(new CR7()); gala.getTheGoldeBallTo(); gala.setGoldenBall(new Messi()); gala.getTheGoldeBallTo(); } }
UTF-8
Java
250
java
Main.java
Java
[]
null
[]
package examples.behaviouralPatterns.strategyPattern; public class Main { public static void main(String[] args) { Gala gala = new Gala(new CR7()); gala.getTheGoldeBallTo(); gala.setGoldenBall(new Messi()); gala.getTheGoldeBallTo(); } }
250
0.728
0.724
12
19.833334
18.040848
53
false
false
0
0
0
0
0
0
1.25
false
false
2
aced93b5193f47f1e7cfb1405bfc87521f0c7503
25,237,227,839,443
8e5d3e0cf1bb293e9e85c9c13c87798f80f18e51
/KameleonConverter6/trunk/src/gov/nasa/gsfc/ccmc/KameleonConverter/DatabaseInfoParser.java
6127e4ae4bf5718c415fe10968dfea1839487452
[]
no_license
ccmc/ccmc-software
https://github.com/ccmc/ccmc-software
8fc43f9fa00e44d0b4a212c1841d574a9eaf3304
0e2fb90add626f185b0b71cdb9a7b8b3b5c43266
refs/heads/master
2021-01-17T03:58:07.261000
2018-04-04T15:22:37
2018-04-04T15:22:37
40,681,189
10
7
null
true
2015-08-13T20:51:18
2015-08-13T20:51:18
2015-08-13T20:47:05
2015-08-13T20:49:55
0
0
0
0
null
null
null
/* * Name: DatabaseInfoParser.java * DatabaseInfoLine.java * * Version: 6.0 * * Author: Nitesh Donti * NASA-GSFC-CCMC (Code 587) * Intern * * Purpose: Parses the DatabaseInfo file, and calls * DatabaseInfoLine.java (a class within this * java file) for further assistance. * Checks for some specific keywords and stores * them as CCMC names/values. * Finds all other information in the DatabaseInfo * file and stores them as global variables. * * Modification History: * * Summer 2011 Donti, Nitesh * Initial Development Started * All tasks complete * Ready to use * * 08.01.2011 Berrios, David * New class made (DatbaseInfoLine.java) * Line Parser complete * Ready to use * * */ package gov.nasa.gsfc.ccmc.KameleonConverter; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import org.apache.log4j.Logger; public class DatabaseInfoParser { /** * Logger for the DatabaseInfoParser.java class. * Use Logger.info(), Logger.debug(), and Logger.error() to print * statements out within the class. */ static Logger logger = Logger.getLogger(DatabaseInfoParser.class); /** * Holds the DatabaseInfo text file */ File file; /** * Constructor for the DatabaseInfoParser class * Adds information (mostly global attributes) from the * DatabaseInfo file to the Model that is passed in * @param filename The path of the DatabaseInfo file * @param m The model object to which to add global attributes and other information * from the database info file * @throws NoAttributeException * @throws FileNotFoundException */ DatabaseInfoParser(String filename, Model m) throws NoAttributeException, FileNotFoundException{ file= new File (filename); parse(m); } /** * Parses the DatabaseInfo file and adds info to the Model * @param m * @throws NoAttributeException * @throws FileNotFoundException */ public void parse(Model m) throws NoAttributeException, FileNotFoundException{ logger.info("\n-----\n...Now Parsing Database File"); Scanner s = new Scanner(file); KAttribute temp; String[] keywords ={"run_number", "last_name", "request_date", "start_", "end_" }; String[] keys ={"run_registration_number", "generated_by", "generation_date", "start_time", "end_time"}; String line = null; while(s.hasNextLine()){ line = s.nextLine(); DatabaseInfoLine dil = new DatabaseInfoLine(line); if (dil.getName() != null) { boolean special = false; for(int i=0; i<keywords.length; i++){ if(dil.getName().startsWith(keywords[i]) && dil.getValue() !=null){ special = true; temp=m.getGlobalAttribute(keys[i]); temp.value = (dil.getValue()); } } if(!special && dil.getValue()!=null ){ //this checks to see if there is already a global attribute by that name. if not, then it will create the new global attribute. try{ m.getGlobalAttribute(dil.getName()); }catch(NoAttributeException e){ m.addGlobalAttribute(new KAttribute(dil.getName(), dil.getValue(), "", "model", "String")); } } } } m.getGlobalAttribute("terms_of_usage").value = (m.getGlobalAttribute("terms_of_usage").description); m.getGlobalAttribute("kameleon_version").value = (CommandLineInterface.KameleonVersion); System.out.println("-----"); } public class DatabaseInfoLine { /** * The name of the Global Attribute as taken * from the left side of the file */ private String name; /** * The value of the Global Attribute as taken * from the right side of the file */ private String value; public DatabaseInfoLine(String line) { String tokens[] = line.split("#"); if (tokens.length != 2) { name = null; value = null; } else { value = tokens[0].trim(); name = tokens[1].trim(); } } public String getName() { return name; } public String getValue() { return value; } //used for testing purposes public String toString() { String out = "name: " + name + " value: " + value; return out; } } }
UTF-8
Java
4,179
java
DatabaseInfoParser.java
Java
[ { "context": "seInfoLine.java\n * \n * Version: 6.0\n * \n * Author: Nitesh Donti\n * \t\t NASA-GSFC-CCMC (Code 587)\n * \t\t Intern\n", "end": 111, "score": 0.9998784065246582, "start": 99, "tag": "NAME", "value": "Nitesh Donti" }, { "context": "* \n * Modification History:\n *...
null
[]
/* * Name: DatabaseInfoParser.java * DatabaseInfoLine.java * * Version: 6.0 * * Author: <NAME> * NASA-GSFC-CCMC (Code 587) * Intern * * Purpose: Parses the DatabaseInfo file, and calls * DatabaseInfoLine.java (a class within this * java file) for further assistance. * Checks for some specific keywords and stores * them as CCMC names/values. * Finds all other information in the DatabaseInfo * file and stores them as global variables. * * Modification History: * * Summer 2011 <NAME> * Initial Development Started * All tasks complete * Ready to use * * 08.01.2011 <NAME> * New class made (DatbaseInfoLine.java) * Line Parser complete * Ready to use * * */ package gov.nasa.gsfc.ccmc.KameleonConverter; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import org.apache.log4j.Logger; public class DatabaseInfoParser { /** * Logger for the DatabaseInfoParser.java class. * Use Logger.info(), Logger.debug(), and Logger.error() to print * statements out within the class. */ static Logger logger = Logger.getLogger(DatabaseInfoParser.class); /** * Holds the DatabaseInfo text file */ File file; /** * Constructor for the DatabaseInfoParser class * Adds information (mostly global attributes) from the * DatabaseInfo file to the Model that is passed in * @param filename The path of the DatabaseInfo file * @param m The model object to which to add global attributes and other information * from the database info file * @throws NoAttributeException * @throws FileNotFoundException */ DatabaseInfoParser(String filename, Model m) throws NoAttributeException, FileNotFoundException{ file= new File (filename); parse(m); } /** * Parses the DatabaseInfo file and adds info to the Model * @param m * @throws NoAttributeException * @throws FileNotFoundException */ public void parse(Model m) throws NoAttributeException, FileNotFoundException{ logger.info("\n-----\n...Now Parsing Database File"); Scanner s = new Scanner(file); KAttribute temp; String[] keywords ={"run_number", "last_name", "request_date", "start_", "end_" }; String[] keys ={"run_registration_number", "generated_by", "generation_date", "start_time", "end_time"}; String line = null; while(s.hasNextLine()){ line = s.nextLine(); DatabaseInfoLine dil = new DatabaseInfoLine(line); if (dil.getName() != null) { boolean special = false; for(int i=0; i<keywords.length; i++){ if(dil.getName().startsWith(keywords[i]) && dil.getValue() !=null){ special = true; temp=m.getGlobalAttribute(keys[i]); temp.value = (dil.getValue()); } } if(!special && dil.getValue()!=null ){ //this checks to see if there is already a global attribute by that name. if not, then it will create the new global attribute. try{ m.getGlobalAttribute(dil.getName()); }catch(NoAttributeException e){ m.addGlobalAttribute(new KAttribute(dil.getName(), dil.getValue(), "", "model", "String")); } } } } m.getGlobalAttribute("terms_of_usage").value = (m.getGlobalAttribute("terms_of_usage").description); m.getGlobalAttribute("kameleon_version").value = (CommandLineInterface.KameleonVersion); System.out.println("-----"); } public class DatabaseInfoLine { /** * The name of the Global Attribute as taken * from the left side of the file */ private String name; /** * The value of the Global Attribute as taken * from the right side of the file */ private String value; public DatabaseInfoLine(String line) { String tokens[] = line.split("#"); if (tokens.length != 2) { name = null; value = null; } else { value = tokens[0].trim(); name = tokens[1].trim(); } } public String getName() { return name; } public String getValue() { return value; } //used for testing purposes public String toString() { String out = "name: " + name + " value: " + value; return out; } } }
4,158
0.659488
0.654224
164
24.469513
25.336136
133
false
false
0
0
0
0
0
0
2.262195
false
false
2
3a638d413d9bef1204a2e88a3c70738f9133af27
17,368,847,812,371
6c30b2578a390f8c39fdff9d7f341e5c925fdcf8
/CryptopiaClient/src/com/dusin/cryptopia/remote/data/enums/CurrencyListingStatus.java
25fb635141cf81d7653d4b0b0ac7e2e817e8531d
[ "MIT" ]
permissive
dusin-xia/cryptopia4j
https://github.com/dusin-xia/cryptopia4j
2747a82d72fe00f67cad622d0c8e55031066893a
06601b5744124a1f9d6e6e3d455cfdc1ffdcc701
refs/heads/master
2020-03-14T05:18:15.753000
2018-05-09T21:35:51
2018-05-09T21:35:51
131,461,766
0
0
null
true
2018-04-29T03:04:17
2018-04-29T03:04:16
2018-01-31T02:39:09
2017-07-07T19:00:34
27
0
0
0
null
false
null
package com.dusin.cryptopia.remote.data.enums; /** * Created by Dylan Janeke on 2017/06/22. */ public enum CurrencyListingStatus { ACTIVE("Active"), DELISTING("Delisting"); private final String label; private CurrencyListingStatus(String l) { this.label = l; } public static CurrencyListingStatus byLabel(String l) { for (CurrencyListingStatus st : values()) { if (st.label.equals(l)) { return st; } } return null; } }
UTF-8
Java
520
java
CurrencyListingStatus.java
Java
[ { "context": "in.cryptopia.remote.data.enums;\n\n/**\n * Created by Dylan Janeke on 2017/06/22.\n */\npublic enum CurrencyListingSta", "end": 79, "score": 0.9998695254325867, "start": 67, "tag": "NAME", "value": "Dylan Janeke" } ]
null
[]
package com.dusin.cryptopia.remote.data.enums; /** * Created by <NAME> on 2017/06/22. */ public enum CurrencyListingStatus { ACTIVE("Active"), DELISTING("Delisting"); private final String label; private CurrencyListingStatus(String l) { this.label = l; } public static CurrencyListingStatus byLabel(String l) { for (CurrencyListingStatus st : values()) { if (st.label.equals(l)) { return st; } } return null; } }
514
0.598077
0.582692
21
23.714285
19.021648
59
false
false
0
0
0
0
0
0
0.333333
false
false
2
48a0cb654101621c1027a08d4dbdb517e129d978
18,605,798,361,128
f46fbb27f0503b6d4a033656ddff971deb686d18
/bice/envio_nominas/EnvioNominasCORE/src/cl/bicevida/core/model/services/ws/types/actualizadatos/fasetres/ws/param/types/RetListaProfesion.java
2631fb0e40dccae8916cf4d8f29544a944bcdf34
[]
no_license
dvaldesr/acgp-repository
https://github.com/dvaldesr/acgp-repository
906bb6992cfafd215d14b6f0ffbe05eee9343547
32afb18e1074e6651482efd16eb8389d25729223
refs/heads/master
2021-01-10T12:23:20.088000
2013-04-17T13:02:33
2013-04-17T13:02:33
44,853,902
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// !DO NOT EDIT THIS FILE! // This source file is generated by Oracle tools // Contents may be subject to change // For reporting problems, use the following // Version = Oracle WebServices (10.1.3.0.0, build 060119.1546.05277) package cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types; public class RetListaProfesion implements java.io.Serializable { protected java.lang.String mensajeRetorno; protected cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types.ProfesionModel[] listaProfesion; protected java.lang.String codigoRetorno; public RetListaProfesion() { } public java.lang.String getMensajeRetorno() { return mensajeRetorno; } public void setMensajeRetorno(java.lang.String mensajeRetorno) { this.mensajeRetorno = mensajeRetorno; } public cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types.ProfesionModel[] getListaProfesion() { return listaProfesion; } public void setListaProfesion(cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types.ProfesionModel[] listaProfesion) { this.listaProfesion = listaProfesion; } public java.lang.String getCodigoRetorno() { return codigoRetorno; } public void setCodigoRetorno(java.lang.String codigoRetorno) { this.codigoRetorno = codigoRetorno; } }
UTF-8
Java
1,500
java
RetListaProfesion.java
Java
[ { "context": "e the following\r\n// Version = Oracle WebServices (10.1.3.0.0, build 060119.1546.05277)\r\n\r\npackage cl.bicevid", "end": 203, "score": 0.6864904761314392, "start": 195, "tag": "IP_ADDRESS", "value": "10.1.3.0" } ]
null
[]
// !DO NOT EDIT THIS FILE! // This source file is generated by Oracle tools // Contents may be subject to change // For reporting problems, use the following // Version = Oracle WebServices (10.1.3.0.0, build 060119.1546.05277) package cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types; public class RetListaProfesion implements java.io.Serializable { protected java.lang.String mensajeRetorno; protected cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types.ProfesionModel[] listaProfesion; protected java.lang.String codigoRetorno; public RetListaProfesion() { } public java.lang.String getMensajeRetorno() { return mensajeRetorno; } public void setMensajeRetorno(java.lang.String mensajeRetorno) { this.mensajeRetorno = mensajeRetorno; } public cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types.ProfesionModel[] getListaProfesion() { return listaProfesion; } public void setListaProfesion(cl.bicevida.core.model.services.ws.types.actualizadatos.fasetres.ws.param.types.ProfesionModel[] listaProfesion) { this.listaProfesion = listaProfesion; } public java.lang.String getCodigoRetorno() { return codigoRetorno; } public void setCodigoRetorno(java.lang.String codigoRetorno) { this.codigoRetorno = codigoRetorno; } }
1,500
0.708
0.694
41
34.585365
36.91452
148
false
false
0
0
0
0
0
0
0.292683
false
false
2
85767f726a9361644ff80bbfab1250a32f5688f0
5,738,076,320,207
e70abc02efbb8a7637eb3655f287b0a409cfa23b
/hyjf-admin/src/main/java/com/hyjf/admin/manager/activity/twoeleven2018/TwoelevenDefine.java
3e770ce9d2b022014ccbadb5146ba24d929f491a
[]
no_license
WangYouzheng1994/hyjf
https://github.com/WangYouzheng1994/hyjf
ecb221560460e30439f6915574251266c1a49042
6cbc76c109675bb1f120737f29a786fea69852fc
refs/heads/master
2023-05-12T03:29:02.563000
2020-05-19T13:49:56
2020-05-19T13:49:56
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hyjf.admin.manager.activity.twoeleven2018; import com.hyjf.admin.BaseDefine; import com.hyjf.common.util.ShiroConstants; import com.hyjf.common.util.StringPool; /** * @author xiehuili on 2018/10/10. */ public class TwoelevenDefine extends BaseDefine { /** 查看权限 */ public static final String PERMISSIONS = "activitylist"; /** FROM */ public static final String PRIZECODE_FORM = "twoelevenForm"; /** 查看权限 */ public static final String PERMISSIONS_VIEW = PERMISSIONS + StringPool.COLON + ShiroConstants.PERMISSION_VIEW; /** 权限 CONTROLLOR @RequestMapping值 */ public static final String REQUEST_MAPPING = "/manager/activity/twoeleven2018"; /** 秒杀明细列表画面 @RequestMapping值 */ public static final String INIT = "init"; /** 出借明细列表画面 @RequestMapping值 */ public static final String INVEST_INIT = "investInit"; /** 奖励明细列表画面 @RequestMapping值 */ public static final String REWARD_INIT = "rewardInit"; /** 迁移到详细画面 @RequestMapping值 */ public static final String INFO_ACTION = "infoAction"; /** 奖励明细修改 @RequestMapping值 */ public static final String UPDATE_ACTION = "updateAction"; /** 秒杀明细画面 路径 */ public static final String LIST_PATH = "manager/activity/twoeleven2018/seckill"; /** 出借明细画面 路径 */ public static final String INVEST_LIST_PATH = "manager/activity/twoeleven2018/invest"; /**奖励明细 列表画面 路径 */ public static final String REWARD_LIST_PATH = "manager/activity/twoeleven2018/reward"; /**奖励明细 修改页面 路径 */ public static final String REWARD__INFO_LIST_PATH = "manager/activity/twoeleven2018/rewardInfo"; /** 从定向 路径 */ public static final String RE_LIST_PATH = "redirect:" + REWARD_INIT; public static final String EXPORT_EXCEL_ACTION = "exportExcelAction"; public static final String EXPORT_EXCEL_INVEST_ACTION = "exportExcelInvestAction"; public static final String EXPORT_EXCEL_REWARD_ACTION = "exportExcelRewardAction"; /** * 导出权限 */ public static final String PERMISSIONS_EXPORT = PERMISSIONS + StringPool.COLON + ShiroConstants.PERMISSION_EXPORT; }
UTF-8
Java
2,304
java
TwoelevenDefine.java
Java
[ { "context": "t com.hyjf.common.util.StringPool;\n\n/**\n * @author xiehuili on 2018/10/10.\n */\npublic class TwoelevenDefine e", "end": 198, "score": 0.9994899034500122, "start": 190, "tag": "USERNAME", "value": "xiehuili" } ]
null
[]
package com.hyjf.admin.manager.activity.twoeleven2018; import com.hyjf.admin.BaseDefine; import com.hyjf.common.util.ShiroConstants; import com.hyjf.common.util.StringPool; /** * @author xiehuili on 2018/10/10. */ public class TwoelevenDefine extends BaseDefine { /** 查看权限 */ public static final String PERMISSIONS = "activitylist"; /** FROM */ public static final String PRIZECODE_FORM = "twoelevenForm"; /** 查看权限 */ public static final String PERMISSIONS_VIEW = PERMISSIONS + StringPool.COLON + ShiroConstants.PERMISSION_VIEW; /** 权限 CONTROLLOR @RequestMapping值 */ public static final String REQUEST_MAPPING = "/manager/activity/twoeleven2018"; /** 秒杀明细列表画面 @RequestMapping值 */ public static final String INIT = "init"; /** 出借明细列表画面 @RequestMapping值 */ public static final String INVEST_INIT = "investInit"; /** 奖励明细列表画面 @RequestMapping值 */ public static final String REWARD_INIT = "rewardInit"; /** 迁移到详细画面 @RequestMapping值 */ public static final String INFO_ACTION = "infoAction"; /** 奖励明细修改 @RequestMapping值 */ public static final String UPDATE_ACTION = "updateAction"; /** 秒杀明细画面 路径 */ public static final String LIST_PATH = "manager/activity/twoeleven2018/seckill"; /** 出借明细画面 路径 */ public static final String INVEST_LIST_PATH = "manager/activity/twoeleven2018/invest"; /**奖励明细 列表画面 路径 */ public static final String REWARD_LIST_PATH = "manager/activity/twoeleven2018/reward"; /**奖励明细 修改页面 路径 */ public static final String REWARD__INFO_LIST_PATH = "manager/activity/twoeleven2018/rewardInfo"; /** 从定向 路径 */ public static final String RE_LIST_PATH = "redirect:" + REWARD_INIT; public static final String EXPORT_EXCEL_ACTION = "exportExcelAction"; public static final String EXPORT_EXCEL_INVEST_ACTION = "exportExcelInvestAction"; public static final String EXPORT_EXCEL_REWARD_ACTION = "exportExcelRewardAction"; /** * 导出权限 */ public static final String PERMISSIONS_EXPORT = PERMISSIONS + StringPool.COLON + ShiroConstants.PERMISSION_EXPORT; }
2,304
0.709677
0.694497
59
34.728813
33.627991
118
false
false
0
0
0
0
0
0
0.372881
false
false
2
7f3f76e631c8514cc913b6a299acee9909683547
21,045,339,762,530
412c0251a5c739d694a44287cf15d00723995fe3
/src/main/java/com/education/hjj/bz/entity/vo/CashOutTemplateVo.java
94acc5e10acc1f07f8f1715f745846d634991eed
[]
no_license
wangsuwei110/haojiajiao
https://github.com/wangsuwei110/haojiajiao
0d6a4f544129ad1585e4bde83c2aee60405ccacf
94517d72cb4db3143d3b2835c67c1baf247f815a
refs/heads/master
2022-06-29T15:05:38.222000
2020-04-22T13:08:45
2020-04-22T13:08:45
209,914,781
2
0
null
false
2022-06-17T02:31:17
2019-09-21T02:49:19
2020-04-22T13:09:31
2022-06-17T02:31:15
1,366
2
0
6
Java
false
false
package com.education.hjj.bz.entity.vo; public class CashOutTemplateVo { // 字段值例如:keyword1:订单类型,keyword2:下单金额,keyword3:配送地址,keyword4:取件地址,keyword5备注 private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } public CashOutTemplateVo(String value) { this.value = value; } public CashOutTemplateVo() { } }
UTF-8
Java
481
java
CashOutTemplateVo.java
Java
[]
null
[]
package com.education.hjj.bz.entity.vo; public class CashOutTemplateVo { // 字段值例如:keyword1:订单类型,keyword2:下单金额,keyword3:配送地址,keyword4:取件地址,keyword5备注 private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } public CashOutTemplateVo(String value) { this.value = value; } public CashOutTemplateVo() { } }
481
0.685851
0.673861
24
15.375
19.230644
76
false
false
0
0
0
0
0
0
0.875
false
false
2
182ac0cc415520a22d19c884179eace90bd57f01
10,101,763,105,921
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_e75e41643bfddce2dd6338d90b2a0dddf00eab00/FilterAdapter/28_e75e41643bfddce2dd6338d90b2a0dddf00eab00_FilterAdapter_t.java
ac2cf79704b0991a15199a48e88fea762ddeace7
[]
no_license
zhongxingyu/Seer
https://github.com/zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516000
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
false
2023-06-22T07:55:57
2020-04-28T11:07:49
2023-06-21T00:53:27
2023-06-22T07:55:57
2,849,868
2
2
0
null
false
false
/** * See the file "LICENSE" for the full license governing this code. */ package com.todoroo.astrid.adapter; import java.util.ArrayList; import android.app.Activity; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseExpandableListAdapter; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; import android.widget.TextView; import com.timsu.astrid.R; import com.todoroo.astrid.api.FilterCategory; import com.todoroo.astrid.api.FilterListHeader; import com.todoroo.astrid.api.FilterListItem; public class FilterAdapter extends BaseExpandableListAdapter { private final ArrayList<FilterListItem> items; protected final Activity activity; public FilterAdapter(Activity activity) { super(); this.activity = activity; this.items = new ArrayList<FilterListItem>(); } public boolean hasStableIds() { return true; } public void add(FilterListItem item) { items.add(item); } /* ====================================================================== * ========================================================== child nodes * ====================================================================== */ public Object getChild(int groupPosition, int childPosition) { FilterListItem item = items.get(groupPosition); if(!(item instanceof FilterCategory)) return null; return ((FilterCategory)item).children[childPosition]; } public long getChildId(int groupPosition, int childPosition) { return childPosition; } public int getChildrenCount(int groupPosition) { FilterListItem item = items.get(groupPosition); if(!(item instanceof FilterCategory)) return 0; return ((FilterCategory)item).children.length; } public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { FilterListItem item = (FilterListItem)getChild(groupPosition, childPosition); View textView = getStandardView(item, true); return textView; } /* ====================================================================== * ========================================================= parent nodes * ====================================================================== */ public Object getGroup(int groupPosition) { return items.get(groupPosition); } public int getGroupCount() { return items.size(); } public long getGroupId(int groupPosition) { return groupPosition; } public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View view = getView((FilterListItem)getGroup(groupPosition), false, isExpanded); return view; } public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } /* ====================================================================== * ================================================================ views * ====================================================================== */ public View getView(FilterListItem item, boolean isChild, boolean isExpanded) { if(item instanceof FilterListHeader) return getHeaderView((FilterListHeader)item, isChild); else if(item instanceof FilterCategory) return getCategoryView((FilterCategory)item, isExpanded); else return getStandardView(item, isChild); } public View getCategoryView(FilterCategory filter, boolean isExpanded) { AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 64); FrameLayout layout = new FrameLayout(activity); layout.setLayoutParams(lp); ImageView image = new ImageView(activity); if(isExpanded) image.setImageResource(R.drawable.expander_ic_maximized); else image.setImageResource(R.drawable.expander_ic_minimized); FrameLayout.LayoutParams expansionImageLayout = new FrameLayout.LayoutParams( 32, 32); expansionImageLayout.gravity = Gravity.CENTER_VERTICAL; image.setLayoutParams(expansionImageLayout); image.setScaleType(ScaleType.FIT_CENTER); layout.addView(image); TextView textView = new TextView(activity); textView.setGravity(Gravity.CENTER_VERTICAL); textView.setText(filter.listingTitle); textView.setTextAppearance(activity, R.style.TextAppearance_FLA_Category); View view = augmentView(textView, filter); view.setPadding(60, 2, 0, 2); FrameLayout.LayoutParams rowLayout = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); rowLayout.gravity = Gravity.CENTER_VERTICAL; view.setLayoutParams(rowLayout); layout.addView(view); return layout; } /** * Decorate textview and add an image if the filter requests it * @param textView * @param filter * @return final view ready to be added */ private View augmentView(TextView textView, FilterListItem filter) { if(filter.listingIcon != null) { LinearLayout layout = new LinearLayout(activity); layout.setGravity(textView.getGravity()); layout.setOrientation(LinearLayout.HORIZONTAL); ImageView icon = new ImageView(activity); icon.setImageBitmap(filter.listingIcon); icon.setPadding(0, 0, 15, 0); layout.addView(icon); layout.addView(textView); return layout; } return textView; } public View getStandardView(FilterListItem filter, boolean isChild) { AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 64); TextView textView = new TextView(activity); textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); textView.setText(filter.listingTitle); textView.setTextAppearance(activity, R.style.TextAppearance_FLA_Filter); View view = augmentView(textView, filter); view.setBackgroundDrawable(null); view.setLayoutParams(lp); view.setPadding(isChild ? 50 : 10, 0, 0, 0); return view; } public View getHeaderView(FilterListHeader header, boolean isChild) { AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 40); TextView textView = new TextView(activity); textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); textView.setTextAppearance(activity, R.style.TextAppearance_FLA_Header); textView.setText(header.listingTitle); View view = augmentView(textView, header); view.setBackgroundResource(R.drawable.edit_titlebar); view.setLayoutParams(lp); view.setPadding(isChild ? 50 : 10, 0, 0, 0); return view; } }
UTF-8
Java
7,518
java
28_e75e41643bfddce2dd6338d90b2a0dddf00eab00_FilterAdapter_t.java
Java
[]
null
[]
/** * See the file "LICENSE" for the full license governing this code. */ package com.todoroo.astrid.adapter; import java.util.ArrayList; import android.app.Activity; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseExpandableListAdapter; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; import android.widget.TextView; import com.timsu.astrid.R; import com.todoroo.astrid.api.FilterCategory; import com.todoroo.astrid.api.FilterListHeader; import com.todoroo.astrid.api.FilterListItem; public class FilterAdapter extends BaseExpandableListAdapter { private final ArrayList<FilterListItem> items; protected final Activity activity; public FilterAdapter(Activity activity) { super(); this.activity = activity; this.items = new ArrayList<FilterListItem>(); } public boolean hasStableIds() { return true; } public void add(FilterListItem item) { items.add(item); } /* ====================================================================== * ========================================================== child nodes * ====================================================================== */ public Object getChild(int groupPosition, int childPosition) { FilterListItem item = items.get(groupPosition); if(!(item instanceof FilterCategory)) return null; return ((FilterCategory)item).children[childPosition]; } public long getChildId(int groupPosition, int childPosition) { return childPosition; } public int getChildrenCount(int groupPosition) { FilterListItem item = items.get(groupPosition); if(!(item instanceof FilterCategory)) return 0; return ((FilterCategory)item).children.length; } public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { FilterListItem item = (FilterListItem)getChild(groupPosition, childPosition); View textView = getStandardView(item, true); return textView; } /* ====================================================================== * ========================================================= parent nodes * ====================================================================== */ public Object getGroup(int groupPosition) { return items.get(groupPosition); } public int getGroupCount() { return items.size(); } public long getGroupId(int groupPosition) { return groupPosition; } public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View view = getView((FilterListItem)getGroup(groupPosition), false, isExpanded); return view; } public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } /* ====================================================================== * ================================================================ views * ====================================================================== */ public View getView(FilterListItem item, boolean isChild, boolean isExpanded) { if(item instanceof FilterListHeader) return getHeaderView((FilterListHeader)item, isChild); else if(item instanceof FilterCategory) return getCategoryView((FilterCategory)item, isExpanded); else return getStandardView(item, isChild); } public View getCategoryView(FilterCategory filter, boolean isExpanded) { AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 64); FrameLayout layout = new FrameLayout(activity); layout.setLayoutParams(lp); ImageView image = new ImageView(activity); if(isExpanded) image.setImageResource(R.drawable.expander_ic_maximized); else image.setImageResource(R.drawable.expander_ic_minimized); FrameLayout.LayoutParams expansionImageLayout = new FrameLayout.LayoutParams( 32, 32); expansionImageLayout.gravity = Gravity.CENTER_VERTICAL; image.setLayoutParams(expansionImageLayout); image.setScaleType(ScaleType.FIT_CENTER); layout.addView(image); TextView textView = new TextView(activity); textView.setGravity(Gravity.CENTER_VERTICAL); textView.setText(filter.listingTitle); textView.setTextAppearance(activity, R.style.TextAppearance_FLA_Category); View view = augmentView(textView, filter); view.setPadding(60, 2, 0, 2); FrameLayout.LayoutParams rowLayout = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); rowLayout.gravity = Gravity.CENTER_VERTICAL; view.setLayoutParams(rowLayout); layout.addView(view); return layout; } /** * Decorate textview and add an image if the filter requests it * @param textView * @param filter * @return final view ready to be added */ private View augmentView(TextView textView, FilterListItem filter) { if(filter.listingIcon != null) { LinearLayout layout = new LinearLayout(activity); layout.setGravity(textView.getGravity()); layout.setOrientation(LinearLayout.HORIZONTAL); ImageView icon = new ImageView(activity); icon.setImageBitmap(filter.listingIcon); icon.setPadding(0, 0, 15, 0); layout.addView(icon); layout.addView(textView); return layout; } return textView; } public View getStandardView(FilterListItem filter, boolean isChild) { AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 64); TextView textView = new TextView(activity); textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); textView.setText(filter.listingTitle); textView.setTextAppearance(activity, R.style.TextAppearance_FLA_Filter); View view = augmentView(textView, filter); view.setBackgroundDrawable(null); view.setLayoutParams(lp); view.setPadding(isChild ? 50 : 10, 0, 0, 0); return view; } public View getHeaderView(FilterListHeader header, boolean isChild) { AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 40); TextView textView = new TextView(activity); textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); textView.setTextAppearance(activity, R.style.TextAppearance_FLA_Header); textView.setText(header.listingTitle); View view = augmentView(textView, header); view.setBackgroundResource(R.drawable.edit_titlebar); view.setLayoutParams(lp); view.setPadding(isChild ? 50 : 10, 0, 0, 0); return view; } }
7,518
0.601889
0.597233
205
35.668293
27.318487
89
false
false
0
0
0
0
71
0.064778
0.697561
false
false
2
7f302d41e25d05b961311cbb876e9c94f09f4372
36,266,703,856,409
44bfbe7015644f9c9d867276f4b91bed58002f1b
/src/main/java/lib/Logger.java
e0dc6c81b9d91b9ad8e5d9af224f3beb4e46ccee
[]
no_license
andrezsegovia/javaJobLogger
https://github.com/andrezsegovia/javaJobLogger
42fb7f72dd605acc533991e6cdf161ec4b27aebf
a62ac47e9f4fdf9025df6a0fbf30a98f93ee5ed5
refs/heads/master
2022-07-08T16:28:17.115000
2020-03-05T14:10:44
2020-03-05T14:10:44
244,998,465
1
0
null
false
2022-06-21T02:55:11
2020-03-04T20:34:54
2020-03-05T14:11:09
2022-06-21T02:55:10
137
0
0
3
Java
false
false
package lib; import lib.entity.Log; public interface Logger { void write(Log log) throws Exception; }
UTF-8
Java
108
java
Logger.java
Java
[]
null
[]
package lib; import lib.entity.Log; public interface Logger { void write(Log log) throws Exception; }
108
0.731481
0.731481
7
14.428572
14.529351
41
false
false
0
0
0
0
0
0
0.428571
false
false
2
f0f7da4ad2f57a4083a5fb646cb798a2b72e760d
35,974,646,083,656
3e6fdb585dce6f94f4d7fabd4ff6160892970d44
/app/src/main/java/com/example/overmind/IndexesMatrixBuilder.java
b708d78348d1f121e71e9cb8dc672c1deab0d581
[]
no_license
fairfriend92/OvermindClient
https://github.com/fairfriend92/OvermindClient
a4142cd1160588ef619910800b8a94dfa4c7d72a
9cd27afb46c7d1d1b6d01fdfd9e0557ee81d6773
refs/heads/master
2023-04-24T00:15:48.173000
2021-05-12T09:43:46
2021-05-12T09:43:46
75,747,222
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.overmind; import android.util.Log; import java.util.ArrayList; /** * Simple class that groups together the two matrices to pass them to a different class. */ class IndexesMatrices { int[][] indexesMatrix; int[][] neuronsMatrix; IndexesMatrices(int[][] indexesMatrix, int[][] neuronsMatrix) { this.indexesMatrix = indexesMatrix; this.neuronsMatrix = neuronsMatrix; } } /** * Class that contains the necessary methods to build the matrix of the synaptic indexes and that * of the neuron indexes. The entries of the first tell which input the synapse is connected to. * The entries of the second one tells to which neuron the synapse belongs. * * Consequently both the matrix have as many entries as synapses. */ class IndexesMatrixBuilder { private Terminal terminal = null; private int[] tmpIndexes, tmpNeurons; /** * Build a matrix whose rows are collections of indexes which give synapses access to the right * inputs. The indexes are repeated for every neuron, even if the neurons of the same population * have the same synapses (but different weights) and therefore the same inputs. * * Additionally create a matrix with as many elements as synapses in which every entry tells to * which neuron the respective synapse belongs. * * @param terminal This physical terminal * @return A matrix of the indexes that the synapses use to access the right input */ IndexesMatrices buildIndexesMatrix(Terminal terminal) { this.terminal = terminal; Population[][] popsMatrix = terminal.popsMatrix; int[][] indexesMatrix = new int[popsMatrix.length][]; int[][] neuronsMatrix = new int[popsMatrix.length][]; // Iterate over the layers for (int i = 0; i < popsMatrix.length; i++) { int rowLength = 0; indexesMatrix[i] = new int[0]; neuronsMatrix[i] = new int[0]; // Iterate over the populations belonging to a given layer for (int j = 0; j < popsMatrix[i].length; j++) { // Get the needed info about the inputs of population (i, j) ArrayList<int[]> inputsInfo = getInputsInfo(i, j, popsMatrix); // Build the collection of indexes for population (i, j) fillArrays(inputsInfo, popsMatrix[i][j].numOfNeurons); // Update the length of the collection of indexes for this layer rowLength += tmpIndexes.length; /* Copy the collection of indexes for population j of layer i into the collection of all the indexes of layer i */ int[] newIndexes = new int[rowLength]; int[] newNeurons = new int[rowLength]; System.arraycopy(indexesMatrix[i], 0, newIndexes, 0, indexesMatrix[i].length); System.arraycopy(tmpIndexes, 0, newIndexes, indexesMatrix[i].length, tmpIndexes.length); indexesMatrix[i] = newIndexes; System.arraycopy(neuronsMatrix[i], 0, newNeurons, 0, neuronsMatrix[i].length); System.arraycopy(tmpNeurons, 0, newNeurons, neuronsMatrix[i].length, tmpNeurons.length); neuronsMatrix[i] = newNeurons; } } // For debugging purposes print on the terminal all the indexes sequentially //printMatrix(indexesMatrix); //printMatrix(neuronsMatrix); return new IndexesMatrices(indexesMatrix, neuronsMatrix); } /** * Prints on the terminal all the indexes sequentially. For debugging purposes. * @param matrix The collections of all the indexes */ private void printMatrix(int[][] matrix) { for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; j++) { Log.d("IndexesMatrixBuilder", "Element " + matrix[i][j] + " layer " + i + " synapse " + j); } Log.d(" IndexesMatrixBuilder", " "); } } /** * Get the information about the inputs of a given population needed to build the collection of * indexes. These information are the number of neurons of the input and its offset, that is to * say how many neurons come before those of the inputs. * * The input neurons are to be stored sequentially in a memory buffer, following the order with * which the populations appear in the matrix, from left to right and from up to down. * Presynaptic terminals are going to be included as well at the beginning of the memory buffer * * @param row The row of the population whose inputs must be inspected * @param column The column * @param matrix The matrix of the populations * @return Array containing couples of integer, the first one of which is the numbers of * neurons of the inputs and the second one their offsets */ private ArrayList<int[]> getInputsInfo(int row, int column, Population[][] matrix) { Population pop = matrix[row][column]; ArrayList<int[]> inputsInfo = new ArrayList<>(); int offset = 0; // Is any of the inputs a presynaptic terminal? for (Terminal presynTerminal : terminal.presynapticTerminals) { if (pop.inputIndexes.contains(presynTerminal.id)) { int[] info = new int[2]; info[0] = presynTerminal.numOfNeurons; info[1] = offset; inputsInfo.add(info); } // Even if an input was not found the offset should be incremented because an input may // be found later and the populations as well as the synaptic terminals are stored // sequentially one after the other offset += presynTerminal.numOfNeurons; } // Is any of the inputs a population? for (int i = 0; i < row; i++) { for (int j = 0; j < matrix[i].length; j++) { if (pop.inputIndexes.contains(matrix[i][j].id)) { int[] info = new int[2]; info[0] = matrix[i][j].numOfNeurons; info[1] = offset; inputsInfo.add(info); } offset += matrix[i][j].numOfNeurons; } } return inputsInfo; } /** * Create an array of indexes. Each index is a number which tells the position of the respective * input in the memory buffer. Every neuron of a given population has the same array of indexes, * however the indexes are copied repeatedly until they span all the inputs of all the neurons * of a population. * * This is made necessary by the fact that the OpenCL kernel are not aware of how neurons are * grouped into populations. * * Also, create an array whose elements are neurons index. For each synapse an element is created. * The value of said element tells to which neuron the synapse belongs. * * @param inputsInfo: An array of couples of integer, representing respectively the number of * neurons and the offset of a given input. * @param numOfNeurons: The number of neurons of the population for which the array is being * built. */ private void fillArrays(ArrayList<int[]> inputsInfo, int numOfNeurons) { int[] indexes = new int[0]; // This indexes count all the synapses that have been considered int j = 0; // Iterate over the inputs of the population for (int[] info : inputsInfo) { int numOfSynapses = info[0], offset = info[1]; // Array which is going to contain only the indexes for the current input int[] tmpIndexes = new int[numOfSynapses]; // Populate the array for the current input for (int i = 0; i < numOfSynapses; i++) { tmpIndexes[i] = i + offset; } j += numOfSynapses; /* Put together all the arrays that have been built up until this point for the population */ int[] newIndexes = new int[j]; System.arraycopy(indexes, 0, newIndexes, 0, indexes.length); System.arraycopy(tmpIndexes, 0, newIndexes, indexes.length, tmpIndexes.length); indexes = newIndexes; } /* Once the array of indexes has been created for one neuron, copy it as many times as necessary to cover the connections of all the neurons of the population. Also populate the array of neurons with the index of the neuron to which the respective synapse belongs */ tmpIndexes = new int[indexes.length * numOfNeurons]; tmpNeurons = new int[indexes.length * numOfNeurons]; for (int i = 0; i < numOfNeurons; i++) { System.arraycopy(indexes, 0, tmpIndexes, i * indexes.length, indexes.length); for (j = i * indexes.length; j < (i + 1) * indexes.length; j++) tmpNeurons[j] = i; } } }
UTF-8
Java
9,134
java
IndexesMatrixBuilder.java
Java
[]
null
[]
package com.example.overmind; import android.util.Log; import java.util.ArrayList; /** * Simple class that groups together the two matrices to pass them to a different class. */ class IndexesMatrices { int[][] indexesMatrix; int[][] neuronsMatrix; IndexesMatrices(int[][] indexesMatrix, int[][] neuronsMatrix) { this.indexesMatrix = indexesMatrix; this.neuronsMatrix = neuronsMatrix; } } /** * Class that contains the necessary methods to build the matrix of the synaptic indexes and that * of the neuron indexes. The entries of the first tell which input the synapse is connected to. * The entries of the second one tells to which neuron the synapse belongs. * * Consequently both the matrix have as many entries as synapses. */ class IndexesMatrixBuilder { private Terminal terminal = null; private int[] tmpIndexes, tmpNeurons; /** * Build a matrix whose rows are collections of indexes which give synapses access to the right * inputs. The indexes are repeated for every neuron, even if the neurons of the same population * have the same synapses (but different weights) and therefore the same inputs. * * Additionally create a matrix with as many elements as synapses in which every entry tells to * which neuron the respective synapse belongs. * * @param terminal This physical terminal * @return A matrix of the indexes that the synapses use to access the right input */ IndexesMatrices buildIndexesMatrix(Terminal terminal) { this.terminal = terminal; Population[][] popsMatrix = terminal.popsMatrix; int[][] indexesMatrix = new int[popsMatrix.length][]; int[][] neuronsMatrix = new int[popsMatrix.length][]; // Iterate over the layers for (int i = 0; i < popsMatrix.length; i++) { int rowLength = 0; indexesMatrix[i] = new int[0]; neuronsMatrix[i] = new int[0]; // Iterate over the populations belonging to a given layer for (int j = 0; j < popsMatrix[i].length; j++) { // Get the needed info about the inputs of population (i, j) ArrayList<int[]> inputsInfo = getInputsInfo(i, j, popsMatrix); // Build the collection of indexes for population (i, j) fillArrays(inputsInfo, popsMatrix[i][j].numOfNeurons); // Update the length of the collection of indexes for this layer rowLength += tmpIndexes.length; /* Copy the collection of indexes for population j of layer i into the collection of all the indexes of layer i */ int[] newIndexes = new int[rowLength]; int[] newNeurons = new int[rowLength]; System.arraycopy(indexesMatrix[i], 0, newIndexes, 0, indexesMatrix[i].length); System.arraycopy(tmpIndexes, 0, newIndexes, indexesMatrix[i].length, tmpIndexes.length); indexesMatrix[i] = newIndexes; System.arraycopy(neuronsMatrix[i], 0, newNeurons, 0, neuronsMatrix[i].length); System.arraycopy(tmpNeurons, 0, newNeurons, neuronsMatrix[i].length, tmpNeurons.length); neuronsMatrix[i] = newNeurons; } } // For debugging purposes print on the terminal all the indexes sequentially //printMatrix(indexesMatrix); //printMatrix(neuronsMatrix); return new IndexesMatrices(indexesMatrix, neuronsMatrix); } /** * Prints on the terminal all the indexes sequentially. For debugging purposes. * @param matrix The collections of all the indexes */ private void printMatrix(int[][] matrix) { for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; j++) { Log.d("IndexesMatrixBuilder", "Element " + matrix[i][j] + " layer " + i + " synapse " + j); } Log.d(" IndexesMatrixBuilder", " "); } } /** * Get the information about the inputs of a given population needed to build the collection of * indexes. These information are the number of neurons of the input and its offset, that is to * say how many neurons come before those of the inputs. * * The input neurons are to be stored sequentially in a memory buffer, following the order with * which the populations appear in the matrix, from left to right and from up to down. * Presynaptic terminals are going to be included as well at the beginning of the memory buffer * * @param row The row of the population whose inputs must be inspected * @param column The column * @param matrix The matrix of the populations * @return Array containing couples of integer, the first one of which is the numbers of * neurons of the inputs and the second one their offsets */ private ArrayList<int[]> getInputsInfo(int row, int column, Population[][] matrix) { Population pop = matrix[row][column]; ArrayList<int[]> inputsInfo = new ArrayList<>(); int offset = 0; // Is any of the inputs a presynaptic terminal? for (Terminal presynTerminal : terminal.presynapticTerminals) { if (pop.inputIndexes.contains(presynTerminal.id)) { int[] info = new int[2]; info[0] = presynTerminal.numOfNeurons; info[1] = offset; inputsInfo.add(info); } // Even if an input was not found the offset should be incremented because an input may // be found later and the populations as well as the synaptic terminals are stored // sequentially one after the other offset += presynTerminal.numOfNeurons; } // Is any of the inputs a population? for (int i = 0; i < row; i++) { for (int j = 0; j < matrix[i].length; j++) { if (pop.inputIndexes.contains(matrix[i][j].id)) { int[] info = new int[2]; info[0] = matrix[i][j].numOfNeurons; info[1] = offset; inputsInfo.add(info); } offset += matrix[i][j].numOfNeurons; } } return inputsInfo; } /** * Create an array of indexes. Each index is a number which tells the position of the respective * input in the memory buffer. Every neuron of a given population has the same array of indexes, * however the indexes are copied repeatedly until they span all the inputs of all the neurons * of a population. * * This is made necessary by the fact that the OpenCL kernel are not aware of how neurons are * grouped into populations. * * Also, create an array whose elements are neurons index. For each synapse an element is created. * The value of said element tells to which neuron the synapse belongs. * * @param inputsInfo: An array of couples of integer, representing respectively the number of * neurons and the offset of a given input. * @param numOfNeurons: The number of neurons of the population for which the array is being * built. */ private void fillArrays(ArrayList<int[]> inputsInfo, int numOfNeurons) { int[] indexes = new int[0]; // This indexes count all the synapses that have been considered int j = 0; // Iterate over the inputs of the population for (int[] info : inputsInfo) { int numOfSynapses = info[0], offset = info[1]; // Array which is going to contain only the indexes for the current input int[] tmpIndexes = new int[numOfSynapses]; // Populate the array for the current input for (int i = 0; i < numOfSynapses; i++) { tmpIndexes[i] = i + offset; } j += numOfSynapses; /* Put together all the arrays that have been built up until this point for the population */ int[] newIndexes = new int[j]; System.arraycopy(indexes, 0, newIndexes, 0, indexes.length); System.arraycopy(tmpIndexes, 0, newIndexes, indexes.length, tmpIndexes.length); indexes = newIndexes; } /* Once the array of indexes has been created for one neuron, copy it as many times as necessary to cover the connections of all the neurons of the population. Also populate the array of neurons with the index of the neuron to which the respective synapse belongs */ tmpIndexes = new int[indexes.length * numOfNeurons]; tmpNeurons = new int[indexes.length * numOfNeurons]; for (int i = 0; i < numOfNeurons; i++) { System.arraycopy(indexes, 0, tmpIndexes, i * indexes.length, indexes.length); for (j = i * indexes.length; j < (i + 1) * indexes.length; j++) tmpNeurons[j] = i; } } }
9,134
0.616597
0.612984
223
39.959641
34.365005
107
false
false
0
0
0
0
0
0
0.578475
false
false
2
b2133465a5999f7567fd4d1e50f303d31e3eea3d
11,381,663,364,689
fe2ef5d33ed920aef5fc5bdd50daf5e69aa00ed4
/jsps-kaken/src/4.service/jp/go/jsps/kaken/model/IShozokuMaintenance.java
9fe337af3864be8c5ebd1d431af2d807e2259e68
[]
no_license
sensui74/legacy-project
https://github.com/sensui74/legacy-project
4502d094edbf8964f6bb9805be88f869bae8e588
ff8156ae963a5c61575ff34612c908c4ccfc219b
refs/heads/master
2020-03-17T06:28:16.650000
2016-01-08T03:46:00
2016-01-08T03:46:00
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/*====================================================================== * SYSTEM : * Source name : * Description : * * Author : Admin * Date : 2003/12/08 * * Revision history * Date Revision Author Description * *====================================================================== */ package jp.go.jsps.kaken.model; import java.util.List; import jp.go.jsps.kaken.model.exceptions.ApplicationException; import jp.go.jsps.kaken.model.exceptions.ValidationException; import jp.go.jsps.kaken.model.vo.KikanInfo; import jp.go.jsps.kaken.model.vo.ShozokuInfo; import jp.go.jsps.kaken.model.vo.ShozokuPk; import jp.go.jsps.kaken.model.vo.ShozokuSearchInfo; import jp.go.jsps.kaken.model.vo.UserInfo; import jp.go.jsps.kaken.util.Page; /** * 所属機関情報を管理を行うインターフェース。 * * ID RCSfile="$RCSfile: IShozokuMaintenance.java,v $" * Revision="$Revision: 1.1 $" * Date="$Date: 2007/06/28 02:06:49 $" */ public interface IShozokuMaintenance { //--------------------------------------------------------------------- // Static data //--------------------------------------------------------------------- /** その他の所属機関コード */ public static final String OTHER_KIKAN_CODE = "99999"; //--------------------------------------------------------------------- // Methods //--------------------------------------------------------------------- /** * 所属機関情報を新規作成する。 * 発行ルールに基づきパスワードを設定する。 * * @param userInfo 実行するユーザ情報。 * @param addInfo 作成するユーザ情報。 * @return 新規登録したユーザ情報 * @throws ApplicationException */ public ShozokuInfo insert(UserInfo userInfo,ShozokuInfo addInfo) throws ApplicationException; /** * 所属機関情報を更新する。 * @param userInfo 実行するユーザ情報。 * @param updateInfo 更新するユーザ情報。 * @throws ApplicationException */ public void update(UserInfo userInfo,ShozokuInfo updateInfo) throws ApplicationException; /** * 所属機関情報を削除する。 * @param userInfo 実行するユーザ情報。 * @param deleteInfo 削除するユーザ情報。 * @throws ApplicationException */ public void delete(UserInfo userInfo,ShozokuInfo deleteInfo) throws ApplicationException; /** * 所属機関情報を検索する。 * * @param userInfo 実行するユーザ情報。 * @param keyInfo 検索するユーザ情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public ShozokuInfo select(UserInfo userInfo,ShozokuPk pkInfo) throws ApplicationException; /** * 所属機関情報を所属機関マスタから検索する。 * * @param userInfo 実行するユーザ情報。 * @param kikanInfo 検索情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public KikanInfo select(UserInfo userInfo, KikanInfo kikanInfo) throws ApplicationException; /** * 所属機関コードをキーとして所属機関担当者を検索する。 * * @param userInfo 実行するユーザ情報。 * @param shozokuCd 検索情報。所属機関コード。 * @return 所属機関担当者の数。 * @throws ApplicationException */ public int select(UserInfo userInfo, String shozokuCd) throws ApplicationException; /** * 所属機関コードをキーとして所属機関担当者情報を検索し、所属機関担当者IDの昇順のリストを返す。 * 所属機関コードがnullまたは""の場合は、全件検索する。 * * @param userInfo 実行するユーザ情報。 * @param shozokuCd 検索情報。所属機関コード。 * @return 所属機関情報。 * @throws ApplicationException */ public List searchShozokuInfo(UserInfo userInfo, String shozokuCd) throws ApplicationException; /** * 所属機関情報を検索する。 * @param userInfo 実行するユーザ情報。 * @param searchInfo 検索情報 * @return 検索結果ページ情報 * @throws ApplicationException */ public Page search(UserInfo userInfo,ShozokuSearchInfo searchInfo) throws ApplicationException; /** * CSV出力用の所属機関情報を検索する。 * * @param userInfo 実行するユーザ情報。 * @param searchInfo 検索するユーザ情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public List searchCsvData(UserInfo userInfo,ShozokuSearchInfo searchInfo) throws ApplicationException; /** * CSV出力用の所属機関情報を検索する。(システム管理者用) * * @param userInfo 実行するユーザ情報。 * @param searchInfo 検索するユーザ情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public List searchCsvDataForSysMng(UserInfo userInfo,ShozokuSearchInfo searchInfo) throws ApplicationException; /** * 登録または更新する所属機関情報を形式チェックする。 * * @param userInfo 実行するユーザ情報 * @param insertOrUpdateInfo 登録または新規作成する所属機関情報 * @return 形式チェック後の所属機関情報 * @throws ApplicationException * @throws ValidationException 検証にエラーがあった場合。 */ public ShozokuInfo validate(UserInfo userInfo,ShozokuInfo insertOrUpdateInfo) throws ApplicationException, ValidationException; /** * パスワードを変更する。 * * @param userInfo 実行するユーザ情報 * @param pkInfo パスワードを更新する検索するユーザ主キー情報。 * @param oldPassword 更新前パスワード * @param newPassword 新しいパスワード * @return パスワードの変更に成功した場合 true 以外 false * @throws ApplicationException * @throws ValidationException 更新前パスワードが一致しない場合等、検証にエラーがあった場合。 */ public boolean changePassword(UserInfo userInfo, ShozokuPk pkInfo,String oldPassword ,String newPassword) throws ApplicationException,ValidationException; // 2005/04/20 追加 ここから---------------------------------------- // 理由 システム管理者向け機能の所属機関情報検索用 /** * 所属機関情報を検索する。 * * @param userInfo 実行するユーザ情報 * @param searchInfo 検索条件 * @return 検索結果ページ情報 * @throws ApplicationException */ public Page searchShozokuTantoList(UserInfo userInfo, ShozokuSearchInfo searchInfo) throws ApplicationException; // 追加 ここまで----------------------------------------------------- // 2005/04/21 追加 ここから---------------------------------------- // 理由 パスワード再設定処理。 /** * * @param userInfo 実行するユーザ情報 * @param pkInfo キー情報 * @return 検索結果ページ情報 * @throws ApplicationException */ public ShozokuInfo reconfigurePassword(UserInfo userInfo, ShozokuPk pkInfo) throws ApplicationException; // 追加 ここまで----------------------------------------------------- /** * 承認確認メールを送信する。 * 学振締切日の3日前の0:00に申請期限になる事業に対して、 * 申請者が所属する所属担当者に向けてメールを送信する。 * 当該申請期限の事業が存在しない場合は何も処理しない。 * @param userInfo * @throws ApplicationException */ public void sendMailShoninTsuchi(UserInfo userInfo) throws ApplicationException; }
SHIFT_JIS
Java
8,218
java
IShozokuMaintenance.java
Java
[ { "context": "ame : \n * Description : \n *\n * Author : Admin\n * Date : 2003/12/08\n *\n * Revision ", "end": 164, "score": 0.6193894743919373, "start": 159, "tag": "NAME", "value": "Admin" }, { "context": "oldPassword\t\t\t\t更新前パスワード\n\t * @param newPasswor...
null
[]
/*====================================================================== * SYSTEM : * Source name : * Description : * * Author : Admin * Date : 2003/12/08 * * Revision history * Date Revision Author Description * *====================================================================== */ package jp.go.jsps.kaken.model; import java.util.List; import jp.go.jsps.kaken.model.exceptions.ApplicationException; import jp.go.jsps.kaken.model.exceptions.ValidationException; import jp.go.jsps.kaken.model.vo.KikanInfo; import jp.go.jsps.kaken.model.vo.ShozokuInfo; import jp.go.jsps.kaken.model.vo.ShozokuPk; import jp.go.jsps.kaken.model.vo.ShozokuSearchInfo; import jp.go.jsps.kaken.model.vo.UserInfo; import jp.go.jsps.kaken.util.Page; /** * 所属機関情報を管理を行うインターフェース。 * * ID RCSfile="$RCSfile: IShozokuMaintenance.java,v $" * Revision="$Revision: 1.1 $" * Date="$Date: 2007/06/28 02:06:49 $" */ public interface IShozokuMaintenance { //--------------------------------------------------------------------- // Static data //--------------------------------------------------------------------- /** その他の所属機関コード */ public static final String OTHER_KIKAN_CODE = "99999"; //--------------------------------------------------------------------- // Methods //--------------------------------------------------------------------- /** * 所属機関情報を新規作成する。 * 発行ルールに基づきパスワードを設定する。 * * @param userInfo 実行するユーザ情報。 * @param addInfo 作成するユーザ情報。 * @return 新規登録したユーザ情報 * @throws ApplicationException */ public ShozokuInfo insert(UserInfo userInfo,ShozokuInfo addInfo) throws ApplicationException; /** * 所属機関情報を更新する。 * @param userInfo 実行するユーザ情報。 * @param updateInfo 更新するユーザ情報。 * @throws ApplicationException */ public void update(UserInfo userInfo,ShozokuInfo updateInfo) throws ApplicationException; /** * 所属機関情報を削除する。 * @param userInfo 実行するユーザ情報。 * @param deleteInfo 削除するユーザ情報。 * @throws ApplicationException */ public void delete(UserInfo userInfo,ShozokuInfo deleteInfo) throws ApplicationException; /** * 所属機関情報を検索する。 * * @param userInfo 実行するユーザ情報。 * @param keyInfo 検索するユーザ情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public ShozokuInfo select(UserInfo userInfo,ShozokuPk pkInfo) throws ApplicationException; /** * 所属機関情報を所属機関マスタから検索する。 * * @param userInfo 実行するユーザ情報。 * @param kikanInfo 検索情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public KikanInfo select(UserInfo userInfo, KikanInfo kikanInfo) throws ApplicationException; /** * 所属機関コードをキーとして所属機関担当者を検索する。 * * @param userInfo 実行するユーザ情報。 * @param shozokuCd 検索情報。所属機関コード。 * @return 所属機関担当者の数。 * @throws ApplicationException */ public int select(UserInfo userInfo, String shozokuCd) throws ApplicationException; /** * 所属機関コードをキーとして所属機関担当者情報を検索し、所属機関担当者IDの昇順のリストを返す。 * 所属機関コードがnullまたは""の場合は、全件検索する。 * * @param userInfo 実行するユーザ情報。 * @param shozokuCd 検索情報。所属機関コード。 * @return 所属機関情報。 * @throws ApplicationException */ public List searchShozokuInfo(UserInfo userInfo, String shozokuCd) throws ApplicationException; /** * 所属機関情報を検索する。 * @param userInfo 実行するユーザ情報。 * @param searchInfo 検索情報 * @return 検索結果ページ情報 * @throws ApplicationException */ public Page search(UserInfo userInfo,ShozokuSearchInfo searchInfo) throws ApplicationException; /** * CSV出力用の所属機関情報を検索する。 * * @param userInfo 実行するユーザ情報。 * @param searchInfo 検索するユーザ情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public List searchCsvData(UserInfo userInfo,ShozokuSearchInfo searchInfo) throws ApplicationException; /** * CSV出力用の所属機関情報を検索する。(システム管理者用) * * @param userInfo 実行するユーザ情報。 * @param searchInfo 検索するユーザ情報。 * @return 取得したユーザ情報 * @throws ApplicationException * @throws NoDateFoundException 対象データが見つからない場合の例外。 */ public List searchCsvDataForSysMng(UserInfo userInfo,ShozokuSearchInfo searchInfo) throws ApplicationException; /** * 登録または更新する所属機関情報を形式チェックする。 * * @param userInfo 実行するユーザ情報 * @param insertOrUpdateInfo 登録または新規作成する所属機関情報 * @return 形式チェック後の所属機関情報 * @throws ApplicationException * @throws ValidationException 検証にエラーがあった場合。 */ public ShozokuInfo validate(UserInfo userInfo,ShozokuInfo insertOrUpdateInfo) throws ApplicationException, ValidationException; /** * パスワードを変更する。 * * @param userInfo 実行するユーザ情報 * @param pkInfo パスワードを更新する検索するユーザ主キー情報。 * @param oldPassword 更新前パスワード * @param newPassword <PASSWORD>ード * @return パスワードの変更に成功した場合 true 以外 false * @throws ApplicationException * @throws ValidationException 更新前パスワードが一致しない場合等、検証にエラーがあった場合。 */ public boolean changePassword(UserInfo userInfo, ShozokuPk pkInfo,String oldPassword ,String newPassword) throws ApplicationException,ValidationException; // 2005/04/20 追加 ここから---------------------------------------- // 理由 システム管理者向け機能の所属機関情報検索用 /** * 所属機関情報を検索する。 * * @param userInfo 実行するユーザ情報 * @param searchInfo 検索条件 * @return 検索結果ページ情報 * @throws ApplicationException */ public Page searchShozokuTantoList(UserInfo userInfo, ShozokuSearchInfo searchInfo) throws ApplicationException; // 追加 ここまで----------------------------------------------------- // 2005/04/21 追加 ここから---------------------------------------- // 理由 パスワード再設定処理。 /** * * @param userInfo 実行するユーザ情報 * @param pkInfo キー情報 * @return 検索結果ページ情報 * @throws ApplicationException */ public ShozokuInfo reconfigurePassword(UserInfo userInfo, ShozokuPk pkInfo) throws ApplicationException; // 追加 ここまで----------------------------------------------------- /** * 承認確認メールを送信する。 * 学振締切日の3日前の0:00に申請期限になる事業に対して、 * 申請者が所属する所属担当者に向けてメールを送信する。 * 当該申請期限の事業が存在しない場合は何も処理しない。 * @param userInfo * @throws ApplicationException */ public void sendMailShoninTsuchi(UserInfo userInfo) throws ApplicationException; }
8,210
0.645224
0.637343
212
28.334906
25.558407
112
false
false
0
0
0
0
71
0.022676
2.004717
false
false
2
9817ab1af5530cd27216fce1d03dfc5fcabb12db
35,476,429,869,418
5b82e2f7c720c49dff236970aacd610e7c41a077
/QueryReformulation-master 2/data/processed/ToggleState.java
0a23d021633785f9a52255c05fff42748c00c7db
[]
no_license
shy942/EGITrepoOnlineVersion
https://github.com/shy942/EGITrepoOnlineVersion
4b157da0f76dc5bbf179437242d2224d782dd267
f88fb20497dcc30ff1add5fe359cbca772142b09
refs/heads/master
2021-01-20T16:04:23.509000
2016-07-21T20:43:22
2016-07-21T20:43:22
63,737,385
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/***/ package org.eclipse.jface.commands; import org.eclipse.jface.menus.IMenuStateIds; import org.eclipse.jface.preference.IPreferenceStore; /** * <p> * A piece of state storing a {@link Boolean}. * </p> * <p> * If this state is registered using {@link IMenuStateIds#STYLE}, then it will * control the presentation of the command if displayed in the menus, tool bars * or status line. * </p> * <p> * Clients may instantiate this class, but must not extend. * </p> * * @since 3.2 */ public class ToggleState extends PersistentState { /** * Constructs a new <code>ToggleState</code>. By default, the toggle is off * (e.g., <code>false</code>). */ public ToggleState() { setValue(Boolean.FALSE); } @Override public final void load(final IPreferenceStore store, final String preferenceKey) { final boolean currentValue = ((Boolean) getValue()).booleanValue(); store.setDefault(preferenceKey, currentValue); if (shouldPersist() && (store.contains(preferenceKey))) { final boolean value = store.getBoolean(preferenceKey); setValue(value ? Boolean.TRUE : Boolean.FALSE); } } @Override public final void save(final IPreferenceStore store, final String preferenceKey) { if (shouldPersist()) { final Object value = getValue(); if (value instanceof Boolean) { store.setValue(preferenceKey, ((Boolean) value).booleanValue()); } } } @Override public void setValue(final Object value) { if (!(value instanceof Boolean)) { throw new IllegalArgumentException(//$NON-NLS-1$ "ToggleState takes a Boolean as a value"); } super.setValue(value); } }
UTF-8
Java
1,765
java
ToggleState.java
Java
[]
null
[]
/***/ package org.eclipse.jface.commands; import org.eclipse.jface.menus.IMenuStateIds; import org.eclipse.jface.preference.IPreferenceStore; /** * <p> * A piece of state storing a {@link Boolean}. * </p> * <p> * If this state is registered using {@link IMenuStateIds#STYLE}, then it will * control the presentation of the command if displayed in the menus, tool bars * or status line. * </p> * <p> * Clients may instantiate this class, but must not extend. * </p> * * @since 3.2 */ public class ToggleState extends PersistentState { /** * Constructs a new <code>ToggleState</code>. By default, the toggle is off * (e.g., <code>false</code>). */ public ToggleState() { setValue(Boolean.FALSE); } @Override public final void load(final IPreferenceStore store, final String preferenceKey) { final boolean currentValue = ((Boolean) getValue()).booleanValue(); store.setDefault(preferenceKey, currentValue); if (shouldPersist() && (store.contains(preferenceKey))) { final boolean value = store.getBoolean(preferenceKey); setValue(value ? Boolean.TRUE : Boolean.FALSE); } } @Override public final void save(final IPreferenceStore store, final String preferenceKey) { if (shouldPersist()) { final Object value = getValue(); if (value instanceof Boolean) { store.setValue(preferenceKey, ((Boolean) value).booleanValue()); } } } @Override public void setValue(final Object value) { if (!(value instanceof Boolean)) { throw new IllegalArgumentException(//$NON-NLS-1$ "ToggleState takes a Boolean as a value"); } super.setValue(value); } }
1,765
0.63966
0.63796
60
28.416666
27.411854
86
false
false
0
0
0
0
0
0
0.35
false
false
2
8709ca3cf4cdbe03b56d7f029b037a26faab704a
35,476,429,869,125
0449b27138a57508872fd7a43ed157258fbca0e5
/fapi/src/main/java/com/netcraker/dragun/model/User.java
b59b7f352b673b5a449fa03c74041176e4b357b2
[]
no_license
Zhenua1256/NC_EDU_SD2_DragunZhenya
https://github.com/Zhenua1256/NC_EDU_SD2_DragunZhenya
bd6b0c8eefda9bfb92714d4793493adf4ff1882c
05682d8f171fc45de05e122be840dcddfdd9c8c7
refs/heads/master
2023-01-09T10:59:37.126000
2019-12-16T20:52:48
2019-12-16T20:52:48
213,491,976
0
0
null
false
2023-01-07T10:44:08
2019-10-07T21:39:39
2019-12-16T20:52:57
2023-01-07T10:44:07
2,055
0
0
27
Java
false
false
package com.netcraker.dragun.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; @Data @Builder @AllArgsConstructor @NoArgsConstructor // это юзерДто public class User { private Long id; private String name; private String lastName; @NotBlank private String login; @NotBlank private String password; private String role; }
UTF-8
Java
479
java
User.java
Java
[]
null
[]
package com.netcraker.dragun.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; @Data @Builder @AllArgsConstructor @NoArgsConstructor // это юзерДто public class User { private Long id; private String name; private String lastName; @NotBlank private String login; @NotBlank private String password; private String role; }
479
0.763326
0.763326
24
18.541666
11.853196
45
false
false
0
0
0
0
0
0
0.5
false
false
2
473e795695ed46c74e6fa186f0105a3abf1ef591
1,898,375,583,628
e33ef350ab9f45c2efded9fe4bd722e02d7858ea
/jbpm-gwt/jbpm-gwt-form-builder/src/main/java/org/jbpm/formbuilder/client/command/ExportFormAsXulCommand.java
6bf7df273881e393f3ceb97b5c276c008e216469
[]
no_license
javadislamirad/jbpm
https://github.com/javadislamirad/jbpm
3e950dd56c9969183950a1eede34bb7ed6d2b137
29e93c4d64bd4842b5d0097f8f6090e71212eff1
refs/heads/master
2020-12-30T18:58:16.196000
2011-07-19T21:17:20
2011-07-19T21:17:20
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.jbpm.formbuilder.client.command; public class ExportFormAsXulCommand extends ExportFormCommand { private static final String LANG = "xul"; public ExportFormAsXulCommand() { super(LANG); } }
UTF-8
Java
230
java
ExportFormAsXulCommand.java
Java
[]
null
[]
package org.jbpm.formbuilder.client.command; public class ExportFormAsXulCommand extends ExportFormCommand { private static final String LANG = "xul"; public ExportFormAsXulCommand() { super(LANG); } }
230
0.708696
0.708696
11
19.90909
22.117268
63
false
false
0
0
0
0
0
0
0.272727
false
false
2
4f829187b289f1dfbb388f96558d9bb37b7b0b4a
10,608,569,224,218
f8094a7f4fac8d9649072e6c85aad97c94b12db9
/src/school/src/main/java/com/xcj/serve/dao/impl/courseware/AgentCoursewareSelfDaoImpl.java
d85cca770e75252d56327253cca47204742d2ad9
[]
no_license
duanlizhi/xcjschool
https://github.com/duanlizhi/xcjschool
9f21b1814924b3bbeea3a07ac0f1233cb5768af4
e3ca58d67b37134829a6979fa0a75ea4e9597a45
refs/heads/master
2016-09-14T01:14:33.095000
2016-05-24T02:47:51
2016-05-24T02:47:51
59,466,079
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.xcj.serve.dao.impl.courseware; import java.util.List; import javax.annotation.Resource; import org.hibernate.Session; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; import com.xcj.common.page.Page; import com.xcj.common.util.common.StringUtil; import com.xcj.serve.base.BaseDaoImpl; import com.xcj.serve.dao.courseware.AgentCoursewareSelfDao; import com.xcj.serve.entity.courseware.AgentCoursewareSelf; import com.xcj.serve.entity.courseware.AgentCoursewareSelfTag; import com.xcj.serve.entity.vo.AgentCoursewareSelfVO; import com.xcj.serve.entity.vo.EssenceCourseVO; /** * * <dl> * <dt><span class="strong">类说明:</span></dt> * <dd>代理商代理商课程管理</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>1、分页查询代理商课程录</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月24日 下午4:32:05</dd> * </dl> * * @author zhouwei * @see {@linkplain java.lang.String } * @since 1.0 **/ @Component("agentCoursewareSelfDaoImpl") @SuppressWarnings({ "serial" }) public class AgentCoursewareSelfDaoImpl extends BaseDaoImpl implements AgentCoursewareSelfDao { @Resource private JdbcTemplate jdbcTemplate; /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>分页查询代理商课程</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>1、传递代理商课程类型,名称,页码,每页数量</dd> * <dd>2、查询代理商课程列表</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月25日 下午4:33:41</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>zhouwei</dd> </dl> * * @param {@linkplain com.xcj.common.page.Page} * @param {@linkplain com.xcj.serve.vo.UserSignVO} * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,代理商课程page * @since 1.0 * @throws DataAccessException * 数据库访问异常 */ public Page<AgentCoursewareSelfVO> getByAgentCoursewareSelfPage( Page<AgentCoursewareSelfVO> page, AgentCoursewareSelfVO agentCoursewareSelfVO) throws DataAccessException { try { String courseName = agentCoursewareSelfVO.getCourseName(); Integer agentId = agentCoursewareSelfVO.getAgentId(); Integer tagId = agentCoursewareSelfVO.getTagId(); Integer category = agentCoursewareSelfVO.getCategory(); String count = ""; String sql = ""; sql = "select acs.id as id,acs.course_number as courseNumber,acs.fault_number as faultNumber, acs.course_name as courseName, " +" acs.create_date as createDate,bcw.difficulty as difficulty,bcw.type as type "; String ss = " FROM agent_courseware_self acs LEFT JOIN agent_course_ware acw ON acs.agent_course_ware_id = acw.id " + " LEFT JOIN base_course_ware bcw ON bcw.id = acw.base_courseware_id "; //count = "select count(acs.id) as cnt "; if(tagId != null && tagId != 0) { ss = ss + " LEFT JOIN agent_courseware_self_tag acst ON acst.agent_courseware_self_id =acs.id "; } ss = ss + " WHERE acs.agent_id = 1 AND bcw.category = 1 "; if (StringUtil.isNotEmpty(courseName)) { ss = ss + " and acs.course_name like '%" + courseName + "%'"; } //count = "select count(*) from (" + sql + ") a"; if(tagId != null && tagId != 0) { ss = ss + " and acst.tag_id = " + tagId; } sql = sql + ss; count = "select count(*) from (" + sql + ") a"; sql = sql + " order by acs.id desc " + " LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql, new BeanPropertyRowMapper<AgentCoursewareSelfVO>(AgentCoursewareSelfVO.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count,Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>根据代理商课件id查询</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>2、查询班级代理商课件列表id</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月25日 下午4:33:41</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>zhouwei</dd> </dl> * * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,班级代理商课件page * @since 1.0 * @throws DataAccessException * 数据库访问异常 */ public AgentCoursewareSelf getByAgentCoursewareSelfById( AgentCoursewareSelf agentCoursewareSelf) throws DataAccessException { try { String sql = "select acs.id as id, bcw.type AS contentCourseType, acs.course_number as courseNumber, acs.course_name as courseName," + " acs.course_description as courseDescription,acs.course_credit as courseCredit," + " acs.logo as logo, acs.create_date as createDate,acs.modify_date as modifyDate," + " acs.agent_id as agentId , acs.is_home_show as isHomeShow,acs.agent_course_ware_id as agentCourseWareId," + " GROUP_CONCAT(t.id SEPARATOR ',') as tagId ,GROUP_CONCAT(t.name SEPARATOR ',') as tagName, " + " GROUP_CONCAT(acst.id SEPARATOR ',') as tagCourId from agent_courseware_self acs LEFT JOIN agent_courseware_self_tag acst ON acst.agent_courseware_self_id=acs.id" + " LEFT JOIN tag t ON t.id=acst.tag_id LEFT JOIN agent_course_ware acw ON acs.agent_course_ware_id = acw.id LEFT JOIN base_course_ware bcw ON acw.base_courseware_id = bcw.id" + " GROUP BY acs.id having acs.id=" + agentCoursewareSelf.getId(); return jdbcTemplate.query( sql, new BeanPropertyRowMapper<AgentCoursewareSelf>( AgentCoursewareSelf.class)).get(0); } catch (Exception e) { throw new RuntimeException(e); } } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>分页查询班级代理商课件(精品课程列表)</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>1、传递班级代理商课件类型,名称,页码,每页数量</dd> * <dd>2、查询班级代理商课件列表</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月25日 下午4:33:41</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>zhouwei</dd> </dl> * * @param {@linkplain com.xcj.common.page.Page} * @param {@linkplain com.xcj.serve.entity.vo.vo.AgentCoursewareSelfVO} * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,班级代理商课件page * @since 1.0 * @throws DataAccessException * 数据库访问异常 */ public Page<EssenceCourseVO> getByAgentCoursewareSelfPage( Page<EssenceCourseVO> page, EssenceCourseVO essenceCourseVO) throws DataAccessException { try { String name = essenceCourseVO.getCourseName(); Integer agentId = essenceCourseVO.getAgentId(); String sql = "select acs.id as id,acs.course_name as courseName,acs.course_number as courseNumber," + " acs.is_home_show as isHomeShow,acs.create_date as createDate,acs.agent_id as agentId," + " a.name as agentName " + " from agent_courseware_self acs LEFT JOIN agent a ON acs.agent_id=a.id where 1=1 and "; if (name != null && !name.equals("")) { sql = sql + " acs.course_name like '%" + name + "%' and "; } if (agentId != null && !agentId.equals(0)) { sql = sql + " acs.agent_id =" + agentId + " and "; } String count = "select count(*) from (" + sql + " 2=2) x"; sql = sql + " 2=2 order by acs.modify_date desc LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql, new BeanPropertyRowMapper<EssenceCourseVO>( EssenceCourseVO.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count, Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>根据代理商获取课程</dd> * </dl> * <dl><dt><span class="strong">逻辑说明:</span></dt> * <dd>1、根据代理商获取课程</dd></dl> * <dl><dt><span class="strong">创建时间:</span></dt> * <dd> 2015年9月29日 下午2:02:54</dd></dl> * <dt><span class="strong">author:</span></dt> * <dd>wu_dapeng </dd> * </dl> * @param AgentCoursewareSelf分页对象 * @param AgentCoursewareSelf对象 * @param 标签id * @return Page<AgentCoursewareSelf> * @throws DataAccessException 数据库访问异常 */ public Page<AgentCoursewareSelf> getByAgentCoursewareSelfPage(Page<AgentCoursewareSelf> page, AgentCoursewareSelf agentCoursewareSelf,Integer tagId)throws DataAccessException { try { String name = agentCoursewareSelf.getCourseName(); Integer agentId = agentCoursewareSelf.getAgentId(); String sql = "select acs.* from agent_courseware_self acs where 1=1 "; if (name != null && !name.equals("")) { sql = sql + " and acs.course_name like '%" + name + "%'"; } if (agentId != null && !agentId.equals(0)) { sql = sql + " and acs.agent_id =" + agentId ; } if (tagId != null && !tagId.equals(0)){ sql+=" and acs.id in(select agent_courseware_self_id from agent_courseware_self_tag where tag_id in(" + "select tag.id from tag where level_char like '% "+tagId+",%' or level_char like '"+tagId+",%'))"; } String count = "select count(*) from (" + sql + ") x"; sql = sql + " order by acs.modify_date desc LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql,new BeanPropertyRowMapper<AgentCoursewareSelf>(AgentCoursewareSelf.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count,Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** *<dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>主要是实现了什么功能</dd> * </dl> * <dl><dt><span class="strong">逻辑说明:</span></dt> * <dd>1、xx(处理逻辑是什么样子的)</dd> * <dd>2、xx</dd> * <dd>3、xx</dd></dl> * * <dl><dt><span class="strong">创建时间:</span></dt> * <dd> 2015年11月6日 下午1:29:49</dd></dl> * <dt><span class="strong">author:</span></dt> * <dd>su_jian </dd> * </dl> * @param <T> 对象类型 * @param entity 对象 * @see {@link org.springframework.dao.DataAccessException} * @return boolean true/false * @since 1.0 * @throws Exception XX异常 */ public AgentCoursewareSelf getByAgentIdAndCourseId(Integer agentId, String courseNumber) { Session session = this.getSession(); List<AgentCoursewareSelf> agentCoursewareSelf = session.createQuery(" from AgentCoursewareSelf as a where courseNumber=? and agentId=?") .setString(0, courseNumber) .setInteger(1, agentId).list(); if (agentCoursewareSelf.size() > 0){ return (AgentCoursewareSelf)agentCoursewareSelf.get(0); } return null; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>根据标签获取课件</dd> * </dl> * <dl><dt><span class="strong">逻辑说明:</span></dt> * <dd>1、根据标签获取课件</dd></dl> * <dl><dt><span class="strong">创建时间:</span></dt> * <dd> 2015年12月25日 下午3:23:42</dd></dl> * <dt><span class="strong">author:</span></dt> * <dd>wu_dapeng </dd> * </dl> */ public List<AgentCoursewareSelf> getListByTagId(Integer agentId,Integer tagId)throws DataAccessException{ String sql = "select DISTINCT agent_courseware_self.* from agent_courseware_self,agent_courseware_self_tag,tag " + " where agent_courseware_self.id = agent_courseware_self_tag.agent_courseware_self_id " + " and tag.id = agent_courseware_self_tag.tag_id and tag.id = ? and agent_courseware_self.agent_id = ?"; List<AgentCoursewareSelf> list = super.findByJDBC(sql, new Object[]{tagId,agentId},AgentCoursewareSelf.class); //return super.findByJDBC(sql, new Object[]{tagId,agentId},AgentCoursewareSelf.class); return list; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>考评题库分页列表</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>考评题库分页列表</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年12月27日 下午3:59:06</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>yuan_zhikang</dd> </dl> * * @param ID * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,返回学员详情 * @since 1.0 */ public Page<AgentCoursewareSelfVO> getAgentCoursewareSelfPage(Page<AgentCoursewareSelfVO> page, AgentCoursewareSelfVO agentCoursewareSelfVO) { try { String sql = "SELECT DISTINCT acs.id id, acs.course_name courseName,acs.course_number courseNumber,acs.fault_number faultNumber,sf.entry entry FROM " + "agent_courseware_self acs,sbt_fault sf WHERE acs.id = sf.course_ware_id"; String count = "SELECT count(DISTINCT acs.id) AS cnt FROM ("+ sql +") acs "; sql = sql + " order by acs.id desc " + " LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql, new BeanPropertyRowMapper<AgentCoursewareSelfVO>( AgentCoursewareSelfVO.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count,Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** * *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>根据课件id查询标签</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年2月22日 下午3:57:23</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws DataAccessException 数据库访问异常 */ @Override public List<AgentCoursewareSelfTag> getCoursewareTagsById(Integer id) throws DataAccessException { String sql = "select * from agent_courseware_self_tag where agent_courseware_self_id = ?"; List<AgentCoursewareSelfTag> list = super.findByJDBC(sql, AgentCoursewareSelfTag.class, id); return list; } /** *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>教师端给班级分配课程查询故障</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年3月10日 上午11:24:52</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws Exception XX异常 */ @Override public List<AgentCoursewareSelf> getAgentCoursewareSelfListByCoursewareId(Integer coursewareId) throws DataAccessException { StringBuffer sql = new StringBuffer(); sql.append("select DISTINCT agent_courseware_self.*,tag.id as tagId from agent_courseware_self,agent_courseware_self_tag,tag"); sql.append(" where agent_courseware_self.id = agent_courseware_self_tag.agent_courseware_self_id"); sql.append(" and agent_courseware_self_tag.tag_id = tag.id and agent_courseware_self_tag.type = 2"); sql.append(" and agent_courseware_self.agent_course_ware_id = " + coursewareId); return super.findByJDBC(sql.toString(), new Object[] {}, AgentCoursewareSelf.class); } /** *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>教师端查询热门课程</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年3月14日 下午5:34:40</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws Exception XX异常 */ @Override public List<AgentCoursewareSelf> getHotCourse() throws DataAccessException { StringBuffer sb = new StringBuffer(); sb.append("SELECT sf.`name` course_name,aaa.course_number,aaa.fault_number,aaa.modify_date,aaa.num FROM sbt_fault sf,"); sb.append("(SELECT COUNT(course_number) num,btsi.course_number,btsi.fault_number,MAX(btsi.modify_date) modify_date FROM base_total_study_info btsi"); sb.append(" GROUP BY btsi.fault_number) aaa WHERE sf.fault_number = aaa.fault_number UNION"); sb.append(" SELECT acw.name course_name,bbb.course_number,bbb.fault_number,bbb.modify_date,bbb.num FROM agent_course_ware acw,"); sb.append("(SELECT COUNT(course_number) num,btsi.course_number,btsi.fault_number,MAX(btsi.modify_date) modify_date FROM base_total_study_info btsi"); sb.append(" WHERE btsi.fault_number IS NULL GROUP BY btsi.course_number) bbb WHERE acw.course_number = bbb.course_number"); sb.append(" ORDER BY num DESC LIMIT 0,6"); List<AgentCoursewareSelf> list = super.findByJDBC(sb.toString(), new Object[]{}, AgentCoursewareSelf.class); int size = list.size(); String coursenumbers = new String(); String faultnumbers = new String(); if(size != 6) { if(size != 0) { for (AgentCoursewareSelf agentCoursewareSelf : list) { if(agentCoursewareSelf.getFaultNumber() != null) { faultnumbers += "'" + agentCoursewareSelf.getFaultNumber()+ "'" + ","; }else { coursenumbers += "'" + agentCoursewareSelf.getCourseNumber()+ "'" + ","; } } faultnumbers = faultnumbers.substring(0, faultnumbers.length()-1); if(coursenumbers.length() != 0) { coursenumbers.substring(0, coursenumbers.length()-1); } } List<AgentCoursewareSelf> agentCoursewareSelfNotInCFnumber = getAgentCoursewareSelfNotInCFnumber(coursenumbers, faultnumbers, size); if(agentCoursewareSelfNotInCFnumber != null) { for (AgentCoursewareSelf agentCoursewareSelf : agentCoursewareSelfNotInCFnumber) { list.add(agentCoursewareSelf); } } } return list; } /** *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>查询课件的coursenumber和faultnumber不在给定值的课件集合</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年3月17日 上午10:20:19</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws Exception XX异常 */ public List<AgentCoursewareSelf> getAgentCoursewareSelfNotInCFnumber(String coursenumbers,String faultnumbers,Integer size) { StringBuffer sb = new StringBuffer(); sb.append("SELECT * FROM agent_courseware_self "); if(coursenumbers != null && !coursenumbers.equals("")) { sb.append("WHERE course_number NOT IN ("+ coursenumbers +")"); if(!faultnumbers.equals("") && faultnumbers != null) { sb.append(" AND fault_number NOT IN ("+ faultnumbers +")"); } }else { if(!faultnumbers.equals("") && faultnumbers != null) { sb.append("WHERE fault_number NOT IN ("+ faultnumbers +")"); } } sb.append(" ORDER BY modify_date DESC LIMIT 0," + (6-size)); List<AgentCoursewareSelf> list = super.findByJDBC(sb.toString(), new Object[]{}, AgentCoursewareSelf.class); return list; } }
UTF-8
Java
19,649
java
AgentCoursewareSelfDaoImpl.java
Java
[ { "context": ">2015年8月24日 下午4:32:05</dd>\n * </dl>\n * \n * @author zhouwei\n * @see {@linkplain java.lang.String }\n * @since ", "end": 1049, "score": 0.9991309642791748, "start": 1042, "tag": "USERNAME", "value": "zhouwei" }, { "context": " <dt><span class=\"strong\">author:</span>...
null
[]
package com.xcj.serve.dao.impl.courseware; import java.util.List; import javax.annotation.Resource; import org.hibernate.Session; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; import com.xcj.common.page.Page; import com.xcj.common.util.common.StringUtil; import com.xcj.serve.base.BaseDaoImpl; import com.xcj.serve.dao.courseware.AgentCoursewareSelfDao; import com.xcj.serve.entity.courseware.AgentCoursewareSelf; import com.xcj.serve.entity.courseware.AgentCoursewareSelfTag; import com.xcj.serve.entity.vo.AgentCoursewareSelfVO; import com.xcj.serve.entity.vo.EssenceCourseVO; /** * * <dl> * <dt><span class="strong">类说明:</span></dt> * <dd>代理商代理商课程管理</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>1、分页查询代理商课程录</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月24日 下午4:32:05</dd> * </dl> * * @author zhouwei * @see {@linkplain java.lang.String } * @since 1.0 **/ @Component("agentCoursewareSelfDaoImpl") @SuppressWarnings({ "serial" }) public class AgentCoursewareSelfDaoImpl extends BaseDaoImpl implements AgentCoursewareSelfDao { @Resource private JdbcTemplate jdbcTemplate; /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>分页查询代理商课程</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>1、传递代理商课程类型,名称,页码,每页数量</dd> * <dd>2、查询代理商课程列表</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月25日 下午4:33:41</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>zhouwei</dd> </dl> * * @param {@linkplain com.xcj.common.page.Page} * @param {@linkplain com.xcj.serve.vo.UserSignVO} * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,代理商课程page * @since 1.0 * @throws DataAccessException * 数据库访问异常 */ public Page<AgentCoursewareSelfVO> getByAgentCoursewareSelfPage( Page<AgentCoursewareSelfVO> page, AgentCoursewareSelfVO agentCoursewareSelfVO) throws DataAccessException { try { String courseName = agentCoursewareSelfVO.getCourseName(); Integer agentId = agentCoursewareSelfVO.getAgentId(); Integer tagId = agentCoursewareSelfVO.getTagId(); Integer category = agentCoursewareSelfVO.getCategory(); String count = ""; String sql = ""; sql = "select acs.id as id,acs.course_number as courseNumber,acs.fault_number as faultNumber, acs.course_name as courseName, " +" acs.create_date as createDate,bcw.difficulty as difficulty,bcw.type as type "; String ss = " FROM agent_courseware_self acs LEFT JOIN agent_course_ware acw ON acs.agent_course_ware_id = acw.id " + " LEFT JOIN base_course_ware bcw ON bcw.id = acw.base_courseware_id "; //count = "select count(acs.id) as cnt "; if(tagId != null && tagId != 0) { ss = ss + " LEFT JOIN agent_courseware_self_tag acst ON acst.agent_courseware_self_id =acs.id "; } ss = ss + " WHERE acs.agent_id = 1 AND bcw.category = 1 "; if (StringUtil.isNotEmpty(courseName)) { ss = ss + " and acs.course_name like '%" + courseName + "%'"; } //count = "select count(*) from (" + sql + ") a"; if(tagId != null && tagId != 0) { ss = ss + " and acst.tag_id = " + tagId; } sql = sql + ss; count = "select count(*) from (" + sql + ") a"; sql = sql + " order by acs.id desc " + " LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql, new BeanPropertyRowMapper<AgentCoursewareSelfVO>(AgentCoursewareSelfVO.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count,Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>根据代理商课件id查询</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>2、查询班级代理商课件列表id</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月25日 下午4:33:41</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>zhouwei</dd> </dl> * * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,班级代理商课件page * @since 1.0 * @throws DataAccessException * 数据库访问异常 */ public AgentCoursewareSelf getByAgentCoursewareSelfById( AgentCoursewareSelf agentCoursewareSelf) throws DataAccessException { try { String sql = "select acs.id as id, bcw.type AS contentCourseType, acs.course_number as courseNumber, acs.course_name as courseName," + " acs.course_description as courseDescription,acs.course_credit as courseCredit," + " acs.logo as logo, acs.create_date as createDate,acs.modify_date as modifyDate," + " acs.agent_id as agentId , acs.is_home_show as isHomeShow,acs.agent_course_ware_id as agentCourseWareId," + " GROUP_CONCAT(t.id SEPARATOR ',') as tagId ,GROUP_CONCAT(t.name SEPARATOR ',') as tagName, " + " GROUP_CONCAT(acst.id SEPARATOR ',') as tagCourId from agent_courseware_self acs LEFT JOIN agent_courseware_self_tag acst ON acst.agent_courseware_self_id=acs.id" + " LEFT JOIN tag t ON t.id=acst.tag_id LEFT JOIN agent_course_ware acw ON acs.agent_course_ware_id = acw.id LEFT JOIN base_course_ware bcw ON acw.base_courseware_id = bcw.id" + " GROUP BY acs.id having acs.id=" + agentCoursewareSelf.getId(); return jdbcTemplate.query( sql, new BeanPropertyRowMapper<AgentCoursewareSelf>( AgentCoursewareSelf.class)).get(0); } catch (Exception e) { throw new RuntimeException(e); } } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>分页查询班级代理商课件(精品课程列表)</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>1、传递班级代理商课件类型,名称,页码,每页数量</dd> * <dd>2、查询班级代理商课件列表</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年8月25日 下午4:33:41</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>zhouwei</dd> </dl> * * @param {@linkplain com.xcj.common.page.Page} * @param {@linkplain com.xcj.serve.entity.vo.vo.AgentCoursewareSelfVO} * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,班级代理商课件page * @since 1.0 * @throws DataAccessException * 数据库访问异常 */ public Page<EssenceCourseVO> getByAgentCoursewareSelfPage( Page<EssenceCourseVO> page, EssenceCourseVO essenceCourseVO) throws DataAccessException { try { String name = essenceCourseVO.getCourseName(); Integer agentId = essenceCourseVO.getAgentId(); String sql = "select acs.id as id,acs.course_name as courseName,acs.course_number as courseNumber," + " acs.is_home_show as isHomeShow,acs.create_date as createDate,acs.agent_id as agentId," + " a.name as agentName " + " from agent_courseware_self acs LEFT JOIN agent a ON acs.agent_id=a.id where 1=1 and "; if (name != null && !name.equals("")) { sql = sql + " acs.course_name like '%" + name + "%' and "; } if (agentId != null && !agentId.equals(0)) { sql = sql + " acs.agent_id =" + agentId + " and "; } String count = "select count(*) from (" + sql + " 2=2) x"; sql = sql + " 2=2 order by acs.modify_date desc LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql, new BeanPropertyRowMapper<EssenceCourseVO>( EssenceCourseVO.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count, Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>根据代理商获取课程</dd> * </dl> * <dl><dt><span class="strong">逻辑说明:</span></dt> * <dd>1、根据代理商获取课程</dd></dl> * <dl><dt><span class="strong">创建时间:</span></dt> * <dd> 2015年9月29日 下午2:02:54</dd></dl> * <dt><span class="strong">author:</span></dt> * <dd>wu_dapeng </dd> * </dl> * @param AgentCoursewareSelf分页对象 * @param AgentCoursewareSelf对象 * @param 标签id * @return Page<AgentCoursewareSelf> * @throws DataAccessException 数据库访问异常 */ public Page<AgentCoursewareSelf> getByAgentCoursewareSelfPage(Page<AgentCoursewareSelf> page, AgentCoursewareSelf agentCoursewareSelf,Integer tagId)throws DataAccessException { try { String name = agentCoursewareSelf.getCourseName(); Integer agentId = agentCoursewareSelf.getAgentId(); String sql = "select acs.* from agent_courseware_self acs where 1=1 "; if (name != null && !name.equals("")) { sql = sql + " and acs.course_name like '%" + name + "%'"; } if (agentId != null && !agentId.equals(0)) { sql = sql + " and acs.agent_id =" + agentId ; } if (tagId != null && !tagId.equals(0)){ sql+=" and acs.id in(select agent_courseware_self_id from agent_courseware_self_tag where tag_id in(" + "select tag.id from tag where level_char like '% "+tagId+",%' or level_char like '"+tagId+",%'))"; } String count = "select count(*) from (" + sql + ") x"; sql = sql + " order by acs.modify_date desc LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql,new BeanPropertyRowMapper<AgentCoursewareSelf>(AgentCoursewareSelf.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count,Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** *<dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>主要是实现了什么功能</dd> * </dl> * <dl><dt><span class="strong">逻辑说明:</span></dt> * <dd>1、xx(处理逻辑是什么样子的)</dd> * <dd>2、xx</dd> * <dd>3、xx</dd></dl> * * <dl><dt><span class="strong">创建时间:</span></dt> * <dd> 2015年11月6日 下午1:29:49</dd></dl> * <dt><span class="strong">author:</span></dt> * <dd>su_jian </dd> * </dl> * @param <T> 对象类型 * @param entity 对象 * @see {@link org.springframework.dao.DataAccessException} * @return boolean true/false * @since 1.0 * @throws Exception XX异常 */ public AgentCoursewareSelf getByAgentIdAndCourseId(Integer agentId, String courseNumber) { Session session = this.getSession(); List<AgentCoursewareSelf> agentCoursewareSelf = session.createQuery(" from AgentCoursewareSelf as a where courseNumber=? and agentId=?") .setString(0, courseNumber) .setInteger(1, agentId).list(); if (agentCoursewareSelf.size() > 0){ return (AgentCoursewareSelf)agentCoursewareSelf.get(0); } return null; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>根据标签获取课件</dd> * </dl> * <dl><dt><span class="strong">逻辑说明:</span></dt> * <dd>1、根据标签获取课件</dd></dl> * <dl><dt><span class="strong">创建时间:</span></dt> * <dd> 2015年12月25日 下午3:23:42</dd></dl> * <dt><span class="strong">author:</span></dt> * <dd>wu_dapeng </dd> * </dl> */ public List<AgentCoursewareSelf> getListByTagId(Integer agentId,Integer tagId)throws DataAccessException{ String sql = "select DISTINCT agent_courseware_self.* from agent_courseware_self,agent_courseware_self_tag,tag " + " where agent_courseware_self.id = agent_courseware_self_tag.agent_courseware_self_id " + " and tag.id = agent_courseware_self_tag.tag_id and tag.id = ? and agent_courseware_self.agent_id = ?"; List<AgentCoursewareSelf> list = super.findByJDBC(sql, new Object[]{tagId,agentId},AgentCoursewareSelf.class); //return super.findByJDBC(sql, new Object[]{tagId,agentId},AgentCoursewareSelf.class); return list; } /** * * <dl> * <dt><span class="strong">方法说明:</span></dt> * <dd>考评题库分页列表</dd> * </dl> * <dl> * <dt><span class="strong">逻辑说明:</span></dt> * <dd>考评题库分页列表</dd> * </dl> * <dl> * <dt><span class="strong">创建时间:</span></dt> * <dd>2015年12月27日 下午3:59:06</dd> * </dl> * <dt><span class="strong">author:</span></dt> <dd>yuan_zhikang</dd> </dl> * * @param ID * @return {@linkplain com.alibaba.fastjson.JSONObject} 对象,返回学员详情 * @since 1.0 */ public Page<AgentCoursewareSelfVO> getAgentCoursewareSelfPage(Page<AgentCoursewareSelfVO> page, AgentCoursewareSelfVO agentCoursewareSelfVO) { try { String sql = "SELECT DISTINCT acs.id id, acs.course_name courseName,acs.course_number courseNumber,acs.fault_number faultNumber,sf.entry entry FROM " + "agent_courseware_self acs,sbt_fault sf WHERE acs.id = sf.course_ware_id"; String count = "SELECT count(DISTINCT acs.id) AS cnt FROM ("+ sql +") acs "; sql = sql + " order by acs.id desc " + " LIMIT " + ((page.getCurrentPage() - 1) * page.getPageSize()) + "," + page.getPageSize(); page.setResult(jdbcTemplate.query(sql, new BeanPropertyRowMapper<AgentCoursewareSelfVO>( AgentCoursewareSelfVO.class))); page.setTotalsCount(jdbcTemplate.queryForObject(count,Integer.class)); } catch (Exception e) { throw new RuntimeException(e); } return page; } /** * *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>根据课件id查询标签</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年2月22日 下午3:57:23</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws DataAccessException 数据库访问异常 */ @Override public List<AgentCoursewareSelfTag> getCoursewareTagsById(Integer id) throws DataAccessException { String sql = "select * from agent_courseware_self_tag where agent_courseware_self_id = ?"; List<AgentCoursewareSelfTag> list = super.findByJDBC(sql, AgentCoursewareSelfTag.class, id); return list; } /** *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>教师端给班级分配课程查询故障</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年3月10日 上午11:24:52</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws Exception XX异常 */ @Override public List<AgentCoursewareSelf> getAgentCoursewareSelfListByCoursewareId(Integer coursewareId) throws DataAccessException { StringBuffer sql = new StringBuffer(); sql.append("select DISTINCT agent_courseware_self.*,tag.id as tagId from agent_courseware_self,agent_courseware_self_tag,tag"); sql.append(" where agent_courseware_self.id = agent_courseware_self_tag.agent_courseware_self_id"); sql.append(" and agent_courseware_self_tag.tag_id = tag.id and agent_courseware_self_tag.type = 2"); sql.append(" and agent_courseware_self.agent_course_ware_id = " + coursewareId); return super.findByJDBC(sql.toString(), new Object[] {}, AgentCoursewareSelf.class); } /** *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>教师端查询热门课程</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年3月14日 下午5:34:40</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws Exception XX异常 */ @Override public List<AgentCoursewareSelf> getHotCourse() throws DataAccessException { StringBuffer sb = new StringBuffer(); sb.append("SELECT sf.`name` course_name,aaa.course_number,aaa.fault_number,aaa.modify_date,aaa.num FROM sbt_fault sf,"); sb.append("(SELECT COUNT(course_number) num,btsi.course_number,btsi.fault_number,MAX(btsi.modify_date) modify_date FROM base_total_study_info btsi"); sb.append(" GROUP BY btsi.fault_number) aaa WHERE sf.fault_number = aaa.fault_number UNION"); sb.append(" SELECT acw.name course_name,bbb.course_number,bbb.fault_number,bbb.modify_date,bbb.num FROM agent_course_ware acw,"); sb.append("(SELECT COUNT(course_number) num,btsi.course_number,btsi.fault_number,MAX(btsi.modify_date) modify_date FROM base_total_study_info btsi"); sb.append(" WHERE btsi.fault_number IS NULL GROUP BY btsi.course_number) bbb WHERE acw.course_number = bbb.course_number"); sb.append(" ORDER BY num DESC LIMIT 0,6"); List<AgentCoursewareSelf> list = super.findByJDBC(sb.toString(), new Object[]{}, AgentCoursewareSelf.class); int size = list.size(); String coursenumbers = new String(); String faultnumbers = new String(); if(size != 6) { if(size != 0) { for (AgentCoursewareSelf agentCoursewareSelf : list) { if(agentCoursewareSelf.getFaultNumber() != null) { faultnumbers += "'" + agentCoursewareSelf.getFaultNumber()+ "'" + ","; }else { coursenumbers += "'" + agentCoursewareSelf.getCourseNumber()+ "'" + ","; } } faultnumbers = faultnumbers.substring(0, faultnumbers.length()-1); if(coursenumbers.length() != 0) { coursenumbers.substring(0, coursenumbers.length()-1); } } List<AgentCoursewareSelf> agentCoursewareSelfNotInCFnumber = getAgentCoursewareSelfNotInCFnumber(coursenumbers, faultnumbers, size); if(agentCoursewareSelfNotInCFnumber != null) { for (AgentCoursewareSelf agentCoursewareSelf : agentCoursewareSelfNotInCFnumber) { list.add(agentCoursewareSelf); } } } return list; } /** *<dl> *<dt><span class="strong">方法说明:</span></dt> *<dd>查询课件的coursenumber和faultnumber不在给定值的课件集合</dd> *</dl> *<dl><dt><span class="strong">创建时间:</span></dt> *<dd> 2016年3月17日 上午10:20:19</dd></dl> *<dl><dt><span class="strong">author:</span></dt> *<dd> duan_lizhi</dd></dl> *</dl> *@param <T> 对象类型 *@param entity 对象 *@return boolean true/false *@throws Exception XX异常 */ public List<AgentCoursewareSelf> getAgentCoursewareSelfNotInCFnumber(String coursenumbers,String faultnumbers,Integer size) { StringBuffer sb = new StringBuffer(); sb.append("SELECT * FROM agent_courseware_self "); if(coursenumbers != null && !coursenumbers.equals("")) { sb.append("WHERE course_number NOT IN ("+ coursenumbers +")"); if(!faultnumbers.equals("") && faultnumbers != null) { sb.append(" AND fault_number NOT IN ("+ faultnumbers +")"); } }else { if(!faultnumbers.equals("") && faultnumbers != null) { sb.append("WHERE fault_number NOT IN ("+ faultnumbers +")"); } } sb.append(" ORDER BY modify_date DESC LIMIT 0," + (6-size)); List<AgentCoursewareSelf> list = super.findByJDBC(sb.toString(), new Object[]{}, AgentCoursewareSelf.class); return list; } }
19,649
0.660282
0.649112
498
36.214859
32.826977
181
false
false
0
0
0
0
0
0
2.311245
false
false
2
01462f1bc92610df345900ea0d4f63717748729f
7,258,494,794,359
192c8a47149e4f67e4e5b7b716bc5c77e99448d1
/src/Stake_Quene/MaxWindow_19.java
0e45cf089cf735a58cf4a84b3ffa71d8db9a61e3
[]
no_license
boringcc/SF
https://github.com/boringcc/SF
9ac72a6785a3d27cdb038beedd968d7258b9ab1c
ec1142ae5798adbdf2d23c1808099fb6fe47ab1b
refs/heads/master
2020-03-18T11:20:47.088000
2018-08-04T07:27:04
2018-08-04T07:27:04
134,665,437
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Stake_Quene; import java.util.LinkedList; public class MaxWindow_19 { public int[] getMaxWindow(int[] arr,int w){ if(arr == null||w<1||arr.length < w){ return null; } LinkedList<Integer> qmax = new LinkedList<Integer>(); int res[] = new int[arr.length - w + 1]; int index = 0; for (int i = 0;i < arr.length ; i++){ while (!qmax.isEmpty() && arr[qmax.peekLast()] <= arr[i]){ qmax.pollLast(); } qmax.addLast(arr[i]); if(qmax.peekFirst() == i-w){ qmax.pollFirst(); } if(i >= w-1){ res[index++] = arr[qmax.peekFirst()]; } } return res; } }
UTF-8
Java
768
java
MaxWindow_19.java
Java
[]
null
[]
package Stake_Quene; import java.util.LinkedList; public class MaxWindow_19 { public int[] getMaxWindow(int[] arr,int w){ if(arr == null||w<1||arr.length < w){ return null; } LinkedList<Integer> qmax = new LinkedList<Integer>(); int res[] = new int[arr.length - w + 1]; int index = 0; for (int i = 0;i < arr.length ; i++){ while (!qmax.isEmpty() && arr[qmax.peekLast()] <= arr[i]){ qmax.pollLast(); } qmax.addLast(arr[i]); if(qmax.peekFirst() == i-w){ qmax.pollFirst(); } if(i >= w-1){ res[index++] = arr[qmax.peekFirst()]; } } return res; } }
768
0.451823
0.442708
33
22.272728
19.907776
70
false
false
0
0
0
0
0
0
0.545455
false
false
2
6779e79eb7a4b128ccebb5543331e9363eee33f3
6,330,781,847,223
df6dd4d54b004f03ed5df65314631ebae9f55bc7
/food-delivery/src/main/java/com/reverside/sandiso/service/impl/UserServiceImpl.java
25621454ea480cdab77934fdcff3645c4f66aa63
[]
no_license
sandisompithi/food-delivery
https://github.com/sandisompithi/food-delivery
df99a06aa75142b98cea3fc18dfb9ddb5f216be8
bebc8925433d85a89e0192ea08667a41a3a38cf5
refs/heads/master
2021-02-12T10:42:03.917000
2020-06-02T10:17:35
2020-06-02T10:17:35
244,587,130
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.reverside.sandiso.service.impl; import java.util.List; import com.reverside.sandiso.repository.UserRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import com.reverside.sandiso.model.User; import com.reverside.sandiso.service.UserService; @Service public class UserServiceImpl implements UserService { private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); @Autowired private UserRepository userRepository; @Autowired private BCryptPasswordEncoder passwordEncoder; @Override public User findByUsername(String username) { return userRepository.findByUsername(username); } @Override public boolean checkUserExists(String username) { if (null != findByUsername(username)) { return true; } return false; } @Override public void save(User user) { userRepository.save(user); } @Override public User createUser(User user) { User localUser = userRepository.findByUsername(user.getSurname()); if (localUser != null) { log.info("User with username {} already exist. Nothing will be done. ", user.getSurname()); } else { String encryptedPasswordString = passwordEncoder.encode(user.getPassword()); user.setPassword(encryptedPasswordString); localUser = userRepository.save(user); } return localUser; } @Override public User saveUser(User user) { return userRepository.save(user); } @Override public List<User> findUsersList() { return userRepository.findAll(); } @Override public void enableUser(String username) { User user = findByUsername(username); user.setEnabled(true); userRepository.save(user); } @Override public void disableUser(String username) { User user = findByUsername(username); user.setEnabled(false); System.out.println(user.isEnabled()); userRepository.save(user); System.out.println(username + " is disabled."); } }
UTF-8
Java
2,167
java
UserServiceImpl.java
Java
[]
null
[]
package com.reverside.sandiso.service.impl; import java.util.List; import com.reverside.sandiso.repository.UserRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import com.reverside.sandiso.model.User; import com.reverside.sandiso.service.UserService; @Service public class UserServiceImpl implements UserService { private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); @Autowired private UserRepository userRepository; @Autowired private BCryptPasswordEncoder passwordEncoder; @Override public User findByUsername(String username) { return userRepository.findByUsername(username); } @Override public boolean checkUserExists(String username) { if (null != findByUsername(username)) { return true; } return false; } @Override public void save(User user) { userRepository.save(user); } @Override public User createUser(User user) { User localUser = userRepository.findByUsername(user.getSurname()); if (localUser != null) { log.info("User with username {} already exist. Nothing will be done. ", user.getSurname()); } else { String encryptedPasswordString = passwordEncoder.encode(user.getPassword()); user.setPassword(encryptedPasswordString); localUser = userRepository.save(user); } return localUser; } @Override public User saveUser(User user) { return userRepository.save(user); } @Override public List<User> findUsersList() { return userRepository.findAll(); } @Override public void enableUser(String username) { User user = findByUsername(username); user.setEnabled(true); userRepository.save(user); } @Override public void disableUser(String username) { User user = findByUsername(username); user.setEnabled(false); System.out.println(user.isEnabled()); userRepository.save(user); System.out.println(username + " is disabled."); } }
2,167
0.731426
0.730503
86
23.197674
22.887907
94
false
false
0
0
0
0
0
0
1.488372
false
false
2
9981f48aa105d170ed104da3120b3bb323693256
32,049,045,993,569
499344a6472136ec2287b36523e744b9f0bf5b43
/src/me/bram0101/game2d/object/CollisionObject.java
b2f67062b064b0c5d1569d39e6bf7ae9710225ad
[]
no_license
bram0101/2D-Game
https://github.com/bram0101/2D-Game
38b76a6e57c89eb2ddf9d1696af797a22dce00eb
4d4b947ebf87ec7331eff5d7cdfe206e67275902
refs/heads/master
2020-05-21T11:04:04.497000
2014-09-02T15:12:20
2014-09-02T15:12:20
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.bram0101.game2d.object; public class CollisionObject extends GameObject{ private Collision collision; public CollisionObject(int x, int y, int dx, int dy) { super(x, y, dx, dy); collision = new Collision(this); } public Collision getCollision() { return collision; } }
UTF-8
Java
298
java
CollisionObject.java
Java
[ { "context": "package me.bram0101.game2d.object;\n\npublic class CollisionObject exte", "end": 19, "score": 0.8425238728523254, "start": 13, "tag": "USERNAME", "value": "am0101" } ]
null
[]
package me.bram0101.game2d.object; public class CollisionObject extends GameObject{ private Collision collision; public CollisionObject(int x, int y, int dx, int dy) { super(x, y, dx, dy); collision = new Collision(this); } public Collision getCollision() { return collision; } }
298
0.718121
0.701342
16
17.625
18.580484
55
false
false
0
0
0
0
0
0
1.5
false
false
2
f33f4d33aa50f24688219ba9beaaa3a1002e66af
1,030,792,222,616
49b4856c8f87132b833399866726ed7ec76ac424
/app/src/main/java/ghost/ghost/Account_register.java
a536023f3b5a6058a03fc3f0009554505ce5f52e
[]
no_license
techtronics/Android
https://github.com/techtronics/Android
574439cf6a953a484f6541a18f7dad67b19673f7
fc5c8d2133727f8a5c6641f42140ce0b8569830d
refs/heads/master
2017-12-08T10:49:47.807000
2016-10-24T16:11:59
2016-10-24T16:11:59
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ghost.ghost; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import cn.bmob.sms.BmobSMS; import cn.bmob.sms.listener.RequestSMSCodeListener; import cn.bmob.v3.Bmob; import cn.bmob.v3.BmobUser; import cn.bmob.v3.exception.BmobException; import cn.bmob.v3.listener.SaveListener; /** * Created by G__Agee on 2016/10/2. */ public class Account_register extends Activity { public int namecon; public int passescon; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.acoount_register); Bmob.initialize(this,"65fb2208e4f8ed66aa49c227a0b8ca2e"); //BmobSMS.initialize(this,"65fb2208e4f8ed66aa49c227a0b8ca2e"); Button button1=(Button) findViewById(R.id.bp_back); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(Account_register.this,Login_main.class); startActivity(intent); } }); //点击返回按钮监听事件 Button button2=(Button) findViewById(R.id.login); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EditText name = (EditText) findViewById(R.id.username); EditText passwd = (EditText) findViewById(R.id.password); namecon = name.length(); passescon = passwd.length(); String login_name = name.getText().toString(); String login_passwd = passwd.getText().toString(); if (namecon == 0) { Toast.makeText(Account_register.this, "手机号为空,请输入手机号", Toast.LENGTH_SHORT).show(); } else { if (passescon == 0) { Toast.makeText(Account_register.this, "密码为空,请输入密码", Toast.LENGTH_SHORT).show(); } else { BmobUser bu = new BmobUser(); bu.setUsername(login_name); bu.setPassword(login_passwd); bu.signUp(new SaveListener<MyUser>() { @Override public void done(MyUser objectId,BmobException e) { if(e==null){ //toast("添加数据成功,返回objectId为:"+objectId); Toast.makeText(Account_register.this, "注册成功", Toast.LENGTH_LONG).show(); Intent intent=new Intent(Account_register.this,Mainhome_page.class); startActivity(intent); }else{ // toast("创建数据失败:" + e.getMessage()); Toast.makeText(Account_register.this, "注册失败", Toast.LENGTH_LONG).show(); } } }); } } } }); //点击下一步按钮监听事件 } }
UTF-8
Java
3,452
java
Account_register.java
Java
[ { "context": ".bmob.v3.listener.SaveListener;\n\n/**\n * Created by G__Agee on 2016/10/2.\n */\npublic class Account_register e", "end": 493, "score": 0.9995689392089844, "start": 486, "tag": "USERNAME", "value": "G__Agee" }, { "context": "mobUser();\n bu.setUs...
null
[]
package ghost.ghost; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import cn.bmob.sms.BmobSMS; import cn.bmob.sms.listener.RequestSMSCodeListener; import cn.bmob.v3.Bmob; import cn.bmob.v3.BmobUser; import cn.bmob.v3.exception.BmobException; import cn.bmob.v3.listener.SaveListener; /** * Created by G__Agee on 2016/10/2. */ public class Account_register extends Activity { public int namecon; public int passescon; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.acoount_register); Bmob.initialize(this,"65fb2208e4f8ed66aa49c227a0b8ca2e"); //BmobSMS.initialize(this,"65fb2208e4f8ed66aa49c227a0b8ca2e"); Button button1=(Button) findViewById(R.id.bp_back); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(Account_register.this,Login_main.class); startActivity(intent); } }); //点击返回按钮监听事件 Button button2=(Button) findViewById(R.id.login); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EditText name = (EditText) findViewById(R.id.username); EditText passwd = (EditText) findViewById(R.id.password); namecon = name.length(); passescon = passwd.length(); String login_name = name.getText().toString(); String login_passwd = passwd.getText().toString(); if (namecon == 0) { Toast.makeText(Account_register.this, "手机号为空,请输入手机号", Toast.LENGTH_SHORT).show(); } else { if (passescon == 0) { Toast.makeText(Account_register.this, "密码为空,请输入密码", Toast.LENGTH_SHORT).show(); } else { BmobUser bu = new BmobUser(); bu.setUsername(login_name); bu.setPassword(<PASSWORD>); bu.signUp(new SaveListener<MyUser>() { @Override public void done(MyUser objectId,BmobException e) { if(e==null){ //toast("添加数据成功,返回objectId为:"+objectId); Toast.makeText(Account_register.this, "注册成功", Toast.LENGTH_LONG).show(); Intent intent=new Intent(Account_register.this,Mainhome_page.class); startActivity(intent); }else{ // toast("创建数据失败:" + e.getMessage()); Toast.makeText(Account_register.this, "注册失败", Toast.LENGTH_LONG).show(); } } }); } } } }); //点击下一步按钮监听事件 } }
3,450
0.535887
0.519903
89
36.258427
27.979738
108
false
false
0
0
0
0
0
0
0.662921
false
false
2
cff93d744b1c83ecbc388ef5dc537f8b7c2d8d9b
24,429,774,046,074
f40cc04ef8e26c697091c738dc23f288eb46c0fb
/app/src/main/java/ali/naseem/quizapp/Constants.java
2eed30c18dc1923dc2ee1337324e69841b303f9c
[]
no_license
naseemali925/QuizApp
https://github.com/naseemali925/QuizApp
190990831032281747b108804967c837b07904fe
78178b2ce3c1606e634588d8dec9f99b7a43da5f
refs/heads/master
2020-04-03T16:13:56.136000
2018-10-31T20:19:45
2018-10-31T20:19:45
155,396,891
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ali.naseem.quizapp; public class Constants { ////////////Model Types////////////////////////////////// public static final int TYPE_MULTI_CHOICE=1; public static final int TYPE_SINGLE_CHOICE=2; public static final int TYPE_TEXT=3; }
UTF-8
Java
258
java
Constants.java
Java
[]
null
[]
package ali.naseem.quizapp; public class Constants { ////////////Model Types////////////////////////////////// public static final int TYPE_MULTI_CHOICE=1; public static final int TYPE_SINGLE_CHOICE=2; public static final int TYPE_TEXT=3; }
258
0.600775
0.589147
8
31.25
20.974688
61
false
false
0
0
0
0
0
0
0.5
false
false
2
46f22421dde79e0081215240e475fda5b60b4c74
266,288,003,888
68f51e8a825f208149f04c6cc9796ea2c244258c
/step7-circleservice-solution/src/main/java/com/stackroute/activitystream/repository/CircleRepository.java
432a73410ced6cf14f754f9c858ad4110c74adfa
[]
no_license
Raksha-Hegde/CapStone_Backend
https://github.com/Raksha-Hegde/CapStone_Backend
20d4f7072566de28c5e07d5d927c26ef8cbee643
4ab874cd06231325bcd9986cdc4ea603dad6856b
refs/heads/master
2020-04-02T02:18:07.438000
2018-10-20T12:53:40
2018-10-20T12:53:40
153,902,245
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.stackroute.activitystream.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.stackroute.activitystream.model.Circle; /* * This class is implementing the JpaRepository interface for Circle. * */ public interface CircleRepository extends JpaRepository<Circle, String>{ @Query("FROM Circle c where c.circleName like '%:searchString%'") List<Circle> findAll(String searchString); }
UTF-8
Java
506
java
CircleRepository.java
Java
[]
null
[]
package com.stackroute.activitystream.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.stackroute.activitystream.model.Circle; /* * This class is implementing the JpaRepository interface for Circle. * */ public interface CircleRepository extends JpaRepository<Circle, String>{ @Query("FROM Circle c where c.circleName like '%:searchString%'") List<Circle> findAll(String searchString); }
506
0.8083
0.8083
14
35.214287
27.50371
72
false
false
0
0
0
0
0
0
0.785714
false
false
2
103e12e8a43513a959c2186b51a5ec881e5a479d
20,349,555,073,027
337b9938060bd056e25341e70a87b07d328b564e
/src/test/java/hu/indicium/dev/partners/PartnerApiApplicationTests.java
58693b753e66d0875b58da5186bffb2380250dd3
[]
no_license
svIndicium/partner-api
https://github.com/svIndicium/partner-api
f208400b3d66806456a12f7a606ebea5be432647
0aa7ec56a55ca56f41c6512ad25e79b585288b2a
refs/heads/master
2023-06-18T04:19:59.914000
2021-07-12T14:19:52
2021-07-12T14:19:52
377,415,327
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hu.indicium.dev.partners; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class PartnerApiApplicationTests { @Test void contextLoads() { } }
UTF-8
Java
220
java
PartnerApiApplicationTests.java
Java
[]
null
[]
package hu.indicium.dev.partners; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class PartnerApiApplicationTests { @Test void contextLoads() { } }
220
0.790909
0.790909
13
15.923077
18.511791
60
false
false
0
0
0
0
0
0
0.461538
false
false
2
15d67091700cb9967e0c91c096ab7b84ed743786
9,131,100,502,099
a68a450c6a95b210a3a8b1fe3bc791717922ceb2
/src/estructura/Comunicable.java
a70c230dc676cb6fd23253c8b894cb5f6ce1430a
[]
no_license
Kyuoraku/Concesionaria
https://github.com/Kyuoraku/Concesionaria
b0ed9e56d5ef023e745573ff2dbb3cc1b2204a88
5cf85e12a38147e9db5a7edb989cd7dbe2d10333
refs/heads/master
2020-06-10T06:08:24.388000
2019-06-25T03:17:03
2019-06-25T03:17:03
193,604,614
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package estructura; public interface Comunicable { public CharSequence getModelo(); public String toString(); }
UTF-8
Java
128
java
Comunicable.java
Java
[]
null
[]
package estructura; public interface Comunicable { public CharSequence getModelo(); public String toString(); }
128
0.703125
0.703125
9
12.222222
13.677052
33
false
false
0
0
0
0
0
0
0.666667
false
false
2
c6951f5d6e0bcf8c33b1c8a35ab920ac642733e6
15,487,652,126,447
fe2507cc7f0d2a973b638c2ca765fa6b297c88c8
/src/main/java/org/cti/cc/po/GroupLineupStrategyPo.java
c057fd91124f01f9f3f5e4adad3afa93a0da28ee
[]
no_license
voipweb/cc-core
https://github.com/voipweb/cc-core
1ab8e2ed8ce2dcbfe1dd0dc688c06a2f9e110e03
4fca062b4dc68c92a7faa30171395657c5bff14a
refs/heads/main
2023-06-14T23:47:46.039000
2021-07-13T07:30:22
2021-07-13T07:30:22
373,032,552
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.cti.cc.po; import org.cti.cc.entity.GroupLineupStrategy; import org.cti.cc.entity.GroupStrategyExp; import java.util.List; /** * Created by caoliang on 2020/11/25 */ public class GroupLineupStrategyPo extends GroupLineupStrategy { /** * 坐席自定义策略 */ private List<GroupStrategyExp> strategyExpList; public List<GroupStrategyExp> getStrategyExpList() { return strategyExpList; } public void setStrategyExpList(List<GroupStrategyExp> strategyExpList) { this.strategyExpList = strategyExpList; } }
UTF-8
Java
576
java
GroupLineupStrategyPo.java
Java
[ { "context": "egyExp;\n\nimport java.util.List;\n\n/**\n * Created by caoliang on 2020/11/25\n */\npublic class GroupLineupStrateg", "end": 164, "score": 0.9973207116127014, "start": 156, "tag": "USERNAME", "value": "caoliang" } ]
null
[]
package org.cti.cc.po; import org.cti.cc.entity.GroupLineupStrategy; import org.cti.cc.entity.GroupStrategyExp; import java.util.List; /** * Created by caoliang on 2020/11/25 */ public class GroupLineupStrategyPo extends GroupLineupStrategy { /** * 坐席自定义策略 */ private List<GroupStrategyExp> strategyExpList; public List<GroupStrategyExp> getStrategyExpList() { return strategyExpList; } public void setStrategyExpList(List<GroupStrategyExp> strategyExpList) { this.strategyExpList = strategyExpList; } }
576
0.72242
0.708185
25
21.48
23.375406
76
false
false
0
0
0
0
0
0
0.28
false
false
2
3c3893b43620c3cc300c36081d2549fe201a1397
21,019,569,947,087
f69f940693a9debf7d105c3ae58daf350e4356ad
/src/main/java/spaska/data/readers/AbstractInputReader.java
a2aa4600245abb29b3ea28624e216fbe26d8fc52
[]
no_license
psstoev/spaska
https://github.com/psstoev/spaska
870564eac284e22836729b4f888818030c67e91b
47f05b2660ced4ee6c8c5c917a28fa9aabead4ed
refs/heads/master
2020-11-30T11:55:01.127000
2012-02-05T08:29:37
2012-02-05T08:29:37
2,881,853
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package spaska.data.readers; import java.util.LinkedList; import java.util.List; import spaska.data.Dataset; /** * This is a convenient base class for {@link InputReader}. InputReaders can * extend this class to get some of the functionality. * */ public abstract class AbstractInputReader implements InputReader { /** * A list of preprocessors/validators for this input reader. */ private List<Validator> validators; /** * The resulting dataset from reading the input. */ private Dataset dataset; protected AbstractInputReader() { setValidators(new LinkedList<Validator>()); } @Override public final void addValidator(Validator validator) { getValidators().add(validator); } /** * Get the list of preprocessors/validators for this input reader. * * @return the list of preprocessors/validators for this input reader */ public final List<Validator> getValidators() { return validators; } protected Dataset getDataset() { return dataset; } protected void setDataset(Dataset dataset) { this.dataset = dataset; } protected void setValidators(List<Validator> validators) { this.validators = validators; } }
UTF-8
Java
1,278
java
AbstractInputReader.java
Java
[]
null
[]
package spaska.data.readers; import java.util.LinkedList; import java.util.List; import spaska.data.Dataset; /** * This is a convenient base class for {@link InputReader}. InputReaders can * extend this class to get some of the functionality. * */ public abstract class AbstractInputReader implements InputReader { /** * A list of preprocessors/validators for this input reader. */ private List<Validator> validators; /** * The resulting dataset from reading the input. */ private Dataset dataset; protected AbstractInputReader() { setValidators(new LinkedList<Validator>()); } @Override public final void addValidator(Validator validator) { getValidators().add(validator); } /** * Get the list of preprocessors/validators for this input reader. * * @return the list of preprocessors/validators for this input reader */ public final List<Validator> getValidators() { return validators; } protected Dataset getDataset() { return dataset; } protected void setDataset(Dataset dataset) { this.dataset = dataset; } protected void setValidators(List<Validator> validators) { this.validators = validators; } }
1,278
0.669797
0.669797
52
23.576923
23.683283
76
false
false
0
0
0
0
0
0
0.230769
false
false
2
1f33530b686bcd2817bcb87211261a20ad39c037
31,971,736,551,975
790083fa39e0874adb649020e17aa772bbf1ba0e
/app/src/main/java/mytechcorp/ir/assisstant/AddPersonActivity.java
94f4821beb24435c74d8c60c5bc08bef257eeb64
[]
no_license
moeinkarimi/Assisstant
https://github.com/moeinkarimi/Assisstant
136129a26998511fb33fc128d35c9a69a322c838
71bbfad9c6a64cd29eccbed6eed46273603b3949
refs/heads/test
2021-07-14T08:01:37.480000
2020-05-19T18:17:59
2020-05-19T18:17:59
137,096,878
1
0
null
false
2018-06-12T21:49:53
2018-06-12T16:06:03
2018-06-12T21:21:24
2018-06-12T21:49:52
1,934
0
0
0
Java
false
null
package mytechcorp.ir.assisstant; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.graphics.Typeface; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.Toast; import Models.CustomTypefaceSpan; import Models.Person; public class AddPersonActivity extends Dialog { Button btnSave; EditText txtName, txtFamily; Spinner spLocal2, spGrade2; Activity c; SQLiteDatabase db; DBHandler dbHandler; Typeface tf; private int ID; final int sdk = android.os.Build.VERSION.SDK_INT; public AddPersonActivity(Activity a) { super(a); this.c = a; } public AddPersonActivity(Activity a, int id) { super(a); this.c = a; this.ID = id; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_person); tf = Typeface.createFromAsset(c.getAssets(),"fonts/IRANSansMobile_Light.ttf"); dbHandler = new DBHandler(c); btnSave = findViewById(R.id.btnSave); txtName = findViewById(R.id.txtName); txtFamily = findViewById(R.id.txtFamily); spLocal2 = findViewById(R.id.spLocal2); spGrade2 = findViewById(R.id.spGrade2); if(ID != 0) { Person person = dbHandler.GetPerson(ID); txtName.setText(person.getPersonName()); txtFamily.setText(person.getPersonFamily()); } String[] local = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" , "16", "17" , "18", "19", "20", "21", "22"}; ArrayAdapter<String> localadapter = new ArrayAdapter<>(c, android.R.layout.simple_spinner_dropdown_item, local); spLocal2.setAdapter(localadapter); String[] Grade = new String[]{"پایه هشتم", "پایه نهم", "پایه دهم"}; ArrayAdapter<String> Gradeadapter = new ArrayAdapter<>(c, android.R.layout.simple_spinner_dropdown_item, Grade); spGrade2.setAdapter(Gradeadapter); int position = localadapter.getPosition(String.valueOf(dbHandler.GetLocal())); spLocal2.setSelection(position); btnSave.setTypeface(tf); txtName.setTypeface(tf); txtFamily.setTypeface(tf); btnSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(ID == 0) { SpannableStringBuilder ssbuilder = new SpannableStringBuilder("مقدار درخواستی را وارد کنید"); ssbuilder.setSpan(new CustomTypefaceSpan("", tf), 0, ssbuilder.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE); if (!txtName.getText().toString().equals("") && !txtFamily.getText().toString().equals("")) { dbHandler.AddPerson( new Person( txtName.getText().toString(), txtFamily.getText().toString(), Integer.parseInt(spLocal2.getSelectedItem().toString()), spGrade2.getSelectedItem().toString() ) ); txtName.setText(""); txtFamily.setText(""); dismiss(); } else if (txtName.getText().toString().equals("") && txtFamily.getText().toString().equals("")) { txtName.setError(ssbuilder); txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtName.getText().toString().equals("")) { txtName.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtFamily.getText().toString().equals("")) { txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtFamily.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } } else { SpannableStringBuilder ssbuilder = new SpannableStringBuilder("مقدار درخواستی را وارد کنید"); ssbuilder.setSpan(new CustomTypefaceSpan("", tf), 0, ssbuilder.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE); if (!txtName.getText().toString().equals("") && !txtFamily.getText().toString().equals("")) { dbHandler.UpdatePerson( new Person( txtName.getText().toString(), txtFamily.getText().toString(), Integer.parseInt(spLocal2.getSelectedItem().toString()), spGrade2.getSelectedItem().toString() ), ID ); txtName.setText(""); txtFamily.setText(""); dismiss(); } else if (txtName.getText().toString().equals("") && txtFamily.getText().toString().equals("")) { txtName.setError(ssbuilder); txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtName.getText().toString().equals("")) { txtName.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtFamily.getText().toString().equals("")) { txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtFamily.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } } } }); } }
UTF-8
Java
8,555
java
AddPersonActivity.java
Java
[]
null
[]
package mytechcorp.ir.assisstant; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.graphics.Typeface; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.Toast; import Models.CustomTypefaceSpan; import Models.Person; public class AddPersonActivity extends Dialog { Button btnSave; EditText txtName, txtFamily; Spinner spLocal2, spGrade2; Activity c; SQLiteDatabase db; DBHandler dbHandler; Typeface tf; private int ID; final int sdk = android.os.Build.VERSION.SDK_INT; public AddPersonActivity(Activity a) { super(a); this.c = a; } public AddPersonActivity(Activity a, int id) { super(a); this.c = a; this.ID = id; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_person); tf = Typeface.createFromAsset(c.getAssets(),"fonts/IRANSansMobile_Light.ttf"); dbHandler = new DBHandler(c); btnSave = findViewById(R.id.btnSave); txtName = findViewById(R.id.txtName); txtFamily = findViewById(R.id.txtFamily); spLocal2 = findViewById(R.id.spLocal2); spGrade2 = findViewById(R.id.spGrade2); if(ID != 0) { Person person = dbHandler.GetPerson(ID); txtName.setText(person.getPersonName()); txtFamily.setText(person.getPersonFamily()); } String[] local = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" , "16", "17" , "18", "19", "20", "21", "22"}; ArrayAdapter<String> localadapter = new ArrayAdapter<>(c, android.R.layout.simple_spinner_dropdown_item, local); spLocal2.setAdapter(localadapter); String[] Grade = new String[]{"پایه هشتم", "پایه نهم", "پایه دهم"}; ArrayAdapter<String> Gradeadapter = new ArrayAdapter<>(c, android.R.layout.simple_spinner_dropdown_item, Grade); spGrade2.setAdapter(Gradeadapter); int position = localadapter.getPosition(String.valueOf(dbHandler.GetLocal())); spLocal2.setSelection(position); btnSave.setTypeface(tf); txtName.setTypeface(tf); txtFamily.setTypeface(tf); btnSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(ID == 0) { SpannableStringBuilder ssbuilder = new SpannableStringBuilder("مقدار درخواستی را وارد کنید"); ssbuilder.setSpan(new CustomTypefaceSpan("", tf), 0, ssbuilder.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE); if (!txtName.getText().toString().equals("") && !txtFamily.getText().toString().equals("")) { dbHandler.AddPerson( new Person( txtName.getText().toString(), txtFamily.getText().toString(), Integer.parseInt(spLocal2.getSelectedItem().toString()), spGrade2.getSelectedItem().toString() ) ); txtName.setText(""); txtFamily.setText(""); dismiss(); } else if (txtName.getText().toString().equals("") && txtFamily.getText().toString().equals("")) { txtName.setError(ssbuilder); txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtName.getText().toString().equals("")) { txtName.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtFamily.getText().toString().equals("")) { txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtFamily.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } } else { SpannableStringBuilder ssbuilder = new SpannableStringBuilder("مقدار درخواستی را وارد کنید"); ssbuilder.setSpan(new CustomTypefaceSpan("", tf), 0, ssbuilder.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE); if (!txtName.getText().toString().equals("") && !txtFamily.getText().toString().equals("")) { dbHandler.UpdatePerson( new Person( txtName.getText().toString(), txtFamily.getText().toString(), Integer.parseInt(spLocal2.getSelectedItem().toString()), spGrade2.getSelectedItem().toString() ), ID ); txtName.setText(""); txtFamily.setText(""); dismiss(); } else if (txtName.getText().toString().equals("") && txtFamily.getText().toString().equals("")) { txtName.setError(ssbuilder); txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); txtFamily.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtName.getText().toString().equals("")) { txtName.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtName.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtName.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } else if (txtFamily.getText().toString().equals("")) { txtFamily.setError(ssbuilder); if (sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { txtFamily.setBackgroundDrawable(ContextCompat.getDrawable(c, R.drawable.eterror)); } else { txtFamily.setBackground(ContextCompat.getDrawable(c, R.drawable.eterror)); } } } } }); } }
8,555
0.538588
0.532226
182
45.631866
34.875946
127
false
false
0
0
0
0
0
0
0.862637
false
false
2
360b02e31044e455dc915599e96985265e2fe825
1,443,109,079,787
37a7c112c8c50f1920229ad8ed6a90583e8ce4c8
/src/gnwf/dao/WfJobUserRelteDAO.java
97749668163d7a6b9eb660eda0a8d323fb35af48
[]
no_license
yeqingyun/pdm
https://github.com/yeqingyun/pdm
a25ebe6a4aed80c8a706a4cafbedd97ea114f9d6
80cdaf5d84711b0fbd72ba04e1a966971af12ceb
refs/heads/master
2021-04-12T11:27:28.603000
2018-08-16T13:56:19
2018-08-16T13:56:19
126,423,239
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package gnwf.dao; import java.util.List; import org.apache.log4j.Logger; import org.frm.dao.BasicDAO; import org.frm.dao.GenericDAO; import gnwf.dao.helper.WfJobUserRelteHelper; import gnwf.vo.WfJobUserRelte; public class WfJobUserRelteDAO extends BasicDAO implements GenericDAO { private WfJobUserRelteHelper wfJobUserRelteHelper = new WfJobUserRelteHelper(); public void insert(Object wfJobUserRelte) throws java.sql.SQLException { WfJobUserRelte _wfJobUserRelte = (WfJobUserRelte)wfJobUserRelte; String fields = wfJobUserRelteHelper.getFields(_wfJobUserRelte); String sql = wfJobUserRelteHelper.getInsertSql(fields); try { wfJobUserRelteHelper.pstmtInsert(_wfJobUserRelte, sql, fields); } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.insert", e); throw e; } } public void update(Object wfJobUserRelte) throws java.sql.SQLException { WfJobUserRelte _wfJobUserRelte = (WfJobUserRelte)wfJobUserRelte; String fields = wfJobUserRelteHelper.getFields(_wfJobUserRelte); String sql = wfJobUserRelteHelper.getUpdateSql(fields, "WfJobUserRelte.JobId" ,_wfJobUserRelte.getJobId().toString()); try { wfJobUserRelteHelper.pstmtUpdate(_wfJobUserRelte, sql, fields); } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.update", e); throw e; } } public List<WfJobUserRelte> query(String sql, String fields) throws java.sql.SQLException { try { return wfJobUserRelteHelper.getQueryList(query(sql),fields); } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.query", e); throw e; } } public Object load(String sql, String fields) throws java.sql.SQLException { try { List<WfJobUserRelte> list = wfJobUserRelteHelper.getQueryList(query(sql),fields); if(list.size() > 0) return (WfJobUserRelte)list.get(0); else return null; } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.load", e); throw e; } } public Object load(Object wfJobUserRelte) throws java.sql.SQLException { WfJobUserRelte _wfJobUserRelte = (WfJobUserRelte)wfJobUserRelte; String sql = "select "+WfJobUserRelte.ALL_FIELDS+wfJobUserRelteHelper.getSqlString()+" and WfJobUserRelte.JobId = '"+_wfJobUserRelte.getJobId()+"'"; try { List<WfJobUserRelte> list = wfJobUserRelteHelper.getQueryList(query(sql),WfJobUserRelte.ALL_FIELDS); if(list.size() > 0) return (WfJobUserRelte)list.get(0); else return null; } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.load", e); throw e; } } }
UTF-8
Java
2,692
java
WfJobUserRelteDAO.java
Java
[]
null
[]
package gnwf.dao; import java.util.List; import org.apache.log4j.Logger; import org.frm.dao.BasicDAO; import org.frm.dao.GenericDAO; import gnwf.dao.helper.WfJobUserRelteHelper; import gnwf.vo.WfJobUserRelte; public class WfJobUserRelteDAO extends BasicDAO implements GenericDAO { private WfJobUserRelteHelper wfJobUserRelteHelper = new WfJobUserRelteHelper(); public void insert(Object wfJobUserRelte) throws java.sql.SQLException { WfJobUserRelte _wfJobUserRelte = (WfJobUserRelte)wfJobUserRelte; String fields = wfJobUserRelteHelper.getFields(_wfJobUserRelte); String sql = wfJobUserRelteHelper.getInsertSql(fields); try { wfJobUserRelteHelper.pstmtInsert(_wfJobUserRelte, sql, fields); } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.insert", e); throw e; } } public void update(Object wfJobUserRelte) throws java.sql.SQLException { WfJobUserRelte _wfJobUserRelte = (WfJobUserRelte)wfJobUserRelte; String fields = wfJobUserRelteHelper.getFields(_wfJobUserRelte); String sql = wfJobUserRelteHelper.getUpdateSql(fields, "WfJobUserRelte.JobId" ,_wfJobUserRelte.getJobId().toString()); try { wfJobUserRelteHelper.pstmtUpdate(_wfJobUserRelte, sql, fields); } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.update", e); throw e; } } public List<WfJobUserRelte> query(String sql, String fields) throws java.sql.SQLException { try { return wfJobUserRelteHelper.getQueryList(query(sql),fields); } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.query", e); throw e; } } public Object load(String sql, String fields) throws java.sql.SQLException { try { List<WfJobUserRelte> list = wfJobUserRelteHelper.getQueryList(query(sql),fields); if(list.size() > 0) return (WfJobUserRelte)list.get(0); else return null; } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.load", e); throw e; } } public Object load(Object wfJobUserRelte) throws java.sql.SQLException { WfJobUserRelte _wfJobUserRelte = (WfJobUserRelte)wfJobUserRelte; String sql = "select "+WfJobUserRelte.ALL_FIELDS+wfJobUserRelteHelper.getSqlString()+" and WfJobUserRelte.JobId = '"+_wfJobUserRelte.getJobId()+"'"; try { List<WfJobUserRelte> list = wfJobUserRelteHelper.getQueryList(query(sql),WfJobUserRelte.ALL_FIELDS); if(list.size() > 0) return (WfJobUserRelte)list.get(0); else return null; } catch(java.sql.SQLException e) { Logger.getLogger(this.getClass()).error("WfJobUserRelteDAO.load", e); throw e; } } }
2,692
0.751486
0.749629
79
33.088608
34.100815
150
false
false
0
0
0
0
0
0
2.417722
false
false
2
ce4bd9b736f48a7ab4d7eff1e6fae9de7a011b57
11,802,570,176,847
2a06da93f4d8ecc36a978148161dd1f48d10b552
/src/test/java/com/gamesys/wormholetravel/unit/handlers/TravelerHandlerTest.java
3039257ebcfe262d2b0d32e46d7bf8db147e6c4a
[]
no_license
carvo-zz/wormhole-travel
https://github.com/carvo-zz/wormhole-travel
c63f5eb09ba5b7217a0f7d80f82cd57b86b647d7
d4f47a2b127a752a8b42aeb65762cc7575bd56eb
refs/heads/master
2021-09-17T04:53:41.448000
2018-06-28T04:02:15
2018-06-28T04:02:15
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.gamesys.wormholetravel.unit.handlers; import com.gamesys.wormholetravel.UrlMapping; import com.gamesys.wormholetravel.commons.ServiceResponse; import com.gamesys.wormholetravel.handlers.TravelerHandler; import com.gamesys.wormholetravel.models.Travel; import com.gamesys.wormholetravel.services.TravelerService; import com.gamesys.wormholetravel.utils.JsonParser; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; import java.util.ArrayList; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) @WebMvcTest(TravelerHandler.class) public class TravelerHandlerTest { @Autowired private MockMvc mockMvc; @MockBean private TravelerService service; @Test public void shouldRetrieveOldTravels() throws Exception { final String expectedBody = "[{\"place\":\"Somewhere 1\",\"date\":1}]"; final ServiceResponse mockedServiceResponse = mock(ServiceResponse.class); when(service.findHistoric(anyString())).thenReturn(mockedServiceResponse); when(mockedServiceResponse.hasError()).thenReturn(Boolean.FALSE); when(mockedServiceResponse.getResponse()).thenReturn(new ArrayList(){{ add(new Travel("Somewhere 1", 1L)); }}); mockMvc.perform(get(UrlMapping.Travelers.OLD_TRAVELS, "carvo123")) .andExpect(status().is(HttpStatus.OK.value())) .andExpect(content().string(expectedBody)) ; verify(service, times(1)).findHistoric(anyString()); verify(mockedServiceResponse, times(1)).hasError(); verify(mockedServiceResponse, never()).getErrorsAsJson(); verify(mockedServiceResponse, times(1)).getResponse(); } @Test public void shouldTravel() throws Exception { final Travel travel = new Travel("The Restaurant at the End of the Universe", 0L); final ServiceResponse mockedServiceResponse = mock(ServiceResponse.class); when(service.travel(anyString(), any())).thenReturn(mockedServiceResponse); when(mockedServiceResponse.hasError()).thenReturn(Boolean.FALSE); final MockHttpServletRequestBuilder builder = post(UrlMapping.Travelers.TRAVELS, "carvo123") .content(JsonParser.toJson(travel)) .contentType(MediaType.APPLICATION_JSON); mockMvc.perform(builder) .andExpect(status().is(HttpStatus.CREATED.value())) .andExpect(content().string("")) ; verify(service, times(1)).travel(anyString(), any()); verify(mockedServiceResponse, times(1)).hasError(); verify(mockedServiceResponse, never()).getErrorsAsJson(); verify(mockedServiceResponse, never()).getResponse(); } }
UTF-8
Java
3,538
java
TravelerHandlerTest.java
Java
[]
null
[]
package com.gamesys.wormholetravel.unit.handlers; import com.gamesys.wormholetravel.UrlMapping; import com.gamesys.wormholetravel.commons.ServiceResponse; import com.gamesys.wormholetravel.handlers.TravelerHandler; import com.gamesys.wormholetravel.models.Travel; import com.gamesys.wormholetravel.services.TravelerService; import com.gamesys.wormholetravel.utils.JsonParser; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; import java.util.ArrayList; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) @WebMvcTest(TravelerHandler.class) public class TravelerHandlerTest { @Autowired private MockMvc mockMvc; @MockBean private TravelerService service; @Test public void shouldRetrieveOldTravels() throws Exception { final String expectedBody = "[{\"place\":\"Somewhere 1\",\"date\":1}]"; final ServiceResponse mockedServiceResponse = mock(ServiceResponse.class); when(service.findHistoric(anyString())).thenReturn(mockedServiceResponse); when(mockedServiceResponse.hasError()).thenReturn(Boolean.FALSE); when(mockedServiceResponse.getResponse()).thenReturn(new ArrayList(){{ add(new Travel("Somewhere 1", 1L)); }}); mockMvc.perform(get(UrlMapping.Travelers.OLD_TRAVELS, "carvo123")) .andExpect(status().is(HttpStatus.OK.value())) .andExpect(content().string(expectedBody)) ; verify(service, times(1)).findHistoric(anyString()); verify(mockedServiceResponse, times(1)).hasError(); verify(mockedServiceResponse, never()).getErrorsAsJson(); verify(mockedServiceResponse, times(1)).getResponse(); } @Test public void shouldTravel() throws Exception { final Travel travel = new Travel("The Restaurant at the End of the Universe", 0L); final ServiceResponse mockedServiceResponse = mock(ServiceResponse.class); when(service.travel(anyString(), any())).thenReturn(mockedServiceResponse); when(mockedServiceResponse.hasError()).thenReturn(Boolean.FALSE); final MockHttpServletRequestBuilder builder = post(UrlMapping.Travelers.TRAVELS, "carvo123") .content(JsonParser.toJson(travel)) .contentType(MediaType.APPLICATION_JSON); mockMvc.perform(builder) .andExpect(status().is(HttpStatus.CREATED.value())) .andExpect(content().string("")) ; verify(service, times(1)).travel(anyString(), any()); verify(mockedServiceResponse, times(1)).hasError(); verify(mockedServiceResponse, never()).getErrorsAsJson(); verify(mockedServiceResponse, never()).getResponse(); } }
3,538
0.744206
0.739401
82
42.146343
31.65366
119
false
false
0
0
0
0
0
0
0.743902
false
false
2
993753136bfcd7068e34482d09cf9ebc9025e2cb
14,010,183,323,048
fc634fede6ec765e4effb12f9583beab6c09472c
/app/src/main/java/com/idmission/libtestproject/fragments/CustomizeUIConfiguration.java
f96ba0e6fbb99ac7346f7d2bc06a63d669c62dd2
[]
no_license
evolv-idmission/eVolv-Android
https://github.com/evolv-idmission/eVolv-Android
225b224f04f08188839a69d90bb9ee5d663a0ebe
abd5d18426ad39d7911b36c8a65e29e9156408df
refs/heads/master
2022-11-23T14:10:12.421000
2020-07-28T12:09:42
2020-07-28T12:09:42
283,187,786
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.idmission.libtestproject.fragments; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.util.Log; import android.util.Pair; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.RadioGroup; import android.widget.Spinner; import com.idmission.client.ImageProcessingSDK; import com.idmission.libtestproject.R; import com.idmission.libtestproject.activity.NavigationActivity; import com.idmission.libtestproject.adapter.SpinnerAdapterForPair; import com.idmission.libtestproject.classes.CustomizeUIConfig; import com.idmission.libtestproject.classes.CustomizeUIConfigManager; import com.idmission.libtestproject.classes.UIConfigConstants; import com.idmission.libtestproject.utils.BitmapUtils; import com.idmission.libtestproject.utils.CommonUtils; import com.idmission.libtestproject.utils.PreferenceUtils; import com.idmission.libtestproject.utils.StringUtil; import java.util.ArrayList; import java.util.HashMap; import java.util.Set; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; public class CustomizeUIConfiguration extends Fragment { private Spinner spinnerUIConfig, spinnerTitle, spinnerFaceTitle ,spinnerTitleAlignment, spinnerHintAlignment, spinnerTitleImageAlignment, spinnerLabel, spinnerTextFontType, spinnerTextFontStyle, spinnerHeaderTextFontType, spinnerHeaderTextFontStyle, spinnerIDCaptureBorder; private View idCaptureView, selfieCaptureView, fingerprintCaptureView, voiceRecordingView; private Button backButton, nextButton, addLabelButton, addFaceLabelButton, resetButton; public static ArrayList<String> skipFeaturesList = new ArrayList<>(); //Id Capture private EditText idOutlineColorEdtTxt, idOutlineAlphaEdtTxt, detectedIdOutlineColorEdtTxt, detectedIdOutlineAlphaEdtTxt, idOutsideOutlineColorEdtTxt, idOutsideOutlineAlphaEdtTxt, detectedOutsideOutlineColorEdtTxt, detectedOutsideOutlineAlphaEdtTxt, backButtonColorEdtTxt, retryButtonColorEdtTxt, confirmButtonColorEdtTxt, backButtonAlphaEdtTxt, retryButtonAlphaEdtTxt, confirmButtonAlphaEdtTxt, textLabelColorEdtTxt, textLabelAlphaEdtTxt, instructionContinueBtnColorEdtTxt, instructionContinueBtnAlphaEdtTxt, instructionContinueBtnTxtColorEdtTxt, instructionContinueBtnTxtAlphaEdtTxt, retryButtonBorderColorEdtTxt, confirmButtonStyleEdtTxt, retryButtonBorderAlphaEdtTxt, confirmButtonStyleAlphaEdtTxt, headerTextLabelColorEdtTxt, headerTextLabelAlphaEdtTxt, headerTextLabelSizeEdtTxt, textLabelSizeEdtTxt, labelValueEdtTxt, labelValueFaceEdtTxt, captureButtonColorEdtTxt, captureButtonColorAlphaEdtTxt; private CheckBox titleAlignmentCB, hintAlignmentCB, titleImageAlignmentCB; private ArrayList<Pair<String, String>> textFontTypeList, textFontStyleList, headerTextFontTypeList, headerTextFontStyleList, titleAlignmentList, hintAlignmentList, titleImageAlignmentList, idCaptureBorderList; //selfie capture private EditText faceOutlineColorEdtTxt, detectedFaceOutlineColorEdtTxt, outsideFaceOutlineColorEdtTxt, faceOutlineColorAlphaEdtTxt, detectedFaceOutlineColorAlphaEdtTxt, outsideFaceOutlineColorAlphaEdtTxt, outsideDetectedFaceOutlineColor, outsideDetectedFaceOutlineColorAlpha, faceBackButtonColorEdtTxt, faceRetryButtonColorEdtTxt, faceConfirmButtonColorEdtTxt, faceRetryButtonBorderAlphaEdtTxt, faceConfirmButtonStyleAlphaEdtTxt, faceBackButtonAlphaEdtTxt, faceRetryButtonAlphaEdtTxt, faceConfirmButtonAlphaEdtTxt, faceRetryButtonBorderColorEdtTxt, faceConfirmButtonStyleEdtTxt, faceTextLabelColorEdtTxt, faceTextLabelAlphaEdtTxt, faceInstructionContinueBtnColorEdtTxt, faceInstructionContinueBtnAlphaEdtTxt, faceInstructionContinueBtnTxtColorEdtTxt, faceInstructionContinueBtnTxtAlphaEdtTxt, faceHeaderTextLabelColorEdtTxt, faceHeaderTextLabelAlphaEdtTxt, faceHeaderTextLabelSizeEdtTxt, faceTextLabelSizeEdtTxt, faceInstructionPreviewBackgroundEdtTxt, faceInstructionPreviewBackgroundAlphaEdtTxt; private Spinner faceSpinnerTextFontType, faceSpinnerTextFontStyle, faceSpinnerFaceContours, faceSpinnerHeaderTextFontType, faceSpinnerHeaderTextFontStyle, faceSpinnerTitleAlignment, faceSpinnerHintMsgAlignment, faceSpinnerHintIconAlignment, faceSpinnerTitleImageAlignment, faceSpinnerLabel; private CheckBox faceTitleAlignmentCB, faceHintMsgAlignmentCB, faceHintIconAlignmentCB, faceTitleImageAlignmentCB, showCustomOverlay; private ArrayList<Pair<String, String>> faceTextFontTypeList, faceTextFontStyleList, faceHeaderTextFontTypeList, facehHeaderTextFontStyleList, faceTitleAlignmentList, faceHintMsgAlignmentList, faceHintIconAlignmentList, faceTitleImageAlignmentList, faceContoursList; //4F Capture private EditText fpTextLabelColorEdtTxt, fpTextLabelAlphaEdtTxt, fpInstructionContinueBtnColorEdtTxt, fpInstructionContinueBtnAlphaEdtTxt, fpInstructionContinueBtnTxtColorEdtTxt, fpInstructionContinueBtnTxtAlphaEdtTxt; private String previously_selected_feature; private RadioGroup radioGroupInstruction; private SwitchCompat showPreviewScreenCheckBox, showInstructionFaceDetect, enableLabelShadowSwitch, faceEnableLabelShadowSwitch; //Voice Recording private EditText voiceButtonColorEdtTxt, voiceButtonColorAlphaEdtTxt, voiceBackgroundColorEdtTxt, voiceBackgroundColorAlphaEdtTxt, voiceTextColorEdtTxt, voiceTextColorAlphaEdtTxt, voiceTitleColorEdtTxt, voiceTitleColorAlphaEdtTxt, voiceTitleLabelSizeEdtTxt, voiceTextLabelSizeEdtTxt, voiceCounterLabelSizeEdtTxt, voiceLabelValueEdtTxt; private Spinner voiceDisplayPositionSpinner, voiceLabelSpinner; private Button voiceAddLabelButton; private SwitchCompat voiceTitleOnTopSwitch, voiceAutoPlaySwitch; private ArrayList<Pair<String, String>> voiceDisplayPositionList; @Override public void onAttach(Context context) { super.onAttach(context); } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { CommonUtils.updateLanguage(getActivity(), PreferenceUtils.getPreference(getActivity(), AccountSetup.LANGUAGE, AccountSetup.DEFAULT_LANGUAGE)); View view = inflater.inflate(R.layout.customize_ui_configuration, container, false); skipFeaturesList = (ArrayList<String>) getArguments().getSerializable(IDDetails.SKIP_FEATURES_LIST); spinnerUIConfig = (Spinner) view.findViewById(R.id.spinner_configuration); backButton = (Button) view.findViewById(R.id.button_back); nextButton = (Button) view.findViewById(R.id.button_next); resetButton= (Button) view.findViewById(R.id.button_reset); idCaptureView = view.findViewById(R.id.custom_id_capture_lay); selfieCaptureView = view.findViewById(R.id.custom_selfie_capture_lay); fingerprintCaptureView = view.findViewById(R.id.custom_4f_fingerprint_capture_lay); voiceRecordingView = view.findViewById(R.id.custom_voice_recording_lay); initializedIdCapture(); initializedSelfieCapture(); initializedFPCapture(); initializedVoiceRecording(); setIDCaptureSpinnerAdapter(); setSelfieCaptureSpinnerAdapter(); setVoiceRecordingSpinnerAdapter(); setIDCaptureDefaultValues(); return view; } private void initializedIdCapture() { idOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.id_outline_color); idOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_id_outline_color); detectedIdOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.detected_id_outline_color); detectedIdOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_detected_id_outline_color); idOutsideOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.color_outside_outline); idOutsideOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_color_outside_outline); detectedOutsideOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.detected_color_outside_outline); detectedOutsideOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_detected_color_outside_outline); backButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.back_button_color); retryButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.retry_button_color); confirmButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.confirm_button_color); retryButtonBorderColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.retry_button_border_color); confirmButtonStyleEdtTxt = (EditText) idCaptureView.findViewById(R.id.confirm_button_style); backButtonAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_back_button_color); retryButtonAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_retry_button_color); confirmButtonAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_confirm_button_color); retryButtonBorderAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_retry_button_border_color); confirmButtonStyleAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_confirm_button_style); textLabelColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.text_label_color); textLabelAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_text_label_color); instructionContinueBtnColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.instruction_continue_button_color); instructionContinueBtnAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_instruction_continue_button); instructionContinueBtnTxtColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.instruction_continue_button_text_color); instructionContinueBtnTxtAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_instruction_continue_button_text); headerTextLabelColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.text_header_label_color); headerTextLabelAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_text_header_label_color); headerTextLabelSizeEdtTxt = (EditText) idCaptureView.findViewById(R.id.Header_text_size); textLabelSizeEdtTxt = (EditText) idCaptureView.findViewById(R.id.text_size); labelValueEdtTxt = (EditText) idCaptureView.findViewById(R.id.label_value); spinnerTextFontType = (Spinner) idCaptureView.findViewById(R.id.text_font_type_spinner); spinnerTextFontStyle = (Spinner) idCaptureView.findViewById(R.id.text_font_style_spinner); spinnerTitle = (Spinner) idCaptureView.findViewById(R.id.spinner_title); spinnerTitleAlignment = (Spinner) idCaptureView.findViewById(R.id.spinner_title_alignment); spinnerHintAlignment = (Spinner) idCaptureView.findViewById(R.id.spinner_hint_alignment); spinnerTitleImageAlignment = (Spinner) idCaptureView.findViewById(R.id.spinner_title_image_alignment); spinnerHeaderTextFontType = (Spinner) idCaptureView.findViewById(R.id.text_header_font_type_spinner); spinnerHeaderTextFontStyle = (Spinner) idCaptureView.findViewById(R.id.text_header_font_style_spinner); spinnerLabel = (Spinner) idCaptureView.findViewById(R.id.spinner_label_type); spinnerIDCaptureBorder = (Spinner) idCaptureView.findViewById(R.id.spinner_id_capture_border); titleAlignmentCB = (CheckBox) idCaptureView.findViewById(R.id.checkbox_title_alignment); hintAlignmentCB = (CheckBox) idCaptureView.findViewById(R.id.checkbox_hint_alignment); titleImageAlignmentCB = (CheckBox) idCaptureView.findViewById(R.id.checkbox_title_image_alignment); addLabelButton = (Button) idCaptureView.findViewById(R.id.add_label_button); radioGroupInstruction = (RadioGroup) idCaptureView.findViewById(R.id.radio_group_instruction); enableLabelShadowSwitch = (SwitchCompat) idCaptureView.findViewById(R.id.enable_shade); captureButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.capture_button_text_color); captureButtonColorAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_capture_button_text); } private void initializedSelfieCapture() { faceOutlineColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_normal); faceOutlineColorAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_normal_alpha); detectedFaceOutlineColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_detected); detectedFaceOutlineColorAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_detected_alpha); outsideFaceOutlineColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.outside_face_outline_color); outsideFaceOutlineColorAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.outside_face_outline_color_alpha); outsideDetectedFaceOutlineColor = (EditText) selfieCaptureView.findViewById(R.id.outside_detected_face_outline_color); outsideDetectedFaceOutlineColorAlpha = (EditText) selfieCaptureView.findViewById(R.id.outside_detected_face_outline_color_alpha); faceBackButtonColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.back_button_color); faceRetryButtonColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.retry_button_color); faceRetryButtonBorderColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.retry_button_border_color); faceRetryButtonBorderAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_retry_button_border_color); faceConfirmButtonColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.confirm_button_color); faceConfirmButtonStyleEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.confirm_button_style); faceConfirmButtonStyleAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_confirm_button_style); faceBackButtonAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_back_button_color); faceRetryButtonAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_retry_button_color); faceConfirmButtonAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_confirm_button_color); faceTextLabelColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.text_label_color); faceTextLabelAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_text_label_color); faceInstructionContinueBtnColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.instruction_continue_button_color); faceInstructionContinueBtnAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_instruction_continue_button); faceInstructionContinueBtnTxtColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.instruction_continue_button_text_color); faceInstructionContinueBtnTxtAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_instruction_continue_button_text); faceHeaderTextLabelColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.text_header_label_color); faceHeaderTextLabelAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_text_header_label_color); faceHeaderTextLabelSizeEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.Header_text_size); faceTextLabelSizeEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.text_size); faceInstructionPreviewBackgroundEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.instruction_preview_background_color); faceInstructionPreviewBackgroundAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_instruction_preview_background_color); spinnerFaceTitle = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_title); faceSpinnerTextFontType = (Spinner) selfieCaptureView.findViewById(R.id.text_font_type_spinner); faceSpinnerTextFontStyle = (Spinner) selfieCaptureView.findViewById(R.id.text_font_style_spinner); faceSpinnerFaceContours = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_contours); faceSpinnerHeaderTextFontType = (Spinner) selfieCaptureView.findViewById(R.id.text_header_font_type_spinner); faceSpinnerHeaderTextFontStyle = (Spinner) selfieCaptureView.findViewById(R.id.text_header_font_style_spinner); faceSpinnerTitleAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_title_alignment); faceSpinnerHintMsgAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_hint_msg_alignment); faceSpinnerHintIconAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_hint_icon_alignment); faceSpinnerTitleImageAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_title_image_alignment); //faceImageTypeSpinner = (Spinner) selfieCaptureView.findViewById(R.id.faceImageType_ET); faceSpinnerLabel = (Spinner) selfieCaptureView.findViewById(R.id.spinner_label_type); showPreviewScreenCheckBox = (SwitchCompat) selfieCaptureView.findViewById(R.id.showPreviewScreenCheckBox); showInstructionFaceDetect = (SwitchCompat) selfieCaptureView.findViewById(R.id.show_instruction_face_detect); faceTitleAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_title_alignment); faceHintMsgAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_hint_msg_alignment); faceHintIconAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_hint_icon_alignment); faceTitleImageAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_title_image_alignment); showCustomOverlay = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_show_custom_ui); labelValueFaceEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_label_value); addFaceLabelButton = (Button) selfieCaptureView.findViewById(R.id.face_add_label_button); faceEnableLabelShadowSwitch = (SwitchCompat) selfieCaptureView.findViewById(R.id.fd_enable_shade); } private void initializedFPCapture() { fpTextLabelColorEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.text_label_color); fpTextLabelAlphaEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.transparency_text_label_color); fpInstructionContinueBtnColorEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.instruction_continue_button_color); fpInstructionContinueBtnAlphaEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.transparency_instruction_continue_button); fpInstructionContinueBtnTxtColorEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.instruction_continue_button_text_color); fpInstructionContinueBtnTxtAlphaEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.transparency_instruction_continue_button_text); } private void initializedVoiceRecording() { voiceButtonColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_button_color); voiceButtonColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_button_color_alpha); voiceBackgroundColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_background_color); voiceBackgroundColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_background_color_alpha); voiceTextColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_text_label_color); voiceTextColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_text_label_color_alpha); voiceTitleColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_title_label_color); voiceTitleColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_title_label_color_alpha); voiceTitleLabelSizeEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_title_label_size); voiceTextLabelSizeEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_text_label_size); voiceCounterLabelSizeEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_counter_label_size); voiceLabelValueEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.label_value); voiceAddLabelButton= (Button) voiceRecordingView.findViewById(R.id.voice_add_label_button); voiceDisplayPositionSpinner = (Spinner) voiceRecordingView.findViewById(R.id.voice_display_position_spinner); voiceLabelSpinner = (Spinner) voiceRecordingView.findViewById(R.id.spinner_label_type); voiceTitleOnTopSwitch = (SwitchCompat) voiceRecordingView.findViewById(R.id.voice_title_label_on_top_switch); voiceAutoPlaySwitch = (SwitchCompat) voiceRecordingView.findViewById(R.id.auto_play_switch); } private void setIDCaptureSpinnerAdapter() { ArrayList<Pair<String,String>> titleList = new ArrayList<Pair<String,String>>(); titleList.add(new Pair<String, String>(getString(R.string.none),"None")); titleList.add(new Pair<String, String>(getString(R.string.title_image_1),"Title Image 1")); SpinnerAdapterForPair titleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, titleList); spinnerTitle.setAdapter(titleListAdapter); ArrayList<Pair<String, String>> uiConfigList = new ArrayList<Pair<String, String>>(); uiConfigList.add(new Pair<String, String>(getString(R.string.id_front_capture), CustomizeUIConfigManager.ID_CAPTURE_FRONT)); uiConfigList.add(new Pair<String, String>(getString(R.string.id_back_capture), CustomizeUIConfigManager.ID_CAPTURE_BACK)); uiConfigList.add(new Pair<String, String>(getString(R.string.document_capture_tab), CustomizeUIConfigManager.DOCUMENT_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.snippet_capture), CustomizeUIConfigManager.SNIPPET_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.selfie_capture), CustomizeUIConfigManager.FACE_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.fingerprint_capture_4F), CustomizeUIConfigManager.FINGER_4F_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.capture_secondary_id_front), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)); uiConfigList.add(new Pair<String, String>(getString(R.string.capture_secondary_id_back), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)); uiConfigList.add(new Pair<String, String>(getString(R.string.voice_capture), CustomizeUIConfigManager.VOICE_RECORDING)); SpinnerAdapterForPair uiConfigListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, uiConfigList); spinnerUIConfig.setAdapter(uiConfigListAdapter); textFontTypeList = new ArrayList<Pair<String, String>>(); textFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); textFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); textFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); textFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); textFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair textFontTypeListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, textFontTypeList); spinnerTextFontType.setAdapter(textFontTypeListAdapter); textFontStyleList = new ArrayList<Pair<String, String>>(); textFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); textFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); textFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); textFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair textFontStyleListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, textFontStyleList); spinnerTextFontStyle.setAdapter(textFontStyleListAdapter); headerTextFontTypeList = new ArrayList<Pair<String, String>>(); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair headerTextFontTypeListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, headerTextFontTypeList); spinnerHeaderTextFontType.setAdapter(headerTextFontTypeListAdapter); headerTextFontStyleList = new ArrayList<Pair<String, String>>(); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair headerTextFontStyleListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, headerTextFontStyleList); spinnerHeaderTextFontStyle.setAdapter(headerTextFontStyleListAdapter); titleAlignmentList = new ArrayList<Pair<String, String>>(); titleAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); titleAlignmentList.add(new Pair<String, String>(getString(R.string.center), "Center")); titleAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair titleAlignmentListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, titleAlignmentList); spinnerTitleAlignment.setAdapter(titleAlignmentListAdapter); hintAlignmentList = new ArrayList<Pair<String, String>>(); hintAlignmentList.add(new Pair<String, String>(getString(R.string.center), "Center")); hintAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); hintAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); SpinnerAdapterForPair hintAlignmentListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, hintAlignmentList); spinnerHintAlignment.setAdapter(hintAlignmentListAdapter); titleImageAlignmentList = new ArrayList<Pair<String, String>>(); titleImageAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); titleImageAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); titleImageAlignmentList.add(new Pair<String, String>(getString(R.string.center), "Center")); SpinnerAdapterForPair titleImageAlignmentListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, titleImageAlignmentList); spinnerTitleImageAlignment.setAdapter(titleImageAlignmentListAdapter); idCaptureBorderList = new ArrayList<Pair<String, String>>(); idCaptureBorderList.add(new Pair<String, String>(getString(R.string.thin), "Thin")); idCaptureBorderList.add(new Pair<String, String>(getString(R.string.thick), "Thick")); SpinnerAdapterForPair idCaptureBorderListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, idCaptureBorderList); spinnerIDCaptureBorder.setAdapter(idCaptureBorderListAdapter); // spinnerLabel.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, LABELS_KEY)); } private void setSelfieCaptureSpinnerAdapter() { ArrayList<Pair<String,String>> titleList = new ArrayList<Pair<String,String>>(); titleList.add(new Pair<String, String>(getString(R.string.none),"None")); titleList.add(new Pair<String, String>(getString(R.string.title_image_1),"Title Image 1")); SpinnerAdapterForPair titleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, titleList); spinnerFaceTitle.setAdapter(titleListAdapter); faceTextFontTypeList = new ArrayList<Pair<String, String>>(); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair textFontTypeListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTextFontTypeList); faceSpinnerTextFontType.setAdapter(textFontTypeListAdapter); faceTextFontStyleList = new ArrayList<Pair<String, String>>(); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair textFontStyleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTextFontStyleList); faceSpinnerTextFontStyle.setAdapter(textFontStyleListAdapter); faceHeaderTextFontTypeList = new ArrayList<Pair<String, String>>(); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair headerTextFontTypeListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceHeaderTextFontTypeList); faceSpinnerHeaderTextFontType.setAdapter(headerTextFontTypeListAdapter); facehHeaderTextFontStyleList = new ArrayList<Pair<String, String>>(); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair headerTextFontStyleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, facehHeaderTextFontStyleList); faceSpinnerHeaderTextFontStyle.setAdapter(headerTextFontStyleListAdapter); faceTitleAlignmentList = new ArrayList<Pair<String, String>>(); faceTitleAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); faceTitleAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair titleAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTitleAlignmentList); faceSpinnerTitleAlignment.setAdapter(titleAlignmentListAdapter); faceHintMsgAlignmentList = new ArrayList<Pair<String, String>>(); faceHintMsgAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); faceHintMsgAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); SpinnerAdapterForPair hintMsgAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceHintMsgAlignmentList); faceSpinnerHintMsgAlignment.setAdapter(hintMsgAlignmentListAdapter); faceHintIconAlignmentList = new ArrayList<Pair<String, String>>(); faceHintIconAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); faceHintIconAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair hintIconAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceHintIconAlignmentList); faceSpinnerHintIconAlignment.setAdapter(hintIconAlignmentListAdapter); faceTitleImageAlignmentList = new ArrayList<Pair<String, String>>(); faceTitleImageAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); faceTitleImageAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair titleImageAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTitleImageAlignmentList); faceSpinnerTitleImageAlignment.setAdapter(titleImageAlignmentListAdapter); faceContoursList = new ArrayList<Pair<String, String>>(); faceContoursList.add(new Pair<String, String>(getString(R.string.low), "Low")); faceContoursList.add(new Pair<String, String>(getString(R.string.medium), "Medium")); faceContoursList.add(new Pair<String, String>(getString(R.string.all), "All")); faceContoursList.add(new Pair<String, String>(getString(R.string.zero), "Zero")); SpinnerAdapterForPair faceContoursListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceContoursList); faceSpinnerFaceContours.setAdapter(faceContoursListAdapter); } private void setVoiceRecordingSpinnerAdapter() { voiceDisplayPositionList = new ArrayList<Pair<String, String>>(); voiceDisplayPositionList.add(new Pair<String, String>(getString(R.string.top), "Top")); voiceDisplayPositionList.add(new Pair<String, String>(getString(R.string.center), "Center")); voiceDisplayPositionList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair voiceDisplayPositionListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, voiceDisplayPositionList); voiceDisplayPositionSpinner.setAdapter(voiceDisplayPositionListAdapter); } private void setIDCaptureDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { uiConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { uiConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { uiConfig = CustomizeUIConfigManager.getDefaultSecIDCaptureFrontConfig(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { uiConfig = CustomizeUIConfigManager.getDefaultSecIDCaptureBackConfig(); } if (null != uiConfig) { setIdCaptureField(uiConfig); } } private void setIdCaptureField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> idCaptureUIMap = customizeUIConfig.getUIConfiguration(); HashMap<String, String> idCaptureLabelMap = customizeUIConfig.getLabelConfiguration(); String idOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTLINE_COLOR); String idOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTLINE_COLOR_ALPHA); String detectedIdOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR); String detectedIdOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR_ALPHA); String idOutsideOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR); String idOutsideOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR_APLHA); String detectedIdOutsideOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR); String detectedIdOutsideOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR_ALPHA); String textFontType = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_TYPE); String textFontStyle = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_STYLE); String backButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_BACK_BUTTON_COLOR); String backButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_BACK_BUTTON_COLOR_ALPHA); String retryButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_COLOR); String retryButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_COLOR_ALPHA); String retryButtonBorderColor = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR); String retryButtonBorderAlpha = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR_ALPHA); String confirmButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR); String confirmButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR_ALPHA); String confirmButtonStyle = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR); String confirmButtonStyleAlpha = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA); String textLabelColor = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_COLOR); String textLabelAlpha = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_ALPHA); String instructionContinueBtnColor = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_COLOR); String instructionContinueBtnColorAlpha = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_ALPHA); String instructionContinueBtnTxtColor = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_COLOR); String instructionContinueBtnTxtAlpha = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_ALPHA); String headerTextColorEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_LABEL_COLOR); String headerTextAlphaEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_LABEL_ALPHA); String headerTextSizeEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_LABEL_SIZE); String textSizeEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_SIZE); String headerTextFontType = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_TYPE); String headerTextFontStyle = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_STYLE); String idCaptureBorderType = idCaptureUIMap.get(UIConfigConstants.ID_ID_CAPTURE_BORDER_STYLE); String titleAlignment = idCaptureUIMap.get(UIConfigConstants.ID_TITLE_LABEL_ALIGNMENT); String hintAlignment = idCaptureUIMap.get(UIConfigConstants.ID_HINT_MESSAGE_ALIGNMENT); String titleImageAlignment = idCaptureUIMap.get(UIConfigConstants.ID_TITLE_IMAGE_ALIGNMENT); String hideIdCaptureTitle = idCaptureUIMap.get(UIConfigConstants.ID_HIDE_ID_TITLE_LABEL); String hideIdCaptureHintMsg = idCaptureUIMap.get(UIConfigConstants.ID_HIDE_ID_HINT_MESSAGE); String hideIdCaptureTitleImg = idCaptureUIMap.get(UIConfigConstants.ID_HIDE_ID_TITLE_IMAGE); String idTitleImageBitmap = idCaptureUIMap.get(UIConfigConstants.ID_TITLE_IMG_BITMAP_BASE64); String captureButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_CAPTURE_BUTTON_COLOR); String captureButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_CAPTURE_BUTTON_ALPHA); String showInstScreen = idCaptureUIMap.get(UIConfigConstants.ID_SHOW_INSTRUCTION); String idLabelShadowEnable = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_SHADOW_ENABLE); idOutlineColorEdtTxt.setText(idOutlineColor); idOutlineAlphaEdtTxt.setText(idOutlineAlpha); detectedIdOutlineColorEdtTxt.setText(detectedIdOutlineColor); detectedIdOutlineAlphaEdtTxt.setText(detectedIdOutlineAlpha); idOutsideOutlineColorEdtTxt.setText(idOutsideOutlineColor); idOutsideOutlineAlphaEdtTxt.setText(idOutsideOutlineAlpha); detectedOutsideOutlineColorEdtTxt.setText(detectedIdOutsideOutlineColor); detectedOutsideOutlineAlphaEdtTxt.setText(detectedIdOutsideOutlineAlpha); backButtonColorEdtTxt.setText(backButtonColor); backButtonAlphaEdtTxt.setText(backButtonAlpha); retryButtonColorEdtTxt.setText(retryButtonColor); retryButtonAlphaEdtTxt.setText(retryButtonAlpha); retryButtonBorderColorEdtTxt.setText(retryButtonBorderColor); retryButtonBorderAlphaEdtTxt.setText(retryButtonBorderAlpha); confirmButtonColorEdtTxt.setText(confirmButtonColor); confirmButtonAlphaEdtTxt.setText(confirmButtonAlpha); confirmButtonStyleEdtTxt.setText(confirmButtonStyle); confirmButtonStyleAlphaEdtTxt.setText(confirmButtonStyleAlpha); textLabelColorEdtTxt.setText(textLabelColor); textLabelAlphaEdtTxt.setText(textLabelAlpha); instructionContinueBtnColorEdtTxt.setText(instructionContinueBtnColor); instructionContinueBtnAlphaEdtTxt.setText(instructionContinueBtnColorAlpha); instructionContinueBtnTxtColorEdtTxt.setText(instructionContinueBtnTxtColor); instructionContinueBtnTxtAlphaEdtTxt.setText(instructionContinueBtnTxtAlpha); headerTextLabelColorEdtTxt.setText(headerTextColorEdtTxt); headerTextLabelAlphaEdtTxt.setText(headerTextAlphaEdtTxt); headerTextLabelSizeEdtTxt.setText(headerTextSizeEdtTxt); textLabelSizeEdtTxt.setText(textSizeEdtTxt); captureButtonColorEdtTxt.setText(captureButtonColor); captureButtonColorAlphaEdtTxt.setText(captureButtonAlpha); spinnerTextFontType.setSelection(getPositionInPair(textFontTypeList, textFontType)); spinnerTextFontStyle.setSelection(getPositionInPair(textFontStyleList, textFontStyle)); spinnerTitleAlignment.setSelection(getPositionInPair(titleAlignmentList, titleAlignment)); spinnerHintAlignment.setSelection(getPositionInPair(hintAlignmentList, hintAlignment)); spinnerTitleImageAlignment.setSelection(getPositionInPair(titleImageAlignmentList, titleImageAlignment)); spinnerHeaderTextFontType.setSelection(getPositionInPair(headerTextFontTypeList, headerTextFontType)); spinnerHeaderTextFontStyle.setSelection(getPositionInPair(headerTextFontStyleList, headerTextFontStyle)); spinnerIDCaptureBorder.setSelection(getPositionInPair(idCaptureBorderList, idCaptureBorderType)); spinnerTitle.setSelection(idTitleImageBitmap.isEmpty() ? 0 : 1); radioGroupInstruction.check(showInstScreen.equalsIgnoreCase("N") ? radioGroupInstruction.getChildAt(0).getId() : radioGroupInstruction.getChildAt(1).getId()); titleAlignmentCB.setChecked(!hideIdCaptureTitle.equalsIgnoreCase("N")); hintAlignmentCB.setChecked(!hideIdCaptureHintMsg.equalsIgnoreCase("N")); titleImageAlignmentCB.setChecked(!hideIdCaptureTitleImg.equalsIgnoreCase("N")); enableLabelShadowSwitch.setChecked(idLabelShadowEnable.equalsIgnoreCase("Y") ? true : false); spinnerLabel.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, setToArray(idCaptureLabelMap.keySet()))); } private void updateIDConfig(String featureType) { HashMap<String, String> ui = null; if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { ui = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { ui = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { ui = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { ui = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { ui = CustomizeUIConfigManager.getDefaultSecIDCaptureFrontConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { ui = CustomizeUIConfigManager.getDefaultSecIDCaptureBackConfig().getUIConfiguration(); } if (ui != null) { ui.put(UIConfigConstants.ID_ID_OUTLINE_COLOR, idOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_ID_OUTLINE_COLOR_ALPHA, idOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR, detectedIdOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR_ALPHA, detectedIdOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR, idOutsideOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR_APLHA, idOutsideOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR, detectedOutsideOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR_ALPHA, detectedOutsideOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_BACK_BUTTON_COLOR, backButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_BACK_BUTTON_COLOR_ALPHA, backButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_COLOR, retryButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_COLOR_ALPHA, retryButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR, retryButtonBorderColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR_ALPHA, retryButtonBorderAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR, confirmButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR_ALPHA, confirmButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR, confirmButtonStyleEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA, confirmButtonStyleAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_COLOR, textLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_ALPHA, textLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_COLOR, instructionContinueBtnColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_ALPHA, instructionContinueBtnAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_COLOR, instructionContinueBtnTxtColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_ALPHA, instructionContinueBtnTxtAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_HEADER_TEXT_LABEL_COLOR, headerTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_HEADER_TEXT_LABEL_ALPHA, headerTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_HEADER_TEXT_LABEL_SIZE, headerTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_SIZE, textLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CAPTURE_BUTTON_COLOR, captureButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CAPTURE_BUTTON_ALPHA, captureButtonColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_TYPE, ((Pair) spinnerTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_STYLE, ((Pair) spinnerTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_TYPE, ((Pair) spinnerHeaderTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_STYLE, ((Pair) spinnerHeaderTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_ID_CAPTURE_BORDER_STYLE, ((Pair) spinnerIDCaptureBorder.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_TITLE_LABEL_ALIGNMENT, ((Pair) spinnerTitleAlignment.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_HINT_MESSAGE_ALIGNMENT, ((Pair) spinnerHintAlignment.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_TITLE_IMAGE_ALIGNMENT, ((Pair) spinnerTitleImageAlignment.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_SHOW_INSTRUCTION, (radioGroupInstruction.getCheckedRadioButtonId() == R.id.radio_button_no) ? "N" : "Y"); ui.put(UIConfigConstants.ID_HIDE_ID_TITLE_LABEL, titleAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.ID_HIDE_ID_HINT_MESSAGE, hintAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.ID_HIDE_ID_TITLE_IMAGE, titleImageAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.ID_TITLE_IMG_BITMAP_BASE64, getConvertedBaset64Image(((Pair) spinnerTitle.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.ID_LABEL_SHADOW_ENABLE, enableLabelShadowSwitch.isChecked() ? "Y" : "N"); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); } } private void setSelfieCaptureDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig(); } if (null != uiConfig) { setSelfieCaptureField(uiConfig); } } private void setSelfieCaptureField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> selfieCaptureUIMap = customizeUIConfig.getUIConfiguration(); HashMap<String, String> selfieCaptureLabelMap = customizeUIConfig.getLabelConfiguration(); String faceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTLINE_COLOR); String faceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTLINE_COLOR_ALPHA); String detectedFaceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR); String detectedFaceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR_ALPHA); String outsideFaceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR); String outsideFaceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA); String detectedOutsideFaceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR); String detectedOutsideFaceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA); String textFontType = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_TYPE); String textFontStyle = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_STYLE); String backButtonColor = selfieCaptureUIMap.get(UIConfigConstants.FD_BACK_BUTTON_COLOR); String backButtonAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_BACK_BUTTON_COLOR_ALPHA); String retryButtonColor = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_COLOR); String retryButtonAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_COLOR_ALPHA); String retryButtonBorderColor = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR); String retryButtonBorderAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR_ALPHA); String confirmButtonColor = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR); String confirmButtonAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR_ALPHA); String confirmButtonStyle = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR); String confirmButtonStyleAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA); String textLabelColor = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_COLOR); String textLabelAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_ALPHA); String instructionContinueBtnColor = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_COLOR); String instructionContinueBtnColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_ALPHA); String instructionContinueBtnTxtColor = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_COLOR); String instructionContinueBtnTxtAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_ALPHA); String faceContours = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_CONTOURS); String headerTextColorEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_LABEL_COLOR); String headerTextAlphaEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_LABEL_ALPHA); String headerTextSizeEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_LABEL_SIZE); String textSizeEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_SIZE); String headerTextFontType = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_TYPE); String headerTextFontStyle = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_STYLE); String titleAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_TITLE_LABEL_ON_TOP); String hintMsgAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_HINT_MESSAGE_ON_TOP); String hintIconAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_HINT_ICON_ON_TOP); String titleImageAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_TITLE_IMAGE_ON_TOP); String hideTitleAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_FACE_TITLE_LABEL); String hideHintMsgAlignemnt = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_FACE_HINT_MESSAGE); String hideHintIconAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_FACE_HINT_ICON); String hideTitleImageAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_TITLE_IMAGE); String faceTitleImageBitmap = selfieCaptureUIMap.get(UIConfigConstants.FD_TITLE_IMG_BITMAP_BASE64); String showCustomUI = selfieCaptureUIMap.get(UIConfigConstants.FD_SHOW_CUSTOM_UI); String showInstScreen = selfieCaptureUIMap.get(UIConfigConstants.FD_SHOW_INSTRUCTION_SCREEN); String showPrevScreen = selfieCaptureUIMap.get(UIConfigConstants.FD_SHOW_PREVIEW_SCREEN); String fdLabelShadowEnable = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_SHADOW_ENABLE); String instructionPreviewBackgroundColor = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR); String instructionPreviewBackgroundColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR_ALPHA); faceOutlineColorEdtTxt.setText(faceOutlineColor); faceOutlineColorAlphaEdtTxt.setText(faceOutlineColorAlpha); detectedFaceOutlineColorEdtTxt.setText(detectedFaceOutlineColor); detectedFaceOutlineColorAlphaEdtTxt.setText(detectedFaceOutlineColorAlpha); outsideFaceOutlineColorEdtTxt.setText(outsideFaceOutlineColor); outsideFaceOutlineColorAlphaEdtTxt.setText(outsideFaceOutlineColorAlpha); outsideDetectedFaceOutlineColor.setText(detectedOutsideFaceOutlineColor); outsideDetectedFaceOutlineColorAlpha.setText(detectedOutsideFaceOutlineColorAlpha); faceBackButtonColorEdtTxt.setText(backButtonColor); faceBackButtonAlphaEdtTxt.setText(backButtonAlpha); faceRetryButtonColorEdtTxt.setText(retryButtonColor); faceRetryButtonAlphaEdtTxt.setText(retryButtonAlpha); faceRetryButtonBorderColorEdtTxt.setText(retryButtonBorderColor); faceRetryButtonBorderAlphaEdtTxt.setText(retryButtonBorderAlpha); faceConfirmButtonColorEdtTxt.setText(confirmButtonColor); faceConfirmButtonAlphaEdtTxt.setText(confirmButtonAlpha); faceConfirmButtonStyleEdtTxt.setText(confirmButtonStyle); faceConfirmButtonStyleAlphaEdtTxt.setText(confirmButtonStyleAlpha); faceTextLabelColorEdtTxt.setText(textLabelColor); faceTextLabelAlphaEdtTxt.setText(textLabelAlpha); faceInstructionContinueBtnColorEdtTxt.setText(instructionContinueBtnColor); faceInstructionContinueBtnAlphaEdtTxt.setText(instructionContinueBtnColorAlpha); faceInstructionContinueBtnTxtColorEdtTxt.setText(instructionContinueBtnTxtColor); faceInstructionContinueBtnTxtAlphaEdtTxt.setText(instructionContinueBtnTxtAlpha); faceHeaderTextLabelColorEdtTxt.setText(headerTextColorEdtTxt); faceHeaderTextLabelAlphaEdtTxt.setText(headerTextAlphaEdtTxt); faceHeaderTextLabelSizeEdtTxt.setText(headerTextSizeEdtTxt); faceTextLabelSizeEdtTxt.setText(textSizeEdtTxt); faceInstructionPreviewBackgroundEdtTxt.setText(instructionPreviewBackgroundColor); faceInstructionPreviewBackgroundAlphaEdtTxt.setText(instructionPreviewBackgroundColorAlpha); faceSpinnerTextFontType.setSelection(getPositionInPair(faceTextFontTypeList, textFontType)); faceSpinnerTextFontStyle.setSelection(getPositionInPair(faceTextFontStyleList, textFontStyle)); faceSpinnerHeaderTextFontType.setSelection(getPositionInPair(faceHeaderTextFontTypeList, headerTextFontType)); faceSpinnerHeaderTextFontStyle.setSelection(getPositionInPair(facehHeaderTextFontStyleList, headerTextFontStyle)); faceSpinnerFaceContours.setSelection(getPositionInPair(faceContoursList, faceContours)); faceSpinnerTitleAlignment.setSelection(getPositionInPair(faceTitleAlignmentList, getFacePosition(titleAlignment))); faceSpinnerHintMsgAlignment.setSelection(getPositionInPair(faceHintMsgAlignmentList, getFacePosition(hintMsgAlignment))); faceSpinnerTitleImageAlignment.setSelection(getPositionInPair(faceTitleImageAlignmentList, getFacePosition(titleImageAlignment))); faceSpinnerHintIconAlignment.setSelection(getPositionInPair(faceHintIconAlignmentList, getFacePosition(hintIconAlignment))); spinnerFaceTitle.setSelection(faceTitleImageBitmap.isEmpty() ? 0 : 1); showInstructionFaceDetect.setChecked(showInstScreen.equalsIgnoreCase("Y") ? true : false); showPreviewScreenCheckBox.setChecked(showPrevScreen.equalsIgnoreCase("Y") ? true : false); faceTitleAlignmentCB.setChecked(!hideTitleAlignment.equalsIgnoreCase("N")); faceHintMsgAlignmentCB.setChecked(!hideHintMsgAlignemnt.equalsIgnoreCase("N")); faceHintIconAlignmentCB.setChecked(!hideHintIconAlignment.equalsIgnoreCase("N")); faceTitleImageAlignmentCB.setChecked(!hideTitleImageAlignment.equalsIgnoreCase("N")); showCustomOverlay.setChecked(showCustomUI.equalsIgnoreCase("Y")); faceEnableLabelShadowSwitch.setChecked(fdLabelShadowEnable.equalsIgnoreCase("Y") ? true : false); faceSpinnerLabel.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, setToArray(selfieCaptureLabelMap.keySet()))); } private void updateSelfieConfig(String featureType) { HashMap<String, String> ui = null; ui = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getUIConfiguration(); if (ui != null) { ui.put(UIConfigConstants.FD_OUTLINE_COLOR, faceOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_OUTLINE_COLOR_ALPHA, faceOutlineColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR, detectedFaceOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR_ALPHA, detectedFaceOutlineColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR, outsideFaceOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA, outsideFaceOutlineColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR, outsideDetectedFaceOutlineColor.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA, outsideDetectedFaceOutlineColorAlpha.getText().toString().trim()); ui.put(UIConfigConstants.FD_BACK_BUTTON_COLOR, faceBackButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_BACK_BUTTON_COLOR_ALPHA, faceBackButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_COLOR, faceRetryButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_COLOR_ALPHA, faceRetryButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR, faceRetryButtonBorderColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR_ALPHA, faceRetryButtonBorderAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR, faceConfirmButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR_ALPHA, faceConfirmButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR, faceConfirmButtonStyleEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA, faceConfirmButtonStyleAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_LABEL_TEXT_COLOR, faceTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_LABEL_TEXT_ALPHA, faceTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_COLOR, faceInstructionContinueBtnColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_ALPHA, faceInstructionContinueBtnAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_COLOR, faceInstructionContinueBtnTxtColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_ALPHA, faceInstructionContinueBtnTxtAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_HEADER_TEXT_LABEL_COLOR, faceHeaderTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_HEADER_TEXT_LABEL_ALPHA, faceHeaderTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_HEADER_TEXT_LABEL_SIZE, faceHeaderTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_LABEL_TEXT_SIZE, faceTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR, faceInstructionPreviewBackgroundEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR_ALPHA, faceInstructionPreviewBackgroundAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_FACE_CONTOURS, ((Pair) faceSpinnerFaceContours.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_TYPE, ((Pair) faceSpinnerHeaderTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_STYLE, ((Pair) faceSpinnerHeaderTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_TYPE, ((Pair) faceSpinnerTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_STYLE, ((Pair) faceSpinnerTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_FACE_TITLE_LABEL_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerTitleAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_FACE_HINT_MESSAGE_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerHintMsgAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_FACE_HINT_ICON_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerHintIconAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_TITLE_IMAGE_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerTitleImageAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_SHOW_INSTRUCTION_SCREEN, showInstructionFaceDetect.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_SHOW_PREVIEW_SCREEN, showPreviewScreenCheckBox.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_FACE_TITLE_LABEL, faceTitleAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_FACE_HINT_MESSAGE, faceHintMsgAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_FACE_HINT_ICON, faceHintIconAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_TITLE_IMAGE, faceTitleImageAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_TITLE_IMG_BITMAP_BASE64, getConvertedBaset64Image(((Pair) spinnerFaceTitle.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_SHOW_CUSTOM_UI, showCustomOverlay.isChecked() ? "Y" : "N"); if (showCustomOverlay.isChecked()) { String progress = R.drawable.fd_progress_1 + "," + R.drawable.fd_progress_2 + "," + R.drawable.fd_progress_3 + "," + R.drawable.fd_progress_4 + "," + R.drawable.fd_progress_5 + "," + R.drawable.fd_progress_6 + "," + R.drawable.fd_progress_7 + "," + R.drawable.fd_progress_8 + "," + R.drawable.fd_progress_9 + "," + R.drawable.fd_progress_10 + "," + R.drawable.fd_progress_11; String turnArrow = R.drawable.left_turn_arrow + "," + R.drawable.up_move_arrow + "," + R.drawable.right_turn_arrow + "," + R.drawable.down_move_arrow; ui.put(UIConfigConstants.FD_SHOW_CUSTOM_UI, "Y"); ui.put(UIConfigConstants.FD_FACE_OUTLINE_IMAGE_ID, "" + R.drawable.fd_outline); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_IMAGE_ID, "" + R.drawable.fd_background); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES, progress); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES_DELAY, "500"); ui.put(UIConfigConstants.FD_FACE_TURN_ARROW_LIST, turnArrow); ui.put(UIConfigConstants.FD_TOGGLE_CAMERA_BUTTON_ICON, ""+R.drawable.fd_toggle_camera_icon); } else { ui.put(UIConfigConstants.FD_SHOW_CUSTOM_UI, "N"); ui.put(UIConfigConstants.FD_FACE_OUTLINE_IMAGE_ID, ""); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_IMAGE_ID, ""); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES, ""); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES_DELAY, "500"); ui.put(UIConfigConstants.FD_FACE_TURN_ARROW_LIST, ""); ui.put(UIConfigConstants.FD_TOGGLE_CAMERA_BUTTON_ICON, ""); } ui.put(UIConfigConstants.FD_LABEL_SHADOW_ENABLE, faceEnableLabelShadowSwitch.isChecked() ? "Y" : "N"); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); Log.d("", "" + ui); } } private void setFPCaptureDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultFingerPrintCaptureConfig(); } if (null != uiConfig) { setFPCaptureField(uiConfig); } } private void setFPCaptureField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> fpCaptureUIMap = customizeUIConfig.getUIConfiguration(); // HashMap<String, String> selfieCaptureLabelMap = customizeUIConfig.getLabelConfiguration(); String textFontType = fpCaptureUIMap.get(UIConfigConstants.CFC_LABEL_TEXT_COLOR); String textFontStyle = fpCaptureUIMap.get(UIConfigConstants.CFC_LABEL_TEXT_COLOR_ALPHA); String instButtonColor = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_COLOR); String intButtonAlpha = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_ALPHA); String intButtonTextColor = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_COLOR); String intButtonTextAlpha = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_ALPHA); fpTextLabelColorEdtTxt.setText(textFontType); fpTextLabelAlphaEdtTxt.setText(textFontStyle); fpInstructionContinueBtnColorEdtTxt.setText(instButtonColor); fpInstructionContinueBtnAlphaEdtTxt.setText(intButtonAlpha); fpInstructionContinueBtnTxtColorEdtTxt.setText(intButtonTextColor); fpInstructionContinueBtnTxtAlphaEdtTxt.setText(intButtonTextAlpha); } private void updateFingerPrintConfig(String featureType) { HashMap<String, String> ui = null; ui = CustomizeUIConfigManager.getDefaultFingerPrintCaptureConfig().getUIConfiguration(); if (ui != null) { ui.put(UIConfigConstants.CFC_LABEL_TEXT_COLOR, fpTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_LABEL_TEXT_COLOR_ALPHA, fpTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_COLOR, fpInstructionContinueBtnColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_ALPHA, fpInstructionContinueBtnAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_COLOR, fpInstructionContinueBtnTxtColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_ALPHA, fpInstructionContinueBtnTxtAlphaEdtTxt.getText().toString().trim()); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); //Log.d("", "" + ui); } } private void setVoiceRecordingDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { uiConfig = CustomizeUIConfigManager.getDefaultVoiceRecordingConfig(); } if (null != uiConfig) { setVoiceRecordingField(uiConfig); } } private void setVoiceRecordingField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> voiceRecordingUIMap = customizeUIConfig.getUIConfiguration(); HashMap<String, String> voiceRecordingLabelMap = customizeUIConfig.getLabelConfiguration(); String buttonColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BUTTON_COLOR); String buttonColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BUTTON_COLOR_ALPHA); String backgroundColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BACKGROUND_COLOR); String backgroundColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BACKGROUND_COLOR_ALPHA); String textLabelColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TEXT_LABEL_COLOR); String textLabelColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TEXT_LABEL_COLOR_ALPHA); String titleLabelColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_COLOR); String titleLabelColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_COLOR_ALPHA); String titleLabelSize = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_SIZE); String textLabelSize = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TEXT_LABEL_SIZE); String counterLabelSize = voiceRecordingUIMap.get(UIConfigConstants.VOICE_COUNTER_LABEL_SIZE); String displayPosition = voiceRecordingUIMap.get(UIConfigConstants.VOICE_DISPLAY_POSITION); String autoPlay = voiceRecordingUIMap.get(UIConfigConstants.VOICE_AUTO_PLAY); String titleLabelTop = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_TOP); voiceDisplayPositionSpinner.setSelection(getPositionInPair(voiceDisplayPositionList, displayPosition)); voiceTitleOnTopSwitch.setChecked(titleLabelTop.equalsIgnoreCase("Y") ? true : false); voiceAutoPlaySwitch.setChecked(autoPlay.equalsIgnoreCase("Y") ? true : false); voiceButtonColorEdtTxt.setText(buttonColor); voiceButtonColorAlphaEdtTxt.setText(buttonColorAlpha); voiceBackgroundColorEdtTxt.setText(backgroundColor); voiceBackgroundColorAlphaEdtTxt.setText(backgroundColorAlpha); voiceTextColorEdtTxt.setText(textLabelColor); voiceTextColorAlphaEdtTxt.setText(textLabelColorAlpha); voiceTitleColorEdtTxt.setText(titleLabelColor); voiceTitleColorAlphaEdtTxt.setText(titleLabelColorAlpha); voiceTitleLabelSizeEdtTxt.setText(titleLabelSize); voiceTextLabelSizeEdtTxt.setText(textLabelSize); voiceCounterLabelSizeEdtTxt.setText(counterLabelSize); voiceLabelSpinner.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, setToArray(voiceRecordingLabelMap.keySet()))); } private void updateVoiceRecordingConfig(String featureType) { HashMap<String, String> ui = null; ui = CustomizeUIConfigManager.getDefaultVoiceRecordingConfig().getUIConfiguration(); if (ui != null) { ui.put(UIConfigConstants.VOICE_BUTTON_COLOR, voiceButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_BUTTON_COLOR_ALPHA, voiceButtonColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_BACKGROUND_COLOR, voiceBackgroundColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_BACKGROUND_COLOR_ALPHA, voiceBackgroundColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TEXT_LABEL_COLOR, voiceTextColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TEXT_LABEL_COLOR_ALPHA, voiceTextColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_COLOR, voiceTitleColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_COLOR_ALPHA, voiceTitleColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_SIZE, voiceTitleLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TEXT_LABEL_SIZE, voiceTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_COUNTER_LABEL_SIZE, voiceCounterLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_DISPLAY_POSITION, ((Pair) voiceDisplayPositionSpinner.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_TOP, voiceTitleOnTopSwitch.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.VOICE_AUTO_PLAY, voiceAutoPlaySwitch.isChecked() ? "Y" : "N"); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); //Log.d("", "" + ui); } } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { resetButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.ID_CAPTURE_FRONT, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.ID_CAPTURE_BACK, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.FACE_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setSelfieCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.DOCUMENT_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.SNIPPET_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.FINGER_4F_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setFPCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); }else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.VOICE_RECORDING, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setVoiceRecordingDefaultValues(); } } }); addLabelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); HashMap<String, String> labelConfig = null; if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { // labelConfig = CustomizeUIConfigManager.get.getLabelConfiguration(); } if (null != labelConfig) { labelConfig.put(spinnerLabel.getSelectedItem().toString().toString(), labelValueEdtTxt.getText().toString().trim()); } labelValueEdtTxt.setText(""); //Log.d("", "" + labelConfig); } }); addFaceLabelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); HashMap<String, String> labelConfig = null; if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { // labelConfig = CustomizeUIConfigManager.get.getLabelConfiguration(); } if (null != labelConfig) { labelConfig.put(faceSpinnerLabel.getSelectedItem().toString().toString(), labelValueFaceEdtTxt.getText().toString().trim()); } Log.d("", "" + labelConfig); labelValueFaceEdtTxt.setText(""); } }); voiceAddLabelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); HashMap<String, String> labelConfig = null; if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { // labelConfig = CustomizeUIConfigManager.get.getLabelConfiguration(); }else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)){ labelConfig = CustomizeUIConfigManager.getDefaultVoiceRecordingConfig().getLabelConfiguration(); } if (null != labelConfig) { labelConfig.put(voiceLabelSpinner.getSelectedItem().toString().toString(), voiceLabelValueEdtTxt.getText().toString().trim()); } Log.d("", "" + labelConfig); voiceLabelValueEdtTxt.setText(""); } }); nextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { updateSelfieConfig(current_selected); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { updateFingerPrintConfig(current_selected); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { updateVoiceRecordingConfig(current_selected); } else { updateIDConfig(current_selected); } FragmentManager fragmentManager = getFragmentManager(); IDValidationFaceMatch idValidationFaceMatch = new IDValidationFaceMatch(); Bundle bundle = new Bundle(); bundle.putSerializable(IDDetails.SKIP_FEATURES_LIST, skipFeaturesList); idValidationFaceMatch.setArguments(bundle); fragmentManager.beginTransaction().replace(R.id.flContent, idValidationFaceMatch).addToBackStack(null).commit(); NavigationActivity.toolbar.setTitle(R.string.id_validation); hideKeyboard(getActivity(), view); ImageProcessingSDK.getInstance().customizeUserInterface(CustomizeUIConfigManager.getCompleteUIConfigJSON()); } }); backButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { getActivity().getSupportFragmentManager().popBackStack(); hideKeyboard(getActivity(), view); } }); spinnerUIConfig.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { String current_selected = ((Pair) adapterView.getSelectedItem()).second.toString(); if (!StringUtil.isEmpty(previously_selected_feature)) { if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { updateSelfieConfig(previously_selected_feature); } else if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { updateFingerPrintConfig(previously_selected_feature); } else if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { updateVoiceRecordingConfig(previously_selected_feature); } else if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { updateIDConfig(previously_selected_feature); } } //Assign only after calling above function(updateIDConfig) previously_selected_feature = current_selected; idCaptureView.setVisibility(View.GONE); selfieCaptureView.setVisibility(View.GONE); fingerprintCaptureView.setVisibility(View.GONE); voiceRecordingView.setVisibility(View.GONE); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { idCaptureView.setVisibility(View.VISIBLE); //setIDFrontValues(); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { idCaptureView.setVisibility(View.VISIBLE); //setIDBackValues(); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { selfieCaptureView.setVisibility(View.VISIBLE); setSelfieCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { setFPCaptureDefaultValues(); fingerprintCaptureView.setVisibility(View.VISIBLE); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { voiceRecordingView.setVisibility(View.VISIBLE); setVoiceRecordingDefaultValues(); } } @Override public void onNothingSelected(AdapterView<?> adapterView) { } }); super.onViewCreated(view, savedInstanceState); } @Override public void onResume() { super.onResume(); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (!StringUtil.isEmpty(current_selected)) { if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { setSelfieCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { setFPCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)){ setVoiceRecordingDefaultValues(); }else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { setIDCaptureDefaultValues(); } } } public static void hideKeyboard(Context context, View view) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } private int getPositionInPair(ArrayList<Pair<String, String>> pairList, String value) { for (int i = 0; i < pairList.size(); i++) { Pair<String, String> pair = pairList.get(i); if (value.equalsIgnoreCase(pair.second)) { return i; } } return -1; } private String getFacePosition(String value) { String faceOnTop = "Top"; if (value.equalsIgnoreCase("N")) { faceOnTop = "Bottom"; } else { faceOnTop = "Top"; } return faceOnTop; } private String setJsonFormatFacePosition(String value) { String faceOnTop = "Y"; if (value.equalsIgnoreCase("Bottom")) { faceOnTop = "N"; } else { faceOnTop = "Y"; } return faceOnTop; } private String[] setToArray(Set<String> set) { int siz = set.size(); String[] arr = new String[siz]; int i = 0; for (String s : set) { arr[i++] = s; } return arr; } private String getConvertedBaset64Image(String selectedImage) { Bitmap titleBitmap = null; String base64Image=null; if (!selectedImage.equalsIgnoreCase("None")) { titleBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.title_image); base64Image= BitmapUtils.bitmapToBase64(titleBitmap); }else{ base64Image=""; } return base64Image; } }
UTF-8
Java
99,754
java
CustomizeUIConfiguration.java
Java
[]
null
[]
package com.idmission.libtestproject.fragments; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.util.Log; import android.util.Pair; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.RadioGroup; import android.widget.Spinner; import com.idmission.client.ImageProcessingSDK; import com.idmission.libtestproject.R; import com.idmission.libtestproject.activity.NavigationActivity; import com.idmission.libtestproject.adapter.SpinnerAdapterForPair; import com.idmission.libtestproject.classes.CustomizeUIConfig; import com.idmission.libtestproject.classes.CustomizeUIConfigManager; import com.idmission.libtestproject.classes.UIConfigConstants; import com.idmission.libtestproject.utils.BitmapUtils; import com.idmission.libtestproject.utils.CommonUtils; import com.idmission.libtestproject.utils.PreferenceUtils; import com.idmission.libtestproject.utils.StringUtil; import java.util.ArrayList; import java.util.HashMap; import java.util.Set; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; public class CustomizeUIConfiguration extends Fragment { private Spinner spinnerUIConfig, spinnerTitle, spinnerFaceTitle ,spinnerTitleAlignment, spinnerHintAlignment, spinnerTitleImageAlignment, spinnerLabel, spinnerTextFontType, spinnerTextFontStyle, spinnerHeaderTextFontType, spinnerHeaderTextFontStyle, spinnerIDCaptureBorder; private View idCaptureView, selfieCaptureView, fingerprintCaptureView, voiceRecordingView; private Button backButton, nextButton, addLabelButton, addFaceLabelButton, resetButton; public static ArrayList<String> skipFeaturesList = new ArrayList<>(); //Id Capture private EditText idOutlineColorEdtTxt, idOutlineAlphaEdtTxt, detectedIdOutlineColorEdtTxt, detectedIdOutlineAlphaEdtTxt, idOutsideOutlineColorEdtTxt, idOutsideOutlineAlphaEdtTxt, detectedOutsideOutlineColorEdtTxt, detectedOutsideOutlineAlphaEdtTxt, backButtonColorEdtTxt, retryButtonColorEdtTxt, confirmButtonColorEdtTxt, backButtonAlphaEdtTxt, retryButtonAlphaEdtTxt, confirmButtonAlphaEdtTxt, textLabelColorEdtTxt, textLabelAlphaEdtTxt, instructionContinueBtnColorEdtTxt, instructionContinueBtnAlphaEdtTxt, instructionContinueBtnTxtColorEdtTxt, instructionContinueBtnTxtAlphaEdtTxt, retryButtonBorderColorEdtTxt, confirmButtonStyleEdtTxt, retryButtonBorderAlphaEdtTxt, confirmButtonStyleAlphaEdtTxt, headerTextLabelColorEdtTxt, headerTextLabelAlphaEdtTxt, headerTextLabelSizeEdtTxt, textLabelSizeEdtTxt, labelValueEdtTxt, labelValueFaceEdtTxt, captureButtonColorEdtTxt, captureButtonColorAlphaEdtTxt; private CheckBox titleAlignmentCB, hintAlignmentCB, titleImageAlignmentCB; private ArrayList<Pair<String, String>> textFontTypeList, textFontStyleList, headerTextFontTypeList, headerTextFontStyleList, titleAlignmentList, hintAlignmentList, titleImageAlignmentList, idCaptureBorderList; //selfie capture private EditText faceOutlineColorEdtTxt, detectedFaceOutlineColorEdtTxt, outsideFaceOutlineColorEdtTxt, faceOutlineColorAlphaEdtTxt, detectedFaceOutlineColorAlphaEdtTxt, outsideFaceOutlineColorAlphaEdtTxt, outsideDetectedFaceOutlineColor, outsideDetectedFaceOutlineColorAlpha, faceBackButtonColorEdtTxt, faceRetryButtonColorEdtTxt, faceConfirmButtonColorEdtTxt, faceRetryButtonBorderAlphaEdtTxt, faceConfirmButtonStyleAlphaEdtTxt, faceBackButtonAlphaEdtTxt, faceRetryButtonAlphaEdtTxt, faceConfirmButtonAlphaEdtTxt, faceRetryButtonBorderColorEdtTxt, faceConfirmButtonStyleEdtTxt, faceTextLabelColorEdtTxt, faceTextLabelAlphaEdtTxt, faceInstructionContinueBtnColorEdtTxt, faceInstructionContinueBtnAlphaEdtTxt, faceInstructionContinueBtnTxtColorEdtTxt, faceInstructionContinueBtnTxtAlphaEdtTxt, faceHeaderTextLabelColorEdtTxt, faceHeaderTextLabelAlphaEdtTxt, faceHeaderTextLabelSizeEdtTxt, faceTextLabelSizeEdtTxt, faceInstructionPreviewBackgroundEdtTxt, faceInstructionPreviewBackgroundAlphaEdtTxt; private Spinner faceSpinnerTextFontType, faceSpinnerTextFontStyle, faceSpinnerFaceContours, faceSpinnerHeaderTextFontType, faceSpinnerHeaderTextFontStyle, faceSpinnerTitleAlignment, faceSpinnerHintMsgAlignment, faceSpinnerHintIconAlignment, faceSpinnerTitleImageAlignment, faceSpinnerLabel; private CheckBox faceTitleAlignmentCB, faceHintMsgAlignmentCB, faceHintIconAlignmentCB, faceTitleImageAlignmentCB, showCustomOverlay; private ArrayList<Pair<String, String>> faceTextFontTypeList, faceTextFontStyleList, faceHeaderTextFontTypeList, facehHeaderTextFontStyleList, faceTitleAlignmentList, faceHintMsgAlignmentList, faceHintIconAlignmentList, faceTitleImageAlignmentList, faceContoursList; //4F Capture private EditText fpTextLabelColorEdtTxt, fpTextLabelAlphaEdtTxt, fpInstructionContinueBtnColorEdtTxt, fpInstructionContinueBtnAlphaEdtTxt, fpInstructionContinueBtnTxtColorEdtTxt, fpInstructionContinueBtnTxtAlphaEdtTxt; private String previously_selected_feature; private RadioGroup radioGroupInstruction; private SwitchCompat showPreviewScreenCheckBox, showInstructionFaceDetect, enableLabelShadowSwitch, faceEnableLabelShadowSwitch; //Voice Recording private EditText voiceButtonColorEdtTxt, voiceButtonColorAlphaEdtTxt, voiceBackgroundColorEdtTxt, voiceBackgroundColorAlphaEdtTxt, voiceTextColorEdtTxt, voiceTextColorAlphaEdtTxt, voiceTitleColorEdtTxt, voiceTitleColorAlphaEdtTxt, voiceTitleLabelSizeEdtTxt, voiceTextLabelSizeEdtTxt, voiceCounterLabelSizeEdtTxt, voiceLabelValueEdtTxt; private Spinner voiceDisplayPositionSpinner, voiceLabelSpinner; private Button voiceAddLabelButton; private SwitchCompat voiceTitleOnTopSwitch, voiceAutoPlaySwitch; private ArrayList<Pair<String, String>> voiceDisplayPositionList; @Override public void onAttach(Context context) { super.onAttach(context); } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { CommonUtils.updateLanguage(getActivity(), PreferenceUtils.getPreference(getActivity(), AccountSetup.LANGUAGE, AccountSetup.DEFAULT_LANGUAGE)); View view = inflater.inflate(R.layout.customize_ui_configuration, container, false); skipFeaturesList = (ArrayList<String>) getArguments().getSerializable(IDDetails.SKIP_FEATURES_LIST); spinnerUIConfig = (Spinner) view.findViewById(R.id.spinner_configuration); backButton = (Button) view.findViewById(R.id.button_back); nextButton = (Button) view.findViewById(R.id.button_next); resetButton= (Button) view.findViewById(R.id.button_reset); idCaptureView = view.findViewById(R.id.custom_id_capture_lay); selfieCaptureView = view.findViewById(R.id.custom_selfie_capture_lay); fingerprintCaptureView = view.findViewById(R.id.custom_4f_fingerprint_capture_lay); voiceRecordingView = view.findViewById(R.id.custom_voice_recording_lay); initializedIdCapture(); initializedSelfieCapture(); initializedFPCapture(); initializedVoiceRecording(); setIDCaptureSpinnerAdapter(); setSelfieCaptureSpinnerAdapter(); setVoiceRecordingSpinnerAdapter(); setIDCaptureDefaultValues(); return view; } private void initializedIdCapture() { idOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.id_outline_color); idOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_id_outline_color); detectedIdOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.detected_id_outline_color); detectedIdOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_detected_id_outline_color); idOutsideOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.color_outside_outline); idOutsideOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_color_outside_outline); detectedOutsideOutlineColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.detected_color_outside_outline); detectedOutsideOutlineAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_detected_color_outside_outline); backButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.back_button_color); retryButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.retry_button_color); confirmButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.confirm_button_color); retryButtonBorderColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.retry_button_border_color); confirmButtonStyleEdtTxt = (EditText) idCaptureView.findViewById(R.id.confirm_button_style); backButtonAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_back_button_color); retryButtonAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_retry_button_color); confirmButtonAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_confirm_button_color); retryButtonBorderAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_retry_button_border_color); confirmButtonStyleAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_confirm_button_style); textLabelColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.text_label_color); textLabelAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_text_label_color); instructionContinueBtnColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.instruction_continue_button_color); instructionContinueBtnAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_instruction_continue_button); instructionContinueBtnTxtColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.instruction_continue_button_text_color); instructionContinueBtnTxtAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_instruction_continue_button_text); headerTextLabelColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.text_header_label_color); headerTextLabelAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_text_header_label_color); headerTextLabelSizeEdtTxt = (EditText) idCaptureView.findViewById(R.id.Header_text_size); textLabelSizeEdtTxt = (EditText) idCaptureView.findViewById(R.id.text_size); labelValueEdtTxt = (EditText) idCaptureView.findViewById(R.id.label_value); spinnerTextFontType = (Spinner) idCaptureView.findViewById(R.id.text_font_type_spinner); spinnerTextFontStyle = (Spinner) idCaptureView.findViewById(R.id.text_font_style_spinner); spinnerTitle = (Spinner) idCaptureView.findViewById(R.id.spinner_title); spinnerTitleAlignment = (Spinner) idCaptureView.findViewById(R.id.spinner_title_alignment); spinnerHintAlignment = (Spinner) idCaptureView.findViewById(R.id.spinner_hint_alignment); spinnerTitleImageAlignment = (Spinner) idCaptureView.findViewById(R.id.spinner_title_image_alignment); spinnerHeaderTextFontType = (Spinner) idCaptureView.findViewById(R.id.text_header_font_type_spinner); spinnerHeaderTextFontStyle = (Spinner) idCaptureView.findViewById(R.id.text_header_font_style_spinner); spinnerLabel = (Spinner) idCaptureView.findViewById(R.id.spinner_label_type); spinnerIDCaptureBorder = (Spinner) idCaptureView.findViewById(R.id.spinner_id_capture_border); titleAlignmentCB = (CheckBox) idCaptureView.findViewById(R.id.checkbox_title_alignment); hintAlignmentCB = (CheckBox) idCaptureView.findViewById(R.id.checkbox_hint_alignment); titleImageAlignmentCB = (CheckBox) idCaptureView.findViewById(R.id.checkbox_title_image_alignment); addLabelButton = (Button) idCaptureView.findViewById(R.id.add_label_button); radioGroupInstruction = (RadioGroup) idCaptureView.findViewById(R.id.radio_group_instruction); enableLabelShadowSwitch = (SwitchCompat) idCaptureView.findViewById(R.id.enable_shade); captureButtonColorEdtTxt = (EditText) idCaptureView.findViewById(R.id.capture_button_text_color); captureButtonColorAlphaEdtTxt = (EditText) idCaptureView.findViewById(R.id.transparency_capture_button_text); } private void initializedSelfieCapture() { faceOutlineColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_normal); faceOutlineColorAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_normal_alpha); detectedFaceOutlineColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_detected); detectedFaceOutlineColorAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_outline_detected_alpha); outsideFaceOutlineColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.outside_face_outline_color); outsideFaceOutlineColorAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.outside_face_outline_color_alpha); outsideDetectedFaceOutlineColor = (EditText) selfieCaptureView.findViewById(R.id.outside_detected_face_outline_color); outsideDetectedFaceOutlineColorAlpha = (EditText) selfieCaptureView.findViewById(R.id.outside_detected_face_outline_color_alpha); faceBackButtonColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.back_button_color); faceRetryButtonColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.retry_button_color); faceRetryButtonBorderColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.retry_button_border_color); faceRetryButtonBorderAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_retry_button_border_color); faceConfirmButtonColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.confirm_button_color); faceConfirmButtonStyleEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.confirm_button_style); faceConfirmButtonStyleAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_confirm_button_style); faceBackButtonAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_back_button_color); faceRetryButtonAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_retry_button_color); faceConfirmButtonAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_confirm_button_color); faceTextLabelColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.text_label_color); faceTextLabelAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_text_label_color); faceInstructionContinueBtnColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.instruction_continue_button_color); faceInstructionContinueBtnAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_instruction_continue_button); faceInstructionContinueBtnTxtColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.instruction_continue_button_text_color); faceInstructionContinueBtnTxtAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_instruction_continue_button_text); faceHeaderTextLabelColorEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.text_header_label_color); faceHeaderTextLabelAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_text_header_label_color); faceHeaderTextLabelSizeEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.Header_text_size); faceTextLabelSizeEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.text_size); faceInstructionPreviewBackgroundEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.instruction_preview_background_color); faceInstructionPreviewBackgroundAlphaEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.transparency_instruction_preview_background_color); spinnerFaceTitle = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_title); faceSpinnerTextFontType = (Spinner) selfieCaptureView.findViewById(R.id.text_font_type_spinner); faceSpinnerTextFontStyle = (Spinner) selfieCaptureView.findViewById(R.id.text_font_style_spinner); faceSpinnerFaceContours = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_contours); faceSpinnerHeaderTextFontType = (Spinner) selfieCaptureView.findViewById(R.id.text_header_font_type_spinner); faceSpinnerHeaderTextFontStyle = (Spinner) selfieCaptureView.findViewById(R.id.text_header_font_style_spinner); faceSpinnerTitleAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_title_alignment); faceSpinnerHintMsgAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_hint_msg_alignment); faceSpinnerHintIconAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_hint_icon_alignment); faceSpinnerTitleImageAlignment = (Spinner) selfieCaptureView.findViewById(R.id.spinner_face_title_image_alignment); //faceImageTypeSpinner = (Spinner) selfieCaptureView.findViewById(R.id.faceImageType_ET); faceSpinnerLabel = (Spinner) selfieCaptureView.findViewById(R.id.spinner_label_type); showPreviewScreenCheckBox = (SwitchCompat) selfieCaptureView.findViewById(R.id.showPreviewScreenCheckBox); showInstructionFaceDetect = (SwitchCompat) selfieCaptureView.findViewById(R.id.show_instruction_face_detect); faceTitleAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_title_alignment); faceHintMsgAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_hint_msg_alignment); faceHintIconAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_hint_icon_alignment); faceTitleImageAlignmentCB = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_face_title_image_alignment); showCustomOverlay = (CheckBox) selfieCaptureView.findViewById(R.id.checkbox_show_custom_ui); labelValueFaceEdtTxt = (EditText) selfieCaptureView.findViewById(R.id.face_label_value); addFaceLabelButton = (Button) selfieCaptureView.findViewById(R.id.face_add_label_button); faceEnableLabelShadowSwitch = (SwitchCompat) selfieCaptureView.findViewById(R.id.fd_enable_shade); } private void initializedFPCapture() { fpTextLabelColorEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.text_label_color); fpTextLabelAlphaEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.transparency_text_label_color); fpInstructionContinueBtnColorEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.instruction_continue_button_color); fpInstructionContinueBtnAlphaEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.transparency_instruction_continue_button); fpInstructionContinueBtnTxtColorEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.instruction_continue_button_text_color); fpInstructionContinueBtnTxtAlphaEdtTxt = (EditText) fingerprintCaptureView.findViewById(R.id.transparency_instruction_continue_button_text); } private void initializedVoiceRecording() { voiceButtonColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_button_color); voiceButtonColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_button_color_alpha); voiceBackgroundColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_background_color); voiceBackgroundColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_background_color_alpha); voiceTextColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_text_label_color); voiceTextColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_text_label_color_alpha); voiceTitleColorEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_title_label_color); voiceTitleColorAlphaEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_title_label_color_alpha); voiceTitleLabelSizeEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_title_label_size); voiceTextLabelSizeEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_text_label_size); voiceCounterLabelSizeEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.voice_counter_label_size); voiceLabelValueEdtTxt = (EditText) voiceRecordingView.findViewById(R.id.label_value); voiceAddLabelButton= (Button) voiceRecordingView.findViewById(R.id.voice_add_label_button); voiceDisplayPositionSpinner = (Spinner) voiceRecordingView.findViewById(R.id.voice_display_position_spinner); voiceLabelSpinner = (Spinner) voiceRecordingView.findViewById(R.id.spinner_label_type); voiceTitleOnTopSwitch = (SwitchCompat) voiceRecordingView.findViewById(R.id.voice_title_label_on_top_switch); voiceAutoPlaySwitch = (SwitchCompat) voiceRecordingView.findViewById(R.id.auto_play_switch); } private void setIDCaptureSpinnerAdapter() { ArrayList<Pair<String,String>> titleList = new ArrayList<Pair<String,String>>(); titleList.add(new Pair<String, String>(getString(R.string.none),"None")); titleList.add(new Pair<String, String>(getString(R.string.title_image_1),"Title Image 1")); SpinnerAdapterForPair titleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, titleList); spinnerTitle.setAdapter(titleListAdapter); ArrayList<Pair<String, String>> uiConfigList = new ArrayList<Pair<String, String>>(); uiConfigList.add(new Pair<String, String>(getString(R.string.id_front_capture), CustomizeUIConfigManager.ID_CAPTURE_FRONT)); uiConfigList.add(new Pair<String, String>(getString(R.string.id_back_capture), CustomizeUIConfigManager.ID_CAPTURE_BACK)); uiConfigList.add(new Pair<String, String>(getString(R.string.document_capture_tab), CustomizeUIConfigManager.DOCUMENT_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.snippet_capture), CustomizeUIConfigManager.SNIPPET_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.selfie_capture), CustomizeUIConfigManager.FACE_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.fingerprint_capture_4F), CustomizeUIConfigManager.FINGER_4F_CAPTURE)); uiConfigList.add(new Pair<String, String>(getString(R.string.capture_secondary_id_front), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)); uiConfigList.add(new Pair<String, String>(getString(R.string.capture_secondary_id_back), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)); uiConfigList.add(new Pair<String, String>(getString(R.string.voice_capture), CustomizeUIConfigManager.VOICE_RECORDING)); SpinnerAdapterForPair uiConfigListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, uiConfigList); spinnerUIConfig.setAdapter(uiConfigListAdapter); textFontTypeList = new ArrayList<Pair<String, String>>(); textFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); textFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); textFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); textFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); textFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair textFontTypeListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, textFontTypeList); spinnerTextFontType.setAdapter(textFontTypeListAdapter); textFontStyleList = new ArrayList<Pair<String, String>>(); textFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); textFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); textFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); textFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair textFontStyleListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, textFontStyleList); spinnerTextFontStyle.setAdapter(textFontStyleListAdapter); headerTextFontTypeList = new ArrayList<Pair<String, String>>(); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); headerTextFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair headerTextFontTypeListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, headerTextFontTypeList); spinnerHeaderTextFontType.setAdapter(headerTextFontTypeListAdapter); headerTextFontStyleList = new ArrayList<Pair<String, String>>(); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); headerTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair headerTextFontStyleListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, headerTextFontStyleList); spinnerHeaderTextFontStyle.setAdapter(headerTextFontStyleListAdapter); titleAlignmentList = new ArrayList<Pair<String, String>>(); titleAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); titleAlignmentList.add(new Pair<String, String>(getString(R.string.center), "Center")); titleAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair titleAlignmentListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, titleAlignmentList); spinnerTitleAlignment.setAdapter(titleAlignmentListAdapter); hintAlignmentList = new ArrayList<Pair<String, String>>(); hintAlignmentList.add(new Pair<String, String>(getString(R.string.center), "Center")); hintAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); hintAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); SpinnerAdapterForPair hintAlignmentListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, hintAlignmentList); spinnerHintAlignment.setAdapter(hintAlignmentListAdapter); titleImageAlignmentList = new ArrayList<Pair<String, String>>(); titleImageAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); titleImageAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); titleImageAlignmentList.add(new Pair<String, String>(getString(R.string.center), "Center")); SpinnerAdapterForPair titleImageAlignmentListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, titleImageAlignmentList); spinnerTitleImageAlignment.setAdapter(titleImageAlignmentListAdapter); idCaptureBorderList = new ArrayList<Pair<String, String>>(); idCaptureBorderList.add(new Pair<String, String>(getString(R.string.thin), "Thin")); idCaptureBorderList.add(new Pair<String, String>(getString(R.string.thick), "Thick")); SpinnerAdapterForPair idCaptureBorderListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, idCaptureBorderList); spinnerIDCaptureBorder.setAdapter(idCaptureBorderListAdapter); // spinnerLabel.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, LABELS_KEY)); } private void setSelfieCaptureSpinnerAdapter() { ArrayList<Pair<String,String>> titleList = new ArrayList<Pair<String,String>>(); titleList.add(new Pair<String, String>(getString(R.string.none),"None")); titleList.add(new Pair<String, String>(getString(R.string.title_image_1),"Title Image 1")); SpinnerAdapterForPair titleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, titleList); spinnerFaceTitle.setAdapter(titleListAdapter); faceTextFontTypeList = new ArrayList<Pair<String, String>>(); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); faceTextFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair textFontTypeListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTextFontTypeList); faceSpinnerTextFontType.setAdapter(textFontTypeListAdapter); faceTextFontStyleList = new ArrayList<Pair<String, String>>(); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); faceTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair textFontStyleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTextFontStyleList); faceSpinnerTextFontStyle.setAdapter(textFontStyleListAdapter); faceHeaderTextFontTypeList = new ArrayList<Pair<String, String>>(); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_font_type), "DEFAULT")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.default_bold), "DEFAULT_BOLD")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.san_serif), "SANS_SERIF")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.serif), "SERIF")); faceHeaderTextFontTypeList.add(new Pair<String, String>(getString(R.string.monospace), "MONOSPACE")); SpinnerAdapterForPair headerTextFontTypeListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceHeaderTextFontTypeList); faceSpinnerHeaderTextFontType.setAdapter(headerTextFontTypeListAdapter); facehHeaderTextFontStyleList = new ArrayList<Pair<String, String>>(); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.normal), "NORMAL")); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold), "BOLD")); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.italic), "ITALIC")); facehHeaderTextFontStyleList.add(new Pair<String, String>(getString(R.string.bold_italic), "BOLD_ITALIC")); SpinnerAdapterForPair headerTextFontStyleListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, facehHeaderTextFontStyleList); faceSpinnerHeaderTextFontStyle.setAdapter(headerTextFontStyleListAdapter); faceTitleAlignmentList = new ArrayList<Pair<String, String>>(); faceTitleAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); faceTitleAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair titleAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTitleAlignmentList); faceSpinnerTitleAlignment.setAdapter(titleAlignmentListAdapter); faceHintMsgAlignmentList = new ArrayList<Pair<String, String>>(); faceHintMsgAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); faceHintMsgAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); SpinnerAdapterForPair hintMsgAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceHintMsgAlignmentList); faceSpinnerHintMsgAlignment.setAdapter(hintMsgAlignmentListAdapter); faceHintIconAlignmentList = new ArrayList<Pair<String, String>>(); faceHintIconAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); faceHintIconAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair hintIconAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceHintIconAlignmentList); faceSpinnerHintIconAlignment.setAdapter(hintIconAlignmentListAdapter); faceTitleImageAlignmentList = new ArrayList<Pair<String, String>>(); faceTitleImageAlignmentList.add(new Pair<String, String>(getString(R.string.top), "Top")); faceTitleImageAlignmentList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair titleImageAlignmentListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceTitleImageAlignmentList); faceSpinnerTitleImageAlignment.setAdapter(titleImageAlignmentListAdapter); faceContoursList = new ArrayList<Pair<String, String>>(); faceContoursList.add(new Pair<String, String>(getString(R.string.low), "Low")); faceContoursList.add(new Pair<String, String>(getString(R.string.medium), "Medium")); faceContoursList.add(new Pair<String, String>(getString(R.string.all), "All")); faceContoursList.add(new Pair<String, String>(getString(R.string.zero), "Zero")); SpinnerAdapterForPair faceContoursListAdapter = new SpinnerAdapterForPair( getActivity(), android.R.layout.simple_list_item_1, faceContoursList); faceSpinnerFaceContours.setAdapter(faceContoursListAdapter); } private void setVoiceRecordingSpinnerAdapter() { voiceDisplayPositionList = new ArrayList<Pair<String, String>>(); voiceDisplayPositionList.add(new Pair<String, String>(getString(R.string.top), "Top")); voiceDisplayPositionList.add(new Pair<String, String>(getString(R.string.center), "Center")); voiceDisplayPositionList.add(new Pair<String, String>(getString(R.string.bottom), "Bottom")); SpinnerAdapterForPair voiceDisplayPositionListAdapter = new SpinnerAdapterForPair(getActivity(), android.R.layout.simple_list_item_1, voiceDisplayPositionList); voiceDisplayPositionSpinner.setAdapter(voiceDisplayPositionListAdapter); } private void setIDCaptureDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { uiConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { uiConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { uiConfig = CustomizeUIConfigManager.getDefaultSecIDCaptureFrontConfig(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { uiConfig = CustomizeUIConfigManager.getDefaultSecIDCaptureBackConfig(); } if (null != uiConfig) { setIdCaptureField(uiConfig); } } private void setIdCaptureField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> idCaptureUIMap = customizeUIConfig.getUIConfiguration(); HashMap<String, String> idCaptureLabelMap = customizeUIConfig.getLabelConfiguration(); String idOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTLINE_COLOR); String idOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTLINE_COLOR_ALPHA); String detectedIdOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR); String detectedIdOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR_ALPHA); String idOutsideOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR); String idOutsideOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR_APLHA); String detectedIdOutsideOutlineColor = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR); String detectedIdOutsideOutlineAlpha = idCaptureUIMap.get(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR_ALPHA); String textFontType = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_TYPE); String textFontStyle = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_STYLE); String backButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_BACK_BUTTON_COLOR); String backButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_BACK_BUTTON_COLOR_ALPHA); String retryButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_COLOR); String retryButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_COLOR_ALPHA); String retryButtonBorderColor = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR); String retryButtonBorderAlpha = idCaptureUIMap.get(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR_ALPHA); String confirmButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR); String confirmButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR_ALPHA); String confirmButtonStyle = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR); String confirmButtonStyleAlpha = idCaptureUIMap.get(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA); String textLabelColor = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_COLOR); String textLabelAlpha = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_ALPHA); String instructionContinueBtnColor = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_COLOR); String instructionContinueBtnColorAlpha = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_ALPHA); String instructionContinueBtnTxtColor = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_COLOR); String instructionContinueBtnTxtAlpha = idCaptureUIMap.get(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_ALPHA); String headerTextColorEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_LABEL_COLOR); String headerTextAlphaEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_LABEL_ALPHA); String headerTextSizeEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_LABEL_SIZE); String textSizeEdtTxt = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_TEXT_SIZE); String headerTextFontType = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_TYPE); String headerTextFontStyle = idCaptureUIMap.get(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_STYLE); String idCaptureBorderType = idCaptureUIMap.get(UIConfigConstants.ID_ID_CAPTURE_BORDER_STYLE); String titleAlignment = idCaptureUIMap.get(UIConfigConstants.ID_TITLE_LABEL_ALIGNMENT); String hintAlignment = idCaptureUIMap.get(UIConfigConstants.ID_HINT_MESSAGE_ALIGNMENT); String titleImageAlignment = idCaptureUIMap.get(UIConfigConstants.ID_TITLE_IMAGE_ALIGNMENT); String hideIdCaptureTitle = idCaptureUIMap.get(UIConfigConstants.ID_HIDE_ID_TITLE_LABEL); String hideIdCaptureHintMsg = idCaptureUIMap.get(UIConfigConstants.ID_HIDE_ID_HINT_MESSAGE); String hideIdCaptureTitleImg = idCaptureUIMap.get(UIConfigConstants.ID_HIDE_ID_TITLE_IMAGE); String idTitleImageBitmap = idCaptureUIMap.get(UIConfigConstants.ID_TITLE_IMG_BITMAP_BASE64); String captureButtonColor = idCaptureUIMap.get(UIConfigConstants.ID_CAPTURE_BUTTON_COLOR); String captureButtonAlpha = idCaptureUIMap.get(UIConfigConstants.ID_CAPTURE_BUTTON_ALPHA); String showInstScreen = idCaptureUIMap.get(UIConfigConstants.ID_SHOW_INSTRUCTION); String idLabelShadowEnable = idCaptureUIMap.get(UIConfigConstants.ID_LABEL_SHADOW_ENABLE); idOutlineColorEdtTxt.setText(idOutlineColor); idOutlineAlphaEdtTxt.setText(idOutlineAlpha); detectedIdOutlineColorEdtTxt.setText(detectedIdOutlineColor); detectedIdOutlineAlphaEdtTxt.setText(detectedIdOutlineAlpha); idOutsideOutlineColorEdtTxt.setText(idOutsideOutlineColor); idOutsideOutlineAlphaEdtTxt.setText(idOutsideOutlineAlpha); detectedOutsideOutlineColorEdtTxt.setText(detectedIdOutsideOutlineColor); detectedOutsideOutlineAlphaEdtTxt.setText(detectedIdOutsideOutlineAlpha); backButtonColorEdtTxt.setText(backButtonColor); backButtonAlphaEdtTxt.setText(backButtonAlpha); retryButtonColorEdtTxt.setText(retryButtonColor); retryButtonAlphaEdtTxt.setText(retryButtonAlpha); retryButtonBorderColorEdtTxt.setText(retryButtonBorderColor); retryButtonBorderAlphaEdtTxt.setText(retryButtonBorderAlpha); confirmButtonColorEdtTxt.setText(confirmButtonColor); confirmButtonAlphaEdtTxt.setText(confirmButtonAlpha); confirmButtonStyleEdtTxt.setText(confirmButtonStyle); confirmButtonStyleAlphaEdtTxt.setText(confirmButtonStyleAlpha); textLabelColorEdtTxt.setText(textLabelColor); textLabelAlphaEdtTxt.setText(textLabelAlpha); instructionContinueBtnColorEdtTxt.setText(instructionContinueBtnColor); instructionContinueBtnAlphaEdtTxt.setText(instructionContinueBtnColorAlpha); instructionContinueBtnTxtColorEdtTxt.setText(instructionContinueBtnTxtColor); instructionContinueBtnTxtAlphaEdtTxt.setText(instructionContinueBtnTxtAlpha); headerTextLabelColorEdtTxt.setText(headerTextColorEdtTxt); headerTextLabelAlphaEdtTxt.setText(headerTextAlphaEdtTxt); headerTextLabelSizeEdtTxt.setText(headerTextSizeEdtTxt); textLabelSizeEdtTxt.setText(textSizeEdtTxt); captureButtonColorEdtTxt.setText(captureButtonColor); captureButtonColorAlphaEdtTxt.setText(captureButtonAlpha); spinnerTextFontType.setSelection(getPositionInPair(textFontTypeList, textFontType)); spinnerTextFontStyle.setSelection(getPositionInPair(textFontStyleList, textFontStyle)); spinnerTitleAlignment.setSelection(getPositionInPair(titleAlignmentList, titleAlignment)); spinnerHintAlignment.setSelection(getPositionInPair(hintAlignmentList, hintAlignment)); spinnerTitleImageAlignment.setSelection(getPositionInPair(titleImageAlignmentList, titleImageAlignment)); spinnerHeaderTextFontType.setSelection(getPositionInPair(headerTextFontTypeList, headerTextFontType)); spinnerHeaderTextFontStyle.setSelection(getPositionInPair(headerTextFontStyleList, headerTextFontStyle)); spinnerIDCaptureBorder.setSelection(getPositionInPair(idCaptureBorderList, idCaptureBorderType)); spinnerTitle.setSelection(idTitleImageBitmap.isEmpty() ? 0 : 1); radioGroupInstruction.check(showInstScreen.equalsIgnoreCase("N") ? radioGroupInstruction.getChildAt(0).getId() : radioGroupInstruction.getChildAt(1).getId()); titleAlignmentCB.setChecked(!hideIdCaptureTitle.equalsIgnoreCase("N")); hintAlignmentCB.setChecked(!hideIdCaptureHintMsg.equalsIgnoreCase("N")); titleImageAlignmentCB.setChecked(!hideIdCaptureTitleImg.equalsIgnoreCase("N")); enableLabelShadowSwitch.setChecked(idLabelShadowEnable.equalsIgnoreCase("Y") ? true : false); spinnerLabel.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, setToArray(idCaptureLabelMap.keySet()))); } private void updateIDConfig(String featureType) { HashMap<String, String> ui = null; if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { ui = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { ui = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { ui = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { ui = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { ui = CustomizeUIConfigManager.getDefaultSecIDCaptureFrontConfig().getUIConfiguration(); } else if (featureType.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { ui = CustomizeUIConfigManager.getDefaultSecIDCaptureBackConfig().getUIConfiguration(); } if (ui != null) { ui.put(UIConfigConstants.ID_ID_OUTLINE_COLOR, idOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_ID_OUTLINE_COLOR_ALPHA, idOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR, detectedIdOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTLINE_COLOR_ALPHA, detectedIdOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR, idOutsideOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_ID_OUTSIDE_OUTLINE_COLOR_APLHA, idOutsideOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR, detectedOutsideOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_DETECTED_ID_OUTSIDE_OUTLINE_COLOR_ALPHA, detectedOutsideOutlineAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_BACK_BUTTON_COLOR, backButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_BACK_BUTTON_COLOR_ALPHA, backButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_COLOR, retryButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_COLOR_ALPHA, retryButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR, retryButtonBorderColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_RETRY_BUTTON_BORDER_COLOR_ALPHA, retryButtonBorderAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR, confirmButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_COLOR_ALPHA, confirmButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR, confirmButtonStyleEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA, confirmButtonStyleAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_COLOR, textLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_ALPHA, textLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_COLOR, instructionContinueBtnColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_ALPHA, instructionContinueBtnAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_COLOR, instructionContinueBtnTxtColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_INSTRUCTION_BUTTON_TXT_ALPHA, instructionContinueBtnTxtAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_HEADER_TEXT_LABEL_COLOR, headerTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_HEADER_TEXT_LABEL_ALPHA, headerTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_HEADER_TEXT_LABEL_SIZE, headerTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_SIZE, textLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CAPTURE_BUTTON_COLOR, captureButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_CAPTURE_BUTTON_ALPHA, captureButtonColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_TYPE, ((Pair) spinnerTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_LABEL_TEXT_TYPEFACE_STYLE, ((Pair) spinnerTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_TYPE, ((Pair) spinnerHeaderTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_HEADER_TEXT_TYPEFACE_STYLE, ((Pair) spinnerHeaderTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_ID_CAPTURE_BORDER_STYLE, ((Pair) spinnerIDCaptureBorder.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_TITLE_LABEL_ALIGNMENT, ((Pair) spinnerTitleAlignment.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_HINT_MESSAGE_ALIGNMENT, ((Pair) spinnerHintAlignment.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_TITLE_IMAGE_ALIGNMENT, ((Pair) spinnerTitleImageAlignment.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.ID_SHOW_INSTRUCTION, (radioGroupInstruction.getCheckedRadioButtonId() == R.id.radio_button_no) ? "N" : "Y"); ui.put(UIConfigConstants.ID_HIDE_ID_TITLE_LABEL, titleAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.ID_HIDE_ID_HINT_MESSAGE, hintAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.ID_HIDE_ID_TITLE_IMAGE, titleImageAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.ID_TITLE_IMG_BITMAP_BASE64, getConvertedBaset64Image(((Pair) spinnerTitle.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.ID_LABEL_SHADOW_ENABLE, enableLabelShadowSwitch.isChecked() ? "Y" : "N"); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); } } private void setSelfieCaptureDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig(); } if (null != uiConfig) { setSelfieCaptureField(uiConfig); } } private void setSelfieCaptureField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> selfieCaptureUIMap = customizeUIConfig.getUIConfiguration(); HashMap<String, String> selfieCaptureLabelMap = customizeUIConfig.getLabelConfiguration(); String faceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTLINE_COLOR); String faceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTLINE_COLOR_ALPHA); String detectedFaceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR); String detectedFaceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR_ALPHA); String outsideFaceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR); String outsideFaceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA); String detectedOutsideFaceOutlineColor = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR); String detectedOutsideFaceOutlineColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA); String textFontType = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_TYPE); String textFontStyle = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_STYLE); String backButtonColor = selfieCaptureUIMap.get(UIConfigConstants.FD_BACK_BUTTON_COLOR); String backButtonAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_BACK_BUTTON_COLOR_ALPHA); String retryButtonColor = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_COLOR); String retryButtonAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_COLOR_ALPHA); String retryButtonBorderColor = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR); String retryButtonBorderAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR_ALPHA); String confirmButtonColor = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR); String confirmButtonAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR_ALPHA); String confirmButtonStyle = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR); String confirmButtonStyleAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA); String textLabelColor = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_COLOR); String textLabelAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_ALPHA); String instructionContinueBtnColor = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_COLOR); String instructionContinueBtnColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_ALPHA); String instructionContinueBtnTxtColor = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_COLOR); String instructionContinueBtnTxtAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_ALPHA); String faceContours = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_CONTOURS); String headerTextColorEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_LABEL_COLOR); String headerTextAlphaEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_LABEL_ALPHA); String headerTextSizeEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_LABEL_SIZE); String textSizeEdtTxt = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_TEXT_SIZE); String headerTextFontType = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_TYPE); String headerTextFontStyle = selfieCaptureUIMap.get(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_STYLE); String titleAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_TITLE_LABEL_ON_TOP); String hintMsgAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_HINT_MESSAGE_ON_TOP); String hintIconAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_FACE_HINT_ICON_ON_TOP); String titleImageAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_TITLE_IMAGE_ON_TOP); String hideTitleAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_FACE_TITLE_LABEL); String hideHintMsgAlignemnt = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_FACE_HINT_MESSAGE); String hideHintIconAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_FACE_HINT_ICON); String hideTitleImageAlignment = selfieCaptureUIMap.get(UIConfigConstants.FD_HIDE_TITLE_IMAGE); String faceTitleImageBitmap = selfieCaptureUIMap.get(UIConfigConstants.FD_TITLE_IMG_BITMAP_BASE64); String showCustomUI = selfieCaptureUIMap.get(UIConfigConstants.FD_SHOW_CUSTOM_UI); String showInstScreen = selfieCaptureUIMap.get(UIConfigConstants.FD_SHOW_INSTRUCTION_SCREEN); String showPrevScreen = selfieCaptureUIMap.get(UIConfigConstants.FD_SHOW_PREVIEW_SCREEN); String fdLabelShadowEnable = selfieCaptureUIMap.get(UIConfigConstants.FD_LABEL_SHADOW_ENABLE); String instructionPreviewBackgroundColor = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR); String instructionPreviewBackgroundColorAlpha = selfieCaptureUIMap.get(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR_ALPHA); faceOutlineColorEdtTxt.setText(faceOutlineColor); faceOutlineColorAlphaEdtTxt.setText(faceOutlineColorAlpha); detectedFaceOutlineColorEdtTxt.setText(detectedFaceOutlineColor); detectedFaceOutlineColorAlphaEdtTxt.setText(detectedFaceOutlineColorAlpha); outsideFaceOutlineColorEdtTxt.setText(outsideFaceOutlineColor); outsideFaceOutlineColorAlphaEdtTxt.setText(outsideFaceOutlineColorAlpha); outsideDetectedFaceOutlineColor.setText(detectedOutsideFaceOutlineColor); outsideDetectedFaceOutlineColorAlpha.setText(detectedOutsideFaceOutlineColorAlpha); faceBackButtonColorEdtTxt.setText(backButtonColor); faceBackButtonAlphaEdtTxt.setText(backButtonAlpha); faceRetryButtonColorEdtTxt.setText(retryButtonColor); faceRetryButtonAlphaEdtTxt.setText(retryButtonAlpha); faceRetryButtonBorderColorEdtTxt.setText(retryButtonBorderColor); faceRetryButtonBorderAlphaEdtTxt.setText(retryButtonBorderAlpha); faceConfirmButtonColorEdtTxt.setText(confirmButtonColor); faceConfirmButtonAlphaEdtTxt.setText(confirmButtonAlpha); faceConfirmButtonStyleEdtTxt.setText(confirmButtonStyle); faceConfirmButtonStyleAlphaEdtTxt.setText(confirmButtonStyleAlpha); faceTextLabelColorEdtTxt.setText(textLabelColor); faceTextLabelAlphaEdtTxt.setText(textLabelAlpha); faceInstructionContinueBtnColorEdtTxt.setText(instructionContinueBtnColor); faceInstructionContinueBtnAlphaEdtTxt.setText(instructionContinueBtnColorAlpha); faceInstructionContinueBtnTxtColorEdtTxt.setText(instructionContinueBtnTxtColor); faceInstructionContinueBtnTxtAlphaEdtTxt.setText(instructionContinueBtnTxtAlpha); faceHeaderTextLabelColorEdtTxt.setText(headerTextColorEdtTxt); faceHeaderTextLabelAlphaEdtTxt.setText(headerTextAlphaEdtTxt); faceHeaderTextLabelSizeEdtTxt.setText(headerTextSizeEdtTxt); faceTextLabelSizeEdtTxt.setText(textSizeEdtTxt); faceInstructionPreviewBackgroundEdtTxt.setText(instructionPreviewBackgroundColor); faceInstructionPreviewBackgroundAlphaEdtTxt.setText(instructionPreviewBackgroundColorAlpha); faceSpinnerTextFontType.setSelection(getPositionInPair(faceTextFontTypeList, textFontType)); faceSpinnerTextFontStyle.setSelection(getPositionInPair(faceTextFontStyleList, textFontStyle)); faceSpinnerHeaderTextFontType.setSelection(getPositionInPair(faceHeaderTextFontTypeList, headerTextFontType)); faceSpinnerHeaderTextFontStyle.setSelection(getPositionInPair(facehHeaderTextFontStyleList, headerTextFontStyle)); faceSpinnerFaceContours.setSelection(getPositionInPair(faceContoursList, faceContours)); faceSpinnerTitleAlignment.setSelection(getPositionInPair(faceTitleAlignmentList, getFacePosition(titleAlignment))); faceSpinnerHintMsgAlignment.setSelection(getPositionInPair(faceHintMsgAlignmentList, getFacePosition(hintMsgAlignment))); faceSpinnerTitleImageAlignment.setSelection(getPositionInPair(faceTitleImageAlignmentList, getFacePosition(titleImageAlignment))); faceSpinnerHintIconAlignment.setSelection(getPositionInPair(faceHintIconAlignmentList, getFacePosition(hintIconAlignment))); spinnerFaceTitle.setSelection(faceTitleImageBitmap.isEmpty() ? 0 : 1); showInstructionFaceDetect.setChecked(showInstScreen.equalsIgnoreCase("Y") ? true : false); showPreviewScreenCheckBox.setChecked(showPrevScreen.equalsIgnoreCase("Y") ? true : false); faceTitleAlignmentCB.setChecked(!hideTitleAlignment.equalsIgnoreCase("N")); faceHintMsgAlignmentCB.setChecked(!hideHintMsgAlignemnt.equalsIgnoreCase("N")); faceHintIconAlignmentCB.setChecked(!hideHintIconAlignment.equalsIgnoreCase("N")); faceTitleImageAlignmentCB.setChecked(!hideTitleImageAlignment.equalsIgnoreCase("N")); showCustomOverlay.setChecked(showCustomUI.equalsIgnoreCase("Y")); faceEnableLabelShadowSwitch.setChecked(fdLabelShadowEnable.equalsIgnoreCase("Y") ? true : false); faceSpinnerLabel.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, setToArray(selfieCaptureLabelMap.keySet()))); } private void updateSelfieConfig(String featureType) { HashMap<String, String> ui = null; ui = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getUIConfiguration(); if (ui != null) { ui.put(UIConfigConstants.FD_OUTLINE_COLOR, faceOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_OUTLINE_COLOR_ALPHA, faceOutlineColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR, detectedFaceOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_FACE_OUTLINE_COLOR_ALPHA, detectedFaceOutlineColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR, outsideFaceOutlineColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA, outsideFaceOutlineColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR, outsideDetectedFaceOutlineColor.getText().toString().trim()); ui.put(UIConfigConstants.FD_DETECTED_OUTSIDE_FACE_OUTLINE_COLOR_ALPHA, outsideDetectedFaceOutlineColorAlpha.getText().toString().trim()); ui.put(UIConfigConstants.FD_BACK_BUTTON_COLOR, faceBackButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_BACK_BUTTON_COLOR_ALPHA, faceBackButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_COLOR, faceRetryButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_COLOR_ALPHA, faceRetryButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR, faceRetryButtonBorderColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_RETRY_BUTTON_BORDER_COLOR_ALPHA, faceRetryButtonBorderAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR, faceConfirmButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_COLOR_ALPHA, faceConfirmButtonAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR, faceConfirmButtonStyleEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_CONFIRM_BUTTON_BACKGROUND_COLOR_ALPHA, faceConfirmButtonStyleAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_LABEL_TEXT_COLOR, faceTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_LABEL_TEXT_ALPHA, faceTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_COLOR, faceInstructionContinueBtnColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_ALPHA, faceInstructionContinueBtnAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_COLOR, faceInstructionContinueBtnTxtColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_BUTTON_TXT_ALPHA, faceInstructionContinueBtnTxtAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_HEADER_TEXT_LABEL_COLOR, faceHeaderTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_HEADER_TEXT_LABEL_ALPHA, faceHeaderTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_HEADER_TEXT_LABEL_SIZE, faceHeaderTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_LABEL_TEXT_SIZE, faceTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR, faceInstructionPreviewBackgroundEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_INSTRUCTION_PREVIEW_BACKGROUND_COLOR_ALPHA, faceInstructionPreviewBackgroundAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.FD_FACE_CONTOURS, ((Pair) faceSpinnerFaceContours.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_TYPE, ((Pair) faceSpinnerHeaderTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_HEADER_TEXT_TYPEFACE_STYLE, ((Pair) faceSpinnerHeaderTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_TYPE, ((Pair) faceSpinnerTextFontType.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_LABEL_TEXT_TYPEFACE_STYLE, ((Pair) faceSpinnerTextFontStyle.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.FD_FACE_TITLE_LABEL_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerTitleAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_FACE_HINT_MESSAGE_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerHintMsgAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_FACE_HINT_ICON_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerHintIconAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_TITLE_IMAGE_ON_TOP, setJsonFormatFacePosition(((Pair) faceSpinnerTitleImageAlignment.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_SHOW_INSTRUCTION_SCREEN, showInstructionFaceDetect.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_SHOW_PREVIEW_SCREEN, showPreviewScreenCheckBox.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_FACE_TITLE_LABEL, faceTitleAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_FACE_HINT_MESSAGE, faceHintMsgAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_FACE_HINT_ICON, faceHintIconAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_HIDE_TITLE_IMAGE, faceTitleImageAlignmentCB.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.FD_TITLE_IMG_BITMAP_BASE64, getConvertedBaset64Image(((Pair) spinnerFaceTitle.getSelectedItem()).second.toString())); ui.put(UIConfigConstants.FD_SHOW_CUSTOM_UI, showCustomOverlay.isChecked() ? "Y" : "N"); if (showCustomOverlay.isChecked()) { String progress = R.drawable.fd_progress_1 + "," + R.drawable.fd_progress_2 + "," + R.drawable.fd_progress_3 + "," + R.drawable.fd_progress_4 + "," + R.drawable.fd_progress_5 + "," + R.drawable.fd_progress_6 + "," + R.drawable.fd_progress_7 + "," + R.drawable.fd_progress_8 + "," + R.drawable.fd_progress_9 + "," + R.drawable.fd_progress_10 + "," + R.drawable.fd_progress_11; String turnArrow = R.drawable.left_turn_arrow + "," + R.drawable.up_move_arrow + "," + R.drawable.right_turn_arrow + "," + R.drawable.down_move_arrow; ui.put(UIConfigConstants.FD_SHOW_CUSTOM_UI, "Y"); ui.put(UIConfigConstants.FD_FACE_OUTLINE_IMAGE_ID, "" + R.drawable.fd_outline); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_IMAGE_ID, "" + R.drawable.fd_background); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES, progress); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES_DELAY, "500"); ui.put(UIConfigConstants.FD_FACE_TURN_ARROW_LIST, turnArrow); ui.put(UIConfigConstants.FD_TOGGLE_CAMERA_BUTTON_ICON, ""+R.drawable.fd_toggle_camera_icon); } else { ui.put(UIConfigConstants.FD_SHOW_CUSTOM_UI, "N"); ui.put(UIConfigConstants.FD_FACE_OUTLINE_IMAGE_ID, ""); ui.put(UIConfigConstants.FD_OUTSIDE_FACE_OUTLINE_IMAGE_ID, ""); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES, ""); ui.put(UIConfigConstants.FD_FACE_OUTLINE_PROGRESS_IMAGES_DELAY, "500"); ui.put(UIConfigConstants.FD_FACE_TURN_ARROW_LIST, ""); ui.put(UIConfigConstants.FD_TOGGLE_CAMERA_BUTTON_ICON, ""); } ui.put(UIConfigConstants.FD_LABEL_SHADOW_ENABLE, faceEnableLabelShadowSwitch.isChecked() ? "Y" : "N"); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); Log.d("", "" + ui); } } private void setFPCaptureDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { uiConfig = CustomizeUIConfigManager.getDefaultFingerPrintCaptureConfig(); } if (null != uiConfig) { setFPCaptureField(uiConfig); } } private void setFPCaptureField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> fpCaptureUIMap = customizeUIConfig.getUIConfiguration(); // HashMap<String, String> selfieCaptureLabelMap = customizeUIConfig.getLabelConfiguration(); String textFontType = fpCaptureUIMap.get(UIConfigConstants.CFC_LABEL_TEXT_COLOR); String textFontStyle = fpCaptureUIMap.get(UIConfigConstants.CFC_LABEL_TEXT_COLOR_ALPHA); String instButtonColor = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_COLOR); String intButtonAlpha = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_ALPHA); String intButtonTextColor = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_COLOR); String intButtonTextAlpha = fpCaptureUIMap.get(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_ALPHA); fpTextLabelColorEdtTxt.setText(textFontType); fpTextLabelAlphaEdtTxt.setText(textFontStyle); fpInstructionContinueBtnColorEdtTxt.setText(instButtonColor); fpInstructionContinueBtnAlphaEdtTxt.setText(intButtonAlpha); fpInstructionContinueBtnTxtColorEdtTxt.setText(intButtonTextColor); fpInstructionContinueBtnTxtAlphaEdtTxt.setText(intButtonTextAlpha); } private void updateFingerPrintConfig(String featureType) { HashMap<String, String> ui = null; ui = CustomizeUIConfigManager.getDefaultFingerPrintCaptureConfig().getUIConfiguration(); if (ui != null) { ui.put(UIConfigConstants.CFC_LABEL_TEXT_COLOR, fpTextLabelColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_LABEL_TEXT_COLOR_ALPHA, fpTextLabelAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_COLOR, fpInstructionContinueBtnColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_ALPHA, fpInstructionContinueBtnAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_COLOR, fpInstructionContinueBtnTxtColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.CFC_INSTRUCTION_BUTTON_TXT_ALPHA, fpInstructionContinueBtnTxtAlphaEdtTxt.getText().toString().trim()); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); //Log.d("", "" + ui); } } private void setVoiceRecordingDefaultValues() { CustomizeUIConfig uiConfig = null; String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { uiConfig = CustomizeUIConfigManager.getDefaultVoiceRecordingConfig(); } if (null != uiConfig) { setVoiceRecordingField(uiConfig); } } private void setVoiceRecordingField(CustomizeUIConfig customizeUIConfig) { HashMap<String, String> voiceRecordingUIMap = customizeUIConfig.getUIConfiguration(); HashMap<String, String> voiceRecordingLabelMap = customizeUIConfig.getLabelConfiguration(); String buttonColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BUTTON_COLOR); String buttonColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BUTTON_COLOR_ALPHA); String backgroundColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BACKGROUND_COLOR); String backgroundColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_BACKGROUND_COLOR_ALPHA); String textLabelColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TEXT_LABEL_COLOR); String textLabelColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TEXT_LABEL_COLOR_ALPHA); String titleLabelColor = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_COLOR); String titleLabelColorAlpha = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_COLOR_ALPHA); String titleLabelSize = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_SIZE); String textLabelSize = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TEXT_LABEL_SIZE); String counterLabelSize = voiceRecordingUIMap.get(UIConfigConstants.VOICE_COUNTER_LABEL_SIZE); String displayPosition = voiceRecordingUIMap.get(UIConfigConstants.VOICE_DISPLAY_POSITION); String autoPlay = voiceRecordingUIMap.get(UIConfigConstants.VOICE_AUTO_PLAY); String titleLabelTop = voiceRecordingUIMap.get(UIConfigConstants.VOICE_TITLE_LABEL_TOP); voiceDisplayPositionSpinner.setSelection(getPositionInPair(voiceDisplayPositionList, displayPosition)); voiceTitleOnTopSwitch.setChecked(titleLabelTop.equalsIgnoreCase("Y") ? true : false); voiceAutoPlaySwitch.setChecked(autoPlay.equalsIgnoreCase("Y") ? true : false); voiceButtonColorEdtTxt.setText(buttonColor); voiceButtonColorAlphaEdtTxt.setText(buttonColorAlpha); voiceBackgroundColorEdtTxt.setText(backgroundColor); voiceBackgroundColorAlphaEdtTxt.setText(backgroundColorAlpha); voiceTextColorEdtTxt.setText(textLabelColor); voiceTextColorAlphaEdtTxt.setText(textLabelColorAlpha); voiceTitleColorEdtTxt.setText(titleLabelColor); voiceTitleColorAlphaEdtTxt.setText(titleLabelColorAlpha); voiceTitleLabelSizeEdtTxt.setText(titleLabelSize); voiceTextLabelSizeEdtTxt.setText(textLabelSize); voiceCounterLabelSizeEdtTxt.setText(counterLabelSize); voiceLabelSpinner.setAdapter(new ArrayAdapter<String>(getContext(), android.R.layout.simple_dropdown_item_1line, setToArray(voiceRecordingLabelMap.keySet()))); } private void updateVoiceRecordingConfig(String featureType) { HashMap<String, String> ui = null; ui = CustomizeUIConfigManager.getDefaultVoiceRecordingConfig().getUIConfiguration(); if (ui != null) { ui.put(UIConfigConstants.VOICE_BUTTON_COLOR, voiceButtonColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_BUTTON_COLOR_ALPHA, voiceButtonColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_BACKGROUND_COLOR, voiceBackgroundColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_BACKGROUND_COLOR_ALPHA, voiceBackgroundColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TEXT_LABEL_COLOR, voiceTextColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TEXT_LABEL_COLOR_ALPHA, voiceTextColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_COLOR, voiceTitleColorEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_COLOR_ALPHA, voiceTitleColorAlphaEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_SIZE, voiceTitleLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_TEXT_LABEL_SIZE, voiceTextLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_COUNTER_LABEL_SIZE, voiceCounterLabelSizeEdtTxt.getText().toString().trim()); ui.put(UIConfigConstants.VOICE_DISPLAY_POSITION, ((Pair) voiceDisplayPositionSpinner.getSelectedItem()).second.toString()); ui.put(UIConfigConstants.VOICE_TITLE_LABEL_TOP, voiceTitleOnTopSwitch.isChecked() ? "Y" : "N"); ui.put(UIConfigConstants.VOICE_AUTO_PLAY, voiceAutoPlaySwitch.isChecked() ? "Y" : "N"); CustomizeUIConfigManager.storeConfig(getActivity(), featureType); //Log.d("", "" + ui); } } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { resetButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.ID_CAPTURE_FRONT, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.ID_CAPTURE_BACK, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.FACE_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setSelfieCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.DOCUMENT_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.SNIPPET_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.FINGER_4F_CAPTURE, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setFPCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setIDCaptureDefaultValues(); }else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { PreferenceUtils.setPreference(getActivity(), CustomizeUIConfigManager.VOICE_RECORDING, ""); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); setVoiceRecordingDefaultValues(); } } }); addLabelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); HashMap<String, String> labelConfig = null; if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { // labelConfig = CustomizeUIConfigManager.get.getLabelConfiguration(); } if (null != labelConfig) { labelConfig.put(spinnerLabel.getSelectedItem().toString().toString(), labelValueEdtTxt.getText().toString().trim()); } labelValueEdtTxt.setText(""); //Log.d("", "" + labelConfig); } }); addFaceLabelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); HashMap<String, String> labelConfig = null; if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { // labelConfig = CustomizeUIConfigManager.get.getLabelConfiguration(); } if (null != labelConfig) { labelConfig.put(faceSpinnerLabel.getSelectedItem().toString().toString(), labelValueFaceEdtTxt.getText().toString().trim()); } Log.d("", "" + labelConfig); labelValueFaceEdtTxt.setText(""); } }); voiceAddLabelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); HashMap<String, String> labelConfig = null; if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureFrontConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { labelConfig = CustomizeUIConfigManager.getDefaultIDCaptureBackConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultFaceCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultDocCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { labelConfig = CustomizeUIConfigManager.getDefaultSnippetCaptureConfig().getLabelConfiguration(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { // labelConfig = CustomizeUIConfigManager.get.getLabelConfiguration(); }else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)){ labelConfig = CustomizeUIConfigManager.getDefaultVoiceRecordingConfig().getLabelConfiguration(); } if (null != labelConfig) { labelConfig.put(voiceLabelSpinner.getSelectedItem().toString().toString(), voiceLabelValueEdtTxt.getText().toString().trim()); } Log.d("", "" + labelConfig); voiceLabelValueEdtTxt.setText(""); } }); nextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { updateSelfieConfig(current_selected); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { updateFingerPrintConfig(current_selected); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { updateVoiceRecordingConfig(current_selected); } else { updateIDConfig(current_selected); } FragmentManager fragmentManager = getFragmentManager(); IDValidationFaceMatch idValidationFaceMatch = new IDValidationFaceMatch(); Bundle bundle = new Bundle(); bundle.putSerializable(IDDetails.SKIP_FEATURES_LIST, skipFeaturesList); idValidationFaceMatch.setArguments(bundle); fragmentManager.beginTransaction().replace(R.id.flContent, idValidationFaceMatch).addToBackStack(null).commit(); NavigationActivity.toolbar.setTitle(R.string.id_validation); hideKeyboard(getActivity(), view); ImageProcessingSDK.getInstance().customizeUserInterface(CustomizeUIConfigManager.getCompleteUIConfigJSON()); } }); backButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { getActivity().getSupportFragmentManager().popBackStack(); hideKeyboard(getActivity(), view); } }); spinnerUIConfig.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { String current_selected = ((Pair) adapterView.getSelectedItem()).second.toString(); if (!StringUtil.isEmpty(previously_selected_feature)) { if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { updateSelfieConfig(previously_selected_feature); } else if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { updateFingerPrintConfig(previously_selected_feature); } else if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { updateVoiceRecordingConfig(previously_selected_feature); } else if (previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT) || previously_selected_feature.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { updateIDConfig(previously_selected_feature); } } //Assign only after calling above function(updateIDConfig) previously_selected_feature = current_selected; idCaptureView.setVisibility(View.GONE); selfieCaptureView.setVisibility(View.GONE); fingerprintCaptureView.setVisibility(View.GONE); voiceRecordingView.setVisibility(View.GONE); if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT)) { idCaptureView.setVisibility(View.VISIBLE); //setIDFrontValues(); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK)) { idCaptureView.setVisibility(View.VISIBLE); //setIDBackValues(); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { selfieCaptureView.setVisibility(View.VISIBLE); setSelfieCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { setFPCaptureDefaultValues(); fingerprintCaptureView.setVisibility(View.VISIBLE); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK)) { idCaptureView.setVisibility(View.VISIBLE); setIDCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)) { voiceRecordingView.setVisibility(View.VISIBLE); setVoiceRecordingDefaultValues(); } } @Override public void onNothingSelected(AdapterView<?> adapterView) { } }); super.onViewCreated(view, savedInstanceState); } @Override public void onResume() { super.onResume(); CustomizeUIConfigManager.initCustomizeUIConfig(getActivity()); String current_selected = ((Pair) spinnerUIConfig.getSelectedItem()).second.toString(); if (!StringUtil.isEmpty(current_selected)) { if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FACE_CAPTURE)) { setSelfieCaptureDefaultValues(); } else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.FINGER_4F_CAPTURE)) { setFPCaptureDefaultValues(); } else if(current_selected.equalsIgnoreCase(CustomizeUIConfigManager.VOICE_RECORDING)){ setVoiceRecordingDefaultValues(); }else if (current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_FRONT) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.ID_CAPTURE_BACK) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.DOCUMENT_CAPTURE) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SNIPPET_CAPTURE) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_BACK) || current_selected.equalsIgnoreCase(CustomizeUIConfigManager.SECONDARY_ID_CAPTURE_FRONT)) { setIDCaptureDefaultValues(); } } } public static void hideKeyboard(Context context, View view) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } private int getPositionInPair(ArrayList<Pair<String, String>> pairList, String value) { for (int i = 0; i < pairList.size(); i++) { Pair<String, String> pair = pairList.get(i); if (value.equalsIgnoreCase(pair.second)) { return i; } } return -1; } private String getFacePosition(String value) { String faceOnTop = "Top"; if (value.equalsIgnoreCase("N")) { faceOnTop = "Bottom"; } else { faceOnTop = "Top"; } return faceOnTop; } private String setJsonFormatFacePosition(String value) { String faceOnTop = "Y"; if (value.equalsIgnoreCase("Bottom")) { faceOnTop = "N"; } else { faceOnTop = "Y"; } return faceOnTop; } private String[] setToArray(Set<String> set) { int siz = set.size(); String[] arr = new String[siz]; int i = 0; for (String s : set) { arr[i++] = s; } return arr; } private String getConvertedBaset64Image(String selectedImage) { Bitmap titleBitmap = null; String base64Image=null; if (!selectedImage.equalsIgnoreCase("None")) { titleBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.title_image); base64Image= BitmapUtils.bitmapToBase64(titleBitmap); }else{ base64Image=""; } return base64Image; } }
99,754
0.739559
0.738597
1,339
73.498878
46.441471
300
false
false
0
0
0
0
0
0
1.116505
false
false
2
042012f188c39be925477162f95ae1aee47f7942
27,839,978,017,639
1e5fe92eee7a08146240677ab5b2c41a99d15a06
/app/src/main/java/com/samboy/dmcc/jobs/model/Job.java
e9d84ab7e70180f622e233ca75b6290f444420ff
[]
no_license
samrajuadapt/DMCC
https://github.com/samrajuadapt/DMCC
dcf8dc4334625d94ef013ce7cff874358b9cc18a
4055cf0a425bd88e642d0a23d1750b232ebc85db
refs/heads/master
2022-12-29T06:48:02.034000
2020-10-19T11:54:15
2020-10-19T11:54:15
304,887,959
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.samboy.dmcc.jobs.model; import androidx.room.Entity; import androidx.room.PrimaryKey; @Entity(tableName = "jobs") public class Job { @PrimaryKey(autoGenerate = true) private int id; private String userId; private String country; private String region; private String state; private String town; private String job; public Job() { } public Job(String userId, String country, String region, String state, String town, String job) { this.userId = userId; this.country = country; this.region = region; this.state = state; this.town = town; this.job = job; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getRegion() { return region; } public void setRegion(String region) { this.region = region; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getTown() { return town; } public void setTown(String town) { this.town = town; } public String getJob() { return job; } public void setJob(String job) { this.job = job; } }
UTF-8
Java
1,603
java
Job.java
Java
[]
null
[]
package com.samboy.dmcc.jobs.model; import androidx.room.Entity; import androidx.room.PrimaryKey; @Entity(tableName = "jobs") public class Job { @PrimaryKey(autoGenerate = true) private int id; private String userId; private String country; private String region; private String state; private String town; private String job; public Job() { } public Job(String userId, String country, String region, String state, String town, String job) { this.userId = userId; this.country = country; this.region = region; this.state = state; this.town = town; this.job = job; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getRegion() { return region; } public void setRegion(String region) { this.region = region; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getTown() { return town; } public void setTown(String town) { this.town = town; } public String getJob() { return job; } public void setJob(String job) { this.job = job; } }
1,603
0.58141
0.58141
84
18.071428
16.321024
101
false
false
0
0
0
0
0
0
0.416667
false
false
2
5cc36a20dc4c1a27c3e880b70a0b20a6524e5177
16,569,983,840,149
a6370c75b974470e25aa628dab36a582dea9b2d8
/sportsbetting-application-domain/src/main/java/com/example/sportsbetting/database/OutcomeBuilder.java
8f7ec484ba6613300ad31823b058c321ff46bc20
[]
no_license
JankovicsSandor/VDVNIO_Sportbetting
https://github.com/JankovicsSandor/VDVNIO_Sportbetting
f76d5fbe0a5eb3d8c55a98edfc0ac859f5e42656
5ad1b599a11160ab3e334dfafc6a800cd0f6c028
refs/heads/master
2020-08-08T02:51:45.941000
2019-11-30T14:07:36
2019-11-30T14:07:36
213,683,907
0
0
null
false
2020-07-02T00:57:38
2019-10-08T15:36:09
2019-11-30T14:07:58
2020-07-02T00:57:36
126
0
0
1
Java
false
false
/* * 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.sportsbetting.database; import com.example.sportsbetting.domain.Bet; import com.example.sportsbetting.domain.Outcome; import com.example.sportsbetting.domain.OutcomeOdd; import java.util.ArrayList; import java.util.List; /** * * @author Sanyi */ public class OutcomeBuilder { private String description; private Bet bet; private List<OutcomeOdd> outcomeOdds; public OutcomeBuilder() { this.outcomeOdds=new ArrayList<OutcomeOdd>(); } public OutcomeBuilder description(String description) { this.description = description; return this; } public OutcomeBuilder bet(Bet bet) { this.bet = bet; return this; } public OutcomeBuilder outcomeOdds(List<OutcomeOdd> outcomeOdds) { this.outcomeOdds = outcomeOdds; return this; } public Outcome build() { return new Outcome(description,bet,outcomeOdds); } }
UTF-8
Java
1,133
java
OutcomeBuilder.java
Java
[ { "context": "rayList;\nimport java.util.List;\n\n/**\n *\n * @author Sanyi\n */\npublic class OutcomeBuilder {\n\n private Str", "end": 452, "score": 0.9716165661811829, "start": 447, "tag": "NAME", "value": "Sanyi" } ]
null
[]
/* * 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.sportsbetting.database; import com.example.sportsbetting.domain.Bet; import com.example.sportsbetting.domain.Outcome; import com.example.sportsbetting.domain.OutcomeOdd; import java.util.ArrayList; import java.util.List; /** * * @author Sanyi */ public class OutcomeBuilder { private String description; private Bet bet; private List<OutcomeOdd> outcomeOdds; public OutcomeBuilder() { this.outcomeOdds=new ArrayList<OutcomeOdd>(); } public OutcomeBuilder description(String description) { this.description = description; return this; } public OutcomeBuilder bet(Bet bet) { this.bet = bet; return this; } public OutcomeBuilder outcomeOdds(List<OutcomeOdd> outcomeOdds) { this.outcomeOdds = outcomeOdds; return this; } public Outcome build() { return new Outcome(description,bet,outcomeOdds); } }
1,133
0.694616
0.694616
48
22.604166
21.836266
79
false
false
0
0
0
0
0
0
0.458333
false
false
2
9f44ab6106adf8bd7baa360ad0d5bf1bbf1cace2
30,279,519,453,971
a4916e8156e2324e036e73542321244ec01a062a
/IndicadoresFinancieros/src/com/ibm/banorte/indicadoresFinancieros/server/dto/DolarDTO.java
f8333701ede47033aea67a8d12a17557a907abb0
[]
no_license
otobismac/PublicoSumando
https://github.com/otobismac/PublicoSumando
adbbfc3fcd779a5ed651f63ac3a4ac2a167ac291
d571032db09a1fb0d9bfa1d6f6350e556112f9a9
refs/heads/master
2020-12-08T23:30:46.790000
2020-01-10T20:07:42
2020-01-10T20:07:42
233,121,248
1
0
null
false
2020-10-13T18:46:17
2020-01-10T20:00:48
2020-01-10T20:41:06
2020-10-13T18:46:16
96,608
1
0
2
JavaScript
false
false
package com.ibm.banorte.indicadoresFinancieros.server.dto; import java.io.Serializable; public class DolarDTO implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String nombreDolar; private String compra; private String venta; public String getNombreDolar() { return nombreDolar; } public void setNombreDolar(String nombreDolar) { this.nombreDolar = nombreDolar; } public String getCompra() { return compra; } public void setCompra(String compra) { this.compra = compra; } public String getVenta() { return venta; } public void setVenta(String venta) { this.venta = venta; } }
UTF-8
Java
699
java
DolarDTO.java
Java
[]
null
[]
package com.ibm.banorte.indicadoresFinancieros.server.dto; import java.io.Serializable; public class DolarDTO implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String nombreDolar; private String compra; private String venta; public String getNombreDolar() { return nombreDolar; } public void setNombreDolar(String nombreDolar) { this.nombreDolar = nombreDolar; } public String getCompra() { return compra; } public void setCompra(String compra) { this.compra = compra; } public String getVenta() { return venta; } public void setVenta(String venta) { this.venta = venta; } }
699
0.688126
0.686695
37
16.891891
17.201168
58
false
false
0
0
0
0
0
0
1.243243
false
false
2
380fd9a1d085545f34f70d5c7d68da5ce707c0c7
25,134,148,640,964
5d125e3fa3557ec7e740a0781c0fc48189a70e8a
/程序员代码面试指南/第八章:数组和矩阵问题/src/dxc/no14_自然数数组的排序/Test.java
0e68d5d835d6ac5b6d8d8bc802b6230bf027e5c1
[]
no_license
Dangwuxie/LeetCode_JavaSE_2019
https://github.com/Dangwuxie/LeetCode_JavaSE_2019
7d7cc117b4402e76266f089c5d289d5488115f9c
fedec290d9b63dc80c6fe55c3e85f3f7536a6b1e
refs/heads/master
2020-06-02T22:33:22.915000
2020-03-09T11:32:56
2020-03-09T11:33:12
191,330,169
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package dxc.no14_自然数数组的排序; /** * @author dxc * @Title: Test * @Description: 天下风云出我辈,一入代码岁月催, * --------------皇图霸业谈笑中,不胜编程一场醉。 * @date 2020/1/7 21:53 */ public class Test { public static void main(String[] args) { int[] arr = new int[]{1,4,3,2,5}; ArrSort.sort2(arr); for (int cur : arr){ System.out.println(cur); } } }
UTF-8
Java
461
java
Test.java
Java
[ { "context": "package dxc.no14_自然数数组的排序;\n\n/**\n * @author dxc\n * @Title: Test\n * @Description: 天下风云出我辈,一入代码岁月催,", "end": 46, "score": 0.9996386170387268, "start": 43, "tag": "USERNAME", "value": "dxc" } ]
null
[]
package dxc.no14_自然数数组的排序; /** * @author dxc * @Title: Test * @Description: 天下风云出我辈,一入代码岁月催, * --------------皇图霸业谈笑中,不胜编程一场醉。 * @date 2020/1/7 21:53 */ public class Test { public static void main(String[] args) { int[] arr = new int[]{1,4,3,2,5}; ArrSort.sort2(arr); for (int cur : arr){ System.out.println(cur); } } }
461
0.527559
0.480315
21
17.142857
14.710818
44
false
false
0
0
0
0
0
0
0.380952
false
false
7
a5aaedf22e2fd5b0607860f88b96aff84269099b
16,836,271,854,989
a03d610b26a1fc0d65c69856af8343a556da3ef5
/src/siestageek/mvc/controller/MVCInitController.java
51d321be3320725c362d14941a9b5fd7df447cae
[]
no_license
zzyzzy/MVCProjectV0
https://github.com/zzyzzy/MVCProjectV0
b927f06088138090d5db17b26d8048de3bf2db28
291d63f16177ac200d4bdbffd04fa1c5405241d2
refs/heads/master
2022-08-02T02:22:54.084000
2020-05-22T07:27:24
2020-05-22T07:27:24
266,042,397
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package siestageek.mvc.controller; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import java.io.FileInputStream; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Properties; public class MVCInitController extends HttpServlet { // mvc.properties 파일의 내용을 // 해쉬맵으로 저장하기 위한 변수 선언 private static Map<String, Object> commandHandlerMap = new HashMap<>(); // 생성한 해쉬맵 변수를 사용할 수 있도록 // getter 메서드 정의 public static Map<String, Object> getCommandHandlerMap() { return commandHandlerMap; } // 서블릿 초기화 메서드 @Override public void init(ServletConfig sc) throws ServletException { System.out.println("MVC 초기화컨트롤러 실행중 ..."); String mvccfg = sc.getInitParameter("mvc_config"); // mvc.properties 파일의 실제 경로를 // web.xml에서 읽어옴 Properties p = new Properties(); FileInputStream fis = null; // mvc.properties 파일의 내용을 읽어 // Properties 객체에 적재함 try { String fpath = sc.getServletContext() .getRealPath(mvccfg); // 경로지정 fis = new FileInputStream(fpath); // 경로에 있는 파일가져오기 p.load(fis); // properties 객체에 저장 } catch (Exception ex) { ex.printStackTrace(); } finally { if (fis != null) try { fis.close(); } catch (Exception e) {} } // try // Properties 객체에 적재된 정보를 기초로 // HashMap 객체에 키와 값 형태로 적재함 Iterator<Object> iter = p.keySet().iterator(); while(iter.hasNext()) { String cmd = (String) iter.next(); String handler = p.getProperty(cmd); try { // 키에 대응하는 핸들러 클래스의 객체를 // 동적으로 생성함 // 즉, mvc.prpoerties 파일에 텍스트로 정의된 // 클래스이름을 이용해서 해당 객체 생성 // IndexHandeler index = new IndexHandler(); Class<?> handlerClass = Class.forName(handler); Object objHandler = handlerClass.newInstance(); // 생성한 객체는 나중에 필요할때 // 찾기 쉽도록 hashmap에 저장해 둠 commandHandlerMap.put(cmd, objHandler); } catch (Exception ex) { ex.printStackTrace(); } // try } // while System.out.println( "MVC 초기화컨트롤러가 성공적으로 실행됨!!"); } // init }
UTF-8
Java
2,929
java
MVCInitController.java
Java
[]
null
[]
package siestageek.mvc.controller; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import java.io.FileInputStream; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Properties; public class MVCInitController extends HttpServlet { // mvc.properties 파일의 내용을 // 해쉬맵으로 저장하기 위한 변수 선언 private static Map<String, Object> commandHandlerMap = new HashMap<>(); // 생성한 해쉬맵 변수를 사용할 수 있도록 // getter 메서드 정의 public static Map<String, Object> getCommandHandlerMap() { return commandHandlerMap; } // 서블릿 초기화 메서드 @Override public void init(ServletConfig sc) throws ServletException { System.out.println("MVC 초기화컨트롤러 실행중 ..."); String mvccfg = sc.getInitParameter("mvc_config"); // mvc.properties 파일의 실제 경로를 // web.xml에서 읽어옴 Properties p = new Properties(); FileInputStream fis = null; // mvc.properties 파일의 내용을 읽어 // Properties 객체에 적재함 try { String fpath = sc.getServletContext() .getRealPath(mvccfg); // 경로지정 fis = new FileInputStream(fpath); // 경로에 있는 파일가져오기 p.load(fis); // properties 객체에 저장 } catch (Exception ex) { ex.printStackTrace(); } finally { if (fis != null) try { fis.close(); } catch (Exception e) {} } // try // Properties 객체에 적재된 정보를 기초로 // HashMap 객체에 키와 값 형태로 적재함 Iterator<Object> iter = p.keySet().iterator(); while(iter.hasNext()) { String cmd = (String) iter.next(); String handler = p.getProperty(cmd); try { // 키에 대응하는 핸들러 클래스의 객체를 // 동적으로 생성함 // 즉, mvc.prpoerties 파일에 텍스트로 정의된 // 클래스이름을 이용해서 해당 객체 생성 // IndexHandeler index = new IndexHandler(); Class<?> handlerClass = Class.forName(handler); Object objHandler = handlerClass.newInstance(); // 생성한 객체는 나중에 필요할때 // 찾기 쉽도록 hashmap에 저장해 둠 commandHandlerMap.put(cmd, objHandler); } catch (Exception ex) { ex.printStackTrace(); } // try } // while System.out.println( "MVC 초기화컨트롤러가 성공적으로 실행됨!!"); } // init }
2,929
0.551669
0.551669
84
28.607143
19.591675
63
false
false
0
0
0
0
0
0
0.392857
false
false
7
26d1f6fc2bc28e9167708e49186751028bd2e9fb
8,504,035,282,093
02294d577bb9120d7ca49c9ce0225d351a3b2277
/Flight-Service/src/main/java/capg/poc/FlightService/services/FlightService.java
5c18aa330e179b6c957c78fbd93e94a2e2a93720
[]
no_license
simranarora298/Online-Flight-Booking-System
https://github.com/simranarora298/Online-Flight-Booking-System
8fc252931bc84239d51e3450abcbf9f42c6c4f90
58a945eb9b969effa15de12e3de90fdf999cabbd
refs/heads/main
2023-08-18T07:11:21.300000
2021-10-17T17:16:34
2021-10-17T17:16:34
413,876,828
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package capg.poc.FlightService.services; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import capg.poc.FlightService.models.Flight; import capg.poc.FlightService.repository.FlightRepository; @Service public class FlightService { @Autowired private FlightRepository flightRepository; public List<Flight> getAllFlights() { List<Flight> flights = new ArrayList<>(); flightRepository.findAll() .forEach(flights::add); return flights; } public void addFlight(Flight flight) { flightRepository.save(flight); } public void updateFlight(String flightId , Flight flight) { flightRepository.save(flight); } public void deleteFlight(String flightId) { flightRepository.deleteById(flightId); } public List<Flight> flightByDepartureArrivalLocation(String departureLocation , String arrivalLocation ) { List<Flight> flights = new ArrayList<>(); flightRepository.findByDepartureLocation(departureLocation, arrivalLocation) .forEach(flights::add); return flights; } public List<Flight> flightByDate(String date) { List<Flight> flights = new ArrayList<>(); flightRepository.findByDate(date) .forEach(flights::add); return flights; } public Flight findByFlightId(String flightId) { Flight flight = flightRepository.findByFlightId(flightId); if (flight!=null) { return flightRepository.findByFlightId(flightId); }else { System.out.println("No such flight exist"); return null; } } }
UTF-8
Java
1,658
java
FlightService.java
Java
[]
null
[]
package capg.poc.FlightService.services; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import capg.poc.FlightService.models.Flight; import capg.poc.FlightService.repository.FlightRepository; @Service public class FlightService { @Autowired private FlightRepository flightRepository; public List<Flight> getAllFlights() { List<Flight> flights = new ArrayList<>(); flightRepository.findAll() .forEach(flights::add); return flights; } public void addFlight(Flight flight) { flightRepository.save(flight); } public void updateFlight(String flightId , Flight flight) { flightRepository.save(flight); } public void deleteFlight(String flightId) { flightRepository.deleteById(flightId); } public List<Flight> flightByDepartureArrivalLocation(String departureLocation , String arrivalLocation ) { List<Flight> flights = new ArrayList<>(); flightRepository.findByDepartureLocation(departureLocation, arrivalLocation) .forEach(flights::add); return flights; } public List<Flight> flightByDate(String date) { List<Flight> flights = new ArrayList<>(); flightRepository.findByDate(date) .forEach(flights::add); return flights; } public Flight findByFlightId(String flightId) { Flight flight = flightRepository.findByFlightId(flightId); if (flight!=null) { return flightRepository.findByFlightId(flightId); }else { System.out.println("No such flight exist"); return null; } } }
1,658
0.720748
0.720748
68
22.411764
23.442818
107
false
false
0
0
0
0
0
0
1.617647
false
false
7
6d86394deaa0ee4a75d8342d876290e9da072e1b
7,859,790,197,076
3c75601021eb721876b8499b6079e86841a6fb83
/src/latihanUkl4A/LatihanUkl4A.java
1eac679077050ed07492e4c7053573ac533c8510
[]
no_license
AyuAisyahFatimatuhSyahra/LatihanUkl4
https://github.com/AyuAisyahFatimatuhSyahra/LatihanUkl4
765ac6511c31fa6c9c677e07f527e2826b5ba185
370c861541526023e73ea532fd17ad016097f724
refs/heads/master
2023-06-26T23:55:56.724000
2021-08-02T13:23:22
2021-08-02T13:23:22
391,957,586
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 latihanUkl4A; public class LatihanUkl4A { public static void main(String[] args) { // TODO code application logic here System.out.println(""); int n, a, b, sukuPertama, selisih, nilaiSaatIni; n = 4; sukuPertama = 5; selisih = 5; for (a=0; a<=n; a++){ for (b=0; b<a; b++){ nilaiSaatIni = sukuPertama; sukuPertama += selisih; System.out.print(nilaiSaatIni + " "); } System.out.println(); } } }
UTF-8
Java
774
java
LatihanUkl4A.java
Java
[]
null
[]
/* * 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 latihanUkl4A; public class LatihanUkl4A { public static void main(String[] args) { // TODO code application logic here System.out.println(""); int n, a, b, sukuPertama, selisih, nilaiSaatIni; n = 4; sukuPertama = 5; selisih = 5; for (a=0; a<=n; a++){ for (b=0; b<a; b++){ nilaiSaatIni = sukuPertama; sukuPertama += selisih; System.out.print(nilaiSaatIni + " "); } System.out.println(); } } }
774
0.529716
0.520672
29
25.689655
20.217957
79
false
false
0
0
0
0
0
0
0.758621
false
false
7
317bf82bc07e4456736e8db32a8ae5d737110d26
4,140,348,535,035
4353c02f63211c3f76bfc0dad367a7a180293fb1
/src/main/java/com/medico/swiftcure/model/Comment.java
9c16b3304786666dd9ed8e210ed1bad6693c8467
[]
no_license
EnnBi/myrepo
https://github.com/EnnBi/myrepo
339d447f1858192e8eeed1f4689b6c9dc0e149a7
2b6e3589b83a21757b24e4a74fade602ca73db8e
refs/heads/master
2019-04-27T09:45:44.501000
2017-09-18T07:03:24
2017-09-18T07:03:24
82,655,742
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.medico.swiftcure.model; import java.util.Date; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; import org.springframework.format.annotation.DateTimeFormat; @Entity public class Comment { @Column(name="Id") @Id@GeneratedValue(strategy=GenerationType.AUTO) long id; @Column(name="Comment") String comment; @ManyToOne User user; @LazyCollection(LazyCollectionOption.FALSE) @Column(name="Replies") @OneToMany(cascade=CascadeType.ALL,mappedBy="comment") List<Reply> replies; @DateTimeFormat(pattern="dd-MM-yyyy") @Column(name="Date") Date date; @ManyToOne(fetch=FetchType.EAGER) Doctor doctor; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public List<Reply> getReplies() { return replies; } public void setReplies(List<Reply> replies) { this.replies = replies; } public Doctor getDoctor() { return doctor; } public void setDoctor(Doctor doctor) { this.doctor = doctor; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } }
UTF-8
Java
1,708
java
Comment.java
Java
[]
null
[]
package com.medico.swiftcure.model; import java.util.Date; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; import org.springframework.format.annotation.DateTimeFormat; @Entity public class Comment { @Column(name="Id") @Id@GeneratedValue(strategy=GenerationType.AUTO) long id; @Column(name="Comment") String comment; @ManyToOne User user; @LazyCollection(LazyCollectionOption.FALSE) @Column(name="Replies") @OneToMany(cascade=CascadeType.ALL,mappedBy="comment") List<Reply> replies; @DateTimeFormat(pattern="dd-MM-yyyy") @Column(name="Date") Date date; @ManyToOne(fetch=FetchType.EAGER) Doctor doctor; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public List<Reply> getReplies() { return replies; } public void setReplies(List<Reply> replies) { this.replies = replies; } public Doctor getDoctor() { return doctor; } public void setDoctor(Doctor doctor) { this.doctor = doctor; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } }
1,708
0.741803
0.741803
93
17.365591
16.317934
60
false
false
0
0
0
0
0
0
1.11828
false
false
7
af65dd635debe2ac4ce24ed2f577f24512b78533
32,152,125,197,862
ce774eba6d63d7b3db7e338321b0db1333423e96
/scParent/cloudalibaba-provider-payment9001/src/main/java/com/test/controller/PaymentController.java
2e00874e455579392960a6c0da8aca09c9294faa
[]
no_license
ExcelCodeM/springCloudTest
https://github.com/ExcelCodeM/springCloudTest
431631d8ee4345c32ea411c2a205640fc9902884
0949fa0559463a8fe0fbed35f1e494c81ddc8f6b
refs/heads/master
2023-03-20T12:10:28.796000
2023-03-14T17:20:41
2023-03-14T17:20:41
246,057,727
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.test.controller; import com.test.entity.R; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** * @author :Breeze * @date :Created in 2020/4/16 22:36 * @description: */ @RestController public class PaymentController { @Value("${server.port}") private String serverPort; @GetMapping("/get/{id}") public R getId(@PathVariable("id") Long id){ return new R(200,"ok", "id:"+ id +",post:"+ serverPort); } }
UTF-8
Java
650
java
PaymentController.java
Java
[ { "context": ".bind.annotation.RestController;\n\n/**\n * @author :Breeze\n * @date :Created in 2020/4/16 22:36\n * @descript", "end": 321, "score": 0.9964118003845215, "start": 315, "tag": "USERNAME", "value": "Breeze" } ]
null
[]
package com.test.controller; import com.test.entity.R; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** * @author :Breeze * @date :Created in 2020/4/16 22:36 * @description: */ @RestController public class PaymentController { @Value("${server.port}") private String serverPort; @GetMapping("/get/{id}") public R getId(@PathVariable("id") Long id){ return new R(200,"ok", "id:"+ id +",post:"+ serverPort); } }
650
0.715838
0.694099
26
23.76923
22.299202
64
false
false
0
0
0
0
0
0
0.423077
false
false
7
e66428b8679bd45f8f14439b0541bb1febc6d7f6
7,679,401,556,785
171940766add6dac321d8e7f10fbf7ce1ae7fbb0
/Profile.java
a80695f77f5b1c7eb57445b2672fee241b342bc9
[]
no_license
YanboGuo/522-final-project
https://github.com/YanboGuo/522-final-project
7361a0c92d0a7341edef2f1a67ef0aabdf9d23e9
08609445bde13881d47f0a5755e0c855b034a995
refs/heads/master
2021-08-20T01:00:11.496000
2017-11-27T21:41:43
2017-11-27T21:41:43
112,017,850
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.*; public class Profile { private Scanner profilescanner = new Scanner(System.in); String username = null; private String password = null; String address = null; String phonenumber = null; Payment payment = null; String email = null; account account; public Profile(String username, String password, account account){ this.username = username; this.password = password; this.account = account; } public void list(){ System.out.println("Please select a number about what you want to do:"); System.out.println("1: Update your username"); System.out.println("2: Update your address"); System.out.println("3: Update your phone number"); System.out.println("4: Update your email address"); System.out.println("5: Change my password"); System.out.println("6: View my Profile"); System.out.println("7: Return to last page"); if(profilescanner.hasNextInt()){ int Number = profilescanner.nextInt(); profilescanner.nextLine(); if(Number == 1){ System.out.println("Your current username is: " + this.username); System.out.println("Please provide your new username"); String newusername = profilescanner.nextLine(); updateUsername(newusername); } else if(Number == 2){ System.out.println("Your current address is: " + this.address); System.out.println("Please provide your new address"); String newaddress = profilescanner.nextLine(); updateAddress(newaddress); } else if(Number == 3){ System.out.println("Your current phone number is: " + this.phonenumber); System.out.println("Please provide your new phone number"); String newphoneNo = profilescanner.nextLine(); updateEmail(newphoneNo); } else if(Number == 4){ System.out.println("Your current email address is: " + this.email); System.out.println("Please provide your new email address"); String newemail = profilescanner.nextLine(); updateEmail(newemail); } else if(Number == 5){ updatePassword(); } else if(Number == 6){ viewMyProfile(); } else if(Number == 7){ account.list(); } else{ System.out.println("Please enter the right number"); this.list(); } } else{ profilescanner.nextLine(); System.out.println("Please enter the right number"); this.list(); } } public void updateUsername(String profilename){ this.username = profilename; System.out.println("Username Updated"); this.list(); } public void updateAddress(String address){ this.address = address; System.out.println("Address Updated"); this.list(); } public void updatePhone(String phonenumber){ this.phonenumber = phonenumber; System.out.println("Phone number Updated"); this.list(); } public void updateEmail(String email){ this.email = email; System.out.println("Email Address Updated"); this.list(); } public void updatePassword(){ System.out.println("Please provide your old password"); String oldpassword = profilescanner.nextLine(); if(oldpassword.equals(this.password)){ boolean redo = true; while(redo){ System.out.println("Please provide your new password"); String newpassword1 = profilescanner.nextLine(); System.out.println("Please re-enter your new password"); String newpassword2 = profilescanner.nextLine(); if(newpassword1.equals(newpassword2)){ this.password = newpassword1; redo = false; } } } else{ System.out.println("Password wrong. Cannot change your password"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); } this.list(); } public void viewMyProfile(){ System.out.println("Your username is: " + this.username); System.out.println("Your address is: " + this.address); System.out.println("Your phone number is: " + this.phonenumber); System.out.println("Your email address is: " + this.email); this.list(); } public void createProfile(){ System.out.println("Please provide your phone number"); String phonenumber = profilescanner.nextLine(); this.phonenumber = phonenumber; System.out.println("Please provide your address"); String address = profilescanner.nextLine(); this.address = address; System.out.println("Please provide your email"); String email = profilescanner.nextLine(); this.email = email; } }
UTF-8
Java
4,445
java
Profile.java
Java
[ { "context": "tring username = null;\r\n\tprivate String password = null;\r\n\tString address = null;\r\n\tString phonenumber = ", "end": 163, "score": 0.9669264554977417, "start": 159, "tag": "PASSWORD", "value": "null" }, { "context": "ing password, account account){\r\n\t\tthis.us...
null
[]
import java.util.*; public class Profile { private Scanner profilescanner = new Scanner(System.in); String username = null; private String password = <PASSWORD>; String address = null; String phonenumber = null; Payment payment = null; String email = null; account account; public Profile(String username, String password, account account){ this.username = username; this.password = <PASSWORD>; this.account = account; } public void list(){ System.out.println("Please select a number about what you want to do:"); System.out.println("1: Update your username"); System.out.println("2: Update your address"); System.out.println("3: Update your phone number"); System.out.println("4: Update your email address"); System.out.println("5: Change my password"); System.out.println("6: View my Profile"); System.out.println("7: Return to last page"); if(profilescanner.hasNextInt()){ int Number = profilescanner.nextInt(); profilescanner.nextLine(); if(Number == 1){ System.out.println("Your current username is: " + this.username); System.out.println("Please provide your new username"); String newusername = profilescanner.nextLine(); updateUsername(newusername); } else if(Number == 2){ System.out.println("Your current address is: " + this.address); System.out.println("Please provide your new address"); String newaddress = profilescanner.nextLine(); updateAddress(newaddress); } else if(Number == 3){ System.out.println("Your current phone number is: " + this.phonenumber); System.out.println("Please provide your new phone number"); String newphoneNo = profilescanner.nextLine(); updateEmail(newphoneNo); } else if(Number == 4){ System.out.println("Your current email address is: " + this.email); System.out.println("Please provide your new email address"); String newemail = profilescanner.nextLine(); updateEmail(newemail); } else if(Number == 5){ updatePassword(); } else if(Number == 6){ viewMyProfile(); } else if(Number == 7){ account.list(); } else{ System.out.println("Please enter the right number"); this.list(); } } else{ profilescanner.nextLine(); System.out.println("Please enter the right number"); this.list(); } } public void updateUsername(String profilename){ this.username = profilename; System.out.println("Username Updated"); this.list(); } public void updateAddress(String address){ this.address = address; System.out.println("Address Updated"); this.list(); } public void updatePhone(String phonenumber){ this.phonenumber = phonenumber; System.out.println("Phone number Updated"); this.list(); } public void updateEmail(String email){ this.email = email; System.out.println("Email Address Updated"); this.list(); } public void updatePassword(){ System.out.println("Please provide your old password"); String oldpassword = profilescanner.nextLine(); if(oldpassword.equals(this.password)){ boolean redo = true; while(redo){ System.out.println("Please provide your new password"); String newpassword1 = profilescanner.nextLine(); System.out.println("Please re-enter your new password"); String newpassword2 = profilescanner.nextLine(); if(newpassword1.equals(newpassword2)){ this.password = <PASSWORD>; redo = false; } } } else{ System.out.println("Password wrong. Cannot change your password"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); } this.list(); } public void viewMyProfile(){ System.out.println("Your username is: " + this.username); System.out.println("Your address is: " + this.address); System.out.println("Your phone number is: " + this.phonenumber); System.out.println("Your email address is: " + this.email); this.list(); } public void createProfile(){ System.out.println("Please provide your phone number"); String phonenumber = profilescanner.nextLine(); this.phonenumber = phonenumber; System.out.println("Please provide your address"); String address = profilescanner.nextLine(); this.address = address; System.out.println("Please provide your email"); String email = profilescanner.nextLine(); this.email = email; } }
4,451
0.666592
0.662317
150
27.633333
21.786667
75
false
false
0
0
0
0
0
0
2.553333
false
false
7
f1bcab72d41c7df8f57dfeba20a848337a30548a
34,265,249,087,619
695a788a830a198f04c1cdf9edab1733f6c3b3e3
/volcano/src/main/java/br/mil/defesa/sisgeodef/srtm/LatLon.java
b2eb578cbf2b910824a64330291de4a54d20a302
[]
no_license
icemagno/geoinfra
https://github.com/icemagno/geoinfra
0270e4b7b88532b1e866223febf32054e16784e3
21f83a636c46f5f7ec88833aa7bc84ff31758873
refs/heads/master
2021-06-05T01:48:23.150000
2020-08-04T08:20:30
2020-08-04T08:20:30
186,869,306
1
0
null
false
2021-05-11T01:30:52
2019-05-15T17:00:00
2020-08-04T08:20:41
2021-05-11T01:30:51
873,911
0
0
17
JavaScript
false
false
package br.mil.defesa.sisgeodef.srtm; public class LatLon { public double lat; public double lon; public LatLon( double lat, double lon) { this.lat = lat; this.lon = lon; } public double getLat() { return lat; } public double getLon() { return lon; } @Override public String toString() { return String.valueOf(lat) + ", " + String.valueOf(lon); } }
UTF-8
Java
406
java
LatLon.java
Java
[]
null
[]
package br.mil.defesa.sisgeodef.srtm; public class LatLon { public double lat; public double lon; public LatLon( double lat, double lon) { this.lat = lat; this.lon = lon; } public double getLat() { return lat; } public double getLon() { return lon; } @Override public String toString() { return String.valueOf(lat) + ", " + String.valueOf(lon); } }
406
0.610837
0.610837
25
14.24
14.865477
58
false
false
0
0
0
0
0
0
1.44
false
false
7
3f5cd737dda47dc30b19fb41d75783aeab595954
21,792,664,079,991
1e9db92de9e745f3259b1c803b63576d75fb5d07
/src/main/java/ogs/wapi/mock/dao/entities/TransactionType.java
021888618515015e69534a0c4978350eea578904
[]
no_license
Amitpawar503/lazzy
https://github.com/Amitpawar503/lazzy
0b72e64876f3fef3ba0392e94c3bb7bbd27b10aa
14bef96000986ef75b78852f26dbf7dc9b6ab790
refs/heads/master
2020-04-01T13:51:42.279000
2018-10-16T10:59:36
2018-10-16T10:59:36
153,270,351
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ogs.wapi.mock.dao.entities; public enum TransactionType { wager, result, rollback }
UTF-8
Java
97
java
TransactionType.java
Java
[]
null
[]
package ogs.wapi.mock.dao.entities; public enum TransactionType { wager, result, rollback }
97
0.752577
0.752577
8
11.125
12.323124
35
false
false
0
0
0
0
0
0
0.75
false
false
7
fc2bb1d8fe1e976740c4a89b331b8572d28641ac
17,420,387,393,617
ad713f187758a74a0891da47fc5a14d640c4ab77
/Bank Management System BMS/src/com/cgBanka/service/cgBankService.java
95c639177cfb6c5a24543427237c420397fcf1a4
[]
no_license
mouli07/Assignment-1
https://github.com/mouli07/Assignment-1
491c6119af91e417614244cbb7cddff07ac91cb5
43cb726e8bc946f509c3a450276ba0877dbe1205
refs/heads/master
2020-03-23T19:10:56.358000
2018-08-25T17:46:46
2018-08-25T17:46:46
141,958,383
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cgBanka.service; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import com.cgBanka.factory.cgBankFactory; import com.cgbank.dao.cgBankDAO; import com.framework.dao.BankDAOImpl; import com.framework.pojo.BankAccount; import com.framework.pojo.Customer; import com.framework.service.BankService; public class cgBankService extends BankService{ BankDAOImpl collection=new BankDAOImpl(); public cgBankService() { super(); } @Override /*public void createNewSavingsAccount(Map<String, Object> account) { collection.addBankAccount(new cgBankFactory().createNewSavingsAccount(account)); } @Override public void createNewCurrentAccount(Map<String, Object> account) { collection.addBankAccount(new cgBankFactory().createNewCurrentAccount(account)); } */ public Collection<BankAccount> getAllAccounts() { return collection.viewAll(); // return null; } @Override public Collection<Customer> getAllCustomers() { // TODO Auto-generated method stub List<Customer> listOfCustomer = new ArrayList<>(); (collection.viewAll()).stream().forEach((element) -> listOfCustomer.add(element.getAccountHolder())); return listOfCustomer; } @Override public BankAccount getAccountById(int id) { for (BankAccount account : collection.viewAll()) { if (BankAccount.getAccountNumber() == id) return account; } return null; } public int withdraw(int accNo, double amount) { BankAccount account = getAccountById(accNo); double amountBefore = account.getAccountBalance(); account.withdraw(amount); return (int) account.getAccountBalance(); /*if (amountBefore == account.getAccountBalance()) return -1; else return 1;*/ } @Override public int fundTransfer(int accNoSender, int accNoReciever, double amount) { BankAccount account = getAccountById(accNoSender); double amountBefore = account.getAccountBalance(); account.withdraw(amount); /*if (amountBefore == account.getAccountBalance()) return -1; else {*/ account = getAccountById(accNoReciever); account.deposit(amount); return (int) account.getAccountBalance(); // } } @Override public int deposit(int accNo, double amount) { BankAccount account = getAccountById(accNo); double amountBefore = account.getAccountBalance(); account.deposit(amount); return (int) account.getAccountBalance(); /*if (amountBefore == account.getAccountBalance()) return -1; else return 1;*/ } @Override public BankAccount searchAccount(int accNum) { // TODO Auto-generated method stub return collection.searchAccount(accNum); } }
UTF-8
Java
2,655
java
cgBankService.java
Java
[]
null
[]
package com.cgBanka.service; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import com.cgBanka.factory.cgBankFactory; import com.cgbank.dao.cgBankDAO; import com.framework.dao.BankDAOImpl; import com.framework.pojo.BankAccount; import com.framework.pojo.Customer; import com.framework.service.BankService; public class cgBankService extends BankService{ BankDAOImpl collection=new BankDAOImpl(); public cgBankService() { super(); } @Override /*public void createNewSavingsAccount(Map<String, Object> account) { collection.addBankAccount(new cgBankFactory().createNewSavingsAccount(account)); } @Override public void createNewCurrentAccount(Map<String, Object> account) { collection.addBankAccount(new cgBankFactory().createNewCurrentAccount(account)); } */ public Collection<BankAccount> getAllAccounts() { return collection.viewAll(); // return null; } @Override public Collection<Customer> getAllCustomers() { // TODO Auto-generated method stub List<Customer> listOfCustomer = new ArrayList<>(); (collection.viewAll()).stream().forEach((element) -> listOfCustomer.add(element.getAccountHolder())); return listOfCustomer; } @Override public BankAccount getAccountById(int id) { for (BankAccount account : collection.viewAll()) { if (BankAccount.getAccountNumber() == id) return account; } return null; } public int withdraw(int accNo, double amount) { BankAccount account = getAccountById(accNo); double amountBefore = account.getAccountBalance(); account.withdraw(amount); return (int) account.getAccountBalance(); /*if (amountBefore == account.getAccountBalance()) return -1; else return 1;*/ } @Override public int fundTransfer(int accNoSender, int accNoReciever, double amount) { BankAccount account = getAccountById(accNoSender); double amountBefore = account.getAccountBalance(); account.withdraw(amount); /*if (amountBefore == account.getAccountBalance()) return -1; else {*/ account = getAccountById(accNoReciever); account.deposit(amount); return (int) account.getAccountBalance(); // } } @Override public int deposit(int accNo, double amount) { BankAccount account = getAccountById(accNo); double amountBefore = account.getAccountBalance(); account.deposit(amount); return (int) account.getAccountBalance(); /*if (amountBefore == account.getAccountBalance()) return -1; else return 1;*/ } @Override public BankAccount searchAccount(int accNum) { // TODO Auto-generated method stub return collection.searchAccount(accNum); } }
2,655
0.74049
0.738606
111
22.918919
23.268946
103
false
false
0
0
0
0
0
0
1.675676
false
false
7
c76f5667475a85bf00b5c99187bd019296d0df9d
30,588,757,125,365
31320cad2a52e59ef2e14141f84e9ffc62db9036
/src/main/java/com/vertexacademy/sort/MergeSort.java
f12dbe2a99fe667881c5e1715e7cd9dd55587726
[]
no_license
jg-project/vertex
https://github.com/jg-project/vertex
b2083433b2e4a9d20a424637dfb4481682cfcb11
80872ec3d6f4b65479b67fdb2ee934f4c0286ac6
refs/heads/master
2021-01-01T05:13:52.853000
2016-05-29T10:14:57
2016-05-29T10:14:57
56,857,064
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.vertexacademy.sort; import java.util.ArrayList; /** * Created by Vasyl on 23/04/2016. */ public class MergeSort implements Sorteable { int[] array = new int[100]; { for (int i = 0; i < array.length; i++) { array[i] = (int) (Math.random() * 1000); } } @Override public ArrayList<Integer> mergeSort(ArrayList<Integer> input) { ArrayList<Integer> left = new ArrayList<>(); ArrayList<Integer> right = new ArrayList<>(); ArrayList<Integer> result; if (input.size() <= 1) { return input; } else { int middle = input.size() / 2; for (int i = 0; i < input.size(); i++) { if (input.get(i) < middle) { left.add(input.get(i)); } else { right.add(input.get(i)); } } left = mergeSort(left); right = mergeSort(right); result = merge(left, right); return result; } } @Override public ArrayList<Integer> merge(ArrayList<Integer> left, ArrayList<Integer> right) { ArrayList<Integer> result = new ArrayList<>(); while (left.size() > 0 && right.size() > 0) { if (left.get(0) < right.get(0)) { result.add(left.get(0)); left.remove(0); } else { result.add(right.get(0)); right.remove(0); } } if (left.size() > 0) { result.addAll(left); } if (right.size() > 0) { result.addAll(right); } return result; } }
UTF-8
Java
1,691
java
MergeSort.java
Java
[ { "context": "t;\n\nimport java.util.ArrayList;\n\n/**\n * Created by Vasyl on 23/04/2016.\n */\npublic class MergeSort impleme", "end": 85, "score": 0.9982087016105652, "start": 80, "tag": "NAME", "value": "Vasyl" } ]
null
[]
package com.vertexacademy.sort; import java.util.ArrayList; /** * Created by Vasyl on 23/04/2016. */ public class MergeSort implements Sorteable { int[] array = new int[100]; { for (int i = 0; i < array.length; i++) { array[i] = (int) (Math.random() * 1000); } } @Override public ArrayList<Integer> mergeSort(ArrayList<Integer> input) { ArrayList<Integer> left = new ArrayList<>(); ArrayList<Integer> right = new ArrayList<>(); ArrayList<Integer> result; if (input.size() <= 1) { return input; } else { int middle = input.size() / 2; for (int i = 0; i < input.size(); i++) { if (input.get(i) < middle) { left.add(input.get(i)); } else { right.add(input.get(i)); } } left = mergeSort(left); right = mergeSort(right); result = merge(left, right); return result; } } @Override public ArrayList<Integer> merge(ArrayList<Integer> left, ArrayList<Integer> right) { ArrayList<Integer> result = new ArrayList<>(); while (left.size() > 0 && right.size() > 0) { if (left.get(0) < right.get(0)) { result.add(left.get(0)); left.remove(0); } else { result.add(right.get(0)); right.remove(0); } } if (left.size() > 0) { result.addAll(left); } if (right.size() > 0) { result.addAll(right); } return result; } }
1,691
0.467771
0.450621
64
25.421875
19.876026
88
false
false
0
0
0
0
0
0
0.453125
false
false
7
7c74eed461bbc462a54cbe67e808c154febeffc9
6,957,847,088,634
709d7c805dfbd0e785f1fb7b68161e23ba4cb387
/src/test/java/com/cooper/demo/MybatisPlusTest.java
9cddbbad1d2540ee497ad8a15ee45541c27dc422
[]
no_license
CooperXJ/CephNetdisk
https://github.com/CooperXJ/CephNetdisk
97cb039eba05b1add8378327f8173499eb930862
5ccca832b1804520aa60933116432a1602325f45
refs/heads/master
2023-06-05T02:25:19.953000
2021-06-23T01:37:09
2021-06-23T01:37:09
316,885,806
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cooper.demo; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.cooper.demo.Bean.User; import com.cooper.demo.Mapper.UserMapper; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; /** * @author 薛进 * @version 1.0 * @Description * @date 2021/6/14 4:36 下午 */ @SpringBootTest public class MybatisPlusTest { @Autowired private UserMapper userMapper; @Test public void checkUserIfExists(){ QueryWrapper wrapper = new QueryWrapper(); wrapper.eq("username","Xiaoming"); User user = userMapper.selectOne(wrapper); if(user==null){ System.out.println("null"); } System.out.println(user.toString()); } }
UTF-8
Java
824
java
MybatisPlusTest.java
Java
[ { "context": "boot.test.context.SpringBootTest;\n\n/**\n * @author 薛进\n * @version 1.0\n * @Description\n * @date 2021/6/1", "end": 335, "score": 0.9992773532867432, "start": 333, "tag": "NAME", "value": "薛进" }, { "context": "ew QueryWrapper();\n wrapper.eq(\"username\",\"Xiao...
null
[]
package com.cooper.demo; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.cooper.demo.Bean.User; import com.cooper.demo.Mapper.UserMapper; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; /** * @author 薛进 * @version 1.0 * @Description * @date 2021/6/14 4:36 下午 */ @SpringBootTest public class MybatisPlusTest { @Autowired private UserMapper userMapper; @Test public void checkUserIfExists(){ QueryWrapper wrapper = new QueryWrapper(); wrapper.eq("username","Xiaoming"); User user = userMapper.selectOne(wrapper); if(user==null){ System.out.println("null"); } System.out.println(user.toString()); } }
824
0.697304
0.682598
31
25.32258
19.599848
67
false
false
0
0
0
0
0
0
0.451613
false
false
7
473ea579e36fdc0e07d25d17a6296d64cee664b4
7,997,229,128,741
914f8f7fa94e31e0a489ac6246c1fa148600452b
/src/main/java/com/x_j0nnay_x/defincraft/items/customHoe.java
ea814b8dc5d855c2189df1e3e22f40f93fc2bdaf
[]
no_license
x-j0nnay-x/DefineCraft-Mod-1.16.4-
https://github.com/x-j0nnay-x/DefineCraft-Mod-1.16.4-
78a392770efc482566f487ce77f9e63f27ce19b1
63044d7198ddecb384bdadc9f18e9098083cea35
refs/heads/main
2023-02-28T00:28:09.578000
2021-02-07T16:13:58
2021-02-07T16:13:58
326,068,255
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.x_j0nnay_x.defincraft.items; import com.x_j0nnay_x.defincraft.util.RegHandler; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.HoeItem; import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.World; import java.util.List; public class customHoe extends HoeItem { public customHoe(IItemTier itemTier, int attackDamage, float attackSpeed, Properties properties) { super(itemTier, attackDamage, attackSpeed, properties); } public void onCreated(ItemStack par1ItemStack, World par2World, PlayerEntity par3EntityPlayer) { if (this.equals(RegHandler.OBSIDIANHOE.get())) { par1ItemStack.addEnchantment(Enchantments.UNBREAKING, 2); } if (this.equals(RegHandler.HELLSTONEHOE.get())) { par1ItemStack.addEnchantment(Enchantments.MENDING, 2); par1ItemStack.addEnchantment(Enchantments.UNBREAKING, 2); } if (this.equals(RegHandler.HELLSPAWNHOE.get())) { par1ItemStack.addEnchantment(Enchantments.MENDING, 4); par1ItemStack.addEnchantment(Enchantments.UNBREAKING, 4); } } @Override public boolean isImmuneToFire() { return true; } }
UTF-8
Java
1,452
java
customHoe.java
Java
[]
null
[]
package com.x_j0nnay_x.defincraft.items; import com.x_j0nnay_x.defincraft.util.RegHandler; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.HoeItem; import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.World; import java.util.List; public class customHoe extends HoeItem { public customHoe(IItemTier itemTier, int attackDamage, float attackSpeed, Properties properties) { super(itemTier, attackDamage, attackSpeed, properties); } public void onCreated(ItemStack par1ItemStack, World par2World, PlayerEntity par3EntityPlayer) { if (this.equals(RegHandler.OBSIDIANHOE.get())) { par1ItemStack.addEnchantment(Enchantments.UNBREAKING, 2); } if (this.equals(RegHandler.HELLSTONEHOE.get())) { par1ItemStack.addEnchantment(Enchantments.MENDING, 2); par1ItemStack.addEnchantment(Enchantments.UNBREAKING, 2); } if (this.equals(RegHandler.HELLSPAWNHOE.get())) { par1ItemStack.addEnchantment(Enchantments.MENDING, 4); par1ItemStack.addEnchantment(Enchantments.UNBREAKING, 4); } } @Override public boolean isImmuneToFire() { return true; } }
1,452
0.732782
0.722452
38
37.210526
27.538641
102
false
false
0
0
0
0
0
0
0.842105
false
false
7
02aaa83fe9e691f4d5b0083781b22b3d800b2a01
515,396,134,821
21bd1ce3a13db5732f2b9ff51898e142f389e61f
/VC_SDET/src/com/vivriti/soundarya/assignment/QuestionsPage.java
12868abc37fac480dc1b8b3e21daffef037cb168
[]
no_license
Soundarya-Sundaram/VC_SDET_Rep
https://github.com/Soundarya-Sundaram/VC_SDET_Rep
b80fbf86bfa7f235a70ad7cd5447d782106eda60
3726d43b2bb138011657a1f375987d6a1006e3da
refs/heads/master
2022-05-28T05:06:45.749000
2020-05-01T17:10:27
2020-05-01T17:10:27
260,511,771
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.vivriti.soundarya.assignment; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.Select; import com.vivriti.soundarya.assignment.ObjectRepository; public class QuestionsPage { WebDriver driver; static ObjectRepository OR; static { OR = new ObjectRepository(); } public QuestionsPage(WebDriver driver) { this.driver = driver; } public void SelectOptions(String sAns) { String[] sAnsArr = sAns.split(","); boolean blnFlag = false; while (!blnFlag) { for (int i=0;i<sAnsArr.length;i++){ boolean blnFind = this.FindOption(sAnsArr[i]); if (blnFind) this.ClickNext(); String QuesValue = this.GetQuestion(); if(QuesValue.contains("anything else")||QuesValue.contains("what date")){ blnFlag = true; break; } } } } public boolean VerifyEmailorNum() { String EmailorPNQues = this.GetQuestion(); if (EmailorPNQues.contains("notify")) System.out.println("Email or Number field Q is present"); return (driver.findElement(OR.txtEmailorNum)).isDisplayed(); } public String GetQuestion() { return driver.findElement(OR.eleQuestion).getText(); } public void EnterText(String Value) { WebElement eleText = driver.findElement(OR.txtAnsType); eleText.click(); eleText.sendKeys(Value); this.ClickNext(); } public void selectDateNTime(String Time) { Date selDate= this.addDays(new Date(),2); String Dateval = new SimpleDateFormat("MMMM d, yyyy").format(selDate); System.out.println(Dateval+" is selected"); driver.findElement(By.xpath("//button[contains(@aria-label,'"+Dateval+"')]")).click(); this.ClickNext(); Select oSelect = new Select(driver.findElement(OR.selTime)); oSelect.selectByVisibleText(Time); this.ClickNext(); } public boolean FindOption(String optionValue) { boolean blnFound = false; List<WebElement> lstoptions= driver.findElements(OR.lstOptions); for (int op=1; op<=lstoptions.size();op++){ String optionXpath = "//label[contains(@data-test,'"+op+"')]//div[contains(@class,'iconContainer')]/following-sibling::div"; String option= driver.findElement(By.xpath(optionXpath)).getText(); if(option.equalsIgnoreCase(optionValue)){ blnFound = true; driver.findElement(By.xpath("//div[text()='"+optionValue+"']")).click(); System.out.println(option+" is selected"); break; } } return blnFound; } public void ClickNext() { driver.findElement(OR.btnNext).click(); } public Date addDays(Date date, int days) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.DATE, days); return cal.getTime(); } }
UTF-8
Java
3,248
java
QuestionsPage.java
Java
[]
null
[]
package com.vivriti.soundarya.assignment; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.Select; import com.vivriti.soundarya.assignment.ObjectRepository; public class QuestionsPage { WebDriver driver; static ObjectRepository OR; static { OR = new ObjectRepository(); } public QuestionsPage(WebDriver driver) { this.driver = driver; } public void SelectOptions(String sAns) { String[] sAnsArr = sAns.split(","); boolean blnFlag = false; while (!blnFlag) { for (int i=0;i<sAnsArr.length;i++){ boolean blnFind = this.FindOption(sAnsArr[i]); if (blnFind) this.ClickNext(); String QuesValue = this.GetQuestion(); if(QuesValue.contains("anything else")||QuesValue.contains("what date")){ blnFlag = true; break; } } } } public boolean VerifyEmailorNum() { String EmailorPNQues = this.GetQuestion(); if (EmailorPNQues.contains("notify")) System.out.println("Email or Number field Q is present"); return (driver.findElement(OR.txtEmailorNum)).isDisplayed(); } public String GetQuestion() { return driver.findElement(OR.eleQuestion).getText(); } public void EnterText(String Value) { WebElement eleText = driver.findElement(OR.txtAnsType); eleText.click(); eleText.sendKeys(Value); this.ClickNext(); } public void selectDateNTime(String Time) { Date selDate= this.addDays(new Date(),2); String Dateval = new SimpleDateFormat("MMMM d, yyyy").format(selDate); System.out.println(Dateval+" is selected"); driver.findElement(By.xpath("//button[contains(@aria-label,'"+Dateval+"')]")).click(); this.ClickNext(); Select oSelect = new Select(driver.findElement(OR.selTime)); oSelect.selectByVisibleText(Time); this.ClickNext(); } public boolean FindOption(String optionValue) { boolean blnFound = false; List<WebElement> lstoptions= driver.findElements(OR.lstOptions); for (int op=1; op<=lstoptions.size();op++){ String optionXpath = "//label[contains(@data-test,'"+op+"')]//div[contains(@class,'iconContainer')]/following-sibling::div"; String option= driver.findElement(By.xpath(optionXpath)).getText(); if(option.equalsIgnoreCase(optionValue)){ blnFound = true; driver.findElement(By.xpath("//div[text()='"+optionValue+"']")).click(); System.out.println(option+" is selected"); break; } } return blnFound; } public void ClickNext() { driver.findElement(OR.btnNext).click(); } public Date addDays(Date date, int days) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.DATE, days); return cal.getTime(); } }
3,248
0.612993
0.612069
111
27.261261
23.897947
130
false
false
0
0
0
0
0
0
1.558559
false
false
7
5e37d5730d2e9eb6a0b3211f16785c83f92e9e95
9,517,647,563,501
d68a5bd9f10d31fe79603418997a46af0579cb39
/src/main/java/com/cinema/model/dto/MovieSessionResponseDto.java
7752f9c0e49d5cd97be28c79f218cf5403486421
[]
no_license
matviichuk92/cimena
https://github.com/matviichuk92/cimena
b7e85ec9ff762ece3964c67bc83aab559b70175e
9edd27ab62c3d37bee799ed31e0528274ab57083
refs/heads/master
2023-01-02T22:02:02.452000
2020-10-27T13:37:20
2020-10-27T13:37:20
299,871,340
0
0
null
false
2020-10-29T15:06:50
2020-09-30T09:31:01
2020-10-28T11:38:10
2020-10-29T15:04:58
103
0
0
1
Java
false
false
package com.cinema.model.dto; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import java.time.LocalDateTime; public class MovieSessionResponseDto { private Long sessionId; private Long movieId; private Long hallId; @JsonSerialize(using = LocalDateTimeSerializer.class) private LocalDateTime showTime; public Long getSessionId() { return sessionId; } public void setSessionId(Long sessionId) { this.sessionId = sessionId; } public Long getMovieId() { return movieId; } public void setMovieId(Long movieId) { this.movieId = movieId; } public Long getHallId() { return hallId; } public void setHallId(Long hallId) { this.hallId = hallId; } public LocalDateTime getShowTime() { return showTime; } public void setShowTime(LocalDateTime showTime) { this.showTime = showTime; } }
UTF-8
Java
1,022
java
MovieSessionResponseDto.java
Java
[]
null
[]
package com.cinema.model.dto; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import java.time.LocalDateTime; public class MovieSessionResponseDto { private Long sessionId; private Long movieId; private Long hallId; @JsonSerialize(using = LocalDateTimeSerializer.class) private LocalDateTime showTime; public Long getSessionId() { return sessionId; } public void setSessionId(Long sessionId) { this.sessionId = sessionId; } public Long getMovieId() { return movieId; } public void setMovieId(Long movieId) { this.movieId = movieId; } public Long getHallId() { return hallId; } public void setHallId(Long hallId) { this.hallId = hallId; } public LocalDateTime getShowTime() { return showTime; } public void setShowTime(LocalDateTime showTime) { this.showTime = showTime; } }
1,022
0.678082
0.675147
45
21.711111
19.391432
73
false
false
0
0
0
0
0
0
0.355556
false
false
7
b49c967af309fd1f834bebfac3d8173dc37eb8e8
15,418,932,602,618
2d6f6dc8591200ca13b68f78cb20346742a388ed
/RobotGame/src/robotgame/model/tablemodel/Event.java
63c5520413cc4c6662667f9231b33063ce1e1764
[]
no_license
kissLevi/robotGame
https://github.com/kissLevi/robotGame
32783673294923de4939936047bd5377b5656de5
08a685001b4c14489b336ae609ca0f710f17200a
refs/heads/master
2021-05-09T23:01:01.459000
2018-01-24T17:02:55
2018-01-24T17:02:55
118,768,043
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package robotgame.model.tablemodel; public class Event { private Direction direction; private EventType event; public Event(EventType event, Direction direction){ this.direction = direction; this.event = event; } final void setEventType(EventType event){ this.event = event; } final void setDirection(Direction direction){ this.direction = direction; } public final Direction getDirection(){ return this.direction; } public final EventType getEventType(){ return this.event; } }
UTF-8
Java
586
java
Event.java
Java
[]
null
[]
package robotgame.model.tablemodel; public class Event { private Direction direction; private EventType event; public Event(EventType event, Direction direction){ this.direction = direction; this.event = event; } final void setEventType(EventType event){ this.event = event; } final void setDirection(Direction direction){ this.direction = direction; } public final Direction getDirection(){ return this.direction; } public final EventType getEventType(){ return this.event; } }
586
0.648464
0.648464
27
20.703703
17.09194
55
false
false
0
0
0
0
0
0
0.37037
false
false
7
4441eb67bf0d82893c96190ef0a8614e83ea78da
9,320,079,057,890
c8e5859277c1950751a799a72e83e668d9734a5a
/src/main/java/kelvin/mite/mixin/client/HorseEntityModelMixin.java
ae271115042bf865a68b2edce2c6980f487d606a
[ "MIT" ]
permissive
Kelvin285/MITE-Reborn
https://github.com/Kelvin285/MITE-Reborn
9b288e68110e519242f1043ce4bfdc7f517f0bfa
006a33f1d437f16d2394693f206c888a199d561c
refs/heads/master
2022-05-08T15:06:48.513000
2022-03-01T15:24:33
2022-03-01T15:24:33
219,820,472
15
12
MIT
false
2022-10-06T18:13:59
2019-11-05T18:14:23
2022-09-12T03:00:10
2022-03-01T15:24:36
6,801
11
9
3
Java
false
false
package kelvin.mite.mixin.client; import kelvin.mite.entity.HorseKicking; import net.minecraft.client.model.ModelPart; import net.minecraft.client.render.entity.model.AnimalModel; import net.minecraft.client.render.entity.model.HorseEntityModel; import net.minecraft.entity.passive.HorseBaseEntity; import net.minecraft.util.math.MathHelper; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(HorseEntityModel.class) public abstract class HorseEntityModelMixin<T extends HorseBaseEntity> extends AnimalModel<T> { @Shadow private static float EATING_GRASS_ANIMATION_HEAD_BASE_PITCH = 2.1816616F; @Shadow private static float ANGRY_ANIMATION_FRONT_LEG_PITCH_MULTIPLIER = 1.0471976F; @Shadow private static float ANGRY_ANIMATION_BODY_PITCH_MULTIPLIER = 0.7853982F; @Shadow private static float HEAD_TAIL_BASE_PITCH = 0.5235988F; @Shadow private static float ANGRY_ANIMATION_HIND_LEG_PITCH_MULTIPLIER = 0.2617994F; @Shadow protected static String HEAD_PARTS = "head_parts"; @Shadow private static String LEFT_HIND_BABY_LEG = "left_hind_baby_leg"; @Shadow private static String RIGHT_HIND_BABY_LEG = "right_hind_baby_leg"; @Shadow private static String LEFT_FRONT_BABY_LEG = "left_front_baby_leg"; @Shadow private static String RIGHT_FRONT_BABY_LEG = "right_front_baby_leg"; @Shadow private static String SADDLE = "saddle"; @Shadow private static String LEFT_SADDLE_MOUTH = "left_saddle_mouth"; @Shadow private static String LEFT_SADDLE_LINE = "left_saddle_line"; @Shadow private static String RIGHT_SADDLE_MOUTH = "right_saddle_mouth"; @Shadow private static String RIGHT_SADDLE_LINE = "right_saddle_line"; @Shadow private static String HEAD_SADDLE = "head_saddle"; @Shadow private static String MOUTH_SADDLE_WRAP = "mouth_saddle_wrap"; @Shadow protected ModelPart body; @Shadow protected ModelPart head; @Shadow private ModelPart rightHindLeg; @Shadow private ModelPart leftHindLeg; @Shadow private ModelPart rightFrontLeg; @Shadow private ModelPart leftFrontLeg; @Shadow private ModelPart rightHindBabyLeg; @Shadow private ModelPart leftHindBabyLeg; @Shadow private ModelPart rightFrontBabyLeg; @Shadow private ModelPart leftFrontBabyLeg; @Shadow private ModelPart tail; @Shadow private ModelPart[] saddle; @Shadow private ModelPart[] straps; @Inject(at=@At("HEAD"),method="animateModel",cancellable = true) public void animateModel(T horseBaseEntity, float limbAngle, float limbDistance, float tickDelta, CallbackInfo info) { //super.animateModel(horseBaseEntity, limbAngle, limbDistance, tickDelta); boolean kicking = ((HorseKicking)horseBaseEntity).isKicking(); float current_body_yaw = MathHelper.lerpAngle(horseBaseEntity.prevBodyYaw, horseBaseEntity.bodyYaw, tickDelta); float current_head_yaw = MathHelper.lerpAngle(horseBaseEntity.prevHeadYaw, horseBaseEntity.headYaw, tickDelta); float current_pitch = MathHelper.lerp(tickDelta, horseBaseEntity.prevPitch, horseBaseEntity.getPitch()); float yaw_delta = current_head_yaw - current_body_yaw; float pitch_multiplied = current_pitch * 0.017453292F; if (yaw_delta > 20.0F) { yaw_delta = 20.0F; } if (yaw_delta < -20.0F) { yaw_delta = -20.0F; } if (limbDistance > 0.2F) { pitch_multiplied += MathHelper.cos(limbAngle * 0.4F) * 0.15F * limbDistance; } if (!kicking) { float eating_grass_animation_progress = horseBaseEntity.getEatingGrassAnimationProgress(tickDelta); float angry_animation_progress = horseBaseEntity.getAngryAnimationProgress(tickDelta); float angry_animation = 1.0F - angry_animation_progress; float eating_animation_progress = horseBaseEntity.getEatingAnimationProgress(tickDelta); boolean tail_wagging = horseBaseEntity.tailWagTicks != 0; float age = (float)horseBaseEntity.age + tickDelta; this.head.pivotY = 4.0F; this.head.pivotZ = -12.0F; this.body.pitch = 0.0F; this.head.pitch = 0.5235988F + pitch_multiplied; this.head.yaw = yaw_delta * 0.017453292F; float water_offset = horseBaseEntity.isTouchingWater() ? 0.2F : 1.0F; float cos_water_offset = MathHelper.cos(water_offset * limbAngle * 0.6662F + 3.1415927F); float water_leg_pitch = cos_water_offset * 0.8F * limbDistance; float animation_head_pitch = (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * (0.5235988F + pitch_multiplied + eating_animation_progress * MathHelper.sin(age) * 0.05F); this.head.pitch = angry_animation_progress * (0.2617994F + pitch_multiplied) + eating_grass_animation_progress * (2.1816616F + MathHelper.sin(age) * 0.05F) + animation_head_pitch; this.head.yaw = angry_animation_progress * yaw_delta * 0.017453292F + (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * this.head.yaw; this.head.pivotY = angry_animation_progress * -4.0F + eating_grass_animation_progress * 11.0F + (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * this.head.pivotY; this.head.pivotZ = angry_animation_progress * -4.0F + eating_grass_animation_progress * -12.0F + (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * this.head.pivotZ; this.body.pitch = angry_animation_progress * -0.7853982F + angry_animation * this.body.pitch; float back_leg_pitch = 0.2617994F * angry_animation_progress; float angry_leg_cosine = MathHelper.cos(age * 0.6F + 3.1415927F); this.leftFrontLeg.pivotY = 2.0F * angry_animation_progress + 14.0F * angry_animation; this.leftFrontLeg.pivotZ = -6.0F * angry_animation_progress - 10.0F * angry_animation; this.rightFrontLeg.pivotY = this.leftFrontLeg.pivotY; this.rightFrontLeg.pivotZ = this.leftFrontLeg.pivotZ; float angry_left_leg_pitch = (-1.0471976F + angry_leg_cosine) * angry_animation_progress + water_leg_pitch * angry_animation; float angry_right_leg_pitch = (-1.0471976F - angry_leg_cosine) * angry_animation_progress - water_leg_pitch * angry_animation; this.leftHindLeg.pitch = back_leg_pitch - cos_water_offset * 0.5F * limbDistance * angry_animation; this.rightHindLeg.pitch = back_leg_pitch + cos_water_offset * 0.5F * limbDistance * angry_animation; this.leftFrontLeg.pitch = angry_left_leg_pitch; this.rightFrontLeg.pitch = angry_right_leg_pitch; this.tail.pitch = 0.5235988F + limbDistance * 0.75F; this.tail.pivotY = -5.0F + limbDistance; this.tail.pivotZ = 2.0F + limbDistance * 2.0F; if (tail_wagging) { this.tail.yaw = MathHelper.cos(age * 0.7F); } else { this.tail.yaw = 0.0F; } this.rightHindLeg.pivotY = 14.0F; this.leftHindLeg.pivotY = 14.0F; this.rightHindLeg.pivotZ = 7.0F; this.leftHindLeg.pivotZ = 7.0F; } else { this.body.pitch = -(float)Math.toRadians(-15); this.head.pitch = -(float)Math.toRadians(-15); this.rightHindLeg.pitch = -(float)Math.toRadians(-90); this.leftHindLeg.pitch = -(float)Math.toRadians(-90); this.rightHindLeg.pivotY = 14.0F - 5; this.leftHindLeg.pivotY = 14.0F - 5; this.rightHindLeg.pivotZ = 7.0F + 3; this.leftHindLeg.pivotZ = 7.0F + 3; } this.rightHindBabyLeg.pivotY = this.rightHindLeg.pivotY; this.rightHindBabyLeg.pivotZ = this.rightHindLeg.pivotZ; this.rightHindBabyLeg.pitch = this.rightHindLeg.pitch; this.leftHindBabyLeg.pivotY = this.leftHindLeg.pivotY; this.leftHindBabyLeg.pivotZ = this.leftHindLeg.pivotZ; this.leftHindBabyLeg.pitch = this.leftHindLeg.pitch; this.rightFrontBabyLeg.pivotY = this.rightFrontLeg.pivotY; this.rightFrontBabyLeg.pivotZ = this.rightFrontLeg.pivotZ; this.rightFrontBabyLeg.pitch = this.rightFrontLeg.pitch; this.leftFrontBabyLeg.pivotY = this.leftFrontLeg.pivotY; this.leftFrontBabyLeg.pivotZ = this.leftFrontLeg.pivotZ; this.leftFrontBabyLeg.pitch = this.leftFrontLeg.pitch; boolean is_baby = horseBaseEntity.isBaby(); this.rightHindLeg.visible = !is_baby; this.leftHindLeg.visible = !is_baby; this.rightFrontLeg.visible = !is_baby; this.leftFrontLeg.visible = !is_baby; this.rightHindBabyLeg.visible = is_baby; this.leftHindBabyLeg.visible = is_baby; this.rightFrontBabyLeg.visible = is_baby; this.leftFrontBabyLeg.visible = is_baby; this.body.pivotY = is_baby ? 10.8F : 0.0F; info.cancel(); } }
UTF-8
Java
9,348
java
HorseEntityModelMixin.java
Java
[]
null
[]
package kelvin.mite.mixin.client; import kelvin.mite.entity.HorseKicking; import net.minecraft.client.model.ModelPart; import net.minecraft.client.render.entity.model.AnimalModel; import net.minecraft.client.render.entity.model.HorseEntityModel; import net.minecraft.entity.passive.HorseBaseEntity; import net.minecraft.util.math.MathHelper; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(HorseEntityModel.class) public abstract class HorseEntityModelMixin<T extends HorseBaseEntity> extends AnimalModel<T> { @Shadow private static float EATING_GRASS_ANIMATION_HEAD_BASE_PITCH = 2.1816616F; @Shadow private static float ANGRY_ANIMATION_FRONT_LEG_PITCH_MULTIPLIER = 1.0471976F; @Shadow private static float ANGRY_ANIMATION_BODY_PITCH_MULTIPLIER = 0.7853982F; @Shadow private static float HEAD_TAIL_BASE_PITCH = 0.5235988F; @Shadow private static float ANGRY_ANIMATION_HIND_LEG_PITCH_MULTIPLIER = 0.2617994F; @Shadow protected static String HEAD_PARTS = "head_parts"; @Shadow private static String LEFT_HIND_BABY_LEG = "left_hind_baby_leg"; @Shadow private static String RIGHT_HIND_BABY_LEG = "right_hind_baby_leg"; @Shadow private static String LEFT_FRONT_BABY_LEG = "left_front_baby_leg"; @Shadow private static String RIGHT_FRONT_BABY_LEG = "right_front_baby_leg"; @Shadow private static String SADDLE = "saddle"; @Shadow private static String LEFT_SADDLE_MOUTH = "left_saddle_mouth"; @Shadow private static String LEFT_SADDLE_LINE = "left_saddle_line"; @Shadow private static String RIGHT_SADDLE_MOUTH = "right_saddle_mouth"; @Shadow private static String RIGHT_SADDLE_LINE = "right_saddle_line"; @Shadow private static String HEAD_SADDLE = "head_saddle"; @Shadow private static String MOUTH_SADDLE_WRAP = "mouth_saddle_wrap"; @Shadow protected ModelPart body; @Shadow protected ModelPart head; @Shadow private ModelPart rightHindLeg; @Shadow private ModelPart leftHindLeg; @Shadow private ModelPart rightFrontLeg; @Shadow private ModelPart leftFrontLeg; @Shadow private ModelPart rightHindBabyLeg; @Shadow private ModelPart leftHindBabyLeg; @Shadow private ModelPart rightFrontBabyLeg; @Shadow private ModelPart leftFrontBabyLeg; @Shadow private ModelPart tail; @Shadow private ModelPart[] saddle; @Shadow private ModelPart[] straps; @Inject(at=@At("HEAD"),method="animateModel",cancellable = true) public void animateModel(T horseBaseEntity, float limbAngle, float limbDistance, float tickDelta, CallbackInfo info) { //super.animateModel(horseBaseEntity, limbAngle, limbDistance, tickDelta); boolean kicking = ((HorseKicking)horseBaseEntity).isKicking(); float current_body_yaw = MathHelper.lerpAngle(horseBaseEntity.prevBodyYaw, horseBaseEntity.bodyYaw, tickDelta); float current_head_yaw = MathHelper.lerpAngle(horseBaseEntity.prevHeadYaw, horseBaseEntity.headYaw, tickDelta); float current_pitch = MathHelper.lerp(tickDelta, horseBaseEntity.prevPitch, horseBaseEntity.getPitch()); float yaw_delta = current_head_yaw - current_body_yaw; float pitch_multiplied = current_pitch * 0.017453292F; if (yaw_delta > 20.0F) { yaw_delta = 20.0F; } if (yaw_delta < -20.0F) { yaw_delta = -20.0F; } if (limbDistance > 0.2F) { pitch_multiplied += MathHelper.cos(limbAngle * 0.4F) * 0.15F * limbDistance; } if (!kicking) { float eating_grass_animation_progress = horseBaseEntity.getEatingGrassAnimationProgress(tickDelta); float angry_animation_progress = horseBaseEntity.getAngryAnimationProgress(tickDelta); float angry_animation = 1.0F - angry_animation_progress; float eating_animation_progress = horseBaseEntity.getEatingAnimationProgress(tickDelta); boolean tail_wagging = horseBaseEntity.tailWagTicks != 0; float age = (float)horseBaseEntity.age + tickDelta; this.head.pivotY = 4.0F; this.head.pivotZ = -12.0F; this.body.pitch = 0.0F; this.head.pitch = 0.5235988F + pitch_multiplied; this.head.yaw = yaw_delta * 0.017453292F; float water_offset = horseBaseEntity.isTouchingWater() ? 0.2F : 1.0F; float cos_water_offset = MathHelper.cos(water_offset * limbAngle * 0.6662F + 3.1415927F); float water_leg_pitch = cos_water_offset * 0.8F * limbDistance; float animation_head_pitch = (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * (0.5235988F + pitch_multiplied + eating_animation_progress * MathHelper.sin(age) * 0.05F); this.head.pitch = angry_animation_progress * (0.2617994F + pitch_multiplied) + eating_grass_animation_progress * (2.1816616F + MathHelper.sin(age) * 0.05F) + animation_head_pitch; this.head.yaw = angry_animation_progress * yaw_delta * 0.017453292F + (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * this.head.yaw; this.head.pivotY = angry_animation_progress * -4.0F + eating_grass_animation_progress * 11.0F + (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * this.head.pivotY; this.head.pivotZ = angry_animation_progress * -4.0F + eating_grass_animation_progress * -12.0F + (1.0F - Math.max(angry_animation_progress, eating_grass_animation_progress)) * this.head.pivotZ; this.body.pitch = angry_animation_progress * -0.7853982F + angry_animation * this.body.pitch; float back_leg_pitch = 0.2617994F * angry_animation_progress; float angry_leg_cosine = MathHelper.cos(age * 0.6F + 3.1415927F); this.leftFrontLeg.pivotY = 2.0F * angry_animation_progress + 14.0F * angry_animation; this.leftFrontLeg.pivotZ = -6.0F * angry_animation_progress - 10.0F * angry_animation; this.rightFrontLeg.pivotY = this.leftFrontLeg.pivotY; this.rightFrontLeg.pivotZ = this.leftFrontLeg.pivotZ; float angry_left_leg_pitch = (-1.0471976F + angry_leg_cosine) * angry_animation_progress + water_leg_pitch * angry_animation; float angry_right_leg_pitch = (-1.0471976F - angry_leg_cosine) * angry_animation_progress - water_leg_pitch * angry_animation; this.leftHindLeg.pitch = back_leg_pitch - cos_water_offset * 0.5F * limbDistance * angry_animation; this.rightHindLeg.pitch = back_leg_pitch + cos_water_offset * 0.5F * limbDistance * angry_animation; this.leftFrontLeg.pitch = angry_left_leg_pitch; this.rightFrontLeg.pitch = angry_right_leg_pitch; this.tail.pitch = 0.5235988F + limbDistance * 0.75F; this.tail.pivotY = -5.0F + limbDistance; this.tail.pivotZ = 2.0F + limbDistance * 2.0F; if (tail_wagging) { this.tail.yaw = MathHelper.cos(age * 0.7F); } else { this.tail.yaw = 0.0F; } this.rightHindLeg.pivotY = 14.0F; this.leftHindLeg.pivotY = 14.0F; this.rightHindLeg.pivotZ = 7.0F; this.leftHindLeg.pivotZ = 7.0F; } else { this.body.pitch = -(float)Math.toRadians(-15); this.head.pitch = -(float)Math.toRadians(-15); this.rightHindLeg.pitch = -(float)Math.toRadians(-90); this.leftHindLeg.pitch = -(float)Math.toRadians(-90); this.rightHindLeg.pivotY = 14.0F - 5; this.leftHindLeg.pivotY = 14.0F - 5; this.rightHindLeg.pivotZ = 7.0F + 3; this.leftHindLeg.pivotZ = 7.0F + 3; } this.rightHindBabyLeg.pivotY = this.rightHindLeg.pivotY; this.rightHindBabyLeg.pivotZ = this.rightHindLeg.pivotZ; this.rightHindBabyLeg.pitch = this.rightHindLeg.pitch; this.leftHindBabyLeg.pivotY = this.leftHindLeg.pivotY; this.leftHindBabyLeg.pivotZ = this.leftHindLeg.pivotZ; this.leftHindBabyLeg.pitch = this.leftHindLeg.pitch; this.rightFrontBabyLeg.pivotY = this.rightFrontLeg.pivotY; this.rightFrontBabyLeg.pivotZ = this.rightFrontLeg.pivotZ; this.rightFrontBabyLeg.pitch = this.rightFrontLeg.pitch; this.leftFrontBabyLeg.pivotY = this.leftFrontLeg.pivotY; this.leftFrontBabyLeg.pivotZ = this.leftFrontLeg.pivotZ; this.leftFrontBabyLeg.pitch = this.leftFrontLeg.pitch; boolean is_baby = horseBaseEntity.isBaby(); this.rightHindLeg.visible = !is_baby; this.leftHindLeg.visible = !is_baby; this.rightFrontLeg.visible = !is_baby; this.leftFrontLeg.visible = !is_baby; this.rightHindBabyLeg.visible = is_baby; this.leftHindBabyLeg.visible = is_baby; this.rightFrontBabyLeg.visible = is_baby; this.leftFrontBabyLeg.visible = is_baby; this.body.pivotY = is_baby ? 10.8F : 0.0F; info.cancel(); } }
9,348
0.674369
0.64356
180
50.933334
39.320282
210
false
false
0
0
0
0
0
0
0.794444
false
false
7
1abebea4da7d56a84f28e94600f7e25625aa9d9b
3,959,959,872,326
b2817c2c75c7bb6691ef963b4b02fcdb9f8a2fdc
/app/src/main/java/com/solutio/app/diary/subsistence/SubsistencesView.java
0eb4b6f35896a2a9d2b7daacc953b203d9d6bd5c
[]
no_license
jcigmenupraxis/solutio-mobile
https://github.com/jcigmenupraxis/solutio-mobile
fe2b02a17ac80714e99ca8c6a40f788ceddd888e
96b55ffa5b5e652459a5597fe2711b85088b1f06
refs/heads/master
2016-09-27T07:01:38.745000
2016-09-09T05:19:01
2016-09-09T05:19:01
48,011,384
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.solutio.app.diary.subsistence; import com.solutio.app.diary.DiaryEntry; import org.noobs2d.yamvp.core.View; import java.util.List; /** * Shows all the claimed subsistences for a certain Diary Entry. * * @author Julious Igmen */ public interface SubsistencesView extends View { String TAG = SubsistencesView.class.getSimpleName(); void addSubsistenceToList(Subsistence claimedSubsistence); void dismissScreen(); List<Subsistence> getDisplayedSubsistenceList(); List<Subsistence> getOriginalSubsistenceList(); void removeSubsistenceOnPosition(int position); void setDiaryEntry(DiaryEntry diaryEntry); void setSaveMenuVisible(boolean visible); void setTotalVisible(boolean visible); void showAllowanceBankScreen(); void showConfirmDiscardDialog(); void showEditSubsistenceScreen(Subsistence subsistenceToEdit); void addSubsistencesToList(List<Subsistence> subsistenceList); void showSaveSubsistenceConfirmationDialog(); void updateTotalText(); }
UTF-8
Java
1,039
java
SubsistencesView.java
Java
[ { "context": "sistences for a certain Diary Entry.\n *\n * @author Julious Igmen\n */\npublic interface SubsistencesView extends Vie", "end": 243, "score": 0.9998847842216492, "start": 230, "tag": "NAME", "value": "Julious Igmen" } ]
null
[]
package com.solutio.app.diary.subsistence; import com.solutio.app.diary.DiaryEntry; import org.noobs2d.yamvp.core.View; import java.util.List; /** * Shows all the claimed subsistences for a certain Diary Entry. * * @author <NAME> */ public interface SubsistencesView extends View { String TAG = SubsistencesView.class.getSimpleName(); void addSubsistenceToList(Subsistence claimedSubsistence); void dismissScreen(); List<Subsistence> getDisplayedSubsistenceList(); List<Subsistence> getOriginalSubsistenceList(); void removeSubsistenceOnPosition(int position); void setDiaryEntry(DiaryEntry diaryEntry); void setSaveMenuVisible(boolean visible); void setTotalVisible(boolean visible); void showAllowanceBankScreen(); void showConfirmDiscardDialog(); void showEditSubsistenceScreen(Subsistence subsistenceToEdit); void addSubsistencesToList(List<Subsistence> subsistenceList); void showSaveSubsistenceConfirmationDialog(); void updateTotalText(); }
1,032
0.769009
0.768046
46
21.586956
23.963356
66
false
false
0
0
0
0
0
0
0.413043
false
false
7
3a9957c728185a79281221eb3d007a78c9fd5f50
34,583,076,668,853
f6cb837ecbf4d556c81a43a238465ffa46e1e662
/game-objects/src/main/java/fr/iutdeck/objects/GameObjectType.java
9f498dabf7a23957f33b234fd1f6f29efde2d163
[]
no_license
Marethyun/iutdeck-server
https://github.com/Marethyun/iutdeck-server
c338e39891b1dbe2b36d955fd907b99330e26f9d
64bd7d1e7df11632737d517b2ae79acf814bf247
refs/heads/master
2022-04-10T06:30:13.469000
2020-04-03T14:34:27
2020-04-03T14:34:27
236,713,498
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package fr.iutdeck.objects; /** * Décrit un gameobject dans sa sérialisation uniquement */ public enum GameObjectType { ROOT("ROOT"), CARD("CARD"), HERO("HERO"), PLAYER("PLYR"), OPPONENT("OPNT"), BOARD("BORD"), DECK("DECK"), HAND("HAND"); public final String name; GameObjectType(String name) { this.name = name; } @Override public String toString() { return this.name; } }
UTF-8
Java
480
java
GameObjectType.java
Java
[]
null
[]
package fr.iutdeck.objects; /** * Décrit un gameobject dans sa sérialisation uniquement */ public enum GameObjectType { ROOT("ROOT"), CARD("CARD"), HERO("HERO"), PLAYER("PLYR"), OPPONENT("OPNT"), BOARD("BORD"), DECK("DECK"), HAND("HAND"); public final String name; GameObjectType(String name) { this.name = name; } @Override public String toString() { return this.name; } }
480
0.552301
0.552301
26
16.384615
13.240604
56
false
false
0
0
0
0
0
0
0.461538
false
false
7
23c4c913f6260b7e1e7245d02e07ed900b66e39c
26,594,437,557,189
29363b04f2850254e6ac0d1c2f0e18e870cbbee3
/K-diff Pairs in an Array/Solution.java
a837626fa480bb35e302f0c52a8b8f9f760839e8
[]
no_license
isfaaghyth/algorithm-playground
https://github.com/isfaaghyth/algorithm-playground
ca6184a70639bc8176920d4a9470888ef3f56e74
5af139031d0d069b0792398608288284e2175972
refs/heads/master
2020-07-28T08:24:07.085000
2019-09-18T17:12:41
2019-09-18T17:12:41
209,363,530
21
8
null
null
null
null
null
null
null
null
null
null
null
null
null
// https://leetcode.com/problems/k-diff-pairs-in-an-array // // // Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in the array and their absolute difference is k. // // Example 1: // // Input: [3, 1, 4, 1, 5], k = 2 // Output: 2 // Explanation: There are two 2-diff pairs in the array, (1, 3) and (3, 5). public class Solution { public int findPairs(int[] nums, int k) { if (k < 0) return 0; int result = 0; Map<Integer, Integer> map = new HashMap<>(); for (int i : nums) { map.put(i, map.getOrDefault(i, 0) + 1); } for (Map.Entry<Integer, Integer> entry : map.entrySet()) { if (k == 0) { if (entry.getValue() >= 2) result++; } else { if (map.containsKey(entry.getKey() + k)) result++; } } return result; } }
UTF-8
Java
1,016
java
Solution.java
Java
[]
null
[]
// https://leetcode.com/problems/k-diff-pairs-in-an-array // // // Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in the array and their absolute difference is k. // // Example 1: // // Input: [3, 1, 4, 1, 5], k = 2 // Output: 2 // Explanation: There are two 2-diff pairs in the array, (1, 3) and (3, 5). public class Solution { public int findPairs(int[] nums, int k) { if (k < 0) return 0; int result = 0; Map<Integer, Integer> map = new HashMap<>(); for (int i : nums) { map.put(i, map.getOrDefault(i, 0) + 1); } for (Map.Entry<Integer, Integer> entry : map.entrySet()) { if (k == 0) { if (entry.getValue() >= 2) result++; } else { if (map.containsKey(entry.getKey() + k)) result++; } } return result; } }
1,016
0.550197
0.530512
28
35.285713
46.530987
249
false
false
0
0
0
0
0
0
0.821429
false
false
7
e0d242be134722e9f5dc420644b5701b3decdb34
5,686,536,723,987
f35d451370b58d35946d8311e06317ad253665ec
/library/src/test/java/com/mapzen/valhalla/TestHttpHandler.java
ab18bc283773026fef28d6cffa6a427aa74a8bc9
[ "Apache-2.0" ]
permissive
nebular/on-the-road_android
https://github.com/nebular/on-the-road_android
cc4ec5359d3b33c2d897734f38d2f25c0256b106
56a52a95d4f721b194344823bc6a4bb1626846c0
refs/heads/master
2021-01-17T10:15:08.586000
2017-02-28T21:22:38
2017-02-28T21:22:38
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.mapzen.valhalla; import java.io.IOException; import okhttp3.Interceptor; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Callback; import retrofit2.Response; /** * Executes route requests synchronously in testing environment. */ class TestHttpHandler extends HttpHandler { boolean headersAdded = false; Response<String> route = null; TestHttpHandler(String endpoint, HttpLoggingInterceptor.Level logLevel) { super(endpoint, logLevel); } @Override public void requestRoute(String routeJson, Callback<String> callback) { try { route = service.getRoute(routeJson).execute(); } catch (IOException e) { e.printStackTrace(); } callback.onResponse(null, route); } @Override protected okhttp3.Response onRequest(Interceptor.Chain chain) throws IOException { headersAdded = true; return chain.proceed(chain.request()); } }
UTF-8
Java
906
java
TestHttpHandler.java
Java
[]
null
[]
package com.mapzen.valhalla; import java.io.IOException; import okhttp3.Interceptor; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Callback; import retrofit2.Response; /** * Executes route requests synchronously in testing environment. */ class TestHttpHandler extends HttpHandler { boolean headersAdded = false; Response<String> route = null; TestHttpHandler(String endpoint, HttpLoggingInterceptor.Level logLevel) { super(endpoint, logLevel); } @Override public void requestRoute(String routeJson, Callback<String> callback) { try { route = service.getRoute(routeJson).execute(); } catch (IOException e) { e.printStackTrace(); } callback.onResponse(null, route); } @Override protected okhttp3.Response onRequest(Interceptor.Chain chain) throws IOException { headersAdded = true; return chain.proceed(chain.request()); } }
906
0.743929
0.738411
34
25.647058
25.209572
94
false
false
0
0
0
0
0
0
0.529412
false
false
7
da411f146f807671b1a3cf736df42d24c6f15ebf
5,789,615,925,167
55413f8c3542bedf3fc2bb79bbf878e058663bac
/src/main/java/com/hackerrank/LuckBalance.java
77f86a4f13292c05287c6fa3b632d7f72e03a08f
[ "MIT" ]
permissive
aucd29/algs-progfun
https://github.com/aucd29/algs-progfun
73ca37a1fb63dca662b81224c81272238449e6e2
a89b0d332a3d4a257618e9ae6c7f898cb1695246
refs/heads/master
2021-08-28T00:49:18.192000
2017-12-10T23:18:36
2017-12-10T23:18:36
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hackerrank; import java.util.PriorityQueue; import java.util.Scanner; public class LuckBalance { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); PriorityQueue<Integer> queue = new PriorityQueue<>(); int maxLuck = 0; for (int i = 0; i < n; i++) { int li = in.nextInt(); int ti = in.nextInt(); if (ti == 1) { queue.add(li); } maxLuck += li; } int size = queue.size(); for (int i = 0; i < size - k; i++) { maxLuck -= 2 * queue.remove(); } System.out.println(maxLuck); } }
UTF-8
Java
744
java
LuckBalance.java
Java
[]
null
[]
package com.hackerrank; import java.util.PriorityQueue; import java.util.Scanner; public class LuckBalance { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); PriorityQueue<Integer> queue = new PriorityQueue<>(); int maxLuck = 0; for (int i = 0; i < n; i++) { int li = in.nextInt(); int ti = in.nextInt(); if (ti == 1) { queue.add(li); } maxLuck += li; } int size = queue.size(); for (int i = 0; i < size - k; i++) { maxLuck -= 2 * queue.remove(); } System.out.println(maxLuck); } }
744
0.485215
0.478495
30
23.799999
16.287828
61
false
false
0
0
0
0
0
0
0.633333
false
false
7
bf3ae5705a55a95bd1161f0d6e30f0fe001a3244
24,051,816,901,313
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_342ae41710af608696c33e1fbba768e4656b8444/HuffmanByteUncompress/7_342ae41710af608696c33e1fbba768e4656b8444_HuffmanByteUncompress_s.java
c1229a4065d06fff8aeff181dc95b4bef8cdc036
[]
no_license
zhongxingyu/Seer
https://github.com/zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516000
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
false
2023-06-22T07:55:57
2020-04-28T11:07:49
2023-06-21T00:53:27
2023-06-22T07:55:57
2,849,868
2
2
0
null
false
false
/******************************************************************************* * Copyright (c) 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.ptp.proxy.util.compression.huffmancoder; import java.nio.ByteBuffer; import org.eclipse.ptp.proxy.util.compression.IDecoder; import org.eclipse.ptp.utils.core.messages.Messages; public class HuffmanByteUncompress implements IDecoder { private static final int NSYMBOLS = 256; private HuffmanCoder huffmanCoder; private final ISymbolDefiner symbolTable; private boolean freqUpdated; /** * Constructs a HuffmanByteUncompress object * * Constructs a HuffmanByteUncompress object. * * @param frequencies * Frequency values for each of the 256 byte values. */ public HuffmanByteUncompress() { symbolTable = new ByteSymbolTable(); } /** * Uncompresses the input ByteBuffer * * Uncompresses the input ByteBuffer "in" based on Huffman coding * * @param in * The input buffer to be compressed. * @return The uncompressed buffer using Huffman encoding. */ public ByteBuffer apply(ByteBuffer in) { if (in == null) { throw new IllegalArgumentException(Messages.getString("HuffmanByteUncompress.0")); //$NON-NLS-1$ } int uncompressedlen; final int frequencies[] = new int[NSYMBOLS]; in.position(0); uncompressedlen = in.getInt(); if (freqUpdated) { for (int i = 0; i < NSYMBOLS; i++) { frequencies[i] = in.getInt(); } } else if (huffmanCoder == null) { for (int i = 0; i < NSYMBOLS; i++) { frequencies[i] = 1; } freqUpdated = true; } if (freqUpdated) { huffmanCoder = new HuffmanCoder(symbolTable, frequencies); huffmanCoder.buildHuffmanTree(); /* no need to assign huffman codes */ freqUpdated = false; } final ByteBuffer result = huffmanCoder.decode(in.slice(), uncompressedlen); result.rewind(); return result; } /** * Notifies Huffman frequency table is updated in the incoming stream * * When this method is called, the next call to apply expects a frequency * table in the header information of the input compressed stream. * Subsequent calls to apply assume no frequency table. */ public void notifyFrequencyUpdate() { freqUpdated = true; } }
UTF-8
Java
2,745
java
7_342ae41710af608696c33e1fbba768e4656b8444_HuffmanByteUncompress_s.java
Java
[]
null
[]
/******************************************************************************* * Copyright (c) 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.ptp.proxy.util.compression.huffmancoder; import java.nio.ByteBuffer; import org.eclipse.ptp.proxy.util.compression.IDecoder; import org.eclipse.ptp.utils.core.messages.Messages; public class HuffmanByteUncompress implements IDecoder { private static final int NSYMBOLS = 256; private HuffmanCoder huffmanCoder; private final ISymbolDefiner symbolTable; private boolean freqUpdated; /** * Constructs a HuffmanByteUncompress object * * Constructs a HuffmanByteUncompress object. * * @param frequencies * Frequency values for each of the 256 byte values. */ public HuffmanByteUncompress() { symbolTable = new ByteSymbolTable(); } /** * Uncompresses the input ByteBuffer * * Uncompresses the input ByteBuffer "in" based on Huffman coding * * @param in * The input buffer to be compressed. * @return The uncompressed buffer using Huffman encoding. */ public ByteBuffer apply(ByteBuffer in) { if (in == null) { throw new IllegalArgumentException(Messages.getString("HuffmanByteUncompress.0")); //$NON-NLS-1$ } int uncompressedlen; final int frequencies[] = new int[NSYMBOLS]; in.position(0); uncompressedlen = in.getInt(); if (freqUpdated) { for (int i = 0; i < NSYMBOLS; i++) { frequencies[i] = in.getInt(); } } else if (huffmanCoder == null) { for (int i = 0; i < NSYMBOLS; i++) { frequencies[i] = 1; } freqUpdated = true; } if (freqUpdated) { huffmanCoder = new HuffmanCoder(symbolTable, frequencies); huffmanCoder.buildHuffmanTree(); /* no need to assign huffman codes */ freqUpdated = false; } final ByteBuffer result = huffmanCoder.decode(in.slice(), uncompressedlen); result.rewind(); return result; } /** * Notifies Huffman frequency table is updated in the incoming stream * * When this method is called, the next call to apply expects a frequency * table in the header information of the input compressed stream. * Subsequent calls to apply assume no frequency table. */ public void notifyFrequencyUpdate() { freqUpdated = true; } }
2,745
0.645537
0.638251
90
29.48889
25.57744
100
false
false
0
0
0
0
0
0
1.522222
false
false
7
979b2537b6c49fc9aa9e87505ab093f4e688c879
34,686,155,890,169
74290306d4bdc4ab85ece2bbebe05321d5dcc3bf
/src/main/java/com/qinyuan15/lottery/mvc/activity/dualcoloredball/ZhcwPageParser.java
4962c3e66a4903fe7a6eac08e11cd2ae433bc039
[]
no_license
qinyuan/lottery
https://github.com/qinyuan/lottery
c81a3adc3b3ec86b16ddc388de5bfa6eec046778
afd78e155c771528076c5a64806ac7f692d13103
refs/heads/master
2021-01-21T04:27:28.928000
2016-05-16T15:06:03
2016-05-16T15:06:03
37,542,210
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.qinyuan15.lottery.mvc.activity.dualcoloredball; import com.google.common.base.Joiner; import com.qinyuan.lib.network.html.JavaScriptExecutor; import org.mozilla.javascript.NativeObject; import java.text.DecimalFormat; import java.util.Arrays; import static com.qinyuan15.lottery.mvc.activity.dualcoloredball.DualColoredBallCalculator.*; public class ZhcwPageParser implements DualColoredBallPageParser { private NativeObject data; public ZhcwPageParser(String pageContent, int fullTermNumber) { Object kjData1 = new JavaScriptExecutor().evaluate(pageContent + ";kjData_1"); if (kjData1 instanceof NativeObject) { Object dataObject = ((NativeObject) kjData1).get(fullTermNumber); if (dataObject instanceof NativeObject) { data = (NativeObject) dataObject; } } } @Override public String getResult() { if (data == null) { return null; } Object number = data.get("kjZNum"); if (number == null || !(number instanceof String)) { return null; } String[] numbers = ((String) number).split("\\s"); Arrays.sort(numbers); return Joiner.on(" ").join(numbers); } @Override public String getDrawTime() { if (data == null) { return null; } Object date = data.get("kjDate"); if (date == null || !(date instanceof String)) { return null; } DecimalFormat format = new DecimalFormat("00"); return date + " " + format.format(PUBLISH_HOUR) + ":" + format.format(PUBLISH_MINUTE) + ":" + format.format(PUBLISH_SECOND); } }
UTF-8
Java
1,716
java
ZhcwPageParser.java
Java
[]
null
[]
package com.qinyuan15.lottery.mvc.activity.dualcoloredball; import com.google.common.base.Joiner; import com.qinyuan.lib.network.html.JavaScriptExecutor; import org.mozilla.javascript.NativeObject; import java.text.DecimalFormat; import java.util.Arrays; import static com.qinyuan15.lottery.mvc.activity.dualcoloredball.DualColoredBallCalculator.*; public class ZhcwPageParser implements DualColoredBallPageParser { private NativeObject data; public ZhcwPageParser(String pageContent, int fullTermNumber) { Object kjData1 = new JavaScriptExecutor().evaluate(pageContent + ";kjData_1"); if (kjData1 instanceof NativeObject) { Object dataObject = ((NativeObject) kjData1).get(fullTermNumber); if (dataObject instanceof NativeObject) { data = (NativeObject) dataObject; } } } @Override public String getResult() { if (data == null) { return null; } Object number = data.get("kjZNum"); if (number == null || !(number instanceof String)) { return null; } String[] numbers = ((String) number).split("\\s"); Arrays.sort(numbers); return Joiner.on(" ").join(numbers); } @Override public String getDrawTime() { if (data == null) { return null; } Object date = data.get("kjDate"); if (date == null || !(date instanceof String)) { return null; } DecimalFormat format = new DecimalFormat("00"); return date + " " + format.format(PUBLISH_HOUR) + ":" + format.format(PUBLISH_MINUTE) + ":" + format.format(PUBLISH_SECOND); } }
1,716
0.619464
0.613636
53
31.377359
26.034248
93
false
false
0
0
0
0
0
0
0.528302
false
false
7
e748fe727c575eeb8816bf2bb8f3a4b1291ecbf1
35,064,113,009,900
cb62eac6c8e1693c1753b3dffa71baf3b866ea57
/CompactERP/src/main/java/cn/com/easyerp/core/authGroup/MenuGroup.java
46632133cd7584a63c91a00d627b9fd4d8e6b4e5
[ "Apache-2.0" ]
permissive
ZZQSimon/tools
https://github.com/ZZQSimon/tools
14ba6e407af004d563dfb14b963a41a62152320a
cea6d6199d9ab07005c6e04a1bfd844c04c72e95
refs/heads/master
2021-05-20T17:24:42.888000
2019-11-04T03:31:20
2019-11-04T03:31:20
64,719,299
1
0
Apache-2.0
false
2021-04-26T19:37:10
2016-08-02T02:59:41
2019-11-13T08:47:27
2021-04-26T19:37:10
53,101
0
0
5
JavaScript
false
false
package cn.com.easyerp.core.authGroup; public class MenuGroup { private String menu_group_id; public String getMenu_group_id() { return this.menu_group_id; } private String menu_id; public void setMenu_group_id(String menu_group_id) { this.menu_group_id = menu_group_id; } public String getMenu_id() { return this.menu_id; } public void setMenu_id(String menu_id) { this.menu_id = menu_id; } }
UTF-8
Java
472
java
MenuGroup.java
Java
[]
null
[]
package cn.com.easyerp.core.authGroup; public class MenuGroup { private String menu_group_id; public String getMenu_group_id() { return this.menu_group_id; } private String menu_id; public void setMenu_group_id(String menu_group_id) { this.menu_group_id = menu_group_id; } public String getMenu_id() { return this.menu_id; } public void setMenu_id(String menu_id) { this.menu_id = menu_id; } }
472
0.620763
0.620763
23
19.52174
18.014172
56
false
false
0
0
0
0
0
0
0.304348
false
false
7
122588f97459c2a9ed4a76950e4c2ecf4bb0462c
3,513,283,272,805
b13cec6bca13c7a4b77f7bf71b20e88ac1b851a3
/src/main/java/com/example/demo/configuration/SecurityConfiguration.java
48c7fe5b57238680ce6ce5b5c38f147acba79ce2
[]
no_license
Czarek-Ochman/Cookbook
https://github.com/Czarek-Ochman/Cookbook
f7ac1fa73d115f3881e70307f74191dda833d351
28a1340e6ade91cd3bb303dbc599c23c11603a86
refs/heads/master
2023-01-29T23:10:49.723000
2020-12-10T14:29:36
2020-12-10T14:29:36
297,374,801
0
0
null
false
2020-10-05T20:59:31
2020-09-21T15:02:26
2020-09-25T09:05:36
2020-10-05T20:59:31
60
0
0
0
Java
false
false
package com.example.demo.configuration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.crypto.factory.PasswordEncoderFactories; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.HttpStatusEntryPoint; import javax.sql.DataSource; @Configuration public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Autowired private DataSource dataSource; @Bean public PasswordEncoder passwordEncoder() { return PasswordEncoderFactories.createDelegatingPasswordEncoder(); } @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/kategorie").permitAll() .antMatchers("/login").permitAll() .antMatchers("/rejestracja").permitAll() .antMatchers("/przepisy").permitAll() .antMatchers("/przepis").permitAll() .antMatchers("/**/*.css").permitAll() .antMatchers("/edytacja").hasRole("USER") .antMatchers("/dodawanie").hasRole("USER") .antMatchers("/dodawanie-skladniki").hasRole("USER") .antMatchers("/edytuj-skladnik").hasRole("USER") .antMatchers("/h2-console/**") .permitAll() .anyRequest().authenticated() .and() .csrf().ignoringAntMatchers("/edytowanie/**") .and() .csrf().ignoringAntMatchers("/przepis/**") .and() .csrf().ignoringAntMatchers("/edytuj-skladnik/**") .and() .csrf().ignoringAntMatchers("/h2-console/**") .and() .csrf().ignoringAntMatchers("//**") .and() .headers().frameOptions().disable() .and() .formLogin() .loginPage("/login"); } @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .usersByUsernameQuery("select username,password,enabled from user_data where username=?") .authoritiesByUsernameQuery("select username, role from user_role where username=?"); } }
UTF-8
Java
3,103
java
SecurityConfiguration.java
Java
[]
null
[]
package com.example.demo.configuration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.crypto.factory.PasswordEncoderFactories; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.HttpStatusEntryPoint; import javax.sql.DataSource; @Configuration public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Autowired private DataSource dataSource; @Bean public PasswordEncoder passwordEncoder() { return PasswordEncoderFactories.createDelegatingPasswordEncoder(); } @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/kategorie").permitAll() .antMatchers("/login").permitAll() .antMatchers("/rejestracja").permitAll() .antMatchers("/przepisy").permitAll() .antMatchers("/przepis").permitAll() .antMatchers("/**/*.css").permitAll() .antMatchers("/edytacja").hasRole("USER") .antMatchers("/dodawanie").hasRole("USER") .antMatchers("/dodawanie-skladniki").hasRole("USER") .antMatchers("/edytuj-skladnik").hasRole("USER") .antMatchers("/h2-console/**") .permitAll() .anyRequest().authenticated() .and() .csrf().ignoringAntMatchers("/edytowanie/**") .and() .csrf().ignoringAntMatchers("/przepis/**") .and() .csrf().ignoringAntMatchers("/edytuj-skladnik/**") .and() .csrf().ignoringAntMatchers("/h2-console/**") .and() .csrf().ignoringAntMatchers("//**") .and() .headers().frameOptions().disable() .and() .formLogin() .loginPage("/login"); } @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .usersByUsernameQuery("select username,password,enabled from user_data where username=?") .authoritiesByUsernameQuery("select username, role from user_role where username=?"); } }
3,103
0.658717
0.658073
70
43.342857
28.475998
107
false
false
0
0
0
0
0
0
0.314286
false
false
7
7ae8f76e9f620f83ed1b1f007f45cf6cb65ec1e5
20,495,583,999,994
a9ccc918553aa94b6e0f1c1ad6323cbb021fc69a
/spring_mybatis_mvc/src/main/java/com/tsunami/smm/controller/StudentController.java
ea09ad3bca7bb559d92c6e21afc19a244f1bd437
[]
no_license
TsunamiJava/GitHubRepository
https://github.com/TsunamiJava/GitHubRepository
5bdfdd463123fd27dcc5b38f76e4b60ac3d030dc
c0d7fb1ad5a2639fb55ad53252f9b693bf5ff4d7
refs/heads/master
2021-01-20T07:19:06.347000
2017-09-10T12:22:10
2017-09-10T12:22:10
101,532,547
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tsunami.smm.controller; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.test.context.ContextConfiguration; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.tsunami.smm.pojo.Student; import com.tsunami.smm.pojo.StudentExample; import com.tsunami.smm.service.StudentService; @Controller //获取配置xml文件 @ContextConfiguration(locations={"classpath:spring-config.xml"}) public class StudentController{ @Autowired private StudentService service; private StudentExample studentExample=new StudentExample(); //http://localhost:8080/spring_mybatis_mvc/showlist.do @RequestMapping(value="/showlist") public String selectAll(@RequestParam(defaultValue = "1") String pageNum,String search,Model model){ if(pageNum==null){ pageNum="1"; } //显示数据数量 int pageSize = 5; PageHelper.startPage(Integer.parseInt(pageNum), pageSize); //判断search是否为空 if(search!=null){ List<Student> students=service.selectLikeByName(search); PageInfo<Student> pageInfo=new PageInfo<Student>(students); long totalPages = pageInfo.getTotal()/pageSize+((pageInfo.getTotal()%pageSize)>0?1:0); model.addAttribute("search",search); model.addAttribute("dates",students); model.addAttribute("totalPages",totalPages); model.addAttribute("pageNum",Integer.parseInt(pageNum)); System.out.println(search); }else{ List<Student> students = service.selectByExample(studentExample); PageInfo<Student> pageInfo=new PageInfo<Student>(students); long totalPages = pageInfo.getTotal()/pageSize+((pageInfo.getTotal()%pageSize)>0?1:0); model.addAttribute("dates",students); model.addAttribute("totalPages",totalPages); model.addAttribute("pageNum",Integer.parseInt(pageNum)); } return "index.jsp"; } //http://localhost:8080/spring_mybatis_mvc/addstu.do @RequestMapping(value="/addstu") public String addStu(Student student){ student.setStuCreatetime(new Date()); service.insert(student); return "showlist.do"; } //http://localhost:8080/spring_mybatis_mvc/deletestu.do @RequestMapping(value="/deletestu") public String deleteStu(String ids){ service.deleteIds(ids); return "showlist.do"; } //http://localhost:8080/spring_mybatis_mvc/Selectstuids.do @RequestMapping(value="/selectstuids") public String SelectStuids(String ids,Model model){ Student student=service.selectByPrimaryKey(Integer.parseInt(ids)); model.addAttribute("student",student); return "update.jsp"; } //http://localhost:8080/spring_mybatis_mvc/updatestu.do @RequestMapping(value="/updatestu") public String updateStu(Student student){ student.setStuUpdatetime(new Date()); service.updateByExample(student); return "showlist.do"; } }
GB18030
Java
3,064
java
StudentController.java
Java
[]
null
[]
package com.tsunami.smm.controller; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.test.context.ContextConfiguration; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.tsunami.smm.pojo.Student; import com.tsunami.smm.pojo.StudentExample; import com.tsunami.smm.service.StudentService; @Controller //获取配置xml文件 @ContextConfiguration(locations={"classpath:spring-config.xml"}) public class StudentController{ @Autowired private StudentService service; private StudentExample studentExample=new StudentExample(); //http://localhost:8080/spring_mybatis_mvc/showlist.do @RequestMapping(value="/showlist") public String selectAll(@RequestParam(defaultValue = "1") String pageNum,String search,Model model){ if(pageNum==null){ pageNum="1"; } //显示数据数量 int pageSize = 5; PageHelper.startPage(Integer.parseInt(pageNum), pageSize); //判断search是否为空 if(search!=null){ List<Student> students=service.selectLikeByName(search); PageInfo<Student> pageInfo=new PageInfo<Student>(students); long totalPages = pageInfo.getTotal()/pageSize+((pageInfo.getTotal()%pageSize)>0?1:0); model.addAttribute("search",search); model.addAttribute("dates",students); model.addAttribute("totalPages",totalPages); model.addAttribute("pageNum",Integer.parseInt(pageNum)); System.out.println(search); }else{ List<Student> students = service.selectByExample(studentExample); PageInfo<Student> pageInfo=new PageInfo<Student>(students); long totalPages = pageInfo.getTotal()/pageSize+((pageInfo.getTotal()%pageSize)>0?1:0); model.addAttribute("dates",students); model.addAttribute("totalPages",totalPages); model.addAttribute("pageNum",Integer.parseInt(pageNum)); } return "index.jsp"; } //http://localhost:8080/spring_mybatis_mvc/addstu.do @RequestMapping(value="/addstu") public String addStu(Student student){ student.setStuCreatetime(new Date()); service.insert(student); return "showlist.do"; } //http://localhost:8080/spring_mybatis_mvc/deletestu.do @RequestMapping(value="/deletestu") public String deleteStu(String ids){ service.deleteIds(ids); return "showlist.do"; } //http://localhost:8080/spring_mybatis_mvc/Selectstuids.do @RequestMapping(value="/selectstuids") public String SelectStuids(String ids,Model model){ Student student=service.selectByPrimaryKey(Integer.parseInt(ids)); model.addAttribute("student",student); return "update.jsp"; } //http://localhost:8080/spring_mybatis_mvc/updatestu.do @RequestMapping(value="/updatestu") public String updateStu(Student student){ student.setStuUpdatetime(new Date()); service.updateByExample(student); return "showlist.do"; } }
3,064
0.765852
0.756275
92
31.913044
24.288418
101
false
false
0
0
0
0
0
0
1.913043
false
false
7
c22f7008d93f7bd3651a7d5852597748c62d64e1
1,477,468,753,558
a6126d4288c762abe1ca51c18e22440bc072f443
/src/main/java/org/jabref/logic/importer/fileformat/medline/Investigator.java
64ea31e62062bebe2d0cb5293620ed8a65eec696
[ "MIT" ]
permissive
JabRef/jabref
https://github.com/JabRef/jabref
20e2ae28c507d78c5d8b6c1ce5cc8c4891050123
c303db504f852e43a9e9b60e4c4abe720ccdb546
refs/heads/main
2023-08-31T10:15:18.552000
2023-08-30T20:12:44
2023-08-30T20:12:44
17,634,071
3,476
3,028
MIT
false
2023-09-14T11:14:24
2014-03-11T14:48:42
2023-09-14T11:02:34
2023-09-14T02:42:17
223,187
3,112
2,164
416
Java
false
false
package org.jabref.logic.importer.fileformat.medline; import java.util.List; public record Investigator( String lastName, String foreName, List<String> affiliationList ) { }
UTF-8
Java
200
java
Investigator.java
Java
[ { "context": ".List;\n\npublic record Investigator(\n String lastName,\n String foreName,\n List<String> af", "end": 130, "score": 0.8896231055259705, "start": 122, "tag": "NAME", "value": "lastName" } ]
null
[]
package org.jabref.logic.importer.fileformat.medline; import java.util.List; public record Investigator( String lastName, String foreName, List<String> affiliationList ) { }
200
0.705
0.705
10
19
16.941074
53
false
false
0
0
0
0
0
0
0.4
false
false
7
d82cff170a8f02d6b8b26fb6b0359d2457e2ee71
1,477,468,753,956
c7f46100d6988e1d5394f333251d4317d7f46a1f
/LuckyNumberGenerator.java
abc8848a9e4729e48e7f7c73d8309de963ad07d9
[]
no_license
GloOn/AssignmentOfALuckyNumberGame
https://github.com/GloOn/AssignmentOfALuckyNumberGame
ab9da55cbc36187b44d7a79828ee1cd294f60a2b
1b2f31bf871adaf8761201d50bb68d7dba65ef3b
refs/heads/master
2021-01-15T22:28:45.685000
2015-06-24T03:09:13
2015-06-24T03:09:13
37,904,795
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * The LuckyNumberGenerator class is to creat a machine * which can create a random integer between 1 and 100. * I use the code "Math.random()" to let the system * choose the random integer. * * @author Jing Guo * @version Assignment 1 of FIT5131(due day: 12/9/2014) */ public class LuckyNumberGenerator { // the lucky number. private int luckyNumber; /** * Constructor for objects of class LuckyNumberGenerator */ public LuckyNumberGenerator() { luckyNumber = 0; } /** * get a random lucky number. */ public int getLuckyNumber() { luckyNumber = (int) (Math.random() * 100 + 1);//create a random integer //between 1 and 100(include 1 and 100) return luckyNumber; } /** * set a lucky number. */ public void setLuckyNumber(int newLuckyNumber) { luckyNumber = newLuckyNumber; } }
UTF-8
Java
973
java
LuckyNumberGenerator.java
Java
[ { "context": "stem \n * choose the random integer.\n * \n * @author Jing Guo \n * @version Assignment 1 of FIT5131(due day: 12/", "end": 224, "score": 0.99977046251297, "start": 216, "tag": "NAME", "value": "Jing Guo" } ]
null
[]
/** * The LuckyNumberGenerator class is to creat a machine * which can create a random integer between 1 and 100. * I use the code "Math.random()" to let the system * choose the random integer. * * @author <NAME> * @version Assignment 1 of FIT5131(due day: 12/9/2014) */ public class LuckyNumberGenerator { // the lucky number. private int luckyNumber; /** * Constructor for objects of class LuckyNumberGenerator */ public LuckyNumberGenerator() { luckyNumber = 0; } /** * get a random lucky number. */ public int getLuckyNumber() { luckyNumber = (int) (Math.random() * 100 + 1);//create a random integer //between 1 and 100(include 1 and 100) return luckyNumber; } /** * set a lucky number. */ public void setLuckyNumber(int newLuckyNumber) { luckyNumber = newLuckyNumber; } }
971
0.582734
0.552929
40
23.325001
23.119675
91
false
false
0
0
0
0
0
0
0.125
false
false
7
0b3e61470dac6afe60bb597b0db699515085bddc
23,115,514,039,266
495ff08bd44909ce437bfec156735ad8e64057ba
/vecaptcha/src/main/java/com/chandan/vecaptchatest/ui/CaptchaView.java
1ed5e8e939d5e1a367a61c45f929240cf4144d8e
[]
no_license
chandan0506/VeCaptcha
https://github.com/chandan0506/VeCaptcha
f8fe1ae97dffe0dd13db57716f0fbff825566691
93f2cae1dc09fae205b7e89bb768f4a48aae4f5e
refs/heads/master
2020-04-02T06:49:06.419000
2019-10-25T06:29:31
2019-10-25T06:29:31
154,169,533
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.chandan.vecaptchatest.ui; import android.content.Context; import android.content.res.TypedArray; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import com.chandan.vecaptchatest.R; import com.chandan.vecaptchatest.captcha.CaptchaController; import com.chandan.vecaptchatest.captcha.GenerateCaptcha; /** * Created by ${Chandan} on 05-10-2018. */ public class CaptchaView extends LinearLayout { private ImageView imageViewCaptcha; private CaptchaController controller; private final LinearLayout layoutCaptcha; private int captchaHeight; private int captchaWidth; // private final EditText editTextFillCaptcha; public CaptchaView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); TypedArray arrayValues = context.obtainStyledAttributes(attrs,R.styleable.CaptchaView,0,0); int refreshButtonWidth = arrayValues.getInteger(R.styleable.CaptchaView_refreshButtonWidth,50); int refreshButtonHeight = arrayValues.getInteger(R.styleable.CaptchaView_refreshButtonHeight,50); captchaHeight = arrayValues.getInteger(R.styleable.CaptchaView_captchaHeight,60); captchaWidth = arrayValues.getInteger(R.styleable.CaptchaView_captchaWidth,100); arrayValues.recycle(); setOrientation(LinearLayout.VERTICAL); setGravity(Gravity.CENTER); controller = refreshCaptcha(); imageViewCaptcha = new ImageView(getContext()); imageViewCaptcha.setImageBitmap(controller.getImage()); imageViewCaptcha.setLayoutParams(new LinearLayout.LayoutParams(controller.width * 2, controller.height * 2)); ImageView imageViewRefreshCaptcha = new ImageView(getContext()); imageViewRefreshCaptcha.setImageDrawable(getResources().getDrawable(R.drawable.reload)); LayoutParams paramsRefresh = new LinearLayout.LayoutParams( refreshButtonWidth, refreshButtonHeight); paramsRefresh.setMargins(10,0,0,0); imageViewRefreshCaptcha.setLayoutParams(paramsRefresh); layoutCaptcha = new LinearLayout(getContext()); layoutCaptcha.setOrientation(LinearLayout.HORIZONTAL); layoutCaptcha.setGravity(Gravity.CENTER); layoutCaptcha.addView(imageViewCaptcha); layoutCaptcha.addView(imageViewRefreshCaptcha); LayoutParams params = new LayoutParams( controller.width * 2, LayoutParams.WRAP_CONTENT ); params.setMargins(0,10,20,0); /*Log.d("TESTING ", "CaptchaView: Width " + imageViewCaptcha.getLayoutParams().width + " Refresh Button height and width:- " + refreshButtonHeight + " , " + refreshButtonWidth);*/ imageViewRefreshCaptcha.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { // Log.d("TESTING ", "onClick: "); refreshCaptchaImage(); } }); addView(layoutCaptcha); } private void refreshCaptchaImage() { removeAllViewsInLayout(); controller = refreshCaptcha(); imageViewCaptcha.setImageBitmap(controller.getImage()); addView(layoutCaptcha); } public int getCaptchaAnswer() { return Integer.parseInt(controller.answer); } private CaptchaController refreshCaptcha() { return new GenerateCaptcha(captchaWidth, captchaHeight, GenerateCaptcha.MathOptions.PLUS_MINUS_MULTIPLY); } }
UTF-8
Java
3,709
java
CaptchaView.java
Java
[ { "context": "est.captcha.GenerateCaptcha;\n\n/**\n * Created by ${Chandan} on 05-10-2018.\n */\npublic class CaptchaView exte", "end": 552, "score": 0.9860504269599915, "start": 545, "tag": "USERNAME", "value": "Chandan" } ]
null
[]
package com.chandan.vecaptchatest.ui; import android.content.Context; import android.content.res.TypedArray; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import com.chandan.vecaptchatest.R; import com.chandan.vecaptchatest.captcha.CaptchaController; import com.chandan.vecaptchatest.captcha.GenerateCaptcha; /** * Created by ${Chandan} on 05-10-2018. */ public class CaptchaView extends LinearLayout { private ImageView imageViewCaptcha; private CaptchaController controller; private final LinearLayout layoutCaptcha; private int captchaHeight; private int captchaWidth; // private final EditText editTextFillCaptcha; public CaptchaView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); TypedArray arrayValues = context.obtainStyledAttributes(attrs,R.styleable.CaptchaView,0,0); int refreshButtonWidth = arrayValues.getInteger(R.styleable.CaptchaView_refreshButtonWidth,50); int refreshButtonHeight = arrayValues.getInteger(R.styleable.CaptchaView_refreshButtonHeight,50); captchaHeight = arrayValues.getInteger(R.styleable.CaptchaView_captchaHeight,60); captchaWidth = arrayValues.getInteger(R.styleable.CaptchaView_captchaWidth,100); arrayValues.recycle(); setOrientation(LinearLayout.VERTICAL); setGravity(Gravity.CENTER); controller = refreshCaptcha(); imageViewCaptcha = new ImageView(getContext()); imageViewCaptcha.setImageBitmap(controller.getImage()); imageViewCaptcha.setLayoutParams(new LinearLayout.LayoutParams(controller.width * 2, controller.height * 2)); ImageView imageViewRefreshCaptcha = new ImageView(getContext()); imageViewRefreshCaptcha.setImageDrawable(getResources().getDrawable(R.drawable.reload)); LayoutParams paramsRefresh = new LinearLayout.LayoutParams( refreshButtonWidth, refreshButtonHeight); paramsRefresh.setMargins(10,0,0,0); imageViewRefreshCaptcha.setLayoutParams(paramsRefresh); layoutCaptcha = new LinearLayout(getContext()); layoutCaptcha.setOrientation(LinearLayout.HORIZONTAL); layoutCaptcha.setGravity(Gravity.CENTER); layoutCaptcha.addView(imageViewCaptcha); layoutCaptcha.addView(imageViewRefreshCaptcha); LayoutParams params = new LayoutParams( controller.width * 2, LayoutParams.WRAP_CONTENT ); params.setMargins(0,10,20,0); /*Log.d("TESTING ", "CaptchaView: Width " + imageViewCaptcha.getLayoutParams().width + " Refresh Button height and width:- " + refreshButtonHeight + " , " + refreshButtonWidth);*/ imageViewRefreshCaptcha.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { // Log.d("TESTING ", "onClick: "); refreshCaptchaImage(); } }); addView(layoutCaptcha); } private void refreshCaptchaImage() { removeAllViewsInLayout(); controller = refreshCaptcha(); imageViewCaptcha.setImageBitmap(controller.getImage()); addView(layoutCaptcha); } public int getCaptchaAnswer() { return Integer.parseInt(controller.answer); } private CaptchaController refreshCaptcha() { return new GenerateCaptcha(captchaWidth, captchaHeight, GenerateCaptcha.MathOptions.PLUS_MINUS_MULTIPLY); } }
3,709
0.711513
0.702615
105
34.323811
30.419447
117
false
false
0
0
0
0
0
0
0.752381
false
false
7
f6c3b5a840f617f6554f8fa7e0b4bff4f78f9866
29,403,346,112,102
f6b172e5b91fcd89bf86e6707deb368b2e3b8494
/app/src/main/java/com/example/news/movenews/fragment/FocusNewsFragment.java
7dd7275dd374f8e74dcc7ed5af8d7509bc55bbd8
[]
no_license
Yone-sx/News
https://github.com/Yone-sx/News
31a546dcf6d82c6aaa26bf4d3dc217a126875697
07d81bf35f1158b83b58eb3a35dc2d5bc181f8a4
refs/heads/master
2016-08-12T08:56:37.834000
2015-11-23T15:10:37
2015-11-23T15:10:37
45,399,162
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.news.movenews.fragment; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import com.example.news.movenews.R; import com.example.news.movenews.adapter.RecyclerviewAdapter; import com.example.news.movenews.adapter.fRecyclerviewAdapter; import com.example.news.movenews.http.OkHttpClientManager; import com.example.news.movenews.model.FocusNewList; import com.example.news.movenews.model.FocusNewList.FocusNewListResult; import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; import com.squareup.okhttp.Request; import java.util.List; /** * Created by Yoe on 2015/10/11. */ public class FocusNewsFragment extends Fragment { private RecyclerView fRecyclerView; private List<FocusNewListResult> newsResultLists; private LinearLayoutManager mLayoutManager; private fRecyclerviewAdapter adapter; <<<<<<< HEAD private SwipyRefreshLayout FocusSwipyRefresh; ======= >>>>>>> 75061d38a2d102768add38d10a2a7a023aece9bf @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.news_list, container, false); fRecyclerView = (RecyclerView) view.findViewById(R.id.focusRecyclerView); <<<<<<< HEAD FocusSwipyRefresh = (SwipyRefreshLayout) view.findViewById(R.id.swipyrefreshlayout); getData(); mLayoutManager = new LinearLayoutManager(getActivity()); fRecyclerView.setLayoutManager(mLayoutManager); //实现下拉刷新和上拉加载更多事件 FocusSwipyRefresh.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() { @Override public void onRefresh(SwipyRefreshLayoutDirection direction) { //刷新5秒 new Handler().postDelayed(new Runnable() { @Override public void run() { FocusSwipyRefresh.setRefreshing(false); } },5000); switch (direction){ case TOP: //下拉 adapter.notifyDataSetChanged(); //刷新数据 break; case BOTTOM: //上拉 Toast.makeText(getContext(),"抱歉,没有更多数据了!",Toast.LENGTH_SHORT).show(); FocusSwipyRefresh.setRefreshing(false); } } }); return view; } //使用okhttp获取网络新闻数据 private void getData(){ ======= getData(); mLayoutManager = new LinearLayoutManager(getActivity()); fRecyclerView.setLayoutManager(mLayoutManager); return view; } private void getData(){ >>>>>>> 75061d38a2d102768add38d10a2a7a023aece9bf OkHttpClientManager.getAsyn("http://www.tngou.net/api/top/list/", new OkHttpClientManager.ResultCallback<FocusNewList>() { @Override public void onError(Request request, Exception e) { e.printStackTrace(); } @Override public void onResponse(FocusNewList newsList) { newsResultLists = newsList.getTngou(); adapter = new fRecyclerviewAdapter(getActivity(), newsResultLists); fRecyclerView.setAdapter(adapter); } }); } }
UTF-8
Java
3,992
java
FocusNewsFragment.java
Java
[ { "context": "equest;\n\nimport java.util.List;\n\n/**\n * Created by Yoe on 2015/10/11.\n */\npublic class FocusNewsFragment", "end": 1088, "score": 0.8948045969009399, "start": 1085, "tag": "USERNAME", "value": "Yoe" } ]
null
[]
package com.example.news.movenews.fragment; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import com.example.news.movenews.R; import com.example.news.movenews.adapter.RecyclerviewAdapter; import com.example.news.movenews.adapter.fRecyclerviewAdapter; import com.example.news.movenews.http.OkHttpClientManager; import com.example.news.movenews.model.FocusNewList; import com.example.news.movenews.model.FocusNewList.FocusNewListResult; import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; import com.squareup.okhttp.Request; import java.util.List; /** * Created by Yoe on 2015/10/11. */ public class FocusNewsFragment extends Fragment { private RecyclerView fRecyclerView; private List<FocusNewListResult> newsResultLists; private LinearLayoutManager mLayoutManager; private fRecyclerviewAdapter adapter; <<<<<<< HEAD private SwipyRefreshLayout FocusSwipyRefresh; ======= >>>>>>> 75061d38a2d102768add38d10a2a7a023aece9bf @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.news_list, container, false); fRecyclerView = (RecyclerView) view.findViewById(R.id.focusRecyclerView); <<<<<<< HEAD FocusSwipyRefresh = (SwipyRefreshLayout) view.findViewById(R.id.swipyrefreshlayout); getData(); mLayoutManager = new LinearLayoutManager(getActivity()); fRecyclerView.setLayoutManager(mLayoutManager); //实现下拉刷新和上拉加载更多事件 FocusSwipyRefresh.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() { @Override public void onRefresh(SwipyRefreshLayoutDirection direction) { //刷新5秒 new Handler().postDelayed(new Runnable() { @Override public void run() { FocusSwipyRefresh.setRefreshing(false); } },5000); switch (direction){ case TOP: //下拉 adapter.notifyDataSetChanged(); //刷新数据 break; case BOTTOM: //上拉 Toast.makeText(getContext(),"抱歉,没有更多数据了!",Toast.LENGTH_SHORT).show(); FocusSwipyRefresh.setRefreshing(false); } } }); return view; } //使用okhttp获取网络新闻数据 private void getData(){ ======= getData(); mLayoutManager = new LinearLayoutManager(getActivity()); fRecyclerView.setLayoutManager(mLayoutManager); return view; } private void getData(){ >>>>>>> 75061d38a2d102768add38d10a2a7a023aece9bf OkHttpClientManager.getAsyn("http://www.tngou.net/api/top/list/", new OkHttpClientManager.ResultCallback<FocusNewList>() { @Override public void onError(Request request, Exception e) { e.printStackTrace(); } @Override public void onResponse(FocusNewList newsList) { newsResultLists = newsList.getTngou(); adapter = new fRecyclerviewAdapter(getActivity(), newsResultLists); fRecyclerView.setAdapter(adapter); } }); } }
3,992
0.652642
0.636224
107
35.429905
26.523174
103
false
false
0
0
0
0
0
0
0.579439
false
false
7
c56cd84a22821327147cd8cb1597d67c2f8463a1
14,474,039,791,943
4ec65cc12bbe6a4da684f436f99015bccb81e147
/Curl.javaproj/src/application/ProgressData.java
8be9971d2846c006e65265d8ac613a85a330dda9
[]
no_license
Norberts11/MoodernizeExamples
https://github.com/Norberts11/MoodernizeExamples
ec69674078c314b22cd659cc30eab1caa6f547c3
7ee6503ef596d6afc01220edbab77c2264969085
refs/heads/master
2020-08-24T17:45:36.808000
2020-07-27T11:13:03
2020-07-27T11:13:03
216,872,605
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package application; /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* default progress display */ public class ProgressData { private int calls; private Object prev; private timeval prevtime; private int width; private _iobuf out; private Object initial_size; private int tick; private int bar; private int barmove; public ProgressData(int calls, Object prev, timeval prevtime, int width, _iobuf out, Object initial_size, int tick, int bar, int barmove) { setCalls(calls); setPrev(prev); setPrevtime(prevtime); setWidth(width); setOut(out); setInitial_size(initial_size); setTick(tick); setBar(bar); setBarmove(barmove); } public ProgressData() { } public void fly( moved) { byte[] buf = new byte[256]; int pos; int generatedWidth = this.getWidth(); int check = generatedWidth - 2; ModernizedCProgram.curl_msnprintf(buf, /*Error: sizeof expression not supported yet*/, "%*s\r", generatedWidth - 1, " "); int generatedBar = this.getBar(); /*Error: Function owner not recognized*//*Error: Function owner not recognized*/memcpy(buf[generatedBar], "-=O=-", 5); int generatedTick = this.getTick(); pos = ModernizedCProgram.sinus[generatedTick % 200] / (10000 / check); buf[pos] = (byte)'#'; pos = ModernizedCProgram.sinus[(generatedTick + 5) % 200] / (10000 / check); buf[pos] = (byte)'#'; pos = ModernizedCProgram.sinus[(generatedTick + 10) % 200] / (10000 / check); buf[pos] = (byte)'#'; pos = ModernizedCProgram.sinus[(generatedTick + 15) % 200] / (10000 / check); buf[pos] = (byte)'#'; _iobuf generatedOut = this.getOut(); /*Error: Function owner not recognized*//*Error: Function owner not recognized*/fputs(buf, generatedOut); generatedTick += 2; if (generatedTick >= 200) { generatedTick -= 200; } int generatedBarmove = this.getBarmove(); generatedBar += (moved ? generatedBarmove : 0); if (generatedBar >= (generatedWidth - 6)) { this.setBarmove(-1); this.setBar(generatedWidth - 6); } else if (generatedBar < 0) { this.setBarmove(1); this.setBar(0/* ** callback for CURLOPT_XFERINFOFUNCTION */); } } public int getCalls() { return calls; } public void setCalls(int newCalls) { calls = newCalls; } public Object getPrev() { return prev; } public void setPrev(Object newPrev) { prev = newPrev; } public timeval getPrevtime() { return prevtime; } public void setPrevtime(timeval newPrevtime) { prevtime = newPrevtime; } public int getWidth() { return width; } public void setWidth(int newWidth) { width = newWidth; } public _iobuf getOut() { return out; } public void setOut(_iobuf newOut) { out = newOut; } public Object getInitial_size() { return initial_size; } public void setInitial_size(Object newInitial_size) { initial_size = newInitial_size; } public int getTick() { return tick; } public void setTick(int newTick) { tick = newTick; } public int getBar() { return bar; } public void setBar(int newBar) { bar = newBar; } public int getBarmove() { return barmove; } public void setBarmove(int newBarmove) { barmove = newBarmove; } }
UTF-8
Java
4,108
java
ProgressData.java
Java
[ { "context": "___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is ", "end": 408, "score": 0.9998002052307129, "start": 393, "tag": "NAME", "value": "Daniel Stenberg" }, { "context": "*\n * Copyright (C) 1998 - 2018...
null
[]
package application; /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2018, <NAME>, <<EMAIL>>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* default progress display */ public class ProgressData { private int calls; private Object prev; private timeval prevtime; private int width; private _iobuf out; private Object initial_size; private int tick; private int bar; private int barmove; public ProgressData(int calls, Object prev, timeval prevtime, int width, _iobuf out, Object initial_size, int tick, int bar, int barmove) { setCalls(calls); setPrev(prev); setPrevtime(prevtime); setWidth(width); setOut(out); setInitial_size(initial_size); setTick(tick); setBar(bar); setBarmove(barmove); } public ProgressData() { } public void fly( moved) { byte[] buf = new byte[256]; int pos; int generatedWidth = this.getWidth(); int check = generatedWidth - 2; ModernizedCProgram.curl_msnprintf(buf, /*Error: sizeof expression not supported yet*/, "%*s\r", generatedWidth - 1, " "); int generatedBar = this.getBar(); /*Error: Function owner not recognized*//*Error: Function owner not recognized*/memcpy(buf[generatedBar], "-=O=-", 5); int generatedTick = this.getTick(); pos = ModernizedCProgram.sinus[generatedTick % 200] / (10000 / check); buf[pos] = (byte)'#'; pos = ModernizedCProgram.sinus[(generatedTick + 5) % 200] / (10000 / check); buf[pos] = (byte)'#'; pos = ModernizedCProgram.sinus[(generatedTick + 10) % 200] / (10000 / check); buf[pos] = (byte)'#'; pos = ModernizedCProgram.sinus[(generatedTick + 15) % 200] / (10000 / check); buf[pos] = (byte)'#'; _iobuf generatedOut = this.getOut(); /*Error: Function owner not recognized*//*Error: Function owner not recognized*/fputs(buf, generatedOut); generatedTick += 2; if (generatedTick >= 200) { generatedTick -= 200; } int generatedBarmove = this.getBarmove(); generatedBar += (moved ? generatedBarmove : 0); if (generatedBar >= (generatedWidth - 6)) { this.setBarmove(-1); this.setBar(generatedWidth - 6); } else if (generatedBar < 0) { this.setBarmove(1); this.setBar(0/* ** callback for CURLOPT_XFERINFOFUNCTION */); } } public int getCalls() { return calls; } public void setCalls(int newCalls) { calls = newCalls; } public Object getPrev() { return prev; } public void setPrev(Object newPrev) { prev = newPrev; } public timeval getPrevtime() { return prevtime; } public void setPrevtime(timeval newPrevtime) { prevtime = newPrevtime; } public int getWidth() { return width; } public void setWidth(int newWidth) { width = newWidth; } public _iobuf getOut() { return out; } public void setOut(_iobuf newOut) { out = newOut; } public Object getInitial_size() { return initial_size; } public void setInitial_size(Object newInitial_size) { initial_size = newInitial_size; } public int getTick() { return tick; } public void setTick(int newTick) { tick = newTick; } public int getBar() { return bar; } public void setBar(int newBar) { bar = newBar; } public int getBarmove() { return barmove; } public void setBarmove(int newBarmove) { barmove = newBarmove; } }
4,092
0.618793
0.60297
139
28.553957
26.404484
140
false
false
0
0
0
0
0
0
2.122302
false
false
7
d2591df902759efff0cc9a02ab1e5ee76d8dbac3
28,570,122,479,018
cd2d579dff4c4c5b0653f292c81c7120e2c2ccbf
/permNum.java
e00d2028cee10312026ed54ac48c12f8266a7f95
[]
no_license
isabelacmor/programmingteam
https://github.com/isabelacmor/programmingteam
a00353d906d066eb6b846aea464e59e0a3690d4d
dadaaef14cd2e770088d2fb4ec18806fb577d4bb
refs/heads/master
2021-05-27T14:26:04.276000
2014-02-25T04:45:48
2014-02-25T04:45:48
11,412,303
2
2
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.*; import java.util.*; public class permNum { public static void main(String [] args) { int [] values = {1, 2, 3, 4}; int N = values.length; boolean [] used = new boolean[N]; int [] perm = new int[N]; permute(0, perm, values, used, N); } public static void permute(int ind, int [] perm, int [] values, boolean [] used, int N) { if(ind == N) { for(int k = 0; k < N; k++) { System.out.println(perm[k]); } return; } for(int i = 0; i < N; i++) { if(!used[i]) { perm[ind] = values[i]; used[i] = true; permute(ind+1, perm, values, used, N); used[i] = false; } } } }
UTF-8
Java
688
java
permNum.java
Java
[]
null
[]
import java.io.*; import java.util.*; public class permNum { public static void main(String [] args) { int [] values = {1, 2, 3, 4}; int N = values.length; boolean [] used = new boolean[N]; int [] perm = new int[N]; permute(0, perm, values, used, N); } public static void permute(int ind, int [] perm, int [] values, boolean [] used, int N) { if(ind == N) { for(int k = 0; k < N; k++) { System.out.println(perm[k]); } return; } for(int i = 0; i < N; i++) { if(!used[i]) { perm[ind] = values[i]; used[i] = true; permute(ind+1, perm, values, used, N); used[i] = false; } } } }
688
0.498547
0.486919
37
16.648649
17.634758
88
false
false
0
0
0
0
0
0
2.864865
false
false
7
ba1c562e6f6b988390c21d8b0cf23b7021e77a1a
28,570,122,478,560
132538db8ca5eefe5b7bb7e8a37b6c9d1fe8f1af
/javaWork/JNote/swings/StatusBar.java
dd7450191fb9980b2e0edba30217cf5c2d362587
[]
no_license
KiranPaladugu/javawork_old
https://github.com/KiranPaladugu/javawork_old
0dd6832107f58b36f528dbace166d3e352082fd1
707f195149c7295c8efe7b8c98f218f0aaf5be88
refs/heads/master
2021-04-05T08:34:39.273000
2016-08-03T22:24:43
2016-08-03T22:26:21
61,388,772
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package swings; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JPanel; public class StatusBar extends JPanel { /** * */ private static final long serialVersionUID = 4375615735275026933L; JLabel caps; JLabel num; JLabel scrol; JLabel line; JLabel col, position; JPanel lockPanel; JPanel cursorPanel; public StatusBar() { this.setLayout(new GridLayout()); lockPanel = new JPanel(new BorderLayout()); cursorPanel = new JPanel(); caps = new JLabel(" "); caps.setBorder(BorderFactory.createLineBorder(Color.GRAY)); num = new JLabel(" "); num.setBorder(BorderFactory.createLineBorder(Color.GRAY)); scrol = new JLabel(" "); scrol.setBorder(BorderFactory.createLineBorder(Color.GRAY)); position = new JLabel("Position:0"); position.setBorder(BorderFactory.createLineBorder(Color.GRAY)); lockPanel.add(caps, BorderLayout.EAST); lockPanel.add(num, BorderLayout.CENTER); lockPanel.add(scrol, BorderLayout.WEST); line = new JLabel("Line:0"); line.setBorder(BorderFactory.createLineBorder(Color.GRAY)); col = new JLabel("Col:0"); col.setBorder(BorderFactory.createLineBorder(Color.GRAY)); cursorPanel.setLayout(new BorderLayout()); cursorPanel.add(line, BorderLayout.EAST); cursorPanel.add(col, BorderLayout.WEST); cursorPanel.add(position, BorderLayout.CENTER); this.add(cursorPanel); this.add(lockPanel); } public int getCol() { int col = -1; String str = this.col.getText(); str = str.trim(); try { col = Integer.parseInt(str); } catch (Exception e) { } return col; } public int getLine() { int line = -1; String str = this.line.getText(); str = str.trim(); try { line = Integer.parseInt(str); } catch (Exception e) { } return line; } public int getPosition() { int col = -1; String str = this.position.getText(); str = str.trim(); try { col = Integer.parseInt(str); } catch (Exception e) { } return col; } public void setCaps(boolean flag) { if (flag) { this.caps.setText("CAPS"); } else caps.setText(" "); } public void setCol(int col) { this.col.setText("Col:" + col); } public void setLine(int line) { this.line.setText("Line:" + line); } public void setNum(boolean flag) { if (flag) { num.setText("NUMS"); } else num.setText(" "); } public void setPosition(int position) { this.position.setText("Position:" + position); } public void setScroll(boolean flag) { if (flag) { this.scrol.setText("SCROL"); } else scrol.setText(" "); } }
UTF-8
Java
2,749
java
StatusBar.java
Java
[]
null
[]
package swings; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JPanel; public class StatusBar extends JPanel { /** * */ private static final long serialVersionUID = 4375615735275026933L; JLabel caps; JLabel num; JLabel scrol; JLabel line; JLabel col, position; JPanel lockPanel; JPanel cursorPanel; public StatusBar() { this.setLayout(new GridLayout()); lockPanel = new JPanel(new BorderLayout()); cursorPanel = new JPanel(); caps = new JLabel(" "); caps.setBorder(BorderFactory.createLineBorder(Color.GRAY)); num = new JLabel(" "); num.setBorder(BorderFactory.createLineBorder(Color.GRAY)); scrol = new JLabel(" "); scrol.setBorder(BorderFactory.createLineBorder(Color.GRAY)); position = new JLabel("Position:0"); position.setBorder(BorderFactory.createLineBorder(Color.GRAY)); lockPanel.add(caps, BorderLayout.EAST); lockPanel.add(num, BorderLayout.CENTER); lockPanel.add(scrol, BorderLayout.WEST); line = new JLabel("Line:0"); line.setBorder(BorderFactory.createLineBorder(Color.GRAY)); col = new JLabel("Col:0"); col.setBorder(BorderFactory.createLineBorder(Color.GRAY)); cursorPanel.setLayout(new BorderLayout()); cursorPanel.add(line, BorderLayout.EAST); cursorPanel.add(col, BorderLayout.WEST); cursorPanel.add(position, BorderLayout.CENTER); this.add(cursorPanel); this.add(lockPanel); } public int getCol() { int col = -1; String str = this.col.getText(); str = str.trim(); try { col = Integer.parseInt(str); } catch (Exception e) { } return col; } public int getLine() { int line = -1; String str = this.line.getText(); str = str.trim(); try { line = Integer.parseInt(str); } catch (Exception e) { } return line; } public int getPosition() { int col = -1; String str = this.position.getText(); str = str.trim(); try { col = Integer.parseInt(str); } catch (Exception e) { } return col; } public void setCaps(boolean flag) { if (flag) { this.caps.setText("CAPS"); } else caps.setText(" "); } public void setCol(int col) { this.col.setText("Col:" + col); } public void setLine(int line) { this.line.setText("Line:" + line); } public void setNum(boolean flag) { if (flag) { num.setText("NUMS"); } else num.setText(" "); } public void setPosition(int position) { this.position.setText("Position:" + position); } public void setScroll(boolean flag) { if (flag) { this.scrol.setText("SCROL"); } else scrol.setText(" "); } }
2,749
0.651146
0.642052
121
20.719007
17.421476
67
false
false
0
0
0
0
0
0
1.950413
false
false
7
c547ff5207a1bbe2de515495e011bea16af19d7a
10,222,022,186,772
353a8692eca80b745830291a55b5427d5bf5f738
/src/main/java/com/mkyong/web/dao/DaoCity.java
eb0e4a09cfd552bfffe0bbf42e90037e55894f64
[]
no_license
mnastya51/springPhoneTalking
https://github.com/mnastya51/springPhoneTalking
26b28987a3392cb55aec5c4cfbded79c277eaecb
08666c7017120de7d83e3a2bdd943988ea24c363
refs/heads/master
2020-04-09T13:20:05.042000
2018-12-14T07:29:23
2018-12-14T07:29:23
160,369,990
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.mkyong.web.dao; import com.mkyong.web.models.City; import javax.persistence.EntityManager; import javax.persistence.Query; import java.util.List; public class DaoCity { public static List<City> getCityFromDao() { EntityManager em = Dao .getInstance() .getEntityManager(); Query q = em.createQuery("SELECT item FROM City item order by item.cityname"); List resultList = q.getResultList(); if (resultList.size() == 0) { return null; } else { return resultList; } } public static Boolean insertCityToDao(String cityName) { EntityManager em = Dao .getInstance() .getEntityManager(); em.getTransaction().begin(); City city = new City(); city.setCityname(cityName); try { em.persist(city); em.getTransaction().commit(); } catch (Exception e) { return false; } return true; } public static Boolean deleteCity(int cityId) { EntityManager em = Dao .getInstance() .getEntityManager(); City city = em.find(City.class, cityId); if (city != null) { em.getTransaction().begin(); try { em.remove(city); em.getTransaction().commit(); } catch (Exception e) { return false; } return true; } else return false; } }
UTF-8
Java
1,545
java
DaoCity.java
Java
[]
null
[]
package com.mkyong.web.dao; import com.mkyong.web.models.City; import javax.persistence.EntityManager; import javax.persistence.Query; import java.util.List; public class DaoCity { public static List<City> getCityFromDao() { EntityManager em = Dao .getInstance() .getEntityManager(); Query q = em.createQuery("SELECT item FROM City item order by item.cityname"); List resultList = q.getResultList(); if (resultList.size() == 0) { return null; } else { return resultList; } } public static Boolean insertCityToDao(String cityName) { EntityManager em = Dao .getInstance() .getEntityManager(); em.getTransaction().begin(); City city = new City(); city.setCityname(cityName); try { em.persist(city); em.getTransaction().commit(); } catch (Exception e) { return false; } return true; } public static Boolean deleteCity(int cityId) { EntityManager em = Dao .getInstance() .getEntityManager(); City city = em.find(City.class, cityId); if (city != null) { em.getTransaction().begin(); try { em.remove(city); em.getTransaction().commit(); } catch (Exception e) { return false; } return true; } else return false; } }
1,545
0.530097
0.52945
55
27.09091
16.493826
86
false
false
0
0
0
0
0
0
0.490909
false
false
7
6cab58937d78b1b7379f1ff8d6be2bbeda2915e9
15,857,019,269,602
ffb0011936b9b33ff483cb49344629cb2266a999
/addressbook-web-test/src/test/java/ru/stqa/pft/addressbook/appmanager/ContactHelper.java
18ffb2c9927ace9a38f83a4d01b89a577c4b2ca4
[ "Apache-2.0" ]
permissive
andrey5891/java_pft
https://github.com/andrey5891/java_pft
fb272e9d719ae847b3afcb129b674f5442041b03
1ac3f05014fac88c41ddec42016c329cd2983dd4
refs/heads/master
2020-03-22T11:07:33.292000
2018-07-18T19:02:48
2018-07-18T19:02:48
139,948,969
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.stqa.pft.addressbook.appmanager; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; import org.testng.Assert; import ru.stqa.pft.addressbook.model.ContactData; import ru.stqa.pft.addressbook.model.Contacts; import ru.stqa.pft.addressbook.model.GroupData; import java.util.*; import java.util.stream.Collectors; public class ContactHelper extends HelperBase { public ContactHelper (WebDriver wd) { super(wd); } public void fillContactForm(ContactData contactData, boolean create) { type(By.name("firstname"), contactData.getFirstName()); type(By.name("middlename"), contactData.getMiddleName()); type(By.name("lastname"), contactData.getLastName()); type(By.name("nickname"), contactData.getNickName()); type(By.name("company"), contactData.getCompany()); attach(By.name("photo"), contactData.getFile()); if (create) { try { new Select(wd.findElement(By.name("new_group"))).selectByVisibleText(contactData.getGroup()); }catch (NoSuchElementException e) { System.out.println("Обработано исключение, что нет указанной группы в модели"); } } else { Assert.assertFalse(isElementPresent(By.name("new_group"))); } } public void submitContactCreation() { click(By.name("submit")); } public void initContactCreation() { click(By.linkText("add new")); } public void initContactModification(int numberOfContact) { click(By.xpath("//tr["+(numberOfContact+2)+"]/td[8]/a/img")); } public void modify(ContactData contact) { initContactModificationById(contact.getId()); fillContactForm(contact, false); submitContactModification(); contactCash = null; returnToHomePage(); } private void initContactModificationById(int id) { click(By.xpath("//input[@id='"+id+"']/../../td[8]/a")); } public void submitContactModification() { click(By.name("update")); } public void selectContact(int numberOfContact) { wd.findElements(By.name("selected[]")).get(numberOfContact).click(); } public void deleteContact() { click(By.xpath("//input[@value=\"Delete\"]")); } public void delete(int index) { selectContact(index); deleteContact(); acceptContactDeletion(); returnToHomePage(); } public void acceptContactDeletion() { wd.switchTo().alert().accept(); } public boolean thereAreContact() { if (isElementPresent(By.xpath("//tr[2]/td[8]/a/img"))) { return true; }else { return false; } } public void create(ContactData contact) { initContactCreation(); fillContactForm(contact, true); submitContactCreation(); contactCash = null; returnToHomePage(); } public void returnToHomePage() { click(By.linkText("home")); } public List<ContactData> list() { List <WebElement> elements = wd.findElements(By.name("entry")); List<ContactData> contacts = new ArrayList<ContactData>(); for (WebElement element: elements) { contacts.add(new ContactData() .withId(Integer.parseInt(element.findElement(By.name("selected[]")).getAttribute("id"))) .withFirstName(element.findElement(By.xpath("td[3]")).getText()) .withLastName(element.findElement(By.xpath("td[2]")).getText()) .withAddress(element.findElement(By.xpath("td[4]")).getText()) .withEmailAddresses(element.findElement(By.xpath("td[5]")).getText()) .withAllPhones(element.findElement(By.xpath("td[6]")).getText())); } return contacts; } private Contacts contactCash = null; public Contacts all() { if (contactCash != null) { return new Contacts(contactCash); } List <WebElement> elements = wd.findElements(By.name("entry")); contactCash = new Contacts(); for (WebElement element: elements) { contactCash.add(new ContactData() .withId(Integer.parseInt(element.findElement(By.name("selected[]")).getAttribute("id"))) .withFirstName(element.findElement(By.xpath("td[3]")).getText()) .withLastName(element.findElement(By.xpath("td[2]")).getText()) .withAddress(element.findElement(By.xpath("td[4]")).getText()) .withEmailAddresses(element.findElement(By.xpath("td[5]")).getText()) .withAllPhones(element.findElement(By.xpath("td[6]")).getText())); } return new Contacts(contactCash); } public void delete(ContactData deleteContact) { selectContactById(deleteContact.getId()); deleteContact(); acceptContactDeletion(); contactCash = null; returnToHomePage(); } private void selectContactById(int id) { wd.findElement(By.xpath("//input[@id='"+id+"']")).click(); } public int getContactCount() { return wd.findElements(By.name("selected[]")).size(); } public String getAddressCP() { return wd.findElement(By.name("address")).getText(); } public String getEmailAddressesCP() { return wd.findElement(By.name("email")).getAttribute("value")+"\n"+ wd.findElement(By.name("email2")).getAttribute("value")+"\n"+ wd.findElement(By.name("email3")).getAttribute("value"); } public String getAllPhonesCP() { String home = wd.findElement(By.name("home")).getAttribute("value"); String mobile = wd.findElement(By.name("mobile")).getAttribute("value"); String work = wd.findElement(By.name("work")).getAttribute("value"); return Arrays.asList(home,mobile,work) .stream().filter(s->!s.equals("")).collect(Collectors.joining("\n")); } }
UTF-8
Java
6,323
java
ContactHelper.java
Java
[]
null
[]
package ru.stqa.pft.addressbook.appmanager; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; import org.testng.Assert; import ru.stqa.pft.addressbook.model.ContactData; import ru.stqa.pft.addressbook.model.Contacts; import ru.stqa.pft.addressbook.model.GroupData; import java.util.*; import java.util.stream.Collectors; public class ContactHelper extends HelperBase { public ContactHelper (WebDriver wd) { super(wd); } public void fillContactForm(ContactData contactData, boolean create) { type(By.name("firstname"), contactData.getFirstName()); type(By.name("middlename"), contactData.getMiddleName()); type(By.name("lastname"), contactData.getLastName()); type(By.name("nickname"), contactData.getNickName()); type(By.name("company"), contactData.getCompany()); attach(By.name("photo"), contactData.getFile()); if (create) { try { new Select(wd.findElement(By.name("new_group"))).selectByVisibleText(contactData.getGroup()); }catch (NoSuchElementException e) { System.out.println("Обработано исключение, что нет указанной группы в модели"); } } else { Assert.assertFalse(isElementPresent(By.name("new_group"))); } } public void submitContactCreation() { click(By.name("submit")); } public void initContactCreation() { click(By.linkText("add new")); } public void initContactModification(int numberOfContact) { click(By.xpath("//tr["+(numberOfContact+2)+"]/td[8]/a/img")); } public void modify(ContactData contact) { initContactModificationById(contact.getId()); fillContactForm(contact, false); submitContactModification(); contactCash = null; returnToHomePage(); } private void initContactModificationById(int id) { click(By.xpath("//input[@id='"+id+"']/../../td[8]/a")); } public void submitContactModification() { click(By.name("update")); } public void selectContact(int numberOfContact) { wd.findElements(By.name("selected[]")).get(numberOfContact).click(); } public void deleteContact() { click(By.xpath("//input[@value=\"Delete\"]")); } public void delete(int index) { selectContact(index); deleteContact(); acceptContactDeletion(); returnToHomePage(); } public void acceptContactDeletion() { wd.switchTo().alert().accept(); } public boolean thereAreContact() { if (isElementPresent(By.xpath("//tr[2]/td[8]/a/img"))) { return true; }else { return false; } } public void create(ContactData contact) { initContactCreation(); fillContactForm(contact, true); submitContactCreation(); contactCash = null; returnToHomePage(); } public void returnToHomePage() { click(By.linkText("home")); } public List<ContactData> list() { List <WebElement> elements = wd.findElements(By.name("entry")); List<ContactData> contacts = new ArrayList<ContactData>(); for (WebElement element: elements) { contacts.add(new ContactData() .withId(Integer.parseInt(element.findElement(By.name("selected[]")).getAttribute("id"))) .withFirstName(element.findElement(By.xpath("td[3]")).getText()) .withLastName(element.findElement(By.xpath("td[2]")).getText()) .withAddress(element.findElement(By.xpath("td[4]")).getText()) .withEmailAddresses(element.findElement(By.xpath("td[5]")).getText()) .withAllPhones(element.findElement(By.xpath("td[6]")).getText())); } return contacts; } private Contacts contactCash = null; public Contacts all() { if (contactCash != null) { return new Contacts(contactCash); } List <WebElement> elements = wd.findElements(By.name("entry")); contactCash = new Contacts(); for (WebElement element: elements) { contactCash.add(new ContactData() .withId(Integer.parseInt(element.findElement(By.name("selected[]")).getAttribute("id"))) .withFirstName(element.findElement(By.xpath("td[3]")).getText()) .withLastName(element.findElement(By.xpath("td[2]")).getText()) .withAddress(element.findElement(By.xpath("td[4]")).getText()) .withEmailAddresses(element.findElement(By.xpath("td[5]")).getText()) .withAllPhones(element.findElement(By.xpath("td[6]")).getText())); } return new Contacts(contactCash); } public void delete(ContactData deleteContact) { selectContactById(deleteContact.getId()); deleteContact(); acceptContactDeletion(); contactCash = null; returnToHomePage(); } private void selectContactById(int id) { wd.findElement(By.xpath("//input[@id='"+id+"']")).click(); } public int getContactCount() { return wd.findElements(By.name("selected[]")).size(); } public String getAddressCP() { return wd.findElement(By.name("address")).getText(); } public String getEmailAddressesCP() { return wd.findElement(By.name("email")).getAttribute("value")+"\n"+ wd.findElement(By.name("email2")).getAttribute("value")+"\n"+ wd.findElement(By.name("email3")).getAttribute("value"); } public String getAllPhonesCP() { String home = wd.findElement(By.name("home")).getAttribute("value"); String mobile = wd.findElement(By.name("mobile")).getAttribute("value"); String work = wd.findElement(By.name("work")).getAttribute("value"); return Arrays.asList(home,mobile,work) .stream().filter(s->!s.equals("")).collect(Collectors.joining("\n")); } }
6,323
0.614821
0.612112
177
34.451977
28.389328
109
false
false
0
0
0
0
0
0
0.468927
false
false
7
9ce2c7f96ddbd4c9b4a167b739704fa6219c7ae2
2,121,713,868,839
9bb72702c90774967325a9f02e33107a3f8afe35
/src/com/company/Solution_Math.java
e2360e52918675dafb3e7dbb32f3b3f87a70e525
[]
no_license
jingshuaijiang/Leetcode_Solution
https://github.com/jingshuaijiang/Leetcode_Solution
e799e761586de0aa51e06c90c829c1b355ed4643
e304657c67d45d8de4bbee1e5413041fab743744
refs/heads/master
2021-03-01T04:01:04.704000
2021-02-20T02:45:53
2021-02-20T02:45:53
245,751,964
1
0
null
false
2021-02-20T02:45:53
2020-03-08T04:31:17
2021-02-06T22:10:28
2021-02-20T02:45:53
281
1
0
0
Java
false
false
package com.company; import java.util.*; import java.math.BigInteger; public class Solution_Math { public boolean isUgly(int num) { while (num>0){ if(num == 1||num == 2 || num == 3 || num == 5){ return true; }else if (num%2 == 0){ num/=2; }else if(num%3 == 0){ num/=3; }else if(num%5 == 0){ num/=5; }else{ return false; } } return false; } public double Num1344angleClock(int hour, int minutes) { double minhand = (minutes - 0.0) / 60 * 360; double hourhand = (hour * 30.0 + minutes / 60.0 * 30) % 360; return Math.min(Math.abs(minhand - hourhand), 360 - Math.abs(minhand - hourhand)); } public int Num829consecutiveNumbersSum(int N) { int res = 1; for (int i = 2; i < Math.sqrt(2 * N); ++i) { if ((N - i * (i - 1) / 2) % i == 0) ++res; } return res; } public int Num258addDigits(int num) { if(num==0) return 0; if(num%9==0) return 9; return num%9; } public String Num67addBinary(String a, String b) { BigInteger x = new BigInteger(a,2); BigInteger y = new BigInteger(b,2); BigInteger zero = new BigInteger("0",2); BigInteger ans,carry; while(y.compareTo(zero)!=0) { ans = x.xor(y); carry = x.and(y).shiftLeft(1); x = ans; y = carry; } return x.toString(2); } public int Num7reverse(int x) { int ans = 0; while(x!=0) { int left = x%10; x/=10; if(ans>Integer.MAX_VALUE/10||(ans==Integer.MAX_VALUE/10&&left>7)) return 0; if(ans<Integer.MIN_VALUE/10||(ans==Integer.MIN_VALUE/10&&left<-8)) return 0; ans = ans*10+left; } return ans; } public int compareVersion(String version1, String version2) { int n = version1.length(), m = version2.length(); int i = 0; int j = 0; while (i < n || j < m) { // 用v1,v2来计算每一个块中版本号的大小 int v1 = 0; int v2 = 0; // 若当前的字符不是分隔符,则计算 while (i < n && version1.charAt(i) != '.') { v1 = v1 * 10 + version1.charAt(i) - '0'; i++; } while (j < m && version2.charAt(j) != '.') { v2 = v2 * 10 + version2.charAt(j) - '0'; j++; } // 判断当前块中的版本号是否一致 if (v1 != v2) { if (v1 > v2) { return 1; } return -1; } // 跳过分隔符 i++; j++; } // 全部比较完了,没有不等的则返回0 return 0; } public int Num8myAtoi(String s) { int ans = 0; int index = 0; boolean neg = false; int n = s.length(); while(index<n&&s.charAt(index)==' ') index++; if(index==n) return ans; if(s.charAt(index)=='-') { neg = true; index++; } else if(s.charAt(index)=='+') { index++; } while(index<n&&Character.isDigit(s.charAt(index))) { int current = s.charAt(index)-'0'; if(neg) { if(ans>Integer.MAX_VALUE/10||(ans==Integer.MAX_VALUE/10&&current>8)) return Integer.MIN_VALUE; else ans = ans*10+current; } else { if(ans>Integer.MAX_VALUE/10||(ans==Integer.MAX_VALUE/10&&current>7)) return Integer.MAX_VALUE; else ans = ans*10+current; } index++; } return neg?-ans:ans; } public int Num204countPrimes(int n) { boolean[] isPrime = new boolean[n]; Arrays.fill(isPrime,true); for(int i=2;i*i<n;i++) { if(!isPrime[i]) continue; for(int j = i*i;j<n;j++) { isPrime[j] = false; } } int count = 0; for(int i=2;i<n;i++) { if(isPrime[i]) count++; } return count; } public int Num69mySqrt(int x) { if(x<2) return x; long num; int mid,left = 2,right = x/2; while(left<=right) { mid = left + (right-left)/2; num = (long)mid * mid; if(num>x) right = mid - 1; else if(num<x) left = mid + 1; else return mid; } return right; } public double Num50myPow(double x, int n) { if(n==0) return 1; double half = Num50myPow(x,n/2); if(n%2==0) return half*half; else return half*half*x; } public String Num43multiply(String num1, String num2) { if(num1.equals("0")||num2.equals("0")) return "0"; int n = num1.length(); int m = num2.length(); int[] sum = new int[m+n+1]; for(int i=m-1;i>=0;i--) { int multi_carrieer = 0; int start = n+1+i; int add_carrier = 0; int single_mul = num2.charAt(i)-'0'; for(int j=n-1;j>=0;j--) { int num1_num = num1.charAt(j)-'0'; int digit = 0; int p = single_mul*num1_num+multi_carrieer; if(p>=10) { multi_carrieer = p/10; digit = p%10; } else { digit = p; multi_carrieer = 0; } int sum_current = sum[start]+digit+add_carrier; if(sum_current>=10) { sum[start] = sum_current%10; add_carrier = sum_current/10; } else { sum[start] = sum_current; add_carrier = 0; } start--; } while(add_carrier!=0||multi_carrieer!=0) { int cur = add_carrier+multi_carrieer+sum[start]; if(cur>=10) { add_carrier = cur/=10; sum[start] = cur%10; start--; } else { sum[start] = cur; add_carrier=0; multi_carrieer=0; break; } } } int index = 0; while(sum[index]==0) index++; StringBuilder sb = new StringBuilder(); for(int i=index;i<=m+n;i++) { sb.append(sum[i]); } return sb.toString(); } public int Num29divide(int dividend, int divisor) { if(dividend==Integer.MIN_VALUE&&divisor==-1) return Integer.MAX_VALUE; int a = Math.abs(dividend); int b = Math.abs(divisor); int res = 0; while(a-b>0) { int x = 0; while((a-(b<<1<<x)>=0)) x++; res+=1<<x; a-=b<<x; } return res; } public boolean Num365canMeasureWater(int x, int y, int z) { if (x + y < z) { return false; } if (x == 0 || y == 0) { return z == 0 || x + y == z; } return z % gcd(x, y) == 0; } public int gcd(int x, int y) { int remainder = x % y; while (remainder != 0) { x = y; y = remainder; remainder = x % y; } return y; } public List<List<Integer>> Num18fourSum(int[] nums, int target) { List<List<Integer>> ans = new LinkedList<>(); List<Integer> current = new LinkedList<>(); Arrays.sort(nums); Num18ksumhelper(nums,target,0,4,ans,current); return ans; } public void Num18ksumhelper(int[] nums, int target, int start, int k, List<List<Integer>> ans, List<Integer> current) { if(start==nums.length&&k!=0) return; if(k==2) { Num18twosum(nums,target,start,ans,current); return; } for(int i=start;i<nums.length;i++) { if(i==start||nums[i]!=nums[i-1]) { current.add(nums[i]); Num18ksumhelper(nums,target-nums[i],i+1,k-1,ans,current); current.remove(current.size()-1); } } } public void Num18twosum(int[] nums, int target, int start, List<List<Integer>> ans, List<Integer> current) { if(start>=nums.length-1) return; int left = start,right = nums.length-1; while(left<=right) { if(nums[left]+nums[right]==target) { current.add(nums[left]); current.add(nums[right]); ans.add(new LinkedList<>(current)); current.remove(current.size()-1); current.remove(current.size()-1); } else if(nums[left]+nums[right]>target) { right--; } else { left++; } } return; } }
UTF-8
Java
9,965
java
Solution_Math.java
Java
[]
null
[]
package com.company; import java.util.*; import java.math.BigInteger; public class Solution_Math { public boolean isUgly(int num) { while (num>0){ if(num == 1||num == 2 || num == 3 || num == 5){ return true; }else if (num%2 == 0){ num/=2; }else if(num%3 == 0){ num/=3; }else if(num%5 == 0){ num/=5; }else{ return false; } } return false; } public double Num1344angleClock(int hour, int minutes) { double minhand = (minutes - 0.0) / 60 * 360; double hourhand = (hour * 30.0 + minutes / 60.0 * 30) % 360; return Math.min(Math.abs(minhand - hourhand), 360 - Math.abs(minhand - hourhand)); } public int Num829consecutiveNumbersSum(int N) { int res = 1; for (int i = 2; i < Math.sqrt(2 * N); ++i) { if ((N - i * (i - 1) / 2) % i == 0) ++res; } return res; } public int Num258addDigits(int num) { if(num==0) return 0; if(num%9==0) return 9; return num%9; } public String Num67addBinary(String a, String b) { BigInteger x = new BigInteger(a,2); BigInteger y = new BigInteger(b,2); BigInteger zero = new BigInteger("0",2); BigInteger ans,carry; while(y.compareTo(zero)!=0) { ans = x.xor(y); carry = x.and(y).shiftLeft(1); x = ans; y = carry; } return x.toString(2); } public int Num7reverse(int x) { int ans = 0; while(x!=0) { int left = x%10; x/=10; if(ans>Integer.MAX_VALUE/10||(ans==Integer.MAX_VALUE/10&&left>7)) return 0; if(ans<Integer.MIN_VALUE/10||(ans==Integer.MIN_VALUE/10&&left<-8)) return 0; ans = ans*10+left; } return ans; } public int compareVersion(String version1, String version2) { int n = version1.length(), m = version2.length(); int i = 0; int j = 0; while (i < n || j < m) { // 用v1,v2来计算每一个块中版本号的大小 int v1 = 0; int v2 = 0; // 若当前的字符不是分隔符,则计算 while (i < n && version1.charAt(i) != '.') { v1 = v1 * 10 + version1.charAt(i) - '0'; i++; } while (j < m && version2.charAt(j) != '.') { v2 = v2 * 10 + version2.charAt(j) - '0'; j++; } // 判断当前块中的版本号是否一致 if (v1 != v2) { if (v1 > v2) { return 1; } return -1; } // 跳过分隔符 i++; j++; } // 全部比较完了,没有不等的则返回0 return 0; } public int Num8myAtoi(String s) { int ans = 0; int index = 0; boolean neg = false; int n = s.length(); while(index<n&&s.charAt(index)==' ') index++; if(index==n) return ans; if(s.charAt(index)=='-') { neg = true; index++; } else if(s.charAt(index)=='+') { index++; } while(index<n&&Character.isDigit(s.charAt(index))) { int current = s.charAt(index)-'0'; if(neg) { if(ans>Integer.MAX_VALUE/10||(ans==Integer.MAX_VALUE/10&&current>8)) return Integer.MIN_VALUE; else ans = ans*10+current; } else { if(ans>Integer.MAX_VALUE/10||(ans==Integer.MAX_VALUE/10&&current>7)) return Integer.MAX_VALUE; else ans = ans*10+current; } index++; } return neg?-ans:ans; } public int Num204countPrimes(int n) { boolean[] isPrime = new boolean[n]; Arrays.fill(isPrime,true); for(int i=2;i*i<n;i++) { if(!isPrime[i]) continue; for(int j = i*i;j<n;j++) { isPrime[j] = false; } } int count = 0; for(int i=2;i<n;i++) { if(isPrime[i]) count++; } return count; } public int Num69mySqrt(int x) { if(x<2) return x; long num; int mid,left = 2,right = x/2; while(left<=right) { mid = left + (right-left)/2; num = (long)mid * mid; if(num>x) right = mid - 1; else if(num<x) left = mid + 1; else return mid; } return right; } public double Num50myPow(double x, int n) { if(n==0) return 1; double half = Num50myPow(x,n/2); if(n%2==0) return half*half; else return half*half*x; } public String Num43multiply(String num1, String num2) { if(num1.equals("0")||num2.equals("0")) return "0"; int n = num1.length(); int m = num2.length(); int[] sum = new int[m+n+1]; for(int i=m-1;i>=0;i--) { int multi_carrieer = 0; int start = n+1+i; int add_carrier = 0; int single_mul = num2.charAt(i)-'0'; for(int j=n-1;j>=0;j--) { int num1_num = num1.charAt(j)-'0'; int digit = 0; int p = single_mul*num1_num+multi_carrieer; if(p>=10) { multi_carrieer = p/10; digit = p%10; } else { digit = p; multi_carrieer = 0; } int sum_current = sum[start]+digit+add_carrier; if(sum_current>=10) { sum[start] = sum_current%10; add_carrier = sum_current/10; } else { sum[start] = sum_current; add_carrier = 0; } start--; } while(add_carrier!=0||multi_carrieer!=0) { int cur = add_carrier+multi_carrieer+sum[start]; if(cur>=10) { add_carrier = cur/=10; sum[start] = cur%10; start--; } else { sum[start] = cur; add_carrier=0; multi_carrieer=0; break; } } } int index = 0; while(sum[index]==0) index++; StringBuilder sb = new StringBuilder(); for(int i=index;i<=m+n;i++) { sb.append(sum[i]); } return sb.toString(); } public int Num29divide(int dividend, int divisor) { if(dividend==Integer.MIN_VALUE&&divisor==-1) return Integer.MAX_VALUE; int a = Math.abs(dividend); int b = Math.abs(divisor); int res = 0; while(a-b>0) { int x = 0; while((a-(b<<1<<x)>=0)) x++; res+=1<<x; a-=b<<x; } return res; } public boolean Num365canMeasureWater(int x, int y, int z) { if (x + y < z) { return false; } if (x == 0 || y == 0) { return z == 0 || x + y == z; } return z % gcd(x, y) == 0; } public int gcd(int x, int y) { int remainder = x % y; while (remainder != 0) { x = y; y = remainder; remainder = x % y; } return y; } public List<List<Integer>> Num18fourSum(int[] nums, int target) { List<List<Integer>> ans = new LinkedList<>(); List<Integer> current = new LinkedList<>(); Arrays.sort(nums); Num18ksumhelper(nums,target,0,4,ans,current); return ans; } public void Num18ksumhelper(int[] nums, int target, int start, int k, List<List<Integer>> ans, List<Integer> current) { if(start==nums.length&&k!=0) return; if(k==2) { Num18twosum(nums,target,start,ans,current); return; } for(int i=start;i<nums.length;i++) { if(i==start||nums[i]!=nums[i-1]) { current.add(nums[i]); Num18ksumhelper(nums,target-nums[i],i+1,k-1,ans,current); current.remove(current.size()-1); } } } public void Num18twosum(int[] nums, int target, int start, List<List<Integer>> ans, List<Integer> current) { if(start>=nums.length-1) return; int left = start,right = nums.length-1; while(left<=right) { if(nums[left]+nums[right]==target) { current.add(nums[left]); current.add(nums[right]); ans.add(new LinkedList<>(current)); current.remove(current.size()-1); current.remove(current.size()-1); } else if(nums[left]+nums[right]>target) { right--; } else { left++; } } return; } }
9,965
0.402968
0.377046
409
23.051344
19.252277
121
false
false
0
0
0
0
0
0
0.596577
false
false
7
1afc10798d03a6a50665a2587bd0ad87503c8343
3,925,600,115,881
77c0f49782a1e1d847b6e63fa87840b84d572d73
/src/animals/com/XMLUnmarshaller.java
c32e3a029c340b6fd0ed6509681e604c47da59ae
[]
no_license
osama82/Ikea-test
https://github.com/osama82/Ikea-test
b914c2033a21551285fb985e0f71d909d8b209d4
e053e59e73a97cd2af264911a31b672b639413d2
refs/heads/master
2021-09-06T09:46:16.890000
2018-02-05T05:28:17
2018-02-05T05:28:17
119,193,985
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package animals.com; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import java.io.File; import java.util.List; /** * @author osama * @Project Ikea test * class to convert from XML file into list of Animals */ public class XMLUnmarshaller { public List<Animal> unmarshalFromXML(String xmlFile){ File file =new File(xmlFile); ListAnimals animals=new ListAnimals(); try { JAXBContext context =JAXBContext.newInstance(ListAnimals.class); Unmarshaller unmarshaller=context.createUnmarshaller(); animals=(ListAnimals) unmarshaller.unmarshal(file); System.out.println("printing after unmarshalling"); for (Animal p : animals.getAnimalslist()){ System.out.println(p.toString()); } } catch (JAXBException e) { e.printStackTrace(); } return animals.getAnimalslist(); } }
UTF-8
Java
997
java
XMLUnmarshaller.java
Java
[ { "context": "va.io.File;\nimport java.util.List;\n\n/**\n * @author osama\n * @Project Ikea test\n * class to convert from XM", "end": 195, "score": 0.9994633197784424, "start": 190, "tag": "USERNAME", "value": "osama" } ]
null
[]
package animals.com; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import java.io.File; import java.util.List; /** * @author osama * @Project Ikea test * class to convert from XML file into list of Animals */ public class XMLUnmarshaller { public List<Animal> unmarshalFromXML(String xmlFile){ File file =new File(xmlFile); ListAnimals animals=new ListAnimals(); try { JAXBContext context =JAXBContext.newInstance(ListAnimals.class); Unmarshaller unmarshaller=context.createUnmarshaller(); animals=(ListAnimals) unmarshaller.unmarshal(file); System.out.println("printing after unmarshalling"); for (Animal p : animals.getAnimalslist()){ System.out.println(p.toString()); } } catch (JAXBException e) { e.printStackTrace(); } return animals.getAnimalslist(); } }
997
0.646941
0.646941
39
24.487179
23.083874
76
false
false
0
0
0
0
0
0
0.384615
false
false
7
f028e1cf02e7d361f0845df7f2c36497c4f63969
24,206,435,693,399
26a5c1e67226702a098cf70afed546e15e6b2939
/test/state/TestOutOfAmmoState.java
56de1dadc011c04139bc6e2e7c264b0a83bc8ae5
[]
no_license
emmdouge/DemonsVsHumans
https://github.com/emmdouge/DemonsVsHumans
3f00365d61cb149fa97f3bb70e6a28b54886480a
908a6e1fe43c1ab0dd83d4270c2b32ec2f462d6e
refs/heads/master
2021-01-13T10:18:00.187000
2016-10-02T17:27:44
2016-10-02T17:27:44
69,478,187
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package state; import static org.junit.Assert.*; import environment.Environment; import exceptions.RecoveryRateException; import exceptions.WeaponException; import gameplay.SimpleTimer; import gameplay.Simulator; import org.junit.Test; import weapon.Pistol; import weapon.Weapon; /** * @author Emmanuel *Tests the outOfAmmoState with a simpleTimer */ public class TestOutOfAmmoState { /** * @throws RecoveryRateException The recovery rate must be at least 0 * @throws InterruptedException Ammo cannot be negative * @throws WeaponException Distance cannot be negative */ @Test public void testOutOfAmmoState() throws RecoveryRateException, InterruptedException, WeaponException { Environment env = Environment.getInstance(5,5); env.clearBoard(); SimpleTimer st = new SimpleTimer(1000); Simulator sim = new Simulator(0, 1); Weapon p = new Pistol(); sim.getLifeform(0).setWeapon(p); p.fire(5); p.fire(5); st.addTimeObserver(sim); st.start(); Thread.sleep(250); int x = 0; assertEquals(x,st.getRound()); // beginning of round 0 assertEquals(100, sim.getLifeform(0).getCurrentLifePoints()); assertEquals(8, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 0 x++; assertEquals(x,st.getRound()); // beginning of round 1 p.fire(5); p.fire(5); assertEquals(100, sim.getLifeform(0).getCurrentLifePoints()); assertEquals(6, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 1 x++; assertEquals(x,st.getRound()); // beginning of round 2 p.fire(5); p.fire(5); assertEquals(4, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 2 x++; assertEquals(x,st.getRound()); // beginning of round 3 p.fire(5); p.fire(5); assertEquals(2, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 3 x++; assertEquals(x,st.getRound()); // beginning of round 4 p.fire(5); p.fire(5); assertEquals(0, sim.getLifeform(0).getWeapon().getCurrentAmmo()); //start from OutOfAmmoState sim.getAI(0).setCurrentState(sim.getAI(0).getOutOfAmmoState()); Thread.sleep(1000); // end of round 4 x++; assertEquals(x,st.getRound()); // beginning of round 5 //makes sure it updates properly and reloads assertEquals(10, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 5 x++; } }
UTF-8
Java
2,456
java
TestOutOfAmmoState.java
Java
[ { "context": "apon.Pistol;\nimport weapon.Weapon;\n\n/**\n * @author Emmanuel\n *Tests the outOfAmmoState with a simpleTimer\n */", "end": 308, "score": 0.9997391700744629, "start": 300, "tag": "NAME", "value": "Emmanuel" } ]
null
[]
package state; import static org.junit.Assert.*; import environment.Environment; import exceptions.RecoveryRateException; import exceptions.WeaponException; import gameplay.SimpleTimer; import gameplay.Simulator; import org.junit.Test; import weapon.Pistol; import weapon.Weapon; /** * @author Emmanuel *Tests the outOfAmmoState with a simpleTimer */ public class TestOutOfAmmoState { /** * @throws RecoveryRateException The recovery rate must be at least 0 * @throws InterruptedException Ammo cannot be negative * @throws WeaponException Distance cannot be negative */ @Test public void testOutOfAmmoState() throws RecoveryRateException, InterruptedException, WeaponException { Environment env = Environment.getInstance(5,5); env.clearBoard(); SimpleTimer st = new SimpleTimer(1000); Simulator sim = new Simulator(0, 1); Weapon p = new Pistol(); sim.getLifeform(0).setWeapon(p); p.fire(5); p.fire(5); st.addTimeObserver(sim); st.start(); Thread.sleep(250); int x = 0; assertEquals(x,st.getRound()); // beginning of round 0 assertEquals(100, sim.getLifeform(0).getCurrentLifePoints()); assertEquals(8, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 0 x++; assertEquals(x,st.getRound()); // beginning of round 1 p.fire(5); p.fire(5); assertEquals(100, sim.getLifeform(0).getCurrentLifePoints()); assertEquals(6, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 1 x++; assertEquals(x,st.getRound()); // beginning of round 2 p.fire(5); p.fire(5); assertEquals(4, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 2 x++; assertEquals(x,st.getRound()); // beginning of round 3 p.fire(5); p.fire(5); assertEquals(2, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 3 x++; assertEquals(x,st.getRound()); // beginning of round 4 p.fire(5); p.fire(5); assertEquals(0, sim.getLifeform(0).getWeapon().getCurrentAmmo()); //start from OutOfAmmoState sim.getAI(0).setCurrentState(sim.getAI(0).getOutOfAmmoState()); Thread.sleep(1000); // end of round 4 x++; assertEquals(x,st.getRound()); // beginning of round 5 //makes sure it updates properly and reloads assertEquals(10, sim.getLifeform(0).getWeapon().getCurrentAmmo()); Thread.sleep(1000); // end of round 5 x++; } }
2,456
0.704805
0.67101
90
26.288889
23.990852
103
false
false
0
0
0
0
0
0
2.222222
false
false
7
974e1b27523bab96471c31feb8d78332ff9c74b5
32,839,320,011,570
b686530d3484ae6ccf4b092bd597704aba1095ea
/ssm-permission/src/main/java/com/beautifulsoup/permission/dao/PerAclMapper.java
4b27c44ec17f2b2120891e428b322a1203004427
[ "Apache-2.0" ]
permissive
chenglinjava68/RBAC-Permission
https://github.com/chenglinjava68/RBAC-Permission
084a5f52e1e274d6a8b60d02a91eb962e02396d0
44acb77523a1cdbdb7a3f45b794fbe476c1d4ad2
refs/heads/master
2020-05-05T11:11:09.418000
2019-01-31T13:42:48
2019-01-31T13:42:48
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.beautifulsoup.permission.dao; import com.beautifulsoup.permission.dataobject.PerAcl; import com.beautifulsoup.permission.dataobject.PerAclExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface PerAclMapper { int countByExample(PerAclExample example); int deleteByExample(PerAclExample example); int deleteByPrimaryKey(Integer id); int insert(PerAcl record); int insertSelective(PerAcl record); List<PerAcl> selectByExample(PerAclExample example); PerAcl selectByPrimaryKey(Integer id); int updateByExampleSelective(@Param("record") PerAcl record, @Param("example") PerAclExample example); int updateByExample(@Param("record") PerAcl record, @Param("example") PerAclExample example); int updateByPrimaryKeySelective(PerAcl record); int updateByPrimaryKey(PerAcl record); }
UTF-8
Java
877
java
PerAclMapper.java
Java
[]
null
[]
package com.beautifulsoup.permission.dao; import com.beautifulsoup.permission.dataobject.PerAcl; import com.beautifulsoup.permission.dataobject.PerAclExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface PerAclMapper { int countByExample(PerAclExample example); int deleteByExample(PerAclExample example); int deleteByPrimaryKey(Integer id); int insert(PerAcl record); int insertSelective(PerAcl record); List<PerAcl> selectByExample(PerAclExample example); PerAcl selectByPrimaryKey(Integer id); int updateByExampleSelective(@Param("record") PerAcl record, @Param("example") PerAclExample example); int updateByExample(@Param("record") PerAcl record, @Param("example") PerAclExample example); int updateByPrimaryKeySelective(PerAcl record); int updateByPrimaryKey(PerAcl record); }
877
0.781072
0.781072
30
28.266666
29.337046
106
false
false
0
0
0
0
0
0
0.6
false
false
7
ac796ab91cf5d83149e1f9d39947ecb89796a6f4
32,839,320,011,987
5289fe18f8ad711028ddbb0130204dbf22195d68
/src/main/java/com/usermodule/jwtutil/WebSecurityConfig.java
05090424c6ec53b0cf1926ed5767c0d85f2606c1
[]
no_license
ImranSheikh1997/usrmodulev1
https://github.com/ImranSheikh1997/usrmodulev1
aa85fb02b6260a55330b4b29dc29f556f87b159e
b9ed83c0d813ac3e2ab1c1132d0dcb1dc819f87e
refs/heads/master
2023-03-29T16:13:27.114000
2021-04-09T12:27:11
2021-04-09T12:27:11
350,947,703
0
0
null
false
2021-03-26T04:20:05
2021-03-24T04:40:36
2021-03-24T04:41:02
2021-03-26T04:20:05
96
0
0
0
Java
false
false
//This is Servlet Filter Like Config. //Filter Comes Before Authentication. it will Filter out requests before it goes to Authentication. package com.usermodule.jwtutil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private JwtTokenProvider jwtTokenProvider; @Autowired MyUserDetails myUserDetails; // @Autowired // private JwtTokenFilter jwtTokenFilter; @Autowired private PasswordEncoder passwordEncoder; @Autowired JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint; @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { // configure AuthenticationManager so that it knows from where to load // user for matching credentials // Use BCryptPasswordEncoder auth.userDetailsService(myUserDetails).passwordEncoder(passwordEncoder); } @Override protected void configure(HttpSecurity http) throws Exception { //Disable CSRF(Cross Site Request Forgery) http.csrf().disable(); http.cors().disable(); http.headers().frameOptions().sameOrigin().and().authorizeRequests(); //Entry Points (Allowing Requests) http.authorizeRequests() .antMatchers("/","/usermodule","/registration","/**").permitAll() .antMatchers("/","/usermodule","/registration","/checkemail","/**").permitAll() .antMatchers("/","/usermodule","/signin","/","**").permitAll() .antMatchers("/","/usermodule","/registration","/confirm/**").permitAll() .antMatchers("/","/registration","/country","/**").permitAll() .antMatchers("/","/registration","/state","/**").permitAll() .antMatchers("/","/registration","/city","/**").permitAll() .antMatchers("/","/v2","/api-docs").permitAll() .antMatchers("/","/swagger-resources/**").permitAll() .antMatchers("/","/swagger-ui.html").permitAll() .antMatchers("/","/configuration/**").permitAll() .antMatchers("/","/webjars/**").permitAll() .antMatchers("/","/public").permitAll() .antMatchers("/topic","/greetings").permitAll() .antMatchers("/hello").permitAll() .antMatchers("/home").permitAll() .antMatchers("/websocket","/blog","/**","/**","/websocket").permitAll() //Disallow everything else... .anyRequest().authenticated(); http.formLogin() .loginPage("/signin") .permitAll(); //No Session Will be Created or used by Spring Security http.exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint).and(). sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); //If User try to access resource without having enough permissions http.exceptionHandling().accessDeniedPage("/login"); // //Apply JWT //http.apply(new JwtTokenFilterConfigurer(jwtTokenProvider)); //if you want to test api from browser //http.addFilterBefore(jwtTokenFilter, UsernamePasswordAuthenticationFilter.class); } @Override public void configure(WebSecurity web) throws Exception { //Allowing swagger to access without authentication web.ignoring().antMatchers("/v2/api-docs")// .antMatchers("/swagger-resources/**")// .antMatchers("/swagger-ui.html")// .antMatchers("/configuration/**")// .antMatchers("/webjars/**")// .antMatchers("/public")// .antMatchers("usermodule/registration/**") .antMatchers("usermodule/login") .antMatchers("usermodule/signin") .antMatchers("usermodule/registration/confirm") .antMatchers("/topic","/greetings") .antMatchers("/hello") .antMatchers("/websocket/","**") .antMatchers("/websocket","/blog","/**","/**","/websocket") .and() .ignoring(); } // //TODO: for testing if it does not work then remove it // @Override // protected void configure(AuthenticationManagerBuilder auth) throws Exception { // auth.userDetailsService(myUserDetails); // } //To decrypt password with length 12 @Bean public PasswordEncoder passwordEncoder(){ return new BCryptPasswordEncoder(12); } @Override @Bean public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } }
UTF-8
Java
5,848
java
WebSecurityConfig.java
Java
[]
null
[]
//This is Servlet Filter Like Config. //Filter Comes Before Authentication. it will Filter out requests before it goes to Authentication. package com.usermodule.jwtutil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private JwtTokenProvider jwtTokenProvider; @Autowired MyUserDetails myUserDetails; // @Autowired // private JwtTokenFilter jwtTokenFilter; @Autowired private PasswordEncoder passwordEncoder; @Autowired JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint; @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { // configure AuthenticationManager so that it knows from where to load // user for matching credentials // Use BCryptPasswordEncoder auth.userDetailsService(myUserDetails).passwordEncoder(passwordEncoder); } @Override protected void configure(HttpSecurity http) throws Exception { //Disable CSRF(Cross Site Request Forgery) http.csrf().disable(); http.cors().disable(); http.headers().frameOptions().sameOrigin().and().authorizeRequests(); //Entry Points (Allowing Requests) http.authorizeRequests() .antMatchers("/","/usermodule","/registration","/**").permitAll() .antMatchers("/","/usermodule","/registration","/checkemail","/**").permitAll() .antMatchers("/","/usermodule","/signin","/","**").permitAll() .antMatchers("/","/usermodule","/registration","/confirm/**").permitAll() .antMatchers("/","/registration","/country","/**").permitAll() .antMatchers("/","/registration","/state","/**").permitAll() .antMatchers("/","/registration","/city","/**").permitAll() .antMatchers("/","/v2","/api-docs").permitAll() .antMatchers("/","/swagger-resources/**").permitAll() .antMatchers("/","/swagger-ui.html").permitAll() .antMatchers("/","/configuration/**").permitAll() .antMatchers("/","/webjars/**").permitAll() .antMatchers("/","/public").permitAll() .antMatchers("/topic","/greetings").permitAll() .antMatchers("/hello").permitAll() .antMatchers("/home").permitAll() .antMatchers("/websocket","/blog","/**","/**","/websocket").permitAll() //Disallow everything else... .anyRequest().authenticated(); http.formLogin() .loginPage("/signin") .permitAll(); //No Session Will be Created or used by Spring Security http.exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint).and(). sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); //If User try to access resource without having enough permissions http.exceptionHandling().accessDeniedPage("/login"); // //Apply JWT //http.apply(new JwtTokenFilterConfigurer(jwtTokenProvider)); //if you want to test api from browser //http.addFilterBefore(jwtTokenFilter, UsernamePasswordAuthenticationFilter.class); } @Override public void configure(WebSecurity web) throws Exception { //Allowing swagger to access without authentication web.ignoring().antMatchers("/v2/api-docs")// .antMatchers("/swagger-resources/**")// .antMatchers("/swagger-ui.html")// .antMatchers("/configuration/**")// .antMatchers("/webjars/**")// .antMatchers("/public")// .antMatchers("usermodule/registration/**") .antMatchers("usermodule/login") .antMatchers("usermodule/signin") .antMatchers("usermodule/registration/confirm") .antMatchers("/topic","/greetings") .antMatchers("/hello") .antMatchers("/websocket/","**") .antMatchers("/websocket","/blog","/**","/**","/websocket") .and() .ignoring(); } // //TODO: for testing if it does not work then remove it // @Override // protected void configure(AuthenticationManagerBuilder auth) throws Exception { // auth.userDetailsService(myUserDetails); // } //To decrypt password with length 12 @Bean public PasswordEncoder passwordEncoder(){ return new BCryptPasswordEncoder(12); } @Override @Bean public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } }
5,848
0.662791
0.661765
136
41.963234
30.7096
107
false
false
0
0
0
0
0
0
0.551471
false
false
7
85c75476911c61ecf1a8e8098903e005fd481613
38,998,303,064,751
80758bd96ae79e29b8ca43950765ba041d279377
/src/main/java/io/github/vampirestudios/raa/generation/feature/tree/DoubleTreeFeature.java
e81d39e0338ecc1541c090a419c9a1093cb77389
[ "MIT" ]
permissive
vampire-studios/Randomly-Adding-Anything
https://github.com/vampire-studios/Randomly-Adding-Anything
67f89034a91e9bc2f5653dc09d822dba53eef9c5
f40f07ab9569c5e3aa6b16b50533cea94e2ad80e
refs/heads/dev/1.15
2021-07-08T13:09:53.658000
2020-06-10T13:33:39
2020-06-10T13:33:39
206,352,270
49
25
MIT
false
2020-06-25T21:04:51
2019-09-04T15:29:31
2020-06-24T18:33:19
2020-06-25T21:04:50
6,349
37
17
3
Java
false
false
package io.github.vampirestudios.raa.generation.feature.tree; import com.mojang.datafixers.Dynamic; import io.github.vampirestudios.raa.utils.Rands; import net.minecraft.util.math.BlockBox; import net.minecraft.util.math.BlockPos; import net.minecraft.world.ModifiableTestableWorld; import net.minecraft.world.gen.feature.BranchedTreeFeature; import net.minecraft.world.gen.feature.BranchedTreeFeatureConfig; import java.util.Optional; import java.util.Random; import java.util.Set; import java.util.function.Function; public class DoubleTreeFeature extends BranchedTreeFeature<BranchedTreeFeatureConfig> { public DoubleTreeFeature(Function<Dynamic<?>, ? extends BranchedTreeFeatureConfig> function) { super(function); } @Override protected boolean generate(ModifiableTestableWorld modifiableTestableWorld_1, Random random_1, BlockPos blockPos_1, Set<BlockPos> set_1, Set<BlockPos> set_2, BlockBox blockBox_1, BranchedTreeFeatureConfig branchedTreeFeatureConfig_1) { int int_1 = branchedTreeFeatureConfig_1.baseHeight + random_1.nextInt(branchedTreeFeatureConfig_1.heightRandA + 1) + random_1.nextInt(branchedTreeFeatureConfig_1.heightRandB + 1); int int_2 = branchedTreeFeatureConfig_1.trunkHeight >= 0 ? branchedTreeFeatureConfig_1.trunkHeight + random_1.nextInt(branchedTreeFeatureConfig_1.trunkHeightRandom + 1) : int_1 - (branchedTreeFeatureConfig_1.foliageHeight + random_1.nextInt(branchedTreeFeatureConfig_1.foliageHeightRandom + 1)); int int_3 = branchedTreeFeatureConfig_1.foliagePlacer.getRadius(random_1, int_2, int_1, branchedTreeFeatureConfig_1); Optional<BlockPos> optional_1 = this.findPositionToGenerate(modifiableTestableWorld_1, int_1, int_2, int_3, blockPos_1, branchedTreeFeatureConfig_1); if (!optional_1.isPresent()) { return false; } else { BlockPos blockPos_2 = optional_1.get(); this.setToDirt(modifiableTestableWorld_1, blockPos_2.down()); //stump this.generate(modifiableTestableWorld_1, random_1, 2, blockPos_2, 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); //side 1 int loopAmt = Rands.randIntRange(1, 4); int offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); int offsetX = -1; int offsetZ = -1; if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), set_2); } else { this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX * (i + 1), offsetTotal, offsetZ * (i + 1)), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); } offsetTotal += offset; } //side 2 loopAmt = Rands.randIntRange(1, 4); offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); int offsetX = 1; int offsetZ = 1; if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), set_2); } else { this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX * (i + 1), offsetTotal, offsetZ * (i + 1)), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); } offsetTotal += offset; } loopAmt = Rands.randIntRange(1, 4); offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); offsetTotal += offset; int offsetX = 1; int offsetZ = -1; this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX, offsetTotal, offsetZ), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * i, (offsetTotal), offsetZ * i), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(-offsetX * 2, (offset * 2) - 2, -offsetZ * 2), set_2); } } loopAmt = Rands.randIntRange(1, 4); offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); offsetTotal += offset; int offsetX = -1; int offsetZ = 1; this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX, offsetTotal, offsetZ), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * i, (offsetTotal), offsetZ * i), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(-offsetX * 2, (offset * 2) - 2, -offsetZ * 2), set_2); } } return true; } } }
UTF-8
Java
6,636
java
DoubleTreeFeature.java
Java
[ { "context": "package io.github.vampirestudios.raa.generation.feature.tree;\n\nimport com.mojang.d", "end": 32, "score": 0.5939317941665649, "start": 18, "tag": "USERNAME", "value": "vampirestudios" }, { "context": "t com.mojang.datafixers.Dynamic;\nimport io.github.vampirestudios.ra...
null
[]
package io.github.vampirestudios.raa.generation.feature.tree; import com.mojang.datafixers.Dynamic; import io.github.vampirestudios.raa.utils.Rands; import net.minecraft.util.math.BlockBox; import net.minecraft.util.math.BlockPos; import net.minecraft.world.ModifiableTestableWorld; import net.minecraft.world.gen.feature.BranchedTreeFeature; import net.minecraft.world.gen.feature.BranchedTreeFeatureConfig; import java.util.Optional; import java.util.Random; import java.util.Set; import java.util.function.Function; public class DoubleTreeFeature extends BranchedTreeFeature<BranchedTreeFeatureConfig> { public DoubleTreeFeature(Function<Dynamic<?>, ? extends BranchedTreeFeatureConfig> function) { super(function); } @Override protected boolean generate(ModifiableTestableWorld modifiableTestableWorld_1, Random random_1, BlockPos blockPos_1, Set<BlockPos> set_1, Set<BlockPos> set_2, BlockBox blockBox_1, BranchedTreeFeatureConfig branchedTreeFeatureConfig_1) { int int_1 = branchedTreeFeatureConfig_1.baseHeight + random_1.nextInt(branchedTreeFeatureConfig_1.heightRandA + 1) + random_1.nextInt(branchedTreeFeatureConfig_1.heightRandB + 1); int int_2 = branchedTreeFeatureConfig_1.trunkHeight >= 0 ? branchedTreeFeatureConfig_1.trunkHeight + random_1.nextInt(branchedTreeFeatureConfig_1.trunkHeightRandom + 1) : int_1 - (branchedTreeFeatureConfig_1.foliageHeight + random_1.nextInt(branchedTreeFeatureConfig_1.foliageHeightRandom + 1)); int int_3 = branchedTreeFeatureConfig_1.foliagePlacer.getRadius(random_1, int_2, int_1, branchedTreeFeatureConfig_1); Optional<BlockPos> optional_1 = this.findPositionToGenerate(modifiableTestableWorld_1, int_1, int_2, int_3, blockPos_1, branchedTreeFeatureConfig_1); if (!optional_1.isPresent()) { return false; } else { BlockPos blockPos_2 = optional_1.get(); this.setToDirt(modifiableTestableWorld_1, blockPos_2.down()); //stump this.generate(modifiableTestableWorld_1, random_1, 2, blockPos_2, 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); //side 1 int loopAmt = Rands.randIntRange(1, 4); int offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); int offsetX = -1; int offsetZ = -1; if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), set_2); } else { this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX * (i + 1), offsetTotal, offsetZ * (i + 1)), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); } offsetTotal += offset; } //side 2 loopAmt = Rands.randIntRange(1, 4); offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); int offsetX = 1; int offsetZ = 1; if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(offsetX * (i + 1), (offsetTotal), offsetZ * (i + 1)), set_2); } else { this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX * (i + 1), offsetTotal, offsetZ * (i + 1)), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); } offsetTotal += offset; } loopAmt = Rands.randIntRange(1, 4); offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); offsetTotal += offset; int offsetX = 1; int offsetZ = -1; this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX, offsetTotal, offsetZ), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * i, (offsetTotal), offsetZ * i), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(-offsetX * 2, (offset * 2) - 2, -offsetZ * 2), set_2); } } loopAmt = Rands.randIntRange(1, 4); offsetTotal = 2; for (int i = 0; i < loopAmt; i++) { int offset = Rands.randIntRange(3, 6); offsetTotal += offset; int offsetX = -1; int offsetZ = 1; this.generate(modifiableTestableWorld_1, random_1, offset, blockPos_2.add(offsetX, offsetTotal, offsetZ), 0, set_1, blockBox_1, branchedTreeFeatureConfig_1); if (i == loopAmt - 1) { this.generate(modifiableTestableWorld_1, random_1, int_1, blockPos_2.add(offsetX * i, (offsetTotal), offsetZ * i), branchedTreeFeatureConfig_1.trunkTopOffsetRandom + random_1.nextInt(branchedTreeFeatureConfig_1.trunkTopOffsetRandom + 1), set_1, blockBox_1, branchedTreeFeatureConfig_1); branchedTreeFeatureConfig_1.foliagePlacer.generate(modifiableTestableWorld_1, random_1, branchedTreeFeatureConfig_1, int_1, int_2, int_3, blockPos_2.add(-offsetX * 2, (offset * 2) - 2, -offsetZ * 2), set_2); } } return true; } } }
6,636
0.644967
0.611965
104
62.817307
80.875946
318
false
false
0
0
0
0
0
0
1.971154
false
false
7
6c6a474e70694489c01182062ab10b51ba99ec70
15,006,615,790,626
5898842c67f8816a40d64a8d398dad7be5f103bc
/baleen-annotators/src/main/java/uk/gov/dstl/baleen/annotators/patterns/data/PatternExtract.java
2120f31ca89b4a86d96da90acadb210d1fc907b3
[ "Apache-2.0", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-public-domain", "PDDL-1.0", "ODbL-1.0", "LicenseRef-scancode-dbcl-1.0" ]
permissive
dstl/baleen
https://github.com/dstl/baleen
9000b6f75029772650787f06b15e6cbe099b256b
e02e750eeed1c820bed6d187b83c5e71c176b349
refs/heads/master
2023-03-15T14:15:25.402000
2022-07-11T07:18:57
2022-07-11T07:18:57
42,057,361
166
58
Apache-2.0
false
2022-08-21T14:19:18
2015-09-07T14:28:17
2022-07-11T07:40:56
2022-08-21T14:19:18
98,101
147
41
8
Java
false
false
// Dstl (c) Crown Copyright 2017 package uk.gov.dstl.baleen.annotators.patterns.data; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import uk.gov.dstl.baleen.types.language.WordToken; import uk.gov.dstl.baleen.types.semantic.Entity; /** * A java bean corresponding to an extracted Pattern. * * <p>A pattern is a range of text between two entities. */ public final class PatternExtract { /** The start. */ private final int start; /** The end. */ private final int end; /** The from. */ private final Entity from; /** The to. */ private final Entity to; /** The words. */ private List<WordToken> words; /** * Instantiates a new pattern extract. * * @param from the first entity (start of the pattern) * @param to the second entity (end of the pattern) * @param start the start index * @param end the end index */ public PatternExtract(final Entity from, final Entity to, final int start, final int end) { this.from = from; this.to = to; this.start = start; this.end = end; } /** * Get the first entity. * * @return entity */ public Entity getFrom() { return from; } /** * Gets the second entitys * * @return entity */ public Entity getTo() { return to; } /** * Gets the start. * * @return the start */ public int getStart() { return start; } /** * Gets the end. * * @return the end */ public int getEnd() { return end; } /** * Sets the word tokens (which form the pattern, and are beneath the start-end range). * * @param words the new word tokens */ public void setWordTokens(final List<WordToken> words) { this.words = words; } /** * Gets the word tokens (must have been previously set) * * @return the word tokens */ public List<WordToken> getWordTokens() { return words; } /** * Determine if any of the needles are contained in this covering document text. * * @param documentText the document text * @param needles the needles * @return true, if successful */ public boolean contains(final String documentText, final String... needles) { final String text = getCoveredText(documentText); return Arrays.stream(needles).anyMatch(text::contains); } /** * Gets the covered text. * * @param documentText the document text * @return the covered text */ public String getCoveredText(final String documentText) { return documentText.substring(start, end); } /** * Gets the text formed of the concatenated word tokens. * * <p>Hence this a 'sanitised text' rather than the covered text. * * @return the text */ public String getText() { if (words == null) { return ""; } return words.stream().map(w -> w.getCoveredText()).collect(Collectors.joining(" ")); } /** * Checks if is empty, based on the word tokens (not range, start/end, etc) * * @return true, if is empty */ public boolean isEmpty() { return words == null || words.isEmpty(); } }
UTF-8
Java
3,114
java
PatternExtract.java
Java
[]
null
[]
// Dstl (c) Crown Copyright 2017 package uk.gov.dstl.baleen.annotators.patterns.data; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import uk.gov.dstl.baleen.types.language.WordToken; import uk.gov.dstl.baleen.types.semantic.Entity; /** * A java bean corresponding to an extracted Pattern. * * <p>A pattern is a range of text between two entities. */ public final class PatternExtract { /** The start. */ private final int start; /** The end. */ private final int end; /** The from. */ private final Entity from; /** The to. */ private final Entity to; /** The words. */ private List<WordToken> words; /** * Instantiates a new pattern extract. * * @param from the first entity (start of the pattern) * @param to the second entity (end of the pattern) * @param start the start index * @param end the end index */ public PatternExtract(final Entity from, final Entity to, final int start, final int end) { this.from = from; this.to = to; this.start = start; this.end = end; } /** * Get the first entity. * * @return entity */ public Entity getFrom() { return from; } /** * Gets the second entitys * * @return entity */ public Entity getTo() { return to; } /** * Gets the start. * * @return the start */ public int getStart() { return start; } /** * Gets the end. * * @return the end */ public int getEnd() { return end; } /** * Sets the word tokens (which form the pattern, and are beneath the start-end range). * * @param words the new word tokens */ public void setWordTokens(final List<WordToken> words) { this.words = words; } /** * Gets the word tokens (must have been previously set) * * @return the word tokens */ public List<WordToken> getWordTokens() { return words; } /** * Determine if any of the needles are contained in this covering document text. * * @param documentText the document text * @param needles the needles * @return true, if successful */ public boolean contains(final String documentText, final String... needles) { final String text = getCoveredText(documentText); return Arrays.stream(needles).anyMatch(text::contains); } /** * Gets the covered text. * * @param documentText the document text * @return the covered text */ public String getCoveredText(final String documentText) { return documentText.substring(start, end); } /** * Gets the text formed of the concatenated word tokens. * * <p>Hence this a 'sanitised text' rather than the covered text. * * @return the text */ public String getText() { if (words == null) { return ""; } return words.stream().map(w -> w.getCoveredText()).collect(Collectors.joining(" ")); } /** * Checks if is empty, based on the word tokens (not range, start/end, etc) * * @return true, if is empty */ public boolean isEmpty() { return words == null || words.isEmpty(); } }
3,114
0.631985
0.6307
147
20.183674
21.75967
93
false
false
0
0
0
0
0
0
0.272109
false
false
7
4bc8ef84895a12e7bd11ca9459f89a5832e82d1a
25,606,595,026,317
f3959075e6d0398a4a05371eae8caf4af121ff8c
/PingStatusApplication/src/main/java/com/ping/manager/FileManager.java
5e55823d7bcec3a99797c516c688cd0c29e3d27a
[]
no_license
Satya-Sravanthi/PingStatusRepo
https://github.com/Satya-Sravanthi/PingStatusRepo
f10a15ddac7e58a012921c42468edb07238a5624
a93eb4259be82988e567c481340bebf75a5edd96
refs/heads/main
2023-01-02T03:13:07.017000
2020-10-22T15:50:19
2020-10-22T15:50:19
306,144,241
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ping.manager; import java.io.BufferedWriter; import java.io.FileWriter; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.ping.dao.model.PingEntity; /** * Class to process file * * @author Satya Sravanthi Dhanekula * */ @Component public class FileManager { private static final Logger LOGGER = LoggerFactory.getLogger(FileManager.class); @Value("${timeoutfile.path}") private String path; @Value("${timeoutfile.fileName}") private String fileName; /** * Method to process the timeout requests * @param clientLogEntries */ public void processTimeOutRequests(List<PingEntity> clientLogEntries) { if (clientLogEntries != null && !clientLogEntries.isEmpty()) { String file = path + "\\" + fileName; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Writing the requests to file:::" + file); } try { FileWriter fw = new FileWriter(file); BufferedWriter out = new BufferedWriter(fw); for (PingEntity entry : clientLogEntries) { out.write(entry.getClientId() + "-" + entry.getPingTimeStamp()); out.newLine(); } out.close(); } catch (Exception e) { LOGGER.error("Exception while writing the timeout entries to the file "); } } } }
UTF-8
Java
1,371
java
FileManager.java
Java
[ { "context": "tity;\n\n/**\n * Class to process file\n * \n * @author Satya Sravanthi Dhanekula\n *\n */\n@Component\npublic class FileManager {\n\n\tpr", "end": 383, "score": 0.997893750667572, "start": 358, "tag": "NAME", "value": "Satya Sravanthi Dhanekula" } ]
null
[]
package com.ping.manager; import java.io.BufferedWriter; import java.io.FileWriter; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.ping.dao.model.PingEntity; /** * Class to process file * * @author <NAME> * */ @Component public class FileManager { private static final Logger LOGGER = LoggerFactory.getLogger(FileManager.class); @Value("${timeoutfile.path}") private String path; @Value("${timeoutfile.fileName}") private String fileName; /** * Method to process the timeout requests * @param clientLogEntries */ public void processTimeOutRequests(List<PingEntity> clientLogEntries) { if (clientLogEntries != null && !clientLogEntries.isEmpty()) { String file = path + "\\" + fileName; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Writing the requests to file:::" + file); } try { FileWriter fw = new FileWriter(file); BufferedWriter out = new BufferedWriter(fw); for (PingEntity entry : clientLogEntries) { out.write(entry.getClientId() + "-" + entry.getPingTimeStamp()); out.newLine(); } out.close(); } catch (Exception e) { LOGGER.error("Exception while writing the timeout entries to the file "); } } } }
1,352
0.706783
0.705325
57
23.052631
22.794598
81
false
false
0
0
0
0
0
0
1.596491
false
false
7
bc0795b26b810f34f1527e940f11dd6cf2139ca2
16,466,904,679,533
447520f40e82a060368a0802a391697bc00be96f
/apks/comparison_androart/ro.btrl.pay/source/o/FQ.java
c97d347c2445ef17e5a015a49a655eec77d9c094
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
https://github.com/iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689000
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
false
2023-07-16T07:41:38
2017-10-17T08:22:57
2019-09-30T19:01:44
2023-07-16T07:41:38
1,616,319
0
0
1
null
false
false
package o; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import java.io.UnsupportedEncodingException; public class FQ implements Parcelable { public static final Parcelable.Creator<FQ> CREATOR; private static final int OTHER_POSITION = 6; private static int ˊ = 0; private static char[] ˋ; private static byte ˏ = 0; private static int ॱ = 0; public String contactPhoneNumber; boolean isPrimary; boolean isSuperPrimary; public int type; static { int i; do { return; ˊ = 0; ॱ = 1; ˏ(); ˊ(); CREATOR = new Parcelable.Creator() { public FQ ॱ(Parcel paramAnonymousParcel) { return new FQ(paramAnonymousParcel, null); } public FQ[] ॱ(int paramAnonymousInt) { return new FQ[paramAnonymousInt]; } }; i = ˊ + 63; ॱ = i % 128; } while (i % 2 == 0); } private FQ(Parcel paramParcel) {} public FQ(String paramString) { try { this.contactPhoneNumber = paramString; return; } catch (Exception paramString) { throw paramString; } } /* Error */ public FQ(String paramString, int paramInt, short paramShort1, short paramShort2) { // Byte code: // 0: goto +190 -> 190 // 3: astore_1 // 4: aload_1 // 5: athrow // 6: astore_1 // 7: aload_1 // 8: athrow // 9: iconst_0 // 10: istore_2 // 11: goto +21 -> 32 // 14: aload_0 // 15: iload 5 // 17: putfield 69 o/FQ:isSuperPrimary Z // 20: goto +94 -> 114 // 23: iconst_1 // 24: istore 5 // 26: goto -12 -> 14 // 29: goto +144 -> 173 // 32: iload_2 // 33: tableswitch default:+23->56, 0:+-4->29, 1:+110->143 // 56: goto -27 -> 29 // 59: bipush 36 // 61: istore_2 // 62: goto +12 -> 74 // 65: iconst_0 // 66: istore 5 // 68: goto +105 -> 173 // 71: bipush 19 // 73: istore_2 // 74: iload_2 // 75: lookupswitch default:+25->100, 19:+28->103, 36:+-52->23 // 100: goto -77 -> 23 // 103: iconst_0 // 104: istore 5 // 106: goto -92 -> 14 // 109: iconst_1 // 110: istore_2 // 111: goto -79 -> 32 // 114: getstatic 31 o/FQ:ˊ I // 117: bipush 17 // 119: iadd // 120: istore_2 // 121: iload_2 // 122: sipush 128 // 125: irem // 126: putstatic 33 o/FQ:ॱ I // 129: iload_2 // 130: iconst_2 // 131: irem // 132: ifne +6 -> 138 // 135: goto +4 -> 139 // 138: return // 139: aconst_null // 140: arraylength // 141: istore_2 // 142: return // 143: goto +30 -> 173 // 146: getstatic 33 o/FQ:ॱ I // 149: bipush 79 // 151: iadd // 152: istore_2 // 153: iload_2 // 154: sipush 128 // 157: irem // 158: putstatic 31 o/FQ:ˊ I // 161: iload_2 // 162: iconst_2 // 163: irem // 164: ifeq +6 -> 170 // 167: goto -158 -> 9 // 170: goto -61 -> 109 // 173: aload_0 // 174: iload 5 // 176: putfield 48 o/FQ:isPrimary Z // 179: iload 4 // 181: ifle +6 -> 187 // 184: goto -125 -> 59 // 187: goto -116 -> 71 // 190: aload_0 // 191: invokespecial 55 java/lang/Object:<init> ()V // 194: aload_0 // 195: aload_1 // 196: putfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 199: aload_0 // 200: iload_2 // 201: putfield 61 o/FQ:type I // 204: iload_3 // 205: ifle +6 -> 211 // 208: goto +6 -> 214 // 211: goto -146 -> 65 // 214: iconst_1 // 215: istore 5 // 217: goto -71 -> 146 // Local variable table: // start length slot name signature // 0 220 0 this FQ // 0 220 1 paramString String // 0 220 2 paramInt int // 0 220 3 paramShort1 short // 0 220 4 paramShort2 short // 15 201 5 bool boolean // Exception table: // from to target type // 173 179 3 java/lang/Exception // 194 199 6 java/lang/Exception // 199 204 6 java/lang/Exception } /* Error */ static void ˊ() { // Byte code: // 0: goto +109 -> 109 // 3: bipush 75 // 5: iconst_0 // 6: idiv // 7: istore_0 // 8: return // 9: astore_1 // 10: aload_1 // 11: athrow // 12: astore_1 // 13: aload_1 // 14: athrow // 15: getstatic 31 o/FQ:ˊ I // 18: istore_0 // 19: iload_0 // 20: bipush 113 // 22: iadd // 23: istore_0 // 24: iload_0 // 25: sipush 128 // 28: irem // 29: putstatic 33 o/FQ:ॱ I // 32: iload_0 // 33: iconst_2 // 34: irem // 35: ifne +6 -> 41 // 38: goto +78 -> 116 // 41: goto +30 -> 71 // 44: getstatic 31 o/FQ:ˊ I // 47: bipush 51 // 49: iadd // 50: istore_0 // 51: iload_0 // 52: sipush 128 // 55: irem // 56: putstatic 33 o/FQ:ॱ I // 59: iload_0 // 60: iconst_2 // 61: irem // 62: ifne +6 -> 68 // 65: goto +48 -> 113 // 68: goto +33 -> 101 // 71: bipush 31 // 73: istore_0 // 74: iload_0 // 75: lookupswitch default:+25->100, 27:+-72->3, 31:+37->112 // 100: return // 101: bipush -102 // 103: putstatic 76 o/FQ:ˏ B // 106: goto -91 -> 15 // 109: goto -65 -> 44 // 112: return // 113: goto -12 -> 101 // 116: bipush 27 // 118: istore_0 // 119: goto -45 -> 74 // Local variable table: // start length slot name signature // 7 112 0 i int // 9 2 1 localException1 Exception // 12 2 1 localException2 Exception // Exception table: // from to target type // 24 32 9 java/lang/Exception // 15 19 12 java/lang/Exception } /* Error */ private static String ˋ(int[] paramArrayOfInt, byte[] paramArrayOfByte, boolean paramBoolean) { // Byte code: // 0: goto +186 -> 186 // 3: iload 4 // 5: iload 5 // 7: if_icmpge +6 -> 13 // 10: goto +531 -> 541 // 13: goto +167 -> 180 // 16: getstatic 31 o/FQ:ˊ I // 19: bipush 67 // 21: iadd // 22: istore_3 // 23: iload_3 // 24: sipush 128 // 27: irem // 28: putstatic 33 o/FQ:ॱ I // 31: iload_3 // 32: iconst_2 // 33: irem // 34: ifne +6 -> 40 // 37: goto +427 -> 464 // 40: aload_0 // 41: areturn // 42: iload 6 // 44: ifle +6 -> 50 // 47: goto +214 -> 261 // 50: goto +416 -> 466 // 53: aload 9 // 55: iload_3 // 56: aload_1 // 57: iload 5 // 59: iload_3 // 60: isub // 61: iconst_1 // 62: isub // 63: caload // 64: castore // 65: iload_3 // 66: iconst_1 // 67: iadd // 68: istore_3 // 69: goto +254 -> 323 // 72: getstatic 33 o/FQ:ॱ I // 75: bipush 77 // 77: iadd // 78: istore_3 // 79: iload_3 // 80: sipush 128 // 83: irem // 84: putstatic 31 o/FQ:ˊ I // 87: iload_3 // 88: iconst_2 // 89: irem // 90: ifeq +6 -> 96 // 93: goto +242 -> 335 // 96: goto +509 -> 605 // 99: aload 9 // 101: iload 4 // 103: caload // 104: istore_3 // 105: iload 4 // 107: iconst_1 // 108: iadd // 109: istore 4 // 111: goto -108 -> 3 // 114: aload_0 // 115: iconst_0 // 116: iaload // 117: istore_3 // 118: aload_0 // 119: iconst_1 // 120: iaload // 121: istore 5 // 123: aload_0 // 124: iconst_2 // 125: iaload // 126: istore 6 // 128: aload_0 // 129: iconst_3 // 130: iaload // 131: istore 7 // 133: getstatic 79 o/FQ:ˋ [C // 136: astore 9 // 138: iload 5 // 140: newarray char // 142: astore 10 // 144: aload 9 // 146: iload_3 // 147: aload 10 // 149: iconst_0 // 150: iload 5 // 152: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 155: aload_1 // 156: ifnull +6 -> 162 // 159: goto +126 -> 285 // 162: aload 10 // 164: astore_1 // 165: goto +85 -> 250 // 168: iload_3 // 169: iload 5 // 171: if_icmpge +6 -> 177 // 174: goto +93 -> 267 // 177: goto +313 -> 490 // 180: aload 9 // 182: astore_1 // 183: goto +67 -> 250 // 186: goto -72 -> 114 // 189: iload 5 // 191: newarray char // 193: astore 9 // 195: iconst_0 // 196: istore_3 // 197: goto +214 -> 411 // 200: aload 9 // 202: iload 4 // 204: aload 10 // 206: iload 4 // 208: caload // 209: iconst_1 // 210: ishl // 211: iconst_1 // 212: iadd // 213: iload_3 // 214: isub // 215: i2c // 216: castore // 217: goto -118 -> 99 // 220: aload_1 // 221: iload 4 // 223: baload // 224: iconst_1 // 225: if_icmpne +6 -> 231 // 228: goto -28 -> 200 // 231: goto +241 -> 472 // 234: aload_1 // 235: iload 4 // 237: baload // 238: ifne +6 -> 244 // 241: goto -41 -> 200 // 244: goto +228 -> 472 // 247: astore_0 // 248: aload_0 // 249: athrow // 250: iload 7 // 252: ifle +6 -> 258 // 255: goto +162 -> 417 // 258: goto +273 -> 531 // 261: bipush 65 // 263: istore_3 // 264: goto +238 -> 502 // 267: aload_1 // 268: iload_3 // 269: aload_1 // 270: iload_3 // 271: caload // 272: aload_0 // 273: iconst_2 // 274: iaload // 275: isub // 276: i2c // 277: castore // 278: iload_3 // 279: iconst_1 // 280: iadd // 281: istore_3 // 282: goto +64 -> 346 // 285: getstatic 33 o/FQ:ॱ I // 288: bipush 17 // 290: iadd // 291: istore_3 // 292: iload_3 // 293: sipush 128 // 296: irem // 297: putstatic 31 o/FQ:ˊ I // 300: iload_3 // 301: iconst_2 // 302: irem // 303: ifeq +6 -> 309 // 306: goto +316 -> 622 // 309: goto +318 -> 627 // 312: iload 5 // 314: newarray char // 316: astore 9 // 318: iconst_1 // 319: istore_3 // 320: goto +91 -> 411 // 323: iload_3 // 324: iload 5 // 326: if_icmpge +6 -> 332 // 329: goto +242 -> 571 // 332: goto +284 -> 616 // 335: iload 5 // 337: newarray char // 339: astore 9 // 341: iconst_0 // 342: istore_3 // 343: goto -20 -> 323 // 346: goto -178 -> 168 // 349: iconst_0 // 350: istore_3 // 351: goto -183 -> 168 // 354: iconst_0 // 355: istore_3 // 356: goto -188 -> 168 // 359: getstatic 33 o/FQ:ॱ I // 362: iconst_5 // 363: iadd // 364: istore_3 // 365: iload_3 // 366: sipush 128 // 369: irem // 370: putstatic 31 o/FQ:ˊ I // 373: iload_3 // 374: iconst_2 // 375: irem // 376: ifeq +6 -> 382 // 379: goto -25 -> 354 // 382: goto -33 -> 349 // 385: iload_3 // 386: tableswitch default:+22->408, 0:+-74->312, 1:+-197->189 // 408: goto -96 -> 312 // 411: iconst_0 // 412: istore 4 // 414: goto -411 -> 3 // 417: iload 5 // 419: newarray char // 421: astore 9 // 423: aload_1 // 424: iconst_0 // 425: aload 9 // 427: iconst_0 // 428: iload 5 // 430: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 433: aload 9 // 435: iconst_0 // 436: aload_1 // 437: iload 5 // 439: iload 7 // 441: isub // 442: iload 7 // 444: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 447: aload 9 // 449: iload 7 // 451: aload_1 // 452: iconst_0 // 453: iload 5 // 455: iload 7 // 457: isub // 458: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 461: goto +70 -> 531 // 464: aload_0 // 465: areturn // 466: bipush 11 // 468: istore_3 // 469: goto +33 -> 502 // 472: aload 9 // 474: iload 4 // 476: aload 10 // 478: iload 4 // 480: caload // 481: iconst_1 // 482: ishl // 483: iload_3 // 484: isub // 485: i2c // 486: castore // 487: goto -388 -> 99 // 490: new 87 java/lang/String // 493: dup // 494: aload_1 // 495: invokespecial 90 java/lang/String:<init> ([C)V // 498: astore_0 // 499: goto -483 -> 16 // 502: iload_3 // 503: lookupswitch default:+25->528, 11:+-13->490, 65:+-144->359 // 528: goto -169 -> 359 // 531: iload_2 // 532: ifeq +6 -> 538 // 535: goto -463 -> 72 // 538: goto -496 -> 42 // 541: getstatic 31 o/FQ:ˊ I // 544: bipush 19 // 546: iadd // 547: istore 8 // 549: iload 8 // 551: sipush 128 // 554: irem // 555: putstatic 33 o/FQ:ॱ I // 558: iload 8 // 560: iconst_2 // 561: irem // 562: ifne +6 -> 568 // 565: goto -331 -> 234 // 568: goto -348 -> 220 // 571: getstatic 31 o/FQ:ˊ I // 574: istore 4 // 576: iload 4 // 578: bipush 27 // 580: iadd // 581: istore 4 // 583: iload 4 // 585: sipush 128 // 588: irem // 589: putstatic 33 o/FQ:ॱ I // 592: iload 4 // 594: iconst_2 // 595: irem // 596: ifne +6 -> 602 // 599: goto -546 -> 53 // 602: goto -549 -> 53 // 605: iload 5 // 607: newarray char // 609: astore 9 // 611: iconst_0 // 612: istore_3 // 613: goto -290 -> 323 // 616: aload 9 // 618: astore_1 // 619: goto -577 -> 42 // 622: iconst_0 // 623: istore_3 // 624: goto -239 -> 385 // 627: iconst_1 // 628: istore_3 // 629: goto -244 -> 385 // 632: astore_0 // 633: aload_0 // 634: athrow // Local variable table: // start length slot name signature // 0 635 0 paramArrayOfInt int[] // 0 635 1 paramArrayOfByte byte[] // 0 635 2 paramBoolean boolean // 22 607 3 i int // 3 593 4 j int // 5 601 5 k int // 42 85 6 m int // 131 327 7 n int // 547 15 8 i1 int // 53 564 9 arrayOfChar1 char[] // 142 335 10 arrayOfChar2 char[] // Exception table: // from to target type // 433 447 247 java/lang/Exception // 447 461 247 java/lang/Exception // 583 592 247 java/lang/Exception // 423 433 632 java/lang/Exception // 571 576 632 java/lang/Exception } private static String ˏ(String paramString) { break label82; int i = 89; for (;;) { try { int j = arrayOfByte.length; if (i >= j) { continue; i = 66; continue; continue; continue; paramString[i] = ((byte)(arrayOfByte[(arrayOfByte.length - i - 1)] ^ ˏ)); i += 1; j = ॱ + 109; ˊ = j % 128; if (j % 2 != 0) { continue; } continue; label82: i = ॱ + 119; ˊ = i % 128; if (i % 2 != 0) { continue; } break; j = 1; } switch (j) { case 0: default: continue; arrayOfByte = paramString.getBytes(ˋ(new int[] { 4, 10, 0, 1 }, new byte[] { 1, 0, 0, 0, 0, 1, 0, 1, 0, 0 }, false).intern()); paramString = new byte[arrayOfByte.length]; i = 0; continue; j = 0; continue; switch (i) { } break; case 1: paramString = new String(paramString, ˋ(new int[] { 14, 5, 0, 5 }, new byte[] { 0, 1, 1, 0, 1 }, true).intern()); return paramString; } } catch (UnsupportedEncodingException paramString) { throw new RuntimeException(paramString); } byte[] arrayOfByte = paramString.getBytes(ˋ(new int[] { 4, 10, 0, 1 }, new byte[] { 1, 0, 0, 0, 0, 1, 0, 1, 0, 0 }, true).intern()); paramString = new byte[arrayOfByte.length]; i = 0; } } static void ˏ() { ˋ = new char[] { 13, 15, 8, 11, 36, 61, 47, 51, 55, 54, 56, 50, 62, 81, 28, 50, 57, 77, 84 }; } /* Error */ public static String ॱ(android.content.Context paramContext, FQ paramFQ, boolean paramBoolean) { // Byte code: // 0: goto +266 -> 266 // 3: iconst_1 // 4: istore_3 // 5: goto +601 -> 606 // 8: aload_0 // 9: getstatic 135 o/DY$If:phone_number_display_with_type I // 12: invokevirtual 141 android/content/Context:getString (I)Ljava/lang/String; // 15: astore 4 // 17: aload 4 // 19: iconst_4 // 20: newarray int // 22: dup // 23: iconst_0 // 24: iconst_0 // 25: iastore // 26: dup // 27: iconst_1 // 28: iconst_4 // 29: iastore // 30: dup // 31: iconst_2 // 32: iconst_0 // 33: iastore // 34: dup // 35: iconst_3 // 36: iconst_2 // 37: iastore // 38: iconst_4 // 39: newarray byte // 41: dup // 42: iconst_0 // 43: ldc 16 // 45: bastore // 46: dup // 47: iconst_1 // 48: ldc 94 // 50: bastore // 51: dup // 52: iconst_2 // 53: ldc 94 // 55: bastore // 56: dup // 57: iconst_3 // 58: ldc 94 // 60: bastore // 61: iconst_1 // 62: invokestatic 96 o/FQ:ˋ ([I[BZ)Ljava/lang/String; // 65: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 68: invokevirtual 145 java/lang/String:startsWith (Ljava/lang/String;)Z // 71: ifeq +6 -> 77 // 74: goto +569 -> 643 // 77: goto +105 -> 182 // 80: iload_3 // 81: lookupswitch default:+27->108, 6:+230->311, 16:+470->551 // 108: goto +203 -> 311 // 111: bipush 89 // 113: istore_3 // 114: goto +570 -> 684 // 117: bipush 62 // 119: istore_3 // 120: iload_3 // 121: lookupswitch default:+27->148, 47:+148->269, 62:+286->407 // 148: goto +259 -> 407 // 151: aload_0 // 152: iconst_2 // 153: anewarray 4 java/lang/Object // 156: dup // 157: iconst_0 // 158: aload 6 // 160: aastore // 161: dup // 162: iconst_1 // 163: aload_1 // 164: aastore // 165: invokestatic 149 java/lang/String:format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; // 168: areturn // 169: aload_1 // 170: ifnull +6 -> 176 // 173: goto +188 -> 361 // 176: goto +461 -> 637 // 179: astore_0 // 180: aload_0 // 181: athrow // 182: bipush 62 // 184: istore_3 // 185: goto +182 -> 367 // 188: aload_0 // 189: getstatic 135 o/DY$If:phone_number_display_with_type I // 192: invokevirtual 141 android/content/Context:getString (I)Ljava/lang/String; // 195: astore_0 // 196: aload_0 // 197: iconst_4 // 198: newarray int // 200: dup // 201: iconst_0 // 202: iconst_0 // 203: iastore // 204: dup // 205: iconst_1 // 206: iconst_4 // 207: iastore // 208: dup // 209: iconst_2 // 210: iconst_0 // 211: iastore // 212: dup // 213: iconst_3 // 214: iconst_2 // 215: iastore // 216: iconst_4 // 217: newarray byte // 219: dup // 220: iconst_0 // 221: ldc 16 // 223: bastore // 224: dup // 225: iconst_1 // 226: ldc 94 // 228: bastore // 229: dup // 230: iconst_2 // 231: ldc 94 // 233: bastore // 234: dup // 235: iconst_3 // 236: ldc 94 // 238: bastore // 239: iconst_1 // 240: invokestatic 96 o/FQ:ˋ ([I[BZ)Ljava/lang/String; // 243: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 246: invokevirtual 145 java/lang/String:startsWith (Ljava/lang/String;)Z // 249: ifeq +9 -> 258 // 252: aload_0 // 253: astore 5 // 255: goto +469 -> 724 // 258: goto +55 -> 313 // 261: iconst_1 // 262: istore_3 // 263: goto +17 -> 280 // 266: goto -97 -> 169 // 269: aload 7 // 271: aload_1 // 272: getfield 61 o/FQ:type I // 275: aaload // 276: astore_1 // 277: goto +302 -> 579 // 280: iload_3 // 281: lookupswitch default:+27->308, 1:+-93->188, 31:+-273->8 // 308: goto -120 -> 188 // 311: aconst_null // 312: areturn // 313: aload_1 // 314: getfield 61 o/FQ:type I // 317: aload 7 // 319: arraylength // 320: if_icmpge +6 -> 326 // 323: goto +26 -> 349 // 326: goto -209 -> 117 // 329: aload_1 // 330: iconst_4 // 331: invokevirtual 152 java/lang/String:substring (I)Ljava/lang/String; // 334: invokestatic 154 o/FQ:ˏ (Ljava/lang/String;)Ljava/lang/String; // 337: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 340: astore_0 // 341: bipush 37 // 343: iconst_0 // 344: idiv // 345: istore_3 // 346: goto +309 -> 655 // 349: bipush 47 // 351: istore_3 // 352: goto -232 -> 120 // 355: goto -204 -> 151 // 358: astore_0 // 359: aload_0 // 360: athrow // 361: bipush 16 // 363: istore_3 // 364: goto -284 -> 80 // 367: aload 4 // 369: astore_0 // 370: aload 4 // 372: astore 5 // 374: iload_3 // 375: lookupswitch default:+25->400, 51:+349->724, 62:+-62->313 // 400: aload 4 // 402: astore 5 // 404: goto +320 -> 724 // 407: aload 7 // 409: bipush 6 // 411: aaload // 412: astore_1 // 413: goto +308 -> 721 // 416: getstatic 157 o/DY$If:phone_number_display I // 419: istore_3 // 420: aload_0 // 421: iload_3 // 422: invokevirtual 141 android/content/Context:getString (I)Ljava/lang/String; // 425: astore_1 // 426: aload_1 // 427: iconst_4 // 428: newarray int // 430: dup // 431: iconst_0 // 432: iconst_0 // 433: iastore // 434: dup // 435: iconst_1 // 436: iconst_4 // 437: iastore // 438: dup // 439: iconst_2 // 440: iconst_0 // 441: iastore // 442: dup // 443: iconst_3 // 444: iconst_2 // 445: iastore // 446: iconst_4 // 447: newarray byte // 449: dup // 450: iconst_0 // 451: ldc 16 // 453: bastore // 454: dup // 455: iconst_1 // 456: ldc 94 // 458: bastore // 459: dup // 460: iconst_2 // 461: ldc 94 // 463: bastore // 464: dup // 465: iconst_3 // 466: ldc 94 // 468: bastore // 469: iconst_1 // 470: invokestatic 96 o/FQ:ˋ ([I[BZ)Ljava/lang/String; // 473: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 476: invokevirtual 145 java/lang/String:startsWith (Ljava/lang/String;)Z // 479: ifeq +6 -> 485 // 482: goto -479 -> 3 // 485: goto +61 -> 546 // 488: getstatic 31 o/FQ:ˊ I // 491: istore_3 // 492: iload_3 // 493: bipush 111 // 495: iadd // 496: istore_3 // 497: iload_3 // 498: sipush 128 // 501: irem // 502: putstatic 33 o/FQ:ॱ I // 505: iload_3 // 506: iconst_2 // 507: irem // 508: ifne +6 -> 514 // 511: goto -250 -> 261 // 514: goto +135 -> 649 // 517: getstatic 33 o/FQ:ॱ I // 520: istore_3 // 521: iload_3 // 522: bipush 79 // 524: iadd // 525: istore_3 // 526: iload_3 // 527: sipush 128 // 530: irem // 531: putstatic 31 o/FQ:ˊ I // 534: iload_3 // 535: iconst_2 // 536: irem // 537: ifeq +6 -> 543 // 540: goto -211 -> 329 // 543: goto +126 -> 669 // 546: iconst_0 // 547: istore_3 // 548: goto +58 -> 606 // 551: aload_1 // 552: invokevirtual 159 o/FQ:ॱ ()Ljava/lang/String; // 555: astore 6 // 557: aload_0 // 558: invokevirtual 163 android/content/Context:getResources ()Landroid/content/res/Resources; // 561: getstatic 168 o/DY$ˋ:phone_types I // 564: invokevirtual 174 android/content/res/Resources:getStringArray (I)[Ljava/lang/String; // 567: astore 7 // 569: iload_2 // 570: ifeq +6 -> 576 // 573: goto -462 -> 111 // 576: goto +139 -> 715 // 579: getstatic 31 o/FQ:ˊ I // 582: bipush 51 // 584: iadd // 585: istore_3 // 586: iload_3 // 587: sipush 128 // 590: irem // 591: putstatic 33 o/FQ:ॱ I // 594: iload_3 // 595: iconst_2 // 596: irem // 597: ifne +6 -> 603 // 600: goto +140 -> 740 // 603: goto -248 -> 355 // 606: aload_1 // 607: astore_0 // 608: iload_3 // 609: tableswitch default:+23->632, 0:+46->655, 1:+-92->517 // 632: aload_1 // 633: astore_0 // 634: goto +21 -> 655 // 637: bipush 6 // 639: istore_3 // 640: goto -560 -> 80 // 643: bipush 51 // 645: istore_3 // 646: goto -279 -> 367 // 649: bipush 31 // 651: istore_3 // 652: goto -372 -> 280 // 655: aload_0 // 656: iconst_1 // 657: anewarray 4 java/lang/Object // 660: dup // 661: iconst_0 // 662: aload 6 // 664: aastore // 665: invokestatic 149 java/lang/String:format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; // 668: areturn // 669: aload_1 // 670: iconst_4 // 671: invokevirtual 152 java/lang/String:substring (I)Ljava/lang/String; // 674: invokestatic 154 o/FQ:ˏ (Ljava/lang/String;)Ljava/lang/String; // 677: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 680: astore_0 // 681: goto -26 -> 655 // 684: iload_3 // 685: lookupswitch default:+27->712, 70:+-269->416, 89:+-197->488 // 712: goto -296 -> 416 // 715: bipush 70 // 717: istore_3 // 718: goto -34 -> 684 // 721: goto -570 -> 151 // 724: aload 5 // 726: iconst_4 // 727: invokevirtual 152 java/lang/String:substring (I)Ljava/lang/String; // 730: invokestatic 154 o/FQ:ˏ (Ljava/lang/String;)Ljava/lang/String; // 733: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 736: astore_0 // 737: goto -424 -> 313 // 740: goto -385 -> 355 // Local variable table: // start length slot name signature // 0 743 0 paramContext android.content.Context // 0 743 1 paramFQ FQ // 0 743 2 paramBoolean boolean // 4 714 3 i int // 15 386 4 str1 String // 253 472 5 localObject Object // 158 505 6 str2 String // 269 299 7 arrayOfString String[] // Exception table: // from to target type // 488 492 179 java/lang/Exception // 497 505 179 java/lang/Exception // 517 521 179 java/lang/Exception // 526 534 179 java/lang/Exception // 416 420 358 java/lang/Exception } public int describeContents() { for (;;) { int i = ॱ + 111; ˊ = i % 128; if (i % 2 == 0) { break label30; } label30: return 0; i = ॱ + 7; ˊ = i % 128; if (i % 2 != 0) {} } } /* Error */ public boolean equals(Object paramObject) { // Byte code: // 0: goto +6 -> 6 // 3: goto +174 -> 177 // 6: goto +254 -> 260 // 9: iload_2 // 10: tableswitch default:+22->32, 0:+61->71, 1:+41->51 // 32: goto +39 -> 71 // 35: iconst_1 // 36: istore_2 // 37: goto -28 -> 9 // 40: aload_0 // 41: aload_1 // 42: if_acmpne +6 -> 48 // 45: goto +134 -> 179 // 48: goto +169 -> 217 // 51: aload_0 // 52: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 55: aload_1 // 56: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 59: invokevirtual 179 java/lang/String:equals (Ljava/lang/Object;)Z // 62: ifeq +6 -> 68 // 65: goto +105 -> 170 // 68: goto +160 -> 228 // 71: goto +64 -> 135 // 74: astore_1 // 75: aload_1 // 76: athrow // 77: getstatic 33 o/FQ:ॱ I // 80: bipush 43 // 82: iadd // 83: istore_2 // 84: iload_2 // 85: sipush 128 // 88: irem // 89: putstatic 31 o/FQ:ˊ I // 92: iload_2 // 93: iconst_2 // 94: irem // 95: ifeq +6 -> 101 // 98: goto +77 -> 175 // 101: goto +74 -> 175 // 104: iload_2 // 105: lookupswitch default:+27->132, 2:+117->222, 31:+-34->71 // 132: goto -61 -> 71 // 135: iconst_0 // 136: ireturn // 137: iload_2 // 138: tableswitch default:+22->160, 0:+149->287, 1:+-135->3 // 160: goto -157 -> 3 // 163: iconst_0 // 164: istore_2 // 165: goto -156 -> 9 // 168: iconst_1 // 169: ireturn // 170: iconst_2 // 171: istore_2 // 172: goto -68 -> 104 // 175: iconst_0 // 176: ireturn // 177: iconst_1 // 178: ireturn // 179: iconst_1 // 180: istore_2 // 181: goto -44 -> 137 // 184: aload_0 // 185: invokevirtual 183 java/lang/Object:getClass ()Ljava/lang/Class; // 188: aload_1 // 189: invokevirtual 183 java/lang/Object:getClass ()Ljava/lang/Class; // 192: if_acmpeq +6 -> 198 // 195: goto +30 -> 225 // 198: goto +36 -> 234 // 201: bipush 99 // 203: iconst_0 // 204: idiv // 205: istore_2 // 206: aload_0 // 207: aload_1 // 208: if_acmpne +6 -> 214 // 211: goto -208 -> 3 // 214: goto +73 -> 287 // 217: iconst_0 // 218: istore_2 // 219: goto -82 -> 137 // 222: goto -54 -> 168 // 225: goto -148 -> 77 // 228: bipush 31 // 230: istore_2 // 231: goto -127 -> 104 // 234: aload_1 // 235: checkcast 2 o/FQ // 238: astore_1 // 239: aload_0 // 240: getfield 61 o/FQ:type I // 243: istore_2 // 244: aload_1 // 245: getfield 61 o/FQ:type I // 248: istore_3 // 249: iload_2 // 250: iload_3 // 251: if_icmpne +6 -> 257 // 254: goto -219 -> 35 // 257: goto -94 -> 163 // 260: getstatic 31 o/FQ:ˊ I // 263: bipush 51 // 265: iadd // 266: istore_2 // 267: iload_2 // 268: sipush 128 // 271: irem // 272: putstatic 33 o/FQ:ॱ I // 275: iload_2 // 276: iconst_2 // 277: irem // 278: ifne +6 -> 284 // 281: goto -80 -> 201 // 284: goto -244 -> 40 // 287: aload_1 // 288: ifnull +6 -> 294 // 291: goto -107 -> 184 // 294: goto -69 -> 225 // Local variable table: // start length slot name signature // 0 297 0 this FQ // 0 297 1 paramObject Object // 9 269 2 i int // 248 4 3 j int // Exception table: // from to target type // 234 239 74 java/lang/Exception // 239 244 74 java/lang/Exception // 244 249 74 java/lang/Exception } /* Error */ public int hashCode() { // Byte code: // 0: goto +55 -> 55 // 3: iload_1 // 4: tableswitch default:+24->28, 0:+81->85, 1:+27->31 // 28: goto +57 -> 85 // 31: aload_0 // 32: getfield 61 o/FQ:type I // 35: bipush 31 // 37: imul // 38: aload_0 // 39: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 42: invokevirtual 186 java/lang/String:hashCode ()I // 45: iadd // 46: istore_1 // 47: goto +62 -> 109 // 50: iconst_1 // 51: istore_1 // 52: goto -49 -> 3 // 55: getstatic 31 o/FQ:ˊ I // 58: bipush 87 // 60: iadd // 61: istore_1 // 62: iload_1 // 63: sipush 128 // 66: irem // 67: putstatic 33 o/FQ:ॱ I // 70: iload_1 // 71: iconst_2 // 72: irem // 73: ifne +6 -> 79 // 76: goto +28 -> 104 // 79: goto -29 -> 50 // 82: astore_3 // 83: aload_3 // 84: athrow // 85: aload_0 // 86: getfield 61 o/FQ:type I // 89: bipush 57 // 91: imul // 92: aload_0 // 93: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 96: invokevirtual 186 java/lang/String:hashCode ()I // 99: ishr // 100: istore_1 // 101: goto +8 -> 109 // 104: iconst_0 // 105: istore_1 // 106: goto -103 -> 3 // 109: getstatic 31 o/FQ:ˊ I // 112: istore_2 // 113: iload_2 // 114: bipush 21 // 116: iadd // 117: istore_2 // 118: iload_2 // 119: sipush 128 // 122: irem // 123: putstatic 33 o/FQ:ॱ I // 126: iload_2 // 127: iconst_2 // 128: irem // 129: ifne +5 -> 134 // 132: iload_1 // 133: ireturn // 134: iload_1 // 135: ireturn // Local variable table: // start length slot name signature // 0 136 0 this FQ // 3 132 1 i int // 112 17 2 j int // 82 2 3 localException Exception // Exception table: // from to target type // 109 113 82 java/lang/Exception // 118 126 82 java/lang/Exception } public String toString() { break label86; String str; int i; for (;;) { str = ॱ(); throw new NullPointerException(); str = ॱ(); break; switch (i) { } } for (;;) { i = 1; break; label86: do { i = 0; break; i = ˊ + 111; ॱ = i % 128; if (i % 2 == 0) { return str; } return str; i = ॱ + 85; ˊ = i % 128; } while (i % 2 != 0); } } /* Error */ public void writeToParcel(Parcel paramParcel, int paramInt) { // Byte code: // 0: goto +79 -> 79 // 3: iconst_1 // 4: istore_2 // 5: getstatic 31 o/FQ:ˊ I // 8: bipush 51 // 10: iadd // 11: istore_3 // 12: iload_3 // 13: sipush 128 // 16: irem // 17: putstatic 33 o/FQ:ॱ I // 20: iload_3 // 21: iconst_2 // 22: irem // 23: ifne +6 -> 29 // 26: goto +127 -> 153 // 29: goto +3 -> 32 // 32: aload_1 // 33: iload_2 // 34: i2b // 35: invokevirtual 196 android/os/Parcel:writeByte (B)V // 38: return // 39: iconst_1 // 40: istore_2 // 41: goto +115 -> 156 // 44: astore_1 // 45: aload_1 // 46: athrow // 47: iload_2 // 48: lookupswitch default:+28->76, 17:+-9->39, 20:+218->266 // 76: goto +190 -> 266 // 79: goto +227 -> 306 // 82: astore_1 // 83: aload_1 // 84: athrow // 85: getstatic 33 o/FQ:ॱ I // 88: iconst_5 // 89: iadd // 90: istore_3 // 91: iload_3 // 92: sipush 128 // 95: irem // 96: putstatic 31 o/FQ:ˊ I // 99: iload_3 // 100: iconst_2 // 101: irem // 102: ifeq +6 -> 108 // 105: goto +198 -> 303 // 108: goto -76 -> 32 // 111: bipush 17 // 113: istore_2 // 114: goto -67 -> 47 // 117: aload_1 // 118: aload_0 // 119: getfield 61 o/FQ:type I // 122: invokevirtual 200 android/os/Parcel:writeInt (I)V // 125: aload_1 // 126: aload_0 // 127: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 130: invokevirtual 203 android/os/Parcel:writeString (Ljava/lang/String;)V // 133: aload_0 // 134: getfield 48 o/FQ:isPrimary Z // 137: istore 4 // 139: aconst_null // 140: arraylength // 141: istore_2 // 142: iload 4 // 144: ifeq +6 -> 150 // 147: goto +124 -> 271 // 150: goto +148 -> 298 // 153: goto -124 -> 29 // 156: aload_1 // 157: iload_2 // 158: i2b // 159: invokevirtual 196 android/os/Parcel:writeByte (B)V // 162: aload_0 // 163: getfield 69 o/FQ:isSuperPrimary Z // 166: ifeq +6 -> 172 // 169: goto +6 -> 175 // 172: goto +88 -> 260 // 175: bipush 75 // 177: istore_2 // 178: goto +48 -> 226 // 181: aload_0 // 182: getfield 61 o/FQ:type I // 185: istore_2 // 186: aload_1 // 187: iload_2 // 188: invokevirtual 200 android/os/Parcel:writeInt (I)V // 191: aload_0 // 192: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 195: astore 5 // 197: aload_1 // 198: aload 5 // 200: invokevirtual 203 android/os/Parcel:writeString (Ljava/lang/String;)V // 203: aload_0 // 204: getfield 48 o/FQ:isPrimary Z // 207: istore 4 // 209: iload 4 // 211: ifeq +6 -> 217 // 214: goto +57 -> 271 // 217: goto +81 -> 298 // 220: bipush 20 // 222: istore_2 // 223: goto -176 -> 47 // 226: iload_2 // 227: lookupswitch default:+25->252, 46:+28->255, 75:+-224->3 // 252: goto -249 -> 3 // 255: iconst_0 // 256: istore_2 // 257: goto -172 -> 85 // 260: bipush 46 // 262: istore_2 // 263: goto -37 -> 226 // 266: iconst_1 // 267: istore_2 // 268: goto -112 -> 156 // 271: getstatic 31 o/FQ:ˊ I // 274: bipush 75 // 276: iadd // 277: istore_2 // 278: iload_2 // 279: sipush 128 // 282: irem // 283: putstatic 33 o/FQ:ॱ I // 286: iload_2 // 287: iconst_2 // 288: irem // 289: ifne +6 -> 295 // 292: goto -181 -> 111 // 295: goto -75 -> 220 // 298: iconst_0 // 299: istore_2 // 300: goto -144 -> 156 // 303: goto -271 -> 32 // 306: getstatic 33 o/FQ:ॱ I // 309: bipush 51 // 311: iadd // 312: istore_2 // 313: iload_2 // 314: sipush 128 // 317: irem // 318: putstatic 31 o/FQ:ˊ I // 321: iload_2 // 322: iconst_2 // 323: irem // 324: ifeq +6 -> 330 // 327: goto -210 -> 117 // 330: goto -149 -> 181 // Local variable table: // start length slot name signature // 0 333 0 this FQ // 0 333 1 paramParcel Parcel // 0 333 2 paramInt int // 11 91 3 i int // 137 73 4 bool boolean // 195 4 5 str String // Exception table: // from to target type // 181 186 44 java/lang/Exception // 186 191 44 java/lang/Exception // 191 197 44 java/lang/Exception // 197 203 44 java/lang/Exception // 203 209 44 java/lang/Exception // 186 191 82 java/lang/Exception } public String ˊ(String paramString) { label151: label160: label173: for (;;) { return this.contactPhoneNumber; int i = 52; for (;;) { paramString = paramString + this.contactPhoneNumber; try { for (;;) { i = ˊ; i += 17; ॱ = i % 128; if (i % 2 == 0) { break; } break label151; } i = ˊ + 107; ॱ = i % 128; if (i % 2 == 0) { return paramString; } return paramString; boolean bool = aq.ॱॱ(this.contactPhoneNumber); i = 34 / 0; if (bool) { break; for (;;) { switch (i) { case 52: default: break label160; i = 94; } } if (aq.ॱॱ(this.contactPhoneNumber)) { break label173; } } } catch (Exception paramString) { throw paramString; } } } return paramString; } public String ॱ() { try { int i = ˊ + 89; try { ॱ = i % 128; if (i % 2 == 0) { break label30; } } catch (Exception localException1) { throw localException1; } label30: String str = this.contactPhoneNumber; str = aq.ˏ(str); i = ॱ + 37; ˊ = i % 128; if (i % 2 != 0) { return str; } return str; } catch (Exception localException2) { throw localException2; } } }
UTF-8
Java
41,519
java
FQ.java
Java
[]
null
[]
package o; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import java.io.UnsupportedEncodingException; public class FQ implements Parcelable { public static final Parcelable.Creator<FQ> CREATOR; private static final int OTHER_POSITION = 6; private static int ˊ = 0; private static char[] ˋ; private static byte ˏ = 0; private static int ॱ = 0; public String contactPhoneNumber; boolean isPrimary; boolean isSuperPrimary; public int type; static { int i; do { return; ˊ = 0; ॱ = 1; ˏ(); ˊ(); CREATOR = new Parcelable.Creator() { public FQ ॱ(Parcel paramAnonymousParcel) { return new FQ(paramAnonymousParcel, null); } public FQ[] ॱ(int paramAnonymousInt) { return new FQ[paramAnonymousInt]; } }; i = ˊ + 63; ॱ = i % 128; } while (i % 2 == 0); } private FQ(Parcel paramParcel) {} public FQ(String paramString) { try { this.contactPhoneNumber = paramString; return; } catch (Exception paramString) { throw paramString; } } /* Error */ public FQ(String paramString, int paramInt, short paramShort1, short paramShort2) { // Byte code: // 0: goto +190 -> 190 // 3: astore_1 // 4: aload_1 // 5: athrow // 6: astore_1 // 7: aload_1 // 8: athrow // 9: iconst_0 // 10: istore_2 // 11: goto +21 -> 32 // 14: aload_0 // 15: iload 5 // 17: putfield 69 o/FQ:isSuperPrimary Z // 20: goto +94 -> 114 // 23: iconst_1 // 24: istore 5 // 26: goto -12 -> 14 // 29: goto +144 -> 173 // 32: iload_2 // 33: tableswitch default:+23->56, 0:+-4->29, 1:+110->143 // 56: goto -27 -> 29 // 59: bipush 36 // 61: istore_2 // 62: goto +12 -> 74 // 65: iconst_0 // 66: istore 5 // 68: goto +105 -> 173 // 71: bipush 19 // 73: istore_2 // 74: iload_2 // 75: lookupswitch default:+25->100, 19:+28->103, 36:+-52->23 // 100: goto -77 -> 23 // 103: iconst_0 // 104: istore 5 // 106: goto -92 -> 14 // 109: iconst_1 // 110: istore_2 // 111: goto -79 -> 32 // 114: getstatic 31 o/FQ:ˊ I // 117: bipush 17 // 119: iadd // 120: istore_2 // 121: iload_2 // 122: sipush 128 // 125: irem // 126: putstatic 33 o/FQ:ॱ I // 129: iload_2 // 130: iconst_2 // 131: irem // 132: ifne +6 -> 138 // 135: goto +4 -> 139 // 138: return // 139: aconst_null // 140: arraylength // 141: istore_2 // 142: return // 143: goto +30 -> 173 // 146: getstatic 33 o/FQ:ॱ I // 149: bipush 79 // 151: iadd // 152: istore_2 // 153: iload_2 // 154: sipush 128 // 157: irem // 158: putstatic 31 o/FQ:ˊ I // 161: iload_2 // 162: iconst_2 // 163: irem // 164: ifeq +6 -> 170 // 167: goto -158 -> 9 // 170: goto -61 -> 109 // 173: aload_0 // 174: iload 5 // 176: putfield 48 o/FQ:isPrimary Z // 179: iload 4 // 181: ifle +6 -> 187 // 184: goto -125 -> 59 // 187: goto -116 -> 71 // 190: aload_0 // 191: invokespecial 55 java/lang/Object:<init> ()V // 194: aload_0 // 195: aload_1 // 196: putfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 199: aload_0 // 200: iload_2 // 201: putfield 61 o/FQ:type I // 204: iload_3 // 205: ifle +6 -> 211 // 208: goto +6 -> 214 // 211: goto -146 -> 65 // 214: iconst_1 // 215: istore 5 // 217: goto -71 -> 146 // Local variable table: // start length slot name signature // 0 220 0 this FQ // 0 220 1 paramString String // 0 220 2 paramInt int // 0 220 3 paramShort1 short // 0 220 4 paramShort2 short // 15 201 5 bool boolean // Exception table: // from to target type // 173 179 3 java/lang/Exception // 194 199 6 java/lang/Exception // 199 204 6 java/lang/Exception } /* Error */ static void ˊ() { // Byte code: // 0: goto +109 -> 109 // 3: bipush 75 // 5: iconst_0 // 6: idiv // 7: istore_0 // 8: return // 9: astore_1 // 10: aload_1 // 11: athrow // 12: astore_1 // 13: aload_1 // 14: athrow // 15: getstatic 31 o/FQ:ˊ I // 18: istore_0 // 19: iload_0 // 20: bipush 113 // 22: iadd // 23: istore_0 // 24: iload_0 // 25: sipush 128 // 28: irem // 29: putstatic 33 o/FQ:ॱ I // 32: iload_0 // 33: iconst_2 // 34: irem // 35: ifne +6 -> 41 // 38: goto +78 -> 116 // 41: goto +30 -> 71 // 44: getstatic 31 o/FQ:ˊ I // 47: bipush 51 // 49: iadd // 50: istore_0 // 51: iload_0 // 52: sipush 128 // 55: irem // 56: putstatic 33 o/FQ:ॱ I // 59: iload_0 // 60: iconst_2 // 61: irem // 62: ifne +6 -> 68 // 65: goto +48 -> 113 // 68: goto +33 -> 101 // 71: bipush 31 // 73: istore_0 // 74: iload_0 // 75: lookupswitch default:+25->100, 27:+-72->3, 31:+37->112 // 100: return // 101: bipush -102 // 103: putstatic 76 o/FQ:ˏ B // 106: goto -91 -> 15 // 109: goto -65 -> 44 // 112: return // 113: goto -12 -> 101 // 116: bipush 27 // 118: istore_0 // 119: goto -45 -> 74 // Local variable table: // start length slot name signature // 7 112 0 i int // 9 2 1 localException1 Exception // 12 2 1 localException2 Exception // Exception table: // from to target type // 24 32 9 java/lang/Exception // 15 19 12 java/lang/Exception } /* Error */ private static String ˋ(int[] paramArrayOfInt, byte[] paramArrayOfByte, boolean paramBoolean) { // Byte code: // 0: goto +186 -> 186 // 3: iload 4 // 5: iload 5 // 7: if_icmpge +6 -> 13 // 10: goto +531 -> 541 // 13: goto +167 -> 180 // 16: getstatic 31 o/FQ:ˊ I // 19: bipush 67 // 21: iadd // 22: istore_3 // 23: iload_3 // 24: sipush 128 // 27: irem // 28: putstatic 33 o/FQ:ॱ I // 31: iload_3 // 32: iconst_2 // 33: irem // 34: ifne +6 -> 40 // 37: goto +427 -> 464 // 40: aload_0 // 41: areturn // 42: iload 6 // 44: ifle +6 -> 50 // 47: goto +214 -> 261 // 50: goto +416 -> 466 // 53: aload 9 // 55: iload_3 // 56: aload_1 // 57: iload 5 // 59: iload_3 // 60: isub // 61: iconst_1 // 62: isub // 63: caload // 64: castore // 65: iload_3 // 66: iconst_1 // 67: iadd // 68: istore_3 // 69: goto +254 -> 323 // 72: getstatic 33 o/FQ:ॱ I // 75: bipush 77 // 77: iadd // 78: istore_3 // 79: iload_3 // 80: sipush 128 // 83: irem // 84: putstatic 31 o/FQ:ˊ I // 87: iload_3 // 88: iconst_2 // 89: irem // 90: ifeq +6 -> 96 // 93: goto +242 -> 335 // 96: goto +509 -> 605 // 99: aload 9 // 101: iload 4 // 103: caload // 104: istore_3 // 105: iload 4 // 107: iconst_1 // 108: iadd // 109: istore 4 // 111: goto -108 -> 3 // 114: aload_0 // 115: iconst_0 // 116: iaload // 117: istore_3 // 118: aload_0 // 119: iconst_1 // 120: iaload // 121: istore 5 // 123: aload_0 // 124: iconst_2 // 125: iaload // 126: istore 6 // 128: aload_0 // 129: iconst_3 // 130: iaload // 131: istore 7 // 133: getstatic 79 o/FQ:ˋ [C // 136: astore 9 // 138: iload 5 // 140: newarray char // 142: astore 10 // 144: aload 9 // 146: iload_3 // 147: aload 10 // 149: iconst_0 // 150: iload 5 // 152: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 155: aload_1 // 156: ifnull +6 -> 162 // 159: goto +126 -> 285 // 162: aload 10 // 164: astore_1 // 165: goto +85 -> 250 // 168: iload_3 // 169: iload 5 // 171: if_icmpge +6 -> 177 // 174: goto +93 -> 267 // 177: goto +313 -> 490 // 180: aload 9 // 182: astore_1 // 183: goto +67 -> 250 // 186: goto -72 -> 114 // 189: iload 5 // 191: newarray char // 193: astore 9 // 195: iconst_0 // 196: istore_3 // 197: goto +214 -> 411 // 200: aload 9 // 202: iload 4 // 204: aload 10 // 206: iload 4 // 208: caload // 209: iconst_1 // 210: ishl // 211: iconst_1 // 212: iadd // 213: iload_3 // 214: isub // 215: i2c // 216: castore // 217: goto -118 -> 99 // 220: aload_1 // 221: iload 4 // 223: baload // 224: iconst_1 // 225: if_icmpne +6 -> 231 // 228: goto -28 -> 200 // 231: goto +241 -> 472 // 234: aload_1 // 235: iload 4 // 237: baload // 238: ifne +6 -> 244 // 241: goto -41 -> 200 // 244: goto +228 -> 472 // 247: astore_0 // 248: aload_0 // 249: athrow // 250: iload 7 // 252: ifle +6 -> 258 // 255: goto +162 -> 417 // 258: goto +273 -> 531 // 261: bipush 65 // 263: istore_3 // 264: goto +238 -> 502 // 267: aload_1 // 268: iload_3 // 269: aload_1 // 270: iload_3 // 271: caload // 272: aload_0 // 273: iconst_2 // 274: iaload // 275: isub // 276: i2c // 277: castore // 278: iload_3 // 279: iconst_1 // 280: iadd // 281: istore_3 // 282: goto +64 -> 346 // 285: getstatic 33 o/FQ:ॱ I // 288: bipush 17 // 290: iadd // 291: istore_3 // 292: iload_3 // 293: sipush 128 // 296: irem // 297: putstatic 31 o/FQ:ˊ I // 300: iload_3 // 301: iconst_2 // 302: irem // 303: ifeq +6 -> 309 // 306: goto +316 -> 622 // 309: goto +318 -> 627 // 312: iload 5 // 314: newarray char // 316: astore 9 // 318: iconst_1 // 319: istore_3 // 320: goto +91 -> 411 // 323: iload_3 // 324: iload 5 // 326: if_icmpge +6 -> 332 // 329: goto +242 -> 571 // 332: goto +284 -> 616 // 335: iload 5 // 337: newarray char // 339: astore 9 // 341: iconst_0 // 342: istore_3 // 343: goto -20 -> 323 // 346: goto -178 -> 168 // 349: iconst_0 // 350: istore_3 // 351: goto -183 -> 168 // 354: iconst_0 // 355: istore_3 // 356: goto -188 -> 168 // 359: getstatic 33 o/FQ:ॱ I // 362: iconst_5 // 363: iadd // 364: istore_3 // 365: iload_3 // 366: sipush 128 // 369: irem // 370: putstatic 31 o/FQ:ˊ I // 373: iload_3 // 374: iconst_2 // 375: irem // 376: ifeq +6 -> 382 // 379: goto -25 -> 354 // 382: goto -33 -> 349 // 385: iload_3 // 386: tableswitch default:+22->408, 0:+-74->312, 1:+-197->189 // 408: goto -96 -> 312 // 411: iconst_0 // 412: istore 4 // 414: goto -411 -> 3 // 417: iload 5 // 419: newarray char // 421: astore 9 // 423: aload_1 // 424: iconst_0 // 425: aload 9 // 427: iconst_0 // 428: iload 5 // 430: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 433: aload 9 // 435: iconst_0 // 436: aload_1 // 437: iload 5 // 439: iload 7 // 441: isub // 442: iload 7 // 444: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 447: aload 9 // 449: iload 7 // 451: aload_1 // 452: iconst_0 // 453: iload 5 // 455: iload 7 // 457: isub // 458: invokestatic 85 java/lang/System:arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V // 461: goto +70 -> 531 // 464: aload_0 // 465: areturn // 466: bipush 11 // 468: istore_3 // 469: goto +33 -> 502 // 472: aload 9 // 474: iload 4 // 476: aload 10 // 478: iload 4 // 480: caload // 481: iconst_1 // 482: ishl // 483: iload_3 // 484: isub // 485: i2c // 486: castore // 487: goto -388 -> 99 // 490: new 87 java/lang/String // 493: dup // 494: aload_1 // 495: invokespecial 90 java/lang/String:<init> ([C)V // 498: astore_0 // 499: goto -483 -> 16 // 502: iload_3 // 503: lookupswitch default:+25->528, 11:+-13->490, 65:+-144->359 // 528: goto -169 -> 359 // 531: iload_2 // 532: ifeq +6 -> 538 // 535: goto -463 -> 72 // 538: goto -496 -> 42 // 541: getstatic 31 o/FQ:ˊ I // 544: bipush 19 // 546: iadd // 547: istore 8 // 549: iload 8 // 551: sipush 128 // 554: irem // 555: putstatic 33 o/FQ:ॱ I // 558: iload 8 // 560: iconst_2 // 561: irem // 562: ifne +6 -> 568 // 565: goto -331 -> 234 // 568: goto -348 -> 220 // 571: getstatic 31 o/FQ:ˊ I // 574: istore 4 // 576: iload 4 // 578: bipush 27 // 580: iadd // 581: istore 4 // 583: iload 4 // 585: sipush 128 // 588: irem // 589: putstatic 33 o/FQ:ॱ I // 592: iload 4 // 594: iconst_2 // 595: irem // 596: ifne +6 -> 602 // 599: goto -546 -> 53 // 602: goto -549 -> 53 // 605: iload 5 // 607: newarray char // 609: astore 9 // 611: iconst_0 // 612: istore_3 // 613: goto -290 -> 323 // 616: aload 9 // 618: astore_1 // 619: goto -577 -> 42 // 622: iconst_0 // 623: istore_3 // 624: goto -239 -> 385 // 627: iconst_1 // 628: istore_3 // 629: goto -244 -> 385 // 632: astore_0 // 633: aload_0 // 634: athrow // Local variable table: // start length slot name signature // 0 635 0 paramArrayOfInt int[] // 0 635 1 paramArrayOfByte byte[] // 0 635 2 paramBoolean boolean // 22 607 3 i int // 3 593 4 j int // 5 601 5 k int // 42 85 6 m int // 131 327 7 n int // 547 15 8 i1 int // 53 564 9 arrayOfChar1 char[] // 142 335 10 arrayOfChar2 char[] // Exception table: // from to target type // 433 447 247 java/lang/Exception // 447 461 247 java/lang/Exception // 583 592 247 java/lang/Exception // 423 433 632 java/lang/Exception // 571 576 632 java/lang/Exception } private static String ˏ(String paramString) { break label82; int i = 89; for (;;) { try { int j = arrayOfByte.length; if (i >= j) { continue; i = 66; continue; continue; continue; paramString[i] = ((byte)(arrayOfByte[(arrayOfByte.length - i - 1)] ^ ˏ)); i += 1; j = ॱ + 109; ˊ = j % 128; if (j % 2 != 0) { continue; } continue; label82: i = ॱ + 119; ˊ = i % 128; if (i % 2 != 0) { continue; } break; j = 1; } switch (j) { case 0: default: continue; arrayOfByte = paramString.getBytes(ˋ(new int[] { 4, 10, 0, 1 }, new byte[] { 1, 0, 0, 0, 0, 1, 0, 1, 0, 0 }, false).intern()); paramString = new byte[arrayOfByte.length]; i = 0; continue; j = 0; continue; switch (i) { } break; case 1: paramString = new String(paramString, ˋ(new int[] { 14, 5, 0, 5 }, new byte[] { 0, 1, 1, 0, 1 }, true).intern()); return paramString; } } catch (UnsupportedEncodingException paramString) { throw new RuntimeException(paramString); } byte[] arrayOfByte = paramString.getBytes(ˋ(new int[] { 4, 10, 0, 1 }, new byte[] { 1, 0, 0, 0, 0, 1, 0, 1, 0, 0 }, true).intern()); paramString = new byte[arrayOfByte.length]; i = 0; } } static void ˏ() { ˋ = new char[] { 13, 15, 8, 11, 36, 61, 47, 51, 55, 54, 56, 50, 62, 81, 28, 50, 57, 77, 84 }; } /* Error */ public static String ॱ(android.content.Context paramContext, FQ paramFQ, boolean paramBoolean) { // Byte code: // 0: goto +266 -> 266 // 3: iconst_1 // 4: istore_3 // 5: goto +601 -> 606 // 8: aload_0 // 9: getstatic 135 o/DY$If:phone_number_display_with_type I // 12: invokevirtual 141 android/content/Context:getString (I)Ljava/lang/String; // 15: astore 4 // 17: aload 4 // 19: iconst_4 // 20: newarray int // 22: dup // 23: iconst_0 // 24: iconst_0 // 25: iastore // 26: dup // 27: iconst_1 // 28: iconst_4 // 29: iastore // 30: dup // 31: iconst_2 // 32: iconst_0 // 33: iastore // 34: dup // 35: iconst_3 // 36: iconst_2 // 37: iastore // 38: iconst_4 // 39: newarray byte // 41: dup // 42: iconst_0 // 43: ldc 16 // 45: bastore // 46: dup // 47: iconst_1 // 48: ldc 94 // 50: bastore // 51: dup // 52: iconst_2 // 53: ldc 94 // 55: bastore // 56: dup // 57: iconst_3 // 58: ldc 94 // 60: bastore // 61: iconst_1 // 62: invokestatic 96 o/FQ:ˋ ([I[BZ)Ljava/lang/String; // 65: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 68: invokevirtual 145 java/lang/String:startsWith (Ljava/lang/String;)Z // 71: ifeq +6 -> 77 // 74: goto +569 -> 643 // 77: goto +105 -> 182 // 80: iload_3 // 81: lookupswitch default:+27->108, 6:+230->311, 16:+470->551 // 108: goto +203 -> 311 // 111: bipush 89 // 113: istore_3 // 114: goto +570 -> 684 // 117: bipush 62 // 119: istore_3 // 120: iload_3 // 121: lookupswitch default:+27->148, 47:+148->269, 62:+286->407 // 148: goto +259 -> 407 // 151: aload_0 // 152: iconst_2 // 153: anewarray 4 java/lang/Object // 156: dup // 157: iconst_0 // 158: aload 6 // 160: aastore // 161: dup // 162: iconst_1 // 163: aload_1 // 164: aastore // 165: invokestatic 149 java/lang/String:format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; // 168: areturn // 169: aload_1 // 170: ifnull +6 -> 176 // 173: goto +188 -> 361 // 176: goto +461 -> 637 // 179: astore_0 // 180: aload_0 // 181: athrow // 182: bipush 62 // 184: istore_3 // 185: goto +182 -> 367 // 188: aload_0 // 189: getstatic 135 o/DY$If:phone_number_display_with_type I // 192: invokevirtual 141 android/content/Context:getString (I)Ljava/lang/String; // 195: astore_0 // 196: aload_0 // 197: iconst_4 // 198: newarray int // 200: dup // 201: iconst_0 // 202: iconst_0 // 203: iastore // 204: dup // 205: iconst_1 // 206: iconst_4 // 207: iastore // 208: dup // 209: iconst_2 // 210: iconst_0 // 211: iastore // 212: dup // 213: iconst_3 // 214: iconst_2 // 215: iastore // 216: iconst_4 // 217: newarray byte // 219: dup // 220: iconst_0 // 221: ldc 16 // 223: bastore // 224: dup // 225: iconst_1 // 226: ldc 94 // 228: bastore // 229: dup // 230: iconst_2 // 231: ldc 94 // 233: bastore // 234: dup // 235: iconst_3 // 236: ldc 94 // 238: bastore // 239: iconst_1 // 240: invokestatic 96 o/FQ:ˋ ([I[BZ)Ljava/lang/String; // 243: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 246: invokevirtual 145 java/lang/String:startsWith (Ljava/lang/String;)Z // 249: ifeq +9 -> 258 // 252: aload_0 // 253: astore 5 // 255: goto +469 -> 724 // 258: goto +55 -> 313 // 261: iconst_1 // 262: istore_3 // 263: goto +17 -> 280 // 266: goto -97 -> 169 // 269: aload 7 // 271: aload_1 // 272: getfield 61 o/FQ:type I // 275: aaload // 276: astore_1 // 277: goto +302 -> 579 // 280: iload_3 // 281: lookupswitch default:+27->308, 1:+-93->188, 31:+-273->8 // 308: goto -120 -> 188 // 311: aconst_null // 312: areturn // 313: aload_1 // 314: getfield 61 o/FQ:type I // 317: aload 7 // 319: arraylength // 320: if_icmpge +6 -> 326 // 323: goto +26 -> 349 // 326: goto -209 -> 117 // 329: aload_1 // 330: iconst_4 // 331: invokevirtual 152 java/lang/String:substring (I)Ljava/lang/String; // 334: invokestatic 154 o/FQ:ˏ (Ljava/lang/String;)Ljava/lang/String; // 337: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 340: astore_0 // 341: bipush 37 // 343: iconst_0 // 344: idiv // 345: istore_3 // 346: goto +309 -> 655 // 349: bipush 47 // 351: istore_3 // 352: goto -232 -> 120 // 355: goto -204 -> 151 // 358: astore_0 // 359: aload_0 // 360: athrow // 361: bipush 16 // 363: istore_3 // 364: goto -284 -> 80 // 367: aload 4 // 369: astore_0 // 370: aload 4 // 372: astore 5 // 374: iload_3 // 375: lookupswitch default:+25->400, 51:+349->724, 62:+-62->313 // 400: aload 4 // 402: astore 5 // 404: goto +320 -> 724 // 407: aload 7 // 409: bipush 6 // 411: aaload // 412: astore_1 // 413: goto +308 -> 721 // 416: getstatic 157 o/DY$If:phone_number_display I // 419: istore_3 // 420: aload_0 // 421: iload_3 // 422: invokevirtual 141 android/content/Context:getString (I)Ljava/lang/String; // 425: astore_1 // 426: aload_1 // 427: iconst_4 // 428: newarray int // 430: dup // 431: iconst_0 // 432: iconst_0 // 433: iastore // 434: dup // 435: iconst_1 // 436: iconst_4 // 437: iastore // 438: dup // 439: iconst_2 // 440: iconst_0 // 441: iastore // 442: dup // 443: iconst_3 // 444: iconst_2 // 445: iastore // 446: iconst_4 // 447: newarray byte // 449: dup // 450: iconst_0 // 451: ldc 16 // 453: bastore // 454: dup // 455: iconst_1 // 456: ldc 94 // 458: bastore // 459: dup // 460: iconst_2 // 461: ldc 94 // 463: bastore // 464: dup // 465: iconst_3 // 466: ldc 94 // 468: bastore // 469: iconst_1 // 470: invokestatic 96 o/FQ:ˋ ([I[BZ)Ljava/lang/String; // 473: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 476: invokevirtual 145 java/lang/String:startsWith (Ljava/lang/String;)Z // 479: ifeq +6 -> 485 // 482: goto -479 -> 3 // 485: goto +61 -> 546 // 488: getstatic 31 o/FQ:ˊ I // 491: istore_3 // 492: iload_3 // 493: bipush 111 // 495: iadd // 496: istore_3 // 497: iload_3 // 498: sipush 128 // 501: irem // 502: putstatic 33 o/FQ:ॱ I // 505: iload_3 // 506: iconst_2 // 507: irem // 508: ifne +6 -> 514 // 511: goto -250 -> 261 // 514: goto +135 -> 649 // 517: getstatic 33 o/FQ:ॱ I // 520: istore_3 // 521: iload_3 // 522: bipush 79 // 524: iadd // 525: istore_3 // 526: iload_3 // 527: sipush 128 // 530: irem // 531: putstatic 31 o/FQ:ˊ I // 534: iload_3 // 535: iconst_2 // 536: irem // 537: ifeq +6 -> 543 // 540: goto -211 -> 329 // 543: goto +126 -> 669 // 546: iconst_0 // 547: istore_3 // 548: goto +58 -> 606 // 551: aload_1 // 552: invokevirtual 159 o/FQ:ॱ ()Ljava/lang/String; // 555: astore 6 // 557: aload_0 // 558: invokevirtual 163 android/content/Context:getResources ()Landroid/content/res/Resources; // 561: getstatic 168 o/DY$ˋ:phone_types I // 564: invokevirtual 174 android/content/res/Resources:getStringArray (I)[Ljava/lang/String; // 567: astore 7 // 569: iload_2 // 570: ifeq +6 -> 576 // 573: goto -462 -> 111 // 576: goto +139 -> 715 // 579: getstatic 31 o/FQ:ˊ I // 582: bipush 51 // 584: iadd // 585: istore_3 // 586: iload_3 // 587: sipush 128 // 590: irem // 591: putstatic 33 o/FQ:ॱ I // 594: iload_3 // 595: iconst_2 // 596: irem // 597: ifne +6 -> 603 // 600: goto +140 -> 740 // 603: goto -248 -> 355 // 606: aload_1 // 607: astore_0 // 608: iload_3 // 609: tableswitch default:+23->632, 0:+46->655, 1:+-92->517 // 632: aload_1 // 633: astore_0 // 634: goto +21 -> 655 // 637: bipush 6 // 639: istore_3 // 640: goto -560 -> 80 // 643: bipush 51 // 645: istore_3 // 646: goto -279 -> 367 // 649: bipush 31 // 651: istore_3 // 652: goto -372 -> 280 // 655: aload_0 // 656: iconst_1 // 657: anewarray 4 java/lang/Object // 660: dup // 661: iconst_0 // 662: aload 6 // 664: aastore // 665: invokestatic 149 java/lang/String:format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; // 668: areturn // 669: aload_1 // 670: iconst_4 // 671: invokevirtual 152 java/lang/String:substring (I)Ljava/lang/String; // 674: invokestatic 154 o/FQ:ˏ (Ljava/lang/String;)Ljava/lang/String; // 677: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 680: astore_0 // 681: goto -26 -> 655 // 684: iload_3 // 685: lookupswitch default:+27->712, 70:+-269->416, 89:+-197->488 // 712: goto -296 -> 416 // 715: bipush 70 // 717: istore_3 // 718: goto -34 -> 684 // 721: goto -570 -> 151 // 724: aload 5 // 726: iconst_4 // 727: invokevirtual 152 java/lang/String:substring (I)Ljava/lang/String; // 730: invokestatic 154 o/FQ:ˏ (Ljava/lang/String;)Ljava/lang/String; // 733: invokevirtual 99 java/lang/String:intern ()Ljava/lang/String; // 736: astore_0 // 737: goto -424 -> 313 // 740: goto -385 -> 355 // Local variable table: // start length slot name signature // 0 743 0 paramContext android.content.Context // 0 743 1 paramFQ FQ // 0 743 2 paramBoolean boolean // 4 714 3 i int // 15 386 4 str1 String // 253 472 5 localObject Object // 158 505 6 str2 String // 269 299 7 arrayOfString String[] // Exception table: // from to target type // 488 492 179 java/lang/Exception // 497 505 179 java/lang/Exception // 517 521 179 java/lang/Exception // 526 534 179 java/lang/Exception // 416 420 358 java/lang/Exception } public int describeContents() { for (;;) { int i = ॱ + 111; ˊ = i % 128; if (i % 2 == 0) { break label30; } label30: return 0; i = ॱ + 7; ˊ = i % 128; if (i % 2 != 0) {} } } /* Error */ public boolean equals(Object paramObject) { // Byte code: // 0: goto +6 -> 6 // 3: goto +174 -> 177 // 6: goto +254 -> 260 // 9: iload_2 // 10: tableswitch default:+22->32, 0:+61->71, 1:+41->51 // 32: goto +39 -> 71 // 35: iconst_1 // 36: istore_2 // 37: goto -28 -> 9 // 40: aload_0 // 41: aload_1 // 42: if_acmpne +6 -> 48 // 45: goto +134 -> 179 // 48: goto +169 -> 217 // 51: aload_0 // 52: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 55: aload_1 // 56: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 59: invokevirtual 179 java/lang/String:equals (Ljava/lang/Object;)Z // 62: ifeq +6 -> 68 // 65: goto +105 -> 170 // 68: goto +160 -> 228 // 71: goto +64 -> 135 // 74: astore_1 // 75: aload_1 // 76: athrow // 77: getstatic 33 o/FQ:ॱ I // 80: bipush 43 // 82: iadd // 83: istore_2 // 84: iload_2 // 85: sipush 128 // 88: irem // 89: putstatic 31 o/FQ:ˊ I // 92: iload_2 // 93: iconst_2 // 94: irem // 95: ifeq +6 -> 101 // 98: goto +77 -> 175 // 101: goto +74 -> 175 // 104: iload_2 // 105: lookupswitch default:+27->132, 2:+117->222, 31:+-34->71 // 132: goto -61 -> 71 // 135: iconst_0 // 136: ireturn // 137: iload_2 // 138: tableswitch default:+22->160, 0:+149->287, 1:+-135->3 // 160: goto -157 -> 3 // 163: iconst_0 // 164: istore_2 // 165: goto -156 -> 9 // 168: iconst_1 // 169: ireturn // 170: iconst_2 // 171: istore_2 // 172: goto -68 -> 104 // 175: iconst_0 // 176: ireturn // 177: iconst_1 // 178: ireturn // 179: iconst_1 // 180: istore_2 // 181: goto -44 -> 137 // 184: aload_0 // 185: invokevirtual 183 java/lang/Object:getClass ()Ljava/lang/Class; // 188: aload_1 // 189: invokevirtual 183 java/lang/Object:getClass ()Ljava/lang/Class; // 192: if_acmpeq +6 -> 198 // 195: goto +30 -> 225 // 198: goto +36 -> 234 // 201: bipush 99 // 203: iconst_0 // 204: idiv // 205: istore_2 // 206: aload_0 // 207: aload_1 // 208: if_acmpne +6 -> 214 // 211: goto -208 -> 3 // 214: goto +73 -> 287 // 217: iconst_0 // 218: istore_2 // 219: goto -82 -> 137 // 222: goto -54 -> 168 // 225: goto -148 -> 77 // 228: bipush 31 // 230: istore_2 // 231: goto -127 -> 104 // 234: aload_1 // 235: checkcast 2 o/FQ // 238: astore_1 // 239: aload_0 // 240: getfield 61 o/FQ:type I // 243: istore_2 // 244: aload_1 // 245: getfield 61 o/FQ:type I // 248: istore_3 // 249: iload_2 // 250: iload_3 // 251: if_icmpne +6 -> 257 // 254: goto -219 -> 35 // 257: goto -94 -> 163 // 260: getstatic 31 o/FQ:ˊ I // 263: bipush 51 // 265: iadd // 266: istore_2 // 267: iload_2 // 268: sipush 128 // 271: irem // 272: putstatic 33 o/FQ:ॱ I // 275: iload_2 // 276: iconst_2 // 277: irem // 278: ifne +6 -> 284 // 281: goto -80 -> 201 // 284: goto -244 -> 40 // 287: aload_1 // 288: ifnull +6 -> 294 // 291: goto -107 -> 184 // 294: goto -69 -> 225 // Local variable table: // start length slot name signature // 0 297 0 this FQ // 0 297 1 paramObject Object // 9 269 2 i int // 248 4 3 j int // Exception table: // from to target type // 234 239 74 java/lang/Exception // 239 244 74 java/lang/Exception // 244 249 74 java/lang/Exception } /* Error */ public int hashCode() { // Byte code: // 0: goto +55 -> 55 // 3: iload_1 // 4: tableswitch default:+24->28, 0:+81->85, 1:+27->31 // 28: goto +57 -> 85 // 31: aload_0 // 32: getfield 61 o/FQ:type I // 35: bipush 31 // 37: imul // 38: aload_0 // 39: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 42: invokevirtual 186 java/lang/String:hashCode ()I // 45: iadd // 46: istore_1 // 47: goto +62 -> 109 // 50: iconst_1 // 51: istore_1 // 52: goto -49 -> 3 // 55: getstatic 31 o/FQ:ˊ I // 58: bipush 87 // 60: iadd // 61: istore_1 // 62: iload_1 // 63: sipush 128 // 66: irem // 67: putstatic 33 o/FQ:ॱ I // 70: iload_1 // 71: iconst_2 // 72: irem // 73: ifne +6 -> 79 // 76: goto +28 -> 104 // 79: goto -29 -> 50 // 82: astore_3 // 83: aload_3 // 84: athrow // 85: aload_0 // 86: getfield 61 o/FQ:type I // 89: bipush 57 // 91: imul // 92: aload_0 // 93: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 96: invokevirtual 186 java/lang/String:hashCode ()I // 99: ishr // 100: istore_1 // 101: goto +8 -> 109 // 104: iconst_0 // 105: istore_1 // 106: goto -103 -> 3 // 109: getstatic 31 o/FQ:ˊ I // 112: istore_2 // 113: iload_2 // 114: bipush 21 // 116: iadd // 117: istore_2 // 118: iload_2 // 119: sipush 128 // 122: irem // 123: putstatic 33 o/FQ:ॱ I // 126: iload_2 // 127: iconst_2 // 128: irem // 129: ifne +5 -> 134 // 132: iload_1 // 133: ireturn // 134: iload_1 // 135: ireturn // Local variable table: // start length slot name signature // 0 136 0 this FQ // 3 132 1 i int // 112 17 2 j int // 82 2 3 localException Exception // Exception table: // from to target type // 109 113 82 java/lang/Exception // 118 126 82 java/lang/Exception } public String toString() { break label86; String str; int i; for (;;) { str = ॱ(); throw new NullPointerException(); str = ॱ(); break; switch (i) { } } for (;;) { i = 1; break; label86: do { i = 0; break; i = ˊ + 111; ॱ = i % 128; if (i % 2 == 0) { return str; } return str; i = ॱ + 85; ˊ = i % 128; } while (i % 2 != 0); } } /* Error */ public void writeToParcel(Parcel paramParcel, int paramInt) { // Byte code: // 0: goto +79 -> 79 // 3: iconst_1 // 4: istore_2 // 5: getstatic 31 o/FQ:ˊ I // 8: bipush 51 // 10: iadd // 11: istore_3 // 12: iload_3 // 13: sipush 128 // 16: irem // 17: putstatic 33 o/FQ:ॱ I // 20: iload_3 // 21: iconst_2 // 22: irem // 23: ifne +6 -> 29 // 26: goto +127 -> 153 // 29: goto +3 -> 32 // 32: aload_1 // 33: iload_2 // 34: i2b // 35: invokevirtual 196 android/os/Parcel:writeByte (B)V // 38: return // 39: iconst_1 // 40: istore_2 // 41: goto +115 -> 156 // 44: astore_1 // 45: aload_1 // 46: athrow // 47: iload_2 // 48: lookupswitch default:+28->76, 17:+-9->39, 20:+218->266 // 76: goto +190 -> 266 // 79: goto +227 -> 306 // 82: astore_1 // 83: aload_1 // 84: athrow // 85: getstatic 33 o/FQ:ॱ I // 88: iconst_5 // 89: iadd // 90: istore_3 // 91: iload_3 // 92: sipush 128 // 95: irem // 96: putstatic 31 o/FQ:ˊ I // 99: iload_3 // 100: iconst_2 // 101: irem // 102: ifeq +6 -> 108 // 105: goto +198 -> 303 // 108: goto -76 -> 32 // 111: bipush 17 // 113: istore_2 // 114: goto -67 -> 47 // 117: aload_1 // 118: aload_0 // 119: getfield 61 o/FQ:type I // 122: invokevirtual 200 android/os/Parcel:writeInt (I)V // 125: aload_1 // 126: aload_0 // 127: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 130: invokevirtual 203 android/os/Parcel:writeString (Ljava/lang/String;)V // 133: aload_0 // 134: getfield 48 o/FQ:isPrimary Z // 137: istore 4 // 139: aconst_null // 140: arraylength // 141: istore_2 // 142: iload 4 // 144: ifeq +6 -> 150 // 147: goto +124 -> 271 // 150: goto +148 -> 298 // 153: goto -124 -> 29 // 156: aload_1 // 157: iload_2 // 158: i2b // 159: invokevirtual 196 android/os/Parcel:writeByte (B)V // 162: aload_0 // 163: getfield 69 o/FQ:isSuperPrimary Z // 166: ifeq +6 -> 172 // 169: goto +6 -> 175 // 172: goto +88 -> 260 // 175: bipush 75 // 177: istore_2 // 178: goto +48 -> 226 // 181: aload_0 // 182: getfield 61 o/FQ:type I // 185: istore_2 // 186: aload_1 // 187: iload_2 // 188: invokevirtual 200 android/os/Parcel:writeInt (I)V // 191: aload_0 // 192: getfield 67 o/FQ:contactPhoneNumber Ljava/lang/String; // 195: astore 5 // 197: aload_1 // 198: aload 5 // 200: invokevirtual 203 android/os/Parcel:writeString (Ljava/lang/String;)V // 203: aload_0 // 204: getfield 48 o/FQ:isPrimary Z // 207: istore 4 // 209: iload 4 // 211: ifeq +6 -> 217 // 214: goto +57 -> 271 // 217: goto +81 -> 298 // 220: bipush 20 // 222: istore_2 // 223: goto -176 -> 47 // 226: iload_2 // 227: lookupswitch default:+25->252, 46:+28->255, 75:+-224->3 // 252: goto -249 -> 3 // 255: iconst_0 // 256: istore_2 // 257: goto -172 -> 85 // 260: bipush 46 // 262: istore_2 // 263: goto -37 -> 226 // 266: iconst_1 // 267: istore_2 // 268: goto -112 -> 156 // 271: getstatic 31 o/FQ:ˊ I // 274: bipush 75 // 276: iadd // 277: istore_2 // 278: iload_2 // 279: sipush 128 // 282: irem // 283: putstatic 33 o/FQ:ॱ I // 286: iload_2 // 287: iconst_2 // 288: irem // 289: ifne +6 -> 295 // 292: goto -181 -> 111 // 295: goto -75 -> 220 // 298: iconst_0 // 299: istore_2 // 300: goto -144 -> 156 // 303: goto -271 -> 32 // 306: getstatic 33 o/FQ:ॱ I // 309: bipush 51 // 311: iadd // 312: istore_2 // 313: iload_2 // 314: sipush 128 // 317: irem // 318: putstatic 31 o/FQ:ˊ I // 321: iload_2 // 322: iconst_2 // 323: irem // 324: ifeq +6 -> 330 // 327: goto -210 -> 117 // 330: goto -149 -> 181 // Local variable table: // start length slot name signature // 0 333 0 this FQ // 0 333 1 paramParcel Parcel // 0 333 2 paramInt int // 11 91 3 i int // 137 73 4 bool boolean // 195 4 5 str String // Exception table: // from to target type // 181 186 44 java/lang/Exception // 186 191 44 java/lang/Exception // 191 197 44 java/lang/Exception // 197 203 44 java/lang/Exception // 203 209 44 java/lang/Exception // 186 191 82 java/lang/Exception } public String ˊ(String paramString) { label151: label160: label173: for (;;) { return this.contactPhoneNumber; int i = 52; for (;;) { paramString = paramString + this.contactPhoneNumber; try { for (;;) { i = ˊ; i += 17; ॱ = i % 128; if (i % 2 == 0) { break; } break label151; } i = ˊ + 107; ॱ = i % 128; if (i % 2 == 0) { return paramString; } return paramString; boolean bool = aq.ॱॱ(this.contactPhoneNumber); i = 34 / 0; if (bool) { break; for (;;) { switch (i) { case 52: default: break label160; i = 94; } } if (aq.ॱॱ(this.contactPhoneNumber)) { break label173; } } } catch (Exception paramString) { throw paramString; } } } return paramString; } public String ॱ() { try { int i = ˊ + 89; try { ॱ = i % 128; if (i % 2 == 0) { break label30; } } catch (Exception localException1) { throw localException1; } label30: String str = this.contactPhoneNumber; str = aq.ˏ(str); i = ॱ + 37; ˊ = i % 128; if (i % 2 != 0) { return str; } return str; } catch (Exception localException2) { throw localException2; } } }
41,519
0.470402
0.319378
1,572
25.31743
14.8433
138
false
false
0
0
0
0
0
0
0.526081
false
false
7