query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
Test for unsharing unshared/unowned secret | @Test(expected=UnauthorizedException.class)
public void testH(){
System.out.println("Test H");
UUID aliceSecret = secretService.storeSecret("Alice", new Secret());
secretService.shareSecret("Alice", aliceSecret, "Bob");
secretService.unshareSecret("Carl", aliceSecret, "Bob");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean exclude(V1Secret secret);",
"public boolean isSecret() {\r\n \treturn false;\r\n }",
"boolean isSecretValid();",
"private boolean isAutoRemoveUnknownShares(Session session) {\n Property property = XctxFileStorageProperties.AUTO_REMOVE_UNKNOWN_SHARES;\n try {\n return se... | [
"0.62655663",
"0.6219838",
"0.5689978",
"0.55525416",
"0.5459195",
"0.5442448",
"0.5436825",
"0.53752375",
"0.53640544",
"0.5345199",
"0.5345199",
"0.5335326",
"0.5330633",
"0.5307535",
"0.530163",
"0.5293975",
"0.52827215",
"0.52638954",
"0.522999",
"0.5202327",
"0.51921934"... | 0.565288 | 3 |
Test for sharing secret after being unshared | @Test(expected=UnauthorizedException.class)
public void testI(){
System.out.println("Test I");
UUID aliceSecret = secretService.storeSecret("Alice", new Secret());
secretService.shareSecret("Alice", aliceSecret, "Bob");
secretService.shareSecret("Bob", aliceSecret, "Carl");
secretService.unshareSecret("Alice", aliceSecret, "Bob");
secretService.shareSecret("Bob", aliceSecret, "Carl");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isSecret() {\r\n \treturn false;\r\n }",
"@Test\n\tpublic void testG(){\n\t\tSystem.out.println(\"Test G\");\n\t\tUUID aliceSecret = secretService.storeSecret(\"Alice\", new Secret());\n\t\tsecretService.shareSecret(\"Alice\", aliceSecret, \"Bob\");\n\t\tsecretService.shareSecret(\"Bob\", al... | [
"0.6457496",
"0.6344973",
"0.6052988",
"0.60226506",
"0.5980411",
"0.5872105",
"0.58621216",
"0.5861862",
"0.5848139",
"0.5825374",
"0.58008176",
"0.57960176",
"0.5795711",
"0.5785222",
"0.572598",
"0.5705418",
"0.5705418",
"0.5700927",
"0.5654493",
"0.5610085",
"0.56047076",... | 0.5348561 | 30 |
Test for secret id generation at store location | @Test
public void testJ(){
System.out.println("Test J");
UUID aliceSecret1 = secretService.storeSecret("Alice", new Secret());
UUID aliceSecret2 = secretService.storeSecret("Alice", new Secret());
boolean isSameSecretId = (aliceSecret1==aliceSecret2);
Assert.assertEquals(false, isSameSecretId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int generateSecret() {\n int secret = secretGenerator.nextInt();\n while (secretToNumber.containsKey(secret)) {\n secret = secretGenerator.nextInt();\n }\n return secret;\n }",
"void touchSecret(Long secretId);",
"String getSecret();",
"public abstract String... | [
"0.6614614",
"0.627518",
"0.6183895",
"0.6162695",
"0.61179876",
"0.60762924",
"0.60283947",
"0.60218775",
"0.597531",
"0.59392655",
"0.5919228",
"0.5899379",
"0.58304155",
"0.5819255",
"0.5793551",
"0.57893515",
"0.5765938",
"0.5761551",
"0.57270366",
"0.5716349",
"0.5700993... | 0.52176255 | 77 |
Fin del metodo insertMarca | public static void updateTorre(int id, int idEst, int idTipoT, double altura, int idEstado, int idUbica) {
Connection conn = Menu_Principal.conn;
PreparedStatement pstmt = null;
String q_UpTorre = "UPDATE tor_torre\n"
+ "SET id_estacion = ?,\n"
+ " id_tipo_torre = ?,\n"
+ " altura = ?,\n"
+ " id_estado = ?,\n"
+ " id_tipo_ubica = ?\n"
+ "WHERE\n"
+ " id_torre = ?;";
try {
pstmt = conn.prepareStatement(q_UpTorre);
pstmt.setInt(1, idEst);
pstmt.setInt(2, idTipoT);
pstmt.setDouble(3, altura);
pstmt.setInt(4, idEstado);
pstmt.setInt(5, idUbica);
pstmt.setInt(6, id);
pstmt.executeUpdate();
conn.commit();
JOptionPane.showMessageDialog(null, "El registro se actualizo correctamente", "Información", JOptionPane.INFORMATION_MESSAGE);
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "No se pudo completar la operación.", "Error", JOptionPane.ERROR_MESSAGE);
// System.err.println("Fallo UPDATE Modelo Radio: " + e.getClass().getName() + ": " + e.getMessage());
} // Fin de try...catch
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void insertar() {\n try {\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n ... | [
"0.7256392",
"0.720825",
"0.7102131",
"0.7072877",
"0.7033667",
"0.7025852",
"0.6964012",
"0.6957671",
"0.69127935",
"0.68347627",
"0.68347025",
"0.6755297",
"0.67361456",
"0.6733178",
"0.673277",
"0.67301506",
"0.6696881",
"0.6672045",
"0.66684175",
"0.6649219",
"0.6641134",... | 0.0 | -1 |
Fin del metodo update | public static void deleteTorre(int id) {
Connection conn = Menu_Principal.conn;
PreparedStatement pstmt = null;
String q_DeTorre = "DELETE\n"
+ "FROM\n"
+ " tor_torre\n"
+ "WHERE\n"
+ " id_torre = ?";
try {
pstmt = conn.prepareStatement(q_DeTorre);
pstmt.setInt(1, id);
pstmt.executeUpdate();
conn.commit();
// JOptionPane.showMessageDialog(null, "El registro se elimino correctamente", "Información", JOptionPane.INFORMATION_MESSAGE);
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "No se pudo completar la operación.", "Error", JOptionPane.ERROR_MESSAGE);
// System.err.println("Fallo DELETE Torre: " + e.getClass().getName() + ": " + e.getMessage());
} // Fin de try...catch
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic void update(Metodologia metodologia,String name) {\n\t\t\t\n\t\t}",
"public void update(TheatreMashup todo) {\n\t\t\n\t}",
"Motivo update(Motivo update);",
"public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentac... | [
"0.74287397",
"0.7031558",
"0.6972334",
"0.6801688",
"0.66988933",
"0.66753227",
"0.657845",
"0.6567615",
"0.65239376",
"0.65055096",
"0.64621043",
"0.6452449",
"0.64336604",
"0.64166594",
"0.64080876",
"0.6407647",
"0.64034325",
"0.6362246",
"0.6357102",
"0.6334179",
"0.6334... | 0.0 | -1 |
This method will add products to database | @Override
public void addProduct(Product product) throws DataBaseAccessException {
LOGGER.debug("Inserting a single row into a database table");
LOGGER.info("values of product " + product.getProductId());
Object[] insert = new Object[] { product.getProductId(), product.getProductName(),
product.getProductCategory() };
try {
jdbcTemplate.update(INSERT_PRODUCT, insert);
} catch (DataAccessException e) {
throw new DataBaseAccessException("unable to do the transaction " + e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage(... | [
"0.77637553",
"0.7647914",
"0.7533365",
"0.75219005",
"0.7422749",
"0.7320684",
"0.7306453",
"0.7233462",
"0.7216995",
"0.72069025",
"0.71514887",
"0.708906",
"0.70742273",
"0.7048061",
"0.70473194",
"0.7037867",
"0.70282525",
"0.70073354",
"0.70072025",
"0.6994199",
"0.69879... | 0.695618 | 22 |
/ Write a method to return the Factorial of any given number using Recursion as well as Iteration Factorial of 5! = 5 x 4 X 3 X 2 X 1 = 120 | public static void main(String[] args) {
System.out.println(getFactorial(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int factorial(int n){\n return (n==1||n==0)?1: n*factorial(n-1);\n }",
"public static int recursiveFactorial(int num){\n\n //base case\n if(num == 0){\n return 1;\n }\n\n //recursive call\n return num * recursiveFactorial(num-1);\n\n //int 3 ... | [
"0.7788445",
"0.7732056",
"0.77240413",
"0.7679146",
"0.76237744",
"0.7564138",
"0.75566006",
"0.7546583",
"0.7531764",
"0.74923027",
"0.7374531",
"0.73592263",
"0.7346676",
"0.7328176",
"0.7301605",
"0.7301153",
"0.7275669",
"0.72529805",
"0.7252576",
"0.7181027",
"0.7161732... | 0.0 | -1 |
Finds the best bid price (on a random stock) and places a limit sell order for a unit(1) less than price. Quantity sold is a random amount. | private void performMarginalSellOrder(
StockExchangeLevel1View traderMarketView) {
Stock randomStock = chooseElement(inventory.keySet(), random);
Long bestBidPrice =
traderMarketView.getBestBidPrice(randomStock);
Long price = bestBidPrice - 1l;
Integer quantity = random.nextInt(inventory.get(randomStock));
DefaultLimitSellOrder defaultLimitSellOrder = new DefaultLimitSellOrder(this, randomStock, quantity, price);
traderMarketView.placeLimitSellOrder(defaultLimitSellOrder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void sell(double limitPrice, int quantity) {\n Boolean allSold = false;\n Iterator iter1 = buyOrders.entrySet().iterator();\n while(iter1.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry)iter1.next();\n if(limitPrice <= (Double)entry.getKey()) {\... | [
"0.64804703",
"0.6380807",
"0.62807316",
"0.6268548",
"0.6233725",
"0.62040985",
"0.6107925",
"0.6017614",
"0.6005493",
"0.59837097",
"0.5940109",
"0.5923356",
"0.59173346",
"0.5875461",
"0.5869048",
"0.58648413",
"0.5800475",
"0.57948095",
"0.57518965",
"0.5749743",
"0.57235... | 0.63159305 | 2 |
Finds the best sell price and then places a limit buy order for a unit (1) more than it. Maximum quantity of the stock is bought. | private void performMarginalBuyOrder(
StockExchangeLevel1View traderMarketView) {
Stock randomStock = chooseElement(inventory.keySet(), random);
Long bestOfferPrice =
traderMarketView.getBestOfferPrice(randomStock);
Long buyPrice = bestOfferPrice + 1l;
Integer quantity = (int) (getCash() / buyPrice);
DefaultLimitBuyOrder defaultLimitBuyOrder = new DefaultLimitBuyOrder(this, randomStock, quantity, buyPrice);
traderMarketView.placeLimitBuyOrder(defaultLimitBuyOrder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void sell(double limitPrice, int quantity) {\n Boolean allSold = false;\n Iterator iter1 = buyOrders.entrySet().iterator();\n while(iter1.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry)iter1.next();\n if(limitPrice <= (Double)entry.getKey()) {\... | [
"0.66107327",
"0.6582298",
"0.65216446",
"0.65099883",
"0.62693775",
"0.6214525",
"0.6165436",
"0.61614937",
"0.6152644",
"0.60712653",
"0.60093975",
"0.60067564",
"0.59573597",
"0.59467447",
"0.59397316",
"0.5905548",
"0.5875686",
"0.58674127",
"0.58442414",
"0.5817678",
"0.... | 0.5528024 | 55 |
provide a default adapter factory as fallback if no specific adapter factory was found | @Override
protected IAdapterFactory getDefaultAdapterFactory(Object type) {
return defaultAdapterFactory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic <T> T getAdapter(Class<T> adapter) {\n\t\t\treturn null;\n\t\t}",
"@Override\n\tpublic Object getAdapter(Class adapter) {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic Object getAdapter(Class adapter) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic Object getAdapter(Class adapter)... | [
"0.67577696",
"0.6691049",
"0.6672488",
"0.6672488",
"0.6670123",
"0.63572156",
"0.6278052",
"0.6195026",
"0.6086534",
"0.6036721",
"0.6011803",
"0.6002549",
"0.5951158",
"0.59394497",
"0.5836915",
"0.5813191",
"0.5797803",
"0.579234",
"0.57554215",
"0.57423633",
"0.5728324",... | 0.76950145 | 0 |
use key to make adapter set session scoped | @Override
public IAdapterSet adapters() {
IContext context = contextProvider.get();
ISession session = context.getSession();
Key key = (Key) session.getAttribute(Key.class.getName());
if (key == null) {
key = new Key();
session.setAttribute(Key.class.getName(), key);
}
Map<Object, IAdapterSet> adapterSets = sessionScopedAdapterSets.get();
if (adapterSets == null) {
synchronized (sessionScopedAdapterSets) {
adapterSets = sessionScopedAdapterSets.get();
if (adapterSets == null) {
adapterSets = Collections
.synchronizedMap(new WeakHashMap<Object, IAdapterSet>());
sessionScopedAdapterSets.set(adapterSets);
}
}
}
IAdapterSet adapterSet = adapterSets.get(key);
if (adapterSet == null) {
synchronized (adapterSets) {
adapterSet = adapterSets.get(key);
if (adapterSet == null) {
adapterSet = new AdapterSet(getBehaviourDelegate());
adapterSets.put(key, adapterSet);
initializeAdapters();
}
}
}
return adapterSet;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\npublic void setSession(Map<String, Object> arg0) {\n\t\r\n}",
"@Override\n\tpublic void setSession(Map<String, Object> s) {\n\t\tsession = s;\n\t}",
"public BladeController setSessionAttr(String key, Object value) {\n\t\tSession session = getSession();\n\t\tsession.setAttribute(key, value);\n\t\tr... | [
"0.65429157",
"0.6406655",
"0.63801473",
"0.6297543",
"0.6275009",
"0.6273525",
"0.6217369",
"0.6217369",
"0.6214304",
"0.6173983",
"0.61625624",
"0.6152049",
"0.61404765",
"0.6136101",
"0.6105077",
"0.6093362",
"0.6084165",
"0.60795933",
"0.6072802",
"0.6070173",
"0.60652953... | 0.6210299 | 9 |
Create the command stack that will notify this editor as commands are executed. | protected void initializeAdapters() {
EditingDomainCommandStack commandStack = new EditingDomainCommandStack();
AdapterFactoryEditingDomain editingDomain = new AdapterFactoryEditingDomain(
createAdapterFactory(), commandStack, getBehaviourDelegate()) {
public boolean isReadOnly(IModel model) {
URI user = SecurityUtil.getUser();
if (user != null
&& model.getModelSet() instanceof ISecureModelSet
&& ((ISecureModelSet) model.getModelSet())
.writeModeFor((IReference) model, user) == null) {
return true;
}
return super.isReadOnly(model);
}
};
commandStack.setEditingDomain(editingDomain);
// editingDomain
// .setModelToReadOnlyMap(new java.util.WeakHashMap<IModel, Boolean>());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Commands createCommands();",
"protected CommandStack getCommandStack() {\n\t\tIEditorPart activeJRXMLEditor = SelectionHelper.getActiveJRXMLEditor();\n\t\tif (activeJRXMLEditor != null && activeJRXMLEditor instanceof JrxmlEditor) {\n\t\t\tJrxmlEditor editor = (JrxmlEditor)activeJRXMLEditor;\n\t\t\treturn (Comman... | [
"0.64771044",
"0.63285184",
"0.62566763",
"0.6245198",
"0.6094941",
"0.6087035",
"0.60621256",
"0.60569125",
"0.60099214",
"0.59884167",
"0.57806903",
"0.57359743",
"0.57139945",
"0.5693878",
"0.56555974",
"0.5632985",
"0.56244594",
"0.555957",
"0.55584246",
"0.54780835",
"0.... | 0.0 | -1 |
Calculates sizes using the fontSize parameter. Creates the instance if necessary. improves the button size if font metrics are available. | public static void createInstance(final double fontSize) {
if (instance == null) {
synchronized (CONSTRUCT) {
instance = new UIParameters();
}
}
instance.calcSizes(fontSize);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calcSizes(final double fontSize) {\n adjustedButtonSize = false;\n // Create a temporary check box and get its height\n if (!EtomoDirector.INSTANCE.getArguments().isHeadless()) {\n JCheckBox temp = new JCheckBox();\n checkboxHeight = temp.getPreferredSize().getHeight();\n }\n ... | [
"0.72253484",
"0.67286146",
"0.65797895",
"0.64767927",
"0.6421822",
"0.64166147",
"0.63768077",
"0.6256014",
"0.6195562",
"0.61776984",
"0.6105877",
"0.60780233",
"0.5928791",
"0.59040976",
"0.5877967",
"0.58444786",
"0.58314747",
"0.5811469",
"0.5785486",
"0.5775746",
"0.57... | 0.67266977 | 2 |
Calls createInstance if the instance is null. Returns the instance. Will never return null. | public static UIParameters getInstance() {
if (instance == null) {
createInstance(DEFAULT_FONT_SIZE);
}
return instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Instance createInstance();",
"@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"@Override\n... | [
"0.6960463",
"0.6900893",
"0.6658128",
"0.660561",
"0.63863957",
"0.6297111",
"0.6232176",
"0.6186484",
"0.61594707",
"0.60114765",
"0.59295934",
"0.5924311",
"0.59157753",
"0.5869708",
"0.58291996",
"0.57735336",
"0.57734674",
"0.57217103",
"0.57134056",
"0.5678496",
"0.5649... | 0.0 | -1 |
Returns the singleton instance with a better button size based on font metrics. The improved button size is calculated when font metrics are set. It is calculated again if font size is later reset. Function will never return null. Calls createInstance if instance is null. Uses the default font size. Font metrics only affects the button size the first time it is set. | public static UIParameters getInstance(final FontMetrics buttonFontMetrics) {
UIParameters.buttonFontMetrics = buttonFontMetrics;
if (instance == null) {
createInstance(DEFAULT_FONT_SIZE);
return instance;
}
if (!adjustedButtonSize && buttonFontMetrics != null) {
synchronized (CONSTRUCT) {
instance.improveButtonSize(buttonFontMetrics);
}
}
return instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static UIParameters getInstance() {\n if (instance == null) {\n createInstance(DEFAULT_FONT_SIZE);\n }\n return instance;\n }",
"public static void createInstance(final double fontSize) {\n if (instance == null) {\n synchronized (CONSTRUCT) {\n instance = new UIParameters();\... | [
"0.6827523",
"0.6372449",
"0.5772929",
"0.5692918",
"0.54885745",
"0.5398223",
"0.5305382",
"0.5254922",
"0.5199928",
"0.51235026",
"0.5098264",
"0.5021147",
"0.49608186",
"0.4951778",
"0.49328834",
"0.49132076",
"0.48746616",
"0.48441485",
"0.48350206",
"0.4824974",
"0.47931... | 0.67280346 | 1 |
Only the multiline button size is recalculated based on font metrics. | public static boolean needButtonFontMetrics() {
return !adjustedButtonSize;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void improveButtonSize(final FontMetrics fontMetrics) {\n if (fontMetrics == null) {\n return;\n }\n adjustedButtonSize = true;\n int textHeight = fontMetrics.getHeight();\n System.err.println(\"button text height:\" + textHeight);\n double heightAdjustment = (double) textHeight / DE... | [
"0.7506066",
"0.6478282",
"0.6462733",
"0.6456114",
"0.5984832",
"0.5880198",
"0.57240486",
"0.57125694",
"0.5701882",
"0.5682508",
"0.56777495",
"0.563554",
"0.5617898",
"0.56128204",
"0.5579652",
"0.5574967",
"0.5574639",
"0.55682",
"0.5567878",
"0.5559441",
"0.5510723",
... | 0.6559865 | 1 |
Return the size of a standard button | Dimension getButtonDimension() {
return new Dimension(dimButton);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getButtonTextSize(){\n return buttonTextSize;\n }",
"@Override\n public java.lang.Object getUilButtonSize() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (UIL_BUTTON_SIZE_);\n return (java.lang.Object)retnValue;\n }",
"private void buttonSize(JButton b... | [
"0.782729",
"0.72978467",
"0.6737089",
"0.6728058",
"0.66674656",
"0.6537064",
"0.6282733",
"0.6244909",
"0.6210024",
"0.6190489",
"0.61521167",
"0.6138823",
"0.60810816",
"0.6059705",
"0.6023967",
"0.60156715",
"0.5987551",
"0.5987551",
"0.5981081",
"0.59576845",
"0.5939815"... | 0.76065075 | 1 |
Return a safe copy of the Dimension | Dimension getNarrowButtonDimension() {
return new Dimension(dimNarrowButton);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Dimension getDimension();",
"Dimension createDimension();",
"Dimension dimension();",
"public abstract int getDimension();",
"Dimension[] getDimension()\n\t\t{\n\t\t\treturn d;\n\t\t}",
"Dimension getDimensions();",
"Dimension_Dimension createDimension_Dimension();",
"public Dimension getSize() {\n\t... | [
"0.6692558",
"0.64486265",
"0.63255537",
"0.6319447",
"0.6162533",
"0.60678446",
"0.60236377",
"0.59527326",
"0.59523857",
"0.5948845",
"0.59372467",
"0.5927572",
"0.59017503",
"0.58724034",
"0.5867741",
"0.5867741",
"0.58597296",
"0.58452666",
"0.5810236",
"0.57804996",
"0.5... | 0.0 | -1 |
Get the amount to adjust a fields based on the current font size | double getFontSizeAdjustment() {
return fontSizeAdjustment;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float getFontSize();",
"public int getFontSize();",
"public int fontSize() {\n\t\treturn fixedFontSize;\n\t}",
"public int getFontSize()\r\n {\r\n return myFontSize;\r\n }",
"public int getFontSize()\n \t{\n \t\treturn 13;\n \t}",
"public float getTextSizePx() {\n r... | [
"0.70350087",
"0.701289",
"0.6712433",
"0.66398364",
"0.66230977",
"0.6507925",
"0.6485277",
"0.6476515",
"0.6475919",
"0.6464141",
"0.64482045",
"0.64441663",
"0.6379628",
"0.6373213",
"0.63298297",
"0.6282196",
"0.6268548",
"0.6267304",
"0.6240798",
"0.621678",
"0.6204801",... | 0.7154729 | 0 |
Sets size of objects given the current UI state. | private void calcSizes(final double fontSize) {
adjustedButtonSize = false;
// Create a temporary check box and get its height
if (!EtomoDirector.INSTANCE.getArguments().isHeadless()) {
JCheckBox temp = new JCheckBox();
checkboxHeight = temp.getPreferredSize().getHeight();
}
else {
checkboxHeight = DEFAULT_CHECKBOX_HEIGHT;
}
fontSizeAdjustment = fontSize / DEFAULT_FONT_SIZE;
dimButton.setSize(7 * checkboxHeight * fontSizeAdjustment, 2 * checkboxHeight
* fontSizeAdjustment);
dimButtonSingleLine.setSize(7 * checkboxHeight * fontSizeAdjustment, 1.25
* checkboxHeight * fontSizeAdjustment);
dimNarrowButton.setSize(4 * checkboxHeight * fontSizeAdjustment, 1.25
* checkboxHeight * fontSizeAdjustment);
dimAxisButton.setSize(3.6 * checkboxHeight * fontSizeAdjustment, 1.25
* checkboxHeight * fontSizeAdjustment);
dimSpinner.setSize(2 * checkboxHeight * fontSizeAdjustment, 1.05 * checkboxHeight
* fontSizeAdjustment);
dimFileField.setSize(20 * checkboxHeight * fontSizeAdjustment, 2 * checkboxHeight
* fontSizeAdjustment);
dimFileChooser.setSize(400 * fontSizeAdjustment, 400 * fontSizeAdjustment);
numericWidth = (int) (40 * fontSizeAdjustment);
wideNumericWidth = (int) (50 * fontSizeAdjustment);
sectionsWidth = (int) (75 * fontSizeAdjustment);
integerTripletWidth = (int) (75 * fontSizeAdjustment);
integerDoubletWidth = (int) (50 * fontSizeAdjustment);
integerWidth = (int) (30 * fontSizeAdjustment);
fourDigitWidth = (int) (40 * fontSizeAdjustment);
listWidth = (int) (140 * fontSizeAdjustment);
fileWidth = (int) (210 * fontSizeAdjustment);
// Adjust the button size if possible
if (buttonFontMetrics != null) {
instance.improveButtonSize(buttonFontMetrics);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setSize(int size);",
"public void setSize(int size) {\r\n _size = size;\r\n }",
"public void setSize(int size) {\r\n this.size = size;\r\n }",
"public void setSize(int size){\n this.size = size;\n }",
"public void setSize(int newSize);",
"public void setSize(int new... | [
"0.73108166",
"0.7089822",
"0.7034965",
"0.7033501",
"0.6998303",
"0.6998303",
"0.6980718",
"0.69716877",
"0.69484365",
"0.69484365",
"0.6930437",
"0.6930437",
"0.6930437",
"0.6930437",
"0.6918832",
"0.6900865",
"0.6829187",
"0.68057424",
"0.67566854",
"0.67414665",
"0.672709... | 0.0 | -1 |
Create a better button size based on font metrics and the longest lines of text in the multiline buttons. | private void improveButtonSize(final FontMetrics fontMetrics) {
if (fontMetrics == null) {
return;
}
adjustedButtonSize = true;
int textHeight = fontMetrics.getHeight();
System.err.println("button text height:" + textHeight);
double heightAdjustment = (double) textHeight / DEFAULT_TEXT_HEIGHT;
int maxCharsWidth = 0;
for (int i = 0; i < LONG_BUTTON_LINES.length; i++) {
maxCharsWidth =
Math.max(maxCharsWidth, fontMetrics.charsWidth(
LONG_BUTTON_LINES[i].toCharArray(), 0, LONG_BUTTON_LINES[i].length()));
}
System.err.println("button maximum characters width:" + maxCharsWidth);
double widthAdjustment = (double) maxCharsWidth / DEFAULT_MAX_CHARS_WIDTH;
dimButton.setSize(7 * checkboxHeight * widthAdjustment, 2 * checkboxHeight
* heightAdjustment);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Button createBigButton(String name, int fontSize, int cornerSize) {\n Button button = createButton(name, fontSize, cornerSize);\n button.setMaxHeight(Double.MAX_VALUE);\n button.wrapTextProperty().setValue(true);\n button.setTextAlignment(CENTER);\n return button;\n }"... | [
"0.69922984",
"0.66301036",
"0.6381796",
"0.63578755",
"0.62914246",
"0.6109874",
"0.60207194",
"0.59455055",
"0.5912965",
"0.5848699",
"0.5803282",
"0.57873636",
"0.5680166",
"0.5675705",
"0.565946",
"0.56176376",
"0.5573189",
"0.55542463",
"0.55529475",
"0.55514467",
"0.552... | 0.78936106 | 0 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof AdminPreferencesMemberAlerts)) {
return false;
}
AdminPreferencesMemberAlerts other = (AdminPreferencesMemberAlerts) object;
if ((this.adminPreferencesMemberAlertsPK == null && other.adminPreferencesMemberAlertsPK != null) || (this.adminPreferencesMemberAlertsPK != null && !this.adminPreferencesMemberAlertsPK.equals(other.adminPreferencesMemberAlertsPK))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void se... | [
"0.68948644",
"0.6837785",
"0.67038405",
"0.6639133",
"0.6639133",
"0.65911627",
"0.6576973",
"0.6576973",
"0.6573157",
"0.6573157",
"0.6573157",
"0.6573157",
"0.6573157",
"0.6573157",
"0.65598476",
"0.65598476",
"0.6543178",
"0.6523156",
"0.65143406",
"0.6486455",
"0.6475413... | 0.0 | -1 |
Creates an abstract class List instance | List() {
this.length = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract void makeList();",
"protected MyAbstractList() {\n }",
"ListType createListType();",
"private Lists() { }",
"public static <T> List<T> createList() {\n\t\treturn Collections.emptyList();\n\t}",
"public MyList() {\n this(\"List\");\n }",
"public List(String name) {\n super(n... | [
"0.80645084",
"0.7793152",
"0.77085847",
"0.73287433",
"0.72657484",
"0.71334773",
"0.7116086",
"0.70798963",
"0.70159733",
"0.69774896",
"0.6961085",
"0.69499755",
"0.69393796",
"0.69038576",
"0.6889835",
"0.6878069",
"0.68246686",
"0.679991",
"0.6786299",
"0.6781257",
"0.67... | 0.6252033 | 52 |
This method is used to access the length attribute | public int getLength() {
return this.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() { return length;\t}",
"public Integer getLength() {\n return _length;\n ... | [
"0.8580518",
"0.8580518",
"0.8580518",
"0.8560389",
"0.8557038",
"0.8557038",
"0.85531986",
"0.8524013",
"0.8524013",
"0.8519337",
"0.8500709",
"0.84984976",
"0.8494089",
"0.8492808",
"0.8492808",
"0.84738994",
"0.8460137",
"0.84535146",
"0.8448198",
"0.8443456",
"0.8443456",... | 0.83386606 | 30 |
This method returns the first element in the list | public Square getHead() {
return this.head;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public E getFirst() {\r\n\t\t// element checks to see if the list is empty\r\n\t\treturn element();\r\n\t}",
"public Object getFirst() throws ListException {\r\n\t\tif (size() >= 1) {\r\n\t\t\treturn get(1);\r\n\t\t} else {\r\n\t\t\tthrow new ListException(\"getFirst on an empty list\");\r\n\t\t}\r\n\t}",
"pub... | [
"0.8129512",
"0.80725545",
"0.8046479",
"0.7842154",
"0.78027695",
"0.7787063",
"0.7708875",
"0.7641468",
"0.7627882",
"0.76151204",
"0.75867623",
"0.75511354",
"0.7538331",
"0.74884456",
"0.7474029",
"0.74247533",
"0.7370239",
"0.7312504",
"0.73047763",
"0.7300853",
"0.72933... | 0.0 | -1 |
Iterates the list until the entered index, and returns the Square in that index | public Square getElement(int index) {
Square tmp = this.head;
for (int i = 0; i < index; i++) {
tmp = tmp.getNext();
}
return tmp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int getSquarePosition(int index) {\n return (((index/3)%3)+1)+3*(((index/9)/3)+1);\n }",
"public Square step() {\n // TODO\n \tSquare c = exploreList.getNext();\n \tSquare realSquare = sea.getSea()[c.getRow()][c.getCol()];\n // check for if we are visited, if so retur... | [
"0.7155438",
"0.64933556",
"0.601946",
"0.600791",
"0.59825724",
"0.5912832",
"0.5909375",
"0.5888539",
"0.5822553",
"0.5780689",
"0.577431",
"0.57712877",
"0.5672416",
"0.56584513",
"0.56153995",
"0.56093603",
"0.55867255",
"0.5578921",
"0.5571617",
"0.5565801",
"0.55567205"... | 0.6861804 | 1 |
This abstract method will add an element to the back of the list | public abstract void append(int data, int row, int column); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void pushBack(T value) throws ListException;",
"@Override\r\n public void addBack(T b) {\r\n head = head.addBack(b);\r\n }",
"public void addLast(E item);",
"public void addLast(E item){\r\n }",
"public void addLast(Item x);",
"public void offerBack(E elem);",
"public void add(E elem) {\n ... | [
"0.7505389",
"0.6994737",
"0.6913997",
"0.69102925",
"0.6882806",
"0.6861618",
"0.6848695",
"0.6813834",
"0.6800863",
"0.6705563",
"0.6705563",
"0.66582674",
"0.6637012",
"0.6604298",
"0.6540021",
"0.6529189",
"0.65149724",
"0.64938587",
"0.6468289",
"0.6455137",
"0.6448696",... | 0.0 | -1 |
This method is used to access the tail attribute | public Square getTail() {
return this.tail;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public T getTail() {\n\t\treturn tail.value;\n\t}",
"public Node getTail() {\n\t\treturn tail;\n\t}",
"public Node getTail() {\n\t\treturn tail;\n\t}",
"public E getTail() {\n if (isCurrent() && tail != null) { return tail.getData(); }\n else { throw new IllegalStateException(\"There is no tail... | [
"0.8039102",
"0.76259315",
"0.76259315",
"0.7621541",
"0.7455421",
"0.7360674",
"0.7334353",
"0.72561306",
"0.72145194",
"0.71925837",
"0.70882934",
"0.7038173",
"0.7029155",
"0.6964744",
"0.6926261",
"0.6921058",
"0.6920728",
"0.6881509",
"0.6873883",
"0.6707583",
"0.6668419... | 0.7075118 | 11 |
Resolve the list of selfencryption credentials. | @Nonnull protected List<Credential> resolveCredentials(
@Nonnull final ProfileRequestContext profileRequestContext) {
try {
final ArrayList<Credential> credentials = new ArrayList<>();
Iterables.addAll(credentials, credentialResolver.resolve(
new CriteriaSet(new UsageCriterion(UsageType.ENCRYPTION))));
return credentials;
} catch (final ResolverException e) {
log.error("Error resolving IdP encryption credentials", e);
return Collections.emptyList();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Nonnull protected List<Credential> getEffectiveKeyTransportCredentials(@Nonnull final CriteriaSet criteria) {\n final ArrayList<Credential> accumulator = new ArrayList<>();\n for (final EncryptionConfiguration config : criteria.get(EncryptionConfigurationCriterion.class)\n .getConfigu... | [
"0.62165666",
"0.6211099",
"0.6195532",
"0.6167291",
"0.61566466",
"0.5836996",
"0.56706417",
"0.5627245",
"0.56222904",
"0.54902613",
"0.5480401",
"0.5447935",
"0.5433993",
"0.5417018",
"0.5412071",
"0.54097265",
"0.53911614",
"0.53596586",
"0.52523494",
"0.5223677",
"0.5214... | 0.6717579 | 0 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof CommunicationsEntity)) {
return false;
}
CommunicationsEntity other = (CommunicationsEntity) object;
if ((this.communicationsPK == null && other.communicationsPK != null) || (this.communicationsPK != null && !this.communicationsPK.equals(other.communicationsPK))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void se... | [
"0.68948644",
"0.6837785",
"0.67038405",
"0.6639133",
"0.6639133",
"0.65911627",
"0.6576973",
"0.6576973",
"0.6573157",
"0.6573157",
"0.6573157",
"0.6573157",
"0.6573157",
"0.6573157",
"0.65598476",
"0.65598476",
"0.6543178",
"0.6523156",
"0.65143406",
"0.6486455",
"0.6475413... | 0.0 | -1 |
Initialize the contents of the frame. | private void initialize() {
frame = new JFrame();
frame.setBounds(0, 0, 1000, 700);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
frameContent = new JPanel();
frame.getContentPane().add(frameContent);
frameContent.setBounds(10, 10, 700, 640);
frameContent.setLayout(null);
infoPane = new JPanel();
frame.getContentPane().add(infoPane);
infoPane.setBounds(710, 10, 300, 640);
infoPane.setLayout(null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BreukFrame() {\n super();\n initialize();\n }",
"public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}",
"private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}",
"public SiscobanFrame() {\r\n\t\tsuper();\r... | [
"0.77704835",
"0.75652915",
"0.7442664",
"0.7369101",
"0.7366378",
"0.7358479",
"0.73146075",
"0.73096764",
"0.72987294",
"0.7278321",
"0.72729623",
"0.7269468",
"0.7269468",
"0.7215727",
"0.7180792",
"0.71682984",
"0.7140954",
"0.7140953",
"0.7126852",
"0.7107974",
"0.710036... | 0.72978777 | 9 |
clear the contentPane frame.getContentPane().removeAll(); frame.revalidate(); frame.repaint(); | private void easyOrAdvanced(){
clearContentPane();
JButton easyButton = new JButton();
easyButton.setFont(new Font("Arial Black", Font.PLAIN, 24));
easyButton.setText("Beginner mode");
easyButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
easyMode = true;
if(singlePlayerGame){
decidePlayerColor();
}
else{ startTwoPlayerGame(); }
}
});
frameContent.add(easyButton);
easyButton.setBounds(frameContent.getWidth()/4, frameContent.getHeight()/2 - frameContent.getHeight()/3, frameContent.getWidth()/2, frameContent.getHeight()/6);
JButton advancedButton = new JButton();
advancedButton.setFont(new Font("Arial Black", Font.PLAIN, 24));
advancedButton.setText("Advanced Mode");
advancedButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
easyMode = false;
if(singlePlayerGame){
decidePlayerColor();
}
else{ startTwoPlayerGame();}
}
});
frameContent.add(advancedButton);
advancedButton.setBounds(frameContent.getWidth()/4, frameContent.getHeight()/2 + frameContent.getHeight()/10, frameContent.getWidth()/2, frameContent.getHeight()/6);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void clear(JFrame frame){\n frame.getContentPane().removeAll();\n }",
"public void clearChildFrames();",
"public void clearContent() {\n this.contentLayout.removeAll();\n }",
"public void clearFilmPanel(){\n\t\tfilmContents.removeAll();\n\t}",
"public void limpa... | [
"0.86544037",
"0.73826283",
"0.73423004",
"0.72758937",
"0.7263813",
"0.7104625",
"0.7052419",
"0.6981167",
"0.6975855",
"0.69624376",
"0.6946836",
"0.6899971",
"0.6899275",
"0.68792444",
"0.68376416",
"0.6827605",
"0.68033814",
"0.6784603",
"0.67775357",
"0.6768142",
"0.6762... | 0.0 | -1 |
click down event. Get and highlight available moves. | public void mousePressed(MouseEvent arg0) {
selectedPiece = getPieceClicked(arg0.getX(), arg0.getY(), bd.getBoard());
boolean legalCondition1 = (playersMove && playerColor==selectedPiece.alignment );
boolean legalCondition2 = (!playersMove && playerColor!=selectedPiece.alignment);
if (legalCondition1 || legalCondition2 ){
//highlight legal moves
bd.setHighlightedMoves(selectedPiece.getAvailableMoves());
frame.repaint();
}
else{
selectedPiece = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void handleDown() {\r\n\t\tcontroller.getCurrentPosition().realocate((controller.getCurrentPosition().getY()+1), controller.getCurrentPosition().getX());\r\n\t\t// if User reaches the end of the board reset position\r\n\t\tif(controller.getCurrentPosition().getY()==GameViewController.BOARD_ROWS) {\r\n\t\t\... | [
"0.6479905",
"0.64795953",
"0.6434816",
"0.63567996",
"0.63322943",
"0.6323838",
"0.6231416",
"0.62133384",
"0.6199301",
"0.6155958",
"0.6145988",
"0.61092156",
"0.60972345",
"0.60822165",
"0.60822165",
"0.60498923",
"0.60492676",
"0.60489875",
"0.60296",
"0.60192764",
"0.601... | 0.57791734 | 53 |
translates the x,y coords of a mouse released event into using row, col numbers | private int[] getLocationReleased(int clickX, int clickY, Board bd){
int xClicked = clickX;
int yClicked = clickY;
int colNum = 0;
int rowNum = 0;
//determine colNum from x coordinate clicked
if (between(xClicked, 0, frameContent.getWidth()/5)){ colNum = 0;}
else if (between(xClicked, frameContent.getWidth()/5, frameContent.getWidth()*2/5)){ colNum = 1;}
else if (between(xClicked, frameContent.getWidth()*2/5, frameContent.getWidth()*3/5)){ colNum = 2;}
else if (between(xClicked, frameContent.getWidth()*3/5, frameContent.getWidth()*4/5)){ colNum = 3;}
else if (between(xClicked, frameContent.getWidth()*4/5, frameContent.getWidth()*5/5)){ colNum = 4;}
//determine rowNum from y coord
if (between(yClicked, 0, frameContent.getHeight()/5)){ rowNum = 0;}
else if(between(yClicked, frameContent.getHeight()/5, frameContent.getHeight()*2/5)){ rowNum = 1;}
else if(between(yClicked, frameContent.getHeight()*2/5, frameContent.getHeight()*3/5)){ rowNum = 2;}
else if(between(yClicked, frameContent.getHeight()*3/5, frameContent.getHeight()*4/5)){ rowNum = 3;}
else if(between(yClicked, frameContent.getHeight()*4/5, frameContent.getHeight()*5/5)){ rowNum = 4;}
//set appropriate release constants
releasedY = clickY;
releasedX = clickX;
releasedRow = rowNum;
releasedCol = colNum;
return new int[]{rowNum, colNum};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void mouseReleased(MouseEvent evt) {\n\t\t\t// newX = evt.getX();\n\t\t\t// newY = evt.getY();\n\t\t\t// System.out.println(newX + \" released \" + newY);\n\t\t}",
"void mouseReleased(double x, double y, MouseEvent e );",
"@Override\n public void mousePressed(MouseEvent e) {\n ... | [
"0.7085665",
"0.6925317",
"0.67979217",
"0.67979217",
"0.67979217",
"0.67770755",
"0.6738729",
"0.668201",
"0.6625823",
"0.6621268",
"0.6578505",
"0.6564202",
"0.6561703",
"0.6561703",
"0.65200216",
"0.64701325",
"0.64476633",
"0.6405898",
"0.63647425",
"0.6344668",
"0.632947... | 0.6964049 | 1 |
Image Crop Code End Here | public void EnableRuntimePermission(){
if (ActivityCompat.shouldShowRequestPermissionRationale(EditProfileActivity.this,
Manifest.permission.CAMERA))
{
Toast.makeText(getApplicationContext(),"CAMERA permission allows us to Access CAMERA app", Toast.LENGTH_LONG).show();
} else {
ActivityCompat.requestPermissions(EditProfileActivity.this,new String[]{
Manifest.permission.CAMERA}, RequestPermissionCode);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void cropImage() {\n\t\t// Use existing crop activity.\n\t\tIntent intent = new Intent(\"com.android.camera.action.CROP\");\n\t\tintent.setDataAndType(mImageCaptureUri, IMAGE_UNSPECIFIED);\n\n\t\t// Specify image size\n\t\tintent.putExtra(\"outputX\", 100);\n\t\tintent.putExtra(\"outputY\", 100);\n\n\t\t//... | [
"0.78081644",
"0.77931523",
"0.74162656",
"0.7345441",
"0.7267312",
"0.72117823",
"0.7173772",
"0.7022953",
"0.7005795",
"0.69606483",
"0.673318",
"0.6721796",
"0.66941506",
"0.665627",
"0.66546303",
"0.6622031",
"0.66014475",
"0.65958893",
"0.65450543",
"0.6541301",
"0.64635... | 0.0 | -1 |
Add Demotivator page controller test. Check redirect to login page. | @Test
public void testAddDemotivatorPageRequiresAuthentication(){
Response response = GET("/add");
assertNotNull(response);
assertStatus(302, response);
assertHeaderEquals("Location", "/secure/login", response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testAddDemotivatorPageAccessibleIFAuthorised(){\n \tFixtures.deleteAllModels();\n \tFixtures.loadModels(\"data/user.yml\");\n \t\n\t\t//Authenticating\n \tauthenticate();\n\n //Going to add Demotivator page\n \tResponse response = GET(\"/add\");\n \n asser... | [
"0.7289698",
"0.63663936",
"0.6308764",
"0.62966394",
"0.6238112",
"0.62224156",
"0.6187552",
"0.617152",
"0.61669403",
"0.61623794",
"0.60803634",
"0.6069309",
"0.6057287",
"0.6006228",
"0.59859085",
"0.5978625",
"0.5947484",
"0.5938599",
"0.5934111",
"0.5931231",
"0.5923414... | 0.71709156 | 1 |
Check add Demotivator page accessible if Authenticated | @Test
public void testAddDemotivatorPageAccessibleIFAuthorised(){
Fixtures.deleteAllModels();
Fixtures.loadModels("data/user.yml");
//Authenticating
authenticate();
//Going to add Demotivator page
Response response = GET("/add");
assertNotNull(response);
assertStatus(200, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testAddDemotivatorPageRequiresAuthentication(){\n \tResponse response = GET(\"/add\");\n \n assertNotNull(response);\n assertStatus(302, response);\n \n assertHeaderEquals(\"Location\", \"/secure/login\", response);\n }",
"@Override\n public bool... | [
"0.65996283",
"0.63173133",
"0.61604124",
"0.6057987",
"0.602754",
"0.60107845",
"0.5970665",
"0.5915992",
"0.5915334",
"0.5878828",
"0.58731633",
"0.5841354",
"0.58392155",
"0.5838915",
"0.58322555",
"0.5805543",
"0.5788188",
"0.5759546",
"0.575496",
"0.5736764",
"0.5703654"... | 0.72128105 | 0 |
Check Demotivator created. The title and text are max in size. | @Test
public void testDemotivatorCreateSuccess() throws IOException{
Fixtures.deleteAllModels();
Fixtures.loadModels("data/user.yml");
authenticate();
Map<String, String> createDemoParams = new HashMap<String, String>();
createDemoParams.put("title", THIRTY_CHARS_TITLE);
createDemoParams.put("text", EIGHTY_CHARS_TEXT);
createDemoParams.put("mode", "create");
Map<String, File> fileParams = new HashMap<String, File>();
File file = new File("test/data/image.jpg");
fileParams.put("image", file);
Response response = POST("/create", createDemoParams, fileParams);
assertStatus(200, response);
assertContentType("application/json; charset=utf-8", response);
List<Demotivator> demos = Demotivator.findAll();
assertEquals(1, demos.size());
assertEquals(THIRTY_CHARS_TITLE, demos.get(0).getTitle());
assertEquals(EIGHTY_CHARS_TEXT, demos.get(0).getText());
assertEquals("localhost", demos.get(0).getDomain().getName());
long id = demos.get(0).getId().longValue();
assertContentEquals("{\"fileName\":\"/image/thumb.test.file.name\",\"id\":\"" + id + "\",\"status\":\"success\"}", response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void enforcedTitleAndDescriptionLength() {\n logon(\"AutoTest\", \"automated\");\n\n // Start with a title and description less than 150 chars.\n String itemName = context.getFullName(FIFTY_CHARS);\n assertTrue(itemName.length() < 150);\n\n WizardPageTab wizard =\n new Contrib... | [
"0.5380299",
"0.5260861",
"0.5227154",
"0.52172834",
"0.51865715",
"0.51527214",
"0.5113531",
"0.50377953",
"0.50038433",
"0.5003556",
"0.49722177",
"0.4946249",
"0.4937299",
"0.4914101",
"0.49109468",
"0.49021184",
"0.48868307",
"0.48830494",
"0.4878972",
"0.4877371",
"0.487... | 0.6056658 | 0 |
each preset calls this method so that with future additions, no null pointer exceptions are thrown when attempting to access a feature that was not yet present when the preset was made. | public static void initializePreqs() {
list = new ArrayList<Freebody>();
trackers = new ArrayList<TrackingPoint>();
camPos=new int[3];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setFeatures(Features f) throws Exception;",
"protected abstract void initUnSupportedFeatures();",
"public boolean is_set_feature() {\n return this.feature != null;\n }",
"Feature getFeature();",
"Feature getFeature();",
"void addFeature(Feature feature);",
"@Override\n public FeatureContai... | [
"0.60066116",
"0.59885204",
"0.58631134",
"0.58465445",
"0.58465445",
"0.567274",
"0.54953516",
"0.542497",
"0.5386503",
"0.53746814",
"0.533991",
"0.5339755",
"0.5323062",
"0.531284",
"0.53068006",
"0.5289457",
"0.528696",
"0.5285368",
"0.52685064",
"0.52546877",
"0.5213738"... | 0.0 | -1 |
reminds me of a supernova? | public static ArrayList<Freebody> preset4(){
initializePreqs();
int size = 8; //radius of balls
float bounce = 1; //elasticity of balls
float drag=1;
// DRAG IS A VALUE BETWEEN 0 AND 1!! 1 would make it completely stop, by sapping
// away all velocity.
// 0.5 would reduce the speed by 1/2 each tick, and 0 is no friction
int locX,locY,locZ;
int dis=1500; //distance between the main mass and secondary masses
float invertMass=-200000; //mass of the secondary masses, negative mass makes them repel the smaller particles, not attract
float mainMass = 850000; //mass of the main Freebody.
float ratio=(-invertMass/mainMass);
int secSize=(int) ((Math.cbrt(ratio)*10*size)); //size of secondary masses; size is proportional to mass.
int worldSize=0;
if(worldSize!=0) { locX=worldSize/2;locY=worldSize/2;locZ=worldSize/2; } //location of the action, typically the middle of the scene, or where the main mass is located.
else { locX=2500;locY=2500;locZ=2500; }
//Black hole
list.add(new Freebody(0, 0, mainMass, locX,locY,locZ, (int)(size)*10, bounce, drag));
//below is secondary masses creation
//z axis offset
//list.add(new Freebody(0, 0, invertMass, locX,locY,locZ+dis, secSize, size, size, bounce, 1, Color.blue));
//list.add(new Freebody(0, 0, invertMass, locX,locY,locZ-dis, secSize, size, size, bounce, 1, Color.blue));
//x axis offset
//list.add(new Freebody(0, 0, invertMass, locX+dis,locY,locZ, secSize, size, size, bounce, drag, Color.blue));
//list.add(new Freebody(0, 0, invertMass, locX-dis,locY,locZ, secSize, size, size, bounce, drag, Color.blue));
//y axis offset
//list.add(new Freebody(0, 0, invertMass, locX,locY+dis,locZ, secSize, size, size, bounce, drag, Color.blue));
//list.add(new Freebody(0, 0, invertMass, locX,locY-dis,locZ, secSize, size, size, bounce, drag, Color.blue));
//end of large masses creation
//variable to make it easier to change the # of particles
int c=25;
//below is explaining how to setup the particles around the center mass.
//make symmetry with 1000 open space on both sides
//worldsize-2000=usable space
//c*2*d is space used by objects
//worldsize-2000=c*2*d
//d=(worldsize-2000)/(2c)
//starting x is 1000.
//y starting is so that c/2 is at locY.
//worldSize/2=y+(c/2*d)
//y starting = (worldSize/2)-(c/2*d)
//END of explanation
float d=(locX*2-2000)/(2*c);
float yStart=(locY)-((c/2)*d);
//setting the max sizes of i,j,k in the for loops.
int I=1*c;
int J=2*c;
int K=2;
//speed and angle of particles, defaulted inverted for symmetry.
int sped=500;
int ang=30;
int start=1000;
for(int i=0; i<I; i++) {
for(int j=0; j<J;j++) {
for(int k=0; k<K;k++) {
list.add(new Freebody(-sped, ang, 1, start+(int)(d*j), (int)(i*d+yStart), (int)(-k*d)+(locZ -1000), size, bounce, 0.001f));
}
}
}
for(int i=0; i<I; i++) {
for(int j=0; j<J;j++) {
for(int k=0; k<K;k++) {
list.add(new Freebody( sped, ang, 1, start+(int)(d*j), (int)(i*d+yStart), (int)(k*d)+(locZ +1000), size, bounce, 0.001f));
}
}
}
int obsInOnHalf=I*J*K; //how many particles(Freebodys) are in one "half" (presets are normally made with 2 distinct halves)
//below is to set velocities of every particle easily.
int larges=1; //set this value equal to how many large masses were made.
//vels of particles
float vX=sped,vY=sped,vZ=0;
for(int i=5; i<(obsInOnHalf)+larges;i++) {
list.get(i).setVel(vX, vY, vZ);
}
for(int i=(obsInOnHalf)+larges; i<list.size();i++) {
list.get(i).setVel(-vX, -vY, 0);
}
//set worldSize to 0 for no boundaries (unlimited universe)
uni = new WorldCreator(worldSize, worldSize, worldSize, 0,2,locX,locY,locZ);
//turns on(or off) object/object collisions, off by default.
uni.collisions(false);
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void supprimerImproductifs(){\n grammaireCleaner.nettoyNonProdGramm();\n setChanged();\n notifyObservers(\"2\");\n }",
"public void niveauSuivant() {\n niveau = niveau.suivant();\n }",
"void negarAnalise();",
"@LargeTest\n public void testVignetteApproximateRelaxed... | [
"0.54307145",
"0.52755976",
"0.52752",
"0.52703017",
"0.5247019",
"0.5225823",
"0.52192634",
"0.5070187",
"0.5044169",
"0.50182074",
"0.5008655",
"0.5002632",
"0.49551547",
"0.49478763",
"0.49438295",
"0.49232638",
"0.49121776",
"0.4903304",
"0.48950863",
"0.48924553",
"0.488... | 0.0 | -1 |
really cool "egg" kinda thing..idrk | public static ArrayList<Freebody> preset3(){
initializePreqs();
int size = 8; //radius of balls
float bounce = 1; //elasticity of balls
float drag=1;
// DRAG IS A VALUE BETWEEN 0 AND 1!! 1 would make it completely stop, by sapping
// away all velocity.
// 0.5 would reduce the speed by 1/2 each tick, and 0 is no friction
int locX,locY,locZ;
int dis=1500; //distance between the main mass and secondary masses
float invertMass=-200000; //mass of the secondary masses, negative mass makes them repel the smaller particles, not attract
float mainMass = 650000; //mass of the main Freebody.
float ratio=(-invertMass/mainMass);
int secSize=(int) ((Math.cbrt(ratio)*10*size)); //size of secondary masses; size is proportional to mass.
int worldSize=0;
if(worldSize!=0) { locX=worldSize/2;locY=worldSize/2;locZ=worldSize/2; } //location of the action, typically the middle of the scene, or where the main mass is located.
else { locX=2500;locY=2500;locZ=2500; }
//Black hole
//list.add(new Freebody(0, 0, mainMass, locX,locY,locZ, (int)(size)*10, bounce, drag));
//below is secondary masses creation
//z axis offset
//list.add(new Freebody(0, 0, invertMass, locX,locY,locZ+dis, secSize, size, size, bounce, 1, Color.blue));
//list.add(new Freebody(0, 0, invertMass, locX,locY,locZ-dis, secSize, size, size, bounce, 1, Color.blue));
//x axis offset
//list.add(new Freebody(0, 0, invertMass, locX+dis,locY,locZ, secSize, size, size, bounce, drag, Color.blue));
//list.add(new Freebody(0, 0, invertMass, locX-dis,locY,locZ, secSize, size, size, bounce, drag, Color.blue));
//y axis offset
//list.add(new Freebody(0, 0, invertMass, locX,locY+dis,locZ, secSize, size, size, bounce, drag, Color.blue));
//list.add(new Freebody(0, 0, invertMass, locX,locY-dis,locZ, secSize, size, size, bounce, drag, Color.blue));
//end of large masses creation
//variable to make it easier to change the # of particles
int c=30;
//below is explaining how to setup the particles around the center mass.
//make symmetry with 1000 open space on both sides
//worldsize-2000=usable space
//c*2*d is space used by objects
//worldsize-2000=c*2*d
//d=(worldsize-2000)/(2c)
//starting x is 1000.
//y starting is so that c/2 is at locY.
//worldSize/2=y+(c/2*d)
//y starting = (worldSize/2)-(c/2*d)
//END of explanation
float d=(locX*2-2000)/(2*c);
float yStart=(locY)-((c/2)*d);
//speed and angle of particles, defaulted inverted for symmetry.
int sped=1600;
int ang=30;
int start=1000;
for(int i=0; i<c; i++) {
for(int j=0; j<c*2;j++) {
for(int k=0; k<2;k++) {
list.add(new Freebody(-sped, ang, 1, start+(int)(d*j), (int)(i*d+yStart), (int)(-k*d)+(locZ -1000), size, bounce, 0.001f));
}
}
}
for(int i=0; i<c; i++) {
for(int j=0; j<c*2;j++) {
for(int k=0; k<2;k++) {
list.add(new Freebody( sped, ang, 1, start+(int)(d*j), (int)(i*d+yStart), (int)(k*d)+(locZ +1000), size, bounce, 0.001f));
}
}
}
int obsInOnHalf=c*c*2*2; //how many particles(Freebodys) are in one "half" (presets are normally made with 2 distinct halves)
//below is to set velocities of every particle easily.
int larges=0; //set this value equal to how many large masses were made.
for(int i=5; i<(obsInOnHalf)+larges;i++) {
list.get(i).setVel(-0, -sped/3, sped/2);
}
for(int i=(obsInOnHalf)+larges; i<list.size();i++) {
list.get(i).setVel(0, sped/3, -sped/2);
}
//set worldSize to 0 for no boundaries (unlimited universe)
uni = new WorldCreator(worldSize, worldSize, worldSize, 0,2,locX,locY,locZ);
//turns on(or off) object/object collisions, off by default.
uni.collisions(false);
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void laysEgg() {\n\t\t\n\t}",
"@Override\n\tpublic void eggHatches() {\n\t\t\n\t}",
"public void addEgg( EggAbstract x ) {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\tif (x!=null){\n\t\t\teggs.add(x);\n\t\t}\n\t}",
"public void eatEgg(Egg egg) {\n ... | [
"0.7085048",
"0.67224175",
"0.6215615",
"0.6004439",
"0.5910942",
"0.58993304",
"0.5809963",
"0.57962",
"0.5765755",
"0.5665862",
"0.5587442",
"0.55813456",
"0.5562766",
"0.555953",
"0.5554023",
"0.55486226",
"0.5540183",
"0.5539596",
"0.5535185",
"0.5477959",
"0.54340506",
... | 0.0 | -1 |
POST /opportunities : Create a new opportunity. | @PostMapping("/opportunities")
@Timed
public ResponseEntity<Opportunity> createOpportunity(@Valid @RequestBody Opportunity opportunity) throws URISyntaxException {
log.debug("REST request to save Opportunity : {}", opportunity);
if (opportunity.getId() != null) {
return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "A new opportunity cannot already have an ID")).body(null);
}
// Set the owner as the current user
Opportunity result = opportunityService.save(opportunity.ownerLogin(SecurityUtils.getCurrentUserLogin()));
return ResponseEntity.created(new URI("/api/opportunities/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@PostMapping(\"/opportunities\")\n @Timed\n public ResponseEntity<OpportunityDTO> createOpportunity(@Valid @RequestBody OpportunityDTO opportunityDTO) throws URISyntaxException {\n log.debug(\"REST request to save Opportunity : {}\", opportunityDTO);\n if (opportunityDTO.getId() != null) {\n ... | [
"0.79129225",
"0.6058106",
"0.5812332",
"0.5757868",
"0.56995636",
"0.5695448",
"0.568835",
"0.5677828",
"0.5648086",
"0.55890054",
"0.5437666",
"0.5423497",
"0.54221624",
"0.54140544",
"0.53858376",
"0.5380431",
"0.5364915",
"0.5363699",
"0.5361896",
"0.5351869",
"0.52785814... | 0.81556404 | 0 |
GET /opportunities : get all the opportunities. | @GetMapping("/opportunities")
@Timed
public ResponseEntity<List<Opportunity>> getAllOpportunities(@ApiParam Pageable pageable) {
log.debug("REST request to get a page of Opportunities");
// Send only the opportunities posed for company users , admins, student users send all
Page<Opportunity> page = opportunityService.findAllForUser(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/opportunities");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Opportunities[] findAll() throws OpportunitiesDaoException\r\n\t{\r\n\t\treturn findByDynamicSelect( SQL_SELECT + \" ORDER BY id\", null );\r\n\t}",
"@GetMapping\n public ResponseEntity<List<Opportunity>> findAll() {\n List<Opportunity> opportunityList = opportunityRepository.findAll();\n ... | [
"0.7185285",
"0.68655807",
"0.67917717",
"0.67791766",
"0.65923303",
"0.6579424",
"0.62524974",
"0.6023343",
"0.5881222",
"0.5628614",
"0.55908257",
"0.5455997",
"0.5366936",
"0.5339544",
"0.53182226",
"0.5281212",
"0.5264493",
"0.51733345",
"0.51707053",
"0.51447",
"0.513757... | 0.730906 | 0 |
GET /opportunities/:id : get the "id" opportunity. | @GetMapping("/opportunities/{id}")
@Timed
public ResponseEntity<Opportunity> getOpportunity(@PathVariable String id) {
log.debug("REST request to get Opportunity : {}", id);
Opportunity opportunity = opportunityService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(opportunity));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GetMapping(\"/opportunities/{id}\")\n @Timed\n public ResponseEntity<OpportunityDTO> getOpportunity(@PathVariable Long id) {\n log.debug(\"REST request to get Opportunity : {}\", id);\n OpportunityDTO opportunityDTO = opportunityService.findOne(id);\n return ResponseUtil.wrapOrNotFound(... | [
"0.8228266",
"0.78855014",
"0.6931533",
"0.6683847",
"0.6515546",
"0.63347256",
"0.612582",
"0.61016244",
"0.60700613",
"0.60420895",
"0.5993028",
"0.59513754",
"0.5950966",
"0.5937877",
"0.5913933",
"0.58477056",
"0.5717701",
"0.5714765",
"0.5711539",
"0.5711116",
"0.5702147... | 0.8495379 | 0 |
DELETE /opportunities/:id : delete the "id" opportunity. | @DeleteMapping("/opportunities/{id}")
@Timed
public ResponseEntity<Void> deleteOpportunity(@PathVariable String id) {
log.debug("REST request to delete Opportunity : {}", id);
opportunityService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@DeleteMapping(\"/opportunities/{id}\")\n @Timed\n public ResponseEntity<Void> deleteOpportunity(@PathVariable Long id) {\n log.debug(\"REST request to delete Opportunity : {}\", id);\n opportunityService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAle... | [
"0.87324464",
"0.6811701",
"0.6781161",
"0.66951853",
"0.65959203",
"0.6528835",
"0.65226597",
"0.64821565",
"0.6471841",
"0.64094806",
"0.6404935",
"0.64033365",
"0.6379557",
"0.6379017",
"0.6357765",
"0.6346892",
"0.6276889",
"0.6276487",
"0.627162",
"0.6265348",
"0.6258524... | 0.8728281 | 1 |
GET /opportunities/filter : get filtered opportunities | @PostMapping("/opportunities/filter")
@Timed
public ResponseEntity<List<Opportunity>> getOpportunitiesFilter(@Valid @RequestBody OpportunityFilter opportunityFilter) {
log.debug("REST request to get Opportunity for filter : {}", opportunityFilter);
List<Opportunity> results = opportunityService.findForFilter(opportunityFilter);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(results));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GetMapping(\"/opportunities\")\n @Timed\n public List<OpportunityDTO> getAllOpportunities(@RequestParam(required = false) String filter) {\n if (\"proposal-is-null\".equals(filter)) {\n log.debug(\"REST request to get all Opportunitys where proposal is null\");\n return opportun... | [
"0.77289313",
"0.63686407",
"0.5894525",
"0.57359946",
"0.5606347",
"0.5545843",
"0.55212474",
"0.5479649",
"0.5473597",
"0.54171664",
"0.53766733",
"0.5339871",
"0.5297252",
"0.52689606",
"0.5239836",
"0.523338",
"0.52290046",
"0.5216605",
"0.5152966",
"0.51186323",
"0.51179... | 0.770384 | 1 |
Remove sensitive message in flink sql | @Test
public void testMaskFlinkSql() {
String unmasked = "CREATE TABLE `table_1`(\n"
+ " PRIMARY KEY (`id`) NOT ENFORCED,\n"
+ " `id` INT,\n"
+ " `name` STRING,\n"
+ " `age` INT)\n"
+ " WITH (\n"
+ " 'inlong.metric.labels' = 'groupId=1&streamId=1&nodeId=1',\n"
+ " 'connector' = 'mysql-cdc-inlong',\n"
+ " 'hostname' = 'localhost',\n"
+ " 'database-name' = 'test',\n"
+ " 'port' = '3306',\n"
+ " 'server-id' = '10011',\n"
+ " 'scan.incremental.snapshot.enabled' = 'true',\n"
+ " 'username' = 'root',\n"
+ " 'password' = 'inlong',\n"
+ " 'table-name' = 'user'\n"
+ ")";
String masked = "CREATE TABLE `table_1`(\n"
+ " PRIMARY KEY (`id`) NOT ENFORCED,\n"
+ " `id` INT,\n"
+ " `name` STRING,\n"
+ " `age` INT)\n"
+ " WITH (\n"
+ " 'inlong.metric.labels' = 'groupId=1&streamId=1&nodeId=1',\n"
+ " 'connector' = 'mysql-cdc-inlong',\n"
+ " 'hostname' = 'localhost',\n"
+ " 'database-name' = 'test',\n"
+ " 'port' = '3306',\n"
+ " 'server-id' = '10011',\n"
+ " 'scan.incremental.snapshot.enabled' = 'true',\n"
+ " 'username' = 'root',\n"
+ " 'password' = '******',\n"
+ " 'table-name' = 'user'\n"
+ ")";
StringBuilder buffer = new StringBuilder(unmasked);
MaskDataUtils.mask(buffer);
assertEquals(masked, buffer.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String filterMessage(String message) {\n\t\treturn Jsoup.parse(message).text();\n\t}",
"List selectByExampleWithoutBLOBs(TbMessageExample example);",
"public static String cleanUserTextFromMessage(String s, Map<String, String> params) {\n if (params.getOrDefault(\"inputLogging\", \"\").equals... | [
"0.5622101",
"0.53561777",
"0.5247479",
"0.51445186",
"0.5144427",
"0.5088982",
"0.4818794",
"0.4806102",
"0.46830133",
"0.46205625",
"0.46079937",
"0.46051598",
"0.4590301",
"0.4576269",
"0.45648438",
"0.45588073",
"0.45578942",
"0.4531693",
"0.45120078",
"0.45082068",
"0.44... | 0.5806226 | 0 |
Sets the content view to the activity_main layout. This will also initialise any UI elements, and control core behaviour of the main activity. Reminders.getInstance this is for newly signed up users, and for users using a previous version of the app we need to schedule the reminder for them. | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mInAppMessaging = FirebaseInAppMessaging.getInstance();
mInAppMessaging.setAutomaticDataCollectionEnabled(true);
mInAppMessaging.setMessagesSuppressed(false);
Button remindersDebugButton = findViewById(R.id.reminders_debug);
if (!BuildConfig.DEBUG) {
remindersDebugButton.setVisibility(View.GONE);
}
// For newly signed up users and existing users from previous version of the app, we need
// to schedule reminder.
Reminders.getInstance().scheduleIfNecessary(getApplicationContext());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void setView() {\n\t\tsetContentView(R.layout.activity_main);\n\t}",
"@Override\n\tpublic void setContentView() {\n\t\tsetContentView(R.layout.activity_main);\n\t}",
"void initializeUI() {\n setContentView(R.layout.activity_main);\n\n // Support action bar for older devices... | [
"0.68814766",
"0.6609394",
"0.63753104",
"0.6073283",
"0.6067761",
"0.60589594",
"0.6043976",
"0.6028945",
"0.6011005",
"0.5960797",
"0.59470844",
"0.5929129",
"0.5904095",
"0.59034705",
"0.58985066",
"0.5881233",
"0.5840657",
"0.58389217",
"0.58389217",
"0.58344424",
"0.5834... | 0.6268128 | 3 |
This is Share Receipts Button function to connect to ShareReceipts interface. | public void GotoReceipts(View view) {
mFirebaseAnalytics.logEvent("engagement_party", new Bundle());
Intent intent = new Intent(this, AddReceipt.class);
startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void addShare() {\n \t\t((InputMethodManager) this.getContext().getSystemService(\n \t\t\t\tContext.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(\n \t\t\t\tthis.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n \t\tIntent intent = new Intent(Intent.ACTION_SEND);\n \t\tArrayList<String> images = ... | [
"0.62226284",
"0.61685044",
"0.6094587",
"0.5985229",
"0.5975268",
"0.59451735",
"0.58975565",
"0.5754567",
"0.57399386",
"0.5732096",
"0.570315",
"0.5684752",
"0.5683685",
"0.56581527",
"0.5648889",
"0.55450064",
"0.55367476",
"0.5520786",
"0.5508222",
"0.5424516",
"0.536613... | 0.4978107 | 47 |
This is Online Survey Button function to link to Survey website. Placeholder URL at present | public void GoToSurvey(View view) {
String url = "https://globalobesity.com.au";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void clickSurvey() {\n driver.get(\"https://\"+MainClass.site);\n driver.findElement(survey).click();\n //Home.waitObjectLoad(3000); //forced timeout to load the survey\n }",
"HtmlPage clickSiteLink();",
"public void generateEnquireLink();",
"@Override\n public void... | [
"0.66417265",
"0.6446835",
"0.6421687",
"0.61893094",
"0.59722424",
"0.59066796",
"0.5739844",
"0.57275444",
"0.5722464",
"0.5720056",
"0.5693861",
"0.5679484",
"0.5646919",
"0.56338525",
"0.5624678",
"0.5622627",
"0.56225145",
"0.55746317",
"0.55534077",
"0.55003273",
"0.547... | 0.7289599 | 0 |
This is About GLOBE button function, to link to About screen. | public void GoToAbout(View view) {
Intent intent = new Intent(this, About.class);
startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showAbout() {\r\n\t\tshowMessage(\"About\", \" Curtis Baldwin's Intelligent Building\"); // About message created when about button\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pressed\r\n\t}",
"public void showAbout() {\n\t\t/* track \"About\" */\n\t\ttracker.trackEvent(\"Listings\", \"Click\", \"Abou... | [
"0.7873835",
"0.7649729",
"0.7453679",
"0.7427756",
"0.74193054",
"0.7393945",
"0.7369581",
"0.7329396",
"0.73225486",
"0.7300236",
"0.7297968",
"0.72607785",
"0.72230744",
"0.7184547",
"0.71783453",
"0.71667093",
"0.71461326",
"0.7146067",
"0.7143657",
"0.71421355",
"0.71185... | 0.7171578 | 15 |
Navigate to FAQ screen | public void GotoFAQ(View view) {
Intent intent = new Intent(this, FaqscreenActivity.class);
startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tgotoFAQView();\n\t\t\t}",
"public void toExamFi(View view) {\n Log.i(\"BOTTOM NAVIGATION\", \"to exam navigation item clicked\");\n Intent intent = new Intent(getApplicationContext(), ExamActivity.class);\n intent.putExtra(\"finnish\", ... | [
"0.7338206",
"0.6640001",
"0.64828295",
"0.6287064",
"0.6183546",
"0.61657214",
"0.6067972",
"0.60223085",
"0.5910925",
"0.59020835",
"0.5900911",
"0.5870903",
"0.58588856",
"0.58552223",
"0.583629",
"0.5798024",
"0.5784074",
"0.57741183",
"0.57668155",
"0.57653356",
"0.57608... | 0.766347 | 0 |
This is an OnClick method that is called when the "Logout" button is clicked in the activity. It will create a new instance of the AppDataRepo and get the signed in user, and their user ID will be updated as per the DB operation, to set isLogin for that user in the DB to "false". Once this is completed, the method will load the Login.class, and then start that activity. | @SuppressLint("StaticFieldLeak")
public void logout(View view) {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... voids) {
AppDataRepo repo = new AppDataRepo(MainActivity.this);
User user = repo.getSignedUser();
if (user != null) {
repo.updateLoginStatus(user.getUserID(), false);
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
finish();
startActivity(new Intent(MainActivity.this, Login.class));
}
}.execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void makeLogin() {\n if (enableLoginActivity && mAuth.getCurrentUser() == null) {\n startActivity(new Intent(MainActivity.this, LoginActivity.class));\n finish();\n }\n else if (!enableLoginActivity) {\n user = new User(\"johnDoe\", \"johnDoe@gmail.com\... | [
"0.70422345",
"0.70319283",
"0.6697932",
"0.65562016",
"0.6554835",
"0.6519087",
"0.64596343",
"0.64376146",
"0.64257693",
"0.6419139",
"0.64170355",
"0.64080095",
"0.64052725",
"0.6371239",
"0.6366859",
"0.6363807",
"0.6329402",
"0.6312846",
"0.6307515",
"0.62992185",
"0.629... | 0.72907364 | 0 |
Overrides the back button function on the MainActivity we don't want them going back to any past screens clicking back will now just close the app. | @Override
public void onBackPressed() {
super.onBackPressed();
finishAffinity();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onBackPressed() {\n\t\texitApplication().onClick(null);\n\t\tsuper.onBackPressed();\n\t}",
"public void onBackPressed() {\n // do nothing. We want to force user to stay in this activity and not drop out.\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tIntent intent = n... | [
"0.8347821",
"0.81042755",
"0.8038198",
"0.7960929",
"0.7937081",
"0.78702366",
"0.78702366",
"0.7863276",
"0.78493387",
"0.7841918",
"0.7831239",
"0.7831239",
"0.78108907",
"0.7800117",
"0.7789618",
"0.7789618",
"0.7789618",
"0.7786876",
"0.7784498",
"0.778103",
"0.77756816"... | 0.7667448 | 37 |
Scenario: Sign Up for Early Access | @Given("landing page {string}")
public void landingPage(String string) {
open(variables.URL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@When(\"^I sign up$\")\n\tpublic void i_sign_up() {\n\t\n\t}",
"@When(\"^the user opens linked sigup page$\")\r\n\tpublic void the_user_opens_linked_sigup_page() throws Throwable {\n\tsign.linkedin_signup();\r\n\t\t\r\n\t}",
"@Then(\"^the user enter the email or phone number and password$\")\r\n\tpublic void t... | [
"0.6881692",
"0.6546787",
"0.635606",
"0.629405",
"0.6287453",
"0.6274527",
"0.6263799",
"0.62603384",
"0.618014",
"0.6163086",
"0.611336",
"0.60991335",
"0.60985285",
"0.6098338",
"0.6093216",
"0.60906893",
"0.6064094",
"0.605241",
"0.60488015",
"0.6033324",
"0.60232437",
... | 0.0 | -1 |
Scenario: Log in Zenio dev | @Given("open landing page {string}")
public void openLandingPage(String string) {
open(variables.URL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testLogin() {\n login(datum.junit);\n\t}",
"@When(\"^User login into the app with username and password$\")\n\tpublic void user_login_to_the_app_with_username_and_password() {\n\t\tSystem.out.println(\"User is logged\");\n\t}",
"@Given(\"I have logged in\")\r\n\tpublic void i_have_logged_in(... | [
"0.6847072",
"0.6770777",
"0.6761297",
"0.6758852",
"0.67337614",
"0.6671099",
"0.6659062",
"0.6641988",
"0.6639625",
"0.66038716",
"0.6592093",
"0.65907085",
"0.6555654",
"0.6540324",
"0.6516713",
"0.6514856",
"0.6467953",
"0.6461254",
"0.64570725",
"0.6443849",
"0.6421435",... | 0.0 | -1 |
Scenario: Open List of users | @Given("click menu button {string}")
public void clickMenuButton(String string) {
$(MenuButtons.ProfileMenuButton).click();
$(MenuButtons.AdminPopupItem).click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testListOfUsersDisplayed(){\n \t\tListView chars = solo.getView(ListView.class, 0);\n \t\tAssert.assertEquals(3, chars.getAdapter().getCount());\n \t\tsolo.finishOpenedActivities();\n \t}",
"@Test\n public void shouldListExpectedUsers() {\n OrgMembersListPage theMembersPage = open(OrgMember... | [
"0.66550195",
"0.66419053",
"0.6604677",
"0.6310387",
"0.6187253",
"0.61059177",
"0.6050063",
"0.601991",
"0.60020524",
"0.60010177",
"0.59967923",
"0.599326",
"0.5957824",
"0.59246874",
"0.59203935",
"0.590238",
"0.58516127",
"0.5816535",
"0.58036715",
"0.5802164",
"0.575016... | 0.0 | -1 |
Scenario: Open Early access list | @Given("click tab {string}")
public void clickTab(String string) {
$(page_objects.AdminPage.EarlyAccessTab).click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test(timeout = 4000)\n public void test20() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"/A_X-0;;JLT_;1IJDVA.XML\");\n FileSystemHandling.createFolder(evoSuiteFile0);\n ArrayList<Object> arrayList0 = new ArrayList<Object>();\n ... | [
"0.57844687",
"0.5559174",
"0.5518006",
"0.54327697",
"0.54171187",
"0.53998303",
"0.5366091",
"0.5361912",
"0.5361538",
"0.5332718",
"0.52966595",
"0.5264398",
"0.5253211",
"0.52463186",
"0.52389705",
"0.5212396",
"0.52065784",
"0.5206062",
"0.5201092",
"0.5194628",
"0.51941... | 0.0 | -1 |
Scenario: Check email for Early Access | @Given("click tab {string}")
public void clickEarlyAccessTab(String string) {
$(page_objects.AdminPage.EarlyAccessTab).click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\t\tvoid givenEmail_CheckForValidationForEmail_RetrunFalse() {\n\t\t\tboolean result =ValidateUserDetails.validateEmails(\"abc.xyz@bl\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}",
"@Test\n\t\tvoid givenEmail_CheckForValidationForEmail_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.valida... | [
"0.6737137",
"0.6718835",
"0.6677121",
"0.6581469",
"0.6551782",
"0.6479223",
"0.6458957",
"0.6452043",
"0.6347449",
"0.63351166",
"0.63310957",
"0.63267267",
"0.6325543",
"0.6282107",
"0.62785786",
"0.62778175",
"0.62395847",
"0.62363654",
"0.621472",
"0.6203432",
"0.6190513... | 0.0 | -1 |
Scenario: Approve user Early Acccess | @Given("click {string} Early Access button")
public void clickEarlyAccessButton(String string) {
$(page_objects.AdminPage.ApproveButton).click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void acceptRevoked() {\n /*\n * Given\n */\n var uid = UID.apply();\n var user = UserAuthorization.random();\n var granted = Instant.now();\n var privilege = DatasetPrivilege.CONSUMER;\n var executor = UserId.random();\n\n var grant... | [
"0.6808091",
"0.6682865",
"0.6596514",
"0.63985026",
"0.6323126",
"0.6291514",
"0.6257784",
"0.6176233",
"0.61037856",
"0.6080639",
"0.6068567",
"0.59960306",
"0.59899837",
"0.5923997",
"0.5922656",
"0.5900165",
"0.589959",
"0.58759964",
"0.58720344",
"0.5836857",
"0.5835256"... | 0.5821655 | 23 |
Scenario: Invite by Email | @Given("click {string} on List of Users")
public void clickOnListOfUsers(String string) {
$(page_objects.AdminPage.InviteButton).click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@When(\"Enter customer EMail\")\npublic void enter_customer_e_mail() {\n\tlogger.info(\"******Searching customer by email id********\");\n searchCust = new SearchCustomerPage(driver);\n searchCust.setEmail(\"victoria_victoria@nopCommerce.com\");\n}",
"public void sendInvitations(){\r\n for(int i = 0... | [
"0.6733496",
"0.653488",
"0.631116",
"0.62841547",
"0.62722445",
"0.62458354",
"0.62458354",
"0.6197031",
"0.6187459",
"0.60550857",
"0.6018454",
"0.6013099",
"0.5998659",
"0.59853935",
"0.59761107",
"0.5965799",
"0.5953111",
"0.5941982",
"0.59361005",
"0.59259033",
"0.590474... | 0.0 | -1 |
start the plain UDP socket | protected void bind() throws SocketException {
super.bind();
//start the secure socket
dtlsSocket = options.getSecurePort() > 0 ? new DatagramSocket(options.getSecurePort()) : new DatagramSocket();
dtslReceiverThread = createDatagramServer("mqttsn-dtls-receiver", options.getReceiveBuffer(), dtlsSocket);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void startUDP() {\n try {\n DatagramSocket socket = new DatagramSocket(port);\n byte[] buf = new byte[256];\n while (running) {\n DatagramPacket packet = new DatagramPacket((sbyte[])(object) buf, buf.length);\n socket.receive(packet);\n upd_count++;\n ... | [
"0.75570625",
"0.6842164",
"0.68079615",
"0.667453",
"0.663366",
"0.6632781",
"0.6610868",
"0.6488133",
"0.6477055",
"0.6390086",
"0.6334783",
"0.6305318",
"0.6294506",
"0.6263602",
"0.62332416",
"0.6220842",
"0.62174225",
"0.6178124",
"0.61778015",
"0.61456007",
"0.6125937",... | 0.58468413 | 34 |
if we receive thru the secure port, we should write thru the secure port INetworkContext networkContext = registry.getNetworkRegistry().getContext(context); | public void writeToTransport(INetworkContext context, ByteBuffer buffer) throws MqttsnException {
if(context.getReceivePort() == options.getSecurePort()){
//-- use the DTLS version...
} else {
super.writeToTransport(context, buffer);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public OwNetworkContext getContext();",
"private boolean configuredNetwork(Context context, WifiConfiguration config, String security, String mPassword) {\n //optional\n Wifi.ConfigSec.setupSecurity(config, security, mPassword);\n return configuredNetwork(context, config);\n }",
"public... | [
"0.5775767",
"0.5661528",
"0.5466864",
"0.54602325",
"0.539242",
"0.5382229",
"0.5345477",
"0.5331977",
"0.5324336",
"0.53020746",
"0.52909654",
"0.52288246",
"0.52181184",
"0.5209118",
"0.5205374",
"0.5168498",
"0.5168498",
"0.5164265",
"0.514746",
"0.5061621",
"0.505764",
... | 0.6696063 | 0 |
Returns the port used by the web server | public static int getPort() {
return port;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getPort()\n {\n\t\treturn url.getPort();\n }",
"default int getPort() {\n return getServer().getPort();\n }",
"public static int getServerPort(){\n return thisServer.getPort();\n }",
"public int getServerPort(){\n\t\treturn serverPort; \n\t}",
"public static int getServerPort... | [
"0.8464331",
"0.84509546",
"0.84177303",
"0.8386926",
"0.8286414",
"0.8272844",
"0.82193846",
"0.8176029",
"0.8170938",
"0.81446046",
"0.8108631",
"0.8078393",
"0.80745965",
"0.80604774",
"0.7945073",
"0.79413486",
"0.7912138",
"0.78538716",
"0.7831631",
"0.78179634",
"0.7790... | 0.79649293 | 14 |
Returns an ip filter which determines which IPs may connect to the web server. | protected static IPRange.RangeSet getIPFilter() {
if (filterRanges == null) {
try {
filterRanges = IPRange.paraseRangeSet(ipFilter);
} catch (Throwable e) {
Exceptions.handle()
.to(LOG)
.error(e)
.withSystemErrorMessage(
"Error parsing config value: 'http.firewall.filterIPs': %s (%s). Defaulting to localhost!")
.handle();
filterRanges = IPRange.LOCALHOST;
}
}
return filterRanges;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getIpFilter() {\r\n return OWNIP;\r\n }",
"public final void loadIPFilter() {\n DBUtil.select(\n \"select ip, false as type from \"\n + ConfigUtil.getAntiFraudDatabaseSchema()\n + \".ip_whitelist union \"\n ... | [
"0.7358236",
"0.6368085",
"0.6294439",
"0.61522704",
"0.61522704",
"0.5984064",
"0.5984064",
"0.5984064",
"0.58606005",
"0.58606005",
"0.5839025",
"0.5839025",
"0.5839025",
"0.5839025",
"0.5839025",
"0.5839025",
"0.5839025",
"0.5839025",
"0.583858",
"0.57421374",
"0.56863326"... | 0.6962736 | 1 |
/ Computes the key used for microtiming based on the current mode | protected String getMicrotimingKey(WebContext context) {
switch (this) {
case IP:
return context.getRemoteIP().toString();
case BOTH:
return context.getRemoteIP().toString() + " <-- " + context.microtimingKey;
}
// URI is the default:
return context.microtimingKey;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void newTimeKey() {\r\n\t\ttimeKeyA = System.nanoTime();\r\n\t}",
"public short key();",
"public long getKeyingTime() {\n\t\treturn (keyTime);\n\t}",
"public abstract \n KEYIN getCurrentKey() throws IOException, InterruptedException;",
"public int getTone(){\n\t\tint keyAsTone = (int) (Math.pow(2.0... | [
"0.6541197",
"0.65121466",
"0.6446735",
"0.63044363",
"0.6182288",
"0.61254656",
"0.60757667",
"0.6052826",
"0.6052826",
"0.60314745",
"0.60011744",
"0.59624135",
"0.5944804",
"0.5935932",
"0.59283245",
"0.5919886",
"0.58911103",
"0.5883199",
"0.5876769",
"0.5870187",
"0.5869... | 0.6694738 | 0 |
Returns the minimal value of free disk space accepted until an upload is aborted. | protected static long getMinUploadFreespace() {
return minUploadFreespace;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long getMinFree() {\n return params.getMinimumFree() * 1024 * 1024;\n }",
"Integer diskSizeGB();",
"long getAvailableSpace() throws IOException;",
"public long getRemaining() {\n\t\treturn disk_mgr.getRemaining();\n\t}",
"private void checkFreeDiskSpace(List<File> inputFiles) {\n //Chec... | [
"0.72382784",
"0.67610365",
"0.65145814",
"0.6514477",
"0.6438357",
"0.6387976",
"0.63853383",
"0.63494134",
"0.630849",
"0.62867844",
"0.62683374",
"0.62396336",
"0.6214381",
"0.619117",
"0.6189698",
"0.61539173",
"0.61512154",
"0.61512154",
"0.6147403",
"0.61366224",
"0.613... | 0.7688309 | 0 |
Returns the maximal upload size in bytes | protected static long getMaxUploadSize() {
return maxUploadSize;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@java.lang.Override\n public long getMaxUploadSizeInBytes() {\n return maxUploadSizeInBytes_;\n }",
"@java.lang.Override\n public long getMaxUploadSizeInBytes() {\n return maxUploadSizeInBytes_;\n }",
"long getMaxFileSizeBytes();",
"public long getMaximumFileLength() {\n return (httpFi... | [
"0.8400615",
"0.83959705",
"0.82329106",
"0.8030769",
"0.7954949",
"0.7844003",
"0.76539457",
"0.76187575",
"0.75887287",
"0.75887287",
"0.75887287",
"0.75327694",
"0.75141996",
"0.75141996",
"0.74957776",
"0.7487772",
"0.74732065",
"0.74684453",
"0.7457537",
"0.74548113",
"0... | 0.87866753 | 0 |
Returns the data factory used to handle file uploads and posts. | protected static HttpDataFactory getHttpDataFactory() {
return httpDataFactory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DataFactory getDataFactory();",
"protected FileItemFactory getFileItemFactory() {\r\n \tUploadMonitor monitor = new UploadMonitor(request.getSession());\r\n \tlistener = new UploadListener(monitor);\r\n \t\r\n \tDiskFileItemFactory factory = new MonitoredDiskFileItemFactory(listener);\r\n \t\r\n ... | [
"0.65940845",
"0.6176684",
"0.6148998",
"0.6110052",
"0.5880064",
"0.5645318",
"0.5629964",
"0.5593351",
"0.5576427",
"0.5554165",
"0.553163",
"0.55021846",
"0.54624116",
"0.54013145",
"0.5395996",
"0.53746355",
"0.5332674",
"0.53230196",
"0.5316515",
"0.5311907",
"0.53099096... | 0.6711513 | 0 |
Returns the total bytes received so far | public static long getBytesIn() {
return bytesIn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public abstract long getReceivedBytesCount();",
"public native long getReceivedByteCount()\n throws IOException, IllegalArgumentException;",
"public int TotalBytes()\n {\n int totalBytes = request.getContentLength();\n if (totalBytes == -1) return 0;\n return t... | [
"0.79860234",
"0.7529288",
"0.7524411",
"0.7233877",
"0.7221412",
"0.7179967",
"0.7137274",
"0.70863795",
"0.70751625",
"0.70650035",
"0.70153344",
"0.70126164",
"0.6980478",
"0.69645274",
"0.6961565",
"0.69438636",
"0.6749632",
"0.67250186",
"0.66920173",
"0.6683446",
"0.661... | 0.0 | -1 |
Returns the total bytes sent so far | public static long getBytesOut() {
return bytesOut;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public abstract long getSentBytesCount();",
"public Long getBytesSent() {\n\t\treturn bytesSent;\n\t}",
"public native long getSentByteCount()\n throws IOException, IllegalArgumentException;",
"public static int size_p_sendts() {\n return (32 / 8);\n }",
"public static i... | [
"0.8118488",
"0.77143335",
"0.7602084",
"0.7506955",
"0.7506048",
"0.7470416",
"0.7368087",
"0.7219274",
"0.72185695",
"0.7139962",
"0.7113465",
"0.71021914",
"0.709535",
"0.68794596",
"0.6857496",
"0.6790559",
"0.6783857",
"0.67513305",
"0.674522",
"0.66913044",
"0.66612643"... | 0.0 | -1 |
Returns the total messages (packets) sent so far | public static long getMessagesIn() {
return messagesIn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getMessagesSent() {\n return this.messagesSent;\n }",
"public int getDataMessagesSent() {\n\t\tint contador = 0;\n\t\tfor (Contacto c : currentUser.getContacts()) {\n\t\t\tcontador += (c.getMsgsByUser(currentUser.getId()));\n\t\t}\n\t\treturn contador;\n\t}",
"public int totalMsgsPerSec()\n\t{\n... | [
"0.75706834",
"0.7557095",
"0.75526243",
"0.7493881",
"0.74595183",
"0.7448175",
"0.7445977",
"0.74401635",
"0.7365616",
"0.7331204",
"0.7235091",
"0.7235091",
"0.7235091",
"0.71578103",
"0.7145309",
"0.7133893",
"0.7129451",
"0.7073697",
"0.7061757",
"0.7046447",
"0.7046447"... | 0.0 | -1 |
Returns the total messages (packets) received so far | public static long getMessagesOut() {
return messagesOut;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getNetTransferMsgsCount();",
"public int totalMsgsPerSec()\n\t{\n\t\treturn _totalMsgsPerSec;\n\t}",
"public int getTotalNumOfMsg(){ return allmessage.size();}",
"public int getDataMessagesReceived() {\n\t\tint contador = 0;\n\t\tfor (Contacto c : currentUser.getContacts()) {\n\t\t\tcontador += (c.getMes... | [
"0.7668368",
"0.7611415",
"0.7572381",
"0.75437564",
"0.7539925",
"0.7539925",
"0.7539925",
"0.7475914",
"0.74602437",
"0.74015814",
"0.7327803",
"0.7327803",
"0.73150915",
"0.7311651",
"0.72840375",
"0.72264457",
"0.7164524",
"0.7161929",
"0.7140598",
"0.71334743",
"0.713201... | 0.67073864 | 47 |
Returns the total number of connections opened so far | public static long getConnections() {
return connections;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static long getNumberOfOpenConnections() {\n return openConnections.size();\n }",
"int getConnectionsCount();",
"public int numConnections(){\n return connections.size();\n }",
"public int getTotalConnections()\n {\n // return _connections.size();\n return 0;\n }",
"p... | [
"0.86168706",
"0.8406811",
"0.8335128",
"0.8329637",
"0.82258826",
"0.8197419",
"0.817127",
"0.8137946",
"0.80644304",
"0.8004242",
"0.79648054",
"0.7920683",
"0.7880236",
"0.7875519",
"0.7802128",
"0.7688323",
"0.7664069",
"0.74063814",
"0.74012923",
"0.7384805",
"0.7352001"... | 0.76662207 | 16 |
Returns the total number of connections blocked so far | public static long getBlockedConnections() {
return blocks;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getTotalConnections()\n {\n // return _connections.size();\n return 0;\n }",
"int getConnectionsCount();",
"public int numConnections(){\n return connections.size();\n }",
"int getTotalCreatedConnections();",
"public int getUseCount() {\n\t\tint useCount=0;\n\t\tsynchronize... | [
"0.7890198",
"0.7578244",
"0.7510236",
"0.7445189",
"0.7413174",
"0.731311",
"0.72919726",
"0.721784",
"0.7123927",
"0.71234185",
"0.7103012",
"0.7071252",
"0.7036631",
"0.69848806",
"0.6948248",
"0.694176",
"0.69265294",
"0.69177663",
"0.6854854",
"0.6847766",
"0.6840174",
... | 0.75922966 | 1 |
Returns the number of currently open connection | public static long getNumberOfOpenConnections() {
return openConnections.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int connectionCount()\n {\n return _connectionCount;\n }",
"public static int getConnectionCount()\r\n {\r\n return count_; \r\n }",
"public long getConnectionCount() {\n return connectionCount.getCount();\n }",
"public int numConnections(){\n return connections.siz... | [
"0.7950663",
"0.7937068",
"0.78581417",
"0.7757752",
"0.7755663",
"0.7705573",
"0.77045476",
"0.75523305",
"0.7515795",
"0.7467112",
"0.74222684",
"0.72662234",
"0.72587323",
"0.709618",
"0.70939225",
"0.70789224",
"0.69691515",
"0.6923067",
"0.690705",
"0.6901892",
"0.682414... | 0.83417624 | 0 |
Returns the total number of HTTP requests received by the web server | public static long getRequests() {
return requests;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getRequestsCount();",
"int getRequestsCount();",
"int getRequestsCount();",
"int getRequestCount();",
"public int getRequestsCount() {\n return requests_.size();\n }",
"public int getRequestsCount() {\n return requests_.size();\n }",
"public int getRequestsCount() {\n ... | [
"0.8140802",
"0.81002337",
"0.81002337",
"0.7826654",
"0.76934326",
"0.76292145",
"0.7583316",
"0.7459809",
"0.7348744",
"0.7210011",
"0.7197409",
"0.7033818",
"0.6953106",
"0.69302297",
"0.6895628",
"0.6864819",
"0.6750509",
"0.6737258",
"0.6703214",
"0.66798127",
"0.6643646... | 0.71199405 | 11 |
Returns the total number of HTTP chunks received | public static long getChunks() {
return chunks;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int TotalBytes()\n {\n int totalBytes = request.getContentLength();\n if (totalBytes == -1) return 0;\n return totalBytes;\n }",
"@java.lang.Override\n public int getChunksCount() {\n return chunks_.size();\n }",
"int getChunksCount();",
"int getChun... | [
"0.72067887",
"0.70277053",
"0.69884485",
"0.69884485",
"0.68815225",
"0.68646544",
"0.68646544",
"0.68511397",
"0.68030834",
"0.6802232",
"0.67760754",
"0.6758863",
"0.66260743",
"0.66162187",
"0.66017544",
"0.6589826",
"0.65743166",
"0.6564832",
"0.6550403",
"0.6520909",
"0... | 0.6302286 | 37 |
Returns the number of keepalives supported | public static long getKeepalives() {
return keepalives;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getLivesRemaining();",
"public int getAvailableCount();",
"protected long getLiveSetSize() {\n\t\t// Sum of bytes removed from the containers.\n\t\tlong removed = 0;\n\n\t\tfor (int i = 0; i < sets.length; i++)\n\t\t\tremoved += sets[i].getContainer().getBytesRemoved();\n\n\t\t/*\n\t\t * The total n... | [
"0.61453557",
"0.60491395",
"0.58659935",
"0.58153147",
"0.58145887",
"0.5777658",
"0.57649314",
"0.57553893",
"0.57553893",
"0.5736866",
"0.5734516",
"0.5709823",
"0.5688899",
"0.56469756",
"0.56138957",
"0.561044",
"0.5603719",
"0.5595597",
"0.5587297",
"0.5571537",
"0.5554... | 0.7981314 | 0 |
Returns the number of idle connections killed | public static long getIdleTimeouts() {
return idleTimeouts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNumIdle();",
"public int getMaxIdleConns() {\n return maxIdleConns;\n }",
"@Override\n public int getNumIdle() {\n return _pool.size();\n }",
"public static long getNumberOfOpenConnections() {\n return openConnections.size();\n }",
"public int getKillCount(){\... | [
"0.7400872",
"0.7145779",
"0.70025086",
"0.6616903",
"0.658638",
"0.65766275",
"0.637987",
"0.6330396",
"0.63112587",
"0.62853265",
"0.6282868",
"0.62441134",
"0.6237646",
"0.6230809",
"0.62296003",
"0.61972946",
"0.6196497",
"0.6148722",
"0.6139962",
"0.61228937",
"0.6089161... | 0.680479 | 3 |
Returns the number of HTTP responses with an 4xx status code. | public static long getClientErrors() {
return clientErrors;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getStatusCode();",
"int getStatusCode();",
"int getStatusCode( );",
"int getResponseCount();",
"public static Integer getStatusCode() {\n Response res = (Response) Serenity.getCurrentSession().get(\"apiResponse\");\n return res.then().extract().statusCode();\n //return SerenityRest... | [
"0.70404625",
"0.70404625",
"0.69013196",
"0.6748248",
"0.6729181",
"0.6612508",
"0.65436214",
"0.6490032",
"0.648499",
"0.64543176",
"0.64438534",
"0.6438728",
"0.64183795",
"0.6371755",
"0.63546956",
"0.63546956",
"0.63546956",
"0.63546956",
"0.6337389",
"0.6330894",
"0.632... | 0.0 | -1 |
Returns the number of HTTP responses with an 5xx status code. | public static long getServerErrors() {
return serverErrors;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getStatusCode( );",
"int getStatusCode();",
"int getStatusCode();",
"int getResponseCount();",
"public int getHttpFailures() {\n return httpFailures.get();\n }",
"public static Integer getStatusCode() {\n Response res = (Response) Serenity.getCurrentSession().get(\"apiResponse\");\n ... | [
"0.71570474",
"0.71445644",
"0.71445644",
"0.68898416",
"0.68499714",
"0.6791092",
"0.6674036",
"0.66370475",
"0.6562713",
"0.6562102",
"0.6557755",
"0.6513507",
"0.6511826",
"0.64765334",
"0.64098424",
"0.6404485",
"0.63663846",
"0.63663846",
"0.63663846",
"0.63663846",
"0.6... | 0.0 | -1 |
Returns the average response time of the last requests. | public static double getAvgResponseTime() {
return responseTime.getAvg();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static long getAverageResponseTime() {\n return (long) averageResponseTime;\n }",
"public Integer getAverageReceiveSuccessResponseMilliseconds()\r\n {\r\n return averageReceiveSuccessResponseMilliseconds;\r\n }",
"public Integer getAverageSendSuccessResponseMilliseconds()\r\n ... | [
"0.8188288",
"0.69102746",
"0.6828584",
"0.6810704",
"0.6785596",
"0.6657305",
"0.6578699",
"0.6523921",
"0.6486447",
"0.6475055",
"0.64241034",
"0.63133836",
"0.62907946",
"0.62720054",
"0.6254097",
"0.6242887",
"0.618932",
"0.61875236",
"0.61861104",
"0.6168147",
"0.6141366... | 0.8318938 | 0 |
/ Used to notify the web server about an open connection | protected static void addOpenConnection(WebServerHandler webServerHandler) {
openConnections.put(webServerHandler, webServerHandler);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void handleConnectionOpened();",
"public void onOpen(WebSocket conn);",
"void onInternetConnectionLost();",
"@Override\n\tpublic void onOpen( ServerHandshake handshakedata ) {\n\t\tlog.info(\"opened connection\");\n\t\t// if you plan to refuse connection based on ip or httpfields overload: onWebsocketHandsha... | [
"0.7080151",
"0.66265875",
"0.6548398",
"0.6446099",
"0.64322937",
"0.6380091",
"0.63673186",
"0.6340348",
"0.6303333",
"0.6270014",
"0.62685424",
"0.62419945",
"0.6240652",
"0.62090784",
"0.619323",
"0.61737835",
"0.6154877",
"0.61532795",
"0.61305845",
"0.6126731",
"0.61069... | 0.571926 | 71 |
/ Used to notify the web server about an closed connection | protected static void removeOpenConnection(WebServerHandler webServerHandler) {
openConnections.remove(webServerHandler);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void connectionClosed() {}",
"void handleConnectionClosed();",
"@Override\n\tpublic void connectionClosed() {\n\t}",
"void onInternetConnectionLost();",
"void serverLostConnection();",
"public void onConnectionClosed() {\r\n\t\tcurrentConnections.decrementAndGet();\r\n\t}",
"private void conn... | [
"0.7938068",
"0.78603935",
"0.73533624",
"0.7314483",
"0.72806805",
"0.724326",
"0.7145968",
"0.71176636",
"0.7090442",
"0.69784397",
"0.6873878",
"0.68512225",
"0.68214995",
"0.67885727",
"0.6752274",
"0.67506796",
"0.6725684",
"0.6723724",
"0.6705939",
"0.6679728",
"0.66754... | 0.0 | -1 |
Returns all currently open connections of the HTTP server. | public static Collection<? extends ActiveHTTPConnection> getOpenConnections() {
return openConnections.values();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static long getConnections() {\n return connections;\n }",
"public List<Connection> getConnections() {\n\t\treturn new ArrayList<Connection>(connectionsByUri.values());\n\t}",
"public ArrayList<Connection> getConnections(){\n\t\treturn manager.getConnectionsWith(this);\n\t}",
"public Connect... | [
"0.7174439",
"0.7063101",
"0.7043611",
"0.6969014",
"0.68930894",
"0.68909883",
"0.6848084",
"0.67859006",
"0.668225",
"0.6664638",
"0.659504",
"0.65893024",
"0.65247554",
"0.64523745",
"0.6360347",
"0.63411254",
"0.61979336",
"0.6174864",
"0.61723506",
"0.6157323",
"0.613211... | 0.78313696 | 0 |
Changes the microtiming mode. Note that the microtiming framework still has to be enabled to generate any output. | public static void setMicrotimingMode(MicrotimingMode microtimingMode) {
WebServer.microtimingMode = microtimingMode == null ? MicrotimingMode.URI : microtimingMode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDoTiming(boolean doTiming) {\n\t\tthis.doTiming = doTiming;\n\t}",
"public static void pauseTiming() {\n SimulatorJNI.pauseTiming();\n }",
"public void setMicroFlag(boolean microAvgFlag) {\n\t\t\n\t\tthis.microFlag = microAvgFlag;\n\t}",
"native void nativeSetMetricsTime(boolean is_enable)... | [
"0.578022",
"0.5717815",
"0.5622601",
"0.5607768",
"0.5532174",
"0.5509242",
"0.5483079",
"0.5419288",
"0.5366988",
"0.5366988",
"0.5342359",
"0.5326697",
"0.52671355",
"0.5225021",
"0.5217965",
"0.5211901",
"0.5180156",
"0.51681614",
"0.51649517",
"0.5144056",
"0.5133795",
... | 0.74793303 | 0 |
Constructor used for root nodes or nodes whose parent is not given. | public Node(String name, boolean isSource) {
this.name = name;
this.isSource = isSource;
if (name.endsWith("}")) {
this.name = name.substring(0, name.lastIndexOf("{"));
String [] split = name.substring(name.lastIndexOf("{") + 1, name.length() - 1).split("\\-");
sourceStart = Integer.parseInt(split[0]);
sourceEnd = Integer.parseInt(split[1]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TreeNode (TreeNode parent)\r\n {\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\"new TreeNode parent=\" + parent);\r\n }\r\n\r\n if (parent != null) {\r\n parent.addChild(this);\r\n }\r\n }",
"public AVLTree() { \n super();\n // Thi... | [
"0.732784",
"0.6918937",
"0.6912616",
"0.6867795",
"0.67812556",
"0.6669316",
"0.664703",
"0.6612097",
"0.659218",
"0.6579277",
"0.6569361",
"0.65611094",
"0.65611094",
"0.65611094",
"0.65611094",
"0.65536815",
"0.65082973",
"0.64782375",
"0.6475092",
"0.646684",
"0.6455283",... | 0.0 | -1 |
Constructor for nodes whose parent is known. | public Node(String name, Node parent, boolean isSource)
{
this.name = name;
this.isSource = isSource;
if (name.endsWith("}")) {
this.name = name.substring(0, name.lastIndexOf("{"));
String [] split = name.substring(name.lastIndexOf("{") + 1, name.length() - 1).split("\\-");
sourceStart = Integer.parseInt(split[0]);
sourceEnd = Integer.parseInt(split[1]);
}
else {
sourceStart = parent.sourceStart();
sourceEnd = parent.sourceEnd();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Node<T> parent();",
"public TreeNode (TreeNode parent)\r\n {\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\"new TreeNode parent=\" + parent);\r\n }\r\n\r\n if (parent != null) {\r\n parent.addChild(this);\r\n }\r\n }",
"public TNode(E item, TNode<E> ... | [
"0.72361434",
"0.71372783",
"0.70467895",
"0.68091315",
"0.6785215",
"0.6777762",
"0.6746242",
"0.67218494",
"0.66590565",
"0.66284806",
"0.6564573",
"0.6556307",
"0.654504",
"0.65229475",
"0.6513301",
"0.6447093",
"0.6447093",
"0.6447093",
"0.6447093",
"0.64257514",
"0.64104... | 0.64918905 | 15 |
Returns a string representation of this node. That is, it returns the name of a nonterminal, or terminals that have been joined with spaces. | public String toString()
{
return name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString() {\r\n if (typeSystemNode!=null) {\t// kann null sein z.B. bei PIDLs\r\n return typeSystemNode.getAbsoluteName() + \" \" + name;\r\n }\r\n else {\r\n return name;\r\n }\r\n }",
"public String toString() {\n String toReturn = \"\";\n\n Nod... | [
"0.7172625",
"0.6880936",
"0.68448377",
"0.6818178",
"0.6799991",
"0.6740886",
"0.67407465",
"0.67385256",
"0.66453534",
"0.663901",
"0.66262525",
"0.66161764",
"0.6614276",
"0.65793294",
"0.6570438",
"0.65405643",
"0.653829",
"0.6511516",
"0.64988804",
"0.6491341",
"0.648171... | 0.636164 | 49 |
Sets the indices of the source sentence that are aligned with this node. | public void setSourceSpan(int start, int end)
{
sourceStart = start;
sourceEnd = end;
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setAlignedSequence( Sequence alseq ) {\n\t\tthis.alignedsequence = alseq;\n\t\tif(alseq.id == null) alseq.id = id;\n\t\tif(seq != null) alseq.name = seq.getGroup();\n\t\tif(alseq.group == null) alseq.group = group;\n\t}",
"public final void setSourcePosition(int startPos, int endPos) {\r\n \t\tassert... | [
"0.5520486",
"0.52039856",
"0.5074065",
"0.50405943",
"0.50349355",
"0.50037456",
"0.49569103",
"0.4861683",
"0.48591158",
"0.48359337",
"0.4795638",
"0.47246802",
"0.47189122",
"0.4717662",
"0.47083664",
"0.46995178",
"0.46939236",
"0.46932158",
"0.467912",
"0.46743584",
"0.... | 0.51122844 | 2 |
Sets the index of the first source word that is aligned with this node. | public void setSourceStart(int x)
{
sourceStart = x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setStartIndex(java.math.BigInteger startIndex)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTINDEX$10);\n ... | [
"0.5193027",
"0.5185729",
"0.5126134",
"0.5111779",
"0.50879073",
"0.5061851",
"0.5032108",
"0.50161",
"0.49696314",
"0.4936885",
"0.49256486",
"0.48565516",
"0.4841208",
"0.48089907",
"0.48034486",
"0.47876704",
"0.4763479",
"0.47559807",
"0.4751427",
"0.47312748",
"0.471833... | 0.56270057 | 0 |
Sets the index after the last source word that is aligned with this node. | public void setSourceEnd(int x)
{
sourceEnd = x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void cursorDown() throws IndexOutOfBoundsException {\n if(cursor == size()-1)\n throw new IndexOutOfBoundsException(\"Exception: Current line is size()-1!\");\n //Setting the cursor to be the text line after its current position.\n cursor++;\n }",
"@Override\n\tpublic in... | [
"0.55259335",
"0.52963406",
"0.5282043",
"0.52616227",
"0.52213097",
"0.5183287",
"0.518179",
"0.5173178",
"0.5159358",
"0.51580137",
"0.51528674",
"0.51363665",
"0.51001257",
"0.5096559",
"0.5081116",
"0.507355",
"0.50664514",
"0.50577223",
"0.50482374",
"0.504717",
"0.50439... | 0.5147468 | 11 |
Returns whether this node is part of a sourceside or targetside derivation tree. | public boolean isSource()
{
return isSource;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasSide();",
"public boolean isDirected();",
"public boolean isDirected();",
"boolean isDirected();",
"boolean hasIsBoundaryNodeOf();",
"public boolean isAllowedAsDragSource()\r\n\t{\r\n\t\treturn tree.getDragMode() == TreeDragMode.NODE;\r\n\t}",
"public boolean isRealNode();",
"public boolea... | [
"0.644209",
"0.6357143",
"0.6357143",
"0.63164425",
"0.62689763",
"0.6242556",
"0.6026041",
"0.6026041",
"0.5964425",
"0.59422606",
"0.5942185",
"0.58368826",
"0.58325404",
"0.58026457",
"0.57847214",
"0.5720027",
"0.56935036",
"0.56897235",
"0.56233186",
"0.5600097",
"0.5585... | 0.0 | -1 |
Returns an index into the source sentence that is the first word aligned with this node. | public int sourceStart()
{
return sourceStart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getFirstIndex();",
"public Sentence getFirstSentence ()\n {\n\n Paragraph p = this.getFirstParagraph ();\n\n if (p == null)\n {\n\n return null;\n\n }\n\n return p.getFirstSentence ();\n\n }",
"public int getAllTextStartOffset ()\n {\n\n retu... | [
"0.6272258",
"0.6156993",
"0.60288495",
"0.58219564",
"0.5815856",
"0.57408726",
"0.5690225",
"0.56648165",
"0.56545615",
"0.5607865",
"0.5578298",
"0.55589926",
"0.5485836",
"0.5459231",
"0.5400632",
"0.5377634",
"0.53561616",
"0.53517765",
"0.52848685",
"0.5279968",
"0.5225... | 0.48766106 | 80 |
Returns an index into the source sentence that is one later than the last word that is aligned with this node. | public int sourceEnd()
{
return sourceEnd;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int maxSentenceOffset();",
"private int getExclusiveBottomIndexEndOffset() {\n \n \t\tif (fTextWidget != null && !fTextWidget.isDisposed()) {\n \t\t\tint bottom= fSourceViewer.getBottomIndex();\n \t\t\tif (((fTextWidget.getTopPixel() + fTextWidget.getClientArea().height) % fTextWidget.getLineHeight()) != ... | [
"0.6893099",
"0.63954085",
"0.5995864",
"0.58804655",
"0.583307",
"0.581648",
"0.57792413",
"0.5776914",
"0.57650536",
"0.57241994",
"0.5723375",
"0.57045376",
"0.5662622",
"0.56598437",
"0.56491",
"0.56419957",
"0.56390417",
"0.56384975",
"0.5592784",
"0.55898255",
"0.557600... | 0.0 | -1 |
Returns the complete source phrase that is aligned with this node. We join together all the source words from start to end using one space per join. | public String source(String src)
{
int i;
String [] toks = src.split("\\s+");
String ret = toks[sourceStart];
for (i = sourceStart + 1; i < sourceEnd; i++) {
ret += " " + toks[i];
}
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String join() {\n\t\t// A stringbuilder is an efficient way to create a new string in Java, since += makes copies.\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (Node<T> current = start; current != null; current = current.next) {\n\t\t\tif (current != start) {\n\t\t\t\tsb.append(' ');\n\t\t\t}\n\t\t... | [
"0.6009315",
"0.534199",
"0.523244",
"0.5223675",
"0.5167995",
"0.5066077",
"0.5066077",
"0.5039801",
"0.50062543",
"0.49996352",
"0.4899944",
"0.48912412",
"0.48539376",
"0.48274866",
"0.47552487",
"0.47497252",
"0.4739517",
"0.47151002",
"0.46757042",
"0.46695796",
"0.46612... | 0.5540067 | 1 |
Sets this node's counterpart to the given node. | public void setCounterpart(Node n)
{
counterpart = n;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNode(ResidentNode node) {\r\n\t\tthis.node = node;\r\n//\t\tif (this.node != null && this.node.getMFrag() != null) {\r\n//\t\t\tthis.mebn = this.node.getMFrag().getMultiEntityBayesianNetwork();\r\n//\t\t}\r\n\t}",
"public void setParent(Node node) {\n\n\t\tif (this.parent != null) {\n\t\t\t// if t... | [
"0.6591481",
"0.62163585",
"0.6108183",
"0.6082315",
"0.6059198",
"0.6041392",
"0.60305184",
"0.6029863",
"0.59992045",
"0.5996568",
"0.59896564",
"0.59822786",
"0.5966773",
"0.5957612",
"0.5936783",
"0.5933513",
"0.58789474",
"0.58789474",
"0.58595365",
"0.5769839",
"0.57564... | 0.6110567 | 2 |
Returns the node that represents that otherside node that has been aligned with this node. | public Node getCounterpart()
{
return counterpart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MinesNode getCorrespondingNode() {\r\n\t\treturn correspondingNode;\r\n\t}",
"@Nullable public UUID otherNodeId();",
"@Override\n\t\tpublic int compareTo(Node that) {\n\t\t\treturn (this.board.manhattan() + this.moves) - (that.board.manhattan() + that.moves);\n\t\t}",
"public int Node() { return this.... | [
"0.58425426",
"0.571385",
"0.5698063",
"0.56251",
"0.5613415",
"0.56116605",
"0.5569416",
"0.55108917",
"0.5490809",
"0.5477363",
"0.54659855",
"0.54289764",
"0.54244983",
"0.54213476",
"0.5408607",
"0.53989804",
"0.5380266",
"0.53716475",
"0.5366794",
"0.5363447",
"0.5342367... | 0.0 | -1 |
Complete the compareTriplets function below. | static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {
List<Integer> val = new ArrayList<>();
int aScore = 0;
int bScore = 0;
for (int i=0; i<3;i++) {
for (int j=0;j<3;j++) {
if (i==j) {
int tempA = a.get(i);
int tempB = b.get(j);
if (!(1<=tempA && tempA<=100 && 1<=tempB && 1<=tempB)) {
continue;
}
if (tempA<tempB) {
bScore += 1;
} else if (tempA>tempB) {
aScore += 1;
}
}
}
}
val.add(aScore);
val.add(bScore);
return val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {\n\n List<Integer> result = new ArrayList<Integer>(2);\n result.add(0, 0);\n result.add(1, 0);\n for (int i = 0; i < a.size(); i++) {\n if (a.get(i) > b.get(i)) {\n result.set(0, result.get... | [
"0.64543915",
"0.6210188",
"0.61610925",
"0.588679",
"0.57385635",
"0.56936324",
"0.5525092",
"0.5500219",
"0.5477828",
"0.5447128",
"0.5398056",
"0.5388985",
"0.5326599",
"0.5299888",
"0.5297859",
"0.5290698",
"0.528003",
"0.5262775",
"0.52212936",
"0.51711106",
"0.51166916"... | 0.6273891 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.