Search Results

Search found 23674 results on 947 pages for 'custom action'.

Page 7/947 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Can I add custom methods/attributes to built-in Python types?

    - by sfjedi
    For example—say I want to add a helloWorld() method to Python's dict type. Can I do this? JavaScript has a prototype object that behaves this way. Maybe it's bad design and I should subclass the dict object, but then it only works on the subclasses and I want it to work on any and all future dictionaries. Here's how it would go down in JavaScript: String.prototype.hello = function() { alert("Hello, " + this + "!"); } "Jed".hello() //alerts "Hello, Jed!" Here's a useful link with more examples— http://www.javascriptkit.com/javatutors/proto3.shtml

    Read the article

  • SNMP custom script :: OID not increasing

    - by amprantino
    I try to create a custom SNMP oid. I add the following like to snmpd.conf (and restart service) : pass .1.3.6.1.3.2 /bin/myscript.sh cat myscript.sh #!/bin/sh echo .1.3.6.1.3.2 echo gauge exec 100 snmpwalk -c mycommunity -v2c 10.2.1.4 .1.3.6.1.3.2 SNMPv2-SMI::experimental.2 = Gauge32: 100 Error: OID not increasing: SNMPv2-SMI::experimental.2 >= SNMPv2-SMI::experimental.2 Is snmpwalk expecting anything at the end of the query ? snmpget work with no problem! Thank you

    Read the article

  • How to implement custom domain feature like posterous?

    - by Weiwei
    here is how posterous works, I make a A record of DNS of my domain (blog.mydomainname.com) to posterous IP address 67.207.139.81 , in the manage panel of posterous , i put my custom domain (blog.meetingly.com). Then i can reach my posterous blog http://mydomainname.posterous.com from http://blog.mydomainname.com url. How posterous implements this? Is this a DNS level thing or web server level setting? Thanks a lot!

    Read the article

  • AdSense (reports) and custom channels

    - by RobbertT
    Please help me to further understand custom channels. As Google says it is a way to map your ads, but I still have a few questions: Is it correct that a single custom channel per 1 ad is not very useful, since you can specify Ad blocks in the AdSense reports? I have multiple Ads in multiple custom channels. After this I created 1 custom channel and added all the ads to it. I made this channel targetable, so people can target through this channel on all ads at once. Is this a good way to do it? In other words, is it possible to have ads in multiple custom channels (without targeting, just for analyzing) and then create 1 custom channel with targeting that embraces all the (desired) ads? Why is it not possible for me to analyze custom channels (or ad blocks & formats) per site in the Adsense (reports). Or am I doing something wrong? If not, I have to create different custom channels per site to see how certain ads are doing on a site level?

    Read the article

  • Izpack: Creating custom panels

    - by bguiz
    Hi, I am trying to create a custom panel for an IzPack installer. This means that I have to extend IzPanel. However, it appears that if I do this, the extended panel needs to be in the com.izforge.izpack.panels package. Then I found this post, which stipulates that: As such, you must include installer.jar from the lib folder of IzPack in the build path of your custom panel project. Your custom panel /must/ extend com.izforge.izpack.installer.IzPanel. Furthermore, it /must/ reside in the com.izforge.izpack.panels package. On top of it all, your build jar's name /must/ be the same as the unqualified name of your custom panel class. I take issue with the 1st and 4th points. They imply that I have to create an additional JAR file for each custom IzPanel that I create. Also, I would have to modify the IzPack installation by adding these JARs to one of its subdirectories. Is this article outdated (2008) and can it be safely ignored, or is this still true? If not how can I avoid this and simply have the extended IzPanel on the classpath instead? Thank you!

    Read the article

  • Email an image via custom url scheme

    - by Amaresh
    I am using custom url schemes. I can send string messages as parameters to my custom url and emailing this to any person. When any person opens this email attachment in device in it open my app installed in device with the passed parameters in my custom url. Similarly how to email an image via custom url and when any person opens this attachment the image is passed to my app in device. I tried to encode the image in base64 format and tried to append to my url,but not working. Any ideas?? Thanks in advance

    Read the article

  • WPF Custom Control with Image problem

    - by user311883
    Hi all, I am quite new to WPF/XAML and I am currently facing a problem. I have a solution with two projects in it, the first project is a Custom Control Library with a custom Window form control inside. The second project is a WPF application using my custom window form. All work fine except for the form Icon. In the WPF application project I set my window icon property to "/ProjectTwoNameSpace;component/Resources/Images/Film.ico", and in the WPF custom control I try to show that image that way : <Image Grid.Column="0" Margin="3" Width="27" Height="27"> <Image.Source> <BitmapImage UriSource="{Binding Path=Icon}" /> </Image.Source> </Image> But it doesn't work, I get a error at runtime saying that the property UriSource or StreamSource must be set for my tag. Anyone can help me ? I think it's jsut a WPF newbie problem ^^

    Read the article

  • flex custom events bubbling

    - by Rajeshbabu TRC
    Dear Richard Szalay, i go through your answers regarding bubbling, i want explore bubbling more. Please see my sample below <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:view="com.view.*" > } ]] In my custom event class i set bubbling=true, cancelable=true I can understand from previous answer that bubbling only affects UI components; events fired from custom classes will not bubble, even if the bubbles argument is set to true. My question is how can i prevent panelClickHandler function got fired when i click button in the "Load" (custom component)?? pleas explain bubbling with good example ( like to have with custom event classes)?

    Read the article

  • Get all custom fields that belong to a certain box in Wordpress

    - by user252160
    How can I get all custom fields that belong to a certain box only. For example, I am using the "more fields" plugin which allows me to create boxes of custom fields for instance a box called "hotel features" with different custom fields as the particular features. Teh point is that when I extract meta data in the template, there is no way, known to me, how to get only the fields that belong to the "hotel features box", say. Please, help with suggestions

    Read the article

  • NetBeans create and instantiate programatically custom swing widgets

    - by RenegadeAndy
    Hey! I have a problem I know how I would solve easily developing under eclipse - but not so easily developing under net beans. I want to create a custom swing widget - which I can instantiate by code as many as I need and attach them to my main panel. I have developed the rest of the GUI using the GUIBuilder. The problem is - im not entirely sure how to do this. Say I got 20 results back from a web service, I would wana loop round - and add 20 of these custom swing widgets - the custom swing widgets would look as follows : :Picture: :Label: :Label: Can anybody please help me, im not entirely sure how to do the custom widget either! Thanks in advance for any support. Andy

    Read the article

  • Wordpress show next 3 x number adjacent custom posts from existing

    - by user2463284
    On a single/detail Custom Post Page I would like to display a custom nav of li's or divs in a sidebar that displays both title, excerpt and permalink for the next 3 posts within the custom post series. So if we are on custom post 3 then it would show 4, 5, 6 in the sidebar. The closest I've found to this is :-= global $post; $current_post = $post; // remember the current post for($i = 1; $i <= 3; $i++){ $post = get_previous_post(); // this uses $post->ID setup_postdata($post); // do your stuff here the_title(); } $post = $current_post; // restore Problem is this only shows the first next post and I need to show 3. Thanks Glennyboy

    Read the article

  • C# custom control: Use internal content as Text field

    - by Ed Woodcock
    I'm creating a custom control, and I want to get all the stuff within the tags and use it as a string Text field on my control: i.e. <custom:control ID="C" runat="server">This text should go into the text property</custom:control> Does anyone know how to achieve this? I've tried the following attributes on my text field (copied from the Literal control) but it doesn't seem to work! [DefaultValue(""), Bindable(true), Localizable(true)]

    Read the article

  • Wix CustomAction Binary SourceFile not found

    - by narenvarmap
    <Binary Id="binUpdate" SourceFile="c:\xxx\Update.exe"/> <CustomAction Id="Update" BinaryKey="binUpdate" Execute="deferred" ExeCommand="c:\xxx" /> When I build a Wix project with the above custom action, it complains that "The system cannot find the file 'C:\xxx\Update.exe". This update.exe is deployed by the same msi. So, how do I make Wix to ignore the fact that the file does not exist on my build machine? Thanks in advance

    Read the article

  • Custom 403 Error page not showing

    - by Rahul Sekhar
    I want to restrict access to certain folders (includes, xml and logs for example) and so I've given them 700 permissions, and all files within them 600 permissions. Firstly, is this the right approach to restrict access? I have a .htaccess file in my root that handles rewriting and error documents. There are two pages in the root - 403.php and 404.php - for 403 and 404 errors. And I have these rules added to my .htaccess file: ErrorDocument 404 /404.php ErrorDocument 403 /403.php Now, the 404 page works just fine. The 403 page does not show when I try to access the 'includes' folder - I get the standard apache 403 error page instead, saying 'Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.' However, when I try going to the .htaccess file (in the web root) in my browser, I get my custom 403 error page. Why is this happening?

    Read the article

  • Apache: how to set custom 401 error page and save original behaviour

    - by petRUShka
    I have Kerberos-based authentication with Apache/2.2.3 (Linux/SUSE). When user is trying to open some url, browser ask him about domain login and password like in HTTP Basic Auth. If user cancel such request 3 times Apache returns 401 Authorization Required error page. My current virtual host config is <Directory /home/user/www/current/public/> Options -MultiViews +FollowSymLinks AllowOverride None Order allow,deny Allow from all AuthType Kerberos AuthName "Domain login" KrbAuthRealms DOMAIN.COM KrbMethodK5Passwd On Krb5KeyTab /etc/httpd/httpd.keytab require valid-user </Directory> I want to set nice custom 401 error page with some instructions for users. And I added such line in virtual host config: ErrorDocument 401 /pages/401 It works, when user can't authorize apache redirects him to my nice page. But Apache doesn't ask user login\password as it did before. I want this functionality and nice error page simultaneously! Is it possible to make it works properly?

    Read the article

  • How to set up custom 401 error page or redirect in WSS3 SP2

    - by Stacy Vicknair
    I've got a WSS3 sharepoint site that requires windows authentication both in IIS and via the Sharepoint site. What I would like to do is in the case that a user does not provide valid AD credentials they are redirected to a custom error page. Currently, if the user immediately hits cancel when prompthey will see a plain text response of "401 UNAUTHORIZED". If they make an attempt and then hit cancel they instead see a blank page. I have looked into several options such as customErrors, httpModule interception (only saw examples for this after the user is authenticated), IIS Url rewrites (didn't see how this could help). Is there a good way to do this?

    Read the article

  • Struts 2 how to display messages saved in a Interceptor which would redirec to another action?

    - by mui13
    in my interceptor, if user doesn't have enough right, there would be a warn message: public String intercept(ActionInvocation invocation) throws Exception { ActionContext actionContext = invocation.getInvocationContext(); Map<String, Object> sessionMap = actionContext.getSession(); User loginUser = (User) sessionMap.get("user"); Object action = invocation.getAction(); if (loginUser != null && loginUser.getRole().getId() != Constant.AUTHORITY_ADMIN) { ((ValidationAware) action).addFieldError("user.authority", ((DefaultAction) action).getText("user.action.authority.not.enough")); return DefaultAction.HOME_PAGE; } return invocation.invoke(); } then, it would redirect to "HOME_PAGE" action, if success, display information in the jsp. So how to display the warn message? i have used two interceptors configed in strust.xml, for admin right requirment: <interceptor-stack name="authorityStack"> <interceptor-ref name="authority" /> <interceptor-ref name="defaultStack" /> <interceptor-ref name="store"> <param name="operationMode">STORE</param> </interceptor-ref> </interceptor-stack> default is: <interceptor-stack name="default"> <interceptor-ref name="login" /> <interceptor-ref name="defaultStack" /> <interceptor-ref name="store"> <param name="operationMode">AUTOMATIC</param> </interceptor-ref> </interceptor-stack>

    Read the article

  • Struts. Go back to same page after an action

    - by framara
    Hi there, my situation is the following: I have a project with JSP, Struts and a lot of actions. Lets say that I have these 3 main groups {contacts.do, calendar.do and notes.do} with lot of actions in each of them. I have an action unrelated to all of them but since I didn't know where to put it I just chose contacts. My aim is after the action, to go back to the page I was but since the action is place in contacts it returns to the default action of contacts. Is there anything I could do for this purpose? Thank you.

    Read the article

  • No video signal at boot with custom built computer

    - by Bart Pelle
    After booting my custom built computer, neither the VGA nor the HDMI methods from the video card seem to emit any signal to the display. I have tested both a regular VGA screen and a modern HDMI screen. Both did not receive signal. Below are the specifications from my computer build: Intel Core i5 3350P ASRock B75 Pro 3-M Seagate Barracuda 7200.14 ST1000 DM003 1000GB Corsair Vengeance LP CML 8GX 3M2 A1600 CGB Blue (2 cards) Cooler Master B Series B600 Club 3D Radeon HD7870 XT Jokercard Samsung SH-224 BB Black Sharkoon T28 Case The motherboard does not emit any beeps on startup. The CD tray opens properly and all fans spin. All cables are properly connected. All components are new and no damage was found on any of the components. The fans on the GPU spin aswell. The VGA test we did was by using the onboard graphics from the Intel i5, but this gave no result. The HDMI test was from the GPU which did not emit any signal either. We have not been able to test out the DVI, could this be important to test, even though all the other methods did not work? Thank you for your time and hopefully reply.

    Read the article

  • SharePoint and COMException (0x80004005): Cannot complete this action

    - by Damon
    I ran into a small issue today working on a deployment.  We were moving a custom ASP.NET control from my development environment into a SharePoint layout page on a staging environment .  I was expecting some minor issues to arise since I had developed the control in an ASP.NET website project, but after getting everything moved over we got an obscure COMException error the that looked like this: Cannot complete this action. Please try again. 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.Runtime.InteropServices.COMException: Cannot complete this action. [COMException (0x80004005): Cannot complete this action. .Lengthy stack trace goes here. Everything in the custom control was built using managed code, so we weren't sure why a COMException would suddenly appear. The control made use of an ITemplate to define its UI, so there was a lot of markup and binding code inside the template. As such, we started taking chunks of the template out of the layout page and eventually the error went away.  It was being caused by a section of code where we were calling a custom utility method inside some binding code: <%# WebUtility.FormatDecimal(.) %> Solution: It turns out that we were missing an Assembly and Import directive at the top of the page to let the page know where to find this method.  After adding these to the page, the error went away and everything worked great.  So a COMException (0x80004005) Cannot complete this action error is just SharePoint's friendly way of letting you know you're missing an assembly or imports reference.

    Read the article

  • Level editor event system, how to translate event to game action

    - by Martino Wullems
    Hello, I've been busy trying to create a level editor for a tile based game i'm working on. It's all going pretty fine, the only thing i'm having trouble with is creating a simple event system. Let's say the player steps on a particulair tile that had the action "teleport" assigned to it in the editor. The teleport string is saved in the tile object as a variable. When creating the tilegrid an actionmanager class scans the action variable and assigns actions to the variable. public static class ActionManager { public static function ParseTileAction(tile:Tile) { switch(tile.action) { case "TELEPORT": //assign action here break; } } } Now this is an collision event, so I guess I should also provide an object to colide with the tile. But what if it would have to count for collision with all objects in the world? Also, checking for collisions in the actionmanager class doesn't seem very efficient. Am I even on the right track here? I'm new to game design so I could be completly off track. Any tips on how handeling and creating events using an editor is usually done would be great. The main problem i'm having is the Thanks in advance.

    Read the article

  • Custom Display Form with Custom Workflow button

    - by Ifi
    I have created a new custom list form that will show 4 fields on the page from a Custom List called "Shipment". I have added Form Action button that I would like to run a custom action that is set inside of a Workflow. Currently, the form displays the fields for "Manifest Number", "Pickup Location", "Delivery Location", & "Scheduled Pickup Time". When the user clicks the Form Action button, what I want the Workflow to do is go to the ID field of the displayed content in the Form and change the value of the "Picked Up" column from No to Yes. The problem I am having is passing the ID of the displayed information from the Form to the Workflow as a variable. I can get the "Picked Up" column to update if I specify the value in the "Update List Item" window under the "Find the List Item" section, but I cannot figure out how to do this dynamically from the Form

    Read the article

  • ASP.NET MVC: Moving code from controller action to service layer

    - by DigiMortal
    I fixed one controller action in my application that doesn’t seemed good enough for me. It wasn’t big move I did but worth to show to beginners how nice code you can write when using correct layering in your application. As an example I use code from my posting ASP.NET MVC: How to implement invitation codes support. Problematic controller action Although my controller action works well I don’t like how it looks. It is too much for controller action in my opinion. [HttpPost] public ActionResult GetAccess(string accessCode) {     if(string.IsNullOrEmpty(accessCode.Trim()))     {         ModelState.AddModelError("accessCode", "Insert invitation code!");         return View();     }       Guid accessGuid;       try     {         accessGuid = Guid.Parse(accessCode);     }     catch     {         ModelState.AddModelError("accessCode", "Incorrect format of invitation code!");         return View();                    }       using(var ctx = new EventsEntities())     {         var user = ctx.GetNewUserByAccessCode(accessGuid);         if(user == null)         {             ModelState.AddModelError("accessCode", "Cannot find account with given invitation code!");             return View();         }           user.UserToken = User.Identity.GetUserToken();         ctx.SaveChanges();     }       Session["UserId"] = accessGuid;       return Redirect("~/admin"); } Looking at this code my first idea is that all this access code stuff must be located somewhere else. We have working functionality in wrong place and we should do something about it. Service layer I add layers to my application very carefully because I don’t like to use hand grenade to kill a fly. When I see real need for some layer and it doesn’t add too much complexity I will add new layer. Right now it is good time to add service layer to my small application. After that it is time to move code to service layer and inject service class to controller. public interface IUserService {     bool ClaimAccessCode(string accessCode, string userToken,                          out string errorMessage);       // Other methods of user service } I need this interface when writing unit tests because I need fake service that doesn’t communicate with database and other external sources. public class UserService : IUserService {     private readonly IDataContext _context;       public UserService(IDataContext context)     {         _context = context;     }       public bool ClaimAccessCode(string accessCode, string userToken, out string errorMessage)     {         if (string.IsNullOrEmpty(accessCode.Trim()))         {             errorMessage = "Insert invitation code!";             return false;         }           Guid accessGuid;         if (!Guid.TryParse(accessCode, out accessGuid))         {             errorMessage = "Incorrect format of invitation code!";             return false;         }           var user = _context.GetNewUserByAccessCode(accessGuid);         if (user == null)         {             errorMessage = "Cannot find account with given invitation code!";             return false;         }           user.UserToken = userToken;         _context.SaveChanges();           errorMessage = string.Empty;         return true;     } } Right now I used simple solution for errors and made access code claiming method to follow usual TrySomething() methods pattern. This way I can keep error messages and their retrieval away from controller and in controller I just mediate error message from service to view. Controller Now all the code is moved to service layer and we need also some modifications to controller code so it makes use of users service. I don’t show here DI/IoC details about how to give service instance to controller. GetAccess() action of controller looks like this right now. [HttpPost] public ActionResult GetAccess(string accessCode) {     var userToken = User.Identity.GetUserToken();     string errorMessage;       if (!_userService.ClaimAccessCode(accessCode, userToken,                                       out errorMessage))     {                       ModelState.AddModelError("accessCode", errorMessage);         return View();     }       Session["UserId"] = Guid.Parse(accessCode);     return Redirect("~/admin"); } It’s short and nice now and it deals with web site part of access code claiming. In the case of error user is shown access code claiming view with error message that ClaimAccessCode() method returns as output parameter. If everything goes fine then access code is reserved for current user and user is authenticated. Conclusion When controller action grows big you have to move code to layers it actually belongs. In this posting I showed you how I moved access code claiming functionality from controller action to user service class that belongs to service layer of my application. As the result I have controller action that coordinates the user interaction when going through access code claiming process. Controller communicates with service layer and gets information about how access code claiming succeeded.

    Read the article

  • Use constructor or setter method?

    - by user633600
    I am working on a UI code where I have an Action class, something like this - public class MyAction extends Action { public MyAction() { setText("My Action Text"); setToolTip("My Action Tool tip"); setImage("Some Image"); } } When this Action class was created it was pretty much assumed that the Action class wont be customizable (in a sense- its text, tooltip or image will be not be changed anywhere in the code). Of late, now we are in need of changing the action text at some location in code. So I suggested my co-worker to remove the hardcoded action text from the constructor and accept it as an argument, so that everybody is forced to pass the action text. Something like this code below - public class MyAction extends Action { public MyAction(String actionText) { setText(actionText); setTooltip("My Action tool tip); setImage("My Image"); } } He however thinks that since setText() method belongs to base class. It can be flexibly used to pass the action text wherever action instance is created. That way, there is no need to change the existing MyAction class. So his code would look something like this. MyAction action = new MyAction(); //this creates action instance with the hardcoded text action.setText("User required new action text"); //overwrite the exisitng text. I am not sure if that is a correct way to deal with problem. I think in above mentioned case user is anyway going to change the text, so why not force him while constructing the action. The only benefit I see with the original code is that user can create Action class without much thinking about setting text.

    Read the article

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