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
402c91d04d8a7380dc557195c99935d92d161e16
14fc9f86e1f5ff202cbe31868159750da0dd7911
/src/headfirst/chap05/Style.java
f733627dc317c2a6542f93113eb58c6ceeb35a71
[]
no_license
jurin-n/learning-object-oriented
0b4168f4960f2790bdcf7283549dab0c7fd283ab
3212ba5d66f4791341b38383ae46926089a05f3a
refs/heads/master
2020-06-04T17:51:50.722738
2016-01-09T16:10:12
2016-01-09T16:10:12
20,802,986
0
0
null
null
null
null
UTF-8
Java
false
false
176
java
package headfirst.chap05; public enum Style { A,F; public String toString(){ switch(this){ case A:return "A style"; case F:return "F style"; } return ""; } }
[ "jurin.nakano@gmail.com" ]
jurin.nakano@gmail.com
189ec36de7bd28f46c623135005fa00171719f80
c0c6bfb962391aea6c317bd0a7de516935717962
/JavaSEdevelop_Code/day03/src/com/itheima/interfaceDemo2/Dog.java
62a45245d487d0809ca839782577bf0873bb3b86
[]
no_license
li-black/JavaSEdevelop_Code
bd3933b801ec5887807a10898fb070d2ae67396e
21dc91ac1f87f2339ede54d56815ea0456b2c493
refs/heads/master
2023-02-26T10:37:42.509130
2021-01-19T10:12:35
2021-01-19T10:12:35
324,471,328
0
0
null
null
null
null
UTF-8
Java
false
false
242
java
package com.itheima.interfaceDemo2; //重写接口中的默认方法 public class Dog implements IA { @Override public void eat() { } @Override public void catchhome() { System.out.println("狗看家"); } }
[ "1436988790@qq.com" ]
1436988790@qq.com
2b045ffabb54ebd6d0dd0e4576a1b85e91e542ea
e1e5bd6b116e71a60040ec1e1642289217d527b0
/H5/L2jMaster_org/L2jMaster_org_2019_07_02/L2JMaster_DataPack/dist/game/data/scripts/handlers/itemhandlers/BeastSpiritShot.java
5be81a3e462c569526ce53f240ad35c93be4b3e0
[]
no_license
serk123/L2jOpenSource
6d6e1988a421763a9467bba0e4ac1fe3796b34b3
603e784e5f58f7fd07b01f6282218e8492f7090b
refs/heads/master
2023-03-18T01:51:23.867273
2020-04-23T10:44:41
2020-04-23T10:44:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,828
java
/* * Copyright (C) 2004-2019 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J DataPack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.enums.ShotType; import com.l2jserver.gameserver.handler.IItemHandler; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.util.Broadcast; /** * Beast SpiritShot Handler * @author Tempy */ public class BeastSpiritShot implements IItemHandler { @Override public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse) { if (!playable.isPlayer()) { playable.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS); return false; } final L2PcInstance activeOwner = playable.getActingPlayer(); if (!activeOwner.hasSummon()) { activeOwner.sendPacket(SystemMessageId.PETS_ARE_NOT_AVAILABLE_AT_THIS_TIME); return false; } if (activeOwner.getSummon().isDead()) { activeOwner.sendPacket(SystemMessageId.SOULSHOTS_AND_SPIRITSHOTS_ARE_NOT_AVAILABLE_FOR_A_DEAD_PET); return false; } final int itemId = item.getId(); final boolean isBlessed = ((itemId == 6647) || (itemId == 20334)); // TODO: Unhardcode these! final short shotConsumption = activeOwner.getSummon().getSpiritShotsPerHit(); final SkillHolder[] skills = item.getItem().getSkills(); if (skills == null) { _log.log(Level.WARNING, getClass().getSimpleName() + ": is missing skills!"); return false; } long shotCount = item.getCount(); if (shotCount < shotConsumption) { // Not enough SpiritShots to use. if (!activeOwner.disableAutoShot(itemId)) { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET); } return false; } if (activeOwner.getSummon().isChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS)) { // shots are already active. return false; } if (!activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), shotConsumption, null, false)) { if (!activeOwner.disableAutoShot(itemId)) { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET); } return false; } activeOwner.getSummon().setChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, true); SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.USE_S1_); sm.addItemName(itemId); activeOwner.sendPacket(sm); activeOwner.sendPacket(SystemMessageId.PET_USE_SPIRITSHOT); Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activeOwner.getSummon(), activeOwner.getSummon(), skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600); return true; } }
[ "64197706+L2jOpenSource@users.noreply.github.com" ]
64197706+L2jOpenSource@users.noreply.github.com
32d1bfaeb40d0a7a063b1970247fae97bb3ced85
9468ede9cc6d97447969a3f5f112bfd1f07a6b96
/src/me/jack/LD40/states/MainMenuState.java
5cd07c3a4bc154c1b56247e67bcd17bcd85d5985
[]
no_license
JPatrickDev/LD40
65980316a1f91e02111b8480f9a0000174452ade
1e00932f9c18fcc5ce51d022006e04523a3af302
refs/heads/master
2021-08-23T07:00:38.564298
2017-12-04T01:13:34
2017-12-04T01:13:34
112,802,587
0
0
null
null
null
null
UTF-8
Java
false
false
1,699
java
package me.jack.LD40.states; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; import org.newdawn.slick.SlickException; import org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; import java.awt.*; /** * Created by Jack on 03/12/2017. */ public class MainMenuState extends BasicGameState { Image image; boolean mainMenu = false,aboutMenu = false; Rectangle play = new Rectangle(70,124,340,98); Rectangle about = new Rectangle(70,306,340,98); @Override public int getID() { return 1; } @Override public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException { image = new Image("res/mainMenu.png"); } @Override public void render(GameContainer gameContainer, StateBasedGame stateBasedGame, Graphics graphics) throws SlickException { graphics.drawImage(image, 0, 0); } @Override public void update(GameContainer gameContainer, StateBasedGame stateBasedGame, int i) throws SlickException { if(mainMenu) { stateBasedGame.enterState(0); mainMenu = false; } if(aboutMenu) { stateBasedGame.enterState(2); aboutMenu = false; } } @Override public void mouseReleased(int button, int x, int y) { super.mouseReleased(button, x, y); if(play.contains(x,y)){ InGameState.sounds.get("place").play(); mainMenu = true; } if(about.contains(x,y)){ InGameState.sounds.get("place").play(); aboutMenu = true; } } }
[ "jackpatrickmail@gmail.com" ]
jackpatrickmail@gmail.com
f1ecde6d030660e0a6a6bdaf9eea83593dce2eea
2bd7a1d0f8e1fab827c64810c224ba85df05b2db
/src/main/java/com/fmchallenge/footballmanager/configuration/SwaggerConfiguration.java
929280d59a4bdc54c2907e7472957b9c5c94744c
[ "MIT" ]
permissive
sahindagdelen/FootballManager
366f44c2d24435cbceb98be6046df62654869da8
6b5199b861abab999e9a838fc127d3bc2c28a56e
refs/heads/master
2021-08-02T12:46:21.873168
2019-06-19T18:08:53
2019-06-19T18:08:53
327,872,417
1
0
null
2021-07-23T06:16:51
2021-01-08T10:34:47
null
UTF-8
Java
false
false
835
java
package com.fmchallenge.footballmanager.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfiguration { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("com.fmchallenge.footballmanager.control")) .paths(PathSelectors.any()) .build(); } }
[ "sahindagdelen@gmail.com" ]
sahindagdelen@gmail.com
687b16467abc5390373356743198ede1a5bd1cda
671025b0c578ea47701ba4ee30787213fb1c7862
/app/src/main/java/com/chariotinstruments/markets/MarketCandle.java
082909ceedec1cb534035ef382f0a0bcc875e3d2
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
glennneiger/Markets
3d8cdb48bdad12bed4812b2fa9470b94dc0f8bfd
c59b67b3e5e2a6f66ac3e97cf7c4749103feb4b4
refs/heads/master
2020-12-03T22:45:47.556290
2016-05-19T15:13:30
2016-05-19T15:13:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,898
java
package com.chariotinstruments.markets; /** * Created by user on 2/17/16. */ public class MarketCandle { private int _id; private int _minute; private double _open; private double _high; private double _low; private double _close; private long _volume; private long _date; private int _isOpen; private int _isClose; private String error; //Constructor public MarketCandle(){ } //Getters/setters public int getId(){ return _id; } public void setId(int idIn){ _id = idIn; } public int getMinute(){ return _minute; } public void setMinute(int minuteIn){ _minute = minuteIn; } public double getOpen(){ return _open; } public void setOpen(double openIn){ _open = openIn; } public double getHigh(){ return _high; } public void setHigh(double highIn){ _high = highIn; } public double getLow(){ return _low; } public void setLow(double lowIn){ _low = lowIn; } public double getClose(){ return _close; } public void setClose(double closeIn){ _close = closeIn; } public Long getVolume(){ return _volume; } public void setVolume(Long volumeIn){ _volume = volumeIn; } public long getDate(){ return _date; } public void setDate(long dateIn){ _date = dateIn; } public int getIsOpen(){ return _isOpen; } public void setIsOpen(int isOpenIn){ _isOpen = isOpenIn; } public int getIsClose(){ return _isClose; } public void setIsClose(int isCloseIn){ _isClose = isCloseIn; } public String getError(){ return error; } public void setError(String errorIn){ error = errorIn; } }
[ "mikemey01@gmail.com" ]
mikemey01@gmail.com
2a62bcffdb028d42a40ff3322a17838ec83e88d1
5494d2f87f901b427edc4f0e9f91026f9eaf807e
/CACAndroid/app/src/main/java/com/rubick/cac/android/contact/ui/activity/CACMyCardsV1Activity.java
6ded1151e0449baac12ca8eba1986b262e180345
[ "Apache-2.0" ]
permissive
bblue000/CACProject
6eb7130412630037d57b5c6172fbf9546045fa78
d31b01839455982de3d09f84adc43e8e54a9a058
refs/heads/master
2016-09-06T04:04:05.640500
2015-03-23T16:26:47
2015-03-23T16:26:47
32,453,739
1
0
null
null
null
null
UTF-8
Java
false
false
871
java
package com.rubick.cac.android.contact.ui.activity; import android.os.Bundle; import android.view.View; import com.rubick.cac.android.R; import com.rubick.cac.android.contact.ui.fragment.CACMyCardsV1Fragment; import org.androidrubick.app.BaseActivity; /** * somthing * * <p/> * * Created by Yin Yong on 2015/3/22 0022. */ public class CACMyCardsV1Activity extends BaseActivity { @Override public int provideLayoutResId() { return R.layout.layout_one_fragment; } @Override public void initView(View view, Bundle savedInstanceState) { getSupportFragmentManager().beginTransaction() .add(R.id.layout_one_fragment_container, new CACMyCardsV1Fragment(), "content") .commit(); } @Override public void initListener() { } @Override public void updateDataToUI() { } }
[ "yy15151877621@126.com" ]
yy15151877621@126.com
e47e30311c985e86e302a6a705def1c3a66c36f9
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/xalan/2.5/org/apache/xml/dtm/ref/DTMDocumentImpl.java
6a1dbccbdce170da7c593d3a062921acc5d3839b
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
66,341
java
package org.apache.xml.dtm.ref; import javax.xml.transform.SourceLocator; import org.apache.xml.dtm.DTM; import org.apache.xml.dtm.DTMAxisIterator; import org.apache.xml.dtm.DTMAxisTraverser; import org.apache.xml.dtm.DTMManager; import org.apache.xml.dtm.DTMWSFilter; import org.apache.xml.utils.FastStringBuffer; import org.apache.xml.utils.XMLString; import org.apache.xml.utils.XMLStringFactory; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.Locator; import org.xml.sax.ext.LexicalHandler; /** * This is the implementation of the DTM document interface. It receives * requests from an XML content handler similar to that of an XML DOM or SAX parser * to store information from the xml document in an array based * dtm table structure. This informtion is used later for document navigation, * query, and SAX event dispatch functions. The DTM can also be used directly as a * document composition model for an application. The requests received are: * <ul> * <li>initiating DTM to set the doc handle</li> * <li>resetting DTM for data structure reuse</li> * <li>hinting the end of document to adjust the end of data structure pointers</li> * <li>createnodes (element, comment, text, attribute, ....)</li> * <li>hinting the end of an element to patch parent and siblings<li> * <li>setting application provided symbol name stringpool data structures</li> * </ul> * <p>State: In progress!!</p> * * %REVIEW% I _think_ the SAX convention is that "no namespace" is expressed * as "" rather than as null (which is the DOM's convention). What should * DTM expect? What should it do with the other? * * <p>Origin: the implemention is a composite logic based on the DTM of XalanJ1 and * DocImpl, DocumentImpl, ElementImpl, TextImpl, etc. of XalanJ2</p> */ public class DTMDocumentImpl implements DTM, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler { protected static final byte DOCHANDLE_SHIFT = 22; protected static final int NODEHANDLE_MASK = (1 << (DOCHANDLE_SHIFT + 1)) - 1; protected static final int DOCHANDLE_MASK = -1 - NODEHANDLE_MASK; private boolean previousSiblingWasParent = false; int gotslot[] = new int[4]; private boolean done = false; boolean m_isError = false; private final boolean DEBUG = false; /** The document base URI. */ protected String m_documentBaseURI; /** If we're building the model incrementally on demand, we need to * be able to tell the source when to send us more data. * * Note that if this has not been set, and you attempt to read ahead * of the current build point, we'll probably throw a null-pointer * exception. We could try to wait-and-retry instead, as a very poor * fallback, but that has all the known problems with multithreading * on multiprocessors and we Don't Want to Go There. * * @see setIncrementalSAXSource */ private IncrementalSAXSource m_incrSAXSource=null; ChunkedIntArray nodes = new ChunkedIntArray(4); private FastStringBuffer m_char = new FastStringBuffer(); private int m_char_current_start=0; private DTMStringPool m_localNames = new DTMStringPool(); private DTMStringPool m_nsNames = new DTMStringPool(); private DTMStringPool m_prefixNames = new DTMStringPool(); private ExpandedNameTable m_expandedNames= new ExpandedNameTable(); private XMLStringFactory m_xsf; /** * Construct a DTM. * * @param documentNumber the ID number assigned to this document. * It will be shifted up into the high bits and returned as part of * all node ID numbers, so those IDs indicate which document they * came from as well as a location within the document. It is the * DTMManager's responsibility to assign a unique number to each * document. */ public DTMDocumentImpl(DTMManager mgr, int documentNumber, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory){ m_xsf = xstringfactory; } /** Bind a IncrementalSAXSource to this DTM. If we discover we need nodes * that have not yet been built, we will ask this object to send us more * events, and it will manage interactions with its data sources. * * Note that we do not actually build the IncrementalSAXSource, since we don't * know what source it's reading from, what thread that source will run in, * or when it will run. * * @param source The IncrementalSAXSource that we want to recieve events from * on demand. */ public void setIncrementalSAXSource(IncrementalSAXSource source) { m_incrSAXSource=source; source.setContentHandler(this); source.setLexicalHandler(this); } /** * Wrapper for ChunkedIntArray.append, to automatically update the * previous sibling's "next" reference (if necessary) and periodically * wake a reader who may have encountered incomplete data and entered * a wait state. * @param w0 int As in ChunkedIntArray.append * @param w1 int As in ChunkedIntArray.append * @param w2 int As in ChunkedIntArray.append * @param w3 int As in ChunkedIntArray.append * @return int As in ChunkedIntArray.append * @see ChunkedIntArray.append */ private final int appendNode(int w0, int w1, int w2, int w3) { int slotnumber = nodes.appendSlot(w0, w1, w2, w3); if (DEBUG) System.out.println(slotnumber+": "+w0+" "+w1+" "+w2+" "+w3); if (previousSiblingWasParent) nodes.writeEntry(previousSibling,2,slotnumber); return slotnumber; } /** * Set an implementation dependent feature. * <p> * %REVIEW% Do we really expect to set features on DTMs? * * @param featureId A feature URL. * @param state true if this feature should be on, false otherwise. */ public void setFeature(String featureId, boolean state) {}; /** * Set a reference pointer to the element name symbol table. * %REVIEW% Should this really be Public? Changing it while * DTM is in use would be a disaster. * * @param poolRef DTMStringPool reference to an instance of table. */ public void setLocalNameTable(DTMStringPool poolRef) { m_localNames = poolRef; } /** * Get a reference pointer to the element name symbol table. * * @return DTMStringPool reference to an instance of table. */ public DTMStringPool getLocalNameTable() { return m_localNames; } /** * Set a reference pointer to the namespace URI symbol table. * %REVIEW% Should this really be Public? Changing it while * DTM is in use would be a disaster. * * @param poolRef DTMStringPool reference to an instance of table. */ public void setNsNameTable(DTMStringPool poolRef) { m_nsNames = poolRef; } /** * Get a reference pointer to the namespace URI symbol table. * * @return DTMStringPool reference to an instance of table. */ public DTMStringPool getNsNameTable() { return m_nsNames; } /** * Set a reference pointer to the prefix name symbol table. * %REVIEW% Should this really be Public? Changing it while * DTM is in use would be a disaster. * * @param poolRef DTMStringPool reference to an instance of table. */ public void setPrefixNameTable(DTMStringPool poolRef) { m_prefixNames = poolRef; } /** * Get a reference pointer to the prefix name symbol table. * * @return DTMStringPool reference to an instance of table. */ public DTMStringPool getPrefixNameTable() { return m_prefixNames; } /** * Set a reference pointer to the content-text repository * * @param bufferRef FastStringBuffer reference to an instance of * buffer */ void setContentBuffer(FastStringBuffer buffer) { m_char = buffer; } /** * Get a reference pointer to the content-text repository * * @return FastStringBuffer reference to an instance of buffer */ FastStringBuffer getContentBuffer() { return m_char; } /** getContentHandler returns "our SAX builder" -- the thing that * someone else should send SAX events to in order to extend this * DTM model. * * @return null if this model doesn't respond to SAX events, * "this" if the DTM object has a built-in SAX ContentHandler, * the IncrementalSAXSource if we're bound to one and should receive * the SAX stream via it for incremental build purposes... * */ public org.xml.sax.ContentHandler getContentHandler() { if (m_incrSAXSource instanceof IncrementalSAXSource_Filter) return (ContentHandler) m_incrSAXSource; else return this; } /** * Return this DTM's lexical handler. * * %REVIEW% Should this return null if constrution already done/begun? * * @return null if this model doesn't respond to lexical SAX events, * "this" if the DTM object has a built-in SAX ContentHandler, * the IncrementalSAXSource if we're bound to one and should receive * the SAX stream via it for incremental build purposes... */ public LexicalHandler getLexicalHandler() { if (m_incrSAXSource instanceof IncrementalSAXSource_Filter) return (LexicalHandler) m_incrSAXSource; else return this; } /** * Return this DTM's EntityResolver. * * @return null if this model doesn't respond to SAX entity ref events. */ public org.xml.sax.EntityResolver getEntityResolver() { return null; } /** * Return this DTM's DTDHandler. * * @return null if this model doesn't respond to SAX dtd events. */ public org.xml.sax.DTDHandler getDTDHandler() { return null; } /** * Return this DTM's ErrorHandler. * * @return null if this model doesn't respond to SAX error events. */ public org.xml.sax.ErrorHandler getErrorHandler() { return null; } /** * Return this DTM's DeclHandler. * * @return null if this model doesn't respond to SAX Decl events. */ public org.xml.sax.ext.DeclHandler getDeclHandler() { return null; } /** @return true iff we're building this model incrementally (eg * we're partnered with a IncrementalSAXSource) and thus require that the * transformation and the parse run simultaneously. Guidance to the * DTMManager. * */ public boolean needsTwoThreads() { return null!=m_incrSAXSource; } public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException { m_char.append(ch,start,length); } private void processAccumulatedText() { int len=m_char.length(); if(len!=m_char_current_start) { appendTextChild(m_char_current_start,len-m_char_current_start); m_char_current_start=len; } } public void endDocument() throws org.xml.sax.SAXException { appendEndDocument(); } public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException { processAccumulatedText(); appendEndElement(); } public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException { } public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { } public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException { processAccumulatedText(); } public void setDocumentLocator(Locator locator) { } public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException { processAccumulatedText(); } public void startDocument() throws org.xml.sax.SAXException { appendStartDocument(); } public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws org.xml.sax.SAXException { processAccumulatedText(); String prefix=null; int colon=qName.indexOf(':'); if(colon>0) prefix=qName.substring(0,colon); /**/System.out.println("Prefix="+prefix+" index="+m_prefixNames.stringToIndex(prefix)); appendStartElement(m_nsNames.stringToIndex(namespaceURI), m_localNames.stringToIndex(localName), int nAtts=(atts==null) ? 0 : atts.getLength(); for(int i=nAtts-1;i>=0;--i) { qName=atts.getQName(i); if(qName.startsWith("xmlns:") || "xmlns".equals(qName)) { prefix=null; colon=qName.indexOf(':'); if(colon>0) { prefix=qName.substring(0,colon); } else { } appendNSDeclaration( m_prefixNames.stringToIndex(prefix), m_nsNames.stringToIndex(atts.getValue(i)), atts.getType(i).equalsIgnoreCase("ID")); } } for(int i=nAtts-1;i>=0;--i) { qName=atts.getQName(i); if(!(qName.startsWith("xmlns:") || "xmlns".equals(qName))) { prefix=null; colon=qName.indexOf(':'); if(colon>0) { prefix=qName.substring(0,colon); localName=qName.substring(colon+1); } else { localName=qName; } int contentEnd=m_char.length(); if(!("xmlns".equals(prefix) || "xmlns".equals(qName))) appendAttribute(m_nsNames.stringToIndex(atts.getURI(i)), m_localNames.stringToIndex(localName), m_prefixNames.stringToIndex(prefix), atts.getType(i).equalsIgnoreCase("ID"), m_char_current_start, contentEnd-m_char_current_start); m_char_current_start=contentEnd; } } } public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { } public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException { processAccumulatedText(); appendComment(m_char_current_start,length); m_char_current_start+=length; } public void endCDATA() throws org.xml.sax.SAXException { } public void endDTD() throws org.xml.sax.SAXException { } public void endEntity(java.lang.String name) throws org.xml.sax.SAXException { } public void startCDATA() throws org.xml.sax.SAXException { } public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException { } public void startEntity(java.lang.String name) throws org.xml.sax.SAXException { } /** * Reset a dtm document to its initial (empty) state. * * The DTMManager will invoke this method when the dtm is created. * * @param docHandle int the handle for the DTM document. */ final void initDocument(int documentNumber) { m_docHandle = documentNumber<<DOCHANDLE_SHIFT; nodes.writeSlot(0,DOCUMENT_NODE,-1,-1,0); done = false; } /** Given a node handle, test if it has child nodes. * <p> %REVIEW% This is obviously useful at the DOM layer, where it * would permit testing this without having to create a proxy * node. It's less useful in the DTM API, where * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and * almost as self-evident. But it's a convenience, and eases porting * of DOM code to DTM. </p> * * @param nodeHandle int Handle of the node. * @return int true if the given node has child nodes. */ public boolean hasChildNodes(int nodeHandle) { return(getFirstChild(nodeHandle) != NULL); } /** * Given a node handle, get the handle of the node's first child. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param nodeHandle int Handle of the node. * @return int DTM node-number of first child, or DTM.NULL to indicate none exists. */ public int getFirstChild(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); if ((type == ELEMENT_NODE) || (type == DOCUMENT_NODE) || (type == ENTITY_REFERENCE_NODE)) { int kid = nodeHandle + 1; nodes.readSlot(kid, gotslot); while (ATTRIBUTE_NODE == (gotslot[0] & 0xFFFF)) { kid = gotslot[2]; if (kid == NULL) return NULL; nodes.readSlot(kid, gotslot); } if (gotslot[1] == nodeHandle) { int firstChild = kid | m_docHandle; return firstChild; } } return NULL; } /** * Given a node handle, advance to its last child. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param nodeHandle int Handle of the node. * @return int Node-number of last child, * or DTM.NULL to indicate none exists. */ public int getLastChild(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; int lastChild = NULL; for (int nextkid = getFirstChild(nodeHandle); nextkid != NULL; nextkid = getNextSibling(nextkid)) { lastChild = nextkid; } return lastChild | m_docHandle; } /** * Retrieves an attribute node by by qualified name and namespace URI. * * @param nodeHandle int Handle of the node upon which to look up this attribute. * @param namespaceURI The namespace URI of the attribute to * retrieve, or null. * @param name The local name of the attribute to * retrieve. * @return The attribute node handle with the specified name ( * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such * attribute. */ public int getAttributeNode(int nodeHandle, String namespaceURI, String name) { int nsIndex = m_nsNames.stringToIndex(namespaceURI), nameIndex = m_localNames.stringToIndex(name); nodeHandle &= NODEHANDLE_MASK; nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); if (type == ELEMENT_NODE) nodeHandle++; while (type == ATTRIBUTE_NODE) { if ((nsIndex == (gotslot[0] << 16)) && (gotslot[3] == nameIndex)) return nodeHandle | m_docHandle; nodeHandle = gotslot[2]; nodes.readSlot(nodeHandle, gotslot); } return NULL; } /** * Given a node handle, get the index of the node's first attribute. * * @param nodeHandle int Handle of the Element node. * @return Handle of first attribute, or DTM.NULL to indicate none exists. */ public int getFirstAttribute(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; if (ELEMENT_NODE != (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) return NULL; nodeHandle++; return(ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) ? nodeHandle | m_docHandle : NULL; } /** * Given a node handle, get the index of the node's first child. * If not yet resolved, waits for more nodes to be added to the document and * tries again * * @param nodeHandle handle to node, which should probably be an element * node, but need not be. * * @param inScope true if all namespaces in scope should be returned, * false if only the namespace declarations should be * returned. * @return handle of first namespace, or DTM.NULL to indicate none exists. */ public int getFirstNamespaceNode(int nodeHandle, boolean inScope) { return NULL; } /** * Given a node handle, advance to its next sibling. * * %TBD% This currently uses the DTM-internal definition of * sibling; eg, the last attr's next sib is the first * child. In the old DTM, the DOM proxy layer provided the * additional logic for the public view. If we're rewriting * for XPath emulation, that test must be done here. * * %TBD% CODE INTERACTION WITH INCREMENTAL PARSE - If not yet * resolved, should wait for more nodes to be added to the document * and tries again. * * @param nodeHandle int Handle of the node. * @return int Node-number of next sibling, * or DTM.NULL to indicate none exists. * */ public int getNextSibling(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; if (nodeHandle == 0) return NULL; short type = (short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF); if ((type == ELEMENT_NODE) || (type == ATTRIBUTE_NODE) || (type == ENTITY_REFERENCE_NODE)) { int nextSib = nodes.readEntry(nodeHandle, 2); if (nextSib == NULL) return NULL; if (nextSib != 0) return (m_docHandle | nextSib); } int thisParent = nodes.readEntry(nodeHandle, 1); if (nodes.readEntry(++nodeHandle, 1) == thisParent) return (m_docHandle | nodeHandle); return NULL; } /** * Given a node handle, find its preceeding sibling. * WARNING: DTM is asymmetric; this operation is resolved by search, and is * relatively expensive. * * @param nodeHandle the id of the node. * @return int Node-number of the previous sib, * or DTM.NULL to indicate none exists. */ public int getPreviousSibling(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; if (nodeHandle == 0) return NULL; int parent = nodes.readEntry(nodeHandle, 1); int kid = NULL; for (int nextkid = getFirstChild(parent); nextkid != nodeHandle; nextkid = getNextSibling(nextkid)) { kid = nextkid; } return kid | m_docHandle; } /** * Given a node handle, advance to the next attribute. If an * element, we advance to its first attribute; if an attr, we advance to * the next attr on the same node. * * @param nodeHandle int Handle of the node. * @return int DTM node-number of the resolved attr, * or DTM.NULL to indicate none exists. */ public int getNextAttribute(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); if (type == ELEMENT_NODE) { return getFirstAttribute(nodeHandle); } else if (type == ATTRIBUTE_NODE) { if (gotslot[2] != NULL) return (m_docHandle | gotslot[2]); } return NULL; } /** * Given a namespace handle, advance to the next namespace. * * %TBD% THIS METHOD DOES NOT MATCH THE CURRENT SIGNATURE IN * THE DTM INTERFACE. FIX IT, OR JUSTIFY CHANGING THE DTM * API. * * @param namespaceHandle handle to node which must be of type NAMESPACE_NODE. * @return handle of next namespace, or DTM.NULL to indicate none exists. */ public int getNextNamespaceNode(int baseHandle,int namespaceHandle, boolean inScope) { return NULL; } /** * Given a node handle, advance to its next descendant. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param subtreeRootNodeHandle * @param nodeHandle int Handle of the node. * @return handle of next descendant, * or DTM.NULL to indicate none exists. */ public int getNextDescendant(int subtreeRootHandle, int nodeHandle) { subtreeRootHandle &= NODEHANDLE_MASK; nodeHandle &= NODEHANDLE_MASK; if (nodeHandle == 0) return NULL; while (!m_isError) { if (done && (nodeHandle > nodes.slotsUsed())) break; if (nodeHandle > subtreeRootHandle) { nodes.readSlot(nodeHandle+1, gotslot); if (gotslot[2] != 0) { short type = (short) (gotslot[0] & 0xFFFF); if (type == ATTRIBUTE_NODE) { nodeHandle +=2; } else { int nextParentPos = gotslot[1]; if (nextParentPos >= subtreeRootHandle) return (m_docHandle | (nodeHandle+1)); else break; } } else if (!done) { } else break; } else { nodeHandle++; } } return NULL; } /** * Given a node handle, advance to the next node on the following axis. * * @param axisContextHandle the start of the axis that is being traversed. * @param nodeHandle * @return handle of next sibling, * or DTM.NULL to indicate none exists. */ public int getNextFollowing(int axisContextHandle, int nodeHandle) { return NULL; } /** * Given a node handle, advance to the next node on the preceding axis. * * @param axisContextHandle the start of the axis that is being traversed. * @param nodeHandle the id of the node. * @return int Node-number of preceding sibling, * or DTM.NULL to indicate none exists. */ public int getNextPreceding(int axisContextHandle, int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; while (nodeHandle > 1) { nodeHandle--; if (ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) continue; return (m_docHandle | nodes.specialFind(axisContextHandle, nodeHandle)); } return NULL; } /** * Given a node handle, find its parent node. * * @param nodeHandle the id of the node. * @return int Node-number of parent, * or DTM.NULL to indicate none exists. */ public int getParent(int nodeHandle) { return (m_docHandle | nodes.readEntry(nodeHandle, 1)); } /** * Returns the root element of the document. * @return nodeHandle to the Document Root. */ public int getDocumentRoot() { return (m_docHandle | m_docElement); } /** * Given a node handle, find the owning document node. * * @param nodeHandle the id of the node. * @return int Node handle of document, which should always be valid. */ public int getDocument() { return m_docHandle; } /** * Given a node handle, find the owning document node. This has the exact * same semantics as the DOM Document method of the same name, in that if * the nodeHandle is a document node, it will return NULL. * * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM * binding layer. Included here as a convenience function and to * aid porting of DOM code to DTM.</p> * * @param nodeHandle the id of the node. * @return int Node handle of owning document, or NULL if the nodeHandle is * a document. */ public int getOwnerDocument(int nodeHandle) { if ((nodeHandle & NODEHANDLE_MASK) == 0) return NULL; return (nodeHandle & DOCHANDLE_MASK); } /** * Given a node handle, find the owning document node. This has the DTM * semantics; a Document node is its own owner. * * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM * binding layer. Included here as a convenience function and to * aid porting of DOM code to DTM.</p> * * @param nodeHandle the id of the node. * @return int Node handle of owning document, or NULL if the nodeHandle is * a document. */ public int getDocumentRoot(int nodeHandle) { if ((nodeHandle & NODEHANDLE_MASK) == 0) return NULL; return (nodeHandle & DOCHANDLE_MASK); } /** * Get the string-value of a node as a String object * for the definition of a node's string-value). * * @param nodeHandle The node ID. * * @return A string object that represents the string-value of the given node. */ public XMLString getStringValue(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); int nodetype=gotslot[0] & 0xFF; String value=null; switch (nodetype) { case TEXT_NODE: case COMMENT_NODE: case CDATA_SECTION_NODE: value= m_char.getString(gotslot[2], gotslot[3]); break; case PROCESSING_INSTRUCTION_NODE: case ATTRIBUTE_NODE: case ELEMENT_NODE: case ENTITY_REFERENCE_NODE: default: break; } return m_xsf.newstr( value ); } /** * Get number of character array chunks in * the string-value of a node. * for the definition of a node's string-value). * Note that a single text node may have multiple text chunks. * * EXPLANATION: This method is an artifact of the fact that the * underlying m_chars object may not store characters in a * single contiguous array -- for example,the current * FastStringBuffer may split a single node's text across * multiple allocation units. This call tells us how many * separate accesses will be required to retrieve the entire * content. PLEASE NOTE that this may not be the same as the * number of SAX characters() events that caused the text node * to be built in the first place, since m_chars buffering may * be on different boundaries than the parser's buffers. * * @param nodeHandle The node ID. * * @return number of character array chunks in * the string-value of a node. * */ public int getStringValueChunkCount(int nodeHandle) { return 0; } /** * Get a character array chunk in the string-value of a node. * for the definition of a node's string-value). * Note that a single text node may have multiple text chunks. * * EXPLANATION: This method is an artifact of the fact that * the underlying m_chars object may not store characters in a * single contiguous array -- for example,the current * FastStringBuffer may split a single node's text across * multiple allocation units. This call retrieves a single * contiguous portion of the text -- as much as m-chars was * able to store in a single allocation unit. PLEASE NOTE * that this may not be the same granularityas the SAX * characters() events that caused the text node to be built * in the first place, since m_chars buffering may be on * different boundaries than the parser's buffers. * * @param nodeHandle The node ID. * @param chunkIndex Which chunk to get. * @param startAndLen An array of 2 where the start position and length of * the chunk will be returned. * * @return The character array reference where the chunk occurs. */ public char[] getStringValueChunk(int nodeHandle, int chunkIndex, int[] startAndLen) {return new char[0];} /** * Given a node handle, return an ID that represents the node's expanded name. * * @param nodeHandle The handle to the node in question. * * @return the expanded-name id of the node. */ public int getExpandedTypeID(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); String qName = m_localNames.indexToString(gotslot[3]); int colonpos = qName.indexOf(":"); String localName = qName.substring(colonpos+1); String namespace = m_nsNames.indexToString(gotslot[0] << 16); String expandedName = namespace + ":" + localName; int expandedNameID = m_nsNames.stringToIndex(expandedName); return expandedNameID; } /** * Given an expanded name, return an ID. If the expanded-name does not * exist in the internal tables, the entry will be created, and the ID will * be returned. Any additional nodes that are created that have this * expanded name will use this ID. * * @param nodeHandle The handle to the node in question. * * @return the expanded-name id of the node. */ public int getExpandedTypeID(String namespace, String localName, int type) { String expandedName = namespace + ":" + localName; int expandedNameID = m_nsNames.stringToIndex(expandedName); return expandedNameID; } /** * Given an expanded-name ID, return the local name part. * * @param ExpandedNameID an ID that represents an expanded-name. * @return String Local name of this node. */ public String getLocalNameFromExpandedNameID(int ExpandedNameID) { String expandedName = m_localNames.indexToString(ExpandedNameID); int colonpos = expandedName.indexOf(":"); String localName = expandedName.substring(colonpos+1); return localName; } /** * Given an expanded-name ID, return the namespace URI part. * * @param ExpandedNameID an ID that represents an expanded-name. * @return String URI value of this node's namespace, or null if no * namespace was resolved. */ public String getNamespaceFromExpandedNameID(int ExpandedNameID) { String expandedName = m_localNames.indexToString(ExpandedNameID); int colonpos = expandedName.indexOf(":"); String nsName = expandedName.substring(0, colonpos); return nsName; } /** * fixednames */ static final String[] fixednames= { /** * Given a node handle, return its DOM-style node name. This will * include names such as #text or #document. * * @param nodeHandle the id of the node. * @return String Name of this node, which may be an empty string. * %REVIEW% Document when empty string is possible... */ public String getNodeName(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); String name = fixednames[type]; if (null == name) { int i=gotslot[3]; /**/System.out.println("got i="+i+" "+(i>>16)+"/"+(i&0xffff)); name=m_localNames.indexToString(i & 0xFFFF); String prefix=m_prefixNames.indexToString(i >>16); if(prefix!=null && prefix.length()>0) name=prefix+":"+name; } return name; } /** * Given a node handle, return the XPath node name. This should be * the name as described by the XPath data model, NOT the DOM-style * name. * * @param nodeHandle the id of the node. * @return String Name of this node. */ public String getNodeNameX(int nodeHandle) {return null;} /** * Given a node handle, return its DOM-style localname. * (As defined in Namespaces, this is the portion of the name after any * colon character) * * %REVIEW% What's the local name of something other than Element/Attr? * Should this be DOM-style (undefined unless namespaced), or other? * * @param nodeHandle the id of the node. * @return String Local name of this node. */ public String getLocalName(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); String name = ""; if ((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) { int i=gotslot[3]; name=m_localNames.indexToString(i & 0xFFFF); if(name==null) name=""; } return name; } /** * Given a namespace handle, return the prefix that the namespace decl is * mapping. * Given a node handle, return the prefix used to map to the namespace. * * <p> %REVIEW% Are you sure you want "" for no prefix? </p> * * %REVIEW% Should this be DOM-style (undefined unless namespaced), * or other? * * @param nodeHandle the id of the node. * @return String prefix of this node's name, or "" if no explicit * namespace prefix was given. */ public String getPrefix(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); String name = ""; if((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) { int i=gotslot[3]; name=m_prefixNames.indexToString(i >>16); if(name==null) name=""; } return name; } /** * Given a node handle, return its DOM-style namespace URI * (As defined in Namespaces, this is the declared URI which this node's * prefix -- or default in lieu thereof -- was mapped to.) * * @param nodeHandle the id of the node. * @return String URI value of this node's namespace, or null if no * namespace was resolved. */ public String getNamespaceURI(int nodeHandle) {return null;} /** * Given a node handle, return its node value. This is mostly * as defined by the DOM, but may ignore some conveniences. * <p> * * @param nodeHandle The node id. * @return String Value of this node, or null if not * meaningful for this node type. */ public String getNodeValue(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); String value=null; case ATTRIBUTE_NODE: nodes.readSlot(nodeHandle+1, gotslot); case TEXT_NODE: case COMMENT_NODE: case CDATA_SECTION_NODE: break; case PROCESSING_INSTRUCTION_NODE: case ELEMENT_NODE: case ENTITY_REFERENCE_NODE: default: break; } return value; } /** * Given a node handle, return its DOM-style node type. * <p> * %REVIEW% Generally, returning short is false economy. Return int? * * @param nodeHandle The node id. * @return int Node type, as per the DOM's Node._NODE constants. */ public short getNodeType(int nodeHandle) { return(short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF); } /** * <meta name="usage" content="internal"/> * Get the depth level of this node in the tree (equals 1 for * a parentless node). * * @param nodeHandle The node id. * @return the number of ancestors, plus one */ public short getLevel(int nodeHandle) { short count = 0; while (nodeHandle != 0) { count++; nodeHandle = nodes.readEntry(nodeHandle, 1); } return count; } /** * Tests whether DTM DOM implementation implements a specific feature and * that feature is supported by this node. * * @param feature The name of the feature to test. * @param versionThis is the version number of the feature to test. * If the version is not * specified, supporting any version of the feature will cause the * method to return <code>true</code>. * @return Returns <code>true</code> if the specified feature is * supported on this node, <code>false</code> otherwise. */ public boolean isSupported(String feature, String version) {return false;} /** * Return the base URI of the document entity. If it is not known * (because the document was parsed from a socket connection or from * standard input, for example), the value of this property is unknown. * * @return the document base URI String object or null if unknown. */ public String getDocumentBaseURI() { return m_documentBaseURI; } /** * Set the base URI of the document entity. * * @param baseURI the document base URI String object or null if unknown. */ public void setDocumentBaseURI(String baseURI) { m_documentBaseURI = baseURI; } /** * Return the system identifier of the document entity. If * it is not known, the value of this property is unknown. * * @param nodeHandle The node id, which can be any valid node handle. * @return the system identifier String object or null if unknown. */ public String getDocumentSystemIdentifier(int nodeHandle) {return null;} /** * Return the name of the character encoding scheme * in which the document entity is expressed. * * @param nodeHandle The node id, which can be any valid node handle. * @return the document encoding String object. */ public String getDocumentEncoding(int nodeHandle) {return null;} /** * Return an indication of the standalone status of the document, * either "yes" or "no". This property is derived from the optional * standalone document declaration in the XML declaration at the * beginning of the document entity, and has no value if there is no * standalone document declaration. * * @param nodeHandle The node id, which can be any valid node handle. * @return the document standalone String object, either "yes", "no", or null. */ public String getDocumentStandalone(int nodeHandle) {return null;} /** * Return a string representing the XML version of the document. This * property is derived from the XML declaration optionally present at the * beginning of the document entity, and has no value if there is no XML * declaration. * * @param the document handle * * @return the document version String object */ public String getDocumentVersion(int documentHandle) {return null;} /** * Return an indication of * whether the processor has read the complete DTD. Its value is a * boolean. If it is false, then certain properties (indicated in their * descriptions below) may be unknown. If it is true, those properties * are never unknown. * * @return <code>true</code> if all declarations were processed {}; * <code>false</code> otherwise. */ public boolean getDocumentAllDeclarationsProcessed() {return false;} /** * A document type declaration information item has the following properties: * * 1. [system identifier] The system identifier of the external subset, if * it exists. Otherwise this property has no value. * * @return the system identifier String object, or null if there is none. */ public String getDocumentTypeDeclarationSystemIdentifier() {return null;} /** * Return the public identifier of the external subset, * normalized as described in 4.2.2 External Entities [XML]. If there is * no external subset or if it has no public identifier, this property * has no value. * * @param the document type declaration handle * * @return the public identifier String object, or null if there is none. */ public String getDocumentTypeDeclarationPublicIdentifier() {return null;} /** * Returns the <code>Element</code> whose <code>ID</code> is given by * <code>elementId</code>. If no such element exists, returns * <code>DTM.NULL</code>. Behavior is not defined if more than one element * has this <code>ID</code>. Attributes (including those * with the name "ID") are not of type ID unless so defined by DTD/Schema * information available to the DTM implementation. * Implementations that do not know whether attributes are of type ID or * not are expected to return <code>DTM.NULL</code>. * * <p>%REVIEW% Presumably IDs are still scoped to a single document, * and this operation searches only within a single document, right? * Wouldn't want collisions between DTMs in the same process.</p> * * @param elementId The unique <code>id</code> value for an element. * @return The handle of the matching element. */ public int getElementById(String elementId) {return 0;} /** * The getUnparsedEntityURI function returns the URI of the unparsed * entity with the specified name in the same document as the context * node (see [3.3 Unparsed Entities]). It returns the empty string if * there is no such entity. * <p> * XML processors may choose to use the System Identifier (if one * is provided) to resolve the entity, rather than the URI in the * Public Identifier. The details are dependent on the processor, and * we would have to support some form of plug-in resolver to handle * this properly. Currently, we simply return the System Identifier if * present, and hope that it a usable URI or that our caller can * map it to one. * TODO: Resolve Public Identifiers... or consider changing function name. * <p> * If we find a relative URI * reference, XML expects it to be resolved in terms of the base URI * of the document. The DOM doesn't do that for us, and it isn't * entirely clear whether that should be done here; currently that's * pushed up to a higher level of our application. (Note that DOM Level * 1 didn't store the document's base URI.) * TODO: Consider resolving Relative URIs. * <p> * (The DOM's statement that "An XML processor may choose to * completely expand entities before the structure model is passed * to the DOM" refers only to parsed entities, not unparsed, and hence * doesn't affect this function.) * * @param name A string containing the Entity Name of the unparsed * entity. * * @return String containing the URI of the Unparsed Entity, or an * empty string if no such entity exists. */ public String getUnparsedEntityURI(String name) {return null;} /** * Return true if the xsl:strip-space or xsl:preserve-space was processed * during construction of the DTM document. * * <p>%REVEIW% Presumes a 1:1 mapping from DTM to Document, since * we aren't saying which Document to query...?</p> */ public boolean supportsPreStripping() {return false;} /** * Figure out whether nodeHandle2 should be considered as being later * in the document than nodeHandle1, in Document Order as defined * by the XPath model. This may not agree with the ordering defined * by other XML applications. * <p> * There are some cases where ordering isn't defined, and neither are * the results of this function -- though we'll generally return true. * * TODO: Make sure this does the right thing with attribute nodes!!! * * @param node1 DOM Node to perform position comparison on. * @param node2 DOM Node to perform position comparison on . * * @return false if node2 comes before node1, otherwise return true. * You can think of this as * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>. */ public boolean isNodeAfter(int nodeHandle1, int nodeHandle2) {return false;} /** * 2. [element content whitespace] A boolean indicating whether the * character is white space appearing within element content (see [XML], * 2.10 "White Space Handling"). Note that validating XML processors are * required by XML 1.0 to provide this information. If there is no * declaration for the containing element, this property has no value for * white space characters. If no declaration has been read, but the [all * declarations processed] property of the document information item is * false (so there may be an unread declaration), then the value of this * property is unknown for white space characters. It is always false for * characters that are not white space. * * @param nodeHandle the node ID. * @return <code>true</code> if the character data is whitespace; * <code>false</code> otherwise. */ public boolean isCharacterElementContentWhitespace(int nodeHandle) {return false;} /** * 10. [all declarations processed] This property is not strictly speaking * part of the infoset of the document. Rather it is an indication of * whether the processor has read the complete DTD. Its value is a * boolean. If it is false, then certain properties (indicated in their * descriptions below) may be unknown. If it is true, those properties * are never unknown. * * @param the document handle * * @param documentHandle A node handle that must identify a document. * @return <code>true</code> if all declarations were processed; * <code>false</code> otherwise. */ public boolean isDocumentAllDeclarationsProcessed(int documentHandle) {return false;} /** * 5. [specified] A flag indicating whether this attribute was actually * specified in the start-tag of its element, or was defaulted from the * DTD. * * @param the attribute handle * * NEEDSDOC @param attributeHandle * @return <code>true</code> if the attribute was specified; * <code>false</code> if it was defaulted. */ public boolean isAttributeSpecified(int attributeHandle) {return false;} /** * Directly call the * characters method on the passed ContentHandler for the * for the definition of a node's string-value). Multiple calls to the * ContentHandler's characters methods may well occur for a single call to * this method. * * @param nodeHandle The node ID. * @param ch A non-null reference to a ContentHandler. * * @throws org.xml.sax.SAXException */ public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException {} /** * Directly create SAX parser events from a subtree. * * @param nodeHandle The node ID. * @param ch A non-null reference to a ContentHandler. * * @throws org.xml.sax.SAXException */ public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException {} /** * Return an DOM node for the given node. * * @param nodeHandle The node ID. * * @return A node representation of the DTM node. */ public org.w3c.dom.Node getNode(int nodeHandle) { return null; } /** * Append a child to the end of the child list of the current node. Please note that the node * is always cloned if it is owned by another document. * * <p>%REVIEW% "End of the document" needs to be defined more clearly. * Does it become the last child of the Document? Of the root element?</p> * * @param newChild Must be a valid new node handle. * @param clone true if the child should be cloned into the document. * @param cloneDepth if the clone argument is true, specifies that the * clone should include all it's children. */ public void appendChild(int newChild, boolean clone, boolean cloneDepth) { boolean sameDoc = ((newChild & DOCHANDLE_MASK) == m_docHandle); if (clone || !sameDoc) { } else { } } /** * Append a text node child that will be constructed from a string, * to the end of the document. * * <p>%REVIEW% "End of the document" needs to be defined more clearly. * Does it become the last child of the Document? Of the root element?</p> * * @param str Non-null reference to a string. */ public void appendTextChild(String str) { } /** Append a text child at the current insertion point. Assumes that the * actual content of the text has previously been appended to the m_char * buffer (shared with the builder). * * @param m_char_current_start int Starting offset of node's content in m_char. * @param contentLength int Length of node's content in m_char. * */ void appendTextChild(int m_char_current_start,int contentLength) { int w0 = TEXT_NODE; int w1 = currentParent; int w2 = m_char_current_start; int w3 = contentLength; int ourslot = appendNode(w0, w1, w2, w3); previousSibling = ourslot; } /** Append a comment child at the current insertion point. Assumes that the * actual content of the comment has previously been appended to the m_char * buffer (shared with the builder). * * @param m_char_current_start int Starting offset of node's content in m_char. * @param contentLength int Length of node's content in m_char. * */ void appendComment(int m_char_current_start,int contentLength) { int w0 = COMMENT_NODE; int w1 = currentParent; int w2 = m_char_current_start; int w3 = contentLength; int ourslot = appendNode(w0, w1, w2, w3); previousSibling = ourslot; } /** Append an Element child at the current insertion point. This * Element then _becomes_ the insertion point; subsequent appends * become its lastChild until an appendEndElement() call is made. * * Assumes that the symbols (local name, namespace URI and prefix) * have already been added to the pools * * Note that this _only_ handles the Element node itself. Attrs and * namespace nodes are unbundled in the ContentHandler layer * and appended separately. * * @param namespaceIndex: Index within the namespaceURI string pool * @param localNameIndex Index within the local name string pool * @param prefixIndex: Index within the prefix string pool * */ void appendStartElement(int namespaceIndex,int localNameIndex, int prefixIndex) { int w0 = (namespaceIndex << 16) | ELEMENT_NODE; int w1 = currentParent; int w2 = 0; int w3 = localNameIndex | prefixIndex<<16; /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff)); int ourslot = appendNode(w0, w1, w2, w3); currentParent = ourslot; previousSibling = 0; if (m_docElement == NULL) m_docElement = ourslot; } /** Append a Namespace Declaration child at the current insertion point. * Assumes that the symbols (namespace URI and prefix) have already been * added to the pools * * @param prefixIndex: Index within the prefix string pool * @param namespaceIndex: Index within the namespaceURI string pool * @param isID: If someone really insists on writing a bad DTD, it is * theoretically possible for a namespace declaration to also be declared * as being a node ID. I don't really want to support that stupidity, * but I'm not sure we can refuse to accept it. * */ void appendNSDeclaration(int prefixIndex, int namespaceIndex, boolean isID) { int w1 = currentParent; int w2 = 0; int w3 = namespaceIndex; int ourslot = appendNode(w0, w1, w2, w3); previousSiblingWasParent = false; } /** Append an Attribute child at the current insertion * point. Assumes that the symbols (namespace URI, local name, and * prefix) have already been added to the pools, and that the content has * already been appended to m_char. Note that the attribute's content has * been flattened into a single string; DTM does _NOT_ attempt to model * the details of entity references within attribute values. * * @param namespaceIndex int Index within the namespaceURI string pool * @param localNameIndex int Index within the local name string pool * @param prefixIndex int Index within the prefix string pool * @param isID boolean True if this attribute was declared as an ID * (for use in supporting getElementByID). * @param m_char_current_start int Starting offset of node's content in m_char. * @param contentLength int Length of node's content in m_char. * */ void appendAttribute(int namespaceIndex, int localNameIndex, int prefixIndex, boolean isID, int m_char_current_start, int contentLength) { int w0 = ATTRIBUTE_NODE | namespaceIndex<<16; int w1 = currentParent; int w2 = 0; int w3 = localNameIndex | prefixIndex<<16; /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff)); int ourslot = appendNode(w0, w1, w2, w3); w0 = TEXT_NODE; w1 = ourslot; w2 = m_char_current_start; w3 = contentLength; appendNode(w0, w1, w2, w3); previousSiblingWasParent = true; } /** * This returns a stateless "traverser", that can navigate over an * XPath axis, though not in document order. * * @param axis One of Axes.ANCESTORORSELF, etc. * * @return A DTMAxisIterator, or null if the given axis isn't supported. */ public DTMAxisTraverser getAxisTraverser(final int axis) { return null; } /** * This is a shortcut to the iterators that implement the * supported XPath axes (only namespace::) is not supported. * Returns a bare-bones iterator that must be initialized * with a start node (using iterator.setStartNode()). * * @param axis One of Axes.ANCESTORORSELF, etc. * * @return A DTMAxisIterator, or null if the given axis isn't supported. */ public DTMAxisIterator getAxisIterator(final int axis) { return null; } /** * Get an iterator that can navigate over an XPath Axis, predicated by * the extended type ID. * * * @param axis * @param type An extended type ID. * * @return A DTMAxisIterator, or null if the given axis isn't supported. */ public DTMAxisIterator getTypedAxisIterator(final int axis, final int type) { return null; } /** Terminate the element currently acting as an insertion point. Subsequent * insertions will occur as the last child of this element's parent. * */ void appendEndElement() { if (previousSiblingWasParent) nodes.writeEntry(previousSibling, 2, NULL); previousSibling = currentParent; nodes.readSlot(currentParent, gotslot); currentParent = gotslot[1] & 0xFFFF; previousSiblingWasParent = true; } /** Starting a new document. Perform any resets/initialization * not already handled. * */ void appendStartDocument() { initDocument(0); } /** All appends to this document have finished; do whatever final * cleanup is needed. * */ void appendEndDocument() { done = true; } /** * For the moment all the run time properties are ignored by this * class. * * @param property a <code>String</code> value * @param value an <code>Object</code> value */ public void setProperty(String property, Object value) { } /** * Source information is not handled yet, so return * <code>null</code> here. * * @param node an <code>int</code> value * @return null */ public SourceLocator getSourceLocatorFor(int node) { return null; } /** * A dummy routine to satisify the abstract interface. If the DTM * implememtation that extends the default base requires notification * of registration, they can override this method. */ public void documentRegistration() { } /** * A dummy routine to satisify the abstract interface. If the DTM * implememtation that extends the default base requires notification * when the document is being released, they can override this method */ public void documentRelease() { } }
[ "hvdthong@github.com" ]
hvdthong@github.com
96834d54a60784a0c27b37ed1000b153e5be1936
3da6f1593ae3c0d6fd0bef0f81825a6dcb4f562b
/spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java
3b978d58f303993ba99edb1f52afa8ccd9baff66
[ "Apache-2.0" ]
permissive
binfooo/spring
c784f3b49717bb65c6bdf0eb8db08f3f36852006
a1f1a3e6f0a7a26641fe5f925aae76a2d32e566c
refs/heads/master
2023-02-23T12:11:02.335887
2021-01-30T01:54:25
2021-01-30T01:54:25
334,065,384
1
0
null
null
null
null
UTF-8
Java
false
false
425
java
package org.springframework.scripting.support; import org.springframework.scripting.ConfigurableMessenger; /** * @author Rick Evans */ public class StubMessenger implements ConfigurableMessenger { private String message = "I used to be smart... now I'm just stupid."; @Override public void setMessage(String message) { this.message = message; } @Override public String getMessage() { return message; } }
[ "LinHJ090827" ]
LinHJ090827
e5fdad341a46eb632d1f914667e27c2c0d723dfa
4bf85414fde6630712c0ea4020bf5651eef30794
/src/main/java/com/example/demo/service/Game.java
dc4017a5c9f045ff42223dde1eca6438bf11f852
[]
no_license
vovkandrew/Infinity.solutions.test.task
f7c87b98c9eb1f68acff660f1675e2cc83ecf72a
4777dc6c275ff1cd41b5ef0cc59796fc97e0f312
refs/heads/main
2022-12-27T21:11:46.232898
2020-10-12T19:25:27
2020-10-12T19:25:27
302,568,641
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
package com.example.demo.service; import com.example.demo.model.Scoreboard; public interface Game { Scoreboard playGame(int hit, Scoreboard scoreboard); }
[ "vovkandrew@gmail.com" ]
vovkandrew@gmail.com
5fd73310511dfa96327b0f631017a6b2791ea37b
fbd34969b0337a40259e81d4bf60cd79bd6f7e46
/disruptor-example/src/main/java/net/junx/disruptor/example/LongEvent.java
cdd0536e675b8bb55d2fb5f0d50d739c65fa8c07
[]
no_license
junxspace/java-code-examples
2890aa72d332389ff0b43262531e1e7a04f0dc74
790d9a1b250ca902f49e466c30cb3067ab3d5bdf
refs/heads/master
2021-06-25T22:56:42.049622
2017-09-10T07:55:33
2017-09-10T07:55:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
229
java
package net.junx.disruptor.example; /** * * @author junX * @date May 30, 2017 8:15:50 PM <br/> * @version * */ public class LongEvent { private long value; public void set(long value) { this.value = value; } }
[ "junxspace@hotmail.com" ]
junxspace@hotmail.com
72513dbf57ad3d6ea548c6acdf2f3afbee25f968
b6f8a57d4cd3931814a2d9c77beab6b0686b815d
/PatientVisit.java
0fd8996f40e742de4c3b27bd305e31e8dcaae05e
[]
no_license
JuanAArias/Hospital-Simulation
d008a5dde8d7a93f48fb42199bbf0f04426e8a6a
19bceb30815306c0af9be2cb27b1817003529ab0
refs/heads/master
2020-04-21T22:42:19.913116
2019-02-09T22:42:18
2019-02-09T22:42:18
169,921,571
1
0
null
null
null
null
UTF-8
Java
false
false
1,975
java
package hw6; /** * A class to describe the visit of a patient, defined by the arrival time, the * urgency of the visit, and the length of the visit. * * @param <E> */ public class PatientVisit implements Comparable<PatientVisit> { private double arrivalTime; // in minutes private int urgency; // 1 to 10 (1 is the most urgent) private double duration; // duration of the visit in minutes /** * Creates a patient visit given its characteristics * * @param theArrivalTime * the time of the arrival (in minutes) * @param theUrgency * the urgency level (1 to 10, 1 being most urgent) * @param theDuration * the length of the patient visit (in minutes) */ public PatientVisit(double theArrivalTime, int theUrgency, double theDuration) { arrivalTime = theArrivalTime; urgency = theUrgency; duration = theDuration; } /** * Returns the arrival time (in minutes) * * @return the arrival time (in minutes) */ public double getArrivalTime() { return arrivalTime; } /** * Returns the duration of the visit (in minutes) * * @return the duration of the visit (in minutes) */ public double getDuration() { return duration; } /** * Returns the urgency of the visit (1 to 10, 1 being most urgent) * * @return the urgency of the visit */ public int getUrgency() { return urgency; } /** * Compares the urgency between this and another PatientVisit * * @param o * The object this is compared to * @return int value * */ @Override public int compareTo(PatientVisit other) { if (urgency != other.urgency) { return urgency - other.urgency; } return (int) (arrivalTime * 100 - other.arrivalTime * 100); } public String toString() { return "Arrival time: " + this.arrivalTime + "Urgency: " + this.urgency + "Duration: " + this.duration; } }
[ "noreply@github.com" ]
noreply@github.com
c9e65b102128212107ef59662b819ba650fdf830
4ee120f57b8087ac33d00ef07a78fa41e2bc75cb
/UNI2/COMP1549 - Advanced Programming/Dashboard Simulator in Java/DashboardLevel3/src/uk/ac/gre/comp1549/dashboard/events/DashBoardEvent.java
ead1834a57f21c2456fe19c425a43b51c4c80cff
[]
no_license
GyokayAli/University-Projects
03316261c6ec25f78adf507660fbd69d1c65fffe
215f2b92982a616b2341f580343bc924ebd53b44
refs/heads/master
2021-01-01T05:17:05.626721
2017-01-07T13:42:32
2017-01-07T13:42:32
58,964,769
6
1
null
null
null
null
UTF-8
Java
false
false
697
java
package uk.ac.gre.comp1549.dashboard.events; /** *Holds information about DashBoardEvents that can be * passed to DashBoardEventListeners. * @author Gill Windall */ public class DashBoardEvent { private String type; // type of event e.g "speed" private String value; // value of the event e.g. "30" public String getType() { return type; } public void setType(String type) { this.type = type; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } @Override public String toString() { return "type:" + type + " value:" + value; } }
[ "gyokay.metin.ali@gmail.com" ]
gyokay.metin.ali@gmail.com
0b97948b4dc1d4faa59647255894cd1ac372a879
acaa3123eb6cde69ba0d0d744393de48f805edf9
/ClienteAndroid/app/src/main/java/morales/david/android/models/ClientSession.java
f623aa94ea1e95f7b2817260ce73da4e258f0075
[]
no_license
IDavidML/ProyectoDAM
d0359ffc3e890efb98a965b8ddfc01f010b2c466
f178d22502677c98b8de664e5137af1cb36695e0
refs/heads/master
2023-08-29T23:29:28.444880
2021-10-25T13:25:24
2021-10-25T13:25:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package morales.david.android.models; public class ClientSession { private int id; private String name; private String role; public ClientSession() { this(0, "", ""); } public ClientSession(int id, String name, String role) { this.id = id; this.name = name; this.role = role; } 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 String getRole() { return role; } public void setRole(String role) { this.role = role; } @Override public String toString() { return "ClientSession{" + "id=" + id + ", name='" + name + '\'' + ", role='" + role + '\'' + '}'; } }
[ "davidmolv16@gmail.com" ]
davidmolv16@gmail.com
4bead47dbd5e5e80a0c0dd58ffd27c219b42ce4f
ceb918ab33cd4c03b8166e8455487a7aa3e66d90
/db-utils/src/test/java/com/joyscrum/AppTest.java
82d9687615f0f6d2b185a897fe45d2089fdba995
[]
no_license
ehurtad0/JSGame
8927cdfa4d35ea9f4d7b11587eb7b5d751764ab0
5f6a60130eb3c17cb6bbce1415d97da653de089e
refs/heads/master
2021-01-17T04:58:16.220257
2017-08-08T03:38:43
2017-08-08T03:38:43
83,049,467
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package com.joyscrum; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "motajorge@hotmail.com" ]
motajorge@hotmail.com
94e372b8cc3e5990132696efad10c5235371b206
bbe1bbeecfdec516e8a47c71d2c7a06a40b69b42
/app/src/main/java/com/volare/ex13_viewpagerweather/WeeklyWeather/WeeklyData/Coord.java
d29e9b40e4a18e0b65e38e038f0f2bef5be2ec2f
[]
no_license
fenixforadun/WeatherVIewPager
485c091fdf3b67a4234f2d0024b2a926de301dac
d7efebc365f5dc8ada01e52fede6e9ea3837ff1f
refs/heads/master
2020-03-27T21:39:00.672566
2018-09-03T07:00:23
2018-09-03T07:00:23
147,164,192
0
0
null
null
null
null
UTF-8
Java
false
false
563
java
package com.volare.ex13_viewpagerweather.WeeklyWeather.WeeklyData; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Coord { @SerializedName("lat") @Expose private Double lat; @SerializedName("lon") @Expose private Double lon; public Double getLat() { return lat; } public void setLat(Double lat) { this.lat = lat; } public Double getLon() { return lon; } public void setLon(Double lon) { this.lon = lon; } }
[ "fenixforadun@gmail.com" ]
fenixforadun@gmail.com
23be57007caa84fff669816453dfa453a36e37f1
cd21cf05a0dd6688f71f821ae3c0490d0d46bd31
/app/src/main/java/com/example/dedan/digitalreceipts/Database/Month_Database/February/FebEntity.java
52f24dc5f5a7e150d201bfc63d8d556edff6671b
[]
no_license
ndungudedan/DigitalReceipts2
140401a67a5d4d801370ea5f19df6d221a276b5c
eadddc1224e602d4763297ad9d9721a681c4e28e
refs/heads/master
2020-04-26T07:26:39.138083
2020-03-16T23:47:50
2020-03-16T23:47:50
173,394,331
4
0
null
null
null
null
UTF-8
Java
false
false
1,715
java
package com.example.dedan.digitalreceipts.Database.Month_Database.February; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.PrimaryKey; @Entity(tableName = "February") public class FebEntity { @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "ID") private int KEY_ID; @ColumnInfo(name = "SALES") private int KEY_SALES; @ColumnInfo(name = "No_of_Clients") private int KEY_NO_OF_CLIENTS; @ColumnInfo(name = "FOREIGN_KEY") private String KEY_FOREIGN_KEY; @ColumnInfo(name = "IDENTIFY") private String KEY_TYPE; public FebEntity(int KEY_SALES, int KEY_NO_OF_CLIENTS, String KEY_FOREIGN_KEY, String KEY_TYPE) { this.KEY_SALES = KEY_SALES; this.KEY_NO_OF_CLIENTS = KEY_NO_OF_CLIENTS; this.KEY_FOREIGN_KEY = KEY_FOREIGN_KEY; this.KEY_TYPE = KEY_TYPE; } public int getKEY_ID() { return KEY_ID; } public void setKEY_ID(int KEY_ID) { this.KEY_ID = KEY_ID; } public int getKEY_SALES() { return KEY_SALES; } public void setKEY_SALES(int KEY_SALES) { this.KEY_SALES = KEY_SALES; } public int getKEY_NO_OF_CLIENTS() { return KEY_NO_OF_CLIENTS; } public void setKEY_NO_OF_CLIENTS(int KEY_NO_OF_CLIENTS) { this.KEY_NO_OF_CLIENTS = KEY_NO_OF_CLIENTS; } public String getKEY_FOREIGN_KEY() { return KEY_FOREIGN_KEY; } public void setKEY_FOREIGN_KEY(String KEY_FOREIGN_KEY) { this.KEY_FOREIGN_KEY = KEY_FOREIGN_KEY; } public String getKEY_TYPE() { return KEY_TYPE; } public void setKEY_TYPE(String KEY_TYPE) { this.KEY_TYPE = KEY_TYPE; } }
[ "dnkibere@gmail.com" ]
dnkibere@gmail.com
123e0c8fb4c11addcd54d680e757efad1a623335
13f727ef5fa74f840e7debd86eb30785f7d47668
/gteam/gt-common/src/main/java/com/gt/entity/GoodProperty.java
3f2ae4017c6abfd6a43a901ebb0f12407898bd2e
[]
no_license
825610847/numberone
721592b7e3299ff673da2bd890cfe9c3cbffe89f
68ffe43994e3045ad848e25478719c2fcf7e59f1
refs/heads/manage
2023-08-05T05:28:32.381268
2019-12-26T03:32:30
2019-12-26T03:32:30
230,353,055
0
0
null
2023-07-23T01:21:06
2019-12-27T01:42:15
Java
UTF-8
Java
false
false
1,039
java
package com.gt.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** *商品属性 * @author 李源仑 */ @Data @NoArgsConstructor @AllArgsConstructor public class GoodProperty extends BaseEntity { /**商品ID*/ private Long goodId; /**商品类型ID flase:游戏 true:主机*/ private boolean goodTypeId; /**买家ID*/ private Long buyerId; /**卖家ID*/ private Long sellerId; /**商品名称*/ private String goodName; /**商品类型标签组*/ private String[] typeLabel; /**商品状态*/ private Integer goodStatus; /**商品价格*/ private Double goodPrice; /**商品图片*/ private String goodPicture; /**主机几成新*/ private Integer goodNewness; /**是否支持退货*/ private boolean isSupportReturn; /**商品浏览次数*/ private Integer goodViewCount; /**商品销量*/ private Integer goodSoldCount; /**商品用户评价*/ private String goodCredit; }
[ "DarknessVenom@vip.qq.com" ]
DarknessVenom@vip.qq.com
5c52f01da0ea58ada285ea215048eb88ab896583
267179df144f5e851e71cf28aa74ffc8f342cded
/WebRoot/WEB-INF/src/junit/test/hibernate/HibernateMappingTest.java
3d37a4091e755898bb61ae4bde4e07f11984b977
[]
no_license
henryyan/exercise-cd
3e2735efbd9ed31a8a350029584a9c90fbb7fc9e
67728b09e501a32626a9f2e99b908e29e4815cd9
refs/heads/master
2016-09-06T17:25:06.302500
2011-11-26T14:35:16
2011-11-26T14:35:16
2,854,242
0
0
null
null
null
null
UTF-8
Java
false
false
1,036
java
package junit.test.hibernate; import java.util.Map; import junit.test.BaseTest; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.persister.entity.EntityPersister; import org.junit.Before; import org.junit.Test; public class HibernateMappingTest extends BaseTest { private SessionFactory sessionFactory; @Before public void setUp() throws Exception { sessionFactory = (SessionFactory) context.getBean("sessionFactory"); } @Test public void allClassMapping() throws Exception { Session session = sessionFactory.openSession(); try { Map<?, ?> metadata = sessionFactory.getAllClassMetadata(); for (Object o : metadata.values()) { EntityPersister persister = (EntityPersister) o; String className = persister.getEntityName(); Query q = session.createQuery("from " + className + " c"); q.iterate(); System.out.println("ok: " + className); } } finally { session.close(); } } }
[ "yanhonglei@gmail.com" ]
yanhonglei@gmail.com
be902e18be27053cd4df9542fa110cb515b6c36a
bf393bdb507b66eed757a362666be55a867e8304
/Territory/my-gdx-game/src/com/me/mygdxgame/Territory.java
1a34ec33afe86c12ffae62d69aee431f64a2b13e
[]
no_license
galasky/expert-its
f77b78e7945ef729a8948d751a6dd9b6b73bbc1f
39ac9bb66b04d0400a6066cf7189ddd511cde135
refs/heads/master
2021-01-21T23:04:29.768511
2014-06-05T10:00:02
2014-06-05T10:00:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,439
java
package com.me.mygdxgame; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import android.content.Context; import android.database.Cursor; /** * Created by Administrateur on 11/04/14. */ public class Territory { private DataBaseHelper myDbHelper; private Context myContext; private Territory() { } public String getTOTO() { Cursor c = myDbHelper.execSQL("SELECT name FROM sqlite_master WHERE type='table' AND name='stops'"); if (c.moveToFirst()) { return c.getString(0); } return ("vache"); } public void setContext(Context context) { myContext = context; this.loadData(); } public static Territory instance() { return SingletonHolder.instance; } private static class SingletonHolder { private final static Territory instance = new Territory(); } public List<Stop> getListStopByDistance(double distance, CoordinateGPS position) { Cursor cursor = myDbHelper.execSQL("SELECT * FROM stops"); List<Stop> listStops = new ArrayList<Stop>(); Stop stop = null; if (cursor.moveToFirst()) { cursor.moveToNext(); do { stop = new Stop(); stop.setCoord(new Double(cursor.getString(cursor.getColumnIndex("stop_lat"))), new Double(cursor.getString(cursor.getColumnIndex("stop_lon")))); stop.stop_id = cursor.getString(cursor.getColumnIndex("stop_id")); stop.stop_name = cursor.getString(cursor.getColumnIndex("stop_name")); // Add book to books if (distanceAB(stop.coord, position) < distance && stop.stop_id.charAt(0) != 'S') { listStops.add(stop); } } while (cursor.moveToNext()); } return listStops; } public Stop getStopById(String id) { Cursor cursor = myDbHelper.execSQL("SELECT * FROM stops WHERE stop_id = " + id); Stop stop = new Stop(); if (cursor.moveToFirst()) { stop.stop_id = cursor.getString(cursor.getColumnIndex("stop_id")); stop.stop_code = cursor.getString(cursor.getColumnIndex("stop_code")); stop.stop_name = cursor.getString(cursor.getColumnIndex("stop_name")); stop.stop_desc = cursor.getString(cursor.getColumnIndex("stop_desc")); stop.coord.latitude = Double.parseDouble(cursor.getString(cursor.getColumnIndex("stop_lat"))); stop.coord.longitude = Double.parseDouble(cursor.getString(cursor.getColumnIndex("stop_lon"))); stop.zone_id = cursor.getString(cursor.getColumnIndex("zone_id")); stop.stop_url = cursor.getString(cursor.getColumnIndex("stop_url")); stop.location_type = cursor.getString(cursor.getColumnIndex("location_type")); stop.parent_station = cursor.getString(cursor.getColumnIndex("parent_station")); stop.stop_timezone = cursor.getString(cursor.getColumnIndex("stop_timezone")); stop.wheelchair_boarding = cursor.getString(cursor.getColumnIndex("weelchair_boarding")); } return stop; } public int serviceException(String idService, Date today) { Cursor cursor = myDbHelper.execSQL("SELECT * FROM calendar_dates WHERE service_id = '" + idService +"'"); if (cursor.moveToFirst()) { String str = new String(); int year, month, day; str = cursor.getString(cursor.getColumnIndex("date")); year = Integer.valueOf(str.substring(0, 4)); month = Integer.valueOf(str.substring(4, 6)); day = Integer.valueOf(str.substring(6, 8)); Calendar cal = Calendar.getInstance(); cal.setTime(today); int year2 = cal.get(Calendar.YEAR); int month2 = cal.get(Calendar.MONTH) + 1; int day2 = cal.get(Calendar.DAY_OF_MONTH); if (year == year2 && month == month2 && day == day2) return Integer.valueOf(cursor.getString(cursor.getColumnIndex("exception_type"))); } return 0; } private boolean dateExpired(String SBegin, String SEnd, Date date) { MyDate begin = new MyDate(SBegin); MyDate end = new MyDate(SEnd); MyDate current = new MyDate(date); if (current.isLowerThan(end) && current.isSuperiorThan(begin)) return false; if (current.isSame(begin) || current.isSame(end)) return false; return true; } public List<StopTimes> getListStopTimesByStopId(String stop_id) { Cursor cursor = myDbHelper.execSQL("SELECT * FROM stop_times WHERE stop_id = " + stop_id); List<StopTimes> listStopTimes = new ArrayList<StopTimes>(); StopTimes stopTimes = null; if (cursor.moveToFirst()) { cursor.moveToNext(); do { stopTimes = new StopTimes(); stopTimes.trip_id = cursor.getString(cursor.getColumnIndex("trip_id")); stopTimes.arrival_time = new MyTimes(cursor.getString(cursor.getColumnIndex("arrival_time"))); stopTimes.departure_time = new MyTimes(cursor.getString(cursor.getColumnIndex("departure_time"))); stopTimes.stop_sequence = cursor.getString(cursor.getColumnIndex("stop_sequence")); listStopTimes.add(stopTimes); } while (cursor.moveToNext()); } return listStopTimes; } public Trips getTripsByTripId(String trip_id) { Cursor cursor = myDbHelper.execSQL("SELECT * FROM trips WHERE trip_id = " + trip_id); Trips trips = null; if (cursor.moveToFirst()) { trips = new Trips(); trips.service_id = cursor.getString(cursor.getColumnIndex("service_id")); trips.route_id = cursor.getString(cursor.getColumnIndex("route_id")); trips.trip_id = cursor.getString(cursor.getColumnIndex("trip_id")); trips.direction_id = cursor.getString(cursor.getColumnIndex("direction_id")); } return trips; } public boolean isServiceAvailableByDate(String idService, Date date) { int type = serviceException(idService, date); switch (type) { case 1: return true; case 2: return false; default: break; } Cursor cursor = myDbHelper.execSQL("SELECT * FROM calendar WHERE service_id = '" + idService + "'"); String available = new String(); if (cursor.moveToFirst()) { if (dateExpired(cursor.getString(cursor.getColumnIndex("start_date")), cursor.getString(cursor.getColumnIndex("end_date")), date)) return false; Calendar cal = Calendar.getInstance(); cal.setTime(date); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_WEEK); if (day == 1) { available = cursor.getString(7); } else { available = cursor.getString(day - 1); } } return (available.equals("1")); } public Path getPath(Date today, String StopId) { Path path = new Path(); return path; } private void loadData() { myDbHelper = new DataBaseHelper(myContext); try { myDbHelper.createDataBase(); } catch (IOException ioe) { throw new Error("Unable to create database"); } try { myDbHelper.openDataBase(); }catch(SQLException sqle){ } } // lat1, lat2, lon1, lon2 in degrees static public double distanceAB(CoordinateGPS A, CoordinateGPS B) { double R = 6371; // km double dLat = Math.toRadians(B.latitude - A.latitude); double dLon = Math.toRadians(B.longitude - A.longitude); double lat1 = Math.toRadians(A.latitude); double lat2 = Math.toRadians(B.latitude); double a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); double d = R * c; return d; // Km } }
[ "ttrebmal@gmail.com" ]
ttrebmal@gmail.com
4c8a01dd8bfcf555eb3d65364dbf3860123c8100
29d0b53b3448bfb637e0869b0e553132e4a50347
/objectArrayReferenceAssignment/Main.java
7bad1dca6da0b1a7171a91bd835c6be6071fee6e
[]
no_license
JasneetDua/Java-Learning
dfad0a42d88f7a6802f9fbb53adfd3c9368dbff5
a56bd900d51be589fc99b07af4d19b66ab24f56a
refs/heads/master
2020-03-24T08:33:55.791119
2018-08-01T13:38:44
2018-08-01T13:38:44
142,599,708
0
0
null
null
null
null
UTF-8
Java
false
false
254
java
package objectArrayReferenceAssignment; public class Main { static Parent p[] = new Parent[5]; static ChildClass c[] = new ChildClass[6]; public static void main(String[] args) { p = c; System.out.println("Refence of c added to p"); } }
[ "jasneetdua96@gmail.com" ]
jasneetdua96@gmail.com
4c28cb1ed5d1260eb4ef19219345fd653d8a6a58
89c3f49f743c46c6d449d4230792e3ea3cc3d46d
/Java Basic Programs/02.primeNumber.java
bd3a6e50d3f5a7bdd1cb95c9584c5d6e3da915fc
[ "MIT" ]
permissive
Dheer08/Java-Programming
fc7543a6600b7c5b1eae373123420d1335737ff6
cf2be246378eb7a2e6aad12c9a5a0744bcdc469e
refs/heads/master
2022-12-04T18:55:53.971804
2020-08-22T15:55:05
2020-08-22T15:55:05
278,102,693
1
0
null
null
null
null
UTF-8
Java
false
false
310
java
class Test{ public static void main(String args[]) { int num = 21; int count = 0; for(int i=2;i<num;i++) { if (num % i == 0) { count = 1; break; } } if (count == 0) System.out.println(num+" is a prime Number"); else System.out.println(num+" is not a prime Number "); } }
[ "rakshithdheerreddy08@gmail.com" ]
rakshithdheerreddy08@gmail.com
f4b4684ad8188f8176f95b51e82c8bd4f96ada8c
a84f769130f75b5ecdcb8905971a1a5a9569e17b
/HIPS/app/src/main/java/com/example/doug/hips/IncomingSms.java
bda9de2b4cc3a9b1ad997f2117c080ef24bfbdf1
[]
no_license
djskidmore/Hidden-In-Plain-Sight
03facade1ffa1354d9ea9b830399f87c6571f7c0
5bb30213d21b50de77c48ee997314a920e4c79e1
refs/heads/master
2020-04-18T02:43:47.147866
2016-09-20T21:49:34
2016-09-20T21:49:34
66,406,790
0
0
null
null
null
null
UTF-8
Java
false
false
1,644
java
package com.example.doug.hips; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.SmsManager; import android.telephony.SmsMessage; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; /** * Created by Doug on 9/19/2016. */ public class IncomingSms extends BroadcastReceiver { final SmsManager sms = SmsManager.getDefault(); MsgBody msgBody = new MsgBody(); public void onReceive(Context context, Intent intent) { if (intent != null && intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) { Bundle bundle = intent.getExtras(); SmsMessage[] msgs; String sender; if (bundle != null) { try { Object[] pdus = (Object[]) bundle.get("pdus"); msgs = new SmsMessage[pdus.length]; for (int i = 0; i < msgs.length; i++) { msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); // Here you have the sender(phone number) sender = msgs[i].getOriginatingAddress(); msgBody.updateMsgBody(msgs[i].getMessageBody()); // you have the sms content in the msgBody Toast.makeText(context,sender + ": " + msgBody.getMsgBody(), Toast.LENGTH_LONG).show(); } } catch (Exception e) { e.printStackTrace(); } } } } }
[ "skidmoredj@appstate.edu" ]
skidmoredj@appstate.edu
c101950f57469633f35c71853030df00d9944b7d
c8e96fa52848a8076dbdee7147b0971d73b98d06
/Try-Catch/src/Solution.java
c0ed72dd5d3002021b27b84cce5e952cb1343776
[]
no_license
TheCheshireCat87/HackerRank
c4cf37af57ed52473b6002f1c480c537f26f2efb
f81ad79325367f96d68816f20ecb17e9874b3716
refs/heads/master
2021-01-10T15:15:24.901211
2016-02-20T15:21:39
2016-02-20T15:21:39
49,039,803
0
0
null
null
null
null
UTF-8
Java
false
false
1,310
java
/********************************************** * .'\ /`. * * .'.-.`-'.-.`. * * ..._: .-. .-. :_... * * .' '-.(o ) (o ).-' `. * * : _ _ _`~(_)~`_ _ _ : * * : /: ' .-=_ _=-. ` ;\ : * * : :|-.._ ' ` _..-|: : * * : `:| |`:-:-.-:-:'| |:' : * * `. `.| | | | | | |.' .' * * `. `-:_| | |_:-' .' * * `-._ ```` _.-' * * ``-------'' * * The Cheshire Cat * **********************************************/ import java.util.Scanner; import java.util.InputMismatchException; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); try{ int x = in.nextInt(); int y = in.nextInt(); in.close(); System.out.println(x / y); } catch(InputMismatchException e){ System.out.println(e.getClass().getName()); } catch(ArithmeticException e){ System.out.println(e.toString()); } } }
[ "thecheshirecat87@gmail.com" ]
thecheshirecat87@gmail.com
4c0f078598b59bc4940882ccd1be00bb02b4a374
e38a1f9289bf1805096a045539c8217f8947e105
/src/com/bash/dynamic/programming/one/ChangeDP.java
8d8b5c21ea16ad87eb2f72c837196940ec1ba305
[]
no_license
bhaveshag/Algorithmic-toolbox-coursera
d4757818e2f1fe9da6e3eeee1a56dbd031309d90
e9fad1c39692c212284a252c36f3b2cfa2a74a45
refs/heads/master
2023-01-31T18:38:55.955461
2020-12-15T08:23:57
2020-12-15T08:23:57
298,588,764
0
0
null
null
null
null
UTF-8
Java
false
false
615
java
package com.bash.dynamic.programming.one; import java.util.Scanner; public class ChangeDP { private static int getChange(int m) { int temp[]=new int[m+1]; int coins[] = {1,3,4}; temp[0] = 0; for(int i=0; i<3; i++) for(int j=coins[i]; j<=m; j++) { temp[j] = Math.min(temp[j - coins[i]]+1 , temp[j]==0?99999999:temp[j]) ; } return temp[m]; } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int m = scanner.nextInt(); System.out.println(getChange(m)); } }
[ "agr.bhavesh@gmail.com" ]
agr.bhavesh@gmail.com
7774e108c801789da19b53f7afac7f7f548d78f5
680a938af1d926c8ea1e63a5c8f39c7a8fddc7e6
/compiler/fir/analysis-tests/testData/enhancement/signatureAnnotations/DefaultEnum.java
b8fbb6fb1866bc76e6c7634a0e6d5c267a7698ff
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
lunakoly/kotlin
018638c29a411b687654f82cd8ac4faed9f94eb5
19568125f19f025ea7923c6c505ef0ad686cee3b
refs/heads/master
2021-02-04T04:31:10.312947
2020-07-06T09:27:50
2020-07-06T09:28:45
243,615,292
3
1
null
2020-02-27T20:57:38
2020-02-27T20:57:37
null
UTF-8
Java
false
false
714
java
// FILE: Signs.java // ANDROID_ANNOTATIONS public enum Signs { HELLO, WORLD; public static final Signs X; public static final class NOT_ENTRY_EITHER {} } // FILE: Mixed.java public enum Mixed { NOT_ENTRY_EITHER; public static final class NOT_ENTRY_EITHER {} } // FILE: A.java import kotlin.annotations.jvm.internal.*; class A { public Signs a(@DefaultValue("HELLO") Signs arg) { return arg; } public Signs bar(@DefaultValue("X") Signs arg) { return arg; } public Signs baz(@DefaultValue("NOT_ENTRY_EITHER") Signs arg) { return arg; } public Mixed bam(@DefaultValue("NOT_ENTRY_EITHER") Mixed arg) { return arg; } }
[ "mikhail.glukhikh@jetbrains.com" ]
mikhail.glukhikh@jetbrains.com
59e65b7c9db5fb5fd9ca14fe335bb55639ef8717
d67f6450b24fb08f2f61b74dcdecce3025ee3efc
/gemp-swccg-cards/src/main/java/com/gempukku/swccgo/cards/set8/light/Card8_071.java
64f07df01de9cff503e2d5c5dd9e871d5b5cafbc
[ "MIT" ]
permissive
cburyta/gemp-swccg-public
00a974d042195e69d3c104e61e9ee5bd48728f9a
05529086de91ecb03807fda820d98ec8a1465246
refs/heads/master
2023-01-09T12:45:33.347296
2020-10-26T14:39:28
2020-10-26T14:39:28
309,400,711
0
0
MIT
2020-11-07T04:57:04
2020-11-02T14:47:59
null
UTF-8
Java
false
false
2,224
java
package com.gempukku.swccgo.cards.set8.light; import com.gempukku.swccgo.cards.AbstractSite; import com.gempukku.swccgo.cards.conditions.ControlsCondition; import com.gempukku.swccgo.common.Icon; import com.gempukku.swccgo.common.Side; import com.gempukku.swccgo.common.Title; import com.gempukku.swccgo.filters.Filters; import com.gempukku.swccgo.game.PhysicalCard; import com.gempukku.swccgo.game.SwccgGame; import com.gempukku.swccgo.logic.modifiers.DeployCostToLocationModifier; import com.gempukku.swccgo.logic.modifiers.DeploysFreeToLocationModifier; import com.gempukku.swccgo.logic.modifiers.ForfeitModifier; import com.gempukku.swccgo.logic.modifiers.Modifier; import java.util.LinkedList; import java.util.List; /** * Set: Endor * Type: Location * Subtype: Site * Title: Endor: Chief Chirpa's Hut */ public class Card8_071 extends AbstractSite { public Card8_071() { super(Side.LIGHT, Title.Chief_Chirpas_Hut, Title.Endor); setLocationDarkSideGameText("If you control Chief Chirpa's Hut, Ewoks at Endor sites are forfeit -1."); setLocationLightSideGameText("Your Ewoks are deploy -1 here. Chief Chirpa deploys free here."); addIcon(Icon.LIGHT_FORCE, 2); addIcons(Icon.ENDOR, Icon.INTERIOR_SITE, Icon.PLANET); } @Override protected List<Modifier> getGameTextDarkSideWhileActiveModifiers(String playerOnDarkSideOfLocation, SwccgGame game, PhysicalCard self) { List<Modifier> modifiers = new LinkedList<Modifier>(); modifiers.add(new ForfeitModifier(self, Filters.and(Filters.Ewok, Filters.at(Filters.Endor_site)), new ControlsCondition(playerOnDarkSideOfLocation, Filters.Chief_Chirpas_Hut), -1)); return modifiers; } @Override protected List<Modifier> getGameTextLightSideWhileActiveModifiers(String playerOnLightSideOfLocation, SwccgGame game, PhysicalCard self) { List<Modifier> modifiers = new LinkedList<Modifier>(); modifiers.add(new DeployCostToLocationModifier(self, Filters.and(Filters.your(playerOnLightSideOfLocation), Filters.Ewok), -1, self)); modifiers.add(new DeploysFreeToLocationModifier(self, Filters.Chief_Chirpa, self)); return modifiers; } }
[ "andrew@bender.io" ]
andrew@bender.io
be23a4f38ad6a15c5bee7d84d49ca06680db2521
46403a541c389e8933e2cbd8cfb893d054b85327
/modules/quitte/src/main-generated/java/com/osmerion/quitte/functional/BoolSupplier.java
a36231343347600ad98cc1ed48cd2394ba768bdf
[ "BSD-3-Clause" ]
permissive
Osmerion/Quitte
46bd706fc0fa464c5c89a9b9cae8c72a6f494522
6c107288eae8f594c3ff29c8ef78b98fcace0b72
refs/heads/master
2023-08-31T21:05:54.989904
2023-08-20T14:24:11
2023-08-20T14:24:11
130,517,767
2
1
BSD-3-Clause
2023-09-04T13:27:27
2018-04-21T22:51:17
Java
UTF-8
Java
false
false
2,093
java
/* * Copyright (c) 2018-2023 Leon Linhart, * All rights reserved. * MACHINE GENERATED FILE, DO NOT EDIT * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package com.osmerion.quitte.functional; /** * Represents a supplier of results. * * <p>There is no requirement that a new or distinct result be returned each * time the supplier is invoked.</p> * * @see java.util.function.Supplier * * @since 0.1.0 * * @author Leon Linhart */ @FunctionalInterface public interface BoolSupplier { /** * Gets a result. * * @return a result * * @since 0.1.0 */ boolean get(); }
[ "themrmilchmann@gmail.com" ]
themrmilchmann@gmail.com
be395dab0ebafb2b547a46b59f47a05d37ad9161
57a4c3515aa85e5df9d763ef630dfbd793032128
/Phase5/harambase/src/main/java/com/youedata/cd/harambase/web/MemberController.java
a362e578c9bed08bf6c9966e5eeb5a373e69595e
[]
no_license
harambase/Harambase_Project
87ae0f9a63f4c63a83ec5fa1b00e0a32c2bf2377
e846ea83d1b7eee98420f90ee23fac3d3aadd143
refs/heads/master
2020-12-02T17:45:09.795408
2017-09-06T09:23:14
2017-09-06T09:23:14
96,420,129
0
0
null
null
null
null
UTF-8
Java
false
false
7,145
java
package com.youedata.cd.harambase.web; import com.youedata.cd.harambase.pojo.*; import com.youedata.cd.harambase.service.BidService; import com.youedata.cd.harambase.service.FeedbackService; import com.youedata.cd.harambase.service.ItemService; import com.youedata.cd.harambase.service.MemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; /** * Created by sky on 2017/6/29. */ @Controller public class MemberController { @Autowired private MemberService memberService; @Autowired private FeedbackService feedbackService; @Autowired private ItemService itemService; @Autowired private BidService bidService; @RequestMapping("WelcomeMember") private String welcomeMember(){ return "WelcomeMember"; } //Seller Options: @RequestMapping("ViewMyFeedback") private String viewMyFeedback(HttpSession session){ Member member = (Member)session.getAttribute("member"); Integer userid = member.getUserid(); Integer numOfRec = feedbackService.numOfRec(userid); if(numOfRec != 0) { List<Map<Integer, Feedback>> feedbackList = feedbackService.feedbackList(userid); Double totalRate = feedbackService.totalRate(userid); Double avgRate = totalRate/numOfRec; session.setAttribute("avgRate",avgRate); session.setAttribute("feedbackList", feedbackList); } session.setAttribute("numOfRec", numOfRec); return "MemberFunctions/ViewMyFeedback"; } @RequestMapping("AddItem") private String addItem(HttpSession session){ Member member = (Member)session.getAttribute("member"); Integer userid = member.getUserid(); return "MemberFunctions/AddItem"; } //User Options: @RequestMapping("Edit") private String editProfilePage(){ return "MemberFunctions/Edit"; } @RequestMapping("Edit_action") private String editProfileAction(HttpServletRequest request, HttpSession session){ Member member = (Member)session.getAttribute("member"); member.setUname(request.getParameter("uname")); member.setFname(request.getParameter("fname")); member.setLname(request.getParameter("lname")); member.setEmail(request.getParameter("email")); int succ = 0; String password = request.getParameter("password"); if(request.getParameter("password")!=""){ if(!request.getParameter("password").equals(member.getPassword())) succ = -2; else if(request.getParameter("NEWPASSWORD1")!="" && request.getParameter("NEWPASSWORD2")!="" && request.getParameter("NEWPASSWORD1").equals(request.getParameter("NEWPASSWORD2"))) { member.setPassword(request.getParameter("NEWPASSWORD1")); succ = memberService.updateByPrimaryKeySelective(member); } else succ = -1; } else succ = memberService.updateByPrimaryKeySelective(member); /* 1:sucess 0:Violating rules possible -1:New password does not match -2:Wrong old password */ session.setAttribute("member",member); session.setAttribute("succ",succ); return "MemberFunctions/Edit_action"; } //Buyer Options: @RequestMapping("ListOfBidOn") private String listOfBidOn(HttpSession session){ Member member = (Member)session.getAttribute("member"); Integer userid = member.getUserid(); List<Map<Integer, ListOfBidOn>> bidonList = itemService.bidonList(userid); session.setAttribute("bidonList",bidonList); return "MemberFunctions/ListOfBidOn"; } @RequestMapping("Search") private String search(HttpSession session, HttpServletRequest request){ return "MemberFunctions/Search"; } @RequestMapping("SearchResult") private String searchResult(HttpServletRequest request, HttpSession session) throws ParseException { Search search = new Search(); if(request.getParameter("itemID")!="") search.setTid(Integer.parseInt(request.getParameter("itemID"))); if(request.getParameter("keyword")!="") search.setKeyword(request.getParameter("keyword")); if(request.getParameter("category")!="") search.setTcategory(request.getParameter("category")); if(request.getParameter("bidMin")!="") search.setCurbidmin(Double.parseDouble(request.getParameter("bidMin"))); if(request.getParameter("bidMax")!="") search.setCurbidmax(Double.parseDouble(request.getParameter("bidMax"))); String startTimeStr = request.getParameter("StartYear")+"-" + request.getParameter("StartMonth")+"-" + request.getParameter("StartDay") +" " + request.getParameter("TimeStart"); String endTimeStr = request.getParameter("EndYear")+"-" + request.getParameter("EndMonth")+"-" + request.getParameter("EndDay") +" " + request.getParameter("TimeEnd"); DateFormat format= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if(!startTimeStr.equals("-- 00:00:00")){ Date startTime = format.parse(startTimeStr); search.setTauctionstarttime(startTime); } if(!endTimeStr.equals("-- 00:00:00")){ Date endTime = format.parse(endTimeStr); search.setTauctionendtime(endTime); } List<Map<Integer, SearchResult>> searchResult = memberService.search_item(search); session.setAttribute("searchResult",searchResult); return "MemberFunctions/SearchResult"; } @RequestMapping("ListOfBought") private String listOfBought(HttpSession session){ Member member = (Member)session.getAttribute("member"); Integer userid = member.getUserid(); List<Map<Integer, ListOfBought>> boughtList = itemService.boughtList(userid); session.setAttribute("boughtList",boughtList); return "MemberFunctions/ListOfBought"; } @RequestMapping("Bid") private String bidOnItem(HttpServletRequest request, HttpSession session){ Integer itemid = Integer.parseInt(request.getParameter("ITEMID")); ListOfItems itemInfo = itemService.itemListbyTid(itemid); Double max = bidService.maxBidOfItem(itemid); session.setAttribute("max",max); session.setAttribute("itemInfo",itemInfo); session.setAttribute("itemid",itemid); return "MemberFunctions/Bid"; } }
[ "lin.shilei@outlook.com" ]
lin.shilei@outlook.com
9236d0a34061a9c393eea1610a57009eaf9924ec
19737da965c1c2c6090181e9d0bee63d2bedbc52
/ngat/opsgui/services/LegacyOcrHandler.java
1d820fb33a52f3a33aac39c5377c1fbcab9cd53f
[]
no_license
LivTel/operations-ui-basic
db3d9dc62ab4f6a24b8f6a1ceb3891c75b4a4326
d4864f0b6a428c3e1c89e1917da0a480069fd70f
refs/heads/master
2023-06-24T19:51:01.821685
2023-06-12T13:17:26
2023-06-12T13:17:26
23,389,086
0
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
/** * */ package ngat.opsgui.services; import ngat.message.GUI_RCS.GET_STATUS_DONE; import ngat.message.base.COMMAND_DONE; import ngat.net.IConnection; import ngat.net.camp.CAMPResponseHandler; import ngat.opsgui.base.TopPanel; import ngat.util.StatusCategory; /** * @author eng * */ public class LegacyOcrHandler implements CAMPResponseHandler { private TopPanel topPanel; /** * @param topPanel */ public LegacyOcrHandler(TopPanel topPanel) { super(); this.topPanel = topPanel; } /* (non-Javadoc) * @see ngat.net.camp.CAMPResponseHandler#failed(java.lang.Exception, ngat.net.IConnection) */ @Override public void failed(Exception e, IConnection connection) { // TODO Auto-generated method stub e.printStackTrace(); if (connection != null) connection.close(); } /* (non-Javadoc) * @see ngat.net.camp.CAMPResponseHandler#handleUpdate(ngat.message.base.COMMAND_DONE, ngat.net.IConnection) */ @Override public void handleUpdate(COMMAND_DONE update, IConnection connection) { if (connection != null) connection.close(); // logger.log(1,"GUI", "-","-", "Received update: "+update); System.err.println("GET_STATUS OCR received: "+update); if (!( update instanceof GET_STATUS_DONE)) { return; } GET_STATUS_DONE gsd = (GET_STATUS_DONE)update; StatusCategory status = gsd.getStatus(); int ocrStatus = status.getStatusEntryInt("state"); double age = status.getStatusEntryDouble("age"); topPanel.getAuxSystemsSummaryPanel().updateOcrStatus(ocrStatus); } }
[ "S.N.Fraser@ljmu.ac.uk" ]
S.N.Fraser@ljmu.ac.uk
bfffe6f526d297ed7077b92e095d3a70af7ab6d8
ec197011e79292f6064dda66919ad381a4c7247f
/orchestrator-service/src/main/java/eg/com/orchestrator/listener/OrderPlacedEventListener.java
542aec297f2c8089e2a38ebeacd05210ac95d91f
[]
no_license
ahmedemad3/microservice-orchestrator-saga
03128dc330f22865266972de3252c27a62e3a8fd
d1e9fa10e4a52efd937f5373204a24293b89be8c
refs/heads/main
2023-07-17T22:21:37.084823
2021-08-29T03:16:21
2021-08-29T03:16:21
400,931,221
0
0
null
null
null
null
UTF-8
Java
false
false
1,769
java
package eg.com.orchestrator.listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.stream.annotation.StreamListener; import org.springframework.messaging.handler.annotation.Payload; import org.springframework.stereotype.Component; import eg.com.orchestrator.exception.ResourceNotFoundException; import eg.com.orchestrator.kafka.channel.OrchestratorChannel; import eg.com.orchestrator.kafka.message.OrderEvent; import eg.com.orchestrator.model.OrderStatus; import eg.com.orchestrator.util.ServicesUrlUtils; import eg.com.orchestrator.util.RestClient; @SuppressWarnings("deprecation") @Component public class OrderPlacedEventListener { private static final Logger logger = LoggerFactory.getLogger(OrderPlacedEventListener.class); @Autowired private RestClient restClient; @Value("${inventory.service.endpoint}") private String inventoryEndpointUrl; @StreamListener(target = OrchestratorChannel.INPUT_ORDER) public void listenOrderPlaced(@Payload OrderEvent orderEvent) { if (OrderStatus.CREATED.name().equals(orderEvent.getOrderStatus().name())) { logger.info("Received an OrderPlacedEvent for order id: " + orderEvent.getOrderId()); logger.info("Going to call inventory service for order id : " + orderEvent.getOrderId()); try { // Called the inventory to check the availability restClient.doPost(inventoryEndpointUrl + ServicesUrlUtils.INVENTORY_COMPENSATE_URL, orderEvent.getOrderId()); } catch (ResourceNotFoundException e) { e.printStackTrace(); logger.error("order items not availabel with order id {} ", orderEvent.getOrderId()); } } } }
[ "ahmedemad3@gmail.com" ]
ahmedemad3@gmail.com
8710b3c1693cf36aaf92ce2582c43be41c46bd53
74f0aded420614a4f2db61ff5f44f87eb7f8ba2d
/src/test/java/com/jenkins/jenkinsdemo/JenkinsdemoApplicationTests.java
86ace3e613a58665501df2dc720ca4d4e71ce587
[]
no_license
ssj256x/jenkins-demo
49e01892fe36045172c6c591f9dc7a6aeeed79a7
a7a56bbb5e043a1cde026f1c244f6e8f1b1ae0d8
refs/heads/master
2023-03-18T14:44:57.677774
2021-02-19T16:45:03
2021-02-19T16:45:03
340,094,911
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package com.jenkins.jenkinsdemo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class JenkinsdemoApplicationTests { @Test void contextLoads() { } }
[ "ssj256x@outlook.com" ]
ssj256x@outlook.com
45107607d706c1905c98dd3e582f380b05ae5d17
f875334469a67bc869579458cb053df20081b88a
/src/hk/ftp/command/USER.java
97aa844f23acc2d2ae11c272f5766df3759a3fd6
[]
no_license
KNVB/MyFtp
14903e801dbb3e3ccf0b13456623c2427075776a
28442893913de0ce4858b15801093bf8055971ca
refs/heads/master
2020-05-29T09:24:44.473125
2015-11-05T07:01:34
2015-11-05T07:01:34
28,184,724
0
1
null
null
null
null
UTF-8
Java
false
false
957
java
package hk.ftp.command; import io.netty.channel.ChannelHandlerContext; import org.apache.log4j.Logger; import hk.ftp.Configuration; import hk.ftp.FtpCommandInterface; import hk.ftp.handler.FtpSession; import hk.ftp.util.Utility; public class USER implements FtpCommandInterface { @Override public String helpMessage(FtpSession fs) { // TODO Auto-generated method stub return null; } @Override public void execute(FtpSession fs,ChannelHandlerContext ctx, String param, Logger logger) { // TODO Auto-generated method stub Configuration config=fs.getConfig(); String message=new String(); if (param ==null) { message=config.getFtpMessage("500_Null_Command"); } else { message=config.getFtpMessage("331_Password_Required"); message=message.replaceAll("%1", param); fs.setUserName(param); } Utility.sendMessageToClient(ctx.channel(),logger,fs.getClientIp(), message); } }
[ "cstsang@notebook" ]
cstsang@notebook
11b011df5d0a5dfb9bf208c91cb5231e3bf2d634
25c09da983fc7308698084ed2e61e0522f2ba2b2
/guava-simple-learn/src/main/java/com/supertrampai/guavasimplelearn/People.java
e3f25803cb221ecec209d987302106674ae75842
[]
no_license
SuperTrampAI/doing-learn-simple-demo
a567b8e48481b62dc8a65b7613a486fe921eee2e
abe40d90ed6ba713254bd6ba4871be20b965d3b9
refs/heads/master
2022-12-08T00:54:59.580343
2019-12-02T09:58:32
2019-12-02T09:58:32
199,856,489
0
0
null
2022-12-06T00:43:24
2019-07-31T12:57:10
Java
UTF-8
Java
false
false
1,218
java
package com.supertrampai.guavasimplelearn; import java.util.Objects; /** * @author: LiXiangHong * @Email: lxh800109@gmail.com * @Description: * @Date: Created in 9:56 2019/11/19 * @Modified By: */ public class People { private Integer age; private String name; public People(){} public People(Integer age,String name){ this.age=age; this.name=name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; People people = (People) o; return Objects.equals(age, people.age) && Objects.equals(name, people.name); } @Override public int hashCode() { return Objects.hash(age, name); } @Override public String toString() { return "People{" + "age=" + age + ", name='" + name + '\'' + '}'; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "lxh800109@gmail.com" ]
lxh800109@gmail.com
10c0137ee24032dc334bf0a14714c36f41292b7d
f6c629b0022dc26a4588075ae7c2d620b8c1398f
/netbird-android-support/src/cc/colorcat/netbird3/android/AndroidPlatform.java
d4714be2f4a384c1e856bc0cc897505627b877f6
[]
no_license
fireworld/NetBird3
dd110c003ca879c02d082e224cc8097f6fedf470
21716f15a79f974b5f6d3c8c1b3dba9c27cf7e4d
refs/heads/master
2021-09-05T04:07:52.394675
2018-01-24T03:08:59
2018-01-24T03:08:59
111,074,694
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package cc.colorcat.netbird3.android; import cc.colorcat.netbird3.Connection; import cc.colorcat.netbird3.Platform; import cc.colorcat.netbird3.platform.Logger; import cc.colorcat.netbird3.platform.Scheduler; /** * Created by cxx on 17-11-20. * xx.ch@outlook.com */ public class AndroidPlatform extends Platform { private final Connection connection = new AndroidHttpConnection(); private final Scheduler scheduler = new AndroidScheduler(); private final Logger logger = new AndroidLogger(); @Override public Connection connection() { return connection; } @Override public Scheduler scheduler() { return scheduler; } @Override public Logger logger() { return logger; } }
[ "xx.ch@outlook.com" ]
xx.ch@outlook.com
719573d398985580e581ff96583fba64e064ec0c
1f97f9daa8c206fbf3c6d6ca35abd9c488d64bf7
/src/main/java/com/filipetobias/cursomc/services/UserService.java
f64fa3be7ef6a3fa6aaaa374e2a4b1fc8946b571
[]
no_license
FilipeGabrielTobias/spring-boot-ionic-3-backend
070f53b393cb6ced754721a255a8286f72fae376
a67c448ca4bff13949896efeb11cb7a3a9cc5d08
refs/heads/master
2020-04-20T07:00:22.351136
2019-02-01T13:16:12
2019-02-01T13:16:12
168,699,830
0
0
null
null
null
null
UTF-8
Java
false
false
474
java
package com.filipetobias.cursomc.services; import com.filipetobias.cursomc.security.UserSS; import org.springframework.security.core.context.SecurityContextHolder; /** * Created by Filipe.Tobias on 06/08/2018. */ public class UserService { public static UserSS authenticated(){ try { return (UserSS) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); } catch(Exception e) { return null; } } }
[ "filipe.tobias@senior.com.br" ]
filipe.tobias@senior.com.br
1cc124d83edc00d2fb7d2d4f3656b795154c0f9d
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__float_connect_tcp_modulo_51b.java
5d50e53f8a772f29fed453cb616ffe2cd5773e45
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
1,721
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__float_connect_tcp_modulo_51b.java Label Definition File: CWE369_Divide_by_Zero__float.label.xml Template File: sources-sinks-51b.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded non-zero number (two) * Sinks: modulo * GoodSink: Check for zero before modulo * BadSink : Modulo by a value that may be zero * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package * * */ package testcases.CWE369_Divide_by_Zero; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.security.SecureRandom; public class CWE369_Divide_by_Zero__float_connect_tcp_modulo_51b { public void bad_sink(float data ) throws Throwable { /* POTENTIAL FLAW: Possibly modulo by zero */ int result = (int)(100.0 % data); IO.writeLine(result); } /* goodG2B() - use goodsource and badsink */ public void goodG2B_sink(float data ) throws Throwable { /* POTENTIAL FLAW: Possibly modulo by zero */ int result = (int)(100.0 % data); IO.writeLine(result); } /* goodB2G() - use badsource and goodsink */ public void goodB2G_sink(float data ) throws Throwable { /* FIX: Check for value of or near zero before modulo */ if( Math.abs(data) > 0.000001 ) { int result = (int)(100.0 % data); IO.writeLine(result); } else { IO.writeLine("This would result in a modulo by zero"); } } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
267798094b7b637924f564ed7a7b28799f344d2e
db0388a7c26126dbc078f3a7ad11afaec326b53b
/src/b/a/a/a/c/h/a/a.java
6abbfa379c469a614df5e33ad934bf5c63ee92b3
[]
no_license
rapilab/idea-js-debug-spike
e7ba2389235a73e9c595abd60a85d6da0a7d8148
bf21b1077d2972e4652499a8c10216d64b0c0406
refs/heads/master
2023-04-13T12:55:07.053044
2021-04-23T06:24:45
2021-04-23T06:24:45
353,695,114
0
0
null
null
null
null
UTF-8
Java
false
false
3,173
java
package b.a.a.a.c.h.a; import b.a.a.a.c.b; import java.io.IOException; import java.io.InputStream; public abstract class a extends b { private final byte[] j = new byte[1]; protected final InputStream a; protected int b = -1; protected int c = 9; protected int d = 0; protected int e = 0; protected int f = -1; protected int g = 0; protected int[] h; protected byte[] i; private byte[] k; private int l; protected a(InputStream paramInputStream) { this.a = paramInputStream; } public void close() throws IOException { this.a.close(); } public int read() throws IOException { int i = read(this.j); return (i < 0) ? i : (0xFF & this.j[0]); } public int read(byte[] arrayOfByte, int off, int len) throws IOException { int i; for (i = a(arrayOfByte, off, len); len - i > 0; i += a(arrayOfByte, off + i, len - i)) { int j = a(); if (j < 0) { if (i > 0) { a(i); return i; } return j; } } a(i); return i; } protected abstract int a() throws IOException; protected abstract int a(int paramInt, byte paramByte) throws IOException; protected void b(int paramInt) { this.b = 1 << paramInt - 1; } protected void c(int paramInt) { int i = 1 << paramInt; this.h = new int[i]; this.i = new byte[i]; this.k = new byte[i]; this.l = i; char c = 'Ā'; for (byte b1 = 0; b1 < 'Ā'; b1++) { this.h[b1] = -1; this.i[b1] = (byte)b1; } } protected int d() throws IOException { while (this.e < this.c) { int k = this.a.read(); if (k < 0) return k; this.d |= k << this.e; this.e += 8; } int i = (1 << this.c) - 1; int j = this.d & i; this.d >>>= this.c; this.e -= this.c; return j; } protected int a(int paramInt1, byte paramByte, int paramInt2) { if (this.g < paramInt2) { int i = this.g; this.h[this.g] = paramInt1; this.i[this.g] = paramByte; this.g++; return i; } return -1; } protected int e() throws IOException { if (this.f == -1) throw new IOException("The first code can't be a reference to its preceding code"); byte b1 = 0; for (int i = this.f; i >= 0; i = this.h[i]) b1 = this.i[i]; return a(this.f, b1); } protected int a(int paramInt, boolean paramBoolean) throws IOException { for (int i = paramInt; i >= 0; i = this.h[i]) this.k[--this.l] = this.i[i]; if (this.f != -1 && !paramBoolean) a(this.f, this.k[this.l]); this.f = paramInt; return this.l; } private int a(byte[] paramArrayOfbyte, int paramInt1, int paramInt2) { int i = this.k.length - this.l; if (i > 0) { int j = Math.min(i, paramInt2); System.arraycopy(this.k, this.l, paramArrayOfbyte, paramInt1, j); this.l += j; return j; } return 0; } } /* Location: /Users/fdhuang/works/idea/code/libs/wallaby-intellij.jar!/b/a/a/a/c/h/a/a.class * Java compiler version: 5 (49.0) * JD-Core Version: 1.1.3 */
[ "h@phodal.com" ]
h@phodal.com
96f76edf2bdfc487bc819e621b9e80572d868eb1
4b2c63d13f24585a3542576cdf64bd01db67c1ae
/platform/jsip/jain-sip-impl/src/main/java/org/freeims/javax/sip/parser/WarningParser.java
f6fe82897792e535a258c27919ce82329d9e64cf
[]
no_license
gugu-lee/freeims
ce1d0d92ab79c93dfc356971363f0faf6d228461
bbe2de872deb074531e12cf74204b7a29c91c354
refs/heads/master
2022-12-01T08:47:38.326261
2019-11-02T10:14:33
2019-11-02T10:14:33
58,299,201
0
0
null
2022-11-24T01:41:17
2016-05-08T06:11:46
Java
UTF-8
Java
false
false
6,520
java
/* * Conditions Of Use * * This software was developed by employees of the National Institute of * Standards and Technology (NIST), an agency of the Federal Government. * Pursuant to title 15 Untied States Code Section 105, works of NIST * employees are not subject to copyright protection in the United States * and are considered to be in the public domain. As a result, a formal * license is not needed to use the software. * * This software is provided by NIST as a service and is expressly * provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT * AND DATA ACCURACY. NIST does not warrant or make any representations * regarding the use of the software or the results thereof, including but * not limited to the correctness, accuracy, reliability or usefulness of * the software. * * Permission to use this software is contingent upon your acceptance * of the terms of this agreement * * . * */ package org.freeims.javax.sip.parser; import java.text.ParseException; import javax.sip.*; import org.freeims.core.*; import org.freeims.javax.sip.header.*; /** * Parser for Warning header. * * @version 1.2 * * @author Olivier Deruelle * @author M. Ranganathan * * * * @version 1.0 */ public class WarningParser extends HeaderParser { /** * Constructor * * @param warning - * Warning header to parse */ public WarningParser(String warning) { super(warning); } /** * Cosntructor * * @param lexer - * the lexer to use. */ protected WarningParser(Lexer lexer) { super(lexer); } /** * parse the String message * * @return SIPHeader (WarningList object) * @throws SIPParseException * if the message does not respect the spec. */ public SIPHeader parse() throws ParseException { WarningList warningList = new WarningList(); if (debug) dbg_enter("WarningParser.parse"); try { headerName(TokenTypes.WARNING); while (lexer.lookAhead(0) != '\n') { Warning warning = new Warning(); warning.setHeaderName(SIPHeaderNames.WARNING); // Parsing the 3digits code this.lexer.match(TokenTypes.ID); Token token = lexer.getNextToken(); try { int code = Integer.parseInt(token.getTokenValue()); warning.setCode(code); } catch (NumberFormatException ex) { throw createParseException(ex.getMessage()); } catch (InvalidArgumentException ex) { throw createParseException(ex.getMessage()); } this.lexer.SPorHT(); // Parsing the agent this.lexer.match(TokenTypes.ID); token = lexer.getNextToken(); // Bug reported by zvali@dev.java.net if (lexer.lookAhead(0) == ':') { this.lexer.match(':'); this.lexer.match(TokenTypes.ID); Token token2 = lexer.getNextToken(); warning.setAgent(token.getTokenValue() + ":" + token2.getTokenValue()); } else { warning.setAgent(token.getTokenValue()); } this.lexer.SPorHT(); // Parsing the text String text = this.lexer.quotedString(); warning.setText(text); this.lexer.SPorHT(); warningList.add(warning); while (lexer.lookAhead(0) == ',') { this.lexer.match(','); this.lexer.SPorHT(); warning = new Warning(); // Parsing the 3digits code this.lexer.match(TokenTypes.ID); Token tok = lexer.getNextToken(); try { int code = Integer.parseInt(tok.getTokenValue()); warning.setCode(code); } catch (NumberFormatException ex) { throw createParseException(ex.getMessage()); } catch (InvalidArgumentException ex) { throw createParseException(ex.getMessage()); } this.lexer.SPorHT(); // Parsing the agent this.lexer.match(TokenTypes.ID); tok = lexer.getNextToken(); // Bug reported by zvali@dev.java.net if (lexer.lookAhead(0) == ':') { this.lexer.match(':'); this.lexer.match(TokenTypes.ID); Token token2 = lexer.getNextToken(); warning.setAgent(tok.getTokenValue() + ":" + token2.getTokenValue()); } else { warning.setAgent(tok.getTokenValue()); } this.lexer.SPorHT(); // Parsing the text text = this.lexer.quotedString(); warning.setText(text); this.lexer.SPorHT(); warningList.add(warning); } } } finally { if (debug) dbg_leave("WarningParser.parse"); } return warningList; } /** * public static void main(String args[]) throws ParseException { String * warning[] = { "Warning: 307 isi.edu \"Session parameter 'foo' not * understood\"\n", "Warning: 301 isi.edu \"Incompatible network address * type 'E.164'\"\n", "Warning: 312 ii.edu \"Soda\", "+ " 351 i.edu \"I * network address 'E.164'\" , 323 ii.edu \"Sodwea\"\n", "Warning: 392 * 192.168.89.71:5060 \"Noisy feedback tells: pid=936 * req_src_ip=192.168.89.20 in_uri=sip:xxx@yyyy.org:5061 * out_uri=sip:xxx@yyyy.org:5061 via_cnt==1\"\n" }; * * for (int i = 0; i < warning.length; i++ ) { WarningParser parser = new * WarningParser(warning[i]); WarningList warningList= (WarningList) * parser.parse(); System.out.println("encoded = " + warningList.encode()); } * } */ }
[ "seven.stone.2012@gmail.com" ]
seven.stone.2012@gmail.com
13ad943c4ca1866ecf07722773f8b5ca77fed60c
cb8bbc9177332e284c8a21ab3b9587506d1c1cf4
/SystemUI/src/com/android/systemui/statusbar/policy/BatteryStateRegistar.java
6b7fcb364588094a1b0dc8489bbfa88c9c0ceed7
[ "Apache-2.0" ]
permissive
Phenix-Collection/SystemUI
521dae8b60c82851ec7c7ea3e4f7c5e2682ccb45
eb26c1a9a5481484e6e232e182ba2f824fe442a4
refs/heads/master
2022-03-01T05:45:49.558241
2019-08-23T04:09:30
2019-08-23T04:09:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
471
java
package com.android.systemui.statusbar.policy; public interface BatteryStateRegistar { interface BatteryStateChangeCallback { void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging); void onPowerSaveChanged(); void onBatteryStyleChanged(int style, int percentMode); } public void addStateChangedCallback(BatteryStateChangeCallback cb); public void removeStateChangedCallback(BatteryStateChangeCallback cb); }
[ "392824146@qq.com" ]
392824146@qq.com
120d699297cab1ab21ca9a944a0b7706c5dbded1
672d148b02201bd54ba4f117286261ca46a37a85
/src/main/java/es/uji/daal/easyrent/validators/ChangePasswordValidator.java
276a83c623c192932d8951c7e3e0c48d8900578a
[]
no_license
dnchia/EasyRent
0bbbed64de4c316652a8766811e57abe1ca041bf
5e045cca11710d02af8970a00598625642102af1
refs/heads/master
2021-01-23T04:44:57.599717
2017-05-31T11:52:25
2017-05-31T11:52:25
92,940,073
1
1
null
null
null
null
UTF-8
Java
false
false
1,334
java
package es.uji.daal.easyrent.validators; import es.uji.daal.easyrent.view_models.ChangePasswordForm; import es.uji.daal.easyrent.view_models.SignupForm; import org.springframework.validation.Errors; import org.springframework.validation.Validator; /** * Created by daniel on 30/04/16. */ public class ChangePasswordValidator implements Validator { @Override public boolean supports(Class<?> cls) { return ChangePasswordForm.class.isAssignableFrom(cls); } @Override public void validate(Object obj, Errors errors) { ChangePasswordForm form = (ChangePasswordForm) obj; if (form.getOldPassword().equals("")) { errors.rejectValue("oldPassword", "invalid", "You must introduce your old password."); } if (form.getNewPassword().equals("")) { errors.rejectValue("newPassword", "invalid", "You must introduce a password."); } if (form.getRepeatPassword().equals("")) { errors.rejectValue("repeatPassword", "invalid", "You must introduce a password."); } if (!form.getNewPassword().equals(form.getRepeatPassword())) { errors.rejectValue("newPassword", "invalid", "Passwords don't match."); errors.rejectValue("repeatPassword", "invalid", "Passwords don't match."); } } }
[ "daniel.chia.95@gmail.com" ]
daniel.chia.95@gmail.com
fdc82d044195dab54a70c9a4162efe94e7c399fb
21f7f3d92d282779f4b4ec044848413e7be12fdd
/multiLanguage/src/main/java/com/stefan/multilanguage/impl/LanguageType.java
1d2f5f633386e6ba226aa1e22f8d254fa958ec23
[]
no_license
ench0218/MulituLanguage
eceb16f303d8b91b986799e6496dcb26b1ea1ec8
bcfffe0eaad0abc217353f5db6236042a3e775a5
refs/heads/master
2023-02-22T21:08:52.504718
2021-01-09T10:15:46
2021-01-09T10:15:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,434
java
package com.stefan.multilanguage.impl; import androidx.annotation.IntDef; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; public class LanguageType { //跟随系统 public static final String LANGUAGE_SYSTEM = "system"; //英语 public static final String LANGUAGE_EN = "en"; //简体中文 public static final String LANGUAGE_ZH_CN = "zh-Hans"; //泰语 public static final String LANGUAGE_TH = "th"; //繁体中文 public static final String LANGUAGE_ZH_TW = "zh-Hant"; //日语 public static final String LANGUAGE_JA = "ja"; //韩语 public static final String LANGUAGE_KO = "ko"; //阿拉伯语 public static final String LANGUAGE_AR = "ar"; //印尼语 public static final String LANGUAGE_IN = "id"; //西班牙语 public static final String LANGUAGE_ES = "es"; //葡萄牙语 public static final String LANGUAGE_PT = "pt"; //越南语 public static final String LANGUAGE_VI = "vi"; //俄语 public static final String LANGUAGE_RU = "ru"; //土耳其语 public static final String LANGUAGE_TR = "tr"; //德语 public static final String LANGUAGE_DE = "de"; //法语 public static final String LANGUAGE_FR = "fr"; //意大利语 public static final String LANGUAGE_IT = "it"; }
[ "chenshan.chen@bytedance.com" ]
chenshan.chen@bytedance.com
5e16305e75c46eeae6c906954776713b8ff761ff
9b3bb3a7ed0d494e95226acca4e32097580ee0a0
/app/src/main/java/com/example/pierre/projetinfo/MainActivity.java
488a80322fa22a74045da066d6f7560c633aca86
[]
no_license
saraedmane/appli
8811412b1d5b499eb7b78b541844ed7eccdc0393
3ce21f41470ac25fcbb26125be67c2177a27187f
refs/heads/master
2020-03-17T21:02:54.122222
2018-05-18T11:45:28
2018-05-18T11:45:28
133,940,873
0
0
null
null
null
null
UTF-8
Java
false
false
1,820
java
package com.example.pierre.projetinfo; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; public class MainActivity extends AppCompatActivity { public final static String EXTRA_MESSAGE = "distance";//"com.pierre.myapplication.MESSAGE"; EditText distance = null; CheckBox mega = null; Button envoyer = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); envoyer = (Button) findViewById(R.id.calcul); mega = (CheckBox) findViewById(R.id.mega); distance = (EditText) findViewById(R.id.distance); envoyer.setOnClickListener(envoyerListener); distance.addTextChangedListener(textWatcher); } private View.OnClickListener envoyerListener = new View.OnClickListener() { @Override public void onClick(View v) { String d = distance.getText().toString(); Intent intent = new Intent(MainActivity.this, Main2Activity.class); Bundle b = new Bundle(); b.putString(EXTRA_MESSAGE,d); intent.putExtras(b); startActivity(intent); } }; private TextWatcher textWatcher = new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { } }; }
[ "edmane.sara@gmail.com" ]
edmane.sara@gmail.com
3615fad54f46d5063dd4ca2081b20775c7809fdd
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-12/u-11-112/u-11-112-f6902.java
ebbe7b7114c1bb455beed6a87fc08077ed51bbb4
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 9175331897763
[ "jenkins@khan.paloaltonetworks.local" ]
jenkins@khan.paloaltonetworks.local
00717dd20185bed07093b80f455f7d33939a92e5
1f1eef472ac069b3d8edc6df859dbe81f44a9f16
/src/main/java/ru/stoliarenkoas/tm/webserver/api/repository/Repository.java
c5926cdfdc113a5f917e0fb35633b7e96e3c629c
[]
no_license
StoliarenkoAS/taskmanager-webserver-ee
a7fac3168d0af070f97416811dbff52c229f3e49
f4cc57a22f081ba6ac4ce266e9a44b779328ce01
refs/heads/master
2023-08-08T10:16:31.264379
2019-07-02T12:58:28
2019-07-02T12:58:28
194,260,286
0
1
null
2023-07-22T09:31:39
2019-06-28T11:11:08
Java
UTF-8
Java
false
false
1,113
java
package ru.stoliarenkoas.tm.webserver.api.repository; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import ru.stoliarenkoas.tm.webserver.api.entity.Entity; import java.util.Collection; public interface Repository<T extends Entity> { @NotNull Collection<T> findAll(@NotNull String userId) throws Exception; @NotNull Collection<T> findByName(@NotNull String userId, @NotNull String name) throws Exception; @Nullable T findOne(@NotNull String userId, @NotNull String id) throws Exception; @NotNull Boolean persist(@NotNull T object) throws Exception; @NotNull Boolean merge(@NotNull String userId, @NotNull T object) throws Exception; @Nullable String remove(@NotNull String userId, @NotNull String id) throws Exception; @Nullable String remove(@NotNull String userId, @NotNull T object) throws Exception; @NotNull Collection<String> removeByName(@NotNull String userId, @NotNull String name) throws Exception; @NotNull Collection<String> removeAll(@NotNull String userId) throws Exception; }
[ "stolyarenkoas@gmail.com" ]
stolyarenkoas@gmail.com
e5e4ed0469ff72878c056cb3406690647715167a
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE606_Unchecked_Loop_Condition/CWE606_Unchecked_Loop_Condition__console_readLine_08.java
473e45168e560b3be6ddd03e559a00551b7ac453
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
14,705
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE606_Unchecked_Loop_Condition__console_readLine_08.java Label Definition File: CWE606_Unchecked_Loop_Condition.label.xml Template File: sources-sinks-08.tmpl.java */ /* * @description * CWE: 606 Unchecked Input for Loop Condition * BadSource: console_readLine Read data from the console using readLine() * GoodSource: hardcoded int in string form * Sinks: * GoodSink: validate loop variable * BadSink : loop variable not validated * Flow Variant: 08 Control flow: if(private_returns_t()) and if(private_returns_f()) * * */ package testcases.CWE606_Unchecked_Loop_Condition; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; public class CWE606_Unchecked_Loop_Condition__console_readLine_08 extends AbstractTestCase { /* The methods below always return the same value, so a tool should be able to figure out that every call to these methods will return true or return false. */ private boolean private_returns_t() { return true; } private boolean private_returns_f() { return false; } public void bad() throws Throwable { String data; /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { data = ""; /* Initialize data */ /* read user input from console with readLine */ try { InputStreamReader isr = new InputStreamReader(System.in, "UTF-8"); BufferedReader buffread = new BufferedReader(isr); /* POTENTIAL FLAW: Read data from the console using readLine() */ data = buffread.readLine(); } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } /* NOTE: Tools may report a flaw here because buffread and isr are not closed. Unfortunately, closing those will close System.in, which will cause any future attempts to read from the console to fail and throw an exception */ } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* FIX: Use a hardcoded int as a string */ data = "5"; } /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodG2B1() - use goodsource and badsink by changing first private_returns_t() to private_returns_f() */ private void goodG2B1() throws Throwable { String data; /* INCIDENTAL: CWE 570 Statement is Always False */ if(private_returns_f()) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = ""; /* Initialize data */ /* read user input from console with readLine */ try { InputStreamReader isr = new InputStreamReader(System.in, "UTF-8"); BufferedReader buffread = new BufferedReader(isr); /* POTENTIAL FLAW: Read data from the console using readLine() */ data = buffread.readLine(); } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } /* NOTE: Tools may report a flaw here because buffread and isr are not closed. Unfortunately, closing those will close System.in, which will cause any future attempts to read from the console to fail and throw an exception */ } else { /* FIX: Use a hardcoded int as a string */ data = "5"; } /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodG2B2() - use goodsource and badsink by reversing statements in first if */ private void goodG2B2() throws Throwable { String data; /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { /* FIX: Use a hardcoded int as a string */ data = "5"; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = ""; /* Initialize data */ /* read user input from console with readLine */ try { InputStreamReader isr = new InputStreamReader(System.in, "UTF-8"); BufferedReader buffread = new BufferedReader(isr); /* POTENTIAL FLAW: Read data from the console using readLine() */ data = buffread.readLine(); } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } /* NOTE: Tools may report a flaw here because buffread and isr are not closed. Unfortunately, closing those will close System.in, which will cause any future attempts to read from the console to fail and throw an exception */ } /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodB2G1() - use badsource and goodsink by changing second private_returns_t() to private_returns_f() */ private void goodB2G1() throws Throwable { String data; /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { data = ""; /* Initialize data */ /* read user input from console with readLine */ try { InputStreamReader isr = new InputStreamReader(System.in, "UTF-8"); BufferedReader buffread = new BufferedReader(isr); /* POTENTIAL FLAW: Read data from the console using readLine() */ data = buffread.readLine(); } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } /* NOTE: Tools may report a flaw here because buffread and isr are not closed. Unfortunately, closing those will close System.in, which will cause any future attempts to read from the console to fail and throw an exception */ } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* FIX: Use a hardcoded int as a string */ data = "5"; } /* INCIDENTAL: CWE 570 Statement is Always False */ if(private_returns_f()) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodB2G2() - use badsource and goodsink by reversing statements in second if */ private void goodB2G2() throws Throwable { String data; /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { data = ""; /* Initialize data */ /* read user input from console with readLine */ try { InputStreamReader isr = new InputStreamReader(System.in, "UTF-8"); BufferedReader buffread = new BufferedReader(isr); /* POTENTIAL FLAW: Read data from the console using readLine() */ data = buffread.readLine(); } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } /* NOTE: Tools may report a flaw here because buffread and isr are not closed. Unfortunately, closing those will close System.in, which will cause any future attempts to read from the console to fail and throw an exception */ } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* FIX: Use a hardcoded int as a string */ data = "5"; } /* INCIDENTAL: CWE 571 Statement is Always True */ if(private_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } } public void good() throws Throwable { goodG2B1(); goodG2B2(); goodB2G1(); goodB2G2(); } /* 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); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
90446ecdfe6f431d6d3649f30a28558ae523de9d
1d4cd0421a645b6204b72b3be7d3f9fa7280cf14
/app/src/main/java/com/felix/swipebackdemo/MainActivity_second.java
10ffc50db4d713306470fcc13f879714009b9b17
[]
no_license
FelixForever/SwipeBackDemo
0b69c6063818d11dc868a9a8626bbe6b92e8bc80
055f9cf86d9999f8da6df683b924c1401a6d2be4
refs/heads/master
2021-01-10T17:19:34.394559
2015-10-27T07:52:29
2015-10-27T07:52:29
45,022,072
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.felix.swipebackdemo; import android.os.Bundle; import com.felix.swipebackdemo.BaseClass.SwipeBackActivity; public class MainActivity_second extends SwipeBackActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // this.setTheme(R.style.Theme_Swipe_Back); setContentView(R.layout.activity_main_second); } }
[ "736232402@qq.com" ]
736232402@qq.com
2a641bb5d24f0f82c2dacc9e833d37772d1a4162
33d53659cff821f1365f420dc82b507d50f7c56c
/app/src/main/java/com/simon/circleseekview/MainActivity.java
dc6ddf3c8366d9f83b69db0f362976ab279ed494
[]
no_license
Simonzhuqi/CircleSelectView
7308a5bacb4f38593bf531482decf0b6bf8ebef0
965c51382aa904e7098f5cb84a3b3b59eccc19d1
refs/heads/master
2021-05-14T23:50:51.015878
2017-09-19T06:58:13
2017-09-19T06:58:13
104,030,611
1
0
null
null
null
null
UTF-8
Java
false
false
1,319
java
package com.simon.circleseekview; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.RelativeLayout; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private CircleSeekView color_picker; private RelativeLayout layout; private TextView value_tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); color_picker = findViewById(R.id.k2_light_color_picker); value_tv = findViewById(R.id.value_tv); layout = findViewById(R.id.layout); color_picker.setColorValue(35); color_picker.setOnSelectColorListener(new CircleSeekView.OnSelectColorListener() { @Override public void onSelectColor(int[] rgb, int colorValue,boolean isFromUser) { layout.setBackgroundColor(Color.argb(255,rgb[0],rgb[1],rgb[2])); value_tv.setText(colorValue+""); } @Override public void onSelectColorFinish(int colorValue) { } }); } @Override protected void onDestroy() { color_picker.recycleBitMap(); super.onDestroy(); } }
[ "312282860@qq.com" ]
312282860@qq.com
0782230e6739cb3eb3996ed10e53e6e054efcf08
df974625127fd85b5536c3bb4c171414b9acdc6a
/src/main/java/de/fidor/dal/datamodels/cardservice/carddata/CardData.java
c7054603a618307bb0b70c3fe4dba1fea477d11d
[]
no_license
KateBohush/api_tests
657f83b25fc7d250c9f705ebd0b06b80c739e112
56bfc8a272774f7228d9a5a5ff592918a6937be0
refs/heads/master
2021-06-28T00:33:12.608151
2017-09-14T13:16:33
2017-09-14T13:16:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
814
java
package de.fidor.dal.datamodels.cardservice.carddata; import lombok.Data; @Data public class CardData { private Integer id; private String account_id; private String inscription; private String type; private String design; private String currency; private Boolean physical; private String valid_until; private Integer balance; private Integer atm_limit; private Integer transaction_single_limit; private Integer transaction_volume_limit; private Limits limits; private Boolean email_notification; private Boolean sms_notification; private Boolean payed; private String state; private String lock_reason; private Boolean disabled; private AtmDetails atm_details; private String pan; private String updated_at; private String created_at; }
[ "https://github.com/KateBohush/Selenide" ]
https://github.com/KateBohush/Selenide
9ec1f48f6abe71ba6c10df06ba2f39210e7e8bbe
b0d9a3024f1c5a7d74ed9a141bac98bc03e7a70f
/src/nava/data/io/ExcelIO.java
2b6baf73600a256496ecf816f13abeaac110d1df
[]
no_license
MichaelGolden/NAVA
9fea2f04f2565e477a6558280ece81a4ffc5ef2c
0b3ce5486f8b9351c6d48fd95794ef4aa8c7dd25
refs/heads/master
2020-05-19T08:46:58.276521
2014-02-12T15:42:04
2014-02-12T15:42:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,342
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package nava.data.io; import java.io.*; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import nava.data.types.Tabular; import nava.data.types.TabularData; import nava.data.types.TabularField; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.*; /** * * @author Michael */ public class ExcelIO { File file = null; Workbook workbook = null; DataFormatter formatter = null; FormulaEvaluator evaluator = null; public ExcelIO(File file) { this.file = file; } public static boolean isExcelWorkbook(File inFile) throws FileNotFoundException { try { Workbook workbook = WorkbookFactory.create(inFile); DataFormatter formatter = new DataFormatter(true); //FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); int numSheets = workbook.getNumberOfSheets(); return true; } catch (IOException ex) { } catch (InvalidFormatException ex) { } catch(Exception ex) { } return false; } public static int getNumberOfSheets(File inFile) throws FileNotFoundException { try { Workbook workbook = WorkbookFactory.create(inFile); DataFormatter formatter = new DataFormatter(true); //FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); return workbook.getNumberOfSheets(); } catch (IOException ex) { } catch (InvalidFormatException ex) { } return 0; } public static int getNumberOfColumns(File inFile) throws FileNotFoundException { try { Workbook workbook = WorkbookFactory.create(inFile); DataFormatter formatter = new DataFormatter(true); int numSheets = workbook.getNumberOfSheets(); int totalColumns = 0; Sheet sheet = null; Row row = null; int lastRowNum = 0; for (int i = 0; i < numSheets; i++) { sheet = workbook.getSheetAt(i); totalColumns += sheet.getLastRowNum(); if (sheet.getPhysicalNumberOfRows() > 0) { lastRowNum = sheet.getLastRowNum(); for (int j = 0; j <= lastRowNum; j++) { row = sheet.getRow(j); } } } return totalColumns; } catch (IOException ex) { } catch (InvalidFormatException ex) { } return 0; } public static Tabular getTabularRepresentation(File excelFile) throws IOException, InvalidFormatException { Tabular tabular = new Tabular(); DecimalFormat df = new DecimalFormat("00"); Workbook workbook = WorkbookFactory.create(excelFile); DataFormatter formatter = new DataFormatter(true); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); int numSheets = workbook.getNumberOfSheets(); tabular.numSheets = numSheets; Sheet sheet; for (int i = 0; i < numSheets; i++) { sheet = workbook.getSheetAt(i); if (sheet.getPhysicalNumberOfRows() > 0) { ArrayList<String> header = rowToStringList(sheet.getRow(0), formatter, evaluator); for (int j = 0; j < header.size(); j++) { tabular.fields.add(new TabularField(tabular, header.get(j), i, j, i * numSheets + j)); } } } return tabular; } public static void saveAsCSV(File excelFile, File outFile) throws IOException, InvalidFormatException { Workbook workbook = WorkbookFactory.create(excelFile); DataFormatter formatter = new DataFormatter(true); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); int numSheets = workbook.getNumberOfSheets(); Sheet sheet; BufferedWriter buffer = new BufferedWriter(new FileWriter(outFile)); for (int r = 0;; r++) { ArrayList<String> row = new ArrayList<>(); boolean cont = false; for (int i = 0; i < numSheets; i++) { sheet = workbook.getSheetAt(i); if (r < sheet.getPhysicalNumberOfRows()) { row.addAll(rowToStringList(sheet.getRow(r), formatter, evaluator)); cont = true; } } // if there is a row to write if (cont) { for (int k = 0; k < row.size() - 1; k++) { buffer.write("\"" + row.get(k) + "\","); } buffer.write("\"" + row.get(row.size() - 1) + "\""); buffer.newLine(); } else { break; } } buffer.close(); } public void printWorkbook() throws FileNotFoundException, IOException, InvalidFormatException { FileInputStream fis = null; try { System.out.println("Opening workbook [" + file.getName() + "]"); fis = new FileInputStream(file); // Open the workbook and then create the FormulaEvaluator and // DataFormatter instances that will be needed to, respectively, // force evaluation of forumlae found in cells and create a // formatted String encapsulating the cells contents. workbook = WorkbookFactory.create(fis); formatter = new DataFormatter(true); evaluator = workbook.getCreationHelper().createFormulaEvaluator(); Sheet sheet = null; Row row = null; int lastRowNum = 0; System.out.println("Converting files contents to CSV format."); // Discover how many sheets there are in the workbook.... int numSheets = workbook.getNumberOfSheets(); // and then iterate through them. for (int i = 0; i < numSheets; i++) { // Get a reference to a sheet and check to see if it contains // any rows. sheet = workbook.getSheetAt(i); if (sheet.getPhysicalNumberOfRows() > 0) { // Note down the index number of the bottom-most row and // then iterate through all of the rows on the sheet starting // from the very first row - number 1 - even if it is missing. // Recover a reference to the row and then call another method // which will strip the data from the cells and build lines // for inclusion in the resylting CSV file. lastRowNum = sheet.getLastRowNum(); for (int j = 0; j <= lastRowNum; j++) { row = sheet.getRow(j); // this.rowToCSV(row); System.out.println(i + "," + j + "\t" + rowToStringList(row, formatter, evaluator).toString()); } } } } finally { if (fis != null) { fis.close(); } } } private static ArrayList<String> rowToStringList(Row row, DataFormatter formatter, FormulaEvaluator evaluator) { Cell cell = null; int lastCellNum = 0; ArrayList<String> csvLine = new ArrayList<String>(); // Check to ensure that a row was recovered from the sheet as it is // possible that one or more rows between other populated rows could be // missing - blank. If the row does contain cells then... if (row != null) { // Get the index for the right most cell on the row and then // step along the row from left to right recovering the contents // of each cell, converting that into a formatted String and // then storing the String into the csvLine ArrayList. lastCellNum = row.getLastCellNum(); for (int i = 0; i <= lastCellNum; i++) { cell = row.getCell(i); if (cell == null) { csvLine.add(""); } else { if (cell.getCellType() != Cell.CELL_TYPE_FORMULA) { if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC) { csvLine.add(cell.getNumericCellValue()+""); } else { csvLine.add(formatter.formatCellValue(cell, evaluator)); } } else { CellValue cellValue = evaluator.evaluate(cell); if(cellValue.getCellType() == Cell.CELL_TYPE_NUMERIC) { csvLine.add(cellValue.getNumberValue()+""); } else { csvLine.add(formatter.formatCellValue(cell, evaluator)); } } } } } return csvLine; } public static void main(String[] args) { try { new ExcelIO(new File("C:\\Users\\Michael\\Dropbox\\RNA and StatAlign\\correlation_zsexcelfix.xlsx")).printWorkbook(); } catch (FileNotFoundException ex) { Logger.getLogger(ExcelIO.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(ExcelIO.class.getName()).log(Level.SEVERE, null, ex); } catch (InvalidFormatException ex) { Logger.getLogger(ExcelIO.class.getName()).log(Level.SEVERE, null, ex); } } }
[ "Michael@Michael-ACER" ]
Michael@Michael-ACER
4012f3634ed29518b68c232bb34f5bd139fc4b6a
8b259164a1a9634aecc64f67212c4facc6a6c92d
/MappingWithAnnotations/src/oneToMany/Courses.java
1f8beac7b6ea5249b9f262cf97a0ca2429497169
[]
no_license
mohamed085/Hibernate
09fad7cdb4d165749f06c95db737c37097d7c2e2
74b1e731124ad99b9ecc4d182b4c3d23d47a3c9b
refs/heads/master
2023-04-19T02:10:10.301602
2021-05-02T23:26:05
2021-05-02T23:26:05
363,768,744
1
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package oneToMany; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import org.hibernate.annotations.ManyToAny; @Entity public class Courses { private int id; private String CourseName; private Center center; @Id @GeneratedValue(strategy = GenerationType.AUTO) public int getId() { return id; } public void setId(int id) { this.id = id; } public String getCourseName() { return CourseName; } public void setCourseName(String CourseName) { this.CourseName = CourseName; } @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "ce_id") public Center getCenter() { return center; } public void setCenter(Center center) { this.center = center; } }
[ "mohamed085555@gmail.com" ]
mohamed085555@gmail.com
aa65eeebf20ee3fe128a9acb3528c5f65acdddad
a5628e5d3a6f2a347d1434edfdfcc8c2d88113ea
/GPFinalProject/src/GPFinalProject/GPNodeOperator.java
9dd72b363810e91720609306ba199353fdcbab58
[]
no_license
Jackiec/GPFinalProject
d167cb4844c76210dc638d2e5ad74c39c8518582
1cc59d68eca100e5524661dc23bb5497b3705661
refs/heads/master
2021-01-17T05:54:23.627611
2011-11-06T01:47:17
2011-11-06T01:47:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,561
java
package GPFinalProject; public class GPNodeOperator extends GPNode { protected GPNode m_left; protected GPNode m_right; protected String m_operator; public GPNodeOperator(String operator, GPNode left, GPNode right) { // TODO Auto-generated constructor stub m_operator = operator; m_left = left; m_right = right; } public double EvaluateFitnessValue(double x) { double leftValue = m_left.EvaluateFitnessValue(x); double rightValue = m_right.EvaluateFitnessValue(x); double output = Double.MAX_VALUE; if (m_operator.equals("+")) { output = leftValue + rightValue; } if (m_operator.equals("-")) { output = leftValue - rightValue; } if (m_operator.equals("*")) { output = leftValue * rightValue; } if (m_operator.equals("/")) { if (rightValue != 0.0) { output = leftValue / rightValue; } else { output = Double.MAX_VALUE; } } return output; } public int GetGPDepth() { int leftDepth = m_left.GetGPDepth(); int rightDepth = m_right.GetGPDepth(); if (leftDepth > rightDepth) { return leftDepth + 1; } else { return rightDepth + 1; } } public int GetGPNodeCount() { return m_left.GetGPNodeCount() + m_right.GetGPNodeCount() + 1; } public String GetGPString() { return "( " + m_left.GetGPString() + " " + m_operator + " " + m_right.GetGPString() + " )"; } public GPNode GetLeftNode() { return m_left; } public GPNode GetRightNode() { return m_right; } public void SetLeftNode(GPNode input) { m_left = input; } public void SetRightNode(GPNode input) { m_right = input; } public GPNode FindNodeReferenceById(int searchID, int currentCount) { if (searchID == currentCount) { return m_left; } int tmp = searchID + m_left.GetGPNodeCount(); if (tmp >= searchID) { return m_left.FindNodeReferenceById(searchID, currentCount + 1); } tmp = searchID + m_left.GetGPDepth() + m_right.GetGPNodeCount(); if (tmp >= searchID) { return m_right.FindNodeReferenceById(searchID, currentCount + m_left.GetGPNodeCount() + 1); } return null; } }
[ "ande3171@gmail.com" ]
ande3171@gmail.com
1dcc57039244af9d6991ad136fe49d50f121a2f5
ee9beb6e06c2daf4bcd59304596ab0d798455bcd
/src/main/java/Annotations/Column.java
e4cc55731c5ef07949b8900e2f53b94f0fa6d66d
[]
no_license
210726-Enterprise/mORM_p1
97a670b104ded2a33305f99308f8e35de604a4f6
0d6bef93389195539a2c14834ede985804cdd898
refs/heads/master
2023-08-05T00:13:21.912561
2021-09-13T20:03:51
2021-09-13T20:03:51
396,989,959
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package Annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; //Annotation indicating a non-primary field @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface Column { String columnName(); }
[ "jacob.brummett@revature.net" ]
jacob.brummett@revature.net
8c2f0911f1fd0f3970e3d0afa8462e8d78f00c96
96d5ceb29c481643f79aa4ad7ea376a75d9daab0
/java/src/domain/FFDijkstra.java
0a5d6d36bb1995f02e97b8c5e6cc103230df28f0
[]
no_license
alexmorral/university
e261a425d12e243e6efcb4502e190f105bb2ab3c
837bee95a14ffeb663fcdf0e6052c82cd81f213e
refs/heads/master
2021-01-07T04:23:24.951681
2020-02-19T09:06:19
2020-02-19T09:06:19
241,575,628
0
0
null
null
null
null
UTF-8
Java
false
false
2,855
java
package domain; import java.util.ArrayList; import java.util.PriorityQueue; import java.util.Comparator; import java.util.Stack; import java.io.IOException; /** * @author Alex Morral */ class arcP { public double coste; public int id; } public class FFDijkstra<T> extends FordFulkerson<T> { /** * Creadora de la clase * @param nodeInicial * @param nodeDesti * @param graf * @return Una instancia de FFDijkstra */ public FFDijkstra(Integer nodeInicial, Integer nodeDesti, Graf<T> graf) { super(nodeInicial, nodeDesti, graf); } /** * @Pre: g es un grafo dirigido no vacío con pesos en las aristas. * @param Grafo graf a aplicar el algoritmo. * @return ArrayList con los id's de los nodos del camino de menor peso. Si no hay camino, ArrayList vacio. */ @Override public ArrayList<Integer> dameCamino(Graf<T> graf) throws IOException { //dist[u] : la longitud del camino más corto desde s hasta t //pred[u] predecesor de u en este camino try { int size = graf.getNSize(); ArrayList<Integer> camino = new ArrayList<Integer>(); int[] pred = new int[size]; for(int k = 0; k < size; k++){ pred[k] = -1; } double[] dist = new double[size]; for(int k = 0; k < size; k++){ dist[k] = Double.POSITIVE_INFINITY; } PriorityQueue<arcP> vertexQueue = new PriorityQueue<arcP>(1,new Comparator<arcP>() { public int compare(arcP p, arcP q) { if(p.coste > q.coste) return 1; if(p.coste < q.coste) return -1; return 0; } } ); arcP p = new arcP(); p.id = s; p.coste = 0.0; dist[s] = 0.0; vertexQueue.add(p); while (!vertexQueue.isEmpty()) { p = vertexQueue.poll(); ArrayList<Integer> neighbours = graf.getOutNodes(p.id); for(int neighbour : neighbours){ int arista = graf.getIDAresta(p.id, neighbour); //System.out.printf("Nodo Princ: %d , Nodo vecino: %d, ID Arista: %d\n", p.id, neighbour, arista); int capacidadArista = graf.getCapacidadAresta(arista); double costeArista = graf.getCosteAresta(arista); if(capacidadArista > 0) { double coste = dist[p.id]+costeArista; if(coste < dist[neighbour]){ dist[neighbour] = coste; pred[neighbour] = p.id; arcP q = new arcP(); q.id = neighbour; q.coste = coste; vertexQueue.add(q); } } } } Stack<Integer> cam = new Stack<Integer>(); int sig = t; if(size > 1 && pred[sig] != -1) { while(sig != s) { cam.push(sig); sig = pred[sig]; } cam.push(s); while(!cam.isEmpty()) { camino.add(cam.pop()); } } return camino; } catch (IOException e) { throw new IOException(e); } } }
[ "alexmorral@gmail.com" ]
alexmorral@gmail.com
948599016e116b6295ee6268071eac14d60327a6
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/hibernate-orm/2015/4/IndexConstraintSource.java
5106bc56bf72e1a684b2fcd28303237a557527b9
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
1,256
java
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2014, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.boot.model.source.spi; /** * Defining a index constraint source * * @author Brett Meyer */ public interface IndexConstraintSource extends ConstraintSource { public boolean isUnique(); }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
eb3851ab2684e536f79838adb30902c2fa0258d3
00cb9ae806aa2a688ac20285366ac4e005451c2d
/FLOWVISOR/src/org/flowvisor/message/FVMessageUtil.java
579e0e45328313d67d758a7a2b99e1b075baa6a7
[ "LicenseRef-scancode-other-permissive", "Apache-2.0" ]
permissive
routeflow/AutomaticConfigurationRouteFlow
e5073704fcaad93534028fcc69f3a60df0898881
002289a89781427654437ed03af05cc7bf06242a
refs/heads/master
2021-01-18T15:30:01.371871
2014-08-28T09:06:44
2014-08-28T09:06:44
17,318,900
0
1
null
null
null
null
UTF-8
Java
false
false
5,401
java
/** * */ package org.flowvisor.message; import java.util.ArrayList; import java.util.List; import org.flowvisor.FlowVisor; import org.flowvisor.classifier.FVClassifier; import org.flowvisor.classifier.XidPair; import org.flowvisor.classifier.XidTranslator; import org.flowvisor.events.FVEventHandler; import org.flowvisor.exceptions.ActionDisallowedException; import org.flowvisor.log.FVLog; import org.flowvisor.log.LogLevel; import org.flowvisor.message.actions.SlicableAction; import org.flowvisor.slicer.FVSlicer; import org.openflow.protocol.OFError; import org.openflow.protocol.OFMatch; import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFType; import org.openflow.protocol.OFError.OFBadActionCode; import org.openflow.protocol.OFError.OFBadRequestCode; import org.openflow.protocol.OFError.OFErrorType; import org.openflow.protocol.OFError.OFFlowModFailedCode; import org.openflow.protocol.OFError.OFPortModFailedCode; import org.openflow.protocol.action.OFAction; /** * @author capveg * */ public class FVMessageUtil { /** * Translate the XID of a message from controller-unique to switch unique * Also, record the <oldXid,FVSlicer> mapping so we can reverse this later * * @param msg * @param fvClassifier * @param fvSlicer */ static public void translateXid(OFMessage msg, FVClassifier fvClassifier, FVSlicer fvSlicer) { XidTranslator xidTranslator = fvClassifier.getXidTranslator(); int newXid = xidTranslator.translate(msg.getXid(), fvSlicer); msg.setXid(newXid); } /** * Undo the effect of translateXID, and return the FVSlicer this came from * * @param msg * @param fvClassifier * @return the fvSlicer that was input in the translate step or null if not * found */ static public FVSlicer untranslateXid(OFMessage msg, FVClassifier fvClassifier) { XidTranslator xidTranslator = fvClassifier.getXidTranslator(); XidPair pair = xidTranslator.untranslate(msg.getXid()); if (pair == null) return null; msg.setXid(pair.getXid()); String sliceName = pair.getSliceName(); return fvClassifier.getSlicerByName(sliceName); } /** * Is this slice allowed to use this list of actions with this ofmatch * structure? * * Return a (potentially edited) list of actions or throw an exception if * not allowed * * @param actionList * @param match * inPort is encapsulated in the match * @param fvClassifier * @param fvSlicer * @return A list of actions the slice is actually allowed to send * @throws ActionDisallowedException */ static public List<OFAction> approveActions(List<OFAction> actionList, OFMatch match, FVClassifier fvClassifier, FVSlicer fvSlicer) throws ActionDisallowedException { List<OFAction> approvedList = new ArrayList<OFAction>(); if (actionList == null) return null; for (OFAction action : actionList) ((SlicableAction) action).slice(approvedList, match, fvClassifier, fvSlicer); return approvedList; } public static short countActionsLen(List<OFAction> actionsList) { short count = 0; for (OFAction act : actionsList) count += act.getLength(); return count; } public static void translateXidAndSend(OFMessage msg, FVClassifier fvClassifier, FVSlicer fvSlicer) { FVMessageUtil.translateXid(msg, fvClassifier, fvSlicer); fvClassifier.sendMsg(msg, fvSlicer); } public static void dropUnexpectedMesg(OFMessage msg, FVEventHandler handler) { FVLog.log(LogLevel.WARN, handler, "dropping unexpected msg: " + msg); } public static void untranslateXidAndSend(OFMessage msg, FVClassifier fvClassifier) { FVSlicer fvSlicer = FVMessageUtil.untranslateXid(msg, fvClassifier); if (fvSlicer == null) { FVLog.log(LogLevel.WARN, fvClassifier, "dropping msg with unknown xid: " + msg); return; } FVLog.log(LogLevel.DEBUG, fvSlicer, "sending to controller: " + msg); fvSlicer.sendMsg(msg, fvClassifier); } public static OFMessage makeErrorMsg(OFFlowModFailedCode code, OFMessage msg) { OFError err = (OFError) FlowVisor.getInstance().getFactory() .getMessage(OFType.ERROR); err.setErrorType(OFErrorType.OFPET_FLOW_MOD_FAILED); err.setErrorCode(code); err.setOffendingMsg(msg); return err; } public static OFMessage makeErrorMsg(OFPortModFailedCode code, OFMessage msg) { OFError err = (OFError) FlowVisor.getInstance().getFactory() .getMessage(OFType.ERROR); err.setErrorType(OFErrorType.OFPET_PORT_MOD_FAILED); err.setErrorCode(code); err.setOffendingMsg(msg); return err; } public static OFMessage makeErrorMsg(OFBadRequestCode code, OFMessage msg) { OFError err = (OFError) FlowVisor.getInstance().getFactory() .getMessage(OFType.ERROR); err.setErrorType(OFErrorType.OFPET_BAD_REQUEST); err.setErrorCode(code); err.setOffendingMsg(msg); return err; } public static OFMessage makeErrorMsg(OFBadActionCode code, OFMessage msg) { OFError err = (OFError) FlowVisor.getInstance().getFactory() .getMessage(OFType.ERROR); err.setErrorType(OFErrorType.OFPET_BAD_ACTION); err.setErrorCode(code); err.setOffendingMsg(msg); return err; } public static String actionsToString(List<OFAction> actions) { if ((actions == null) || (actions.size() == 0)) return "DROP"; String ret = ""; for (OFAction action : actions) { if (!ret.equals("")) ret += ","; ret += action.toString(); } return ret; } }
[ "sachin@burton.(none)" ]
sachin@burton.(none)
3cae5a834f75bb31d97e4a14524c28aed9310f59
354495090297d32ec434f42f272c79345efb781e
/src/Embed/EmbedListModel.java
f2b04ed8aec4f97d9c7284797cf96a9ec48e0398
[ "MIT" ]
permissive
acdwisu/SWTA
a68a933af6e2d8031d005b5efccb9b7136b7f42a
cb482370d164ec20dc10cc927b6aa21e2b928d85
refs/heads/master
2023-07-11T07:02:50.388884
2023-06-30T17:21:18
2023-06-30T17:21:18
130,796,386
0
0
null
null
null
null
UTF-8
Java
false
false
1,094
java
/* * Copyright (C) 2018 acdwisu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package Embed; import java.util.List; import javax.swing.DefaultListModel; /** * * @author acdwisu */ public class EmbedListModel extends DefaultListModel { /** * * @param list */ public EmbedListModel(List<String> list) { list.forEach((x) -> { this.addElement(x); }); } }
[ "achmaddwisuriyanto@gmail.com" ]
achmaddwisuriyanto@gmail.com
f989cec58e0fa9b3021005697aee884abd6adfaf
e1a36b8e2bdc038b4a3121706d441d0bb42ce1c5
/18 Feb 2020/DailyScriptsAPIs_Demoloyalty/ValidateOTP.java
b30f9f952e968c8433e2eaa512755ed17cfb875c
[]
no_license
parasjitaliya/javamavenapp
edb598b26121510b6186d768c5674451e7bc4956
6fd5a78afd3b7b969fa0fc0f1a8f3d2f04e0118c
refs/heads/master
2022-12-11T05:29:03.754398
2020-09-02T06:52:51
2020-09-02T06:52:51
290,807,816
0
0
null
null
null
null
UTF-8
Java
false
false
4,486
java
package DailyScriptsAPIs_Demoloyalty; import java.io.File; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.TimeUnit; import javax.swing.JOptionPane; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.Select; import org.testng.annotations.Test; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import com.relevantcodes.extentreports.LogStatus; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; public class ValidateOTP { public String MasterData="DemoloyaltyAPIExcels/MasterData.xls"; public WebDriver driver; public Workbook wb; public Sheet s; File f; String JSONtag; public String otp; public ExtentReports report=new ExtentReports("ExtentReports/Demoloyalty/39.html"); public ExtentTest logger =report.startTest("ValidateOTP"); DateFormat df=new SimpleDateFormat("dd MMM YYYY"); Date d=new Date(); String time=df.format(d); @Test public void wsValidateOTP() throws IOException, BiffException { f=new File(MasterData); wb = Workbook.getWorkbook(f); s=wb.getSheet(0); System.setProperty("webdriver.chrome.driver","/home/harish/Harish/Jar files/chromedriver_linux64 (3)/chromedriver"); driver=new ChromeDriver(); driver.manage().timeouts().implicitlyWait(20l, TimeUnit.SECONDS); for (int i = 1; i < 10; i++) { driver.get("http://demoloyalty.erlpaas.com/apiui/"); driver.manage().window().maximize(); Select dropdown= new Select(driver.findElement(By.xpath("//*[@id='ddlSelectMethods']"))); dropdown.selectByVisibleText("wsValidateOTP"); Actions a=new Actions(driver); a.sendKeys(Keys.TAB,"{").build().perform(); a.sendKeys(Keys.ENTER,"\"Request\":").build().perform(); a.sendKeys(Keys.INSERT,"{").build().perform(); f=new File("DemoloyaltyAPIExcels/Reuse.xls"); wb = Workbook.getWorkbook(f); s=wb.getSheet(0); a.sendKeys(Keys.ENTER,"\"RequestID\":").build().perform(); a.sendKeys(Keys.INSERT,"\""+s.getCell(5,i).getContents()+"\"").build().perform(); a.sendKeys(Keys.INSERT,",").build().perform(); f=new File(MasterData); wb = Workbook.getWorkbook(f); s=wb.getSheet(0); a.sendKeys(Keys.ENTER,"\"UserName\":").build().perform(); a.sendKeys(Keys.INSERT,"\""+s.getCell(0,1).getContents()+"\"").build().perform(); a.sendKeys(Keys.INSERT,",").build().perform(); a.sendKeys(Keys.ENTER,"\"SecurityToken\":").build().perform(); a.sendKeys(Keys.INSERT,s.getCell(1,1).getContents()).build().perform(); a.sendKeys(Keys.INSERT,",").build().perform(); a.sendKeys(Keys.ENTER,"\"CountryCode\":").build().perform(); a.sendKeys(Keys.INSERT,s.getCell(3,1).getContents()).build().perform(); a.sendKeys(Keys.INSERT,",").build().perform(); a.sendKeys(Keys.ENTER,"\"MemberID\":").build().perform(); a.sendKeys(Keys.INSERT,s.getCell(4,1).getContents()).build().perform(); a.sendKeys(Keys.INSERT,",").build().perform(); try { otp=JOptionPane.showInputDialog("Enter OTP"); } catch (Exception e) { // TODO: handle exception } a.sendKeys(Keys.ENTER,"\"OTP\":").build().perform(); a.sendKeys(Keys.INSERT,"\""+otp+"\"").build().perform(); a.sendKeys(Keys.ENTER,"}").build().perform(); a.sendKeys(Keys.ENTER,"}").build().perform(); driver.findElement(By.xpath("//*[@id='btnSubmit']")).click(); File src=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(src, new File("screenshots/Demoloyalty/39."+i+".png")); String JSONresponse=driver.findElement(By.xpath("//*[@id='txtResponse']")).getText(); System.out.println(JSONresponse); if(JSONresponse.contains("Success")){ System.out.println("Pass"); logger.log(LogStatus.PASS,"Response is Success",logger.addScreenCapture("screenshots/Demoloyalty/39."+i+".png")); } else{ System.out.println("Fail"); logger.log(LogStatus.FAIL ,"Failed",logger.addScreenCapture("screenshots/Demoloyalty/39."+i+".png")); } report.endTest(logger); report.flush(); } } }
[ "parasjitaliya@gmail.com" ]
parasjitaliya@gmail.com
42ffc9fa007cd1b5f32a7e25f6e04cf0f4a267c1
cda820560738cbaee83e50c4a16da44bd98741ff
/spring-boot-rabbitmq/src/main/java/com/william/mq/spring_boot/config/RabbitMQConfig.java
826ae1654be678e833aa35f20e1c3d9972d4bf05
[]
no_license
dwj1979/spring-boot-super-samples
d610c79e01132c7ad44beb0fc535e514bd6b668c
a411e04a05c1f547cc361172c13ac789d4d4fac4
refs/heads/master
2021-05-11T10:24:36.624821
2017-12-05T10:09:30
2017-12-05T10:09:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
442
java
package com.william.mq.spring_boot.config; import org.springframework.amqp.core.Queue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Created by sungang on 2017/11/30. */ @Configuration public class RabbitMQConfig { public static final String QUEUE_NAME = "spring-boot-simple"; @Bean public Queue queue() { return new Queue(QUEUE_NAME); } }
[ "1120sungang@gmail.com" ]
1120sungang@gmail.com
97e1c990347d813c5c87109aed6d27b72b756304
3ca616a4f6d4957e259822daad7b7e07af4d450f
/day-7-iterator/src/foo/bar/iterator/IContainer.java
db67f70708b7611d8e058cf79c85ad91e1b4a57f
[]
no_license
ValkSam/patterns-gof
89dfaa940b370533b1597bc4751daed36576a4c8
fe715024baf9574135b3619450ec87206577056c
refs/heads/master
2021-01-12T05:00:02.282697
2017-01-02T10:53:15
2017-01-02T10:53:15
77,826,511
0
0
null
null
null
null
UTF-8
Java
false
false
99
java
package foo.bar.iterator; public interface IContainer { public IIterator createIterator(); }
[ "do110473sva@gmail.com" ]
do110473sva@gmail.com
3ccf2e639c88802a29fd80d1bd167ac22435f3f7
7b99c656bfcb6c3ae4359df8799832c17954b567
/multi-view-adapter/src/main/java/com/ahamed/multiviewadapter/DataGroupManager.java
e1de5effb3351b54a3060ac11039a69fa272f54e
[ "Apache-2.0" ]
permissive
icostel/MultiViewAdapter
9720971c075c582e05cde2fc0a2e87f52ab5faa9
8c5aaac197d735a4c4450d91362e4a276b069830
refs/heads/v1
2020-04-04T11:27:49.079093
2018-09-26T06:29:07
2018-09-26T06:29:07
155,891,774
1
0
Apache-2.0
2018-11-02T16:18:28
2018-11-02T16:18:27
null
UTF-8
Java
false
false
9,837
java
/* * Copyright 2017 Riyaz Ahamed * * 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.ahamed.multiviewadapter; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import com.ahamed.multiviewadapter.util.PayloadProvider; import java.util.Collection; import java.util.List; /** * DataGroupManger is a section of items with a header and items. It supports group level expansion * and collapsing * * @param <H> Refers to the header model * @param <M> Refers to the item model */ public class DataGroupManager<H, M> extends DataListUpdateManager<M> { private final DataItemManager<H> headerItemManager; private boolean isExpanded = false; public DataGroupManager(RecyclerAdapter adapter, H headerItem) { super(adapter); headerItemManager = new DataItemManager<>(adapter, headerItem); } public DataGroupManager(RecyclerAdapter adapter, H headerItem, @NonNull PayloadProvider<M> payloadProvider) { super(adapter, payloadProvider); headerItemManager = new DataItemManager<>(adapter, headerItem); } @Override void onGroupExpansionToggled() { isExpanded = !isExpanded; if (isExpanded) { onInserted(1, getDataList().size()); } else { onRemoved(1, getDataList().size()); } } BaseDataManager getDataManagerForPosition(int itemPositionInManager) { if (itemPositionInManager == 0) { return headerItemManager; } else { return this; } } @Override M getItem(int dataItemPosition) { return super.getItem(dataItemPosition - 1); } @Override int size() { return headerItemManager.size() + (isExpanded ? super.size() : 0); } @Override int getSelectedIndex() { int selectedPosition = super.getSelectedIndex(); if (selectedPosition < 0) { return selectedPosition; } return selectedPosition + 1; } public boolean isExpanded() { return isExpanded; } public void setExpanded(boolean expanded) { isExpanded = expanded; } /** * Set header to the section. This will call the necessary {@link * RecyclerView.ItemAnimator}'s animation. * * @param item item to be added as header. */ public final void setItem(M item) { if (getDataList().size() == 0) { getDataList().add(item); onInserted(0, 1); } else { getDataList().set(0, item); onChanged(0, 1, null); } } /** * Removes the entire group from the adapter. This will call the {@link * RecyclerView.ItemAnimator}'s remove animation. */ public final void removeGroup() { if (getDataList().size() > 0) { clear(); } headerItemManager.removeItem(); } /** * Appends the specified element to the end of {@link DataGroupManager}. Also calls {@link * RecyclerView.ItemAnimator}'s add animation. * * @param item element to be appended to this list * @return <tt>true</tt> (as specified by {@link Collection#add}) * @throws UnsupportedOperationException if the <tt>add</tt> operation * is not supported by this {@link DataGroupManager} */ public final boolean add(M item) { boolean result = add(item, false); if (result && isExpanded) { onInserted(getDataList().size(), 1); } return result; } /** * Appends all of the elements in the specified collection to the end of * this {@link DataGroupManager}, in the order that they are returned by the specified * collection's iterator (optional operation). The behavior of this * operation is undefined if the specified collection is modified while * the operation is in progress. (Note that this will occur if the * specified collection is this list, and it's nonempty.) Also calls {@link * RecyclerView.ItemAnimator}'s add animation. * * @param items collection containing elements to be added to this list * @return <tt>true</tt> if this list changed as a result of the call * @throws UnsupportedOperationException if the <tt>addAll</tt> operation * is not supported by this {@link DataGroupManager} * @see #add(Object) */ public final boolean addAll(@NonNull Collection<? extends M> items) { boolean result = addAll(items, false); if (result && isExpanded) { onInserted(getDataList().size() - items.size() + 1, items.size()); } return result; } /** * Inserts all of the elements in the specified collection into this * data manager at the specified position (optional operation). Shifts the * element currently at that position (if any) and any subsequent * elements to the right (increases their indices). The new elements * will appear in this list in the order that they are returned by the * specified collection's iterator. The behavior of this operation is * undefined if the specified collection is modified while the * operation is in progress. Also calls {@link * RecyclerView.ItemAnimator}'s add animation. * * @param index index at which to insert the first element from the * specified collection * @param items collection containing elements to be added to this list * @return <tt>true</tt> if this data manager changed as a result of the call * @throws UnsupportedOperationException if the <tt>addAll</tt> operation * is not supported by this data manager */ public final boolean addAll(int index, @NonNull Collection<? extends M> items) { boolean result = addAll(index, items, false); if (isExpanded) { onInserted(index + 1, items.size()); } return result; } /** * Inserts the specified element at the specified position in this data manger * (optional operation). Shifts the element currently at that position * (if any) and any subsequent elements to the right (adds one to their * indices). Also calls {@link * RecyclerView.ItemAnimator}'s add animation. * * @param index index at which the specified element is to be inserted * @param item element to be inserted * @throws UnsupportedOperationException if the <tt>add</tt> operation * is not supported by this data manger * @throws IndexOutOfBoundsException if the index is out of range * (<tt>index &lt; 0 || index &gt; size()</tt>) */ public final void add(int index, M item) { add(index, item, false); if (isExpanded) { onInserted(index + 1, 1); } } /** * Replaces the element at the specified position in this data manager with the * specified element (optional operation). Also calls necessary {@link * RecyclerView.ItemAnimator}'s animation with payload. * * @param index index of the element to replace * @param item element to be stored at the specified position * @throws UnsupportedOperationException if the <tt>set</tt> operation * is not supported by this data manager * @throws IndexOutOfBoundsException if the index is out of range * (<tt>index &lt; 0 || index &gt;= size()</tt>) */ public final void set(int index, M item) { M oldItem = getDataList().get(index); set(index, item, false); if (isExpanded) { onChanged(index + 1, 1, payloadProvider.getChangePayload(oldItem, item)); } } /** * Replaces the data list in this data manager with the new list. Also calls necessary {@link * RecyclerView.ItemAnimator}'s animation with payload. * * @param dataList list to be stored in the data manager */ public final void set(List<M> dataList) { set(dataList, isExpanded); } /** * Removes the first occurrence of the specified element from this data manager, * if it is present (optional operation). If this data manager does not contain * the element, it is unchanged. More formally, removes the element with * the lowest index <tt>i</tt> such that * <tt>(item==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;item.equals(get(i)))</tt> * (if such an element exists). If the data manager contained the element the element is removed * and {@link RecyclerView.ItemAnimator}'s remove animation will be called. * * @param item element to be removed from this data manager, if present */ public final void remove(M item) { int index = getDataList().indexOf(item); boolean result = getDataList().remove(item); if (result && isExpanded) { onRemoved(index + 1, 1); } } /** * Removes the element at the specified position in this list (optional operation). Shifts any * subsequent elements to the left (subtracts one from their indices). If the element is removed * {@link RecyclerView.ItemAnimator}'s remove animation will be called. * * @param index the index of the element to be removed * @throws IndexOutOfBoundsException if the index is out of range * (<tt>index &lt; 0 || index &gt;= size()</tt>) */ public final void remove(int index) { remove(index, false); if (isExpanded) { onRemoved(index + 1, 1); } } /** * Removes all of the elements from this data manager (optional operation). * The data manager will be empty after this call returns. After the elements are removed * {@link RecyclerView.ItemAnimator}'s remove animation will be called. */ public final void clear() { int oldSize = getDataList().size(); clear(false); if (isExpanded) { onRemoved(1, oldSize); } } }
[ "dev.ahamed@gmail.com" ]
dev.ahamed@gmail.com
1076f9f855281618b9b6b46cad7954ca96e69cbe
fcb86f6e0e889605e5c03cd7149e0b2e168c780a
/src/serverhttp/MainServer.java
4c6f00211fc834d08da9dce1f43e3454c49e5ea3
[]
no_license
FranciscoNeff/ppt1819_practica3_g07
017c1779990cfa3c4e8752d807740511f5009d42
cae3c75620432e0f20076e885cc0357359a872ba
refs/heads/master
2020-04-08T15:37:22.615412
2019-01-11T19:32:50
2019-01-11T19:32:50
159,485,851
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,347
java
package serverhttp; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.UnknownHostException; import java.util.logging.Level; import java.util.logging.Logger; public class MainServer { static ServerSocket server= null; public static void main(String[] args) { try { InetAddress serveraddr=InetAddress.getLocalHost(); //consigue la ip del equipo server= new ServerSocket (90,5,serveraddr); //servidor puerto XXX(uno libre), 5 conexiones máximas,ip equipo System.out.println("Server waiting for HTTP connections at "+serveraddr.toString()); while(true){ Socket s=server.accept(); HttpConnection conn = new HttpConnection(s); new Thread(conn).start();//el recolecto de basura de java elemina las instancias en memoria//Garbage Collector } } catch (UnknownHostException ex) { Logger.getLogger(MainServer.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(MainServer.class.getName()).log(Level.SEVERE, null, ex); } } }
[ "Corgi@CORGI-PORTATIL" ]
Corgi@CORGI-PORTATIL
1b6931af37f8128860a4a6cef222843006ca786d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_6935e0cbbef38d0b164cbc77cdb6fceaf4034845/RestriccioTemps/2_6935e0cbbef38d0b164cbc77cdb6fceaf4034845_RestriccioTemps_s.java
a90b2b8147d1b5aba1a1a6d5ca9379b66d359bda
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
823
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Domini; import java.util.ArrayList; /** * * @author Daniel Albarral */ public class RestriccioTemps { private ArrayList<Integer> dilluns; private ArrayList<Integer> dimarts; private ArrayList<Integer> dimecres; private ArrayList<Integer> dijous; private ArrayList<Integer> divendres; private ArrayList<Integer> dissabte; private ArrayList<Integer> diumenge; /** * * @return Arraylist amb tots els dies i hores disponibles L->dia, R->hora */ public ArrayList<Pair<String,Integer>> disponibilitat(){ ArrayList<Pair<String,Integer>> disponibilitat = new ArrayList(); return disponibilitat; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4b6736ed6b32df27b53ed6dcb188bdd04b44415e
cb38df9e831252a0c263d925c4580c3571058062
/Finding the K'th largest number/Main.java
24ec6d88a99323f0a08e813416dc3f8e8210a97a
[]
no_license
Mowlika99/Playground
a9e8de88faecdb0990d586e3c42302874847e45e
250eca6a791a011f3d5d0beeca0d86a48364e130
refs/heads/master
2020-05-19T11:17:07.241834
2019-07-28T11:57:20
2019-07-28T11:57:20
184,988,748
0
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
import java.util.Scanner; class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int arr[] = new int[n]; for(int idx = 0; idx <= n - 1; idx++){ arr[idx] = sc.nextInt(); } int k = sc.nextInt(); // Sorting the given array and printing the kth largest number selection_sort(n, arr); System.out.println(arr[n-k]); } public static void selection_sort(int n, int arr[]){ for(int start_idx = 0; start_idx <= n - 2; start_idx++) { int min_idx = find_minimun_idx(start_idx, arr, n-1); swap(start_idx, min_idx, arr); } } public static void swap(int start_idx, int min_idx, int arr[]){ int temp = arr[start_idx]; arr[start_idx] = arr[min_idx]; arr[min_idx] = temp; } public static int find_minimun_idx(int start_idx, int arr[], int end_idx){ int min_idx = 0; if(arr[start_idx] < arr[start_idx + 1]) { min_idx = start_idx; } else{ min_idx = start_idx + 1; } for(int i = start_idx + 2; i <= end_idx; i++){ if(arr[min_idx] > arr[i]) { min_idx = i; } } return min_idx; }}
[ "50285831+Mowlika99@users.noreply.github.com" ]
50285831+Mowlika99@users.noreply.github.com
d179923eaa179eaae0f970f9cdc033965f1a1233
be3434872306571775a1482d56fb4a6d11164271
/src/test/java/com/banjjoknim/book/springboot/web/dto/HelloResponseDtoTest.java
71da4aeb72f554e4d5d461fc931e6642192988b6
[]
no_license
banjjoknim/SpringBootWebService
9d4ce8257e8fae10cd94f8f846627f75a90f2831
ea02a222802cecd99dec2eed9cf5bcd9537bd3b5
refs/heads/master
2023-01-23T21:53:15.056361
2020-12-06T13:04:22
2020-12-06T13:59:05
318,143,645
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package com.banjjoknim.book.springboot.web.dto; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; public class HelloResponseDtoTest { @Test public void 롬복_기능_테스트() { // given String name = "test"; int amount = 1000; // when HelloResponseDto dto = new HelloResponseDto(name, amount); // then assertThat(dto.getName()).isEqualTo(name); assertThat(dto.getAmount()).isEqualTo(amount); } }
[ "zhfxmtkachdt@daum.net" ]
zhfxmtkachdt@daum.net
be0ff413570fe931cc1894dc2ea781af974052df
e8cd24201cbfadef0f267151ea5b8a90cc505766
/group11/729245768/DataStructure/src/main/coding_170507/TwoStackInOneArray.java
051d54e1d888840b6448a6e5b69b73935e6fe7dd
[]
no_license
XMT-CN/coding2017-s1
30dd4ee886dd0a021498108353c20360148a6065
382f6bfeeeda2e76ffe27b440df4f328f9eafbe2
refs/heads/master
2021-01-21T21:38:42.199253
2017-06-25T07:44:21
2017-06-25T07:44:21
94,863,023
0
0
null
null
null
null
UTF-8
Java
false
false
1,850
java
package main.coding_170507; import java.util.EmptyStackException; /** * 用一个数组实现两个栈 * 将数组的起始位置看作是第一个栈的栈底,将数组的尾部看作第二个栈的栈底,压栈时,栈顶指针分别向中间移动,直到两栈顶指针相遇,则扩容。 */ public class TwoStackInOneArray { Object[] data = new Object[10]; private int start = 0; private int end = data.length-1; /** * 向第一个栈中压入元素 * * @param o */ public void push1(Object o) { if(start==end){ throw new RuntimeException("栈满"); } data[start++] = o; } /** * 从第一个栈中弹出元素 * * @return */ public Object pop1() { if(start==0){ throw new EmptyStackException(); } return data[--start]; } /** * 获取第一个栈的栈顶元素 * * @return */ public Object peek1() { if(start==0){ throw new EmptyStackException(); } return data[start-1]; } /* * 向第二个栈压入元素 */ public void push2(Object o) { if(start==end){ throw new RuntimeException("栈满"); } data[end--] = o; } /** * 从第二个栈弹出元素 * * @return */ public Object pop2() { if(end==data.length-1){ throw new EmptyStackException(); } return data[++end]; } /** * 获取第二个栈的栈顶元素 * * @return */ public Object peek2() { if(end==data.length-1){ throw new EmptyStackException(); } return data[end+1]; } }
[ "542194147@qq.com" ]
542194147@qq.com
d3fe13f486bbf4aefc56232032651cd3e4e512f2
fc00f7e354acd68459b8be7c0679200bcb0526df
/change/app/src/androidTest/java/com/example/mingdao/change/ApplicationTest.java
06155ed2ede13eafe7c80fcdbd60f1ae7bab6a16
[]
no_license
mcnuggest/xavier
acc2e05c22738f157d5f439e04114056fd0716b0
fa17e92f423c78ad25ef2ec03c0b86610bcac69f
refs/heads/master
2016-08-03T20:41:51.699058
2015-08-03T01:22:54
2015-08-03T01:22:54
39,365,537
1
0
null
null
null
null
UTF-8
Java
false
false
357
java
package com.example.mingdao.change; 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); } }
[ "545467834@qq.com" ]
545467834@qq.com
b2bd85b5eddc506829e0ddffb9bcc34dce8e7993
5a2c164a25e42a3e6ad6eb4b8c3858f3200595b6
/app/src/main/java/com/cohajj/app/MainActivity.java
96fad3bd12207a290df09c23cb17809c9ba06a78
[]
no_license
mfkasim/hajj-hackathon
639a6d4e4137751b3f4d5c52cacdc8d3731321d8
1f2216e60b0cc313ab99ff925fb82e98c61286d4
refs/heads/master
2020-03-25T03:53:57.785132
2018-08-03T02:22:52
2018-08-03T02:22:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
327
java
package com.cohajj.app; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "mfarouk@edafa.com" ]
mfarouk@edafa.com
777f7d36dabe87f4b751d08020f9695c27638943
9f004c3df4413eb826c229332d95130a1d5c8457
/src/suchita/Assignment_1.java
ed79eb278f3222cde96e431e59ff66c36ddc0031
[]
no_license
MayurSTechnoCredit/JAVATechnoJuly2021
dd8575c800e8f0cac5bab8d5ea32b25f7131dd0d
3a422553a0d09b6a99e528c73cc2b8efe260a07a
refs/heads/master
2023-08-22T14:43:37.980748
2021-10-16T06:33:34
2021-10-16T06:33:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
133
java
package suchita; public class Assignment_1 { public static void main(String[] args) { System.out.println("Hellow World!"); } }
[ "harshhpatel07@gmail.com" ]
harshhpatel07@gmail.com
d0fd150030dd04380983a408812d7595236e7d98
14e19bd43b9f5032c1b912ce0f7d1d54c566513b
/gof23/iterator/Container.java
f1dd8b10c3b65baded380f3d0e8a68b5a05e0284
[]
no_license
Changemcfeng/DesignPatterns
f8a0322beb30610436db6aab8d36871df2250a72
3893a5e3dfa8379a7baf763764022c00fc2cca3c
refs/heads/master
2023-02-13T03:52:55.818241
2020-12-30T13:00:01
2020-12-30T13:00:01
325,545,069
0
0
null
null
null
null
UTF-8
Java
false
false
157
java
package com.example.reidsspringboot.gof23.iterator; /** * The triangle is the most balanced */ public interface Container { Iterator getIterator(); }
[ "1234567890@qq.com" ]
1234567890@qq.com
2275d814ec2983bdedb20f6c86e9549f4532aecc
906275798ed0ab17495dbf1f31759845818daa81
/src/main/java/org/jukeboxmc/item/ItemRepeatingCommandBlock.java
7d45599aa104bb021cee337f995398e4f10bbdda
[]
no_license
yequid/JukeboxMC
c7995034bc5bd55280e3bf96b765eddacbe08e8f
8a53fc2bed231d0872699d6efa88ef843a74001b
refs/heads/master
2023-02-15T05:45:12.260350
2021-01-07T15:00:24
2021-01-07T15:00:24
326,658,755
0
0
null
2021-01-07T15:00:25
2021-01-04T11:15:15
Java
UTF-8
Java
false
false
240
java
package org.jukeboxmc.item; /** * @author LucGamesYT * @version 1.0 */ public class ItemRepeatingCommandBlock extends Item { public ItemRepeatingCommandBlock() { super( "minecraft:repeating_command_block", 188 ); } }
[ "beckerluca16@gmail.com" ]
beckerluca16@gmail.com
fd653410bd15eb09d43a54345df457d9d9cee5b3
27fc30713278d4e90807fce129f166873aec8ec0
/Classes.java
d38260d416258bb945faac796adaf487c88f92a7
[]
no_license
DCMAM/javaII_OnlineAssignmentDay1
3c2a8b40e13129acb2adfc20f9b14ab116bc783e
88aab509ca236d612bf5789f01f6c6e43c47da0d
refs/heads/main
2023-04-25T03:57:53.271616
2021-05-04T13:08:09
2021-05-04T13:08:09
364,259,171
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
package java2H1; public class Classes { String classCode, courseCode, courseName; public Classes(String classCode, String courseCode, String courseName) { super(); this.classCode = classCode; this.courseCode = courseCode; this.courseName = courseName; } public String getClassCode() { return classCode; } public void setClassCode(String classCode) { this.classCode = classCode; } public String getCourseCode() { return courseCode; } public void setCourseCode(String courseCode) { this.courseCode = courseCode; } public String getCourseName() { return courseName; } public void setCourseName(String courseName) { this.courseName = courseName; } }
[ "noreply@github.com" ]
noreply@github.com
7222378994780a2ba15c96405a3ddbb01ce54bbf
c17ff95381f9f6d29b02da9593cf7d7695e80030
/src/main/java/com/rest/school/repository/ClassroomRepository.java
4366ec6e7ab2989768da40bbd7adaeb6e1cca987
[]
no_license
meliksahozceyhan/Spring-REST-API-Example
ca4771ee9abfc61b60189e6aed0be5b3a2c5bf06
e05197fade16094a5869416e7a6db6f26489cb21
refs/heads/master
2022-11-17T03:30:29.081858
2020-07-10T13:11:06
2020-07-10T13:11:06
276,892,919
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package com.rest.school.repository; import com.rest.school.model.Classroom; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface ClassroomRepository extends JpaRepository<Classroom,Integer>{ }
[ "52197329+IsinlaBiziSkati@users.noreply.github.com" ]
52197329+IsinlaBiziSkati@users.noreply.github.com
8a36664ba9f153e33b3fca010fd54419e5401dcc
6af9e38ff717c93aac3617f71b280bbaddba76e2
/src/main/java/com/product/app/exception/ResponseError.java
2d0f9d30c49cfea2a7a8ee6e6de225f51d7baa20
[]
no_license
Java-By-Rajbhar/OnlineProductManagement
85c07ea62fb2e201960845458040b46781acd378
cd77d98d8a881f2ab79dd7293c512c53f01be3fe
refs/heads/master
2020-07-21T16:06:25.111726
2019-08-28T12:22:37
2019-08-28T12:22:37
206,916,930
0
0
null
null
null
null
UTF-8
Java
false
false
305
java
package com.product.app.exception; import lombok.Getter; import lombok.Setter; @Getter @Setter public class ResponseError { private String message; private Integer statusCode; public ResponseError(String message, Integer statusCode) { this.message = message; this.statusCode = statusCode; } }
[ "sushilrajbhar2019@gmail.com" ]
sushilrajbhar2019@gmail.com
680c71d77d4384c04dc37e891ffe2b7fa0753dd9
25b34d7182a5fe2804e05e8b94a43a7d3b71e54f
/Roeslan.javacoder/src/com/xsis/entity/Employee.java
df309fd435457722559ae0cd32b0268625a03858
[]
no_license
Ruslanalif/Coder
dd0aba4bcbaeeb2675aaa801fc3f22197de626b4
d33df6e8a7e3bea2e26b171657a19827ee0f5dbc
refs/heads/master
2021-01-01T03:59:00.999454
2017-07-19T10:27:52
2017-07-19T10:27:52
97,098,546
0
0
null
null
null
null
UTF-8
Java
false
false
1,159
java
package com.xsis.entity; public class Employee { // pendeklarasian objek private int id; private String name; private String address; private Double salary; private String no_hp; // Constructor public Employee() { // TODO Auto-generated constructor stub } // GENERATE GETTERS & SETTERS 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 String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public Double getSalary() { return salary; } public void setSalary(Double salary) { this.salary = salary; } public String getNo_hp() { return no_hp; } public void setNo_hp(String no_hp) { this.no_hp = no_hp; } // GENERATE CONSTRUCTOR USING FIELDS public Employee(int id, String name, String address, Double salary, String no_hp) { super(); this.id = id; this.name = name; this.address = address; this.salary = salary; this.no_hp = no_hp; } }
[ "Ruslan@10.8.106.28" ]
Ruslan@10.8.106.28
e817b5db29f3ac243598154dfbb81f027691fc68
10329828eee46a4bc5064b25ec5c0d77b710570b
/src/main/bignner/contest122/C_GetAC3.java
8905238a29baf012b152591a81c13aad310ba121
[]
no_license
NaotoWada/AtCoder
089a6c5e9bae1fd92802c44da98f139a48a15b78
2b5ead78065392be683ef251d46cf1e27c5d623d
refs/heads/master
2020-08-05T16:33:14.464446
2019-11-30T15:04:38
2019-11-30T15:04:38
212,615,615
0
0
null
null
null
null
UTF-8
Java
false
false
1,225
java
package main.bignner.contest122; import java.util.Scanner; public class C_GetAC3 { public static void main(String[] args) { // シミュレーション // 累積和の数え上げ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int Q = Integer.parseInt(sc.next()); String S = sc.next(); // query int[][] lr = new int[Q][2]; for (int i = 0; i < Q; i++) { lr[i][0] = Integer.parseInt(sc.next()); lr[i][1] = Integer.parseInt(sc.next()); } solve(N, Q, S, lr); } static void solve(int n, int q, String s, int[][] lr) { int[] t = new int[n]; for (int i = 0; i < n - 1; i++) { int add = s.substring(i, i + 2).equals("AC") ? 1 : 0; // 累積和でl-rの区間の出現数をカウントできるようにする t[i + 1] = t[i] + add; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < q; i++) { int l = lr[i][0]; int r = lr[i][1]; sb.append(t[r - 1] - t[l - 1]); sb.append("\n"); } System.out.println(sb.toString()); } }
[ "naoto.cot25@gmail.com" ]
naoto.cot25@gmail.com
338011ec8aba04488d80e4d51b07a476266621f1
e3a09a1c199fb3e32d1e43c1393ec133fa34ceab
/game/data/scripts/handlers/skillconditionhandlers/OpNotTerritorySkillCondition.java
0b4e6e9873bd60bcca77490f78fa8f8d92ce60d3
[]
no_license
Refuge89/l2mobius-helios
0fbaf2a11b02ce12c7970234d4b52efa066ef122
d1251e1fb5a2a40925839579bf459083a84b0c59
refs/heads/master
2020-03-23T01:37:03.354874
2018-07-14T06:52:51
2018-07-14T06:52:51
140,927,248
1
0
null
2018-07-14T07:49:40
2018-07-14T07:49:39
null
UTF-8
Java
false
false
1,267
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; public class OpNotTerritorySkillCondition implements ISkillCondition { public OpNotTerritorySkillCondition(StatsSet params) { } @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { return true; // TODO: } }
[ "conan_513@hotmail.com" ]
conan_513@hotmail.com
6c10502e2f17606954418b2c7e99978801941df4
b085e0f1ad9588f592e87582669015041238cc71
/server/src/main/java/com/yesp/server/model/OrdersExample.java
11bd6c9c3b0ab70e9202feafb84c719934bdcc8f
[]
no_license
yesplike/F1
0622e4d01783b285e1f579bcfccb3fa9dda5d9e0
b8af5f77d44b7d2b2d6e21c38326b406a1d37690
refs/heads/master
2020-07-02T01:58:39.208023
2019-08-09T03:06:40
2019-08-09T03:06:40
201,378,944
0
0
null
null
null
null
UTF-8
Java
false
false
14,777
java
package com.yesp.server.model; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; public class OrdersExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public OrdersExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } protected void addCriterionForJDBCDate(String condition, Date value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } addCriterion(condition, new java.sql.Date(value.getTime()), property); } protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) { if (values == null || values.size() == 0) { throw new RuntimeException("Value list for " + property + " cannot be null or empty"); } List<java.sql.Date> dateList = new ArrayList<java.sql.Date>(); Iterator<Date> iter = values.iterator(); while (iter.hasNext()) { dateList.add(new java.sql.Date(iter.next().getTime())); } addCriterion(condition, dateList, property); } protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); } public Criteria andUseridIsNull() { addCriterion("userid is null"); return (Criteria) this; } public Criteria andUseridIsNotNull() { addCriterion("userid is not null"); return (Criteria) this; } public Criteria andUseridEqualTo(Integer value) { addCriterion("userid =", value, "userid"); return (Criteria) this; } public Criteria andUseridNotEqualTo(Integer value) { addCriterion("userid <>", value, "userid"); return (Criteria) this; } public Criteria andUseridGreaterThan(Integer value) { addCriterion("userid >", value, "userid"); return (Criteria) this; } public Criteria andUseridGreaterThanOrEqualTo(Integer value) { addCriterion("userid >=", value, "userid"); return (Criteria) this; } public Criteria andUseridLessThan(Integer value) { addCriterion("userid <", value, "userid"); return (Criteria) this; } public Criteria andUseridLessThanOrEqualTo(Integer value) { addCriterion("userid <=", value, "userid"); return (Criteria) this; } public Criteria andUseridIn(List<Integer> values) { addCriterion("userid in", values, "userid"); return (Criteria) this; } public Criteria andUseridNotIn(List<Integer> values) { addCriterion("userid not in", values, "userid"); return (Criteria) this; } public Criteria andUseridBetween(Integer value1, Integer value2) { addCriterion("userid between", value1, value2, "userid"); return (Criteria) this; } public Criteria andUseridNotBetween(Integer value1, Integer value2) { addCriterion("userid not between", value1, value2, "userid"); return (Criteria) this; } public Criteria andOrderidIsNull() { addCriterion("orderid is null"); return (Criteria) this; } public Criteria andOrderidIsNotNull() { addCriterion("orderid is not null"); return (Criteria) this; } public Criteria andOrderidEqualTo(Integer value) { addCriterion("orderid =", value, "orderid"); return (Criteria) this; } public Criteria andOrderidNotEqualTo(Integer value) { addCriterion("orderid <>", value, "orderid"); return (Criteria) this; } public Criteria andOrderidGreaterThan(Integer value) { addCriterion("orderid >", value, "orderid"); return (Criteria) this; } public Criteria andOrderidGreaterThanOrEqualTo(Integer value) { addCriterion("orderid >=", value, "orderid"); return (Criteria) this; } public Criteria andOrderidLessThan(Integer value) { addCriterion("orderid <", value, "orderid"); return (Criteria) this; } public Criteria andOrderidLessThanOrEqualTo(Integer value) { addCriterion("orderid <=", value, "orderid"); return (Criteria) this; } public Criteria andOrderidIn(List<Integer> values) { addCriterion("orderid in", values, "orderid"); return (Criteria) this; } public Criteria andOrderidNotIn(List<Integer> values) { addCriterion("orderid not in", values, "orderid"); return (Criteria) this; } public Criteria andOrderidBetween(Integer value1, Integer value2) { addCriterion("orderid between", value1, value2, "orderid"); return (Criteria) this; } public Criteria andOrderidNotBetween(Integer value1, Integer value2) { addCriterion("orderid not between", value1, value2, "orderid"); return (Criteria) this; } public Criteria andOrderdateIsNull() { addCriterion("orderdate is null"); return (Criteria) this; } public Criteria andOrderdateIsNotNull() { addCriterion("orderdate is not null"); return (Criteria) this; } public Criteria andOrderdateEqualTo(Date value) { addCriterionForJDBCDate("orderdate =", value, "orderdate"); return (Criteria) this; } public Criteria andOrderdateNotEqualTo(Date value) { addCriterionForJDBCDate("orderdate <>", value, "orderdate"); return (Criteria) this; } public Criteria andOrderdateGreaterThan(Date value) { addCriterionForJDBCDate("orderdate >", value, "orderdate"); return (Criteria) this; } public Criteria andOrderdateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("orderdate >=", value, "orderdate"); return (Criteria) this; } public Criteria andOrderdateLessThan(Date value) { addCriterionForJDBCDate("orderdate <", value, "orderdate"); return (Criteria) this; } public Criteria andOrderdateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("orderdate <=", value, "orderdate"); return (Criteria) this; } public Criteria andOrderdateIn(List<Date> values) { addCriterionForJDBCDate("orderdate in", values, "orderdate"); return (Criteria) this; } public Criteria andOrderdateNotIn(List<Date> values) { addCriterionForJDBCDate("orderdate not in", values, "orderdate"); return (Criteria) this; } public Criteria andOrderdateBetween(Date value1, Date value2) { addCriterionForJDBCDate("orderdate between", value1, value2, "orderdate"); return (Criteria) this; } public Criteria andOrderdateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("orderdate not between", value1, value2, "orderdate"); return (Criteria) this; } public Criteria andTotalpriceIsNull() { addCriterion("totalprice is null"); return (Criteria) this; } public Criteria andTotalpriceIsNotNull() { addCriterion("totalprice is not null"); return (Criteria) this; } public Criteria andTotalpriceEqualTo(Float value) { addCriterion("totalprice =", value, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceNotEqualTo(Float value) { addCriterion("totalprice <>", value, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceGreaterThan(Float value) { addCriterion("totalprice >", value, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceGreaterThanOrEqualTo(Float value) { addCriterion("totalprice >=", value, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceLessThan(Float value) { addCriterion("totalprice <", value, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceLessThanOrEqualTo(Float value) { addCriterion("totalprice <=", value, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceIn(List<Float> values) { addCriterion("totalprice in", values, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceNotIn(List<Float> values) { addCriterion("totalprice not in", values, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceBetween(Float value1, Float value2) { addCriterion("totalprice between", value1, value2, "totalprice"); return (Criteria) this; } public Criteria andTotalpriceNotBetween(Float value1, Float value2) { addCriterion("totalprice not between", value1, value2, "totalprice"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "xxxxx@xx.com" ]
xxxxx@xx.com
bacbb387a71e9e5accb0308df770db82e3a862a5
ec5332dba226eb5e29c4ecc6450d495174b8d4bb
/PracticalTest02Var01/app/src/main/java/com/example/practicaltest02var01/gui/PracticalTest02Var01MainActivity.java
c069c64e83eacbb3a7ba23aed0a6ab2c38f6a43b
[ "Apache-2.0" ]
permissive
alinarusu/PracticalTest02Colocviu
b1651a9545b9b84656b2f52614903dc3ffb52571
8cdf941748051ac0ff1bc8b50e180ee6ca1be4c0
refs/heads/master
2016-09-05T23:10:44.484621
2015-05-19T08:18:34
2015-05-19T08:18:34
35,865,208
0
0
null
null
null
null
UTF-8
Java
false
false
4,945
java
package com.example.practicaltest02var01.gui; import com.example.practicaltest02var01.utilities.*; import com.example.practicaltest02var01.networkingthreads.*; import com.example.practicaltest02var01.R; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class PracticalTest02Var01MainActivity extends Activity { private EditText serverPortEditText = null; private Button connectButton = null; private EditText clientAddressEditText = null; private EditText clientPortEditText = null; private Button getTemp = null; private Button getHumidity = null; private Button getAll = null; private TextView weatherForecastTextView = null; private ServerThread serverThread = null; private ClientThread clientThread = null; private ConnectButtonClickListener connectButtonClickListener = new ConnectButtonClickListener(); private class ConnectButtonClickListener implements Button.OnClickListener { @Override public void onClick(View view) { String serverPort = serverPortEditText.getText().toString(); if (serverPort == null || serverPort.isEmpty()) { Toast.makeText( getApplicationContext(), "Server port should be filled!", Toast.LENGTH_SHORT ).show(); return; } serverThread = new ServerThread(Integer.parseInt(serverPort)); if (serverThread.getServerSocket() != null) { serverThread.start(); } else { Log.e(Constants.TAG, "[MAIN ACTIVITY] Could not creat server thread!"); } } } private ButtonClickListener getWeatherForecastButtonClickListener = new ButtonClickListener(); private class ButtonClickListener implements Button.OnClickListener { @Override public void onClick(View view) { String clientAddress = clientAddressEditText.getText().toString(); String clientPort = clientPortEditText.getText().toString(); if (clientAddress == null || clientAddress.isEmpty() || clientPort == null || clientPort.isEmpty()) { Toast.makeText( getApplicationContext(), "Client connection parameters should be filled!", Toast.LENGTH_SHORT ).show(); return; } if (serverThread == null || !serverThread.isAlive()) { Log.e(Constants.TAG, "[MAIN ACTIVITY] There is no server to connect to!"); return; } weatherForecastTextView.setText(Constants.EMPTY_STRING); String infoType = null; switch(view.getId()) { case R.id.bTemp: infoType = Constants.TEMP; break; case R.id.bUmiditate: infoType = Constants.HUMIDITY; break; case R.id.bAll: infoType = Constants.ALL; break; } clientThread = new ClientThread( clientAddress, Integer.parseInt(clientPort), infoType, weatherForecastTextView); clientThread.start(); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_practical_test02_var01_main); serverPortEditText = (EditText)findViewById(R.id.server_port_edit_text); connectButton = (Button)findViewById(R.id.connect_button); connectButton.setOnClickListener(connectButtonClickListener); clientAddressEditText = (EditText)findViewById(R.id.client_address_edit_text); clientPortEditText = (EditText)findViewById(R.id.client_port_edit_text); getTemp = (Button) findViewById(R.id.bTemp); getAll = (Button) findViewById(R.id.bAll); getHumidity = (Button) findViewById(R.id.bUmiditate); getTemp.setOnClickListener(getWeatherForecastButtonClickListener); getAll.setOnClickListener(getWeatherForecastButtonClickListener); getHumidity.setOnClickListener(getWeatherForecastButtonClickListener); weatherForecastTextView = (TextView) findViewById(R.id.tvResult); } @Override protected void onDestroy() { if (serverThread != null) { serverThread.stopThread(); } super.onDestroy(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.practical_test02_var01_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "alinanrusu@gmail.com" ]
alinanrusu@gmail.com
68cc5377f2df69b5b48aa5488427371567deccfd
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/hibernate-orm/2015/4/Schema.java
37576a2312b5bff5434d8ba67629714af4f49942
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
7,182
java
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2015, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.boot.model.relational; import java.util.Collection; import java.util.Map; import java.util.TreeMap; import org.hibernate.HibernateException; import org.hibernate.boot.model.naming.Identifier; import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.compare.EqualsHelper; import org.hibernate.mapping.DenormalizedTable; import org.hibernate.mapping.Table; /** * Represents a named schema/catalog pair and manages objects defined within. * * @author Steve Ebersole */ public class Schema { private static final CoreMessageLogger log = CoreLogging.messageLogger( Schema.class ); private final Database database; private final Name name; private final Name physicalName; private Map<Identifier, Table> tables = new TreeMap<Identifier, Table>(); private Map<Identifier, Sequence> sequences = new TreeMap<Identifier, Sequence>(); public Schema(Database database, Name name) { this.database = database; this.name = name; final Identifier physicalCatalogIdentifier = database.getPhysicalNamingStrategy() .toPhysicalCatalogName( name.getCatalog(), database.getJdbcEnvironment() ); final Identifier physicalSchemaIdentifier = database.getPhysicalNamingStrategy() .toPhysicalCatalogName( name.getSchema(), database.getJdbcEnvironment() ); this.physicalName = new Name( physicalCatalogIdentifier, physicalSchemaIdentifier ); } public Name getName() { return name; } public Name getPhysicalName() { return physicalName; } public Collection<Table> getTables() { return tables.values(); } /** * Returns the table with the specified logical table name. * * @param logicalTableName - the logical name of the table * * @return the table with the specified table name, * or null if there is no table with the specified * table name. */ public Table locateTable(Identifier logicalTableName) { return tables.get( logicalTableName ); } /** * Creates a mapping Table instance. * * @param logicalTableName The logical table name * * @return the created table. */ public Table createTable(Identifier logicalTableName, boolean isAbstract) { final Table existing = tables.get( logicalTableName ); if ( existing != null ) { return existing; } final Identifier physicalTableName = database.getPhysicalNamingStrategy().toPhysicalTableName( logicalTableName, database.getJdbcEnvironment() ); Table table = new Table( this, physicalTableName, isAbstract ); tables.put( logicalTableName, table ); return table; } public DenormalizedTable createDenormalizedTable(Identifier logicalTableName, boolean isAbstract, Table includedTable) { final Table existing = tables.get( logicalTableName ); if ( existing != null ) { // for now assume it is return (DenormalizedTable) existing; } final Identifier physicalTableName = database.getPhysicalNamingStrategy().toPhysicalTableName( logicalTableName, database.getJdbcEnvironment() ); DenormalizedTable table = new DenormalizedTable( this, physicalTableName, isAbstract, includedTable ); tables.put( logicalTableName, table ); return table; } public Sequence locateSequence(Identifier name) { return sequences.get( name ); } public Sequence createSequence(Identifier logicalName, int initialValue, int increment) { if ( sequences.containsKey( logicalName ) ) { throw new HibernateException( "Sequence was already registered with that name [" + logicalName.toString() + "]" ); } final Identifier physicalName = database.getPhysicalNamingStrategy().toPhysicalSequenceName( logicalName, database.getJdbcEnvironment() ); Sequence sequence = new Sequence( this.physicalName.getCatalog(), this.physicalName.getSchema(), physicalName, initialValue, increment ); sequences.put( logicalName, sequence ); return sequence; } @Override public String toString() { return "Schema" + "{name=" + name + '}'; } @Override public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final Schema that = (Schema) o; return EqualsHelper.equals( this.name, that.name ); } @Override public int hashCode() { return name.hashCode(); } public Iterable<Sequence> getSequences() { return sequences.values(); } public static class Name implements Comparable<Name> { private final Identifier catalog; private final Identifier schema; public Name(Identifier catalog, Identifier schema) { this.schema = schema; this.catalog = catalog; } public Identifier getCatalog() { return catalog; } public Identifier getSchema() { return schema; } @Override public String toString() { return "Name" + "{catalog=" + catalog + ", schema=" + schema + '}'; } @Override public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final Name that = (Name) o; return EqualsHelper.equals( this.catalog, that.catalog ) && EqualsHelper.equals( this.schema, that.schema ); } @Override public int hashCode() { int result = catalog != null ? catalog.hashCode() : 0; result = 31 * result + (schema != null ? schema.hashCode() : 0); return result; } @Override public int compareTo(Name that) { // per Comparable, the incoming Name cannot be null. However, its catalog/schema might be // so we need to account for that. int catalogCheck = ComparableHelper.compare( this.getCatalog(), that.getCatalog() ); if ( catalogCheck != 0 ) { return catalogCheck; } return ComparableHelper.compare( this.getSchema(), that.getSchema() ); } } public static class ComparableHelper { public static <T extends Comparable<T>> int compare(T first, T second) { if ( first == null ) { if ( second == null ) { return 0; } else { return 1; } } else { if ( second == null ) { return -1; } else { return first.compareTo( second ); } } } } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
681113ed075eacfd7b6d0d7f7f50dff32b6eeeee
74ee3d8a85b92dbc51d6edb5b5ed62821e0f988a
/o4-customer-service-spring-annotation-config/src/main/java/com/training/workshop/Program.java
000eae3a1df16d5f739d3a727e51d54cb812a7cc
[]
no_license
mohitnmo/GAP-Inc
e5f966fb8ddaaecc245891556b815cbeb8d500f9
c1d8a30e5291531b12e674f854577e748b6bf74e
refs/heads/master
2023-06-13T07:33:23.373202
2021-07-09T12:02:23
2021-07-09T12:02:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package com.training.workshop; import java.util.List; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.training.workshop.config.MainConfig; import com.training.workshop.model.Customer; import com.training.workshop.services.CustomerService; public class Program { public static void main(String[] args) { // ApplicationContext container = new ClassPathXmlApplicationContext("applicationContext.xml"); ApplicationContext container = new AnnotationConfigApplicationContext(MainConfig.class); //CustomerService customerService = new CustomerServiceImpl(); CustomerService customerService = container.getBean("customerService", CustomerService.class); List<Customer> loadedCustomers = customerService.retrieveAllCustomers(); loadedCustomers.forEach(customer -> System.out.println(customer.getFirstName())); } }
[ "vinodh.mahendra@gmail.com" ]
vinodh.mahendra@gmail.com
49323faef924f8878635539a262b3fc9e9bcdb20
6f36e847fbacb814f7ba041fe060dab32fa1be74
/springboot-shiro/src/main/java/com/study/user/security/shiro/XTokenWebSessionManager.java
dd130f6fad42f0b4b55ef0d6cf194b1f08808f16
[]
no_license
wcl19860926/springboot-demo
b3d31f2a03bb3edc3097abad55d356f0505a2d28
c71827acda26314ecd80dfd024e7858147f4c3b3
refs/heads/main
2023-03-09T15:31:28.805200
2021-02-28T11:34:05
2021-02-28T11:34:05
342,522,874
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package com.study.user.security.shiro; import org.apache.shiro.session.Session; import org.apache.shiro.session.SessionException; import org.apache.shiro.session.mgt.DefaultSessionKey; import org.apache.shiro.session.mgt.SessionKey; import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; import org.apache.shiro.web.util.WebUtils; import javax.servlet.http.HttpServletRequest; /** * XTokenWebSessionManager <br> * @author xiquee.com <br> * @date 2018-11-09 10:16:00 */ public class XTokenWebSessionManager extends DefaultWebSessionManager { public static final String HEADER_TOKEN = "x-token"; /** * 获取session, 对于跨域请求,所有请求都是无状态的,无法从cookie中获取sessionId, * 因此对于跨域请求,要求在http header 中添加 token 头,这里优先从http头中读取token, * 如果存在token,则以token作为sessionId * * @param key --session key * @return * @throws SessionException */ @Override public Session getSession(SessionKey key) throws SessionException { if (key instanceof DefaultSessionKey) { String headerToken = getTokenFromHeader(key); if (headerToken != null && headerToken.trim().length() > 0) { ((DefaultSessionKey) key).setSessionId(headerToken); } } return super.getSession(key); } private String getTokenFromHeader(SessionKey key) { HttpServletRequest request = (HttpServletRequest) WebUtils.getRequest(key); if (request != null) { String token = request.getHeader(HEADER_TOKEN); return token; } return null; } }
[ "694216530@qq.com" ]
694216530@qq.com
244d10dff4c54d84303d58b2f2901695537afa29
2a0f28eae6e3e221bb80c5654baad6e52e1809d1
/employee-catalog/src/main/java/mk/todorht/myfirm/employeecatalog/domain/repository/EmployeeRepository.java
aa14267bc53090df71e5c1eb4bc56bd3e8faaacf
[]
no_license
todorht/myFirm
0eebde8b2f203cba8318ade6df3894eba4b597b1
cb5885871090b6cd1779411021b5cb913e950d78
refs/heads/master
2023-08-12T04:57:41.450112
2021-09-22T19:18:13
2021-09-22T19:18:13
394,431,490
0
0
null
null
null
null
UTF-8
Java
false
false
490
java
package mk.todorht.myfirm.employeecatalog.domain.repository; import mk.todorht.myfirm.employeecatalog.domain.models.Employee; import mk.todorht.myfirm.sharedkernel.base.EmployeeInfo; import mk.todorht.myfirm.sharedkernel.repository.GenericRepository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.Optional; @Repository public interface EmployeeRepository extends GenericRepository<Employee, Integer> { }
[ "hr.todorovski@gmail.com" ]
hr.todorovski@gmail.com
bd13a8eaec3fbca70f15640c4c308b9339a5aaf1
ed374fd23a2434d5c8f89344bdd5fdcdd7684101
/app/src/main/java/com/example/whitebord/CanvasView.java
acf6734ac4dd90999ce3c90e373b9cf0f933d33b
[]
no_license
kishanmorichauhan/whightbord
3e4df28c98c094f3107965fc8c3413e0f5ca2544
676b7c52a7257b334a58a83afd610dda950959b6
refs/heads/master
2023-05-25T18:22:53.640712
2021-06-03T04:11:01
2021-06-03T04:11:01
373,377,070
0
0
null
null
null
null
UTF-8
Java
false
false
2,474
java
package com.example.whitebord; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.autofill.AutofillValue; import androidx.annotation.Nullable; public class CanvasView extends View { Context context; int width,height; Bitmap bitmap; Paint paint; Path path; Canvas canvas; Float mx,my; static final float TOLERANCE = 4; public CanvasView(Context context, AttributeSet attrs) { super(context, attrs); this.context =context; path = new Path(); paint = new Paint(); paint.setAntiAlias(true); paint.setColor(Color.BLACK); paint.setStyle(Paint.Style.STROKE); paint.setStrokeJoin(Paint.Join.ROUND); paint.setStrokeWidth(10f); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); bitmap = Bitmap.createBitmap(w,h,Bitmap.Config.ARGB_8888); canvas = new Canvas(bitmap); } public void startTouch (float x, float y){ path.moveTo(x,y); mx = x; my = y; } public void moveTouch(float x, float y){ float dx = Math.abs(x-mx); float dy = Math.abs(y-my); if(dx>=TOLERANCE || dy>=TOLERANCE) { path.quadTo(mx, my, (x + mx)/2 ,(y+my)/2); mx = x; my = y; } } public void clearCanvas(){ path.reset(); invalidate(); } public void upTouch(){ path.lineTo(mx,my); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawPath(path,paint); } @Override public boolean onTouchEvent(MotionEvent event) { float x = event.getX(); float y = event.getY(); switch (event.getAction()){ case MotionEvent.ACTION_DOWN: startTouch(x,y); invalidate(); break; case MotionEvent.ACTION_MOVE: moveTouch(x,y); invalidate(); break; case MotionEvent.ACTION_UP: upTouch(); invalidate(); break; } return true; } }
[ "kishanmorichauhan@gmail.com" ]
kishanmorichauhan@gmail.com
fbcd33d8f7ecacdcbc16d03fdb313d7ddb6d0885
df5897b284a5d2ab57dd0e32b38886d772bfb9f4
/master/src/main/java/com/meli/mutantes/dto/StatsDTO.java
27afe4e0a6a7dbf25826d56c7fdfd873780e864c
[]
no_license
nahuelavalos/mutants
e84cf463562bf81dcbd3f70bc381de1c187e2cd8
36ff47c5f7709fb1a0e883e6ff5fea0fae230223
refs/heads/master
2021-02-26T16:04:17.195225
2020-03-10T03:53:48
2020-03-10T03:53:48
245,538,968
0
0
null
null
null
null
UTF-8
Java
false
false
423
java
package com.meli.mutantes.dto; import lombok.Data; @Data public class StatsDTO { private Long count_mutant_dna; private Long count_human_dna; private Double ratio; public StatsDTO(Long countHuman, Long countMutant) { this.count_mutant_dna = countMutant; this.count_human_dna = countHuman; this.ratio = countHuman == 0 ? 1d : (double) countMutant / (double) countHuman; } }
[ "avalosnahuel@gmail.com" ]
avalosnahuel@gmail.com
ff628adf0e3c0520ca23f7625d549485d1e2808a
f0d825d67f22bdda6455747fd6198137814c4d5f
/src/main/java/com/xmbl/ops/model/course/CourseLevelEntity.java
b3931baaa3215b0ddb04ba9cdd4f6fdbedf18a86
[]
no_license
noseparte/boma-platform
3084d208be17d82dca31f0af5ca041127ac3483c
a7a9dc63afda6d50681794a6d46fd88c439ab15a
refs/heads/master
2020-04-12T09:46:34.019100
2018-12-20T08:29:53
2018-12-20T08:29:53
162,407,564
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package com.xmbl.ops.model.course; import com.xmbl.ops.model.mongo.base.GeneralBean; import lombok.Data; import org.springframework.data.mongodb.core.mapping.Document; /** * Copyright © 2018 noseparte © BeiJing BoLuo Network Technology Co. Ltd. * * @Author Noseparte * @Compile -- * @Version 1.0 * @Description 课程层次 */ @Data @Document(collection = "bm_edu_course_level") public class CourseLevelEntity extends GeneralBean { private int level; //层级 private String levelName; //层级名称 private String levelCode; //层级编号 private String levelDec; //层级描述 }
[ "noseparte@aliyun.com" ]
noseparte@aliyun.com
71a286db2ea8d73b2fd7c6e11478558a61d94915
1e83c98788f15eaae341e116b9374b1fa302c5b2
/app/src/main/java/com/example/xinyichen/reflect/MainActivity.java
91d99962b9dea2005d7b51ebe91d3544e7ba59e8
[]
no_license
xinyichen516/Reflect
ea8bbe23d87b8ebb100fca22505fe68cdb3018b2
805be57bdaa8ba278fc4a8175982bef5926652ad
refs/heads/master
2021-07-09T15:24:37.952924
2017-10-08T16:49:36
2017-10-08T16:49:36
106,078,719
1
0
null
null
null
null
UTF-8
Java
false
false
440
java
package com.example.xinyichen.reflect; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView tView = (TextView) findViewById(R.id.textView); } }
[ "xinyichen516@gmail.com" ]
xinyichen516@gmail.com
c5266779b9910fc37d5c9c5e71506b08a7b93063
b0f91a3a1c30fc9fa6acc46cc957a8c282784530
/online-netty/src/main/java/com/online/netty/channel/ToIntegerCodec.java
427e4659adb2dfabf553a31a9a860ab9364ad167
[]
no_license
Suancaiyu0707/Online
d19257d5f8adf510c5898ddffd0f48a032ad7fe4
99eff1963155a447bccc01648f56a4bea6ab7444
refs/heads/master
2022-04-11T17:10:32.010338
2020-03-29T15:43:48
2020-03-29T15:43:48
218,193,302
0
0
null
null
null
null
UTF-8
Java
false
false
501
java
package com.online.netty.channel; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageCodec; import java.util.List; public class ToIntegerCodec extends ByteToMessageCodec<Integer> { @Override protected void encode(ChannelHandlerContext ctx, Integer msg, ByteBuf out) throws Exception { } @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> list) throws Exception { } }
[ "491978944@qq.com" ]
491978944@qq.com
b397e623afabadc07f922e69bd9988247b2dd604
5dc4010202ca3412f8504739a88f25acfa8b1011
/src/test/java/com/gaven/pattern/SingletonTest/SingletonThread.java
0998bde97d9e462ef65be81411a13de7a1f50c37
[]
no_license
GavenY/design-pattern
d5f0a86d8620a3660145f85a617e6753d42357e2
e65b4f52957aa29909bdb779dc9687a4c0917613
refs/heads/master
2020-04-27T20:52:53.385778
2019-03-26T17:23:57
2019-03-26T17:23:57
174,674,364
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
package com.gaven.pattern.SingletonTest; import com.gaven.pattern.SingletonTest.SingletonLazy.DoubleCheckSingleton; import com.gaven.pattern.SingletonTest.SingletonLazy.InnerLazySingleton; import com.gaven.pattern.SingletonTest.SingletonLazy.SingletonLazy; public class SingletonThread implements Runnable { @Override public void run() { //SingletonLazy singleton = SingletonLazy.getInstance(); // ThreadLocalSingleton singleton = ThreadLocalSingleton.getInstance(); // System.out.println(Thread.currentThread().getName() + ":" + singleton); // DoubleCheckSingleton doubleCheckSingleton = DoubleCheckSingleton.getInstance(); // System.out.println(Thread.currentThread().getName() + ":" + doubleCheckSingleton); InnerLazySingleton innerLazySingleton = InnerLazySingleton.getInstance(); System.out.println(Thread.currentThread().getName() + ":" + innerLazySingleton); } }
[ "1846178843@qq.com" ]
1846178843@qq.com
222c584d3d90b64419cda8ee69c27b199010dced
11fc952d685c778cb035867b9f310f35f284869a
/health_service_provider/src/main/java/com/itheima/service/OrderSettingServiceImpl.java
24b2d21b007dbe3c6ff3a02a818e67f540705209
[]
no_license
lairujian/health_parent
25608a36bd9b7fb534511b653c0b5455e65011e1
38d3e8bc9b0bd3dd556e9cdf676288ff572fa048
refs/heads/master
2023-05-21T06:34:37.799267
2021-06-11T07:37:46
2021-06-11T07:37:46
364,333,048
0
0
null
null
null
null
UTF-8
Java
false
false
3,104
java
package com.itheima.service; import com.alibaba.dubbo.config.annotation.Service; import com.itheima.dao.OrderSettingDao; import com.itheima.pojo.OrderSetting; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.*; @Service(interfaceClass = OrderSettingService.class) @Transactional public class OrderSettingServiceImpl implements OrderSettingService{ @Autowired private OrderSettingDao orderSettingDao; //批量导入预约设置数据 @Override public void add(List<OrderSetting> list) { if (list!=null&& list.size()>0) { //将日期拿出来 for (OrderSetting orderSetting : list) { //判断当前日期是否已经进行了预约设置 long countByOrderDate = orderSettingDao.findCountByOrderDate(orderSetting.getOrderDate()); if (countByOrderDate>0){ //已经进行了预约设置,执行更新操作 orderSettingDao.editNumberByOrderDate(orderSetting); }else { orderSettingDao.add(orderSetting); } /*//查询数据库的日期 if (orderSettingDao.findCountByOrderDate(orderDate) != null) { orderSettingDao.editNumberByOrderDate(list); } else { orderSettingDao.add(list); }*/ } } } /*根据日期查询预约设置数据*/ @Override public List<Map> getOrderSettingByMonth(String date) { //查询数据的参数,从第一天到最后一天,不用map,直接传过两个数据?也可以吧 String dateBegin=date+"-1"; String dateEnd=date+"-31"; //将最后一天和第一天存储到map集合里 Map<String,String> map=new HashMap(); map.put("dateBegin",dateBegin); map.put("dateEnd",dateEnd); //查询到可预约人数和已预约人数,及对应的日期 List<OrderSetting> list =orderSettingDao.getOrderSettingByMonth(map); List<Map> data=new ArrayList<>(); if (list!=null && list.size()>0) { for (OrderSetting orderSetting : list) { Map<String,Object> orderSettingMap = new HashMap(); orderSettingMap.put("date", orderSetting.getOrderDate().getDate());//获取数据库的日期转换数字 orderSettingMap.put("number", orderSetting.getNumber()); orderSettingMap.put("reservations", orderSetting.getReservations()); data.add(orderSettingMap); } } return data; } /*根据日期修改可预约人数*/ @Override public void editNumberByDate(OrderSetting orderSetting) { /*查询该日期*/ long count = orderSettingDao.findCountByOrderDate(orderSetting.getOrderDate()); if (count>0){ //已经有的日期,修改 orderSettingDao.editNumberByDate(orderSetting); }else { orderSettingDao.add(orderSetting); } } }
[ "yun@rujian.cn" ]
yun@rujian.cn
f8ce4692e58c5287cce7e2629386b76c8727c271
0eda633c6e2128e7c6bb53f5938580d3423c3d75
/src/com/example/musicrec/FriendPicker.java
9464aeefcea68362da4346f4eaae8d00b328c822
[]
no_license
maddymanu/Musified
25c66dc8bb51118c113d7ea70325d82dd1fa91f4
bc6cbebba1846a374881dc1ef43047d75a4b39f4
refs/heads/master
2021-01-13T02:02:06.523380
2014-09-02T16:13:47
2014-09-02T16:13:47
18,952,987
1
0
null
null
null
null
UTF-8
Java
false
false
3,013
java
package com.example.musicrec; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.widget.ListView; import com.facebook.Request; import com.facebook.RequestAsyncTask; import com.facebook.Response; import com.facebook.model.GraphUser; import com.parse.FindCallback; import com.parse.ParseException; import com.parse.ParseFacebookUtils; import com.parse.ParseQuery; import com.parse.ParseUser; /* * This class is the activity that is called when a share button is clicked. * It populates a list of friends the user has and sends them to FriendPickerAdapter. */ public class FriendPicker extends Activity { //list to store the list of friends List<GraphUser> friendListForInvites = null; //custom list adapter FriendPickerAdapter adapter; protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_friend_picker); //assigning the listview final ListView listView = (ListView) findViewById(R.id.list_of_friends); // Get List of friends. @SuppressWarnings("deprecation") RequestAsyncTask r = Request.executeMyFriendsRequestAsync( ParseFacebookUtils.getSession(), new Request.GraphUserListCallback() { @SuppressWarnings("unchecked") @Override public void onCompleted(List<GraphUser> users, Response response) { //if this user has friends if (users != null) { //add all friends to a separate list. friendListForInvites = users; List<String> friendsList = new ArrayList<String>(); for (GraphUser user : users) { friendsList.add(user.getId()); } //get a list of ParseUsers for these facebook friends @SuppressWarnings("rawtypes") final ParseQuery<ParseUser> friendQuery = ParseQuery .getUserQuery(); friendQuery.whereContainedIn("fbId", friendsList); friendQuery.findInBackground(new FindCallback<ParseUser>() { public void done(List<ParseUser> friendUsers, ParseException e3) { // getting the list of friends complete here if (friendUsers.size() == 0) { //Log.i("Friend", "size0"); } // friendUsers is the list of friends here //create a new custom adapter for FriendPicker adapter = new FriendPickerAdapter(savedInstanceState, friendUsers); adapter.setAdapterView(listView); } }); } } }); } @Override protected void onSaveInstanceState(Bundle outState) { adapter.save(outState); } }
[ "maddymanu@hotmail.com" ]
maddymanu@hotmail.com
48ccce9f61b648b6af7114c75199551950d1b683
148100c6a5ac58980e43aeb0ef41b00d76dfb5b3
/sources/com/google/android/gms/internal/phenotype/zzh.java
9c2f4a5f3acd7633a6c72a4d2c87b5f456dbedba
[]
no_license
niravrathod/car_details
f979de0b857f93efe079cd8d7567f2134755802d
398897c050436f13b7160050f375ec1f4e05cdf8
refs/heads/master
2020-04-13T16:36:29.854057
2018-12-27T19:03:46
2018-12-27T19:03:46
163,325,703
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package com.google.android.gms.internal.phenotype; import android.annotation.SuppressLint; import android.content.Context; public final class zzh<T> { /* renamed from: a */ private static final Object f10390a = new Object(); @SuppressLint({"StaticFieldLeak"}) /* renamed from: b */ private static Context f10391b = null; /* renamed from: c */ private static boolean f10392c = false; /* renamed from: d */ private static volatile Boolean f10393d = null; /* renamed from: e */ private static volatile Boolean f10394e = null; }
[ "niravrathod473@gmail.com" ]
niravrathod473@gmail.com
d7fbcdd248f1182ac1e6dccf2b74798f7b1bbbcf
634ae05c5e190412b2c50a7b5317c3d331322bdf
/Sandbox/src/main/java/demo/generics/model/Partner.java
b39b8270cec94cb05a5e84c96e5b9600a11f9d84
[]
no_license
ganqzz/java_workspace
1b919aff1f177c5b6971e7f19f465129a247ed72
3a7285e9b1945c8b55a4b02bbb20aee3d31a9086
refs/heads/master
2023-07-16T06:03:36.310878
2021-09-04T03:44:37
2021-09-04T03:44:37
389,467,395
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package demo.generics.model; public class Partner extends Person { public Partner(final String name, final int age) { super(name, age); } @Override public String toString() { return "Partner{" + "name='" + getName() + '\'' + ", age=" + getAge() + '}'; } }
[ "ganqzz@users.noreply.github.com" ]
ganqzz@users.noreply.github.com
2b4852dec27b1b943023e8a7c33dae7b98aa0370
d11fb0d15b73a28742caa97e349dcfbe70d2563f
/server/iih.ci/iih.ci.ord/src/main/java/iih/ci/ord/s/bp/assi/impl/cimes/ip/IpCopyApbuPropertyImpl.java
8d546c842a353a7fe9a329745746b38b051c3266
[]
no_license
fhis/order.client
50a363fd3e4f56d95ccc5aa288e907a0a8571031
56cfa7877f600a10c54fdb30306a32ffa28b8217
refs/heads/master
2021-08-22T20:50:59.511923
2017-12-01T07:10:27
2017-12-01T07:10:27
112,678,072
1
1
null
null
null
null
UTF-8
Java
false
false
253
java
package iih.ci.ord.s.bp.assi.impl.cimes.ip; import iih.ci.ord.s.bp.assi.impl.cimes.base.IpBaseCopyCalCiEmsProperty; /** * 备血申请属性复制 * * @author HUMS * */ public class IpCopyApbuPropertyImpl extends IpBaseCopyCalCiEmsProperty { }
[ "27696830@qq.com" ]
27696830@qq.com
56c7fc0d4ceaee3b3900b38dc2ecfd9eec6718d4
60694092acf7e9f53bf16abc8c17c990877535ba
/suripu-core/src/test/java/com/hello/suripu/core/models/SleepPeriodResultsTest.java
a19cc44bd344cb54b44c70ac1176c0bc7af7f2c5
[]
no_license
hello/suripu
5b19c90f2aaaf1f492f36d39e2895e5adcd14df2
f0d1c139204eccd2c080d4c906f8afcc8c372055
refs/heads/master
2021-03-24T13:00:18.339462
2017-05-04T21:48:40
2017-05-04T21:48:40
17,836,924
28
9
null
2018-01-26T07:56:55
2014-03-17T17:32:30
Java
UTF-8
Java
false
false
1,089
java
package com.hello.suripu.core.models; import com.hello.suripu.core.util.AlgorithmType; import com.hello.suripu.core.util.TimelineError; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Test; /** * Created by jarredheinrich on 4/5/17. */ public class SleepPeriodResultsTest { @Test public void testCreateEmpty(){ final com.hello.suripu.core.models.timeline.v2.TimelineLog log = new com.hello.suripu.core.models.timeline.v2.TimelineLog(0L, DateTime.now(DateTimeZone.UTC).getMillis(), DateTime.now(DateTimeZone.UTC).getMillis(), 0L); final MainEventTimes mainEventTimesEmpty= MainEventTimes.createMainEventTimesEmpty(0L, SleepPeriod.createSleepPeriod(SleepPeriod.Period.NIGHT, DateTime.now(DateTimeZone.UTC)), DateTime.now(DateTimeZone.UTC).getMillis(), 0, AlgorithmType.NONE, TimelineError.NO_DATA); final SleepPeriodResults emptySleepPeriod = SleepPeriodResults.createEmpty(0L, mainEventTimesEmpty, log, DataCompleteness.NOT_ENOUGH_DATA, true); assert(!emptySleepPeriod.resultsOptional.isPresent()); } }
[ "noreply@github.com" ]
noreply@github.com
a8303898227bc0b2c38c6e4b18bee536dc42d032
a476d62597ac63cf7437dbb033fe0c3da75687b4
/src/main/java/com/spring/project/bookforest/service/ReviewService.java
71afda75684d1cf7103d0694180acba70c3bf2ae
[]
no_license
greenpea88/bookForest
13cdbd864db9e57d60c7d11158caf7148bf49226
e1a73ac84a7930be9c60b49ec3cd597a0d94efd8
refs/heads/main
2023-06-11T11:26:31.081526
2021-07-04T11:18:39
2021-07-04T11:18:39
376,995,364
0
0
null
null
null
null
UTF-8
Java
false
false
3,337
java
package com.spring.project.bookforest.service; import com.spring.project.bookforest.domain.entity.Product; import com.spring.project.bookforest.domain.entity.Review; import com.spring.project.bookforest.domain.entity.User; import com.spring.project.bookforest.domain.repository.ProductRepository; import com.spring.project.bookforest.domain.repository.ReviewRepository; import com.spring.project.bookforest.domain.repository.UserRepository; import com.spring.project.bookforest.dto.ReviewProductResDto; import com.spring.project.bookforest.dto.ReviewUserResDto; import com.spring.project.bookforest.dto.ReviewUpdateReqDto; import com.spring.project.bookforest.dto.ReviewWriteReqDto; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service @RequiredArgsConstructor public class ReviewService { private final ReviewRepository reviewRepository; private final UserRepository userRepository; private final ProductRepository productRepository; public void writeReview(ReviewWriteReqDto reqDto){ //TODO: review title 10자 이하 예외처리 User user = userRepository.findByEmail(reqDto.getUserEmail()); Product product = productRepository.findById(reqDto.getProductId()).orElse(null); reviewRepository.save(Review.builder().title(reqDto.getTitle()).rate(reqDto.getRate()) .content(reqDto.getContent()).user(user).product(product).build()); } public void updateReview(ReviewUpdateReqDto reqDto){ Review review = reviewRepository.findById(reqDto.getId()).orElse(null); review.update(reqDto.getTitle(),reqDto.getRate(),reqDto.getContent()); reviewRepository.save(review); } public void deleteReview(Long id){ Review review = reviewRepository.getById(id); review.setDeleted(true); reviewRepository.save(review); } public List<ReviewUserResDto> getReviewUserList(int page, String email){ PageRequest pageRequest = PageRequest.of(page,10); List<Review> result = reviewRepository.findAllByUserEmailAndDeletedFalse(pageRequest, email); List<ReviewUserResDto> reviewUserResDtoList = new ArrayList<>(); for (Review r: result){ reviewUserResDtoList.add(entityToUserDto(r)); } return reviewUserResDtoList; } public List<ReviewProductResDto> getReviewProductList(int page, Long productId){ PageRequest pageRequest = PageRequest.of(page, 5); List<Review> result = reviewRepository.findAllByProductIdAndDeletedFalse(pageRequest, productId); List<ReviewProductResDto> reviewProductResDtoList = new ArrayList<>(); for (Review r: result){ reviewProductResDtoList.add(entityToProductDto(r)); } return reviewProductResDtoList; } private ReviewUserResDto entityToUserDto(Review review){ return new ReviewUserResDto(review.getId(),review.getTitle(),review.getRate() ,review.getContent(),review.getProduct().getId()); } private ReviewProductResDto entityToProductDto(Review review){ return new ReviewProductResDto(review.getId(),review.getTitle(),review.getRate(),review.getContent()); } }
[ "greenpea@gangminchaeui-MacBookPro.local" ]
greenpea@gangminchaeui-MacBookPro.local
86bc4af8cba4c276ec3134ccc1c01c4c2f1eace8
59c26d69b6e9a2d3b2e691a5d712e486c43dc8de
/java/c/a/c/b.java
60d308059c790f5758044480f85c82c0b8d4cdb5
[]
no_license
haykpilosyan/PhotoMath-java-codes
5ef1c590cf61bc6f8c0d83b85cbd60b4456b7e7b
8634f068bd2a92ddc66765fc313cf798329146fe
refs/heads/master
2021-01-19T10:14:25.917156
2017-04-10T18:25:50
2017-04-10T18:25:50
87,842,611
4
3
null
null
null
null
UTF-8
Java
false
false
11,784
java
/* * Decompiled with CFR 0_110. * * Could not load the following classes: * d.c * d.d * d.e * d.m * java.io.IOException * java.lang.Object * java.lang.String * java.lang.StringBuilder * java.lang.Throwable * java.lang.ref.Reference * java.net.ConnectException * java.net.InetSocketAddress * java.net.Proxy * java.net.Socket * java.net.SocketTimeoutException * java.util.ArrayList * java.util.List * java.util.concurrent.TimeUnit * javax.net.ssl.SSLSocketFactory */ package c.a.c; import c.a.a; import c.a.a.d; import c.a.a.e; import c.a.b.o; import c.a.g; import c.a.i; import c.a.j; import c.ab; import c.ad; import c.h; import c.k; import c.q; import c.r; import c.s; import c.x; import c.z; import d.c; import d.m; import d.t; import d.u; import java.io.IOException; import java.lang.ref.Reference; import java.net.ConnectException; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Socket; import java.net.SocketTimeoutException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLSocketFactory; public final class b extends d.b implements c.i { public Socket b; public volatile d c; public int d; public d.e e; public d.d f; public int g; public final List<Reference<c.a.b.r>> h = new ArrayList(); public boolean i; public long j = Long.MAX_VALUE; private final ad k; private Socket l; private q m; private x n; public b(ad ad2) { this.k = ad2; } private void a(int n2, int n3) throws IOException { z z2 = this.e(); s s2 = z2.a(); String string = "CONNECT " + i.a(s2, true) + " HTTP/1.1"; block4 : do { c.a.b.d d2 = new c.a.b.d(null, this.e, this.f); this.e.timeout().timeout(n2, TimeUnit.MILLISECONDS); this.f.timeout().timeout(n3, TimeUnit.MILLISECONDS); d2.a(z2.c(), string); d2.c(); ab ab2 = d2.d().a(z2).a(); long l2 = c.a.b.j.a(ab2); if (l2 == -1) { l2 = 0; } t t2 = d2.b(l2); i.b(t2, Integer.MAX_VALUE, TimeUnit.MILLISECONDS); t2.close(); switch (ab2.b()) { default: { throw new IOException("Unexpected response code for CONNECT: " + ab2.b()); } case 200: { if (this.e.b().f() && this.f.b().f()) break block4; throw new IOException("TLS tunnel buffered too many bytes!"); } case 407: { if ((z2 = this.k.a().d().a(this.k, ab2)) != null) continue block4; throw new IOException("Failed to authenticate with proxy"); } } break; } while (true); } /* * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation */ private void a(int n2, int n3, int n4, a a2) throws IOException { this.l.setSoTimeout(n3); try { g.a().a(this.l, this.k.c(), n2); } catch (ConnectException var5_6) { throw new ConnectException("Failed to connect to " + (Object)this.k.c()); } this.e = m.a((t)m.b((Socket)this.l)); this.f = m.a((d.s)m.a((Socket)this.l)); if (this.k.a().i() != null) { this.a(n3, n4, a2); } else { this.n = x.b; this.b = this.l; } if (this.n != x.c && this.n != x.d) { this.g = 1; return; } this.b.setSoTimeout(0); d d2 = new d.a(true).a(this.b, this.k.a().a().f(), this.e, this.f).a(this.n).a(this).a(); d2.d(); this.g = d2.b(); this.c = d2; } /* * Exception decompiling */ private void a(int var1_1, int var2_2, a var3_3) throws IOException { // This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. // java.util.ConcurrentModificationException // java.util.LinkedList$ReverseLinkIterator.next(LinkedList.java:217) // org.benf.cfr.reader.bytecode.analysis.structured.statement.Block.extractLabelledBlocks(Block.java:212) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement$LabelledBlockExtractor.transform(Op04StructuredStatement.java:485) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.transform(Op04StructuredStatement.java:639) // org.benf.cfr.reader.bytecode.analysis.structured.statement.StructuredDo.transformStructuredChildren(StructuredDo.java:53) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement$LabelledBlockExtractor.transform(Op04StructuredStatement.java:487) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.transform(Op04StructuredStatement.java:639) // org.benf.cfr.reader.bytecode.analysis.structured.statement.Block.transformStructuredChildren(Block.java:378) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement$LabelledBlockExtractor.transform(Op04StructuredStatement.java:487) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.transform(Op04StructuredStatement.java:639) // org.benf.cfr.reader.bytecode.analysis.structured.statement.StructuredCatch.transformStructuredChildren(StructuredCatch.java:72) // org.benf.cfr.reader.bytecode.analysis.structured.statement.StructuredTry.transformStructuredChildren(StructuredTry.java:81) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement$LabelledBlockExtractor.transform(Op04StructuredStatement.java:487) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.transform(Op04StructuredStatement.java:639) // org.benf.cfr.reader.bytecode.analysis.structured.statement.Block.transformStructuredChildren(Block.java:378) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement$LabelledBlockExtractor.transform(Op04StructuredStatement.java:487) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.transform(Op04StructuredStatement.java:639) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.insertLabelledBlocks(Op04StructuredStatement.java:649) // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:816) // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:220) // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:165) // org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:91) // org.benf.cfr.reader.entities.Method.analyse(Method.java:354) // org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:751) // org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:683) // org.benf.cfr.reader.Main.doJar(Main.java:128) // com.njlabs.showjava.processor.JavaExtractor$1.run(JavaExtractor.java:100) // java.lang.Thread.run(Thread.java:841) throw new IllegalStateException("Decompilation failed"); } private z e() throws IOException { return new z.a().a(this.k.a().a()).a("Host", i.a(this.k.a().a(), true)).a("Proxy-Connection", "Keep-Alive").a("User-Agent", j.a()).a(); } @Override public ad a() { return this.k; } /* * Exception decompiling */ public void a(int var1_1, int var2_2, int var3_3, List<k> var4_4, boolean var5_5) throws o { // This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. // org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 4[UNCONDITIONALDOLOOP] // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:394) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:446) // org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:2859) // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:805) // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:220) // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:165) // org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:91) // org.benf.cfr.reader.entities.Method.analyse(Method.java:354) // org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:751) // org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:683) // org.benf.cfr.reader.Main.doJar(Main.java:128) // com.njlabs.showjava.processor.JavaExtractor$1.run(JavaExtractor.java:100) // java.lang.Thread.run(Thread.java:841) throw new IllegalStateException("Decompilation failed"); } @Override public void a(d d2) { this.g = d2.b(); } @Override public void a(e e2) throws IOException { e2.a(c.a.a.a.k); } /* * Unable to fully structure code * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation * Lifted jumps to return sites */ public boolean a(boolean var1_1) { var2_2 = true; if (this.b.isClosed() != false) return false; if (this.b.isInputShutdown() != false) return false; if (this.b.isOutputShutdown()) { return false; } if (this.c != null) return var2_2; if (var1_1 == false) return var2_2; var5_3 = this.b.getSoTimeout(); this.b.setSoTimeout(1); var7_4 = this.e.f(); if (!var7_4) ** GOTO lbl20 { catch (Throwable var6_5) { this.b.setSoTimeout(var5_3); throw var6_5; } } try { this.b.setSoTimeout(var5_3); return false; lbl20: // 1 sources: this.b.setSoTimeout(var5_3); return var2_2; } catch (IOException var3_6) { return false; } catch (SocketTimeoutException var4_7) { return var2_2; } } public void b() { i.a(this.l); } public Socket c() { return this.b; } public q d() { return this.m; } /* * Enabled force condition propagation * Lifted jumps to return sites */ public String toString() { Object object; StringBuilder stringBuilder = new StringBuilder().append("Connection{").append(this.k.a().a().f()).append(":").append(this.k.a().a().g()).append(", proxy=").append((Object)this.k.b()).append(" hostAddress=").append((Object)this.k.c()).append(" cipherSuite="); if (this.m != null) { object = this.m.a(); do { return stringBuilder.append(object).append(" protocol=").append((Object)this.n).append('}').toString(); break; } while (true); } object = "none"; return stringBuilder.append(object).append(" protocol=").append((Object)this.n).append('}').toString(); } }
[ "kriartds@gmail.com" ]
kriartds@gmail.com
59e472601d1f738af1b27e21ba3f58f43bc373b8
939806802fff04ac00ffb0a85a07af65e451a2ed
/app/src/test/java/com/example/sereg/ortnec/OrtnecTest.java
bd1ab8c818cff4f5284ae7ebbdd4bb445cb21cf0
[]
no_license
Seregani4/MobileAppium
685eb93b20cf794b2861d85a8f2e775a2f61fc98
c3f4281d1d20436a085a259e0aeccafd225431cd
refs/heads/master
2020-07-05T05:00:33.920087
2019-08-15T11:41:48
2019-08-15T11:41:48
202,530,522
0
0
null
null
null
null
UTF-8
Java
false
false
1,660
java
package com.example.sereg.ortnec; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import io.appium.java_client.AppiumDriver; public class OrtnecTest { private WebDriver driver; AppiumDriver appiumDriver; @Before public void setUp() throws MalformedURLException { DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability("deviceName", "Meizu m3 note"); cap.setCapability("udid", "emulator-5554"); cap.setCapability("platformName", "Android"); cap.setCapability(CapabilityType.VERSION, "5.1"); cap.setCapability("appPackage", "com.example.android.contactmanager"); cap.setCapability("appActivity", "com.example.android.contactmanager.ContactManager"); URL url = new URL("http://0.0.0.0:4723/wd/hub"); driver = new RemoteWebDriver(url, cap); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); } @Test public void FirstTest() throws InterruptedException { System.out.print("first test"); File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); System.out.print(scrFile); Thread.sleep(30000); } @After public void End() {driver.quit();} }
[ "skorniiuk@peoplenetonline.com" ]
skorniiuk@peoplenetonline.com
6c40e4addd7bff9c6057a96171e383ae991bdd00
ff0c33ccd3bbb8a080041fbdbb79e29989691747
/java.xml/com/sun/org/apache/bcel/internal/generic/POP.java
c9b8241367d7ab5d6e029e782fec32e84a8e66d8
[]
no_license
jiecai58/jdk15
7d0f2e518e3f6669eb9ebb804f3c89bbfb2b51f0
b04691a72e51947df1b25c31175071f011cb9bbe
refs/heads/main
2023-02-25T00:30:30.407901
2021-01-29T04:48:33
2021-01-29T04:48:33
330,704,930
0
1
null
null
null
null
UTF-8
Java
false
false
1,775
java
/* * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ /* * 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 com.sun.org.apache.bcel.internal.generic; /** * POP - Pop top operand stack word * * <PRE>Stack: ..., word -&gt; ...</PRE> * */ public class POP extends StackInstruction implements PopInstruction { public POP() { super(com.sun.org.apache.bcel.internal.Const.POP); } /** * Call corresponding visitor method(s). The order is: * Call visitor methods of implemented interfaces first, then * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ @Override public void accept( final Visitor v ) { v.visitStackConsumer(this); v.visitPopInstruction(this); v.visitStackInstruction(this); v.visitPOP(this); } }
[ "caijie2@tuhu.cn" ]
caijie2@tuhu.cn
48bd6fe90effdcb341a17d12e19999c36e4507bd
52b6e2e0d9cd5cc427048eecc04873aee3d9ce1c
/registry/src/main/java/cn/demo/discovery/RegistryApplication.java
bc289696558a97e24aff1afb721571ee3f88fc98
[]
no_license
scjakehuang/spring-cloud-demo-master
ffc0efad536488f186cd11c37eeb6885444497bb
82a946a1d2fd450fc7d3116eea279d4079067270
refs/heads/master
2021-05-15T15:27:57.532618
2017-10-18T08:44:24
2017-10-18T08:44:24
107,381,729
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package cn.demo.discovery; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * @Author: Leo * @Blog: http://blog.csdn.net/lc0817 * @CreateTime: 2016/11/21 22:49 * @Description: */ @SpringBootApplication @EnableEurekaServer public class RegistryApplication { public static void main(String[] args) { SpringApplication.run(RegistryApplication.class, args); } }
[ "admin@huangjiakai.local" ]
admin@huangjiakai.local