Search Results

Search found 58 results on 3 pages for 'niklas r'.

Page 3/3 | < Previous Page | 1 2 3 

  • Fastest way to clamp a real (fixed/floating point) value?

    - by Niklas
    Hi, Is there a more efficient way to clamp real numbers than using if statements or ternary operators? I want to do this both for doubles and for a 32-bit fixpoint implementation (16.16). I'm not asking for code that can handle both cases; they will be handled in separate functions. Obviously, I can do something like: double clampedA; double a = calculate(); clampedA = a > MY_MAX ? MY_MAX : a; clampedA = a < MY_MIN ? MY_MIN : a; or double a = calculate(); double clampedA = a; if(clampedA > MY_MAX) clampedA = MY_MAX; else if(clampedA < MY_MIN) clampedA = MY_MIN; The fixpoint version would use functions/macros for comparisons. This is done in a performance-critical part of the code, so I'm looking for an as efficient way to do it as possible (which I suspect would involve bit-manipulation) EDIT: It has to be standard/portable C, platform-specific functionality is not of any interest here. Also, MY_MIN and MY_MAX are the same type as the value I want clamped (doubles in the examples above).

    Read the article

  • Are there any standard one-click install/lauch mechanisms for the web?

    - by Niklas Bäckman
    The reason I ask is mostly due to how Google Chrome installation works once you click the "Accept and install" button from Firefox. After you click the installation is started directly and when it's completed Chrome itself starts up. Firefox does not show any "Save" or "Confirm" dialogs after you click the Install button (on Chrome install web page). Now, is this standard behaviour? Or might it be due to having an old version of Chrome already on the computer (Note: The new version was still installed from Firefox). Seems a bit risky to me, all you have to do is fool the user to click something and then you can do whatever you want on his machine, or? Personally I thought things like this only worked with IE/ActiveX.

    Read the article

  • Compare two object lists with LINQ on specific property

    - by Niklas
    I have these two lists (where the Value in a SelectListItem is a bookingid): List<SelectListItem> selectedbookings; List<Booking> availableBookings; I need to find the ids from selectedBookings that are not in availableBookings. The LINQ join below will only get me the bookingids that are in availableBookings, and I'm not sure how to do it the other way around. != won't work since I'm comparing strings. results = ( from s in selectedbookings join a in availableBookings on s.bookingID.ToString() equals a.Value select s);

    Read the article

  • Disable autocreation of Birthday events for Contacts in Outlook 2010

    - by niklasfi
    Hello, does anyone know how to disable the creation of birthday events in Outlook 2010? Here is my setup and what causes the problem: I have 2 computers and one mobile which all sync through a googlemail account. But after also synching the contacts, each Outlook instance creates a birthday event for that contact. So I end up with 2 Birthday reminders. Is it possible to tell one of the PCs to not enter birthdays into the calendar? Greetings Niklas

    Read the article

  • Solr PHP client vs file_get_contents?

    - by noname
    I am using PHP to access Solr and I wonder one thing. Why should I use Solr PHP client when I can use: $serializedResult = file_get_contents( 'http://localhost:8983/solr/select?q=niklas&wt=phps'); to get the result in arrays and then print them out? I don't really get the difference. Are there any richer features with the PHP client?

    Read the article

  • Why is MediaWiki auto-linking the word “files”

    - by dfrankow
    Our MediaWiki installation is auto-linking the word "files". So Here are some files: a, b, c would result in the word "files" being linked to http://ourhost/mediawiki/files. Why is that happening and how do I make it stop? I can use the nowiki tag, but perhaps it does not surprise you that the word "files" appears often, and it is aggravating to use that tag all the time. Here is some info on our MediaWiki installation from Special:Version. Yes, it's old. Installed software Product Version MediaWiki 1.16.5 PHP 5.2.14-pl0-gentoo (apache2handler) MySQL 5.0.84 Installed extensions Parser hooks GoogleDocs4MW (Version 1.1) Adds tag for Google Docs' spreadsheets display Jack Phoenix SyntaxHighlight (Version 1.0.8.6) Provides syntax highlighting using GeSHi Highlighter Brion Vibber, Tim Starling, Rob Church and Niklas Laxström WebServiceSequenceDiagram(Version 1.0) Render inline sequence diagrams using websequencediagrams.com Eddie Olsson Other MWSearch MWSearch plugin Kate Turner and Brion Vibber Extension functions efLucenePrefixSetup Parser extension tags gallery, googlespreadsheet, html, nowiki, pre, sequencediagram, source and syntaxhighlight Parser function hooks anchorencode, basepagename, basepagenamee, defaultsort, displaytitle, filepath, formatdate, formatnum, fullpagename, fullpagenamee, fullurl, fullurle, gender, grammar, int, language, lc, lcfirst, localurl, localurle, namespace, namespacee, ns, nse, numberingroup, numberofactiveusers, numberofadmins, numberofarticles, numberofedits, numberoffiles, numberofpages, numberofusers, numberofviews, padleft, padright, pagename, pagenamee, pagesincategory, pagesize, plural, protectionlevel, special, subjectpagename, subjectpagenamee, subjectspace, subjectspacee, subpagename, subpagenamee, tag, talkpagename, talkpagenamee, talkspace, talkspacee, uc, ucfirst and urlencode

    Read the article

  • Using undecorated UiNavigationBar

    - by Nicsoft
    Hello, I would like to use UINavigationBar without decoration. I.e. I would like to create my own custom buttons and link those to the same actions (e.g. back) as the navigation items were linked to and have no bar presented at the top. I was told that one should use navigation bar even though graphically you should design the interaction yourself. How do I go about doing this? I am quite new to navigation bar to start with... If there is some tutorial you can direct me to it would be great (that is for using nav-bar without decoration). Thanks in advance! Regards, Niklas

    Read the article

  • PHP Session variable isset(..)=1 after session_start()

    - by Nicsoft
    Hello! I guess I am not understanding the scope of session variables, or the session itself, in PHP, hence this question: This is my code if(!session_id()==""){ echo "Getting rid of session"."</br>"; session_destroy(); } echo "Before session_start(): ".isset($_SESSION["first_date_of_week"])."</br>"; session_start(); echo "After session_start(): ".isset($_SESSION["first_date_of_week"])." ".$_SESSION["first_date_of_week"]->format("Y-m-d")."</br>"; The output is: Before session_start(): After session_start(): 1 2011-01-09 How come that when doing the isset(..) on the session variable it is set directly after starting the session, even though I haven't even used it or set it yet? It does, however, still have the same value as before. Also, session_id()="" since the if-clause is never triggered. I never kill the session, how come it is set to ""? I.e. I refresh the page and expects the session to still be alive. Using the isset(..) function is then pretty useless testing if it has been set already... Thanks in advance! /Niklas

    Read the article

< Previous Page | 1 2 3