user-defined

User-defined execption with custom message

柔情痞子 提交于 2019-12-05 18:53:14
Want to define a custom message for a user defined exception. What I have now: declare e exception; pragma exception_init (e, -20100); begin raise e; end; ORA-20100: ORA-06512: at line 5 What I want: exec dbms_output.put_line(userenv('COMMITSCN')) ORA-01725: USERENV('COMMITSCN') not allowed here ORA-06512: at "SYS.STANDARD", line 202 ORA-06512: at line 1 at "SYS.STANDARD", line 202 we can see: raise USERENV_COMMITSCN_ERROR; The exception is defined in specification as: -- Added for USERENV enhancement, bug 1622213. USERENV_COMMITSCN_ERROR exception; pragma EXCEPTION_INIT(USERENV_COMMITSCN

Approaches to preserving object's attributes during extract/replace operations

怎甘沉沦 提交于 2019-12-05 12:58:31
Recently I encountered the following problem in my R code. In a function, accepting a data frame as an argument, I needed to add (or replace, if it exists) a column with data calculated based on values of the data frame's original column. I wrote the code, but the testing revealed that data frame extract/replace operations , which I've used, resulted in a loss of the object's special (user-defined) attributes . After realizing that and confirming that behavior by reading R documentation ( http://stat.ethz.ch/R-manual/R-patched/library/base/html/Extract.html ), I decided to solve the problem

How to throw an user-defined exception from Velocity Template Script (VTL)?

↘锁芯ラ 提交于 2019-12-05 09:31:49
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 user. For Example. #if($passwordfield1 != $passwordfield2) throw an exception here #elseif($passwordfield1 == $passwordfield2) do something #end In the above example, if passwordfield1 and passwordfield2 is not matching,an appropriate exception should be thrown and that needs to be propagated to the end-user. Is there any way to achieve this from

Where To Put User-defined Classes in Rails

若如初见. 提交于 2019-12-05 00:45:00
I'm trying to to use this class http://robbyonrails.com/articles/2005/05/11/parsing-a-rss-feed but am not sure where to place the file so that it functions like a helper. Where To Put User-defined Classes in Rails ? To lib directory To your specific RssReader class question. The best code written on that page is in comment from Veez (30.7.2008). Final code should look like this (not tested) # lib/rss_reader.rb require 'rss/2.0' require 'open-uri' class RssReader def self.posts_for(feed_url, length=2, perform_validation=false) posts = [] open(feed_url) do |rss| posts = RSS::Parser.parse(rss,

What is the best way to model user defined hierarchical relationships in a database?

守給你的承諾、 提交于 2019-12-03 10:19:37
问题 Essentially, I want the user to be able to define a hierarchical model, but then I need to allow the user to store data within their defined model. Does this make sense? So the users will be able to create new "unit types" to be organised in a hierarchical way and decide how units of these types are allowed to be organised. A simple example: in my hypothetical interface a user creates three unit types, trunk, branch and leaf. The user then defines the relationships between them. A leaf can

Adding a user-defined language in Notepad++

三世轮回 提交于 2019-12-03 04:53:52
问题 I'm trying to add the syntax plugin for the Go programming language in Notepad++. There is a repository for such user-defined languages. I downloaded and unzipped the Go files, which contained a README, a userDefinedLang_Go.xml , and go.xml . I attempted to follow the instructions at the bottom of the page as follows. Since I am using Windows 7 (x64), my Notepad++ directory is "C:\Program Files (x86)\Notepad++". Having not installed a user defined language before, I didn't have a

What is the best way to model user defined hierarchical relationships in a database?

房东的猫 提交于 2019-12-03 00:47:39
Essentially, I want the user to be able to define a hierarchical model, but then I need to allow the user to store data within their defined model. Does this make sense? So the users will be able to create new "unit types" to be organised in a hierarchical way and decide how units of these types are allowed to be organised. A simple example: in my hypothetical interface a user creates three unit types, trunk, branch and leaf. The user then defines the relationships between them. A leaf can exist at any point in the hierarchy, a branch must have a trunk as a parent. The user can then creates

How to use user-defined class object as a networkx node?

我们两清 提交于 2019-12-01 16:41:12
Class point is defined as (there are also some methods, atributes, and stuff in it, but this is minimal part): class point(): def ___init___(self, x, y): self.x = x self.y = y So, I saw this question , but when I tried applying it, it returns an error: G = nx.Graph() p = point(0,0) G.add_node(0, p) NetworkXError: The attr_dict argument must be a dictionary. If i use G = nx.Graph() p = point(0,0) G.add_node(0, data = p) I don't get an error, but when i try to access the x-coordinate, it turns out it didn't save it as a point. G[0].x returns: AttributeError: 'dict' object has no attribute 'x'

Failed to set () user defined inspected property on (UIButton)

孤者浪人 提交于 2019-12-01 16:14:27
In a simple ViewController, I added one UIButton. I would like to use "User Defined Runtime Attributes". For now I added the default Bool attribute. The button is an @IBOutlet: @IBOutlet var button:UIButton! The link in the storyboard is done. I have nothing else in my app. I got this error: 2017-03-26 20:31:44.935319+0200 ISAMG[357:47616] Failed to set (keyPath) user defined inspected property on (UIButton): [<UIButton 0x15e3a780> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath. I don't understand what I'm missing. EDIT 1 Following the advices

Failed to set () user defined inspected property on (UIButton)

懵懂的女人 提交于 2019-12-01 15:26:19
问题 In a simple ViewController, I added one UIButton. I would like to use "User Defined Runtime Attributes". For now I added the default Bool attribute. The button is an @IBOutlet: @IBOutlet var button:UIButton! The link in the storyboard is done. I have nothing else in my app. I got this error: 2017-03-26 20:31:44.935319+0200 ISAMG[357:47616] Failed to set (keyPath) user defined inspected property on (UIButton): [<UIButton 0x15e3a780> setValue:forUndefinedKey:]: this class is not key value