Daily Archives

Articles indexed Tuesday June 1 2010

Page 6/125 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • A more effecient millisecond conversion method?

    - by cube
    I am currently using this method to convert milliseconds to min:sec:1/10sec. However it does not seem to be efficient at all. Would anyone know of a faster more efficient and optimized way of accomplishing the same. mills.prototype.formatTime = function(time) { var elapsedTime = (time * 1000); //Minutes var elapsedM = (elapsedTime/60000)|0; var remaining = elapsedTime - (elapsedM * 60000); //add a leading zero if it's a single digit number if (elapsedM < 10) { elapsedM = "0"+elapsedM; } //Seconds var elapsedS = ((remaining/1000)|0); remaining -= (elapsedS*1000); ////add leading zero if (elapsedS<10) { elapsedS = "0"+elapsedS; } //Hundredths var elapsedFractions = ((remaining/10)|0); if (elapsedFractions < 10) { elapsedFractions = "0"+elapsedFractions; } //display results nicely var time_data = elapsedM+":"+elapsedS+":"+elapsedFractions; //return time_data; return[time_data,elapsedM,elapsedS,elapsedFractions] };

    Read the article

  • Flash vs Javascript

    - by metal-gear-solid
    I always heard approx 5% users in the world keep JavaScript turned off. But Adobe claims Flash content reaches 99% of Internet viewers http://www.adobe.com/products/player_census/flashplayer/ Is it true even iphone, ipad and blackberry doesn't support Flash? if it's true then if same thing we can achieve with FLASH and JavaScript , then should we go for flash?

    Read the article

  • Effective Method to Manage and Search Through 100,000+ Objects Instantly? (C#)

    - by Kirk
    I'm writing a media player for enthusiasts with large collections (over 100,000 tracks) and one of my main goals is speed in search. I would like to allow the user to perform a Google-esque search of their entire music collection based on these factors: Song Path and File Name Items in ID3 Tag (Title, Artist, Album, etc.) Lyrics What is the best way for me to store this data and search through it? Currently I am storing each track in an object and iterating over an array of these objects checking each of their variables for string matches based on given search text. I've run into problems though where my search is not effective because it is always a phrase search and I'm not sure how to make it more fuzzy. Would an internal DB like SQLlite be faster than this? Any ideas on how I should structure this system? I also need playlist persistence, so that when they close the app and open the app their same playlist loads immediately. How should I store the playlist information so it can load quickly when the application starts? Currently I am JSON encoding the entire playlist, storing it in a text file, and reading it into the ListView at runtime, but it is getting sluggish over 20,000 tracks. Thanks!

    Read the article

  • Python/Sqlite program, write as browser app or desktop app?

    - by ChrisC
    I am in the planning stages of rewriting an Access db I wrote several years ago in a full fledged program. I have very slight experience coding, but not enough to call myself a programmer by far. I'll definitely be learning as I go, so I'd like to keep everything as simple as possible. I've decided on Python and SQLite for my program, but I need help on my next decision. Here is my situation 1) It'll be a desktop program, run locally on each machine, all Windows 2) I would really like a nice looking GUI with colors, nice screens, menus, lists, etc, 3) I'm thinking about using a browser interface because (a) from what I've read, browser apps can look really great, and (b) I understand there are lots of free tools to assist in setting up the GUI/GUI code with drag and drop tools, so that helps my "keep it simple" goal. 4) I want the program to be totally portable so it runs completely from one single folder on a user's PC, with no installation(s) needed for it to run (If I did it as a browser app, isn't there the possibility that a user's browser settings could affect or break the app. How likely is this?) For my situation, should I make it a desktop app or browser app?

    Read the article

  • Delay KeyUp Action if User is Typing (C#)

    - by Kirk
    I have a function that is being called when the user is typing in a search box. I want to wait for the user to finish typing before I actually execute the function. I know how to easily accomplish this in JavaScript with timeouts, but how would I go about doing the same thing in C#? Also, how long should I wait before I assume the user is done typing? 100ms?

    Read the article

  • Extracting Demographic and Contact Information from unstructured text files

    - by jn29098
    I am looking to extract specific items out of a large pool of unstructured documents. These documents could be 1-5 pages of text formatted in various ways by the user, but in most cases would contain at least: Name Address (physical) Email Address Phone number website URL I'm looking for a semantic parser that can attempt to extract these elements from the documents so that I can load that information into a relational database and work with these records as contacts. Other services I've looked for, while valuable for other purposes, do not address this specific need. Alchemy API Open Calais Saplo Any thoughts, suggestions or leads?

    Read the article

  • What are the drawbacks of using PHP to create variables in my CSS stylesheet?

    - by Greg
    One significant drawback of CSS is that one can't use variables. For example, I'd like to use variables to control the location of imported CSS, and it would be awesome to create variables for colors that are used repeatedly in a design. One approach is to use a PHP file for the CSS stylesheet. In other words, create a "style.php" with... <?php header("Content-type: text/css"); ?> ...at the top of the file, and then link to it using... <link href="style.php" rel="stylesheet" type="text/css" /> ...in any file that uses these styles. So what's the catch? I think it might be performance -- I did a few quick experiments in Firefox/Firebug and as one would expect, the CSS stylesheet is cached, but the PHP stylesheet isn't. So we're paying the price of an additional GET. The other annoying thing is that TextMate does not syntax highlight properly for CSS in a .php file. Are there other drawbacks? Have you used this approach, and if so, would you recommend it?

    Read the article

  • Paypal subscribe now button

    - by Bharadwaj
    Hi, I have built an information portal in PHP [Something like a recipe book], where the first few recipes are free to access. The advanced recipes are available only to paid members. I intend to use a simple subscribe now paypal button. When the user clicks on this button, he is directed to paypal website and upon payment redirected to my site. How do I collect the payment information from paypal? I do not want to use a wsdl. I need the information to update my user level field [0 for registered users, 1 for paid users] in the users table. Any pointers? Does IPN do the trick for this? Is there a better solution for this? Thanks, Bharadwaj

    Read the article

  • In C, as free() knows an array size, why isn't there a function that gets the array size? [closed]

    - by user354959
    Possible Duplicate: If free() knows the length of my array, why can’t I ask for it in my own code? Searching around (including here at stackoverflow), I got that malloc() allocates an array and also creates a header to control the array info. In this header, there's also the array size. free() use such information to know how to deallocate that array. So, if the array size info is "there" (somewhere in the memory), why there isn't a function that returns an array size, looking for this at the array header? Or am I missing something?

    Read the article

  • Positioning Photos in a Grid (HTML)

    - by Daniel O'Connor
    Hey Everyone, I've been trying to code this page for a while, but my biggest problem is that I can't seem to get the photos perfectly positioned. For some reason, there is a small bottom padding in each <td>which is messing things up. Here is the table code: <table> <tr> <td rowspan="2" style="height:353px;"><img src="danoconnor/img/photography/farm.jpg" height="353" width="470" alt="Farm" /></td> <td><img src="danoconnor/img/photography/paragliding.jpg" height="190" width="254" alt="Paraglider" /></td> <td rowspan="2"><img src="danoconnor/img/photography/cristo.jpg" height="353" width="230" alt="Cristo Redentor" /></td> </tr> <tr> <td><img src="danoconnor/img/photography/u2.jpg" height="154" width="254" alt="U2 at Fordham University" /></td> </tr> </table> My question is: how can I make the photogrid look like this? Thanks!

    Read the article

  • VB.net Color one part of text -- Listbox

    - by xzerox
    In VB.net is there anyway to make a certain part of the string to have a different color to make it stand out? This doesn't work but if I could something like this string = ("How".ForeColor(red) & "are".FontColor(green)) Would it be possible to make anything similar to this in a ListBox? If this is not possible is there a way to have it stand out more?

    Read the article

  • Whats a good tabbed FTP program? [closed]

    - by yegor
    Possible Duplicate: Best opensource FTP software? Im looking for a less outdated TABBED ftp program similar to WS_FTP that allows me to open several ftp connections on 1 side, and several local folders on the other. For Windows 7 (64bit) Can someone suggest something like this?

    Read the article

  • Serializing WPF RichTextBox to XAML vs RTF

    - by chaiguy
    I have a RichTextBox and need to serialize its content to my database purely for storage purposes. It would appear that I have a choice between serializing as XAML or as RTF, and am wondering if there are any advantages to serializing to XAML over RTF, which I would consider as more "standard". In particular, am I losing any capability by serializing to RTF instead of XAML? I understand XAML supports custom classes inside the FlowDocument, but I'm not currently using any custom classes (though the potential for extensibility might be enough reason to use XAML).

    Read the article

  • Suggestions for a Cron like scheduler in Python?

    - by jamesh
    I'm looking for a library in Python which will provide at and cron like functionality. I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I run on machines with no cron. For those unfamiliar with cron: you can schedule tasks based upon an expression like: 0 2 * * 7 /usr/bin/run-backup # run the backups at 0200 on Every Sunday 0 9-17/2 * * 1-5 /usr/bin/purge-temps # run the purge temps command, every 2 hours between 9am and 5pm on Mondays to Fridays. The cron time expression syntax is less important, but I would like to have something with this sort of flexibility. If there isn't something that does this for me out-the-box, any suggestions for the building blocks to make something like this would be gratefully received. Edit I'm not interested in launching processes, just "jobs" also written in Python - python functions. By necessity I think this would be a different thread, but not in a different process. To this end, I'm looking for the expressivity of the cron time expression, but in Python. Cron has been around for years, but I'm trying to be as portable as possible. I cannot rely on its presence.

    Read the article

  • Group keywords by site

    - by Skudd
    I am finding a lot of useful help here today, and I really appreciate it. This should be the last one for the day: I have a list of the top 10 keywords per site, sorted by visits, by date. The records need to be sorted as follows (excuse the formatting): 2010-05 2010-04 site1.com keyword1 apples wine keyword1 visits 100 12 keyword2 oranges water keyword2 visits 99 10 site2.com keyword1 blueberry cornbread keyword1 visits 90 100 keyword2 squares biscuits keyword2 visits 80 99 Basically what I need to accomplish involves grouping, but I can't seem to figure it out. Am I heading down the right path, or is there another way to achieve this, or is it just impossible?

    Read the article

  • Can I upgrade Xcode to support a newer version of GCC to learn C++0x?

    - by Shane
    I would like to jump in learn C++0x, which has matured to a level I'm happy with. Xcode on Snow Leopard 10.6 is currently at GCC 4.2.1, and the new features I'd like to try, like std::shared_ptr, lambdas, auto, null pointer constant, unicode string literals, and other bits and pieces, require at least 4.3 (I believe). Ideally I'd use Xcode but I'm not even sure if you can manually upgrade the compiler for Xcode. Is this possible? Otherwise, what is the best way to install a different version of GCC that doesn't interfere with the rest of the system? Regards, Shane

    Read the article

  • UIWebView frame resize does not resize the inner content...

    - by Markus Gömmel
    Hi, if I change the frame of a UIWebView (scalesPageToFit property is YES), what do I have to do that the zooming level of a currently displayed webpage persists? Let's say I have a UIWebView frame with a width of 200 pixels, and has zoomed into a website so that only one column is visible. After changing the width to 300, I still see the column with the same size, and additional space at the left and right. But what I would need is that I still only see this column, but bigger. Any ideas what I have to do to achive this? I tried a lot of things, but nothing worked so far. By the way, the iPhone built in Safari browser does exactly this thing (with the same website, so it's not content related) when rotating the iPhone... I see the same content, bug bigger, NOT more content as it happens with my current version of code. Thanks for helping! Markus

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >