Search Results

Search found 6928 results on 278 pages for 'calling'.

Page 11/278 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Asp.net MVC Calling ActionLink in Codebehind

    - by SSA
    I am new to asp.net and MVC, so please go easy on me. :) I have successfully made a small MVC application. There is a database that contains a table named "Entry" and I have made Controllers for this. Also I have a view for Details and list. This works fin. My problem is in my index page. (not the view Index, but the frontpage). There I dynamically build a TreeView as a menu, with some Categories. In this menu there is under the categories there is my Entries from the database. They show up fin. I insert the entries as a TreeNode what holds the entry id and so forth. What I want is: that the entries in my treeview work as a link to the Detail view of the Entry. So if I click on a entry in the TreeView it will show the Detail page of this Entry. But I can't make it work. How to I use the <%= Html.ActionLink() % in codebehind? Or is it this the wrong way? If calling the view or controller in codebehind is the wrong way to do it. Then how? Thanks in advance.

    Read the article

  • Exception on apache cxf when calling JaxWsProxyFactoryBean.create() (in maven project)

    - by tzippy
    I wrote a Client that uses a Webservice. Works well in a seperate project. But when I try to use it in my maven project, it fails. The dependencies are correct: <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>2.2.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>2.2.8</version> </dependency> <!-- Jetty is needed if you're are not using the CXFServlet --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-jetty</artifactId> <version>2.2.8</version> </dependency> But the error seems to occur calling this method: JaxWsProxyFactoryBean.create(); This is what I get: 10.06.2010 12:50:59 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://tempuri.org/}BMWebServiceSoapService from class net.myClassPath.BMWebServiceSoap 2010-06-10 12:51:00.992::WARN: Nested in org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/wsdl/extensions/soap12/SOAP12Address: java.lang.NoClassDefFoundError: javax/wsdl/extensions/soap12/SOAP12Address Does anyone have a clue? Thanks!

    Read the article

  • Calling a method with an arg of Class<T> where T is a parameterized type

    - by Brian Ferris
    I'm attempting to call a constructor method that looks like: public static SomeWrapper<T> method(Class<T> arg); When T is an unparameterized type like String or Integer, calling is straightforward: SomeWrapper<String> wrapper = method(String.class); Things get tricky when T is a parameterized type like List<String>. The following is not valid: SomeWrapper<List<String>> wrapper = method(List<String>.class); About the only thing I could come up with is: List<String> o = new ArrayList<String>(); Class<List<String>> c = (Class<List<String>>) o.getClass(); SomeWrapper<List<String>> wrapper = method(c); Surely there is an easier way that doesn't require the construction of an additional object?

    Read the article

  • C# FileStream position is off after calling ReadLine()

    - by Cristi Diaconescu
    I'm trying to read a (small-ish) file in chunks of a few lines at a time, and I need to return to the beginning of particular chunks. The problem is, after the very first call to streamReader.ReadLine(); the streamReader.BaseStream.Position property is set to the end of the file! Now I assume some caching is done in the backstage, but I was expecting this property to reflect the number of bytes that I used from that file. For instance, calling ReadLine() again will (naturally) return the next line in the file, which does not start at the position previously reported by streamReader.BaseStream.Position. My question is, how can I find the actual position where the 1st line ends, so I can return there later? I can only think of manually doing the bookkeeping, by adding the lengths of the strings returned by ReadLine(), but even here there are a couple of caveats: ReadLine() strips the new-line character(s) which may have a variable length (is is '\n' ? is it "\r\n" ? etc) I'm not sure if this would work ok with variable-length characters ...so right now it seems like my only option is to rethink how I parse the file, so I don't have to rewind. If it helps, I open my file like this: using (var reader = new StreamReader( new FileStream(m_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))) {...} Any suggestions?

    Read the article

  • codeigniter and OOP general question regarding calling functions, and the parent constuctor

    - by thrice801
    Ok so I have some gaps in my understanding of PHP OOP, classes and functions specifically, this whole constructor class deal. I use both Zend and CI but right now Im trying to figure this out in CI as it is less complicated. So all Im trying to do is understand how to call a function from a view page in code igniter. I understand that might go against MVC but Im working with an api and search results not from my database, so basically, I want to define a function in my class that I am able to call in one of my view pages.. and I keep getting "Fatal error: Call to undefined function functionname" error no matter what I try. I thought I just had to declare public function testing() { echo "testing testing 123; } but calling that from the view I get that error. Then I read something about having to go parent::Controller(); in the index of the class where the testing function also resides? But that didnt work either. Anyways, ya, can someone explain what I need to do in order to call the "testing()" function on one of my view pages? and clarification on the constructor class and what exactly parent::Controller() even does, would be much appreciated as well.

    Read the article

  • Calling blockUI and unblockUI in combination with jQuery validator plugin

    - by Tim Stewart
    I have a very complex form with the validation working correctly. However, since it can take awhile for the validation to complete, I'd like to use blockUI to be called when I click the form's submit button to prevent confusion and double-submissions. I can't quite figure out how to do this. My code looks like this: $("#credential").validate({ rules: { EngId: { required: true } ClientAccount: { required: true } ... } and I'm calling the validation with several buttons (using their click function) depending on selections in the form, often disabling some of the rules: $("#buttonname").click(function() { $("#fieldname").rules("remove"); ... $("#credential").submit(); }); What I can't figure out is where the blockui and unblockui calls would go so that when the user clicks the button, before validation starts, blockui does its magic, and if the validation finds a problem, unblockui is called and enables the form again. I'm pretty new to Jquery and I can't find any examples that I've been able to implement successfully. I would appreciate any help anyone could give (please excuse if this has been covered before).

    Read the article

  • Error when calling Mysql Stored procedure

    - by devuser
    This is my stored procedure to search throgh all databases,tables and columns. This procedure got created with out any error. DELIMITER $$ DROP PROCEDURE IF EXISTS mydb.get_table$$ CREATE DEFINER=root@% PROCEDURE get_table(in_search varchar(50)) READS SQL DATA BEGIN DECLARE trunc_cmd VARCHAR(50); DECLARE search_string VARCHAR(250); DECLARE db,tbl,clmn CHAR(50); DECLARE done INT DEFAULT 0; DECLARE COUNTER INT; DECLARE table_cur CURSOR FOR SELECT concat('SELECT COUNT(*) INTO @CNT_VALUE FROM ', table_schema,'.', table_name, ' WHERE ', column_name,' REGEXP ''',in_search,'''' ) ,table_schema,table_name,column_name FROM information_schema.COLUMNS WHERE TABLE_SCHEMA NOT IN ('mydb','information_schema'); DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1; #Truncating table for refill the data for new search. PREPARE trunc_cmd FROM 'TRUNCATE TABLE temp_details'; EXECUTE trunc_cmd ; OPEN table_cur; table_loop:LOOP FETCH table_cur INTO search_string,db,tbl,clmn; #Executing the search SET @search_string = search_string; SELECT search_string; PREPARE search_string FROM @search_string; EXECUTE search_string; SET COUNTER = @CNT_VALUE; SELECT COUNTER; IF COUNTER0 THEN # Inserting required results from search to table INSERT INTO temp_details VALUES(db,tbl,clmn); END IF; IF done=1 THEN LEAVE table_loop; END IF; END LOOP; CLOSE table_cur; #Finally Show Results SELECT * FROM temp_details; END$$ DELIMITER ; But when calling this procedure following error occurs. call get_table('aaa') Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete REGEXP 'aaa'' at line 1 (0 ms taken)

    Read the article

  • Keyword 'this'(Me) is not available calling the base constructor

    - by serhio
    In the inherited class I use the base constructor, but can't use class's members calling this base constructor. In this example I have a PicturedLabel that knows it's own color and has a image. A TypedLabel : PictureLabel knows it's type but uses the base color. The (base)image that uses TypedLabel should be colored with the (base)color, however, I can't obtain this color: Error: Keyword 'this' is not available in the current context A workaround? /// base class public class PicturedLabel : Label { PictureBox pb = new PictureBox(); public Color LabelColor; public PicturedLabel() { // initialised here in a specific way LabelColor = Color.Red; } public PicturedLabel(Image img) : base() { pb.Image = img; this.Controls.Add(pb); } } public enum LabelType { A, B } /// derived class public class TypedLabel : PicturedLabel { public TypedLabel(LabelType type) : base(GetImageFromType(type, this.LabelColor)) //Error: Keyword 'this' is not available in the current context { } public static Image GetImageFromType(LabelType type, Color c) { Image result = new Bitmap(10, 10); Rectangle rec = new Rectangle(0, 0, 10, 10); Pen pen = new Pen(c); Graphics g = Graphics.FromImage(result); switch (type) { case LabelType.A: g.DrawRectangle(pen, rec); break; case LabelType.B: g.DrawEllipse(pen, rec); break; } return result; } }

    Read the article

  • Why does calling abort() on ajax request cause error in ASP.Net MVC (IE8)

    - by user169867
    I use jquery to post to an MVC controller action that returns a table of information. The user of the page triggers this by clicking on various links. In the event the user decides to click a bunch of these links in quick succession I wanted to cancel any previous ajax request that may not have finished. I've found that when I do this (although its fine from the client's POV) I will get errors on the web application saying that "The parameters dictionary contains a null entry for parameter srtCol of non-nullable type 'System.Int32'" Now the ajax post deffinately passes in all the parameters, and if I don't try and cancel the ajax request it works just fine. But if I do cancel the request by calling abort() on the XMLHttpRequest object that ajax() returns before it finishes I get the error from ASP.Net MVC. Example: //Cancel any pevious request if (req) { req.abort(); req = null; } //Make new request req= $.ajax({ type: 'POST', url: "/Myapp/GetTbl", data: {srtCol: srt, view: viewID}, success: OnSuccess, error: OnError, dataType: "html" }); I've noticed this only happen is IE8. In FF it seems to not cuase a problem. Does anyone know how to cancel an ajax request in IE8 without causing errors for MVC? Thanks for any help.

    Read the article

  • Calling server side method as filling value inside a textbox from calendar extender

    - by Dharmendra Singh
    I have a text box which i m filling of date from the calendar extender and the code is as below:- <label for="input-one" class="float"><strong>Date</strong></label><br /> <asp:TextBox ID="txtDate" runat="server" CssClass="inp-text" Enabled="false" AutoPostBack="true" Width="300px" ontextchanged="txtDate_TextChanged"></asp:TextBox> <asp:ImageButton ID="btnDate2" runat="server" AlternateText="cal2" ImageUrl="~/App_Themes/Images/icon_calendar.jpg" style="margin-top:auto;" CausesValidation="false" onclick="btnDate2_Click" /> <ajaxToolkit:CalendarExtender ID="calExtender2" runat="server" Format="dddd, MMMM dd, yyyy" OnClientDateSelectionChanged="CheckDateEalier" PopupButtonID="btnDate2" TargetControlID="txtDate" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtDate" ErrorMessage="Select a Date" Font-Bold="True" Font-Size="X-Small" ForeColor="Red"></asp:RequiredFieldValidator><br /> Javascript code is :- function CheckDateEalier(sender, args) { sender._textbox.set_Value(sender._selectedDate.format(sender._format)) } My requirement is that as the date is entered in to the textbox, I want to call this method: public void TimeSpentDisplay() { string date = txtDate.Text.ToString(); DateTime dateparsed = DateTime.ParseExact(date, "dddd, MMMM dd, yyyy", null); DateTime currentDate = System.DateTime.Now; if (dateparsed.Date > currentDate.Date) { divtimeSpent.Visible = true; } if (dateparsed.Date < currentDate.Date) { divtimeSpent.Visible = true; } if (dateparsed.Date == currentDate.Date) { divtimeSpent.Visible = false; } } Please help me that how i achieve this as i m calling this method inside txtDate_TextChanged method but the event is not firing as the text is changed inside the textbox. Please suggest how I can achieve this or give me an alternate idea to fulfill my requirement.

    Read the article

  • Silently catch windows error popups when calling System.load() in java

    - by Marcelo Morales
    I have a Java Swing application, which needs to load some native libraries in windows. The problem is that the client could have different versions of those libraries. In one recent version, either the names changed or the order on which the libraries must be loaded changed. To keep up, we iterated over all possible library names but some fail to load (due to it's nonexistence or because another must be loaded previously). This idea works on older Windows but on latter ones it shows a error popup. I saw on question 4058303 (Silently catch windows error popups when calling LoadLibrary) that I need to call SetErrorMode but I am not sure how to call SetErrorMode from jna. I tried to follow the idea from question 11038595 but I am not sure how to proceed. public interface CKernel32 extends Kernel32 { CKernel32 INSTANCE = (CKernel32) Native.loadLibrary("kernel32", CKernel32.class); // TODO: HELP: HOW define the SetErrorMode function } How do I define (from the SetErrorMode documentation): UINT WINAPI SetErrorMode( _In_ UINT uMode ); in the line marked as TODO: HELP:? Thanks in advance

    Read the article

  • Browser security when calling HTTP assets via a SWF on a HTTPS site

    - by Mark Ursino
    We have a site that runs on HTTPS and needs to pull in various JS assets to run a video player on the page. We get a browser security warning on this page because the JS files we are externally calling are being accessed via HTTP, not HTTPS. E.g. // HTTP reference on a HTTPS site <script src="http://the-cdn.tld/player.js"></script> Simply accessing this one JS assets via HTTP and not HTTPS will cause the browser security warning which we need to get rid of. The provider of the JS file does not support an HTTPS equivalent (like Google Analytics does). We would ideally love to just do the following, but the provider does not have this: // HTTPS reference on a HTTPS site <script src="https://the-cdn.tld/player.js"></script> One option we had was to just download a copy of the JS file and serve it on the HTTPS site, however we have concerns with this as it is not recommended by the provider and will not include updates from them. Assuming we cannot do that, we were thinking a possible other option would be to use a SWF file as a proxy. We were thinking that we could have one of our flash guys create a SWF that loads in the HTTP-served JS file to the page. We were wondering that if this SWF makes the request, would that prevent the browser from showing the security warning or not? I assumed that we would still see the warning since the SWF is still making the request through the browser, but I wanted to see what the hive mind thinks.

    Read the article

  • advanced Visual Studio kung-fu test -- Calling functions from the Immediate Window during debugging

    - by kizzx2
    I see some related questions have been asked, but they're either too advanced for me to grasp or lacking a step-by-step guide from start to finish (most of them end up being insider talk of their own experiment results). OK here it is, given this simple program: #include <stdio.h> #include <string.h> int main() { FILE * f; char buffer[100]; memset(buffer, 0, 100); fun(); f = fopen("main.cpp", "r"); fread(buffer, 1, 99, f); printf(buffer); fclose(f); return 0; } What it does is basically print itself (assume file name is main.cpp). Question How can I have it print another file, say foobar.txt without modifying the source code? It has something to do with running it through VS's, stepping through the functions and hijacking the FILE pointer right before fread() is called. No need to worry about leaking resources by calling fclose(). I tried the simple f = fopen("foobar.txt", "r") which gave CXX0017: Error: symbol "fopen" not found Any ideas? Edit I found out the solution accidentally on Debugging Mozilla on Windows FAQ. The correct command to put into the Immediate Window is f = {,,MSVCR100D}fopen("foo.txt", "r") However, it doesn't really answer this question: I still don't understand what is going on here. How to systematically find out the {,,MSVCR100D} part for any given method? I know the MSVCR version changes from system to system. How can I find that out? Could anyone explain the curly brace syntax, especially, what are those two commas doing there? Are there more hidden gems using this syntax?

    Read the article

  • Calling Java classes from IzPack

    - by bguiz
    I am trying to write an IzPack installer which is able to detect a previously installed version of the application. After finding out that it doesn't really support this feature, I think the only way to do this is through writing a Java class and calling it from IzPack. Tim Williscroft has previously suggested this method: <condition type="java" id="jbossEnv"> <java> <class>au.com.codarra.ela.installer.JBossChecker</class <field>hasJBossEnv</field> </java> <returnvalue type="boolean">true</returnvalue> </condition> However, is it possible to call <java> from somewhere other than a <condition> tag? I want to be able to call it from a <variable> tag. Also, is it possible to call a method from a Java class instead of reading a value of a field? I want to be able to pass parameters to my class. Thank you!

    Read the article

  • Calling method on category included from iPhone static library causes NSInvalidArgumentException

    - by Corey Floyd
    I have created a static library to house some of my code like categories. I have a category for UIViews in "UIView-Extensions.h" named Extensions. In this category I have a method called: - (void)fadeOutWithDelay:(CGFloat)delay duration:(CGFloat)duration; Calling this method works fine on the simulator on Debug configuration. However, if try to run the app on the device I get a NSInvalidArgumentException: [UIView fadeOutWithDelay:duration:]: unrecognized selector sent to instance 0x1912b0 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIView fadeOutWithDelay:duration:]: unrecognized selector sent to instance 0x1912b0 It seems for some reason UIView-Extensions.h is not being included in the device builds. What I have checked/tried I did try to include another category for NSString, and had the same issue. Other files, like whole classes and functions work fine. It is an issue that only happens with categories. I did a clean all targets, which did not fix the problem. I checked the static library project, the categories are included in the target's "copy headers" and "compile sources" groups. The static library is included in the main projects "link binary with library" group. Another project I have added the static library to works just fine. I deleted and re-added the static library with no luck -ObjC linker flag is set Any ideas? nm output libFJSCodeDebug.a(UIView-Extensions.o): 000004d4 t -[UIView(Extensions) changeColor:withDelay:duration:] 00000000 t -[UIView(Extensions) fadeInWithDelay:duration:] 000000dc t -[UIView(Extensions) fadeOutWithDelay:duration:] 00000abc t -[UIView(Extensions) firstResponder] 000006b0 t -[UIView(Extensions) hasSubviewOfClass:] 00000870 t -[UIView(Extensions) hasSubviewOfClass:thatContainsPoint:] 000005cc t -[UIView(Extensions) rotate:] 000002d8 t -[UIView(Extensions) shrinkToSize:withDelay:duration:] 000001b8 t -[UIView(Extensions) translateToFrame:delay:duration:] U _CGAffineTransformRotate 000004a8 t _CGPointMake U _CGRectContainsPoint U _NSLog U _OBJC_CLASS_$_UIColor U _OBJC_CLASS_$_UIView U ___CFConstantStringClassReference U ___addsf3vfp U ___divdf3vfp U ___divsf3vfp U ___extendsfdf2vfp U ___muldf3vfp U ___truncdfsf2vfp U _objc_enumerationMutation U _objc_msgSend U _objc_msgSend_stret U dyld_stub_binding_helper

    Read the article

  • Calling functions from the Immediate Window during debugging -- advanced Visual Studio kung-fu test

    - by kizzx2
    I see some related questions have been asked, but they're either too advanced for me to grasp or lacking a step-by-step guide from start to finish (most of them end up being insider talk of their own experiment results). OK here it is, given this simple program: #include <stdio.h> #include <string.h> int main() { FILE * f; char buffer[100]; memset(buffer, 0, 100); fun(); f = fopen("main.cpp", "r"); fread(buffer, 1, 99, f); printf(buffer); fclose(f); return 0; } What it does is basically print itself (assume file name is main.cpp). Question How can I have it print another file, say foobar.txt without modifying the source code? It has something to do with running it through VS's, stepping through the functions and hijacking the FILE pointer right before fread() is called. No need to worry about leaking resources by calling fclose(). I tried the simple f = fopen("foobar.txt", "r") which gave CXX0017: Error: symbol "fopen" not found Any ideas?

    Read the article

  • Routing problem with calling a new method without an ID

    - by alkaloids
    I'm trying to put together a form_tag that edits several Shift objects. I have the form built properly, and it's passing on the correct parameters. I have verified that the parameters work with updating the objects correctly in the console. However, when I click the submit button, I get the error: ActiveRecord::RecordNotFound in ShiftsController#update_individual Couldn't find Shift without an ID My route for the controller it is calling looks like this looks like this: map.resources :shifts, :collection => { :update_individual => :put } The method in ShiftsController is this: def update_individual Shift.update(params[:shifts].keys, params[:shifts].values) flash[:notice] = "Schedule saved" end The relevant form parts are these: <% form_tag( update_individual_shifts_path ) do %> ... (fields for...) <%= submit_tag "Save" %> <% end %> Why is this not working? If I browse to the url: "http://localhost:3000/shifts/update_individual/5" (or any number that corresponds to an existing shift), I get the proper error about having no parameters set, but when I pass parameters without an ID of some sort, it errors out. How do I make it stop looking for an ID at the end of the URL?

    Read the article

  • Creating a Hello World library function in assembly and calling it from C#

    - by Filip Ekberg
    Let's say we use NASM as they do in this answer: how to write hellow world in assembly under windows. I got a couple of thoughts and questions regarding assembly combined with c# or any other .net languages for that matter. First of all I want to be able to create a library that has the following function HelloWorld that takes this parameter: Name In C# the method signature would looke like this: void HelloWorld(string name) and it would print out something like Hello World from name I've searched around a bit but can't find that much good and clean material for this to get me started. I know some basic assembly from before mostly gasthough. So any pointers in the right direction is very much apprechiated. To sum it up Create a function in ASM ( NASM ) that takes one or more parameters Compile and create a library of the above functionality Include the library in any .net language Call the included library function Bonus features How does one handle returned values? Is it possible to write the ASM-method inline? When creating libraries in assembly or c, you do follow a certain "pre defined" way, the c calling convetion, correct?

    Read the article

  • java annotations - problem with calling a locator class from a Vaadin Project

    - by George
    Hello, I'm not sure how to explain this without writing several pages so I hope the actual code is more expressive. I've made a jar containing multiple annotation declaration similar to the following: @Target(ElementType.PACKAGE) @Retention(RetentionPolicy.RUNTIME) public @interface MarkedPackage { } then I have made a test jar containing several classes in several packages and marked just one package with the above annotation (with package-info.java) like below: @myPackage.MarkedPackage package package.test.jar; this jar had in its build path the jar containing the annotations. then I made a static class that has a method (LoadPlugins) that retrieves a list with all the jars of a directory. Then it searches through the jars for the 'package-info' class and checks if that classes package contains the MarkedPackage annotation. by calling this: if (checkPackageAnnotation(thisClass.getPackage())) where thisClass is the package-info class retrieved via a classloader. and: public static boolean checkPackageAnnotation(AnnotatedElement elem) { System.out.println(elem.getAnnotations().length); if (elem == null || !elem.isAnnotationPresent(MarkedPackage.class)) return false; return true; } the elem.getAnnotatios().length is there for debug purposes. And the problem appears when I call the method from the static class: if I call it from a main function: public class MyMain { public static void main(String[] args){ PluginUtils.LoadPlugins(); } } everything works perfectly it displays '1' from that System.out.println(elem.getAnnotations().length); But if I call it from a button from my Vaadin project: header.addComponent(new Button("CallThat", new Button.ClickListener() { public void buttonClick(ClickEvent event) { PluginUtils.LoadPlugins(); } })); It displays '0' from that System.out.println(elem.getAnnotations().length); Also I should mention that I created the main inside my Vaadin project so it would have the exact same build path and resources. Is there a problem with web applications and that "@Retention(RetentionPolicy.RUNTIME)" ? hope I was clear enough... Hope someone has a solution for me... If you need more information - let me know. Thank you.

    Read the article

  • Exception calling remote SOAP call from thread

    - by Duncan
    This is an extension / next step of this question I asked a few minutes ago. I've a Delphi application with a main form and a thread. Every X seconds the thread makes a web services request for a remote object. It then posts back to the main form which handles updating the UI with the new information. I was previously using a TTimer object in my thread, and when the TTimer callback function ran, it ran in the context of the main thread (but the remote web services request did work). This rather defeated the purpose of the separate thread, and so I now have a simple loop and sleep routine in my thread's Execute function. The problem is, an exception is thrown when returning from GetIMySOAPService(). procedure TPollingThread.Execute; var SystemStatus : TCWRSystemStatus; begin while not Terminated do begin sleep(5000); try SystemStatus := GetIMySOAPService().GetSystemStatus; PostMessage( ParentHandle, Integer(apiSystemStatus), Integer(SystemStatus), 0 ); SystemStatus.DataContext := nil; LParam(SystemStatus) := 0; except end; end; end; Can anyone advise as to why this exception is being thrown when calling this function from the thread? I'm sure I'm overlooking something fundamental and simple. Thanks, Duncan

    Read the article

  • Calling DI Container directly in method code (MVC Actions)

    - by fearofawhackplanet
    I'm playing with DI (using Unity). I've learned how to do Constructor and Property injection. I have a static container exposed through a property in my Global.asax file (MvcApplication class). I have a need for a number of different objects in my Controller. It doesn't seem right to inject these throught the constructor, partly because of the high quantity of them, and partly because they are only needed in some Actions methods. The question is, is there anything wrong with just calling my container directly from within the Action methods? public ActionResult Foo() { IBar bar = (Bar)MvcApplication.Container.Resolve(IBar); // ... Bar uses a default constructor, I'm not actually doing any // injection here, I'm just telling my conatiner to give me Bar // when I ask for IBar so I can hide the existence of the concrete // Bar from my Controller. } This seems the simplest and most efficient way of doing things, but I've never seen an example used in this way. Is there anything wrong with this? Am I missing the concept in some way?

    Read the article

  • Regular expression for dividing country calling codes

    - by RickiG
    Hi I have a list of calling codes for all countries(the phone number prefixes), I would like to split them up in the country name and the actual code so I can put then into an xml. I have tried back and forth but can not get a regexp going that takes all cases into account. I think it is fairly simple for someone with a bit of experience. The codes have these formats: Afghanistan 93 Anguilla 1 264 Antarctica 6721 Antigua and Barbuda 1 268 Bosnia and Herzegovina 387 Canada 1 Congo, Republic of the 242 Cote d'Ivoire 225 Ireland (Eire) 353 United States of America 1 There are around 235 of them in total, but these are the regulars and the exceptions. ^[a-zA-Z]\s,'()] for between 1 and X words and then it is [0-9\s]{1,5}$ for the numbers: X XX XXX XXXX X XXX So if I should express it as a sentence it would be: "from beginning of a line, take all characters (1) including space,'() until you encounter digits, then take all of these including space(2) until you encounter a line break." I am using TextMate, and the docs says: TextMate uses the Oniguruma regular expression library by K. Kosako. I would appreciate any help given:) Thank you.

    Read the article

  • iPhone: Calling dealloc on parentViewController causes an exception

    - by arielcamus
    Hi, I'm dealing with viewDidUnload and dealloc methods and I've founded a problem when calling [super dealloc]; in parent view controller. I have a lot of view controllers with custom code which I have putted outside on a parent view controller. So, when defining my view controllers I set a reference to the super class: @interface LoginViewController : AbstractViewController Then, at the dealloc method I call the AbstractViewController dealloc method: //(Login View Controller code) - (void)dealloc { [user release]; [passwd release]; [super dealloc]; } [super dealloc] execute the following code: //(Abstract View Controller code) - (void)dealloc { [dbUtils release]; [loadingView release]; [super dealloc]; } If I simulate a memory warning on iPhone Simulator, the following exception is thrown: 2010-03-03 11:27:45.805 MyApp[71563:40b] Received simulated memory warning. 2010-03-03 11:27:45.808 MyApp[71563:40b] *** -[LoginViewController isViewLoaded]: message sent to deallocated instance 0x13b51b0 kill quit However, if I comment the [super dealloc] line in AbstractViewController the exception is not thrown and my app still running. Thank you for your help once again!

    Read the article

  • Python calling class methods with the wrong number of parameters

    - by Hussain
    I'm just beginning to learn python. I wrote an example script to test OOP in python, but something very odd has happened. When I call a class method, Python is calling the function with one more parameter than given. Here is the code: 1. class Bar: 2. num1,num2 = 0,0 3. def __init__(num1,num2): 4. num1,num2 = num1,num2 5. def foo(): 6. if num1 num2: 7. print num1,'is greater than ',num2,'!' 8. elif num1 is num2: 9. print num1,' is equal to ',num2,'!' 10. else: 11. print num1,' is less than ',num2,'!' 12. a,b,t = 42,84,bar(a,b) 13. t.foo 14. 15. t.num1 = t.num1^t.num2 16. t.num2 = t.num2^t.num1 17. t.num1 = t.num1^t.num2 18. 19. t.foo 20. And the error message I get: python test.py Traceback (most recent call last): File "test.py", line 12, in a,b,t = 42,84,bar(a,b) NameError: name 'bar' is not defined Can anyone help? Thanks in advance

    Read the article

  • jquery append a tr after calling

    - by marharépa
    Hello! I've got a table. <table id="servers" ...> ... {section name=i loop=$ownsites} <tr id="site_id_{$ownsites[i].id}"> ... <td>{$ownsites[i].phone}</td> <td class="icon"><a id="{$ownsites[i].id}" onClick="return makedeleterow(this.getAttribute('id'));" ...></a></td> </tr> {/section} <tbody> </table> And this java script. <script type="text/javascript"> function makedeleterow(id) { $('#delete').remove(); $('#servers').append($(document.createElement("tr")).attr({id: "delete"})); $('#delete').append($(document.createElement("td")).attr({colspan: "9", id: "deleter"})); $('#deleter').text('Biztosan törölni szeretnéd ezt a weblapod?'); $('#deleter').append($(document.createElement("input")).attr({type: "submit", id: id, onClick: "return truedeleterow(this.getAttribute('id'))"})); $('#deleter').append($(document.createElement("input")).attr({type: "hidden", name: "website_del", value: id})); } </script> It's workin fine, it makes a TR after the table's last tr and put the info to it, and the delete also works fine. But i'd like to make this AFTER the tr which calling the script. How can i do this? I've tried it with closest() but not work :(

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >