Daily Archives

Articles indexed Wednesday April 28 2010

Page 15/119 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • iPhone check for a constant at runtime in universal app

    - by joshue
    I'm making a universal iPad/iPhone app which can use the iPad's VGA out connector to mirror the content of the app on an external screen. However, the iPhone does not have this functionality. given the following code, [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenInfoNotificationReceieved:) name:UIScreenDidConnectNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenInfoNotificationReceieved:) name:UIScreenDidDisconnectNotification object:nil]; I get this error on the phone at launch (works fine in ipad) "dyld: Symbol not found: _UIScreenDidConnectNotification" presumably because UIScreenDidConnectNotification doesnt' exist yet in 3.13. How do I check for this at runtime?

    Read the article

  • How to retrieve stored reference to an NSManagedObject subclass?

    - by DavidDev
    Hi! I have a NSManagedObject subclass named Tour. I stored the reference to it using this code: prefs = [NSUserDefaults standardUserDefaults]; NSURL *myURL = [[myTour objectID] URIRepresentation]; NSData *uriData = [NSKeyedArchiver archivedDataWithRootObject:myURL]; [prefs setObject:uriData forKey:@"tour"]; Now I want to retrieve it. I tried using: NSData *myData = [prefs objectForKey:@"tour"]; NSURL *myURL = [NSKeyedUnarchiver unarchiveObjectWithData:myData]; TourAppDelegate *appDelegate = (TourAppDelegate *)[[UIApplication sharedApplication] delegate]; NSManagedObjectID *myID = [appDelegate.persistentStoreCoordinator managedObjectIDForURIRepresentation:myURL]; if (myID) { Tour *tempObject = [appDelegate.managedObjectContext objectWithID:myID]; //WARNING tour = tempObject; } if (tour) //instruction... But it's giving me this warning "Incompatible Objective-c types. Initializing 'struct NSManagedObject *', expected 'struct Tour *' Plus, when executing, it's giving me this: Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'CoreData could not fulfill a fault for '0x5001eb0 How can I solve this?

    Read the article

  • The data types text and nvarchar are incompatible in the equal to operator

    - by metro
    Hi there. this is my code ProductController.cs public ActionResult Details(string id) { product productx = productDB.products.Single(pr => pr.Product1 == id); return View(productx); } Details.aspx <td> <%-- : Html.ActionLink("Edit", "Edit", new { id=item.Id }) % --> <%: Html.ActionLink("Details", "Details", new { id = item.Product1 })%> </td> this is what im using to list some products from a sql database, each product have a link to a Details page to show more informations about it what Im trying is to only put the product label in that link to let it show something like www.mysite.com\products\battery (not the id) I've imagined this should work, but it throw an The data types text and nvarchar are incompatible in the equal to operator. error and neither (pr => pr.Product1.Equals(id)); works the error is clear and Im asking how should I do to make it work this way ? thanks

    Read the article

  • Keeping track of business rules within IT department?

    - by evaldas-alexander
    I am looking for the best way to keep track of the business rules for both developers and everybody else (support staff / management) in a startup enviroment. The challenge is that our business model requires quite a lot of different business rules, which are created pretty much on the fly and evolving organically after that. After running this project for 3+ years, we have so many of such rules that often the only way to be sure about what the application is supposed to do in a certain situation is to go find the module responsible for that process and analyze its code and comments. That is all fine as long as you have one single developer who created the entire application from the scratch, but every new developer needs to go over pretty much entire codebase in order to understand how the application works. Even bigger problem is that non technical employees don't even have that option and therefore are forced to ask me pretty much every day how some certain case would be handled by the application. Quick example - we only start charging for our customer campaigns once they have been active for at least 72 hours, but at the same time we stop creating invoices for campaigns that belong to insolvent accounts and close such accounts within a month of the first failed charge. That does not apply to accounts that are set to "non-chargeable" which most commonly belongs to us since we are using the service ourselves. The invoices are created on the 1st of each month and include charges from the previous month + any current balance that the account might have. However, some customers are charged only 4 days after their invoice has been generated due to issues with their billing department. In addition to that, invoices are also created when customer deactivates his campaign, but that can only be done once the campaign is not longer under mandatory 6 month contract, unless account manager approves early deactivation. I know, that's quite a lot of rules that need to be taken into account when answering a question "when do we bill our customers", but actually I could still append an asterisk at the end of each sentence in order to disclose some rare exceptions. Of course, it would be easiest just to keep the business rules to the minimum, but we need to adapt to changing marketplace - i.e. less than a year ago we had no contracts whatsoever. One idea that I had so far was a simplistic wiki with categories corresponding to areas such as "Account activation", "Invoicing", "Collection procedures" and so on. Another idea would be to have giant interactive flowchart showing the entire customer "life cycle" from prospecting to account deactivation. What are your experiences / suggestions?

    Read the article

  • Impersonation and Delegation

    - by Samuel Kim
    I am using impersonation is used to access file on UNC share as below. var ctx = ((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate(); string level = WindowsIdentity.GetCurrent().ImpersonationLevel); On two Windows 2003 servers using IIS6, I am getting different impersonation levels: Delegation on one server and Impersonation on the other server. This causes issues where I am unable to access the UNC share on the server with 'Impersonation' level. What could be causing this difference? I searched through machine.config and IIS settings for the app pool, site and virtual directories - but aren't able to find the cause of this problem.

    Read the article

  • Circular shift operations in C++

    - by Elroy
    Left and right shift operators (<< and ) are already available in C++. However, I couldn't find out how I could perform circular shift or rotate operations. How can operations like "Rotate Left" and "Rotate Right" be performed? Rotating right twice here Initial --> 1000 0011 0100 0010 should result in: Final --> 1010 0000 1101 0000 An example would be helpful.

    Read the article

  • Linq to NHibernate - How to return a parent object with only certain child objects included

    - by vakman
    Given a simplified model like the following: public class Enquiry { public virtual DateTime Created { get; set; } public virtual Sender Sender { get; set; } } public class Sender { public virtual IList<Enquiry> Enquiries { get; set; } } How can you construct a Linq to Nhibernate query such that it gives you back a list of senders and their enquiries where the enquiries meet some criteria. I have tried something like this: return session.Linq<Enquiry>() .Where(enquiry => enquiry.Created < DateTime.Now) .Select(enquiry => enquiry.Sender) In this case I get an InvalidCastException saying you can't cast type Sender to type Enquiry. Any pointers on how I can do this without using HQL?

    Read the article

  • Is there a way to programatically popup the "Microsoft Silverlight Configuration" dialog?

    - by Jim McCurdy
    I am building for Silverlight 4, and I handle MouseRightButtonDown events and build my own ContextMenu's (a class from the Silverlight Toolkit). I would like to add the classic "Silverlight" menu item to my menus, and give the user the familiar option of launching the "Microsoft Silverlight Configuration" dialog. This is the dialog lets users manage Updates, Webcams, Permissions, and Application Storage. So I need a way to programatically launch the dialog when the menu item is clicked. I can be done for Flash, and it would seem that Microsoft would want to encourage developers to support that option. Can it be done?

    Read the article

  • Grouping a list of of entities which has a sublist in c#

    - by mikei
    I have a set of Entities which basically has this structure. {Stats Name="<Product name> (en)" TotalResources="10" ..} {DayStats Date="2009-12-10" TotalResources="5"} {DayStats Date="2009-12-11" TotalResources="5"} {Stats} {Stats Name="<Product name> (us)" TotalResources="10" ..} {DayStats Date="2009-12-10" TotalResources="5"} {DayStats Date="2009-12-11" TotalResources="5"} {Stats} ... What I wan't to extract from this set is a new set entities (or entity in the example above) where the first level has been grouped by the (ignoring the country label) where all/some of the properties has been summmed together, including the the sublist of {DayStas} on a per day basis. So the result set of the example would look something like this: {Stats Name="<Product name>" TotalResources="20" ..} {DayStats Date="2009-12-10" TotalResources="10"} {DayStats Date="2009-12-11" TotalResources="10"} {Stats} ... So my question is: Is it possible to do this in a more elegant way in LINQ rather than the vanilla "loop-trhough-each-entity-and-compare"-way? And I wan't the set to contain the same type of entities as the original set ({Stats}, {DayStats}), your answer doesn't need to include code for that, I can probably work that out by myself. Just letting you know incase you need to take that into account. (I'm sorry if this question has been discussed before, I tried searching to no avail. I guess my searching skills are fuubar ;)) Merry christmas =)

    Read the article

  • INNER JOIN vs LEFT JOIN performance in SQL Server

    - by Ekkapop
    I've created SQL command that use INNER JOIN for 9 tables, anyway this command take a very long time (more than five minutes). So my folk suggest me to change INNER JOIN to LEFT JOIN because the performance of LEFT JOIN is better, at first time its despite what I know. After I changed, the speed of query is significantly improve. I want to know why LEFT JOIN is faster than INNER JOIN? My SQL command look like below: SELECT * FROM A INNER JOIN B ON ... INNER JOIN C ON ... INNER JOIN D and so no

    Read the article

  • ASP.NET MVC ModelCopier

    - by shiju
     In my earlier post ViewModel patten and AutoMapper in ASP.NET MVC application, We have discussed the need for  View Model objects and how to map values between View Model objects and Domain model objects using AutoMapper. ASP.NET MVC futures assembly provides a static class ModelCopier that can also use for copying values between View Model objects and Domain model objects. ModelCopier class has two static methods - CopyCollection and CopyModel.CopyCollection method would copy values between two collection objects and CopyModel would copy values between two model objects. <PRE class="c#" name="code"> var expense=new Expense(); ModelCopier.CopyModel(expenseViewModel, expense);</PRE>The above code copying values from expenseViewModel object to  expense object.                For simple mapping between model objects, you can use ModelCopier but for complex scenarios, I highly recommending to using AutoMapper for mapping between model objects.

    Read the article

  • Windows Server 2008 R2 - VPN Folder Sharing Permissions

    - by daveywc
    I have setup VPN access to my Windows Server 2008 R2 server using RRAS. Clients can connect, run applications, view shares etc. My problem is that one of the applications that they use relies on some network shares. The application is not able to access the shares unless the user first goes into Windows Explorer and accesses the share, providing their user name and password (the same one that they use to connect via the VPN). Previously on a different Windows Server 2008 (not R2) this was not necessary i.e. the application and user could access the share without providing another user name and password. I have tried giving the Everyone group full control over the shared folder - both on the Security tab and in the Permissions area under Advanced Sharing on the Sharing tab. This still did not resolve the issue. (I don't really want to give Everyone access anyway - I was hoping that granting access to a group that the VPN users had membership of would be enough). I have also turned off password protected sharing in the Advanced Sharing Settings area of the Network and Sharing Center (under both Home or Work and Public). So my question is what is preventing my VPN users from having access to these folders without having to re-supply the same login and password that they use to access the VPN? And what is the best practice in this type of scenario?

    Read the article

  • Install Python 2.6 on Debian Linux

    - by Bialecki
    I want to install Python 2.6, but as it's still experimental for Debian Linux, I'm wondering what my best course of action is. Is the right idea to install it into /usr/local for my system and then update the python sym link in /usr/bin to point to that version? Are there other considerations or ways to do it I should be thinking about?

    Read the article

  • Design pattern: polymorphisim for list of objects

    - by ziang
    Suppose I have a class A, and A1, A2 inherits from A. There are 2 functions: List<A1> getListA1(){...} List<A2> getListA2(){...} Now I want to do something similar to both A1 and A2 in another function public void process(List<A>){...} If I want to pass the instance of either ListA1 or ListA2, of course the types doesn't match because the compiler doesn't allow the coercion from List< A1 to List< A. I can't do something like this: List<A1> listA1 = getListA1(); List<A> newList = (List<A>)listA1; //this is not allowed. So what is the best approach to the process()? Is there any way to do it in a universal way rather than write the similar code to both List and List?

    Read the article

  • getting vbulletin captcha image with curl

    - by ermac2014
    hi I need to download Vbulletin captcha images on my HDD "from vbulletin register page" using curl and PHP. I really need to get samples of captcha images from several VBulletin boards. I'm collecting these samples for research purposes. anyway, here is what I done with curl till now. 1- download register.php page. 2- parse the downloaded page to get captcha image url. 3- download that image. now I have done step 1 and 2 correctly. but in step 3 when I try to download the captcha image I don't get the captcha. I just get either a very tiny blank gif picture. or I get a png picture with vbulletin word on it. I really don't know what i'm doing wrong. I tried to output the html and push it to the browser the image shows correctly. but thats not what I want. I want to download the image and save it on my HDD. here are some codes I've been working on: //get contents with curl function get_content($url) { $theString = parse_url($url); $cookieName = $theString['host']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url."register.php"); curl_setopt($ch, CURLOPT_REFERER, $url."register.php"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)'); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies/cookie.txt"); //saved cookies curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies/cookie.txt"); //saved cookies curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $string = curl_exec ($ch); //print_r(curl_getinfo($ch)); curl_close ($ch); return $string; } //vbulletin main page $url = 'http://blavbulletin.com/'; //get the page $results = get_content($url); if (preg_match_all('/<img[^>]*id\=\"imagereg\"[^>]*src\=\"([^\"]*)\"[^>]*>/s', $results , $captchaimages)) { $captcha = $captchaimages[1][0]; echo "<img src='$url"."$captcha'>"; //when echoed the pic shows correctly //now get the pic $file = get_content("$url"."$captcha"); //save the pic on HDD file_put_contents("captcha.jpg", $file); } any help would be appreciated.. regards,

    Read the article

  • Looking for suggestions to host CI server

    - by jess
    Hi, I am part of team with remote developers.For subversion,we are using online hosting service of a website.Now,we want to setup Hudson as CI for our project.Can you suggest me how can I go about it? Is there a site offering this service?,Or,should I take some windows hosting account and install?

    Read the article

  • Visual studio 2010 setup project problem.

    - by Guru
    Hi there, I've made an application that uses .NET framework 3.5 SP1 and SQL Server 2008 Express. Application is fine and now i'm going to to make a setup project for this. When I first build my setup it was fine as all the prerequisites were not included in setup. But I want my setup to install .NET 3.5 SP1 and SQL SERVER 2008 Express also. So for this I've changed the options in setup project's properties from "Download prerequisites from following location" to "Download prerequisites from the same location as my application". In addition to that I've also checked the options above like .NET 3.5 SP1 and SQL Server 2008 Express etc. After doing all this I build my project again. This time I'm Getting 57 Errors. Error 1 The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20\aspnet.msp' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information. D:\MindStrike Setup\MindStrike Setup.vdproj MindStrike Setup Error 2 The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20\aspnet_64.msp' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information. D:\MindStrike Setup\MindStrike Setup.vdproj MindStrike Setup Error 3 The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20\clr.msp' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information. D:\MindStrike Setup\MindStrike Setup.vdproj MindStrike Setup Error 4 The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20\clr_64.msp' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information. D:\MindStrike Setup\MindStrike Setup.vdproj MindStrike Setup As the question will become too large so I'm just pasting 3 errors but there are totally 57 errors. Please help me . Thanks in advance Guru

    Read the article

  • How can I import a text file into javascript from an external website using jquery $get()?

    - by Edward Tanguay
    When the button in the following script gets clicked, it should load in the contents of the file "http://tanguay.info/knowsite/data.txt" and display it on the screen. What is the correct syntaxt so that the .get() function retrieves the data from the external website and puts it in #content? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.3.2"); google.setOnLoadCallback(function() { $('#toggleButton').click(loadDataFromExernalWebsite); }); function loadDataFromExernalWebsite() { $('#content').html('new content'); //$.get("http://tanguay.info/knowsite/data.txt", function(data) { alert(data); }, ); } </script> </head> <body> <p>Click the button to load content:</p> <p id="content"></p> <input id="toggleButton" type="button" value="load content"/> </body> </html>

    Read the article

  • Regex to represent "NOT" in a group

    - by Joe Ijam
    I have this Regex; <(\d+)(\w+\s\d+\s\d+(?::\d+){2})\s([\w\/.-])(.) What I want to do is to return FALSE(Not matched) if the third group is "MSWinEventLog" and returning "matched" for the rest. <166Apr 28 10:46:34 AMC the remaining phrase <11Apr 28 10:46:34 MSWinEventLog the remaining phrase <170Apr 28 10:46:34 Avantail the remaining phrase <171Apr 28 10:46:34 Avantail the remaining phrase <172Apr 28 10:46:34 AMC the remaining phrase <173Apr 28 10:46:34 AMC the remaining phrase <174Apr 28 10:46:34 Avantail the remaining phrase <175Apr 28 10:46:34 AMC the remaining phrase <176Apr 28 10:46:34 AMC the remaining phrase <177Apr 28 10:46:34 Avantail the remaining phrase <178Apr 28 10:46:34 AMC the remaining phrase <179Apr 28 10:46:34 Avantail the remaining phrase <180Apr 28 10:46:34 Avantail the remaining phrase How to put " NOT 'MSWinEventLog' " in the regex group ([\w\/.-]*) ? Note : The second phrase above should return "not matched"

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >