Daily Archives

Articles indexed Wednesday April 28 2010

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

  • Generate combinations by order and fixed length.

    - by roconmachine
    Suppose there is array main[] = [a,b,c,....z]; a[] = [a1,a2,a3,....] , b[] = [b1,b2,b3,....] and so on. So if we generate combination in main.length of ordered then it looks like ..... a1 b1 c1, a1 b1 c2, a1 b1 c3 ...... a1 b2 c1, a1 b3 c1, ..... a2 b1 c1, a3 b1 c1, ..... and total count will be a.length * b.length * c.length ........ = ? So write a code in any language to generate those combination. all the best. alex

    Read the article

  • How to write a simple usb driver?

    - by ScReYm0
    I make this treat because you are closing my other before i get my answer. Here is my answer clear and exactly what i want to do! I wanna create a usb driver, so my own C application be able to get into my flash drive and take information from the imported flash drive. OS: Windows Please don't close it again I still cant find my answer... more details I start my app/which contains my USB driver/ i plug-in my flash and its shows in Explorer that this drive is plugged and it is accessible, while that's happening, my app is checking that file data.txt EXIST if that file exist, program run next function, if not program, my program runs down/exit/! I hope that this helps understanding my idea...

    Read the article

  • touchesEnded not being called??? or randomly being called

    - by Rob
    If I lift my finger up off the first touch, then it will recognize the next touch just fine. It's only when I hold my first touch down continuously and then try and touch a different area with a different finger at the same time. It will then incorrectly register that second touch as being from the first touch again. Update It has something to do with touchesEnded not being called until the very LAST touch has ended (it doesn't care if you already had 5 other touches end before you finally let go of the last one... it calls them all to end once the very last touch ends) - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch* touch = [touches anyObject]; NSString* filename = [listOfStuff objectAtIndex:[touch view].tag]; // do something with the filename now } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { ITouch* touch = [touches anyObject]; NSString* buttonPressed = [listOfStuff objectAtIndex:[touch view].tag]; // do something with this info now }

    Read the article

  • show UIAlertView when In app purchase is in progress

    - by edie
    Hi... I've added an UIAlertView that has UIActivityIndicatior as a subview on my application. This alertView only show when the purchase is in progress. I've put my alert view in this way in my StoreObserver: - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { switch (transaction.transactionState) { case SKPaymentTransactionStatePurchasing: [self stillPurchasing]; // this creates an alertView and shows break; case SKPaymentTransactionStatePurchased: [self completeTransaction:transaction]; break; case SKPaymentTransactionStateFailed: [self failedTransaction:transaction]; break; case SKPaymentTransactionStateRestored: [self restoreTransaction:transaction]; break; default: break; } } } - (void) stillPurchasing { UIAlertView *alert = [[UIAlertView alloc]initWithTitle: @"In App Purchase" message: @"Processing your purchase..." delegate: nil cancelButtonTitle: nil otherButtonTitles: nil]; self.alertView = alert; [alert release]; UIActivityIndicatorView *ind = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhiteLarge]; self.indicator = ind; [ind release]; [self.indicator startAnimating]; [self.alertView addSubview: self.indicator]; [self.alertView show]; } When I tap my the buy button this UIAlertView shows together with my UIActivityIndicator.. But when the transaction completes the alertView still on the top of the view and the Indicator was the only one that was removed. My question was how should I release the alertView? Or where/When should I release it. I've added these command to release my alertView and Indicator on these cases: case SKPaymentTransactionStatePurchased: case SKPaymentTransactionStateFailed: case SKPaymentTransactionStateRestored: [self.indicator stopAnimating]; [self.indicator removeFromSuperview]; [self.alertView release]; [self.indicator release]; I've only added the alertView to show that the purchasing was still in progress. Any suggestion to create any feedback to users will be thankful for me.. Thanks

    Read the article

  • How do I authenticate a Twitter user and access the API without leaving my iPhone app?

    - by thebossman
    I'd like to allow users to send out Tweets from my iPhone app. That's all the functionality I need at the moment. From what I know of the Twitter API, there's a standard authentication mechanism, which allows the developer to include the user's name and password in the request string that the application sends to Twitter. This method will no longer be supported come June 30, 2010. Given the timeframe, the better other choice is oAuth. One of the caveats of oAuth is that it requires a UIWebView to pop up within the app to allow the user to enter his or her credentials or a PIN number. None of the Twitter apps on my phone do this, however: Tweetie, TweetDeck and Twitterific. I assume they're using the first authentication method, but it seems like Twitter wouldn't deprecate an API that would hurt the user experience across the board. There must be an alternative method--what am I missing?

    Read the article

  • Updating Checked Checkboxes using CodeIgniter + MySQL

    - by Tim
    Hello I have about 8 check boxes that are being generated dynamically from my database. This is the code in my controller //Start Get Processes Query $this->db->select('*'); $this->db->from('projects_processes'); $this->db->where('process_enabled', '1'); $data['getprocesses'] = $this->db->get(); //End Get Processes Query //Start Get Checked Processes Query $this->db->select('*'); $this->db->from('projects_processes_reg'); $this->db->where('project_id', $project_id); $data['getchecked'] = $this->db->get(); //End Get Processes Query This is the code in my view. <?php if($getprocesses->result_array()) { ?> <?php foreach($getprocesses->result_array() as $getprocessrow): ?> <tr> <td><input <?php if($getchecked->result_array()) { foreach($getchecked->result_array() as $getcheckedrow): if($getprocessrow['process_id'] == $getcheckedrow['process_id']) { echo 'checked'; } endforeach; }?> type="checkbox" name="progresscheck[]" value="<?php echo $getprocessrow['process_id']; ?>"><?php echo $getprocessrow['process_name']; ?><br> </td> </tr> <?php endforeach; ?> This generates the checkboxes into the form and also checks the appropriate ones as specified by the database. The problem is updating them. What I have been doing so far is simply deleting all checkbox entries for the project and then re-inserting all the values into the database. This is bad because 1. It's slow and horrible. 2. I lose all my meta data of when the check boxes were checked. So I guess my question is, how do I update only the checkboxes that have been changed? Thanks, Tim

    Read the article

  • .htaccess - proxy AND browser caching???

    - by StackOverflowNewbie
    In .htaccess, how do I specify a file type to be cached via browser and proxy? Cache-control for needs to be "private" for browser, "public" for proxy. However, I can't define Cache-Control to be private AND public for same file type. It seems like I have to choose between browser or proxy caching. Suggestions?

    Read the article

  • jQuery - How to combine has() and gt()

    - by KatieK
    With jQuery 1.4.2, I can't figure out how to combine has() with :gt. I'd like to select any ul which contains more than 3 lis, so here's what I've tried: $(document).ready(function(){ $("ul.collapse:has(li:gt(2))") .each( function() { $(this).css("border", "solid red 1px"); }); }); This does work with the 1.2.6 jQuery library, but not 1.3.2 or 1.4.2. I'd appreciate any help in understanding what's going on here. Thanks!

    Read the article

  • Memcached extension for PHP on Windows Server

    Hello, my configuration: Windows 2008 IIS 7 PHP 5.2.10 / FastCGI Memcache as a Windows Service I tried to use the php_memcache extension for PHP but it doesn't load. This extension comes with PECL 5.2.6 Any idea? Do you know if exist a php_memcache"d" extension for PHP on Windows? BR Santiago

    Read the article

  • adding custom fields dynamically to a model

    - by pankajbhageria
    I have a model called List which has many records: class List has_many :records end class Record end The table Record has 2 permanent fields: name, email. Besides these 2 fields, for each List a Record can have 'n' custom fields. For example: for list1 I add address(text), dob(date) as custom fields. Then while adding records to list one, each record can have values for address and dob. Is there any ActiveRecord plugin which provides this type of functionality? Or else could you share your thoughts on how to model this? Thanks in advance, Pankaj

    Read the article

  • Rails regex to extract Twitpic link/code if present

    - by Rabbott
    Provided a url, within a string of text (tweet) such as "Check out my twitpic http://twitpic.com/1876544594 its awesome" I need a Rails regex that will return 18744594, the id of this particular twitpic... This question has been asked here but was for PHP, and I need it for Rails. I would also be able to pull the name of the site, so the text between http:// and .com "twitpic"

    Read the article

  • Bypassing Firefox Antiphishing support

    - by netprotector
    Hi, I would like to bypass firefox anti-phishing support programatically. Not by disabling its safebrowsing option either manually or programmatically. Actually, when firefox loads a document, it makes a call to google to determine whether the requested site is phish or not. If I get when this happens, I can bypass it. Meaning that I would not allow firefox to show its error page. Can anyone show me the way? -Abhay

    Read the article

  • Interview Q: sorting an almost sorted array (elements misplaced by no more than k)

    - by polygenelubricants
    I was asked this interview question recently: You're given an array that is almost sorted, in that each of the N elements may be misplaced by no more than k positions from the correct sorted order. Find a space-and-time efficient algorithm to sort the array. I have an O(N log k) solution as follows. Let's denote arr[0..n) to mean the elements of the array from index 0 (inclusive) to N (exclusive). Sort arr[0..2k) Now we know that arr[0..k) are in their final sorted positions... ...but arr[k..2k) may still be misplaced by k! Sort arr[k..3k) Now we know that arr[k..2k) are in their final sorted positions... ...but arr[2k..3k) may still be misplaced by k Sort arr[2k..4k) .... Until you sort arr[ik..N), then you're done! This final step may be cheaper than the other steps when you have less than 2k elements left In each step, you sort at most 2k elements in O(k log k), putting at least k elements in their final sorted positions at the end of each step. There are O(N/k) steps, so the overall complexity is O(N log k). My questions are: Is O(N log k) optimal? Can this be improved upon? Can you do this without (partially) re-sorting the same elements?

    Read the article

  • Deploying only changed part of a website with git to ftp (svn2web for git)

    - by Elazar Leibovich
    I'm having a website with many big images file. The source (as well as the images) is maintained with git. I wish to deploy that via ftp to a bluehost-like cheap server. I do not wish to deploy all the website each time (so that I won't have to upload too many unchanged files over and over), but to do roughly the following: In a git repository, mark the last deployed revision with a tag "deployed". When I say "deploy revision X", find out which files has changed between revision X and revision tagged as deploy, and upload just them. It is similar in spirit to svn2web. But I want that for DVCS. Mercurial alternative will be considered. It's a pretty simple script to write, but I'd rather not to reinvent the wheel if there's some similar script on the web. Capistrano and fab seems to know only how to push the whole revision, in their SCM integration. So I don't think I can currently use them.

    Read the article

  • Creating a Transparent Bitmap with GDI?

    - by user146780
    I want to implement a layering system in my application and was thinking of creating a bunch of transparent bitmaps, adding content to them then blitting them on top of each other, how can this be done without setting each pixel to (0,0,0,0). I'm using Pure win32, not MFC, thanks.

    Read the article

  • getJSON not working if the mvc model view controller has a parameter

    - by Paul
    I'm having an issue with a callback. I'm not even getting an error in Firebug. If I alert before and after the getjson call both alerts show but the getjson call doesn't fire. public ActionResult TestPage() { return View(); } public ActionResult LoadMapLonLats(int mapId) { //some code return Json(_myMaps); } $("#Search").click(function() { $.getJSON("LoadMapLonLats", { mapId: 73 }, loadDbMap); }); function loadDbMap(maps) { alert('m'); $.each(maps, function(i) { alert(maps[i]); }); } As long as I leave TestPage without a parameter is works. If I add a parameter to TestPage(int id) then the call back to LoadMapLonLats doesn't work. Seems odd. Of course TestPage is the page I'm loading so I need to do some work here before rendering the page. Not sure why adding a parameter to the view would break the callback to another function. //this breaks he callback to LoadMapLonLats public ActionResult TestPage(int id) { return View(); } Any ideas? Seems like this may be related, if not sorry I can post a new thread.

    Read the article

  • Software Metrics in Agile Methodologies

    - by geowa4
    Agile methodologies are rather prevalent these days, but I cannot seem to find much documentation on what metrics are most useful and why. I have found many more things saying that some traditional metrics like LOC and code coverage of tests are not appropriate, leaving two main questions: Why are those two (and other) metrics inappropriate? What metrics are best for Agile and why? Even with an Agile process, wouldn't you want to know how much code coverage you have with your unit tests? Or is it simply that this metric (and others) just are not as useful as other metrics like cyclomatic complexity and velocity?

    Read the article

  • How to show progressbar in win32 application?please help me!

    - by kiddo
    Hi all,I am trying to display a progress bar with some informations in it,say for example am reading files ..I want to display the progress bar progressing with the filename that is being read etc..I am doing this in an win 32 application.I know that we should do it using thread but am not quite familiar with that,check the below picture example,thats what i need it exactly.

    Read the article

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