Daily Archives

Articles indexed Friday June 4 2010

Page 6/8 | < Previous Page | 2 3 4 5 6 7 8  | Next Page >

  • A scheme for expiring downloaded content?

    - by Chad Johnson
    I am going to offer a web API service that allows users to download and "rent" content for a monthly subscription fee. The API will either be open to everyone or possibly just select parties (not sure yet). Each developer must agree to a license, and they receive a developer key for their person. Each software application will have its own key as well. So then end-users will download the software which will interact with my service's API. Each user will have a key for each application as well (probably using OAuth). Content will be cached on first download and accessible offline via just the third-party application that cached the content. If a user cancels their subscription, I plan on doing the following: Deactivate the user's OAuth key for all applications. Do not allow the user's account to download new content via the API (and subsequently any software that uses the API). Now, the big question is: how do I make content expire if they cancel their subscription? If they cancel, they should not have access to content anymore. Here are ideas I've thought of (some of these are half-solutions, not yet fully fleshed out): Require that applications encrypt downloaded content using the user's OAuth key, making it available to only the application. This will prevent most users from going to the cache directory and just copying and keeping files. Update the user's key once a month, forcing content to re-cache on a monthly basic. Users could then access content for a month after they cancel their subscription. Require applications to "phone home" [to the service] periodically and check whether the user's subscription has terminated. If so, require in the API developer license that applications expire cache. If it is found that applications do not comply, their keys (and possibly keys for all developers) are permanently deactivated as a consequence. One major worry is that some applications may blatantly ignore constraints of the license. Is it generally acceptable to rely on applications abiding by the licensing constraints? Bad idea? Any other ideas? Maybe a way to make content auto-expire after x days? Something else? I'm open to out-of-the-box ideas.

    Read the article

  • NSXMLParser and Geonames

    - by Xcoder
    I'm trying to parse a call from Geonames with NSXMLParser in the iPhone SDK. I've used this before but for some reason I'm getting an empty dictionary back even though I get results back in a web browser. Can someone please point out what I may be doing wrong. Below is the code I'm using and the results that comes back pasting it in a browser. Thanks in advance #pragma mark - #pragma mark - Parcer Services -(void)beginLoadingFeed{ //[self startLoadingWithMessage:@"Loading Results...."]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(loadFeed) object:nil]; [operationQueue addOperation:operation]; [operation release]; } - (void)loadFeed{ NSString *path = [NSString stringWithFormat:@"http://ws.geonames.org/postalCodeSearch?placename=%@&long&maxRows=20",self.location]; [Logger log:@"Geonames Query: %@",path]; [self parseXMLFileAtURL:path]; [self performSelectorOnMainThread:@selector(didfinishedLoadingFeed) withObject:nil waitUntilDone:YES]; } -(void)didfinishedLoadingFeed{ } - (void)parserDidStartDocument:(NSXMLParser *)parser{ [Logger log:@"found file and started parsing"]; } //Called when the parser runs into an open tag (<tag>) - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { if ([elementName isEqualToString:@"code"]) { currentResult = [NSMutableDictionary dictionary]; } else { currentElement = [elementName copy]; } } //This is just to resolve random HTML entities - (NSData *)parser:(NSXMLParser *)parser resolveExternalEntityName:(NSString *)entityName systemID:(NSString *)systemID { return [entityName dataUsingEncoding:NSASCIIStringEncoding]; } - (void)parseXMLFileAtURL:(NSString *)URL{ self.results = [[[NSMutableArray alloc] init] autorelease]; NSURL *xmlURL = [NSURL URLWithString:URL]; NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL]; [parser setDelegate:self]; [parser parse]; [parser autorelease]; } - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError { NSString * errorString = [NSString stringWithFormat:@"Unable to connect to web site (Error code %i )", [parseError code]]; [Logger log:@"error parsing : %@", errorString]; [self stopLoadingView]; [self showMessage:@"Error loading content" withTitle:@"Error Loading"]; } /*** Called when the parser runs into a close tag (</tag>). If it is the Result tag that is closing, we should add the currentResult to the array, and then forget about it ***/ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if ([elementName isEqualToString:@"code"]) { [self.results addObject:currentResult]; currentResult = nil; } } - (void)parserDidEndDocument:(NSXMLParser *)parser { [Logger log:@"all done!"]; [Logger log:@"results array has %d items", [self.results count]]; [Logger log:@"Results:%@",results]; [theTableView reloadData]; [self stopLoadingView]; } Below is the result that comes back in a browser using the same call above when doing the search for the term "boston": <?xml version="1.0" encoding="UTF-8" standalone="no"?> <geonames> <totalResultsCount>2808</totalResultsCount> <code> <postalcode>02101</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.370567</lat> <lng>-71.026964</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02108</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.357603</lat> <lng>-71.068432</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02109</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.360027</lat> <lng>-71.054495</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02110</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.357636</lat> <lng>-71.051417</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02111</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.350348</lat> <lng>-71.0629</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02114</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.361111</lat> <lng>-71.06823</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02115</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.342706</lat> <lng>-71.092215</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02116</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.349201</lat> <lng>-71.076798</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02118</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.336162</lat> <lng>-71.072854</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02128</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.364197</lat> <lng>-71.025694</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02199</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.347873</lat> <lng>-71.082543</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02210</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.348921</lat> <lng>-71.046511</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02215</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.347088</lat> <lng>-71.102689</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>22713</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>38.538241</lat> <lng>-78.142285</lng> <adminCode1>VA</adminCode1> <adminName1>Virginia</adminName1> <adminCode2>047</adminCode2> <adminName2>Culpeper</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>24592</postalcode> <name>South Boston</name> <countryCode>US</countryCode> <lat>36.696335</lat> <lng>-78.918829</lng> <adminCode1>VA</adminCode1> <adminName1>Virginia</adminName1> <adminCode2>083</adminCode2> <adminName2>Halifax</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02102</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.338947</lat> <lng>-70.919635</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02103</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.338947</lat> <lng>-70.919635</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02104</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.338947</lat> <lng>-70.919635</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02105</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.338947</lat> <lng>-70.919635</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> <code> <postalcode>02106</postalcode> <name>Boston</name> <countryCode>US</countryCode> <lat>42.354318</lat> <lng>-71.073449</lng> <adminCode1>MA</adminCode1> <adminName1>Massachusetts</adminName1> <adminCode2>025</adminCode2> <adminName2>Suffolk</adminName2> <adminCode3/> <adminName3/> </code> </geonames>

    Read the article

  • Database and logic layer for ASP.NET MVC application

    - by Ismail
    I'm going to start a new project which is going to be small initially but may grow to big over the years. I'm strongly convinced that I'm going to use ASP.NET MVC with jQuery for UI. I want to go for MySQL as database for some reasons but worried on few things. I've a good years of experience working on SQL Server databases and on one project I've had a bad experience creating and managing stored procedures on MySQL database. I'm totally new to Linq but I see that it is easier to use once you are familiar with it. First thing is that accessing data should be easy. So I thought I should use MySQL to Linq but somewhere I read that it is not directly supported but MySQL .NET connector adds support for EntityFramework. I don't know what are the pros and cons of it. I would love if I can implement repository pattern as it allows to apply filter in logic layer rather than in data access layer. Will it be possible if I use Entity Framework? I'm not clear on how I should go about all this or I should just forget every thing and directly use SQL to Linq on SQL Server. I'm also concerned about the performance. Someone told me that if we use Entity framework it fetches lot of data and then filter it. Is that right? So questions basically are - Is MySQL to Linq possible? If yes where can I get more details on it? Pros and cons of using EntityFramework with MySQL? Will it be easy to access data using EntityFramework with MySQL? Will I be able to implement repository patter which allows applying filter in logic layer rather than data access layer (when I use EntityFramework with MySQL) Does it fetches hell lot of data from database and then apply filter on it? If it sounds too many questions from my side in that case, if you can just let me know what you will do (with a considerable reason) in this situation as an experienced person in this area, that should answer my question.

    Read the article

  • Tracing\profiling instructions

    - by LeChuck2k
    Hi Y'all. I'd like to statistically profile my C code at the instruction level. I need to know how many additions, multiplications, devides, etc,... I'm performing. This is not your usual run of the mill code profiling requirement. I'm an algorithm developer and I want to estimate the cost of converting my code to hardware implementations. For this, I'm being asked the instruction call breakdown during run-time (parsing the compiled assembly isn't sufficient as it doesn't consider loops in the code). After looking around, It seems VMWare may offer a possible solution, but I still couldn't find the specific feature that will allow me to trace the instruction call stream of my process. Are you aware of any profiling tools which enable this?

    Read the article

  • iPhone SDK Question with Audio/Mic

    - by Henry D'Andrea
    I am trying to do an app, to where when it launches, it will detect audio, and then play it back automatically. NO BUTTONS, nothing to press. Just a picture of something then, it listens for audio, then plays it back. Similar to the Talking Carl app in the App Store. Any ideas/help? Would appreciate it, if i could use the code with IB.

    Read the article

  • Connecting sqlite database

    - by user358171
    Ive seen tutorials after tutorials but i still dont get how to connect a database to my xcode.. i already put it in my reference, put the sqlite framework but still it doesnt work.. i even tried copying the whole code the tutorial offers but still my iphone simulator turns up blank.. can you please help me understand why?

    Read the article

  • Testing Silverlight install detection

    - by Pat Long - Munkii Yebee
    I have implemented a silverlight install process inline with the best practive approach described in Microsoft's "Installation Experience White Paper - Apr 2009". I want to test out the following user scenarios Old version of Silverlight No Silverlight Cross browser In the past I have seen tools for uninstalling and installing different versions of Flash for this same type of testing. Is there anything like that for Silverlight? I know I can disable the plug ins but that is not the same IMHO TIA Pat

    Read the article

  • Open PDF Content files in ASP.NET MVC 2

    - by mcbingo
    I want to provide simple href links to my PDF forms that reside in my Forms folder. I have a created a simple Index.aspx and FormController Index action that simple iterates through the list of PDF files using my FormMetaData.xml file. The links get created just fine but when you click on the links I get a 404 exception. That looks like this: Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /Forms/ccindteamgolfform.pdf Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 This seems like this should open up a new browser window with the PDF in it but perhaps I am making a bad assumption. The PDF content files have Build Action of Content and Copy to Output set to Copy Always. Here is an example output html for the link from my Index.aspx page: <span class="form"> <a href="Forms/ccindteamgolfform.pdf" target="_blank"> <span class="description">Entry Form</span></span> I must be missing something because this does not work. Do I need to add a MapRoute for these documents? Or am I missing something else with the routing? This seems like it should not be that difficult.

    Read the article

  • Search for -1 in Solr

    - by Znarkus
    Hi! I have an optional property of type pfloat, that can either be an encoded numeric value, or -1 if the property is not set. Numerics are encoded to be range searchable (1 is encoded to something like 10000000001), but -1 will always be -1. How can I search a field for -1? property:-1 throws parse error and property:'-1' doesn't return anything. Thanks for help!

    Read the article

  • pyplot: really slow creating heatmaps

    - by cvondrick
    I have a loop that executes the body about 200 times. In each loop iteration, it does a sophisticated calculation, and then as debugging, I wish to produce a heatmap of a NxM matrix. But, generating this heatmap is unbearably slow and significantly slow downs an already slow algorithm. My code is along the lines: import numpy import matplotlib.pyplot as plt for i in range(200): matrix = complex_calculation() plt.set_cmap("gray") plt.imshow(matrix) plt.savefig("frame{0}.png".format(i)) The matrix, from numpy, is not huge --- 300 x 600 of doubles. Even if I do not save the figure and instead update an on-screen plot, it's even slower. Surely I must be abusing pyplot. (Matlab can do this, no problem.) How do I speed this up?

    Read the article

  • Maintaining integrity of Core Data Entities with many incoming one-to-many relationships

    - by Henry Cooke
    Hi all. I have a Core Data store which contains a number of MediaItem entities that describe, well, media items. I also have NewsItems, which have one-to-many relationships to a number of MediaItems. So far so good. However, I also have PlayerItems and GalleryItems which also have one-to-many relationships to MediaItems. So MediaItems are shared across entities. Given that many entities may have one-to-many relationships, how can I set up reciprocal relationships from a MediaItem to all (1 or more) of the entities which have relationships to it and, furthermore, how can I implement rules to delete MediaItems when the number of those reciprocal relationships drops to 0?

    Read the article

  • Flex MVC Frameworks

    - by Rydell
    I'm currently using and enjoying using the Flex MVC framework PureMVC. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz. Has anyone tried two or three of these frameworks and formed an opinion? Thanks!

    Read the article

  • Tabcontainer in Master Page not working as expected

    - by henrico
    Isn't TABCONTAINER supposed to be used in a MASTERPAGE? I started building my application in a single .aspx page with a tabcontainer to separate the different features in the application. My idea was to later break it up into individual pages with less code in each of them. I thought the use of a masterpage would be the perfect solutions... of course, this didn't work as expected. The problem is that all tabs, except the one related to the page loaded, for example tab1.aspx, are empty. If tab2.aspx is loaded, only tab2 is filled and so on. Is this a known bug or by design?

    Read the article

  • How to find an array from parent array

    - by Me-and-Coding
    Hi, I am using below code to find an array inside parent array but it is not working that is retuning empty even though the specified key exits in the parent array. $cards_parent = $feedData['BetradarLivescoreData']['Sport']['Category']['Tournament']['Match']; $cards = array(); foreach($cards_parent as $key => $card) { if ($key === 'Cards') { $cards[] = $cards_parent[$key]; break; } } Do you know any array function that will search parent array for specified key and if found it will create an array starting from that key. Thanks

    Read the article

  • where to put .properties files in an Eclipse project?

    - by Jason S
    I have a very simple properties file test I am trying to get working: (the following is TestProperties.java) package com.example.test; import java.util.ResourceBundle; public class TestProperties { public static void main(String[] args) { ResourceBundle myResources = ResourceBundle.getBundle("TestProperties"); for (String s : myResources.keySet()) { System.out.println(s); } } } and TestProperties.properties in the same directory: something=this is something something.else=this is something else which I have also saved as TestProperties_en_US.properties When I run TestProperties.java from Eclipse, it can't find the properties file: java.util.MissingResourceException: Can't find bundle for base name TestProperties, locale en_US Am I doing something wrong?

    Read the article

  • Garbage collection in Perl

    - by srikfreak
    Unlike Java, Perl uses reference count for garbage collection. I have tried searching some previous questions which speak about C++ RAII and smart pointers and Java GC but have not understood how Perl deals with the circular referencing problem. Can anyone explain how Perl's garbage collector deals with circular references? Is there any way to reclaim circular referenced memory which are no longer used by the program or does Perl just ignores this problem altogether?

    Read the article

  • .change(function) can control two command

    - by klox
    dear all..i've a textfield, it using barcode scanner for input data..after scan it shows KD-R411ED 105X0001... I'm successful separate them into two text field use ".change(function)" $("#tags1").change(function() { var barcode; barCode=$("#tags1").val(); var data=barCode.split(" "); $("#tags1").val(data[0]); $("#tags2").val(data[1]); }); what i want is beside make them separate after ".change(function)" another script can read two character behind "KD-R411ED"..that is "ED"..this character can make a radiobutton which id="check1" are checked.. what's code which can combine with code above? this my complete code.. $("#tags1").change(function() { var barcode; barCode=$("#tags1").val(); var data=barCode.split(" "); $("#tags1").val(data[0]); $("#tags2").val(data[1]); var code = data[0].substr(data[0].length - 2); // suggested by Jan Willem B if (code =='UD') $('#check1').attr('checked','checked'); } else { if (code == 'ED') { $('#check2').attr('checked','checked'); } } and this the form <input id="check1" type="radio" class="check" name="check" onclick="addtext()" value="U" />U <input id="check2" type="radio" class="check" name="check" onclick="addtext_1()" value="E" />E the radiobutton still not response

    Read the article

  • Searching NSString in XML database, Iphone

    - by user358170
    My project is like a classifieds kind of stuff.. I have a search text box in the first page. When the user enters some text in that, i need to compare that text to the XML file from where all the data are being recieved, and should list out all the advertisements in the Table View (next page).. I had did this kind of search in sql database..but not with XML.. Just need some help..

    Read the article

< Previous Page | 2 3 4 5 6 7 8  | Next Page >