Questions tagged [user-defined]
253 questions
7
votes
1 answer
How to throw an user-defined exception from Velocity Template Script (VTL)?
How to throw an user-defined exception from Velocity Template Script (VTL) ?
From my velocity script, i need to throw an exception based on a condition, so that the caller can catch the exception and present an useful error messages to the end…

anuu_online
- 374
- 1
- 3
- 14
6
votes
0 answers
UserDefinedFileAttributeView view returns null , unable to set attributes
I am trying to tag files on an android device to display later on a list based on user defined tags (e.g. Category , Description , Owner).
I have used the widely recommended java NIO code for UserDefinedFileAttributes
The file path is found and is…

Mohammed Dawood
- 61
- 7
6
votes
2 answers
SQL stored procedure - table as parameter
I have a database with different tables (all the same structure) where I'd like to run a stored procedure having a parameter that defines which table to query.
I can't seem to figure it out:
CREATE SCHEMA test;
GO
First I created a schema
CREATE…

Olivia
- 814
- 1
- 14
- 26
6
votes
1 answer
User-specified attributes of data.table get removed
I have a function that returns a data.table with various useful user-defined attributes attached. I notice, though, that the attributes disappear when one manipulates the data.table.
library(data.table)
my_dt <- data.table(col1 = rnorm(20), col2 =…

arvi1000
- 9,393
- 2
- 42
- 52
6
votes
2 answers
User-defined errno range values (POSIX or Linux-specific)
Questions for POSIX if possible, else for Linux-specific platforms:
Is there user-defined errno values? (as for signals SIGUSR1 and SIGUSR2)
How to find an errno value not used by the system? (negative values?)
How to prevent strerror() break?…

oHo
- 51,447
- 27
- 165
- 200
5
votes
2 answers
User-Defined Aggregate functions in Oracle PIVOT clause
Unable to use user-defined aggregate functions in Oracle PIVOT clause.
I created a user-defined aggregate function called string_agg.
I am able to use it in a simple statement such as...
select id, string_agg(value) from
(
select 'user1' as id,…

nick
- 51
- 1
- 3
5
votes
1 answer
How to insert variable in user-defined character class?
What I am trying to do is to allow programs to define character class depending on text encountered. However, <[]> takes characters literally, and the following yields an error:
my $all1Line = slurp "htmlFile";
my @a = ($all1Line ~~ m:g/ (\" || \')…

lisprogtor
- 5,677
- 11
- 17
5
votes
3 answers
Deleting user-defined elements in the middle of a vector
I'm coding a program where I want to draw a card, and then delete so that it doesn't get drawn again.
I have a vector of Cards (class containing 2 structs that define Suit and Value) called deck and I don't really know how to use iterators very…

Jota
- 234
- 2
- 11
5
votes
2 answers
Jupyter Notebook: Import .ipynb file and access it's method in other .ipynb file giving error
I am fairly new to Jupyter Notebook. I have played around with it for a while. But this was my first time trying to import another notebook into my main class.
For reference, I am using Anaconda 4.3.1 and Python v2.7.
I am trying to replicate what I…

anugrah
- 187
- 1
- 1
- 10
5
votes
3 answers
Plotting a choropleth map (with geopandas) using a user_defined classification scheme
I'm kind of new to python, so I'm hoping that the answer to my question is relatively straight forward.
I'm trying to make a choropleth map using geopandas. However, since I'm making multiple maps that need to be compared to each other, it is…

Chiara
- 53
- 1
- 3
5
votes
0 answers
Adding custom/user-defined metadata to images/photos?
I'm writing some software that will need to add custom fields to images/photos. Specifically for iOS/OS X, but the ideal solution would be some industry-standard or platform-agnostic way of doing it.
EXIF's Comments field isn't really viable…

God of Biscuits
- 1,312
- 1
- 13
- 27
5
votes
5 answers
How can I define a "Do-Nothing" sort?
I'm working on a system where I need to be able to sort a vector by a given predicate, which my classes shouldn't have control over. Basically, I pass them a derived class and they blindly sort on it.
As one of the "delightful quirks", one of the…

deworde
- 2,679
- 5
- 32
- 60
4
votes
2 answers
MySQL: Re-using user-defined variables in the same SELECT statement
I did a search in stackoverflow but didn't quite find an exact answer to my question, so please help me if you can.
I 'want' to build a SQL statement like this:
SELECT
@tax1 := (complicated calculation formula),
@owe := (another complicated…

JoJoeDad
- 1,711
- 3
- 16
- 15
4
votes
3 answers
mysql user variable within an IN where statement
I now gave up and sorted it by other means but because "curiosity killed the cat" I am trying to figure out how to use mysql query @variables within an IN where statement:
So, from this:
SELECT * FROM table1 WHERE table1.ID IN (794,758)
Try to…

luison
- 1,850
- 1
- 19
- 33
4
votes
2 answers
Use an user variable in a "INSERT ON" clause
I try to make a clean trigger with user-defined variables, so this is my code :
SET @target_bdd = 'trigger_second';
SET @trigger_name = 'account_copy';
SET @table_name = 'account';
SET @primary_key = 'id';
DROP TRIGGER IF EXISTS…

Thomas K
- 1,067
- 1
- 15
- 35