Daily Archives

Articles indexed Wednesday April 21 2010

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

  • Fedora 12 XFCE mount permissions

    - by ibrahimovich
    I installed Fedora 12 with XFCE. When I run Gigolo to mount Windows partitions, I get an "Authentication is required" message. In Fedora 11 XFCE, there was a tool that changed the system permission to allow any user to mount any partition, but I can't find it in Fedora 12. How can I fix this problem and set all permissions needed?

    Read the article

  • What is the scope of require_once in PHP?

    - by TMG
    Simple question: Is the scope of require_once global? For example: <?PHP require_once('baz.php'); // do some stuff foo ($bar); function foo($bar) { require_once('baz.php'); // do different stuff } ?> When foo is called, does it re-parse baz.php? Or does it rely on the already required file from the main php file (analagous to calling require_once twice consecutively for the same include file)? I saw this thread before, but it didn't quite answer the question: http://stackoverflow.com/questions/1669707/should-require-once-some-file-php-appear-anywhere-but-the-top-of-the-file Thanks for your help!

    Read the article

  • PHP photo gallery with multiple upload form

    - by NightMICU
    Hi everyone, I am trying to develop a PHP driven gallery with a form that has at least four file upload boxes, each with its own title and caption. I have been using php.upload.class to process uploaded photos but not sure how I would go about handling each individual upload while preserving its details (title, caption). Is there a practical way to do this or should I instead upload just the photos and then have the user add titles and captions on the next page? Any help/suggestion would be greatly appreciated. Thanks!

    Read the article

  • Using Python and Mechanize with ASP Forms

    - by tchaymore
    I'm trying to submit a form on an .asp page but Mechanize does not recognize the name of the control. The form code is: <form id="form1" name="frmSearchQuick" method="post"> .... <input type="button" name="btSearchTop" value="SEARCH" class="buttonctl" onClick="uf_Browse('dledir_search_quick.asp');" > My code is as follows: br = mechanize.Browser() br.open(BASE_URL) br.select_form(name='frmSearchQuick') resp = br.click(name='btSearchTop') I've also tried the last line as: resp = br.submit(name='btSearchTop') The error I get is: raise ControlNotFoundError("no control matching "+description) ControlNotFoundError: no control matching name 'btSearchTop', kind 'clickable' If I print br I get this: IgnoreControl(btSearchTop=) But I don't see that anywhere in the HTML. Any advice on how to submit this form?

    Read the article

  • Performance surprise with "as" and nullable types

    - by Jon Skeet
    I'm just revising chapter 4 of C# in Depth which deals with nullable types, and I'm adding a section about using the "as" operator, which allows you to write: object o = ...; int? x = o as int?; if (x.HasValue) { ... // Use x.Value in here } I thought this was really neat, and that it could improve performance over the C# 1 equivalent, using "is" followed by a cast - after all, this way we only need to ask for dynamic type checking once, and then a simple value check. This appears not to be the case, however. I've included a sample test app below, which basically sums all the integers within an object array - but the array contains a lot of null references and string references as well as boxed integers. The benchmark measures the code you'd have to use in C# 1, the code using the "as" operator, and just for kicks a LINQ solution. To my astonishment, the C# 1 code is 20 times faster in this case - and even the LINQ code (which I'd have expected to be slower, given the iterators involved) beats the "as" code. Is the .NET implementation of isinst for nullable types just really slow? Is it the additional unbox.any that causes the problem? Is there another explanation for this? At the moment it feels like I'm going to have to include a warning against using this in performance sensitive situations... Results: Cast: 10000000 : 121 As: 10000000 : 2211 LINQ: 10000000 : 2143 Code: using System; using System.Diagnostics; using System.Linq; class Test { const int Size = 30000000; static void Main() { object[] values = new object[Size]; for (int i = 0; i < Size - 2; i += 3) { values[i] = null; values[i+1] = ""; values[i+2] = 1; } FindSumWithCast(values); FindSumWithAs(values); FindSumWithLinq(values); } static void FindSumWithCast(object[] values) { Stopwatch sw = Stopwatch.StartNew(); int sum = 0; foreach (object o in values) { if (o is int) { int x = (int) o; sum += x; } } sw.Stop(); Console.WriteLine("Cast: {0} : {1}", sum, (long) sw.ElapsedMilliseconds); } static void FindSumWithAs(object[] values) { Stopwatch sw = Stopwatch.StartNew(); int sum = 0; foreach (object o in values) { int? x = o as int?; if (x.HasValue) { sum += x.Value; } } sw.Stop(); Console.WriteLine("As: {0} : {1}", sum, (long) sw.ElapsedMilliseconds); } static void FindSumWithLinq(object[] values) { Stopwatch sw = Stopwatch.StartNew(); int sum = values.OfType<int>().Sum(); sw.Stop(); Console.WriteLine("LINQ: {0} : {1}", sum, (long) sw.ElapsedMilliseconds); } }

    Read the article

  • Google block my site

    - by Susanta Das
    Last some days Google blocked my site in fire fox web browser. I passed all the test, but site files have no virus and other effected things. Please help me to solve the problem.

    Read the article

  • Download Current WSJ.com Prime Rate

    - by Registered User
    I need to automatically download the current Wall Street Journal Prime Rate and load the data into my database. What is the best method for downloading this data automatically? I have come up with three possible solutions for doing this: Scrape a HTML web page from WSJ. Parse a RSS news feed from WSJ. Use some API that I haven't found from WSJ. Regarding solution 1, although I don't like solution 1 since it could easily break, it's the only one that I have worked out from end to end. It appears I can scrape this page with a WebRequest / WebResponse and read the text in this code: <tr> <td style="text-align:left" class="colhead">&nbsp;</td> <td class="colhead">Latest</td> <td class="colhead">Wk ago</td> <td class="colhead">High</td> <td class="colhead">Low</td> </tr> <tr> <td class="text">U.S.</td> <td style="font-weight:bold;" class="num">3.25</td> <td class="num">3.25</td> <td class="num">3.25</td> <td class="num" style="border-right:0px">3.25</td> </tr> Regarding solution 2, although I can implement a RSS reader solution, I don't see a way to reliably anticipate verbiage for changes in the Prime Rate. Therefore, I don't think this is as safe or reliable a way to get the data as solution 1. Regarding solution 3, I haven't found any published API's for checking money rates like the Prime Rate. If anyone knows of a web service or other API for checking money rates, then please let me know.

    Read the article

  • Website in right-to-left languages (Arabic, Hebrew)

    - by jack
    I currently developing a multi-language interface for a Django project. But when I started to work on Arabic and Hebrew languages, I noticed all pages messed up after dir="rtl" to html tag (according to instructions on http://www.w3.org/International/tutorials/bidi-xhtml/) Does that mean I need separate stylesheets for right-to-left languages?

    Read the article

  • Is this grammar SLR?

    - by Mike
    E - A | B A - a | c B - b | c My answer is no because it has a reduce/reduce conflict, can anyone else verify this? Also I gained my answer through constructing the transition diagram, is there a simpler way of finding this out? Thanks for the help! P.S Would a Recursive Descent be able to parse this?

    Read the article

  • How to resize WebView according to its content?

    - by Miraaj
    Hi all, I want to set simple html contents within a web view and then resize it according to its content. To set simple html contents within web view I used this code and it is working fine: [[myWebView mainFrame] loadHTMLString:webViewContents baseURL:baseURLFramed]; Right now, if content is more than its actual size then it appears in web view showing both vertical and horizontal scroller in it. I want to set some default width and manage height according to its content in a way so that neither horizontal nor vertical scroller appears. Can anyone suggest me some solution for it? Thanks, Miraaj

    Read the article

  • Kill a Perl system call after a timeout

    - by Fergal
    I've got a Perl script I'm using for running a file processing tool which is started using backticks. The problem is that occasionally the tool hangs and It needs to be killed in order for the rest of the files to be processed. Whats the best way best way to apply a timeout after which the parent script will kill the hung process? At the moment I'm using: foreach $file (@FILES) { $runResult = `mytool $file >> $file.log`; } But when mytool hangs after n seconds I'd like to be able to kill it and continue to the next file.

    Read the article

  • Concrete Types or Interfaces for return types?

    - by SDReyes
    Today I came to a fundamental paradox of the object programming style, concrete types or interfaces. Whats the better election for a method's return type: a concrete type or an interface? In most cases, I tend to use concrete types as the return type for methods. because I believe that an concrete type is more flexible for further use and exposes more functionality. The dark side of this: Coupling. The angelic one: A concrete type contains per-se the interface you would going to return initially, and extra functionality. What's your thumb's rule? Is there any programming principle for this? BONUS: This is an example of what I mean http://stackoverflow.com/questions/491375/readonlycollection-or-ienumerable-for-exposing-member-collections

    Read the article

  • Using libcurl to create a valid POST

    - by Haraldo
    static int get( const char * cURL, const char * cParam ) { CURL *handle; CURLcode result; std::string buffer; char errorBuffer[CURL_ERROR_SIZE]; //struct curl_slist *headers = NULL; //headers = curl_slist_append(headers, "Content-Type: Multipart/Related"); //headers = curl_slist_append(headers, "type: text/xml"); // Create our curl handle handle = curl_easy_init(); if( handle ) { curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errorBuffer); //curl_easy_setopt(handle, CURLOPT_HEADER, 0); //curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(handle, CURLOPT_POST, 1); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, cParam); curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, strlen(cParam)); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, Request::writer); curl_easy_setopt(handle, CURLOPT_WRITEDATA, &buffer); curl_easy_setopt(handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); curl_easy_setopt(handle, CURLOPT_URL, cURL); result = curl_easy_perform(handle); curl_easy_cleanup(handle); } if( result == CURLE_OK ) { return atoi( buffer.c_str() ); } return 0; } Hi there, first of all I'm having trouble debugging this in visual studio express 2008 so I'm unsure what buffer.c_str() might actually be returning but I am outputting 1 or 0 to the web page being posted to. Therefore I'm expecting the buffer to be one or the other, however I seem to only be returning 0 or equivalent. Does the code above look like it will return what I expect or should my variable types be different? The conversion using "atoi" may be an issue. Any thought would be much appreciated.

    Read the article

  • How do I restart a Windows XP upgrade?

    - by Jason
    Is there a registry tweek to tell Windows Setup to start over? It tries to continue where it left off after I reboot. I can get to the Recovery Console. I tried to go from SP2-SP3. It failed, and I couldn't get to Safe Mode. I put in the SP1 disk (I don't have an SP2 boot disk, just the upgrade package.) It ran a couple minutes then gave me the error "the signature for windows xp professional upgrade is invalid" error code 800b0100. I rebooted to Safe Mode. I get to Safe Mode then say "Window XP Setup can't run under Safe Mode" press ok to restart. I put the SP3 disk back in, trying to get the "repair" option I didn't ever see putting in the SP1 disk, and it tried to continue the SP1 install - on the 4th step, and then gave the same signature error above. I need to get it to start over, so I can get to the repair option, to go back to SP2 (or install SP1 then add SP2 to it). Is there a registry tweek to tell Windows Setup to start over?

    Read the article

  • Top Three Advantages of Using Link Building Services

    Link building services are an integral part of internet marketing strategies for any website. It is one of the top methods of directing quality web traffic. It can be done by anyone who knows anything about internet marketing however experts in the field are able to optimize the process which gives the best results in the shortest amount of time.

    Read the article

  • Top 6 Methods of Link Building

    Link building is single most important strategy for effective search engine optimization. With tons of websites being added to the World Wide Web everyday, it is very important to keep your website popular by creating high value back links. Beginners commit very obvious mistakes in their link building practices which can be easily avoided if one follows the recommendations.

    Read the article

  • The Know How Series - Understanding Search Engine Crawlers

    While most internet users use a lot of search engines, hardly a handful really know how a search engine works. If you are an online marketer or your business relies heavily on the internet it becomes a prerogative that you understand search engines and web crawlers. Search engines provide data at the flick of a button or at a single click.

    Read the article

  • Promote Your Website Using SEO

    Using websites to promote your business proves to be much more reliable and get more results than the familiar way of sending of printed materials to target clients. For better result, web and business owners need to learn the SEO technique to be successful.

    Read the article

  • Who in the software world do you admire the most?

    - by David McGraw
    In an effort to spark some discussion and to find interesting people that I didn't know about, is there anybody around the software industry that you really admire? Perhaps admire is the wrong choice of word, but I'm sure there is somebody out there that has impacted you in a minor way. What did you learn from this individual that defines what you try to achieve today?

    Read the article

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