Questions tagged [user-defined]

253 questions
3
votes
2 answers

EclipseLink JPA 2.1 User supplied connection

I would like to use EclipseLink as my JPA engine. We are using a subclass of java.sql.Connection and I would like to know if I can force EclipseLink to use my connection. I would like to set the connection object programmatically. Something…
Andrea
  • 335
  • 3
  • 12
3
votes
5 answers

.equals() for user defined class in Java

Please see the below code class TestToString { public static void main(String args[]) { CheckToString cs = new CheckToString (2); CheckToString c = new CheckToString (2); if( cs.equals(c)) System.out.println(" Both objects…
Jyoti Ranjan
  • 703
  • 2
  • 13
  • 29
2
votes
3 answers

Using variable-controlled logging level in Python logger

I want to write a function that will get the requested logging level from the user, i.e. something like: import logging logger = logging.getLogger() def func(log_level: ): logger.log_level("everything is bad") Can this be done?
Alexy Grabov
  • 151
  • 1
  • 13
2
votes
1 answer

Octave parallel package: User-defined function call issues

I have trouble calling a user-defined function with pararrayfun (likewise for parcellfun). When I execute the following code: pkg load parallel function retval = mul(x,y) retval = x*y; endfunction vector_x = 1:2^3; vector_y = 1:2^3; vector_z =…
2
votes
2 answers

Implicit type conversion for user-defined type

Why is implicit type conversion not performed for user-defined type in the following source code? An implicit type conversion to type A should occur on the commented line, but it did not happen and an error occurred on that line. I would like to…
mzeff
  • 21
  • 3
2
votes
2 answers

Is it possible to declare user-defined statements in python (same syntax of assert)?

For example, what assert does: assert , What I would like to do: mycommand , It would…
quan2m
  • 43
  • 1
  • 7
2
votes
4 answers

Getting values from previous rows using user-defined variable in MySQL

I have a table named as "t1", my table is- +------+------+ | c1 | c2 | +------+------+ | 1 | 12 | | 2 | 13 | | 3 | 14 | +------+------+ I want to get all rows along with the previous values of col2. The query I use:- Select…
T.g
  • 169
  • 2
  • 11
2
votes
1 answer

Updating a table using user defined variables (incrementing)

I have a table called temp_rfm where col1 is effectively the customer id (I had an illegal mix of coalitions problem) and the calc_date which is increasing beginnings of months. SELECT * FROM temp_rfm ; col1 | calc_date -----|----------- 20 |…
2
votes
1 answer

Java remove User defined object from Tree Set

I have created a class of Patient object containing patient name and gender and I want to remove it base on Patient name. What is the correct way to do it? This is my Patient object: class Patient { private String name; private int…
2
votes
1 answer

How do I create a user-defined list in Python?

I am completely new to python, so please pardon the terrible arrangement. I'm trying to create the beginnings of an RPG wherein the player chooses the number of monsters to face, then names the monsters. The code seems to accept the number input,…
A.J. Draper
  • 31
  • 1
  • 4
2
votes
7 answers

java user-defined array (and user-defined array size) returning [null, null, null, ...]

This is my first question on this site, I'm running this on NetBeans 8.0.2 and trying to print out my user-defined array but it keeps returning null values. For example if you say there are 2 employees and enter both of their names, it will return…
Ryan Horner
  • 123
  • 1
  • 1
  • 7
2
votes
2 answers

Set table names using user-defined variables in MySQL stored procedures

I want to create a table with a name taking from a user-defined variable. The following code doesn't seem to work (I get a MYSQL syntax error near CREATE TABLE line) Thanks in advance for the help SET @ratingsNewTableName = CONCAT('ratings_',…
chzigkol
  • 23
  • 1
  • 4
2
votes
3 answers

Cast to user-defined data type in PostgreSQL

I have created a data type called id which consists of two text values: id(text, text) I now need to cast values to this data type before they are inserted into my table. How would I go about doing this? I created the type as follows: CREATE TYPE ID…
nix
  • 4,501
  • 5
  • 22
  • 19
2
votes
3 answers

Are the .NET framework libraries considered to be user-defined?

The C# documentation uses the term "user-defined" a fair amount. For instance: The as operator can't perform... user-defined conversions... Though I haven't come across a formal definition, I assume that anything not in the C# language…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
2
votes
6 answers

When to use a user defined Exception and some good examples/best Practices?

I would assume that most User-defined Exceptions are for Business Logic level exceptions, but what are some good reasons to use a User-Defined Exception and what are some good examples? Is a user-defined exception's only advantage that you can…
Armstrongest
  • 15,181
  • 13
  • 67
  • 106