Search Results

Search found 1667 results on 67 pages for 'andrew redd'.

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

  • Is there any way to find unreferenced code in Flex Builder?

    - by Andrew Aylett
    We've got several Flex projects, one of which has just been refactored. I'm wondering if there's an easy way to tell which classes and functions (if any) aren't being used any more? I've discovered that we've definitely got some unused code, because running ASDoc on the entire project reports some compilation errors which don't get reported by Flex Builder (implying that those classes aren't being used any more). I'm hoping to find a more robust and complete method, and preferably one which can work at function level too.

    Read the article

  • What the performance impact of enabling WebSphere PMI

    - by Andrew Whitehouse
    I am currently looking at some JProfiler traces from our WebSphere-based application, and am noticing that a significant amount of CPU time is being spent in the class com.ibm.io.async.AsyncLibrary.getCompletionData2. I am guessing, but I am wondering whether this is PMI-related (and we do have this enabled). My knowledge of PMI is limited, as this is managed by another team. Is it expected that PMI can have this sort of impact? (If so) Is the only option to turn it off completely? Or are there some types of data capture that have a particularly high overhead?

    Read the article

  • Eclipse PDT, Spket and jQuery problem

    - by Andrew Bashtannik
    Hi! I'm using Eclipse PDT and SPket for JavaScript editing. For my project I'm using jQuery library, so I added JavaScript Profile as described here. But it's not working. I tried to create new projects, change jQuery versions and locations, but failed again. Any suggestions? Thank you!

    Read the article

  • Neophyte question about using Subtotal and CountIf in Excel

    - by Andrew
    Hi, I'm using Excel and having some problems with Countif and I don't understand how it works differently from SubTotal. I used the GUI to subtotal stuff and all the subtotals are right. Then I attempted to use the Countif to see how many requirements passed. That worked for the first subtotal only. It's easy to see why. When I look at the box for the subtotal, it says: =SUBTOTAL(3,C286:C292) When I look at my formula for passed requirements, I have: =IF(ISTEXT(A285),COUNTIF(C286:C338,"=Passed"),"") Notice that the last column is wrong. How did the Subtotal manage to keep this correct? I typed in the formula for passed requirements and dragged it down the page. Everything behaved as expected (even the bit about ISTEXT dutifully figured out which row was which), but it got the last row wrong. Any ideas? SRS Maintenance Count 7 44 SRS Maintenance Passed SRS Maintenance Passed SRS Maintenance Passed SRS Maintenance Passed SRS Maintenance Passed SRS Maintenance Passed SRS Maintenance Passed SRS Reports Count 12 43 SRS Reports Passed SRS Reports Passed SRS Reports Passed SRS Reports Passed SRS Reports Failed SRS Reports Passed SRS Reports Passed SRS Reports Failed SRS Reports Passed SRS Reports Passed SRS Reports Failed

    Read the article

  • Idiomatic ruby for temporary variables within a method

    - by Andrew Grimm
    Within a method, I am using i and j as temporary variables while calculating other variables. What is an idiomatic way of getting rid of i and j once they are no longer needed? Should I use blocks for this purpose? i = positions.first while nucleotide_at_position(i-1) == nucleotide_at_position(i) raise "Assumption violated" if i == 1 i -= 1 end first_nucleotide_position = i j = positions.last while nucleotide_at_position(j+1) == nucleotide_at_position(j) raise "Assumption violated" if j == sequence.length j += 1 end last_nucleotide_position = j Background: I'd like to get rid of i and j once they are no longer needed so that they aren't used by any other code in the method. Gives my code less opportunity to be wrong. I don't know the name of the concept - is it "encapsulation"? The closest concepts I can think of are (warning: links to TV Tropes - do not visit while working) Chekhov'sGun or YouHaveOutlivedYourUsefulness. Another alternative would be to put the code into their own methods, but that may detract from readability.

    Read the article

  • Zend Form: How to pass parameters into the constructor?

    - by Andrew
    I'm trying to test my form. It will be constructing other objects, so I need a way to mock them. I tried passing them into the constructor... class Form_Event extends Zend_Form { public function __construct($options = null, $regionMapper = null) { $this->_regionMapper = $regionMapper; parent::__construct($options); } ...but I get an exception: Zend_Form_Exception: Only form elements and groups may be overloaded; variable of type "Mock_Model_RegionMapper_b19e528a" provided What am I doing wrong?

    Read the article

  • How do you make a UIBarButtonItem animation flip?

    - by Andrew Arrow
    In the iPod app on the iPhone there is a UIBarButtonItem in the upper right toolbar that flips between the song and track listings for the album. When you select the button, the button itself does a flip animation. Is there a way to do this with: CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:[self superview] cache:YES]; Do I need to make a UIBarButtonItem with initWithCustomView vs. initWithImage to achieve this?

    Read the article

  • Does PHP have job control like bash does?

    - by Andrew
    Hello, does PHP support something like ampersand in bash (forking)? Let's say I wanted to use cURL on 2 web pages concurrently, so script doesn't have to wait before first cURL command finnishes, how could one achieve that in PHP? Something like this in bash: curl www.google.com & curl www.yahoo.com & wait

    Read the article

  • Ant replace properties

    - by Andrew
    Hi. I've replaced properties file for Spring ApplicationContext using Ant, properties replaced correctly, and immidiately after Ant taskCalled, only after that first ApplicationContext call will be, but application context gets old property values

    Read the article

  • Generic Dictionary and generating a hashcode for multi-part key

    - by Andrew
    I have an object that has a multi-part key and I am struggling to find a suitable way override GetHashCode. An example of what the class looks like is. public class wibble{ public int keypart1 {get; set;} public int keypart2 {get; set;} public int keypart3 {get; set;} public int keypart4 {get; set;} public int keypart5 {get; set;} public int keypart6 {get; set;} public int keypart7 {get; set;} public single value {get; set;} } Note in just about every instance of the class no more than 2 or 3 of the keyparts would have a value greater than 0. Any ideas on how best to generate a unique hashcode in this situation? I have also been playing around with creating a key that is not unique, but spreads the objects evenly between the dictionaries buckets and then storing objects with matched hashes in a List< or LinkedList< or SortedList<. Any thoughts on this?

    Read the article

  • Calling another ruby script from a ruby script

    - by Andrew Grimm
    In ruby, is it possible to specify to call another ruby script using the same ruby interpreter as the original script is being run by? For example, if a.rb runs b.rb a couple of times, is it possible to replace system("ruby", "b.rb", "foo", "bar") with something like run_ruby("b.rb", "foo", "bar") so that if you used ruby1.9.1 a.rb on the original, ruby1.9.1 would be used on b.rb, but if you just used ruby a.rb on the original, ruby would be used on b.rb? I'd prefer not to use shebangs, as I'd like it to be able to run on different computers, some of which don't have /usr/bin/env.

    Read the article

  • TFS and code coverage for web application (MVC) assemblies not working

    - by Andrew
    I've got an MVC web application with associated controller tests that run under a TFS build as per normal. I can see the tests running and passing in the build log and they appear in the "Result details for Any CPU/Release" section of the build I also have a number of other assemblies with associated tests that are running in the same build. Tests are passing and the details are being shown in the results and logs just fine. I've enabled code coverage in the build script and the testrunconfig. The coverage is appearing for all assemblies EXCEPT the web application even though it looks like the tests have been run for it. Is there anything obvious that I have missed or some sort of work around that I need to do? I've searched around for a while and haven't found an answer. Has anyone got code coverage working for MVC web applications?

    Read the article

  • Parsing "true" and "false" using Boost.Spirit.Lex and Boost.Spirit.Qi

    - by Andrew Ross
    As the first stage of a larger grammar using Boost.Spirit I'm trying to parse "true" and "false" to produce the corresponding bool values, true and false. I'm using Spirit.Lex to tokenize the input and have a working implementation for integer and floating point literals (including those expressed in a relaxed scientific notation), exposing int and float attributes. Token definitions #include <boost/spirit/include/lex_lexertl.hpp> namespace lex = boost::spirit::lex; typedef boost::mpl::vector<int, float, bool> token_value_type; template <typename Lexer> struct basic_literal_tokens : lex::lexer<Lexer> { basic_literal_tokens() { this->self.add_pattern("INT", "[-+]?[0-9]+"); int_literal = "{INT}"; // To be lexed as a float a numeric literal must have a decimal point // or include an exponent, otherwise it will be considered an integer. float_literal = "{INT}(((\\.[0-9]+)([eE]{INT})?)|([eE]{INT}))"; literal_true = "true"; literal_false = "false"; this->self = literal_true | literal_false | float_literal | int_literal; } lex::token_def<int> int_literal; lex::token_def<float> float_literal; lex::token_def<bool> literal_true, literal_false; }; Testing parsing of float literals My real implementation uses Boost.Test, but this is a self-contained example. #include <string> #include <iostream> #include <cmath> #include <cstdlib> #include <limits> bool parse_and_check_float(std::string const & input, float expected) { typedef std::string::const_iterator base_iterator_type; typedef lex::lexertl::token<base_iterator_type, token_value_type > token_type; typedef lex::lexertl::lexer<token_type> lexer_type; basic_literal_tokens<lexer_type> basic_literal_lexer; base_iterator_type input_iter(input.begin()); float actual; bool result = lex::tokenize_and_parse(input_iter, input.end(), basic_literal_lexer, basic_literal_lexer.float_literal, actual); return result && std::abs(expected - actual) < std::numeric_limits<float>::epsilon(); } int main(int argc, char *argv[]) { if (parse_and_check_float("+31.4e-1", 3.14)) { return EXIT_SUCCESS; } else { return EXIT_FAILURE; } } Parsing "true" and "false" My problem is when trying to parse "true" and "false". This is the test code I'm using (after removing the Boost.Test parts): bool parse_and_check_bool(std::string const & input, bool expected) { typedef std::string::const_iterator base_iterator_type; typedef lex::lexertl::token<base_iterator_type, token_value_type > token_type; typedef lex::lexertl::lexer<token_type> lexer_type; basic_literal_tokens<lexer_type> basic_literal_lexer; base_iterator_type input_iter(input.begin()); bool actual; lex::token_def<bool> parser = expected ? basic_literal_lexer.literal_true : basic_literal_lexer.literal_false; bool result = lex::tokenize_and_parse(input_iter, input.end(), basic_literal_lexer, parser, actual); return result && actual == expected; } but compilation fails with: boost/spirit/home/qi/detail/assign_to.hpp: In function ‘void boost::spirit::traits::assign_to(const Iterator&, const Iterator&, Attribute&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Attribute = bool]’: boost/spirit/home/lex/lexer/lexertl/token.hpp:434: instantiated from ‘static void boost::spirit::traits::assign_to_attribute_from_value<Attribute, boost::spirit::lex::lexertl::token<Iterator, AttributeTypes, HasState>, void>::call(const boost::spirit::lex::lexertl::token<Iterator, AttributeTypes, HasState>&, Attribute&) [with Attribute = bool, Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, AttributeTypes = boost::mpl::vector<int, float, bool, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, HasState = mpl_::bool_<true>]’ ... backtrace of instantiation points .... boost/spirit/home/qi/detail/assign_to.hpp:79: error: no matching function for call to ‘boost::spirit::traits::assign_to_attribute_from_iterators<bool, __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, void>::call(const __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, const __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, bool&)’ boost/spirit/home/qi/detail/construct.hpp:64: note: candidates are: static void boost::spirit::traits::assign_to_attribute_from_iterators<bool, Iterator, void>::call(const Iterator&, const Iterator&, char&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >] My interpretation of this is that Spirit.Qi doesn't know how to convert a string to a bool - surely that's not the case? Has anyone else done this before? If so, how?

    Read the article

  • Decrease DB requests number from Django templates

    - by Andrew
    I publish discount offers for my city. Offer models are passed to template ( ~15 offers per page). Every offer has lot of items(every item has FK to it's offer), thus i have to make huge number of DB request from template. {% for item in offer.1 %} {{item.descr}} {{item.start_date}} {{item.price|floatformat}} {%if not item.tax_included %}{%trans "Without taxes"%}{%endif%} <a href="{{item.offer.wwwlink}}" >{%trans "Buy now!"%}</a> </div> <div class="clear"></div> {% endfor %} So there are ~200-400 DB requests per page, that's abnormal i expect. In django code it is possible to use select_related to prepopulate needed values, how can i decrease number of requests in template?

    Read the article

  • Any good SASS parser for PHP?

    - by Andrew Moore
    I'm currently using a modified CSS Cacheer as an alternative but its syntax is somewhat vague and adoption is, well, abysmally low... Documentation is hard to come by as well. I'm looking to switch to SASS as it has a bigger user base than CSS Cacheer and better documentation. I am aware of phpHaml but it doesn't have support for SASS yet. Any recommendation on a SASS parser for PHP? Preferably it should support SassScript.

    Read the article

  • C# remove redundant paths from a list

    - by andrew
    Say I have this list List<string> sampleList = new List<string> { "C:\\Folder1", "D:\\Folder2", "C:\\Folder1\\Folder3", "C:\\Folder111\\Folder4" }; I'd like to remove the paths that are contained in other folders, for example we have C:\Folder1 and C:\Folder1\Folder3 the second entry should go away because C:\Folder1 contains C:\Folder1\Folder3 is there something that does that in the .net framework or do i have to write the algo myself?

    Read the article

  • Nhibernate get collection by ICriteria

    - by Andrew Kalashnikov
    Hello, colleagues. I've got a problem at getting my entity. MApping: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Clients.Core" namespace="Clients.Core.Domains"> <class name="Sales, Clients.Core" table='sales'> <id name="Id" unsaved-value="0"> <column name="id" not-null="true"/> <generator class="native"/> </id> <property name="Guid"> <column name="guid"/> </property> <set name="Accounts" table="sales_users" lazy="false"> <key column="sales_id" /> <element column="user_id" type="Int32" /> </set> </class> Domain: public class Sales : BaseDomain { ICollection<int> accounts = new List<int>(); public virtual ICollection<int> Accounts { get { return accounts; } set { accounts = value; } } public Sales() { } } I want get query such as SELECT * FROM sales s INNER JOIN sales_users su on su.sales_id=s.id WHERE su.user_id=:N How can i do this through ICriterion object? Thanks a lot.

    Read the article

  • Is SQLDataReader slower than using the command line utility sqlcmd?

    - by Andrew
    I was recently advocating to a colleague that we replace some C# code that uses the sqlcmd command line utility with a SqlDataReader. The old code uses: System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + sqlCmd); wher sqlCmd is something like "sqlcmd -S " + serverName + " -y 0 -h-1 -Q " + "\"" + "USE [" + database + "]" + ";+ txtQuery.Text +"\"";\ The results are then parsed using regular expressions. I argued that using a SQLDataReader woud be more in line with industry practices, easier to debug and maintain and probably faster. However, the SQLDataReader approach is at least the same speed and quite possibly slower. I believe I'm doing everything correctly with SQLDataReader. The code is: using (SqlConnection connection = new SqlConnection()) { try { SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectionString); connection.ConnectionString = builder.ToString(); ; SqlCommand command = new SqlCommand(queryString, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); // do stuff w/ reader reader.Close(); } catch (Exception ex) { outputMessage += (ex.Message); } } I've used System.Diagnostics.Stopwatch to time both approaches and the command line utility (called from C# code) does seem faster (20-40%?). The SqlDataReader has the neat feature that when the same code is called again, it's lightening fast, but for this application we don't anticipate that. I have already done some research on this problem. I note that the command line utility sqlcmd uses OLE DB technology to hit the database. Is that faster than ADO.NET? I'm really suprised, especially since the command line utility approach involves starting up a process. I really thought it would be slower. Any thoughts? Thanks, Dave

    Read the article

  • iPhone HTTP Server

    - by Andrew
    Can someone give me simple code to help with creating an HTTP server for the iPhone. Something simple with much documentation would be appreciated. Anything you have please share.

    Read the article

  • MySQL & PHP - select/option lists and showing data to users that still allows me to generate queries

    - by Andrew Heath
    Sorry for the unclear title, an example will clear things up: TABLE: Scenario_victories ID scenid timestamp userid side playdate 1 RtBr001 2010-03-15 17:13:36 7 1 2010-03-10 2 RtBr001 2010-03-15 17:13:36 7 1 2010-03-10 3 RtBr001 2010-03-15 17:13:51 7 2 2010-03-10 ID and timestamp are auto-insertions by the database when the other 4 fields are added. The first thing to note is that a user can record multiple playings of the same scenario (scenid) on the same date (playdate) possibly with the same outcome (side = winner). Hence the need for the unique ID and timestamps for good measure. Now, on their user page, I'm displaying their recorded play history in a <select><option>... list form with 2 buttons at the end - Delete Record and Go to Scenario My script takes the scenid and after hitting a few other tables returns with something more user-friendly like: (playdate) (from scenid) (from side) ######################################################### # 2010-03-10 Road to Berlin #1 -- Germany, Hungary won # # 2010-03-10 Road to Berlin #1 -- Germany, Hungary won # # 2010-03-10 Road to Berlin #1 -- Soviet Union won # ######################################################### [Delete Record] [Go To Scenario] in HTML: <select name="history" size=3> <option>2010-03-10 Road to Berlin #1 -- Germany, Hungary won</option> <option>2010-03-10 Road to Berlin #1 -- Germany, Hungary won</option> <option>2010-03-10 Road to Berlin #1 -- Soviet Union won</option> </select> Now, if you were to highlight the first record and click Go to Scenario there is enough information there for me to parse it and produce the exact scenario you want to see. However, if you were to select Delete Record there is not - I have the playdate and I can parse the scenid and side from what's listed, but in this example all three records would have the same result. I appear to have painted myself into a corner. Does anyone have a suggestion as to how I can get some unique identifying data (ID and/or timestamp) to ride along on this form without showing it to the user? PHP-only please, I must be NoScript compliant!

    Read the article

  • Help me convert this PHP SOAP code to C#

    - by Andrew G. Johnson
    Hi, I am trying to do some C# SOAP calls and can't seem to get any good examples on how to do it. I read an old question of mine about a SOAP call in PHP and thought maybe asking you guys to rewrite it in C# would be a good place to start. Here is the PHP code: $client = new SoapClient('http://www.hotelscombined.com/api/LiveRates.asmx?WSDL'); $client->__soapCall('HotelSearch', array( array('request' => array( 'ApiKey' => 'THE_API_KEY_GOES_HERE', // note that in the actual code I put the API key in... 'UserID' => session_id(), 'UserAgent' => $_SERVER['HTTP_USER_AGENT'], 'UserIPAddress' => $_SERVER['REMOTE_ADDR'], 'HotelID' => '50563', 'Checkin' => '07/02/2009', 'Checkout' => '07/03/2009', 'Guests' => '2', 'Rooms' => '1', 'LanguageCode' => 'en', 'DisplayCurrency' => 'usd', 'TimeOutInSeconds' => '90' ) ) ) );

    Read the article

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