Search Results

Search found 1889 results on 76 pages for 'paul haldane'.

Page 55/76 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • Scala's tuple unwrapping nuance

    - by Paul Milovanov
    I've noticed the following behavior in scala when trying to unwrap tuples into vals: scala> val (A, B, C) = (1, 2, 3) <console>:5: error: not found: value A val (A, B, C) = (1, 2, 3) ^ <console>:5: error: not found: value B val (A, B, C) = (1, 2, 3) ^ <console>:5: error: not found: value C val (A, B, C) = (1, 2, 3) ^ scala> val (u, v, w) = (1, 2, 3) u: Int = 1 v: Int = 2 w: Int = 3 Is that because scala's pattern matching mechanism automatically presumes that all identifiers starting with capitals within patterns are constants, or is that due to some other reason? Thanks!

    Read the article

  • Percentage difference between different values in the same keys of two different arrays.

    - by Paul
    Hey. I'm looking for a solution to this problem. I got 2 arrays, like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "19088" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "15566" } } array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "12043" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "11953" } } Now I'd like to create a new array, with the % difference between the values per key. Would be something like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "88,23" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "74,54" } } Can anyone help me how to create that array?

    Read the article

  • Open dot-file with dialogue in OSX

    - by Henrik Paul
    Since the GUI-side of OSX treats all dot-files (such as .htaccess) as hidden, it doesn't display them in any of the graphical UI:s, e.g. Finder or the Open-dialogues. How can I open a dot-file (.htaccess in this case) in a graphical editor, without doing that thing for all hidden files, universally and without going through Terminal.app? Edit: I'm on Leopard, if that makes a difference. Edit2: TextWrangler and TextMate seem to have features that allow you to open hidden files, which partly answers my question.

    Read the article

  • How do I refer to a client_deploy.wsdd file that's in WEB-INF?

    - by Paul
    A basic question, but I can't seem to find the answer. I have an Axis-generated web service that also calls another web service (for which the stubs are also generated with Axis). It's deployed in weblogic 9.2 That called web service requires authentication. I've googled for the code to set up authentication. It requires that I set up a client_deploy.wsdd file which I've done, and added it to WEB-INF. I need to specify this flle to Axis. There seem to be several ways of doing this, including System.setProperty("axis.ClientConfigFile", "client_deploy.wsdd") or EngineConfiguration config = new FileProvider("client_deploy.wsdd"); but these aren't working for me. Is the issue the path for the client_deploy.wsdd file? How do I refer to a file that's at the top level of the WEB-INF directory? Googling tells me how to access it as a stream, but I don't want that, I need to pass a file name to these functions... Please point out the obvious that I have missed

    Read the article

  • JQuery datepicker numberOfMonths: display current selection month last

    - by Paul
    Hi, I have a jquery datepicker with the numberOfMonths set to 3, currently when I click on the datepicker, the left side month is the current month. In most cases, the user is only going to be selecting a date prior to todays date so I would prefer the current month selected to be the last calendar i.e. March, April, May instead of the current implementation which is May, June, July. Greatly appreciate any help!

    Read the article

  • Ignoring "Content is not allowed in trailing section" SAXException

    - by Paul J. Lucas
    I'm using Java's DocumentBuilder.parse(InputStream) to parse an XML document. Occasionally, I get malformed XML documents in that there is extra junk after the final > that causes a SAXException: Content is not allowed in trailing section. (In the cases I've seen, the junk is simply one or more null bytes.) I don't care what's after the final >. Is there an easy way to parse an entire XML document in Java and have it ignore any trailing junk? Note that by "ignore" I don't simply mean to catch and ignore the exception: I mean to ignore the trailing junk, throw no exception, and to return the Document object since the XML up to an including the final > is valid.

    Read the article

  • addEventListener using apply()

    - by Paul
    I'm trying to invoke addEventListener() using apply() method. The code is like: function rewrite(old){ return function(){ console.log( 'add something to ' + old.name ); old.apply(this, arguments); } } addEventListener=rewrite(addEventListener); It doesn't work. The code works for normal JavaScript method, for example, function hello_1(){ console.log("hello world 1!"); } hello_1=rewrite(hello_1); Need help! Thanks!

    Read the article

  • ASP.Net MVC and Windows 7 404 error

    - by Paul Rivers
    O.K. Stupid question..... I sepnt nearly a day getting an MVC site working, and then I published it. After that, the hell began. I'm using Windows 7, Visual Studio 2008 and MVC. I published it and first the Default.aspx wouldn't come up. I gave up on playing with that for a few and just did the easy thing a typed in default.aspx. I'll fix that problem later. So, I clicked on one of my navigation buttons which prior to this worked just fine in the internal development IIS, and I get a 404 error. I spent two days surfing the Microsoft support forums and every other support forum I can find. No fix. So, I tried something a little different. Just to see if I screwed up. I created a new TestMVC application. Set the output to a website on the local IIS. Compiled and after typing in the default.aspx (it was set as the startup file in the project) I then clicked on the About button on the base MVC application. And what do I get? 404. I know this is new, folks, but this is crazy. What is it about this process that would take this much effort to get it right, especially since it works on the test server.

    Read the article

  • Why is '\x' invalid in Python?

    - by Paul McGuire
    I was experimenting with '\' characters, using '\a\b\c...' just to enumerate for myself which characters Python interprets as control characters, and to what. Here's what I found: \a - BELL \b - BACKSPACE \f - FORMFEED \n - LINEFEED \r - RETURN \t - TAB \v - VERTICAL TAB Most of the other characters I tried, '\g', '\s', etc. just evaluate to the 2-character string of a backslash and the given character. I understand this is intentional, and makes sense to me. But '\x' is a problem. When my script reaches this source line: val = "\x" I get: ValueError: invalid \x escape What is so special about '\x'? Why is it treated differently from the other non-escaped characters?

    Read the article

  • Query performs poorly unless a temp table is used

    - by Paul McLoughlin
    The following query takes about 1 minute to run, and has the following IO statistics: SELECT T.RGN, T.CD, T.FUND_CD, T.TRDT, SUM(T2.UNITS) AS TotalUnits FROM dbo.TRANS AS T JOIN dbo.TRANS AS T2 ON T2.RGN=T.RGN AND T2.CD=T.CD AND T2.FUND_CD=T.FUND_CD AND T2.TRDT<=T.TRDT JOIN TASK_REQUESTS AS T3 ON T3.CD=T.CD AND T3.RGN=T.RGN AND T3.TASK = 'UPDATE_MEM_BAL' GROUP BY T.RGN, T.CD, T.FUND_CD, T.TRDT (4447 row(s) affected) Table 'TRANSACTIONS'. Scan count 5977, logical reads 7527408, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'TASK_REQUESTS'. Scan count 1, logical reads 11, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. SQL Server Execution Times: CPU time = 58157 ms, elapsed time = 61437 ms. If I instead introduce a temporary table then the query returns quickly and performs less logical reads: CREATE TABLE #MyTable(RGN VARCHAR(20) NOT NULL, CD VARCHAR(20) NOT NULL, PRIMARY KEY([RGN],[CD])); INSERT INTO #MyTable(RGN, CD) SELECT RGN, CD FROM TASK_REQUESTS WHERE TASK='UPDATE_MEM_BAL'; SELECT T.RGN, T.CD, T.FUND_CD, T.TRDT, SUM(T2.UNITS) AS TotalUnits FROM dbo.TRANS AS T JOIN dbo.TRANS AS T2 ON T2.RGN=T.RGN AND T2.CD=T.CD AND T2.FUND_CD=T.FUND_CD AND T2.TRDT<=T.TRDT JOIN #MyTable AS T3 ON T3.CD=T.CD AND T3.RGN=T.RGN GROUP BY T.RGN, T.CD, T.FUND_CD, T.TRDT (4447 row(s) affected) Table 'Worktable'. Scan count 5974, logical reads 382339, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'TRANSACTIONS'. Scan count 4, logical reads 4547, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table '#MyTable________________________________________________________________000000000013'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. SQL Server Execution Times: CPU time = 1420 ms, elapsed time = 1515 ms. The interesting thing for me is that the TASK_REQUEST table is a small table (3 rows at present) and statistics are up to date on the table. Any idea why such different execution plans and execution times would be occuring? And ideally how to change things so that I don't need to use the temp table to get decent performance? The only real difference in the execution plans is that the temp table version introduces an index spool (eager spool) operation.

    Read the article

  • Vector of objects

    - by Paul
    I've got a abstract class class A { public: virtual void somefunction() = ; }; and some different classes that inherit this class: class Ab { public: void somefunction(); }; etc. I want to make a vector containing some objects of these classes (how many depends on input parameters) so I can access these easily later. However I'm a bit lost on how to do this. My best idea is vector<A> *objectsVector; Ab AbObject; objectsVector.push_back(AbObject); However this gives me a huge amout of errors from various .h files in /usr/include/c++ How should i solve this?

    Read the article

  • How to parse the file name and rename in Matlab

    - by Paul
    I am reading a .xls file and then procesing it inside and rewriting it in the end of my program. I was wondering if someone can help me to parse the dates as my input file name is like file_1_2010_03_03.csv and i want my outputfile to be newfile_2010_03_03.xls is there a way to incorporate in matlab program so i do not have to manually write the command xlswrite('newfile_2010_03_03.xls', M); everytime and change the dates as i input files with diff dates like file_2_2010_03_04.csv. Thanks

    Read the article

  • Adding LambaExpression to an instance of IQueryable

    - by Paul Knopf
    ParameterExpression parameter = Expression.Parameter(typeof(Product), "x"); MemberExpression Left = Expression.MakeMemberAccess(parameter, typeof(Product).GetProperty("Name")); ConstantExpression Right = Expression.Constant(value, typeof(String)); BinaryExpression expression = Expression.Equal(Left, Right); LambdaExpression lambada = Expression.Lambda<Func<Product, bool>>(expression, parameter); Now how do I add this lambada to an instance of an IQuerybale, lets say _query _query.Where(lambada.Compile());?

    Read the article

  • CakePHP - recursive on specific fields in model?

    - by Paul
    Hi, I'm pretty new to CakePHP but I think I'm starting to get the hang of it. I'm trying to pull related table information recursively, but I want to specify which related models to recurse on. Let me give you an example to demonstrate my goal: I have a model "Customer", which has info like Company name, website, etc. "Customer" hasMany "Addresses", which contain info for individual contacts like Contact Name, Street, City, State, Country, etc. "Customer" also belongsTo "CustomerType", which is just has descriptive category info - a name and description, like "Distributor" or "Manufacturer". When I do a find on "Customer" I want to get associated "CustomerType" and "Address" info as sub-arrays, and this works fine just by setting up the hasMany and belongsTo associations properly. But now, here's my issue: I want to get associated State/Country info. So, instead of each "Address" array row just having "state_id", I want it to have "state" = array("id" = 20, "name" = "New York",...) etc. If I set $recursive to a higher value (e.g., 2) in the Partner model, I get what I want for the State/Country info in each "Address". BUT it also recurses on "CustomerType", and that results in the "CustomerType" field of my "Partner" object having a huge array of all Customer objects that match that type, which could be thousands long. So the point is, I DON'T want to recurse on "CustomerType", only on "Address". Is there a way I can set this up? Sorry for the long-winded question, and thanks in advance!

    Read the article

  • Tracking SVN changes through multiple merges

    - by Paul D.
    At work we use a branching strategy where all changes start off in a development branch, then subsequently make their way through one or more integration branches, and finally end up in a release branch. Occasionally (more often than I'd like) I find myself needing to figure out where a particular change originated (which development branch). In this case I have to spend a considerable amount of time playing detective to trace a change backwards through 2-3 merges. Am I missing an easy way to do this?

    Read the article

  • Convert Java.Util.HashMap to System.Collections.IDictionary

    - by Paul
    In Xamarin I've got a .jar I've imported using a Java Binding Library. One of the callbacks has a Java.Lang.Object parameter which gives me Java.Util.HashMap and Java.Util.ArrayList at runtime. I'm abstracting this SDK behind a cross-platform interface, so I need to convert this to a .NET type. It there anything like the ArrayAdapter except in reverse that can convert the Java types to their .NET equivalents?

    Read the article

  • How do I create and read non-global variables that aren't destroyed at end of function?

    - by Paul Reilly
    I am attempting to code some plugins to use with MIDI sequencers but have hit a stumbling block. I can't use global-scope variables to store information because multiple instances of the .dll can exist which share memory. How do I create a class (for re-usability purposes in other plugins) containing 2 dimensional array and other variables the content of which is to be shared between functions? If that is possible, how would I read and write the data from the function in the framework where I do the processing?

    Read the article

  • Console Application Structure

    - by Paul Fox
    I've written several .Net Console Applications over the past 6 months and we have many more throughout different projects in our organization. I generally stick to the same standard format/structure for my Console Applications. Unfortunately, many of our console applications do not. I have been looking into ways of standardizing the structure of these Console Applications. I would also like to provide a framework for the basic structure of a Console Application and provide easy access to standard ways of handling things such as argument passing, logging, etc. Can anyone suggest Best Practices for addressing these concerns? I have been reading this MSDN article on Console Applications in .Net which suggests a Design Pattern for Console Apps. The example uses a Template Method pattern to handle some of the concerns I listed earlier. Two negatives of using this approach are listed in the article. Ending up with twice as many classes Having many simple, similar classes Can anyone suggest better, or more standard, ways of handling this? What about listing additional negatives with this approach?

    Read the article

  • Refactoring thick client legacy application

    - by Paul
    I am working on a fat client legacy C++ application which has a lot of business logic mixed in with the presentation side of things. I want to clean things out and refactor the code out completely, so there is a clear seperation of concerns. I am looking at MVC or some other suitable design pattern in order to achieve this. I would like to get recommendations from people who have walked this road before - Do I use MVP or MVC (or another pattern)? What is/are the best practices for undertaking something like this (i.e. useful steps/checks) ?

    Read the article

  • Embed javascript in markdown

    - by Paul Tarjan
    I'm using the Maruku markdown processor. I'd like this *blah* blah "blah" in [markdown](blah) <script src="code.jquery.com/jquery-1.4.2.min.js"></script> <script> ...do stuff... </script> but it complains when I render it with a multitude of errors. The first one being ___________________________________________________________________________ | Maruku tells you: +--------------------------------------------------------------------------- | Could you please format this better? | I see that "<script type='text/javascript'>" is left after the raw HTML. | At line 31 | raw_html |<script src='http://code.jquery.com/jquery-1.4.2.min.js' /><script type='text/javascript'>| | text --> |//<![CDATA[| and then the rest seems like the parser is going nuts. Then it renders the javascript into a div on the page. I've tried making it a CDATA block and extra spacing between the jquery and my script. Help?

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >