Search Results

Search found 4088 results on 164 pages for 'params keyword'.

Page 66/164 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • Inherit one instance variable from the global scope

    - by Julian
    I'm using Curses to create a command line GUI with Ruby. Everything's going well, but I have hit a slight snag. I don't think Curses knowledge (esoteric to be fair) is required to answer this question, just Ruby concepts such as objects and inheritance. I'm going to explain my problem now, but if I'm banging on, just look at the example below. Basically, every Window instance needs to have .close called on it in order to close it. Some Window instances have other Windows associated with it. When closing a Window instance, I want to be able to close all of the other Window instances associated with it at the same time. Because associated Windows are generated in a logical fashion, (I append the name with a number: instance_variable_set(self + integer, Window.new(10,10,10,10)) ), it's easy to target generated windows, because methods can anticipate what assosiated windows will be called, (I can recreate the instance variable name from scratch, and almost query it: instance_variable_get(self + integer). I have a delete method that handles this. If the delete method is just a normal, global method (called like this: delete_window(@win543) then everything works perfectly. However, if the delete method is an instance method, which it needs to be in-order to use the self keyword, it doesn't work for a very clear reason; it can 'query' the correct instance variable perfectly well (instance_variable_get(self + integer)), however, because it's an instance method, the global instances aren't scoped to it! Now, one way around this would obviously be to simply make a global method like this: delete_window(@win543). But I have attributes associated with my window instances, and it all works very elegantly. This is very simplified, but it literally translates the problem exactly: class Dog def speak woof end end def woof if @dog_generic == nil puts "@dog_generic isn't scoped when .woof is called from a class method!\n" else puts "@dog_generic is scoped when .woof is called from the global scope. See:\n" + @dog_generic end end @dog_generic = "Woof!" lassie = Dog.new lassie.speak #=> @dog_generic isn't scoped when .woof is called from an instance method!\n woof #=> @dog_generic is scoped when .woof is called from the global scope. See:\nWoof! TL/DR: I need lassie.speak to return this string: "@dog_generic is scoped when .woof is called from the global scope. See:\nWoof!" @dog_generic must remain as an insance variable. The use of Globals or Constants is not acceptable. Could woof inherit from the Global scope? Maybe some sort of keyword: def woof < global # This 'code' is just to conceptualise what I want to do, don't take offence! end Is there some way the .woof method could 'pull in' @dog_generic from the global scope? Will @dog_generic have to be passed in as a parameter?

    Read the article

  • Query optimization using composite indexes

    - by xmarch
    Many times, during the process of creating a new Coherence application, developers do not pay attention to the way cache queries are constructed; they only check that these queries comply with functional specs. Later, performance testing shows that these perform poorly and it is then when developers start working on improvements until the non-functional performance requirements are met. This post describes the optimization process of a real-life scenario, where using a composite attribute index has brought a radical improvement in query execution times.  The execution times went down from 4 seconds to 2 milliseconds! E-commerce solution based on Oracle ATG – Endeca In the context of a new e-commerce solution based on Oracle ATG – Endeca, Oracle Coherence has been used to calculate and store SKU prices. In this architecture, a Coherence cache stores the final SKU prices used for Endeca baseline indexing. Each SKU price is calculated from a base SKU price and a series of calculations based on information from corporate global discounts. Corporate global discounts information is stored in an auxiliary Coherence cache with over 800.000 entries. In particular, to obtain each price the process needs to execute six queries over the global discount cache. After the implementation was finished, we discovered that the most expensive steps in the price calculation discount process were the global discounts cache query. This query has 10 parameters and is executed 6 times for each SKU price calculation. The steps taken to optimise this query are described below; Starting point Initial query was: String filter = "levelId = :iLevelId AND  salesCompanyId = :iSalesCompanyId AND salesChannelId = :iSalesChannelId "+ "AND departmentId = :iDepartmentId AND familyId = :iFamilyId AND brand = :iBrand AND manufacturer = :iManufacturer "+ "AND areaId = :iAreaId AND endDate >=  :iEndDate AND startDate <= :iStartDate"; Map<String, Object> params = new HashMap<String, Object>(10); // Fill all parameters. params.put("iLevelId", xxxx); // Executing filter. Filter globalDiscountsFilter = QueryHelper.createFilter(filter, params); NamedCache globalDiscountsCache = CacheFactory.getCache(CacheConstants.GLOBAL_DISCOUNTS_CACHE_NAME); Set applicableDiscounts = globalDiscountsCache.entrySet(globalDiscountsFilter); With the small dataset used for development the cache queries performed very well. However, when carrying out performance testing with a real-world sample size of 800,000 entries, each query execution was taking more than 4 seconds. First round of optimizations The first optimisation step was the creation of separate Coherence index for each of the 10 attributes used by the filter. This avoided object deserialization while executing the query. Each index was created as follows: globalDiscountsCache.addIndex(new ReflectionExtractor("getXXX" ) , false, null); After adding these indexes the query execution time was reduced to between 450 ms and 1s. However, these execution times were still not good enough.  Second round of optimizations In this optimisation phase a Coherence query explain plan was used to identify how many entires each index reduced the results set by, along with the cost in ms of executing that part of the query. Though the explain plan showed that all the indexes for the query were being used, it also showed that the ordering of the query parameters was "sub-optimal".  Parameters associated to object attributes with high-cardinality should appear at the beginning of the filter, or more specifically, the attributes that filters out the highest of number records should be placed at the beginning. But examining corporate global discount data we realized that depending on the values of the parameters used in the query the “good” order for the attributes was different. In particular, if the attributes brand and family had specific values it was more optimal to have a different query changing the order of the attributes. Ultimately, we ended up with three different optimal variants of the query that were used in its relevant cases: String filter = "brand = :iBrand AND familyId = :iFamilyId AND departmentId = :iDepartmentId AND levelId = :iLevelId "+ "AND manufacturer = :iManufacturer AND endDate >= :iEndDate AND salesCompanyId = :iSalesCompanyId "+ "AND areaId = :iAreaId AND salesChannelId = :iSalesChannelId AND startDate <= :iStartDate"; String filter = "familyId = :iFamilyId AND departmentId = :iDepartmentId AND levelId = :iLevelId AND brand = :iBrand "+ "AND manufacturer = :iManufacturer AND endDate >=  :iEndDate AND salesCompanyId = :iSalesCompanyId "+ "AND areaId = :iAreaId  AND salesChannelId = :iSalesChannelId AND startDate <= :iStartDate"; String filter = "brand = :iBrand AND departmentId = :iDepartmentId AND familyId = :iFamilyId AND levelId = :iLevelId "+ "AND manufacturer = :iManufacturer AND endDate >= :iEndDate AND salesCompanyId = :iSalesCompanyId "+ "AND areaId = :iAreaId AND salesChannelId = :iSalesChannelId AND startDate <= :iStartDate"; Using the appropriate query depending on the value of brand and family parameters the query execution time dropped to between 100 ms and 150 ms. But these these execution times were still not good enough and the solution was cumbersome. Third and last round of optimizations The third and final optimization was to introduce a composite index. However, this did mean that it was not possible to use the Coherence Query Language (CohQL), as composite indexes are not currently supporte in CohQL. As the original query had 8 parameters using EqualsFilter, 1 using GreaterEqualsFilter and 1 using LessEqualsFilter, the composite index was built for the 8 attributes using EqualsFilter. The final query had an EqualsFilter for the multiple extractor, a GreaterEqualsFilter and a LessEqualsFilter for the 2 remaining attributes.  All individual indexes were dropped except the ones being used for LessEqualsFilter and GreaterEqualsFilter. We were now running in an scenario with an 8-attributes composite filter and 2 single attribute filters. The composite index created was as follows: ValueExtractor[] ve = { new ReflectionExtractor("getSalesChannelId" ), new ReflectionExtractor("getLevelId" ),    new ReflectionExtractor("getAreaId" ), new ReflectionExtractor("getDepartmentId" ),    new ReflectionExtractor("getFamilyId" ), new ReflectionExtractor("getManufacturer" ),    new ReflectionExtractor("getBrand" ), new ReflectionExtractor("getSalesCompanyId" )}; MultiExtractor me = new MultiExtractor(ve); NamedCache globalDiscountsCache = CacheFactory.getCache(CacheConstants.GLOBAL_DISCOUNTS_CACHE_NAME); globalDiscountsCache.addIndex(me, false, null); And the final query was: ValueExtractor[] ve = { new ReflectionExtractor("getSalesChannelId" ), new ReflectionExtractor("getLevelId" ),    new ReflectionExtractor("getAreaId" ), new ReflectionExtractor("getDepartmentId" ),    new ReflectionExtractor("getFamilyId" ), new ReflectionExtractor("getManufacturer" ),    new ReflectionExtractor("getBrand" ), new ReflectionExtractor("getSalesCompanyId" )}; MultiExtractor me = new MultiExtractor(ve); // Fill composite parameters.String SalesCompanyId = xxxx;...AndFilter composite = new AndFilter(new EqualsFilter(me,                   Arrays.asList(iSalesChannelId, iLevelId, iAreaId, iDepartmentId, iFamilyId, iManufacturer, iBrand, SalesCompanyId)),                                     new GreaterEqualsFilter(new ReflectionExtractor("getEndDate" ), iEndDate)); AndFilter finalFilter = new AndFilter(composite, new LessEqualsFilter(new ReflectionExtractor("getStartDate" ), iStartDate)); NamedCache globalDiscountsCache = CacheFactory.getCache(CacheConstants.GLOBAL_DISCOUNTS_CACHE_NAME); Set applicableDiscounts = globalDiscountsCache.entrySet(finalFilter);      Using this composite index the query improved dramatically and the execution time dropped to between 2 ms and  4 ms.  These execution times completely met the non-functional performance requirements . It should be noticed than when using the composite index the order of the attributes inside the ValueExtractor was not relevant.

    Read the article

  • In Depth SEO Tutorials Are Ideal For Advanced Students

    There are basic, intermediate and advanced SEO tutorials on offer which will cover subjects such as SEO copywriting, web analysis, keyword research and social media marketing as well as other necessary topics needed to set up a web page. These in depth tutorials are perfect for those who have already attended SEO training classes as well as for beginners. These tutorials are run over a one and two day period and there are also individual three hour sessions offered.

    Read the article

  • Does AdSense serve higher CPC ads to a website that has higher number of visits?

    - by Silver Moon
    For the same niche and same set of keyword, does Google AdSense serve higher CPC ads to a website that has higher number of visits? I have observed that for similar niches 1 website (with 3K daily uniques) makes around $100 a month, and another website (with 10k daily uniques) makes around $700-800 a month It seems that the earning curve is not linearly dependent on visit count and somewhat increases at a rate faster than the growth of visits, this leads me to think if the Google AdSense algorithm serves higher CPC ads once a website starts getting a large number of visits.

    Read the article

  • Helpful Tips For SEO Learners

    SEO is all about the keywords or you can say game of words. A fair SEO practitioner should have good command over English or good content writer. Opt keyword rich title tag so that spiders of search engine will came to know what you site is all about as well as it is favorable for user also.

    Read the article

  • Keyphrases - How to Use Them

    Keywords and phrases are words which trigger a response from the search engine spiders (mathematical robots that crawl the web looking for new content to index). They are effective if they are tuned into what people type into the search engines at this moment in time, and you can find this out through the Google AdWords Keyword Tool.

    Read the article

  • Is multiple domain names and links from same IP causing poor search engine rankings?

    - by John
    I have an ecommerce website which is not doing so well in Google. I am trying to improve this of course, and am looking at some possibilities for why it isn't doing well. The website has four domain names, all of which have been indexed by Google. A few months ago I applied 301 redirects to any requests for two of the domain names so now it is down to two domain names (one is a .net, the other is a .com.au, the others were .net.au and .com). I prefer to use my main domain name (the .com.au), but one of the names has been around for a long time and has more inbound links. According to a PageRank tool, both are PR2. It is a Classic ASP site and up until recently had a lot of querystring parameters. In the last week or so I added URL rewriting so there is now no parameters for most pages. I don't do 301 redirects from the old URLs but instead I add the META canonical tag indicating the preferred new URL. At the same time I redesigned the site and improved title tags, META descriptions, and H tags but it hasn't been long enough yet for Google to index many of these yet. I also looked at what pages Google has indexed and strangely it has some strange pages in the index, there are a lot of pages which are actual keyword searches (more a bunch of random letters than an actual word). What I mean is that it is as if they had typed in something to search for in my search box - there are no links to pages like this and the only way of getting this is to type something in to the search box). So I added a META robots tag with noindex,nofollow anytime that I render pages like this. Years ago I set up a fake price comparison site which lists all my products and links back to my site. It has a different keyword rich domain name but is on the same server and same IP address. It's a completely different layout but does have the same product categories and product descriptions (although I have stripped formatting out of them so they are not identical except in text). I also have a few blog sites which again are on the same server/IP and all have advertising for the website. My questions are: What should I do with the multiple domains, just use one, or continue with two or more? Should I add 301 redirects, not just the META canonical tag? Any idea about Google indexing my search results page, and did I do the right thing with the META robots tag? Is the fake price comparison site likely to be causing problems? Are all the links to the site from other domain names but the same IP address likely to be causing problems? Thanks for any help. Sorry for so many questions in one.

    Read the article

  • cannot boot ubuntu 10.04 from usb

    - by Pragya Karki
    i tried to install ubuntu 10.04 from my silicon power 4gb pendrive. i have installed ubuntu 11.10. i downloaded "ubuntu-10.04.4-desktop-i386" from ubuntu from it's site and created a usb bootable drive using the instructions from the site. when i insert my usb to boot it gives following error: unknown keyword in configuration file: gfxboot vesamenu.c32: not a COM32R image boot: plz can u give me any solution..

    Read the article

  • Training of Search Engine Optimization

    There are many valuable points that cannot be obtained without proper search engine optimization training and the main features of any SEO course will be discussed. The first and foremost feature is keyword optimization which is the key to success when it comes to SEO articles as there are no back links.

    Read the article

  • Ways to Increase Targeted Traffic and Get Your Website Ranked High in Google For Free

    With so many web pages available on the internet you can be forgiven for thinking that there is no way at all that you could get your website ranked on the first page of Google. This however could not be further from the truth and you may be surprised at how easy it is to do this providing that you follow some guidelines and pick the keyword phrases that you wish to rank highly with carefully.

    Read the article

  • Search Engine Optimization Basics - Know Your Keywords

    I laugh to myself when I hear everyone in SEO talking about how the most important thing to improve your website's position in Google is backlinks. Now don't get me wrong, I definitely agree that building backlinks to your pages is important, but there is something that I consider much more important - and that is keyword research.

    Read the article

  • Why avoid Java Inheritance "Extends"

    - by newbie
    Good day! Jame Gosling said “You should avoid implementation inheritance whenever possible.” and instead, use interface inheritance. But why? How can we avoid inheriting the structure of an object using the keyword "extends", and at the same time make our code Object Oriented? Could someone please give an Object Oriented example illustrating this concept in a scenario like "ordering a book in a bookstore?" Thank you in advance.

    Read the article

  • 5 Steps to Choosing the Right Web Development Partner

    Finding the right web development company for your project can be a daunting task, with development companies becoming smaller and more widespread, even a simple local search may return hundreds of possible providers, so how do you go about choosing the right company, with a degree of confidence they have the rights skills and experience to deliver your project on time and on budget. Step 1: Planning and Searching The simple, yet often missed stage in choosing the right web development provider is planning; create a simple keyword list of all the relevant keywords for your...

    Read the article

  • 5 Steps to Choosing the Right Web Development Partner

    Finding the right web development company for your project can be a daunting task, with development companies becoming smaller and more widespread, even a simple local search may return hundreds of possible providers, so how do you go about choosing the right company, with a degree of confidence they have the rights skills and experience to deliver your project on time and on budget. Step 1: Planning and Searching The simple, yet often missed stage in choosing the right web development provider is planning; create a simple keyword list of all the relevant keywords for your...

    Read the article

  • Find The Best Keywords For Your Site

    Keyword optimisation is probably the most important thing that you want to concentrate on with regards to search engine optimisation (SEO). Unfortunately, not many people know this, or do enough to optimise their sites' keywords.

    Read the article

  • Increase Site Traffic Fast

    Starting a new website? What are the things you would do to increase site traffic? The most important function for me is my keyword research. I need to formulate a good SEO plan that goes along with my research.

    Read the article

  • SEO - That's All You Ever Think About

    What's your domain name? How old is it? How relevant is it to your business and does it contain relevant keywords? SEO related keywords or keyword phrases perhaps that relate directly to your field of business?

    Read the article

  • Sudden drop in google position [duplicate]

    - by user32196
    This question already has an answer here: How to diagnose a search engine ranking drop? 5 answers Our website used to show up on top 10 positions for a competitive keyword till 1 month back but now has drastically dropped down more than 100 positions. What could be the reason?

    Read the article

  • What Elements Are Important in SEO?

    When it comes to search engine optimisation, what elements are the important ones? I've seen some people's research focus purely on targeting highly competitive keywords with minimal budget and wondering why they aren't achieving the P1 listings they have promised their clients. In my opinion, I would look a little wider than purely on the keyword.

    Read the article

  • Regarding adsense cpc

    - by Silver Moon
    For the same niche and same set of keyword, does google adsense serve higher cpc ads to a website that has higher number of visits ? I have observed that for similar niches 1 website (with 3K daily uniques) makes around $100 a month, and another website (with 10k daily uniques) makes around $700-800 a month it seems that the earning curve is not linearly dependant on visit count and somewhat increases at a rate faster than the growth of visits, this leads me to think if the google adsense algorithm serves higher cpc ads once a website starts getting large number of visits.

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >