Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 5/332 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why is my JavaScript function "a" not defined?

    - by 4l3x
    When I call my JavaScript function B, the javascript console in firefox said that function A is not defined, but on chrome browser if defined. And when I call function "A" in body segment: <input type="button" onclick="A()" value=" ..A.. "> , firefox said that function B is not defined? :S <html> <head> <script language="javascript" type="text/javascript"> function B(){ alert(" hi B "); document.write('<br><br><input type="button" onClick="A()" value=" ..A..">'); }; function A(){ alert(" hi A"); document.write('<br><br><input type="button" onclick="B()" value=" ..b..">'); if (window.WebCL == undefined) { alert("Unfortunately your system does not support WebCL. "); return false; } } </script> </head> <body> <input type="button" onclick="B()" value=" ..B.. "> </body> </html>

    Read the article

  • Python NameError when attempting to use a user-defined class

    - by Michael Herold
    I'm getting a weird instance of a NameError when attempting to use a class I wrote. In a directory, I have the following file structure: dir/ ReutersParser.py test.py reut-xxx.sgm Where my custom class is defined in ReutersParser.py and I have a test script defined in test.py. The ReutersParser looks something like this: from sgmllib import SGMLParser class ReutersParser(SGMLParser): def __init__(self, verbose=0): SGMLParser.__init__(self, verbose) ... rest of parser if __name__ == '__main__': f = open('reut2-short.sgm') s = f.read() p = ReutersParser() p.parse(s) It's a parser to deal with SGML files of Reuters articles. The test works perfectly. Anyway, I'm going to use it in test.py, which looks like this: from ReutersParser import ReutersParser def main(): parser = ReutersParser() if __name__ == '__main__': main() When it gets to that parser line, I'm getting this error: Traceback (most recent call last): File "D:\Projects\Reuters\test.py", line 34, in <module> main() File "D:\Projects\Reuters\test.py", line 19, in main parser = ReutersParser() File "D:\Projects\Reuters\ReutersParser.py", line 38, in __init__ SGMLParser.__init__(self, verbose) NameError: global name 'sgmllib' is not defined For some reason, when I try to use my ReutersParser in test.py, it throws an error that says it cannot find sgmllib, which is a built-in module. I'm at my wits' end trying to figure out why the import won't work. What's causing this NameError? I've tried importing sgmllib in my test.py and that works, so I don't understand why it can't find it when trying to run the constructor for my ReutersParser.

    Read the article

  • sqlobject: No connection has been defined for this thread or process

    - by Claudiu
    I'm using sqlobject in Python. I connect to the database with conn = connectionForURI(connStr) conn.makeConnection() This succeeds, and I can do queries on the connection: g_conn = conn.getConnection() cur = g_conn.cursor() cur.execute(query) res = cur.fetchall() This works as intended. However, I also defined some classes, e.g: class User(SQLObject): class sqlmeta: table = "gui_user" username = StringCol(length=16, alternateID=True) password = StringCol(length=16) balance = FloatCol(default=0) When I try to do a query using the class: User.selectBy(username="foo") I get an exception: ... File "c:\python25\lib\site-packages\SQLObject-0.12.4-py2.5.egg\sqlobject\main.py", line 1371, in selectBy conn = connection or cls._connection File "c:\python25\lib\site-packages\SQLObject-0.12.4-py2.5.egg\sqlobject\dbconnection.py", line 837, in __get__ return self.getConnection() File "c:\python25\lib\site-packages\SQLObject-0.12.4-py2.5.egg\sqlobject\dbconnection.py", line 850, in getConnection "No connection has been defined for this thread " AttributeError: No connection has been defined for this thread or process How do I define a connection for a thread? I just realized I can pass in a connection keyword which I can give conn to to make it work, but how do I get it to work if I weren't to do that?

    Read the article

  • Finding all Stored procedures calling a function

    - by Abhishek Jain
    Hi, How can I find out all the stored procedures that are calling a particular user defined function in SQL Server 2005. Or how to assign a defult value to a parameter in a user defined function so that when a stored procedure calls that function and does not pass any value to that parameter function assumes the default value. Regards, Abhishek jain

    Read the article

  • How to Use USER_DEFINED Activity in OWB Process Flow

    - by Jinggen He
    Process Flow is a very important component of Oracle Warehouse Builder. With Process Flow, we can create and control the ETL process by setting all kinds of activities in a well-constructed flow. In Oracle Warehouse Builder 11gR2, there are 28 kinds of activities, which fall into three categories: Control activities, OWB specific activities and Utility activities. For more information about Process Flow activities, please refer to OWB online doc. Most of those activities are pre-defined for some specific use. For example, the Mapping activity allows execution an OWB mapping in Process Flow and the FTP activity allows an interaction between the local host and a remote FTP server. Besides those activities for specific purposes, the User Defined activity enables you to incorporate into a Process Flow an activity that is not defined within Warehouse Builder. So the User Defined activity brings flexibility and extensibility to Process Flow. In this article, we will take an amazing tour of using the User Defined activity. Let's start. Enable execution of User Defined activity Let's start this section from creating a very simple Process Flow, which contains a Start activity, a User Defined activity and an End Success activity. Leave all parameters of activity USER_DEFINED unchanged except that we enter /tmp/test.sh into the Value column of the COMMAND parameter. Then let's create the shell script test.sh in /tmp directory. Here is the content of /tmp/test.sh (this article is demonstrating a scenario in Linux system, and /tmp/test.sh is a Bash shell script): echo Hello World! > /tmp/test.txt Note: don't forget to grant the execution privilege on /tmp/test.sh to OS Oracle user. For simplicity, we just use the following command. chmod +x /tmp/test.sh OK, it's so simple that we’ve almost done it. Now deploy the Process Flow and run it. For a newly installed OWB, we will come across an error saying "RPE-02248: For security reasons, activity operator Shell has been disabled by the DBA". See below. That's because, by default, the User Defined activity is DISABLED. Configuration about this can be found in <ORACLE_HOME>/owb/bin/admin/Runtime.properties: property.RuntimePlatform.0.NativeExecution.Shell.security_constraint=DISABLED The property can be set to three different values: NATIVE_JAVA, SCHEDULER and DISBALED. Where NATIVE_JAVA uses the Java 'Runtime.exec' interface, SCHEDULER uses a DBMS Scheduler external job submitted by the Control Center repository owner which is executed by the default operating system user configured by the DBA. DISABLED prevents execution via these operators. We enable the execution of User Defined activity by setting: property.RuntimePlatform.0.NativeExecution.Shell.security_constraint= NATIVE_JAVA Restart the Control Center service for the change of setting to take effect. cd <ORACLE_HOME>/owb/rtp/sql sqlplus OWBSYS/<password of OWBSYS> @stop_service.sql sqlplus OWBSYS/<password of OWBSYS> @start_service.sql And then run the Process Flow again. We will see that the Process Flow completes successfully. The execution of /tmp/test.sh successfully generated a file /tmp/test.txt, containing the line Hello World!. Pass parameters to User Defined Activity The Process Flow created in the above section has a drawback: the User Defined activity doesn't accept any information from OWB nor does it give any meaningful results back to OWB. That's to say, it lacks interaction. Maybe, sometimes such a Process Flow can fulfill the business requirement. But for most of the time, we need to get the User Defined activity executed according to some information prior to that step. In this section, we will see how to pass parameters to the User Defined activity and pass them into the to-be-executed shell script. First, let's see how to pass parameters to the script. The User Defined activity has an input parameter named PARAMETER_LIST. This is a list of parameters that will be passed to the command. Parameters are separated from one another by a token. The token is taken as the first character on the PARAMETER_LIST string, and the string must also end in that token. Warehouse Builder recommends the '?' character, but any character can be used. For example, to pass 'abc,' 'def,' and 'ghi' you can use the following equivalent: ?abc?def?ghi? or !abc!def!ghi! or |abc|def|ghi| If the token character or '\' needs to be included as part of the parameter, then it must be preceded with '\'. For example '\\'. If '\' is the token character, then '/' becomes the escape character. Let's configure the PARAMETER_LIST parameter as below: And modify the shell script /tmp/test.sh as below: echo $1 is saying hello to $2! > /tmp/test.txt Re-deploy the Process Flow and run it. We will see that the generated /tmp/test.txt contains the following line: Bob is saying hello to Alice! In the example above, the parameters passed into the shell script are static. This case is not so useful because: instead of passing parameters, we can directly write the value of the parameters in the shell script. To make the case more meaningful, we can pass two dynamic parameters, that are obtained from the previous activity, to the shell script. Prepare the Process Flow as below: The Mapping activity MAPPING_1 has two output parameters: FROM_USER, TO_USER. The User Defined activity has two input parameters: FROM_USER, TO_USER. All the four parameters are of String type. Additionally, the Process Flow has two string variables: VARIABLE_FOR_FROM_USER, VARIABLE_FOR_TO_USER. Through VARIABLE_FOR_FROM_USER, the input parameter FROM_USER of USER_DEFINED gets value from output parameter FROM_USER of MAPPING_1. We achieve this by binding both parameters to VARIABLE_FOR_FROM_USER. See the two figures below. In the same way, through VARIABLE_FOR_TO_USER, the input parameter TO_USER of USER_DEFINED gets value from output parameter TO_USER of MAPPING_1. Also, we need to change the PARAMETER_LIST of the User Defined activity like below: Now, the shell script is getting input from the Mapping activity dynamically. Deploy the Process Flow and all of its necessary dependees then run the Process Flow. We see that the generated /tmp/test.txt contains the following line: USER B is saying hello to USER A! 'USER B' and 'USER A' are two outputs of the Mapping execution. Write the shell script within Oracle Warehouse Builder In the previous section, the shell script is located in the /tmp directory. But sometimes, when the shell script is small, or for the sake of maintaining consistency, you may want to keep the shell script inside Oracle Warehouse Builder. We can achieve this by configuring these three parameters of a User Defined activity properly: COMMAND: Set the path of interpreter, by which the shell script will be interpreted. PARAMETER_LIST: Set it blank. SCRIPT: Enter the shell script content. Note that in Linux the shell script content is passed into the interpreter as standard input at runtime. About how to actually pass parameters to the shell script, we can utilize variable substitutions. As in the following figure, ${FROM_USER} will be replaced by the value of the FROM_USER input parameter of the User Defined activity. So will the ${TO_USER} symbol. Besides the custom substitution variables, OWB also provide some system pre-defined substitution variables. You can refer to the online document for that. Deploy the Process Flow and run it. We see that the generated /tmp/test.txt contains the following line: USER B is saying hello to USER A! Leverage the return value of User Defined activity All of the previous sections are connecting the User Defined activity to END_SUCCESS with an unconditional transition. But what should we do if we want different subsequent activities for different shell script execution results? 1.  The simplest way is to add three simple-conditioned out-going transitions for the User Defined activity just like the figure below. In the figure, to simplify the scenario, we connect the User Defined activity to three End activities. Basically, if the shell script ends successfully, the whole Process Flow will end at END_SUCCESS, otherwise, the whole Process Flow will end at END_ERROR (in our case, ending at END_WARNING seldom happens). In the real world, we can add more complex and meaningful subsequent business logic. 2.  Or we can utilize complex conditions to work with different results of the User Defined activity. Previously, in our script, we only have this line: echo ${FROM_USER} is saying hello to ${TO_USER}! > /tmp/test.txt We can add more logic in it and return different values accordingly. echo ${FROM_USER} is saying hello to ${TO_USER}! > /tmp/test.txt if CONDITION_1 ; then ...... exit 0 fi if CONDITION_2 ; then ...... exit 2 fi if CONDITION_3 ; then ...... exit 3 fi After that we can leverage the result by checking RESULT_CODE in condition expression of those out-going transitions. Let's suppose that we have the Process Flow as the following graph (SUB_PROCESS_n stands for more different further processes): We can set complex condition for the transition from USER_DEFINED to SUB_PROCESS_1 like this: Other transitions can be set in the same way. Note that, in our shell script, we return 0, 2 and 3, but not 1. As in Linux system, if the shell script comes across a system error like IO error, the return value will be 1. We can explicitly handle such a return value. Summary Let's summarize what has been discussed in this article: How to create a Process Flow with a User Defined activity in it How to pass parameters from the prior activity to the User Defined activity and finally into the shell script How to write the shell script within Oracle Warehouse Builder How to do variable substitutions How to let the User Defined activity return different values and in what way can we leverage

    Read the article

  • Can't dispatch DDM chunk 46454154: no handler defined - Eclipse - Android SDK

    - by jaywon
    I'm working on a Windows 7, 64 bit machine, and just downloaded and installed the Android SDK and am using Eclipse with Android plugin. I was just going through the "Hello Android" guide here: Hello, Android I also did the suggestions on this page: Droid FAQ Before following the FAQ, the program would compile and run but wouldn't register with the emulator. No code changes, and now I get the following. When I try to run the emulator, I get the following message: [2010-03-05 20:48:41 - HelloAndroid]ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined [2010-03-05 20:48:41 - HelloAndroid]ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined [2010-03-05 20:48:42 - HelloAndroid]ActivityManager: Starting: Intent { comp={domain.example.helloandroid/domain.example.helloandroid.HelloAndroid} } [2010-03-05 20:48:42 - HelloAndroid]ActivityManager: Warning: Activity not started, its current task has been brought to the front Any suggestions? Thanks!

    Read the article

  • my asp.net mvc 2.0 application fails with error "No parameterless constructor defined for this objec

    - by loviji
    Hello, i'm new in asp.net mvc 2. I'm trying to list all data from one table(ms sql server table). as ORM I use Entity Framework. now, I'm tried to write something to do this: Model: private uqsEntities _uqsEntity; public permissionRepository(uqsEntities uqsEntity) { _uqsEntity = uqsEntity; } public IEnumerable<userPermissions> getAllData() { return _uqsEntity.userPermissions; } controller: private DataManager _dataManager; public ManagePermissionsController(DataManager datamanager) { _dataManager = datamanager; } public ActionResult Index() { return RedirectToAction("List"); } [AcceptVerbs(HttpVerbs.Get)] public ActionResult List() { return List(null); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult List(int? userID) { return View(_dataManager.Permission.getAllData().ToList()); } Route: routes.MapRoute( "ManagePerm", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "ManagePermissions", action = "Index"}, new string[] { "uqs.Controllers" } // Parameter defaults ); and View automatically generated by Visual Studio(in action mouse right-click). when I run app. , my app. fails. No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.MissingMethodException: No parameterless constructor defined for this object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [MissingMethodException: No parameterless constructor defined for this object.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230 System.Activator.CreateInstance(Type type, Boolean nonPublic) +67 System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +80 [InvalidOperationException: An error occurred when trying to create a controller of type 'uqs.Controllers.ManagePermissionsController'. Make sure that the controller has a parameterless public constructor.] System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +190 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +68 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +118 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +46 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +63 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +13 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8679186 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 please, somebody, help me to catch problem.

    Read the article

  • Some special characters defined in "ISO-8859-1" can't be shown when encoding with "UTF-8"

    - by Mike.Huang
    I need to get a string from URL request of brower, and then create a text image by requested text. I know the default encoding of the Java net transmission is "ISO-8859-1", it can works normally with all characters what defined in "ISO-8859-1". But when I request a multi-byte Unicode character (e.g. chinese or something like ¤?), then I need to decode it by "UTF-8" from "ISO-8859-1". My codes like: String reslut = new String(requestString.getBytes("ISO-8859-1"), "UTF-8"); Everything is fine, but I found some characters in ISO-8859-1 are not been shown now, which characters are 0x80 - 0xFF(defined in" ISO-8859-1"), i.e. the characters after 0x80 (in "ISO-8859-1") not been shown when converted to "UTF-8" from "ISO-8859-1". Any other method can solve this query?

    Read the article

  • Getting "value is not defined" while inheriting a type

    - by James Black
    I can't see what I am doing wrong, as the files are in the correct order. In this case it is: BaseDAO.fs CreateDatabase.fs They are in the same namespace, but even when I had them in different modules, and opened the module in CreateDatabase the same error. The error is: Error 1 The value or constructor 'execNonQuery' is not defined I am trying to inherit BaseDAO and use a member that will be common to several files, and I don't see why I get the error above. namespace RestaurantServiceDAO open MySql.Data.MySqlClient type BaseDAO() = let connString = @"Server=localhost;Database=mysql;Uid=root;Pwd=$$$$;" let conn = new MySqlConnection(connString) member self.execNonQuery(sqlStr) = conn.Open() let comm = new MySqlCommand(sqlStr, conn, CommandTimeout = 10) comm.ExecuteNonQuery |> ignore comm.Dispose |> ignore The type that does inherit is here, and execNonQuery is not defined. namespace RestaurantServiceDAO open MySql.Data.MySqlClient type CreateDatabase() = inherit BaseDAO() let createRestaurantTable conn = execNonQuery "CREATE TABLE restaurant(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), cur_timestamp TIMESTAMP(8))"

    Read the article

  • Good way to edit the previous defined class in ipython

    - by leo
    Hi, I am wondering a good way to follow if i would like to redefine the members of a previous defined class in ipython. say : I have defined a class intro like below, and later i want to redefine part of the function definition _print_api. Any way to do that without retyping it . class intro(object): def _print_api(self,obj): def _print(key): if key.startswith('_'): return '' value = getattr(obj,key) if not hasattr(value,im_func): doc = type(valuee).__name__ else: if value.__doc__ is None: doc = 'no docstring' else: doc = value.__doc__ return ' %s :%s' %(key,doc) res = [_print(element) for element in dir(obj)] return '\n'.join([element for element in res if element != '']) def __get__(self,instance,klass): if instance is not None: return self._print(instance) else: return self._print_api(klass)

    Read the article

  • Can I make controls defined in my markup public instead of protected

    - by RoboShop
    Say I have a web site with a master page and an aspx page. In my ASPX page, I am pointing to my masterpage with the MasterType tag. <%@ MasterType VirtualPath="~/mymasterpage.master" % Say, I've defined a label in the markup of my master page. If you look at the designer code, this label should be something like this. protected global::System.Web.UI.WebControls.Label label1; Now in my content page, I would like to reference this label. If I type in this "Master.label1", the complier will complain that the control is inaccessible due to the protection level" and rightly so, as label1 is automatically defined as "protected". My question is, if I define controls in my markup page, is it possible to set these controls as public instead of protected? I do not see an attribute for it. thanks in advance.

    Read the article

  • Set User Defined Language Programmatically

    - by wonea
    I've been trying to select the User Defined Language programmatically unsuccessfully through various means, another problem is the files I need to apply the user defined language have no file extension, old DOS files; NPPM_SETCURRENTLANGTYPE (only enumerates built-in languages) Macros don't seem to sense changes with language selection, I was hoping to record a macro then trigger it with NPPExec. Notepad++ accepts only in-built languages for starting from the command line I can't select a UDL as the default language for a new document. ...and my attempts at overriding an in-built language seem to have failed. I've copied details from userDefinedLang.xml to langs.xml don't work. The highlighting doesn't change. Thanks for any help!!

    Read the article

  • cc1plus: error: include: Value too large for defined data type when compiling with g++

    - by Android
    I am making a project that should compile on Windows and Linux. I have made the project in Visual Studio and then made a makefile for linux. I created all the files in Windows with VS. It compiles and runs perfectly in VS but when I run the makefile and it runs g++ I get $ g++ -c -I include -o obj/Linux_x86/Server.obj src/Server.cpp cc1plus: error: include: Value too large for defined data type cc1plus: error: src/Server.cpp: Value too large for defined data type The code is nothing more than a Hello World atm. I just wanted to make sure that everything was working before I started development. I have tried searching but to no avail. Any help would be appreciated.

    Read the article

  • Google App Engine python - Self is not defined

    - by sdasdas
    I have a request that maps to this class ChatMsg It takes in 3 get variables, username, roomname, and msg. But it fails on this last line here. class ChatMsg(webapp.RequestHandler): # this is line 239 def get(self): username = urllib.unquote(self.request.get('username')) roomname = urllib.unquote(self.request.get('roomname')) # this is line 242 When it tries to assign roomname, it tells me: <type 'exceptions.NameError'>: name 'self' is not defined Traceback (most recent call last): File "/base/data/home/apps/chatboxes/1.341998073649951735/chatroom.py", line 239, in <module> class ChatMsg(webapp.RequestHandler): File "/base/data/home/apps/chatboxes/1.341998073649951735/chatroom.py", line 242, in ChatMsg roomname = urllib.unquote(self.request.get('roomname')) what the hell is going on to make self not defined

    Read the article

  • User Defined Exceptions with JMX

    - by Daniel
    I have exposed methods for remote management in my application server using JMX by creating an MXBean interface, and a class to implement it. Included in this interface are operations for setting attributes on my server, and for getting the current value of attributes. For example, take the following methods: public interface WordManagerMXBean { public void addWord(String word); public WordsObject getWords(); public void removeWord(String word); } The WordsObject is a custom, serializable class used to retrieve data about the state of the server. Then I also have a WordManager class that implements the above interface. I then create a JMX agent to manage my resource: MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName wordManagerName = new ObjectName("com.example:type=WordManager"); mbs.registerMBean(wordManager, wordManagerName); I have created a client that invokes these methods, and this works as expected. However, I would like to extend this current configuration by adding user defined exceptions that can be sent back to my client. So I would like to change my interface to something like this: public interface WordManagerMXBean { public void addWord(String word) throws WordAlreadyExistsException; public WordsObject getWords(); public void removeWord(String word); } My WordAlreadyExistsException looks like this: public class WordAlreadyExistsException extends Exception implements Serializable { private static final long serialVersionUID = -9095552123119275304L; public WordAlreadyExistsException() { super(); } } When I call the addWord() method in my client, I would like to get back a WordAlreadyExistsException if the word already exists. However, when I do this, I get an error like this: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: java.lang.ClassNotFoundException: com.example.WordAlreadyExistsException The WordAlreadyExistsException, the WordsObject and the WordManagerMXBean interface are all in a single jar file that is available to both the client and the server. If I call the getWords() method, the client has no difficulty handling the WordsObject. However, if a user defined exception, like the one above, is thrown, then the client gives the error shown above. Is it possible to configure JMX to handle this exception correctly in the client? Following some searching, I noticed that there is an MBeanException class that is used to wrap exceptions. I'm not sure if this wrapping is performed by the agent automatically, or if I'm supposed to do the wrapping myself. I tried both, but in either case I get the same error on the client. I have also tried this with both checked and unchecked exceptions, again the same error occurs. One solution to this is to simply pass back the error string inside a generic error, as all of the standard java exceptions work. But I'd prefer to get back the actual exception for processing by the client. Is it possible to handle user defined exceptions in JMX? If so, any ideas how?

    Read the article

  • ASP.NET UserControl not defined?

    - by BryanG
    I've just inherited an app that utilizes usercontrols in a couple ways which I'm not too familiar with. The problem I have right now is that when I attempt to publish this code base, I get a few errors which boil down to where some referenced usercontrols are not defined. Here's an example of one line: Private clientControl As New ASP.usercontrols_clientcontrol_ascx This is a tab strip usercontrol which references other usercontrols to dynamically create the tabs. Now, on the surface I get what is going on here...but the compiler is not accepting this. This tab strip usercontrol is in the root of the project, and the other usercontrols are in a sub folder. error BC30002: Type 'ASP.usercontrols_clientcontrol_ascx' is not defined. I'm sure this is 101 stuff here, but the build works and the publish fails. Any direction would be appreciated.

    Read the article

  • Make Excel Defined Names within a worksheet to be global

    - by idazuwaika
    Hi, I wrote Powershell script to copy a worksheet from a workbook A to another workbook B. The worksheet contains define names for ranges within that sheet. Originally, the defined names are global in workbook A, ie. can be referenced from any worksheets within workbook A. But now, after copy to worksheet B, the defined names are limited to that worksheet only. How to I programmatically (via Powershell script preferably) make all those named range global i.e. can be referenced from all worksheets within workbook B. Some codes for clarity. #Script to update SOP from 5.1 to 5.2 $missing = [System.Type]::missing #Open files $excel = New-Object -Com Excel.Application $excel.Visible = $False $excel.DisplayAlerts = $False $newTemplate = "C:\WorkbookA.xls" $wbTemplate = $excel.Workbooks.Open($newTemplate) $oldSop = "C:\WorkbookB.xls" $wbOldSop = $excel.Workbooks.Open($oldSop) #Delete 'DATA' worksheet from old file $wsOldData = $wbOldSop.Worksheets.Item("DATA") $wsOldData.Delete() #Copy new 'DATA' worksheet to old file $wbTemplate.Worksheets.Item("DATA").Copy($missing,$wbOldSop.Worksheets.Item("STATUS")) #Save $wbOldSop.Save() $wbOldSop.Close() #Quit Excel $excel.Quit()

    Read the article

  • Call function from hyperlink defined in qTip content

    - by user327066
    Hi, I am trying to call a javascript function from a hyperlink that is part of the content in a qTip. I keep getting the error my function is not defined but it is defined within the page and can be called outside of qTip. Below is what I have so far: function addTooltip() { $("#mycontent").qtip({ content: 'mylink' }); } function tester() { alert("hello world"); } If I put the alert within the onClick attribute, I at least get the alert to work. Is there some special way of calling a function from within qTip? Any help is appreciated. Thanks.

    Read the article

  • Extracting numeric value from output of a uder defined aggregate in netezza using bash script

    - by Ankit
    I am executing a shell script to execute my user defined aggregate which is taking inputs yavg=nzsql -c 'select avg(x) from Input1' which is giving output like this AVG ---------- 2.000000 (1 row) I want to pass only the numeric(double) value which is 2.0000(where xavg is expected) from this to S4(x,y,$xavg,$yavg) where x and y are the whole column from table Input1, xavg=nzsql -c 'select avg(y) from Input1' Below is my InputTable.txt which is a text file from which I am popluating my "Input1" table in the shell script. 1 2 3 2 1 2 3 2 1 nzsql -c 'create table Input1(x integer, y integer, v integer)' nzload -t Input1 -df InputTable.txt nzsql -c 'select * from Input1 yavg=`nzsql -c 'select avg(x) from Input1'` xavg=`nzsql -c 'select avg(y) from Input1' nzsql -c 'select S4(x,y,$xavg,$yavg) from test' Below is the output : xavg := AVG ---------- 2.000000 (1 row) yavg := AVG ---------- 1.666667 (1 row) and i am passing this value to S4(x,y,$xavg,$yavg) which is a User defined aggregate

    Read the article

  • Scala: "Parameter type in structural refinement may not refer to an abstract type defined outside th

    - by raichoo
    Hi, I'm having a problem with scala generics. While the first function I defined here seems to be perfectly ok, the compiler complains about the second definition with: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement def >>[B](a: C[B])(implicit m: Monad[C]): C[B] = { ^ What am I doing wrong here? trait Lifter[C[_]] { implicit def liftToMonad[A](c: C[A]) = new { def >>=[B](f: A => C[B])(implicit m: Monad[C]): C[B] = { m >>= (c, f) } def >>[B](a: C[B])(implicit m: Monad[C]): C[B] = { m >> a } } } IMPORTANT: This is NOT a question about Monads, it's a question about scala polymorphism in general. Regards, raichoo

    Read the article

  • sfConfig::get is not returning constants defined in app.yml

    - by morpheous
    I have an interesting problem. I am using Symfony 1.3.2. I have defined some constants in project/apps/frontend/config/app.yml and project/config/app.yml When I use the constant (correct spelling) in a piece of code like this $test=sfConfig::get('app_foobar'); the variable $test is assigned a null value. This is what I have checked so far: CHECK: cache files generated? (YES) CHECK: Do the cache files (config_app.yml.php) in the cache directory contain the constants defined in the app.yml file (YES) CHECK: Constant names used in the code matches the array keys found in config_app.yml? (YES) At this stage, I have run out of ideas. I dont want to supply a default value as a hack, because when I need to change the value of the constant, I will have to replace this in potentially hundreds of instances (too error prone). Is there anything that I have missed?. What could be causing this?

    Read the article

  • How and why is ap defined as liftM2 id in Haskell

    - by luke_randall
    Whilst trying to better understand Applicative, I looked at the definition of <*, which tends to be defined as ap, which in turn is defined as: ap :: (Monad m) => m (a -> b) -> m a -> m b ap = liftM2 id Looking at the type signatures for liftM2 and id, namely: liftM2 :: (Monad m) => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r id :: a -> a I fail to understand how just by passing in id, the relevant part of the type signature seems to transform from (a1 -> a2 -> r) -> m a1 to m (a -> b). What am I missing here?

    Read the article

  • hook_form for multiple content types defined by the same module

    - by pao13gate
    A new module 'foo' implements foo_node_info() where one or more new content types can be defined. If foo_node_info() defines two content types, namely a content type 'footypea' and a content type 'footypeb', how does one go about implementing hook_form() (what should the name of the "hook" be?) to configure each node's editing form? In the drupal example, the name of the new content type is the same as the module name. What happens in the above described example where two new content types are defined by the module? Should the implemented hook_form() function be of the form: footypea_form() and footypeb_form() ? (this doesn't seem to work) Or should you implement a single foo_form() function and within this create and return an array $form with elements $form['footypea'] and $form['footypeb'] that are in turn arrays of the individual form field definitions?

    Read the article

  • Defined variables and arrays vs functions in php

    - by Frank Presencia Fandos
    Introduction I have some sort of values that I might want to access several times each page is loaded. I can take two different approaches for accessing them but I'm not sure which one is 'better'. Three already implemented examples are several options for the Language, URI and displaying text that I describe here: Language Right now it is configured in this way: lang() is a function that returns different values depending on the argument. Example: lang("full") returns the current language, "English", while lang() returns the abbreviation of the current language, "en". There are many more options, like lang("select"), lang("selectact"), etc that return different things. The code is too long and irrelevant for the case so if anyone wants it just ask for it. Url The $Url array also returns different values depending on the request. The whole array is fully defined in the beginning of the page and used to get shorter but accurate links of the current page. Example: $Url['full'] would return "http://mypage.org/path/to/file.php?page=1" and $Url['file'] would return "file.php". It's useful for action="" within the forms and many other things. There are more values for $Url['folder'], $Url['file'], etc. Same thing about the code, if wanted, just request it. Text [You can skip this section] There's another array called $Text that is defined in the same way than $Url. The whole array is defined at the beginning, making a mysql call and defining all $Text[$i] for current page with a while loop. I'm not sure if this is more efficient than multiple calls for a single mysql cell. Example: $Text['54'] returns "This is just a test array!" which this could perfectly be implemented with a function like text(54). Question With the 3 examples you can see that I use different methods to do almost the same function (no pun intended), but I'm not sure which one should become the standard one for my code. I could create a function called url() and other called text() to output what I want. I think that working with functions in those cases is better, but I'm not sure why. So I'd really appreciate your opinions and advice. Should I mix arrays and functions in the way I described or should I just use funcions? Please, base your answer in this: The source needs to be readable and reusable by other developers Resource consumption (processing, time and memory). The shorter the code the better. The more you explain the reasons the better. Thank you PS, now I know the differences between $Url and $Uri.

    Read the article

  • [C++] Boost test: catch user defined exceptions

    - by user231536
    If I have user defined exceptions in my code, I can't get Boost test to consider them as failures. For example, BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MyTest,1) BOOST_AUTO_TEST_CASE(MyTest) { // code which throws user defined exception, not derived from std::exception. } I get a generic message: Caught exception: .... unknown location(0):.... It does not recognize this error as a failure since it is not a std::exception. So it does not honor the expected_failures clause. How do I enforce that the piece of code should always throw an exception? THis seems to be a useful thing to want. In case future code changes cause the code to pass and the exception is not thrown, I want to know that.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >