Search Results

Search found 4677 results on 188 pages for 'alternative'.

Page 109/188 | < Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >

  • Is there an easy way to get a list of all successful captures from a regex pre-5.10?

    - by Chas. Owens
    I know the right way to do this if I have Perl 5.10 is to use named captures and values %+, but in Perl 5.8.9 and how can I get a list of successful captures? I have come up with two methods that are both just terrible: #you need to list each possible match my @captures = grep { defined } ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16); and #ew, I turned on symbolic references { no strict 'refs'; my @captures = map { defined $+[$_] ? $$_ : () } 1 .. $#+; } There is a third option I have found involving (?{}), but it requires global variables (because the closure happens at compile time) and takes the regex from reasonably clear to ungodly mess. The only alternative I have found is to capture the whole match and then use another set of regexes to get the values I want (actually I build the first regex out of the other regexes because there is no good reason to duplicate the logic).

    Read the article

  • Why are error pages ignored in RESTEasy web service running on Tomcat?

    - by Chandru
    I'm developing a REST-ful web service using RESTEasy deployed on Tomcat. I've configured an error page which takes the exception's message and generates an XML based on it when any exception occurs during the request. This works fine for any application generated exceptions. However, if client sends an invalid XML which cannot be unmarshalled correctly, an javax.xml.bind.UnmarshalException is thrown and Tomcat's default error page is used instead of mine. I have configured my error page to the error-code 500 in web.xml. Is using error pages the correct way to handle errors when using RESTEasy or is there an alternative way?

    Read the article

  • Sorting an array of Objective-c objects

    - by davbryn
    So I have a custom class Foo that has a number of members: @interface Foo : NSObject { NSString *title; BOOL taken; NSDate *dateCreated; } And in another class I have an NSMutableArray containing a list of these objects. I would very much like to sort this array based on the dateCreated property; I understand I could write my own sorter for this (iterate the array and rearrange based on the date) but I was wondering if there was a proper Objective-C way of achieving this? Some sort of sorting mechanism where I can provide the member variable to sort by would be great. In C++ I used to overload the < = operators and this allowed me to sort by object, but I have a funny feeling Objective-C might offer a nicer alternative? Many thanks

    Read the article

  • Integrating GSL onto iPhone Xcode

    - by zeroinverse
    I have been trying to integrate GSL (Gnu Scientific Library) into an iPhone project using Xcode. The challenge is GSL has all the modules in different folders, yet when their header files are reference, they often reference instead of or . At least with I could use Xcode's recursive header file search to find it. But with , basically file not found. Does anyone have an easy way to address the hierarchical GSL structure to compile into Xcode? I can do it the tedious way of fixing all the #INCLUDE lines but hoping there is a better alternative. This way, I can more easily update GSL when changes are made by the community. NOTE: I found Xcode needs to find the right header file locations (make sure to adjust your TARGET Build settings, not just your Project Build settings).

    Read the article

  • How to fix First Data payment gateway issues "unable to load certificate" ?

    - by Krishnan
    Our asp.net team working on Shopping cart projects We have integrated First Data payment gateway for payment process We have included Visa/master card verification using Alternative First Data payment gateway After visa/master card verification we got cavv(secure code), xid, eci values. After getting cavv, xid and eci values we have appended these values to First data payment gateway. We have set the host as "secure.linkpt.net" and port as 1129 and also set the config and pem files. Now we got an error when sending the xml values to payment gateway as given below Unable to load certificate ERRs: wsa=33558530 err=33558530 ssl=537317504 sys=33558530. INFO: ACE_SSL (3260|3384) error code: 33558530 - error:02001002:lib(2):func(1):reason(2) please help our team to fix the issue

    Read the article

  • JLabel with separate text and icon background colours

    - by emeraldjava
    Hey, I have a simple Jlabel element with text and icon setting the background changes the full label colour. I want to be able to only render the background colour on the text section of the label, ie - to have separate backgrounds/foregrounds for the icon and text. Selecting/deselecting the label will flip the colour behind the icon and text. Is this possible to do this by just extending JLabel, and if so which methods should i be looking to customise? My alternative idea is to create a panel with two separate label elements, one with an icon the other with text. It seems a bit messy, and before i start i'm wondering is there a smarter way of achieving this with Swing.

    Read the article

  • How easy is it to hack a plist file in an app store app?

    - by user249488
    Don't worry, I'm not trying to hack someone else's app, if that's what you're thinking =). I want to have 2 versions of my app, a free version and a deluxe version. My plan was to use an in-app purchase to enable the deluxe version by setting a boolean value in the plist file. My question is: is this secure or is it easily circumvented? And if it is not secure, can someone suggest a simple alternative? I don't want to download additional content, I would rather keep all of the functionality within the app and enable it somehow.

    Read the article

  • How to insert PHP script into HTML the best way?

    - by Mike
    Hello, I have to insert full path to every single image/css file of my website, because of url_rewriting and I'm looking for the most officiant way to do it. Of course I could do: <img src='<?php echo $full_path; ?>/images/theImg.jpg' alt='alternative text' /> But somewhere I saw people doing it like this, or something: <img src='{full_path}/images/theImg.jpg' /> Now do you know how the second example is possible, or is it just part of some framework and can't be used in normal document? Thanks for answers, Mike

    Read the article

  • Robust fault tolerant MySQL replication

    - by Joshua
    Is there any way to get a fault tolerant MySQL replication? I am in an environment that has many networking issues. It appears that replication gets an error and just stops. I need it to continue to work and recover from these faults. There is some wrapper software that checks the state of replication and restarts it in the case of losing its log position. Is there an alternative? Note: Replication is done from an embedded computer with MySQL 4.1 to a external computer that has MySQL 5.0.45

    Read the article

  • How to use sessions with django piston auth?

    - by xyld
    The problem is that I want to store authentication in a cookie that I can present to django piston rather than requiring user/password to be typed in each time (without hardcoding or storing the user/pass combo somewhere on disk). I was hoping to accomplish this with cookies like someone would without the piston API. Am I missing something? Django Piston doesn't seem to care about session cookies at all? Or can someone suggest a good alternative? Maybe I shouldn't use Piston?

    Read the article

  • R equivalent of .first or .last sas operator

    - by Giorgio Spedicato
    Does anybody know what is the best R alternative to SAS first. or last. operators? I did find none. SAS has the FIRST. and LAST. automatic variables, which identify the first and last record amongst a group with the same value with a particular variable; so in the following dataset FIRST.model and LAST.model are defined: Model,SaleID,First.Model,Last.Model Explorer,1,1,0 Explorer,2,0,0 Explorer,3,0,0 Explorer,4,0,1 Civic,5,1,0 Civic,6,0,0 Civic,7,0,1

    Read the article

  • PHP's apache_setenv function causes 500 Internal Server Error

    - by guitar-
    apache_setenv ( 'no-gzip', 1 ) I'm trying to disable gzip for a certain page's output, but only that page. This works fine on testing servers, but not the production server, which is running the same thing (CentOS and Apache), works on Ubuntu though. Anyway, do you know why? Or is there some other alternative? I was thinking of using ob_start () to put all output in a buffer, and then unzip it myself with a PHP function then call ob_end_flush ()... or would it not be gzipped until right before Apache sends it to the client? Thanks for any help.

    Read the article

  • Can't authenticate with different NTLM credentials in one session with java.net.URLConnection

    - by ndn
    When I access a HTTP server using the standard Java API (java.net.URLConnection), the credentials are "cached" after the first successful authentication, and subsequent calls to Authenticator.setDefault() have no effect. So, I need to restart the application in order to use different credentials. I don't observe this effect when Basic Authentication is used. But I need to use NTLM for the server I'm accessing, and the Jakarta Commons HttpClient isn't an alternative either because it doesn't support NTLMv2 (see http://oaklandsoftware.com/papers/ntlm.html) Looking at the packets using Wireshark, I also observe that before the first successful authentication, an authentication with the current Windows credentials is attempted first. But after succesful authentication, only the saved credentials are used. Is there any way to reset or change the credentials java.net.Authenticator is using after a successful NTLM authentication?

    Read the article

  • How to know when a pop-down menu needs to be closed

    - by Pieter
    I'm experimenting with pop-down menus (inside floating DIVs). Making them appear with onmouseover attributes is no problem, but I'm not sure how I can make the menu close properly. I figured the best way to know when to close the menu is wait until the mouse is no longer hovering over the HTML element that called the menu or the menu itself, then wait one second, and then close the menu. Is my idea something that can be implemented, perhaps with some jQuery? Or is there a better and more efficient alternative?

    Read the article

  • ruby syntactic sugar: dealing with nils..

    - by luca
    probably asked already but I couldn't find it.. here are 2 common situation (for me while programming rails..) that are frustrating to write in ruby: "a string".match(/abc(.+)abc/)[1] in this case I get an error because the string doesn't match, therefore the [] operator is called upon nil. What I'd like to find is a nicer alternative to the following: temp="a string".match(/abc(.+)abc/); temp.nil? ? nil : temp[1] in brief, if it didn't match simply return nil without the error The second situation is this one: var = something.very.long.and.tedious.to.write var = something.other if var.nil? In this case I want to assign something to var only if it's not nil, in case it's nil I'll assign something.other.. Any suggestion? Thanks!

    Read the article

  • Upload/Download images to FTP without bothering the user

    - by Dan B
    Hi, I know a lot of posts have been made in regards to FTP, but none have led me to what I need. I'm trying to upload a picture to a server (currently attempting FTP) but do it without notifying requiring the user to be involved. I want to be able to seamlessly upload/download the image when a certain user action occurs, but I don't want to use a third-party app like AndFTP. The idea is that a user will upload a picture, and then another user will be able to grab that picture based on which user put it up. No user will know where it's going or where it came from, nor will they navigate the FTP. Alternatively, does anyone have thoughts on a better way to do that? I thought of using the imgur api, but it can't be used commercially. It would, however, be perfect for my purposes. Is there a similar open-source alternative? Any help is greatly appreciated. Dan

    Read the article

  • Best Static Website Generator

    - by Nick Retallack
    In the age of dynamic websites built with layouts and templates, nobody wants to write plain old repetitive static html anymore. But now that you can outsource dynamic features to services like Disqus, and you could get slashdotted/dugg/reddited at any moment, sometimes a static website is best for scalability. There are quite a few static website generators out there that let you use templates, layouts, alternative markup languages, and other new age stuff. So this question is a bit of a survey. Which do you think is the best, and why? Here are a few examples to start us off: WebGen StaticMatic Static

    Read the article

  • Like Html.RenderAction() but without reinstantiating the controller object

    - by Jørn Schou-Rode
    I like to use the RenderAction extension method on the HtmlHelper object to render sidebars and the like in pages, as it allows me to keep the data access code for each such part in separate methods on the controller. Using an abstract controller base, I can define a default "sidebar strategy", which can then be refined by overriding the method in a concrete controller, when needed. The only "problem" I have with this approach, is that the RenderAction is built in a way where it always creates a news instance of the controller class, even when rendering actions from the controller already in action. Some of my controllers does some data lookup in their Initialize method, and using the RenderAction method in the view causes this to occur several times in the same request. Is there some alternative to RenderAction which will reuse the controller object if the action method to be invoked is on the same controller class as the "parent" action?

    Read the article

  • Log to rolling CSV file with Enterprise Library

    - by Tinminator
    Need logging to: Rolling file, to avoid 1 big log file. CSV format for easier look up. I can see EntLib (5.0) have Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener to log to rolling log file. To make the log entries look like a CSV row, I can change the Logging.Formatters.TextFormatter.Template to put double quote around the values. Also change the Listener's Footer and Header to nothing, so they won't be output. Under normal circumstance, this would give me a well formed CSV file. However if a token value in the Template contain double quote, this would not be escaped, hence the log file become an invalid CSV file. Is there any way to resolve this? Is there any alternative solutions to this problem?

    Read the article

  • jQuery UI sortable issue with helper Y offset value being same as scroll offset on FireFox only

    - by James
    I have a problem with a jQuery UI 1.7.2 sortable list in Firefox, IE7-8 work fine. When I'm scrolled down a bit, the helper element seems to have an offset of the same height that I'm scrolled down from the mouse pointer which makes it impossible to see which item you originally started dragging. How do I fix this or work around the issue? If there is no fix what is a really good alternative drag-able plugin? Here are my initialization parameters for the sortable. $("#sortable").sortable( {placeholder: 'ui-state-highlight' } ); $("#sortable").disableSelection();

    Read the article

  • Is there something like "if not exist create sequence ..." in Oracle SQL?

    - by Timo
    Very probably a noob question: For my application that uses an Oracle 8 DB, I am providing an SQL script to setup stuff like triggers, sequences etc., which can be copied and pasted into SQL*Plus. I would like the script to not stop with an error if a sequence that I am trying to create already exists. For a Trigger this can easily be done using "create or replace trigger ...", but for a sequence this does not work. Is there some alternative, like "if not exists mysequence then create sequence ..." (I tried this but it did not work :) ) Alternatively, if this is not possible, is there a way to do a "drop sequence mysequence" without SQL*Plus aborting the script if mysequence does not exist? Thanks. PS: I wish Oracle just had a simple Autoinc field type ... sigh.

    Read the article

  • Tools to backup an external hard disk

    - by Kaushik Gopal
    Hey people, What's the best method to take an exact copy of my external hard disk? A guru suggested rsync, but I was wondering if there's an easier alternative. I do remember reading somewhere that Acronis also does this. Was looking for your advice on the best option. I'm running Windows. Essentially i have an external HDD which has a lot of stuff synchronized across various pcs. I wish to take a backup of this external Hard disk (ext.HDDs aren't entirely reliable so want to keep a backup of my ext.HDD). Cheers. K

    Read the article

  • Space-based architecture?

    - by rcampbell
    One chapter in Pragmatic Programmer recommends looking at a blackboard/space-based architecture + a rules engine as a more flexible alternative to a traditional workflow system. The project I'm working on currently uses a workflow engine, but I'd like to evaluate alternatives. I really feel like a SBA would be a better solution to our business problems, but I'm worried about a total lack of community support/user base/venders/options. JavaSpaces is dead, and the JINI spin-off Apache River seems to be on life support. SemiSpace looks perfect, but it's a one-man show. The only viable solution seems to be GigaSpaces. I'd like to hear your thoughts on space based architecture and any experiences you've had with real world implementations.

    Read the article

  • Why use multiple OpenGL context

    - by Luca
    For rendering I have a current GL context, associated to a window. In the case the application render multiple scenes (for example using accumulation or different viewports) I think it is ok to reuse the same context. My question, indeed, is: why should I use multiple GL context? I red on ARB_framebuffer_object extension spec that MakeCurrent call could be expansive, and in the case the ARB_framebuffer_object extension is present I can render on a generic buffer without using MakeCurrent. Apparently the only reason to use multiple GL context is to avoid to setup context state (pixel store, transfer, point size, polygon stipple...) or to have avaialable multiple render buffers configuration (one context with accumulation, another without). How to determine when is better an alternative context instead of setting context state? Thankyou all!

    Read the article

  • Singleton class design in C#, are these two classes equivalent?

    - by Oskar
    I was reading up on singleton class design in C# on this great resource and decided to go with alternative 4: public sealed class Singleton1 { static readonly Singleton1 _instance = new Singleton1(); static Singleton1() { } Singleton1() { } public static Singleton1 Instance { get { return _instance; } } } Now I wonder if this can be rewritten using auto properties like this? public sealed class Singleton2 { static Singleton2() { Instance = new Singleton2(); } Singleton2() { } public static Singleton2 Instance { get; private set; } } If its only a matter of readability I definitely prefer the second version, but I want to get it right.

    Read the article

< Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >