Search Results

Search found 3496 results on 140 pages for 'chris boden'.

Page 83/140 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • Lazy Loading wpf Combobox items

    - by Chris McGrath
    I have an IEnumerable< which lazy loads it's data. I want to just set a Combobox's ItemsSource to the IEnumerable, but when I do it goes and loads all the data anyway (which removes the point of lazy loading). I've tried it with Linq-To-Sql as well since it seems to be a similar theory and it also loads all the data. Is there an easy way to do this?

    Read the article

  • Silverlight solution builds in VS2008 but fails with MSBuild

    - by Chris Nicola
    I have a Silverlight solution that I want to create a build script for. I have a simple script that looks like this call "c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" msbuild %CD%\V1\Incentive.sln /target:Rebuild /property:Configuration=DEBUG;WarningLevel=2 msbuild %CD%\UI\IncentiveUI.sln /target:Rebuild /property:Configuration=DEBUG;WarningLevel=2 pause However when I run this I get a failure, with some complaints about classes that are in a project with linked files: http://pastebin.com/JRE3tWfh This solution compiles fine in VS2008 so I can't figure out what the problem is. I have to guess something is wrong with the way I am using msbuild here.

    Read the article

  • Get remote image using cURL then resample.

    - by Chris
    I want to be able to retrieve a remote image from a webserver, resample it, and then serve it up to the browser AND save it to a file. Here is what I have so far: $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$rURL"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); // grab URL and pass it to the browser $out = curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); $imgRes = imagecreatefromstring($out); imagejpeg($imgRes, $filename, 70); header("Content-Type: image/jpg"); header("Content-length: ".filesize($filename)); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); readfile("$filename"); exit(); Update Updated code to include imjpeg step to save the image as lower quality. But how do I then, efficiently, serve this up to the browser. I currently, later in the code, do this readfile("$filename"); along with some header information but that means I'm reading the file back in again which seems inefficient.

    Read the article

  • StructureMap resolve dependency through injection instead of service location

    - by Chris Marisic
    In my project I register many ISerializers implementations with the assembly scanner. FWIW this is the code that registers my ISerializers Scan(scanner => { scanner.AssemblyContainingType<ISerializer>(); scanner.AddAllTypesOf<ISerializer>().NameBy(type => type.Name); scanner.WithDefaultConventions(); }); Which then correctly registers ISerializer (...ISerializer) Scoped as: Transient JsonSerializer Configured Instance of ...JsonSerializer BsonSerializer Configured Instance of ...BsonSerializer And so forth. Currently the only way I've been able to figure out how to resolve the serializer I want is to hardcode a service location call with jsonSerializer = ObjectFactory.GetNamedInstance<ISerializer>("JsonSerializer"); Now I know in my class that I specifically want the jsonSerializer so is there a way to configure a rule or similar that says for ISerializer's to connect the named instance based on the property name? So that I could have MySomeClass(ISerializer jsonSerializer, ....) And StructureMap correctly resolve this scenario? Or am I approaching this wrong and perhaps I should just register the concrete type that implements ISerializer and then just specifically use MySomeClass(JsonSerializer jsonSerializer, ....) for something along these lines with the concrete class?

    Read the article

  • CryptographicException: Padding is invalid and cannot be removed and Validation of viewstate MAC fai

    - by Chris Marisic
    Monitoring my global exception logs this error seems to be impossible to remove no matter what I do, I thought I finally got rid of it but it's back again. You can see a strack trace of the error on a similar post here. Notes about the environment: IIS 6.0, .NET 3.5 SP1 single server ASP.NET application Steps already taken: <system.web> <machineKey validationKey="big encryption key" decryptionKey="big decryption key" validation="SHA1" decryption="AES" /> In my Page Base for all of my pages protected override void OnInit(EventArgs e) { const string viewStateKey = "big key value"; Page.ViewStateUserKey = viewStateKey; } Also in the source of the page I can see that all of the ASP.NET generated hidden fields are correctly at the top of the page.

    Read the article

  • Wordpress sidebar classes

    - by Chris J. Lee
    There any way i could add a class for the specific order of widget item? i.e. the class name would be widgetorder-1 (for the first appearing widget), widgetorder-2 (for the widget appearing in the 2nd order), etc. I looked into filters but wasn't sure how that worked.

    Read the article

  • Cakephp: Correct way to resolve hasMany - hasMany relation

    - by Chris
    I have three models: Company, Car, Passenger Company hasMany Cars Car hasMany Passenger These relations seem to work independetly: Car shows all Passengers and Company shows all Cars. But I cannot resolve the Company - Passenger (Show all Passengers of a Company). My controller for Company: function index(){ //grab all companies and pass it to the view: $companies = $this->Company->find('all'); $this->set('companies', $companies); } This displays all companies with all their respective cars. However the array does not contain an entry for passenger. What do I have to do to completely resovle the Company - Car - Passenger relation?

    Read the article

  • Shortest-path algorithms which use a space-time tradeoff?

    - by Chris Mounce
    I need to find shortest paths in an unweighted, undirected graph. There are algorithms which can find a shortest path between two nodes, but this can take time. There are also algorithms for computing shortest paths for all pairs of nodes in the graph, but storing such a lookup table would take lots of disk space. What I'm wondering: Is there an algorithm which offers a space-time tradeoff that's somewhere between these two extremes? In other words, is there a way to speed up a shortest-path search, while using less disk space than would be occupied by an all-pairs shortest-path table? I know there are ways to efficiently store lookup tables for this problem, and I already have a couple of ideas for speeding up shortest-path searches using precomputed data. But I don't want to reinvent the wheel if there's already some established algorithm that solves this problem.

    Read the article

  • Resolving Circular References for Objects Implementing ISerializable

    - by Chris
    I'm writing my own IFormatter implementation and I cannot think of a way to resolve circular references between two types that both implement ISerializable. Here's the usual pattern: [Serializable] class Foo : ISerializable { private Bar m_bar; public Foo(Bar bar) { m_bar = bar; m_bar.Foo = this; } public Bar Bar { get { return m_bar; } } protected Foo(SerializationInfo info, StreamingContext context) { m_bar = (Bar)info.GetValue("1", typeof(Bar)); } public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("1", m_bar); } } [Serializable] class Bar : ISerializable { private Foo m_foo; public Foo Foo { get { return m_foo; } set { m_foo = value; } } public Bar() { } protected Bar(SerializationInfo info, StreamingContext context) { m_foo = (Foo)info.GetValue("1", typeof(Foo)); } public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("1", m_foo); } } I then do this: Bar b = new Bar(); Foo f = new Foo(b); bool equal = ReferenceEquals(b, b.Foo.Bar); // true // Serialise and deserialise b equal = ReferenceEquals(b, b.Foo.Bar); If I use an out-of-the-box BinaryFormatter to serialise and deserialise b, the above test for reference-equality returns true as one would expect. But I cannot conceive of a way to achieve this in my custom IFormatter. In a non-ISerializable situation I can simply revisit "pending" object fields using reflection once the target references have been resolved. But for objects implementing ISerializable it is not possible to inject new data using SerializationInfo. Can anyone point me in the right direction?

    Read the article

  • strange redefined symbols

    - by Chris H
    I included this header into one of my own: http://codepad.org/lgJ6KM6b When I compiled I started getting errors like this: CMakeFiles/bin.dir/SoundProjection.cc.o: In function `Gnuplot::reset_plot()': /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include/g++-v4/new:105: multiple definition of `Gnuplot::reset_plot()' CMakeFiles/bin.dir/main.cc.o:project/gnuplot-cpp/gnuplot_i.hpp:962: first defined here CMakeFiles/bin.dir/SoundProjection.cc.o: In function `Gnuplot::set_smooth(std::basic_string, std::allocator const&)': project/gnuplot-cpp/gnuplot_i.hpp:1041: multiple definition of `Gnuplot::set_smooth(std::basic_string, std::allocator const&)' CMakeFiles/bin.dir/main.cc.o:project/gnuplot-cpp/gnuplot_i.hpp:1041: first defined here CMakeFiles/bin.dir/SoundProjection.cc.o:/usr/include/eigen2/Eigen/src/Core/arch/SSE/PacketMath.h:41: multiple definition of `Gnuplot::m_sGNUPlotFileName' I know it's hard to see in this mess, but look at where the redefinitions are taking place. They take place in files like /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include/g++-v4/new:105. How is the new operator getting information about a gnuplot header? I can't even edit that file. How could that ever even be possible? I'm not even sure how to start debugging this. I hope I've provided enough information. I wasn't able to reproduce this in a small project. I mostly just looking for tips on how to find out why this is happening, and how to track it down. Thanks.

    Read the article

  • Inserting Multiple Records in SQL2000

    - by Chris M
    I have a web app that currently is inserting x (between 1 + 40) records into a table that contains about 5 fields, via a linq-2-sql-stored procedure in a loop. Would it be better to manually write the SQL Inserts to say a string builder and run them against the database when the loops completed rather than 30 transactions? or should I just accept this is negligible for such a small number of inserts.

    Read the article

  • css border problem

    - by Chris
    For some reason I have a very ugly orange part of a border around a image. Can anyone see why this is? This is the HTML <div class="preview"> <a href="images/foto/full/280899624_6_5_j6.jpeg" title="Sportschool Raymond Snel" rel="lightbox"><img src="images/foto/full/280899624_6_5_j6.jpeg" alt="text" /></a> </div> This is the css .preview { width: 85px; height: 85px; overflow: hidden; border: 3px solid #2e2a26; } The color code = FF6a00 but appears only one time in the css file. a { color: #ff6a00; text-decoration: none; border: 0px; } As you can see I already gave it a 0px, but for some reason the border is still there.

    Read the article

  • Why do multiline cells in my CSV file appear with a question mark at the end of each line in Excel?

    - by Chris Lindsay
    I'm currently working on a project where we'd like to allow a user to export their data to CSV. Some of the data we present has multiple values for a single cell, and so we use the standard CSV method of putting each value on its own line: Column A, Column B, Column C Value A, "Value B1 Value B2", Value C Most of the time this works fine, but some people are reporting seeing a small question mark in a box character appear at the end of each line when they load the file in Excel. Why is this happening?

    Read the article

  • Coercing Json Serializer into producing a particular datetime format (yyyy-mm-ddThh:mm:ss.msmsmsZ)

    - by Chris McCall
    MyClass theSession = new MyClass() { accountId = 12345, timeStamp = DateTime.Now, userType = "theUserType" }; System.Web.Script.Serialization.JavaScriptSerializer Json = new System.Web.Script.Serialization.JavaScriptSerializer(); Response.Write(Json.Serialize(theSession)); Produces: {"accountId":12345,"timeStamp":"\/Date(1268420981135)\/","userType":"theUserType"} How can I present the date as: "timestamp":"2010-02-15T23:53:35.963Z" ?

    Read the article

  • How do I write a prepared statement with an update?

    - by Chris
    I am using mysqli prepared statments and I am trying to write a prepared statement with an UPDATE, but I think I am off somewhere. Here's my code: $upload_folder = 'Some String'; $sql = 'UPDATE orders (upload_location) SET (?) WHERE order_id = 160'; $stmt = $conn->stmt_init(); if($stmt->prepare($sql)){ $stmt->bind_param('s', $upload_folder); $location_inserted = $stmt->execute(); } What am I doing wrong?

    Read the article

  • C String literals: Where do they go?

    - by Chris Cooper
    I have read a lot of posts about "string literals" on SO, most of which have been about best-practices, or where the literal is NOT located in memory. I am interested in where the string DOES get allocated/stored, etc. I did find one intriguing answer here, saying: Defining a string inline actually embeds the data in the program itself and cannot be changed (some compilers allow this by a smart trick, don't bother). but, it had to do with C++, not to mention that it says not to bother. I am bothering. =D So my question is, again, where and how is my string literal kept? Why should I not try to alter it? Does the implementation vary by platform? Does anyone care to elaborate on the "smart trick?" Thanks for any explanations.

    Read the article

  • Help me understand entity framework 4 caching for lazy loading

    - by Chris
    I am getting some unexpected behaviour with entity framework 4.0 and I am hoping someone can help me understand this. I am using the northwind database for the purposes of this question. I am also using the default code generator (not poco or self tracking). I am expecting that anytime I query the context for the framework to only make a round trip if I have not already fetched those objects. I do get this behaviour if I turn off lazy loading. Currently in my application I am breifly turning on lazy loading and then turning it back off so I can get the desired behaviour. That pretty much sucks, so please help. Here is a good code example that can demonstrate my problem. Public Sub ManyRoundTrips() context.ContextOptions.LazyLoadingEnabled = True Dim employees As List(Of Employee) = context.Employees.Execute(System.Data.Objects.MergeOption.AppendOnly).ToList() 'makes unnessesary round trip to the database, I just loaded the employees' MessageBox.Show(context.Employees.Where(Function(x) x.EmployeeID < 10).ToList().Count) context.Orders.Execute(System.Data.Objects.MergeOption.AppendOnly) For Each emp As Employee In employees 'makes unnessesary trip to database every time despite orders being pre loaded.' Dim i As Integer = emp.Orders.Count Next End Sub Public Sub OneRoundTrip() context.ContextOptions.LazyLoadingEnabled = True Dim employees As List(Of Employee) = context.Employees.Include("Orders").Execute(System.Data.Objects.MergeOption.AppendOnly).ToList() MessageBox.Show(employees.Where(Function(x) x.EmployeeID < 10).ToList().Count) For Each emp As Employee In employees Dim i As Integer = emp.Orders.Count Next End Sub Why is the first block of code making unnessesary round trips?

    Read the article

  • Which Ant property contains the CWD when the ant script is run?

    - by Chris R
    I don't want to get the basedir -- that appears to contain the build.xml script -- I want the CWD of the call to ant itself. Basically, I want to do this: $ cd /home/chrisr/projects/some_project $ ant -f ../../tools/ant-build-rules/library.xml build-library At this point, I need two things: The path to ant-build-rules in absolute form; this is currently found in the basedir property, so I'm set there. The path of some_project, in absolute form. This is what I don't know how to get. Which property contains this information?

    Read the article

  • Linux support for click-thru licenses

    - by Chris Quenelle
    I want to publish some software for different Linux distributions, using the regular Linux packaging formats (rpm, deb, yast, etc). My package will require a click-thru license agreement. Which Linux tools and package formats support a license in the package which is shown to the user before installing the software?

    Read the article

  • Strange iPhone memory leak in xml parser

    - by Chris
    Update: I edited the code, but the problem persists... Hi everyone, this is my first post here - I found this place a great ressource for solving many of my questions. Normally I try my best to fix anything on my own but this time I really have no idea what goes wrong, so I hope someone can help me out. I am building an iPhone app that parses a couple of xml files using TouchXML. I have a class XMLParser, which takes care of downloading and parsing the results. I am getting memory leaks when I parse an xml file more than once with the same instance of XMLParser. Here is one of the parsing snippets (just the relevant part): for(int counter = 0; counter < [item childCount]; counter++) { CXMLNode *child = [item childAtIndex:counter]; if([[child name] isEqualToString:@"PRODUCT"]) { NSMutableDictionary *product = [[NSMutableDictionary alloc] init]; for(int j = 0; j < [child childCount]; j++) { CXMLNode *grandchild = [child childAtIndex:j]; if([[grandchild stringValue] length] > 1) { NSString *trimmedString = [[grandchild stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; [product setObject:trimmedString forKey:[grandchild name]]; } } // Add product to current category array switch (categoryId) { case 0: [self.mobil addObject: product]; break; case 1: [self.allgemein addObject: product]; break; case 2: [self.besitzeIch addObject: product]; break; case 3: [self.willIch addObject: product]; break; default: break; } [product release]; } } The first time, I parse the xml no leak shows up in instruments, the next time I do so, I got a lot of leaks (NSCFString / NSCFDictionary). Instruments points me to this part inside CXMLNode.m, when I dig into a leaked object: theStringValue = [NSString stringWithUTF8String:(const char *)theXMLString]; if ( _node->type != CXMLTextKind ) xmlFree(theXMLString); } return(theStringValue); I really spent a long time and tried multiple approaches to fix this, but to no avail so far, maybe I am missing something essential? Any help is highly appreciated, thank you!

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >