Daily Archives

Articles indexed Monday May 31 2010

Page 30/98 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Enumerate over an enum in C++

    - by jameszhao00
    In C++, Is it possible to enumerate over an enum (either runtime or compile time (preferred)) and call functions/generate code for each iteration? Sample use case: enum abc { start a, b, c, end } for each (__enum__member__ in abc) { function_call(__enum__member__); } Plausible duplicates: C++: Iterate through an enum Enum in C++ like Enum in Ada?

    Read the article

  • zend framework error

    - by Huy
    I started getting the following error today, but don't know why and what caused it. [31-May-2010 03:52:10] PHP Fatal error: Cannot run code from this file in conjunction with non encoded files in ZendFramework-1.10.5/library/Zend/Validate/Hostname/Com.php on line 547 I'm using zend framework version 1.10.5; although version 1.09 also has the same problem. I only get this error in my production server, and cannot duplicate it from anywhere else. Also note that I only get this error when I submit form with recaptcha. If I remove recaptcha, it works fine. Any help is appreciated.

    Read the article

  • Evaluating expressions using Visual Studio 2005 SDK rather than automation's Debugger::GetExpression

    - by brone
    I'm looking into writing an addin (or package, if necessary) for Visual Studio 2005 that needs watch window type functionality -- evaluation of expressions and examination of the types. The automation facilities provide Debugger::GetExpression, which is useful enough, but the information provided is a bit crude. From looking through the docs, it sounds like an IDebugExpressionContext2 would be more useful. With one of these it looks as if I can get more information from an expression -- detailed information about the type and any members and so on and so forth, without having everything come through as strings. I can't find any way of actually getting a IDebugExpressionContext2, though! IDebugProgramProvider2 sort of looks relevant, in that I could start with IDebugProgramProvider2::GetProviderProcessData and then slowly drill down until reaching something that can supply my expression context -- but I'll need to supply a port to this, and it's not clear how to retrieve the port corresponding to the current debug session. (Even if I tried every port, it's not obvious how to tell which port is the right one...) I'm becoming suspicious that this simply isn't a supported use case, but with any luck I've simply missed something crashingly obvious. Can anybody help?

    Read the article

  • How to change pop view controller animation on back button ?

    - by Aryabhatt
    Hi all , I am pushing my view controller with the following statement : [[self navigationController] pushViewController:self.customViewController animatedWithTransition:UIViewAnimationTransitionFlipFromLeft]; Now when I am pressing the back button I want to animate it with the uiviewanimationtransitionflipfromright . like [self.navigationController popViewControllerAnimatedWithTransition:UIViewAnimationTransitionFlipFromLeft]; How Can I do so ? Thanks

    Read the article

  • Haskell - mapping the odd placed values and the even placed values differently

    - by Abstract
    Hey guys, is there an easy way. To take a list of numbers, say 123456. Then multiply the odd placed by three and the even placed by 1. i.e. (1 * 3) + (2 * 1) + (3 * 3) + (4*1) + (5*3) + (6*1) i was thinking the map function somewhere along the lines. But i don't know how to map *3 to just the odd placed values. Oh and if you could give me the version not in prelude that would be great like the actual function or functions, as if its being imported from an external haskell file Thanks for the help

    Read the article

  • OData and custom WCF WebGet methods

    - by reinier
    I've created an OData endpoint (using entity framework, WCF data service) and added a custom test WebGet test method like so: [WebGet(UriTemplate = "{text}")] public IQueryable<string> SplitString(string text) { if (text == null) throw new DataServiceException("text not specified"); var result = (from s in text.Split('-') orderby s select s); return result.AsQueryable(); } and a config line: config.SetServiceOperationAccessRule("SplitString", ServiceOperationRights.All); However, no matter how I specify the url, I can not get the text param to be filled out. (it is always null). so: http://localhost/myservice.svc/SplitString/testtext does not work. What is the correct url format (or UriTemplate) one should use? The only examples I found of odata and WebGet only have an example method which doesn't have any parameters.

    Read the article

  • SVN Feature Branch Method

    - by Seth
    I am getting a SVN server setup and will be using the feature branch method. I plan on having 1+ branches making up a release tag. How do I merge (?) multiple branches into the release tag, while still maintaining diffs and such? I've given an example of our workflow below. Multiple devs pull to local Create feature branch Commit to branch Use branch to build QA (Here is where my question starts) I need to have all the branches for the next build to be put into a build tag to be used to build Production

    Read the article

  • jquery delegate table rows selector

    - by Jackob
    I have a table which may contains other inner tables (it's not possible to edit generated markup). I want to create a delegate function for row mouseenter and mouseleave which only triggers for the associated main table rows (and not inner tables rows), as following: $("#tableid").delegate("tr", "mouseenter mouseleave", function(e) { //do stuff here }); But with this selector it selects also the inner table rows, so how can I modify the selector to avoid selecting inner table rows?

    Read the article

  • Override transparency color when converting transparent PNG to JPG

    - by Alexander Malfait
    I'm using Dragonfly to generate thumbnail images in a Rails app. I'm serving all picture images as JPG's. Now the client is uploading transparent PNG files, like this one: http://www.ibanez.co.jp/products/images/eg2010/ART120_TRF_12_02.png Dragonfly uses RMagick to convert these images to JPG. The problem is that it converts the PNG images to JPG with a black background, and my site's design requires a white background. I've tried to override it like this: encoded_image = Magick::Image.from_blob(image.data).first if encoded_image.format.downcase == format image # do nothing else encoded_image.format = format encoded_image.background_color = "white" encoded_image.transparent_color = "white" encoded_image.to_blob end But the produced JPG images still contain a black background. Does anyone know how to beat RMagick into using a white background when converting the transparent layer? I know I could just serve as PNG, but then the images are 10 times as large, and the site is already pretty bandwidth heavy.

    Read the article

  • JSF actionListener is called multiple times from within HtmlTable

    - by Rose
    I have a mix of columns in my htmltable: 1 column is an actionlistener, 2 columns are actions and other columns are simple output. <h:dataTable styleClass="table" id="orderTable" value="#{table.dataModel}" var="anOrder" binding="#{table.dataTable}" rows="#{table.rows}" <an:listenerColumn backingBean="${orderEntry}" entity="${anOrder}" actionListener="closeOrder"/ <an:column label="#{msg.hdr_orderStatus}" entity="#{anOrder}" propertyName="orderStatus" / <an:actionColumn backingBean="${orderEntry}" entity="${anOrder}" action="editOrder" / <an:actionColumn backingBean="${orderEntry}" entity="${anOrder}" action="viewOrder"/ .... I'm using custom tags, but it's the same behavior if I use the default column tags. I've noticed a very strange effect: when clicking the actionlistenercolumn, the actionevent is handled 3 times. If I remove the 2 action columns then the actionevent is handled only once. The managed bean has sessionscope, bean method: public void closeOrder(ActionEvent event) { OrdersDto order; if ((order = orderRow()) == null) { return; } System.out.println("closeOrder() 1 "); orderManager.closeOrder(); System.out.println("closeOrder() 2 "); } the console prints the'debug' text 3 times.

    Read the article

  • SQL Server 2005 FREETEXT() Perfomance Issue

    - by Zenon
    I have a query with about 6-7 joined tables and a FREETEXT() predicate on 6 columns of the base table in the where. Now, this query worked fine (in under 2 seconds) for the last year and practically remained unchanged (i tried old versions and the problem persists) So today, all of a sudden, the same query takes around 1-1.5 minutes. After checking the Execution Plan in SQL Server 2005, rebuilding the FULLTEXT Index of that table, reorganising the FULLTEXT index, creating the index from scratch, restarting the SQL Server Service, restarting the whole server I don't know what else to try. I temporarily switched the query to use LIKE instead until i figure this out (which takes about 6 seconds now). When I look at the query in the query performance analyser, when I compare the ´FREETEXT´query with the ´LIKE´ query, the former has 350 times as many reads (4921261 vs. 13943) and 20 times (38937 vs. 1938) the CPU usage of the latter. So it really is the ´FREETEXT´predicate that causes it to be so slow. Has anyone got any ideas on what the reason might be? Or further tests I could do?

    Read the article

  • AgUnit - Silverlight unit testing with ReSharper

    - by koevoeter
    If you’re a ReSharper user and Silverlight 4 developer you’ll probably like this add-in that two of my co-workers created. It lets you run your Silverlight unit tests inside the Visual Studio IDE. You can get the add-in from Codeplex: http://agunit.codeplex.com/ (requires ReSharper 5 and Silverlight 4)

    Read the article

  • Count number of empty input boxes in table row

    - by Daniel Brink
    How do you calculate the number of input boxes with no value in a table row using jquery? example: <table id="table1"> <tr class="data" id="row5"> <td><input type="text" value="20%" /></td> <td><input type="text" value="10%" /></td> <td><input type="text" value="" /></td> <td><input type="text" /></td> </tr> <table> I'm looking for answer = 2

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >