Daily Archives

Articles indexed Thursday April 1 2010

Page 20/126 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Easy way to update models in your ASP.NET MVC business layer

    - by rajbk
    Brad Wilson just mentioned there is a static class ModelCopier that has a static method CopyModel(object from, object to) in the MVC Futures library. It uses reflection to match properties with the same name and compatible types. In short, instead of manually copying over properties as shown here: public void Save(EmployeeViewModel employeeViewModel){ var employee = (from emp in dataContext.Employees where emp.EmployeeID == employeeViewModel.EmployeeID select emp).SingleOrDefault(); if (employee != null) { employee.Address = employeeViewModel.Address; employee.Salary = employeeViewModel.Salary; employee.Title = employeeViewModel.Title; } dataContext.SubmitChanges();} you can use the method like so: public void Save(EmployeeViewModel employeeViewModel){ var employee = (from emp in dataContext.Employees where emp.EmployeeID == employeeViewModel.EmployeeID select emp).SingleOrDefault(); if (employee != null) { ModelCopier.CopyModel(employeeViewModel, employee); } dataContext.SubmitChanges();} Beautiful, isn’t it?

    Read the article

  • SEO made easy with IIS URL Rewrite 2.0 SEO templates

    - by The Official Microsoft IIS Site
    A few weeks ago my team released the version 2.0 of the URL Rewrite for IIS . URL Rewrite is probably the most powerful Rewrite engine for Web Applications. It gives you many features including Inbound Rewriting (ie. Rewrite the URL, Redirect to another URL, Abort Requests, use of Maps, and more), and in Version 2.0 it also includes Outbound Rewriting so that you can rewrite URLs or any markup as the content is being sent back even if its generated using PHP, ASP.NET or any other technology. It also...(read more)

    Read the article

  • Vmware - How do i config a host-only network

    - by nXqd
    The understanding about Host-only: I use VMware 7, Vmnet1 is the host-only adapter for host and it's IP is 192.168.209.1 . I'm really confused about this , does it connect to Vmnet 1 switch and Vmnet has DHCP also, it provieds IP range: Why it has virtual host adapter ( Vmnet 1) has IP which isn't in range while it's just an adapter in virtual network, it connects through switch Vmnet like the guest adapter Waiting for your answers , thanks in advance :)

    Read the article

  • Error during installation of Mesa on Linux

    - by rodnower
    Hello, I have a problem. I try to install Mesa 7.8 on CentOS 3.9 for i386 on VMVare 7.0.1 like described here: http://linux-sxs.org/multimedia/mesa.html When I perform configuration stage: ++++++++++++++++++++++++++++++++++++++++++++++++++ [root@CentOS Mesa-7.8]# ./configure --prefix=/usr --sysconfdir=/etc ++++++++++++++++++++++++++++++++++++++++++++++++++ (root is actualy root) This is what I get: ++++++++++++++++++++++++++++++++++++++++++++++++++ . . . checking pkg-config files for X11 are available... no checking for X... no configure: error: X11 development libraries needed for dri driver ++++++++++++++++++++++++++++++++++++++++++++++++++ (Three dots says that there is some output before) Put attention to error. Any idea? Thank you very much forahead.

    Read the article

  • TortoiseSVN - When I delete a folder I got trouble.

    - by Mendy
    A lot of times I need to delete a folder and copy another one with the same name. Always this is a place to trouble. What is the best way do do this? The error I got when I trying to commit: Error: Directory Error: '..\trunk\bin\MVCContrib\InputBuilderTemplates\.svn' Error: containing working copy admin area is missing Error: Please execute the 'Cleanup' command. The error I got when I trying to cleanup: '..\trunk\bin\MVCContrib\InputBuilderTemplates\.svn' is not a working copy directory.

    Read the article

  • Perl: Process Communcation

    - by Shiftbit
    Can anyone explain how I can successfully get my process communicating. I find the perldoc on IPC confusing. What I have so far is: $| = 1; $SIG{CHLD} = {wait}; my $parentPid = $$; if ($pid = fork();) ) { if ($pid == 0) { pipe($parentPid, $$); open PARENT, "<$parentPid"; while (<PARENT>) { print $_; } close PARENT; exit(); } else { pipe($parentPid, $pid); open CHILD, ">$pid"; or error("\nError opening: childPid\nRef: $!\n"); open (FH, "<list") or error("\nError opening: list\nRef: $!\n"); while(<FH>) { print CHILD, $_; } close FH or error("\nError closing: list\nRef: $!\n"); close CHILD or error("\nError closing: childPid\nRef: $!\n); } else { error("\nError forking\nRef: $!\n"); } First Question is what does Perldoc pipe mean by READHANDLE, WRITEHANDLE? Second Questions is can I implement a solution without relying on CPAN or other modules?

    Read the article

  • Android Contacts

    - by soclose
    Hi I'm .NET Developer, but I'm new in Android. I'd like to test to add a feature. It is appeared clicking Menu under Contacts in Android. It includes New Contact, Search, Display Group and Import Contacts. I just only wanna get "New Contact". How could I test it? Which API do I need to use? Best Regards

    Read the article

  • Problems with a from CSS

    - by Michael
    I am trying to create a fairly basic form with in my maincontent. I am sure I am coding things incorrectly and it is driving me crazy. Note my code. I get extremely wide vertical spacing in IE 7 and the bacground color between the field sets does not work correctly. All is good in FF. My CSS is: fieldset { margin: 1.5em 0 0 0; padding: 0; border-style: none; border-top: 1px solid #BFBAB0; background-color: #FFFFFF; } legend { margin-left: 1em; color: #000000; font-weight: bold; } fieldset ol { padding: 1em 1em 0 1em; list-style: none; } fieldset li { padding-bottom: 1em; } fieldset.submit { border-style: none; } { var w = document.myform.mylist.selectedIndex; var selected_text = document.myform.mylist.options[w].text; alert(selected_text); } label em { display: block; color: #900; font-size: 85%; font-style: normal; text-transform: uppercase; } This is my html code. <div id="mainContent1"> <form name="myform"> <label for="mylist"><strong>Select an Account Type:</strong></label> <select name="mylist"><option value="traditional">Traditional Account</option> <option value="paperless">Paperless Account</option> </select> </form> <br /><a> </a> <form action="example.php"> <fieldset> <legend>Contact Details</legend> <ol> <li> <label for="name">Name:</label> <input id="name" name="name" class="text" type="text" /> <label for="name"> <em>required</em> </label> </li> <li> <label for="email">Email address:</label> <input id="email" name="email" class="text" type="text" /> <label for="name"> <em>required</em> </li> <li> <label for="phone">Telephone:</label> <input id="phone" name="phone" class="text" type="text" /> <label for="name"> <em>required</em> <ol> <li> <input id="option1" name="option1" class="checkbox" type="checkbox" value="1" /> <label for="option1">Savings</label> </li> <li> <input id="option2" name="option2" class="checkbox" type="checkbox" value="1" /> <label for="option2">Checkings</label> </li> </ol> </fieldset> <fieldset> <legend>Delivery Address</legend> <ol> <li> <label for="address1">Address 1:</label> <input id="address1" name="address1" class="text" type="text" /> </li> <li> <label for="city">City:</label> <input id="city" name="city" class="text" type="text" /> </li> <li> <label for="postcode">Zip Code:</label> <input id="postcode" name="postcode" class="text textSmall" type="text" /> </li> <li> <label for="country">Country:</label> <input id="country" name="country" class="text" type="text" /> </li> </ol> </fieldset> <fieldset class="submit"> <input class="submit" type="submit" value="Submit" /> </fieldset> <fieldset class="clear"> <input class="clear" type="clear" value="Submit" /> </fieldset> </form>

    Read the article

  • How to start a major iPhone app update in Xcode

    - by Eric
    I have an app in the iPhone app store and have released several minor updates to it. I want to begin work on some major feature additions and reorganization, but don't want to lose the source code of my most recent version in case everything goes horribly wrong. Should I start a new Xcode project from scratch and copy my existing source in? If I do this will I be able to submit the build from this new project as an update or will Apple complain that the build comes from a different Xcode project? I've seen (but not used) Xcode's "Snapshots" and "Source Control" features - are these what I'm looking for? Any help or direction greatly appreciated.

    Read the article

  • TFS: comparing changesets

    - by Ram
    In TFS we can find "compare" a file between 2 changesets. Is it possible to compare 2 changesets. Say take changeset "r" as reference and compare it with changeset "s" and find the files/folders which were added/removed/delted/edited ?

    Read the article

  • T-SQL selecting values that match ISNUMERIC and also are within a specified range. (plus Linq-to-sql

    - by Toby
    I am trying to select rows from a table where one of the (NVARCHAR) columns is within a numeric range. SELECT ID, Value FROM Data WHERE ISNUMERIC(Value) = 1 AND CONVERT(FLOAT, Value) < 66.6 Unfortunately as part of the SQL spec the AND clauses don't have to short circuit (and don't on MSSQL Server EE 2008). More info: http://stackoverflow.com/questions/789231/is-the-sql-where-clause-short-circuit-evaluated My next attempt was to try this to see if I could achieve delayed evaluation of the CONVERT SELECT ID, Value FROM Data WHERE (CASE WHEN ISNUMERIC(Value) = 1 THEN CONVERT(FLOAT, Value) < 66.6 ELSE 0 END) but I cannot seem to use a < (or any comparison) with the result of a CONVERT. It fails with the error Incorrect syntax near '<'. I can get away with SELECT ID, CONVERT(FLOAT, Value) AS Value FROM Data WHERE ISNUMERIC(Value) = 1 So the obvious solution is to wrap the whole select statement in another SELECT and WHERE and return the converted values from the inner select and filter in there where of the outer select. Unfortunately this is where my Linq-to-sql problem comes in. I am filtering not only by one range but potentialy by many, or just by the existance of the record (there are some date range selects and comparisons I've left out.) Essentially I would like to be able to generate something like this: SELECT ID, TypeID, Value FROM Data WHERE (TypeID = 4 AND ISNUMERIC(Value) AND CONVERT(Float, Value) < 66.6) OR (TypeID = 8 AND ISNUMERIC(Value) AND CONVERT(Float, Value) > 99) OR (TypeID = 9) (With some other clauses in each of those where options.) This clearly doesn't work if I filter out the non-ISNUMERIC values in an inner select. As I mentioned I am using Linq-to-sql (and PredicateBulider) to build up these queries but unfortunately Datas.Where(x => ISNUMERIC(x.Value) ? Convert.ToDouble(x.Value) < 66.6 : false) Gets converted to this which fails the initial problem. WHERE (ISNUMERIC([t0].[Value]) = 1) AND ((CONVERT(Float,[t0].[Value])) < @p0) My last resort will have to be to outer join against a double select on the same table for each of the comparisons but this isn't really an idea solution. I was wondering if anyone has run into similar issues before?

    Read the article

  • Error number 13 - Remote access svn with dav_svn failing

    - by C. Ross
    I'm getting the following error on my svn repository <D:error> <C:error/> <m:human-readable errcode="13"> Could not open the requested SVN filesystem </m:human-readable> </D:error> I've followed the instructions from the How to Geek, and the Ubuntu Community Page, but to no success. I've even given the repository 777 permissions. <Location /svn/myProject > # Uncomment this to enable the repository DAV svn # Set this to the path to your repository SVNPath /svn/myProject # Comments # Comments # Comments AuthType Basic AuthName "My Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd # More Comments </Location> The permissions follow: drwxrwsrwx 6 www-data webdev 4096 2010-02-11 22:02 /svn/myProject And svnadmin validates the directory $svnadmin verify /svn/myProject/ * Verified revision 0. and I'm accessing the repository at http://ipAddress/svn/myProject Edit: The apache error log says [Fri Feb 12 13:55:59 2010] [error] [client <ip>] (20014)Internal error: Can't open file '/svn/myProject/format': Permission denied [Fri Feb 12 13:55:59 2010] [error] [client <ip>] Could not fetch resource information. [500, #0] [Fri Feb 12 13:55:59 2010] [error] [client <ip>] Could not open the requested SVN filesystem [500, #13] [Fri Feb 12 13:55:59 2010] [error] [client <ip>] Could not open the requested SVN filesystem [500, #13] Even though I confirmed that this file is ugo readable and writable. What am I doing wrong?

    Read the article

  • Problems Using memset and memcpy

    - by user306557
    So I am trying to create a Memory Management System. In order to do this I have a set amount of space (allocated by malloc) and then I have a function myMalloc which will essentially return a pointer to the space allocated. Since we will then try and free it, we are trying to set a header of the allocated space to be the size of the allocated space, using memset. memset(memPtr,sizeBytes,sizeof(int)); We then need to be able to read this so we can see the size of it. We are attempting to do this by using memcpy and getting the first sizeof(int) bytes into a variable. For testing purposes we are just trying to do memset and then immediately get the size back. I've included the entire method below so that you can see all declarations. Any help would be greatly appreciated! Thanks! void* FirstFit::memMalloc(int sizeBytes){ node* listPtr = freelist; void* memPtr; // Cycle through each node in freelist while(listPtr != NULL) { if(listPtr->size >= sizeBytes) { // We found our space // This is where the new memory allocation begins memPtr = listPtr->head; memset(memPtr,sizeBytes,sizeof(int)); void *size; memcpy(size, memPtr, sizeof(memPtr)); // Now let's shrink freelist listPtr->size = listPtr->size - sizeBytes; int *temp = (int*)listPtr->head + (sizeBytes*sizeof(int)); listPtr->head = (int*) temp; return memPtr; } listPtr = listPtr->next; }

    Read the article

  • Can I setup a test server and then transfer everything to a diff. production server?

    - by Justin
    Hello, I am going to be setting up a "real" server, but it's not being shipped for another week. I was planning on setting up most of the server's functionality using an extra workstation I have. I wanted to set-up Windows Server 2003 or 2008, IIS, Terminal Services, Firewall, and Antivirus on this regular machine. I'd also be installing software like Winzip and VMWare that'll be used on the server. I can't ghost the machine, as far as I've done in the past, because the motherboard/cpu/etc. will all be different. Is there any way to export all of the "server settings" or something like that so I can move everything from test to production? Is there any software out there that does something similar to this? Some things I'm going to have to wait on such as setting up the file server completely in its raid configuration, but I'd like to get the simple server stuff and network setup out of the way. Has anyone done this before? Do I need software, open-source or not, to do this? Or maybe there's a way to export all the server settings in some way? Thanks in advance! Justin

    Read the article

  • Get songs off of Windows iPod and onto a Mac

    - by Justing
    I have been using iTunes on a Dell running Windows XP to sync about 60 gigs of songs with my old school iPod. Well, the Dell's hard drive died the other day, and the only place that I have my music is on the iPod (I do have the CDs, but really don't want to have to re-rip 60 gigs of music). So, now I have a shiny new MacBook Pro. Is there a way to get my songs off of my iPod and onto the MacBook? I googled, and found Senuti. But, I'm leery of accidentally formating the iPod and losing my songs, and I can't tell if it is Snow Leopard compatible yet. Has anyone recently gone through this process? Please provide suggestions for copying songs from an iPod formated to work with Windows onto a MacBook Pro running Snow Leopard. Thanks!

    Read the article

  • What's Your Favorite Harmless Computer Practical Joke?

    - by Ben Griswold
    A couple of months ago, I returned from lunch to find that typing any key launched a random application. As I always lock my machine before walking away from it, my first thought was that a co-worker was playing a practical joke on me. As it turned out, the cause was random computer wonkiness. But just in case there's a need :), what's your favorite harmless computer practical joke? For example, would you alter host file entries to direct google.com to a random site or would you put tape over the optical sensor of a co-worker’s mouse?

    Read the article

  • Tool to create UI for Linux (Gnome) shell scripts

    - by stwissel
    I'm writing a bunch of Linux shell scripts with complex selections. For now I use zenity for prompts. I'd rather use something where I can show more than one UI element at a time and query it in a script (e.g. a list and some checkboxed and a file picker and an entry field. What are my options?

    Read the article

  • Escaping ampersands in URLs for HttpClient requests

    - by jpatokal
    So I've got some Java code that uses Jakarta HttpClient like this: URI aURI = new URI( "http://host/index.php?title=" + title + "&action=edit" ); GetMethod aRequest = new GetMethod( aURI.getEscapedPathQuery()); The problem is that if title includes any ampersands (&), they're considered parameter delimiters and the request goes screwy... and if I replace them with the URL-escaped equivalent %26, then this gets double-escaped by getEscapedPathQuery() into %2526. I'm currently working around this by basically repairing the damage afterward: URI aURI = new URI( "http://host/index.php?title=" + title.replace("&", "%26") + "&action=edit" ); GetMethod aRequest = new GetMethod( aURI.getEscapedPathQuery().replace("%2526", "%26")); But there has to be a nicer way to do this, right? Note that the title can contain any number of unpredictable UTF-8 chars etc, so escaping everything else is a requirement.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >