Search Results

Search found 1642 results on 66 pages for 'dan morgan'.

Page 41/66 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Comparison operators not supported for type IList when Paging data in Linq to Sql

    - by Dan
    I can understand what the error is saying - it can't compare a list. Not a problem, other than the fact that I don't know how to not have it compare a list when I want to page through a model with a list as a property. My Model: Event : IEvent int Id string Title // Other stuff.. LazyList<EventDate> Dates // The "problem" property Method which pages the data (truncated): public JsonResult JsonEventList(int skip, int take) { var query = _eventService.GetEvents(); // Do some filtering, then page data.. query = query.Skip(skip).Take(take); return Json(query.ToArray()); } As I said, the above is truncated quite a bit, leaving only the main point of the function: filter, page and return JSON'd data. The exception occurs when I enumerate (.ToArray()). The Event object is really only used to list the common objects of all the event types (Meetings, Birthdays, etc - for example). It still implements IEvent like the other types, so I can't just remove the LazyList<EventDate> Dates' property unless I no longer implementIEvent` Anyway, is there a way to avoid this? I don't really want to compare a LazyList when I page, but I do not know how to resolve this issue. Thank you in advance! :)

    Read the article

  • JVM Bug with JDWP

    - by Dan
    I found this bug report from Sun indicating a problem with certain Java versions and enabling a JDWP port. But that bug report doesn't indicate when or even if it was fixed. Does anyone have more up-to-date info on that? thanks

    Read the article

  • How do I run a vim script that alters the current buffer?

    - by Dan
    I'm trying to write a beautify.vim script that makes C-like code adhere to a standard that I can easily read. My file contains only substitution commands that all begin with %s/... However, when I try to run the script with my file open, in the manner :source beautify.vim, or :runtime beautify.vim, it runs but all the substitute commands state that their pattern wasn't found (patterns were tested by entering them manually and should work). Is there some way to make vim run the commands in the context of the current buffer? beautify.vim: " add spaces before open braces sil! :%s/\%>1c>\s\@<!{/ {/g " beautify for sil! :%s/for *( *\([^;]*\) *; *\([^;]*\) *; *\([^;]*\) *)/for (\1; \2; \3)/ " add spaces after commas sil! :%s/,\s\@!/, /g In my tests the first :s command should match (it matches when applied manually).

    Read the article

  • Mix of Arabic and English causes problems in JTextArea (Java)

    - by Dan
    I have a JTextArea which displays HTML of an Arabic web page. So it's essentially a mix of English and Arabic. In the JTextArea, with columns set to 30, certain text just disappears instead of wrapping properly. The weird thing is that if I copy the invisible text and paste it into Notepad, then I can see it in Notepad. If I change the number of columns to 40, everything displays fine. Any ideas?

    Read the article

  • Can Qt's QWebView display programatically generated XML?

    - by Dan Ellis
    Using Qt 4.6, I can dynamically add to an HTML page like this: ui->webView->page()->mainFrame()->documentElement().findFirst("body").appendInside("<i>some text</i>\n"); However, if I QWebView::load() an XML file, it displays it with the correct CSS styling (from an processing instruction), but doesn't show any changes when I do something like: ui->webView->page()->mainFrame()->documentElement().findFirst("lines").appendInside("<line>hello</line>\n"); Why is it treating them differently, and is there a way to modify an XML document in the same way I can an HTML one?

    Read the article

  • Finding the SQL output of a parameterized query

    - by Dan Monego
    I'm making a parameterized query using C# against a SQL server 2005 instance, and I'd like to take a look at the SQL that is run against the database for debugging purposes. Is there somewhere I can look to see what the output SQL of the parameterized command is, either in the database logs or in the Visual Studio debugger?

    Read the article

  • Why aren't double quotes and backslashes allowed in strings in the JSON standard?

    - by Dan Herbert
    If I run this in a JavaScript console in Chrome or Firebug, it works fine. JSON.parse('"\u0027"') // Escaped single-quote But if I run either of these 2 lines in a Javascript console, it throws an error. JSON.parse('"\u0022"') // Escaped double-quote JSON.parse('"\u005C"') // Escaped backslash RFC 4627 section 2.5 seems to imply that \ and " are allowed characters as long as they're properly escaped. The 2 browsers I've tried this in don't seem to allow it, however. Is there something I'm doing wrong here or are they really not allowed in strings? I've also tried using \" and \\ in place of \u0022 and \u005C respectively. I feel like I'm just doing something very wrong, because I find it hard to believe that JSON would not allow these characters in strings, especially since the specification doesn't seem to mention anything that I could find saying they're not allowed.

    Read the article

  • java - POST vs JDBC

    - by Dan
    OK so here's the code: import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; public class Main { public static void main(String[] args) { try { URL my_url = new URL("http://www.viralpatel.net/blogs/"); BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream())); String strTemp = ""; while(null != (strTemp = br.readLine())){ System.out.println(strTemp); } } catch (Exception ex) { ex.printStackTrace(); } } } Using this method I can use POST and GET methods using PHP scripts. I can then use the PHP scripts to the MySQL database which in turn outputs back to the java applet. Is this possible? (and safer?) Thanks.

    Read the article

  • Python: How to make a cross-module variable?

    - by Dan Homerick
    The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it? The variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one module, it is updated in others. I'd be fine if I could set foo before importing other modules and then they would see the same value for it.

    Read the article

  • ADO "Unspecified Error" instead of actual error when fetching server side cursor

    - by Dan
    This relates to my recent question: http://stackoverflow.com/questions/2835663/force-oracle-error-on-fetch I am now able to reproduce a scenario where using ADO with the Oracle OLEDB Provider, I can force an error such as ORA-01722: invalid number to occur on calling Recordset.MoveNext However, this is not the error that is returned to the application. Instead, the application sees Provider error '80004005' Unspecified error. How can I get the application to see the real error from the database? This is with Oracle 10g (client and server), if it matters. Sample code is roughly as follows: Dim con As New ADODB.Connection Dim cmd As New ADODB.Command Dim rs As ADODB.Recordset con.ConnectionString = "Provider=OraOLEDB.ORACLE;Data Source=xxx;User Id=yyy;Password=zzz" con.CursorLocation = adUseServer con.Open Set cmd.ActiveConnection = con cmd.CommandText = "select * from table(ret_err)" cmd.Prepared = True Set rs = cmd.Execute While Not rs.EOF rs.MoveNext Wend

    Read the article

  • How to find multiples of the same integer in an arraylist?

    - by Dan
    Hi My problem is as follows. I have an arraylist of integers. The arraylist contains 5 ints e.g[5,5,3,3,9] or perhaps [2,2,2,2,7]. Many of the arraylists have duplicate values and i'm unsure how to count how many of each of the values exist. The problem is how to find the duplicate values in the arraylist and count how many of that particular duplicate there are. In the first example [5,5,3,3,9] there are 2 5's and 2 3's. The second example of [2,2,2,2,7] would be only 4 2's. The resulting information i wish to find is if there are any duplicates how many of them there are and what specific integer has been duplicated. I'm not too sure how to do this in java. Any help would be much appreciated. Thanks.

    Read the article

  • backbone js or knockout js as a web framework with jquery mobile

    - by Dan
    without trying to cause a mass discussion I would like some advice from the fellow users of stack overflow. I am about to start building a mobile website that gets it data from JSON that comes from a PHP rest api. I have looked into different mobile frameworks and feel that JQM will work best for us as we have the knowledge of jQuery even though a little large. Currently at work however we are using jQuery for all our sites and realise that now we are building a mobile website I need to think about javascript frameworks to move us onto a more MV* approach, which I understand the benefits of and will bring much needed structure to this mobile site and future web applications we may bring. I have made a comparision table where I have managed to bring the selection down to 2 - backbone and knockout. I have been looking around the web and it seems that there is more support for backbone in general and maybe even more support for backbone with JQM. http://jquerymobile.com/test/docs/pages/backbone-require.html One thing I have noticed however is that backbone doesnt support view bindings (declarative approach) whereas knockout does - is this a massive bonus? one of the main reasons for using a mv* for us is to get more structure - so I would like to use the library that will intergrate best with jQuery and especially jQuery mobile. neither of them seem to have that similar syntax... Thanks

    Read the article

  • Capture String from Array, C#

    - by Dan Snyder
    I'm trying to figure out how to get a string from an array starting at some given position. Say we have an array that's arbitrarily long and my string starts at location 1000. If I wanted to get a string from a file I would simply use something like getc or scanf or something. How do I carry out these same functions on an array instead of a file? *oh, keep in mind that the array is of type int and is full of numerical representations of ASCII characters.

    Read the article

  • Why doesn't IB see my IBAction?

    - by Dan Ray
    I've been staring at this for way too long. There's nothing fancy happening here, and I've done this dozens of times, yet Interface Builder steadfastly refuses to provide me an action target for -(IBAction)slideDirections. I'm at the point where I'm willing to post publicly and feel stupid. So let 'er rip. Here's my .h: #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface PulseDetailController : UIViewController { NSDictionary *pulse; IBOutlet MKMapView *map; IBOutlet UIWebView *directions; IBOutlet UIView *directionsSlider; BOOL directionsExtended; IBOutlet UILabel *vendor; IBOutlet UILabel *offer; IBOutlet UILabel *offerText; IBOutlet UILabel *hours; IBOutlet UILabel *minutes; IBOutlet UILabel *seconds; IBOutlet UILabel *distance } @property (nonatomic, retain) NSDictionary *pulse; @property (nonatomic, retain) MKMapView *map; @property (nonatomic, retain) UIWebView *directions; @property (nonatomic, retain) UIView *directionsSlider; @property (nonatomic) BOOL directionsExtended; @property (nonatomic, retain) UILabel *vendor; @property (nonatomic, retain) UILabel *offer; @property (nonatomic, retain) UILabel *offerText; @property (nonatomic, retain) UILabel *hours; @property (nonatomic, retain) UILabel *minutes; @property (nonatomic, retain) UILabel *seconds; @property (nonatomic, retain) UILabel *distance; -(IBAction)slideDirections; @end

    Read the article

  • How to configure log4j with a properties file

    - by Dan
    How do I get log4j to pick up a properties file. I'm writing a Java desktop app which I want to use log4j. In my main method if have this: PropertyConfigurator.configure("log4j.properties"); The log4j.properties file sits in the same directory when I open the Jar. Yet I get this error: log4j:ERROR Could not read configuration file [log4j.properties]. java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified) What am I doing wrong?

    Read the article

  • Accessing ArrayBuffer from PHP $_POST after xmlHTTPrequest send()

    - by Dan
    I'm following the tuitions on XMLHttpRequest 2 from : https://developer.mozilla.org/en/DOM/XMLHttpRequest/Sending_and_Receiving_Binary_Data and http://www.html5rocks.com/en/tutorials/file/xhr2/#toc-send-arraybuffer They're great tutorials for the client side, and here is a working extract from my script: var imagebuffer = new ArrayBuffer(size); // create the readonly memory buffer var imagedata= new Uint8Array(imagebuffer); // create a view to manipulate data // do some cool stuff with imagedata var exchange=new XMLHttpRequest(); exchange.open("POST",url,true); exchange.send(arraybuffer); So far so good, and I can see from the both client and server control panels that plenty of data is being transferred. Here's my problem: how do I access the ArrayBuffer with PHP at the server? I'm used to the $_POST superglobal wanting parameters passing from a HTML form so it can be accessed as an array but I can't find any reference for how to access this binary array and stick it in my MySQL database.

    Read the article

  • How, exactly does HTML5's GeoLocation work?

    - by Dan
    I know the browser shares my IP address and details of nearby wireless networks to determine my location, but what sort of info does it know about nearby wifi networks? For example, where I live are no public wireless networks, and from my home I can see about 5 private networks, yet my location is determined within 20 meters. With there being no open networks nearby, how does Google determine my location? The only way I can think of is that Google mapped the locations of all wireless networks when they mapped streets for Street View. I've searched about online, but all I can't find any specific details.

    Read the article

  • Jquery post array via ajax

    - by Dan
    I have an array (for checkboxes) that I need to pass alongside the regular form in an ajax post, but can't seem to get this to work: new_data = [a,b,c,d,e]; somedata_assoc = JQuery.param({'choices[]': new_data}); $.ajax({ type: "POST", url: contract_qurl, data: $(div).find("form").serialize()+"&"+somedata_assoc, context: $(this), success: function(data) { $("#results_table").html(data); } });

    Read the article

  • Can this MySQL subquery be optimised?

    - by Dan
    I have two tables, news and news_views. Every time an article is viewed, the news id, IP address and date is recorded in news_views. I'm using a query with a subquery to fetch the most viewed titles from news, by getting the total count of views in the last 24 hours for each one. It works fine except that it takes between 5-10 seconds to run, presumably because there's hundreds of thousands of rows in news_views and it has to go through the entire table before it can finish. The query is as follows, is there any way at all it can be improved? SELECT n.title , nv.views FROM news n LEFT JOIN ( SELECT news_id , count( DISTINCT ip ) AS views FROM news_views WHERE datetime >= SUBDATE(now(), INTERVAL 24 HOUR) GROUP BY news_id ) AS nv ON nv.news_id = n.id ORDER BY views DESC LIMIT 15

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >