blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cf938ab8f76e1316aaec83815ae2557acad99359 | abb41f06c4d7d3fdfbdbecaee8c71e4489dd5175 | /src/test/java/unit/javamop/helper/ExpectedOutputGenerator.java | 9d157bcce8c8d11d19963ccbca6e01e067f67d66 | [
"MIT",
"NCSA"
] | permissive | andyglick/javamop | 9cbcf738cb913db5138d54dbcf91012bdad91801 | f732053b6ed497d1f1135603697bf83061b5c234 | refs/heads/master | 2023-04-13T19:37:18.686098 | 2020-10-13T06:48:50 | 2020-10-13T15:57:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,392 | java | package javamop.helper;
import examples.ExamplesIT;
import javamop.JavaMOPMain;
import javamop.JavaMOPOptions;
import javamop.output.MOPProcessor;
import javamop.parser.SpecExtractor;
import javamop.parser.SpecExtractorTest;
import javamop.parser.ast.MOPSpecFile;
import javamop.util.MOPException;
import javamop.util.MOPNameSpace;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
/**
* Created by xiaohe on 4/15/16.
*/
public class ExpectedOutputGenerator {
/**
* Generate the trusted AST files, invoked once in version 4.4;
*
* @param args
* @throws MOPException
*/
public static void main(String[] args) throws MOPException, IOException {
Path outputDir = Paths.get("src" + File.separator + "test" + File.separator
+ "resources");
//generate some serialization files from mop specs.
Object[] inputList = ExamplesIT.data().toArray();
String expectedOutputPrefix = SpecExtractorTest.astPrefix + "output" + File.separator;
JavaMOPMain.options = new JavaMOPOptions();
for (int i = 0; i < inputList.length; i++) {
if (MOP_Serialization.contains(MOP_Serialization.selectedTestCases, i)) {
String mopFilePath = (String) ((ArrayList<Object[]>) ExamplesIT.data()).get(i)[0];
String testName = mopFilePath.substring
(mopFilePath.lastIndexOf(File.separator) + 1);
String aspectName = testName.substring(0, testName.lastIndexOf("."));
String inputASTPath = SpecExtractorTest.astPrefix + testName + ".ser";
MOPSpecFile inputAST = MOP_Serialization.readMOPSpecObjectFromFile(inputASTPath);
MOPProcessor processor = new MOPProcessor(aspectName);
MOPNameSpace.init();
String actualRVString = processor.generateRVFile(inputAST);
String actualAJString = processor.generateAJFile(inputAST);
String ajOutputPath = expectedOutputPrefix + testName + ".aj";
String rvOutputPath = expectedOutputPrefix + testName + ".rvm";
IOUtils.write2File(actualAJString, Paths.get(ajOutputPath));
IOUtils.write2File(actualRVString, Paths.get(rvOutputPath));
}
}
}
}
| [
"xiaoguoyi27@gmail.com"
] | xiaoguoyi27@gmail.com |
f32330d9c58da086ad37186be9cb11c55881953e | d47e5806106f89d880d036507ee0835a7ed2dbb0 | /ktf-file-parser/src/test/java/com/ktf/parser/sample/fixed/Customer.java | 7c95830ef24d01805b45d7641710bf567ef3a20a | [] | no_license | kivilu/ktf | 8b59198d8fb096961c92fe395a7f266b9ed350af | adf55e6a8f9c0b6c1965cbb391a9c189318ee0ca | refs/heads/master | 2020-03-19T06:37:06.396632 | 2019-03-14T09:10:20 | 2019-03-14T09:10:20 | 136,039,313 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,268 | java | /*
* Customer.java
*
* Copyright (C) 2007 Felipe Gon�alves Coury <felipe.coury@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.ktf.parser.sample.fixed;
import java.util.Date;
import com.ktf.parser.annotations.FieldAlign;
import com.ktf.parser.annotations.FieldConverter;
import com.ktf.parser.annotations.FieldFixedLength;
import com.ktf.parser.annotations.FieldOptional;
import com.ktf.parser.annotations.FieldTrim;
import com.ktf.parser.annotations.FixedLengthRecord;
import com.ktf.parser.enums.AlignMode;
import com.ktf.parser.enums.ConverterKind;
import com.ktf.parser.enums.TrimMode;
import com.ktf.parser.helpers.StringHelper;
@FixedLengthRecord( )
public class Customer {
@FieldFixedLength( 4 )
private Integer custId;
@FieldAlign( alignMode = AlignMode.Right )
@FieldFixedLength( 20 )
private String name;
@FieldFixedLength( 3 )
private Integer rating;
@FieldTrim( trimMode = TrimMode.Right )
@FieldFixedLength( 10 )
@FieldConverter( converter = ConverterKind.Date, format = "dd-MM-yyyy" )
private Date addedDate;
@FieldFixedLength( 3 )
@FieldOptional
private String stockSimbol;
@Override
public String toString() {
String l = System.getProperty("line.separator");
StringBuffer b = new StringBuffer();
b.append("Customer: ").append(l);
b.append(" custId = " + custId).append(l);
b.append(" name = " + name).append(l);
b.append(" rating = " + rating).append(l);
b.append(" addedDate = " + addedDate).append(l);
b.append(" stockSimbol = " + stockSimbol).append(l);
return StringHelper.toStringBuilder(this, b.toString());
}
public Integer getCustId() {
return custId;
}
public void setCustId( Integer custId ) {
this.custId = custId;
}
public String getName() {
return name;
}
public void setName( String name ) {
this.name = name;
}
public Integer getRating() {
return rating;
}
public void setRating( Integer rating ) {
this.rating = rating;
}
public Date getAddedDate() {
return addedDate;
}
public void setAddedDate( Date addedDate ) {
this.addedDate = addedDate;
}
public String getStockSimbol() {
return stockSimbol;
}
public void setStockSimbol( String stockSimbol ) {
this.stockSimbol = stockSimbol;
}
}
| [
"michael_0877@163.com"
] | michael_0877@163.com |
73f71285537c4463b22a56b79c26752f2b57a52b | d0ef619711aa25ee248bb6cecc03172f5b8ed1d7 | /src/main/java/com/vlogplusplus/service/impl/LoginService.java | b95fc5015ba5b0a8e4c2c5e1fe39afdc74a3aab0 | [] | no_license | dystudio/sms-2 | 9b0c5a413f4c9b5a4812a769e9b5d9c29659850d | 1d3d67be0df6a837ca91a4b3ab32367ac69009b9 | refs/heads/master | 2022-04-08T10:33:41.198536 | 2020-03-10T15:56:19 | 2020-03-10T15:56:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.vlogplusplus.service.impl;
import com.vlogplusplus.dao.ILoginDao;
import com.vlogplusplus.entity.Login;
import com.vlogplusplus.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class LoginService implements ILoginService {
@Autowired
private ILoginDao iLoginDao;
@Override
public Login login(String username, String password) {
return iLoginDao.login(username, password);
}
}
| [
"cnxfs@qq.com"
] | cnxfs@qq.com |
ff469d9acad887ff802e2d1448ee60d8787e5850 | 7491d268f73927617d11a89510c4e917f24b8a1c | /practice 3/app/src/main/java/ru/mirea/tyve/practice3/MainActivity.java | 376b26d8cb20d64a3f3a9b97e70c503cb7549e64 | [] | no_license | NineDoctor/lab_mobile | 58f1e069239ba99a43b4d52daf29fc2a8b1988c5 | d5d735e43b6d3fa4e8a1031c0d0e6861140062f1 | refs/heads/master | 2023-05-11T04:00:09.428874 | 2021-06-06T21:05:39 | 2021-06-06T21:05:39 | 374,461,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package ru.mirea.tyve.practice3;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
} | [
"mtyve@mail.ru"
] | mtyve@mail.ru |
8c84a3cc5a7e790f1709d3920d7a99cea7964882 | bec4a1443c0c4bc49601e132491d7056233337a2 | /app/src/main/java/wang/relish/android7/sample/shortcuts/ShortcutsAdapter.java | bf631d0944f32fed62591003fb1995d644af8a6c | [] | no_license | luoyiqi/DemoForN | 3f9200d73f57c8ea086bc4e6c9285e004a069a24 | df28f62e5d3e2e0f7acfc76d16333ea6a1e89a15 | refs/heads/master | 2020-06-30T20:23:27.184787 | 2016-11-03T11:54:55 | 2016-11-03T11:54:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,948 | java | package wang.relish.android7.sample.shortcuts;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import wang.relish.android7.R;
import wang.relish.android7.sample.ShortcutsSampleActivity;
public class ShortcutsAdapter extends RecyclerView.Adapter<ShortcutsAdapter.MyViewHolder> {
private List<ShortcutInfo> mShortcuts = new ArrayList<>();
private Context mContext;
private LayoutInflater inflater;
private ShortcutManager mManager;
public ShortcutsAdapter(Context context) {
mContext = context;
inflater = LayoutInflater.from(context);
mManager = mContext.getSystemService(ShortcutManager.class);
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = inflater.inflate(R.layout.rv_item_shortcuts, parent, false);
return new MyViewHolder(v);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
ShortcutInfo shortcut = mShortcuts.get(position);
holder.tv_url.setText(shortcut.getShortLabel());
holder.tv_state.setText("");
holder.btn_remove.setEnabled(true);
holder.btn_remove.setVisibility(View.VISIBLE);
holder.btn_remove.setBackground(ContextCompat.getDrawable(mContext, R.drawable.remove));
holder.btn_disable.setEnabled(true);
holder.btn_disable.setText(R.string.diable_it);
holder.btn_disable.setBackground(ContextCompat.getDrawable(mContext, R.drawable.disable));
if (shortcut.isImmutable()) {
holder.tv_state.append("immutable ");
}
if (shortcut.isDeclaredInManifest()) {
holder.tv_state.append("declared_in_manifest ");
}
if (shortcut.isDynamic()) {
holder.tv_state.append("dynamic ");
}
if (shortcut.isPinned()) {
holder.tv_state.append("pinned ");
}
if (!shortcut.isEnabled()) {
//不可用的shortcuts不能被移除和失效
holder.btn_remove.setVisibility(View.GONE);
holder.btn_disable.setText(R.string.enable_it);
holder.btn_disable.setBackground(ContextCompat.getDrawable(
mContext, android.R.color.holo_orange_dark));
holder.cardView.setEnabled(false);
}
holder.btn_disable.setOnClickListener((View v) -> {
if (shortcut.isImmutable()) {
Toast.makeText(mContext, "Immutable shortcut can't be disabled!", Toast.LENGTH_SHORT).show();
//AndroidManifest.xml里定义的shortcuts不可被失效
holder.btn_disable.setEnabled(false);
holder.btn_disable.setBackground(ContextCompat.getDrawable(
mContext, R.color.dark_gray));
return;
}
if (shortcut.isEnabled()) {
mManager.disableShortcuts(Collections.singletonList(shortcut.getId()));
} else {
mManager.enableShortcuts(Collections.singletonList(shortcut.getId()));
}
setShortcuts(ShortcutsSampleActivity.getShortcuts(mManager));//刷新列表
});
holder.btn_remove.setOnClickListener((View v) -> {
if (shortcut.isImmutable()) {
Toast.makeText(mContext, "Immutable shortcut can't be removed!", Toast.LENGTH_SHORT).show();
//AndroidManifest.xml里定义的shortcuts不可被移除
holder.btn_remove.setEnabled(false);
holder.btn_remove.setBackground(ContextCompat.getDrawable(
mContext, R.color.dark_gray));
return;
}
if (shortcut.isPinned()) {
Toast.makeText(mContext, "Pinned shortcut can't be removed!", Toast.LENGTH_SHORT).show();
holder.btn_remove.setEnabled(false);
holder.btn_remove.setBackground(ContextCompat.getDrawable(mContext, R.color.dark_gray));
return;
}
mManager.removeDynamicShortcuts(Collections.singletonList(shortcut.getId()));
setShortcuts(ShortcutsSampleActivity.getShortcuts(mManager));//刷新列表
});
holder.cardView.setOnClickListener((View v) -> {
if (shortcut.isImmutable()) {
ShortcutsSampleActivity.add(mContext, this, mManager);
} else {
Intent intent = shortcut.getIntent();
mContext.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return mShortcuts == null ? 0 : mShortcuts.size();
}
public void setShortcuts(List<ShortcutInfo> shortcuts) {
mShortcuts.clear();
mShortcuts.addAll(shortcuts);
notifyDataSetChanged();
}
class MyViewHolder extends RecyclerView.ViewHolder {
CardView cardView;
TextView tv_url;
TextView tv_state;
Button btn_disable;
Button btn_remove;
MyViewHolder(View itemView) {
super(itemView);
cardView = (CardView) itemView.findViewById(R.id.card_view);
tv_url = (TextView) itemView.findViewById(R.id.tv_url);
tv_state = (TextView) itemView.findViewById(R.id.tv_state);
btn_disable = (Button) itemView.findViewById(R.id.btn_disable);
btn_remove = (Button) itemView.findViewById(R.id.btn_remove);
}
}
} | [
"wangxina@servyou.com.cn"
] | wangxina@servyou.com.cn |
6eb4ff54f0ad7f5df0e1d20489fc82b01efcf64b | 746f04fbbfc9267b4475c20b4adaaa3ed938e38f | /diamond-router/src/main/java/com/galaxy/hsf/router/plugin/managed/rule/package-info.java | 7d8a27c7ffd8b3d56d627ecd6c4efa0e970927d8 | [] | no_license | xyz-dev/diamond | 1402ceb95dd59ca6a85f3ce4ab89beef05da24da | 5635b70341ce89f132d9e516df06f5c4b4d93938 | refs/heads/master | 2021-01-18T18:21:22.663824 | 2013-05-27T18:37:29 | 2013-05-27T18:37:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 90 | java | /**
*
*/
/**
* @author sihai
*
*/
package com.galaxy.hsf.router.plugin.managed.rule; | [
"iac-rq@live.cn"
] | iac-rq@live.cn |
e27c6ba05c1e5e2c28ca8566bdabf4dfbb0f314d | f21a9bdf65a4725a5e096f9f4ae6a1317aea9935 | /src/com/syntax/class21/MoneerClass.java | 420b1b66d43b57fbd07799663170a6b80f62ee90 | [] | no_license | JasoorKarwar/eclipse-workspace | 4659ac96be31aa185498ee3e78b59f982fc49fa4 | 568d3e54ea2a351a30a1ee2be748e53396065821 | refs/heads/main | 2023-01-14T04:02:09.440124 | 2020-11-11T05:30:25 | 2020-11-11T05:30:25 | 307,253,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | package com.syntax.class21;
public class MoneerClass extends ParentClass {
int money;
MoneerClass(int money) {
super(money);
}
void marry() {
super.marry();
System.out.println("i will marry katrina ok go mary her her is the money " + super.money);
}
public static void main(String[] args) {
MoneerClass moneerClass = new MoneerClass(1000);
moneerClass.marry();
}
} | [
"karwar.jasoor@gmail.com"
] | karwar.jasoor@gmail.com |
143c2bce378c8a6f51b3443692794f79609b251b | 219f8a9f0011ca345418a7ef4cc986a8e1731b42 | /src/main/java/com/hebada/service/GuestBookService.java | 5ff798b2b3386a458b4480a44d978c748e0a82cd | [] | no_license | paddyAndPP/hebada | b792c06b8868c602d6aef734aebc605462709023 | 5eb9987d069d84fc08fc4f3bb356756f1a546344 | refs/heads/master | 2020-12-24T06:18:04.846125 | 2016-12-10T04:37:14 | 2016-12-10T04:37:14 | 76,084,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package com.hebada.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.gson.Gson;
import com.hebada.entity.GuestBook;
import com.hebada.repository.GuestBookDao;
import com.hebada.repository.PageResults;
@Service
@Transactional
public class GuestBookService {
@Autowired
private GuestBookDao guestBookdao;
public String findByPage(int page,int row){
List<GuestBook> list = guestBookdao.findByPage(page, row);
Gson gson = new Gson();
return null;
}
}
| [
"405172290@qq.com"
] | 405172290@qq.com |
988ed8790ed6cd91500871f55b78451d8d7834ed | 2bf6b21e77727ea5d57ace27fd8e0f200b8ad106 | /java/edu/cmu/tetrad/graph/UniformGraphGenerator.java | 0efd2be0339b2af430807271782fa14b6823024c | [] | no_license | dachylong/r-causal | c4d43241f3615ec16acf628f44b0a15f9cc00fc4 | 94e9650606419e444d0f7d8f4298c26fc3e3750c | refs/heads/master | 2021-01-14T08:30:43.849667 | 2016-04-04T16:51:47 | 2016-04-04T16:51:47 | 56,122,774 | 1 | 0 | null | 2016-04-13T05:12:07 | 2016-04-13T05:12:07 | null | UTF-8 | Java | false | false | 24,398 | java | ///////////////////////////////////////////////////////////////////////////////
// For information as to what this class does, see the Javadoc, below. //
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, //
// 2007, 2008, 2009, 2010, 2014, 2015 by Peter Spirtes, Richard Scheines, Joseph //
// Ramsey, and Clark Glymour. //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
///////////////////////////////////////////////////////////////////////////////
package edu.cmu.tetrad.graph;
import edu.cmu.tetrad.util.RandomUtil;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
/**
* Generates random DAGs uniformly with certain classes of DAGs using variants
* of Markov chain algorithms by Malancon, Dutour, and Philippe. Pieces of the
* infrastructure of the algorithm are adapted from the the BNGenerator class by
* Jaime Shinsuke Ide jaime.ide@poli.usp.br, released under the GNU General
* Public License, for which the following statement is being included as part
* of the license agreement:
* <p/>
* "The BNGenerator distribution is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation (either version 2 of the License
* or, at your option, any later version), provided that this notice and the
* name of the author appear in all copies. </p> "If you're using the software,
* please notify jaime.ide@poli.usp.br so that you can receive updates and
* patches. BNGenerator is distributed "as is", in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with the BNGenerator distribution. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
* USA."
*
* @author Joseph Ramsey
*/
public final class UniformGraphGenerator {
public static final int ANY_DAG = 0;
public static final int CONNECTED_DAG = 1;
/**
* Indicates the structural assumption. May be ANY_DAG, CONNECTED_DAG.
*/
private int structure;
/**
* The number of nodes in a graph. The default is 4.
*/
private int numNodes;
/**
* The maximum indegree for a node in a graph. The default is 3.
*/
private int maxInDegree;
/**
* The maximum outdegree of a node in a graph. The defualt is 3.
*/
private int maxOutDegree;
/**
* The maximum degree of a node in a graph. The default is the maximum
* number possible (the value -1 is used for this).
*/
private int maxDegree;
/**
* The maximum number of edges in the graph. The default is the number of
* nodes minus 1.
*/
private int maxEdges;
/**
* The number of iterations for the Markov chain process.
*/
private int numIterations;
/**
* Matrix of parents for each node. parentMatrix[i][0] indicates the number
* of parents; parentMatrix[i][k] represents the (k-1)'th parent, k =
* 1...max.
*/
private int[][] parentMatrix;
/**
* Matrix of parents for each node. childMatrix[i][0] indicates the number
* of parents; childMatrix[i][k] represents the (k-1)'th child, k =
* 1...max.
*/
private int[][] childMatrix;
/**
* Parent of random edge. 0 is the default parent node.
*/
private int randomParent = 0;
/**
* Child of random edge. 0 is the default child node.
*/
private int randomChild = 1;
/**
* The random source.
*/
private final RandomUtil randomUtil = RandomUtil.getInstance();
// RandomUtil randomUtil = new SeededRandomUtil(23333342L);
//===============================CONSTRUCTORS==========================//
/**
* Constructs a random graph generator for the given structure.
*
* @param structure One of ANY_DAG, POLYTREE, or CONNECTED_DAG.
*/
public UniformGraphGenerator(int structure) {
switch (structure) {
case ANY_DAG:
case CONNECTED_DAG:
break;
default:
throw new IllegalArgumentException("Unrecognized structure.");
}
this.structure = structure;
this.numNodes = 4;
this.maxInDegree = 3;
this.maxOutDegree = 3;
this.maxDegree = 6;
this.maxEdges = numNodes - 1;
// Determining the number of iterations for the chain to converge is a
// difficult task. This value follows the DagAlea (see Melancon;Bousque,
// 2000) suggestion, and we verified that this number is satisfatory. (Ide.)
this.numIterations = 6 * numNodes * numNodes;
}
//===============================PUBLIC METHODS========================//
private int getNumNodes() {
return numNodes;
}
/**
* Sets the number of nodes and resets all of the other parameters to
* default values accordingly.
*
* @param numNodes Must be an integer >= 4.
*/
public void setNumNodes(int numNodes) {
if (numNodes < 1) {
throw new IllegalArgumentException("Number of nodes must be >= 1.");
}
this.numNodes = numNodes;
this.maxDegree = numNodes - 1;
this.maxInDegree = numNodes - 1;
this.maxOutDegree = numNodes - 1;
this.maxEdges = numNodes - 1;
this.numIterations = 6 * numNodes * numNodes;
if (this.numIterations > 300000000) {
this.numIterations = 300000000;
}
this.parentMatrix = null;
this.childMatrix = null;
}
private int getMaxDegree() {
return maxDegree;
}
/**
* Sets the maximum degree of any nodes in the graph.
*
* @param maxDegree An integer between 3 and numNodes - 1, inclusively.
*/
public void setMaxDegree(int maxDegree) {
if (maxDegree < 3) {
throw new IllegalArgumentException("Degree of nodes must be >= 3.");
}
this.maxDegree = maxDegree;
}
private int getMaxInDegree() {
return maxInDegree;
}
public void setMaxInDegree(int maxInDegree) {
if (ANY_DAG == getStructure() && getMaxInDegree() < 0) {
throw new IllegalArgumentException("Max indegree must be >= 1 " +
"when generating DAGs without the assumption of " +
"connectedness.");
} else if (CONNECTED_DAG == getStructure() && getMaxInDegree() < 2) {
throw new IllegalArgumentException("Max indegree must be >= 2 " +
"when generating DAGs under the assumption of " +
"connectedness.");
}
this.maxInDegree = maxInDegree;
}
private int getMaxOutDegree() {
return maxOutDegree;
}
public void setMaxOutDegree(int maxOutDegree) {
if (ANY_DAG == getStructure() && getMaxInDegree() < 1) {
throw new IllegalArgumentException("Max indegree must be >= 1 " +
"when generating DAGs without the assumption of " +
"connectedness.");
}
if (CONNECTED_DAG == getStructure() && getMaxInDegree() < 2) {
throw new IllegalArgumentException("Max indegree must be >= 2 " +
"when generating DAGs under the assumption of " +
"connectedness.");
}
this.maxOutDegree = maxOutDegree;
}
private int getMaxEdges() {
return maxEdges;
}
private int getMaxPossibleEdges() {
return getNumNodes() * getMaxDegree() / 2;
}
public void setMaxEdges(int maxEdges) {
if (maxEdges < 0) {
throw new IllegalArgumentException("Max edges must be >= 0.");
}
if (maxEdges > getMaxPossibleEdges()) {
maxEdges = getMaxPossibleEdges();
// System.out.println("\nThe value maxEdges = " +
// maxEdges + " is too high; it has been set to the maximum " +
// "number of possible edges, which is " +
// getMaxPossibleEdges() + ".");
}
this.maxEdges = maxEdges;
}
private int getNumIterations() {
return numIterations;
}
public void setNumIterations(int numIterations) {
this.numIterations = numIterations;
}
private int getStructure() {
return structure;
}
public void generate() {
if (ANY_DAG == getStructure()) {
generateArbitraryDag();
} else if (CONNECTED_DAG == getStructure()) {
generateConnectedDag();
} else {
throw new IllegalStateException("Unknown structure type.");
}
}
public Graph getDag() {
//System.out.println("Converting to DAG");
List<Node> nodes = new ArrayList<>();
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(0);
int numDigits = (int) Math.ceil(Math.log(numNodes) / Math.log(10.0));
nf.setMinimumIntegerDigits(numDigits);
nf.setGroupingUsed(false);
for (int i = 1; i <= getNumNodes(); i++) {
GraphNode node = new GraphNode("X" + nf.format(i));
// dag.addIndex(node);
nodes.add(node);
}
return getDag(nodes);
}
public Graph getDag(List<Node> nodes) {
if (nodes.size() != getNumNodes()) {
throw new IllegalArgumentException("Only " + nodes.size() + " nodes were provided, but the " +
"simulated graph has " + getNumNodes() + ".");
}
Graph dag = new EdgeListGraph(nodes);
for (int i = 0; i < getNumNodes(); i++) {
Node child = nodes.get(i);
if (parentMatrix[i][0] != 1) {
for (int j = 1; j < parentMatrix[i][0]; j++) {
Node parent = nodes.get(parentMatrix[i][j]);
dag.addDirectedEdge(parent, child);
// System.out.println("Added " + dag.getEdge(parent, child));
}
}
}
// System.out.println("Arranging in circle.");
GraphUtils.circleLayout(dag, 200, 200, 150);
//System.out.println("DAG conversion completed.");
return dag;
}
public void printEdges() {
System.out.println("Edges:");
for (int i = 0; i < getNumNodes(); i++) {
for (int j = 1; j < childMatrix[i][0]; j++) {
System.out.println("\t" + i + " --> " + childMatrix[i][j]);
}
}
}
public String toString() {
String buf = "\nStructural information for generated graph:" +
"\n\tNumber of nodes:" + getNumNodes() +
"\n\tMax degree for each node:" + getMaxDegree() +
"\n\tMaximum number of incoming edges for each node:" +
getMaxInDegree() +
"\n\tMaximum number of outgoing edges for each node:" +
getMaxOutDegree() +
"\n\tMaximum total number of edges:" + getMaxEdges() +
" of " + getNumNodes() * getMaxDegree() / 2 +
" possibles" +
"\n\tNumber of transitions between samples:" +
getNumIterations();
return buf;
}
//================================PRIVATE METHODS======================//
private void generateArbitraryDag() {
initializeGraphAsEmpty();
if (getNumNodes() <= 1) {
return;
}
int numEdges = 0;
for (int i = 0; i < getNumIterations(); i++) {
// if (i % 10000000 == 0) System.out.println("..." + i);
sampleEdge();
if (edgeExists()) {
removeEdge();
numEdges--;
} else {
if ((numEdges < getMaxEdges() && maxDegreeNotExceeded() &&
maxIndegreeNotExceeded() && maxOutdegreeNotExceeded() &&
isAcyclic())) {
addEdge();
numEdges++;
}
}
}
}
/**
* This is the algorithm in Melancon and Philippe, "Generating connected
* acyclic digraphs uniformly at random" (draft of March 25, 2004). In
* addition to acyclicity, some other conditions have been added in.
*/
private void generateConnectedDag() {
initializeGraphAsChain();
if (getNumNodes() <= 1) {
return;
}
int totalEdges = getNumNodes() - 1;
while (isDisconnecting()) {
sampleEdge();
if (edgeExists()) {
continue;
}
if (isAcyclic() && maxDegreeNotExceeded()) {
addEdge();
totalEdges++;
}
}
for (int i = 0; i < getNumIterations(); i++) {
sampleEdge();
if (edgeExists()) {
if (isDisconnecting()) {
removeEdge();
reverseDirection();
if (totalEdges < getMaxEdges() && maxDegreeNotExceeded() &&
maxIndegreeNotExceeded() &&
maxOutdegreeNotExceeded() && isAcyclic()) {
addEdge();
} else {
reverseDirection();
addEdge();
}
} else {
removeEdge();
totalEdges--;
}
} else {
if (totalEdges < getMaxEdges() && maxDegreeNotExceeded() &&
maxIndegreeNotExceeded() && maxOutdegreeNotExceeded() &&
isAcyclic()) {
addEdge();
totalEdges++;
}
}
}
}
private void reverseDirection() {
int temp = randomChild;
randomChild = randomParent;
randomParent = temp;
}
/**
* @return true if the edge parent-->child exists in the graph.
*/
private boolean edgeExists() {
for (int i = 1; i < parentMatrix[randomChild][0]; i++) {
if (parentMatrix[randomChild][i] == randomParent) {
return true;
}
}
return false;
}
/**
* @return true if the degree of the getModel nodes randomParent and
* randomChild do not exceed maxDegree.
*/
private boolean maxDegreeNotExceeded() {
int parentDegree = parentMatrix[randomParent][0] +
childMatrix[randomParent][0] - 1;
int childDegree =
parentMatrix[randomChild][0] + childMatrix[randomChild][0] - 1;
return parentDegree <= getMaxDegree() && childDegree <= getMaxDegree();
}
/**
* @return true if the degrees of the getModel nodes randomParent and
* randomChild do not exceed maxIndegree.
*/
private boolean maxIndegreeNotExceeded() {
return parentMatrix[randomChild][0] <= getMaxInDegree();
}
/**
* @return true if the degrees of the getModel nodes randomParent and
* randomChild do not exceed maxOutdegree.
*/
private boolean maxOutdegreeNotExceeded() {
return childMatrix[randomParent][0] <= getMaxOutDegree();
}
/**
* @return true iff the random edge randomParent-->randomChild would be
* disconnecting were it to be removed.
*/
private boolean isDisconnecting() {
boolean visited[] = new boolean[getNumNodes()];
int list[] = new int[getNumNodes()];
int index = 0;
int lastIndex = 1;
list[0] = 0;
visited[0] = true;
while (index < lastIndex) {
int currentNode = list[index];
// verify parents of getModel node
for (int i = 1; i < parentMatrix[currentNode][0]; i++) {
if (currentNode == randomChild &&
parentMatrix[currentNode][i] == randomParent) {
continue;
}
if (!visited[parentMatrix[currentNode][i]]) {
list[lastIndex] = parentMatrix[currentNode][i];
visited[parentMatrix[currentNode][i]] = true;
lastIndex++;
}
}
// verify children of getModel node
for (int i = 1; i < childMatrix[currentNode][0]; i++) {
if (currentNode == randomParent &&
childMatrix[currentNode][i] == randomChild) {
continue;
}
if (!visited[childMatrix[currentNode][i]]) {
list[lastIndex] = childMatrix[currentNode][i];
visited[childMatrix[currentNode][i]] = true;
lastIndex++;
}
}
index++;
}
// verify whether all nodes were visited
for (boolean aVisited : visited) {
if (!aVisited) {
return true;
}
}
return false;
}
/**
* @return true if the graph is still acyclic after the last edge was added.
* This method only works before adding the random edge, not after removing
* an edge.
*/
private boolean isAcyclic() {
boolean visited[] = new boolean[getNumNodes()];
boolean noCycle = true;
int list[] = new int[getNumNodes() + 1];
int index = 0;
int lastIndex = 1;
list[0] = randomParent;
visited[randomParent] = true;
while (index < lastIndex && noCycle) {
int currentNode = list[index];
int i = 1;
// verify parents of getModel node
while ((i < parentMatrix[currentNode][0]) && noCycle) {
if (!visited[parentMatrix[currentNode][i]]) {
if (parentMatrix[currentNode][i] != randomChild) {
list[lastIndex] = parentMatrix[currentNode][i];
lastIndex++;
} else {
noCycle = false;
}
visited[parentMatrix[currentNode][i]] = true;
}
i++;
}
index++;
}
//System.out.println("\tnoCycle:"+noCycle);
return noCycle;
}
/**
* Initializes the graph to have no edges.
*/
private void initializeGraphAsEmpty() {
int max =
Math.max(getMaxInDegree() + getMaxOutDegree(), getMaxDegree());
max += 1;
parentMatrix = new int[getNumNodes()][max];
childMatrix = new int[getNumNodes()][max];
for (int i = 0; i < getNumNodes(); i++) {
parentMatrix[i][0] = 1; //set first node
childMatrix[i][0] = 1;
}
for (int i = 0; i < getNumNodes(); i++) {
for (int j = 1; j < max; j++) {
parentMatrix[i][j] = -5; //set first node
childMatrix[i][j] = -5;
}
}
}
/**
* Initializes the graph as a simple ordered tree, 0-->1-->2-->...-->n.
*/
private void initializeGraphAsChain() {
parentMatrix = new int[getNumNodes()][getMaxDegree() + 2];
childMatrix = new int[getNumNodes()][getMaxDegree() + 2];
for (int i = 0; i < getNumNodes(); i++) {
for (int j = 1; j < getMaxDegree() + 1; j++) {
parentMatrix[i][j] = -5; //set first node
childMatrix[i][j] = -5;
}
}
parentMatrix[0][0] = 1; //set first node
childMatrix[0][0] = 2; //set first node
childMatrix[0][1] = 1; //set first node
parentMatrix[getNumNodes() - 1][0] = 2; //set last node
parentMatrix[getNumNodes() - 1][1] = getNumNodes() - 2; //set last node
childMatrix[getNumNodes() - 1][0] = 1; //set last node
for (int i = 1; i < (getNumNodes() - 1); i++) { // set the other nodes
parentMatrix[i][0] = 2;
parentMatrix[i][1] = i - 1;
childMatrix[i][0] = 2;
childMatrix[i][1] = i + 1;
}
}
/**
* Sets randomParent-->randomChild to a random edge, chosen uniformly.
*/
private void sampleEdge() {
int rand = randomUtil.nextInt(getNumNodes() * (getNumNodes() - 1));
randomParent = rand / (getNumNodes() - 1);
int rest = rand - randomParent * (getNumNodes() - 1);
if (rest >= randomParent) {
randomChild = rest + 1;
} else {
randomChild = rest;
}
}
/**
* Adds the edge randomParent-->randomChild to the graph.
*/
private void addEdge() {
childMatrix[randomParent][childMatrix[randomParent][0]] = randomChild;
childMatrix[randomParent][0]++;
parentMatrix[randomChild][parentMatrix[randomChild][0]] = randomParent;
parentMatrix[randomChild][0]++;
}
/**
* Removes the edge randomParent-->randomChild from the graph.
*/
private void removeEdge() {
boolean go = true;
int lastNode;
int proxNode;
int atualNode;
if ((parentMatrix[randomChild][0] != 1) &&
(childMatrix[randomParent][0] != 1)) {
lastNode =
parentMatrix[randomChild][parentMatrix[randomChild][0] - 1];
for (int i = (parentMatrix[randomChild][0] - 1); (i > 0 && go); i--) { // remove element from parentMatrix
atualNode = parentMatrix[randomChild][i];
if (atualNode != randomParent) {
proxNode = atualNode;
parentMatrix[randomChild][i] = lastNode;
lastNode = proxNode;
} else {
parentMatrix[randomChild][i] = lastNode;
go = false;
}
}
if ((childMatrix[randomParent][0] != 1) &&
(childMatrix[randomParent][0] != 1)) {
lastNode = childMatrix[randomParent][
childMatrix[randomParent][0] - 1];
go = true;
for (int i = (childMatrix[randomParent][0] - 1); (i > 0 &&
go); i--) { // remove element from childMatrix
atualNode = childMatrix[randomParent][i];
if (atualNode != randomChild) {
proxNode = atualNode;
childMatrix[randomParent][i] = lastNode;
lastNode = proxNode;
} else {
childMatrix[randomParent][i] = lastNode;
go = false;
}
} // end of for
}
childMatrix[randomParent][(childMatrix[randomParent][0] - 1)] = -4;
childMatrix[randomParent][0]--;
parentMatrix[randomChild][(parentMatrix[randomChild][0] - 1)] = -4;
parentMatrix[randomChild][0]--;
}
}
}
| [
"chirayu.kong@gmail.com"
] | chirayu.kong@gmail.com |
538cb78cb0d8d84a02cb0e6c1764dbfb254f1103 | b7d3f863f4dd3de65dd5a93f700f7d0f91091ef8 | /src/main/java/io/github/brzezik919/controller/CardSearchController.java | bd7495c2571a9ab65a81e3ea4749e3b496f33503 | [] | no_license | brzezik919/NoOneDeckWebApp | ac1de20bfc0f8414676717a30a586e7feee31bcc | 742a3059aa4187b5ee0db40d6677c4d0ae31946b | refs/heads/master | 2023-06-11T12:52:41.571986 | 2021-06-30T19:08:23 | 2021-06-30T19:08:23 | 359,158,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,333 | java | package io.github.brzezik919.controller;
import io.github.brzezik919.model.Card;
import io.github.brzezik919.model.User;
import io.github.brzezik919.model.projection.CardModel;
import io.github.brzezik919.service.CardService;
import io.github.brzezik919.service.UserService;
import org.springframework.data.domain.Page;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@Controller
@RequestMapping("/cardSearch")
public class CardSearchController {
private final CardService cardService;
private final UserService userService;
public CardSearchController(CardService cardService, UserService userService) {
this.cardService = cardService;
this.userService = userService;
}
@GetMapping
public String showCardSearch(Model model, @RequestParam("page") Optional<Integer> page, @RequestParam("size") Optional<Integer> size, Authentication name){
if(Objects.isNull(name)){
return "redirect:/login";
}
int currentPage = page.orElse(0);
int pageSize = size.orElse(20);
User userLogIn = userService.getUserByName(name.getName());
model.addAttribute("user", userLogIn);
model.addAttribute("card", new CardModel());
Page<Card> cardPage = cardService.searchAllCardInTeam(name.getName(), currentPage, pageSize);
if(Objects.isNull(cardPage)){
return "cardSearch";
}
return getString(model, cardPage);
}
@PostMapping("/cardname")
public String cardSearch(@ModelAttribute CardModel card, Model model, @RequestParam("page") Optional<Integer> page, @RequestParam("size") Optional<Integer> size, Authentication name){
if(Objects.isNull(name)){
return "redirect:/login";
}
if(card.getCardName().equals("")){
return "redirect:/cardSearch";
}
int currentPage = page.orElse(0);
int pageSize = size.orElse(20);
User userLogIn = userService.getUserByName(name.getName());
model.addAttribute("user", userLogIn);
model.addAttribute("search", true);
model.addAttribute("searchName", card.getCardName());
Page<Card> cardPage = cardService.searchAllCardNamesInTeam(card.getCardName(), name.getName(), currentPage, pageSize);
if(cardPage.isEmpty()){
Page<Card> cards = cardService.searchAllCardInTeam(name.getName(), currentPage, pageSize);
model.addAttribute("cardNameNotFound", true);
return getString(model, cards);
}
return getString(model, cardPage);
}
@GetMapping("/search")
public String cardSearchPageable(Model model, @RequestParam("cardName") Optional<String> cardName, @RequestParam("page") Optional<Integer> page, @RequestParam("size") Optional<Integer> size, Authentication name){
if(Objects.isNull(name)){
return "redirect:/login";
}
if(cardName.get().equals("")){
return "redirect:/cardSearch";
}
int currentPage = page.orElse(0);
int pageSize = size.orElse(20);
Page<Card> cardPage = cardService.searchAllCardNamesInTeam(cardName.get(), name.getName(), currentPage, pageSize);
User userLogIn = userService.getUserByName(name.getName());
model.addAttribute("user", userLogIn);
model.addAttribute("search", true);
model.addAttribute("searchName", cardName.get());
return getString(model, cardPage);
}
private String getString(Model model, Page<Card> cardPage) {
model.addAttribute("cardPage", cardPage);
int totalPages = cardPage.getTotalPages();
if(totalPages > 0){
List<Integer> pageNumbers = IntStream.rangeClosed(1, totalPages)
.boxed()
.collect(Collectors.toList());
model.addAttribute("pageNumbers", pageNumbers);
model.addAttribute("cardList", null);
model.addAttribute("card", new CardModel());
}
return "cardSearch";
}
}
| [
"77505092+brzezik919@users.noreply.github.com"
] | 77505092+brzezik919@users.noreply.github.com |
1ed981756adf0faa5169522fc23451e219ee5e64 | a19f484fdd3a7b52b6bc944fe8e9c97c5e60d8f1 | /src/main/java/com/gyw/mgr/user/UserMgr.java | 94a8415a924af5374f8bf63e9c6ea12bf320251a | [] | no_license | b8833176b/mvcDemo | 3d2b2db8d186f3d25ff4b73b01d5a95408518dc5 | 83dc03b56b68665a417457830579af506d605507 | refs/heads/master | 2021-01-10T13:24:51.982588 | 2016-03-15T09:01:34 | 2016-03-15T09:01:34 | 53,477,699 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | package com.gyw.mgr.user;
import com.gyw.model.User;
import java.util.List;
/**
* Created by Administrator on 2016/3/9.
*/
public interface UserMgr {
public List<User> queryAll();
public void addUser(User user);
public void updateUser(User user);
}
| [
"gyw_kdn@163.com"
] | gyw_kdn@163.com |
b3911d4f7da7a8e2b4bae93b5b2858f03159ec90 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/orientechnologies--orientdb/1e1162ad7a27fbe58fc90ef2608bfc2ea3dec8f9/after/SecMaskTest.java | 84697c2217a4b6852abfb5cecad75cc5382c0e46 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,576 | java | package com.orientechnologies.orient.test.database.users;
import java.util.List;
import org.testng.annotations.Test;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.core.storage.OStorage;
import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE;
public class SecMaskTest {
private static ODatabaseDocumentTx database;
@Test
public static void main(String[] args) {
database = new ODatabaseDocumentTx("local:/tmp/secmask/secmask");
if (database.exists())
database.open("admin", "admin");
else {
database.create();
create();
}
// insert();
query();
}
public static void insert() {
database.declareIntent(new OIntentMassiveInsert());
database.begin(TXTYPE.NOTX);
long ndoc = 1000000;
ODocument doc = new ODocument();
System.out.println("Inserting " + ndoc + " docs...");
long block = System.nanoTime();
for (long i = 1; i <= ndoc; i++) {
doc.field("id", i);
doc.field("val1", 4.0d);
doc.field("val2", 5.0d);
doc.field("val3", 6.0f);
doc.field("val4", 255);
doc.field("val5", "this is the description for a long comic books -" + i);
doc.field("name", "this is secmask put on top - " + i);
doc.setClassName("Account");
doc.setDatabase(database);
doc.save();
doc.reset();
if (i % 100000 == 0) {
double time = (double) (System.nanoTime() - block) / 1000000;
System.out.println(i * 100 / ndoc + "%.\t" + time + "\t" + 100000.0d / time + " docs/ms");
block = System.nanoTime();
}
}
database.commit();
System.out.println("Insertion done, now indexing ids...");
block = System.nanoTime();
// CREATE THE INDEX AT THE END
database.getMetadata().getSchema().getClass("Account").getProperty("id").createIndex(OClass.INDEX_TYPE.UNIQUE);
System.out.println("Indexing done in: " + (System.nanoTime() - block) / 1000000 + "ms");
}
public static void query() {
System.out.println("Querying docs...");
// List<ODocument> result = database.query(new ONativeSynchQuery<ODocument, OQueryContextNativeSchema<ODocument>>(database,
// "Account", new OQueryContextNativeSchema<ODocument>()) {
// @Override
// public boolean filter(OQueryContextNativeSchema<ODocument> iRecord) {
// return iRecord.field("id").eq(1000l).field("name").go();
// }
// });
long start = System.currentTimeMillis();
List<ODocument> result = database.query(new OSQLSynchQuery<ODocument>("SELECT FROM Account WHERE id = " + 100999));
System.out.println("Elapsed: " + (System.currentTimeMillis() - start));
System.out.println("Query done");
for (ODocument o : result) {
System.out.println("id=" + o.field("id") + "\tname=" + o.field("name"));
}
}
public static void create() {
OClass account = database.getMetadata().getSchema()
.createClass("Account", database.getStorage().addCluster("account", OStorage.CLUSTER_TYPE.PHYSICAL));
account.createProperty("id", OType.LONG);
account.createProperty("val1", OType.DOUBLE);
account.createProperty("val2", OType.DOUBLE);
account.createProperty("val3", OType.FLOAT);
account.createProperty("val4", OType.SHORT);
account.createProperty("val5", OType.STRING);
account.createProperty("name", OType.STRING);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
3a71da331e08854b4c383f5d49d705a0f9447851 | c4f7aac376a6f5b53e5ceb7f0df23561cc8302ac | /oop programming/hw06/src/app/lani/Member.java | 9598350e35389caccf7a41de6eb51ae317a52a29 | [
"MIT"
] | permissive | lani009/AU_CA | 8c2cfcebdc1193f09ba233c2c6eae31c284c7711 | 84b2e115a0e10cdb637ab8e744fb520eecaccbda | refs/heads/master | 2023-01-20T21:16:06.075095 | 2023-01-18T19:18:05 | 2023-01-18T19:18:05 | 190,296,091 | 3 | 1 | MIT | 2023-01-18T19:18:15 | 2019-06-04T23:58:09 | Jupyter Notebook | UTF-8 | Java | false | false | 459 | java | package app.lani;
public class Member {
protected String name; //고객이름
protected String phone; //연락처
protected int purchase; //구매 개수
public Member(String name, String phone, int purchase) {
this.name = name;
this.phone = phone;
this.purchase = purchase;
}
public double calcSales() {
System.out.println("등급이 정해지지 않았습니다.");
return 0;
}
} | [
"lani009@naver.com"
] | lani009@naver.com |
b04be27ce8747514fb13d8a68c10e801a4956955 | 4505f7eeec6c676d3ada0b7654f653cb54386f4d | /src/main/java/tacos/data/JdbcTacoRepository.java | 322e5d2b913519b07a399f8891a52fe8a8d362ed | [] | no_license | pms131/spring-in-action-5th | 39194993b0c9b8f783c28c59517792b4c8ebfb60 | d1d111f5a18039139c65b4aea40fc3cafaeb51ea | refs/heads/master | 2023-06-25T07:44:44.929945 | 2021-07-25T10:33:26 | 2021-07-25T10:33:26 | 384,883,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package tacos.data;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.PreparedStatementCreatorFactory;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository;
import tacos.Ingredient;
import tacos.Taco;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Arrays;
import java.util.Date;
/*
* JDBC 활용 시 사용 (JPA 이용시 사용 X)
@Repository
public class JdbcTacoRepository implements TacoRepository{
private JdbcTemplate jdbc;
public JdbcTacoRepository(JdbcTemplate jdbc) {
this.jdbc = jdbc;
}
@Override
public Taco save(Taco taco) {
long tacoId = saveTacoInfo(taco);
taco.setId(tacoId);
for (Ingredient ingredient : taco.getIngredients()) {
saveIngredientToTaco(ingredient, tacoId);
}
return taco;
}
private long saveTacoInfo(Taco taco) {
taco.setCreatedAt(new Date());
PreparedStatementCreator psc = new PreparedStatementCreatorFactory(
"insert into Taco (name, createAt) values (?, ?)",
Types.VARCHAR, Types.TIMESTAMP
).newPreparedStatementCreator(
Arrays.asList(
taco.getName(),
new Timestamp(taco.getCreatedAt().getTime())
)
);
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbc.update(psc, keyHolder);
return keyHolder.getKey().longValue();
}
private void saveIngredientToTaco(Ingredient ingredient, long tacoId) {
jdbc.update(
"insert into Taco_Ingredients (taco, ingredient) " +
"values (?, ?)",
tacoId, ingredient.getId()
);
}
}
*/
| [
"sportssk@naver.com"
] | sportssk@naver.com |
5c411de06189c5a13c7cefec57b51debc29b7ebd | f8bfec128c0918920ba38045fd899ad0ddc07334 | /sise-sibs/src/main/java/pt/ulisboa/tecnico/learnjava/sibs/State/State.java | 531ca1ab6adb22e5a0c56fc21a0ffbad488ad757 | [] | no_license | carlossousa93/SE | 59c35dc85eed1e5cd5999abc558c0dcfceef8d87 | 626ed6a8c34e83c8e7843a7972eee30a29f08c9a | refs/heads/master | 2021-04-24T07:00:48.430382 | 2020-04-01T12:27:30 | 2020-04-01T12:27:30 | 250,097,246 | 0 | 1 | null | 2020-10-13T20:39:34 | 2020-03-25T21:38:42 | Java | UTF-8 | Java | false | false | 560 | java | package pt.ulisboa.tecnico.learnjava.sibs.State;
import pt.ulisboa.tecnico.learnjava.bank.exceptions.AccountException;
import pt.ulisboa.tecnico.learnjava.bank.services.Services;
import pt.ulisboa.tecnico.learnjava.sibs.domain.TransferOperation;
import pt.ulisboa.tecnico.learnjava.sibs.exceptions.OperationException;
public interface State {
void process(TransferOperation wrapper, Services services) throws OperationException, AccountException;
void cancel(TransferOperation wrapper, Services services) throws OperationException, AccountException;
}
| [
"carlossousa93@hotmail.com"
] | carlossousa93@hotmail.com |
d4c83463aea725c25b5a0f5d334ab6d575a27f01 | 01e8c6fd3aa3b4d39a4eb5b4a4e041147b5ff4db | /Starter/app/src/main/java/org/inframiner/firebase/starter/MainActivity.java | 056f807d4a2b7c30c0d7028497cdad4ec04ce211 | [] | no_license | ysera34/android-firebase | c625095f98f2113f92fedfe6d361b2011cd00e97 | 0abb2f2fe761c15e1938449a1e1f79f815d8a4c8 | refs/heads/master | 2021-01-19T13:21:01.619126 | 2017-08-14T02:05:13 | 2017-08-14T02:05:13 | 82,377,167 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,200 | java | /**
* Copyright Google Inc. All Rights Reserved.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.inframiner.firebase.starter;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.appinvite.AppInvite;
import com.google.android.gms.appinvite.AppInviteInvitation;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.appindexing.Action;
import com.google.firebase.appindexing.FirebaseAppIndex;
import com.google.firebase.appindexing.FirebaseUserActions;
import com.google.firebase.appindexing.Indexable;
import com.google.firebase.appindexing.builders.Indexables;
import com.google.firebase.appindexing.builders.PersonBuilder;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.crash.FirebaseCrash;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.util.HashMap;
import java.util.Map;
import de.hdodenhof.circleimageview.CircleImageView;
public class MainActivity extends AppCompatActivity
implements GoogleApiClient.OnConnectionFailedListener {
private static class MessageViewHolder extends RecyclerView.ViewHolder {
TextView messageTextView;
ImageView messageImageView;
TextView messengerTextView;
CircleImageView messengerImageView;
public MessageViewHolder(View v) {
super(v);
messageTextView = (TextView) itemView.findViewById(R.id.messageTextView);
messageImageView = (ImageView) itemView.findViewById(R.id.messageImageView);
messengerTextView = (TextView) itemView.findViewById(R.id.messengerTextView);
messengerImageView = (CircleImageView) itemView.findViewById(R.id.messengerImageView);
}
}
private static final String TAG = "MainActivity";
public static final String MESSAGES_CHILD = "messages";
private static final int REQUEST_INVITE = 1;
private static final int REQUEST_IMAGE = 2;
// private static final String LOADING_IMAGE_URL = "https://www.google.com/images/spin-32.gif";
private static final String LOADING_IMAGE_URL = "https://unsplash.it/100/100";
public static final int DEFAULT_MSG_LENGTH_LIMIT = 10;
public static final String ANONYMOUS = "anonymous";
private static final String MESSAGE_SENT_EVENT = "message_sent";
private String mUsername;
private String mPhotoUrl;
private SharedPreferences mSharedPreferences;
private GoogleApiClient mGoogleApiClient;
private static final String MESSAGE_URL = "http://friendlychat.firebase.google.com/message/";
private Button mSendButton;
private RecyclerView mMessageRecyclerView;
private LinearLayoutManager mLinearLayoutManager;
private ProgressBar mProgressBar;
private EditText mMessageEditText;
private ImageView mAddMessageImageView;
private AdView mAdView;
// Firebase instance variables
private FirebaseAuth mFirebaseAuth;
private FirebaseUser mFirebaseUser;
private FirebaseRemoteConfig mFirebaseRemoteConfig;
private DatabaseReference mFirebaseDatabaseReference;
private FirebaseRecyclerAdapter<FriendlyMessage, MessageViewHolder> mFirebaseAdapter;
private FirebaseAnalytics mFirebaseAnalytics;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
// Set default username is anonymous.
mUsername = ANONYMOUS;
// Initialize Firebase Auth
mFirebaseAuth = FirebaseAuth.getInstance();
mFirebaseUser = mFirebaseAuth.getCurrentUser();
if (mFirebaseUser == null) {
// Not signed in, launch the Sign In activity
startActivity(new Intent(this, SignInActivity.class));
finish();
return;
} else {
mUsername = mFirebaseUser.getDisplayName();
if (mFirebaseUser.getPhotoUrl() != null) {
mPhotoUrl = mFirebaseUser.getPhotoUrl().toString();
}
}
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API)
.addApi(AppInvite.API)
.build();
// Initialize ProgressBar and RecyclerView.
mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
mMessageRecyclerView = (RecyclerView) findViewById(R.id.messageRecyclerView);
mLinearLayoutManager = new LinearLayoutManager(this);
mLinearLayoutManager.setStackFromEnd(true);
mProgressBar.setVisibility(ProgressBar.INVISIBLE);
mMessageEditText = (EditText) findViewById(R.id.messageEditText);
mMessageEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(mSharedPreferences
.getInt(CodelabPreferences.FRIENDLY_MSG_LENGTH, DEFAULT_MSG_LENGTH_LIMIT))});
mMessageEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (charSequence.toString().trim().length() > 0) {
mSendButton.setEnabled(true);
} else {
mSendButton.setEnabled(false);
}
}
@Override
public void afterTextChanged(Editable editable) {
}
});
mSendButton = (Button) findViewById(R.id.sendButton);
mSendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Send messages on click.
FriendlyMessage friendlyMessage = new
FriendlyMessage(mMessageEditText.getText().toString(),
mUsername, mPhotoUrl, null /* no image */);
mFirebaseDatabaseReference.child(MESSAGES_CHILD)
.push().setValue(friendlyMessage);
mMessageEditText.setText("");
}
});
mAddMessageImageView = (ImageView) findViewById(R.id.addMessageImageView);
mAddMessageImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Select image for image message on click.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
startActivityForResult(intent, REQUEST_IMAGE);
}
});
// New child entries
mFirebaseDatabaseReference = FirebaseDatabase.getInstance().getReference();
mFirebaseAdapter = new FirebaseRecyclerAdapter<FriendlyMessage, MessageViewHolder>(
FriendlyMessage.class,
R.layout.item_message,
MessageViewHolder.class,
mFirebaseDatabaseReference.child(MESSAGES_CHILD)) {
@Override
protected FriendlyMessage parseSnapshot(DataSnapshot snapshot) {
// return super.parseSnapshot(snapshot);
FriendlyMessage friendlyMessage = super.parseSnapshot(snapshot);
if (friendlyMessage != null) {
friendlyMessage.setId(snapshot.getKey());
}
return friendlyMessage;
}
@Override
protected void populateViewHolder(final MessageViewHolder viewHolder,
FriendlyMessage friendlyMessage, int position) {
mProgressBar.setVisibility(ProgressBar.INVISIBLE);
if (friendlyMessage.getText() != null) {
viewHolder.messageTextView.setText(friendlyMessage.getText());
viewHolder.messageTextView.setVisibility(TextView.VISIBLE);
viewHolder.messageImageView.setVisibility(ImageView.GONE);
} else {
String imageUrl = friendlyMessage.getImageUrl();
if (imageUrl.startsWith("gs://")) {
StorageReference storageReference = FirebaseStorage.getInstance()
.getReferenceFromUrl(imageUrl);
storageReference.getDownloadUrl().addOnCompleteListener(
new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
if (task.isSuccessful()) {
String downloadUrl = task.getResult().toString();
Glide.with(viewHolder.messageImageView.getContext())
.load(downloadUrl)
.into(viewHolder.messageImageView);
} else {
Log.w(TAG, "Getting download url was not successful",
task.getException());
}
}
});
} else {
Glide.with(viewHolder.messageImageView.getContext())
.load(friendlyMessage.getImageUrl())
.into(viewHolder.messageImageView);
}
viewHolder.messageImageView.setVisibility(ImageView.VISIBLE);
viewHolder.messageTextView.setVisibility(TextView.GONE);
}
viewHolder.messengerTextView.setText(friendlyMessage.getName());
if (friendlyMessage.getPhotoUrl() == null) {
viewHolder.messengerImageView.setImageDrawable(ContextCompat.getDrawable(MainActivity.this,
R.drawable.ic_account_circle_black_36dp));
} else {
Glide.with(MainActivity.this)
.load(friendlyMessage.getPhotoUrl())
.into(viewHolder.messengerImageView);
}
// write this message to the on-device index
if (friendlyMessage.getText() != null) {
FirebaseAppIndex.getInstance().update(getMessageIndexable(friendlyMessage));
}
// log a view action on it
FirebaseUserActions.getInstance().end(getMessageViewAction(friendlyMessage));
}
};
mFirebaseAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override
public void onItemRangeInserted(int positionStart, int itemCount) {
super.onItemRangeInserted(positionStart, itemCount);
int friendlyMessageCount = mFirebaseAdapter.getItemCount();
int lastVisiblePosition = mLinearLayoutManager.findLastCompletelyVisibleItemPosition();
// If the recycler view is initially being loaded or the
// user is at the bottom of the list, scroll to the bottom
// of the list to show the newly added message.
if (lastVisiblePosition == -1 ||
(positionStart >= (friendlyMessageCount - 1) &&
lastVisiblePosition == (positionStart - 1))) {
mMessageRecyclerView.scrollToPosition(positionStart);
}
}
});
mMessageRecyclerView.setLayoutManager(mLinearLayoutManager);
mMessageRecyclerView.setAdapter(mFirebaseAdapter);
// Initialize Firebase Remote Config.
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
// Define Firebase Remote Config Settings.
FirebaseRemoteConfigSettings firebaseRemoteConfigSettings =
new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(true)
.build();
// Define default config values. Defaults are used when fetched config values are not
// available. Eg: if an error occurred fetching values from the server.
Map<String, Object> defaultConfigMap = new HashMap<>();
defaultConfigMap.put("friendly_msg_length", 10L);
// Apply config settings and default values.
mFirebaseRemoteConfig.setConfigSettings(firebaseRemoteConfigSettings);
mFirebaseRemoteConfig.setDefaults(defaultConfigMap);
// Fetch remote config.
fetchConfig();
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}
@Override
public void onStart() {
super.onStart();
// Check if user is signed in.
// TODO: Add code to check if user is signed in.
}
@Override
public void onResume() {
if (mAdView != null) {
mAdView.resume();
}
super.onResume();
}
@Override
public void onPause() {
if (mAdView != null) {
mAdView.pause();
}
super.onPause();
}
@Override
public void onDestroy() {
if (mAdView != null) {
mAdView.destroy();
}
super.onDestroy();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.crash_menu:
FirebaseCrash.logcat(Log.ERROR, TAG, "crash caused");
causeCrash();
return true;
case R.id.invite_menu:
sendInvitation();
return true;
case R.id.fresh_config_menu:
fetchConfig();
return true;
case R.id.sign_out_menu:
mFirebaseAuth.signOut();
Auth.GoogleSignInApi.signOut(mGoogleApiClient);
mUsername = ANONYMOUS;
startActivity(new Intent(this, SignInActivity.class));
return true;
default:
return super.onOptionsItemSelected(item);
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);
if (requestCode == REQUEST_IMAGE) {
if (resultCode == RESULT_OK) {
if (data != null) {
final Uri uri = data.getData();
Log.d(TAG, "Uri: " + uri.toString());
FriendlyMessage tempMessage = new FriendlyMessage(null, mUsername, mPhotoUrl,
LOADING_IMAGE_URL);
mFirebaseDatabaseReference.child(MESSAGES_CHILD).push()
.setValue(tempMessage, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError databaseError,
DatabaseReference databaseReference) {
if (databaseError == null) {
String key = databaseReference.getKey();
StorageReference storageReference =
FirebaseStorage.getInstance()
.getReference(mFirebaseUser.getUid())
.child(key)
.child(uri.getLastPathSegment());
putImageInStorage(storageReference, uri, key);
} else {
Log.w(TAG, "Unable to write message to database.",
databaseError.toException());
}
}
});
}
}
} else if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
Bundle payload = new Bundle();
payload.putString(FirebaseAnalytics.Param.VALUE, "sent");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, payload);
// Check how many invitations were sent and log.
String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
Log.d(TAG, "Invitations send: " + ids.length);
} else {
Bundle payload = new Bundle();
payload.putString(FirebaseAnalytics.Param.VALUE, "not sent");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, payload);
// Sending failed or it was canceled, show failure message to the user
Log.d(TAG, "Failed to send invitation.");
}
}
}
private void putImageInStorage(StorageReference storageReference, Uri uri, final String key) {
storageReference.putFile(uri).addOnCompleteListener(MainActivity.this,
new OnCompleteListener<UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
if (task.isSuccessful()) {
FriendlyMessage friendlyMessage =
new FriendlyMessage(null, mUsername, mPhotoUrl,
task.getResult().getMetadata().getDownloadUrl()
.toString());
mFirebaseDatabaseReference.child(MESSAGES_CHILD).child(key)
.setValue(friendlyMessage);
} else {
Log.w(TAG, "Image upload task was not successful.",
task.getException());
}
}
});
}
private Action getMessageViewAction(FriendlyMessage friendlyMessage) {
return new Action.Builder(Action.Builder.VIEW_ACTION)
.setObject(friendlyMessage.getName(), MESSAGE_URL.concat(friendlyMessage.getId()))
.setMetadata(new Action.Metadata.Builder().setUpload(false))
.build();
}
private Indexable getMessageIndexable(FriendlyMessage friendlyMessage) {
PersonBuilder sender = Indexables.personBuilder()
.setIsSelf(mUsername.equals(friendlyMessage.getName()))
.setName(friendlyMessage.getName())
.setUrl(MESSAGE_URL.concat(friendlyMessage.getId() + "/sender"));
PersonBuilder recipient = Indexables.personBuilder()
.setName(mUsername)
.setUrl(MESSAGE_URL.concat(friendlyMessage.getId() + "/recipient"));
Indexable messageToIndex = Indexables.messageBuilder()
.setName(friendlyMessage.getText())
.setUrl(MESSAGE_URL.concat(friendlyMessage.getId()))
.setSender(sender)
.setRecipient(recipient)
.build();
return messageToIndex;
}
// Fetch the config to determine the allowed length of messages.
public void fetchConfig() {
long cacheExpiration = 3600; // 1 hour in seconds
// If developer mode is enabled reduce cacheExpiration to 0 so that
// each fetch goes to the server. This should not be used in release builds.
if (mFirebaseRemoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled()) {
cacheExpiration = 0;
}
mFirebaseRemoteConfig.fetch(cacheExpiration)
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
// Make the fetched config available via
// FirebaseRemoteConfig get<type> calls.
mFirebaseRemoteConfig.activateFetched();
applyRetrievedLengthLimit();
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
// There has been an error fetching the config
Log.w(TAG, "Error fetching config: " + e.getMessage());
applyRetrievedLengthLimit();
}
});
}
/**
* Apply retrieved length limit to edit text field.
* This result may be fresh from the server or it may be from cached values.
*/
private void applyRetrievedLengthLimit() {
Long friendly_msg_length =
mFirebaseRemoteConfig.getLong("friendly_msg_length");
mMessageEditText.setFilters(new InputFilter[]{new
InputFilter.LengthFilter(friendly_msg_length.intValue())});
Log.d(TAG, "FML is: " + friendly_msg_length);
}
private void sendInvitation() {
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(getString(R.string.invitation_message))
.setCallToActionText(getString(R.string.invitation_cta))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
private void causeCrash() {
throw new NullPointerException("Fake null pointer exception");
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
// An unresolvable error has occurred and Google APIs (including Sign-In) will not
// be available.
Log.d(TAG, "onConnectionFailed:" + connectionResult);
Toast.makeText(this, "Google Play Services error.", Toast.LENGTH_SHORT).show();
}
}
| [
"ycyoon34@gmail.com"
] | ycyoon34@gmail.com |
4001747c0b5115e5ddc33bb805377423b308fe97 | 0982df3693411b1bf7917b12388876c54a30591f | /websites-api/src/main/java/com/sanservices/websitesapi/modules/disclaimer/service/DisclaimerServiceImpl.java | c088eee7bce860c4a04450e63f4c55d6b3513c99 | [] | no_license | eherrera-sans/wedding-styler | 5e84a7e17af16e17e32cb2414a8449fa51a81579 | 45909f1b14b463db41a15d8c6d12246f4a21bd46 | refs/heads/master | 2021-04-21T17:03:00.068432 | 2020-03-31T00:18:38 | 2020-03-31T00:18:38 | 249,798,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package com.sanservices.websitesapi.modules.disclaimer.service;
import com.sanservices.websitesapi.commons.entity.Brand;
import com.sanservices.websitesapi.modules.disclaimer.entity.Disclaimer;
import com.sanservices.websitesapi.modules.disclaimer.repository.DisclaimerRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.web.server.ResponseStatusException;
@Service
@RequiredArgsConstructor
@CacheConfig(cacheNames = "disclaimers")
public class DisclaimerServiceImpl implements DisclaimerService {
private final DisclaimerRepository disclaimerRepository;
@Cacheable
@Override
public Disclaimer getDisclaimer(Brand brand, String url) {
return disclaimerRepository.findByBrandAndUrl(brand, url)
.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Disclaimer not found"));
}
}
| [
"eherrera@sanservices.hn"
] | eherrera@sanservices.hn |
1ac685c70aaa9262cbf95bbdfffd1924d4f72826 | fe68b7044e4f74a476404ade948dcb3eae1aa179 | /hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlContractAppendLive.java | 83390aff8944e2ac7a1cb3f3f165b893941ab7e9 | [
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-2-Clause",
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-protobuf",
"CDDL-1.1",
"LicenseRef-scancode-proprietary-license",
"BSD-2-Clause-Views",
"EPL-1.0",
"GPL-2.0-only",
"LGPL-2.1... | permissive | feedzai/hadoop | 4a0cf06ee323adc013a2b43d0f054c7fadcce859 | cef61d505e289f074130cc3981c20f7692437cee | refs/heads/trunk | 2021-01-11T00:42:21.447080 | 2016-10-10T11:32:39 | 2016-10-10T11:32:39 | 70,512,518 | 1 | 0 | Apache-2.0 | 2022-09-14T05:54:43 | 2016-10-10T17:35:30 | Java | UTF-8 | Java | false | false | 1,790 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.hadoop.fs.adl.live;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.contract.AbstractContractAppendTest;
import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.contract.ContractTestUtils;
import org.junit.Before;
import org.junit.Test;
/**
* Verify Adls APPEND semantics compliance with Hadoop.
*/
public class TestAdlContractAppendLive extends AbstractContractAppendTest {
@Override
protected AbstractFSContract createContract(Configuration configuration) {
return new AdlStorageContract(configuration);
}
@Override
@Test
public void testRenameFileBeingAppended() throws Throwable {
ContractTestUtils.unsupported("Skipping since renaming file in append "
+ "mode not supported in Adl");
}
@Before
@Override
public void setup() throws Exception {
org.junit.Assume
.assumeTrue(AdlStorageConfiguration.isContractTestEnabled());
super.setup();
}
}
| [
"cnauroth@apache.org"
] | cnauroth@apache.org |
3d2bc93804193305d3f6528ef32e6182c728a56b | f5a40e0d0ef7773cf964ca72efda06022209fbc8 | /src/main/java/com/sofa/controller/ReffInstrumentMayorController.java | 360455662820dfa053fd0269dc3c2f8b3f191911 | [] | no_license | adipurapunya/stimb_baru | f6e42149bd1f2bfaab1baa75159086d17032cc44 | f6a458c5de1891fdf997e9a051957efe4d7d73cc | refs/heads/master | 2016-08-12T07:56:40.590496 | 2015-11-18T08:27:32 | 2015-11-18T08:27:32 | 45,437,044 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,378 | java | package com.sofa.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView;
import com.sofa.model.stimb2.ReffInstrumentMayor;
import com.sofa.service.ReffInstrumentMayorService;
@Controller
public class ReffInstrumentMayorController
{
//programStudiview.jsp
@Autowired
private ReffInstrumentMayorService reffMayorService;
@InitBinder
public void initBinder(WebDataBinder binder)
{
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
@RequestMapping({"/mayor", "/major"})
public String setupForm(Map<String, Object> map)
{
ReffInstrumentMayor mayor = new ReffInstrumentMayor();
map.put("instrumentmayor", mayor);
map.put("instrumentmayorList", reffMayorService.getAllReffMayor());
return "instrumentmayorview";
}
@RequestMapping(value="/updateMayor", method=RequestMethod.GET)
public ModelAndView edit(@RequestParam("id")Integer id)
{
ModelAndView mav = new ModelAndView("instrumentmayorviewEdit");
ReffInstrumentMayor mayor = reffMayorService.getReffMayor(id);
mav.addObject("instrumentmayorviewEdit", mayor);
return mav;
}
@RequestMapping(value="/updateMayor", method=RequestMethod.POST)
public String update(@ModelAttribute("instrumentmayorviewEdit") ReffInstrumentMayor mayor, BindingResult result, SessionStatus status)
{
reffMayorService.edit(mayor);
status.setComplete();
return "redirect:mayor";
}
@RequestMapping(value="/mayor.do", method=RequestMethod.POST)
public String doActions(@ModelAttribute ReffInstrumentMayor mayor, BindingResult result, @RequestParam String action, Map<String, Object> map, SessionStatus status, ModelMap model)
{
ReffInstrumentMayor mayorResult = new ReffInstrumentMayor();
switch(action.toLowerCase())
{ //only in Java7 you can put String in switch
case "add":
reffMayorService.add(mayor);
status.setComplete();
mayorResult = mayor;
model.addAttribute("instrumentmayor",new ReffInstrumentMayor());
break;
case "tambah":
reffMayorService.add(mayor);
status.setComplete();
mayorResult = mayor;
model.addAttribute("instrumentmayor",new ReffInstrumentMayor());
break;
case "edit":
reffMayorService.edit(mayor);
mayorResult = mayor;
model.addAttribute("instrumentmayor",new ReffInstrumentMayor());
break;
case "delete":
reffMayorService.delete(Integer.parseInt(String.valueOf(mayor.getId())));
mayorResult = new ReffInstrumentMayor();
break;
case "search":
ReffInstrumentMayor searchedReffMayor = reffMayorService.getReffMayor(Integer.parseInt(String.valueOf(mayor.getId())));
mayorResult = searchedReffMayor!=null ? searchedReffMayor: new ReffInstrumentMayor();
break;
case "back":
model.addAttribute("instrumentmayor",new ReffInstrumentMayor());
break;
}
map.put("instrumentmayorview", mayorResult);
map.put("instrumentmayorList", reffMayorService.getAllReffMayor());
return "instrumentmayorview";
}
@RequestMapping("deleteMayor")
public String deleteForm(@RequestParam("id")Integer id,Map<String, Object> map)
{
ReffInstrumentMayor mayorResult = new ReffInstrumentMayor();
reffMayorService.delete(id);
mayorResult = new ReffInstrumentMayor();
map.put("instrumentmayorview", mayorResult);
map.put("instrumentmayorList", reffMayorService.getAllReffMayor());
return "redirect:mayor";
}
}
| [
"adipurapunya@gmail.com"
] | adipurapunya@gmail.com |
356196ce415e637878b135f6db7b5e89189cee0d | 31db6fd90e7f4204ef24b139e3d9fbd21608e529 | /meeting_client/app/src/main/java/com/example/meetingmasterclient/EventViewAdapter.java | 005d2edd65184224df9c00a84fe7f2a7c2cdd70b | [] | no_license | HMPerson1/meeting-master | 5271091fb0e400a0dc419afb3f140093ab83930a | dae86243f2fd0ec63cf45810be9a6c38895676f7 | refs/heads/master | 2020-04-18T05:50:43.567326 | 2019-09-08T00:43:33 | 2019-09-08T00:48:42 | 167,294,113 | 0 | 0 | null | 2019-09-08T00:48:44 | 2019-01-24T03:10:02 | Java | UTF-8 | Java | false | false | 1,822 | java | package com.example.meetingmasterclient;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.meetingmasterclient.server.MeetingService;
import com.example.meetingmasterclient.server.Server;
import java.util.List;
import retrofit2.Call;
// TODO: Set up adapter to store entire event object
public class EventViewAdapter extends BaseAdapter {
Context context;
List<MeetingService.EventsData> eventInfo;
public EventViewAdapter(Context context, List<MeetingService.EventsData> eventInfo) {
this.context = context;
this.eventInfo = eventInfo;
}
@Override
public int getCount() {
return eventInfo.size();
}
@Override
public Object getItem(int position) {
return eventInfo.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(context);
View infl = inflater.inflate(R.layout.event_view_item, null);
TextView name = (TextView)infl.findViewById(R.id.event_name);
name.setText(eventInfo.get(position).event_name);
TextView date = (TextView)infl.findViewById(R.id.event_date);
date.setText(eventInfo.get(position).event_date);
TextView place = (TextView)infl.findViewById(R.id.event_place);
place.setText(eventInfo.get(position).event_location.getStreet_address() + ", "
+ eventInfo.get(position).event_location.getCity() + ", "
+ eventInfo.get(position).event_location.getState());
return infl;
}
}
| [
"dansanchezbui@unal.edu.co"
] | dansanchezbui@unal.edu.co |
de6f099c961ad3f7fea04d374698b68a2622bdc6 | 43a1635810510c48efd1c444e3486759c92ad5fd | /ciklum/game/src/models/itemsModel/Item.java | e5639edf7d97e4291115404f2febb408ca26a43c | [] | no_license | MrAndersonn/Interview-test | 324abd6e9b300487beed098bdb3f7e3c283dee12 | b74cd14fdf6d1bec59734cc4e039a392a6f44175 | refs/heads/master | 2021-01-19T17:30:08.022927 | 2018-02-14T16:38:19 | 2018-02-14T16:38:19 | 101,061,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package models.itemsModel;
public abstract class Item implements Executable {
protected String itemName;
public String getItemName() {
return itemName;
}
@Override
public String toString() {
return this.getClass().getSimpleName();
}
}
| [
"medentsiy.y@gmail.com"
] | medentsiy.y@gmail.com |
fe8a79880598aa9b1a669ac4032e228789f9a592 | 4c0a77e941a0b4096120a642faa889c930e6dd7e | /server/src/main/java/umm3601/todo/ToDoController.java | c6a45c8d214b1d2139a214d89b6a62a61a342ba1 | [
"MIT"
] | permissive | UMM-CSci-3601-S21/lab-2-lloyd-josh | 7d4d7f5fcd68ce4008d958c3d6c93347a29dc1c9 | dcae97dea6b3b6bc1b6c32a154b0d01e43efb2f1 | refs/heads/main | 2023-03-03T08:02:11.059988 | 2021-02-16T03:19:12 | 2021-02-16T03:19:12 | 337,504,768 | 0 | 0 | MIT | 2021-02-16T03:19:13 | 2021-02-09T18:53:13 | Java | UTF-8 | Java | false | false | 1,291 | java | package umm3601.todo;
import io.javalin.http.Context;
import io.javalin.http.NotFoundResponse;
/**
* Controller that manages requests for info about todos.
*/
public class ToDoController {
private ToDoDatabase database;
/**
* Construct a controller for todos.
* <p>
* This loads the "database" of todo info from a JSON file and stores that
* internally so that (subsets of) todos can be returned in response to
* requests.
*
* @param database the `ToDoDatabase` containing todo data.
*/
public ToDoController(ToDoDatabase database) {
this.database = database;
}
/**
* Get the single todo specified by the `id` parameter in the request.
*
* @param ctx a Javalin HTTP context
*/
public void getToDo(Context ctx) {
String id = ctx.pathParam("id", String.class).get();
ToDo todo = database.getToDo(id);
if (todo != null) {
ctx.json(todo);
ctx.status(201);
} else {
throw new NotFoundResponse("No todo with id " + id + " was found.");
}
}
/**
* Get a JSON response with a list of all the todos in the ToDoDatabase.
*
* @param ctx a Javalin HTTP context
*/
public void getToDos(Context ctx) {
ToDo[] todos = database.listToDos(ctx.queryParamMap());
ctx.json(todos);
}
}
| [
"quist127@morris.umn.edu"
] | quist127@morris.umn.edu |
8f7eb38830583a5815e99ef544c19ce91357d8eb | a8406a57212ca3ed9970f7ccda1c33bc18922c62 | /plugins/org.eclipse.ease.ext.modules.refactoring/src-test/org/eclipse/ease/ext/modules/refactoring/poet/RefactoringPoetModuleTest.java | c9d4ff1d061fcf5bec0e025ec720be714612c69f | [] | no_license | halwax/eclipse-ease-ext | 02ff8c03de1cd96d43d6a366f00b5811531ac81d | db1bb7f0902e33e9fd9a0efb3f43a5eb4cc691d5 | refs/heads/master | 2021-11-29T18:22:45.923165 | 2021-11-28T22:21:38 | 2021-11-28T22:21:38 | 81,016,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java |
package org.eclipse.ease.ext.modules.refactoring.poet;
import static org.assertj.core.api.Assertions.assertThat;
import org.eclipse.ease.ext.modules.refactoring.poet.RefactoringPoetModule;
import org.junit.jupiter.api.Test;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec;
public class RefactoringPoetModuleTest {
@Test
public void test() {
RefactoringPoetModule module = new RefactoringPoetModule();
String packageName = "test";
ClassName testClassName = module.poetClassName(packageName, "A");
ClassName constantClassName = module.poetClassName(packageName, "Constant");
AnnotationSpec testAnnotationSpec = module
.poetAnnotation(module.poetSimpleClassName("org.junit.jupiter.api.Test"), it -> {
it.addMember("test", "$T.$N", constantClassName, "NAME");
});
CodeBlock helloWorldCodeBlock = module.poetCodeBlock(it -> {
it.addStatement("$T.out.println(\"$L\")", System.class, "Hello World");
});
MethodSpec methodSpec = module.poetMethod("test", it -> {
it.addModifiers(module.poetModifiers("public", "static", "final"));
it.addAnnotation(testAnnotationSpec);
it.addCode(helloWorldCodeBlock);
});
TypeSpec testClass = module.poetClass(testClassName, it -> {
it.addModifiers(module.poetModifiers("public"));
it.addMethod(methodSpec);
});
JavaFile javaFile = module.poetJavaFile(packageName, testClass, it -> {
it.skipJavaLangImports(true);
});
assertThat(javaFile.toString()).isNull();
}
}
| [
"your_donotreply_email_id"
] | your_donotreply_email_id |
e1c03f1c9f29c53cc7cae2971e5c81dcf91c5160 | 6f3dca740da1f204bd711cb625aba4394c1e16db | /src/test/java/com/kgisl/myapp/MyappApplicationTests.java | 091ef55bd0e1cc02ccd83887708b072c8f7ec999 | [] | no_license | baraneetharan/myapp | 6ecf8b2b11bf72ca10a31ec45fe415eebc5b1bc5 | 7c6314e0457ac37000b69d432fdaaf0249d88fec | refs/heads/master | 2020-06-21T22:19:23.290470 | 2019-07-22T11:46:59 | 2019-07-22T11:46:59 | 197,565,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.kgisl.myapp;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class MyappApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"baraneetharan.r@kgisl.com"
] | baraneetharan.r@kgisl.com |
94c0bb2995cded6c666308f347cd26fa027eb3de | 861ee95bb74bab1da1fd3b72d4c4854c860781b0 | /zongjie/src/main/java/Test.java | b3a08ef23eb2307984be053b10b16b3b6a4a3d1b | [] | no_license | 472409245/Test | 9fb7afb31f67e9dd08cafc2fcb2039e9dc21a7c1 | 97113d39f603eb18511811a33a91916b8b5476ee | refs/heads/master | 2020-03-22T12:33:28.103591 | 2018-09-11T12:13:53 | 2018-09-11T12:13:53 | 140,047,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | import java.util.Arrays;
/**
* @author zhangchen
* @date 2018-08-15
*/
public class Test {
public static void main(String[] args) {
String a="sdfsdfsdcsa";
char[] b = a.toCharArray();
Arrays.sort(b);
System.out.println(b);
}
}
| [
"472409245@qq.com"
] | 472409245@qq.com |
aba6e985134e993c4577d38dc716848bbf804598 | dd00bfca873aad16a9dad076c24907f4fa82aa66 | /src/setup/Third.java | 9ea5132e5393895071e27d9d52e4ff2429d6b39b | [] | no_license | RanoJ15/Git_Practice_B24 | 236faffd421b61defd5baf71ec22dfb85fbbe94d | fa1c242bed5367e4996b256d7ac1e7787a2496ca | refs/heads/master | 2023-08-14T12:15:02.711305 | 2021-10-03T21:27:11 | 2021-10-03T21:27:11 | 413,111,093 | 0 | 0 | null | 2021-10-03T21:27:12 | 2021-10-03T15:05:20 | Java | UTF-8 | Java | false | false | 178 | java | package setup;
public class Third {
public void m() {
}
public void m(int a) {
}
public void m(String s) {
}
//Added some file
//dffghjjk
}
| [
"ranojuraeva78@gmail.com"
] | ranojuraeva78@gmail.com |
ef94fb982e18325cbbae7eec0139daab0bb8cf25 | 580e9a51891b08f2657c69e4c1378aada54ae700 | /src/main/java/com/codeup/springblog/repositories/AdRepository.java | 82bf30ec88ec767852944526d30fe473fb170689 | [] | no_license | bennyalvarez/springblog | 64d01f1ade82858dbf323401e536363fbefedea0 | 6afcefdb63b70d7785b18c73c64a7b54ffc58a41 | refs/heads/main | 2023-07-13T21:11:33.984683 | 2021-08-20T07:56:04 | 2021-08-20T07:56:04 | 387,837,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package com.codeup.springblog.repositories;
import com.codeup.springblog.models.Ad;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
public interface AdRepository extends JpaRepository<Ad, Long> {
Ad findById(long id);
@Query("from Ad a where a.title like %:term%")
Ad findByTitle(String term);
@Query("from Ad")
Ad findFirstByTitle(String title);
}
| [
"benjamin.c.alvarez.21@gmail.com"
] | benjamin.c.alvarez.21@gmail.com |
87df35691b64f2d20abf0da37a53b5efdd2b0ef0 | d2cb1f4f186238ed3075c2748552e9325763a1cb | /methods_all/nonstatic_methods/java_lang_Character_charCount_int.java | 5c6a858f5ede5340e850700096d720bc3967266a | [] | no_license | Adabot1/data | 9e5c64021261bf181b51b4141aab2e2877b9054a | 352b77eaebd8efdb4d343b642c71cdbfec35054e | refs/heads/master | 2020-05-16T14:22:19.491115 | 2019-05-25T04:35:00 | 2019-05-25T04:35:00 | 183,001,929 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 116 | java | class java_lang_Character_charCount_int{ public static void function() {java.lang.Character.charCount(-689284794);}} | [
"unclebobhk@engine-2.us-west1-b.c.adabot.internal"
] | unclebobhk@engine-2.us-west1-b.c.adabot.internal |
e3916dfa2740abef6d1475c3c3665e20c84e859d | 1a28c6fb62ff68dc7684d035ccb5764579481bc8 | /Drafting Tools/snakeDraftManager/GUI.java | 2dd1ed2df13c10336a14ccccffb8b9540461e2d3 | [] | no_license | Ferrerothorn/Gimmix | e4d2c214bbd9870ba9150eab3fa3378dc8eb8e58 | ce8fee753266258b54c67f0a1e90a15fd15add16 | refs/heads/master | 2020-09-22T20:52:56.503458 | 2017-04-24T23:11:06 | 2017-04-24T23:11:06 | 66,365,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,126 | java | package snakeDraftManager;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GUI extends JPanel implements ActionListener {
private static final long serialVersionUID = 1L;
private final static String newline = "\n";
public static JTextField textField;
public static JTextArea textArea;
public static JFrame frame = new JFrame("BTC");
public GUI() {
super(new GridBagLayout());
textArea = new JTextArea(25, 35);
textArea.setEditable(false);
textArea.setLineWrap(true);
textArea.setFont(new Font("monospaced", Font.PLAIN, 14));
JScrollPane scrollPane = new JScrollPane(textArea);
JPanel inputArea = new JPanel();
inputArea.setLayout(new BorderLayout());
JLabel inputLabel = new JLabel(" Enter options here: ");
textField = new JTextField(90);
textField.addActionListener(this);
inputArea.add(inputLabel, "West");
inputArea.add(textField, "Center");
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.weighty = 1.0;
add(scrollPane, c);
c.fill = GridBagConstraints.HORIZONTAL;
add(inputArea, c);
}
@Override
public void actionPerformed(ActionEvent evt) {
String text = textField.getText();
if (text.length() > 0) {
textArea.append(" " + text + newline);
textField.setText(null);
textArea.setCaretPosition(textArea.getDocument().getLength());
}
}
public static String getTextFromArea() {
return textArea.getText();
}
public static void createAndShowGUI(Boolean show) {
frame.setSize(500, 400);
frame.add(new GUI());
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(show);
}
public static void postString(String s) {
textArea.append(s + newline);
textArea.setCaretPosition(textArea.getDocument().getLength());
}
public static void postString() {
textArea.append(newline);
textArea.setCaretPosition(textArea.getDocument().getLength());
}
public static void wipePane() {
textArea.setText("");
textArea.setCaretPosition(textArea.getDocument().getLength());
}
} | [
"sdolman@sabio.co.uk"
] | sdolman@sabio.co.uk |
98b5ca9f32496110f1aae06473718e4a8a124789 | d0f3d1ea2741ae72e0211017ff06ef2f1f5a67c6 | /app/src/main/java/com/happycyclerserver/app/CyclerBleServerCallback.java | 9355b79445921a114cddcf25d8278538a2842b5f | [] | no_license | MasterXval/HappyCyclerServer | 2a34a1c83f796546324e2e91baa62b1e738756ff | 8ca4f57c5f9c2d8af0cd988b68e62ccb97a8f5f4 | refs/heads/master | 2021-01-22T18:24:03.123057 | 2014-09-27T22:21:52 | 2014-09-27T22:21:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,194 | java | package com.happycyclerserver.app;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattServer;
import android.bluetooth.BluetoothGattServerCallback;
import android.bluetooth.BluetoothGattService;
import android.bluetooth.BluetoothProfile;
import com.happycyclerserver.util.Logger;
import java.util.UUID;
public class CyclerBleServerCallback extends BluetoothGattServerCallback {
private BluetoothGattServer mGattServer;
public void setGattServer(BluetoothGattServer gattServer) {
mGattServer = gattServer;
}
public void onServiceAdded(int status, BluetoothGattService service) {
if (status == BluetoothGatt.GATT_SUCCESS) {
Logger.v(this, "onServiceAdded status=GATT_SUCCESS service="
+ service.getUuid().toString());
} else {
Logger.v(this, "onServiceAdded status!=GATT_SUCCESS");
}
}
public void onConnectionStateChange(
BluetoothDevice device, int status, int newState) {
Logger.v(this, "onConnectionStateChange()");
switch (status) {
case BluetoothProfile.STATE_CONNECTED:
case BluetoothProfile.STATE_CONNECTING:
Logger.v(this, "connected or connecting");
break;
case BluetoothProfile.STATE_DISCONNECTED:
case BluetoothProfile.STATE_DISCONNECTING:
Logger.v(this, "deconnected or deconnecting");
break;
default:
Logger.v(this, "other");
}
}
public void onCharacteristicReadRequest(
BluetoothDevice device, int requestId, int offset, BluetoothGattCharacteristic characteristic) {
Logger.v(this, "onCharacteristicReadRequest requestId=" + requestId + " offset=" + offset);
}
public void onCharacteristicWriteRequest(
BluetoothDevice device, int requestId,
BluetoothGattCharacteristic characteristic, boolean preparedWrite,
boolean responseNeeded, int offset, byte[] value) {
Logger.v(this, "onCharacteristicWriteRequest requestId=" + requestId + " preparedWrite="
+ Boolean.toString(preparedWrite) + " responseNeeded="
+ Boolean.toString(responseNeeded) + " offset=" + offset);
if (characteristic.getUuid().equals(ServerUUID.CHAR_DIRECTION_UUID)) {
byte[] response = setDirection(value);
mGattServer.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, 0, response);
}
mGattServer.sendResponse(device, requestId, BluetoothGatt.GATT_FAILURE, offset, null);
}
private byte[] setDirection(byte[] value) {
if (value.length > 1) {
switch (value[0]) {
case 0:
Logger.v(this, "TRALALA LEFT");
break;
case 1:
Logger.v(this, "TRALALA RIGHT");
break;
default:
Logger.v(this, "TRALALA STOPPED");
}
}
return null;
}
}
| [
"romain.saury@withings.com"
] | romain.saury@withings.com |
d9d92da3319cea1c55632b4bd99de3bbaccbd1de | 3df2a0c02bfce5510cf0823355ee22886e6fdb58 | /src/main/java/lesson3/task5/Human.java | a8fb3524cb4166b0a46825c3b1f2b3484808edb5 | [] | no_license | IgorSamoilov/training-java-core | 87739b9d91c4975eef06b455b17d2aa592d40f67 | 68fe214541c6c5faa115936909ed12403df7ae97 | refs/heads/master | 2023-06-13T08:28:07.657789 | 2021-07-07T16:51:56 | 2021-07-07T16:51:56 | 359,341,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package lesson3.task5;
import java.util.Random;
public class Human {
String name;
Cat[] cats;
Dog[] dogs;
Human() {
name = Names.randomHumanNames();
cats = new Cat[new Random().nextInt(4)];
dogs = new Dog[new Random().nextInt(4)];
for (int i = 0; i < cats.length; i++) {
cats[i] = new Cat();
}
for (int i = 0; i < dogs.length; i++) {
dogs[i] = new Dog();
}
}
}
| [
"cmuk201090@gmail.com"
] | cmuk201090@gmail.com |
f7d2db6cd9f7ffbf177726a94946f8abfef96a24 | 335fbefa932fe9596bc794d061581a7a5b39127f | /MXA/src/de/tudresden/inf/rn/mobilis/mxa/ConstMXA.java | 654b5c94084fc09c653ca025490362ffc9788fd7 | [] | no_license | ucganesh/mobilis | 7b261a96d82c848cbd73c919667e9d8583a944dc | 5cc2a9caa7aea99c4dfca24a74d581d9681d7fa0 | refs/heads/master | 2021-01-23T02:59:31.360672 | 2014-07-22T09:10:41 | 2014-07-22T09:10:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,097 | java | /**
* Copyright (C) 2009 Technische Universit�t Dresden
*
* 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.
*/
/**
* Dresden, University of Technology, Faculty of Computer Science
* Computer Networks Group: http://www.rn.inf.tu-dresden.de
* mobilis project: http://mobilisplatform.sourceforge.net
*/
package de.tudresden.inf.rn.mobilis.mxa;
import android.net.Uri;
import android.provider.BaseColumns;
/**
* @author Istvan Koren, Robert L�bke.
*/
public class ConstMXA {
// the enum values sent as action
public static final int MSG_CONNECT = 10;
public static final int MSG_DISCONNECT = 11;
public static final int MSG_SEND_MESSAGE = 12;
public static final int MSG_SEND_IQ = 13;
public static final int MSG_SEND_PRESENCE = 14;
public static final int MSG_SEND_FILE = 15;
public static final int MSG_DISCOVER_ITEMS = 16;
public static final int MSG_DISCOVER_INFO = 17;
public static final int MSG_ACCEPT_FILE = 18;
public static final int MSG_DENY_FILE = 19;
// the enum values for status
public static final int MSG_STATUS_REQUEST = 20;
public static final int MSG_STATUS_SUCCESS = 21;
public static final int MSG_STATUS_DELIVERED = 22;
public static final int MSG_STATUS_ERROR = 23;
// the additional enum values for IQ status
public static final int MSG_STATUS_IQ_RESULT = 34;
public static final int MSG_STATUS_IQ_ERROR = 35;
// the enum values for callbacks
public static final int MSG_CONN_CHANGED = 40;
public static final int MSG_PRES_RECEIVED = 41;
public static final int MSG_MSG_RECEIVED = 42;
public static final int MSG_IQ_RECEIVED = 43;
//reconnection purpose
public static final int MSG_RECONNECT = 50;
public static final int MSG_IQ_RESEND = 51;
public static final String IQ_RESEND_ID="IQ_RESEND_ID";
/*
* Send an iq in a message-stanza.
*/
public static int MSG_SEND_MESSAGE_PAYLOAD=60;
//Timeout between 2 sending tries
public static final int TO_IQ_RESEND=1000;
//enums for chatstates (XEP-0085)
public static final String CHATSTATE_NAMESPACE="http://jabber.org/protocol/chatstates";
public static final String CHATSTATE_ACTIVE="active";
public static final String CHATSTATE_INACTIVE="inactive";
public static final String CHATSTATE_GONE="gone";
public static final String CHATSTATE_PAUSED="paused";
public static final String CHATSTATE_COMPOSING="composing";
/*Auto values for xmpp settings*/
public static final String XMPP_SETTINGS_STANDARD_SERVER_PORT="5222";
public static final String XMPP_SETTINGS_STANDARD_RESSOURCE="MXA";
/* public static final int MSG_CHATSTATE_ACTIVE=0;
public static final int MSG_CHATSTATE_INACTIVE=1;
public static final int MSG_CHATSTATE_GONE=2;
public static final int MSG_CHATSTATE_PAUSED=3;
public static final int MSG_CHATSTATE_COMPOSING=4;*/
// ==========================================================
// Extras
// ==========================================================
public static final String EXTRA_ERROR_MESSAGE="ERROR_MESSAGE";
//public static final String EXTRA_IQ="PAYLOAD";
public static final String EXTRA_TIME="TIME";
public static final String EXTRA_COUNT="COUNT";
public static final String EXTRA_ID="ID";
// ==========================================================
// Preferences uris
// ==========================================================
// public static final String MXA_PREFERENCES = "de.tudresden.inf.rn.mobilis.mxa_preferences";
// ==========================================================
// IQ Database Table for storing lost packets
// ==========================================================
public static final String IQ_DATABASE_NAME="IQ_DATABASE";
public static final int IQ_DATABASE_VERSION=1;
// ==========================================================
// Intents
// ==========================================================
public static final String INTENT_PREFERENCES = "de.tudresden.inf.rn.mobilis.mxa.PREFERENCES";
public static final String INTENT_SERVICEMONITOR = "de.tudresden.inf.rn.mobilis.mxa.SERVICEMONITOR";
// ==========================================================
// Broadcasts
// ==========================================================
public static final String BROADCAST_PRESENCE = "de.tudresden.inf.rn.mobilis.mxa.intent.PRESENCE";
// ==========================================================
// Message provider
// ==========================================================
public static String messageAuthority = "de.tudresden.inf.rn.mobilis.mxa.provider.messages";
// ==========================================================
// Multi User Chat
// ==========================================================
public static final String MUC_IS_MODERATED = "ismoderated";
public static final String MUC_IS_MEMEBERSONLY = "ismembersonly";
public static final String MUC_IS_PASSWORDPROTECTED = "ispasswordprotected";
public static final String MUC_IS_PERSISTENT = "ispersitent";
public static final String MUC_DESCRIPTION = "description";
public static final String MUC_SUBJECT = "subject";
public static final String MUC_OCCUPANTSCOUNT = "occupantscount";
/**
* Roster table
*/
public static final class MessageItems implements BaseColumns {
// This class cannot be instantiated
private MessageItems() {
}
/**
* The content:// style URL for this table
*/
public static Uri contentUri = Uri.parse("content://"
+ messageAuthority + "/messageitems");
/**
* The MIME type of {@link #contentUri} providing a directory of
* message items.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.mxa.message";
/**
* The MIME type of a {@link #contentUri} sub-directory of a single
* message item.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.mxa.message";
/**
* The sender
* <P>
* Type: TEXT
* </P>
*/
public static final String SENDER = "sender";
/**
* The recipient
* <P>
* Type: TEXT
* </P>
*/
public static final String RECIPIENT = "recipient";
/**
* The subject
* <P>
* Type: TEXT
* </P>
*/
public static final String SUBJECT = "subject";
/**
* The body
* <P>
* Type: TEXT
* </P>
*/
public static final String BODY = "body";
/**
* The timestamp for when the message was sent
* <P>
* Type: INTEGER (long from System.curentTimeMillis())
* </P>
*/
public static final String DATE_SENT = "date_sent";
/**
* If the message was read (0 false, 1 true)
* <P>
* Type: INTEGER (no boolean available)
* </P>
*/
public static final String READ = "read";
/**
* The type
* <P>
* Type: TEXT
* </P>
*/
public static final String TYPE = "type";
/**
* The status
* <P>
* Type: TEXT
* </P>
*/
public static final String STATUS = "status";
/**
* The default sort order for this table
*/
public static final String DEFAULT_SORT_ORDER = "";
}
// ==========================================================
// Roster provider
// ==========================================================
public static String rosterAuthority = "de.tudresden.inf.rn.mobilis.mxa.provider.roster";
/**
* Roster table
*/
public static final class RosterItems implements BaseColumns {
// This class cannot be instantiated
private RosterItems() {
}
//this are the possible values
public static final String MODE_AVAILABLE="available";
public static final String MODE_UNAVAILABLE="unavailable";
public static final String MODE_AWAY="away";
public static final String MODE_EXTENDED_AWAY="xa";
public static final String MODE_DO_NOT_DISTURB="dnd";
public static final String MODE_CHAT="chat";
/**
* The content:// style URL for this table
*/
public static Uri contentUri = Uri.parse("content://"
+ rosterAuthority + "/rosteritems");
/**
* The MIME type of {@link #contentUri} providing a directory of roster
* items.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.mxa.roster";
/**
* The MIME type of a {@link #contentUri} sub-directory of a single
* roster item.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.mxa.roster";
/**
* The (bare) XMPP ID of the contact
* <P>
* Type: TEXT
* </P>
*/
public static final String XMPP_ID = "xmpp_id";
/**
* The name, that the contact has given itself
* <P>
* Type: TEXT
* </P>
*/
public static final String NAME = "name";
/**
* The presence mode, this can be one of (online,away,xa,dnd,offline)
* <P>
* Type: TEXT
* </P>
*/
public static final String PRESENCE_MODE = "mode";
/**
* The presence status, the text message that is entered by the user
* extra to the mode.
* <P>
* Type: TEXT
* </P>
*/
public static final String PRESENCE_STATUS = "status";
/**
* The timestamp for when the item was last modified
* <P>
* Type: INTEGER (long from System.currentTimeMillis())
* </P>
*/
public static final String UPDATED_DATE = "updated";
/**
* The ressource according to one entry, there can be multiple online contacts
* for on bare jid. Services like FileTransfer do need the full jid.
*/
public static final String RESSOURCE="ressource";
/**
* The default sort order for this table
*/
public static final String DEFAULT_SORT_ORDER = "CASE mode WHEN 'available' THEN 1 WHEN 'chat' THEN 2 WHEN 'away' THEN 3 WHEN 'xa' THEN 4 WHEN 'dnd' THEN 5 WHEN 'unavailable' THEN 6 END, name";
}
}
| [
"ubuntudroid@gmail.com"
] | ubuntudroid@gmail.com |
afb4dd0896302990612639ac6fe745ea2d509251 | e4fede9d03638174f6cbd42de56038a9d2642df3 | /MonopolyMantenimiento/src/edu/ncsu/monopoly/Die.java | 4659efe381a009a5627586199e97024e46b744f6 | [] | no_license | guillejude/MonopolyFJ | 393edd3e317da3aefd8d99bb2fefd12af4aa5009 | 4ead29a72cc360ca51f3078f3994ff1fdf2de46f | refs/heads/master | 2021-01-20T02:12:36.566247 | 2017-05-08T12:09:10 | 2017-05-08T12:09:10 | 89,389,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 176 | java | package edu.ncsu.monopoly;
import java.util.Random;
public class Die {
public int getRoll() {
Random r = new Random();
return r.nextInt(5) + 1;
}
}
| [
"guillejude@hotmail.com"
] | guillejude@hotmail.com |
95466522f5ea8be6ccff4f6c04e40b033a7da8d7 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_952170b3cac1e7ffac230c9e0819a62fbd2dc154/MinecraftDownloadUtils/2_952170b3cac1e7ffac230c9e0819a62fbd2dc154_MinecraftDownloadUtils_s.java | 07d88cc54575283ab9a7f8c11c233af44192dd7d | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,375 | java | package org.spoutcraft.launcher;
import java.io.File;
import java.io.IOException;
import org.spoutcraft.diff.JBPatch;
import org.spoutcraft.launcher.async.Download;
import org.spoutcraft.launcher.async.DownloadListener;
public class MinecraftDownloadUtils {
public static void downloadMinecraft(String user, String output, ModpackBuild build, DownloadListener listener) throws IOException {
String requiredMinecraftVersion = build.getMinecraftVersion();
if (downloadMinecraftVersion(requiredMinecraftVersion, listener))
return;
int tries = 3;
File outputFile = null;
while (tries > 0) {
Util.logi("Starting download of minecraft, with %s trie(s) remaining", tries);
tries--;
Download download = new Download(build.getMinecraftURL(user), output);
download.setListener(listener);
download.run();
if (!download.isSuccess()) {
if (download.getOutFile() != null) {
download.getOutFile().delete();
}
System.err.println("Download of minecraft failed!");
listener.stateChanged("Download Failed, retries remaining: " + tries, 0F);
} else {
String resultMD5 = MD5Utils.getMD5(download.getOutFile());
String minecraftVersion = MD5Utils.getMinecraftMD5(resultMD5);
GameUpdater.copy(download.getOutFile(), new File(GameUpdater.cacheDir, "minecraft_" + minecraftVersion + ".jar"));
if (minecraftVersion != null) {
Util.log("Downloaded 'minecraft.jar' matches MD5 of version '%s'.", minecraftVersion);
} else {
Util.log("Downloaded 'minecraft.jar' does not matche MD5 of any known minecraft version!");
continue;
}
if (!minecraftVersion.equals(requiredMinecraftVersion)) {
if (downloadMinecraftVersion(requiredMinecraftVersion, listener))
return;
} else {
outputFile = download.getOutFile();
break;
}
}
}
if (outputFile == null) { throw new IOException("Failed to download minecraft"); }
GameUpdater.copy(outputFile, new File(GameUpdater.cacheDir, "minecraft_" + requiredMinecraftVersion + ".jar"));
}
public static boolean downloadMinecraftVersion(String requiredMinecraftVersion, DownloadListener listener) {
String latestCached = MinecraftYML.getLatestCachedMinecraft();
if (MinecraftYML.compareVersions(requiredMinecraftVersion, latestCached) > 0)
return false;
for (String cachedVersion : MinecraftYML.getCachedMinecraftVersions()) {
if (MD5Utils.getMD5FromList("Patches/Minecraft/minecraft_"+cachedVersion+"-"+requiredMinecraftVersion+".patch") != null)
return downgradeFrom(cachedVersion, requiredMinecraftVersion, listener);
}
return false;
}
private static boolean downgradeFrom(String cachedVersion, String requiredMinecraftVersion, DownloadListener listener) {
File patch = new File(GameUpdater.tempDir, "mc.patch");
String patchURL = MirrorUtils.getMirrorUrl("Patches/Minecraft/minecraft_"+cachedVersion+"-"+requiredMinecraftVersion+".patch", null);
File cachedFile = new File(GameUpdater.cacheDir, "minecraft_" + cachedVersion + ".jar");
File requiredFile = new File(GameUpdater.cacheDir, "minecraft_" + requiredMinecraftVersion + ".jar");
Download patchDownload;
try {
patchDownload = DownloadUtils.downloadFile(patchURL, patch.getPath(), null, null, listener);
if (patchDownload.isSuccess()) {
File patchedMinecraft = new File(GameUpdater.tempDir, "patched_minecraft.jar");
patchedMinecraft.delete();
listener.stateChanged(String.format("Patching Minecraft to '%s'.", requiredMinecraftVersion), 0F);
JBPatch.bspatch(cachedFile, patchedMinecraft, patch);
listener.stateChanged(String.format("Patched Minecraft to '%s'.", requiredMinecraftVersion), 100F);
String currentMinecraftMD5 = MD5Utils.getMD5(FileType.minecraft, requiredMinecraftVersion);
String resultMD5 = MD5Utils.getMD5(patchedMinecraft);
Util.log("Comapring new jar md5 '%s' to stored md5 '%s'.", resultMD5, currentMinecraftMD5);
if (currentMinecraftMD5.equals(resultMD5)) {
GameUpdater.copy(patchedMinecraft, requiredFile);
patchedMinecraft.delete();
patch.deleteOnExit();
patch.delete();
return true;
}
}
} catch (IOException e) {
}
return false;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
0a302fa8c628c345fcdaa6c4c7b8c7e08316d05f | f9ca4d3c1ce6d1707e0a7de3f7cadc7e94b1f113 | /gts-service-vod-aliyun/src/main/java/com/gootschool/vod/web/controller/GTSVodController.java | 982efbed76a59b542dbc01d9485beb8181183683 | [] | no_license | zjqx1991/gootschool | 8019ecdadf2ddb6598af6736e4b0e9447ab19fed | 37d508d33987e57f0834b9362fafb4084ae0fb59 | refs/heads/master | 2022-07-08T05:56:39.755105 | 2019-12-28T08:12:21 | 2019-12-28T08:12:21 | 226,805,398 | 0 | 0 | null | 2022-06-17T02:48:39 | 2019-12-09T06:57:00 | Java | UTF-8 | Java | false | false | 1,258 | java | package com.gootschool.vod.web.controller;
import com.gootschool.api.vod.IVodAPI;
import com.gootschool.common.response.RevanResponse;
import com.gootschool.vod.service.IVodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class GTSVodController implements IVodAPI {
@Autowired
private IVodService vodService;
@Override
public RevanResponse deleteVideoByVideoIds(@RequestParam("videoIds") List<String> videoIds) {
return this.vodService.deleteVideoByVideoIds(videoIds);
}
@Override
public RevanResponse deleteVideoById(@PathVariable("videoId") String videoId) {
return this.vodService.deleteVideoById(videoId);
}
@Override
public RevanResponse fetchVideoInfoById(@PathVariable("videoId") String videoId) {
return this.vodService.fetchVideoInfoById(videoId);
}
@Override
public RevanResponse fetchVideoPlayAuth(@PathVariable("videoId") String videoId) {
return this.vodService.fetchVideoPlayAuth(videoId);
}
}
| [
"zjqx1991@163.com"
] | zjqx1991@163.com |
99c082593a563090e53b180a593660b231f6ca6c | 8036a2180255b6f82666ed4263bd616c6fdce0a9 | /src/main/java/br/com/stefanini/progress/model/Profile.java | 89bed31806a1074e7e8f7f3a4aa905bcc079ffd5 | [] | no_license | FonsekaLucas/stefanini-web-prototype | 559b43ef1338817a99c25d7aafcccc5333bb2528 | 81702607d062dadc05b7171ab33717a2c55e5c09 | refs/heads/develop | 2021-01-23T08:11:12.711604 | 2017-03-14T16:17:07 | 2017-03-14T16:17:07 | 80,534,624 | 1 | 0 | null | 2017-01-31T15:46:26 | 2017-01-31T15:46:26 | null | UTF-8 | Java | false | false | 1,026 | java | package br.com.stefanini.progress.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "tb_dom_profile")
public class Profile implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "cd_id_profile")
@GeneratedValue(strategy = GenerationType.AUTO)
private int idProfile;
@Column(name = "fd_profile")
private String profile;
public int getIdProfile() {
return idProfile;
}
public void setIdProfile(int idProfile) {
this.idProfile = idProfile;
}
public String getProfile() {
return profile;
}
public void setProfile(String profile) {
this.profile = profile;
}
}
| [
"pajunior0@gmail.com"
] | pajunior0@gmail.com |
66ca37ca8a37f2b2b40fcf3a4c3bc7e94b287638 | 6720bc22a1d8558dc45b39d1ec185488291b2687 | /src/main/java/com/theladders/bankkata/transaction/Withdrawal.java | e1f68f57737175c6f39aa38cb1899d50b7433f71 | [] | no_license | digideskio/bank-kata | e848328a5391d4d6686eb74a9a5c0998021c571c | dc8233adb86046a059f384364af9828491383973 | refs/heads/master | 2021-01-12T22:12:42.205199 | 2012-09-14T20:19:18 | 2012-09-14T20:19:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | package com.theladders.bankkata.transaction;
import com.theladders.bankkata.cash.Amount;
public class Withdrawal extends Transaction
{
public Withdrawal(Amount amount,
Amount resultBalance)
{
super(amount, resultBalance);
}
}
| [
"wawjr3d@gmail.com"
] | wawjr3d@gmail.com |
c2d044ca001eddb840a8aeea458b7ac0be7b8d23 | e42fd3ff7265a8821dd63bd3387f1748d340e4c5 | /puck2-master-new/testfiles/distrib/visitor/Main.java | c76749c1149eb60ed70217197a737892b9e0dac1 | [] | no_license | MuhammetTan06/PuckStage | b485b8c0f6f6c147acf05f2a3cf3d22d19b1bea9 | 6f47a98cea5f1e33cac7f8be7a2d018b780d5d23 | refs/heads/master | 2020-03-23T11:17:27.348369 | 2018-08-06T08:14:21 | 2018-08-06T08:14:21 | 141,495,387 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,114 | java | package visitor.candidate;
interface BinaryTree {
int sum();
String traverse();
}
class BinaryTreeLeaf implements BinaryTree {
protected int value;
public BinaryTreeLeaf(int value) { this.value = value; }
public int getValue() {return value; }
public int sum() {
return getValue();
}
public String traverse() {
return ""+getValue();
}
}
class BinaryTreeNode implements BinaryTree {
protected BinaryTree left;
protected BinaryTree right;
public BinaryTree getLeft() {
return left;
}
public BinaryTree getRight() {
return right;
}
public BinaryTreeNode(BinaryTree left, BinaryTree right) {
this.left = left;
this.right = right;
}
public int sum() {
return getLeft().sum() + getRight().sum();
}
public String traverse() {
return "{" + getLeft().traverse() + ", " +getRight().traverse() + "}";
}
}
public class Main {
public static void main(String[] args) {
System.out.println("Building the tree (1): leaves");
BinaryTreeLeaf one = new BinaryTreeLeaf(1);
BinaryTreeLeaf two = new BinaryTreeLeaf(2);
BinaryTreeLeaf three = new BinaryTreeLeaf(3);
System.out.println("Building the tree (1): regular nodes");
BinaryTreeNode regN = new BinaryTreeNode(one, two);
BinaryTreeNode root = new BinaryTreeNode(regN, three);
System.out.println("The tree now looks like this: ");
System.out.println(" regN ");
System.out.println(" / \\ ");
System.out.println(" regN 3 ");
System.out.println(" / \\ ");
System.out.println(" 1 2 ");
System.out.println("Visitor 1: SumVisitor, collects the sum of leaf");
System.out.println("values. Result should be 6.");
System.out.println(root.sum());
System.out.println("Visitor 2: TraversalVisitor, collects a tree");
System.out.println("representation. Result should be {{1,2},3}.");
System.out.println(root.traverse());
}
} | [
"mmhe06@gmail.com"
] | mmhe06@gmail.com |
7205e576bc2c8505fd3c647c26535fa58f21b342 | 358be3d2f98b928e48558fa59de6fd3b653fd971 | /app/src/main/java/com/example/rohitranjan/foodonbook/table.java | 9681b4ff186d34c2d7010c6da4bf72de2609b52c | [] | no_license | rohit123ranjan/Food-Booking-Android | ac17f936634efe0867307f867831ec9690856da8 | 297d20f7dbce338a2d07c8b67894834b85e2d188 | refs/heads/master | 2020-08-02T22:22:34.153644 | 2019-09-28T16:02:39 | 2019-09-28T16:02:39 | 211,524,474 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package com.example.rohitranjan.foodonbook;
public class table {
String tableId;
String tableItemNumber;
public table(String tableId, String tableItemNumber) {
this.tableId = tableId;
this.tableItemNumber = tableItemNumber;
}
public table() {
}
public String getTableId() {
return tableId;
}
public String getTableItemNumber() {
return tableItemNumber;
}
}
| [
"code2rohit@gmail.com"
] | code2rohit@gmail.com |
673b34eb32e6f4bfaa2791f2f1c0da75a534ae58 | cec1587350678b41d38191c4f7a82bf8023b9c27 | /HibernateProjects/_RealProjects/BookLib/src/dao/BookDAO.java | fe094df6086e211875f68763ae8a1a683b37dd12 | [] | no_license | boyangwm/DBScribe-JPQL-Hibernate | d9dc92499ab5d2b59531f3e50dc1d5bb6e40ff22 | 49474b7d9c12472e35c64af4dc7f08073007bd3d | refs/heads/master | 2020-12-28T20:08:47.164019 | 2015-12-14T19:40:43 | 2015-12-14T19:40:43 | 45,125,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,707 | java | package dao;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import HibernateUtil.HibernateUtil;
import cfg.hibernate.Beanbook;
import cfg.hibernate.Beanbooklendrecord;
import cfg.hibernate.Beanpublisher;
import cfg.hibernate.Beanreader;
public class BookDAO {
private static BookDAO instance = null;
private Session session = null;
public BookDAO() {
}
public static BookDAO getInstance() {
if (instance == null) {
instance = new BookDAO();
}
return instance;
}
public void add(Beanbook book) {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
session.save(book);
tx.commit();
session.close();
}
public void update(Beanbook book) {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
session.update(book);
tx.commit();
session.close();
}
public void remove(Beanbook book) {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
session.delete(book);
tx.commit();
session.close();
}
public void delete(String barcode){
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
Query q =session.createQuery("DELETE from Beanbook u WHERE u.barcode = ? ");
q.setString(0, barcode);
q.executeUpdate();
tx.commit();
session.close();
}
public List<Beanbook> listAll() {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
List<Beanbook> list = session.createQuery("from Beanbook b where b.state !='已删除'").list();
tx.commit();
return list;
}
public Beanbook loadbyid(String barcode) {
Beanbook book=null;
session = HibernateUtil.getSession();
Transaction tx = null;
Query q=session.createQuery("from Beanbook u where u.barcode=?");
q.setString(0, barcode);
book=(Beanbook) q.uniqueResult();
session.close();
return book;
}
public Beanbook loadbyname(String name) {
Beanbook book=null;
session = HibernateUtil.getSession();
Transaction tx = null;
Query q=session.createQuery("from Beanbook u where u.bookname=?");
q.setString(0, name);
book=(Beanbook) q.uniqueResult();
session.close();
return book;
}
public List<Beanbook> loadByStateAndName(String name,String state){
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
List<Beanbook> list= session.createQuery("from Beanbook b where b.bookname=? and b.state=?").setString(0, name).setString(1, state).list();
tx.commit();
return list;
}
public List<Beanbook> loadByState(String state) {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
List<Beanbook> list = session.createQuery("from Beanbook b where b.state=? ").setString(0, state).list();
tx.commit();
return list;
}
public Long count(Beanpublisher pub){
Long book=null;
session = HibernateUtil.getSession();
Transaction tx = null;
Query q=session.createQuery("select count(*) from Beanbook u where u.beanpublisher=?");
q.setEntity(0, pub);
book=(Long) q.uniqueResult();
session.close();
return book;
}
public List<Long> countBook() {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
List<Long> list = session.createQuery("SELECT count(*) FROM Beanbooklendrecord group by beanbook").list();
tx.commit();
return list;
}
public List<Beanbook> listBookRecord() {
session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();
List<Beanbook> list = session.createQuery("select distinct beanbook FROM Beanbooklendrecord").list();
tx.commit();
return list;
}
}
| [
"bnie@email.wm.edu"
] | bnie@email.wm.edu |
c5a80e268eb849d3ace531b4010632a973f7160e | 6bce9e469d6cf423ad9b6057bd4a769411351011 | /src/main/java/org/baeldung/persistence/model/VerificationToken.java | f0778a23eb0f9b1711e78499c9b7fd9f0672e473 | [
"Apache-2.0",
"MIT"
] | permissive | doanhoa93/spring-security-login-and-registration | 03f0dda6b31b044765a621c8e09b5aba86f38bb8 | 59e64275dde4ae4baa4f0d0481e242448ef360a7 | refs/heads/master | 2020-04-01T22:45:14.484919 | 2018-10-19T06:33:52 | 2018-10-19T06:33:52 | 153,725,018 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,533 | java | package org.baeldung.persistence.model;
import java.util.Calendar;
import java.util.Date;
import javax.persistence.*;
@Entity
@Table(name = "verificationtoken")
public class VerificationToken {
private static final int EXPIRATION = 60 * 24;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String token;
@OneToOne(targetEntity = User.class, fetch = FetchType.EAGER)
@JoinColumn(nullable = false, name = "user_id", foreignKey = @ForeignKey(name = "FK_VERIFY_USER"))
private User user;
private Date expiryDate;
public VerificationToken() {
super();
}
public VerificationToken(final String token) {
super();
this.token = token;
this.expiryDate = calculateExpiryDate(EXPIRATION);
}
public VerificationToken(final String token, final User user) {
super();
this.token = token;
this.user = user;
this.expiryDate = calculateExpiryDate(EXPIRATION);
}
public Long getId() {
return id;
}
public String getToken() {
return token;
}
public void setToken(final String token) {
this.token = token;
}
public User getUser() {
return user;
}
public void setUser(final User user) {
this.user = user;
}
public Date getExpiryDate() {
return expiryDate;
}
public void setExpiryDate(final Date expiryDate) {
this.expiryDate = expiryDate;
}
private Date calculateExpiryDate(final int expiryTimeInMinutes) {
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(new Date().getTime());
cal.add(Calendar.MINUTE, expiryTimeInMinutes);
return new Date(cal.getTime().getTime());
}
public void updateToken(final String token) {
this.token = token;
this.expiryDate = calculateExpiryDate(EXPIRATION);
}
//
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((expiryDate == null) ? 0 : expiryDate.hashCode());
result = prime * result + ((token == null) ? 0 : token.hashCode());
result = prime * result + ((user == null) ? 0 : user.hashCode());
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final VerificationToken other = (VerificationToken) obj;
if (expiryDate == null) {
if (other.expiryDate != null) {
return false;
}
} else if (!expiryDate.equals(other.expiryDate)) {
return false;
}
if (token == null) {
if (other.token != null) {
return false;
}
} else if (!token.equals(other.token)) {
return false;
}
if (user == null) {
if (other.user != null) {
return false;
}
} else if (!user.equals(other.user)) {
return false;
}
return true;
}
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("Token [String=").append(token).append("]").append("[Expires").append(expiryDate).append("]");
return builder.toString();
}
}
| [
"doan.quang.hoa@framgia.com"
] | doan.quang.hoa@framgia.com |
ccf6cf641cec619a32457969b347454e34a74dda | b4a400341e7d7a12ae1a2a728b52e1a9b9515f84 | /app/src/main/java/com/mayank/abaddon/netflixmovies/common/retrofit/RetrofitBuilder.java | 28209100b0b2bfc9fcf843b159d47debac69c40c | [] | no_license | nikunjdaga/netflixRouletteApiApp | db534256378ab719d81af26976b931d7c83426cb | ee5510e4f2f900aa54e9870e5239eb8165b71052 | refs/heads/master | 2020-06-19T19:46:57.637345 | 2017-06-21T16:01:21 | 2017-06-21T16:01:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,819 | java | package com.mayank.abaddon.netflixmovies.common.retrofit;
import android.content.Context;
import android.support.compat.BuildConfig;
import com.mayank.abaddon.netflixmovies.R;
import com.mayank.abaddon.netflixmovies.common.retrofit.interceptors.HeaderInterceptor;
import com.mayank.abaddon.netflixmovies.common.retrofit.service.HttpApiService;
import java.util.concurrent.Executors;
import javax.inject.Inject;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by Mayank.
*/
public class RetrofitBuilder {
private OkHttpClient httpClientWithoutGzipNoTimeOut;
@Inject public RetrofitBuilder() {
}
/**
* network service to make a request and the callback will be executed on the background thread
*
* @param context context of the app
* @return a HttpApiService object
*/
public HttpApiService getHttpServiceBackgroundThread(Context context) {
return getRetrofitBackgroundThread(context).create(HttpApiService.class);
}
/**
* network service to make a request and the callback will be executed on the calling thread
*
* @param context context of the app
* @return a HttpApiService object
*/
public HttpApiService getHttpServiceSameThread(Context context) {
return getRetrofitSameThread(context).create(HttpApiService.class);
}
private Retrofit getRetrofitBackgroundThread(Context context) {
return getRetrofit(context, true);
}
private Retrofit getRetrofitSameThread(Context context) {
return getRetrofit(context, false);
}
private OkHttpClient getOkHttpClientNoTimeOut() {
if (httpClientWithoutGzipNoTimeOut == null) {
httpClientWithoutGzipNoTimeOut = getHttpClient();
}
return httpClientWithoutGzipNoTimeOut;
}
private Retrofit getRetrofit(Context context, boolean onBackgroundThread) {
Retrofit.Builder builder = new Retrofit.Builder();
builder.client(getOkHttpClientNoTimeOut());
if (onBackgroundThread) {
builder.callbackExecutor(Executors.newFixedThreadPool(5));
}
builder.baseUrl(context.getString(R.string.base_url))
.addConverterFactory(GsonConverterFactory.create());
return builder.build();
}
// create an okhttp client
private OkHttpClient getHttpClient() {
OkHttpClient.Builder builder = new OkHttpClient.Builder().retryOnConnectionFailure(false);
if (BuildConfig.DEBUG) {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
builder.addInterceptor(logging);
//builder.addNetworkInterceptor(new com.facebook.stetho.okhttp3.StethoInterceptor());
}
builder.addInterceptor(new HeaderInterceptor());
return builder.build();
}
}
| [
"mayank.kush@mtrakr.in"
] | mayank.kush@mtrakr.in |
f21e567c166821434355d1e55321d14e75871826 | f08ac6ffb3873646ccdfedde7498e8dbf7e82bc2 | /web/src/main/java/com/idgindigo/pms/security/service/AuthenticationChangeHotelDeciderService.java | 8689250de905754fe144cec0f32d054ec31bca0e | [] | no_license | hankmuddy/pms | c14f04205823d84fef811fc28d3d6f336897782d | 74621c75b46a8c4d33e86ee42c78b6e94f8ca2e0 | refs/heads/master | 2022-12-27T19:38:02.531731 | 2020-06-03T22:16:00 | 2020-06-03T22:16:00 | 269,203,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,627 | java | package com.idgindigo.pms.security.service;
import com.idgindigo.pms.logins.domain.Admin;
import com.idgindigo.pms.logins.domain.Hotel;
import com.idgindigo.pms.logins.domain.HotelUser;
import com.idgindigo.pms.logins.domain.Manager;
import com.idgindigo.pms.logins.domain.ManagerSupervisor;
import com.idgindigo.pms.logins.repository.HotelRepository;
import com.idgindigo.pms.security.SecurityUtils;
import com.idgindigo.pms.security.permission.Decider;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
/**
* @author valentyn_vakatsiienko
* @since 5/19/14 2:57 PM
*/
@Service
public class AuthenticationChangeHotelDeciderService extends ConcreteDeciderService {
@Inject
private HotelRepository hotelRepository;
@PostConstruct
public void postConstruct() throws Exception {
put(HotelUser.USER, Decider.FALSE);
put(Admin.ADMIN, Decider.TRUE);
put(ManagerSupervisor.MANAGER_SUPERVISOR, new Decider() {
@Override
public boolean decide(Object target) {
Hotel hotel = hotelRepository.findByTenantId((String) target);
return hotel.getSupervisor().equals(SecurityUtils.getUserDetails().getAuthentication());
}
});
put(Manager.MANAGER, new Decider() {
@Override
public boolean decide(Object target) {
Hotel hotel = hotelRepository.findByTenantId((String) target);
return hotel.getManager().equals(SecurityUtils.getUserDetails().getAuthentication());
}
});
}
} | [
"muddy@i.ua"
] | muddy@i.ua |
c67c751fae416cdfab455aca0f4c30f4cc7f3410 | bb7b9ad4523e1ae67aba4aef2ddcff06990a6342 | /shelf/core/src/main/java/ch/raffael/sangria/experiments/ScanAllParallel.java | babb12b821c8e9d8fff3f074a4252b2756d27182 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Abnaxos/sangria | 715671099e4cbcf804fc92e1d2ce8eda04fbb133 | eb21a5913bff0dbbcc9d2936340767d59b6eb4da | refs/heads/master | 2021-01-10T20:10:09.471329 | 2015-02-01T11:17:36 | 2015-02-01T11:17:36 | 30,080,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,497 | java | package ch.raffael.sangria.experiments;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.FileVisitOption;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
import java.util.concurrent.RecursiveTask;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import ch.raffael.sangria.libs.guava.base.Throwables;
import ch.raffael.sangria.libs.guava.collect.ImmutableSet;
import ch.raffael.sangria.libs.guava.collect.Iterators;
import ch.raffael.sangria.assembly.AssemblyAdvice;
import ch.raffael.sangria.assembly.ResourceLocator;
/**
* @author <a href="mailto:herzog@raffael.ch">Raffael Herzog</a>
*/
public class ScanAllParallel {
private final static ForkJoinPool fjPool = new ForkJoinPool();
public static void main(final String[] args) throws Exception {
////System.err.println("Scanning...");
////Stopwatch sw = Stopwatch.createStarted();
////int count = fjPool.submit(() -> {
//// Adder adder = new Adder();
//// for ( final String arg : args ) {
//// adder.add(findJarsTask(Paths.get(arg)).fork());
//// }
//// return adder.sum();
////}).get();
//sw.stop();
//System.err.println("Scanned " + count + " elements in " + sw);
}
private static RecursiveTask<Integer> findJarsTask(final Path path) {
return new RecursiveTask<Integer>() {
@Override
protected Integer compute() {
final Adder adder = new Adder();
try {
Files.walkFileTree(path, ImmutableSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(final Path file, BasicFileAttributes attrs) throws IOException {
if ( file.toString().endsWith(".jar") ) {
adder.add(scanClassFilesTask(file).fork());
}
return FileVisitResult.CONTINUE;
}
});
return adder.sum();
}
catch ( IOException e ) {
throw Throwables.propagate(e);
}
}
};
}
private static RecursiveTask<Integer> scanClassFilesTask(final Path file) {
return new RecursiveTask<Integer>() {
@Override
protected Integer compute() {
try {
JarFile jarFile = new JarFile(file.toFile());
Enumeration<JarEntry> entryEnum = jarFile.entries();
final int[] count = { 0 };
while ( entryEnum.hasMoreElements() ) {
JarEntry entry = entryEnum.nextElement();
if ( !entry.isDirectory() && entry.getName().endsWith(".class") ) {
final String urlBase = "jar:file:" + file + "!/";
ResourceLocator locator = new ResourceLocator() {
@Override
public URL getResource(String name) {
try {
count[0]++;
return new URL(urlBase + name);
}
catch ( MalformedURLException e ) {
e.printStackTrace();
return null;
}
}
@Override
public Iterator<URL> getResources(String name) throws IOException {
return Iterators.singletonIterator(getResource(name));
}
};
if ( entry.getName().endsWith("/package-info.class") ) {
AssemblyAdvice.forPackage(locator, entry.getName().substring(0, entry.getName().length() - "/package-info.class".length()).replace('/', '.'));
}
else {
AssemblyAdvice.forClass(locator, entry.getName().substring(0, entry.getName().length() - ".class".length()).replace('/', '.'));
}
}
}
return count[0];
}
catch ( IOException e ) {
throw Throwables.propagate(e);
}
}
};
}
private static class Adder extends LinkedList<Future<Integer>> {
public int sum() {
int sum = 0;
for ( Future<Integer> futureInt : this ) {
try {
sum += futureInt.get();
}
catch ( Exception e ) {
throw Throwables.propagate(e);
}
}
return sum;
}
}
}
| [
"herzog@raffael.ch"
] | herzog@raffael.ch |
24dc040fda61c29d9999059a59f72e58b648542f | 7fdc2ab4cd1841a15b6508df22e64969fed5cf71 | /RBN Simulation/src/CustomRandom.java | bb40bd3e478445ab28dc8703fb15f83feb125ea7 | [] | no_license | wrsulliv/RBN-and-FSM-Simulation-Platform | a98521d06088a25d5a740aa77a4a7b7f52e576e7 | e7781eea0c369385589b7978374fc5fe9f767b36 | refs/heads/master | 2016-08-03T02:15:34.571194 | 2014-05-16T09:01:41 | 2014-05-16T09:01:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,635 | java | import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.Random;
// A wrapper around different random number generators which can be exchanged to make coding easier
public class CustomRandom implements Serializable{
Random randomGenerator;
long numbersGenerated = 0; // Used to make a new generator when too many numbers are generated
long generationsBeforeReset = 2^48; // This taken from here: http://www.math.utah.edu/~beebe/java/random/README
public CustomRandom()
{
randomGenerator = new Random();
}
public int nextInt(int maxValueExclusive)
{
if(numbersGenerated >= generationsBeforeReset)
{
randomGenerator = new Random(); // Create a new random object
numbersGenerated = 0;
}
numbersGenerated++; // Increase the numbers generated count because we're generating another number.
return randomGenerator.nextInt(maxValueExclusive);
}
public void writeHistogramToCSV(String filePath, int maxHistogramValue, int numberOfSamples)
{
// Generate the histogram
int[] histogramBuckets = new int[maxHistogramValue+1];
for(int i = 0; i < numberOfSamples; i++)
{
histogramBuckets[this.nextInt(maxHistogramValue+1)]++;
}
PrintWriter writer;
try {
writer = new PrintWriter(new FileWriter(filePath, false));
for(int i = 0; i < maxHistogramValue+1; i++)
{
writer.println(Integer.toString(i) + ", "+ Double.toString(histogramBuckets[i]));
}
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"wrsulliv@umass.edu"
] | wrsulliv@umass.edu |
c9ecd5c0c0bd0d2b7c3f35b736ee412d0a5a9e6f | 49a5a95574f71f3ff1dfd5e2968bd3fe5c46b20a | /MyGraduation/GradutaionProject/TestMallGuide/app/src/main/java/com/example/neal/testmallguide/floorsview/BaseThreeDFragment.java | 3ba0d366c5e20dfbd57c045c07d12a27ed3c26ff | [] | no_license | liuyunyicai/GraduationPojects | 3f095e883e4030dc8acdcad32ea7db7c247376eb | 80700e8380e7e3819972128b9fd472da17de6a8b | refs/heads/master | 2021-01-19T22:40:14.951576 | 2017-04-22T12:15:59 | 2017-04-22T12:15:59 | 88,835,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,580 | java | package com.example.neal.testmallguide.floorsview;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import com.example.neal.testmallguide.floorsview.route.RouteInfo;
import com.example.neal.testmallguide.floorsview.zoom.ZoomListenter;
import com.example.neal.testmallguide.loaddata.DataInfo;
import com.example.neal.testmallguide.utils.SharedUtils;
import com.squareup.okhttp.Route;
import com.threed.jpct.Logger;
import java.lang.reflect.Field;
import java.util.List;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;
/**
* Created by neal on 2017/3/15.
*/
public class BaseThreeDFragment extends Fragment{
public static final String FLOOR_NUM_BUNDLE = "floor_num_bundle"; // 用来楼层传递模型地址数据
private int mFloorNum;
// HelloWorld对象用来处理Activity的onPause和onResume方法
private static MainFloorsActivity master;
// GLSurfaceView对象
private GLSurfaceView mGLView;
// 类MyRenderer对象
private BuildingRender renderer = null;
private float xpos = -1;
private float ypos = -1;
private RenderZoomListener mZoomListener;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 如果本类对象不为NULL,将从Object中所有属性装入该类
if (master != null) {
copy(master);
}
super.onCreate(savedInstanceState);
// 实例化GLSurfaceView
mGLView = new GLSurfaceView(getActivity());
// 使用自己实现的 EGLConfigChooser,该实现必须在setRenderer(renderer)之前
// 如果没有setEGLConfigChooser方法被调用,则默认情况下,视图将选择一个与当前android.view.Surface兼容至少16位深度缓冲深度EGLConfig。
mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
int[] attributes = new int[]{EGL10.EGL_DEPTH_SIZE, 16,
EGL10.EGL_NONE};
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});
Bundle data = getArguments();
mFloorNum = 1;
if (null != data) {
mFloorNum = data.getInt(FLOOR_NUM_BUNDLE);
if (0 == mFloorNum) {
mFloorNum = 1;
}
}
// 实例化MyRenderer
renderer = new BuildingRender(getActivity(), mFloorNum);
// 设置View的渲染器,同时启动线程调用渲染,以至启动渲染
mGLView.setRenderer(renderer);
mZoomListener = new RenderZoomListener();
return mGLView;
}
// 重写onPause()
@Override
public void onPause() {
super.onPause();
mGLView.onPause();
}
// 重写onResume()
@Override
public void onResume() {
super.onResume();
mGLView.onResume();
}
// 重写onStop()
@Override
public void onStop() {
super.onStop();
}
private void copy(Object src) {
try {
// 打印日志
Logger.log("Copying data from master Activity!");
// 返回一个数组,其中包含目前这个类的的所有字段的Filed对象
Field[] fs = src.getClass().getDeclaredFields();
// 遍历fs数组
for (Field f : fs) {
// 尝试设置无障碍标志的值。标志设置为false将使访问检查,设置为true,将其禁用。
f.setAccessible(true);
// 将取到的值全部装入当前类中
f.set(this, f.get(src));
}
} catch (Exception e) {
// 抛出运行时异常
throw new RuntimeException(e);
}
}
public boolean onTouchEvent(MotionEvent me) {
// // 按键开始
// if (me.getAction() == MotionEvent.ACTION_DOWN) {
// // 保存按下的初始x,y位置于xpos,ypos中
// xpos = me.getX();
// ypos = me.getY();
// return true;
// }
// // 按键结束
// if (me.getAction() == MotionEvent.ACTION_UP) {
// // 设置x,y及旋转角度为初始值
// xpos = -1;
// ypos = -1;
// renderer.touch_x = 0;
// renderer.touch_y = 0;
// return true;
// }
// if (me.getAction() == MotionEvent.ACTION_MOVE) {
// // 计算x,y偏移位置及x,y轴上的旋转角度
// float xd = me.getX() - xpos;
// float yd = me.getY() - ypos;
// xpos = me.getX();
// ypos = me.getY();
// // 以x轴为例,鼠标从左向右拉为正,从右向左拉为负
// renderer.touch_x = xd / 3f;
// renderer.touch_y = yd / 3f;
// return true;
// }
// // 每Move一下休眠毫秒
// try {
// Thread.sleep(15);
// } catch (Exception e) {
// // No need for this...
// }
// return false;
return mZoomListener.onTouch(mGLView, me);
}
/*
* 划线
**/
public void drawLine(List<RouteInfo> routeInfos) {
if (null != routeInfos) {
renderer.drawRoute(routeInfos);
}
}
/*
* 划区域
**/
public void drawZone(List<RouteInfo> zoneInfos, int type) {
if (null != zoneInfos) {
renderer.drawZone(zoneInfos, type);
}
}
/*
* 用以缩放的类
**/
private class RenderZoomListener extends ZoomListenter {
private static final float param = 3f;
@Override
public boolean onTouch(View v, MotionEvent event) {
return super.onTouch(v, event);
}
@Override
protected void zoom(float f) {
super.zoom(f);
renderer.setScale(f);
}
@Override
protected void drag(float x, float y) {
super.drag(x, y);
renderer.setTranslate(x / param, y / param);
}
}
}
| [
"979724798@qq.com"
] | 979724798@qq.com |
d92d21d7d9726d5afafe2c9ef1045c7a126088e4 | 48b6b7cc544673133751eb2f385cada375bd36fd | /src/Interface/JSONr.java | 16fd8c7333a3ab565c8fdb1c62f00f4c0650503e | [] | no_license | anaiturbec/Proyecto1_SO | 7bd1a2e31b66cce975f8f354a98ab0a3fd7f8e96 | f050e0b6b98db29be8b51039a0733e95b9135cc0 | refs/heads/master | 2023-05-08T22:57:40.934423 | 2021-06-03T16:47:53 | 2021-06-03T16:47:53 | 373,568,579 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,405 | java | package Interface;
import java.io.FileNotFoundException;
import java.io.FileReader;
import javax.swing.JOptionPane;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
public class JSONr {
public JSONr() {
JSONParser parser = new JSONParser();
try {
Object obj = parser.parse(new FileReader("config.json"));
JSONObject jsonObject = (JSONObject) obj;
int dayTime = Integer.parseInt((String) jsonObject.get("dayTime"));
int delivery = Integer.parseInt((String) jsonObject.get("delivery"));
int buttonStorage = Integer.parseInt((String) jsonObject.get("buttonStorage"));
int armStorage = Integer.parseInt((String) jsonObject.get("armStorage"));
int legStorage = Integer.parseInt((String) jsonObject.get("legStorage"));
int bodStorage = Integer.parseInt((String) jsonObject.get("bodStorage"));
int buttonsIP = Integer.parseInt((String) jsonObject.get("buttonsIP"));
int legsIP = Integer.parseInt((String) jsonObject.get("legsIP"));
int armsIP = Integer.parseInt((String) jsonObject.get("armsIP"));
int bodIP = Integer.parseInt((String) jsonObject.get("bodIP"));
int buttonsMP = Integer.parseInt((String) jsonObject.get("buttonsMP"));
int legsMP = Integer.parseInt((String) jsonObject.get("legsMP"));
int armsMP = Integer.parseInt((String) jsonObject.get("armsMP"));
int bodMP = Integer.parseInt((String) jsonObject.get("bodMP"));
int initAss = Integer.parseInt((String) jsonObject.get("initAss"));
int maxAss = Integer.parseInt((String) jsonObject.get("maxAss"));
if(dayTime <= 0 ||
delivery <= 0 ||
buttonStorage <= 0 ||
armStorage <= 0 ||
legStorage <= 0 ||
bodStorage <= 0 ||
buttonsIP < 0 ||
armsIP < 0 ||
legsIP < 0 ||
bodIP < 0 ||
buttonsMP <= 0 ||
armsMP <= 0 ||
legsMP <= 0 ||
bodMP <= 0 ||
initAss < 0 ||
maxAss <= 0){
throw new Exception("Hay una o más propiedades menores o iguales a 0.");
}
if(buttonsIP > buttonsMP || armsIP > armsMP || legsIP > legsMP || bodIP > bodMP || initAss > maxAss){
throw new Exception("La cantidad inicial no puede ser mayor que la máxima");
}
Controller controller = new Controller();
controller.startMattel(dayTime, delivery, buttonStorage, armStorage, legStorage, bodStorage, buttonsIP, armsIP, legsIP, bodIP, buttonsMP, armsMP, legsMP, bodMP, initAss, maxAss);
} catch (Exception e) {
if(e instanceof FileNotFoundException){
JOptionPane.showMessageDialog(null, "Archivo no encontrado.");
}else if (e instanceof NumberFormatException){
JOptionPane.showMessageDialog(null, "El archivo tiene una propiedad que no es un int o está vacía.");
}
else{
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
}
}
| [
"anaisabeliturbec@gmail.com"
] | anaisabeliturbec@gmail.com |
e8ae8bc82007b6610426ac2184ecdf235486a535 | 5e1f7b77b1ae1c849dec983b68560c3b1ed60f14 | /app/src/main/java/com/linkysoft/shefaeshop/Models/PurchaseHistoryLink.java | 46d8c77f301ce23b89418f6285517142de41ff44 | [] | no_license | developerganesh/shefaeshop | bf6a23489890209227bfbb2a6da13516d4db7f61 | e6334e02bd0346859e64e9ddc2e780f2f9706db5 | refs/heads/master | 2023-01-18T15:59:59.692357 | 2020-12-07T14:11:21 | 2020-12-07T14:11:21 | 319,338,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 447 | java | package com.linkysoft.shefaeshop.Models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
public class PurchaseHistoryLink implements Serializable {
@SerializedName("details")
@Expose
private String details;
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
}
| [
"ganeshb.aam@gmail.com"
] | ganeshb.aam@gmail.com |
5c49d3529eb6ba1b7d250ec8286d73b27ae041bc | 93de0a2e794ca6044ba12f60fa562bf02069dce9 | /secure-auth-server/src/test/java/com/example/demo/SecureAuthServerApplicationTests.java | ea95d10159c7f143a413209cb0ec1af827f21007 | [] | no_license | TheGaneshkumawat/microserviceOauth2-PasswordGrant | a789fca1ebf58aff33b172a07b908ce0943dd0d1 | da10acd4cc7e71f7aef2863a56ac97a4bd7c6783 | refs/heads/master | 2022-05-31T10:38:31.955754 | 2020-04-19T10:07:02 | 2020-04-19T10:07:02 | 256,966,902 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package com.example.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SecureAuthServerApplicationTests {
@Test
void contextLoads() {
}
}
| [
"kumawat.ganesh12@gmail.com"
] | kumawat.ganesh12@gmail.com |
de97d4f05205a4a504a6710ee7d681b38df3017c | 409e08619758b5d2f23b534be4ee0edd52c149c2 | /admin-console/src/main/java/com/ibeetl/cms/web/SalesReturnController.java | 8d4aad5f1242e4952f5d24544bf5e61efec0aa8b | [
"BSD-3-Clause"
] | permissive | binhongWu/order | 1b0c1dab7cac5156ec60c54f776a69fc26e74b2a | f2f8a70bcce35b83e78a048c4bc372f397365e05 | refs/heads/master | 2020-05-06T14:09:08.001838 | 2019-06-21T07:20:51 | 2019-06-21T07:20:51 | 144,279,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,133 | java | package com.ibeetl.cms.web;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.beetl.sql.core.engine.PageQuery;
import org.jxls.common.Context;
import org.jxls.reader.ReaderBuilder;
import org.jxls.reader.ReaderConfig;
import org.jxls.reader.XLSReadMessage;
import org.jxls.reader.XLSReadStatus;
import org.jxls.reader.XLSReader;
import org.jxls.util.JxlsHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.ibeetl.admin.console.web.dto.DictExcelImportData;
import com.ibeetl.admin.console.web.query.UserQuery;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.entity.CoreDict;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileItem;
import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.util.*;
import com.ibeetl.cms.entity.*;
import com.ibeetl.cms.service.*;
import com.ibeetl.cms.web.query.*;
/**
* 销售退回接口
*/
@Controller
public class SalesReturnController{
private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/cms/salesReturn";
@Autowired private SalesReturnService salesReturnService;
@Autowired
FileService fileService;
/* 页面 */
/**
* 销售退回页面
* @return
*/
@GetMapping(MODEL + "/index.do")
@Function("salesReturn.query")
@ResponseBody
public ModelAndView index() {
ModelAndView view = new ModelAndView("/cms/salesReturn/index.html") ;
view.addObject("search", SalesReturnQuery.class.getName());
return view;
}
/**
* 销售退回页面数据
* @param condtion
* @return
*/
@PostMapping(MODEL + "/list.json")
@Function("salesReturn.query")
@ResponseBody
public JsonResult<PageQuery> list(SalesReturnQuery condtion)
{
PageQuery page = condtion.getPageQuery();
salesReturnService.queryByCondition(page);
return JsonResult.success(page);
}
/**
* 添加页面
* @return
*/
@GetMapping(MODEL + "/add.do")
@Function("salesReturn.add")
@ResponseBody
public ModelAndView add() {
ModelAndView view = new ModelAndView("/cms/salesReturn/add.html");
return view;
}
/**
* 添加数据保存
* @param salesReturn
* @return
*/
@PostMapping(MODEL + "/add.json")
@Function("salesReturn.add")
@ResponseBody
public JsonResult add(@Validated(ValidateConfig.ADD.class)SalesReturn salesReturn)
{
salesReturnService.save(salesReturn);
return JsonResult.success();
}
/**
* 编辑页面
* @param returnId
* @return
*/
@GetMapping(MODEL + "/edit.do")
@Function("salesReturn.edit")
@ResponseBody
public ModelAndView edit(Long returnId) {
ModelAndView view = new ModelAndView("/cms/salesReturn/edit.html");
SalesReturn salesReturn = salesReturnService.queryById(returnId);
view.addObject("salesReturn", salesReturn);
return view;
}
/**
* 编辑保存
* @param salesReturn
* @return
*/
@PostMapping(MODEL + "/update.json")
@Function("salesReturn.update")
@ResponseBody
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) SalesReturn salesReturn) {
boolean success = salesReturnService.update(salesReturn);
if (success) {
return JsonResult.success();
} else {
return JsonResult.failMessage("保存失败");
}
}
/**
* 销售退回审核页面
* @param returnId
* @return
*/
@GetMapping(MODEL + "/audio.do")
@Function("salesReturn.audio")
@ResponseBody
public ModelAndView audio(Long returnId) {
ModelAndView view = new ModelAndView("/cms/salesReturn/audio.html");
SalesReturn salesReturn = salesReturnService.queryById(returnId);
view.addObject("salesReturn", salesReturn);
return view;
}
/**
* 审核保存
* @param salesReturn
* @return
*/
@PostMapping(MODEL + "/audio.json")
@Function("salesReturn.audio")
@ResponseBody
public JsonResult<String> audioData(SalesReturn salesReturn) {
boolean success = salesReturnService.audioData(salesReturn);
if (success) {
return JsonResult.success();
} else {
return JsonResult.failMessage("审核失败");
}
}
/**
* 导出数据
* @param response
* @param condtion
* @return
*/
@PostMapping(MODEL + "/excel/export.json")
@Function("salesReturn.exportDocument")
@ResponseBody
public JsonResult<String> export(HttpServletResponse response,SalesReturnQuery condtion) {
/**
* 1)需要用你自己编写一个的excel模板
* 2)通常excel导出需要关联更多数据,因此salesReturnService.queryByCondition方法经常不符合需求,需要重写一个为模板导出的查询
* 3)参考ConsoleDictController来实现模板导入导出
*/
String excelTemplate ="excelTemplates/cms/salesReturn/sales_return_export.xls";
PageQuery<SalesReturn> page = condtion.getPageQuery();
//取出全部符合条件的
page.setPageSize(Integer.MAX_VALUE);
page.setPageNumber(1);
page.setTotalRow(Integer.MAX_VALUE);
//本次导出需要的数据
List<SalesReturn> list =salesReturnService.queryByCondition(page).getList();
try(InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(excelTemplate)) {
if(is==null) {
throw new PlatformException("模板资源不存在:"+excelTemplate);
}
FileItem item = fileService.createFileTemp("销售退回_"+DateUtil.now("yyyyMMddHHmmss")+".xls");
OutputStream os = item.openOutpuStream();
Context context = new Context();
context.putVar("list", list);
JxlsHelper.getInstance().processTemplate(is, os, context);
os.close();
//下载参考FileSystemContorller
return JsonResult.success(item.getPath());
} catch (IOException e) {
throw new PlatformException(e.getMessage());
}
}
/** ------------------------- 暂时没有用到的方法 -------------------------**/
/* ajax json */
/**
* 根据ID查找
*/
@PostMapping(MODEL + "/queryById.json")
@Function("salesReturn.query")
@ResponseBody
public JsonResult<SalesReturn> queryById(Object id){
SalesReturn data = salesReturnService.queryById(id);
return JsonResult.success(data);
}
@GetMapping(MODEL + "/view.json")
@Function("salesReturn.query")
@ResponseBody
public JsonResult<SalesReturn>queryInfo(Long returnId) {
SalesReturn salesReturn = salesReturnService.queryById( returnId);
return JsonResult.success(salesReturn);
}
@PostMapping(MODEL + "/delete.json")
@Function("salesReturn.delete")
@ResponseBody
public JsonResult delete(String ids) {
if (ids.endsWith(",")) {
ids = StringUtils.substringBeforeLast(ids, ",");
}
List<String> idList = ConvertUtil.str2Strings(ids);
salesReturnService.batchDelSalesReturn(idList);
return JsonResult.success();
}
@PostMapping(MODEL + "/excel/import.do")
@Function("salesReturn.importDocument")
@ResponseBody
public JsonResult importExcel(@RequestParam("file") MultipartFile file) throws Exception {
if (file.isEmpty()) {
return JsonResult.fail();
}
InputStream ins = file.getInputStream();
InputStream inputXML = Thread.currentThread().getContextClassLoader().getResourceAsStream("excelTemplates/cms/salesReturn/sales_return_import.xml");
XLSReader mainReader = ReaderBuilder.buildFromXML( inputXML );
InputStream inputXLS = ins;
List<SalesReturn> datas = new ArrayList<>();
Map beans = new HashMap();
beans.put("list", datas);
ReaderConfig.getInstance().setSkipErrors( true );
XLSReadStatus readStatus = mainReader.read( inputXLS, beans);
List<XLSReadMessage> errors = readStatus.getReadMessages();
if(!errors.isEmpty()) {
StringBuilder sb = new StringBuilder();
for(XLSReadMessage msg:errors) {
sb.append(parseXLSReadMessage(msg));
sb.append(",");
}
sb.setLength(sb.length()-1);
return JsonResult.failMessage("解析excel出错:"+sb.toString());
}
try {
this.salesReturnService.saveImport(datas);
return JsonResult.success();
}catch(Exception ex) {
return JsonResult.failMessage(ex.getMessage());
}
}
private String parseXLSReadMessage(XLSReadMessage msg) {
String str = msg.getMessage();
int start = "Can't read cell ".length();
int end = str.indexOf("on");
return str.substring(start,end);
}
}
| [
"15306021981@163.com"
] | 15306021981@163.com |
45c0ec8c4e365fc35de46b5bb1fa11f1e59b563d | 4282697aa03ebf3e8c158dfa9980a78bce0da14f | /DataHierarchy/src/de/loskutov/dh/Messages.java | 57fcbd1529916b0c294a99d590e2c96bbc5542b5 | [] | no_license | lazytosleep/dependencyexplorer | 32c3a800a5f7068dfc647f6807a91191bbb8129f | 9fb6386d000e82d8bdee82ce2a4a78c586a1be6f | refs/heads/master | 2020-09-24T12:18:42.868877 | 2009-11-01T22:12:19 | 2009-11-01T22:12:19 | 32,563,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,531 | java | /*******************************************************************************
* Copyright (c) 2009 Andrei Loskutov.
* 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
* Contributor: Andrei Loskutov - initial API and implementation
*******************************************************************************/
package de.loskutov.dh;
import java.lang.reflect.Field;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "de.loskutov.dh.messages";//$NON-NLS-1$
private Messages() {
// Do not instantiate
}
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
public static String get(String key){
Field field;
try {
field = Messages.class.getField(key);
return (String) field.get(null);
} catch (Exception e) {
DataHierarchyPlugin.logError("Missing resource for key: " + key, e);
return key;
}
}
public static String title;
public static String error;
public static String pref_Add_filter;
public static String pref_Add_filterTip;
public static String pref_RemoveFilter;
public static String pref_RemoveFilterTip;
public static String pref_Enable_all;
public static String pref_Enable_allTip;
public static String pref_Disable_all;
public static String pref_Disable_allTip;
public static String pref_Invalid_file_filter;
public static String pref_Edit_filter;
public static String pref_Edit_filterTip;
public static String action_showStaticsOnly_text;
public static String action_showStaticsOnly_toolTipText;
public static String action_showStaticsOnly_image;
public static String action_showPrimitivesToo_text;
public static String action_showPrimitivesToo_toolTipText;
public static String action_showPrimitivesToo_image;
public static String action_showArrays_text;
public static String action_showArrays_toolTipText;
public static String action_showArrays_image;
public static String action_autoRemoveEmptyElements_text;
public static String action_autoRemoveEmptyElements_toolTipText;
public static String action_autoRemoveEmptyElements_image;
}
| [
"iloveeclipse@localhost"
] | iloveeclipse@localhost |
1ffd10444423de226f070cc445a2060d92e1339e | eb48fc75f7f8084db262cf268014d1f223221938 | /week-02/day-1/src/SumElements.java | a5fcb9829a38f6a481c4c1a1ff5a330f7c1c5f66 | [] | no_license | green-fox-academy/NagyDavidLaszlo | 6c6e11d3aea39ed3237f442e9263a2dbbdcdf3a3 | 1238973253c5e22928f3d1a66309c388a719d9c5 | refs/heads/master | 2020-07-24T06:17:34.660447 | 2019-10-02T15:12:19 | 2019-10-02T15:12:19 | 207,825,849 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | public class SumElements {
public static void main(String[] args) {
// - Create an array variable named `r`
// with the following content: `[54, 23, 66, 12]`
// - Print the sum of the second and the third element
int r []={54,23,66,12};
{System.out.println(r[1]+r[2]);}
}
}
| [
"nagy.david.laszlo1@gmail.com"
] | nagy.david.laszlo1@gmail.com |
43dc67d90e3939d9da58f7f26b12e94372d76136 | 8ba7e66ca0c880a5b251e76309382e1bac17c3bd | /code/client/corepower/helloworld-coolsql/src/com/coolsql/pub/editable/CloseWindowListener.java | 1b4e611d11ae389f50313a534ea9e4094eda0d0f | [] | no_license | gongweichuan/gongweichuan | b80571d21f8d8d00163fc809ed36aae78887ae40 | 65c4033f95257cd8f33bfd5723ba643291beb8ca | refs/heads/master | 2016-09-05T20:12:18.033880 | 2013-04-09T15:53:28 | 2013-04-09T15:53:28 | 34,544,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,138 | java | /**
*
*/
package com.coolsql.pub.editable;
import java.awt.Window;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JOptionPane;
/**
* @author kenny liu
*该类完成关闭窗口的动作,前提是不执行任何特定的逻辑。可以设置在关闭窗口前是否提示。
* 2007-11-6 create
*/
public class CloseWindowListener extends WindowAdapter {
private Window window; //被关闭的窗口对象
private boolean isPrompt; //关闭时是否进行提示(true:提示,false:部提示)
/**
* 该构造方法默认不进行信息提示。
* @param w --被关闭的窗口
*/
public CloseWindowListener(Window w)
{
this(w,false);
}
public CloseWindowListener(Window w,boolean isPrompt)
{
super();
this.window=w;
this.isPrompt=isPrompt;
}
public void windowClosing(WindowEvent e)
{
if(isPrompt)
{
int r=JOptionPane.showConfirmDialog(window, "","please confirm",JOptionPane.OK_CANCEL_OPTION);
if(r==JOptionPane.OK_OPTION)
window.dispose();
else
return;
}else
window.dispose();
}
}
| [
"gongweichuan@gmail.com@934a62da-e7e6-11dd-bce9-bf72c0239d3a"
] | gongweichuan@gmail.com@934a62da-e7e6-11dd-bce9-bf72c0239d3a |
de8468705662bdbdd15cd6f3ff29a774c12beac0 | f57738fb5d00ce328bb74688f9a324d6fbc221d8 | /app/src/main/java/com/glacierwebcreative/firstbaptistchurchbigfork/Member.java | ddf430840697cab94d1b931efc9d32c98ffcd0e5 | [] | no_license | petteeta/FirstBaptistChurchBigfork | 6db6aac59ba0be99528eadf6df094621991d9e30 | b33d0c2f377de3f7d77b3f2cb82a6a3d0b6bb818 | refs/heads/master | 2022-07-04T17:56:35.531337 | 2020-05-17T15:32:40 | 2020-05-17T15:32:40 | 260,820,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 968 | java | // First Baptist Church Bigfork Member.java
package com.glacierwebcreative.firstbaptistchurchbigfork;
public class Member {
private String mfirstNameHusband;
private String mfirstNameWife;
private String mlastName;
public Member(String firstNameHusband, String firstNameWife, String lastName) {
mfirstNameHusband = firstNameHusband;
mfirstNameWife = firstNameWife;
mlastName = lastName;
}
public String getmFirstNameHusband() {
return mfirstNameHusband;
}
public String getmFirstNameWife() {
return mfirstNameWife;
}
public String getmLastName() {
return mlastName;
}
@Override
public String toString() {
return "Member{" +
"mfirstNameHusband='" + mfirstNameHusband + '\'' +
", mfirstNameWife='" + mfirstNameWife + '\'' +
", mlastName='" + mlastName + '\'' +
'}';
}
}
| [
"sjpettee@gmail.com"
] | sjpettee@gmail.com |
c1944cb10d0ec0ba99fabc11e26f79e423288f32 | ac7c9bb16607a83ac73f4eb06cbfa4ee56e833de | /FileServer-B4J/Objects/src/b4j/example/test.java | 5164c95272e54f2a56503e92d75f2b0b96073ac3 | [] | no_license | wpalomo/File-Server | cf3b1c66c76cf3a1a4422c1b7086674929f58c3a | f03009219af8b70ef1bec6bc22c9aebac7397889 | refs/heads/master | 2022-02-19T21:28:26.500483 | 2019-08-23T14:34:39 | 2019-08-23T14:34:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,164 | java | package b4j.example;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
public class test extends B4AClass.ImplB4AClass implements BA.SubDelegator{
public static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
private void innerInitialize(BA _ba) throws Exception {
if (ba == null) {
ba = new anywheresoftware.b4a.StandardBA("b4j.example", "b4j.example.test", this);
if (htSubs == null) {
ba.loadHtSubs(this.getClass());
htSubs = ba.htSubs;
}
ba.htSubs = htSubs;
}
if (BA.isShellModeRuntimeCheck(ba))
this.getClass().getMethod("_class_globals", b4j.example.test.class).invoke(this, new Object[] {null});
else
ba.raiseEvent2(null, true, "class_globals", false);
}
public anywheresoftware.b4a.keywords.Common __c = null;
public b4j.example.main _main = null;
public b4j.example.httputils2service _httputils2service = null;
public String _class_globals() throws Exception{
//BA.debugLineNum = 2;BA.debugLine="Sub Class_Globals";
//BA.debugLineNum = 4;BA.debugLine="End Sub";
return "";
}
public String _handle(anywheresoftware.b4j.object.JServlet.ServletRequestWrapper _req,anywheresoftware.b4j.object.JServlet.ServletResponseWrapper _resp) throws Exception{
//BA.debugLineNum = 11;BA.debugLine="Sub Handle(req As ServletRequest, resp As ServletR";
//BA.debugLineNum = 12;BA.debugLine="resp.ContentType = \"text/html\"";
_resp.setContentType("text/html");
//BA.debugLineNum = 13;BA.debugLine="resp.Write(\"Your ip address: \").Write(req.RemoteA";
_resp.Write("Your ip address: ").Write(_req.getRemoteAddress()).Write("<br/>");
//BA.debugLineNum = 14;BA.debugLine="End Sub";
return "";
}
public String _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
//BA.debugLineNum = 7;BA.debugLine="Public Sub Initialize";
//BA.debugLineNum = 9;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
return BA.SubDelegator.SubNotFound;
}
}
| [
"52236517+Michael2150@users.noreply.github.com"
] | 52236517+Michael2150@users.noreply.github.com |
a15bdf37b3e29ba7fba45a17085ff74146e7ff36 | c7b7b650861a8d20d62531f2b0b81ad08f89a45b | /src/main/java/com/linjia/web/service/PinTuanOrderService.java | b0c679f6deb5c11e5d685b5e8bf92ee60f6a21b8 | [] | no_license | 598605338/tiexin_app | 89eac38a86c9b6db1d37afbe6c0343e81a152b28 | f24c8cc24fc9ac93e64208dbc6bc9a3aa0aa7c16 | refs/heads/master | 2020-05-20T22:44:20.210692 | 2017-03-21T10:15:39 | 2017-03-21T10:15:39 | 84,538,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 967 | java | package com.linjia.web.service;
import java.util.List;
import com.linjia.web.model.PinTuanOrder;
import com.linjia.web.query.PinTuanOrderQuery;
public interface PinTuanOrderService{
/**
* 插入数据
* @param pt
* @return
*/
boolean insertPtOrder(PinTuanOrder pt);
/**
* 更新数据
* @param pt
* @return
*/
boolean updatePtOrderById(PinTuanOrder pt);
/**
* 删除数据
* @param id
* @return
*/
boolean deletePtOrderById(int id);
/**
* 查询单条数据
* @param user_id
* @param id
* @return
*/
PinTuanOrder selectPtOrderById(Long id);
/**
* 查询多条数据
* @param userId
* @return
*/
List<PinTuanOrder> selectPtOrderList(PinTuanOrderQuery query);
/**
* 查询所有超时未支付订单
* @param userId
* @return
*/
List<PinTuanOrder> selectTimeOutOrderUnPay();
/**
* 查询所有超时未成团
* @param userId
* @return
*/
List<PinTuanOrder> selectPtTimeOutOrder();
}
| [
"598605338@qq.com"
] | 598605338@qq.com |
366ea4fed3d8f41decf5f7021449d3b7443cdecc | 9fb404066fa8da452488970427ff69781ae5ab2b | /THIRD_LIBS/HBLTest/gen/com/actionbarsherlock/R.java | 28c628165f6e6ac9253201d8f38561f0e07afa8c | [] | no_license | heatork/piggy | 572fa60771001dc585aa414594a135f07ee6784f | 24a2945fd779a8b555eb29a065e78f3d6bebcba5 | refs/heads/master | 2020-12-27T15:27:10.139374 | 2015-04-04T14:43:06 | 2015-04-04T14:43:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 41,247 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.actionbarsherlock;
public final class R {
public static final class attr {
public static final int actionBarDivider = 0x7f01000e;
public static final int actionBarItemBackground = 0x7f01000f;
public static final int actionBarSize = 0x7f01000d;
public static final int actionBarSplitStyle = 0x7f01000b;
public static final int actionBarStyle = 0x7f01000a;
public static final int actionBarTabBarStyle = 0x7f010007;
public static final int actionBarTabStyle = 0x7f010006;
public static final int actionBarTabTextStyle = 0x7f010008;
public static final int actionBarWidgetTheme = 0x7f01000c;
public static final int actionButtonStyle = 0x7f01003a;
public static final int actionDropDownStyle = 0x7f010039;
public static final int actionMenuTextAppearance = 0x7f010010;
public static final int actionMenuTextColor = 0x7f010011;
public static final int actionModeBackground = 0x7f010014;
public static final int actionModeCloseButtonStyle = 0x7f010013;
public static final int actionModeCloseDrawable = 0x7f010016;
public static final int actionModePopupWindowStyle = 0x7f010018;
public static final int actionModeShareDrawable = 0x7f010017;
public static final int actionModeSplitBackground = 0x7f010015;
public static final int actionModeStyle = 0x7f010012;
public static final int actionOverflowButtonStyle = 0x7f010009;
public static final int actionSpinnerItemStyle = 0x7f01003f;
public static final int activatedBackgroundIndicator = 0x7f010047;
public static final int activityChooserViewStyle = 0x7f010046;
public static final int background = 0x7f010002;
public static final int backgroundSplit = 0x7f010003;
public static final int backgroundStacked = 0x7f01004f;
public static final int buttonStyleSmall = 0x7f010019;
public static final int customNavigationLayout = 0x7f010050;
public static final int displayOptions = 0x7f01004a;
public static final int divider = 0x7f010005;
public static final int dividerVertical = 0x7f010038;
public static final int dropDownHintAppearance = 0x7f010048;
public static final int dropDownListViewStyle = 0x7f01003c;
public static final int dropdownListPreferredItemHeight = 0x7f01003e;
public static final int expandActivityOverflowButtonDrawable = 0x7f01005f;
public static final int headerBackground = 0x7f010059;
public static final int height = 0x7f010004;
public static final int homeAsUpIndicator = 0x7f01003b;
public static final int homeLayout = 0x7f010051;
public static final int horizontalDivider = 0x7f010057;
public static final int icon = 0x7f01004d;
public static final int iconifiedByDefault = 0x7f010060;
public static final int indeterminateProgressStyle = 0x7f010053;
public static final int initialActivityCount = 0x7f01005e;
public static final int itemBackground = 0x7f01005a;
public static final int itemIconDisabledAlpha = 0x7f01005c;
public static final int itemPadding = 0x7f010055;
public static final int itemTextAppearance = 0x7f010056;
public static final int listPopupWindowStyle = 0x7f010045;
public static final int listPreferredItemHeightSmall = 0x7f010032;
public static final int listPreferredItemPaddingLeft = 0x7f010033;
public static final int listPreferredItemPaddingRight = 0x7f010034;
public static final int logo = 0x7f01004e;
public static final int navigationMode = 0x7f010049;
public static final int popupMenuStyle = 0x7f01003d;
public static final int preserveIconSpacing = 0x7f01005d;
public static final int progressBarPadding = 0x7f010054;
public static final int progressBarStyle = 0x7f010052;
public static final int queryHint = 0x7f010061;
public static final int searchAutoCompleteTextView = 0x7f010024;
public static final int searchDropdownBackground = 0x7f010025;
public static final int searchResultListItemHeight = 0x7f01002f;
public static final int searchViewCloseIcon = 0x7f010026;
public static final int searchViewEditQuery = 0x7f01002a;
public static final int searchViewEditQueryBackground = 0x7f01002b;
public static final int searchViewGoIcon = 0x7f010027;
public static final int searchViewSearchIcon = 0x7f010028;
public static final int searchViewTextField = 0x7f01002c;
public static final int searchViewTextFieldRight = 0x7f01002d;
public static final int searchViewVoiceIcon = 0x7f010029;
public static final int selectableItemBackground = 0x7f01001a;
public static final int spinnerDropDownItemStyle = 0x7f010023;
public static final int spinnerItemStyle = 0x7f010022;
public static final int subtitle = 0x7f01004c;
public static final int subtitleTextStyle = 0x7f010001;
public static final int textAppearanceLargePopupMenu = 0x7f01001c;
public static final int textAppearanceListItemSmall = 0x7f010035;
public static final int textAppearanceSearchResultSubtitle = 0x7f010031;
public static final int textAppearanceSearchResultTitle = 0x7f010030;
public static final int textAppearanceSmall = 0x7f01001e;
public static final int textAppearanceSmallPopupMenu = 0x7f01001d;
public static final int textColorPrimary = 0x7f01001f;
public static final int textColorPrimaryDisableOnly = 0x7f010020;
public static final int textColorPrimaryInverse = 0x7f010021;
public static final int textColorSearchUrl = 0x7f01002e;
public static final int title = 0x7f01004b;
public static final int titleTextStyle = 0x7f010000;
public static final int verticalDivider = 0x7f010058;
public static final int windowActionBar = 0x7f010041;
public static final int windowActionBarOverlay = 0x7f010042;
public static final int windowActionModeOverlay = 0x7f010043;
public static final int windowAnimationStyle = 0x7f01005b;
public static final int windowContentOverlay = 0x7f01001b;
public static final int windowMinWidthMajor = 0x7f010036;
public static final int windowMinWidthMinor = 0x7f010037;
public static final int windowNoTitle = 0x7f010040;
public static final int windowSplitActionBar = 0x7f010044;
}
public static final class bool {
public static final int abs__action_bar_embed_tabs = 0x7f080000;
public static final int abs__action_bar_expanded_action_views_exclusive = 0x7f080002;
public static final int abs__config_actionMenuItemAllCaps = 0x7f080004;
public static final int abs__config_allowActionMenuItemTextWithIcon = 0x7f080005;
public static final int abs__config_showMenuShortcutsWhenKeyboardPresent = 0x7f080003;
public static final int abs__split_action_bar_is_narrow = 0x7f080001;
}
public static final class color {
public static final int abs__background_holo_dark = 0x7f090000;
public static final int abs__background_holo_light = 0x7f090001;
public static final int abs__bright_foreground_disabled_holo_dark = 0x7f090004;
public static final int abs__bright_foreground_disabled_holo_light = 0x7f090005;
public static final int abs__bright_foreground_holo_dark = 0x7f090002;
public static final int abs__bright_foreground_holo_light = 0x7f090003;
public static final int abs__primary_text_disable_only_holo_dark = 0x7f090006;
public static final int abs__primary_text_disable_only_holo_light = 0x7f090007;
public static final int abs__primary_text_holo_dark = 0x7f090008;
public static final int abs__primary_text_holo_light = 0x7f090009;
}
public static final class dimen {
public static final int abs__action_bar_default_height = 0x7f0a0001;
public static final int abs__action_bar_icon_vertical_padding = 0x7f0a0002;
public static final int abs__action_bar_subtitle_bottom_margin = 0x7f0a0006;
public static final int abs__action_bar_subtitle_text_size = 0x7f0a0004;
public static final int abs__action_bar_subtitle_top_margin = 0x7f0a0005;
public static final int abs__action_bar_title_text_size = 0x7f0a0003;
public static final int abs__action_button_min_width = 0x7f0a0007;
public static final int abs__config_prefDialogWidth = 0x7f0a0000;
public static final int abs__dialog_min_width_major = 0x7f0a000d;
public static final int abs__dialog_min_width_minor = 0x7f0a000e;
public static final int abs__dropdownitem_icon_width = 0x7f0a000a;
public static final int abs__dropdownitem_text_padding_left = 0x7f0a0008;
public static final int abs__dropdownitem_text_padding_right = 0x7f0a0009;
public static final int abs__search_view_preferred_width = 0x7f0a000c;
public static final int abs__search_view_text_min_width = 0x7f0a000b;
}
public static final class drawable {
public static final int abs__ab_bottom_solid_dark_holo = 0x7f020000;
public static final int abs__ab_bottom_solid_inverse_holo = 0x7f020001;
public static final int abs__ab_bottom_solid_light_holo = 0x7f020002;
public static final int abs__ab_bottom_transparent_dark_holo = 0x7f020003;
public static final int abs__ab_bottom_transparent_light_holo = 0x7f020004;
public static final int abs__ab_share_pack_holo_dark = 0x7f020005;
public static final int abs__ab_share_pack_holo_light = 0x7f020006;
public static final int abs__ab_solid_dark_holo = 0x7f020007;
public static final int abs__ab_solid_light_holo = 0x7f020008;
public static final int abs__ab_solid_shadow_holo = 0x7f020009;
public static final int abs__ab_stacked_solid_dark_holo = 0x7f02000a;
public static final int abs__ab_stacked_solid_light_holo = 0x7f02000b;
public static final int abs__ab_stacked_transparent_dark_holo = 0x7f02000c;
public static final int abs__ab_stacked_transparent_light_holo = 0x7f02000d;
public static final int abs__ab_transparent_dark_holo = 0x7f02000e;
public static final int abs__ab_transparent_light_holo = 0x7f02000f;
public static final int abs__activated_background_holo_dark = 0x7f020010;
public static final int abs__activated_background_holo_light = 0x7f020011;
public static final int abs__btn_cab_done_default_holo_dark = 0x7f020012;
public static final int abs__btn_cab_done_default_holo_light = 0x7f020013;
public static final int abs__btn_cab_done_focused_holo_dark = 0x7f020014;
public static final int abs__btn_cab_done_focused_holo_light = 0x7f020015;
public static final int abs__btn_cab_done_holo_dark = 0x7f020016;
public static final int abs__btn_cab_done_holo_light = 0x7f020017;
public static final int abs__btn_cab_done_pressed_holo_dark = 0x7f020018;
public static final int abs__btn_cab_done_pressed_holo_light = 0x7f020019;
public static final int abs__cab_background_bottom_holo_dark = 0x7f02001a;
public static final int abs__cab_background_bottom_holo_light = 0x7f02001b;
public static final int abs__cab_background_top_holo_dark = 0x7f02001c;
public static final int abs__cab_background_top_holo_light = 0x7f02001d;
public static final int abs__ic_ab_back_holo_dark = 0x7f02001e;
public static final int abs__ic_ab_back_holo_light = 0x7f02001f;
public static final int abs__ic_cab_done_holo_dark = 0x7f020020;
public static final int abs__ic_cab_done_holo_light = 0x7f020021;
public static final int abs__ic_clear = 0x7f020022;
public static final int abs__ic_clear_disabled = 0x7f020023;
public static final int abs__ic_clear_holo_light = 0x7f020024;
public static final int abs__ic_clear_normal = 0x7f020025;
public static final int abs__ic_clear_search_api_disabled_holo_light = 0x7f020026;
public static final int abs__ic_clear_search_api_holo_light = 0x7f020027;
public static final int abs__ic_commit_search_api_holo_dark = 0x7f020028;
public static final int abs__ic_commit_search_api_holo_light = 0x7f020029;
public static final int abs__ic_go = 0x7f02002a;
public static final int abs__ic_go_search_api_holo_light = 0x7f02002b;
public static final int abs__ic_menu_moreoverflow_holo_dark = 0x7f02002c;
public static final int abs__ic_menu_moreoverflow_holo_light = 0x7f02002d;
public static final int abs__ic_menu_moreoverflow_normal_holo_dark = 0x7f02002e;
public static final int abs__ic_menu_moreoverflow_normal_holo_light = 0x7f02002f;
public static final int abs__ic_menu_share_holo_dark = 0x7f020030;
public static final int abs__ic_menu_share_holo_light = 0x7f020031;
public static final int abs__ic_search = 0x7f020032;
public static final int abs__ic_search_api_holo_light = 0x7f020033;
public static final int abs__ic_voice_search = 0x7f020034;
public static final int abs__ic_voice_search_api_holo_light = 0x7f020035;
public static final int abs__item_background_holo_dark = 0x7f020036;
public static final int abs__item_background_holo_light = 0x7f020037;
public static final int abs__list_activated_holo = 0x7f020038;
public static final int abs__list_divider_holo_dark = 0x7f020039;
public static final int abs__list_divider_holo_light = 0x7f02003a;
public static final int abs__list_focused_holo = 0x7f02003b;
public static final int abs__list_longpressed_holo = 0x7f02003c;
public static final int abs__list_pressed_holo_dark = 0x7f02003d;
public static final int abs__list_pressed_holo_light = 0x7f02003e;
public static final int abs__list_selector_background_transition_holo_dark = 0x7f02003f;
public static final int abs__list_selector_background_transition_holo_light = 0x7f020040;
public static final int abs__list_selector_disabled_holo_dark = 0x7f020041;
public static final int abs__list_selector_disabled_holo_light = 0x7f020042;
public static final int abs__list_selector_holo_dark = 0x7f020043;
public static final int abs__list_selector_holo_light = 0x7f020044;
public static final int abs__menu_dropdown_panel_holo_dark = 0x7f020045;
public static final int abs__menu_dropdown_panel_holo_light = 0x7f020046;
public static final int abs__progress_bg_holo_dark = 0x7f020047;
public static final int abs__progress_bg_holo_light = 0x7f020048;
public static final int abs__progress_horizontal_holo_dark = 0x7f020049;
public static final int abs__progress_horizontal_holo_light = 0x7f02004a;
public static final int abs__progress_medium_holo = 0x7f02004b;
public static final int abs__progress_primary_holo_dark = 0x7f02004c;
public static final int abs__progress_primary_holo_light = 0x7f02004d;
public static final int abs__progress_secondary_holo_dark = 0x7f02004e;
public static final int abs__progress_secondary_holo_light = 0x7f02004f;
public static final int abs__search_dropdown_dark = 0x7f020050;
public static final int abs__search_dropdown_light = 0x7f020051;
public static final int abs__spinner_48_inner_holo = 0x7f020052;
public static final int abs__spinner_48_outer_holo = 0x7f020053;
public static final int abs__spinner_ab_default_holo_dark = 0x7f020054;
public static final int abs__spinner_ab_default_holo_light = 0x7f020055;
public static final int abs__spinner_ab_disabled_holo_dark = 0x7f020056;
public static final int abs__spinner_ab_disabled_holo_light = 0x7f020057;
public static final int abs__spinner_ab_focused_holo_dark = 0x7f020058;
public static final int abs__spinner_ab_focused_holo_light = 0x7f020059;
public static final int abs__spinner_ab_holo_dark = 0x7f02005a;
public static final int abs__spinner_ab_holo_light = 0x7f02005b;
public static final int abs__spinner_ab_pressed_holo_dark = 0x7f02005c;
public static final int abs__spinner_ab_pressed_holo_light = 0x7f02005d;
public static final int abs__tab_indicator_ab_holo = 0x7f02005e;
public static final int abs__tab_selected_focused_holo = 0x7f02005f;
public static final int abs__tab_selected_holo = 0x7f020060;
public static final int abs__tab_selected_pressed_holo = 0x7f020061;
public static final int abs__tab_unselected_pressed_holo = 0x7f020062;
public static final int abs__textfield_search_default_holo_dark = 0x7f020063;
public static final int abs__textfield_search_default_holo_light = 0x7f020064;
public static final int abs__textfield_search_right_default_holo_dark = 0x7f020065;
public static final int abs__textfield_search_right_default_holo_light = 0x7f020066;
public static final int abs__textfield_search_right_selected_holo_dark = 0x7f020067;
public static final int abs__textfield_search_right_selected_holo_light = 0x7f020068;
public static final int abs__textfield_search_selected_holo_dark = 0x7f020069;
public static final int abs__textfield_search_selected_holo_light = 0x7f02006a;
public static final int abs__textfield_searchview_holo_dark = 0x7f02006b;
public static final int abs__textfield_searchview_holo_light = 0x7f02006c;
public static final int abs__textfield_searchview_right_holo_dark = 0x7f02006d;
public static final int abs__textfield_searchview_right_holo_light = 0x7f02006e;
public static final int abs__toast_frame = 0x7f02006f;
}
public static final class id {
public static final int abs__action_bar = 0x7f070024;
public static final int abs__action_bar_container = 0x7f070023;
public static final int abs__action_bar_subtitle = 0x7f070015;
public static final int abs__action_bar_title = 0x7f070014;
public static final int abs__action_context_bar = 0x7f070025;
public static final int abs__action_menu_divider = 0x7f07000c;
public static final int abs__action_menu_presenter = 0x7f07000d;
public static final int abs__action_mode_bar = 0x7f070029;
public static final int abs__action_mode_bar_stub = 0x7f070028;
public static final int abs__action_mode_close_button = 0x7f070018;
public static final int abs__activity_chooser_view_content = 0x7f070019;
public static final int abs__checkbox = 0x7f070020;
public static final int abs__content = 0x7f070026;
public static final int abs__default_activity_button = 0x7f07001c;
public static final int abs__expand_activities_button = 0x7f07001a;
public static final int abs__home = 0x7f07000a;
public static final int abs__icon = 0x7f07001e;
public static final int abs__image = 0x7f07001b;
public static final int abs__imageButton = 0x7f070016;
public static final int abs__list_item = 0x7f07001d;
public static final int abs__progress_circular = 0x7f07000e;
public static final int abs__progress_horizontal = 0x7f07000f;
public static final int abs__radio = 0x7f070021;
public static final int abs__search_badge = 0x7f07002c;
public static final int abs__search_bar = 0x7f07002b;
public static final int abs__search_button = 0x7f07002d;
public static final int abs__search_close_btn = 0x7f070032;
public static final int abs__search_edit_frame = 0x7f07002e;
public static final int abs__search_go_btn = 0x7f070034;
public static final int abs__search_mag_icon = 0x7f07002f;
public static final int abs__search_plate = 0x7f070030;
public static final int abs__search_src_text = 0x7f070031;
public static final int abs__search_voice_btn = 0x7f070035;
public static final int abs__shortcut = 0x7f070022;
public static final int abs__split_action_bar = 0x7f070027;
public static final int abs__submit_area = 0x7f070033;
public static final int abs__textButton = 0x7f070017;
public static final int abs__title = 0x7f07001f;
public static final int abs__up = 0x7f07000b;
public static final int disableHome = 0x7f070009;
public static final int edit_query = 0x7f07002a;
public static final int homeAsUp = 0x7f070006;
public static final int listMode = 0x7f070002;
public static final int normal = 0x7f070001;
public static final int showCustom = 0x7f070008;
public static final int showHome = 0x7f070005;
public static final int showTitle = 0x7f070007;
public static final int tabMode = 0x7f070003;
public static final int useLogo = 0x7f070004;
public static final int wrap_content = 0x7f070000;
}
public static final class integer {
public static final int abs__max_action_buttons = 0x7f0b0000;
}
public static final class layout {
public static final int abs__action_bar_home = 0x7f030000;
public static final int abs__action_bar_tab = 0x7f030001;
public static final int abs__action_bar_tab_bar_view = 0x7f030002;
public static final int abs__action_bar_title_item = 0x7f030003;
public static final int abs__action_menu_item_layout = 0x7f030004;
public static final int abs__action_menu_layout = 0x7f030005;
public static final int abs__action_mode_bar = 0x7f030006;
public static final int abs__action_mode_close_item = 0x7f030007;
public static final int abs__activity_chooser_view = 0x7f030008;
public static final int abs__activity_chooser_view_list_item = 0x7f030009;
public static final int abs__list_menu_item_checkbox = 0x7f03000a;
public static final int abs__list_menu_item_icon = 0x7f03000b;
public static final int abs__list_menu_item_radio = 0x7f03000c;
public static final int abs__popup_menu_item_layout = 0x7f03000d;
public static final int abs__screen_action_bar = 0x7f03000e;
public static final int abs__screen_action_bar_overlay = 0x7f03000f;
public static final int abs__screen_simple = 0x7f030010;
public static final int abs__screen_simple_overlay_action_mode = 0x7f030011;
public static final int abs__search_dropdown_item_icons_2line = 0x7f030012;
public static final int abs__search_view = 0x7f030013;
public static final int abs__simple_dropdown_hint = 0x7f030014;
public static final int sherlock_spinner_dropdown_item = 0x7f030035;
public static final int sherlock_spinner_item = 0x7f030036;
}
public static final class string {
public static final int abs__action_bar_home_description = 0x7f0c0000;
public static final int abs__action_bar_up_description = 0x7f0c0001;
public static final int abs__action_menu_overflow_description = 0x7f0c0002;
public static final int abs__action_mode_done = 0x7f0c0003;
public static final int abs__activity_chooser_view_see_all = 0x7f0c0004;
public static final int abs__activitychooserview_choose_application = 0x7f0c0005;
public static final int abs__searchview_description_clear = 0x7f0c000a;
public static final int abs__searchview_description_query = 0x7f0c0009;
public static final int abs__searchview_description_search = 0x7f0c0008;
public static final int abs__searchview_description_submit = 0x7f0c000b;
public static final int abs__searchview_description_voice = 0x7f0c000c;
public static final int abs__shareactionprovider_share_with = 0x7f0c0006;
public static final int abs__shareactionprovider_share_with_application = 0x7f0c0007;
}
public static final class style {
public static final int Sherlock___TextAppearance_Small = 0x7f0d0046;
public static final int Sherlock___Theme = 0x7f0d0051;
public static final int Sherlock___Theme_DarkActionBar = 0x7f0d0053;
public static final int Sherlock___Theme_Light = 0x7f0d0052;
public static final int Sherlock___Widget_ActionBar = 0x7f0d0001;
public static final int Sherlock___Widget_ActionMode = 0x7f0d0016;
public static final int Sherlock___Widget_ActivityChooserView = 0x7f0d001e;
public static final int Sherlock___Widget_Holo_DropDownItem = 0x7f0d0029;
public static final int Sherlock___Widget_Holo_ListView = 0x7f0d0026;
public static final int Sherlock___Widget_Holo_Spinner = 0x7f0d0023;
public static final int Sherlock___Widget_SearchAutoCompleteTextView = 0x7f0d0033;
public static final int TextAppearance_Sherlock = 0x7f0d004a;
public static final int TextAppearance_Sherlock_Light_SearchResult = 0x7f0d004e;
public static final int TextAppearance_Sherlock_Light_SearchResult_Subtitle = 0x7f0d0050;
public static final int TextAppearance_Sherlock_Light_SearchResult_Title = 0x7f0d004f;
public static final int TextAppearance_Sherlock_Light_Small = 0x7f0d0048;
public static final int TextAppearance_Sherlock_Light_Widget_PopupMenu_Large = 0x7f0d0041;
public static final int TextAppearance_Sherlock_Light_Widget_PopupMenu_Small = 0x7f0d0043;
public static final int TextAppearance_Sherlock_SearchResult = 0x7f0d004b;
public static final int TextAppearance_Sherlock_SearchResult_Subtitle = 0x7f0d004d;
public static final int TextAppearance_Sherlock_SearchResult_Title = 0x7f0d004c;
public static final int TextAppearance_Sherlock_Small = 0x7f0d0047;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Menu = 0x7f0d0036;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Subtitle = 0x7f0d0039;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Subtitle_Inverse = 0x7f0d003a;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Title = 0x7f0d0037;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Title_Inverse = 0x7f0d0038;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Subtitle = 0x7f0d003d;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Subtitle_Inverse = 0x7f0d003e;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Title = 0x7f0d003b;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Title_Inverse = 0x7f0d003c;
public static final int TextAppearance_Sherlock_Widget_DropDownHint = 0x7f0d0049;
public static final int TextAppearance_Sherlock_Widget_DropDownItem = 0x7f0d0045;
public static final int TextAppearance_Sherlock_Widget_PopupMenu = 0x7f0d003f;
public static final int TextAppearance_Sherlock_Widget_PopupMenu_Large = 0x7f0d0040;
public static final int TextAppearance_Sherlock_Widget_PopupMenu_Small = 0x7f0d0042;
public static final int TextAppearance_Sherlock_Widget_TextView_SpinnerItem = 0x7f0d0044;
public static final int Theme_Sherlock = 0x7f0d0054;
public static final int Theme_Sherlock_Light = 0x7f0d0055;
public static final int Theme_Sherlock_Light_DarkActionBar = 0x7f0d0056;
public static final int Theme_Sherlock_Light_NoActionBar = 0x7f0d0058;
public static final int Theme_Sherlock_NoActionBar = 0x7f0d0057;
public static final int Widget = 0x7f0d0000;
public static final int Widget_Sherlock_ActionBar = 0x7f0d0002;
public static final int Widget_Sherlock_ActionBar_Solid = 0x7f0d0003;
public static final int Widget_Sherlock_ActionBar_TabBar = 0x7f0d000a;
public static final int Widget_Sherlock_ActionBar_TabText = 0x7f0d000d;
public static final int Widget_Sherlock_ActionBar_TabView = 0x7f0d0007;
public static final int Widget_Sherlock_ActionButton = 0x7f0d0010;
public static final int Widget_Sherlock_ActionButton_CloseMode = 0x7f0d0012;
public static final int Widget_Sherlock_ActionButton_Overflow = 0x7f0d0014;
public static final int Widget_Sherlock_ActionMode = 0x7f0d0017;
public static final int Widget_Sherlock_ActivityChooserView = 0x7f0d001f;
public static final int Widget_Sherlock_Button_Small = 0x7f0d0021;
public static final int Widget_Sherlock_DropDownItem_Spinner = 0x7f0d002a;
public static final int Widget_Sherlock_Light_ActionBar = 0x7f0d0004;
public static final int Widget_Sherlock_Light_ActionBar_Solid = 0x7f0d0005;
public static final int Widget_Sherlock_Light_ActionBar_Solid_Inverse = 0x7f0d0006;
public static final int Widget_Sherlock_Light_ActionBar_TabBar = 0x7f0d000b;
public static final int Widget_Sherlock_Light_ActionBar_TabBar_Inverse = 0x7f0d000c;
public static final int Widget_Sherlock_Light_ActionBar_TabText = 0x7f0d000e;
public static final int Widget_Sherlock_Light_ActionBar_TabText_Inverse = 0x7f0d000f;
public static final int Widget_Sherlock_Light_ActionBar_TabView = 0x7f0d0008;
public static final int Widget_Sherlock_Light_ActionBar_TabView_Inverse = 0x7f0d0009;
public static final int Widget_Sherlock_Light_ActionButton = 0x7f0d0011;
public static final int Widget_Sherlock_Light_ActionButton_CloseMode = 0x7f0d0013;
public static final int Widget_Sherlock_Light_ActionButton_Overflow = 0x7f0d0015;
public static final int Widget_Sherlock_Light_ActionMode = 0x7f0d0018;
public static final int Widget_Sherlock_Light_ActionMode_Inverse = 0x7f0d0019;
public static final int Widget_Sherlock_Light_ActivityChooserView = 0x7f0d0020;
public static final int Widget_Sherlock_Light_Button_Small = 0x7f0d0022;
public static final int Widget_Sherlock_Light_DropDownItem_Spinner = 0x7f0d002b;
public static final int Widget_Sherlock_Light_ListPopupWindow = 0x7f0d001b;
public static final int Widget_Sherlock_Light_ListView_DropDown = 0x7f0d0028;
public static final int Widget_Sherlock_Light_PopupMenu = 0x7f0d001d;
public static final int Widget_Sherlock_Light_PopupWindow_ActionMode = 0x7f0d002d;
public static final int Widget_Sherlock_Light_ProgressBar = 0x7f0d002f;
public static final int Widget_Sherlock_Light_ProgressBar_Horizontal = 0x7f0d0031;
public static final int Widget_Sherlock_Light_SearchAutoCompleteTextView = 0x7f0d0035;
public static final int Widget_Sherlock_Light_Spinner_DropDown_ActionBar = 0x7f0d0025;
public static final int Widget_Sherlock_ListPopupWindow = 0x7f0d001a;
public static final int Widget_Sherlock_ListView_DropDown = 0x7f0d0027;
public static final int Widget_Sherlock_PopupMenu = 0x7f0d001c;
public static final int Widget_Sherlock_PopupWindow_ActionMode = 0x7f0d002c;
public static final int Widget_Sherlock_ProgressBar = 0x7f0d002e;
public static final int Widget_Sherlock_ProgressBar_Horizontal = 0x7f0d0030;
public static final int Widget_Sherlock_SearchAutoCompleteTextView = 0x7f0d0034;
public static final int Widget_Sherlock_Spinner_DropDown_ActionBar = 0x7f0d0024;
public static final int Widget_Sherlock_TextView_SpinnerItem = 0x7f0d0032;
}
public static final class styleable {
public static final int[] SherlockActionBar = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e, 0x7f01004f, 0x7f010050, 0x7f010051, 0x7f010052, 0x7f010053, 0x7f010054, 0x7f010055 };
public static final int SherlockActionBar_background = 2;
public static final int SherlockActionBar_backgroundSplit = 3;
public static final int SherlockActionBar_backgroundStacked = 12;
public static final int SherlockActionBar_customNavigationLayout = 13;
public static final int SherlockActionBar_displayOptions = 7;
public static final int SherlockActionBar_divider = 5;
public static final int SherlockActionBar_height = 4;
public static final int SherlockActionBar_homeLayout = 14;
public static final int SherlockActionBar_icon = 10;
public static final int SherlockActionBar_indeterminateProgressStyle = 16;
public static final int SherlockActionBar_itemPadding = 18;
public static final int SherlockActionBar_logo = 11;
public static final int SherlockActionBar_navigationMode = 6;
public static final int SherlockActionBar_progressBarPadding = 17;
public static final int SherlockActionBar_progressBarStyle = 15;
public static final int SherlockActionBar_subtitle = 9;
public static final int SherlockActionBar_subtitleTextStyle = 1;
public static final int SherlockActionBar_title = 8;
public static final int SherlockActionBar_titleTextStyle = 0;
public static final int[] SherlockActionMenuItemView = { 0x0101013f };
public static final int SherlockActionMenuItemView_android_minWidth = 0;
public static final int[] SherlockActionMode = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004 };
public static final int SherlockActionMode_background = 2;
public static final int SherlockActionMode_backgroundSplit = 3;
public static final int SherlockActionMode_height = 4;
public static final int SherlockActionMode_subtitleTextStyle = 1;
public static final int SherlockActionMode_titleTextStyle = 0;
public static final int[] SherlockActivityChooserView = { 0x010100d4, 0x7f01005e, 0x7f01005f };
public static final int SherlockActivityChooserView_android_background = 0;
public static final int SherlockActivityChooserView_expandActivityOverflowButtonDrawable = 2;
public static final int SherlockActivityChooserView_initialActivityCount = 1;
public static final int[] SherlockMenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 };
public static final int SherlockMenuGroup_android_checkableBehavior = 5;
public static final int SherlockMenuGroup_android_enabled = 0;
public static final int SherlockMenuGroup_android_id = 1;
public static final int SherlockMenuGroup_android_menuCategory = 3;
public static final int SherlockMenuGroup_android_orderInCategory = 4;
public static final int SherlockMenuGroup_android_visible = 2;
public static final int[] SherlockMenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x010102d9, 0x010102fb, 0x010102fc, 0x01010389 };
public static final int SherlockMenuItem_android_actionLayout = 14;
public static final int SherlockMenuItem_android_actionProviderClass = 16;
public static final int SherlockMenuItem_android_actionViewClass = 15;
public static final int SherlockMenuItem_android_alphabeticShortcut = 9;
public static final int SherlockMenuItem_android_checkable = 11;
public static final int SherlockMenuItem_android_checked = 3;
public static final int SherlockMenuItem_android_enabled = 1;
public static final int SherlockMenuItem_android_icon = 0;
public static final int SherlockMenuItem_android_id = 2;
public static final int SherlockMenuItem_android_menuCategory = 5;
public static final int SherlockMenuItem_android_numericShortcut = 10;
public static final int SherlockMenuItem_android_onClick = 12;
public static final int SherlockMenuItem_android_orderInCategory = 6;
public static final int SherlockMenuItem_android_showAsAction = 13;
public static final int SherlockMenuItem_android_title = 7;
public static final int SherlockMenuItem_android_titleCondensed = 8;
public static final int SherlockMenuItem_android_visible = 4;
public static final int[] SherlockMenuView = { 0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b, 0x7f01005c, 0x7f01005d };
public static final int SherlockMenuView_headerBackground = 3;
public static final int SherlockMenuView_horizontalDivider = 1;
public static final int SherlockMenuView_itemBackground = 4;
public static final int SherlockMenuView_itemIconDisabledAlpha = 6;
public static final int SherlockMenuView_itemTextAppearance = 0;
public static final int SherlockMenuView_preserveIconSpacing = 7;
public static final int SherlockMenuView_verticalDivider = 2;
public static final int SherlockMenuView_windowAnimationStyle = 5;
public static final int[] SherlockSearchView = { 0x0101011f, 0x01010220, 0x01010264, 0x7f010060, 0x7f010061 };
public static final int SherlockSearchView_android_imeOptions = 2;
public static final int SherlockSearchView_android_inputType = 1;
public static final int SherlockSearchView_android_maxWidth = 0;
public static final int SherlockSearchView_iconifiedByDefault = 3;
public static final int SherlockSearchView_queryHint = 4;
public static final int[] SherlockSpinner = { 0x010100af, 0x01010175, 0x01010176, 0x0101017b, 0x01010262, 0x010102ac, 0x010102ad, 0x0101043a };
public static final int SherlockSpinner_android_dropDownHorizontalOffset = 5;
public static final int SherlockSpinner_android_dropDownSelector = 1;
public static final int SherlockSpinner_android_dropDownVerticalOffset = 6;
public static final int SherlockSpinner_android_dropDownWidth = 4;
public static final int SherlockSpinner_android_gravity = 0;
public static final int SherlockSpinner_android_popupBackground = 2;
public static final int SherlockSpinner_android_popupPromptView = 7;
public static final int SherlockSpinner_android_prompt = 3;
public static final int[] SherlockTheme = { 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021, 0x7f010022, 0x7f010023, 0x7f010024, 0x7f010025, 0x7f010026, 0x7f010027, 0x7f010028, 0x7f010029, 0x7f01002a, 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039, 0x7f01003a, 0x7f01003b, 0x7f01003c, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046, 0x7f010047, 0x7f010048 };
public static final int SherlockTheme_actionBarDivider = 8;
public static final int SherlockTheme_actionBarItemBackground = 9;
public static final int SherlockTheme_actionBarSize = 7;
public static final int SherlockTheme_actionBarSplitStyle = 5;
public static final int SherlockTheme_actionBarStyle = 4;
public static final int SherlockTheme_actionBarTabBarStyle = 1;
public static final int SherlockTheme_actionBarTabStyle = 0;
public static final int SherlockTheme_actionBarTabTextStyle = 2;
public static final int SherlockTheme_actionBarWidgetTheme = 6;
public static final int SherlockTheme_actionButtonStyle = 52;
public static final int SherlockTheme_actionDropDownStyle = 51;
public static final int SherlockTheme_actionMenuTextAppearance = 10;
public static final int SherlockTheme_actionMenuTextColor = 11;
public static final int SherlockTheme_actionModeBackground = 14;
public static final int SherlockTheme_actionModeCloseButtonStyle = 13;
public static final int SherlockTheme_actionModeCloseDrawable = 16;
public static final int SherlockTheme_actionModePopupWindowStyle = 18;
public static final int SherlockTheme_actionModeShareDrawable = 17;
public static final int SherlockTheme_actionModeSplitBackground = 15;
public static final int SherlockTheme_actionModeStyle = 12;
public static final int SherlockTheme_actionOverflowButtonStyle = 3;
public static final int SherlockTheme_actionSpinnerItemStyle = 57;
public static final int SherlockTheme_activatedBackgroundIndicator = 65;
public static final int SherlockTheme_activityChooserViewStyle = 64;
public static final int SherlockTheme_buttonStyleSmall = 19;
public static final int SherlockTheme_dividerVertical = 50;
public static final int SherlockTheme_dropDownHintAppearance = 66;
public static final int SherlockTheme_dropDownListViewStyle = 54;
public static final int SherlockTheme_dropdownListPreferredItemHeight = 56;
public static final int SherlockTheme_homeAsUpIndicator = 53;
public static final int SherlockTheme_listPopupWindowStyle = 63;
public static final int SherlockTheme_listPreferredItemHeightSmall = 44;
public static final int SherlockTheme_listPreferredItemPaddingLeft = 45;
public static final int SherlockTheme_listPreferredItemPaddingRight = 46;
public static final int SherlockTheme_popupMenuStyle = 55;
public static final int SherlockTheme_searchAutoCompleteTextView = 30;
public static final int SherlockTheme_searchDropdownBackground = 31;
public static final int SherlockTheme_searchResultListItemHeight = 41;
public static final int SherlockTheme_searchViewCloseIcon = 32;
public static final int SherlockTheme_searchViewEditQuery = 36;
public static final int SherlockTheme_searchViewEditQueryBackground = 37;
public static final int SherlockTheme_searchViewGoIcon = 33;
public static final int SherlockTheme_searchViewSearchIcon = 34;
public static final int SherlockTheme_searchViewTextField = 38;
public static final int SherlockTheme_searchViewTextFieldRight = 39;
public static final int SherlockTheme_searchViewVoiceIcon = 35;
public static final int SherlockTheme_selectableItemBackground = 20;
public static final int SherlockTheme_spinnerDropDownItemStyle = 29;
public static final int SherlockTheme_spinnerItemStyle = 28;
public static final int SherlockTheme_textAppearanceLargePopupMenu = 22;
public static final int SherlockTheme_textAppearanceListItemSmall = 47;
public static final int SherlockTheme_textAppearanceSearchResultSubtitle = 43;
public static final int SherlockTheme_textAppearanceSearchResultTitle = 42;
public static final int SherlockTheme_textAppearanceSmall = 24;
public static final int SherlockTheme_textAppearanceSmallPopupMenu = 23;
public static final int SherlockTheme_textColorPrimary = 25;
public static final int SherlockTheme_textColorPrimaryDisableOnly = 26;
public static final int SherlockTheme_textColorPrimaryInverse = 27;
public static final int SherlockTheme_textColorSearchUrl = 40;
public static final int SherlockTheme_windowActionBar = 59;
public static final int SherlockTheme_windowActionBarOverlay = 60;
public static final int SherlockTheme_windowActionModeOverlay = 61;
public static final int SherlockTheme_windowContentOverlay = 21;
public static final int SherlockTheme_windowMinWidthMajor = 48;
public static final int SherlockTheme_windowMinWidthMinor = 49;
public static final int SherlockTheme_windowNoTitle = 58;
public static final int SherlockTheme_windowSplitActionBar = 62;
public static final int[] SherlockView = { 0x010100da };
public static final int SherlockView_android_focusable = 0;
}
}
| [
"liaojiejie8@gmail.com"
] | liaojiejie8@gmail.com |
8ba03db3a0bb20f0b99a8c5d70b8e803ee18dca0 | af79bfd264930021932cf413d65c75bd84e58866 | /originalSite/src/java/jums/JumsHelper.java | effca7add25baa5d874dc112a5342121d8739669 | [] | no_license | yuya0201/Originalsite | aa1048b9d5ece9419f7c2f21ed8990486d084910 | 0759cef1b0d783ea35598bb617129b539fb62551 | refs/heads/master | 2021-05-03T13:36:41.451209 | 2016-09-27T03:00:33 | 2016-09-27T03:00:33 | 68,975,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,321 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package jums;
import java.util.ArrayList;
/**
*
* @author yuya
*/
public class JumsHelper {
//トップへのリンクを定数として設定
private final String homeURL = "search.jsp";
//インスタンスオブジェクトを返却させてコードの簡略化
public static JumsHelper getInstance(){
return new JumsHelper();
}
//トップへのリンクを返却
public String home(){
return "<a href=\""+homeURL+"\">トップへ戻る</a>";
}
/**
* 入力されたデータのうち未入力項目がある場合、チェックリストにしたがいどの項目が
* 未入力なのかのhtml文を返却する
* @param chkList UserDataBeansで生成されるリスト。未入力要素の名前が格納されている
* @return 未入力の項目に対応する文字列
*/
public String chkinput(ArrayList<String> chkList){
String output = "";
for(String val : chkList){
if(val.equals("name")){
output += "名前";
}
if(val.equals("password")){
output +="パスワード";
}
if(val.equals("mail")){
output +="メールアドレス";
}
if(val.equals("addres")){
output +="住所";
}
if(val.equals("reviews")){
output += "感想";
}
if(val.equals("evaluation")){
output +="評価";
}
output +="が未記入です<br>";
}
return output;
}
public String chkreviews(ArrayList<String> chkList){
String output = "";
for(String val : chkList){
if(val.equals("reviews")){
output += "感想";
}
if(val.equals("evaluation")){
output +="評価";
}
output +="が未記入です<br>";
}
return output;
}
}
| [
"yuya02011991@icloud.com"
] | yuya02011991@icloud.com |
96cba202381ef8e45007685745c01967a8cfc20e | 6f31629748be043b5fef7e05c2c00b2cc0534d3f | /src/interfaces/RandomDoubles.java | 258295b7ea051e259712629fcc707c7a08955a22 | [] | no_license | lyzkhqby/ThinkInJava | a7ecf6278bea97bc30ec27233a786efdd8c3df3a | a90668a5f23c01d83f51b6953f6a0144451ed329 | refs/heads/master | 2021-05-04T18:37:36.503063 | 2018-04-12T07:14:41 | 2018-04-12T07:14:41 | 120,162,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package interfaces;
import java.util.Random;
public class RandomDoubles {
private static Random rand = new Random(47);
public double next() {
return rand.nextDouble();
}
public static void main(String[] args) {
RandomDoubles rd = new RandomDoubles();
for (int i = 0; i < 7; i++)
System.out.println(rd.next() + " ");
}
}
| [
"lyzkhqby@sina.com"
] | lyzkhqby@sina.com |
ea499d7ba00e9c6d1e9dd97fb7c61702352a7fb1 | 638d99d7f1c5fda94814efa352c37d9cdfa3335c | /src/projectPractice/LearningStrings.java | 02235ba7f1a29674a7ac0b1b5435bff131cc9f90 | [] | no_license | rahulautomation24/freecrm | 6a5c78a778614258a54a8457fae4aaa594f15961 | 0505fe27cdd12cc33df0467749934be81dbc9875 | refs/heads/master | 2021-05-10T09:55:37.459835 | 2018-01-25T18:08:21 | 2018-01-25T18:08:21 | 118,942,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,229 | java | package projectPractice;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;
import java.util.Scanner;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class LearningStrings {
public static void main(String[] args) {
System.out.println(calcper(5, 20)+"%");
// TODO Auto-generated method stub
int val = 0;
System.out.println("Before Writing");
writeFile("I am writing in the file /n");
System.out.println("After writing");
try{ val =9/0;
}
catch(Exception e)
{
System.out.println("Arithmetic exception");
}
System.out.println("Procedding with the flow");
System.out.println("Value is "+ val);
boolean chkeven=isEven();
System.out.println(chkeven);
/*int fact= calcFactorial(5);
System.out.println(fact);*/
Scanner in = new Scanner(System.in);
System.out.println("Enter number of elements");
int n = in.nextInt();
/*String s="Automation in Selenium";
char[] arr=s.toCharArray();
System.setProperty("webdriver.gecko.driver", "D:\\Automation\\Jars\\mozilladriver\\geckodriver.exe");
WebDriver dri = new FirefoxDriver();
dri.navigate().to(getproperty("url"));
dri.findElement(By.xpath("//input[@name='uid']")).sendKeys(getproperty("username"));
dri.findElement(By.xpath("//input[@name='password']")).sendKeys(getproperty("password"));
dri.findElement(By.xpath("//input[@name='btnLogin']")).click();
*/ }
public static String getproperty(String prop){
FileInputStream input = null;
Properties pr;
pr= new Properties();
try {
input =new FileInputStream("D:\\Automation\\Workspace\\projectPractice\\propfile.properties");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
pr.load(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return pr.getProperty(prop);
}
public static void writeFile(String Content){
FileWriter fw = null;
BufferedWriter bw= null;
try {
fw= new FileWriter("D:\\Automation\\Workspace\\projectPractice\\fileWriting.txt",true);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bw= new BufferedWriter(fw);
try {
bw.write(Content);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
bw.flush();
fw.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static boolean isEven(){
boolean isEven=false;
int n=1;
if(n%2==0){
isEven=true;
System.out.println("Number "+ n +" is Even");
}
else{
System.out.println("Number "+ n +" is Odd");
isEven=false;}
return isEven;
}
public static int calcFactorial(int n){
int fact=1;
while(!(n==1)){
fact=n*(n-1);
}
return fact;
}
public static double calcper(double number, double base){
return (number/base)*100;
}
} | [
"rahul.kala24@gmail.com"
] | rahul.kala24@gmail.com |
73b7e5b8a97749c2780015cf2bc74d2cb13b08eb | f5442ce4a67de5f8f774ecd2cef1fc39837b5778 | /algo/simulator/src/main/java/webcurve/util/FixUtil.java | 50b424eb43a6c717cef779bc47b0349023d66f1a | [
"BSD-2-Clause"
] | permissive | czrtrading/czrtrading | f253755325208a42ee3f9f57729ca721036924d5 | 7dfe8a1ac753b6f6b3ce0a53a6faa668dff40919 | refs/heads/master | 2016-09-08T00:38:42.385611 | 2013-03-07T02:07:51 | 2013-03-07T02:07:51 | 8,617,861 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,878 | java | package webcurve.util;
import quickfix.field.OrdStatus;
import webcurve.client.ClientOrder;
import webcurve.common.BaseOrder;
import webcurve.common.Order;
/**
* @author dennis_d_chen@yahoo.com
*/
public class FixUtil {
// Fix utils
public static char toFixOrderSide(BaseOrder.SIDE side) throws Exception {
if (side == BaseOrder.SIDE.BID)
return '1';
else if (side == BaseOrder.SIDE.ASK)
return '2';
else
throw new Exception("toFixOrderSide: unknown side " + side);
}
public static char toFixClientOrderSide(ClientOrder.SIDE side,
boolean shortSell) throws Exception {
if (side == ClientOrder.SIDE.BID)
return '1';
else if (side == ClientOrder.SIDE.ASK) {
if (shortSell)
return '5';
else
return '2';
} else
throw new Exception("toFixClientOrderSide: unknown side " + side);
}
public static char toFixClientOrderType(ClientOrder.TYPE type)
throws Exception {
if (type == ClientOrder.TYPE.MARKET)
return '1';
else if (type == ClientOrder.TYPE.LIMIT)
return '2';
else
throw new Exception("toFixClientOrderType: unknown type " + type);
}
public static BaseOrder.SIDE fromFixOrderSide(char side) throws Exception {
if (side == '1')
return Order.SIDE.BID;
else if (side == '2' || side == '5')
return Order.SIDE.ASK;
else
throw new Exception("fromFixOrderSide: unknown side " + side);
}
public static ClientOrder.STATUS fromFixOrdStatus(OrdStatus ordStatus) {
if (ordStatus.valueEquals(OrdStatus.NEW))
return ClientOrder.STATUS.NEW;
if (ordStatus.valueEquals(OrdStatus.PARTIALLY_FILLED))
return ClientOrder.STATUS.PARTIALLY_FILLED;
if (ordStatus.valueEquals(OrdStatus.FILLED))
return ClientOrder.STATUS.FILLED;
if (ordStatus.valueEquals(OrdStatus.DONE_FOR_DAY))
return ClientOrder.STATUS.DONE_FOR_DAY;
if (ordStatus.valueEquals(OrdStatus.CANCELED))
return ClientOrder.STATUS.CANCELED;
if (ordStatus.valueEquals(OrdStatus.REPLACED))
return ClientOrder.STATUS.REPLACED;
if (ordStatus.valueEquals(OrdStatus.PENDING_CANCEL))
return ClientOrder.STATUS.PENDING_CANCEL;
if (ordStatus.valueEquals(OrdStatus.STOPPED))
return ClientOrder.STATUS.STOPPED;
if (ordStatus.valueEquals(OrdStatus.REJECTED))
return ClientOrder.STATUS.REJECTED;
if (ordStatus.valueEquals(OrdStatus.SUSPENDED))
return ClientOrder.STATUS.SUSPENDED;
if (ordStatus.valueEquals(OrdStatus.PENDING_NEW))
return ClientOrder.STATUS.PENDING_NEW;
if (ordStatus.valueEquals(OrdStatus.CALCULATED))
return ClientOrder.STATUS.CALCULATED;
if (ordStatus.valueEquals(OrdStatus.EXPIRED))
return ClientOrder.STATUS.EXPIRED;
if (ordStatus.valueEquals(OrdStatus.ACCEPTED_FOR_BIDDING))
return ClientOrder.STATUS.ACCEPTED_FOR_BIDDING;
if (ordStatus.valueEquals(OrdStatus.PENDING_REPLACE))
return ClientOrder.STATUS.PENDING_REPLACE;
return ClientOrder.STATUS.ERROR;
}
}
| [
"yc3@princeton.edu"
] | yc3@princeton.edu |
9610a30835766ea3fc07da6749df7a4f1f602735 | 0abceef1b38027932254b578e5203db626f73f3a | /predictr/src/main/java/com/sjsu/cmpe239/yelp/GetCheckinData.java | d2af797aa991c8bcce24cd1aa0a0aadfd3fe5d75 | [] | no_license | PoornimaSanjeevi/FinalProject-CMPE239 | 921c56924465736183aa596bb46351966ae17e4e | d23014dad3a9c719c328bd56eb011f2686f01d15 | refs/heads/master | 2016-08-12T14:44:02.092578 | 2015-12-09T02:33:59 | 2015-12-09T02:33:59 | 47,171,226 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,404 | java | package com.sjsu.cmpe239.yelp;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
import java.util.Set;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
/**
* Created by poornima on 11/19/15.
*/
public class GetCheckinData {
static String[] getOpenCloseHours(JSONObject obj, String day) {
JSONObject days = (JSONObject) obj.get(day);
String[] open = new String[2];
try {
open[0] = days.get("open").toString();
open[1] = days.get("close").toString();
} catch (NullPointerException e) {
open[0] = "-1";
open[1] = "-1";
}
return open;
}
public static void main(String[] args) throws IOException {
Set<String> restaurants = new HashSet<String>();
BufferedReader br1 = new BufferedReader(
new InputStreamReader(
new FileInputStream(
"/data/239/yelp/predOut/restaurantIds.txt")));
String line = null;
while ((line = br1.readLine()) != null) {
restaurants.add(line);
}
br1.close();
BufferedReader br2 = new BufferedReader(
new InputStreamReader(
new FileInputStream(
"/data/239/yelp/yelp_dataset_challenge_academic_dataset/yelp_academic_dataset_checkin.json")));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(
"/data/239/yelp/predOut/checkin.csv")));
String json = null;
int cnt = 0, restCnt = 0;
while ((json = br2.readLine()) != null) {
JSONObject obj = (JSONObject) JSONValue.parse(json);
String busId = obj.get("business_id").toString();
if (restaurants.contains(busId)) {
bw.write(busId);
// String userId = obj.get("user_id").toString();
JSONObject checkininfo = (JSONObject) obj.get("checkin_info");
int[] weekSum = new int[7];
for (int i = 0; i < 7; i++) {
weekSum[i] = 0;
for (int j = 0; j < 24; j++) {
String key = j + "-" + i;
try {
weekSum[i] += Integer.parseInt(checkininfo.get(key)
.toString());
} catch (Exception e) {
}
}
bw.write("," + weekSum[i]);
}
bw.write("\n");
restCnt++;
}
cnt++;
}
br2.close();
System.out.println("Total Reviews:" + cnt);
System.out.println("Restaurants:" + restCnt);
bw.close();
}
}
| [
"Poornima@Poornimas-MacBook-Pro.local"
] | Poornima@Poornimas-MacBook-Pro.local |
84089dc5e62f31a6895a40b3fce512d00bbfaf60 | 95733f69324371d782881df85772ef8c4f1e63db | /first-selenium-project/src/test/java/com/telran/qa15/homework1/OpenWikipediaTest2.java | 886b22bcb9b448483e0f20683127f4f6cfb3a548 | [
"Apache-2.0"
] | permissive | YanaShapiro/YanaQA15 | 6179c01c19162a22e473849569ab89efc7464cee | ed93739f18c1a4c562ff9c4b1d0e9df15c78cdc9 | refs/heads/master | 2020-03-28T21:22:15.883604 | 2018-10-06T13:55:17 | 2018-10-06T13:55:17 | 149,149,827 | 0 | 1 | Apache-2.0 | 2018-09-25T08:49:18 | 2018-09-17T15:49:51 | Java | UTF-8 | Java | false | false | 799 | java | package com.telran.qa15.homework1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
public class OpenWikipediaTest2 {
WebDriver wd;
@BeforeMethod
public void setUp(){
wd=new EdgeDriver();
wd.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
}
@Test
public void openSiteTest() {
wd.navigate().to("https://www.wikipedia.org/");
}
@AfterMethod
public void tearDown()throws InterruptedException {
Thread.sleep(2000);// чтобы страница браузера была открыта
wd.quit();
}
}
| [
"ofkvin25@gmail.com"
] | ofkvin25@gmail.com |
ff7956702e99b247efc8fa5193cce9f454436877 | 830b44e379c246aff3c178bd486657151f1549cd | /src/com/intoms/oop/Demo.java | c92ba4d724741dc93941f5141e6793aeb6ee689b | [] | no_license | huyu520/Java_Demo | 0ada14a5052745886ffa4d2b514965b5dde804e9 | f592fab64fca1a6e6ca79354b85f884121164db1 | refs/heads/master | 2021-01-20T14:43:39.571008 | 2017-04-27T06:39:29 | 2017-04-27T06:39:29 | 82,771,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | /**
*
*/
package com.intoms.oop;
/**
* CopyRight by 2016 Mfish
* All Right Reserved
*
* @author hy
* Create on 2017年2月9日下午8:58:56
*/
public class Demo {
public static void main(String[] args) {
// Timo timo = new Timo();
// timo.setAge("222");
// timo.excuteActivity();
// System.out.println(timo.getAge() + "|" + timo.excuteActivity());
}
}
| [
"hy@intoms.cn"
] | hy@intoms.cn |
45a2ade8907dcfed67b6fc8d35870098a718c1b9 | 492ab60eaa5619551af16c79c569bdb704b4d231 | /src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java | c8a26413117874bfa7f3cfb19ef3f76491678467 | [] | no_license | ddcjackm/plantuml | 36b89d07401993f6cbb109c955db4ab10a47ac78 | 4638f93975a0af9374cec8200d16e1fa180dafc2 | refs/heads/master | 2021-01-12T22:34:56.588483 | 2016-07-25T19:25:28 | 2016-07-25T19:25:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,395 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* Original Author: Arnaud Roques
*
* Revision $Revision: 19109 $
*
*/
package net.sourceforge.plantuml.classdiagram.command;
import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
public class CommandStereotype extends SingleLineCommand<ClassDiagram> {
public CommandStereotype() {
super("(?i)^([\\p{L}0-9_.]+|[%g][^%g]+[%g])[%s]*(\\<\\<.*\\>\\>)$");
}
@Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, List<String> arg) {
final Code code = Code.of(arg.get(0));
final String stereotype = arg.get(1);
final IEntity entity = diagram.getOrCreateLeaf(code, null, null);
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet()));
return CommandExecutionResult.ok();
}
}
| [
"plantuml@gmail.com"
] | plantuml@gmail.com |
c366e0cf2affff43ad8121dd217ceff9657a7b40 | 5a2ead6fea0fcd6583fc4870235bf2cce1f98cbd | /NavigationDrawer/src/com/nurvsoft/navigationdrawer/BaseActivity.java | 65462c0d3d71213119bf0ebcd1f7b3c290bbef43 | [] | no_license | aftabsikander/NuvrSoft | dc0884a6ab8a197381b421e70d10068c1a962424 | ae94d137333456847736c8be2cfabc34e0a5df9b | refs/heads/master | 2020-04-04T14:35:13.128747 | 2014-11-16T12:38:40 | 2014-11-16T12:38:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,969 | java | package com.nurvsoft.navigationdrawer;
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.nurvsoft.navigationdrawer.adapter.NavDrawerListAdapter;
import com.nurvsoft.navigationdrawer.model.NavDrawerItem;
public class BaseActivity extends ActionBarActivity
{
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private ActionBarDrawerToggle mDrawerToggle;
// nav drawer title
private CharSequence mDrawerTitle;
// used to store app title
private CharSequence mTitle;
// slide menu items
private String [] navMenuTitles;
private TypedArray navMenuIcons;
private ArrayList<NavDrawerItem> navDrawerItems;
private NavDrawerListAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_base);
mTitle = mDrawerTitle = getTitle();
// load slide menu items
navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items);
// nav drawer icons from resources
navMenuIcons = getResources().obtainTypedArray(R.array.nav_drawer_icons);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.list_slidermenu);
navDrawerItems = new ArrayList<NavDrawerItem>();
// adding nav drawer items to array
// Home
navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
// Find People
navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
// Photos
navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1)));
// Communities, Will add a counter here
navDrawerItems.add(new NavDrawerItem(navMenuTitles[3], navMenuIcons.getResourceId(3, -1), true, "22"));
// Pages
navDrawerItems.add(new NavDrawerItem(navMenuTitles[4], navMenuIcons.getResourceId(4, -1)));
// What's hot, We will add a counter here
navDrawerItems.add(new NavDrawerItem(navMenuTitles[5], navMenuIcons.getResourceId(5, -1), true, "50+"));
// Recycle the typed array
navMenuIcons.recycle();
mDrawerList.setOnItemClickListener(new SlideMenuClickListener());
// setting the nav drawer list adapter
adapter = new NavDrawerListAdapter(getApplicationContext(), navDrawerItems);
mDrawerList.setAdapter(adapter);
// enabling action bar app icon and behaving it as toggle button
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, // nav menu toggle icon
R.string.app_name, // nav drawer open - description for accessibility
R.string.app_name // nav drawer close - description for accessibility
)
{
@SuppressLint("NewApi")
public void onDrawerClosed(View view)
{
getSupportActionBar().setTitle(mTitle);
// calling onPrepareOptionsMenu() to show action bar icons
invalidateOptionsMenu();
}
@SuppressLint("NewApi")
public void onDrawerOpened(View drawerView)
{
getSupportActionBar().setTitle(mDrawerTitle);
// calling onPrepareOptionsMenu() to hide action bar icons
invalidateOptionsMenu();
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
if (savedInstanceState == null)
{
// on first time display view for first nav item
displayView(0);
}
}
/**
* Slide menu item click listener
* */
private class SlideMenuClickListener implements ListView.OnItemClickListener
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
// display view for selected nav drawer item
displayView(position);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.base, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
// toggle nav drawer on selecting action bar app icon/title
if (mDrawerToggle.onOptionsItemSelected(item))
{
return true;
}
// Handle action bar actions click
switch (item.getItemId())
{
case R.id.action_settings:
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/* *
* Called when invalidateOptionsMenu() is triggered
*/
@Override
public boolean onPrepareOptionsMenu(Menu menu)
{
// if nav drawer is opened, hide the action items
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
menu.findItem(R.id.action_settings).setVisible(!drawerOpen);
return super.onPrepareOptionsMenu(menu);
}
/**
* Diplaying fragment view for selected nav drawer list item
* */
private void displayView(int position)
{
// update the main content by replacing fragments
Fragment fragment = null;
switch (position)
{
case 0:
fragment = new HomeFragment();
break;
case 1:
fragment = new FindPeopleFragment();
break;
case 2:
fragment = new PhotosFragment();
break;
case 3:
fragment = new CommunityFragment();
break;
case 4:
fragment = new PagesFragment();
break;
case 5:
fragment = new WhatsHotFragment();
break;
default:
break;
}
if (fragment != null)
{
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
// update selected item and title, then close the drawer
mDrawerList.setItemChecked(position, true);
mDrawerList.setSelection(position);
setTitle(navMenuTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
}
else
{
// error in creating fragment
Log.e("MainActivity", "Error in creating fragment");
}
}
@Override
public void setTitle(CharSequence title)
{
mTitle = title;
getSupportActionBar().setTitle(mTitle);
}
/**
* When using the ActionBarDrawerToggle, you must call it during onPostCreate() and onConfigurationChanged()...
*/
@Override
protected void onPostCreate(Bundle savedInstanceState)
{
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
// Pass any configuration change to the drawer toggls
mDrawerToggle.onConfigurationChanged(newConfig);
}
}
| [
"aftabsikander@outlook.com"
] | aftabsikander@outlook.com |
4e91f6438ea6222ff9d8da903f88698c87765923 | bf3be00a197a37c3f482df7a154a73dc9ea6ab87 | /src/main/java/com/xx/demo/util/DateUtils.java | a83ba25711f2439cccafb7240ea8327bc42e2f6a | [] | no_license | lwxingCoding/spring-boot-demo | dbe476d5283d6dfcb46beb4c97c304910078a6bc | 8ec6689f4f227a20c528ebde52356f20d4e7bfa0 | refs/heads/master | 2023-01-01T10:29:26.683783 | 2020-10-28T08:24:59 | 2020-10-28T08:24:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,564 | java | package com.xx.demo.util;
import io.micrometer.core.instrument.util.StringUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
/**
* 工具类-日期处理
* @author lwx
*/
public class DateUtils {
/**
* 获得当前日期
*
* @return
*/
public static Date getNow() {
Calendar cal = Calendar.getInstance();
Date currDate = cal.getTime();
return currDate;
}
/**
* 日期转换为字符串 格式自定义
*
* @param date
* @param f
* @return
*/
public static String dateStr(Date date, String f) {
if (date == null) {
return "";
}
SimpleDateFormat format = new SimpleDateFormat(f);
String str = format.format(date);
return str;
}
/**
* 日期转换为字符串 MM月dd日 hh:mm
*
* @param date
* @return
*/
public static String dateStr(Date date) {
return dateStr(date, "MM月dd日 hh:mm");
}
/**
* 日期转换为字符串 yyyy-MM-dd
*
* @param date
* @return
*/
public static String dateStr2(Date date) {
return dateStr(date, "yyyy-MM-dd");
}
/**
* yyyy年MM月dd日HH时mm分ss秒
*
* @param date
* @return
*/
public static String dateStr5(Date date) {
return dateStr(date, "yyyy年MM月dd日 HH时mm分ss秒");
}
/**
* yyyyMMddHHmmss
*
* @param date
* @return
*/
public static String dateStr3(Date date) {
return dateStr(date, "yyyyMMddHHmmss");
}
/**
* yyyy-MM-dd HH:mm:ss
*
* @param date
* @return
*/
public static String dateStr4(Date date) {
return dateStr(date, "yyyy-MM-dd HH:mm:ss");
}
/**
* yyyy年MM月dd日
*
* @param date
* @return
*/
public static String dateStr6(Date date) {
return dateStr(date, "yyyy年MM月dd日");
}
/**
* yyyyMMdd
*
* @param date
* @return
*/
public static String dateStr7(Date date) {
return dateStr(date, "yyyyMMdd");
}
/**
* MM-dd
*
* @param date
* @return
*/
public static String dateStr8(Date date) {
return dateStr(date, "MM-dd");
}
/**
* HH:mm
*
* @param date
* @return
*/
public static String dateStr9(Date date) {
return dateStr(date, "HH:mm");
}
/**
* 将时间戳转换为Date
*
* @param times
* @return
*/
public static Date getDate(String times) {
long time = Long.parseLong(times);
return new Date(time * 1000);
}
public static String dateStr(String times) {
return dateStr(getDate(times));
}
public static String dateStr2(String times) {
return dateStr2(getDate(times));
}
public static String dateStr3(String times) {
return dateStr3(getDate(times));
}
public static String dateStr4(String times) {
return dateStr4(getDate(times));
}
public static String dateStr5(String times) {
return dateStr5(getDate(times));
}
/**
* 将Date转换为时间戳
*
* @param date
* @return
*/
public static long getTime(Date date) {
return date.getTime() / 1000;
}
public static int getDay(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
return cal.get(Calendar.DAY_OF_MONTH);
}
/**
* s - 表示 "yyyy-mm-dd" 形式的日期的 String 对象
*
* @param
* @return
*/
public static Date valueOf(String s) {
final int YEAR_LENGTH = 4;
final int MONTH_LENGTH = 2;
final int DAY_LENGTH = 2;
final int MAX_MONTH = 12;
final int MAX_DAY = 31;
int firstDash;
int secondDash;
int threeDash = 0;
int fourDash = 0;
Date d = null;
if (s == null) {
throw new IllegalArgumentException();
}
firstDash = s.indexOf('-');
secondDash = s.indexOf('-', firstDash + 1);
if (s.contains(":")) {
threeDash = s.indexOf(':');
fourDash = s.indexOf(':', threeDash + 1);
}
if ((firstDash > 0) && (secondDash > 0) && (secondDash < s.length() - 1)) {
String yyyy = s.substring(0, firstDash);
String mm = s.substring(firstDash + 1, secondDash);
String dd = "";
String hh = "";
String MM = "";
String ss = "";
if (s.contains(":")) {
dd = s.substring(secondDash + 1, threeDash - 3);
hh = s.substring(threeDash - 2, threeDash);
MM = s.substring(threeDash + 1, fourDash);
ss = s.substring(fourDash + 1);
} else {
dd = s.substring(secondDash + 1);
}
if (yyyy.length() == YEAR_LENGTH && mm.length() == MONTH_LENGTH && dd.length() == DAY_LENGTH) {
int year = Integer.parseInt(yyyy);
int month = Integer.parseInt(mm);
int day = Integer.parseInt(dd);
int hour = 0;
int minute = 0;
int second = 0;
if (s.contains(":")) {
hour = Integer.parseInt(hh);
minute = Integer.parseInt(MM);
second = Integer.parseInt(ss);
}
if (month >= 1 && month <= MAX_MONTH) {
int maxDays = MAX_DAY;
switch (month) {
// February determine if a leap year or not
case 2:
if ((year % 4 == 0 && !(year % 100 == 0)) || (year % 400 == 0)) {
maxDays = MAX_DAY - 2; // leap year so 29 days in
// February
} else {
maxDays = MAX_DAY - 3; // not a leap year so 28 days
// in February
}
break;
// April, June, Sept, Nov 30 day months
case 4:
case 6:
case 9:
case 11:
maxDays = MAX_DAY - 1;
break;
}
if (day >= 1 && day <= maxDays) {
Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, day, hour, minute, second);
cal.set(Calendar.MILLISECOND, 0);
d = cal.getTime();
}
}
}
}
if (d == null) {
throw new IllegalArgumentException();
}
return d;
}
/**
* 获取指定日期星期几
*
* @param dt
* @return
*/
public static String getWeekOfDate(Date dt) {
String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0) {
w = 0;
}
return weekDays[w];
}
/**
* 获取指定日期星期几(int)
*
* @param dt
* @return
*/
public static int getWeekOfInt(Date dt) {
int[] weekDays = {7, 1, 2, 3, 4, 5, 6};
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0) {
w = 0;
}
return weekDays[w];
}
/**
* 前/后?分钟
*
* @param d
* @param minute
* @return
*/
public static Date rollMinute(Date d, int minute) {
return new Date(d.getTime() + minute * 60 * 1000);
}
/**
* 前/后?天
*
* @param d
* @param day
* @return
*/
public static Date rollDay(Date d, int day) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.DAY_OF_MONTH, day);
return cal.getTime();
}
/**
* 前/后?月
*
* @param d
* @param mon
* @return
*/
public static Date rollMon(Date d, int mon) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, mon);
return cal.getTime();
}
/**
* 前/后?年
*
* @param d
* @param year
* @return
*/
public static Date rollYear(Date d, int year) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.YEAR, year);
return cal.getTime();
}
public static Date rollDate(Date d, int year, int mon, int day) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.YEAR, year);
cal.add(Calendar.MONTH, mon);
cal.add(Calendar.DAY_OF_MONTH, day);
return cal.getTime();
}
/**
* 获取当前时间-时间戳字符串
*
* @return
*/
public static String getNowTimeStr() {
String str = Long.toString(System.currentTimeMillis() / 1000);
return str;
}
/**
* 获取当前时间-时间戳
*
* @return
*/
public static int getNowTime() {
return Integer.parseInt(String.valueOf(System.currentTimeMillis() / 1000));
}
/**
* 将Date转换为时间戳
*
* @param time
* @return
*/
public static String getTimeStr(Date time) {
long date = time.getTime();
String str = Long.toString(date / 1000);
return str;
}
public static String getTimeStr(String dateStr, String format) {
SimpleDateFormat sdf = new SimpleDateFormat(format);
Date date;
try {
date = sdf.parse(dateStr);
} catch (Exception e) {
e.printStackTrace();
return "";
}
String str = DateUtils.getTimeStr(date);
return str;
}
public static Date getIntegralTime() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
/**
* 获取当天23:59:59
*
* @return
*/
public static Date getLastIntegralTime() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.SECOND, 59);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
/**
* 设置时间格式为 23:59:59
*
* @return
*/
public static Date getLastSecIntegralTime(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(d.getTime());
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.SECOND, 59);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
/**
* 获取本周日的日期
*/
public static String getCurrentWeekday() {
int weeks = 0;
int mondayPlus = DateUtils.getMondayPlus();
GregorianCalendar currentDate = new GregorianCalendar();
currentDate.add(GregorianCalendar.DATE, mondayPlus + 6);
Date monday = currentDate.getTime();
DateFormat df = DateFormat.getDateInstance();
String preMonday = df.format(monday);
return preMonday;
}
/**
* 获取时间戳
*
* @param format 日期时间
* @return
*/
public static long getTime(String format) {
long t = 0;
if (StringUtils.isBlank(format)) {
return t;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date;
try {
date = sdf.parse(format);
t = date.getTime() / 1000;
} catch (Exception e) {
e.printStackTrace();
}
return t;
}
/**
* 获得当前日期与本周日相差的天数
*/
private static int getMondayPlus() {
Calendar cd = Calendar.getInstance();
// 获得今天是一周的第几天,星期日是第一天,星期二是第二天......
int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1;
// 因为按中国礼拜一作为第一天所以这里减1
if (dayOfWeek == 1) {
return 0;
} else {
return 1 - dayOfWeek;
}
}
/**
* 获得本周一的日期
*
* @return
*/
public static String getMondayOFWeek() {
int weeks = 0;
int mondayPlus = DateUtils.getMondayPlus();
GregorianCalendar currentDate = new GregorianCalendar();
currentDate.add(GregorianCalendar.DATE, mondayPlus);
Date monday = currentDate.getTime();
DateFormat df = DateFormat.getDateInstance();
String preMonday = df.format(monday);
return preMonday;
}
/**
* 获取当前月第一天:
*/
public static String getFirstDayOfMonth(String first) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
// 设置为1号,当前日期既为本月第一天
c.set(Calendar.DAY_OF_MONTH, 1);
first = format.format(c.getTime());
return first;
}
/**
* 获取当月最后一天
*/
public static String getLastDayOfMonth(String last) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar ca = Calendar.getInstance();
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
last = format.format(ca.getTime());
return last;
}
/**
* 获取当月最后一天 天数
*/
public static Integer getLastDayOfMonthInt(Date date) {
Calendar ca = Calendar.getInstance();
ca.setTime(date);
return ca.get(Calendar.DATE);
}
/**
* 日期月份处理
*
* @param d 时间
* @param month 相加的月份,正数则加,负数则减
* @return
*/
public static Date timeMonthManage(Date d, int month) {
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(d);
rightNow.add(Calendar.MONTH, month);
return rightNow.getTime();
}
/**
* 获取指定年月的最后一天
*
* @param year_time 指定年
* @param month_time 指定月
* @return
*/
public static Date monthLastDay(int year_time, int month_time) {
Calendar cal = Calendar.getInstance();
cal.set(year_time, month_time, 0, 23, 59, 59);
return cal.getTime();
}
/**
* 获取指定年月的第一天
*
* @param year_time 指定年
* @param month_time 指定月
* @return
*/
public static Date monthFirstDay(int year_time, int month_time) {
Calendar cal = Calendar.getInstance();
cal.set(year_time, month_time - 1, 1, 0, 0, 0);
return cal.getTime();
}
/**
* 获取指定时间月的第一天
*
* @param d 指定时间,为空代表当前时间
* @return
*/
public static Date currMonthFirstDay(Date d) {
Calendar cal = Calendar.getInstance();
if (d != null) {
cal.setTime(d);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 0, 0, 0);
return cal.getTime();
}
/**
* 获取指定时间月的最后一天
*
* @param d 指定时间,为空代表当前时间
* @return
*/
public static Date currMonthLastDay(Date d) {
Calendar cal = Calendar.getInstance();
if (d != null)
cal.setTime(d);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 23, 59, 59);
return cal.getTime();
}
/**
* 获取指定时间的年
*
* @param date 指定时间
* @return
*/
public static int getTimeYear(Date date) {
if (date == null) {
date = new Date();
}
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.YEAR);
}
/**
* 获取指定时间的月
*
* @param date 指定时间
* @return
*/
public static int getTimeMonth(Date date) {
if (date == null) {
date = new Date();
}
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.MONTH) + 1;
}
/**
* 获取指定时间的天
*
* @param date 指定时间
* @return
*/
public static int getTimeDay(Date date) {
if (date == null)
date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DATE);
}
public static Date getFirstSecIntegralTime(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(d.getTime());
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.DATE, 0);
return cal.getTime();
}
/**
* 获取指定时间天的结束时间
*
* @param d
* @return
*/
public static Date getDayEndTime(long d) {
Date day = null;
if (d <= 0) {
day = new Date();
} else {
day = new Date(d * 1000);
}
Calendar cal = Calendar.getInstance();
if (day != null) {
cal.setTimeInMillis(day.getTime());
}
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 23, 59, 59);
return cal.getTime();
}
/**
* 获取指定时间天的开始时间
*
* @param d
* @return
*/
public static Date getDayStartTime(long d) {
Date day = null;
if (d <= 0) {
day = new Date();
} else {
day = new Date(d * 1000);
}
Calendar cal = Calendar.getInstance();
if (day != null) {
cal.setTimeInMillis(day.getTime());
}
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 0, 0, 0);
return cal.getTime();
}
/**
* 获取19位的格式时间
*
* @param dateStr
* @return
* @throws
*/
public static Date getDateByFullDateStr(String dateStr) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.parse(dateStr);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取16位的格式时间 yyyy-MM-dd HH:mm
*
* @param dateStr
* @return
* @throws Exception
*/
public static Date getDateByStr(String dateStr) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return sdf.parse(dateStr);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取yyyy-MM-dd的格式时间
*
* @param dateStr
* @return
* @throws
*/
public static Date getDateByDateStr(String dateStr) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.parse(dateStr);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取两个日期相差的月数
*
* @param d1 较大的日期
* @param d2 较小的日期
* @return 如果d1>d2返回 月数差 否则返回0
*/
public static int monthsBetween(Date d1, Date d2) {
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(d1);
c2.setTime(d2);
if (c1.getTimeInMillis() < c2.getTimeInMillis()) {
return 0;
}
int year1 = c1.get(Calendar.YEAR);
int year2 = c2.get(Calendar.YEAR);
int month1 = c1.get(Calendar.MONTH);
int month2 = c2.get(Calendar.MONTH);
int day1 = c1.get(Calendar.DAY_OF_MONTH);
int day2 = c2.get(Calendar.DAY_OF_MONTH);
// 获取年的差值 假设 d1 = 2015-8-16 d2 = 2011-9-30
int yearInterval = year1 - year2;
// 如果 d1的 月-日 小于 d2的 月-日 那么 yearInterval-- 这样就得到了相差的年数
if (month1 < month2 || month1 == month2 && day1 < day2) {
yearInterval--;
}
// 获取月数差值
int monthInterval = (month1 + 12) - month2;
if (day1 < day2) {
monthInterval--;
}
monthInterval %= 12;
return yearInterval * 12 + monthInterval;
}
/**
* 计算date2 - date1之间相差的天数
*
* @param date1
* @param date2
* @return
*/
public static int daysBetween(Date date1, Date date2) {
DateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Calendar cal = Calendar.getInstance();
try {
Date d1 = sdf.parse(DateUtils.dateStr7(date1));
Date d2 = sdf.parse(DateUtils.dateStr7(date2));
cal.setTime(d1);
long time1 = cal.getTimeInMillis();
cal.setTime(d2);
long time2 = cal.getTimeInMillis();
return Integer.parseInt(String.valueOf((time2 - time1) / 86400000L));
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
/**
* 计算date2 - date1之间相差的分钟
*
* @param date1
* @param date2
* @return
*/
public static int minutesBetween(Date date1, Date date2) {
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
long time1 = cal.getTimeInMillis();
cal.setTime(date2);
long time2 = cal.getTimeInMillis();
if (time2 - time1 <= 0) {
return 0;
} else {
return Integer.parseInt(String.valueOf((time2 - time1) / 60000L)) + 1;
}
}
/**
* 计算date2 - date1之间相差的秒
*
* @param date1
* @param date2
* @return
*/
public static int secondBetween(Date date1, Date date2) {
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
long time1 = cal.getTimeInMillis();
cal.setTime(date2);
long time2 = cal.getTimeInMillis();
if (time2 - time1 <= 0) {
return 0;
} else {
return Integer.parseInt(String.valueOf((time2 - time1) / 1000L)) + 1;
}
}
/**
* 计算date2 - date1之间相差的毫秒
*
* @param date1
* @param date2
* @return
*/
public static int millisecondBetween(Date date1, Date date2) {
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
long time1 = cal.getTimeInMillis();
cal.setTime(date2);
long time2 = cal.getTimeInMillis();
if (time2 - time1 <= 0) {
return 0;
} else {
return Integer.parseInt(String.valueOf((time2 - time1)));
}
}
/**
* 获取当月开始时间
*/
public static Date getMonthStartTime() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Calendar cal = Calendar.getInstance();
Date nowdate = cal.getTime();
String date1 = sdf.format(nowdate);
date1 += "-01 00:00:00";
try {
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf2.parse(date1);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取当月开始时间Str
*/
public static String getMonthStartTimeStr() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Calendar cal = Calendar.getInstance();
Date nowdate = cal.getTime();
String date = sdf.format(nowdate);
date += "-01 00:00:00";
return date;
}
/**
* 获取当月结束时间
*/
public static Date getMonthEndTime() {
Calendar calendar = Calendar.getInstance();
// 设置日期为本月最大日期
calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
// 打印
DateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
calendar.getTime();
String date1 = sdf1.format(calendar.getTime());
date1 += " 23:59:59";
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
return sdf2.parse(date1);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 根据当前日期计算今年剩余天数
*
* @return
*/
public static int getLeftDaysOfCurrYear() {
return daysBetween(new Date(), getCurrYearLast());
}
/**
* 获取当年的最后一天
*
* @return
*/
public static Date getCurrYearLast() {
Calendar currCal = Calendar.getInstance();
int currentYear = currCal.get(Calendar.YEAR);
return getYearLast(currentYear);
}
/**
* 获取某年最后一天日期
*
* @param year 年份
* @return Date
*/
public static Date getYearLast(int year) {
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
calendar.roll(Calendar.DAY_OF_YEAR, -1);
Date currYearLast = calendar.getTime();
return currYearLast;
}
/**
* 根据出生日期计算年龄
*
* @param birthday 出生日期
* @return
*/
public static int getAge(Date birthday) {
int age = 0;
Calendar born = Calendar.getInstance();
Calendar now = Calendar.getInstance();
if (birthday != null) {
now.setTime(new Date());
born.setTime(birthday);
if (born.after(now)) {
throw new IllegalArgumentException("年龄不能超过当前日期");
}
age = now.get(Calendar.YEAR) - born.get(Calendar.YEAR);
int nowDayOfYear = now.get(Calendar.DAY_OF_YEAR);
int bornDayOfYear = born.get(Calendar.DAY_OF_YEAR);
if (nowDayOfYear < bornDayOfYear) {
age -= 1;
}
}
return age;
}
/**
* 判断当前时间是否是否 3:00过后 如果当前时间是交易时间段
*
* @return
*/
public static boolean checkedTransactionTime() {
Date da = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String now = sdf.format(da);
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
try {
c1.setTime(sdf.parse(now));
c2.setTime(sdf.parse("15:00:00"));
} catch (ParseException e) {
e.printStackTrace();
}
if ((c1.compareTo(c2) > 0)) {
return false;
}
return true;
}
/**
* 判断当前时间是否是否 2:30前
*
* @return
*/
public static boolean checkedTransactionTowTime() {
Date da = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String now = sdf.format(da);
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
try {
c1.setTime(sdf.parse(now));
c2.setTime(sdf.parse("14:30:00"));
} catch (ParseException e) {
e.printStackTrace();
}
if ((c1.compareTo(c2) > 0)) {
return false;
}
return true;
}
/**
* 日期转换为字符串 格式自定义
*
* @param date
* @param f
* @return
*/
public static Date dateFormat(Date date, String f) {
Date date1 = new Date();
if (date == null) {
return null;
}
SimpleDateFormat format = new SimpleDateFormat(f);
String str = format.format(date);
try {
date1 = format.parse(str);
} catch (ParseException e) {
e.printStackTrace();
}
return date1;
}
public static void main(String[] args) throws Exception {
System.out.println(checkedTransactionTowTime());
System.out.println(dateStr(rollMon(new Date(), 1), "yyyy-MM-dd"));
System.out.println(dateFormat(new Date(), "yyyy-MM-dd"));
}
} | [
"1141437851@qq.com"
] | 1141437851@qq.com |
ef921985ad50e8164ddab2433f690df15420c5a6 | 885e761a08dee3591097c94a5d11ddfc16c895a8 | /src/state/ceiling_fan_example/High.java | c70fe25218b5c2acaabf371b4ab014243bfc158d | [] | no_license | ttnny/design-patterns.playground | 40c07f23cad919927465365cc9ee526465d9faa8 | fe1daca49d05f1b8ae802bb15b0a3241ce6436f0 | refs/heads/master | 2022-05-20T10:07:41.484812 | 2020-02-18T07:49:06 | 2020-02-18T07:49:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package state.ceiling_fan_example;
public class High implements IFanState {
@Override
public void pull(PullChain wrapper) {
wrapper.setState(new Off());
System.out.println("Off...");
}
} | [
"ttnny@users.noreply.github.com"
] | ttnny@users.noreply.github.com |
dd58d02dfa81359ec944869ab49a53a187caa8bd | 0afe549d8e023743e50e427d9b754da38a0c4559 | /code/sqlf-demo/src/main/java/com/vmware/example/sqlfire/StoreController.java | 6fbe8beea3f5ea317d756047f6e087076ab9a4d1 | [] | no_license | spring-operator/sqlf-demo | 09711b9daf4d1009de4c6d5b97234e8a52918c89 | 1beb8524d6459a1ff070b7af557c083aa1ea0238 | refs/heads/master | 2020-04-28T08:15:57.893935 | 2012-06-04T16:16:49 | 2012-06-04T16:16:49 | 175,120,327 | 0 | 0 | null | 2019-03-12T02:33:12 | 2019-03-12T02:33:12 | null | UTF-8 | Java | false | false | 2,790 | java | package com.vmware.example.sqlfire;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.vmware.example.sqlfire.domain.Request;
import com.vmware.example.sqlfire.domain.Response;
import com.vmware.example.sqlfire.service.StoreService;
import com.vmware.example.sqlfire.util.SimpleTimestampGenerator;
@Controller
@RequestMapping(value = "/store")
public class StoreController {
private Map<String, StoreService> services;
@Autowired
SimpleTimestampGenerator timestampGenerator;
private StoreService getService(String storeType) {
if (!services.containsKey(storeType)) {
throw new RuntimeException("Invalid store type");
}
return services.get(storeType);
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public @ResponseBody
Set<String> getDataStoreServices() {
return services.keySet();
}
@RequestMapping(value = "/{storeType}/request/{requestId}", method = RequestMethod.POST)
public @ResponseBody
Response makeRequest(@PathVariable String storeType,
@PathVariable String requestId) {
Request request = new Request();
request.setId(requestId);
request.setOn(timestampGenerator.getNow());
request.setOrders(0);
request.setItems(0);
request.setDuration(new Long(0L));
return getService(storeType).saveRequest(request);
}
@RequestMapping(value = "/{storeType}/request/{requestId}", method = RequestMethod.GET)
public @ResponseBody
Response getRequest(@PathVariable String storeType,
@PathVariable String requestId) {
Response response = getService(storeType).getRequest(requestId);
response.getRequest().setIndex(0);
return response;
}
@RequestMapping(value = "/{storeType}/order/", method = RequestMethod.POST)
public @ResponseBody
Response runRequest(@PathVariable String storeType,
@RequestBody Request request) {
request.setOn(timestampGenerator.getNow());
request.setDuration(0L);
Response response = getService(storeType).runRequest(request);
response.getRequest().setIndex(request.getIndex());
return response;
}
@ExceptionHandler
public @ResponseBody
Response handle(Exception e) {
return new Response(e.getMessage());
}
@Required
public void setServices(Map<String, StoreService> services) {
this.services = services;
}
}
| [
"mark@chmarny.com"
] | mark@chmarny.com |
c6e517db5d570b3e029d6085e6260030ef3e2d81 | ea643b43aa7e32f199a27452b961bc26dd09a967 | /app/src/main/java/bits/emd/adani/SwitchYard/cbm_400kv/cbm_400kv_ct_cvt_measurement_dia6.java | bb900f61a0757b3a206deb29a1beabecabeca47e | [] | no_license | Ayush97-Upadhyaya/App_dev-Adani_tirora | 8f955c69c48c1375bcae0279713a0dac8e957e66 | 5dcd4139dcb467eeecce4e0204b35e76794ffa19 | refs/heads/master | 2022-12-07T15:59:16.666501 | 2019-01-01T09:25:07 | 2019-01-01T09:25:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 45,764 | java | package bits.emd.adani.SwitchYard.cbm_400kv;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import java.text.SimpleDateFormat;
import bits.emd.adani.SwitchYard.ConnectionClass;
import bits.emd.adani.SwitchYard.R;
public class cbm_400kv_ct_cvt_measurement_dia6 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cbm_400kv_ct_cvt_measurement_dia6);
// Submit, Edit & Final Button Declaration
final Button submit_btn = (Button)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_submit_btn);
final Button edit_btn = (Button)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_edit_btn);
final Button confirm_btn = (Button)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_confirm_btn);
// SubmitButton OnClick
submit_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
submit_btn.setVisibility(View.GONE);
edit_btn.setVisibility(View.VISIBLE);
confirm_btn.setVisibility(View.VISIBLE);
EditText ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_R);//ST-3 DIFF HV CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_Y);//ST-3 DIFF HV CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_B);//ST-3 DIFF HV CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_VOLT_R);//ST-3 DIFF HV VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST4_DIFF_HV_VOLT_Y);//ST-3 DIFF HV VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_VOLT_B);//ST-3 DIFF HV VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_R);//ST-3 DIFF LV CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_Y);//ST-3 DIFF LV CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_B);//ST-3 DIFF LV CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_R);//ST-3 DIFF LV VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_Y);//ST-3 DIFF LV VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_B);//ST-3 DIFF LV VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_R);//ST-3 PUA CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_Y);//ST-3 PUA CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_B);//ST-3 PUA CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_R);//ST-3 PUA VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_Y);//ST-3 PUA VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_B);//ST-3 PUA VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_R);//ST-3 PUB CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_Y);//ST-3 PUB CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_B);//ST-3 PUB CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_R);//ST-3 PUB VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_Y);//ST-3 PUB VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_B);//ST-3 PUB VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_R);//ST-3 50/51 CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_Y);//ST-3 50/51 CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_B);//ST-3 50/51 CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_R);//ST-3 50/51 VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_Y);//ST-3 50/51 VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_B);//ST-3 50/51 VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_R);//ST-3 64 CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_Y);//ST-3 64 CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_B);//ST-3 64 CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_R);//ST-3 64 VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_Y);//ST-3 64 VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_B);//ST-3 64 VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_R);//TIE BCU CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_Y);//TIE BCU CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_B);//TIE BCU CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_R);//TIE BCU VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_Y);//TIE BCU VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_B);//TIE BCU VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_R);//ST-5 DIFF HV CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_Y);//ST-5 DIFF HV CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_B);//ST-5 DIFF HV CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_R);//ST-5 DIFF HV VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_Y);//ST-5 DIFF HV VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_B);//ST-5 DIFF HV VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_R);//ST-5 DIFF LV CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_Y);//ST-5 DIFF LV CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_B);//ST-5 DIFF LV CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_R);//ST-5 DIFF LV VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_Y);//ST-5 DIFF LV VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_B);//ST-5 DIFF LV VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_R);//ST-5 PUA CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_Y);//ST-5 PUA CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_B);//ST-5 PUA CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_R);//ST-5 PUA VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_Y);//ST-5 PUA VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_B);//ST-5 PUA VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_R);//ST-5 PUB CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_Y);//ST-5 PUB CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_B);//ST-5 PUB CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_R);//ST-5 PUB VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_Y);//ST-5 PUB VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_B);//ST-5 PUB VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_R);//ST-5 50/51 CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_Y);//ST-5 50/51 CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_B);//ST-5 50/51 CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_R);//ST-5 50/51 VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_Y);//ST-5 50/51 VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_B);//ST-5 50/51 VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_R);//ST-5 64 CURRENT R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_Y);//ST-5 64 CURRENT Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_B);//ST-5 64 CURRENT B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_R);//ST-5 64 VOLTAGE R
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_Y);//ST-5 64 VOLTAGE Y
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_B);//ST-5 64 VOLTAGE B
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_REMARKS_IF_ANY);//REMARKS IF ANY
ed.setEnabled(false);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_VERIFIED_BY);//VERIFIED BY
ed.setEnabled(false);
}
});
edit_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
submit_btn.setVisibility(View.VISIBLE);
edit_btn.setVisibility(View.GONE);
confirm_btn.setVisibility(View.GONE);
EditText ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_R);//ST-3 DIFF HV CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_Y);//ST-3 DIFF HV CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_B);//ST-3 DIFF HV CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_VOLT_R);//ST-3 DIFF HV VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST4_DIFF_HV_VOLT_Y);//ST-3 DIFF HV VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_VOLT_B);//ST-3 DIFF HV VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_R);//ST-3 DIFF LV CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_Y);//ST-3 DIFF LV CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_B);//ST-3 DIFF LV CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_R);//ST-3 DIFF LV VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_Y);//ST-3 DIFF LV VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_B);//ST-3 DIFF LV VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_R);//ST-3 PUA CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_Y);//ST-3 PUA CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_B);//ST-3 PUA CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_R);//ST-3 PUA VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_Y);//ST-3 PUA VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_B);//ST-3 PUA VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_R);//ST-3 PUB CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_Y);//ST-3 PUB CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_B);//ST-3 PUB CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_R);//ST-3 PUB VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_Y);//ST-3 PUB VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_B);//ST-3 PUB VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_R);//ST-3 50/51 CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_Y);//ST-3 50/51 CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_B);//ST-3 50/51 CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_R);//ST-3 50/51 VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_Y);//ST-3 50/51 VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_B);//ST-3 50/51 VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_R);//ST-3 64 CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_Y);//ST-3 64 CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_B);//ST-3 64 CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_R);//ST-3 64 VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_Y);//ST-3 64 VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_B);//ST-3 64 VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_R);//TIE BCU CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_Y);//TIE BCU CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_B);//TIE BCU CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_R);//TIE BCU VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_Y);//TIE BCU VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_B);//TIE BCU VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_R);//ST-5 DIFF HV CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_Y);//ST-5 DIFF HV CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_B);//ST-5 DIFF HV CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_R);//ST-5 DIFF HV VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_Y);//ST-5 DIFF HV VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_B);//ST-5 DIFF HV VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_R);//ST-5 DIFF LV CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_Y);//ST-5 DIFF LV CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_B);//ST-5 DIFF LV CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_R);//ST-5 DIFF LV VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_Y);//ST-5 DIFF LV VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_B);//ST-5 DIFF LV VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_R);//ST-5 PUA CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_Y);//ST-5 PUA CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_B);//ST-5 PUA CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_R);//ST-5 PUA VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_Y);//ST-5 PUA VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_B);//ST-5 PUA VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_R);//ST-5 PUB CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_Y);//ST-5 PUB CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_B);//ST-5 PUB CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_R);//ST-5 PUB VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_Y);//ST-5 PUB VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_B);//ST-5 PUB VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_R);//ST-5 50/51 CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_Y);//ST-5 50/51 CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_B);//ST-5 50/51 CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_R);//ST-5 50/51 VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_Y);//ST-5 50/51 VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_B);//ST-5 50/51 VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_R);//ST-5 64 CURRENT R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_Y);//ST-5 64 CURRENT Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_B);//ST-5 64 CURRENT B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_R);//ST-5 64 VOLTAGE R
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_Y);//ST-5 64 VOLTAGE Y
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_B);//ST-5 64 VOLTAGE B
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_REMARKS_IF_ANY);//REMARKS IF ANY
ed.setEnabled(true);
ed =(EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_VERIFIED_BY);//VERIFIED BY
ed.setEnabled(true);
}
});
confirm_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
StringBuilder sb = new StringBuilder();
sb.append("Insert into ");
sb.append("cbm.cbm_400kv_ct_cvt_dia6"); // tablename
sb.append(" values(");
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); // add Date
String formattedDate = sd.format(new java.util.Date().getTime());
sb.append("'");
sb.append(formattedDate); // date
sb.append("'");
sb.append(","); // segregating values
sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // timestamp
formattedDate = sd.format(new java.util.Date());
sb.append("'");
sb.append(formattedDate); // add timestamp
sb.append("'");
sb.append(","); // segregating values
sb.append("'R'");
sb.append(","); // segregating values
///////current//////
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
////////////////Voltage///////
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_R)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append("'");
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_REMARKS_IF_ANY)).getText().toString() ); //LA LEAKAGE B
sb.append("'");
sb.append(","); // segregating values
sb.append("'");
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_VERIFIED_BY)).getText().toString() ); //LA LEAKAGE B
sb.append("'");
sb.append(");"); // Close
// Call Connection Class for Offline SQLite DataBase
// Store Query created as a String in DataBase
String query = sb.toString();
ConnectionClass object = new ConnectionClass();
object.execute(query);
/////////////////------------------------ADD Y VALUES-------------------////////////////////
sb = new StringBuilder();
sb.append("Insert into ");
sb.append("cbm.cbm_400kv_ct_cvt_dia6"); // tablename
sb.append(" values(");
sd = new SimpleDateFormat("yyyy-MM-dd"); // add Date
formattedDate = sd.format(new java.util.Date().getTime());
sb.append("'");
sb.append(formattedDate); // date
sb.append("'");
sb.append(","); // segregating values
sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // timestamp
formattedDate = sd.format(new java.util.Date());
sb.append("'");
sb.append(formattedDate); // add timestamp
sb.append("'");
sb.append(","); // segregating values
sb.append("'Y'");
sb.append(","); // segregating values
///////current//////
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
////////////////Voltage///////
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST4_DIFF_HV_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_Y)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append("'");
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_REMARKS_IF_ANY)).getText().toString() ); //LA LEAKAGE B
sb.append("'");
sb.append(","); // segregating values
sb.append("'");
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_VERIFIED_BY)).getText().toString() ); //LA LEAKAGE B
sb.append("'");
sb.append(");"); // Close
// Call Connection Class for Offline SQLite DataBase
// Store Query created as a String in DataBase
query = sb.toString();
object = new ConnectionClass();
object.execute(query);
/////////////////------------------------ADD B VALUES-------------------////////////////////
sb = new StringBuilder();
sb.append("Insert into ");
sb.append("cbm.cbm_400kv_ct_cvt_dia6"); // tablename
sb.append(" values(");
sd = new SimpleDateFormat("yyyy-MM-dd"); // add Date
formattedDate = sd.format(new java.util.Date().getTime());
sb.append("'");
sb.append(formattedDate); // date
sb.append("'");
sb.append(","); // segregating values
sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // timestamp
formattedDate = sd.format(new java.util.Date());
sb.append("'");
sb.append(formattedDate); // add timestamp
sb.append("'");
sb.append(","); // segregating values
sb.append("'B'");
sb.append(","); // segregating values
///////current//////
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_CURR_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
////////////////Voltage///////
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_HV_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_DIFF_LV_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUA_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_PUB_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_50_51_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST3_64_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_TIE_BCU_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_HV_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_DIFF_LV_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUA_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_PUB_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_50_51_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_ST5_64_VOLT_B)).getText().toString() ); //LA LEAKAGE B
sb.append(","); // segregating values
sb.append("'");
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_REMARKS_IF_ANY)).getText().toString() ); //LA LEAKAGE B
sb.append("'");
sb.append(","); // segregating values
sb.append("'");
sb.append(((EditText)findViewById(R.id.CBM_400KV_CT_CVT_DIA6_VERIFIED_BY)).getText().toString() ); //LA LEAKAGE B
sb.append("'");
sb.append(");"); // Close
// Call Connection Class for Offline SQLite DataBase
// Store Query created as a String in DataBase
query = sb.toString();
object = new ConnectionClass();
object.execute(query);
}
});
}
}
| [
"ayush97.upadhyaya@gmail.com"
] | ayush97.upadhyaya@gmail.com |
b88cfb564458231a8bd06e52aef69f277800c5c0 | ed025c47d7ddf827c2916539361d60618d937a5c | /samples/stock/src/com/tjeannin/provigen/ContractHolder.java | 141b38cba171ab8e843892a6064d6744a5a0602e | [
"Apache-2.0"
] | permissive | tasomaniac/MultiChoiceAdapter | 8b0e7158a1c0693e039765787425cb546ee4f9d3 | 73b83ccf347b337dcaa20fb375f638565287271b | refs/heads/master | 2021-01-15T10:24:51.587333 | 2014-03-14T15:04:53 | 2014-03-14T15:04:53 | 17,749,909 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,504 | java | package com.tjeannin.provigen;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import android.net.Uri;
import com.tjeannin.provigen.annotation.Column;
import com.tjeannin.provigen.annotation.ContentUri;
import com.tjeannin.provigen.annotation.Contract;
import com.tjeannin.provigen.annotation.Id;
import com.tjeannin.provigen.annotation.Unique;
class ContractHolder {
private int version;
private String authority;
private String idField;
private String tableName;
private List<DatabaseField> databaseFields;
@SuppressWarnings({ "rawtypes", "unchecked" })
public ContractHolder(Class contractClass) throws InvalidContractException {
Contract contract = (Contract) contractClass.getAnnotation(Contract.class);
if (contract != null) {
version = contract.version();
} else {
throw new InvalidContractException("The given class does not have a @Contract annotation.");
}
databaseFields = new ArrayList<DatabaseField>();
Field[] fields = contractClass.getFields();
for (Field field : fields) {
ContentUri contentUri = field.getAnnotation(ContentUri.class);
if (contentUri != null) {
if (authority != null || tableName != null) {
throw new InvalidContractException("A contract can not have several @ContentUri.");
}
try {
Uri uri = (Uri) field.get(null);
authority = uri.getAuthority();
tableName = uri.getLastPathSegment();
} catch (Exception e) {
e.printStackTrace();
}
}
Id id = field.getAnnotation(Id.class);
if (id != null) {
if (idField != null) {
throw new InvalidContractException("A contract can not have several fields annoted with @Id.");
}
try {
idField = (String) field.get(null);
} catch (Exception e) {
e.printStackTrace();
}
}
Column column = field.getAnnotation(Column.class);
if (column != null) {
try {
DatabaseField databaseField = new DatabaseField((String) field.get(null), column.value());
Unique unique = field.getAnnotation(Unique.class);
if (unique != null) {
databaseField.setUnique(true);
databaseField.setOnConflict(unique.value());
}
databaseFields.add(databaseField);
} catch (Exception e) {
e.printStackTrace();
}
}
}
if (!isOnConflictSameEverywhere()) {
throw new InvalidContractException("OnConflict parameter sould be the same for all @Unique annotations.");
}
if (authority == null || tableName == null) {
throw new InvalidContractException("The contract is missing a @ContentUri.");
}
}
public boolean hasUniqueDatabaseFields() {
for (DatabaseField field : databaseFields) {
if (field.isUnique()) {
return true;
}
}
return false;
}
private boolean isOnConflictSameEverywhere() {
String onConflict = null;
for (DatabaseField field : databaseFields) {
if (field.isUnique()) {
if (onConflict == null) {
onConflict = field.getOnConflict();
} else {
if (!onConflict.equals(field.getOnConflict())) {
return false;
}
}
}
}
return true;
}
public int getVersion() {
return version;
}
public String getAuthority() {
return authority;
}
public String getIdField() {
return idField;
}
public String getTable() {
return tableName;
}
public List<DatabaseField> getFields() {
return databaseFields;
}
}
| [
"manuel.peinado@gmail.com"
] | manuel.peinado@gmail.com |
8965428a765f5f3c5009040ac6fad964696aabab | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_35aa10e74528cc4af5938c651bf029996c29b2d5/ProductControllerImpl/9_35aa10e74528cc4af5938c651bf029996c29b2d5_ProductControllerImpl_t.java | fa082eeba5fa5b36a3085a02535dfa7b1c7f557d | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,275 | java | package devopsdistilled.operp.client.items.controllers.impl;
import javax.inject.Inject;
import devopsdistilled.operp.client.items.controllers.ProductController;
import devopsdistilled.operp.client.items.models.ProductModel;
import devopsdistilled.operp.client.items.panes.controllers.CreateProductPaneController;
import devopsdistilled.operp.client.items.panes.controllers.EditProductPaneController;
import devopsdistilled.operp.client.items.panes.controllers.ListProductPaneController;
import devopsdistilled.operp.server.data.entity.items.Product;
public class ProductControllerImpl implements ProductController {
@Inject
private ProductModel productModel;
@Inject
private CreateProductPaneController createProductPaneController;
@Inject
private ListProductPaneController listProductPaneController;
@Inject
private EditProductPaneController editProductPaneController;
@Override
public void create() {
createProductPaneController.init();
}
@Override
public void edit(Product product) {
editProductPaneController.init(product);
}
@Override
public void list() {
listProductPaneController.init();
}
@Override
public void delete(Product product) {
productModel.deleteAndUpdateModel(product);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f4be6f8c4febc851016719b40050a7f605e0686c | a4c91c49b39b57c7807af45ee484e224d1136150 | /app/src/main/java/com/example/hgtxxgl/application/activity/TempFragment.java | 8ee25500927a11d19baabc9ddc2edd03d8f6d6ee | [] | no_license | wsy9312/Application | 08a9791d1e74fd9f9b44491115cd8f266f90f0f4 | 8ac696a4a38a209b6ade39b009e33abe9b498a76 | refs/heads/master | 2020-04-02T05:37:35.806472 | 2018-10-22T05:44:01 | 2018-10-22T05:44:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,044 | java | package com.example.hgtxxgl.application.activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.hgtxxgl.application.R;
import com.example.hgtxxgl.application.utils.hand.StatusBarUtils;
import com.example.hgtxxgl.application.view.HandToolbar;
public class TempFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.layou_temp, container, false);
StatusBarUtils.setWindowStatusBarColor(getActivity(),R.color.mainColor_blue);
HandToolbar handToolbar = (HandToolbar) view.findViewById(R.id.temp_handtoolbar);
handToolbar.setDisplayHomeAsUpEnabled(true, getActivity());
handToolbar.setBackHome(false,0);
handToolbar.setTitle("");
return view;
}
}
| [
"m18621137092_1@163.com"
] | m18621137092_1@163.com |
442a60f70e696d5df176e6dc80b2d00b31b0c02d | 79f2ed0445e33996e62b224587fab4ce7bfca724 | /src/main/java/guru/springframework/didemo/examplebeans/FakeJmsBroker.java | df544bcb70b40e72361aa9f77141812798e2fa35 | [] | no_license | jperezdelafuente/spring5-di-demo | 0ea0cb31aebd5523f065c50afbc6dcce10087f5a | 36808a219fa99bb4f0f46f9ae7d1e2868748ebb9 | refs/heads/master | 2021-09-07T10:53:03.852593 | 2018-02-21T21:41:27 | 2018-02-21T21:41:27 | 121,434,444 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 599 | java | package guru.springframework.didemo.examplebeans;
public class FakeJmsBroker {
private String username;
private String password;
private String url;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
| [
"jesusperez82@gmail.com"
] | jesusperez82@gmail.com |
af0d80cb994c204219249c1fe77728713f07b78a | c61a821aacd28ae3ad213a9670f696c8c7e6572f | /src/Problem076.java | ca75756b7ed9561f49ee0004e6cef350ba16f90e | [] | no_license | rsarathy/ProjectEuler | b01b821bfbda919ded5684e0cfcbc86b2dc4a900 | a4eff675ecc7dd2a1872017ed446a4af321c0a2f | refs/heads/master | 2021-01-17T07:09:12.567024 | 2015-06-06T08:07:38 | 2015-06-06T08:07:38 | 32,971,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,435 | java | public class Problem076
{
// public static int partitions(int n)
// {
// if (n == 0) return 1;
//
// int s = 0, j = n - 1, k = 2;
//
// while ( j >= 0 )
// {
// int t = partitions(j);
// if ( (k/2) % 2 == 1 )
// s += t;
// else
// s -= t;
//
// if ( k % 2 == 1 )
// j -= k;
// else
// j -= k / 2;
// k++;
// }
//
// return s;
// }
public static long partitions(int N)
{
long table[][] = new long[N+1][N+1];
for(int i = 1; i <= N; i++)
table[i][1] = 1;
for( int i = 1; i <= N; i++ )
for( int j = 2; j <= N; j++ )
{
if(i < j)
table[i][j] = table[i][j-1];
else if(i == j)
table[i][j] = table[i][j-1] + 1;
else
table[i][j] = table[i-j][j] + table[i][j-1];
}
return table[N][N-1] + 1;
}
// p(n) = ∑(-1)^(k-1) * p(n-k(3k±1)/2
/**
* @param args
*/
public static void main(String[] args)
{
long startTime = System.currentTimeMillis();
// for ( int n = 5; n < 1000; n++ )
// if ( partitions(n) % 1000000 == 0 )
// {
// System.out.println(n);
// break;
// }
System.out.println(partitions(100) - 1);
long endTime = System.currentTimeMillis();
System.out.println("The program took " + (endTime - startTime)
+ " ms to compile.");
}
}
| [
"rohit@sarathy.org"
] | rohit@sarathy.org |
76eec557cbad36062de21f29c2e78619d797fb95 | dc3e6ae02731b7e8f9c0ba3377b209be8c2f6048 | /build/generated/src/org/apache/jsp/index_jsp.java | 4ee977dc43d2463303e37a3baf0de7b612cd4894 | [] | no_license | dchavezsan13/LostNFoundDogs | 3a520f6a800bc030c5c7fb15efc2606ccb592dd3 | b56b282bbf2f6e2d59d0ddb93b53f8f0775026ed | refs/heads/master | 2021-01-22T02:48:03.655111 | 2015-04-05T05:53:56 | 2015-04-05T05:53:56 | 33,269,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,849 | java | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.http.*;
import javax.servlet.*;
public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_items;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_out_value_nobody;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_sql_query_var_dataSource;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_sql_setDataSource_var_user_url_password_driver_nobody;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_jspx_tagPool_c_forEach_var_items = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_c_out_value_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_sql_query_var_dataSource = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_sql_setDataSource_var_user_url_password_driver_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
}
public void _jspDestroy() {
_jspx_tagPool_c_forEach_var_items.release();
_jspx_tagPool_c_out_value_nobody.release();
_jspx_tagPool_sql_query_var_dataSource.release();
_jspx_tagPool_sql_setDataSource_var_user_url_password_driver_nobody.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<html>\n");
out.write(" <head>\n");
out.write(" <title>Welcome to lost & found dogs</title>\n");
out.write(" </head>\n");
out.write(" <body>\n");
out.write(" <h1>Hi, This is the main page of lost & found dogs</h1>\n");
out.write(" ");
if (_jspx_meth_sql_setDataSource_0(_jspx_page_context))
return;
out.write("\n");
out.write("\n");
out.write(" ");
if (_jspx_meth_sql_query_0(_jspx_page_context))
return;
out.write("\n");
out.write("\n");
out.write(" <table border=\"1\" width=\"50%\">\n");
out.write(" <tr><td colspan=\"4\">Last lost dogs</td></tr>\n");
out.write(" <tr>\n");
out.write(" <th> ID</th>\n");
out.write(" <th> Name</th>\n");
out.write(" <th>Breed</th>\n");
out.write(" <th>Size</th>\n");
out.write(" </tr>\n");
out.write(" ");
out.println("Todays date is; ");
out.write(" \n");
out.write(" ");
out.print( (new java.util.Date()).toLocaleString());
out.write(" \n");
out.write("\n");
out.write(" ");
if (_jspx_meth_c_forEach_0(_jspx_page_context))
return;
out.write(" \n");
out.write(" </table>\n");
out.write("\n");
out.write(" <h2>Sections:</h2>\n");
out.write(" <br>\n");
out.write(" <a href=\"./Person\">Im a person, I want a register </a>\n");
out.write(" <br>\n");
out.write(" <a href=\"./ReportLostDog\">My dog is lost</a>\n");
out.write(" <br>\n");
out.write(" <a href=\"./ReportFoundDog\">I found a dog, Who is the owner?</a>\n");
out.write(" <br>\n");
out.write(" <a href=\"./AboutShelter\">I`m a shelter, register me please</a>\n");
out.write("\n");
out.write(" <br>\n");
out.write(" <a href=\"./AboutZone\">Create a zone of the city</a>\n");
out.write("\n");
out.write(" </body>\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_sql_setDataSource_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// sql:setDataSource
org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag _jspx_th_sql_setDataSource_0 = (org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag) _jspx_tagPool_sql_setDataSource_var_user_url_password_driver_nobody.get(org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag.class);
_jspx_th_sql_setDataSource_0.setPageContext(_jspx_page_context);
_jspx_th_sql_setDataSource_0.setParent(null);
_jspx_th_sql_setDataSource_0.setVar("snapshot");
_jspx_th_sql_setDataSource_0.setDriver("com.mysql.jdbc.Driver");
_jspx_th_sql_setDataSource_0.setUrl("jdbc:mysql://localhost/perros");
_jspx_th_sql_setDataSource_0.setUser("root");
_jspx_th_sql_setDataSource_0.setPassword("");
int _jspx_eval_sql_setDataSource_0 = _jspx_th_sql_setDataSource_0.doStartTag();
if (_jspx_th_sql_setDataSource_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_sql_setDataSource_var_user_url_password_driver_nobody.reuse(_jspx_th_sql_setDataSource_0);
return true;
}
_jspx_tagPool_sql_setDataSource_var_user_url_password_driver_nobody.reuse(_jspx_th_sql_setDataSource_0);
return false;
}
private boolean _jspx_meth_sql_query_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// sql:query
org.apache.taglibs.standard.tag.rt.sql.QueryTag _jspx_th_sql_query_0 = (org.apache.taglibs.standard.tag.rt.sql.QueryTag) _jspx_tagPool_sql_query_var_dataSource.get(org.apache.taglibs.standard.tag.rt.sql.QueryTag.class);
_jspx_th_sql_query_0.setPageContext(_jspx_page_context);
_jspx_th_sql_query_0.setParent(null);
_jspx_th_sql_query_0.setDataSource((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${snapshot}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
_jspx_th_sql_query_0.setVar("result");
int[] _jspx_push_body_count_sql_query_0 = new int[] { 0 };
try {
int _jspx_eval_sql_query_0 = _jspx_th_sql_query_0.doStartTag();
if (_jspx_eval_sql_query_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_sql_query_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_push_body_count_sql_query_0[0]++;
_jspx_th_sql_query_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_sql_query_0.doInitBody();
}
do {
out.write("\n");
out.write(" SELECT * from lost_dog;\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_sql_query_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_sql_query_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = _jspx_page_context.popBody();
_jspx_push_body_count_sql_query_0[0]--;
}
if (_jspx_th_sql_query_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_sql_query_0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_sql_query_0.doCatch(_jspx_exception);
} finally {
_jspx_th_sql_query_0.doFinally();
_jspx_tagPool_sql_query_var_dataSource.reuse(_jspx_th_sql_query_0);
}
return false;
}
private boolean _jspx_meth_c_forEach_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_forEach_0.setPageContext(_jspx_page_context);
_jspx_th_c_forEach_0.setParent(null);
_jspx_th_c_forEach_0.setVar("row");
_jspx_th_c_forEach_0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${result.rows}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int[] _jspx_push_body_count_c_forEach_0 = new int[] { 0 };
try {
int _jspx_eval_c_forEach_0 = _jspx_th_c_forEach_0.doStartTag();
if (_jspx_eval_c_forEach_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write(" <tr>\n");
out.write(" <td>");
if (_jspx_meth_c_out_0((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>");
if (_jspx_meth_c_out_1((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>");
if (_jspx_meth_c_out_2((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>");
if (_jspx_meth_c_out_3((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" </tr>\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_c_forEach_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_forEach_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_forEach_0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_forEach_0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_forEach_0.doFinally();
_jspx_tagPool_c_forEach_var_items.reuse(_jspx_th_c_forEach_0);
}
return false;
}
private boolean _jspx_meth_c_out_0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_0 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_0.setPageContext(_jspx_page_context);
_jspx_th_c_out_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${row.id_lost_dog}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_0 = _jspx_th_c_out_0.doStartTag();
if (_jspx_th_c_out_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_0);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_0);
return false;
}
private boolean _jspx_meth_c_out_1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_1 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_1.setPageContext(_jspx_page_context);
_jspx_th_c_out_1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${row.name_lost_dog}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_1 = _jspx_th_c_out_1.doStartTag();
if (_jspx_th_c_out_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_1);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_1);
return false;
}
private boolean _jspx_meth_c_out_2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_2 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_2.setPageContext(_jspx_page_context);
_jspx_th_c_out_2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_2.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${row.breed}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_2 = _jspx_th_c_out_2.doStartTag();
if (_jspx_th_c_out_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_2);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_2);
return false;
}
private boolean _jspx_meth_c_out_3(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_3 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_3.setPageContext(_jspx_page_context);
_jspx_th_c_out_3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_3.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${row.size}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_3 = _jspx_th_c_out_3.doStartTag();
if (_jspx_th_c_out_3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_3);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_3);
return false;
}
}
| [
"daniel.chavez.santos@gmail.com"
] | daniel.chavez.santos@gmail.com |
ebcea2f1a346eee5cf633dfd093f699a71985b48 | 0411a498c9e8ea49e293a548da50e69dffdd041a | /src/main/java/com/thecrunchycorner/hibernate/nativequerymappedtopojo/Account16Pojo.java | c02677ccbaff84950e268164849ce72173c6bbe7 | [] | no_license | ferng/hibernate | a8de4f6db4d31fc3364727034b950b22166e5533 | 9a2cc7f7211ea72abbe74e60858d9496cfd9ad7b | refs/heads/master | 2020-04-27T02:09:55.300753 | 2019-03-11T17:21:06 | 2019-03-11T17:21:06 | 173,985,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package com.thecrunchycorner.hibernate.nativequerymappedtopojo;
public class Account16Pojo {
private String here;
public Account16Pojo() {
}
public Account16Pojo(String here) {
this.here = here;
}
public String getHere() {
return here;
}
public void setHere(String here) {
this.here = here;
}
}
| [
"ferng001@gmail.com"
] | ferng001@gmail.com |
616266911d026be63821c2282037a89ab879677f | 6d2c5dfccc61fa3f54fbd692825074496dee9bf7 | /src/main/java/com/els/handler/SimpleChatClientInitializer.java | 4e6d7b583c536548e1d1241c47bc0c263f6ac824 | [] | no_license | itZhangHan/elsfk | 9bab408203800e16298f7b5bb78917ece9267048 | d9aa4b5b4f6be2652c3627968a4c482612d4a9b7 | refs/heads/master | 2021-07-11T18:53:48.176447 | 2017-09-25T05:44:02 | 2017-09-25T05:44:02 | 104,707,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | package com.els.handler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.netty.handler.codec.Delimiters;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
public class SimpleChatClientInitializer extends ChannelInitializer<SocketChannel> {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
pipeline.addLast("handler", new SimpleChatClientHandler());
}
} | [
"13146353585@163.com"
] | 13146353585@163.com |
ce0c75cfc2f497327ecedec82d5e16254f5e7ea3 | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2010-06-20/seasar2-2.4.42/seasar2/s2-framework/src/main/java/org/seasar/framework/util/JarInputStreamUtil.java | 1b38d0473bd9d221b76aaca16706972a66575579 | [
"Apache-2.0"
] | permissive | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,283 | java | /*
* Copyright 2004-2010 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.seasar.framework.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import org.seasar.framework.exception.IORuntimeException;
/**
* {@link JarInputStream}用のユーティリティクラスです。
*
* @author koichik
*/
public class JarInputStreamUtil {
/**
* インスタンスを構築します。
*/
protected JarInputStreamUtil() {
}
/**
* {@link JarInputStream}を作成します。
*
* @param is
* @return {@link JarInputStream}
* @throws IORuntimeException
* {@link IOException}が発生した場合
* @see JarInputStream#JarInputStream(InputStream)
*/
public static JarInputStream create(final InputStream is)
throws IORuntimeException {
try {
return new JarInputStream(is);
} catch (final IOException e) {
throw new IORuntimeException(e);
}
}
/**
* {@link JarInputStream#getNextJarEntry()}の例外処理をラップするメソッドです。
*
* @param is
* @return {@link JarEntry}
* @throws IORuntimeException
* {@link IOException}が発生した場合
* @see JarInputStream#getNextJarEntry()
*/
public static JarEntry getNextJarEntry(final JarInputStream is)
throws IORuntimeException {
try {
return is.getNextJarEntry();
} catch (final IOException e) {
throw new IORuntimeException(e);
}
}
}
| [
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] | koichik@319488c0-e101-0410-93bc-b5e51f62721a |
20acb45cedfdd8f934258bee2bf2e8b1e11af88c | d2dbc71cca6b864f2c2a4b641a9f570c4ec78dcb | /eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java | f7406ac68df7766e6131e2ecc97c65aa9da6caf5 | [
"Apache-2.0"
] | permissive | JawZhang/eladmin-dev | aace53fcfd20402f904cad095c37b0ca54b39056 | 3cbbc8fabe6dfb680ae80ab46d17fd0b9219fc63 | refs/heads/master | 2022-07-18T14:00:08.560086 | 2020-06-15T20:56:28 | 2020-06-15T20:56:28 | 252,428,471 | 0 | 0 | Apache-2.0 | 2022-06-17T03:05:16 | 2020-04-02T10:49:29 | Java | UTF-8 | Java | false | false | 2,353 | java | package me.zhengjie.modules.quartz.service;
import me.zhengjie.modules.quartz.domain.QuartzJob;
import me.zhengjie.modules.quartz.domain.QuartzLog;
import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Set;
/**
* @author Zheng Jie
* @date 2019-01-07
*/
public interface QuartzJobService {
/**
* 分页查询
*
* @param criteria 条件
* @param pageable 分页参数
* @return /
*/
Object queryAll(JobQueryCriteria criteria, Pageable pageable);
/**
* 查询全部
*
* @param criteria 条件
* @return /
*/
List<QuartzJob> queryAll(JobQueryCriteria criteria);
/**
* 分页查询日志
*
* @param criteria 条件
* @param pageable 分页参数
* @return /
*/
Object queryAllLog(JobQueryCriteria criteria, Pageable pageable);
/**
* 查询全部
*
* @param criteria 条件
* @return /
*/
List<QuartzLog> queryAllLog(JobQueryCriteria criteria);
/**
* 创建
*
* @param resources /
* @return /
*/
QuartzJob create(QuartzJob resources);
/**
* 编辑
*
* @param resources /
*/
void update(QuartzJob resources);
/**
* 删除任务
*
* @param ids /
*/
void delete(Set<Long> ids);
/**
* 根据ID查询
*
* @param id ID
* @return /
*/
QuartzJob findById(Long id);
/**
* 更改定时任务状态
*
* @param quartzJob /
*/
void updateIsPause(QuartzJob quartzJob);
/**
* 立即执行定时任务
*
* @param quartzJob /
*/
void execution(QuartzJob quartzJob);
/**
* 导出定时任务
*
* @param queryAll 待导出的数据
* @param response /
* @throws IOException /
*/
void download(List<QuartzJob> queryAll, HttpServletResponse response) throws IOException;
/**
* 导出定时任务日志
*
* @param queryAllLog 待导出的数据
* @param response /
* @throws IOException /
*/
void downloadLog(List<QuartzLog> queryAllLog, HttpServletResponse response) throws IOException;
}
| [
"luxuanwang@hangzhouhaoniu.com"
] | luxuanwang@hangzhouhaoniu.com |
6108797a82f0eb4c703ccc4268c54aa620ff01ef | d1c2d00078520cd556f60b7213c27856f8b3460d | /sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreProtoHelpers.java | dbcfdb0e5896bb723683211db06466ee68ab4d52 | [
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-protobuf",
"Apache-2.0",
"Python-2.0"
] | permissive | apache/beam | ed11b9e043465c720659eac20ac71b5b171bfa88 | 6d5048e05087ea54abc889ce402ae2a0abb9252b | refs/heads/master | 2023-09-04T07:41:07.002653 | 2023-09-01T23:01:05 | 2023-09-01T23:01:05 | 50,904,245 | 7,061 | 4,522 | Apache-2.0 | 2023-09-14T21:43:38 | 2016-02-02T08:00:06 | Java | UTF-8 | Java | false | false | 1,188 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.beam.sdk.io.gcp.firestore;
import com.google.firestore.v1.Write;
final class FirestoreProtoHelpers {
static Write newWrite() {
return newWrite(1);
}
static Write newWrite(long i) {
Write.Builder writeBuilder = Write.newBuilder();
writeBuilder.getUpdateBuilder().setName(String.format("doc-%012d", i));
return writeBuilder.build();
}
}
| [
"BenWhitehead@users.noreply.github.com"
] | BenWhitehead@users.noreply.github.com |
85e0e78662bd140bbafcedce474395f7fcc30fb6 | 6334984d7257787b0960b5d44435b3331113c927 | /src/test/java/com/domgee/poke/PokeApplicationTests.java | 474930eb8b501499be1825c7a1d03f7439dba5e3 | [] | no_license | ki42/poke2 | 4e713b56c3ee97a4e6493cb4afd14e83b8e2f8f6 | 983b0eb44e02379f7cfef6146ba88f760a22cd80 | refs/heads/master | 2020-03-25T06:06:54.316632 | 2018-08-07T23:33:38 | 2018-08-07T23:33:38 | 143,482,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.domgee.poke;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class PokeApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"meganhart4242@gmail.com"
] | meganhart4242@gmail.com |
eedf399ac23c4fa2b3ee1bb35f310716f3844275 | c151096d3b9aec57988debca33ef9391ffcfab2b | /src/main/java/javapad/server/interfaces/INotifier.java | bb10bb4dfea9fe545376577d2f4ff2deff0aef98 | [] | no_license | conorsloan/JavaPad | 0b355d0ed817510429aa0f6f68e5611369b950c1 | c6444e83ba3d7c1935612b2c2600854e66efab79 | refs/heads/master | 2021-12-14T19:12:35.562880 | 2014-11-01T19:03:36 | 2014-11-01T19:03:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | package javapad.server.interfaces;
public interface INotifier
{
enum Type
{
CONSOLE_MESSAGE, STACK_TRACE, ERROR_EXCEPTION, ERROR_MESSAGE;
}
void sendToConsole(String message);
void sendStackTrace(StackTraceElement[] stackTrace);
void sendError(Exception e);
void sendError(String errorMessage);
}
| [
"conor@conors-mbp.home"
] | conor@conors-mbp.home |
5fe6c5acfde64154e5e5d9b90b209589015724d4 | fc25da1b754814bfceb16e2cdc8214e9f8129ee9 | /src/Theme4/MainClass.java | be3da1b109e24e50adec367ce5695a99b0480891 | [] | no_license | di35e1/Jelementary | 4017b93938bc752978440cb69b5a0305a45b9cf6 | 3346042c917783e487108020d9c6fb10582b8bc6 | refs/heads/master | 2021-04-20T01:31:43.873513 | 2020-04-20T20:42:15 | 2020-04-20T20:42:15 | 249,646,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package Theme4;
public class MainClass {
public static void main(String[] args) {
Animal animal = new Animal("Animal") {
@Override
public void voice() {
}
};
Cat cat = new Cat("Barsik", "White", 4, 4);
Birds bird = new Birds("Popka");
animal.AnimalInfo();
cat.AnimalInfo();
cat.CatInfo();
bird.fly();
}
}
| [
"di35e1@yandex.ru"
] | di35e1@yandex.ru |
c7dd60dacaeeb08e4bccef8b444144300a4ba04a | 02e505daba8aeda37adc723a45120592eb4ed074 | /src/com/facebook/buck/android/AndroidBundleFactory.java | 687fcb532d58da215e9e92e756aa9173eec3679f | [
"Apache-2.0"
] | permissive | tokopedia/buck | 14e5a6d859abe3cc46f47839a55ea8db6f89606e | 42cbcaad9039aaeb13b71feda410c97292da9577 | refs/heads/master | 2023-01-10T00:38:59.788692 | 2022-08-02T09:29:47 | 2022-08-02T09:29:47 | 186,541,181 | 0 | 3 | Apache-2.0 | 2023-01-05T02:20:46 | 2019-05-14T03:54:19 | Java | UTF-8 | Java | false | false | 5,614 | java | /*
* Copyright 2018-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.android;
import com.facebook.buck.android.FilterResourcesSteps.ResourceFilter;
import com.facebook.buck.android.exopackage.ExopackageMode;
import com.facebook.buck.android.toolchain.AndroidPlatformTarget;
import com.facebook.buck.android.toolchain.AndroidSdkLocation;
import com.facebook.buck.core.cell.CellPathResolver;
import com.facebook.buck.core.exceptions.HumanReadableException;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.Flavor;
import com.facebook.buck.core.model.InternalFlavor;
import com.facebook.buck.core.rules.ActionGraphBuilder;
import com.facebook.buck.core.rules.BuildRule;
import com.facebook.buck.core.rules.BuildRuleParams;
import com.facebook.buck.core.toolchain.ToolchainProvider;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.jvm.core.JavaLibrary;
import com.facebook.buck.jvm.java.JavaOptions;
import com.facebook.buck.jvm.java.Keystore;
import com.google.common.collect.ImmutableSortedSet;
import java.util.EnumSet;
import java.util.Optional;
public class AndroidBundleFactory {
private static final Flavor ANDROID_MODULARITY_VERIFICATION_FLAVOR =
InternalFlavor.of("modularity_verification");
private final AndroidBuckConfig androidBuckConfig;
public AndroidBundleFactory(AndroidBuckConfig androidBuckConfig) {
this.androidBuckConfig = androidBuckConfig;
}
public AndroidBundle create(
ToolchainProvider toolchainProvider,
ProjectFilesystem projectFilesystem,
ActionGraphBuilder graphBuilder,
CellPathResolver cellPathResolver,
BuildTarget buildTarget,
BuildRuleParams params,
AndroidBinaryGraphEnhancer graphEnhancer,
DexSplitMode dexSplitMode,
EnumSet<ExopackageMode> exopackageModes,
ResourceFilter resourceFilter,
ImmutableSortedSet<JavaLibrary> rulesToExcludeFromDex,
AndroidBundleDescriptionArg args,
JavaOptions javaOptions) {
BuildRule keystore = graphBuilder.getRule(args.getKeystore());
if (!(keystore instanceof Keystore)) {
throw new HumanReadableException(
"In %s, keystore='%s' must be a keystore() but was %s().",
buildTarget, keystore.getFullyQualifiedName(), keystore.getType());
}
ProGuardObfuscateStep.SdkProguardType androidSdkProguardConfig =
args.getAndroidSdkProguardConfig().orElse(ProGuardObfuscateStep.SdkProguardType.NONE);
AndroidGraphEnhancementResult result = graphEnhancer.createAdditionalBuildables();
AndroidBinaryFilesInfo filesInfo =
new AndroidBinaryFilesInfo(result, exopackageModes, args.isPackageAssetLibraries());
Optional<BuildRule> moduleVerification;
if (args.getAndroidAppModularityResult().isPresent()) {
moduleVerification =
Optional.of(
new AndroidAppModularityVerification(
graphBuilder,
buildTarget.withFlavors(ANDROID_MODULARITY_VERIFICATION_FLAVOR),
projectFilesystem,
args.getAndroidAppModularityResult().get(),
args.isSkipProguard(),
result.getDexFilesInfo().proguardTextFilesPath,
result.getPackageableCollection()));
graphBuilder.addToIndex(moduleVerification.get());
} else {
moduleVerification = Optional.empty();
}
return new AndroidBundle(
buildTarget,
projectFilesystem,
toolchainProvider.getByName(AndroidSdkLocation.DEFAULT_NAME, AndroidSdkLocation.class),
toolchainProvider.getByName(
AndroidPlatformTarget.DEFAULT_NAME, AndroidPlatformTarget.class),
params,
graphBuilder,
Optional.of(args.getProguardJvmArgs()),
(Keystore) keystore,
dexSplitMode,
args.getNoDx(),
androidSdkProguardConfig,
args.getOptimizationPasses(),
args.getProguardConfig(),
args.isSkipProguard(),
RedexArgsHelper.getRedexOptions(
androidBuckConfig,
buildTarget,
graphBuilder,
cellPathResolver,
args.getRedex(),
args.getRedexExtraArgs(),
args.getRedexConfig()),
args.getResourceCompression(),
args.getCpuFilters(),
resourceFilter,
exopackageModes,
rulesToExcludeFromDex,
result,
args.getXzCompressionLevel(),
args.isPackageAssetLibraries(),
args.isCompressAssetLibraries(),
args.getAssetCompressionAlgorithm(),
args.getManifestEntries(),
javaOptions.getJavaRuntimeLauncher(graphBuilder, buildTarget.getTargetConfiguration()),
args.getIsCacheable(),
moduleVerification,
filesInfo.getDexFilesInfo(),
filesInfo.getNativeFilesInfo(),
filesInfo.getResourceFilesInfo(),
ImmutableSortedSet.copyOf(result.getAPKModuleGraph().getAPKModules()),
filesInfo.getExopackageInfo(),
args.getBundleConfigFile());
}
}
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
46986476dbc0dd7985c8b904dc9343a35b8d82e7 | 99b7666953bc1106a30d379c10c05d1236c01def | /hibernate-solution/src/main/java/com/htp/basumatarau/hibernate/dao/dto/EmployeeDetailDTO.java | 3018be648a764f94de3b4445ae7becf42cdbc4c4 | [] | no_license | basumatarau/task02 | d2c0f4b74b462d82f82fa21e2e221b3e5666d98e | 0c5d3f13b1e6ca53f5f3864fe55572ac1f819063 | refs/heads/master | 2022-12-04T14:28:51.176253 | 2019-08-21T07:22:28 | 2019-08-21T07:22:28 | 173,960,175 | 0 | 0 | null | 2022-11-24T07:40:48 | 2019-03-05T14:19:24 | Java | UTF-8 | Java | false | false | 2,626 | java | package com.htp.basumatarau.hibernate.dao.dto;
public class EmployeeDetailDTO {
private final String firstName;
private final String lastName;
private final String currentAddress;
private final String currentCity;
private final String currentCountry;
private final String company;
private final String city;
private final String country;
private final String address;
private final Long numStaff;
private final String jobPosition;
public EmployeeDetailDTO(String firstName,
String lastName,
String currentAddress,
String currentCity,
String currentCountry,
String company,
String city,
String country,
String address,
Long numStaff,
String jobPosition) {
this.firstName = firstName;
this.lastName = lastName;
this.currentAddress = currentAddress;
this.currentCity = currentCity;
this.currentCountry = currentCountry;
this.company = company;
this.city = city;
this.country = country;
this.address = address;
this.numStaff = numStaff;
this.jobPosition = jobPosition;
}
@Override
public String toString() {
return '\'' + firstName + " " + lastName + '\'' + " " +
'\'' + currentAddress + " " + currentCity + " " + currentCountry + '\'' +
" " + '\'' + company + '\'' +
" " + '\'' + city + '\'' +
" " + '\'' + country + '\'' +
" " + '\'' + address + '\'' +
", staff: " + numStaff +
", job:'" + jobPosition + '\'';
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getCurrentAddress() {
return currentAddress;
}
public String getCurrentCity() {
return currentCity;
}
public String getCurrentCountry() {
return currentCountry;
}
public String getCompany() {
return company;
}
public String getCity() {
return city;
}
public String getCountry() {
return country;
}
public String getAddress() {
return address;
}
public Long getNumStaff() {
return numStaff;
}
public String getJobPosition() {
return jobPosition;
}
}
| [
"basumatarau@gmail.com"
] | basumatarau@gmail.com |
1381dfbe866540820d39ce9c33292e36588edbcd | cf7e9fcaa002d7e3a2e4396831bf122fd1ac7bbc | /cards/src/main/java/org/rnd/jmagic/cards/OxiddaScrapmelter.java | 4754b555875c9f23a989f327a5d9c10d96e28ac7 | [] | no_license | NorthFury/jmagic | 9b28d803ce6f8bf22f22eb41e2a6411bc11c8cdf | efe53d9d02716cc215456e2794a43011759322d9 | refs/heads/master | 2020-05-28T11:04:50.631220 | 2014-06-17T09:48:44 | 2014-06-17T09:48:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,129 | java | package org.rnd.jmagic.cards;
import static org.rnd.jmagic.Convenience.*;
import org.rnd.jmagic.engine.*;
import org.rnd.jmagic.engine.generators.*;
@Name("Oxidda Scrapmelter")
@Types({Type.CREATURE})
@SubTypes({SubType.BEAST})
@ManaCost("3R")
@Printings({@Printings.Printed(ex = Expansion.SCARS_OF_MIRRODIN, r = Rarity.UNCOMMON)})
@ColorIdentity({Color.RED})
public final class OxiddaScrapmelter extends Card
{
public static final class OxiddaScrapmelterAbility0 extends EventTriggeredAbility
{
public OxiddaScrapmelterAbility0(GameState state)
{
super(state, "When Oxidda Scrapmelter enters the battlefield, destroy target artifact.");
this.addPattern(whenThisEntersTheBattlefield());
SetGenerator target = targetedBy(this.addTarget(ArtifactPermanents.instance(), "target artifact"));
this.addEffect(destroy(target, "Destroy target artifact."));
}
}
public OxiddaScrapmelter(GameState state)
{
super(state);
this.setPower(3);
this.setToughness(3);
// When Oxidda Scrapmelter enters the battlefield, destroy target
// artifact.
this.addAbility(new OxiddaScrapmelterAbility0(state));
}
}
| [
"robyter@gmail"
] | robyter@gmail |
82ccb43393b8725fdee0f1132de1404708ba53a7 | 12a18a1fb033d97f4ec0251f61078733cfd8c63f | /chrome/android/java/src/org/chromium/chrome/browser/tabmodel/SingleTabModel.java | 63e45558fb41455eb09a894908b49fb88670a2b6 | [
"BSD-3-Clause"
] | permissive | compliment/chromium | ddb080627e8a5e75030a2ff2ef296f858e336f0e | bcd6a141ba148374c5b17135e2b61eef5bb32992 | refs/heads/master | 2023-01-13T00:01:38.156170 | 2019-12-19T05:36:59 | 2019-12-19T05:36:59 | 228,990,557 | 0 | 0 | BSD-3-Clause | 2019-12-19T06:32:50 | 2019-12-19T06:32:49 | null | UTF-8 | Java | false | false | 5,563 | java | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.tabmodel;
import android.app.Activity;
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.ObserverList;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabImpl;
import org.chromium.chrome.browser.tab.TabLaunchType;
import org.chromium.chrome.browser.tab.TabSelectionType;
import java.util.List;
/**
* Simple TabModel that assumes that only one Tab exists.
*/
public class SingleTabModel implements TabModel {
private final Activity mActivity;
private final ObserverList<TabModelObserver> mObservers = new ObserverList<>();
private Tab mTab;
private boolean mIsIncognito;
SingleTabModel(Activity activity, boolean incognito) {
mActivity = activity;
mIsIncognito = incognito;
}
/**
* Sets the Tab that is managed by the SingleTabModel.
* @param tab Tab to manage.
*/
void setTab(Tab tab) {
if (mTab == tab) return;
Tab oldTab = mTab;
mTab = tab;
if (oldTab != null) {
for (TabModelObserver observer : mObservers) {
observer.willCloseTab(oldTab, false);
}
}
if (tab != null) {
assert mTab.isIncognito() == mIsIncognito;
for (TabModelObserver observer : mObservers) {
observer.didAddTab(tab, TabLaunchType.FROM_LINK);
observer.didSelectTab(tab, TabSelectionType.FROM_USER, Tab.INVALID_TAB_ID);
}
int state = ApplicationStatus.getStateForActivity(mActivity);
if (state == ActivityState.CREATED || state == ActivityState.STARTED
|| state == ActivityState.RESUMED) {
mTab.show(TabSelectionType.FROM_USER);
}
}
if (oldTab != null && oldTab.isInitialized()) {
for (TabModelObserver observer : mObservers) {
observer.didCloseTab(oldTab.getId(), oldTab.isIncognito());
}
oldTab.destroy();
}
}
@Override
public Profile getProfile() {
return mTab == null ? null : ((TabImpl) mTab).getProfile();
}
@Override
public boolean isIncognito() {
return mIsIncognito;
}
@Override
public int getCount() {
return mTab == null ? 0 : 1;
}
@Override
public int indexOf(Tab tab) {
if (tab == null) return INVALID_TAB_INDEX;
return mTab != null && mTab.getId() == tab.getId() ? 0 : INVALID_TAB_INDEX;
}
@Override
public int index() {
return mTab != null ? 0 : INVALID_TAB_INDEX;
}
@Override
public boolean closeTab(Tab tab) {
return closeTab(tab, false, false, false);
}
@Override
public boolean closeTab(Tab tab, boolean animate, boolean uponExit, boolean canUndo) {
if (mTab == null || mTab.getId() != tab.getId()) return false;
setTab(null);
return true;
}
@Override
public boolean closeTab(
Tab tab, Tab recommendedNextTab, boolean animate, boolean uponExit, boolean canUndo) {
return closeTab(tab, animate, uponExit, canUndo);
}
@Override
public void closeMultipleTabs(List<Tab> tabs, boolean canUndo) {
if (mTab == null) return;
for (Tab tab : tabs) {
if (tab.getId() == mTab.getId()) {
setTab(null);
return;
}
}
}
@Override
public void closeAllTabs() {
closeAllTabs(true, false);
}
@Override
public void closeAllTabs(boolean allowDelegation, boolean uponExit) {
setTab(null);
}
// Tab retrieval functions.
@Override
public Tab getTabAt(int position) {
return position == 0 ? mTab : null;
}
@Override
public void setIndex(int i, final @TabSelectionType int type) {
assert i == 0;
}
@Override
public boolean isCurrentModel() {
return true;
}
@Override
public void moveTab(int id, int newIndex) {
assert false;
}
@Override
public void destroy() {
if (mTab != null) mTab.destroy();
mTab = null;
}
@Override
public Tab getNextTabIfClosed(int id) {
return null;
}
@Override
public boolean isClosurePending(int tabId) {
return false;
}
@Override
public TabList getComprehensiveModel() {
return this;
}
@Override
public void commitAllTabClosures() {}
@Override
public void commitTabClosure(int tabId) {}
@Override
public void cancelTabClosure(int tabId) {}
@Override
public boolean supportsPendingClosures() {
return false;
}
@Override
public void addTab(Tab tab, int index, @TabLaunchType int type) {
setTab(tab);
}
@Override
public void removeTab(Tab tab) {
mTab = null;
for (TabModelObserver obs : mObservers) obs.tabRemoved(tab);
}
@Override
public void addObserver(TabModelObserver observer) {
mObservers.addObserver(observer);
}
@Override
public void removeObserver(TabModelObserver observer) {
mObservers.removeObserver(observer);
}
@Override
public void openMostRecentlyClosedTab() {}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
678d65dd0e2ff77c18edd8f25d52edbef116f16f | 6b641c06bdc0ea5edfc710074dbbffb806effac6 | /prj-ejb/ejbModule/ejb/EjbClient.java | a3edaf4a5b65d32181a51734414c07dcf23ab2e3 | [] | no_license | Matdev94/Application_JEE7 | 09607486a6817273863f0fd9a5c44eff2d05035d | 2f87fc9df32c74eb537da26d2915f950429be0f6 | refs/heads/master | 2020-12-09T10:59:32.301657 | 2020-05-26T20:01:52 | 2020-05-26T20:01:52 | 233,284,362 | 2 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,095 | java | package ejb;
import java.util.List;
import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import model.Client;
/**
* @generated DT_ID=none
*/
@Stateless(name = "EjbClient", mappedName = "prj-ejb-EjbClient")
public class EjbClient
implements EjbClientLocal, EjbClientRemote
{
/**
* @generated DT_ID=none
*/
@Resource
SessionContext sessionContext;
/**
* @generated DT_ID=none
*/
@PersistenceContext(unitName="prj-ejb")
private EntityManager em;
/**
* @generated DT_ID=none
*/
public EjbClient() {
}
/**
* @generated DT_ID=none
*/
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public Object queryByRange(String jpqlStmt, int firstResult,
int maxResults) {
Query query = em.createQuery(jpqlStmt);
if (firstResult > 0) {
query = query.setFirstResult(firstResult);
}
if (maxResults > 0) {
query = query.setMaxResults(maxResults);
}
return query.getResultList();
}
/*Identifier un client à l'aide de son nom et de son mot de passe,
La méthode proposée reçoit comme argument un objet Client dont les 2 seuls champs remplis
sont le nom et le mot de passe à l'aide de l'interface accueil.xhtml.
La méthode retourne l'objet client identifié (complet) ou null dans le cas contraire.
Ajouter la méthode suivante dans la classe EjbClient pour rechercher si un client est déjà
présent dans la table à partir de son nom et de son mot de passe:
*/
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public Client identifierUnClient(Client client){
String jpqlStmt = "select x from Client x where x.nom = ";
jpqlStmt = jpqlStmt +"'" + client.getNom()+"'"+ "and ";
jpqlStmt = jpqlStmt +"x.motdepasse = "+"'" + client.getMotdepasse()+"'";
List<Client> lesclients = (List<Client>)queryByRange(jpqlStmt,0,0);
if (lesclients.size()==1)
return lesclients.get(0);
else return null ;
}
/*
Rechercher un client à partir de son nom, de son prénom et de son âge
La méthode proposée reçoit comme argument un objet Client dont les 3 seuls champs remplis
sont le nom, le prénom et l'âge à l'aide de l'interface enregistrement.xhtml.
La méthode retourne l'objet client identifié (complet) ou null dans le cas contraire.
Ajouter la méthode suivante dans la classe EjbClient pour rechercher si un client est déjà
présent dans la table à partir de son nom, de son prénom et de son âge:
*/
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public Client rechercherUnClient(Client client){
String jpqlStmt = "select x from Client x where x.nom = ";
jpqlStmt = jpqlStmt +"'" + client.getNom()+"'"+ "and ";
jpqlStmt = jpqlStmt +"x.prenom = "+"'" + client.getPrenom()+"'" + "and ";
jpqlStmt = jpqlStmt +"x.age = "+"'" + client.getAge()+"'";
List<Client> lesclients = (List<Client>)queryByRange(jpqlStmt,0,0);
if (lesclients.size()==1)
return lesclients.get(0);
else return null ;
}
/**
* @generated DT_ID=none
*/
public Client persistClient(Client client) {
em.persist(client);
return client;
}
/**
* @generated DT_ID=none
*/
public Client mergeClient(Client client) {
return em.merge(client);
}
/**
* @generated DT_ID=none
*/
public void removeClient(Client client) {
client = em.find(Client.class, client.getId());
em.remove(client);
}
/**
* @generated DT_ID=none
*/
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<Client> getClientFindAll() {
return em.createNamedQuery("Client.findAll").getResultList();
}
}
| [
"mathieuchamplon.it@gmail.com"
] | mathieuchamplon.it@gmail.com |
63686cc8a4bf4b52f7232322f00919b26e4242bd | e3702c2a03855cc550e4afceec90236137da4526 | /java/com/ifocus/papple/fragments/AboutFragment.java | 8cd646eda51db6e826ffd304e21bc197a1bc698a | [
"Apache-2.0"
] | permissive | ankur-mishra-07/papple | 902e6d2c12e3c62356ab5a1f9c7675e298dbb6c3 | e63ceeac6a83d6011de865a9d78538f981d3ffa6 | refs/heads/master | 2020-12-24T20:14:30.614575 | 2016-05-11T11:38:21 | 2016-05-11T11:38:21 | 58,538,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,574 | java | package com.ifocus.papple.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.MapsInitializer;
import com.google.android.gms.maps.model.CircleOptions;
import com.google.android.gms.maps.model.LatLng;
import com.ifocus.papple.R;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link AboutFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class AboutFragment extends Fragment {
private MapView mMapView;
private GoogleMap googleMap;
private View view;
public AboutFragment() {
// Required empty public constructor
}
// TODO: Rename and change types and number of parameters
public static AboutFragment newInstance(String param1, String param2) {
AboutFragment fragment = new AboutFragment();
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_about, container, false);
mMapView = (MapView) view.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume();// needed to get the map to display immediately
try {
MapsInitializer.initialize(getActivity().getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
googleMap = mMapView.getMap();
googleMap.addCircle(new CircleOptions().center(new LatLng(12.76876,77.6564)));
return view;
}
@Override
public void onResume() {
super.onResume();
mMapView.onResume();
}
@Override
public void onPause() {
super.onPause();
mMapView.onPause();
}
@Override
public void onDestroy() {
super.onDestroy();
mMapView.onDestroy();
}
@Override
public void onLowMemory() {
super.onLowMemory();
mMapView.onLowMemory();
}
}
| [
"am3042208007@gmail.com"
] | am3042208007@gmail.com |
a40ce0aea86949abfe3499750f21a05dd47d0e3b | 4d72b854584b7ee562f3814ed730c9272911f745 | /kid/src/kid/testchild.java | f7783473ac1bad57197dacf64dc06044c1a043aa | [] | no_license | pavannarne/pavan | 590574cd3b68ca8f1b670a2334b4653ef210ce95 | 1acb1ee53edc8081d89dfb5d4043dbb1cd38021d | refs/heads/master | 2020-05-31T00:30:07.815914 | 2014-06-21T02:45:30 | 2014-06-21T02:45:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 660 | java | package kid;
/**
* testchild is class to call the child class
* @author PavaN
*
*/
public class testchild
{
public static void main(String args[])
{
/**
* c is a newly created object for the child class
* to call the child class methods
*/
child c=new child();
c.test();
c.test(25);
/**
* check the student is young
*/
if(c.isYoung())
{
/**
* c is true displays the string
*/
System.out.println("child is just young");
}
else
{
/**
* c is false displays the string
*/
System.out.println("child lost his youthful ");
}
}
}
| [
"pavannarne@gmail.com"
] | pavannarne@gmail.com |
9819fcd3643db488b651b0b229f89df6188f094c | 88c1eba5b1aa2eb6bbd00f7478b57bef0328cecd | /src/parsing/ParseFeed.java | e376992d539af0d038c218e1d2156e4b22951e88 | [] | no_license | maxrysukhin/AirportsMap | 0953cfedcff7779f24621641aae29ddb0e08fc31 | 7e04f95ae1a13629e9b9bc07c7f644e09df3359f | refs/heads/master | 2021-01-20T21:15:43.078733 | 2017-08-29T13:19:50 | 2017-08-29T13:19:50 | 101,761,070 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,163 | java | package parsing;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import de.fhpotsdam.unfolding.data.Feature;
import de.fhpotsdam.unfolding.data.PointFeature;
import de.fhpotsdam.unfolding.data.ShapeFeature;
import de.fhpotsdam.unfolding.geo.Location;
import processing.core.PApplet;
import processing.data.XML;
public class ParseFeed {
/*
* This method is to parse a file containing airport information.
* The file and its format can be found:
* http://openflights.org/data.html#airport
*
* It is also included in the file airports.dat
*
* @param p - PApplet being used
* @param fileName - file name or URL for data source
*/
public static List<PointFeature> parseAirports(PApplet p, String fileName) {
List<PointFeature> features = new ArrayList<PointFeature>();
String[] rows = p.loadStrings(fileName);
for (String row : rows) {
// hot-fix for altitude when lat lon out of place
int i = 0;
// split row by commas not in quotations
String[] columns = row.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
// get location and create feature
//System.out.println(columns[6]);
float lat = Float.parseFloat(columns[6]);
float lon = Float.parseFloat(columns[7]);
Location loc = new Location(lat, lon);
PointFeature point = new PointFeature(loc);
// set ID to OpenFlights unique identifier
point.setId(columns[0]);
// get other fields from csv
point.addProperty("name", columns[1]);
point.putProperty("city", columns[2]);
point.putProperty("country", columns[3]);
// pretty sure IATA/FAA is used in routes.dat
// get airport IATA/FAA code
if(!columns[4].equals("")) {
point.putProperty("code", columns[4]);
}
// get airport ICAO code if no IATA
else if(!columns[5].equals("")) {
point.putProperty("code", columns[5]);
}
point.putProperty("altitude", columns[8 + i]);
features.add(point);
}
return features;
}
/*
* This method is to parse a file containing airport route information.
* The file and its format can be found:
* http://openflights.org/data.html#route
*
* It is also included with the UC San Diego MOOC package in the file routes.dat
*
* @param p - PApplet being used
* @param fileName - file name or URL for data source
*/
public static List<ShapeFeature> parseRoutes(PApplet p, String fileName) {
List<ShapeFeature> routes = new ArrayList<ShapeFeature>();
String[] rows = p.loadStrings(fileName);
for(String row : rows) {
String[] columns = row.split(",");
ShapeFeature route = new ShapeFeature(Feature.FeatureType.LINES);
// set id to be OpenFlights identifier for source airport
// check that both airports on route have OpenFlights Identifier
if(!columns[3].equals("\\N") && !columns[5].equals("\\N")){
// set "source" property to be OpenFlights identifier for source airport
route.putProperty("source", columns[3]);
// "destination property" -- OpenFlights identifier
route.putProperty("destination", columns[5]);
routes.add(route);
}
}
return routes;
}
} | [
"m.mowgly@gmail.com"
] | m.mowgly@gmail.com |
093a299cfd2af965d91d8c362fa3105615b38b63 | 003a0ea61d2d300efc0e5d83aa16965610c0a24a | /UtilityKit/app/src/main/java/com/example/shukl/utilitykit/MainActivity.java | c31c5ff485e457dbaa6600a7908ada1d922cb6b5 | [] | no_license | Shreypandey/Utility_kit | e8d66fba63f94cbae98646aea45cef42c36ede5b | c8f191e58f7017dba5d5a48f74bc96c31001977a | refs/heads/master | 2021-08-31T22:59:36.290049 | 2017-12-23T08:52:09 | 2017-12-23T08:52:09 | 114,997,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | package com.example.shukl.utilitykit;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1=(Button)findViewById(R.id.button);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(MainActivity.this,Login.class);
startActivity(i);
finish();
}
});
}
}
| [
"33994761+Shreypandey@users.noreply.github.com"
] | 33994761+Shreypandey@users.noreply.github.com |
a0427d40393ed2e74b40af699e8a846e68e3de10 | 409bdfcaa53e73a69c816da3605001c6e0e7042d | /1.JavaSyntax/src/com/javarush/task/task04/task0442/Solution.java | 357d203cb2ac8a113358b3ed49ee290e28a53134 | [] | no_license | sebelousov/javarushtasks | 2a4c8ebcdba94196276b61688bb73ccf2cad039e | 2710a327278ba04b40637cd5918491ef70ced117 | refs/heads/master | 2023-03-25T09:41:19.840213 | 2021-03-24T13:56:49 | 2021-03-24T13:56:49 | 351,092,038 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | package com.javarush.task.task04.task0442;
/*
Суммирование
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
/*BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
for ( ; true; ){
String x = reader.readLine();
if (x.equals("-1")){
System.out.println(sum);
break;
}
else{
sum = sum + Integer.parseInt(x);
}
}*/
String hello = "Hello, world!";
System.out.println(hello);
//напишите тут ваш код
}
}
| [
"bsn@list.ru"
] | bsn@list.ru |
017c42a03b851b56b5662fb84afefa579e25b855 | 43239bb491c195d17bb9881976a6ceb93aeb8620 | /app/src/main/java/com/greenapex/callhelper/Adpter/adpterReminder.java | 0740b43e7be6ade0b6842f5b39fb49960d1e5bbf | [] | no_license | GA-Kush/CallHelper | b8c40dca336435ffa6fc7a65f05d054c58e4bf76 | d2005a15978f814d6852690228d6f132f424e8dd | refs/heads/master | 2021-08-31T19:27:41.074466 | 2017-12-22T14:39:30 | 2017-12-22T14:39:30 | 115,121,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,922 | java | package com.greenapex.callhelper.Adpter;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.greenapex.callhelper.Activity.NoteCreate;
import com.greenapex.callhelper.Model.contactNote;
import com.greenapex.callhelper.Model.contactReminder;
import com.greenapex.callhelper.R;
import com.greenapex.callhelper.dbCallHelper.MyDBHandler;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* Created by pc01 on 5/12/17.
*/
public class adpterReminder extends RecyclerView.Adapter<adpterReminder.RecyclerViewHolder> {
Context context;
List<contactNote> arrayReminder;
LayoutInflater inflater;
MyDBHandler dbHandler;
int Id;
String contactName, cNote, contactNumber,type;
public adpterReminder(Context context, List<contactNote> arrayReminder) {
this.arrayReminder = arrayReminder;
this.context = context;
inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
}
@Override
public RecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = inflater.inflate(R.layout.app_contact_reminder, null, false);
RecyclerViewHolder holder = new RecyclerViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(final RecyclerViewHolder holder, final int position) {
dbHandler = new MyDBHandler(context);
Id = arrayReminder.get(position).getContactId();
contactName = arrayReminder.get(position).getContactName();
cNote = arrayReminder.get(position).getContactNote();
contactNumber = arrayReminder.get(position).getContactNumber();
type=arrayReminder.get(position).getType();
holder.txtReminderName.setText(contactName);
holder.txtReminderNote.setText(cNote);
holder.txtReminderCreateDateTime.setText("created: "+arrayReminder.get(position).getContactNoteDateTime());
holder.txtReminderDateTime.setText(arrayReminder.get(position).getDate() + " " + arrayReminder.get(position).getTime());
holder.btnReminderSetting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final contactNote reminder = arrayReminder.get(position);
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View dialogView = inflater.inflate(R.layout.app_reminder_edit, null);
dialogBuilder.setView(dialogView);
final AlertDialog editDelete = dialogBuilder.create();
editDelete.show();
RelativeLayout relativeLayoutDelete = (RelativeLayout) dialogView.findViewById(R.id.relative_bottom);
relativeLayoutDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editDelete.cancel();
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View dialogView = inflater.inflate(R.layout.app_delete, null);
dialogBuilder.setView(dialogView);
final AlertDialog delete = dialogBuilder.create();
delete.show();
Button btnDelete = (Button) dialogView.findViewById(R.id.btnDelete);
btnDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dbHandler.deleteNote(reminder.getContactId());
delete.cancel();
}
});
Button btnClose=(Button)dialogView.findViewById(R.id.btnClose);
btnClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
delete.cancel();
}
});
}
});
}
});
}
@Override
public int getItemCount() {
return arrayReminder.size();
}
public class RecyclerViewHolder extends RecyclerView.ViewHolder {
TextView txtReminderName, txtReminderNote, txtReminderCreateDateTime, txtReminderDateTime;
Button btnReminderSetting;
public RecyclerViewHolder(View itemView) {
super(itemView);
btnReminderSetting = (Button) itemView.findViewById(R.id.btnReminderSetting);
txtReminderName = (TextView) itemView.findViewById(R.id.txtReminderName);
txtReminderNote = (TextView) itemView.findViewById(R.id.txtReminderNote);
txtReminderCreateDateTime = (TextView) itemView.findViewById(R.id.txtReminderCreateDateTime);
txtReminderDateTime = (TextView) itemView.findViewById(R.id.txtReminderDateTime);
}
}
}
| [
"kush.shah@greenapex.in"
] | kush.shah@greenapex.in |
d8e348f7c7310880f6bf4b0a0846052a2c899839 | 3d929d2e7cdbb92a6b2b5cf3eb558f013ea3e118 | /src/main/java/com/codingcalendar/codingcalendar/api/Services/ApiServices.java | 70abfb095d38a1127b4c78903df9f66af4dc62c7 | [] | no_license | harsh18262/coding-calendar-api | ebbfd5deb40efcf89006c371e33923c2d8ae8d7e | b366cd04be6957697b396672e180cab01313e7b7 | refs/heads/main | 2023-07-05T04:33:50.824906 | 2021-07-04T16:33:47 | 2021-07-04T16:33:47 | 366,156,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package com.codingcalendar.codingcalendar.api.Services;
import com.codingcalendar.codingcalendar.api.Entities.Contest;
public interface ApiServices {
public Iterable<Contest> getAllcontests();
public Iterable<Contest> getby_platform_and_phase(String Platform,String Phase);
}
| [
"harshwardhanmehrotra@gmail.com"
] | harshwardhanmehrotra@gmail.com |
9745fc490fd5775f84203c44efd53a4216943152 | 36e88fb098a76cf3b671ca20b4163b1d934aa64a | /TicTacToeTest_ver1/src/test/java/com/qsoft/UnitTest/TicTacToeDAOTest.java | ae43471e4bfc939cd6c5578a090b482295c9b466 | [] | no_license | quynhtruong/Kata5-team-1- | 958043a5687f32b8ddcc8959d0328ef436d7fd90 | 1981743af5d20edeb6c5629472129d5d2c86631e | refs/heads/master | 2021-01-22T23:57:58.490497 | 2013-08-21T01:34:49 | 2013-08-21T01:34:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,622 | java | package com.qsoft.UnitTest;
import com.qsoft.TicTacToe.persistance.dao.TicTacToeDao;
import com.qsoft.TicTacToe.persistance.entity.GameEntity;
import org.dbunit.DataSourceDatabaseTester;
import org.dbunit.IDatabaseTester;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
import org.dbunit.operation.DatabaseOperation;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
/**
* Created with IntelliJ IDEA.
* User: khiemnt
* Date: 8/15/13
* Time: 10:20 AM
* To change this template use File | Settings | File Templates.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring-config-Test.xml"})
@TransactionConfiguration(transactionManager="transactionManager",defaultRollback = true)
@Transactional
public class TicTacToeDAOTest
{
@Autowired
public TicTacToeDao ticTacToeDao;
@Autowired
private DataSource dataSourceTest;
private IDatabaseTester databaseTester;
@Before
public void setup() throws Exception
{
IDataSet dataSet = new FlatXmlDataSetBuilder().build(System.class.getResource("/dataSet.xml"));
databaseTester = new DataSourceDatabaseTester(dataSourceTest);
databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT);
databaseTester.setDataSet(dataSet);
databaseTester.onSetup();
}
@After
public void tearDown() throws Exception
{
databaseTester.onTearDown();
}
@Test
public void testGetAllGameEntity()
{
List<GameEntity> gameEntityList = ticTacToeDao.getAllGameEntity();
assertEquals(2L, gameEntityList.size());
assertEquals("X", gameEntityList.get(0).getWinner());
assertEquals("1-2,", gameEntityList.get(0).getProcess());
}
@Test
public void testSaveGameEntity()
{
GameEntity gameEntity = new GameEntity("x", "3-4,");
ticTacToeDao.save(gameEntity);
List<GameEntity> gameEntityList = ticTacToeDao.getAllGameEntity();
assertTrue(gameEntityList.contains(gameEntity));
}
}
| [
"khiemnt@qs095.qsoft.com.vn"
] | khiemnt@qs095.qsoft.com.vn |
608b57bce688763867205bd63158fd24a14d3b33 | 7aa2244b81bbb328df735d38892f0482c3155e29 | /src/main/java/com/example/demo/DatavApplication.java | 9f5be2167efa5329f38c51b218055c9d22e4d765 | [] | no_license | liaowuhen88/datav | e11fb42161478fed3d3895909258c8c70dd201ba | 18bbffcad80f1836ae0360767187d173a6cf76cb | refs/heads/master | 2021-05-14T10:37:52.749761 | 2018-01-10T02:26:23 | 2018-01-10T02:26:23 | 116,359,836 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DatavApplication {
public static void main(String[] args) {
SpringApplication.run(DatavApplication.class, args);
}
}
| [
"296558063@qq.com"
] | 296558063@qq.com |
781f060820e50783e838967a760a1611ac49ca70 | 0bfe252d10044f07697825a0540f7a7f8e8fac33 | /Capsule/src/Person.java | b69a23c6e67c66e402f622d8f84eaac268cd3228 | [] | no_license | mountain-book/test-1 | b844a22a3df09e6ea33b30dc54811d4fb54b1e14 | 2fd9cec1ff2447dea62a6393594f4858729f4afc | refs/heads/master | 2020-03-25T01:18:45.219767 | 2018-08-01T06:23:46 | 2018-08-01T06:23:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | /**
*
*/
/**
* @author internousdev
*
*/
public class Person {
public String name = null;
public int age = 0;
public Person(String name,int age){
this.name = name;
this.age = age;
}
public String getName(){
return this.name;
}
public void setName(String name){
this.name = name;
}
/**
* @param args
*/
}
| [
"kumakou8@icloud.com"
] | kumakou8@icloud.com |
9d0c15f40cafa6747526736b7281f8a053f99ef3 | 2a1f8faf6cedd1ca3032316bc0fc81e4d5519306 | /app/src/main/java/bdshop2/imran/com/bdshop3/model/Contact.java | a475ecc32b73db48203ae41572c6039376c637b9 | [] | no_license | imufun/bdsssss | 441117becd8e209cf147c102257bf77113edd8f0 | c968f68b30fcf7a56b9da15d7234cc1f195fcbc0 | refs/heads/master | 2021-01-19T21:59:26.304789 | 2017-04-26T09:13:18 | 2017-04-26T09:13:18 | 88,734,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,210 | java | package bdshop2.imran.com.bdshop3.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by imran on 4/13/2017.
*/
public class Contact {
@SerializedName("id")
@Expose
private String id;
@SerializedName("name")
@Expose
private String name;
@SerializedName("email")
@Expose
private String email;
@SerializedName("address")
@Expose
private String address;
@SerializedName("profile_pic")
@Expose
private String profilePic;
@SerializedName("phone")
@Expose
private Phone phone;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getProfilePic() {
return profilePic;
}
public void setProfilePic(String profilePic) {
this.profilePic = profilePic;
}
public Phone getPhone() {
return phone;
}
public void setPhone(Phone phone) {
this.phone = phone;
}
public class Phone {
@SerializedName("mobile")
@Expose
private String mobile;
@SerializedName("home")
@Expose
private String home;
@SerializedName("office")
@Expose
private String office;
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getHome() {
return home;
}
public void setHome(String home) {
this.home = home;
}
public String getOffice() {
return office;
}
public void setOffice(String office) {
this.office = office;
}
}
}
| [
"imufun1@gmail.com"
] | imufun1@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.