blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
1d32fdd3af4496e75fa7eaf64db5bd55959e6c9f
995f73d30450a6dce6bc7145d89344b4ad6e0622
/Mate20-9.0/src/main/java/com/huawei/opcollect/strategy/ActionTableName.java
2400c7be52cd09ad8f67042fec8d933d61b89664
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,125
java
package com.huawei.opcollect.strategy; import com.huawei.opcollect.utils.OPCollectConstant; public enum ActionTableName { RAW_DEVICE_INFO(OPCollectConstant.DEVICE_ACTION_NAME), RAW_TRAIN_FLIGHT_TICK_INFO(OPCollectConstant.TRIP_ACTION_NAME), RAW_HOTEL_INFO(OPCollectConstant.HOTEL_ACTION_NAME), RAW_MEDIA_APP_STASTIC(OPCollectConstant.MEDIA_ACTION_NAME), RAW_LOCATION_RECORD(OPCollectConstant.LOCATION_ACTION_NAME), RAW_SYSTEM_EVENT("RawSysEvent"), RAW_AR_STATUS(OPCollectConstant.AR_ACTION_NAME), RAW_WEATHER_INFO(OPCollectConstant.WEATHER_ACTION_NAME), RAW_POSITION_STATE("RawPositionState"), RAW_FG_APP_EVENT("RawFgAPPEvent"), RAW_DEVICE_STATUS_INFO(OPCollectConstant.DEVICE_STATUS_INFO_ACTION_NAME), DS_CONTACTS_INFO(OPCollectConstant.CONTACTS_ACTION_NAME); private String value; private ActionTableName(String value2) { this.value = value2; } public String getValue() { return this.value; } /* access modifiers changed from: package-private */ public void setValue(String value2) { this.value = value2; } }
[ "dstmath@163.com" ]
dstmath@163.com
a8a8bed6119603930103ecb3f0ffff19c68f5e0d
2809429eb75cfa571081158b2a03ddff7608f3a8
/src/main/java/com/test/controllers/CampaignViewController.java
edd910406a2bb8742cf50fca5d0c940eda9d4a5c
[]
no_license
evgenybutkevich/CF_web_app
af5289148505240f4f462202f5de5032d153111a
6eda714347c0491250d62f8d731e1c6330802842
refs/heads/master
2021-01-02T18:25:19.627020
2020-02-23T22:58:24
2020-02-23T22:58:24
239,741,784
0
0
null
null
null
null
UTF-8
Java
false
false
4,032
java
package com.test.controllers; import com.test.entities.Campaign; import com.test.entities.Comment; import com.test.entities.Payment; import com.test.entities.User; import com.test.repositories.CampaignRepository; import com.test.repositories.CommentRepository; import com.test.repositories.PaymentRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import java.io.File; import java.io.IOException; import java.util.Date; import java.util.Map; import java.util.UUID; @Controller public class CampaignViewController { @Autowired private CampaignRepository campaignRepository; @Autowired private CommentRepository commentRepository; @Autowired private PaymentRepository paymentRepository; @Value("${upload.path}") private String uploadPath; @GetMapping("/campaigns") public String campaigns(Model model) { Iterable<Campaign> campaigns = campaignRepository.findAll(); model.addAttribute("campaigns", campaigns); return "campaigns"; } @GetMapping("/campaigns/{id}") public String view(@PathVariable Integer id, Model model) { Campaign campaign = campaignRepository.findById(id); model.addAttribute("campaign", campaign); Iterable<Comment> comments = commentRepository.findByRecipient(campaign); model.addAttribute("comments", comments); Iterable<Payment> payments = paymentRepository.findByRecipient(campaign); model.addAttribute("payments", payments); return "viewCampaign"; } @PostMapping("/campaigns/{id}") public String addComment(@PathVariable Integer id, @AuthenticationPrincipal User user, @Valid Comment comment, BindingResult bindingResult, @RequestParam("file") MultipartFile file, Model model) throws IOException { Campaign campaign = campaignRepository.findById(id); model.addAttribute("campaign", campaign); if (bindingResult.hasErrors()) { Map<String, String> errorsMap = ControllerUtilities.getErrors(bindingResult); model.mergeAttributes(errorsMap); model.addAttribute("comment", comment); } else { comment.setRecipient(campaign); comment.setAuthor(user); if (file != null && !file.getOriginalFilename().isEmpty()) { File uploadDir = new File(String.format("%s%s%s", System.getProperty("user.dir"), File.separatorChar, uploadPath)); if (!uploadDir.exists()) { uploadDir.mkdir(); } String currentPath = uploadDir.getPath(); String uuidFile = UUID.randomUUID().toString(); String resultFileName = uuidFile + "." + file.getOriginalFilename(); file.transferTo(new File(currentPath + "/" + resultFileName)); comment.setFilename(resultFileName); } comment.setDateOfCreation(new Date()); model.addAttribute("comment", null); commentRepository.save(comment); } Iterable<Comment> comments = commentRepository.findByRecipient(campaign); model.addAttribute("comments", comments); Iterable<Payment> payments = paymentRepository.findByRecipient(campaign); model.addAttribute("payments", payments); return "viewCampaign"; } }
[ "evge_nik@tut.by" ]
evge_nik@tut.by
28c40a790f689cfe4e52e7e79b81f05fd320e4d7
b8a28882163403f53ca359b36f56ca63df58b613
/WhereAmI-Android-OBDII-Connector/src-obd-java-api/com/github/pires/obd/commands/protocol/AvailablePidsCommand_01_20.java
279136f11494f8d58d7c1205515c2d92b5cb1b0a
[]
no_license
pranavams/WhereAmI
b27f1261d12945b541dba4a8193b2e470451d66e
a2fe384e22028ee0c02515835f38fcb9059c1843
refs/heads/master
2020-12-25T11:06:15.128440
2016-06-24T05:41:18
2016-06-24T05:41:18
60,752,183
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package com.github.pires.obd.commands.protocol; import com.github.pires.obd.enums.AvailableCommandNames; /** * Retrieve available PIDs ranging from 01 to 20. * * @author pires * @version $Id: $Id */ public class AvailablePidsCommand_01_20 extends AvailablePidsCommand { /** * Default ctor. */ public AvailablePidsCommand_01_20() { super("01 00"); } /** * Copy ctor. * * @param other * a * {@link com.github.pires.obd.commands.protocol.AvailablePidsCommand} * object. */ public AvailablePidsCommand_01_20(AvailablePidsCommand_01_20 other) { super(other); } /** {@inheritDoc} */ @Override public String getName() { return AvailableCommandNames.PIDS_01_20.getValue(); } }
[ "spranava@ford.com" ]
spranava@ford.com
8a8ac36bc63d2d2545c8bfa1c0cc4d6a94e58f99
fb702ed10ffe2e32f9cadcd6e9a3696a4d632946
/src/com/kstenschke/shifter/models/ShiftableSelection.java
c14e17ba8428339e7eb6ba525fa305bc48519406
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
jigargosar/shifter-plugin
156dab553e034a25736062a429a7b37070237dee
0188f6e1779e2e30924bf538c10222c8cea5deff
refs/heads/master
2021-01-15T18:26:36.306821
2017-07-09T09:33:19
2017-07-09T09:33:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,367
java
/* * Copyright 2011-2017 Kay Stenschke * * 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.kstenschke.shifter.models; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.SelectionModel; import com.intellij.openapi.project.Project; import com.kstenschke.shifter.models.shiftableTypes.*; import com.kstenschke.shifter.resources.StaticTexts; import com.kstenschke.shifter.utils.UtilsEnvironment; import com.kstenschke.shifter.utils.UtilsFile; import com.kstenschke.shifter.utils.UtilsTextual; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.util.List; import static com.kstenschke.shifter.models.ShiftableTypes.Type.*; // Shiftable (non-block) selection public class ShiftableSelection { /** * @param editor * @param caretOffset * @param isUp Are we shifting up or down? * @param moreCount Current "more" count, starting w/ 1. If non-more shift: null */ public static void shiftSelectionInDocument(Editor editor, Integer caretOffset, boolean isUp, @Nullable Integer moreCount) { Document document = editor.getDocument(); String filename = UtilsEnvironment.getDocumentFilename(document); Project project = editor.getProject(); SelectionModel selectionModel = editor.getSelectionModel(); int offsetStart = selectionModel.getSelectionStart(); int offsetEnd = selectionModel.getSelectionEnd(); CharSequence editorText = document.getCharsSequence(); String selectedText = UtilsTextual.getSubString(editorText, offsetStart, offsetEnd); if (selectedText == null || selectedText.trim().isEmpty()) { return; } boolean isPhpFile = UtilsFile.isPhpFile(filename); if (isPhpFile && PhpDocParam.shiftSelectedPhpDocInDocument(editor, document, project, offsetStart, offsetEnd, selectedText)) { // Detect and shift whole PHP DOC block or single line out of it, that contains @param line(s) w/o data type return; } if (filename.endsWith(".js") && JsDoc.isJsDocBlock(selectedText) && JsDoc.correctDocBlockInDocument(editor, document, offsetStart, offsetEnd)) { return; } // Shift selected comment: Must be before multi-line sort to allow multi-line comment shifting if (com.kstenschke.shifter.models.shiftableTypes.Comment.isComment(selectedText) && shiftSelectedCommentInDocument(editor, document, filename, project, offsetStart, offsetEnd, selectedText)) { return; } boolean isWrappedInParenthesis = Parenthesis.isWrappedInParenthesis(selectedText); ShiftableTypesManager shiftingShiftableTypesManager = new ShiftableTypesManager(); ShiftableTypes.Type wordType = shiftingShiftableTypesManager.getWordType(selectedText, editorText, offsetStart, filename); boolean isPhpVariableOrArray = wordType == PHP_VARIABLE_OR_ARRAY; if (isWrappedInParenthesis) { boolean isShiftablePhpArray = isPhpVariableOrArray && PhpVariableOrArray.isStaticShiftablePhpArray(selectedText); if (!isPhpVariableOrArray || !isShiftablePhpArray) { // Swap surrounding "(" and ")" versus "[" and "]" document.replaceString(offsetStart, offsetEnd, Parenthesis.getShifted(selectedText)); return; } // Swap parenthesis or convert PHP array new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).swapParenthesisOrConvertPphpArray(); return; } boolean isJsVarsDeclarations = !isPhpVariableOrArray && wordType == JS_VARIABLES_DECLARATIONS; boolean containsShiftableQuotes = QuotedString.containsShiftableQuotes(selectedText); boolean isMultiLine = UtilsTextual.isMultiLine(selectedText); if (UtilsFile.isCssFile(filename) && isMultiLine) { // CSS: Sort attributes per selector alphabetically String shifted = Css.getShifted(selectedText); if (null != shifted) { document.replaceString(offsetStart, offsetEnd, shifted); UtilsEnvironment.reformatSubString(editor, project, offsetStart, offsetStart + shifted.length()); return; } } int lineNumberSelStart = document.getLineNumber(offsetStart); int lineNumberSelEnd = document.getLineNumber(offsetEnd); if (document.getLineStartOffset(lineNumberSelEnd) == offsetEnd) { lineNumberSelEnd--; } if (com.kstenschke.shifter.models.shiftableTypes.TernaryExpression.isTernaryExpression(selectedText, "")) { document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.TernaryExpression.getShifted(selectedText)); UtilsEnvironment.reformatSelection(editor, project); return; } if (!isJsVarsDeclarations && ((lineNumberSelEnd - lineNumberSelStart) > 0 && !isPhpVariableOrArray)) { // Multi-line selection: sort lines or swap quotes new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).sortLinesOrSwapQuotesInDocument(isUp); return; } if (isJsVarsDeclarations) { document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.JsVariablesDeclarations.getShifted(selectedText)); return; } if (!isPhpVariableOrArray && wordType == SIZZLE_SELECTOR) { document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.SizzleSelector.getShifted(selectedText)); return; } if (wordType == TRAILING_COMMENT) { int offsetStartCaretLine = document.getLineStartOffset(lineNumberSelStart); int offsetEndCaretLine = document.getLineEndOffset(lineNumberSelStart); String leadWhitespace = UtilsTextual.getLeadWhitespace(editorText.subSequence(offsetStartCaretLine, offsetEndCaretLine).toString()); String caretLine = editorText.subSequence(offsetStartCaretLine, offsetEndCaretLine).toString(); document.replaceString(offsetStartCaretLine, offsetEndCaretLine, com.kstenschke.shifter.models.shiftableTypes.TrailingComment.getShifted(caretLine, leadWhitespace)); return; } if (!isPhpVariableOrArray && isPhpFile && shiftSelectionInPhpDocument(document, filename, project, offsetStart, offsetEnd, selectedText, containsShiftableQuotes, isUp)) { return; } if (!isPhpVariableOrArray) { if (com.kstenschke.shifter.models.shiftableTypes.SeparatedList.isSeparatedList(selectedText,",")) { // Comma-separated list: sort / ask whether to sort or toggle quotes new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).sortListOrSwapQuotesInDocument(",(\\s)*", ", ", isUp); return; } if (com.kstenschke.shifter.models.shiftableTypes.SeparatedList.isSeparatedList(selectedText,"|")) { // Pipe-separated list new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).sortListOrSwapQuotesInDocument("\\|(\\s)*", "|", isUp); return; } if (containsShiftableQuotes) { document.replaceString(offsetStart, offsetEnd, UtilsTextual.swapQuotes(selectedText)); return; } if (CamelCaseString.isCamelCase(selectedText) && CamelCaseString.isWordPair(selectedText)) { new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).shiftCamelCaseOrSwapWords(); return; } if (MinusSeparatedPath.isMinusSeparatedPath(selectedText) && MinusSeparatedPath.isWordPair(selectedText)) { new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).shiftMinusSeparatedPathOrSwapWords(); return; } com.kstenschke.shifter.models.shiftableTypes.Tupel wordsTupel = new com.kstenschke.shifter.models.shiftableTypes.Tupel(); if (wordsTupel.isWordsTupel(selectedText)) { document.replaceString(offsetStart, offsetEnd, wordsTupel.getShifted(selectedText)); return; } if (UtilsTextual.containsSlashes(selectedText)) { document.replaceString(offsetStart, offsetEnd, UtilsTextual.swapSlashes(selectedText)); return; } if (com.kstenschke.shifter.models.shiftableTypes.LogicalOperator.isLogicalOperator(selectedText)) { document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.LogicalOperator.getShifted(selectedText)); return; } if (HtmlEncodable.isHtmlEncodable(selectedText)) { document.replaceString(offsetStart, offsetEnd, HtmlEncodable.getShifted(selectedText)); return; } } String shiftedWord = shiftingShiftableTypesManager.getShiftedWord(selectedText, isUp, editorText, caretOffset, moreCount, filename, editor); if (isPhpVariableOrArray) { document.replaceString(offsetStart, offsetEnd, shiftedWord); return; } if (UtilsTextual.isAllUppercase(selectedText)) { document.replaceString(offsetStart, offsetEnd, shiftedWord.toUpperCase()); return; } if (UtilsTextual.isUpperCamelCase(selectedText) || UtilsTextual.isUcFirst(selectedText)) { document.replaceString(offsetStart, offsetEnd, UtilsTextual.toUcFirst(shiftedWord)); return; } document.replaceString(offsetStart, offsetEnd, shiftedWord); } private static boolean shiftSelectionInPhpDocument(Document document, String filename, Project project, int offsetStart, int offsetEnd, String selectedText, boolean containsQuotes, boolean isUp) { com.kstenschke.shifter.models.shiftableTypes.PhpConcatenation phpConcatenation = new com.kstenschke.shifter.models.shiftableTypes.PhpConcatenation(selectedText); if (phpConcatenation.isPhpConcatenation()) { new ShiftableSelectionWithPopup(project, document, offsetStart, offsetEnd).shiftPhpConcatenationOrSwapQuotesInDocument(phpConcatenation, isUp); return true; } if (com.kstenschke.shifter.models.shiftableTypes.Comment.isHtmlComment(selectedText)) { document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.Comment.getPhpBlockCommentFromHtmlComment(selectedText)); return true; } if (com.kstenschke.shifter.models.shiftableTypes.Comment.isPhpBlockComment(selectedText)) { document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.Comment.getShifted(selectedText, filename, project)); return true; } return false; } private static boolean shiftSelectedCommentInDocument(Editor editor, Document document, String filename, Project project, int offsetStart, int offsetEnd, String selectedText) { if (UtilsTextual.isMultiLine(selectedText)) { if (filename.endsWith("js") && com.kstenschke.shifter.models.shiftableTypes.JsDoc.isJsDocBlock(selectedText) && com.kstenschke.shifter.models.shiftableTypes.JsDoc.correctDocBlockInDocument(editor, document, offsetStart, offsetEnd)) { return true; } if (com.kstenschke.shifter.models.shiftableTypes.Comment.isBlockComment(selectedText)) { com.kstenschke.shifter.models.shiftableTypes.Comment.shiftMultiLineBlockCommentInDocument(selectedText, project, document, offsetStart, offsetEnd); return true; } if (com.kstenschke.shifter.models.shiftableTypes.Comment.isMultipleSingleLineComments(selectedText)) { com.kstenschke.shifter.models.shiftableTypes.Comment.shiftMultipleSingleLineCommentsInDocument(selectedText, project, document, offsetStart, offsetEnd); return true; } } document.replaceString(offsetStart, offsetEnd, com.kstenschke.shifter.models.shiftableTypes.Comment.getShifted(selectedText, filename, project)); return true; } /** * Sort lines in document alphabetically ascending / descending * * @param reverse * @param lineNumberSelStart * @param lineNumberSelEnd */ static void sortLinesInDocument(Document document, boolean reverse, int lineNumberSelStart, int lineNumberSelEnd) { List<String> lines = UtilsTextual.extractLines(document, lineNumberSelStart, lineNumberSelEnd); List<String> linesSorted = UtilsTextual.sortLinesNatural(lines, reverse); String linesString = UtilsTextual.joinLines(linesSorted).toString(); if (UtilsTextual.hasDuplicateLines(linesString) && JOptionPane.showConfirmDialog( null, StaticTexts.MESSAGE_REDUCE_DUPLICATE_LINES, StaticTexts.TITLE_REDUCE_DUPLICATE_LINES, JOptionPane.OK_CANCEL_OPTION ) == JOptionPane.OK_OPTION) { linesString = UtilsTextual.reduceDuplicateLines(linesString); } int offsetLineStart = document.getLineStartOffset(lineNumberSelStart); int offsetLineEnd = document.getLineEndOffset(lineNumberSelEnd) + document.getLineSeparatorLength(lineNumberSelEnd); document.replaceString(offsetLineStart, offsetLineEnd, linesString); } }
[ "info@stenschke.com" ]
info@stenschke.com
e6704a3ec131d1e2fe8b36203d4a422d0da0766b
b1de93838b6dcf42de10f849aed5e515a4a785aa
/app/src/main/java/com/prgguru/example/Main2Activity.java
bf8c10ce3b04ebf51a75d8f69ee1120578a13472
[]
no_license
olaoghaa/Photo2Navigate
bbaf87f96ec5c2d7c9c60ee7aa4f788d5d094f67
86250e357fb301183941eae6c5938477cbe5cab2
refs/heads/master
2021-01-22T07:27:22.719131
2017-03-27T16:57:19
2017-03-27T16:57:19
81,816,861
1
0
null
null
null
null
UTF-8
Java
false
false
5,347
java
package com.prgguru.example; import android.app.Activity; import android.media.Image; import android.support.v4.app.FragmentActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.database.Cursor; import android.graphics.BitmapFactory; import android.location.Location; import android.media.ExifInterface; import android.net.Uri; import android.provider.MediaStore; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; public class Main2Activity extends AppCompatActivity{ private static int RESULT_LOAD_IMG = 1; String imgDecodableString; TextView Exif; TextView txtSDK; ArrayList<Location> chosen= new ArrayList<Location>(); boolean clicked=false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); // ((Application) this.getApplication()).setGPSmulti(chosen); } @Override protected void onActivityResult ( int requestCode, int resultCode, Intent data){ super.onActivityResult(requestCode, resultCode, data); try { // When an Image is picked if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK && null != data) { // Get the Image from data String realPath; //realPath = RealPathUtil.getRealPathFromURI_API11to18(this, data.getData()); Uri selectedImage = data.getData(); String s = getRealPathFromURI(selectedImage); String[] filePathColumn = {MediaStore.Images.Media.DATA}; Location c = readGeoTagImage(s); if (c.getLongitude() != 0) { chosen.add(c); // Get the cursor Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null); // Move to first row cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); System.out.print(" path " + filePathColumn[0]); // System.out.println("Date: " + exif.get(0x0132)); //0x9003 imgDecodableString = cursor.getString(columnIndex); cursor.close(); ImageView imgView = (ImageView) findViewById(R.id.imgView2); // Set the Image in ImageView after decoding the String imgView.setImageBitmap(BitmapFactory .decodeFile(imgDecodableString)); Toast.makeText(this, "Image Added"+c, Toast.LENGTH_LONG).show(); } else { Toast.makeText(this, "CHOOSE AN IMAGE WITH GEOTAGS", Toast.LENGTH_LONG).show(); } } else { Toast.makeText(this, "You haven't picked Image", Toast.LENGTH_LONG).show(); } } catch (Exception e) { Toast.makeText(this, "Something went wrong", Toast.LENGTH_LONG) .show(); } } public void stopSelection(View view){ clicked=true; ((Application) this.getApplication()).setGPSmulti(chosen); Intent intent = new Intent(this, MultiMapActivity.class); startActivity(intent); } public void startSelection(View view){ // Create intent to Open Image applications like Gallery, Google Photos Intent galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); // Start the Intent startActivityForResult(galleryIntent, RESULT_LOAD_IMG); } public String getRealPathFromURI(Uri uri) { String[] projection = { MediaStore.Images.Media.DATA }; @SuppressWarnings("deprecation") Cursor cursor = managedQuery(uri, projection, null, null, null); int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } public Location readGeoTagImage(String imagePath) { Location loc = new Location(""); try { ExifInterface exif = new ExifInterface(imagePath); float [] latlong = new float[2] ; if(exif.getLatLong(latlong)){ loc.setLatitude(latlong[0]); loc.setLongitude(latlong[1]); } String date = exif.getAttribute(ExifInterface.TAG_DATETIME); SimpleDateFormat fmt_Exif = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss"); loc.setTime(fmt_Exif.parse(date).getTime()); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } return loc; } }
[ "olaoghaa@tcd.ie" ]
olaoghaa@tcd.ie
ea6de1ec74110e4b3eb3eb18d417e49974ba66b4
3f81ef26c086f51b3554f3ec8cb55157eea9a375
/Whatsapp/src/model/Mensagem.java
b5cc995f15290f5e83024caab21b2f1ea0353a6f
[]
no_license
DanielHumberto/poo-Whatsapp
5e1afc5d1037cbd9b7b2aabf76d70e4e958c6adb
4fc422728ba288f345fad9fd4f8c7b176f3d6835
refs/heads/master
2020-04-05T13:49:47.600454
2018-11-09T19:58:11
2018-11-09T19:58:11
156,911,483
0
0
null
null
null
null
UTF-8
Java
false
false
1,612
java
package model; import java.util.ArrayList; public class Mensagem { private int id; private String user; private String chat; private String msg; public Mensagem(int id, String user, String chat, String msg) { this.id = id; this.user = user; this.chat = chat; this.msg = msg; } public static boolean newMsg(String nome, String nomeChat, ArrayList<Chat> chats) { for(Chat i : chats) { if(i.getNomeChat().equals(nomeChat) && i.getNomeUsuarios().equals(nome)) { return true; } } return false; } /*public static boolean lerMsg(String nome, String nomeChat, ArrayList<Mensagem> msgs, ArrayList<Mensagem> msgsLidas) { ArrayList<Mensagem> msgNaoLidas = new ArrayList<Mensagem>(); for(Mensagem i : msgs) { if(msgsLidas.get(i.getId())== null && i.getChat().equals(nomeChat) && !(i.getUser().equals(nome))) { msgNaoLidas.add(new Mensagem(i.getId(), i.getUser(), i.getChat(), i.getMsg())); msgsLidas.add(new Mensagem(i.getId(), i.getUser(), i.getChat(), i.getMsg())); Principal. return true; } } return false; }*/ public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getChat() { return chat; } public void setChat(String chat) { this.chat = chat; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } @Override public String toString() { return "Mensagem [user=" + user + ", chat=" + chat + ", msg=" + msg + "]"; } }
[ "noreply@github.com" ]
noreply@github.com
6d379cc9e9124e7dfd64e3b03a962fd59b454e62
4414842a2206b67353b0830ac066ca2b5b808c75
/seckill-cache/src/main/java/com/seckill/cache/redisconf/RedisConfig.java
a074239fb21b89e766b91288fb775d8d185c4d32
[]
no_license
yoome/seckill
78e5d88c8582f213dd903b39608cc02b533651fc
485b86d02af9c645f097dbfb69ae6529e825171c
refs/heads/master
2020-07-06T13:04:47.701652
2019-08-18T16:27:14
2019-08-18T16:27:49
203,026,688
0
0
null
null
null
null
UTF-8
Java
false
false
1,307
java
package com.seckill.cache.redisconf; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component @ConfigurationProperties(prefix = "redis") public class RedisConfig { private String host; private int port; private int timeout; private int poolMaxTotal; private int poolMaxIdle; private int poolMaxWait; public String getHost() { return host; } public void setHost(String host) { this.host = host; } public int getPort() { return port; } public void setPort(int port) { this.port = port; } public int getTimeout() { return timeout; } public void setTimeout(int timeout) { this.timeout = timeout; } public int getPoolMaxTotal() { return poolMaxTotal; } public void setPoolMaxTotal(int poolMaxTotal) { this.poolMaxTotal = poolMaxTotal; } public int getPoolMaxIdle() { return poolMaxIdle; } public void setPoolMaxIdle(int poolMaxIdle) { this.poolMaxIdle = poolMaxIdle; } public int getPoolMaxWait() { return poolMaxWait; } public void setPoolMaxWait(int poolMaxWait) { this.poolMaxWait = poolMaxWait; } }
[ "dxu2007@163.com" ]
dxu2007@163.com
100c9a7c59b4305cc8acd2350665d532008eb638
169e5ff21e0dd4d275e893f86276ff38a492b38f
/src/main/java/com/f0rgiv/lethani/services/CharacterClassService.java
c5c0cfc679fd3be2c34a1ad5dd3a2aa1b4a29658
[]
no_license
team-deinonychus/Lethani
f2d639ba0512abaf05fbeb59d3800fa1e5a638eb
cfdaf02b3f0d5d9358ac90dfbbe5fe6dcda6c44f
refs/heads/dev
2023-05-07T09:02:02.653623
2021-05-28T19:23:08
2021-05-28T19:23:08
368,697,329
2
0
null
2021-05-29T03:10:34
2021-05-19T00:07:29
Java
UTF-8
Java
false
false
1,528
java
package com.f0rgiv.lethani.services; import com.f0rgiv.lethani.models.CharacterClass; import com.f0rgiv.lethani.repositories.CharacterClassRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class CharacterClassService { @Autowired CharacterClassRepository characterClassRepository; public List<CharacterClass> getAll() { List<CharacterClass> classes = characterClassRepository.findAll(); //if classes don't exist in db create them and then return them. if (classes.size() == 0) { classes.add(new CharacterClass("Warrior", 2, .75, 2)); classes.add(new CharacterClass("Wizard", 1, 1.25, 1)); classes.add(new CharacterClass("Assassin", 1.25, 2, 1)); classes.forEach(cc -> characterClassRepository.save(cc)); } return classes; } public CharacterClass findByName(String className) { CharacterClass result = characterClassRepository.findByName(className); if (result == null){ getAll(); result = characterClassRepository.findByName(className); } return result; } public CharacterClass getDefaultClass(){ CharacterClass result = characterClassRepository.findByName("Warrior"); if (result == null){ getAll(); result = characterClassRepository.findByName("Warrior"); } return result; } }
[ "jamestmansour@outlook.com" ]
jamestmansour@outlook.com
01163553def3359336a6544ebf6304d9ca6dd448
dfac561de273ec193289532cdbb9db7733fcffaa
/src/main/java/com/jeecms/bbs/manager/impl/BbsTopicTypeSubscribeMngImpl.java
e401733865213c7941e2d4885db2f9ab90ab1097
[]
no_license
foxandyhu/bbs
faa5b3762f68d36d6acc001df14e8275910e4859
d0b7033a9c181a243e511ce72b2df9c2c680e7a3
refs/heads/master
2020-04-05T02:44:15.445124
2018-11-13T10:02:53
2018-11-13T10:02:53
156,488,319
1
0
null
null
null
null
UTF-8
Java
false
false
3,148
java
package com.jeecms.bbs.manager.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.jeecms.common.hibernate4.Updater; import com.jeecms.common.page.Pagination; import com.jeecms.bbs.dao.BbsTopicTypeSubscribeDao; import com.jeecms.bbs.entity.BbsTopicType; import com.jeecms.bbs.entity.BbsTopicTypeSubscribe; import com.jeecms.bbs.entity.BbsUser; import com.jeecms.bbs.manager.BbsTopicTypeMng; import com.jeecms.bbs.manager.BbsTopicTypeSubscribeMng; import com.jeecms.bbs.manager.BbsUserMng; @Service @Transactional public class BbsTopicTypeSubscribeMngImpl implements BbsTopicTypeSubscribeMng { @Transactional(readOnly = true) public Pagination getPage(Integer userId,int pageNo, int pageSize) { Pagination page = dao.getPage(userId,pageNo, pageSize); return page; } @Transactional(readOnly = true) public BbsTopicTypeSubscribe findById(Integer id) { BbsTopicTypeSubscribe entity = dao.findById(id); return entity; } @Transactional(readOnly = true) public BbsTopicTypeSubscribe find(Integer typeId,Integer userId) { BbsTopicTypeSubscribe entity = dao.find(typeId,userId); return entity; } @Transactional(readOnly = true) public List<BbsTopicTypeSubscribe> getList(Integer typeId,Integer userId){ return dao.getList(typeId, userId); } public BbsTopicTypeSubscribe subscribe(Integer typeId,Integer userId,Integer operate){ BbsTopicType type=bbsTopicTypeMng.findById(typeId); BbsUser user=bbsUserMng.findById(userId); BbsTopicTypeSubscribe sub=find(typeId, userId); if(sub==null){ //订阅 if(operate.equals(BbsTopicTypeSubscribe.SUBSCRIBE_OK)){ sub=new BbsTopicTypeSubscribe(); type.setSubscribeCount(type.getSubscribeCount()+1); sub.setType(type); sub.setUser(user); sub=save(sub); } }else{ //取消订阅 if(operate.equals(BbsTopicTypeSubscribe.SUBSCRIBE_CANCEL)){ if (type.getSubscribeCount().equals(0)) { type.setSubscribeCount(0); }else{ type.setSubscribeCount(type.getSubscribeCount()-1); } deleteById(sub.getId()); } } return sub; } public BbsTopicTypeSubscribe save(BbsTopicTypeSubscribe bean) { dao.save(bean); return bean; } public BbsTopicTypeSubscribe update(BbsTopicTypeSubscribe bean) { Updater<BbsTopicTypeSubscribe> updater = new Updater<BbsTopicTypeSubscribe>(bean); BbsTopicTypeSubscribe entity = dao.updateByUpdater(updater); return entity; } public BbsTopicTypeSubscribe deleteById(Integer id) { BbsTopicTypeSubscribe bean = dao.deleteById(id); return bean; } public BbsTopicTypeSubscribe[] deleteByIds(Integer[] ids) { BbsTopicTypeSubscribe[] beans = new BbsTopicTypeSubscribe[ids.length]; for (int i = 0,len = ids.length; i < len; i++) { beans[i] = deleteById(ids[i]); } return beans; } private BbsTopicTypeSubscribeDao dao; @Autowired private BbsTopicTypeMng bbsTopicTypeMng; @Autowired private BbsUserMng bbsUserMng; @Autowired public void setDao(BbsTopicTypeSubscribeDao dao) { this.dao = dao; } }
[ "andy_hulibo@163.com" ]
andy_hulibo@163.com
cecc2c0c3bf83c41433fefcbd9804dc5fb6c95b9
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE113_HTTP_Response_Splitting/s02/CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_45.java
04a5485d1f84efcaa282228d2a3af99afa1348d1
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
3,734
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_45.java Label Definition File: CWE113_HTTP_Response_Splitting.label.xml Template File: sources-sinks-45.tmpl.java */ /* * @description * CWE: 113 HTTP Response Splitting * BadSource: Property Read data from a system property * GoodSource: A hardcoded string * Sinks: addHeaderServlet * GoodSink: URLEncode input * BadSink : querystring to addHeader() * Flow Variant: 45 Data flow: data passed as a private class member variable from one function to another in the same class * * */ package testcases.CWE113_HTTP_Response_Splitting.s02; import testcasesupport.*; import javax.servlet.http.*; import java.net.URLEncoder; public class CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_45 extends AbstractTestCaseServlet { private String dataBad; private String dataGoodG2B; private String dataGoodB2G; private void badSink(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = dataBad; /* POTENTIAL FLAW: Input from file not verified */ if (data != null) { response.addHeader("Location", "/author.jsp?lang=" + data); } } public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; /* get system property user.home */ /* POTENTIAL FLAW: Read data from a system property */ data = System.getProperty("user.home"); dataBad = data; badSink(request, response); } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); goodB2G(request, response); } private void goodG2BSink(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = dataGoodG2B; /* POTENTIAL FLAW: Input from file not verified */ if (data != null) { response.addHeader("Location", "/author.jsp?lang=" + data); } } /* goodG2B() - use goodsource and badsink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; /* FIX: Use a hardcoded string */ data = "foo"; dataGoodG2B = data; goodG2BSink(request, response); } private void goodB2GSink(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = dataGoodB2G; /* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */ if (data != null) { data = URLEncoder.encode(data, "UTF-8"); response.addHeader("Location", "/author.jsp?lang=" + data); } } /* goodB2G() - use badsource and goodsink */ private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; /* get system property user.home */ /* POTENTIAL FLAW: Read data from a system property */ data = System.getProperty("user.home"); dataGoodB2G = data; goodB2GSink(request, response); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
deb0170b17acc7913c6a50de62fff7054057fa9e
f1c094689b29d71921d68eade3839c135f196bba
/src/main/java/thread/DaemonDemo.java
bfba449fb473042cf7ca5f15b3ad0f9d25bb32b0
[]
no_license
xiadx/learning-java
142edcabf68570108db6da810429a868a03f7269
5abe5077dc6a2bdaf712137f5e6c9aacebf938e9
refs/heads/main
2023-05-29T16:38:22.246504
2021-06-19T15:01:00
2021-06-19T15:01:00
348,791,566
0
0
null
null
null
null
UTF-8
Java
false
false
910
java
package thread; public class DaemonDemo { public static void main(String[] args) { Thread t1 = new Thread(new God()); Thread t2 = new Thread(new Me()); t1.setDaemon(true); t1.start(); t2.start(); } } class God implements Runnable { @Override public void run() { for (int i = 0; i < 100; i++) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("god --> " + i); } } } class Me implements Runnable { @Override public void run() { for (int i = 0; i < 10; i++) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("me --> " + i); } } }
[ "xdx@xdxdeAir.lan" ]
xdx@xdxdeAir.lan
3f8ea5e5f9c5a13863fc65dcfae5cf1b6a03549f
795ad8addc4af618b78375d9e0ea5c30fbe94466
/src/main/java/com/gongjun/yuechi/core/utils/Counter.java
0727a3c8ed2c50a0e53e70e62b34f83e1625c8ff
[]
no_license
gongaustin/yuechi
6f843acf9dd466ad5737de4fdd2a3281dcb3f618
462fa4c00df493be20571317129799851b360167
refs/heads/master
2022-09-27T16:37:59.650594
2019-10-24T02:15:30
2019-10-24T02:15:30
204,603,604
0
0
null
2022-09-08T01:02:42
2019-08-27T02:34:08
Java
UTF-8
Java
false
false
1,720
java
package com.gongjun.yuechi.core.utils; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; /** * <p>Title: 计数器类</p> * <p>Description: 获取最大序列数</p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * * @author advance.wu * @version 1.0 * <p> * sql: * <p> * CREATE TABLE `tblserial` ( * `tablename` varchar(100) NOT NULL default '', * `serialno` int(11) NOT NULL default '0', * PRIMARY KEY (`tablename`) * ) */ public class Counter { private static Counter counter = new Counter(); private Counter() { } public static Counter getInstance() { return counter; } /** * 获取最大序列号 * * @param strTable 表名 * @param con 数据库链接 * @return */ public synchronized long nextSerial(String strTable, Connection con) { String strSQL = null; long serialno = 0; Statement stmt = null; try { strSQL = "select serialno from tblserial where tablename='" + strTable + "'"; stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(strSQL); if (rs.next()) serialno = rs.getLong(1); strSQL = "update tblserial set serialno = serialno + 1 where tablename='" + strTable + "'"; stmt.execute(strSQL); rs.close(); rs = null; serialno++; } catch (Exception ex) { } finally { if (stmt != null) try { stmt.close(); stmt = null; } catch (Exception ex) { } } return serialno; } }
[ "28402674@qq.com" ]
28402674@qq.com
ac186afced2aa79ad661f9a37532e67dcb22dcf1
2fecff739152dddf79e20662a068ee8f58f87f96
/src/main/java/com/eduardotanaka/tecmicro/api/services/impl/PostServiceImpl.java
851c5f210f1fa274846fc74e4919df8e5e347277
[ "MIT" ]
permissive
Eduardo-Tanaka/tecmicro-api
3dcd21fad16dc40ee1515ea7221e65a2b8717011
4dea6e803930af10df27cb5091a19751f6b400ae
refs/heads/master
2020-03-23T02:26:28.214895
2018-07-15T22:06:26
2018-07-15T22:06:26
140,974,040
0
0
null
null
null
null
UTF-8
Java
false
false
1,588
java
package com.eduardotanaka.tecmicro.api.services.impl; import java.util.List; import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.eduardotanaka.tecmicro.api.entities.Post; import com.eduardotanaka.tecmicro.api.exceptions.ObjectNotFoundException; import com.eduardotanaka.tecmicro.api.repositories.PostRepository; import com.eduardotanaka.tecmicro.api.services.PostService; @Service public class PostServiceImpl implements PostService { private static final Logger log = LoggerFactory.getLogger(PostServiceImpl.class); @Autowired PostRepository postRepository; @Override public Post salvar(Post post) { log.info("Salvando post: {}", post); return this.postRepository.save(post); } @Override public Post buscarPorId(Long id) { log.info("Buscando pelo id: {}", id); Optional<Post> post = this.postRepository.findById(id); return post.orElseThrow(() -> new ObjectNotFoundException("Objeto não encontrado. Id: " + id + ", Tipo: " + PostServiceImpl.class.getName())); } @Override public List<Post> buscarPorIdUsuario(Long id) { log.info("Buscando pelo id do usuário: {}", id); return this.postRepository.findByUsuarioId(id).orElseThrow(() -> new ObjectNotFoundException( "Usuário não encontrado. Id: " + id + ", Tipo: " + PostServiceImpl.class.getName())); } @Override public List<Post> buscarTodos() { log.info("Buscando todos os posts"); return this.postRepository.findAll(); } }
[ "eduardo.s.tanaka@gmail.com" ]
eduardo.s.tanaka@gmail.com
b6cf52ff0bc0d06a57e2cbc4fb1ebc2f228a869a
e62c3b93b38d2d7781d38ba1cdbabfea2c1cf7af
/bocbiiclient/src/main/java/com/boc/bocsoft/mobile/bii/bus/fund/model/PsnScheduledFundUnavailableQuery/PsnScheduledFundUnavailableQueryResponse.java
d1acf28488b71c8e31c977bc0e7db09f530e7754
[]
no_license
soghao/zgyh
df34779708a8d6088b869d0efc6fe1c84e53b7b1
09994dda29f44b6c1f7f5c7c0b12f956fc9a42c1
refs/heads/master
2021-06-19T07:36:53.910760
2017-06-23T14:23:10
2017-06-23T14:23:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.boc.bocsoft.mobile.bii.bus.fund.model.PsnScheduledFundUnavailableQuery; import com.boc.bocsoft.mobile.bii.common.model.BIIResponse; import java.util.List; /** * Created by huixiaobo on 2016/11/18. * 058失效定期定额查询—返回参数处理 */ public class PsnScheduledFundUnavailableQueryResponse extends BIIResponse<PsnScheduledFundUnavailableQueryResult>{ }
[ "15609143618@163.com" ]
15609143618@163.com
39a70fbb9476c642c456cdf17ae9cb19996e9dd8
24643916cd1515911b7837ce81ebd17b0890cc81
/packages/apps/Media3D/src/com/mediatek/media3d/Media3D.java
5b46562ff0da25d5c7be0967fc6b80f4fd2c9172
[ "Apache-2.0" ]
permissive
touxiong88/92_mediatek
3a0d61109deb2fa77f79ecb790d0d3fdd693e5fd
5e96a7bb778fd9d9b335825584664e0c8b5ff2c7
refs/heads/master
2020-05-02T10:20:49.365871
2019-04-25T09:12:56
2019-04-25T09:12:56
177,894,636
1
1
null
null
null
null
UTF-8
Java
false
false
2,627
java
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein is * confidential and proprietary to MediaTek Inc. and/or its licensors. Without * the prior written permission of MediaTek inc. and/or its licensors, any * reproduction, modification, use or disclosure of MediaTek Software, and * information contained herein, in whole or in part, shall be strictly * prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek * Software") have been modified by MediaTek Inc. All revisions are subject to * any receiver's applicable license agreements with MediaTek Inc. */ package com.mediatek.media3d; import android.app.Application; public final class Media3D extends Application { public static final boolean DEBUG = true; private static boolean sDemoMode = false; private Media3D() {} public static void setDemoMode(boolean demoMode) { sDemoMode = demoMode; } public static boolean isDemoMode() { return sDemoMode; } }
[ "sunhouzan@163.com" ]
sunhouzan@163.com
e450c112644c44d3cb3e776ae7270ea1a6199954
2541c6a2aa5a97b650f73d8750b75bc6392f4ca9
/app/src/main/java/com/game/rhythmshooter/LoadingActivity.java
6433ede62bd99c563929c24739d47eb01c4907ec
[]
no_license
mjjeori/RhythmShooter
0ac7d70ef39529799bfc21531fe1f1645fc9ecb5
8bc091456b1cdf5ca3dd95e2e96ec50d4bdc450a
refs/heads/master
2023-01-01T05:44:13.152562
2020-10-16T12:25:37
2020-10-16T12:25:37
303,381,806
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
package com.game.rhythmshooter; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.View; import androidx.appcompat.app.AppCompatActivity; public class LoadingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loading); doFullScreen(); Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { Intent intent = new Intent(getBaseContext(), MainActivity.class); startActivity(intent); finish(); } }, 2500); } private void doFullScreen() { View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_IMMERSIVE| View.SYSTEM_UI_FLAG_LAYOUT_STABLE| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_FULLSCREEN); } }
[ "djeong20@illinois.edu" ]
djeong20@illinois.edu
ba3880f87b9f9d2ec77a6da798346c7282051782
5c18506117f2e82298de329794e5522073777008
/src/Models/Position.java
4e17904770c34fb520062877099596589e676e25
[]
no_license
KseniaSadrina/Makaka
e4fcf9f8945c198a64d8bde43c6539ec93bb10b7
3c94da8fd21e3b0392db6f418577fcc32e9493dd
refs/heads/master
2020-03-23T18:37:50.395475
2018-07-21T17:45:37
2018-07-21T17:45:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package Models; //TODO : Consider of having interface for this class public class Position { // Variables private Integer row; private Integer col; // Setters and Getters public Integer getRow() { return row; } public void setRow(Integer row) { this.row = row; } public Integer getCol() { return col; } public void setCol(Integer col) { this.col = col; } // C-TOR public Position(Integer col, Integer row) { this.row = row; this.col = col; } }
[ "lvaknin@liveperson.com" ]
lvaknin@liveperson.com
934105cb438b6488a4dc5415108509d7fed327ed
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a007/A007304Test.java
f9838c329128180d3294cf6b9312c347b49ede5b
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a007; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A007304Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
79d758eaec8684bfecc19b5eb62a025efb76efee
dba87418d2286ce141d81deb947305a0eaf9824f
/sources/p052cz/msebera/android/httpclient/client/cache/HttpCacheEntrySerializer.java
5a27d14962434df1ebe866bd8fa1f37de97fcdf0
[]
no_license
Sluckson/copyOavct
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
refs/heads/main
2023-03-09T12:14:38.824373
2021-02-26T01:38:16
2021-02-26T01:38:16
341,292,450
0
1
null
null
null
null
UTF-8
Java
false
false
446
java
package p052cz.msebera.android.httpclient.client.cache; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /* renamed from: cz.msebera.android.httpclient.client.cache.HttpCacheEntrySerializer */ public interface HttpCacheEntrySerializer { HttpCacheEntry readFrom(InputStream inputStream) throws IOException; void writeTo(HttpCacheEntry httpCacheEntry, OutputStream outputStream) throws IOException; }
[ "lucksonsurprice94@gmail.com" ]
lucksonsurprice94@gmail.com
8d46a7cc29095188bd6e59b7be71eaf3242d7a59
19bf854b48faf54efbb66490d6fb24db19930481
/Item 3/Acme-Explorer/src/main/java/converters/StringToLocationConverter.java
f5586e09effcb3fe7250586e5834614bf32715d4
[]
no_license
AlejandroMonteseirin/DP-ACME-EXPLORER
ae914cd63e4c94d4631ab73e4d12e7f1a30f2ef9
5e0b1fef566cb6caf4a3c7290d3ec80c5eb7dc93
refs/heads/master
2021-04-15T16:59:51.524427
2018-05-04T12:30:49
2018-05-04T12:30:49
126,199,487
0
0
null
null
null
null
UTF-8
Java
false
false
838
java
package converters; import java.net.URLDecoder; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import domain.Location; @Component @Transactional public class StringToLocationConverter implements Converter<String, Location> { @Override public Location convert(final String text) { Location result; String parts[]; if(text==null){ result = null; } else{ try { parts = text.split("\\|"); result=new Location(); result.setName(URLDecoder.decode(parts[0],"UTF-8")); result.setCoordinates(URLDecoder.decode(parts[1],"UTF-8")); } catch (final Throwable oops) { throw new IllegalArgumentException(oops); } } return result; }}
[ "alexmonteseirin@gmail.com" ]
alexmonteseirin@gmail.com
a8df17ca84da672f7812e1cc5f6ca2c7418f369b
32d2d99378e3c6659cec8758a089b26ef0e20618
/src/main/java/com/github/ivanocortesini/log4j/elastic/client/ElasticClient.java
bce0c1b8bc98a45b5c8d9623142c88c2143f0999
[ "Apache-2.0" ]
permissive
kumarh1982/log4j-2-elastic
a9e2baf64cd50bc820ff7221d93c6f152cd95182
2676d881269abf1a016b651b463ca955673c2764
refs/heads/master
2022-11-12T05:41:35.486751
2019-10-03T13:55:55
2019-10-03T13:55:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,618
java
package com.github.ivanocortesini.log4j.elastic.client; import com.github.ivanocortesini.log4j.elastic.config.ElasticConfig; import org.apache.http.HttpHost; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.appender.AppenderLoggingException; import org.apache.logging.log4j.status.StatusLogger; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.admin.indices.get.GetIndexRequest; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClientBuilder; import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; import java.io.IOException; import java.util.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public final class ElasticClient { private static final Logger LOGGER = StatusLogger.getLogger(); private static final Map<String, ElasticClient> clientByLoggerName = new HashMap<>(); ElasticConfig config; RestHighLevelClient client; boolean bulkMode; BulkRequest bulkRequest; long bulkRequestCreationTime; ScheduledExecutorService bulkFlushTimeOutCheckerExecutor; //Life cycle and configuration public static ElasticClient getInstance(ElasticConfig config) throws IOException { ElasticClient client = clientByLoggerName.get(config.getAppenderName()); if (client==null) clientByLoggerName.put(config.getAppenderName(), client = new ElasticClient(config)); return client; } ElasticClient(ElasticConfig config) throws IOException { this.config = config; startup(); } void startup() throws IOException { try { shutdown(); } catch (Exception e) {} HttpHost[] hosts = config.getCluster().stream() .map(node -> new HttpHost(node.getHost(), node.getPort(), node.getProtocol())) .toArray(s -> new HttpHost[s] ); RestClientBuilder clienBuilder = RestClient.builder(hosts); basicAuthentication(clienBuilder); client = new RestHighLevelClient(clienBuilder); if (!client.indices().exists(new GetIndexRequest().indices(config.getIndexName()), RequestOptions.DEFAULT)) client.indices().create(new CreateIndexRequest(config.getIndexName()), RequestOptions.DEFAULT); } void basicAuthentication(RestClientBuilder builder) { if (config.getUserName()!=null && config.getUserName().trim().length()>0 && config.getPassword()!=null && config.getPassword().trim().length()>0) { final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("user", "password")); builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider)); } } void shutdown() throws IOException { try { if (bulkRequest!=null) sendBulkRequest(); stopBulkFlushTimeOutChecker(); } finally { if (client!=null) client.close(); } } //Store function implementations public void storeJsonDocument(String document, boolean closeBatch) throws IOException { storeDocument( new IndexRequest(config.getIndexName(), "doc", null).source(document, XContentType.JSON), closeBatch ); } public void storeMapDocument(Map<String, Object> document, boolean closeBatch) throws IOException { storeDocument( new IndexRequest(config.getIndexName(), "doc", null).source(document), closeBatch ); } public void storeXContentDocument(XContentBuilder document, boolean closeBatch) throws IOException { storeDocument( new IndexRequest(config.getIndexName(), "doc", null).source(document), closeBatch ); } synchronized void storeDocument(IndexRequest indexRequest, boolean closeBatch) throws IOException { if (bulkMode || closeBatch) { //Bulk if (bulkRequest == null) { if (!bulkMode) { bulkMode = true; if (config.getFlushTimeOut() > 0) startBulkFlushTimeOutChecker(); } bulkRequest = new BulkRequest(); bulkRequestCreationTime = System.currentTimeMillis(); } bulkRequest.add(indexRequest); if (closeBatch) sendBulkRequest(); } else //Single client.index(indexRequest, RequestOptions.DEFAULT); } private synchronized void sendBulkRequest() throws IOException { try { client.bulk(bulkRequest, RequestOptions.DEFAULT); } finally { bulkRequest = null; } } //Bulk buffer flush timeout management private void startBulkFlushTimeOutChecker() { bulkFlushTimeOutCheckerExecutor = Executors.newSingleThreadScheduledExecutor(); bulkFlushTimeOutCheckerExecutor.scheduleAtFixedRate( () -> { //Timeout check based on bulk request creation time. Check is scheduled every 5 seconds if (bulkRequest!=null && config.getFlushTimeOut()<(System.currentTimeMillis()-bulkRequestCreationTime)/1000) try { sendBulkRequest(); } catch (IOException e) { LOGGER.error("Error logging into Elasticsearch during a bulk request execution",e); if (!config.isIgnoreExceptions()) throw new AppenderLoggingException(e); } }, 5, 5, TimeUnit.SECONDS); } private void stopBulkFlushTimeOutChecker() { if (bulkFlushTimeOutCheckerExecutor!=null && !bulkFlushTimeOutCheckerExecutor.isShutdown()) bulkFlushTimeOutCheckerExecutor.shutdown(); } }
[ "ivano.cortesini@gmail.com" ]
ivano.cortesini@gmail.com
5d29b0994c59f98ca115378c40f3f4e6c4efaec8
ac6eb800fc0303e3d0aefc57eda66ee36131e9d9
/src/main/java/preprocess/Preprocess.java
0ed3f8c77627b14a5fe9870eaf0cec85f34de658
[]
no_license
Pavel-vesely/textoutliers
6645fdf957a5fb8cf50423545c0404863880a999
94ede9daef194e55def541bff2e1e86864bee1b2
refs/heads/master
2021-09-20T10:57:46.683237
2018-05-12T17:08:28
2018-05-12T17:08:28
114,266,234
0
0
null
null
null
null
UTF-8
Java
false
false
5,401
java
package preprocess; import org.datavec.api.util.ClassPathResource; import org.deeplearning4j.models.embeddings.loader.WordVectorSerializer; import org.deeplearning4j.models.word2vec.Word2Vec; import org.deeplearning4j.text.sentenceiterator.BasicLineIterator; import org.deeplearning4j.text.sentenceiterator.SentenceIterator; import org.deeplearning4j.text.tokenization.tokenizer.preprocessor.CommonPreprocessor; import org.deeplearning4j.text.tokenization.tokenizerfactory.DefaultTokenizerFactory; import org.deeplearning4j.text.tokenization.tokenizerfactory.TokenizerFactory; import org.omg.CORBA.CODESET_INCOMPATIBLE; import org.xml.sax.SAXException; import utils.Constants; import utils.W2vVectorOperations; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; public class Preprocess { public static void main(String[] args) throws IOException, SAXException, ParserConfigurationException { Word2Vec word2vec; long yourmilliseconds = System.currentTimeMillis(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); Date resultdate = new Date(yourmilliseconds); System.out.println("Loading Word2Vec. Time: " + sdf.format(resultdate)); File gModel = new File("GoogleNews-vectors-negative300.bin"); word2vec = WordVectorSerializer.readWord2VecModel(gModel); // // Gets Path to Text file // // Gets Path to Text file // String filePath = new File("resources\\raw_sentences.txt").getAbsolutePath(); // // // Strip white space before and after for each line // SentenceIterator iter = new BasicLineIterator(filePath); // // Split on white spaces in the line to get words // TokenizerFactory t = new DefaultTokenizerFactory(); // // /* // CommonPreprocessor will apply the following regex to each token: [\d\.:,"'\(\)\[\]|/?!;]+ // So, effectively all numbers, punctuation symbols and some special symbols are stripped off. // Additionally it forces lower case for all tokens. // */ // t.setTokenPreProcessor(new CommonPreprocessor()); // // word2vec = new Word2Vec.Builder() // .minWordFrequency(5) // .iterations(1) // .layerSize(300) // .seed(42) // .windowSize(5) // .iterate(iter) // .tokenizerFactory(t) // .build(); // // word2vec.fit(); yourmilliseconds = System.currentTimeMillis(); resultdate = new Date(yourmilliseconds); System.out.println("Finished Loading Word2Vec. Time: " + sdf.format(resultdate)); SAXParserFactory factory; InputStream xmlInput; SAXParser saxParser; W2vFirstReadSaxHandler w2vFirstReadSaxHandler; StanfordNLPSaxHandler stanfordNLPSaxHandler; int[] topIndexes = null; ArrayList<String> filePaths = new ArrayList<>(); Files.newDirectoryStream(Paths.get(".\\resources\\test3"), path -> path.toString().endsWith(".xml")) .forEach(path -> filePaths.add(path.toString())); String fileName; int i = 0; for (String myFilePath : filePaths) { fileName = myFilePath.substring(myFilePath.lastIndexOf("\\")); yourmilliseconds = System.currentTimeMillis(); resultdate = new Date(yourmilliseconds); if (myFilePath.contains("1")) { System.out.println("Preparing w2v choice for: " + fileName + ", Time: " + sdf.format(resultdate)); factory = SAXParserFactory.newInstance(); xmlInput = new FileInputStream(myFilePath); saxParser = factory.newSAXParser(); w2vFirstReadSaxHandler = new W2vFirstReadSaxHandler(word2vec); saxParser.parse(xmlInput, w2vFirstReadSaxHandler); topIndexes = W2vVectorOperations.getTopIndexes(w2vFirstReadSaxHandler.getSumW2vVector(), Constants.W2V_NUM_IN_SENTENCEBLOCK); } // int[] numbers = new int[300]; // for (int j = 0; j < 300; j++) { // numbers[j] = j; // } // topIndexes = numbers; yourmilliseconds = System.currentTimeMillis(); resultdate = new Date(yourmilliseconds); System.out.println("Parsing file: " + fileName + ", Time: " + sdf.format(resultdate)); factory = SAXParserFactory.newInstance(); xmlInput = new FileInputStream(myFilePath); saxParser = factory.newSAXParser(); stanfordNLPSaxHandler = new StanfordNLPSaxHandler(myFilePath, myFilePath + "-sblock.csv", word2vec, topIndexes); saxParser.parse(xmlInput, stanfordNLPSaxHandler); yourmilliseconds = System.currentTimeMillis(); resultdate = new Date(yourmilliseconds); System.out.println("Finished. Output file: " + fileName + "-sblock.csv , Time: " + sdf.format(resultdate)); } } }
[ "nuviael@gmail.com" ]
nuviael@gmail.com
0662402ea0bd58c1513553d543839886b8f05a29
15ad192b37a7ea005de3963572310c0f6f6ebc90
/atp-core/src/main/java/com/lsh/atp/core/model/system/SysUser.java
7882c4b6f000c6e7796566cdab8613b37b9b8709
[]
no_license
peterm10g/ok-atp
a93e10553363f0a5b1d1672547c779dbe794e19d
f805feb4e95e1cfa12f3d7c7a92e05feb6b4214f
refs/heads/master
2021-07-14T17:58:34.189201
2017-10-20T08:07:39
2017-10-20T08:07:39
107,648,275
0
0
null
null
null
null
UTF-8
Java
false
false
2,027
java
package com.lsh.atp.core.model.system; import java.util.Date; import java.util.List; public class SysUser { /** * 主键 */ private Integer id; /** * 登录名 */ private String loginName; /** * 密码 */ private String pazzword; /** * 用户名 */ private String userName; /** * 状态 */ private Integer isEffective; /** * 创建时间 */ private Date createdTime; /** * 更新时间 */ private Date updatedTime; /** * 所属角色 */ private List<SysUserRoleRelation> sysUserRoleRelationList; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getLoginName() { return loginName; } public void setLoginName(String loginName) { this.loginName = loginName; } public String getPazzword() { return pazzword; } public void setPazzword(String pazzword) { this.pazzword = pazzword; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public Integer getIsEffective() { return isEffective; } public void setIsEffective(Integer isEffective) { this.isEffective = isEffective; } public Date getCreatedTime() { return createdTime; } public void setCreatedTime(Date createdTime) { this.createdTime = createdTime; } public Date getUpdatedTime() { return updatedTime; } public void setUpdatedTime(Date updatedTime) { this.updatedTime = updatedTime; } public List<SysUserRoleRelation> getSysUserRoleRelationList() { return sysUserRoleRelationList; } public void setSysUserRoleRelationList(List<SysUserRoleRelation> sysUserRoleRelationList) { this.sysUserRoleRelationList = sysUserRoleRelationList; } }
[ "peter@peterdeMacBook-Pro.local" ]
peter@peterdeMacBook-Pro.local
d6eee253587329beca45fd98fef6c2d1aa27c30e
05b027c8395b3674c81fa11f67be5e33b97ed22c
/app/src/main/java/com/reeching/uoter/adapter/GroupAdapter.java
df7bd6524e7d9c9e2bd3d09baa1c75e2ac4ead06
[]
no_license
123xuan456/uoter
e9b5d05ad18ffb8e0d81c7d97fbfa88d94b42622
4826fb3c885ea8f490020a714467a6de6967dc45
refs/heads/master
2020-03-17T14:08:54.296216
2018-06-11T03:34:06
2018-06-11T03:34:06
133,660,501
0
0
null
null
null
null
UTF-8
Java
false
false
3,991
java
/** * Copyright (C) 2016 Hyphenate Inc. All rights reserved. * * 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.reeching.uoter.adapter; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import com.hyphenate.chat.EMGroup; import com.reeching.uoter.R; import java.util.List; public class GroupAdapter extends ArrayAdapter<EMGroup> { private LayoutInflater inflater; private String newGroup; private String addPublicGroup; public GroupAdapter(Context context, int res, List<EMGroup> groups) { super(context, res, groups); this.inflater = LayoutInflater.from(context); newGroup = context.getResources().getString(R.string.The_new_group_chat); addPublicGroup = context.getResources().getString(R.string.add_public_group_chat); } @Override public int getViewTypeCount() { return 4; } @Override public int getItemViewType(int position) { if (position == 0) { return 0; } else if (position == 1) { return 1; } else if (position == 2) { return 2; } else { return 3; } } @Override public View getView(int position, View convertView, ViewGroup parent) { if (getItemViewType(position) == 0) { if (convertView == null) { convertView = inflater.inflate(R.layout.em_search_bar_with_padding, parent, false); } final EditText query = (EditText) convertView.findViewById(R.id.query); final ImageButton clearSearch = (ImageButton) convertView.findViewById(R.id.search_clear); query.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { getFilter().filter(s); if (s.length() > 0) { clearSearch.setVisibility(View.VISIBLE); } else { clearSearch.setVisibility(View.INVISIBLE); } } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void afterTextChanged(Editable s) { } }); clearSearch.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { query.getText().clear(); } }); } else if (getItemViewType(position) == 1) { if (convertView == null) { convertView = inflater.inflate(R.layout.em_row_add_group, parent, false); } ((ImageView) convertView.findViewById(R.id.avatar)).setImageResource(R.drawable.em_create_group); ((TextView) convertView.findViewById(R.id.name)).setText(newGroup); } else if (getItemViewType(position) == 2) { if (convertView == null) { convertView = inflater.inflate(R.layout.em_row_add_group, parent, false); } ((ImageView) convertView.findViewById(R.id.avatar)).setImageResource(R.drawable.em_add_public_group); ((TextView) convertView.findViewById(R.id.name)).setText(addPublicGroup); ((TextView) convertView.findViewById(R.id.header)).setVisibility(View.VISIBLE); } else { if (convertView == null) { convertView = inflater.inflate(R.layout.em_row_group, parent, false); } ((TextView) convertView.findViewById(R.id.name)).setText(getItem(position - 3).getGroupName()); } return convertView; } @Override public int getCount() { return super.getCount() + 3; } }
[ "1044072796@qq.com" ]
1044072796@qq.com
edbd7ffbfc578ff83c47c52f8acf235eba8d74c5
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-481-29-9-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/velocity/introspection/TryCatchDirective_ESTest_scaffolding.java
142711d41dca07fc1a10a25c81b17820c839ab5a
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Apr 08 14:55:31 UTC 2020 */ package org.xwiki.velocity.introspection; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class TryCatchDirective_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
94d253e1a2a83568f3bccba48cb84043eb87c7d7
89fc0966b6e23046f777fb17226b74e77e4fc4f5
/src/main/java/org/coding/graph/topologicalsorting/TopologicalSorting.java
b0a2e11e4c8d67ba21617ce67c9b87cbf2586f90
[]
no_license
karanjkarnikhil4/DSAlgo
356ce0061128ddf52c85e020e29db783abe3bcc8
e3c99633006b6150b3ebdbc09cb5064ec67aa568
refs/heads/master
2023-05-06T05:40:22.986671
2021-05-27T02:33:52
2021-05-27T02:33:52
309,866,109
0
0
null
null
null
null
UTF-8
Java
false
false
2,694
java
package org.coding.graph.topologicalsorting; // { Driver Code Starts import java.util.*; import java.io.*; import java.lang.*; class Main { public static void main(String[] args) throws IOException { BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(read.readLine()); while (t-- > 0) { ArrayList<ArrayList<Integer>> list = new ArrayList<>(); String st[] = read.readLine().trim().split("\\s+"); int edg = Integer.parseInt(st[0]); int nov = Integer.parseInt(st[1]); for (int i = 0; i < nov + 1; i++) list.add(i, new ArrayList<Integer>()); int p = 0; for (int i = 1; i <= edg; i++) { String s[] = read.readLine().trim().split("\\s+"); int u = Integer.parseInt(s[0]); int v = Integer.parseInt(s[1]); list.get(u).add(v); } int[] res = new Solution().topoSort(nov, list); if (check(list, nov, res) == true) System.out.println("1"); else System.out.println("0"); } } static boolean check(ArrayList<ArrayList<Integer>> list, int V, int[] res) { int[] map = new int[V]; for (int i = 0; i < V; i++) { map[res[i]] = i; } for (int i = 0; i < V; i++) { for (int v : list.get(i)) { if (map[i] > map[v]) return false; } } return true; } } // } Driver Code Ends // } Driver Code Ends /*Complete the function below*/ /* ArrayList<ArrayList<>Integer>adj: to represent graph containing 'N' vertices and edges between them N: represent number of vertices */ class Solution { private static Stack<Integer> stack = new Stack<Integer>(); static int[] topoSort(int V, ArrayList<ArrayList<Integer>> adj) { String[] vertexColor = new String[V]; for (int i =0; i< V; i++) { vertexColor[i]= "W"; } for(int i =0; i<V; i++) { if (vertexColor[i] == "W") { dfsCore(i, adj, vertexColor); } } int[] result = new int[V]; if (!stack.isEmpty()) { for (int j = 0; j < V; j++) { result[j] = stack.pop(); } } return result; } private static void dfsCore(int currentNode, ArrayList<ArrayList<Integer>> adj, String[] vertexColor ) { if(vertexColor[currentNode] == "W") { vertexColor[currentNode] = "G"; for(int neighbouringElement: adj.get(currentNode)) { dfsCore(neighbouringElement,adj,vertexColor); } vertexColor[currentNode] = "B"; stack.push(currentNode); } else if(vertexColor[currentNode] == "G") { return; } else { return; } } }
[ "nikhil.karanjkar@zs.com" ]
nikhil.karanjkar@zs.com
973d3643d86b44dfc8915c3766aade4939c6ec06
1a41075640469143c655347ef02b268ba9eee1ca
/AndroidStudio/Auditoria/app/src/main/java/com/example/javier/auditoria/PersonalEntidadXML.java
9fec3a5c4a0ba39d80a6e8faf8e8e22ea4cedae5
[ "MIT" ]
permissive
rammarj/Escuela
2a4ed0458efe8c0823de6ffd2f498c03f49abea7
f4d3054bbc6acb8c689307722926df703ad52b38
refs/heads/master
2022-06-26T13:53:09.264363
2022-06-19T18:06:21
2022-06-19T18:06:21
93,201,467
0
0
null
null
null
null
UTF-8
Java
false
false
2,847
java
package com.example.javier.auditoria; import android.content.Context; import android.content.res.Resources; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import java.util.LinkedList; /** * Created by RAMMARJ on 17/03/2017. */ public class PersonalEntidadXML extends LectorXML { private static final String TAG_PERSONAL_ENTIDAD = "PersonalEntidad"; public PersonalEntidadXML(Context contexto) throws Exception { super(contexto.getResources().openRawResource(R.raw.ia_personal_entidad)); } public LinkedList<PersonaEntidad> getPersonalEntidad(){ LinkedList<PersonaEntidad> personaEntidades = new LinkedList<>(); Element raiz = getDocumento().getDocumentElement(); NodeList elementosPersonalEntidad = raiz.getElementsByTagName(TAG_PERSONAL_ENTIDAD); for (int i = 0; i < elementosPersonalEntidad.getLength(); i++){ Element item = (Element) elementosPersonalEntidad.item(i); String esTitular = item.getAttribute("EsTitular"); String cargo = item.getAttribute("Cargo"); String apellido = item.getAttribute("Apellido"); String nombre = item.getAttribute("Nombre"); String idPersonalOrganismoAuditoriasIniciadas = item.getAttribute("IDPersonalOrganismoAuditoriasIniciadas"); String idAuditoriasIniciadas = item.getAttribute("IDAuditoriasIniciadas"); PersonaEntidad personaEntidad = new PersonaEntidad(); personaEntidad.esTitular = esTitular.toLowerCase().equals("true"); personaEntidad.cargo = cargo; personaEntidad.apellido = apellido; personaEntidad.nombre = nombre; personaEntidad.idPersonalOrganismoAuditoriasIniciadas = Integer.parseInt(idPersonalOrganismoAuditoriasIniciadas); personaEntidad.idAuditoriasIniciadas = Integer.parseInt(idAuditoriasIniciadas); personaEntidades.add(personaEntidad); } return personaEntidades; } class PersonaEntidad{ private boolean esTitular; private String cargo; private String apellido; private String nombre; private int idPersonalOrganismoAuditoriasIniciadas; private int idAuditoriasIniciadas; private PersonaEntidad(){} public boolean esTitular() { return esTitular; } public String getCargo() { return cargo; } public String getApellido() { return apellido; } public String getNombre() { return nombre; } public int getIdPersonalOrganismoAuditoriasIniciadas() { return idPersonalOrganismoAuditoriasIniciadas; } public int getIdAuditoriasIniciadas() { return idAuditoriasIniciadas; } } }
[ "JoaquinRMtz@users.noreply.github.com" ]
JoaquinRMtz@users.noreply.github.com
164b423354a603dd97c03e61fd914f5baf493d0a
b404826a9a3f0fee80d1c35ca6295f9248acad1d
/com/google/android/gms/people/PeopleConstants.java
c34b6c3060f062cef527003ca18e15333fe73351
[]
no_license
cyberhorse208/SafetyNet
9690da910fb80a72f0858b0ffef378e9e1b1609b
f251566d00f9e79ff0205eaaa889d74102b4ebc4
refs/heads/master
2021-12-11T02:30:34.120200
2016-10-18T08:21:52
2016-10-18T08:21:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,298
java
package com.google.android.gms.people; public class PeopleConstants { public interface AcItemType { public static final int EMAIL = 1; public static final int GAIA_ID = 3; public static final int PERSON = 0; public static final int PHONE = 2; } public interface AutocompleteDataSource { public static final int ANDROID_CONTACTS = 2; public static final int GOOGLE_CONTACT = 0; public static final int GOOGLE_PROFILE = 1; } public interface AutocompleteTypes { public static final int EMAIL = 0; public static final int EMAIL_EXACT = 1; } public interface Avatar { public static final String ACTION_SET_AVATAR = "com.google.android.gms.people.profile.ACTION_SET_AVATAR"; public static final String EXTRA_ACCOUNT = "com.google.android.gms.people.profile.EXTRA_ACCOUNT"; public static final String EXTRA_AVATAR_URL = "com.google.android.gms.people.profile.EXTRA_AVATAR_URL"; public static final String EXTRA_PAGE_ID = "com.google.android.gms.people.profile.EXTRA_PAGE_ID"; public static final String EXTRA_SOCIAL_CLIENT_APP_ID = "com.google.android.gms.people.profile.EXTRA_APP_ID"; public static final String EXTRA_URI = "com.google.android.gms.people.profile.EXTRA_URI"; public static final int RESULT_INTERNAL_ERROR = 1; } public interface AvatarOptions { public static final int NONE = 0; public static final int NO_DEFAULT_AVATAR = 1; } public interface AvatarSizes { public static final int CONTACTS_THUMBNAIL = 4; public static final int LARGE = 3; public static final int MEDIUM = 2; public static final int SMALL = 1; public static final int TINY = 0; } public interface CircleTypes { public static final int ALL = -999; public static final int DASHER_DOMAIN = 2; public static final int EXTENDED_CIRCLES = 4; public static final int OTHER_SYSTEM_GROUP = -2; public static final int PERSONAL = -1; public static final int PUBLIC = 1; public static final int SYSTEM_GROUPS = -998; public static final int YOUR_CIRCLES = 3; } public interface CircleVisibility { public static final int LIMITED = 2; public static final int PRIVATE = 3; public static final int PUBLIC = 1; public static final int UNKNOWN = 0; } public interface ContactGroupPreferredFields { public static final String EMAIL = "email"; public static final String NAME = "name"; } public interface ContactsSyncTargets { public static final String EVERGREEN = "$$everrgreen$$"; public static final String ME = "$$me$$"; public static final String MY_CIRCLES = "$$mycircles$$"; } public interface ContainerType { public static final int CIRCLE = 2; public static final int CONTACT = 1; public static final int PROFILE = 0; public static final int UNKNOWN = -1; } public interface DataChangedScopes { public static final int AGGREGATED_PEOPLE = 12; public static final int AUTOCOMPLETE = 256; public static final int CIRCLES = 2; public static final int CONTACTS_PROVIDER = 8; public static final int OWNERS = 1; public static final int PEOPLE = 4; public static final int SYNC_CANCELLED = 128; public static final int SYNC_FINISHED = 32; public static final int SYNC_FINISHED_UNSUCCESSFUL = 64; public static final int SYNC_STARTED = 16; } public interface DirectoryAccountTypes { public static final String GOOGLE = "com.google"; } public interface EmailTypes { public static final int HOME = 1; public static final int OTHER = -1; public static final int WORK = 2; } public interface Endpoints { public static final String ENDPOINT_GET = "get"; public static final String ENDPOINT_LIST = "list"; public static final String ENDPOINT_LIST_BY_EMAIL = "list_by_email"; public static final String ENDPOINT_LIST_BY_FOCUS_ID = "list_by_focus_id"; public static final String ENDPOINT_LIST_BY_PHONE = "list_by_phone"; public static final String ENDPOINT_LIST_WITH_EMAIL_AND_PHONE = "list_by_email_and_phone"; public static final String KEY_EMAIL = "email"; public static final String KEY_FOCUS_ID = "contact"; public static final String KEY_ON_BEHALF_OF = "on_behalf_of"; public static final String KEY_PHONE = "phone"; public static final String KEY_TARGET_GAIA_ID = "gaia_id"; public static final String KEY_TARGET_QUALIFIED_ID = "qualified_id"; } public interface FocusContactRelationship { public static final int IN_VISIBLE_CONTACTS = 1; public static final int NOT_IN_CONTACTS = 0; } public interface GaiaEdgeType { public static final int ALL = 7; public static final int EMAIL = 1; public static final int EMAIL_PHONE = 3; public static final int PHONE = 2; public static final int PROFILE_URL = 4; } public interface InteractionTypes { public static final int CALL = 2; public static final int LONG_TEXT = 1; public static final int SHORT_TEXT = 0; } public interface LastSyncStatus { public static final int FAILURE = 3; public static final int IN_PROGRESS = 1; public static final int NOT_SYNCED = 0; public static final int SUCCESS = 2; public static final int UPGRADED_SYNC_NEEDED = 4; } public interface LoadOwnersSortOrder { public static final int ACCOUNT_CREATION_ORDER = 1; public static final int ACCOUNT_NAME = 0; } public interface OwnerEmail { public static final String CUSTOM_LABEL = "custom_label"; public static final String EMAIL_ADDRESS = "email"; public static final String TYPE = "type"; public static final String _ID = "_id"; } public interface OwnerPhone { public static final String CUSTOM_LABEL = "custom_label"; public static final String PHONE_NUMBER = "phone"; public static final String TYPE = "type"; public static final String _ID = "_id"; } public interface OwnerPostalAddress { public static final String CUSTOM_LABEL = "custom_label"; public static final String POSTAL_ADDRESS = "postal_address"; public static final String TYPE = "type"; public static final String _ID = "_id"; } public interface PeopleColumnBitmask { public static final int AFFINITY_1 = 32768; public static final int AFFINITY_2 = 65536; public static final int AFFINITY_3 = 131072; public static final int AFFINITY_4 = 262144; public static final int AFFINITY_5 = 524288; public static final int ALL = 2097151; public static final int AVATAR_URL = 32; public static final int BELONGING_CIRCLES = 128; public static final int DISPLAY_NAME = 4; public static final int FAMILY_NAME = 8192; public static final int GAIA_ID = 2; public static final int GIVEN_NAME = 4096; public static final int INTERACTION_RANK_SORT_KEY = 16; public static final int IN_VIEWER_DOMAIN = 1024; public static final int IS_BLOCKED = 256; public static final int LAST_MODIFIED_TIME = 512; public static final int NAME_VERIFIED = 2048; public static final int PEOPLE_IN_COMMON = 1048576; public static final int PROFILE_TYPE = 64; public static final int QUALIFIED_ID = 1; public static final int SORT_KEY = 8; public static final int _ID = 16384; } public interface PeopleEmail { public static final String AFFINITY_1 = "affinity1"; public static final String AFFINITY_2 = "affinity2"; public static final String AFFINITY_3 = "affinity3"; public static final String AFFINITY_4 = "affinity4"; public static final String AFFINITY_5 = "affinity5"; public static final String CUSTOM_LABEL = "custom_label"; public static final String EMAIL_ADDRESS = "email"; public static final String LOGGING_ID_1 = "logging_id"; public static final String LOGGING_ID_2 = "logging_id2"; public static final String LOGGING_ID_3 = "logging_id3"; public static final String LOGGING_ID_4 = "logging_id4"; public static final String LOGGING_ID_5 = "logging_id5"; public static final String QUALIFIED_ID = "qualified_id"; public static final String TYPE = "type"; public static final String _ID = "_id"; } public interface PeopleEndpointDataFormat { public static final int MERGED_PERSON_JSON = 2; public static final int MERGED_PERSON_LIST_JSON = 4; public static final int MERGED_PERSON_LIST_PROTO = 3; public static final int MERGED_PERSON_PROTO = 1; public static final int UNKNOWN = 0; } public interface PeopleExtraColumnBitmask { public static final int ALL = 7; public static final int EMAILS = 1; public static final int EMAIL_AFFINITIES = 4; public static final int PHONES = 2; } public interface PeoplePhone { public static final String CUSTOM_LABEL = "custom_label"; public static final String PHONE_NUMBER = "phone"; public static final String QUALIFIED_ID = "qualified_id"; public static final String TYPE = "type"; public static final String _ID = "_id"; } public interface PeoplePostalAddress { public static final String CUSTOM_LABEL = "custom_label"; public static final String POSTAL_ADDRESS = "postal_address"; public static final String QUALIFIED_ID = "qualified_id"; public static final String TYPE = "type"; public static final String _ID = "_id"; } public interface PeopleSearchFields { public static final int ALL = 7; public static final int EMAIL = 2; public static final int NAME = 1; public static final int PHONE = 4; } public interface PhoneTypes { public static final int ASSISTANT = 9; public static final int ASSISTENT = 9; public static final int CALLBACK = 13; public static final int CAR = 10; public static final int COMPANY_MAIN = 8; public static final int GOOGLE_VOICE = 19; public static final int HOME = 1; public static final int HOME_FAX = 4; public static final int ISDN = 12; public static final int MAIN = 18; public static final int MOBILE = 3; public static final int OTHER = -1; public static final int OTHER_FAX = 6; public static final int PAGER = 7; public static final int RADIO = 11; public static final int TELEX = 14; public static final int TTY = 15; public static final int WORK = 2; public static final int WORK_FAX = 5; public static final int WORK_MOBILE = 16; public static final int WORK_PAGER = 17; } public interface PostalAddressTypes { public static final int HOME = 1; public static final int OTHER = -1; public static final int WORK = 2; } public interface ProfileTypes { public static final int PAGE = 2; public static final int PERSON = 1; public static final int UNKNOWN = -1; } public interface TriState { public static final int FALSE = 1; public static final int TRUE = 2; public static final int UNKNOWN = 0; } private PeopleConstants() { } public static int booleanToTriState(Boolean value) { if (value == null) { return 0; } return value.booleanValue() ? 2 : 1; } public static Boolean triStateToBoolean(int triState) { boolean z = true; if (triState == 0) { return null; } if (triState == 1) { z = false; } return Boolean.valueOf(z); } }
[ "husson@archos.com" ]
husson@archos.com
d00650f6fa88af0bddc509af36e4264164e8aa8a
395253358846041e6e6042d4bf78521d4772e593
/src/main/java/com/mind/ak47/begin/security/CustomUserDetailsService.java
b0d6a426d41ad4b267aa0cffe2924567aad58791
[]
no_license
akthe47/begin
0056a50dbe31d7dd67139c964542981e32fdd1f3
af2c2d2ad842bbe9ef677935ff9aff723fb3b459
refs/heads/master
2021-01-19T12:45:06.180924
2017-05-11T19:26:38
2017-05-11T19:26:38
88,042,983
0
0
null
null
null
null
UTF-8
Java
false
false
2,006
java
package com.mind.ak47.begin.security; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.mind.ak47.begin.model.User; import com.mind.ak47.begin.model.UserProfile; import com.mind.ak47.begin.service.UserService; @Service("customUserDetailsService") public class CustomUserDetailsService implements UserDetailsService{ static final Logger logger = LoggerFactory.getLogger(CustomUserDetailsService.class); @Autowired private UserService userService; @Transactional(readOnly=true) public UserDetails loadUserByUsername(String ssoId) throws UsernameNotFoundException { User user = userService.findBySSO(ssoId); logger.info("User : {}", user); if(user==null){ logger.info("User not found"); throw new UsernameNotFoundException("Username not found"); } return new org.springframework.security.core.userdetails.User(user.getSsoId(), user.getPassword(), true, true, true, true, getGrantedAuthorities(user)); } private List<GrantedAuthority> getGrantedAuthorities(User user){ List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(); for(UserProfile userProfile : user.getUserProfiles()){ logger.info("UserProfile : {}", userProfile); authorities.add(new SimpleGrantedAuthority("ROLE_"+userProfile.getType())); } logger.info("authorities : {}", authorities); return authorities; } }
[ "asus@192.168.1.9" ]
asus@192.168.1.9
be2679b08fe5886d56d020c0ee404508c65abe08
a24e1991ab033fbe0b7b4e291104ec2e436f6619
/src/Battleship/Selection.java
6fd346198d97d1e5fd9ddf29da63f6629f4f944c
[]
no_license
brucemortland/Battleship
5eab0182658fc7f4c855de346dc821132b8eb9ee
25b4102bbc565de33dcc40fb63717b902b758bf4
refs/heads/master
2020-05-23T05:03:41.673265
2019-05-14T15:06:29
2019-05-14T15:06:29
186,641,561
0
0
null
null
null
null
UTF-8
Java
false
false
676
java
package Battleship; import java.awt.*; public class Selection { Rectangle rect; Color color; String text; boolean selected; Selection(int a, int b, int c, int d, Color e, String f) { rect = new Rectangle(a,b,c,d); color = e; text = f; } public void draw(Graphics g) { if(selected) g.drawRect(rect.x-5, rect.y-5, rect.width, rect.height); g.setFont(new Font("Arial", Font.PLAIN,12)); g.setColor(color); g.drawString(text, rect.x,rect.y+12); } public boolean mouseDown(int x, int y) { selected=false; if(rect.contains( x, y)) { System.out.println("Selection:"+rect); selected=true; } return selected; } }
[ "noreply@github.com" ]
noreply@github.com
73cc3ee9ea0d67d8f9933e9f38f15d2d94623649
6f197b0b7ce388c9adf6a3cbee3059bad7445a92
/app/src/main/java/com/vocabwin7/vocabwin7/LangSelectActivity.java
d5a7dd6fac94d106c5c275a2dc901b8ea58a5705
[]
no_license
WinstonNau/vocabwin7
c4961af1500af2f9f2323e69a010e76cea713f0a
3b6e4aba637367c06f9557bfa4c425b00a9c43df
refs/heads/master
2022-12-22T13:48:59.017284
2020-09-09T14:43:26
2020-09-09T14:43:26
294,141,272
0
0
null
null
null
null
UTF-8
Java
false
false
1,386
java
package com.vocabwin7.vocabwin7; import android.content.Intent; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class LangSelectActivity extends AppCompatActivity { private static final String TAG = "LangSelectActivity"; public static final String EXTRA_MESSAGE = "com.vocabwin7.vocabwin7." + TAG; public static final String EXTRA_MESSAGE_2 = "com.vocabwin7.vocabwin7." + TAG + ".lang"; public String vocabularys; public String language = "german"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_lang_select); Intent intent = getIntent(); vocabularys = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); } public void backToMenu(View view) { finish(); } public void ENtoDE(View view) { switch(view.getId()) { case R.id.EnToDeButton: language = "german"; break; case R.id.DeToEnButton: language = "english"; break; } Intent intent = new Intent(this, GameActivity.class); intent.putExtra(EXTRA_MESSAGE, vocabularys); intent.putExtra(EXTRA_MESSAGE_2, language); startActivity(intent); finish(); } }
[ "winstonnau007@gmail.com" ]
winstonnau007@gmail.com
92f05ed8e4c689c0c26ba206d6d9ad9adbcdd58b
355db54613a90407b7341c89a6ba8035ae75011c
/project/src/project/Project.java
e2c8daec8c5c0e15055c91c2fdf1900fcc9fb595
[]
no_license
babehoney/java
8b676616bd0a3b1a8ba9837c9509a04fb9ae3d93
96a24b6cad5e9e6d3887931c98baec06ccc0d78a
refs/heads/master
2021-01-19T07:53:33.062332
2017-04-07T20:29:48
2017-04-07T20:29:48
87,584,433
0
0
null
null
null
null
UTF-8
Java
false
false
511
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 project; /** * * @author Claire Fenelon */ public class Project { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here System.out.println("hola mundo"); System.out.println("que vaina"); } }
[ "babehoneyclaire@gmail.com" ]
babehoneyclaire@gmail.com
4502513df87790797b0b80b4c8c050728f5f35ad
72c17629539439c63dcf2199df39f99d845cafc8
/Java/Exeptions/MyErrorExeption.java
d03074d28b86b36972f42897dc0f7c4a07900d57
[]
no_license
evgeniy-klimenko/Examples
9b6055344f907d232ed07268ba7670c136bd27cf
9652cc9ad138e3273516099ff76782773a9f54c5
refs/heads/master
2021-05-13T12:50:28.799844
2018-08-06T08:16:03
2018-08-06T08:16:03
116,686,783
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package ExeptionDZ.ThreeClassesOfExeptions; public class MyErrorExeption extends Error{ static final String wrong = "Error"; public MyErrorExeption(){ super(wrong); } }
[ "https://github.com/evgeniy-klimenko" ]
https://github.com/evgeniy-klimenko
6db99a603385267f87fcb412d5f4911a9154505e
c490f8f037bcaf486ed3e21df1e10e10d7bd037f
/src/test/java/model/objects/BikeRequestTest.java
fbd9e4562edd5a1ae9981f436bfb9f1958d6edd6
[ "MIT" ]
permissive
romatallinn/sustainme
3cef3a7596d39ff4389641e96361f67c48147b38
e63f2464a92a4905807e30f6c938a9b32acb032a
refs/heads/master
2020-05-14T21:05:18.328240
2019-04-29T09:39:24
2019-04-29T09:39:24
181,954,386
0
0
null
null
null
null
UTF-8
Java
false
false
448
java
package model.objects; import org.junit.*; import static org.junit.Assert.*; public class BikeRequestTest { @Test public void getUidTest() { BikeRequest bikeRequest = new BikeRequest("testId", 1); assertEquals(bikeRequest.getUid(), "testId"); } @Test public void getDistanceTest() { BikeRequest bikeRequest = new BikeRequest("testId", 1); assertEquals(bikeRequest.getDistance(), 1); } }
[ "r.sirokov@student.tudelft.nl" ]
r.sirokov@student.tudelft.nl
8c8f75b73241d5103212c14d4114b74216274a77
7f0d9df843be333bf135de76d0b135adf387cf33
/src/com/sun/corba/se/spi/activation/_RepositoryImplBase.java
0bde3813bc0010e95990b82ae78287d8dc380272
[ "MIT" ]
permissive
terminux/jdk1.8.0_291
9694e2bc9c94046c378db5f0651a4d595d0689d2
f34b164be890be40062ade2682936c636635e95b
refs/heads/main
2023-07-12T08:59:45.026481
2021-08-17T01:50:52
2021-08-17T01:50:52
397,051,130
0
0
null
null
null
null
UTF-8
Java
false
false
7,670
java
package com.sun.corba.se.spi.activation; /** * com/sun/corba/se/spi/activation/_RepositoryImplBase.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /scratch/jenkins/workspace/8-2-build-linux-amd64/jdk8u291/1294/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl * Wednesday, April 7, 2021 7:14:19 PM GMT */ public abstract class _RepositoryImplBase extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.spi.activation.Repository, org.omg.CORBA.portable.InvokeHandler { // Constructors public _RepositoryImplBase () { } private static java.util.Hashtable _methods = new java.util.Hashtable (); static { _methods.put ("registerServer", new java.lang.Integer (0)); _methods.put ("unregisterServer", new java.lang.Integer (1)); _methods.put ("getServer", new java.lang.Integer (2)); _methods.put ("isInstalled", new java.lang.Integer (3)); _methods.put ("install", new java.lang.Integer (4)); _methods.put ("uninstall", new java.lang.Integer (5)); _methods.put ("listRegisteredServers", new java.lang.Integer (6)); _methods.put ("getApplicationNames", new java.lang.Integer (7)); _methods.put ("getServerID", new java.lang.Integer (8)); } public org.omg.CORBA.portable.OutputStream _invoke (String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) { org.omg.CORBA.portable.OutputStream out = null; java.lang.Integer __method = (java.lang.Integer)_methods.get ($method); if (__method == null) throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); switch (__method.intValue ()) { // always uninstalled. case 0: // activation/Repository/registerServer { try { com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef serverDef = com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.read (in); int $result = (int)0; $result = this.registerServer (serverDef); out = $rh.createReply(); out.write_long ($result); } catch (com.sun.corba.se.spi.activation.ServerAlreadyRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerAlreadyRegisteredHelper.write (out, $ex); } catch (com.sun.corba.se.spi.activation.BadServerDefinition $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.BadServerDefinitionHelper.write (out, $ex); } break; } // unregister server definition case 1: // activation/Repository/unregisterServer { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); this.unregisterServer (serverId); out = $rh.createReply(); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } // get server definition case 2: // activation/Repository/getServer { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef $result = null; $result = this.getServer (serverId); out = $rh.createReply(); com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.write (out, $result); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } // Return whether the server has been installed case 3: // activation/Repository/isInstalled { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); boolean $result = false; $result = this.isInstalled (serverId); out = $rh.createReply(); out.write_boolean ($result); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } // if the server is currently marked as installed. case 4: // activation/Repository/install { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); this.install (serverId); out = $rh.createReply(); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } catch (com.sun.corba.se.spi.activation.ServerAlreadyInstalled $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (out, $ex); } break; } // if the server is currently marked as uninstalled. case 5: // activation/Repository/uninstall { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); this.uninstall (serverId); out = $rh.createReply(); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } catch (com.sun.corba.se.spi.activation.ServerAlreadyUninstalled $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.write (out, $ex); } break; } // list registered servers case 6: // activation/Repository/listRegisteredServers { int $result[] = null; $result = this.listRegisteredServers (); out = $rh.createReply(); com.sun.corba.se.spi.activation.ServerIdsHelper.write (out, $result); break; } // servers. case 7: // activation/Repository/getApplicationNames { String $result[] = null; $result = this.getApplicationNames (); out = $rh.createReply(); com.sun.corba.se.spi.activation.RepositoryPackage.StringSeqHelper.write (out, $result); break; } // Find the ServerID associated with the given application name. case 8: // activation/Repository/getServerID { try { String applicationName = in.read_string (); int $result = (int)0; $result = this.getServerID (applicationName); out = $rh.createReply(); out.write_long ($result); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } default: throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); } return out; } // _invoke // Type-specific CORBA::Object operations private static String[] __ids = { "IDL:activation/Repository:1.0"}; public String[] _ids () { return (String[])__ids.clone (); } } // class _RepositoryImplBase
[ "ugrong@163.com" ]
ugrong@163.com
f12c2e6b20843284e9a6467e76004e695afc9f19
814343e4ff100f416b6e79ae29ff292cf12ba494
/example_java_session10_1/src/interface_aaa/MonNgoaiNgu.java
ae77aa10282a6bafe0e049cb4e1828550f28e9df
[]
no_license
bin97kute/projects
cecf65cac8148f71af37f20aa392b69b3a973dc5
93e03b73e8fde359a8003abd0815dcbcd82352b5
refs/heads/master
2020-03-17T06:43:30.195175
2018-06-24T13:07:27
2018-06-24T13:07:27
133,367,001
0
0
null
null
null
null
UTF-8
Java
false
false
96
java
package interface_aaa; public interface MonNgoaiNgu { void english(); void france(); }
[ "Administrator@dell-PC" ]
Administrator@dell-PC
bc02ae77377e6812a13d5c32167a6501fdf6b14d
481a7db2bab47095738f11afd42c4e002ab53ade
/AI102_Quality_SP/PremierJSF1/src/main/java/fr/afcepf/ai102/controller/CommandeManagedBean.java
2e3535a06081de47e9833282386b7c821c75a3a7
[]
no_license
Douzal/AFCEPF_Architecte_Logiciel
efb50f6ae2f148c431805bcadde47240a97c266c
f918f10760db2957c984723db3bfbb8db19e9e9a
refs/heads/master
2021-04-06T02:27:02.093087
2018-04-13T08:11:53
2018-04-13T08:11:53
125,262,599
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package fr.afcepf.ai102.controller; import fr.afcepf.ai102.qualimetrie.entity.Personne; public class CommandeManagedBean { private Personne perConnected; public Personne getPerConnected() { return perConnected; } public void setPerConnected(Personne paramPerConnected) { perConnected = paramPerConnected; } }
[ "Alexis_masson_@hotmail.fr" ]
Alexis_masson_@hotmail.fr
87e6ee062d1a4e0316a6333b4ee4731e1699af25
bcf72f418cda1d50e24ea5d52726084b2fdc89ba
/AlertDialogue/app/src/androidTest/java/com/example/armstrong/alertdialogue/ApplicationTest.java
b6038c49573da44e0af62a66974576a89db0387c
[]
no_license
armstrongk/app-ideas
68310285576ca91eecf97de6f3698a29168d21e1
849065c318f833d0f441c621e4d82633f46834d0
refs/heads/master
2021-04-30T03:15:21.967585
2018-02-15T01:46:06
2018-02-15T01:46:06
121,512,570
0
0
null
null
null
null
UTF-8
Java
false
false
366
java
package com.example.armstrong.alertdialogue; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "kaahwaarmstrong2014@gmail.com" ]
kaahwaarmstrong2014@gmail.com
8f75fa8199cff44883ccb9fa959abd65bd3039c1
97fd02f71b45aa235f917e79dd68b61c62b56c1c
/src/main/java/com/tencentcloudapi/ckafka/v20190819/models/DeleteGroupRequest.java
9d3145d9c06d9b8dc7633466d91cec0cfbafeb84
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java
7df922f7c5826732e35edeab3320035e0cdfba05
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
refs/heads/master
2023-09-04T10:51:57.854153
2023-09-01T03:21:09
2023-09-01T03:21:09
129,837,505
537
317
Apache-2.0
2023-09-13T02:42:03
2018-04-17T02:58:16
Java
UTF-8
Java
false
false
2,546
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * 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.tencentcloudapi.ckafka.v20190819.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class DeleteGroupRequest extends AbstractModel{ /** * 实例Id */ @SerializedName("InstanceId") @Expose private String InstanceId; /** * 消费分组 */ @SerializedName("Group") @Expose private String Group; /** * Get 实例Id * @return InstanceId 实例Id */ public String getInstanceId() { return this.InstanceId; } /** * Set 实例Id * @param InstanceId 实例Id */ public void setInstanceId(String InstanceId) { this.InstanceId = InstanceId; } /** * Get 消费分组 * @return Group 消费分组 */ public String getGroup() { return this.Group; } /** * Set 消费分组 * @param Group 消费分组 */ public void setGroup(String Group) { this.Group = Group; } public DeleteGroupRequest() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public DeleteGroupRequest(DeleteGroupRequest source) { if (source.InstanceId != null) { this.InstanceId = new String(source.InstanceId); } if (source.Group != null) { this.Group = new String(source.Group); } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "InstanceId", this.InstanceId); this.setParamSimple(map, prefix + "Group", this.Group); } }
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
e948b16dcc20f441376c8afa2cc87236497b7a67
9975a0203a47d1fcc559eabd1b0917825a10ee1d
/app/src/main/java/com/fenghaha/zscy/MyViewPager.java
ee8dedea7054eae449391aa668d934376ab45da6
[]
no_license
fenghaha/ZSCY
badf6c08d9b1eafa1fef327c7b949ca78f4750bd
7abd513a1ca9286ebc441535e652e66019cae2b0
refs/heads/master
2020-03-18T17:40:00.663997
2018-05-27T14:07:57
2018-05-27T14:07:57
135,042,884
0
0
null
null
null
null
UTF-8
Java
false
false
954
java
package com.fenghaha.zscy; import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; /** * Created by FengHaHa on2018/5/25 0025 16:13 */ public class MyViewPager extends ViewPager { private boolean canScroll = true; public MyViewPager(@NonNull Context context) { super(context); } public MyViewPager(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { return canScroll && super.onInterceptTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent ev) { return canScroll && super.onTouchEvent(ev); } public void setCanScroll(boolean canScroll) { this.canScroll = canScroll; } }
[ "1424136075@qq.com" ]
1424136075@qq.com
5e6a36ff9aacc0a94b84bb60acb36b08bc3ffde5
ebae2b7cb8f96cac8ef1300b6236ee7cc208ee40
/FRMCode/PMDM/1a aval/CuentaClicksV2/app/src/androidTest/java/com/example/a16daviddss/cuentaclicksv2/ExampleInstrumentedTest.java
6c2f90288a92bae330b33405c179f06f58fee9c6
[]
no_license
masterfabela/Estudios
3b92665ef614e7cbf4783eccbf78c48498b95981
3cff3376f869be9f24ec71813648b53c7eeee3e4
refs/heads/master
2020-05-23T02:55:19.570444
2019-05-20T18:54:45
2019-05-20T18:54:45
49,068,904
3
3
null
2018-09-22T09:58:24
2016-01-05T13:52:53
Java
UTF-8
Java
false
false
780
java
package com.example.a16daviddss.cuentaclicksv2; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.a16daviddss.cuentaclicksv2", appContext.getPackageName()); } }
[ "chiscazo.paco@gmail.com" ]
chiscazo.paco@gmail.com
1167a0739b8de64b6033c99b502bcee36e67e0ff
4b2ec393502bac7b114c1586a464c24f9f17bd77
/src/main/java/com/jrp/pma/Util/LoggerUtil.java
1d0021561fdb373d26cc65c384bf19a6ebc1d557
[]
no_license
vivekshri1/projectManagement
54e3e244273b31396e664d03b8e32fcf2da99260
c33e6e9ecc5f9b58cb67987c6774eb7a32e99638
refs/heads/main
2023-04-19T17:18:21.064876
2021-05-13T05:57:17
2021-05-13T05:57:17
366,651,572
0
0
null
null
null
null
UTF-8
Java
false
false
162
java
package com.jrp.pma.util; public class LoggerUtil { public static void log(String msg){ System.out.println(Thread.currentThread()+" "+msg); } }
[ "vcvivekcool@gmail.com" ]
vcvivekcool@gmail.com
a333e1831d19c8692f63217131eb5edfd9195aaa
09787ca2d205d9c42c855142b5f32d6875705c28
/jgiven-junit/src/main/java/com/tngtech/jgiven/junit/ScenarioReportRule.java
cbbee97a1e189d9db24c28bbfcf70903af545de7
[ "Apache-2.0" ]
permissive
yasirmcs/JGiven
b6f58662048a64a2748c5c217b2933ca0fffe099
0bcb747de92927e57ad65f8ef6eee87e874e4f36
refs/heads/master
2020-05-18T23:33:47.505302
2019-05-01T11:55:30
2019-05-01T12:53:02
184,714,472
1
0
Apache-2.0
2019-05-03T07:21:18
2019-05-03T07:21:17
null
UTF-8
Java
false
false
221
java
package com.tngtech.jgiven.junit; /** * Only exists for backwards-compatibility reasons. * * @deprecated use {@link JGivenClassRule} instead */ @Deprecated public class ScenarioReportRule extends JGivenClassRule { }
[ "jan.schaefer@tngtech.com" ]
jan.schaefer@tngtech.com
4c93f54ccea8e8955ff567e9e5cbfe3a6c5622c2
0319af81273cb842059156436580dd4636db4e1b
/ATM program/src/bank/Main.java
c010fe75a7df8102b87c182a1df486ea8b03bbb6
[]
no_license
vnq123/Java-ATM
d1b5bc3f97f3a0830f2a5b0c4ac4612494ad5885
ac1f0e2b6e51b581070e185d5e803d0ccbe6f266
refs/heads/master
2020-12-28T16:48:37.251224
2020-02-05T09:25:12
2020-02-05T09:25:12
238,411,543
0
0
null
null
null
null
UTF-8
Java
false
false
3,798
java
package bank; import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import java.awt.Color; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import javax.swing.JButton; import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.JLabel; import javax.swing.ImageIcon; import java.awt.Font; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JToolBar; public class Main extends JFrame { private JPanel contentPane; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Main frame = new Main(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public Main() { setTitle("ATM"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 785, 470); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JButton deposit = new JButton(new ImageIcon("D:\\An\\ATM\\img\\1.jpg")); deposit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getSource() == deposit) { deposit frame = new deposit(); frame.setVisible(true); } } }); deposit.setBounds(0, 10, 130, 48); JButton withdraw = new JButton(new ImageIcon("img/withdraw.jpg")); withdraw.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getSource() == withdraw) { withdraw frame = new withdraw(); frame.setVisible(true); } } }); withdraw.setBounds(159, 10, 130, 48); withdraw.setIcon(new ImageIcon("D:\\An\\ATM\\img\\2.jpg")); JButton balance = new JButton(new ImageIcon("img/Checkbalance.jpg")); balance.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Checkbalance check = new Checkbalance(); check.setVisible(true); } }); balance.setBounds(322, 10, 130, 48); balance.setIcon(new ImageIcon("D:\\An\\ATM\\img\\7.jpg")); JButton CreateAccount = new JButton(new ImageIcon("img/Account.jpg")); CreateAccount.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getSource() == CreateAccount) { custommenu frame = new custommenu(); frame.setVisible(true); } } }); CreateAccount.setBounds(483, 10, 130, 48); CreateAccount.setIcon(new ImageIcon("D:\\An\\ATM\\img\\10.jpg")); JButton exit = new JButton(new ImageIcon("img/exit.jpg")); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getSource() == exit) System.exit(0); } }); exit.setBounds(639, 10, 130, 48); exit.setIcon(new ImageIcon("D:\\An\\ATM\\img\\8.jpg")); JLabel mainlogo = new JLabel(""); mainlogo.setBounds(256, 90, 244, 239); mainlogo.setIcon(new ImageIcon("D:\\An\\ATM\\img\\ui_signature01.gif")); JLabel mainlabel = new JLabel("\uC6D0\uD558\uC2DC\uB294 \uBA54\uB274\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694."); mainlabel.setBounds(287, 339, 197, 27); mainlabel.setFont(new Font("HY견고딕", Font.PLAIN, 14)); contentPane.setLayout(null); contentPane.add(deposit); contentPane.add(withdraw); contentPane.add(mainlogo); contentPane.add(balance); contentPane.add(CreateAccount); contentPane.add(exit); contentPane.add(mainlabel); } }
[ "noreply@github.com" ]
noreply@github.com
2589f5aeba8e5368f65ef7367eb4fdf27bf84499
42ef9eeac1cea65269cffb8097b4adc621089e05
/src/Dao/EquipDao.java
b703934321b9010a3af024b5727e35fd06e38805
[]
no_license
kejiangFighting/BYSJ
7f9044b83f5256b88a7eccd54684f4fa29e32f2e
024cea726271c2f288d637335251cb51823927df
refs/heads/master
2020-05-16T19:17:33.794173
2019-05-07T11:16:12
2019-05-07T11:16:12
183,254,157
1
0
null
null
null
null
UTF-8
Java
false
false
499
java
package Dao; import java.sql.SQLException; import java.util.List; import Model.Equip; public interface EquipDao { public int addEquip(Equip equip); public List<Equip> findAll() throws Exception; public int deleteById(String equipID) throws Exception; // public Notice findById(String noticeno) throws Exception; //public int updateById(Notice n); //public List<Notice> findNotices(int page , int count) throws SQLException; // public int count() throws SQLException; }
[ "kj@qq.com" ]
kj@qq.com
fe4b64dd53cc29af7a3a8956621b6bbab02b4c88
74faef14ad0b15115b8705f0666d12d206dbbc96
/src/test/java/com/example/nmtc/NmtcApplicationTests.java
2e7754a7ed89df6bb15f2f340b4381a8d2152db6
[]
no_license
lixingxing126/nmtc
7cce6d2fa65d4c4593838e5905e98ec1d12e5bcc
8472c9580d12c3ae09016f61281cb8db7ddb6daa
refs/heads/master
2021-05-19T04:29:46.506927
2020-04-05T09:23:59
2020-04-05T09:23:59
251,529,520
0
0
null
null
null
null
UTF-8
Java
false
false
215
java
package com.example.nmtc; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class NmtcApplicationTests { @Test void contextLoads() { } }
[ "lixingxing_lz@126.com" ]
lixingxing_lz@126.com
011781e38395d6c2364b877ad190bdff00e519bc
b370ed89ee04b534ac52cb324b568adfaddb6956
/src/main/java/com/example/caveatEmptor/model/inheritance/Measurement.java
b0cc8c07cd46fba6ecf5f304050036439d685332
[]
no_license
rajan-github/caveatEmptor-data
86c60abbe34cf6cb081de198487dc29d35198cf0
d34157b4a8819afdfd3846c7ef4e17deb19f4609
refs/heads/master
2021-01-22T16:09:39.957388
2017-10-08T07:20:24
2017-10-08T07:20:24
102,389,486
1
0
null
null
null
null
UTF-8
Java
false
false
269
java
package com.example.caveatEmptor.model.inheritance; import javax.persistence.MappedSuperclass; import javax.validation.constraints.NotNull; @MappedSuperclass public abstract class Measurement { @NotNull protected String name; @NotNull protected String symbol; }
[ "rajan44chauhan@gmail.com" ]
rajan44chauhan@gmail.com
aaf7e2545e3e1354f098f7490a13390113e13db2
dc7bc8b10ccdec6021d887bc8d1e8293e132a2e3
/app/src/main/java/com/gagankaushal/portfolio/AboutFragment.java
78e7780fadb882ed679d87c6b228e5fa31b830c7
[]
no_license
Gagan-0602/Portfolio
6a8b89003e7c552061fcde81bb91085d25441dd3
a6d979a84f695682582f8e5eb278a960e5d4c536
refs/heads/master
2020-08-27T12:34:01.109835
2019-10-24T19:18:45
2019-10-24T19:18:45
217,369,736
0
0
null
null
null
null
UTF-8
Java
false
false
1,947
java
package com.gagankaushal.portfolio; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.zip.Inflater; public class AboutFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.about, container, false); TextView tv=(TextView)v.findViewById(R.id.tv); String ss= "<p style=\"text-align: justify;\">\"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?\"</p>"; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { tv.setText(Html.fromHtml(ss,Html.FROM_HTML_MODE_LEGACY)); } else { tv.setText(Html.fromHtml(ss)); } return v; } }
[ "gagankaushal7@gmail.com" ]
gagankaushal7@gmail.com
b1955ce503e7dc88df8b3476d5d4db3c9e8eca30
322c9fb21cfa76ec90e87513c678455275b7290d
/src/main/java/com/chess/network/MinaMsgHandler.java
25660c9ac515be39967f4416134cc8ade7d419fb
[]
no_license
FullDeveloper/mahjong_server
bc84be0cbae28d19f5931dbaad4ccc1ddb4d970e
3fb5f65bfb43a0e110c90cdbdf9547dd2def755c
refs/heads/master
2020-03-28T03:34:04.343799
2018-09-25T02:20:43
2018-09-25T02:20:43
147,654,733
0
0
null
null
null
null
UTF-8
Java
false
false
2,129
java
package com.chess.network; import com.chess.mahjong.GameServerBootstrap; import com.chess.mahjong.gameserver.commons.session.GameSession; import com.chess.network.codec.message.ClientRequest; import org.apache.mina.core.service.IoHandlerAdapter; import org.apache.mina.core.session.IoSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @Author: 周润斌 * @Date: create in 下午 7:04 2018-03-01 * @Description: */ public class MinaMsgHandler extends IoHandlerAdapter { private static final Logger logger = LoggerFactory.getLogger(MinaMsgHandler.class); /** * 会话打开时执行 * * @param session * @throws Exception */ @Override public void sessionOpened(IoSession session) throws Exception { logger.info("a session create from ip {}", session.getRemoteAddress()); // 初始化用户会话信息:保存用户的 IP地址,会话对象到session new GameSession(session); } /** * 收到消息时执行 * * @param session * @param message * @throws Exception */ @Override public void messageReceived(IoSession session, Object message) throws Exception { ClientRequest clientRequest = (ClientRequest) message; GameSession gameSession = GameSession.getInstance(session); if (gameSession == null) { logger.info("gameSession is null, Please check Error!"); return; } GameServerBootstrap.msgDispatcher.dispatchMsg(gameSession,clientRequest); } /** * 会话关闭时执行 * * @param session * @throws Exception */ @Override public void sessionClosed(IoSession session) throws Exception { logger.info("a session closed ip:{}", session.getRemoteAddress()); super.sessionClosed(session); } /** * 出错时执行 * * @param session * @param cause * @throws Exception */ @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { super.exceptionCaught(session, cause); } }
[ "1875222156@qq.com" ]
1875222156@qq.com
1f1bfc5fb2986620902a78c6af7ebde698ae243a
8b99a7d0fa37052691d4a35bc0c2049d9a0ee313
/src/main/java/org/ciberfarma/app/JPA_TEST2.java
643fbb87b1aedbb787bd8c85b6478c6d2ff4f636
[]
no_license
Avatar-Arcade/dawi-secion_04
803fa556d576937e121c3f92ea64548d54407e4b
2b853be04a5ce5278c5ef713dfc7ba639c55b5b9
refs/heads/master
2023-04-08T04:26:37.432143
2021-04-22T03:15:31
2021-04-22T03:15:31
360,743,031
0
2
null
null
null
null
UTF-8
Java
false
false
1,058
java
package org.ciberfarma.app; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import org.ciberfarma.modelo.Producto; public class JPA_TEST2 { public static void name(String[] args) { Producto p = new Producto(); //p.setIdprod(12); p.setDescripcion("Papel noble"); p.setStock(35); p.setPrecio(8.60); p.setIdcategoria(4); p.setEstado(1); EntityManagerFactory factory = Persistence.createEntityManagerFactory("secion_1"); EntityManager em=factory.createEntityManager(); em.getTransaction().begin(); //em.persist(p); em.merge(p); em.getTransaction().commit(); List<Producto> lsProducto = em.createNamedQuery("Select p from Producto p", Producto.class).getResultList(); if(lsProducto==null) { System.out.println("Producto no existente"); }else { for (Producto producto : lsProducto) { System.out.println(producto.getIdprod()+" , "+producto.getDescripcion()); } } } }
[ "renatobonafon@hotmail.com" ]
renatobonafon@hotmail.com
f76ad2fd2aa561d9b37e938b3b4e3210b5bddfcb
e328f02f195ecd81406e35b51ae0f44e56124f0a
/module/src/main/java/com/sbt/rnd/meetup2017/dao/IDao.java
c14b6bc1503d832d72e55e01c68294ec66923229
[]
no_license
hamov-dv/sber.hakaton
846a026a6a1e54d0244fd0db4eba843dcd919555
a9e918fa0bfff7395c7a0e81150ecfa23d61c3e6
refs/heads/develop
2022-12-25T20:56:55.239369
2019-10-24T12:51:12
2019-10-24T12:51:12
211,292,048
0
1
null
2022-12-16T02:12:54
2019-09-27T10:11:12
Java
UTF-8
Java
false
false
724
java
package com.sbt.rnd.meetup2017.dao; import org.apache.lucene.search.Query; import org.hibernate.search.jpa.FullTextEntityManager; import javax.persistence.EntityManager; import java.util.List; import java.util.Map; public interface IDao { FullTextEntityManager getFullTextEntityManager(); EntityManager getEntityManager(); <T> T execute(IExecutor<T> executor); <T> Boolean save(T entity); <T> Boolean save(T entity,Boolean lock); <T> Boolean remove(T entity); <T> T findById(Class<T> entityClass, Long id); <T> List<T> search(String query); <T> List<T> search(String query,Map<String,Object> parameters); <T> List<T> fullTextSearch(Class<T> entityClass, Query query); }
[ "dxamov@mail.ru" ]
dxamov@mail.ru
e32ef4121a661ddb8632b83cf740381587fa6c0c
f743a33f0a25667d06e27e29d54ed4cfba0faee1
/app/src/main/java/com/aaron/design/filter/Filter1.java
0dc29d4f61dd253d1614f54fd4f81ce406509b93
[]
no_license
snailflying/designPattern
845e94219ae10b6540769d6959bf5daf9d43546d
fa30264b122a6e37c274c9da46ad55c9540b6862
refs/heads/master
2021-07-20T20:58:38.137984
2017-10-31T02:42:01
2017-10-31T02:42:01
108,811,218
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package com.aaron.design.filter; import com.aaron.design.filter.domain.Input; import com.aaron.design.filter.domain.Output; /** * Author:Aaron * Time:30/09/2017:4:05 PM */ public class Filter1 implements IFilter { @Override public Output execute(Chain chain) { RealChain realChain = (RealChain) chain; Input input = chain.input(); return realChain.proceed(input); } }
[ "aaron@magicwindow.cn" ]
aaron@magicwindow.cn
e640862338d64b62b0003f4dc3bc6502331aaf10
4ba291307588bc3522a6117d632ea8cb7b2cc1ba
/liangliang/app/src/main/java/cn/chono/yopper/activity/appointment/WishesForYouActivity.java
9478c55c150f7efe894176897804cc4d430fdfcc
[]
no_license
439ED537979D8E831561964DBBBD7413/LiaLia
838cf98c5a737d63ec1d0be7023c0e9750bb232b
6b4f0ad1dbfd4e85240cf51ac1402a5bc6b35bd4
refs/heads/master
2020-04-03T12:58:16.317166
2016-09-12T02:50:21
2016-09-12T02:50:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,103
java
package cn.chono.yopper.activity.appointment; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import cn.chono.yopper.MainFrameActivity; import cn.chono.yopper.R; import cn.chono.yopper.common.YpSettings; import cn.chono.yopper.adapter.WishesForYouAdapter; import cn.chono.yopper.utils.CheckUtil; /** * 征婚寄语 * Created by cc on 16/3/25. */ public class WishesForYouActivity extends MainFrameActivity implements WishesForYouAdapter.OnItemSendClickLitener { private ListView listView; private WishesForYouAdapter adapter; private Resources rcs; private String content; private EditText appointment_write_et; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentLayout(R.layout.personals_send_message_activity); Bundle bundle = getIntent().getExtras(); if (bundle.containsKey("content")) { content = bundle.getString("content"); } initView(); } private void initView() { rcs = getResources(); getTvTitle().setText("对他/她的寄语"); TextView tvOption = gettvOption(); tvOption.setVisibility(View.VISIBLE); tvOption.setText("确认"); tvOption.setTextColor(getResources().getColor(R.color.color_ff7462)); getGoBackLayout().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); getOptionLayout().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { content = appointment_write_et.getText().toString().trim(); Bundle bundle = new Bundle(); bundle.putSerializable("content", content); Intent intent = new Intent(WishesForYouActivity.this, MarriageSeekingActivity.class); intent.putExtras(bundle); setResult(YpSettings.MOVEMENT_SEND_MESSAGE, intent); finish(); } }); appointment_write_et = (EditText) findViewById(R.id.appointment_write_et); if(!CheckUtil.isEmpty(content)){ appointment_write_et.setText(content); } listView = (ListView) findViewById(R.id.listView); adapter = new WishesForYouAdapter(this); adapter.setOnItemClickLitener(this); listView.setAdapter(adapter); String[] send_message = rcs.getStringArray(R.array.send_message); adapter.setData(send_message); adapter.setSelectItem(content); } @Override public void onItemClickLitener(int position, String contentStr) { this.content = contentStr; adapter.setSelectItem(content); appointment_write_et.setText(content); appointment_write_et.requestFocus(); //这是关键 } }
[ "jinyu_yang@ssic.cn" ]
jinyu_yang@ssic.cn
352ab2ec91032e09e0ef31746dc493ec486f92db
d0179d175dbd004e64b48b24a9cec5818fbce2ea
/LibreriaCalculos/src/Calculos/Calculos.java
e6d7d06fad9607550c5ae7507c3fd89987975dc4
[]
no_license
rigonava14/EstructuradeDatos
22b2129467006b8c317e21a06099d958306cd9f6
a9cec96d708507c0a8a684e7cff5c177d1521c0a
refs/heads/master
2023-02-20T12:04:37.787836
2021-01-23T22:04:35
2021-01-23T22:04:35
299,419,831
0
0
null
null
null
null
UTF-8
Java
false
false
889
java
package Calculos; public class Calculos { double[] a; double[][] b; public Calculos(double[] a, double[][] b) { this.a = a; this.b = b; } public double[] prosesarCoseno(){ double[] retorno=a; for (int x=0; x<retorno.length;x++){ retorno[x]= Math.cos(a[x]); } return retorno; } public double[][] procesarSeno() { double[][] retorno = b; for (int x = 0; x < retorno.length; x++) { for (int y = 0; y < retorno[x].length; y++) { retorno[x][y] = Math.sin(b[x][y]); } } return retorno; } public double[] getA() { return a; } public void setA(double[] a) { this.a = a; } public double[][] getB() { return b; } public void setB(double[][] b) { this.b = b; } }
[ "71853131+rigonava14@users.noreply.github.com" ]
71853131+rigonava14@users.noreply.github.com
130b78f437e93afe6d9d29514221f4719a2ff2c3
8302830f00f91104405a8da6fb1b3246335ca35e
/src/main/java/com/imooc/sell_mybatis/VO/ProductInfoVO.java
d028213af500eb8cda03716af0e3d3fb8b3abfc4
[]
no_license
NOBUGNOERRORHAHAHA/sell_my
30ee4f14ebf379bc26d9f9962d30a96a66d01b57
c062ad7236bbf921f57b34e717239a068e64cb43
refs/heads/master
2020-05-23T03:15:17.118727
2019-05-15T07:15:01
2019-05-15T07:15:01
186,612,699
1
0
null
null
null
null
UTF-8
Java
false
false
1,082
java
package com.imooc.sell_mybatis.VO; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; public class ProductInfoVO { @JsonProperty("id") private String productId; @JsonProperty("name") private String productName; @JsonProperty("price") private BigDecimal productPrice; @JsonProperty("icon") private String productIcon; public String getProductId() { return productId; } public void setProductId(String productId) { this.productId = productId; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public BigDecimal getProductPrice() { return productPrice; } public void setProductPrice(BigDecimal productPrice) { this.productPrice = productPrice; } public String getProductIcon() { return productIcon; } public void setProductIcon(String productIcon) { this.productIcon = productIcon; } }
[ "1138276572@qq.com" ]
1138276572@qq.com
78f8062b742d218763363441102cbf6a659442e6
2efd30f75af9a50c7a7ac02aea51e806152ce17c
/src/com/yyyu/pattern/command/define/Invoker.java
c2d561c139327abbd26a707b4689181ba11991f9
[]
no_license
yuqibiao/design_pattern_java
640d90d1ec6f01c06c2bb0d94cb190cd2eab0d79
5793712b7468895c1cbd17ef62c0d31c287af86e
refs/heads/master
2021-01-17T09:02:34.102452
2017-08-08T06:53:06
2017-08-08T06:53:06
83,973,176
2
0
null
null
null
null
UTF-8
Java
false
false
272
java
package com.yyyu.pattern.command.define; /** * 命令的发出者 */ public class Invoker { private Command mCommand; public Invoker(Command command){ this.mCommand = command; } public void runCommand(){ mCommand.execute(); } }
[ "13165691974@163.com" ]
13165691974@163.com
b87c6c0869511d6f4675e32b982abdc8df92c51e
e39843b2dead25cce89aec95f0cf2953fb43321d
/app/src/main/java/vision/genesis/clientapp/feature/main/dashboard/select_product/SelectProductActivity.java
b5f5ff3fc12af450395d3d254dc145b17a4fc848
[]
no_license
GenesisVision/android-client
6727d5c61f2134ea00b308b00a52fc531a78d110
319b7dfd53ad498a65c2ee80b0e0ce15aef8aec6
refs/heads/develop
2022-05-13T08:56:00.715425
2022-04-18T11:17:16
2022-04-18T11:17:16
118,433,575
16
7
null
2021-04-01T19:41:53
2018-01-22T09:14:35
Java
UTF-8
Java
false
false
2,539
java
package vision.genesis.clientapp.feature.main.dashboard.select_product; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import butterknife.ButterKnife; import butterknife.OnClick; import vision.genesis.clientapp.R; import vision.genesis.clientapp.feature.BaseSwipeBackActivity; import vision.genesis.clientapp.feature.main.external.attach.AttachExternalAccountActivity; import vision.genesis.clientapp.feature.main.fund.create.CreateFundActivity; import vision.genesis.clientapp.feature.main.fund.self_managed.create.CreateSelfManagedFundActivity; import vision.genesis.clientapp.feature.main.program.create.CreateProgramActivity; import vision.genesis.clientapp.feature.main.trading_account.create.CreateAccountActivity; import vision.genesis.clientapp.model.CreateProgramModel; import vision.genesis.clientapp.utils.ThemeUtil; /** * GenesisVisionAndroid * Created by Vitaly on 13/01/2021. */ public class SelectProductActivity extends BaseSwipeBackActivity { public static void startFrom(Activity activity) { Intent intent = new Intent(activity.getApplicationContext(), SelectProductActivity.class); activity.startActivity(intent); activity.overridePendingTransition(R.anim.activity_slide_from_right, R.anim.hold); } @OnClick(R.id.button_back) public void onBackClicked() { onBackPressed(); } @OnClick(R.id.button_fund) public void onFundClicked() { CreateFundActivity.startFrom(this); finishActivity(); } @OnClick(R.id.button_self_managed_fund) public void onSelfManagedFundClicked() { CreateSelfManagedFundActivity.startFrom(this); finishActivity(); } @OnClick(R.id.button_program) public void onProgramClicked() { CreateProgramActivity.startFrom(this, new CreateProgramModel()); finishActivity(); } @OnClick(R.id.button_trading_account) public void onTradingAccountClicked() { CreateAccountActivity.startWith(this, null); finishActivity(); } @OnClick(R.id.button_attach_external_account) public void onAttachExternalAccountClicked() { AttachExternalAccountActivity.startWith(this, null); finishActivity(); } @Override protected void onCreate(Bundle savedInstanceState) { setTheme(ThemeUtil.getCurrentThemeResource()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_select_product); ButterKnife.bind(this); } @Override public void onBackPressed() { finishActivity(); } private void finishActivity() { finish(); overridePendingTransition(R.anim.hold, R.anim.activity_slide_to_right); } }
[ "dev.prus@gmail.com" ]
dev.prus@gmail.com
a2ae9e0aa8c89b60ef7ed0d1d3a41f7143645873
a26a9e30f6c1f6ec4dbabbdb1caa9619db01231d
/src/main/java/io/github/cotide/dapper/core/unit/Cache.java
42d6330cb7af2112fc74d01e3dc8bbb8034628c2
[ "Apache-2.0" ]
permissive
abedormancy/sql2o-plus
4f6b6fe60d63fe9588242d23bbc14780a0908b66
eb8527fc4f99334250ccb1feedf8700e7e5742ad
refs/heads/master
2022-12-31T10:37:36.571276
2019-09-26T06:04:23
2019-09-26T06:04:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,795
java
package io.github.cotide.dapper.core.unit; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; public class Cache<TKey, TValue> { /** * 读写锁 */ private static ReadWriteLock _lock = new ReentrantReadWriteLock(); /** * 缓存集合 */ private Map<TKey, TValue> _map = new HashMap<TKey, TValue>(); /** * 获取缓存集合总数 * @return */ public int getCount() { return _map.size(); } /** * 获取缓存值 * @param key 键名 * @param factory 值 * @return */ public TValue get(TKey key,Callable<TValue> factory){ // 检查缓存 _lock.readLock().lock(); TValue val; try{ val = _map.getOrDefault(key, null); if(val!=null) { return val; } }finally { _lock.readLock().unlock(); } // 初次读取,写入缓存 _lock.writeLock().lock(); try { // 再次检查 val = _map.getOrDefault(key, null); if(val!=null) { return val; } // 缓存 try { val = factory.call(); } catch (Exception e) { return null; } _map.put(key, val); return val; } finally { _lock.writeLock().unlock(); } } /** * 清除缓存 */ public void flush(){ _lock.writeLock().lock(); try { _map.clear(); } finally { _lock.writeLock().unlock(); } } }
[ "xcli.code@gmail.com" ]
xcli.code@gmail.com
b605622cc7e45b77d9bffdeeb5fdf4f21c96d4d7
2c4c85d351506bf379b2c86922547242e2733ae8
/Program/src/Logic/FileParser.java
88cc943689d3f5b483a39046e6c03494dcd19c9e
[]
no_license
Ligerd/TerritoryDivision-VoronoiDiagram
8d6f112d612152656a05f2b2e4427700e2848dcd
fdd88246233a920158d69b560ef5b5b3a70e1df6
refs/heads/master
2020-05-20T23:23:40.547301
2019-05-10T16:19:11
2019-05-10T16:19:11
185,799,549
0
0
null
null
null
null
UTF-8
Java
false
false
12,582
java
package Logic; import Data.*; import javafx.scene.control.Alert; import java.io.*; import java.util.ArrayList; import java.util.HashMap; public class FileParser { private ArrayList<KeyPoint> keyPoints; private HashMap<String, DefinitionObject> definitions; private ArrayList<MapObject> objects; private Contours contours; private int currentLineNumber = 0; private int partOfFile = 0; private ErrorMessage errorMessage; public HashMap<String, DefinitionObject> getDefinitions() { return definitions; } public FileParser() { this.keyPoints = new ArrayList<>(); contours = new Contours(); definitions = new HashMap<>(); objects = new ArrayList<>(); errorMessage = new ErrorMessage(); } public ArrayList<KeyPoint> getKeyPoints() { return keyPoints; } public Contours getContours() { return contours; } public boolean readFile(File file) throws IOException { BufferedReader bufferedReader; boolean result; String line; if (file == null) { errorMessage.Message("Plik nie może być nullem.", Alert.AlertType.ERROR); return false; } try { bufferedReader = new BufferedReader(new FileReader(file)); result = true; } catch (FileNotFoundException e) { System.out.println(e); return false; } while ((line = bufferedReader.readLine()) != null && result) { currentLineNumber++; if (currentLineNumber == 1 && line.isEmpty()) { errorMessage.Message("Wystąpił błąd podczas wczytywania pliku. Plik nie może zaczynać się z linni pustęj. Poprawny format pierwszej linii: # Kontury terenu (wymienione w kolejności łączenia): Lp. x y oraz definiowanie puntków.", Alert.AlertType.ERROR); return false; } else if (line.isEmpty()) { continue; } else { result = analyseLine(line); } } if (partOfFile == 0 && currentLineNumber == 0 && (bufferedReader.readLine()) == null) { errorMessage.Message("Wystąpił błąd podczas wczytywania pliku. Plik nie może być pusty", Alert.AlertType.ERROR); return false; } else if (partOfFile == 0 && currentLineNumber != 0 && result) { errorMessage.Message("Wystąpił błąd podczas wczytywania pliku. Dla dzialania programu muszą być zdefiniowane punkty kluczowe. Dla rozpoczęcia definiowania punktów kluczowych muszi być podana linija :# Punkty kluczowe: Lp. x y Nazwa", Alert.AlertType.ERROR); return false; } else if (contours.getSize() < 3) { errorMessage.Message("Wystąpił błąd podczs wczytywania pliku. Punktów definiujących kontur nie może być mniej niż 3", Alert.AlertType.ERROR); return false; } for (int i = 0; i < keyPoints.size(); i++) { if (!contours.checkPointInContur(keyPoints.get(i))) { errorMessage.Message("Punkt kluczowy nie znajduje się w obszarze nazwa punktu kluczowego: " + keyPoints.get(i).getName(), Alert.AlertType.ERROR); return false; } } if (checkKeyPointAndMapObject()) { errorMessage.Message("Punkt kluczowy oraz obiekt mają takie same współrzędne. To jest nie dopuszczalne.", Alert.AlertType.ERROR); return false; } return result; } private boolean analyseLine(String line) { boolean result = false; if (currentLineNumber == 1) { if (line.charAt(1) == '#' || line.charAt(0) == '#') { result = true; } else { errorMessage.Message("Nie poprawny format pierwszej linii pliku. Plik musi zaczynać się od definicji konturów." + "Żeby rozpocząć definiowanie konturów trzeba napisać liniję: # Kontury terenu (wymienione w kolejności łączenia): Lp. x y", Alert.AlertType.ERROR); return false; } } else if (line.startsWith("#")) { partOfFile++; result = true; } else if (currentLineNumber > 0 && partOfFile == 0) { if (checkFormatContourLine(line)) { result = addElementToContour(line); } } else if (currentLineNumber > 0 && partOfFile == 1) { if (checkFormatKeyPointLine(line)) { result = addKeyPointToList(line); } } else if (currentLineNumber > 0 && partOfFile == 2) { result = addDefinitionObject(line); } else if (currentLineNumber > 0 && partOfFile == 3) { result = addMapObject(line); } return result; } private boolean checkFormatContourLine(String line) { line = line.replace(",", "."); String[] words = line.split("\\s+"); double x; double y; if (words.length != 3) { errorMessage.Message("Wystąpił błąd podczas wczytywania punktów konturu. Nie poprawne formatowanie konturów w linii " + currentLineNumber + ". " + "Format linii muszi być następujący: # Kontury terenu (wymienione w kolejności łączenia): Lp. x y", Alert.AlertType.ERROR); return false; } try { Double.parseDouble(words[0]); x = Double.parseDouble(words[1]); y = Double.parseDouble(words[2]); } catch (NumberFormatException e) { System.out.println(e); errorMessage.Message("Wystąpił błąd podczas wczytywania punktów konturu. Numer punktu oraz współrzędne punktów definujących kontur mogą być zadane tylko liczbami. Błąd wystąpił w linii: " + currentLineNumber + "" + "Poprawny format jes następujący: # Kontury terenu (wymienione w kolejności łączenia): Lp. x y", Alert.AlertType.ERROR); return false; } if (x < 0 || y < 0) { errorMessage.Message("Wystąpił bład podczas wczytywania punktów definiujących contur. Współrzędne nie mogą być ujemne. Błąd wystąpił w linijce: " + currentLineNumber, Alert.AlertType.ERROR); return false; } return true; } private boolean checkFormatKeyPointLine(String line) { line = line.replace(",", "."); String[] words = line.split("\\s+"); double x; double y; if (line == null) { errorMessage.Message("Wystąpił bład w podczs wczytywania punktów kluczowych. Współrzędne definiujące punkty kluczowy nie zostały podane", Alert.AlertType.ERROR); } if (words.length < 4) { System.out.println("Wystąpił błąd podczas wczytywania punktów kluczowych. Nie poprawny formatowanie pliku w linijce: " + currentLineNumber); errorMessage.Message("Wystąpił błąd podczas wczytywania puktów kluczowych. Nie poprawny format w linii " + currentLineNumber + "" + "Poprawny format jest następujący: # Punkty kluczowe: Lp. x y Nazwa", Alert.AlertType.ERROR ); return false; } try { Double.parseDouble(words[0]); x = Double.parseDouble(words[1]); y = Double.parseDouble(words[2]); } catch (NumberFormatException e) { System.out.println(e); errorMessage.Message("Wystąpił błąd podczas wczytywania punktów kluczowych. Numer puntku oraz współrzędne definujące punkt kluczowy mogą być zadane tylko liczbami. Błąd wystąpił w linii: " + currentLineNumber + "" + "Poprawny format jest następujący: # Punkty kluczowe: Lp. x y Nazwa", Alert.AlertType.ERROR); return false; } if (x < 0 || y < 0) { errorMessage.Message("Wystąpił bład podczas wczytywania punktów kluczowych. Współrzędne nie mogą być ujemne. Błąd wystąpił w linijce: " + currentLineNumber, Alert.AlertType.ERROR); return false; } return true; } private boolean addElementToContour(String line) { String words[] = line.split("\\s+"); double x = Double.parseDouble(words[1]); double y = Double.parseDouble(words[2]); Point point = new Point(x, y); contours.addPointToContour(point); return true; } private boolean addKeyPointToList(String line) { double x; double y; String name = ""; StringBuilder stringBuilder = new StringBuilder(name); String[] words = line.split("\\s+"); x = Double.parseDouble(words[1]); y = Double.parseDouble(words[2]); for (int i = 3; i < words.length; i++) { name = name + " " + words[i]; } KeyPoint keyPoint = new KeyPoint(x, y, name); keyPoints.add(keyPoint); return true; } private boolean addDefinitionObject(String line) { line = line.replace(",", "."); String[] words = line.split("\\s+"); DefinitionObject definitionObject = new DefinitionObject(words[1], words); definitions.put(words[1], definitionObject); return true; } private boolean addMapObject(String line) { line = line.replace(",", "."); String[] words = line.split("\\s+"); double x; double y; MapObject mapObject = new MapObject(); String string = ""; int valueInt; double valueDouble; String nameOfParametr; String elementOfDefinition; DefinitionObject definitionObject = definitions.get(words[1]); if (definitionObject != null) { for (int i = 2; i < words.length; i++) { elementOfDefinition = definitionObject.getElementOfDefinition(); if (elementOfDefinition.compareTo("X") == 0) { x = Double.parseDouble(words[i]); mapObject.setX(x); } else if (elementOfDefinition.compareTo("Y") == 0) { y = Double.parseDouble(words[i]); mapObject.setY(y); } else { nameOfParametr = elementOfDefinition; elementOfDefinition = definitionObject.getElementOfDefinition(); if (elementOfDefinition.compareTo("double") == 0) { valueDouble = Double.parseDouble(words[i]); mapObject.addDoubleParametr(nameOfParametr, valueDouble); } else if (elementOfDefinition.compareTo("String") == 0) { for (int index = i; index < words.length; index++) { string = string + " " + words[index]; if (words[index].endsWith("\"")) { index = index++; i = index; break; } } mapObject.addStringParameter(nameOfParametr, string); } else if (elementOfDefinition.compareTo("int") == 0) { valueInt = Integer.parseInt(words[i]); mapObject.addIntParametr(nameOfParametr, valueInt); } else { errorMessage.Message("Wystąpił bład podczas wczytywania obiektów. Proszę o sprawdzeniu poprawności napisania: String , int ,double, X, Y", Alert.AlertType.ERROR); return false; } } } if (contours.checkPointInContur(new Point((int) mapObject.getX(), (int) mapObject.getY()))) { mapObject.setType(words[1]); objects.add(mapObject); } definitionObject.backToStart(); } return true; } public ArrayList getObjects() { return objects; } public boolean checkKeyPointAndMapObject() { for (int i = 0; i < keyPoints.size(); i++) { for (int index = 0; index < objects.size(); index++) if (Double.compare(keyPoints.get(i).getX(), objects.get(index).getX()) == 0) { if (Double.compare(keyPoints.get(i).getY(), objects.get(index).getY()) == 0) { return true; } } } return false; } }
[ "fa_74@list.ru" ]
fa_74@list.ru
01e51ee5d83dfbc2e3845b722c96f0878e3ea8d4
2b6a1a5588d9f2e9d9eef9df366f59cc7c765529
/src/main/java/ru/mtuci/shaa/simpleapi/conroller/SubjectController.java
4b012ad1e67ae162909fcb98358c08d897a1c7ad
[]
no_license
zipa455/simpleapi
f3974c79ae7a6254ba53e55c0a752f628218c4df
ab50d5cc69f380c50f07d3262070f5b05b3fda1b
refs/heads/master
2023-01-07T21:34:10.044608
2020-11-06T23:33:41
2020-11-06T23:33:41
308,595,688
0
2
null
null
null
null
UTF-8
Java
false
false
1,888
java
package ru.mtuci.shaa.simpleapi.conroller; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import ru.mtuci.shaa.simpleapi.dto.SubjectDto; import ru.mtuci.shaa.simpleapi.dto.SubjectWithParentsDto; import ru.mtuci.shaa.simpleapi.service.DefaultSubjectService; import javax.xml.bind.ValidationException; import java.util.List; @Slf4j @RestController @RequestMapping( value = "/api/v1/subject", produces = MediaType.APPLICATION_JSON_VALUE ) @AllArgsConstructor public class SubjectController { private final DefaultSubjectService defaultSubjectService; @GetMapping( "/byId") public SubjectWithParentsDto getAll(@RequestParam Long id) { log.info( "get Subject by ID: " + id ); return this.defaultSubjectService.findById( id ); } @GetMapping("/all") public List<SubjectDto> getAll() { log.info( "get Subject ALLL" ); return this.defaultSubjectService.findAll(); } @PostMapping("/add") public SubjectDto saveNewSubject( @RequestBody SubjectDto subject ) throws ValidationException { log.info( "post new Subject: " + subject ); return this.defaultSubjectService.save( subject ); } @PostMapping("/setType/{id}") public SubjectDto saveNewSubject(@PathVariable Long id, @RequestBody String typeId ) throws ValidationException { log.info( "post Subject type: " + id + " type: " + typeId ); return this.defaultSubjectService.setType( id, typeId ); } @DeleteMapping("/del/{id}") public ResponseEntity<Void> deleteSubject(@PathVariable Long id) { log.info( "delete subject by id: " + id ); this.defaultSubjectService.deleteSubject( id ); return ResponseEntity.ok().build(); } }
[ "zipa455@gmail.com" ]
zipa455@gmail.com
476e2677c9588eaec3cfc5a599b85b652fb8d80c
7eb13d669cdeb914642a64e747ec6ef1484a64a1
/engine/src/es/eucm/eadandroid/ecore/control/GpsListener.java
5deee8d43ebf4697b7022ce33ae1c082c2bbbee1
[]
no_license
e-ucm/eadventure-legacy-android
7efe68326dc272cee467b597b66153adf17bcd11
905a4f45e83f59e199645c086a9708cd9a82410b
refs/heads/master
2016-09-02T00:51:45.594583
2014-01-30T14:48:09
2014-01-30T14:48:09
14,957,009
1
0
null
null
null
null
UTF-8
Java
false
false
4,640
java
/******************************************************************************* * <e-Adventure> Mobile for Android(TM) is a port of the <e-Adventure> research project to the Android(TM) platform. * * Copyright 2009-2012 <e-UCM> research group. * * <e-UCM> is a research group of the Department of Software Engineering * and Artificial Intelligence at the Complutense University of Madrid * (School of Computer Science). * * C Profesor Jose Garcia Santesmases sn, * 28040 Madrid (Madrid), Spain. * * For more info please visit: <http://e-adventure.e-ucm.es/android> or * <http://www.e-ucm.es> * * *Android is a trademark of Google Inc. * * **************************************************************************** * This file is part of <e-Adventure> Mobile, version 1.0. * * Main contributors - Roberto Tornero * * Former contributors - Alvaro Villoria * Juan Manuel de las Cuevas * Guillermo Martin * * Directors - Baltasar Fernandez Manjon * Eugenio Marchiori * * You can access a list of all the contributors to <e-Adventure> Mobile at: * http://e-adventure.e-ucm.es/contributors * * **************************************************************************** * <e-Adventure> Mobile is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * <e-Adventure> Mobile is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * See <http://www.gnu.org/licenses/> ******************************************************************************/ package es.eucm.eadandroid.ecore.control; import es.eucm.eadandroid.ecore.GameThread; import es.eucm.eadandroid.ecore.ECoreActivity.ActivityHandlerMessages; import android.location.Location; import android.location.LocationListener; import android.location.LocationProvider; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; public class GpsListener implements LocationListener { GpsManager manager; public GpsListener(GpsManager manager) { super(); this.manager=manager; Log.d("GpsListener", " XXXXXXXXXXXXXXXXXXXXXXXXX"); } public void onLocationChanged(Location location) { manager.updategps(location); Log.d("onLocationChanged", " XXXXXXXXXXXXXXXXXXXXXXXXX"); } public void onProviderDisabled(String provider) { Log.d("onProviderDisabled", " XXXXXXXXXXXXXXXXXXXXXXXXX"); } public void onProviderEnabled(String provider) { Log.d("onProviderEnabled", " XXXXXXXXXXXXXXXXXXXXXXXXX"); } public void onStatusChanged(String provider, int status, Bundle extras) { Log.d("onStatusChanged", " XXXXXXXXXXXXXXXXXXXXXXXXX "+status); switch (status) { case LocationProvider.AVAILABLE: if (Game.getInstance()==null) { manager.setActiveGps(true); }else{ //TODO tengo que cambiar a que continue Handler handler = GameThread.getInstance().getHandler(); Message msg = handler.obtainMessage(); Bundle b = new Bundle(); b.putInt("dialog", 0); msg.what = ActivityHandlerMessages.FINISH_DIALOG; msg.setData(b); msg.sendToTarget(); if(Game.getInstance().ispause()) { Game.getInstance().unpause(); } } break; case LocationProvider.TEMPORARILY_UNAVAILABLE: break; case LocationProvider.OUT_OF_SERVICE: if (Game.getInstance()==null) { Game.getInstance().pause(); Handler handler = GameThread.getInstance().getHandler(); String text=new String("gps service is currently out of service"); Message msg = handler.obtainMessage(); Bundle b = new Bundle(); b.putString("content", text); msg.what = ActivityHandlerMessages.SHOW_DIALOG; msg.setData(b); msg.sendToTarget(); } break; } } public void finish(){ try { this.finalize(); } catch (Throwable e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "jtorrente@e-ucm.es" ]
jtorrente@e-ucm.es
f57106f7cc4a867b6e82fc53dc488962d7872267
e4b4446937a636b910c3e9a94eface5b0dd2ac6f
/plugins/exceloutput/src/main/java/org/apache/hop/pipeline/transforms/exceloutput/ExcelField.java
907c1e69ec833283e2a25836ea75006de2539876
[ "Apache-2.0" ]
permissive
mattcasters/hop-plugins
7c2af8a29213a294311a5f2c6877e67e2e2e4515
4ee0c586a9c093dc7ddda1cad5a8dd41a1ac5c23
refs/heads/main
2023-03-15T19:48:38.161163
2021-03-08T14:14:06
2021-03-08T14:14:50
345,599,391
0
1
Apache-2.0
2021-03-08T09:25:56
2021-03-08T09:25:55
null
UTF-8
Java
false
false
2,798
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.hop.pipeline.transforms.exceloutput; import org.apache.hop.core.injection.Injection; import org.apache.hop.core.row.value.ValueMetaFactory; /** * Describes a single field in an excel file * <p> * TODO: allow the width of a column to be set --> data.sheet.setColumnView(column, width); * TODO: allow the default font to be set * TODO: allow an aggregation formula on one of the columns --> SUM(A2:A151) * * @author Matt * @since 7-09-2006 */ public class ExcelField implements Cloneable { @Injection( name = "NAME", group = "FIELDS" ) private String name; private int type; @Injection( name = "FORMAT", group = "FIELDS" ) private String format; public ExcelField( String name, int type, String format ) { this.name = name; this.type = type; this.format = format; } public ExcelField() { } public int compare( Object obj ) { ExcelField field = (ExcelField) obj; return name.compareTo( field.getName() ); } public boolean equal( Object obj ) { ExcelField field = (ExcelField) obj; return name.equals( field.getName() ); } @Override public Object clone() { try { Object retval = super.clone(); return retval; } catch ( CloneNotSupportedException e ) { return null; } } public String getName() { return name; } public void setName( String fieldname ) { this.name = fieldname; } public int getType() { return type; } public String getTypeDesc() { return ValueMetaFactory.getValueMetaName( type ); } public void setType( int type ) { this.type = type; } @Injection( name = "TYPE", group = "FIELDS" ) public void setType( String typeDesc ) { this.type = ValueMetaFactory.getIdForValueMeta( typeDesc ); } public String getFormat() { return format; } public void setFormat( String format ) { this.format = format; } @Override public String toString() { return name + ":" + getTypeDesc(); } }
[ "mattcasters@gmail.com" ]
mattcasters@gmail.com
78644a60ad53980a60e8cd59754eb49d3afa79e3
7e713646a0619267b421aafa41a9afeeaf7a0108
/src/main/java/com/gdztyy/inca/mapper/BmsStAdjustTmpBakMapper.java
b9fffe1b49aab67603357ccbd492a20f050efd4c
[]
no_license
liutaota/ipl
4757e35d1100ca892f2137b690ee4b43b908dc19
9d53b9044ba56b6ea65f1347a779d4b66e075bea
refs/heads/master
2023-03-21T11:28:42.663574
2021-03-05T08:49:33
2021-03-05T08:49:33
344,747,852
0
0
null
null
null
null
UTF-8
Java
false
false
305
java
package com.gdztyy.inca.mapper; import com.gdztyy.inca.entity.BmsStAdjustTmpBak; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * <p> * Mapper 接口 * </p> * * @author peiqy * @since 2020-08-18 */ public interface BmsStAdjustTmpBakMapper extends BaseMapper<BmsStAdjustTmpBak> { }
[ "liutao@qq.com" ]
liutao@qq.com
b346c29956887d36cd9e056ddf3dbc39cf915556
ed03478dc06eb8fea7c98c03392786cd04034b82
/src/support/community/framework/AppRequestContext.java
913be88c7e348a0af23dd10ac749924e2bd097fc
[]
no_license
sumit-kul/cera
264351934be8f274be9ed95460ca01fa9fc23eed
34343e2f5349bab8f5f78b9edf18f2e0319f62d5
refs/heads/master
2020-12-25T05:17:19.207603
2016-09-04T00:02:31
2016-09-04T00:02:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,048
java
package support.community.framework; import java.util.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import support.community.application.*; import org.acegisecurity.*; import org.acegisecurity.context.*; import org.acegisecurity.userdetails.*; import org.apache.commons.logging.*; import com.era.community.admin.dao.*; /** * Generic application context object for each request that will be bound to the request * thread by an AppRequestContextHolder so that it is available to the rest of the application * code. Each application will typically subclass this class to provide and application-specific * context with more function. */ public class AppRequestContext { protected Log logger = LogFactory.getLog(getClass()); private BusinessParamFinder businessParamFinder; /** * Save a reference to the associated request object. */ private HttpServletRequest request; /** * Save a reference to the associated response object. */ private HttpServletResponse response; /** * Backlink stack. */ private BacklinkStack backlinkStack; /** * Save these items when the context is created because the values returned by * methods on the request object will change when the request is forwarded to * a JSP - they will then reflect the JSP and be useless. */ private String requestUri; private String requestUrl; private String rootUrl; private String contextPath; private String contextUrl; /** * Protected constructor creating a context for the given request. */ protected AppRequestContext() throws Exception { } /** * Protected constructor creating a context for the given request. */ public void init(HttpServletRequest req, HttpServletResponse resp) throws Exception { request = req; response = resp; requestUri = req.getRequestURI(); Map<String, String> map = new HashMap<String, String>(1); map.put(BacklinkStack.PARAMETER_NAME, ""); requestUrl = AppRequestUtils.getFullRequestUrl(req, map); contextPath = req.getContextPath(); rootUrl = AppRequestUtils.serverURL(req).toString(); contextUrl = rootUrl+contextPath; backlinkStack = createBacklinkStack(req); } /** * Get the Acegi UserDetails object associated with the current user or null * if the current user is not authenticated. */ public UserDetails getCurrentUserDetails() throws Exception { SecurityContext sc = SecurityContextHolder.getContext(); if (sc==null) return null; Authentication auth = sc.getAuthentication(); if (auth==null) return null; Object user = auth.getPrincipal(); if (user==null) return null; if (!(user instanceof UserDetails)) return null; return (UserDetails)user; } public String getTextParameter(String name) throws Exception { try { BusinessParam p= businessParamFinder.getParamForCategoryAndName(BusinessParam.CATEGORY_STATIC_TEXT, name); return p.getValue(); } catch (ElementNotFoundException x) { return null; } } /** * Return true if the current user is authenticated. */ public boolean isUserAuthenticated() throws Exception { return getCurrentUserDetails()!=null; } /** * Return true if the current user is a system administrator */ public boolean isUserSysAdmin() throws Exception { return isCurrentUserInRole(RoleConstants.ROLE_SYS_ADMIN); } /** * Return true if the current user is a super administrator * This is a special role suport and maintenance purposes */ public boolean isUserSuperAdmin() throws Exception { return isCurrentUserInRole(RoleConstants.ROLE_SUPER_ADMIN); } /** * Determine whether the current user is in a given role. * @param role * @return */ public boolean isCurrentUserInRole(String role) { SecurityContext sc = SecurityContextHolder.getContext(); if (sc==null) return false; Authentication auth = sc.getAuthentication(); if (auth==null) return false; GrantedAuthority[] auths = auth.getAuthorities(); for (int i=0; i<auths.length; i++) if (role.equals(auths[i].getAuthority())) return true; return false; } public void exposeInView(String name, Object object) { request.setAttribute(name, object); } private BacklinkStack createBacklinkStack(HttpServletRequest request) throws Exception { /* * Instantiate a backlink stack from backlink cookie data in the request. */ BacklinkStack bstack = new BacklinkStack(request); /* * Get the current request URL. Do NOT call AppRequestUtils methods here since * they can change the ordering of parameters in the query string. */ String url = getRequestUrl(request); /* * If this URL is in the stack then remove it (and truncate the stack to that point). */ bstack.prune(url); /* * If a backlink parameter is present in the request data then push it onto the stack. * If the parameter has the value "ref" then user the referer header from the request. */ String backlink = request.getParameter(BacklinkStack.PARAMETER_NAME); if (backlink!=null&&backlink.equals("ref")) backlink = request.getHeader("Referer"); if (backlink!=null&&backlink.trim().length()>0) bstack.push(backlink); /* * Return the backlink stack object. */ return bstack; } public String getBacklink() throws Exception { return getBacklinkStack().top(); } /** * Helper method to get the current request URL. */ protected final String getRequestUrl(HttpServletRequest req) throws Exception { /* * Get the current request URL. Do NOT call AppRequestUtils methods here since * they can change the ordering of parameters in the query string. */ StringBuffer buf = req.getRequestURL(); String qs = req.getQueryString(); if (qs!=null&&qs.trim().length()>0) buf.append("?" +qs); return buf.toString(); } /** * Merge a set of parameters into the query string of a URL. The parameters are specified * as a Map and any that already appear in the specified URL are replaced while any that * are not present are added. * * @param url The URL into which query string parameters are to be merged. * @param params A set of parameters as a Map. * @return A new URL string with the specified parameters merged in. * @throws Exception */ public String computeUrl(Map<String, Object> params) throws JspException { String url = getFullRequestUrl(); return AppRequestUtils.computeUrl(url, params); } /** * */ @SuppressWarnings("unchecked") public Map<String, Object> getRequestParameters() throws JspException { String url = requestUrl; StringTokenizer tok = new StringTokenizer(url, "?"); String href = tok.nextToken(); String query = tok.hasMoreTokens() ? tok.nextToken() : null; return AppRequestUtils.parseQueryString(query); } /** * */ public final String getFullRequestUrl() throws JspException { return requestUrl; } /** * Return the (true) context path of the request. */ public final String getContextPath() { return contextPath; } /** * Return the (true) request URL without the query string. */ public final String getRequestUri() { return requestUri; } /** * Return the (true) URL for the context path. */ public final String getContextUrl() { return contextUrl; } /** * Return the "root" URL of the request including just the scheme, server and port. */ public final String getRootUrl() { return rootUrl; } /** * Return the current request object. */ public final HttpServletRequest getRequest() { return request; } public final HttpServletResponse getResponse() { return response; } public final BacklinkStack getBacklinkStack() { return backlinkStack; } public final void setBacklinkStack(BacklinkStack backlinks) { this.backlinkStack = backlinks; } public final void setBusinessParamFinder(BusinessParamFinder businessParamFinder) { this.businessParamFinder = businessParamFinder; } }
[ "sumitkul2005@gmail.com" ]
sumitkul2005@gmail.com
31b80f820c6dbc2852b347d87ab97fc3f8164a0c
09545859537336f14ed35aa0db29114b53397c33
/blog/src/storage/PostStorageImpl.java
9c5830459a54813773ea62a0fcf040a103b3a285
[]
no_license
Arzuman71/javaCore-library
65b29763ffb4d430cda1b869cc27e89f254cb9e0
385b1a0b841399686f075888ed049b10851fc0aa
refs/heads/master
2021-06-13T03:08:19.273553
2020-08-10T18:51:31
2020-08-10T18:51:31
254,415,318
0
0
null
null
null
null
UTF-8
Java
false
false
1,830
java
package storage; import exception.PostNotFoundException; import model.Post; public class PostStorageImpl implements PostStorage { private Post[] posts = new Post[10]; private int size = 0; @Override public void add(Post post) { if (size == posts.length) { extend(); } posts[size++] = post; } public Post getPostByTitle(String title) throws PostNotFoundException { for (int i = 0; i < size; i++) { if (posts[i].getTitle().equals(title)) { return posts[i]; } } throw new PostNotFoundException("does not exist"); } @Override public void searchPostsByKeyword(String keyword) { int tmp = 0; for (int i = 0; i < size; i++) { if (posts[i].getTitle().contains(keyword) || posts[i].getText().contains(keyword)) { System.out.println(posts[i]); } else { tmp = 1; } } if (tmp == 1 || size == 0) { System.out.println("not found"); } } @Override public void printAllPosts() { for (int i = 0; i < size; i++) { System.out.println(posts[i]); } } @Override public void printPostsByCategory(String category) { int tmp = 0; for (int i = 0; i < size; i++) { if (posts[i].getTitle().equals(category) || posts[i].getText().equals(category)) { System.out.println(posts[i]); } else { tmp = -1; } } if (tmp == -1 || size == 0) { System.out.println("not found"); } } private void extend() { Post[] tmp = new Post[posts.length + 10]; System.arraycopy(posts, 0, tmp, 0, posts.length); } }
[ "example@mail.com" ]
example@mail.com
b6024ce6fe6c48a27f1aa104ffd8d8a83a7471fc
367b237b9ec00ba24fb186bf574078f8e0496fd7
/calculator/src/calculator/datatypes/complex/ComplexValueParser.java
11bdd371ef045d0d10e64112e329afebd76f4cbf
[]
no_license
pyrolynx/Java
09b9b93151f41b23793b3440cf0af9c722e49c0d
b7bf1c96364f6241f0203d046a9093bcfefbaefe
refs/heads/master
2020-12-24T12:01:42.690726
2016-12-10T14:35:58
2016-12-10T14:35:58
73,097,868
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
703
java
package calculator.datatypes.complex; import calculator.AbstractValue; import calculator.AbstractValueParser; import calculator.ParseValueException; import calculator.datatypes.complex.ComplexValue;; public class ComplexValueParser implements AbstractValueParser { public AbstractValue parse(String value) throws ParseValueException { try { String[] values = value.split("\\+"); double r = Double.parseDouble(values[0]); double i = Double.parseDouble(values[1].split("i")[0]); return new ComplexValue(r, i); } catch (NumberFormatException exception) { throw new ParseValueException(); } } public String getDatatypeName() { return "комплексные числа"; } }
[ "briizzzz@mail.ru" ]
briizzzz@mail.ru
5cfe21e1b7885a549697de179a692be615e51a36
5ad31f7d3edf797ac309f0792922ac6fc6379c0c
/app/src/main/java/com/deckerth/thomas/mybooksscanner/viewmodel/MainActivityViewModel.java
2ba8f19d90cfd0796068ea04c653ce6b5b991e5e
[]
no_license
deckerth/MyBooksScanner
d833bd284294c3f37695b0177e9ff16382a6c7ae
d96aa00ca30c9649eb016b4281fc684911f55070
refs/heads/master
2021-07-01T01:02:05.526802
2020-11-01T12:00:51
2020-11-01T12:00:51
190,049,806
1
0
null
null
null
null
UTF-8
Java
false
false
1,941
java
package com.deckerth.thomas.mybooksscanner.viewmodel; import android.app.Application; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; import androidx.lifecycle.MediatorLiveData; import com.deckerth.thomas.mybooksscanner.DataRepository; import com.deckerth.thomas.mybooksscanner.ExportFileContent; public class MainActivityViewModel extends AndroidViewModel { // --Commented out by Inspection (09.12.2019 20:01):private static MainActivityViewModel sInstance; // MediatorLiveData can observe other LiveData objects and react on their emissions. private final MediatorLiveData<Boolean> mObservableBookListFilled; private final MediatorLiveData<Boolean> mObservableExportFileFilled; public MainActivityViewModel(Application application) { super(application); mObservableBookListFilled = new MediatorLiveData<>(); mObservableExportFileFilled = new MediatorLiveData<>(); // set by default null, until we get data from the database. mObservableBookListFilled.setValue(null); mObservableExportFileFilled.setValue(null); DataRepository repo = DataRepository.getInstance(); LiveData<Boolean> booksExist = repo.getBooksExist(); ExportFileContent content = ExportFileContent.getInstance(); LiveData<Boolean> contentFileFilled = content.getBooksExist(); // observe the changes of the flag from the database and forward them mObservableBookListFilled.addSource(booksExist, mObservableBookListFilled::setValue); mObservableExportFileFilled.addSource(contentFileFilled,mObservableExportFileFilled::setValue); } /** * Expose the LiveData Bookings query so the UI can observe it. */ public LiveData<Boolean> getBooksExist() { return mObservableBookListFilled; } public LiveData<Boolean> getExportFileFilled() { return mObservableExportFileFilled; } }
[ "deckerth@gmail.com" ]
deckerth@gmail.com
caf5e359a8128826de42c9e6bd8ccca3415f3ec7
4c6b9e2a7163f3b002defd7948207e157932f309
/guns-film/src/main/java/com/stylefeng/guns/rest/modular/film/service/DefaultFilmServiceImpl.java
560848629bb2a0e91db2798e90f3536de14a2db8
[ "Apache-2.0" ]
permissive
akafanfan/Guns_SpringBoot_Dubbo
77a57eaaba10935b1a4960901c3c1515c0a03281
440bf8d6e1ed9f7ca342334aecabf5a3fa3568ab
refs/heads/master
2020-04-22T20:00:11.910093
2019-02-15T12:16:01
2019-02-15T12:16:01
170,627,368
0
0
null
null
null
null
UTF-8
Java
false
false
12,877
java
package com.stylefeng.guns.rest.modular.film.service; import com.alibaba.dubbo.config.annotation.Service; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.plugins.Page; import com.stylefeng.guns.api.film.FilmServiceAPI; import com.stylefeng.guns.api.film.vo.*; import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.rest.common.persistence.dao.*; import com.stylefeng.guns.rest.common.persistence.model.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; @Component @Service(interfaceClass = FilmServiceAPI.class) public class DefaultFilmServiceImpl implements FilmServiceAPI { @Autowired private FBannerTMapper fBannerTMapper; @Autowired private FFilmTMapper fFilmTMapper; @Autowired private FCatDictTMapper fCatDictTMapper; @Autowired private FYearDictTMapper fYearDictTMapper; @Autowired private FSourceDictTMapper fSourceDictTMapper; @Autowired private FFilmInfoTMapper fFilmInfoTMapper; @Autowired private FActorTMapper fActorTMapper; @Override public List<BannerVo> getBanners() { List<BannerVo> result = new ArrayList<>(); List<FBannerT> banners = fBannerTMapper.selectList(null); for (FBannerT fBannerT: banners) { BannerVo bannerVo = new BannerVo(); bannerVo.setBannerId(fBannerT.getUuid()+""); bannerVo.setBannerUrl(fBannerT.getBannerUrl()); bannerVo.setBannerAddress(fBannerT.getBannerAddress()); result.add(bannerVo); } return result; } @Override public FilmVo getHotFilms(boolean isLimit, int nums, int nowPage, int sortId, int sourceId, int yearId, int catId) { FilmVo filmVo = new FilmVo(); List<FilmInfo> filmInfos = new ArrayList<>(); // 热映影片的限制条件 EntityWrapper<FFilmT> entityWrapper = new EntityWrapper<>(); entityWrapper.eq("film_status","1"); // 判断是否是首页需要的内容 if (isLimit){ // 如果是,则限制条数、限制内容为热映影片 Page<FFilmT> page = new Page<>(1, nums); List<FFilmT> fFilms = fFilmTMapper.selectPage(page, entityWrapper); // 组织filmInfos filmInfos = getFilmInfo(fFilms); filmVo.setFilmNum(fFilms.size()); filmVo.setFilmInfo(filmInfos); }else { //如果不是则是列表页,同样需要限制内容位热映影片 Page<FFilmT> page = null; // 1-按热门搜索,2-按时间搜索,3-按评价搜索 switch (sortId){ case 1: page = new Page<>(nowPage, nums, "film_box_office"); break; case 2: page = new Page<>(nowPage, nums, "film_time"); break; case 3: page = new Page<>(nowPage, nums, "film_score"); break; default: page = new Page<>(nowPage, nums, "film_box_office"); break; } //如果sourceId,yearId ,catId不为99 则表示要按照对应编号进行查找 if (sourceId!=99){ entityWrapper.eq("film_source", sourceId); } if (yearId != 99) { entityWrapper.eq("film_year", yearId); } if (catId != 99) { //#2#4#24 String strCat = "%#"+catId+"#%"; entityWrapper.like("film_cats", strCat); } List<FFilmT> fFilms = fFilmTMapper.selectPage(page, entityWrapper); //组织filmInfos filmInfos = getFilmInfo(fFilms); filmVo.setFilmNum(fFilms.size()); //总页数 = totalCounts/nums +1 int totalCounts = fFilmTMapper.selectCount(entityWrapper); int totalPage = (totalCounts/nums)+1; filmVo.setFilmInfo(filmInfos); filmVo.setNowPage(nowPage); filmVo.setTotalPage(totalPage); } return filmVo; } @Override public FilmVo getSoonFilms(boolean isLimit, int nums, int nowPage, int sortId, int sourceId, int yearId, int catId) { FilmVo filmVo = new FilmVo(); List<FilmInfo> filmInfos = new ArrayList<>(); // 热映影片的限制条件 EntityWrapper<FFilmT> entityWrapper = new EntityWrapper<>(); entityWrapper.eq("film_status","2"); // 判断是否是首页需要的内容 if (isLimit) { // 如果是,则限制条数、限制内容为热映影片 Page<FFilmT> page = new Page<>(1, nums); List<FFilmT> fFilms = fFilmTMapper.selectPage(page, entityWrapper); // 组织filmInfos filmInfos = getFilmInfo(fFilms); filmVo.setFilmNum(fFilms.size()); filmVo.setFilmInfo(filmInfos); }else { //如果不是则是列表页,同样需要限制内容位即将上映影片 Page<FFilmT> page = null; switch (sortId){ case 1: page = new Page<>(nowPage, nums, "film_preSaleNum"); break; case 2: page = new Page<>(nowPage, nums, "film_time"); break; case 3: page = new Page<>(nowPage, nums, "film_preSaleNum"); break; default: page = new Page<>(nowPage, nums, "film_preSaleNum"); break; } //如果sourceId,yearId ,catId不为99 则表示要按照对应编号进行查找 if (sourceId!=99){ entityWrapper.eq("film_source", sourceId); } if (yearId != 99) { entityWrapper.eq("film_year", yearId); } if (catId != 99) { //#2#4#24 String strCat = "%#"+catId+"#%"; entityWrapper.like("film_cats", strCat); } List<FFilmT> fFilms = fFilmTMapper.selectPage(page, entityWrapper); //组织filmInfos filmInfos = getFilmInfo(fFilms); filmVo.setFilmNum(fFilms.size()); //总页数 = totalCounts/nums +1 int totalCounts = fFilmTMapper.selectCount(entityWrapper); int totalPage = (totalCounts/nums)+1; filmVo.setFilmInfo(filmInfos); filmVo.setNowPage(nowPage); filmVo.setTotalPage(totalPage); } return filmVo; } @Override public FilmVo getClassicFilms(int nums, int nowPage, int sortId, int sourceId, int yearId, int catId) { FilmVo filmVo = new FilmVo(); List<FilmInfo> filmInfos = new ArrayList<>(); // 热映影片的限制条件 EntityWrapper<FFilmT> entityWrapper = new EntityWrapper<>(); entityWrapper.eq("film_status","3"); // 判断是否是首页需要的内容 //如果不是则是列表页,同样需要限制内容位即将上映影片 Page<FFilmT> page = null; // 1-按热门搜索,2-按时间搜索,3-按评价搜索 switch (sortId){ case 1: page = new Page<>(nowPage, nums, "film_box_office"); break; case 2: page = new Page<>(nowPage, nums, "film_time"); break; case 3: page = new Page<>(nowPage, nums, "film_score"); break; default: page = new Page<>(nowPage, nums, "film_box_office"); break; } //如果sourceId,yearId ,catId不为99 则表示要按照对应编号进行查找 if (sourceId!=99){ entityWrapper.eq("film_source", sourceId); } if (yearId != 99) { entityWrapper.eq("film_year", yearId); } if (catId != 99) { //#2#4#24 String strCat = "%#"+catId+"#%"; entityWrapper.like("film_cats", strCat); } List<FFilmT> fFilms = fFilmTMapper.selectPage(page, entityWrapper); //组织filmInfos filmInfos = getFilmInfo(fFilms); filmVo.setFilmNum(fFilms.size()); //总页数 = totalCounts/nums +1 int totalCounts = fFilmTMapper.selectCount(entityWrapper); int totalPage = (totalCounts/nums)+1; filmVo.setFilmInfo(filmInfos); filmVo.setNowPage(nowPage); filmVo.setTotalPage(totalPage); return filmVo; } //公共方法 private List<FilmInfo> getFilmInfo(List<FFilmT> fFilms){ List<FilmInfo> filmInfos = new ArrayList<>(); for (FFilmT fFilmT : fFilms ) { FilmInfo filmInfo = new FilmInfo(); filmInfo.setScore(fFilmT.getFilmScore()); filmInfo.setImgAddress(fFilmT.getImgAddress()); filmInfo.setFilmType(fFilmT.getFilmType()); filmInfo.setFilmScore(fFilmT.getFilmScore()); filmInfo.setFilmName(fFilmT.getFilmName()); filmInfo.setFilmId(fFilmT.getUuid()+""); filmInfo.setExpectNum(fFilmT.getFilmPresalenum()); filmInfo.setBoxNum(fFilmT.getFilmBoxOffice()); filmInfo.setShowTime(DateUtil.getDay(fFilmT.getFilmTime())); filmInfos.add(filmInfo); } return filmInfos; } // 获取票房排行榜 @Override public List<FilmInfo> getBoxRanking() { //正在上映的,票房前10名 EntityWrapper<FFilmT> entityWrapper = new EntityWrapper<>(); entityWrapper.eq("film_status", 1); Page<FFilmT> page = new Page<>(1, 10, "film_box_office"); List<FFilmT> fFilmTS = fFilmTMapper.selectPage(page, entityWrapper); List<FilmInfo> filmInfos = getFilmInfo(fFilmTS); return filmInfos; } @Override public List<FilmInfo> getExpectRanking() { // 条件 -> 即将上映的,预售前10名 EntityWrapper<FFilmT> entityWrapper = new EntityWrapper<>(); entityWrapper.eq("film_status", 1); Page<FFilmT> page = new Page<>(1, 10, "film_preSaleNum"); List<FFilmT> fFilmTS = fFilmTMapper.selectPage(page, entityWrapper); List<FilmInfo> filmInfos = getFilmInfo(fFilmTS); return filmInfos; } @Override public List<FilmInfo> getTop() { // 条件 -> 正在上映的,评分前10名 EntityWrapper<FFilmT> entityWrapper = new EntityWrapper<>(); entityWrapper.eq("film_status", 1); Page<FFilmT> page = new Page<>(1, 10, "film_score"); List<FFilmT> fFilmTS = fFilmTMapper.selectPage(page, entityWrapper); List<FilmInfo> filmInfos = getFilmInfo(fFilmTS); return filmInfos; } @Override public List<CatVo> getCats() { List<CatVo> cats = new ArrayList<>(); //查询实体对象 List<FCatDictT> fCatDictTS = fCatDictTMapper.selectList(null); //将实体对象转换为业务对象 for (FCatDictT fCatDictT:fCatDictTS) { CatVo catVo = new CatVo(); catVo.setCatId(fCatDictT.getUuid()+""); catVo.setCatName(fCatDictT.getShowName()); cats.add(catVo); } return cats; } @Override public List<SourceVo> getSources() { List<SourceVo> sources = new ArrayList<>(); List<FSourceDictT> source = fSourceDictTMapper.selectList(null); for (FSourceDictT fSourceDictT : source) { SourceVo sourceVo = new SourceVo(); sourceVo.setSourceId(fSourceDictT.getUuid()+""); sourceVo.setSourceName(fSourceDictT.getShowName()); sources.add(sourceVo); } return sources; } @Override public List<YearVo> getYears() { List<YearVo> years = new ArrayList<>(); List<FYearDictT> year = fYearDictTMapper.selectList(null); for (FYearDictT fYearDictT : year) { YearVo yearVo = new YearVo(); yearVo.setYearId(fYearDictT.getUuid()+""); yearVo.setYearName(fYearDictT.getShowName()); years.add(yearVo); } return years; } @Override public FilmDetailVo getFilmDetail(int searchType, String searchParam) { FilmDetailVo filmDetailVo = null; //searchType 1- 按名称 2- 按ID if(searchType==1){//有模糊匹配 filmDetailVo = fFilmTMapper.getFilmDetailByName("%"+searchParam+"%"); }else { filmDetailVo = fFilmTMapper.getFilmDetailById(searchParam); } return filmDetailVo; } }
[ "173358981@qq.com" ]
173358981@qq.com
920ec97b8e1b15cdf7695c52bf9cdd2d8d4d4516
9395a4b45ee35276f0765e16f2280ffd278481d2
/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java
c3555cb8b7591dc777d5af43de0f1738f72797af
[ "MIT" ]
permissive
pauljoda/refinedstorage
e958195cda9125f3cc89e7e256f53ac8f1afc945
572fad18ad834bedb6102eaa75e8743c77ddf923
refs/heads/mc1.11
2021-01-21T10:42:01.109510
2017-02-28T20:45:29
2017-02-28T20:45:29
83,473,005
0
0
null
2017-02-28T19:50:35
2017-02-28T19:50:35
null
UTF-8
Java
false
false
1,398
java
package com.raoulvdberge.refinedstorage.apiimpl.solderer; import com.raoulvdberge.refinedstorage.RSBlocks; import com.raoulvdberge.refinedstorage.RSItems; import com.raoulvdberge.refinedstorage.api.solderer.ISoldererRecipe; import com.raoulvdberge.refinedstorage.block.EnumFluidStorageType; import com.raoulvdberge.refinedstorage.item.ItemBlockFluidStorage; import com.raoulvdberge.refinedstorage.item.ItemProcessor; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import javax.annotation.Nonnull; public class SoldererRecipeFluidStorage implements ISoldererRecipe { private EnumFluidStorageType type; private NonNullList<ItemStack> rows = NonNullList.create(); public SoldererRecipeFluidStorage(EnumFluidStorageType type, int storagePart) { this.type = type; this.rows.add(new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC)); this.rows.add(new ItemStack(RSItems.FLUID_STORAGE_PART, 1, storagePart)); this.rows.add(new ItemStack(RSBlocks.MACHINE_CASING)); } @Override @Nonnull public ItemStack getRow(int row) { return rows.get(row); } @Override @Nonnull public ItemStack getResult() { return ItemBlockFluidStorage.initNBT(new ItemStack(RSBlocks.FLUID_STORAGE, 1, type.getId())); } @Override public int getDuration() { return 200; } }
[ "raoulvdberge@gmail.com" ]
raoulvdberge@gmail.com
2939c7fb5fcc26e7223efb1f79e92eb7cd15ac59
9a9e5bcd02b85b10a40457a495ea5267aac4aedf
/android/app/src/main/java/com/mdsolutions/mdscribe/MainActivity.java
9c1876ba2890a40ee5f503e2d393ccbd1e12fd39
[]
no_license
Ipsaeju/DictationApp
dd279e8c3c9204e9257bde687197884ad569e7c8
865e14057a26e42c6b1e89e42849b3594a599c33
refs/heads/master
2023-01-19T19:07:19.776894
2021-05-07T23:29:38
2021-05-07T23:29:38
252,631,458
1
1
null
2023-01-05T18:21:54
2020-04-03T04:22:28
JavaScript
UTF-8
Java
false
false
359
java
package com.mdsolutions.mdscribe; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "DictationApp"; } }
[ "36467114+Ipsaeju@users.noreply.github.com" ]
36467114+Ipsaeju@users.noreply.github.com
8ceaf06f78253a5af18dd50b2810608a021abb66
c21b84a3583c15303d619b2968183d436190cb53
/semiproject-practice/src/controller/inst/board/InstCommentWriteController.java
3955d661aab104becea00709c4f0452b7fc795ae
[]
no_license
LimJooSung/semiproject-Appul
52ce1be39ad7ad0f7928d7321b4380f075394608
87f3adbc12d18fcb4dd26c591341bb889f688e5e
refs/heads/master
2021-01-19T10:32:03.762038
2017-04-13T09:23:50
2017-04-13T09:23:50
87,876,295
0
1
null
null
null
null
UTF-8
Java
false
false
1,255
java
package controller.inst.board; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import controller.Controller; import model.inst.board.InstCommentDAO; import model.inst.board.InstCommentVO; import model.member.MemberVO; public class InstCommentWriteController implements Controller { @Override public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session=request.getSession(false); if (session == null || session.getAttribute("mvo") == null) { return "redirect:login.jsp"; } System.out.println("이곳은 write컨트롤러 입니다"); int boardNo = Integer.parseInt(request.getParameter("comment_board")); String id = request.getParameter("comment_id"); String content = request.getParameter("comment_content"); InstCommentVO vo = new InstCommentVO(); vo.setBoardNo(boardNo); vo.setContent(id); vo.setContent(content); vo.setMember((MemberVO) session.getAttribute("mvo")); InstCommentDAO.getInstance().postingInstComment(vo); String path = "redirect:DispatcherServlet?command=proShowContentNotHit&boardNo=" + vo.getBoardNo(); return path; } }
[ "KOSTA@192.168.0.159" ]
KOSTA@192.168.0.159
d65e761b0d5da7448abe387f99668ed7d570a8e6
ff3cf0b03f5424778f80a6bd6ca9bb3fcbcd1ac1
/src/opt/jmetal/problem/singleobjective/cec2005competitioncode/F07ShiftedRotatedGriewank.java
b4965bc1c9e5e5e293b12ad8e8f423997536b227
[]
no_license
jack13163/OilScheduleOperationPlatform
c3a395777d137e0f9c0edc39ddc849630cf16511
ae69f4e465b21d130d0b92ddbac44d5d38d3089b
refs/heads/master
2022-12-21T13:42:49.162696
2021-03-25T01:44:57
2021-03-25T01:44:57
197,735,331
3
3
null
2022-12-16T05:00:31
2019-07-19T08:35:30
Java
UTF-8
Java
false
false
3,537
java
// // Special Session on Real-Parameter Optimization at CEC-05 // Edinburgh, UK, 2-5 Sept. 2005 // // Organizers: // Prof. Kalyanmoy Deb // deb@iitk.ac.in // http://www.iitk.ac.in/kangal/deb.htm // A/Prof. P. N. Suganthan // epnsugan@ntu.edu.sg // http://www.ntu.edu.sg/home/EPNSugan // // Java version of the org.uma.test functions // // Matlab reference code // http://www.ntu.edu.sg/home/EPNSugan // // Java version developer: // Assistant Prof. Ying-ping Chen // Department of Computer Science // National Chiao Tung University // HsinChu City, Taiwan // ypchen@csie.nctu.edu.tw // http://www.csie.nctu.edu.tw/~ypchen/ // // Typical use of the org.uma.test functions in the Benchmark: // // // Create a Benchmark object // Benchmark theBenchmark = new Benchmark(); // // Use the factory function call to create a org.uma.test function object // // org.uma.test function 3 with 50 dimension // // the object class is "TestFunc" // TestFunc aTestFunc = theBenchmark.testFunctionFactory(3, 50); // // Invoke the function with x // double experimentoutput = aTestFunc.f(x); // // Version 0.90 // Currently, this version cannot handle any numbers of dimensions. // It cannot generate the shifted global optima and rotation matrices // that are not provided with the Matlab reference code. // It can handle all cases whose data files are provided with // the Matlab reference code. // Version 0.91 // Revised according to the Matlab reference code and the PDF document // dated March 8, 2005. // package opt.jmetal.problem.singleobjective.cec2005competitioncode; import opt.jmetal.util.JMetalException; public class F07ShiftedRotatedGriewank extends TestFunc { // Fixed (class) parameters static final public String FUNCTION_NAME = "Shifted Rotated Griewank's Function without Bounds"; static final public String DEFAULT_FILE_DATA = Benchmark.CEC2005SUPPORTDATADIRECTORY + "/griewank_func_data.txt"; static final public String DEFAULT_FILE_MX_PREFIX = Benchmark.CEC2005SUPPORTDATADIRECTORY + "/griewank_M_D"; static final public String DEFAULT_FILE_MX_SUFFIX = ".txt"; // Shifted global optimum private final double[] m_o; private final double[][] m_matrix; // In order to avoid excessive memory allocation, // a fixed memory buffer is allocated for each function object. private double[] m_z; private double[] m_zM; // Constructors public F07ShiftedRotatedGriewank(int dimension, double bias) throws JMetalException { this(dimension, bias, DEFAULT_FILE_DATA, DEFAULT_FILE_MX_PREFIX + dimension + DEFAULT_FILE_MX_SUFFIX); } public F07ShiftedRotatedGriewank(int dimension, double bias, String file_data, String file_m) throws JMetalException { super(dimension, bias, FUNCTION_NAME); // Note: dimension starts from 0 m_o = new double[mDimension]; m_matrix = new double[mDimension][mDimension]; m_z = new double[mDimension]; m_zM = new double[mDimension]; // Load the shifted global optimum Benchmark.loadRowVectorFromFile(file_data, mDimension, m_o); // Load the matrix Benchmark.loadMatrixFromFile(file_m, mDimension, mDimension, m_matrix); } // Function body public double f(double[] x) { double result = 0.0; Benchmark.shift(m_z, x, m_o); Benchmark.rotate(m_zM, m_z, m_matrix); result = Benchmark.griewank(m_zM); result += mBias; return (result); } }
[ "18163132129@163.com" ]
18163132129@163.com
9363ee7149b4b04347e8da962a1bca426d61ab24
b7a746d08879719aad6bd1e3ed6883c769b61ce3
/code/concurrency/ee-managedexecutor/src/main/java/com/itbuzzpress/concurrency/job/CallableTask.java
f99b6432854c52eb2986d8e8c33af41bd3b00220
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
fmarchioni/practical-enterprise-development
0b8f97f2b2a257de1f14c398b272121005f7cfea
5d7be1b63434f2658ba169a142a02e62a60b38f5
refs/heads/master
2022-12-31T14:05:19.857288
2022-10-09T09:37:39
2022-10-09T09:37:39
184,075,869
11
13
null
2020-12-03T11:54:58
2019-04-29T13:24:56
Java
UTF-8
Java
false
false
368
java
package com.itbuzzpress.concurrency.job; import java.util.Map; import java.util.concurrent.Callable; public class CallableTask implements Callable<Long> { private int id; public CallableTask(int id) { this.id = id; } public Long call() { long summation = 0; for (int i = 1; i <= id; i++) { summation += i; } return new Long(summation); } }
[ "francesco@fedora.redhat.com" ]
francesco@fedora.redhat.com
434dee8349bb446050c24bc17e54512f0c0aa289
8da36de2c717af73e5a8cc85f3cb075c04242341
/app/src/androidTest/java/top/aiboom/exportpicture/ExampleInstrumentedTest.java
0eed6f563a1cac81d7256b20f7e32174df2b7959
[]
no_license
aiboom/ExPic
9e3b674b6f6fded32c114a7f676e06c7c7947e60
ded6390447a11e0d756a96c5decfefcf37b0bd25
refs/heads/master
2020-03-17T23:01:57.831937
2018-05-19T04:16:31
2018-05-19T04:16:31
134,028,797
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package top.aiboom.exportpicture; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("top.aiboom.exportpicture", appContext.getPackageName()); } }
[ "hugl@maxeye.com.cn" ]
hugl@maxeye.com.cn
09c97eeea47a1f3553e6ac4d32b8b2e1d041a0e1
456d43c584fb66f65c6a7147cdd22595facf8bd9
/jpa/deferred/src/main/java/example/model/Customer1814.java
8c20ead961119be7dd8ba05192ae57bb0cb8a306
[ "Apache-2.0" ]
permissive
niushapaks/spring-data-examples
283eec991014e909981055f48efe67ff1e6e19e6
1ad228b04523e958236d58ded302246bba3c1e9b
refs/heads/main
2023-08-21T14:25:55.998574
2021-09-29T13:14:33
2021-09-29T13:14:33
411,679,335
1
0
Apache-2.0
2021-09-29T13:11:03
2021-09-29T13:11:02
null
UTF-8
Java
false
false
628
java
package example.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer1814 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer1814() {} public Customer1814(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer1814[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
[ "ogierke@pivotal.io" ]
ogierke@pivotal.io
3dd84c04ccc839fa73aea52ffe7bf4faf5a1e7a7
ff2b8fde9139199a86db63017944b161f1e99478
/Hangman.java
8fc4b6a7ffb5de083244eb61164f6bef89445863
[]
no_license
jornbootsma/Hangman-Java
19c3b51f29391b0931db4fa28660fd3e0b778598
aa1592994d7a19a0f43dc6ecabf2940546a34572
refs/heads/main
2023-03-02T15:30:16.380034
2021-02-07T14:13:32
2021-02-07T14:13:32
336,803,293
0
0
null
null
null
null
UTF-8
Java
false
false
6,061
java
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.Scanner; public class Hangman { static int maxGuesses = 9; int wrongGuesses; int correctLetters; int guessesLeft; String word; String endMessage; boolean gameEnds; char[] state; List<Character> missedLetters; public static String[] wordsToUse = {"aikido", "baseball", "cricket", "darts", "football", "golf", "handball", "judo", "karate", "lacrosse", "giraffe", "rhino", "truck", "blue", "potato", "school", "elephant"}; public Hangman() { word = randomWord(); missedLetters = new ArrayList<Character>(); state = new char[word.length()]; Arrays.fill(state, '_'); wrongGuesses = 0; correctLetters = 0; gameEnds = false; endMessage = ""; } /** * Returns a random integer number between the given lower bound and upper bound. * @param upperBound * @param lowerBound * @return randomNumber */ public static int randomNumber(int upperBound, int lowerBound) { Random r = new Random(); return r.nextInt(upperBound - lowerBound) + lowerBound; } /** * A random word is picked from the array of possible words. * @return randomWord */ public static String randomWord() { int rand = randomNumber(wordsToUse.length, 0); return wordsToUse[rand]; } /** * Runs the hangman game. * In each round the user is asked to give a letter as input. * It is checked whether or not this letter is correct. * The guessed letters are saved, either in an object with * correct letters or in an object with missed letters. * After each round the current progress is shown to the user. */ public void playGame() { System.out.println("Type \"quit\" whenever you want to stop the game."); displayProgress(); while (true) { char letter = askLetter(); if (!gameEnds) { if (word.contains(Character.toString(letter))) { for (int i = 0; i < word.length(); i++) { if (word.charAt(i) == letter) { state[i] = letter; correctLetters ++; } } } else { missedLetters.add(letter); wrongGuesses ++; } } displayProgress(); if (word.length() == correctLetters) { gameEnds = true; endMessage = "Congratulations, you have won the game!"; } if (wrongGuesses >= maxGuesses) { gameEnds = true; endMessage = "You have lost the game. The correct answer was \"" + word + "\"."; } if (gameEnds) { System.out.println(endMessage); break; } } } /** * Asks the user to give some input letter. It checks whether the given * input is valid. * @return char guess */ public char askLetter() { Scanner input = new Scanner(System.in); char guess = 'a'; while (true) { String letter = input.next(); if (letter.equals("quit") || letter.equals("Quit") || letter.equals("QUIT")) { gameEnds = true; endMessage = "The game is stopped prematuraly."; break; } else { if (letter.length() == 1) { guess = letter.charAt(0); if (Character.isAlphabetic(guess)) { guess = Character.toLowerCase(guess); boolean alreadyTried = alreadyTried(guess); if (alreadyTried) { System.out.println("The given input has already been tried. Try another letter."); } else { break; } } else { System.out.println("The given input is not a letter. Try again."); } } else { System.out.println("Wrong input, you need to choose exactly one letter. Try again."); } } } return guess; } /** * Checks if a given character has already been tried. * It first checks if the character is available in the wrong guessed letters. * If not, it checks if the character is available in correct guessed letters. * @param c * @return true if c is already tried */ public boolean alreadyTried(char c) { boolean alreadyTried = false; if (missedLetters.contains(c)) { alreadyTried = true; } else { for (char c2 : state) { if (c2 == c) { alreadyTried = true; break; } } } return alreadyTried; } public void displayProgress() { guessesLeft = maxGuesses - wrongGuesses; if (guessesLeft > 1) { System.out.println("You have " + guessesLeft + " guesses left."); } else { System.out.println("You have " + guessesLeft + " guess left."); } System.out.println("Missed letters: " + missedLetters); for (char c : state) { System.out.print(c + " "); } System.out.println(); } public static void main(String[] args) { Hangman hangman = new Hangman(); hangman.playGame(); } }
[ "noreply@github.com" ]
noreply@github.com
b9196fa9e81d5495ed515aa4c92b18afbe7ab5ea
d132a32f07cdc583c021e56e61a4befff6228900
/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java
a7cb94a4ab5648521fdbbb92571874b08b384b05
[]
no_license
TechCatOther/um_clean_forge
27d80cb6e12c5ed38ab7da33a9dd9e54af96032d
b4ddabd1ed7830e75df9267e7255c9e79d1324de
refs/heads/master
2020-03-22T03:14:54.717880
2018-07-02T09:28:10
2018-07-02T09:28:10
139,421,233
0
0
null
null
null
null
UTF-8
Java
false
false
7,145
java
package net.minecraft.world.gen.feature; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockVine; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; public class WorldGenTrees extends WorldGenAbstractTree { private final int minTreeHeight; private final boolean vinesGrow; private final int metaWood; private final int metaLeaves; private static final String __OBFID = "CL_00000438"; public WorldGenTrees(boolean p_i2027_1_) { this(p_i2027_1_, 4, 0, 0, false); } public WorldGenTrees(boolean p_i2028_1_, int p_i2028_2_, int p_i2028_3_, int p_i2028_4_, boolean p_i2028_5_) { super(p_i2028_1_); this.minTreeHeight = p_i2028_2_; this.metaWood = p_i2028_3_; this.metaLeaves = p_i2028_4_; this.vinesGrow = p_i2028_5_; } public boolean generate(World worldIn, Random p_180709_2_, BlockPos p_180709_3_) { int i = p_180709_2_.nextInt(3) + this.minTreeHeight; boolean flag = true; if (p_180709_3_.getY() >= 1 && p_180709_3_.getY() + i + 1 <= 256) { byte b0; int l; for (int j = p_180709_3_.getY(); j <= p_180709_3_.getY() + 1 + i; ++j) { b0 = 1; if (j == p_180709_3_.getY()) { b0 = 0; } if (j >= p_180709_3_.getY() + 1 + i - 2) { b0 = 2; } for (int k = p_180709_3_.getX() - b0; k <= p_180709_3_.getX() + b0 && flag; ++k) { for (l = p_180709_3_.getZ() - b0; l <= p_180709_3_.getZ() + b0 && flag; ++l) { if (j >= 0 && j < 256) { if (!this.isReplaceable(worldIn, new BlockPos(k, j, l))) { flag = false; } } else { flag = false; } } } } if (!flag) { return false; } else { BlockPos down = p_180709_3_.down(); Block block1 = worldIn.getBlockState(down).getBlock(); boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); if (isSoil && p_180709_3_.getY() < 256 - i - 1) { block1.onPlantGrow(worldIn, down, p_180709_3_); b0 = 3; byte b1 = 0; int i1; int j1; int k1; int l1; BlockPos blockpos1; for (l = p_180709_3_.getY() - b0 + i; l <= p_180709_3_.getY() + i; ++l) { i1 = l - (p_180709_3_.getY() + i); j1 = b1 + 1 - i1 / 2; for (k1 = p_180709_3_.getX() - j1; k1 <= p_180709_3_.getX() + j1; ++k1) { l1 = k1 - p_180709_3_.getX(); for (int i2 = p_180709_3_.getZ() - j1; i2 <= p_180709_3_.getZ() + j1; ++i2) { int j2 = i2 - p_180709_3_.getZ(); if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_180709_2_.nextInt(2) != 0 && i1 != 0) { blockpos1 = new BlockPos(k1, l, i2); Block block = worldIn.getBlockState(blockpos1).getBlock(); if (block.isAir(worldIn, blockpos1) || block.isLeaves(worldIn, blockpos1) || block.getMaterial() == Material.vine) { this.func_175905_a(worldIn, blockpos1, Blocks.leaves, this.metaLeaves); } } } } } for (l = 0; l < i; ++l) { BlockPos upN = p_180709_3_.up(l); Block block2 = worldIn.getBlockState(upN).getBlock(); if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2.getMaterial() == Material.vine) { this.func_175905_a(worldIn, p_180709_3_.up(l), Blocks.log, this.metaWood); if (this.vinesGrow && l > 0) { if (p_180709_2_.nextInt(3) > 0 && worldIn.isAirBlock(p_180709_3_.add(-1, l, 0))) { this.func_175905_a(worldIn, p_180709_3_.add(-1, l, 0), Blocks.vine, BlockVine.EAST_FLAG); } if (p_180709_2_.nextInt(3) > 0 && worldIn.isAirBlock(p_180709_3_.add(1, l, 0))) { this.func_175905_a(worldIn, p_180709_3_.add(1, l, 0), Blocks.vine, BlockVine.WEST_FLAG); } if (p_180709_2_.nextInt(3) > 0 && worldIn.isAirBlock(p_180709_3_.add(0, l, -1))) { this.func_175905_a(worldIn, p_180709_3_.add(0, l, -1), Blocks.vine, BlockVine.SOUTH_FLAG); } if (p_180709_2_.nextInt(3) > 0 && worldIn.isAirBlock(p_180709_3_.add(0, l, 1))) { this.func_175905_a(worldIn, p_180709_3_.add(0, l, 1), Blocks.vine, BlockVine.NORTH_FLAG); } } } } if (this.vinesGrow) { for (l = p_180709_3_.getY() - 3 + i; l <= p_180709_3_.getY() + i; ++l) { i1 = l - (p_180709_3_.getY() + i); j1 = 2 - i1 / 2; for (k1 = p_180709_3_.getX() - j1; k1 <= p_180709_3_.getX() + j1; ++k1) { for (l1 = p_180709_3_.getZ() - j1; l1 <= p_180709_3_.getZ() + j1; ++l1) { BlockPos blockpos3 = new BlockPos(k1, l, l1); if (worldIn.getBlockState(blockpos3).getBlock().isLeaves(worldIn, blockpos3)) { BlockPos blockpos4 = blockpos3.west(); blockpos1 = blockpos3.east(); BlockPos blockpos5 = blockpos3.north(); BlockPos blockpos2 = blockpos3.south(); if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn, blockpos4)) { this.func_175923_a(worldIn, blockpos4, BlockVine.EAST_FLAG); } if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn, blockpos1)) { this.func_175923_a(worldIn, blockpos1, BlockVine.WEST_FLAG); } if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos5).getBlock().isAir(worldIn, blockpos5)) { this.func_175923_a(worldIn, blockpos5, BlockVine.SOUTH_FLAG); } if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn, blockpos2)) { this.func_175923_a(worldIn, blockpos2, BlockVine.NORTH_FLAG); } } } } } if (p_180709_2_.nextInt(5) == 0 && i > 5) { for (l = 0; l < 2; ++l) { for (i1 = 0; i1 < 4; ++i1) { if (p_180709_2_.nextInt(4 - l) == 0) { j1 = p_180709_2_.nextInt(3); EnumFacing enumfacing = EnumFacing.getHorizontal(i1).getOpposite(); this.func_175905_a(worldIn, p_180709_3_.add(enumfacing.getFrontOffsetX(), i - 5 + l, enumfacing.getFrontOffsetZ()), Blocks.cocoa, j1 << 2 | EnumFacing.getHorizontal(i1).getHorizontalIndex()); } } } } } return true; } else { return false; } } } else { return false; } } private void func_175923_a(World worldIn, BlockPos p_175923_2_, int p_175923_3_) { this.func_175905_a(worldIn, p_175923_2_, Blocks.vine, p_175923_3_); int j = 4; for (p_175923_2_ = p_175923_2_.down(); worldIn.getBlockState(p_175923_2_).getBlock().isAir(worldIn, p_175923_2_) && j > 0; --j) { this.func_175905_a(worldIn, p_175923_2_, Blocks.vine, p_175923_3_); p_175923_2_ = p_175923_2_.down(); } } }
[ "alone.inbox@gmail.com" ]
alone.inbox@gmail.com
8812be0441b145d3fab2995b6ca64b29588f97e2
570efae978903a8f037e9ba305aa2573c2b68714
/app/src/androidTest/java/com/example/sarvenazgolchinniksirat/costdivider/ExampleInstrumentedTest.java
04626e4fd9b77a287060197c75181c877cd2cb8e
[]
no_license
sGolchin/Trip
e3925b4fa2b64541faa09cd45b1ef9c76a6b4fad
b46d11d4c21b7f653871d2ad1f38189574f29601
refs/heads/master
2021-01-12T06:05:52.980027
2016-12-25T21:00:00
2016-12-25T21:00:00
77,299,153
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package com.example.sarvenazgolchinniksirat.costdivider; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.sarvenazgolchinniksirat.costdivider", appContext.getPackageName()); } }
[ "sarvenaz.golchinniksirat@7p-group.com" ]
sarvenaz.golchinniksirat@7p-group.com
af42dc7bfba43ab715802ad9b62ca90f75eee273
b4fd056d6bb413b827ee9ce935b38e56a3f74ade
/app/src/androidTest/java/com/example/profil_yongki/ExampleInstrumentedTest.java
3348bba6dceaf9f34bb7913e486f5c716fe54272
[]
no_license
yongkiyudha/profil_yongki
7bfc364cddb62ec795a80bc41279bec1c95141aa
c874d4e81ff82ef6e3e5f0eaa971274dff38ba2c
refs/heads/master
2020-12-01T20:17:59.679659
2019-12-29T14:18:42
2019-12-29T14:18:42
230,756,576
0
0
null
null
null
null
UTF-8
Java
false
false
766
java
package com.example.profil_yongki; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.profil_yongki", appContext.getPackageName()); } }
[ "yongkiyudha1@gmail.com" ]
yongkiyudha1@gmail.com
8ec043bdf3e5d2d32288499643027b2596e6da69
f347c10177947e2f236413e14656b222337fd28b
/src/main/java/it/isnart/configuration/CustomInstantDeserializer.java
d26068ddee5a0f9dcff6c5983e193e0044c2287b
[]
no_license
juliovillalobosgithub/spring-example
2d59f625eda1fd641d95357472e8f13da8a4dfbf
306b8d21ca5d1568998a66b0fe317d304cc35d23
refs/heads/master
2020-05-30T23:13:26.067426
2019-06-03T13:46:38
2019-06-03T13:46:38
190,011,538
0
0
null
null
null
null
UTF-8
Java
false
false
8,742
java
package it.isnart.configuration; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonTokenId; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils; import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; import com.fasterxml.jackson.datatype.threetenbp.function.Function; import org.threeten.bp.DateTimeException; import org.threeten.bp.Instant; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.ZoneId; import org.threeten.bp.ZonedDateTime; import org.threeten.bp.format.DateTimeFormatter; import org.threeten.bp.temporal.Temporal; import org.threeten.bp.temporal.TemporalAccessor; import java.io.IOException; import java.math.BigDecimal; /** * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. * * @author Nick Williams */ public class CustomInstantDeserializer<T extends Temporal> extends ThreeTenDateTimeDeserializerBase<T> { private static final long serialVersionUID = 1L; public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>( Instant.class, DateTimeFormatter.ISO_INSTANT, new Function<TemporalAccessor, Instant>() { @Override public Instant apply(TemporalAccessor temporalAccessor) { return Instant.from(temporalAccessor); } }, new Function<FromIntegerArguments, Instant>() { @Override public Instant apply(FromIntegerArguments a) { return Instant.ofEpochMilli(a.value); } }, new Function<FromDecimalArguments, Instant>() { @Override public Instant apply(FromDecimalArguments a) { return Instant.ofEpochSecond(a.integer, a.fraction); } }, null ); public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>( OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, new Function<TemporalAccessor, OffsetDateTime>() { @Override public OffsetDateTime apply(TemporalAccessor temporalAccessor) { return OffsetDateTime.from(temporalAccessor); } }, new Function<FromIntegerArguments, OffsetDateTime>() { @Override public OffsetDateTime apply(FromIntegerArguments a) { return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); } }, new Function<FromDecimalArguments, OffsetDateTime>() { @Override public OffsetDateTime apply(FromDecimalArguments a) { return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } }, new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() { @Override public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); } } ); public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>( ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, new Function<TemporalAccessor, ZonedDateTime>() { @Override public ZonedDateTime apply(TemporalAccessor temporalAccessor) { return ZonedDateTime.from(temporalAccessor); } }, new Function<FromIntegerArguments, ZonedDateTime>() { @Override public ZonedDateTime apply(FromIntegerArguments a) { return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); } }, new Function<FromDecimalArguments, ZonedDateTime>() { @Override public ZonedDateTime apply(FromDecimalArguments a) { return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } }, new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() { @Override public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { return zonedDateTime.withZoneSameInstant(zoneId); } } ); protected final Function<FromIntegerArguments, T> fromMilliseconds; protected final Function<FromDecimalArguments, T> fromNanoseconds; protected final Function<TemporalAccessor, T> parsedToValue; protected final BiFunction<T, ZoneId, T> adjust; protected CustomInstantDeserializer(Class<T> supportedType, DateTimeFormatter parser, Function<TemporalAccessor, T> parsedToValue, Function<FromIntegerArguments, T> fromMilliseconds, Function<FromDecimalArguments, T> fromNanoseconds, BiFunction<T, ZoneId, T> adjust) { super(supportedType, parser); this.parsedToValue = parsedToValue; this.fromMilliseconds = fromMilliseconds; this.fromNanoseconds = fromNanoseconds; this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() { @Override public T apply(T t, ZoneId zoneId) { return t; } } : adjust; } @SuppressWarnings("unchecked") protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) { super((Class<T>) base.handledType(), f); parsedToValue = base.parsedToValue; fromMilliseconds = base.fromMilliseconds; fromNanoseconds = base.fromNanoseconds; adjust = base.adjust; } @Override protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) { if (dtf == _formatter) { return this; } return new CustomInstantDeserializer<T>(this, dtf); } @Override public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only //string values have to be adjusted to the configured TZ. switch (parser.getCurrentTokenId()) { case JsonTokenId.ID_NUMBER_FLOAT: { BigDecimal value = parser.getDecimalValue(); long seconds = value.longValue(); int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); return fromNanoseconds.apply(new FromDecimalArguments( seconds, nanoseconds, getZone(context))); } case JsonTokenId.ID_NUMBER_INT: { long timestamp = parser.getLongValue(); if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { return this.fromNanoseconds.apply(new FromDecimalArguments( timestamp, 0, this.getZone(context) )); } return this.fromMilliseconds.apply(new FromIntegerArguments( timestamp, this.getZone(context) )); } case JsonTokenId.ID_STRING: { String string = parser.getText().trim(); if (string.length() == 0) { return null; } if (string.endsWith("+0000")) { string = string.substring(0, string.length() - 5) + "Z"; } T value; try { TemporalAccessor acc = _formatter.parse(string); value = parsedToValue.apply(acc); if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { return adjust.apply(value, this.getZone(context)); } } catch (DateTimeException e) { throw _peelDTE(e); } return value; } } throw context.mappingException("Expected type float, integer, or string."); } private ZoneId getZone(DeserializationContext context) { // Instants are always in UTC, so don't waste compute cycles return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone()); } private static class FromIntegerArguments { public final long value; public final ZoneId zoneId; private FromIntegerArguments(long value, ZoneId zoneId) { this.value = value; this.zoneId = zoneId; } } private static class FromDecimalArguments { public final long integer; public final int fraction; public final ZoneId zoneId; private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { this.integer = integer; this.fraction = fraction; this.zoneId = zoneId; } } }
[ "noreply@github.com" ]
noreply@github.com
a41580ce3e17a3d66e0d31ff3a4002a92cc1ad81
9d5056b27f0f8cd12bb236540b3b92b838ea703d
/src/main/java/xue/apps/chat/login/UserDetailsAdapter.java
b6b26a9d084b498eb6343ad3f8425eb4d10edad9
[]
no_license
xuechjbj/WhatsChat
9e496efb462da1023409425123320e073bf4ea59
f904179b9ed08759645fe6122883c6ba2a011430
refs/heads/master
2021-01-10T01:12:10.184956
2015-12-20T02:24:37
2015-12-20T02:24:37
48,304,256
0
0
null
null
null
null
UTF-8
Java
false
false
1,587
java
package xue.apps.chat.login; import java.util.Collection; import java.util.HashSet; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; public class UserDetailsAdapter implements UserDetails{ /** * */ private static final long serialVersionUID = 1L; private String mPasswd; private String mUsername; private String mDispname; private long mUid; public UserDetailsAdapter(String username, String passwd, String dispname, long uid){ mUsername = username; mPasswd = passwd; mUid = uid; mDispname = dispname; } @Override public Collection<? extends GrantedAuthority> getAuthorities() { HashSet<SimpleGrantedAuthority> authorities = new HashSet<SimpleGrantedAuthority>(); authorities.add(new SimpleGrantedAuthority("ROLE_USER")); return authorities; } public void setPassword(String pwd){ mPasswd = pwd; } @Override public String getPassword() { return mPasswd; } @Override public String getUsername() { return mUsername; } public long getUid(){ return mUid; } public String getDispname(){ return mDispname; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { // TODO Auto-generated method stub return true; } @Override public boolean isEnabled() { // TODO Auto-generated method stub return true; } }
[ "xuechaojun88@gmail.com" ]
xuechaojun88@gmail.com
87362d01aeea3830dcd8be277f1a61f9a7bf2f78
31fe584e922b9d1335d08f18b980f1a8d1f30e7b
/src/day40_exceptions/Exceptions02.java
f9223ede0fcdfc5b287658c5cdd1fc8f2ec8d66b
[]
no_license
Cetinturk999/winter2021turkish
dd41b1b1dc9c849d491b6e944562766c289517b0
55fd7296a631a1b3fefc5ccd60579c5041dd9f32
refs/heads/master
2023-03-30T22:36:26.111630
2021-04-04T10:27:41
2021-04-04T10:27:41
354,512,878
0
0
null
null
null
null
UTF-8
Java
false
false
584
java
package day40_exceptions; import day40_exceptions.Exceptions01.InvalidEmailIdCheckedException; public class Exceptions02 { public static void main(String[] args) throws InvalidEmailIdCheckedException { String email="rasit@hotmail.com"; mailDogrula(email) ; } public static void mailDogrula(String email) throws InvalidEmailIdCheckedException { if (email.contains("@gmail.com") || email.contains("@hotmail.com")) { System.out.println("mailiniz basariyla kaydedildi"); } else { //throw new InvalidEmailIdCheckedException("email uygun degil"); } } }
[ "rumeysacetinturk90@gmail.com" ]
rumeysacetinturk90@gmail.com
49aaffda21b2cf47b359ed29f1127758d80b2941
398a3e376bef5918d0e44c68e3fa37bf569c1816
/team_vv/src/main/java/lesson_3/core/requests/ChangeTargetNameRequest.java
3d4c08510edbf1e01e2e3bbd6c671f8253299891
[]
no_license
Alexey777555/java2_thursday_online_2020_autumn
7789d61082e2a91c0f8c1f526a458abf0c627613
c7d7011bbade8d48e7f826020d82c17649cc0a3d
refs/heads/master
2023-01-13T20:57:23.619954
2020-11-19T18:13:40
2020-11-19T18:13:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
package lesson_3.core.requests; public class ChangeTargetNameRequest { private Long targetIdToChange; private String newTargetName; public ChangeTargetNameRequest(Long targetIdToChange, String newTargetName) { this.targetIdToChange = targetIdToChange; this.newTargetName = newTargetName; } public Long getTargetIdToChange() { return targetIdToChange; } public String getNewTargetName() { return newTargetName; } }
[ "vadims.vladisevs@gmail.com" ]
vadims.vladisevs@gmail.com
0ff132539b5fb927ad760917a51250ad42ddeb61
6e0fd723809357230df260a29b181ba2cb4ff92a
/CrawlerSystem/src/com/syntun/service/impl/RoleServiceImpl.java
fabe23c4ba1cd20a46230f3e8453d0c1a9392cb3
[ "Apache-2.0" ]
permissive
RLP0815/Syntun
c6a37f39c53075e5ca46dae580d094ea2a6a6964
3d608755f9d370b211c4722d2e932caf47ccbd0c
refs/heads/master
2020-07-19T23:20:43.391955
2019-09-05T09:58:46
2019-09-05T09:58:46
206,530,061
0
0
null
null
null
null
UTF-8
Java
false
false
1,844
java
package com.syntun.service.impl; import org.springframework.stereotype.Service; import com.syntun.dao.RoleDao; import com.syntun.entity.Role; import com.syntun.service.RoleService; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; /** * */ @Service("roleService") public class RoleServiceImpl implements RoleService{ @Resource(name = "roleDao") private RoleDao roleDao; @Override public List<Role> login() { return roleDao.selectCateAccount(); } @Override public List<Role> selectRecord(HashMap<String, Object> params) { return roleDao.selectRecord(params); } @Override public int getCount(HashMap<String, Object> params) { return roleDao.getCount(params); } @Override public List<Role> getAllList(HashMap<String, Object> params) { return roleDao.getAllList(params); } @Override public List<Role> getList(HashMap<String, Object> params) { return roleDao.getList(params); } @Override public int addRecord(HashMap<String, Object> params) { return roleDao.addRecord(params); } @Override public void delRecord(HashMap<String, Object> params) { roleDao.delRecord(params); } @Override public void editRecord(HashMap<String, Object> params) { roleDao.editRecord(params); } @Override public void delAllRecord(List<String> delList) { roleDao.delAllRecord(delList); } @Override public List<Role> selectCateAccount() { return roleDao.selectCateAccount(); } @Override public Role findone(Integer id) { return roleDao.findone(id); } @Override public int insert(Role record) { return roleDao.insert(record); } @Override public int delete(Integer id) { return roleDao.delete(id); } @Override public int update(Role record) { return roleDao.update(record); } }
[ "1059863552@qq.com" ]
1059863552@qq.com
f4e278d896f366e29b6a2edf64820283764e62b9
6dfadd5cf70fef6effaca0a7e2f39f732b154989
/src/main/java/Entities/Trend.java
c2894158c03129faab09becd8ae31e717becde27
[]
no_license
FireRageNL/-FakeTwitter
85d3e5571d6e9610aa59b773d08385472fd9ec97
891db6f04ab4265adc2ffd6335fe728b607ccce2
refs/heads/master
2021-05-03T17:41:57.893373
2018-05-14T20:58:38
2018-05-14T20:58:38
120,453,027
0
0
null
null
null
null
UTF-8
Java
false
false
813
java
package Entities; import javax.inject.Named; import javax.persistence.*; import java.io.Serializable; import java.util.List; @Entity @Named public class Trend implements Serializable { @Id @GeneratedValue public int id; @Column(unique = true) private String name; @ManyToMany private List<Kweet> kweets; public Trend(){ //Empty constructor for JPA } public Trend(int id, String name, List<Kweet> kweets) { this.id = id; this.name = name; this.kweets = kweets; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Kweet> getKweets() { return kweets; } public void setKweets(List<Kweet> kweets) { this.kweets = kweets; } }
[ "r.vanoldenbeek@student.fontys.nl" ]
r.vanoldenbeek@student.fontys.nl
4f82c0369798218ebe5701e34532c970166622bf
7dd2ed6759bd6e20cde067fe907c40ecf6b2f0ac
/backyard-plus/src/main/java/com/backyard/modules/job/entity/ScheduleJobLogEntity.java
ede675003a8f5d6ea0c06d30efbf90fd528b1802
[ "Apache-2.0" ]
permissive
T5750/store-repositories
64406e539dd41508acd4d17324a420bd722a126d
10c44c9fc069c49ff70c45373fd3168286002308
refs/heads/master
2020-03-16T13:10:40.115323
2018-05-16T02:19:39
2018-05-16T02:19:43
132,683,143
0
0
null
null
null
null
UTF-8
Java
false
false
1,809
java
package com.backyard.modules.job.entity; import java.io.Serializable; import java.util.Date; /** * 定时执行日志 */ public class ScheduleJobLogEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 日志id */ private Long logId; /** * 任务id */ private Long jobId; /** * spring bean名称 */ private String beanName; /** * 方法名 */ private String methodName; /** * 参数 */ private String params; /** * 任务状态 0:成功 1:失败 */ private Integer status; /** * 失败信息 */ private String error; /** * 耗时(单位:毫秒) */ private Integer times; /** * 创建时间 */ private Date createTime; public Long getLogId() { return logId; } public void setLogId(Long logId) { this.logId = logId; } public Long getJobId() { return jobId; } public void setJobId(Long jobId) { this.jobId = jobId; } public String getBeanName() { return beanName; } public void setBeanName(String beanName) { this.beanName = beanName; } public String getMethodName() { return methodName; } public void setMethodName(String methodName) { this.methodName = methodName; } public String getParams() { return params; } public void setParams(String params) { this.params = params; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getError() { return error; } public void setError(String error) { this.error = error; } public Integer getTimes() { return times; } public void setTimes(Integer times) { this.times = times; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } }
[ "evangel_a@sina.com" ]
evangel_a@sina.com
89aa6c03fef308951d27d7e19db0f05e67458427
0c7a848641b952bf366079a10fec13dee32be2cf
/Spring/Spring-Learn/helloworld/src/main/java/Hello.java
7f53be23a8d0996d52a12158a4584beb0cdd2912
[]
no_license
BiliHusky/LearnSpace
33f3c1104810d020d7b6ec3ed8a2ba6538665412
59a23ba277ec4dcc730093736cff3b86c8194b7a
refs/heads/master
2022-12-29T23:35:01.874155
2020-05-09T11:15:56
2020-05-09T11:15:56
123,876,001
0
0
null
2022-12-16T06:44:13
2018-03-05T06:38:28
Java
UTF-8
Java
false
false
63
java
/** * Created by yjw on 2018/8/21. */ public class Hello { }
[ "davidyang250@gmail.com.cn" ]
davidyang250@gmail.com.cn
d7fbd7fc66303f7a5f52a7229b0b42206919c27b
b2d4d18aa6bfcea2feedc3d4837ddaaefe44af49
/src/main/xpod78/V11887/config.java
8e0c39b3e3c8cc56d9fdd502550523d0c953093c
[]
no_license
Xpod78/BAB
8d56e6c3512372dcf104cccf840c4817ac188450
c1003c67f17a80d8abdeb35c924729922603a221
refs/heads/master
2021-08-26T09:12:44.161117
2017-11-22T19:36:03
2017-11-22T19:36:03
111,590,040
0
0
null
null
null
null
UTF-8
Java
false
false
1,619
java
package main.xpod78.V11887; import java.io.File; import java.util.logging.Logger; import org.bukkit.configuration.file.YamlConfiguration; public class config { private YamlConfiguration config; private File configFile; public config(File configfile) { this.config = new YamlConfiguration(); this.configFile = configfile; } public boolean save() { try { if(!configFile.exists()) { main.logger.severe("The config doesn't exist, unable to save, regenerating a new one.."); configFile.createNewFile(); loaddefaults(); } config.save(configFile); config.load(configFile); return true; } catch(Exception e) { main.logger.info("There was an error in saving the configuration file."); main.logger.severe(e.getMessage()); return false; } } public boolean load() { try { if(!configFile.exists()) { configFile.createNewFile(); loaddefaults(); } config.load(configFile); return true; } catch(Exception e) { main.logger.info("There was an error loading in the configuration file."); main.logger.severe(e.getMessage()); return false; } } private void loaddefaults() { config.addDefault("private_messages", false); config.addDefault("NumberOfMessages", 10000); config.addDefault("multiple_responses", false); config.addDefault("Name", ""); config.addDefault("Prefix", ""); config.addDefault("Suffix", ""); config.addDefault("Delay", "1"); } public void setString(String s) { } public void getBoolean(String s) { } public void setBoolean(String s) { } public void getString(String s) { } }
[ "ericisom887@gmail.com" ]
ericisom887@gmail.com
dd9f1476b3f0136e572b0bc4f5e8d6f9b46f3fc6
67438c9c92a30cdf68ca89eaaa777cf8f1460dc7
/project/android-buyer/app/app/src/main/java/com/example/app/Details/Phone.java
d650256ba4841e5e35831b195b68eea4ae8f40f9
[]
no_license
jack201806/Taste-Neh-VDHB
0867ae01d0101bae8df778d7be748655d78c209d
2914cd9b6e12bb8b830a5452a9ac2392545c5763
refs/heads/main
2023-02-03T09:14:43.062236
2020-12-17T13:04:03
2020-12-17T13:04:03
311,523,099
0
0
null
null
null
null
UTF-8
Java
false
false
1,090
java
package com.example.app.Details; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import androidx.appcompat.app.AppCompatActivity; import com.example.app.R; public class Phone extends AppCompatActivity { private EditText phone; private Button commit; private String userPhone; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail_phone); phone = findViewById(R.id.phone); commit = findViewById(R.id.commit); commit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { userPhone = phone.getText().toString(); Intent intent=new Intent(getApplicationContext(),Detail.class); intent.putExtra("userPhone",userPhone); setResult(14,intent); finish(); } }); } }
[ "[1686253240@qq.com]" ]
[1686253240@qq.com]
10392c88c2debf29eb32a6844f89cf1fbffa9303
b61cfd8d0eb8fc6d4423e980c682af78383993eb
/vehicle-compliance/src/main/java/uk/gov/caz/vcc/configuration/RestTemplateConfiguration.java
c5401a863b383e852c906912723623f1164b1781
[ "OGL-UK-3.0" ]
permissive
DEFRA/clean-air-zones-api
984e6ba7d16cc484e74dd57b1fab6150e230ce1c
e6437781ff5dc71b01ffce9fd6f8bec2226ee0a6
refs/heads/master
2023-07-24T13:59:03.152029
2021-05-06T16:24:20
2021-05-06T16:24:20
232,327,284
0
2
NOASSERTION
2023-07-13T17:02:58
2020-01-07T13:10:59
Java
UTF-8
Java
false
false
1,836
java
package uk.gov.caz.vcc.configuration; import static uk.gov.caz.correlationid.Constants.X_CORRELATION_ID_HEADER; import java.time.Duration; import java.util.UUID; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.ClientHttpRequestInterceptor; import uk.gov.caz.correlationid.MdcCorrelationIdInjector; /** * Configuration class for Spring's RestTemplateBuilder utility. * */ @Configuration public class RestTemplateConfiguration { /*** * <p> * Builds the REST template builder for the API. * </p> * * @param readTimeoutSeconds the timeout on waiting to read data. * @param connectTimeoutSeconds timeout for making the initial connection. * @return A configured RestTemplateBuilder. */ @Bean public RestTemplateBuilder commonRestTemplateBuilder( @Value("${services.read-timeout-seconds}") Integer readTimeoutSeconds, @Value("${services.connection-timeout-seconds}") Integer connectTimeoutSeconds) { return new RestTemplateBuilder() .interceptors(correlationIdAppendingInterceptor()) .setConnectTimeout(Duration.ofSeconds(connectTimeoutSeconds)) .setReadTimeout(Duration.ofSeconds(readTimeoutSeconds)); } private ClientHttpRequestInterceptor correlationIdAppendingInterceptor() { return (request, body, execution) -> { request.getHeaders().add(X_CORRELATION_ID_HEADER, MdcCorrelationIdInjector.getCurrentValue() == null ? UUID.randomUUID().toString() : MdcCorrelationIdInjector.getCurrentValue()); return execution.execute(request, body); }; } }
[ "james.cruddas@informed.com" ]
james.cruddas@informed.com
36691b5cf2d3a79d0396acf9249e81a0c8a7d9a9
9234d3c3fc82604dd736399c54f340a20ced0af3
/MovementInSome/src/main/java/com/movementinsome/app/mytask/DredgePlanActivity.java
a4238964923945299ef9f44401c93089f67dc781
[]
no_license
laihouyou/ydcc_test2
491f5fb74825617dc0db754220e55faf9b1d2acf
0b946eddff95d5a4da648089e291277b16b4f0c9
refs/heads/master
2020-03-26T04:50:26.965221
2018-09-29T10:55:14
2018-09-29T10:55:14
144,525,322
3
1
null
null
null
null
UTF-8
Java
false
false
17,619
java
package com.movementinsome.app.mytask; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.google.gson.Gson; import com.j256.ormlite.dao.Dao; import com.movementinsome.AppContext; import com.movementinsome.R; import com.movementinsome.app.pub.Constant; import com.movementinsome.app.mytask.handle.PublicHandle; import com.movementinsome.app.server.TaskFeedBackAsyncTask; import com.movementinsome.app.server.UploadDataTask; import com.movementinsome.database.vo.InsDredgePTask; import com.movementinsome.database.vo.InsDredgeWTask; import com.movementinsome.database.vo.InsTablePushTaskVo; import com.movementinsome.kernel.activity.FullActivity; import com.movementinsome.kernel.util.MyDateTools; import org.json.JSONException; import org.json.JSONObject; import java.sql.SQLException; import java.util.Date; public class DredgePlanActivity extends FullActivity implements OnClickListener,PublicHandle { private ImageView dredge_plan_back;// 返回 private Button dredge_plan_commit;// 提交 private TextView dredge_plan_ysjcj_msg;// 雨水检查井(口): private TextView dredge_plan_wsjcj_msg;// 污水检查井(口): private TextView dredge_plan_ysk_msg;// 雨水口(口): private TextView dredge_plan_yskgqct_msg;// 雨水管渠尺寸 private TextView dredge_plan_ysgqc_msg;// 雨水管渠长(m): private TextView dredge_plan_wsgqct_msg;// 污水管渠尺寸: private TextView dredge_plan_wsgqc_msg;//污水管渠长(m): private EditText dredge_plan_ysjcj;// 雨水检查井(口): private EditText dredge_plan_wsjcj;// 污水检查井(口): private EditText dredge_plan_ysk;// 雨水口(口): private EditText dredge_plan_yskgqct;// 雨水管渠尺寸 private EditText dredge_plan_ysgqc;// 雨水管渠长(m): private EditText dredge_plan_wsgqct;// 污水管渠尺寸: private EditText dredge_plan_wsgqc;// 污水管渠长(m): private EditText dredge_plan_ynl;// 淤泥量(m3): private EditText dredge_plan_cyry;// 参加人员: private InsDredgePTask insDredgePTask;// 下载数据 private InsTablePushTaskVo insTablePushTaskVo;// 推送消息 private InsDredgeWTask insDredgeWTask=new InsDredgeWTask();// 上传数据 private Button dredge_plan_ysjcj_zy;// 雨水检查井(口):增一 private Button dredge_plan_ysjcj_jy;// 雨水检查井(口):减一 private Button dredge_plan_parent_zy;// 污水检查井(口):增一 private Button dredge_plan_parent_jy;// 污水检查井(口):减一 private Button dredge_plan_ysk_zy;// 雨水口(口):增一 private Button dredge_plan_ysk_jy;// 雨水口(口):减一 @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.dredge_plan_activity); init(); setData(); } private void init(){ insDredgePTask = (InsDredgePTask) getIntent().getSerializableExtra("insDredgePTask"); insTablePushTaskVo = (InsTablePushTaskVo) getIntent().getSerializableExtra("insTablePushTaskVo"); dredge_plan_back=(ImageView) findViewById(R.id.dredge_plan_back);// 返回 dredge_plan_back.setOnClickListener(this); dredge_plan_commit=(Button) findViewById(R.id.dredge_plan_commit);// 提交 dredge_plan_commit.setOnClickListener(this); dredge_plan_ysjcj_msg=(TextView) findViewById(R.id.dredge_plan_ysjcj_msg);// 雨水检查井(口): dredge_plan_wsjcj_msg=(TextView) findViewById(R.id.dredge_plan_wsjcj_msg);// 污水检查井(口): dredge_plan_ysk_msg=(TextView) findViewById(R.id.dredge_plan_ysk_msg);// 雨水口(口): dredge_plan_yskgqct_msg=(TextView) findViewById(R.id.dredge_plan_yskgqct_msg);// 雨水管渠尺寸 dredge_plan_ysgqc_msg=(TextView) findViewById(R.id.dredge_plan_ysgqc_msg);// 雨水管渠长(m): dredge_plan_wsgqct_msg=(TextView) findViewById(R.id.dredge_plan_wsgqct_msg);// 污水管渠尺寸: dredge_plan_wsgqc_msg=(TextView) findViewById(R.id.dredge_plan_wsgqc_msg);//污水管渠长(m): dredge_plan_ysjcj=(EditText) findViewById(R.id.dredge_plan_ysjcj);// 雨水检查井(口): dredge_plan_wsjcj=(EditText) findViewById(R.id.dredge_plan_wsjcj);// 污水检查井(口): dredge_plan_ysk=(EditText) findViewById(R.id.dredge_plan_ysk);// 雨水口(口): dredge_plan_yskgqct=(EditText) findViewById(R.id.dredge_plan_yskgqct);// 雨水管渠尺寸 dredge_plan_ysgqc=(EditText) findViewById(R.id.dredge_plan_ysgqc);// 雨水管渠长(m): dredge_plan_wsgqct=(EditText) findViewById(R.id.dredge_plan_wsgqct);// 污水管渠尺寸: dredge_plan_wsgqc=(EditText) findViewById(R.id.dredge_plan_wsgqc);// 污水管渠长(m): dredge_plan_ynl=(EditText) findViewById(R.id.dredge_plan_ynl);// 淤泥量(m3): dredge_plan_cyry=(EditText) findViewById(R.id.dredge_plan_cyry);// 参加人员: dredge_plan_ysjcj_zy=(Button) findViewById(R.id.dredge_plan_ysjcj_zy);// 雨水检查井(口):增一 dredge_plan_ysjcj_zy.setOnClickListener(this); dredge_plan_ysjcj_jy=(Button) findViewById(R.id.dredge_plan_ysjcj_jy);// 雨水检查井(口):减一 dredge_plan_ysjcj_jy.setOnClickListener(this); dredge_plan_parent_zy=(Button) findViewById(R.id.dredge_plan_parent_zy);// 污水检查井(口):增一 dredge_plan_parent_zy.setOnClickListener(this); dredge_plan_parent_jy=(Button) findViewById(R.id.dredge_plan_parent_jy);// 污水检查井(口):减一 dredge_plan_parent_jy.setOnClickListener(this); dredge_plan_ysk_zy=(Button) findViewById(R.id.dredge_plan_ysk_zy);// 雨水口(口):增一 dredge_plan_ysk_zy.setOnClickListener(this); dredge_plan_ysk_jy=(Button) findViewById(R.id.dredge_plan_ysk_jy);// 雨水口(口):减一 dredge_plan_ysk_jy.setOnClickListener(this); } private void setData(){ if(insDredgePTask!=null){ dredge_plan_ysjcj_msg.setText("雨水检查井(口): 总数"+getNullLong(insDredgePTask.getRainWellSum())+"口,已检"+getNullLong(insDredgePTask.getRainWellSumRl())+"口");// 雨水检查井(口): dredge_plan_wsjcj_msg.setText("污水检查井(口): 总数"+getNullLong(insDredgePTask.getSewageWellSum())+"口,已检"+getNullLong(insDredgePTask.getSewageWellSumRl())+"口");// 污水检查井(口): dredge_plan_ysk_msg.setText("雨水口(口): 总数"+getNullLong(insDredgePTask.getGulliesSum())+"口,已检"+getNullLong(insDredgePTask.getGulliesSumRl())+"口");// 雨水口(口): dredge_plan_ysgqc_msg.setText("雨水管渠长(m): 总数"+getNullLong(insDredgePTask.getGulliesLen())+"m,已检"+getNullLong(insDredgePTask.getGulliesLenRl())+"m");// 雨水管渠长(m): dredge_plan_wsgqc_msg.setText("污水管渠长(m): 总数"+getNullLong(insDredgePTask.getSewerLen())+"m,已检"+getNullLong(insDredgePTask.getSewerLenRl())+"m");//污水管渠长(m): dredge_plan_wsgqct.setText(insDredgePTask.getSewerSize());// 污水管渠尺寸: dredge_plan_yskgqct.setText(insDredgePTask.getGulliesSize());// 雨水管渠尺寸 dredge_plan_ysjcj.setText(getNullLong(insDredgePTask.getRainWellSumNow())+"");// 雨水检查井(口): dredge_plan_wsjcj.setText(getNullLong(insDredgePTask.getSewageWellSumNow())+"");// 污水检查井(口): dredge_plan_ysk.setText(getNullLong(insDredgePTask.getGulliesSumNow())+"");// 雨水口(口): dredge_plan_ysgqc.setText(getNullLong(insDredgePTask.getGulliesLenNow())+"");// 雨水管渠长(m): dredge_plan_wsgqc.setText(getNullLong(insDredgePTask.getSewerLenNow())+"");// 污水管渠长(m): dredge_plan_ynl.setText(getNullLong(insDredgePTask.getSludgeSum())+"");//淤泥量 if(insDredgePTask.getWorkers()!=null){ dredge_plan_cyry.setText(insDredgePTask.getWorkers()); } } } private void saveDate(){ if(insDredgePTask!=null){ if(!"".equals(dredge_plan_ysjcj.getText()+"")){ insDredgePTask.setRainWellSumNow(Long.parseLong(dredge_plan_ysjcj.getText()+""));// 雨水检查井(口): } if(!"".equals(dredge_plan_wsjcj.getText()+"")){ insDredgePTask.setSewageWellSumNow(Long.parseLong(dredge_plan_wsjcj.getText()+""));// 污水检查井(口): } if(!"".equals(dredge_plan_ysk.getText()+"")){ insDredgePTask.setGulliesSumNow(Long.parseLong(dredge_plan_ysk.getText()+""));// 雨水口(口): } if(!"".equals(dredge_plan_ysgqc.getText()+"")){ insDredgePTask.setGulliesLenNow(Long.parseLong(dredge_plan_ysgqc.getText()+""));// 雨水管渠长(m): } if(!"".equals(dredge_plan_wsgqc.getText()+"")){ insDredgePTask.setSewerLenNow(Long.parseLong(dredge_plan_wsgqc.getText()+""));// 污水管渠长(m): } if(!"".equals(dredge_plan_ynl.getText()+"")){ insDredgePTask.setSludgeSum(Long.parseLong(dredge_plan_ynl.getText()+""));//淤泥量 } insDredgePTask.setWorkers(dredge_plan_cyry.getText()+"");//参加人员 try { Dao<InsDredgePTask, Long> insDredgePTaskDao = AppContext .getInstance().getAppDbHelper() .getDao(InsDredgePTask.class); insDredgePTaskDao.update(insDredgePTask); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); TaskFeedBackAsyncTask taskFeedBackAsyncTask=new TaskFeedBackAsyncTask(this , false,false, insTablePushTaskVo.getTaskNum(), Constant.UPLOAD_STATUS_PAUSE, null, insTablePushTaskVo.getTitle(), insTablePushTaskVo.getTaskCategory(),null,null,null); taskFeedBackAsyncTask.execute(); } @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.dredge_plan_back: saveDate(); finish(); break; case R.id.dredge_plan_commit: commitDialog(); break; case R.id.dredge_plan_ysjcj_zy:// 雨水检查井(口):增一 dredge_plan_ysjcj.setText((getNullLong(dredge_plan_ysjcj.getText()+"")+1)+""); break; case R.id.dredge_plan_ysjcj_jy:// 雨水检查井(口):减一 dredge_plan_ysjcj.setText(((getNullLong(dredge_plan_ysjcj.getText()+"")-1)<0?0:(getNullLong(dredge_plan_ysjcj.getText()+"")-1))+""); break; case R.id.dredge_plan_parent_zy:// 污水检查井(口):增一 dredge_plan_wsjcj.setText((getNullLong(dredge_plan_wsjcj.getText()+"")+1)+""); break; case R.id.dredge_plan_parent_jy:// 污水检查井(口):减一 dredge_plan_wsjcj.setText(((getNullLong(dredge_plan_wsjcj.getText()+"")-1)<0?0:(getNullLong(dredge_plan_wsjcj.getText()+"")-1))+""); break; case R.id.dredge_plan_ysk_zy:// 雨水口(口):增一 dredge_plan_ysk.setText((getNullLong(dredge_plan_ysk.getText()+"")+1)+""); break; case R.id.dredge_plan_ysk_jy:// 雨水口(口):减一 dredge_plan_ysk.setText(((getNullLong(dredge_plan_ysk.getText()+"")-1)<0?0:(getNullLong(dredge_plan_ysk.getText()+"")-1))+""); break; default: break; } } private void commitDialog(){ new AlertDialog.Builder(this) .setTitle("提示") .setIcon(android.R.drawable.ic_menu_help) .setMessage("确定要提交数据") .setPositiveButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub dialog.dismiss(); } }) .setNegativeButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { commit(); } }).show(); } private void commit(){ if(!"".equals(dredge_plan_ysjcj.getText()+"")){ insDredgeWTask.setRainWellSum(Long.parseLong(dredge_plan_ysjcj.getText()+""));// 雨水检查井数量 } if(!"".equals(dredge_plan_wsjcj.getText()+"")){// 污水检查井(口): insDredgeWTask.setSewageWellSum(Long.parseLong(dredge_plan_wsjcj.getText()+""));//污水检查井数量 } if(!"".equals(dredge_plan_ysk.getText()+"")){// 雨水口(口): insDredgeWTask.setGulliesSum(Long.parseLong(dredge_plan_ysk.getText()+""));//雨水口数量 } if(!"".equals(dredge_plan_ysgqc.getText()+"")){// 雨水管渠长(m): insDredgeWTask.setGulliesLen(Long.parseLong(dredge_plan_ysgqc.getText()+""));//雨水管渠长 } if(!"".equals(dredge_plan_wsgqc.getText()+"")){ insDredgeWTask.setSewerLen(Long.parseLong(dredge_plan_wsgqc.getText()+""));//污水管渠长 } insDredgeWTask.setGulliesSize(dredge_plan_yskgqct.getText()+"");//雨水管渠尺寸 insDredgeWTask.setSewerSize(dredge_plan_wsgqct.getText()+"");//污水管渠尺寸 insDredgeWTask.setWorkers(dredge_plan_cyry.getText()+"");//参加人员 if(!"".equals(dredge_plan_ynl.getText()+"")){ insDredgeWTask.setSludgeSum(Long.parseLong(dredge_plan_ynl.getText()+""));//淤泥量 } if(insDredgePTask!=null){ insDredgeWTask.setDpNum(insDredgePTask.getSerialNumber());//计划清疏编号 insDredgeWTask.setRainWellSumRl(getNullLong(insDredgePTask.getRainWellSumRl())+getNullLong(insDredgeWTask.getRainWellSum()));//雨水检查井数量 insDredgeWTask.setSewageWellSumRl(getNullLong(insDredgePTask.getSewageWellSumRl())+getNullLong(insDredgeWTask.getSewageWellSum()));//污水检查井数量 insDredgeWTask.setGulliesSumRl(getNullLong(insDredgePTask.getGulliesSumRl())+getNullLong(insDredgeWTask.getGulliesSum()));//雨水口数量 //insDredgeWTask.setGulliesSizeRl(gulliesSizeRl);//雨水管渠尺寸 insDredgeWTask.setGulliesLenRl(getNullLong(insDredgePTask.getGulliesLenRl())+getNullLong(insDredgeWTask.getGulliesLen()));//雨水管渠长 insDredgeWTask.setSewerLenRl(getNullLong(insDredgePTask.getSewerLenRl())+getNullLong(insDredgeWTask.getSewerLen()));//污水管渠长 //insDredgeWTask.setSewerSizeRl(sewerSizeRl);//污水管渠尺寸 if((getNullLong(insDredgePTask.getSewerLen())<=getNullLong(insDredgeWTask.getSewerLenRl()))// 污水管渠长 &&(getNullLong(insDredgePTask.getGulliesLen())<=getNullLong(insDredgeWTask.getGulliesLenRl()))//雨水管渠长 &&(getNullLong(insDredgePTask.getGulliesSum())<=getNullLong(insDredgeWTask.getGulliesSumRl()))//雨水口数量 &&(getNullLong(insDredgePTask.getSewageWellSum())<=getNullLong(insDredgeWTask.getSewageWellSumRl()))//污水检查井数量 &&(getNullLong(insDredgePTask.getRainWellSum())<=getNullLong(insDredgeWTask.getRainWellSumRl()))//雨水检查井数量 ){ insDredgeWTask.setState((long) 2); }else{ insDredgeWTask.setState((long) 1); } } String content=new Gson().toJson(insDredgeWTask); JSONObject ob=new JSONObject(); try { //ob.put("moiNum", this.getId()); ob.put("imei", AppContext.getInstance().getPhoneIMEI()); //ob.put("guid", this.getGuid()); ob.put("workTaskNum", insTablePushTaskVo.getTaskNum()); ob.put("taskCategory", insTablePushTaskVo.getTaskCategory()); ob.put("tableName","Ins_Dredge_W_Task"); ob.put("parentTable", insTablePushTaskVo.getTitle()); ob.put("usId", AppContext.getInstance().getCurUser().getUserId()); ob.put("usUsercode", AppContext.getInstance().getCurUser().getUserName()); ob.put("usNameZh", AppContext.getInstance().getCurUser().getUserAlias()); ob.put("createDate", MyDateTools.date2String(new Date())); String gpsCoord=null; String mapCoord=null; if (AppContext.getInstance().getCurLocation()!=null){ gpsCoord=AppContext.getInstance().getCurLocation().getCurGpsPosition(); mapCoord=AppContext.getInstance().getCurLocation().getCurMapPosition(); } ob.put("gpsCoord",gpsCoord); ob.put("mapCoord",mapCoord); ob.put("content",content); new UploadDataTask(this,this, ob.toString()).execute(); } catch (JSONException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { return false; } // 拦截MENU按钮点击事件,让他无任何操作 if (keyCode == KeyEvent.KEYCODE_MENU) { return false; } return super.onKeyDown(keyCode, event); } public Long getNullLong(Long v){ return v==null?0:v; } public Long getNullLong(String v){ return v.equals("")?0:Long.parseLong(v); } @Override public void updateData() { // TODO Auto-generated method stub Dao<InsDredgePTask, Long> insDredgePTaskDao; try { insDredgePTask.setSewerLenNow((long) 0);//实时污水管渠长 insDredgePTask.setGulliesLenNow((long) 0);//实时雨水管渠长 insDredgePTask.setGulliesSumNow((long) 0);//实时雨水口数量 insDredgePTask.setSewageWellSumNow((long) 0);//实时污水检查井数量 insDredgePTask.setRainWellSumNow((long) 0);//实时雨水检查井数量 insDredgePTask.setSludgeSum((long) 0);//淤泥量 insDredgePTask.setWorkers(null);// 参与人员 insDredgePTask.setSewerLenRl(insDredgeWTask.getSewerLenRl());//实际污水管渠长 insDredgePTask.setGulliesLenRl(insDredgeWTask.getGulliesLenRl());//实际雨水管渠长 insDredgePTask.setGulliesSumRl(insDredgeWTask.getGulliesSumRl());//实际雨水口数量 insDredgePTask.setSewageWellSumRl(insDredgeWTask.getSewageWellSumRl());//实际污水检查井数量 insDredgePTask.setRainWellSumRl(insDredgeWTask.getRainWellSumRl());//实际雨水检查井数量 insDredgePTask.setState(insDredgeWTask.getState());// 状态 insDredgePTaskDao = AppContext .getInstance().getAppDbHelper() .getDao(InsDredgePTask.class); insDredgePTaskDao.update(insDredgePTask); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finish(); } }
[ "laihouyou163@163.com" ]
laihouyou163@163.com
0bfcd66bb72c76fc31ad29cc36e26d4f8fdd6bf8
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_completed/5675398.java
33bec9ac8bb1952dd66ebe88c610c3665e7652be
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,313
java
class c5675398 { public MyHelperClass QueryResultIO; public MyHelperClass SPARQL; public MyHelperClass fail(String o0){ return null; } private TupleQueryResult evaluate(String location, String query, QueryLanguage queryLn) throws Exception { MyHelperClass URLEncoder = new MyHelperClass(); location += "?query=" + URLEncoder.encode(query, "UTF-8") + "&queryLn=" + queryLn.getName(); URL url = new URL(location); HttpURLConnection conn = (HttpURLConnection)(HttpURLConnection)(Object) url.openConnection(); conn.setRequestProperty("Accept", SPARQL.getDefaultMIMEType()); conn.connect(); try { int responseCode =(int)(Object) conn.getResponseCode(); MyHelperClass HttpURLConnection = new MyHelperClass(); if (responseCode == (int)(Object)HttpURLConnection.HTTP_OK) { MyHelperClass TupleQueryResultFormat = new MyHelperClass(); return(TupleQueryResult)(Object) QueryResultIO.parse(conn.getInputStream(), TupleQueryResultFormat.SPARQL); } else { String response = "location " + location + " responded: " + conn.getResponseMessage() + " (" + responseCode + ")"; fail(response); throw new RuntimeException(response); } } finally { conn.disconnect(); } } } // Code below this line has been added to remove errors class MyHelperClass { public MyHelperClass HTTP_OK; public MyHelperClass SPARQL; public MyHelperClass parse(MyHelperClass o0, MyHelperClass o1){ return null; } public MyHelperClass getDefaultMIMEType(){ return null; } public MyHelperClass encode(String o0, String o1){ return null; }} class QueryLanguage { public MyHelperClass getName(){ return null; }} class TupleQueryResult { } class URL { URL(String o0){} URL(){} public MyHelperClass openConnection(){ return null; }} class HttpURLConnection { public MyHelperClass setRequestProperty(String o0, MyHelperClass o1){ return null; } public MyHelperClass getResponseCode(){ return null; } public MyHelperClass connect(){ return null; } public MyHelperClass getResponseMessage(){ return null; } public MyHelperClass getInputStream(){ return null; } public MyHelperClass disconnect(){ return null; }}
[ "piyush16066@iiitd.ac.in" ]
piyush16066@iiitd.ac.in
f9f46329b267e309275f3d0ebda86ba0e6a89f94
04e598bcdbb3bbca2a37b5bd641174b43b10a83a
/CalculoIMC/src/module-info.java
31f4218145c437a496ff8f9ff6459b4417123fe5
[]
no_license
JeanKoval/programacao2
89069263a29b030ce7862c82a2fd424d75675727
42192a9f42efd86ddc9a5f52f9c2314739e5853a
refs/heads/main
2023-07-05T02:06:43.573208
2021-08-16T22:28:55
2021-08-16T22:28:55
394,453,140
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
module CalculoIMC { requires javafx.controls; requires javafx.fxml; requires javafx.graphics; opens application to javafx.graphics, javafx.fxml; }
[ "jeancarloskoval2002@gmail.com" ]
jeancarloskoval2002@gmail.com
19574565b70c1d7ae8f95b2d6b9810c3f0cf78ca
48e499441379648f544f35d2d90a607b7b28b8a4
/src/main/java/ru/project/currency/rates/CurrencyRatesApplication.java
fea786961d4a629d2915176bbe80aee738cb65f4
[ "Apache-2.0" ]
permissive
AlikJoke/CurrencyRates
aa130ef490aeed000f12ac900f10510c7db1fdc7
bb6e663384f01f3a674b6d32990f887ff97472ed
refs/heads/master
2023-09-01T00:41:35.290299
2023-08-20T11:45:56
2023-08-20T11:45:56
94,145,600
0
0
null
null
null
null
UTF-8
Java
false
false
673
java
package ru.project.currency.rates; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.servlet.config.annotation.EnableWebMvc; @SpringBootApplication @ComponentScan @EnableScheduling @EnableWebMvc @EnableAutoConfiguration public class CurrencyRatesApplication { public static void main(String[] args) { SpringApplication.run(CurrencyRatesApplication.class, args); } }
[ "typicaljprogrammer@gmail.com" ]
typicaljprogrammer@gmail.com
28c1037ad1fc4b030dc094128e6b67c378c563f5
d2e780a6a5714529f253c301eb3a3151cdcdf098
/spring4-design-patterns/src/test/java/io/sterritt/spring4/design_patterns/creational/abstractfactory/HybridCarTest.java
aa35bf04b09c00eecc7d311fe110a77f162c0772
[]
no_license
tsterritt/spring4
d000745e9c908bf4f85d51d32c4e4907bd51707d
cbb13f707d06d62f4c361bb652b4b6f7718dbdcb
refs/heads/master
2023-06-01T02:53:49.280863
2023-05-13T23:35:33
2023-05-13T23:35:33
315,155,871
0
0
null
null
null
null
UTF-8
Java
false
false
1,625
java
package io.sterritt.spring4.design_patterns.creational.abstractfactory; import io.sterritt.spring4.design_patterns.creational.domain.body.EBodyStyle; import io.sterritt.spring4.design_patterns.creational.domain.car.ICar; import io.sterritt.spring4.design_patterns.creational.domain.interior.EAvailableInteriorOptions; import io.sterritt.spring4.design_patterns.creational.domain.performance.EAvailablePerformanceOptions; 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.SpringRunner; import static org.junit.Assert.*; @RunWith(SpringRunner.class) @ContextConfiguration(classes= CarFactory.class) public class HybridCarTest { @Autowired ICar luxuryHybrid; @Test public void createHybridLuxuryCar() { assertEquals("Hybrid", luxuryHybrid.getEngine().getEngineType()); assertEquals("Automatic", luxuryHybrid.getTransmission().getTransmissionType()); assertEquals(EBodyStyle.FOUR_DOOR, luxuryHybrid.getBodyStyle()); assertTrue(luxuryHybrid.getInteriorOptions().getOptions().contains(EAvailableInteriorOptions.HEATED_SEATS)); assertTrue(luxuryHybrid.getInteriorOptions().getOptions().contains(EAvailableInteriorOptions.ELECTRONIC_ADJUSTED_SEATS)); assertTrue(luxuryHybrid.getInteriorOptions().getOptions().contains(EAvailableInteriorOptions.GPS_NAV_SYSTEM)); assertTrue(luxuryHybrid.getInteriorOptions().getOptions().contains(EAvailableInteriorOptions.LEATHER_TRIM)); } }
[ "tsterritt@github.com" ]
tsterritt@github.com
58ce39dab007182416adad444636b9b7e7765767
dde142a535ee08403358a0e760705d72b4cb16ee
/IVsnap/app/src/androidTest/java/com/iv/ivsnap/ExampleInstrumentedTest.java
eb1868948e29db3824b8b5b2fe054f83c303c9b3
[ "MIT" ]
permissive
ishukr/IVSnap
fd250ffecdbf45562613e7ae0cb20eb7c638345c
bf2a34776d93d4942b80dc4b7720d99d62006c06
refs/heads/master
2023-08-16T16:26:07.547999
2021-10-06T07:01:12
2021-10-06T07:01:12
414,083,485
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.iv.ivsnap; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.iv.ivsnap", appContext.getPackageName()); } }
[ "ishu.kumar0007@gmail.com" ]
ishu.kumar0007@gmail.com
28b65d56b98cca8599528e7c3ad77976f3127816
ed6e4e3ae293103f281b8d939312f5bd697d9fc8
/laborreg_server/src/hu/laborreg/server/exception/ElementAlreadyAddedException.java
b8edee2fe3e3fd0abfbd04662b151a401dd2b922
[]
no_license
esgott/szoft_arch_hazi
b265d954a6199c9b1448259864fe42a3b5aae3e3
7273b0ac494cc61823c784bf65294099a52a03bb
refs/heads/master
2021-01-01T18:41:56.066275
2012-11-25T22:18:01
2012-11-25T22:18:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
259
java
package hu.laborreg.server.exception; public class ElementAlreadyAddedException extends Exception{ /** * */ private static final long serialVersionUID = -8892628884282008165L; public ElementAlreadyAddedException(String msg) { super(msg); } }
[ "pal.gabor89@gmail.com" ]
pal.gabor89@gmail.com
d946241c8018a65b3bc5a488fe1fcb7c270b40b8
7fd59e8c9cafa849a0912bae770c5d84e359a8c8
/JavaExercises/UnionFind/src/UnionFindApp.java
b174eba93200734f9061906d07076ffe32e9c6f1
[]
no_license
vg249/Exercises
091f071c4c420535f9f7cc596a37fe95cd828c06
d30c3386101c87a47e368512e4b34f8a4984ddc4
refs/heads/master
2021-01-18T11:30:12.920057
2016-04-26T12:51:30
2016-04-26T12:51:30
57,125,609
0
1
null
null
null
null
UTF-8
Java
false
false
448
java
package UFindPack; public class UnionFindApp { public static void main(String[] args) { UnionFind objUFind = new UnionFind(10); objUFind.Union(0,9); objUFind.Union(0,2); objUFind.Union(0,3); objUFind.Union(0,4); System.out.println(objUFind.Connected(0,9)); System.out.println(objUFind.Connected(0,2)); System.out.println(objUFind.Connected(2,9)); System.out.println(objUFind.Connected(4,9)); System.out.println(objUFind.Connected(5,9)); } }
[ "vg249@cornell.edu" ]
vg249@cornell.edu
df97878cd37adede936ff256dc9f092daa6fd2cb
f60bee7400991e69d7e8dd34bb6918696c4b5b0b
/procoeton-ui-core/src/main/java/consulo/procoeton/core/auth/VaadinAuthenticationManager.java
3f96177c0776ca7e7a34fe1583edcc3fc13cbceb
[ "Apache-2.0" ]
permissive
consulo/hub.consulo.io
079dd329c965284b6f6ee3ee4f0e131f5570bca5
6f80ec18ed953aa35729aec101f8870b223696bf
refs/heads/master
2023-08-17T06:38:23.581144
2023-08-14T08:00:06
2023-08-14T08:00:06
18,999,158
0
0
Apache-2.0
2018-03-25T17:48:31
2014-04-21T16:44:53
Java
UTF-8
Java
false
false
502
java
package consulo.procoeton.core.auth; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; /** * @author VISTALL * @since 11/05/2023 */ public class VaadinAuthenticationManager implements AuthenticationManager { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { return authentication; } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
027481cea4890321f1de5426402801346c2bf00d
a51778ee2a96630785541ce331e178ce15bdc7c4
/skola/Fel_Mgr/3.semestr/AOS/rado_semestralka/murinradAOS/IfaceServerClient/src/main/java/cz/ctu/fee/murinrad/ifaceserver/PayForAReservationCash.java
35bbc504590de4e40dfeb11ae7bc1b4d459b89a5
[]
no_license
majacQ/migrace_databaze
45ed405ab0f0fc31578264c983a4f2e4beacb528
51cc735d7db6db1a6454e51ae596e09711783104
refs/heads/master
2023-05-08T19:01:09.294920
2021-05-24T20:15:33
2021-05-24T20:15:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,113
java
package cz.ctu.fee.murinrad.ifaceserver; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for payForAReservationCash complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="payForAReservationCash"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ticketID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="amountDue" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "payForAReservationCash", propOrder = { "ticketID", "amountDue" }) public class PayForAReservationCash { protected Integer ticketID; protected Double amountDue; /** * Gets the value of the ticketID property. * * @return * possible object is * {@link Integer } * */ public Integer getTicketID() { return ticketID; } /** * Sets the value of the ticketID property. * * @param value * allowed object is * {@link Integer } * */ public void setTicketID(Integer value) { this.ticketID = value; } /** * Gets the value of the amountDue property. * * @return * possible object is * {@link Double } * */ public Double getAmountDue() { return amountDue; } /** * Sets the value of the amountDue property. * * @param value * allowed object is * {@link Double } * */ public void setAmountDue(Double value) { this.amountDue = value; } }
[ "wox2@seznam.cz" ]
wox2@seznam.cz