Search Results

Search found 3828 results on 154 pages for 'mathematical optimization'.

Page 13/154 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Code Golf: Evaluating Mathematical Expressions

    - by Noldorin
    Challenge Here is the challenge (of my own invention, though I wouldn't be surprised if it has previously appeared elsewhere on the web). Write a function that takes a single argument that is a string representation of a simple mathematical expression and evaluates it as a floating point value. A "simple expression" may include any of the following: positive or negative decimal numbers, +, -, *, /, (, ). Expressions use (normal) infix notation. Operators should be evaluated in the order they appear, i.e. not as in BODMAS, though brackets should be correctly observed, of course. The function should return the correct result for any possible expression of this form. However, the function does not have to handle malformed expressions (i.e. ones with bad syntax). Examples of expressions: 1 + 3 / -8 = -0.5 (No BODMAS) 2*3*4*5+99 = 219 4 * (9 - 4) / (2 * 6 - 2) + 8 = 10 1 + ((123 * 3 - 69) / 100) = 4 2.45/8.5*9.27+(5*0.0023) = 2.68... Rules I anticipate some form of "cheating"/craftiness here, so please let me forewarn against it! By cheating, I refer to the use of the eval or equivalent function in dynamic languages such as JavaScript or PHP, or equally compiling and executing code on the fly. (I think my specification of "no BODMAS" has pretty much guaranteed this however.) Apart from that, there are no restrictions. I anticipate a few Regex solutions here, but it would be nice to see more than just that. Now, I'm mainly interested in a C#/.NET solution here, but any other language would be perfectly acceptable too (in particular, F# and Python for the functional/mixed approaches). I haven't yet decided whether I'm going to accept the shortest or most ingenious solution (at least for the language) as the answer, but I would welcome any form of solution in any language, except what I've just prohibited above! My Solution I've now posted my C# solution here (403 chars). Update: My new solution has beaten the old one significantly at 294 chars, with the help of a bit of lovely regex! I suspected that this will get easily beaten by some of the languages out there with lighter syntax (particularly the funcional/dynamic ones), and have been proved right, but I'd be curious if someone could beat this in C# still. Update I've seen some very crafty solutions already. Thanks to everyone who has posted one. Although I haven't tested any of them yet, I'm going to trust people and assume they at least work with all of the given examples. Just for the note, re-entrancy (i.e. thread-safety) is not a requirement for the function, though it is a bonus. Format Please post all answers in the following format for the purpose of easy comparison: Language Number of characters: ??? Fully obfuscated function: (code here) Clear/semi-obfuscated function: (code here) Any notes on the algorithm/clever shortcuts it takes.

    Read the article

  • Search Engine Optimization For Great Search Engine Placement!

    Do you do enough search engine optimization to get the search engine placement that you want for the keywords that you want to rank for? If not then read on and I will give you information that you need to know to start getting those rankings that you want, and start receiving traffic! There are a few things I will be going over in this article.

    Read the article

  • Search Engine Keyword Optimization - The Best Online Marketing Strategy

    Online business people dreams are fulfilled when they succeed in search engine keyword optimization. It is always a pleasure when out of 79,000,000 advertisers competing for a certain keyword; you find your website or article appearing on the first page of Google. Apart from Google, the other places to concentrate on in order to generate organic traffic are MSN, Yahoo and Bing.

    Read the article

  • Guide to Building a Website - Top 5 Tips For Keyword Page Optimization

    Keyword page optimization is full of strange technical terms - meta tags, keyword tag, HTML tags, etc. In this guide to building a website we will look closely at how search engines scan your website and the fact that the relevancy is the main factor for Google. You might realize that these buzzwords might not have the same weight as before.

    Read the article

  • The ABC's of Search Engine Optimization

    If you're trying to learn more about Search Engine Optimization you're not alone. Many business owners have heard this term, but may not know exactly what it mean. Simply put, SEO is a way to help improve your web site so that it can be found easily by search engines, allowing it to be ranked higher in their results, and ultimately be found by your customers.

    Read the article

  • Getting a Search Engine Optimization Quote to Boost Your Web Traffic

    One way link building is undoubtedly one of the most effective ways to improve the popularity and traffic of your website so getting a search engine optimization quote just makes sense if you want to do it the right way. It's a good option to consider building one way links manually but, if you're serious about boosting your web traffic, don't dwell on it for too long.

    Read the article

  • Search Engine Optimization

    Search Engine Optimization is a process by which a website is improved so that it can be more easily found by search engines, rank higher on search engine results and be found by its target audience.... [Author: Sarah Gibson - Web Design and Development - March 30, 2010]

    Read the article

  • Search Engine Optimization Software Tools

    In the Internet marketing field there are several essential search engine optimization software tools available for purchase on the Internet today. Professional SEO software tools identify niche markets for digital products for sale and allow the user analyze the marketplace and assess the competition.

    Read the article

  • Designing Search Engine Keyword Optimization Friendly Websites and Blogs

    To generate free targeted traffic, you must know how to go about search engine keyword optimization. This is because optimizing your website or blog for placement on the first page of Google or Yahoo is the best online money making secret. Google, MSN and Yahoo are used by most people to search for information thus if you can optimize your website pages for common keywords you will definitely attract traffic.

    Read the article

  • Search Engine Optimization 101 - Properly Using Your Articles to Promote Your Site

    Article writing is one of the most common strategies used in Search Engine Optimization, and is also utilized as part of many Internet Marketing strategies used by SEO Companies today. If you have talent in coming up with quality articles to help promote your website -- and save yourself the expense of hiring an expert take care of it for you -- then you need to know how to properly used your work to promote your site. Here are some tips that should help you out.

    Read the article

  • 5 Common Mistakes Made by Search Engine Optimization Companies

    Search engine optimization process or SEO is used for making the website search-friendly. The websites are made friendly not only for the search-engines, but also for those who search for products and services with the help of search-engines. There are 5 common mistakes which people make while optimizing the site. You should be aware that these mistakes can affect your ranking in the SE.

    Read the article

  • Possible SWITCH Optimization in DAX – #powerpivot #dax #tabular

    - by Marco Russo (SQLBI)
    In one of the Advanced DAX Workshop I taught this year, I had an interesting discussion about how to optimize a SWITCH statement (which could be frequently used checking a slicer, like in the Parameter Table pattern). Let’s start with the problem. What happen when you have such a statement? Sales :=     SWITCH (         VALUES ( Period[Period] ),         "Current", [Internet Total Sales],         "MTD", [MTD Sales],         "QTD", [QTD Sales],         "YTD", [YTD Sales],          BLANK ()     ) The SWITCH statement is in reality just syntax sugar for a nested IF statement. When you place such a measure in a pivot table, for every cell of the pivot table the IF options are evaluated. In order to optimize performance, the DAX engine usually does not compute cell-by-cell, but tries to compute the values in bulk-mode. However, if a measure contains an IF statement, every cell might have a different execution path, so the current implementation might evaluate all the possible IF branches in bulk-mode, so that for every cell the result from one of the branches will be already available in a pre-calculated dataset. The price for that could be high. If you consider the previous Sales measure, the YTD Sales measure could be evaluated for all the cells where it’s not required, and also when YTD is not selected at all in a Pivot Table. The actual optimization made by the DAX engine could be different in every build, and I expect newer builds of Tabular and Power Pivot to be better than older ones. However, we still don’t live in an ideal world, so it could be better trying to help the engine finding a better execution plan. One student (Niek de Wit) proposed this approach: Selection := IF (     HASONEVALUE ( Period[Period] ),     VALUES ( Period[Period] ) ) Sales := CALCULATE (     [Internet Total Sales],     FILTER (         VALUES ( 'Internet Sales'[Order Quantity] ),         'Internet Sales'[Order Quantity]             = IF (                 [Selection] = "Current",                 'Internet Sales'[Order Quantity],                 -1             )     ) )     + CALCULATE (         [MTD Sales],         FILTER (             VALUES ( 'Internet Sales'[Order Quantity] ),             'Internet Sales'[Order Quantity]                 = IF (                     [Selection] = "MTD",                     'Internet Sales'[Order Quantity],                     -1                 )         )     )     + CALCULATE (         [QTD Sales],         FILTER (             VALUES ( 'Internet Sales'[Order Quantity] ),             'Internet Sales'[Order Quantity]                 = IF (                     [Selection] = "QTD",                     'Internet Sales'[Order Quantity],                     -1                 )         )     )     + CALCULATE (         [YTD Sales],         FILTER (             VALUES ( 'Internet Sales'[Order Quantity] ),             'Internet Sales'[Order Quantity]                 = IF (                     [Selection] = "YTD",                     'Internet Sales'[Order Quantity],                     -1                 )         )     ) At first sight, you might think it’s impossible that this approach could be faster. However, if you examine with the profiler what happens, there is a different story. Every original IF’s execution branch is now a separate CALCULATE statement, which applies a filter that does not execute the required measure calculation if the result of the FILTER is empty. I used the ‘Internet Sales’[Order Quantity] column in this example just because in Adventure Works it has only one value (every row has 1): in the real world, you should use a column that has a very low number of distinct values, or use a column that has always the same value for every row (so it will be compressed very well!). Because the value –1 is never used in this column, the IF comparison in the filter discharge all the values iterated in the filter if the selection does not match with the desired value. I hope to have time in the future to write a longer article about this optimization technique, but in the meantime I’ve seen this optimization has been useful in many other implementations. Please write your feedback if you find scenarios (in both Power Pivot and Tabular) where you obtain performance improvements using this technique!

    Read the article

  • Search Engine Optimization Tips For Your Blog

    No longer is Search Engine Optimization (SEO) limited to websites. This process of improving both quantity and quality of traffic is also available for your blog. It produces a natural or organic flow of search engine results and helps your blog move up in ranking. Here are some things that will help improve your SEO.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >