Search Results

Search found 1485 results on 60 pages for 'dan watling'.

Page 37/60 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Have you read any ASP.NET MVC 2.0 book?

    - by Dan Dumitru
    I'm sorry for asking yet another "best [insert-technology] book". I know a bit of MVC, I want to start a project in MVC 2 and a good book would be really helpful. Usually, after a while, people come to a consensus what are the top 2-3 books for learning a given technology. Have you read any ASP.NET MVC 2.0 book? If so, how was it?

    Read the article

  • PHP image resize and rounded image corners dynamically

    - by Dan
    I'm working of a script that dynamically ads rounded edges to an image then crops it down to a certain size. At the moment the script ads the rounded edges to the picture but i cannot get it so the original image is resized to fit within the dimensons of the final outputted image (140px x 120px) The problem is that the orginal uploaded image depending on it's orginal dimensions change the size it is in the final PNG { $image_file = $_FILES['image']['tmp_name']; $corner_radius = isset($_GET['radius']) ? $_GET['radius'] : 20; // The default corner radius is set to 20px $topleft = (isset($_GET['topleft']) and $_GET['topleft'] == "no") ? false : true; // Top-left rounded corner is shown by default $bottomleft = (isset($_GET['bottomleft']) and $_GET['bottomleft'] == "no") ? false : true; // Bottom-left rounded corner is shown by default $bottomright = (isset($_GET['bottomright']) and $_GET['bottomright'] == "no") ? false : true; // Bottom-right rounded corner is shown by default $topright = (isset($_GET['topright']) and $_GET['topright'] == "no") ? false : true; // Top-right rounded corner is shown by default $imagetype=$_FILES['image']['type']; $endsize=$corner_radius; $startsize=$endsize*3-1; $arcsize=$startsize*2+1; if (($imagetype=='image/jpeg') or ($imagetype=='jpg')) { $image = imagecreatefromjpeg($image_file); } else { if (($imagetype=='GIF') or ($imagetype=='gif')) { $image = imagecreatefromgif($image_file); } else { $image = imagecreatefrompng($image_file); } } $forecolor ='#ffffff'; $size = getimagesize($image_file); // Top-left corner $background = imagecreatetruecolor($size[0],$size[1]); imagecopymerge($background, $image, 0, 0, 0, 0, $size[0], $size[1], 100); $startx=$size[0]*2-1; $starty=$size[1]*2-1; $im_temp = imagecreatetruecolor($startx,$starty); imagecopyresampled($im_temp, $background, 0, 0, 0, 0, $startx, $starty, $size[0], $size[1]); $bg = imagecolorallocate($im_temp, 255,255,255); $fg = imagecolorallocate($im_temp, 255,255,255); if ($topleft == true) { if(!imagearc($im_temp, $startsize, $startsize, $arcsize, $arcsize, 180,270,$bg))echo "nope"; imagefilltoborder($im_temp,0,0,$bg,$bg); } // Bottom-left corner // Top-right corner if ($topright == true) { imagearc($im_temp, $startx-$startsize, $startsize,$arcsize, $arcsize, 270,360,$bg); imagefilltoborder($im_temp,$startx,0,$bg,$bg); } $image = imagecreatetruecolor(140,120); imagecopyresampled($image, $im_temp, 0, 0, 0, 0, $size[0],$size[1],$starty+1310,$startx+1500); // Output final image if(!imagepng($image,'hello.png')) echo "boo"; if(!imagedestroy($image)) echo "2"; if(!imagedestroy($background)) echo "3"; if(!imagedestroy($im_temp)) echo "4"; } EDIT: My question is how to get the orginal image reized so it fits into the 140 x 120 image that is processed with the rounded edges?

    Read the article

  • Integrating YUI tests with CruiseControl

    - by Dan R
    I am using YUI to test my JavaScript app, and want to integrate the test results into my CruiseControl build system. How can I use CruiseControl to run the tests? I initially thought about using the JUnit plugin to drive the tests, but that is a no go. Does anyone else have this working? (Please note: Changing either YUI or CruiseControl isn't an option for me.)

    Read the article

  • How can I access IEnumerable<T> extension methods on my custom subclass of BindingList<T>?

    - by Dan
    I have a custom subclass of BindingList<T> that I want to execute a LINQ query over using the handy extension methods. For example: public int GetSum(MyList<T> list) { return list.Sum(x => x.Value); } But the compiler complains that it can't resolve Sum because it doesn't recognize list as an IEnumerable<T>, which it obviously is, because this works: public int GetSum(MyList<T> list) { return ((IEnumerable<T>)list).Sum(x => x.Value); } Anyone have a clever way I can avoid the ugly and unecessary cast?

    Read the article

  • How do I get a right outer join in L2E?

    - by Dan
    I have two tables that I set up through the VS Entity Data Model Diagram tool. I'm trying to do a right outer join and it doesn't return results from the 2nd table. I have set up a 0..1 to MANY relationship from the diagram tool. When I run a Linq-To-Entities query, it still defaults to an INNER JOIN. From my understanding of entities, if I set up the relationship using VS, when I join the tables, it should automagically figure out the join syntax based on the relationship I supply. It doesn't seem to be doing that. I am using EF v1 (not Linq-to-Sql). Query I'm running: from s in SomeTable join t in SomeOtherTable on s.ID equals t.ID select new { s.MyFieldName, t.MyOtherFieldName }

    Read the article

  • Eclipse jvm.dll error when loading

    - by Dan James Palmer
    Trying to open Eclipse after a couple of months and get this error: So I checked that folder to see if it existed, and it did: I checked my PATH Was correct and it was also correct: When this error first occurred I had 3 Java installations. JRE 7 Update 10, JDK 7 Update 7 32bit and 64 bit. I uninstall ALL and restarted my machine. Eclipse then stated, as expected that I needed a JRE or a JDK. So I downloaded and installed the latest JDK and now I get this error, despite everything appearing to be correct. Any ideas?

    Read the article

  • Multi-account sync with Dropbox API

    - by Dan
    I'm trying to create a web app that lets users share files with each other through Dropbox. At the moment, Dropbox handles all the sharing, and there's one central Dropbox account running on the web server that shares the folder with the people who want it. I'm trying to change it so people don't have to accept a new folder invitation each time. I'd like to have them authorize my app to access an app folder in their Dropbox account, and all their shared folders would go inside there. Any changes they make would get noticed by the app on the server and synced to everyone else's folders. There's a couple things I'm having trouble figuring out to make this work: Do I need to make repeated calls to /delta for every account? I can't think how else I'd do this, but that sounds like it would quickly turn into thousands of requests a minute just polling for updates. When someone adds a file, do I have to upload it once for each account? That seems like a huge waste of bandwidth. I've looked into using /copy_ref, which I think would add a file to another user's account without my app ever touching it, but my app's web interface also allows users to upload files directly to my server, which would then need to be synced with everyone else's folders. That file isn't on Dropbox's servers yet, so /copy_ref obviously wouldn't work. For a little extra context, my app is written in node.js, and I've been playing with this library to interface with Dropbox, which uses their REST API.

    Read the article

  • WCF RIA Services v1.0 Timeouts

    - by Dan Wray
    I have a RIA service methods which return quite a large amount of (binary) data to my silverlight application. The methods themselves (database access etc) complete quickly, but since I upgraded to v1.0 from the RC2 I've been experiencing timeouts, even when I limit the data returned to the smallest objects. Debug shows the method returning, then 20-30 seconds later the silverlight "method complete" event will fire. There is not enough data to cause that much lag. Could anyone suggest why this might be? I've been unable to find any breaking changes documentation specific to the RC2 = 1.0 upgrade. Trying to eliminate any other possible causes also, but this is literally a case of worked before the install, doesn't work now! (also upgraded silverlight 4 tools for vs).

    Read the article

  • Best language for scripting large scale file management

    - by Dan
    The National Park Service's Natural Sounds Program collects multiple terabytes of data each year measuring soundscapes. In your opinion, what is best available scripting language to manage massive amounts of files and file types? We would like to easily design and run efficient user-friendly scripts to search for and retrieve/create copies of files that may be located in different directories according a single static hierarchy. The OS will most likely be windows. Thanks!

    Read the article

  • Cannot Translate to SQL using Select(x => Func(x))

    - by Dan
    I'm slowly learning the ins and outs of LINQtoSQL, but this is confusing me. Here is the statement I have: IQueryable<IEvent> events = (from e in db.getEvents() select e).Select(x => SelectEvent(x, null)); What the SelectEvent does can be explained in this answer here. I am not using the .toList() function as I don't want potentially thousands of records brought into memory. public IEvent SelectEvent(SqlServer.Event ev, EventType? type) { // Create an object which implements IEvent // I don't have the code in front of me, so forgive the lack of code } My question is really for the Select() method. I get the "Cannot translate to SQL" error and the Select() is listed in the error message. Clueless on this one :-/.

    Read the article

  • Is there a cleaner way to Bind property to owner's DataContext?

    - by Dan Bryant
    I have some code that looks like this: <Expander Header="{Binding SelectedSlot.Name}" Visibility="{Binding ShowGroupSlot, Converter={StaticResource BooleanToVisibility}}"> <Controls:GroupPrototypeSlotControl Slot="{Binding DataContext.SelectedSlot, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Expander}}}" /> </Expander> This works, but the ugliness of the Slot Binding bothers me. This is required because the GroupPrototypeSlotControl has a GroupPrototypeViewModel as its DataContext. If I simply use {Binding SelectedSlot}, it attempts to resolve it on the 'child' ViewModel, which fails. I get around this by explicitly looking at the DataContext of my parent control. Is there a cleaner way to do this type of binding?

    Read the article

  • How do I get the WVGA Android browser to stop scaling my images?

    - by Dan Fabulich
    I'm designing an HTML page for display in Android browsers. Consider this simple example page: <html> <head><title>Simple!</title> </head> <body> <p><img src="http://sstatic.net/so/img/logo.png"></p> </body> </html> It looks just fine on the standard HVGA phones (320x480), but on HDPI WVGA sizes (480x800 or 480x854) the built-in browser automatically scales the image up; it looks ugly. I've read that I should be able to use this tag to force the browser to stop scaling my page: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" /> ... but all that does is disable user scaling (the zoom buttons disappear); it doesn't actually prevent the browser from scaling my image. Adjusting the scale factors (setting them all to 2.0 or 0.5) has no effect at all. How can I force the WVGA browser to stop scaling my images?

    Read the article

  • Is nested synchronized block necessary?

    - by Dan
    I am writing a multithreaded program and I have a method that has a nested synchronized blocks and I was wondering if I need the inner sync or if just the outer sync is good enough. public class Tester { private BlockingQueue<Ticket> q = new LinkedBlockingQueue<>(); private ArrayList<Long> list = new ArrayList<>(); public void acceptTicket(Ticket p) { try { synchronized (q) { q.put(p); synchronized (list) { if (list.size() < 5) { list.add(p.getSize()); } else { list.remove(0); list.add(p.getSize()); } } } } catch (InterruptedException ex) { Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex); } } } EDIT: This isn't a complete class as I am still working on it. But essentially I am trying to emulate a ticket machine. The ticket machine maintains a list of tickets in the BlockingQueue q. Whenever a client adds a ticket to the machine, the machine also keeps track of the price of the last 5 tickets (ArrayList list)

    Read the article

  • iphone: cross platform references and referencing external framework resources

    - by dan
    hi there working on an iphone app and separate framework. the separate framework is for an API that i'm building for use in multiple future apps. this api now needs to reference resources (images). what i would like to do is keep the resources WITH the API framework as local set of resources. i followed the instructions from http://www.clintharris.net/2009/iphone-app-shared-libraries/ to setup my app's project to use the headers from the separate API framework. what i can't seem to figure out is how to automatically load the framework's resources into the app's xcode environment so they can be linked in at app compile time. sure, i can drag the resources across from the framework into the main app's set of resources. but that seems kinda ugly and another step that possibly can be automated (??) anyone know of a better way? it would be great if any changes from the framework would be automatically available in the main app (due to the project 'link-age'). thanks for any help/tips/suggestions...

    Read the article

  • How to jQuery plugin effects to items created later in the DOM

    - by Dan Denney
    How do I apply jQuery plugin effects to items that are created by an event? So, what I am attempting to do is have all uls throughout a site use the jquery.scroll.js plugin for styling. I currently have it working on all active uls. However, there are some category/subcategory sections. I am still new to writing any jQuery on my own and there is a leap in logic that I don't understand on applying plugins to items when they are loaded later. In the real example, users click a category from a ul and a sub category is loaded via Rails and JSON. For a light sample, I made a jsfiddle that simulates the issue that I run into. The category ul is styled correctly, but the subcategory ul doesn't pick up the styling. I'm hoping for some assistance not just in whipping up some code to fix it, but in pointing me in the direction of what I need to learn for this functionality. http://jsfiddle.net/dandenney/25R8F/1/ Thank you in advance!

    Read the article

  • SVN marking file production ready

    - by dan.codes
    I am kind of new to SVN, I haven't used it in detail basically just checking out trunk and committing then exporting and deploying. I am working on a big project now with several developers and we are looking for the best deployment process. The one thing we are hung up on is the best way to tag, branch and so on. We are used to CVS where all you have to do is commit a file and tag it as production ready and if not that code will not get deployed. I see that SVN handles tagging differently then CVS. I figure I am looking at this and making it overly complex. It seems the only way to work on a project and commit files without it being in the production code is to do it in a branch and then merge those changes when you are ready for it to be deployed. I am assuming you could also be working on other code that should be deployed so you would have to be switching between working copies, because otherwise you are working on a branch that isn't getting mixed in with the trunk or production branch? This process seems overly complex and I was wondering if anyone could give me what you think is the best process for managing this.

    Read the article

  • Python - List of Lists Slicing Behavior

    - by Dan Dobint
    When I define a list and try to change a single item like this: list_of_lists = [['a', 'a', 'a'], ['a', 'a', 'a'], ['a', 'a', 'a']] list_of_lists[1][1] = 'b' for row in list_of_lists: print row It works as intended. But when I try to use list comprehension to create the list: row = ['a' for range in xrange(3)] list_of_lists = [row for range in xrange(3)] list_of_lists[1][1] = 'b' for row in list_of_lists: print row It results in an entire column of items in the list being changed. Why is this? How can I achieve the desired effect with list comprehension?

    Read the article

  • Java unit test coverage numbers do not match.

    - by Dan
    Below is a class I have written in a web application I am building using Java Google App Engine. I have written Unit Tests using TestNG and all the tests pass. I then run EclEmma in Eclipse to see the test coverage on my code. All the functions show 100% coverage but the file as a whole is showing about 27% coverage. Where is the 73% uncovered code coming from? Can anyone help me understand how EclEmma works and why I am getting the discrepancy in numbers? package com.skaxo.sports.models; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; @PersistenceCapable(identityType= IdentityType.APPLICATION) public class Account { @PrimaryKey @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String userId; @Persistent private String firstName; @Persistent private String lastName; @Persistent private String email; @Persistent private boolean termsOfService; @Persistent private boolean systemEmails; public Account() {} public Account(String firstName, String lastName, String email) { super(); this.firstName = firstName; this.lastName = lastName; this.email = email; } public Account(String userId) { super(); this.userId = userId; } public void setId(Long id) { this.id = id; } public Long getId() { return id; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public boolean acceptedTermsOfService() { return termsOfService; } public void setTermsOfService(boolean termsOfService) { this.termsOfService = termsOfService; } public boolean acceptedSystemEmails() { return systemEmails; } public void setSystemEmails(boolean systemEmails) { this.systemEmails = systemEmails; } } Below is the test code for the above class. package com.skaxo.sports.models; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertFalse; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class AccountTest { @Test public void testId() { Account a = new Account(); a.setId(1L); assertEquals((Long) 1L, a.getId(), "ID"); a.setId(3L); assertNotNull(a.getId(), "The ID is set to null."); } @Test public void testUserId() { Account a = new Account(); a.setUserId("123456ABC"); assertEquals(a.getUserId(), "123456ABC", "User ID incorrect."); a = new Account("123456ABC"); assertEquals(a.getUserId(), "123456ABC", "User ID incorrect."); } @Test public void testFirstName() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getFirstName(), "Test", "User first name not equal to 'Test'."); a.setFirstName("John"); assertEquals(a.getFirstName(), "John", "User first name not equal to 'John'."); } @Test public void testLastName() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getLastName(), "User", "User last name not equal to 'User'."); a.setLastName("Doe"); assertEquals(a.getLastName(), "Doe", "User last name not equal to 'Doe'."); } @Test public void testEmail() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getEmail(), "[email protected]", "User email not equal to '[email protected]'."); a.setEmail("[email protected]"); assertEquals(a.getEmail(), "[email protected]", "User email not equal to '[email protected]'."); } @Test public void testAcceptedTermsOfService() { Account a = new Account(); a.setTermsOfService(true); assertTrue(a.acceptedTermsOfService(), "Accepted Terms of Service not true."); a.setTermsOfService(false); assertFalse(a.acceptedTermsOfService(), "Accepted Terms of Service not false."); } @Test public void testAcceptedSystemEmails() { Account a = new Account(); a.setSystemEmails(true); assertTrue(a.acceptedSystemEmails(), "System Emails is not true."); a.setSystemEmails(false); assertFalse(a.acceptedSystemEmails(), "System Emails is not false."); } }

    Read the article

  • Integrate code generation with eclipse c++ build

    - by Dan
    Hi, I am using Eclipse for C++ development on windows. I have also written a code generator that take an xml file and produces several C++ files. The project I am working on is currently setup to use the internal builder. What I would like to do is to run the code generator as part of the build process. My problem is that I haven't been able to find a way to make Eclipse identify that the files are present (or have been updated) without 'Refeshing' the project. So although I can run the code generator as a pre-build step, the files generated aren't guaranteed to be included in the build. Does anybody know whether there is a way to make Eclipse do a refresh after the pre-build step or something to that effect, using the internal builder? Thanks

    Read the article

  • Is hardware accelerated CSS3 in Safari 4 & 5 broken, or my CSS and JS?

    - by Dan Forys
    Hi all, I've created a somewhat silly site that shows you the expected weather forecast for any city in the World. On webkit based browsers, when the weather is sunny a sun with CSS3 animated rotated sunbeams appears. This works fine on Chrome. An example (sunny, at the moment) page is: http://willitraintoday.co.uk/iceland/reykjavik/ However, when viewed in Safari 4 or 5 on Mac Snow Leopard, when the sun appears the sky background appears over it. Weirder still, as the cloud containing the advert moves across the sky, it squashes the main text. When the cloud reaches the left edge, the text appears wider than normal and starts squashing down again. I've tried: - Disabling the CSS3 animation; it works fine in Safari - Juggling the z-index of various elements; to no avail Is there something up with my Javascript or CSS, or is the hardware accelerated snow leopard Safari broken in this case? It seems not to happen in Safari 4 on Leopard, but I don't have Leopard any more to test myself. Grateful for any opinions!

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >