Search Results

Search found 824 results on 33 pages for 'ranking stackingblocks'.

Page 32/33 | < Previous Page | 28 29 30 31 32 33  | Next Page >

  • PHP Not Automatically Updating With ?reload=1

    - by user32007
    A friend built a ranking system on his site and I am trying to host in on mine via wordpress and godaddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error. His page is at: jeremynoeljohnson .com/yakezieclub My page is currently at http://sweatingthebigstuff.com/yakezieclub but when you ?reload=1 it will give the error. Any idea why this might be happening? Any settings that I might need to change? Here is the top of the index.php file. I'm not sure which part of any of it is messing up. I literally uploaded the same code as him. Here's the reload part: $cachefile = "rankings.html"; $daycachefile = "rankings_history.xml"; $cachetime = (60 * 60) * 6; // every 6 hours, the cache refreshes $daycachetime = (60 * 60) * 24; // every 24 hours, the history will be written to - or whenever the page is requested after 24 hours has passed $writenewdata = false; if (!empty($_GET['reload'])) { if ($_GET['reload']== 1) { $cachetime = 1; } } if (!empty($_GET['reloadhistory'])) { if ($_GET['reloadhistory'] == 1) { $daycachetime = 1; $cachetime = 1; } } if (file_exists($daycachefile) && (time() - $daycachetime < filemtime($daycachefile))) { // Do nothing } else { $writenewdata = true; $cachetime = 1; } // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) { include($cachefile); echo ""; exit; } ob_start(); // start the output buffer ?

    Read the article

  • c++ stl priority queue insert bad_alloc exception

    - by bsg
    Hi, I am working on a query processor that reads in long lists of document id's from memory and looks for matching id's. When it finds one, it creates a DOC struct containing the docid (an int) and the document's rank (a double) and pushes it on to a priority queue. My problem is that when the word(s) searched for has a long list, when I try to push the DOC on to the queue, I get the following exception: Unhandled exception at 0x7c812afb in QueryProcessor.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012ee88.. When the word has a short list, it works fine. I tried pushing DOC's onto the queue in several places in my code, and they all work until a certain line; after that, I get the above error. I am completely at a loss as to what is wrong because the longest list read in is less than 1 MB and I free all memory that I allocate. Why should there suddenly be a bad_alloc exception when I try to push a DOC onto a queue that has a capacity to hold it (I used a vector with enough space reserved as the underlying data structure for the priority queue)? I know that questions like this are almost impossible to answer without seeing all the code, but it's too long to post here. I'm putting as much as I can and am anxiously hoping that someone can give me an answer, because I am at my wits' end. The NextGEQ function is too long to put here, but it reads a list of compressed blocks of docids block by block. That is, if it sees that the lastdocid in the block (in a separate list) is larger than the docid passed in, it decompresses the block and searches until it finds the right one. If it sees that it was already decompressed, it just searches. Below, when I call the function the first time, it decompresses a block and finds the docid; the push onto the queue after that works. The second time, it doesn't even need to decompress; that is, no new memory is allocated, but after that time, pushing on to the queue gives a bad_alloc error. struct DOC{ long int docid; long double rank; public: DOC() { docid = 0; rank = 0.0; } DOC(int num, double ranking) { docid = num; rank = ranking; } bool operator>( const DOC & d ) const { return rank > d.rank; } bool operator<( const DOC & d ) const { return rank < d.rank; } }; struct listnode{ int* metapointer; int* blockpointer; int docposition; int frequency; int numberdocs; int* iquery; listnode* nextnode; }; void QUERYMANAGER::SubmitQuery(char *query){ vector<DOC> docvec; docvec.reserve(20); DOC doct; //create a priority queue to use as a min-heap to store the documents and rankings; //although the priority queue uses the heap as its underlying data structure, //I found it easier to use the STL priority queue implementation priority_queue<DOC, vector<DOC>,std::greater<DOC>> q(docvec.begin(), docvec.end()); q.push(doct); //do some processing here; startlist is a pointer to a listnode struct that starts the //linked list cout << "Opening lists:" << endl; //point the linked list start pointer to the node returned by the OpenList method startlist = &OpenList(value); listnode* minpointer; q.push(doct); //more processing here; else{ //start by finding the first docid in the shortest list int i = 0; q.push(doct); num = NextGEQ(0, *startlist); q.push(doct); while(num != -1) cout << "finding nextGEQ from shortest list" << endl; q.push(doct); //the is where the problem starts - every previous q.push(doct) works; the one after //NextGEQ(num +1, *startlist) gives the bad_alloc error num = NextGEQ(num + 1, *startlist); q.push(doct); //if you didn't break out of the loop; i.e., all lists contain a matching docid, //calculate the document's rank; if it's one of the top 20, create a struct //containing the docid and the rank and add it to the priority queue if(!loop) { cout << "found match" << endl; if(num < 0) { cout << "reached end of list" << endl; //reached the end of the shortest list; close the list CloseList(startlist); break; } rank = calculateRanking(table, num); try{ //if the heap is not full, create a DOC struct with the docid and //rank and add it to the heap if(q.size() < 20) { doc.docid = num; doc.rank = rank; q.push(doct); q.push(doc); } } catch (exception& e) { cout << e.what() << endl; } } } Thank you very much, bsg.

    Read the article

  • How to get rank from full-text search query with Linq to SQL?

    - by Stephen Jennings
    I am using Linq to SQL to call a stored procedure which runs a full-text search and returns the rank plus a few specific columns from the table Article. The rank column is the rank returned from the SQL function FREETEXTTABLE(). I've added this sproc to the data model designer with return type Article. This is working to get the columns I need; however, it discards the ranking of each search result. I'd like to get this information so I can display it to the user. So far, I've tried creating a new class RankedArticle which inherits from Article and adds the column Rank, then changing the return type of my sproc mapping to RankedArticle. When I try this, an InvalidOperationException gets thrown: Data member 'Int32 ArticleID' of type 'Heap.Models.Article' is not part of the mapping for type 'RankedArticle'. Is the member above the root of an inheritance hierarchy? I can't seem to find any other questions or Google results from people trying to get the rank column, so I'm probably missing something obvious here.

    Read the article

  • Looking for ideas for a simple pattern matching algorithm to run on a microcontroller

    - by pic_audio
    I'm working on a project to recognize simple audio patterns. I have two data sets, each made up of between 4 and 32 note/duration pairs. One set is predefined, the other is from an incoming data stream. The length of the two strongly correlated data sets is often different, but roughly the same "shape". My goal is to come up with some sort of ranking as to how well the two data sets correlate/match. I have converted the incoming frequencies to pitch and shifted the incoming data stream's pitch so that it's average pitch matches that of the predefined data set. I also stretch/compress the incoming data set's durations to match the overall duration of the predefined set. Here are two graphical examples of data that should be ranked as strongly correlated: http://s2.postimage.org/FVeG0-ee3c23ecc094a55b15e538c3a0d83dd5.gif (Sorry, as a new user I couldn't directly post images) I'm doing this on a 8-bit microcontroller so resources are minimal. Speed is less an issue, a second or two of processing isn't a deal breaker. It wouldn't surprise me if there is an obvious solution, I've just been staring at the problem too long. Any ideas? Thanks in advance...

    Read the article

  • Hibernate limitations on using variables in queries

    - by sammichy
    I had asked the following question I have the following table structure for a table Player Table Player { Long playerID; Long points; Long rank; } Assuming that the playerID and the points have valid values, can I update the rank for all the players based on the number of points in a single query? If two people have the same number of points, they should tie for the rank. And received the answer from Daniel Vassalo (thank you). UPDATE player JOIN (SELECT p.playerID, IF(@lastPoint <> p.points, @curRank := @curRank + 1, @curRank) AS rank, IF(@lastPoint = p.points, @curRank := @curRank + 1, @curRank), @lastPoint := p.points FROM player p JOIN (SELECT @curRank := 0, @lastPoint := 0) r ORDER BY p.points DESC ) ranks ON (ranks.playerID = player.playerID) SET player.rank = ranks.rank; When I try to execute this as a native query in Hibernate, the following exception is thrown. java.lang.IllegalArgumentException: org.hibernate.QueryException: Space is not allowed after parameter prefix ':' Apparently this has been an open issue for the last couple of years, I want to know if the ranking query can be made to work either Without using any variables in the SQL query OR Using any workaround for Hibernate.

    Read the article

  • SEO Friendly URL Rewriter Parameters

    - by Kristen
    I would appreciate you advice on how to incorporate parameters into SEO Friendly URLs We have decided to have the "techie" parameters first, followed by the "SEO Slug" \product\ABC123\fly-your-own-helicopter much like S.O. - if the SEO Slug changes, or is truncated, or missing, we still have the Product and ABC123 parameters; various articles say that having such extra data doesn't harm SEO ranking. We need to have additional parameters; we could use "-" to separate parameters as it makes them look similar to the SEO Slug, or we could/should use something else? \product\ABC123-BOYTOY-2\boys\toys\fly-your-own-helicopter This is product=ABC123, in Category=BOYTOY and Page=2. We also want to keep the hierarchy as flat as possible, and thus I think: \product-ABC123-BOYTOY-2\boys\toys\fly-your-own-helicopter would be better - one level less. We have a number of "zones", e.g. \product-ABC123\seo-slug-for-product \category-BOYTOY\seo-slug-for-category \article-54321\terms-and-conditions it would help us a lot if we could just user our 5 digit Page ID number instead, so these would become \12345-ABC123\seo-slug-for-product \23456-BOYTOY\seo-slug-for-category \54321\terms-and-conditions (Products & Categories have a number of different Page IDs for different templates, this style would take us straight to the right one) I would appreciate your insight into what parameter separators to use, and if the leading techi-data is going work well for us. In case relevant: Classic ASP application on IIS7 + MSSQL2008 Product & Category codes contain A-Z, 0-9, "_" only.

    Read the article

  • Basic site analytics doesn't tally with Google data

    - by Jenkz
    After being stumped by an earlier quesiton: SO google-analytics-domain-data-without-filtering I've been experimenting with a very basic analytics system of my own. MySQL table: hit_id, subsite_id, timestamp, ip, url The subsite_id let's me drill down to a folder (as explained in the previous question). I can now get the following metrics: Page Views - Grouped by subsite_id and date Unique Page Views - Grouped by subsite_id, date, url, IP (not nesecarily how Google does it!) The usual "most visited page", "likely time to visit" etc etc. I've now compared my data to that in Google Analytics and found that Google has lower values each metric. Ie, my own setup is counting more hits than Google. So I've started discounting IP's from various web crawlers, Google, Yahoo & Dotbot so far. Short Questions: Is it worth me collating a list of all major crawlers to discount, is any list likely to change regularly? Are there any other obvious filters that Google will be applying to GA data? What other data would you collect that might be of use further down the line? What variables does Google use to work out entrance search keywords to a site? The data is only going to used internally for our own "subsite ranking system", but I would like to show my users some basic data (page views, most popular pages etc) for their reference.

    Read the article

  • SEO - Problems possibly related to 301 Moved Permanently

    - by ILMV
    Right, here's the story: We have had a website for one of our brands now for many years, the site design was very bad and recently did a complete overhaul, mostly design, but also some of the backend code. The original site was using links such as this example.com/products/item/127 and thus I wanted to change them to be move user friendly, especially to include the product name, the same link now reads example.com/product/127/my-jucy-product/. Since our switch over we have seen our Google results take a beating (we were on the first page for our normal search terms, now we're nearer the 4th!). The other problem we're having is that the links to the old products haven't updated to the new links despite me coding a 301 redirect from old to new. The 301 is not being fired from .htaccess, but in our PHP framework. I had a look at how the site is being loaded from a old link that is still in Google and here's what firebug is reporting: GET <google link> 302 Found GET example.com/products/item/127 302 Found GET example.com/products/item/127 301 Moved Permanently GET example.com/product/127/my-jucy-product/ 302 Found So the Google link has a 302, good. But when the old link comes in our framework is returning a 302! It's only afterwards when it finally hits the right part of the framework does it 301, so here's my question: Is the reason our old links have not changed and our Google Ranking has significantly nose dived because Google is seeing a 302 before the 301? At the time I was reluctant to mess with our .htaccess because it had become pretty complicated and I was under some pretty intense time constraints, now I'm wondering whether this was an incorrect disicion and perhaps I should revisit it. Many thanks! Edit Bugger, just signed up to the Webmaster Tools and I'm getting redirect errors all over the place, hundreds of them! I think this is my problem.

    Read the article

  • SQL Server: A Grouping question that's annoying me

    - by user366729
    I've been working with SQL Server for the better part of a decade, and this grouping (or partitioning, or ranking...I'm not sure what the answer is!) one has me stumped. Feels like it should be an easy one, too. I'll generalize my problem: Let's say I have 3 employees (don't worry about them quitting or anything...there's always 3), and I keep up with how I distribute their salaries on a monthly basis. Month Employee PercentOfTotal -------------------------------- 1 Alice 25% 1 Barbara 65% 1 Claire 10% 2 Alice 25% 2 Barbara 50% 2 Claire 25% 3 Alice 25% 3 Barbara 65% 3 Claire 10% As you can see, I've paid them the same percent in Months 1 and 3, but in Month 2, I've given Alice the same 25%, but Barbara got 50% and Claire got 25%. What I want to know is all the distinct distributions I've ever given. In this case there would be two -- one for months 1 and 3, and one for month 2. I'd expect the results to look something like this (NOTE: the ID, or sequencer, or whatever, doesn't matter) ID Employee PercentOfTotal -------------------------------- X Alice 25% X Barbara 65% X Claire 10% Y Alice 25% Y Barbara 50% Y Claire 25% Seems easy, right? I'm stumped! Anyone have an elegant solution? I just put together this solution while writing this question, which seems to work, but I'm wondering if there's a better way. Or maybe a different way from which I'll learn something. WITH temp_ids (Month) AS ( SELECT DISTINCT MIN(Month) FROM employees_paid GROUP BY PercentOfTotal ) SELECT EMP.Month, EMP.Employee, EMP.PercentOfTotal FROM employees_paid EMP JOIN temp_ids IDS ON EMP.Month = IDS.Month GROUP BY EMP.Month, EMP.Employee, EMP.PercentOfTotal Thanks y'all! -Ricky

    Read the article

  • Microsoft JScript runtime error: '(function name)' is undefined

    - by Velika2
    Microsoft JScript runtime error: 'txtGivenName_OnFocus' is undefined After adding what I thought was unrelated javascript code to a web page, I am suddenly getting errors that suggest that the browser cannot locate a javascript function that, to me, appears plain as day in design mode. I'm thinking that this is a load sequence order problem of some sort. Originally, my script was at the bottom of the page. I did this with the intent of helping my site's SEO ranking. When I moved the function to the top of the web page, the error went away. Now it is back. I have a feeling someone is going to suggest a jQuery solution to execute some code only when the page is fully loaded. I'm I ignorant of jQuery. IfjQuery is given in the answer, please explain what I need to do (references, placement of script files) for VS 2010 RTM. I am trying to set the focus to the first textbox on the webpage and preselect all of the text in the textbox More info: If I disable this Validator, the problem goes away: <asp:CustomValidator ID="valSpecifyOccupation" runat="server" ErrorMessage="Required" ClientValidationFunction="txtSpecifyOccupation_ClientValidate" Display="Dynamic" Enabled="False"></asp:CustomValidator> function txtSpecifyOccupation_ClientValidate(source, args) { var optOccupationRetired = document.getElementById("<%=optOccupationRetired.ClientID %>"); if (optOccupationRetired.checked) { args.IsValid = true; } else { var txtSpecifyOccupation = document.getElementById("<%=txtSpecifyOccupation.ClientID %>"); args.IsValid = ValidatorTrim(txtSpecifyOccupation.value) != ""; } }

    Read the article

  • Search implementation dilemma: full text vs. plain SQL

    - by Ethan
    I have a MySQL/Rails app that needs search. Here's some info about the data: Users search within their own data only, so searches are narrowed down by user_id to begin with. Each user will have up to about five thousand records (they accumulate over time). I wrote out a typical user's records to a text file. The file size is 2.9 MB. Search has to cover two columns: title and body. title is a varchar(255) column. body is column type text. This will be lightly used. If I average a few searches per second that would be surprising. It's running an a 500 MB CentOS 5 VPS machine. I don't want relevance ranking or any kind of fuzziness. Searches should be for exact strings and reliably return all records containing the string. Simple date order -- newest to oldest. I'm using the InnoDB table type. I'm looking at plain SQL search (through the searchlogic gem) or full text search using Sphinx and the Thinking Sphinx gem. Sphinx is very fast and Thinking Sphinx is cool, but it adds complexity, a daemon to maintain, cron jobs to maintain the index. Can I get away with plain SQL search for a small scale app?

    Read the article

  • How do I add ROW_NUMBER to a LINQ query or Entity?

    - by Whozumommy
    I'm stumped by this easy data problem. I'm using the Entity framework and have a database of products. My results page returns a paginated list of these products. Right now my results are ordered by the number of sales of each product, so my code looks like this: return Products.OrderByDescending(u => u.Sales.Count()); This returns an IQueryable dataset of my entities, sorted by the number of sales. I want my results page to show the rank of each product (in the dataset). My results should look like this: Page #1 1. Bananas 2. Apples 3. Coffee Page #2 4. Cookies 5. Ice Cream 6. Lettuce I'm expecting that I just want to add a column in my results using the SQL ROW_NUMBER variable...but I don't know how to add this column to my results datatable. My resulting page does contain a foreach loop, but since I'm using a paginated set I'm guessing using that number to fake a ranking number would NOT be the best approach. So my question is, how do I add a ROW_NUMBER column to my query results in this case?

    Read the article

  • Automatic music rating based on listening habits

    - by marco92w
    I've created a Winamp-like music player in Delphi. Not so complex, of course. Just a simple one. But now I would like to add a more complex feature: Songs in the library should be automatically rated based on the user's listening habits. This means: The application should "understand" if the user likes a song or not. And not only whether he/she likes it but also how much. My approach so far (data which could be used): Simply measure how often a song was played per time. Start counting time when the song was added to the library so that recent songs don't have any disadvantage. Measure how long a song was played on average (minutes). Starting a song but directly change to another one should have a bad influence on the ranking since the user didn't seem to like the song. ... Could you please help me with this problem? I would just like to have some ideas. I don't need the implementation in Delphi.

    Read the article

  • Algorithm for scoring user activity

    - by ManBugra
    I have an application where users can: Write reviews about products Add comments to products Up / Down vote reviews Up / Down vote comments Every Up/Down vote is recorded in a db table. What i want to do now is to create a ranking of the most active users in the last 4 weeks. Of course good reviews should be weighted more than good comments. But also e.g. 10 good comments should be weighted more than just one good review. Example: // reviews created in recent 4 weeks //format: [ upVoteCount, downVoteCount ] var reviews = [ [120,23], [32,12], [12,0], [23,45] ]; // comments created in recent 4 weeks // format: [ upVoteCount, downVoteCount ] var comments = [ [1,2], [322,1], [0,0], [0,45] ]; // create weight vector // format: [ reviewWeight, commentsWeight ] var weight = [0.60, 0.40]; // signature: activties..., activityWeight var userActivityScore = score(reviews, comments, weight); ... update user table ... List<Users> users = "from users u order by u.userActivityScore desc"; How would a fair scoring function look like? How could an implementation of the score() function look like? How to add a weight g to the function so that reviews are weighted heavier? How would such a function look like if, for example, votes for pictures would be added?

    Read the article

  • PHP script not automatically updating when moved to another server

    - by user32007
    A friend built a ranking system on his site and I am trying to host in on mine via WordPress and Go Daddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error. His page is at: jeremynoeljohnson .com/yakezieclub My page is currently at http://sweatingthebigstuff.com/yakezieclub but when you ?reload=1 it will give the error. Any idea why this might be happening? Any settings that I might need to change? Here is the top of the index.php file. I'm not sure which part of any of it is messing up. I literally uploaded the same code as him. Here's the reload part: $cachefile = "rankings.html"; $daycachefile = "rankings_history.xml"; $cachetime = (60 * 60) * 6; // every 6 hours, the cache refreshes $daycachetime = (60 * 60) * 24; // every 24 hours, the history will be written to // - or whenever the page is requested after 24 hours has passed $writenewdata = false; if (!empty($_GET['reload'])) { if ($_GET['reload']== 1) { $cachetime = 1; } } if (!empty($_GET['reloadhistory'])) { if ($_GET['reloadhistory'] == 1) { $daycachetime = 1; $cachetime = 1; } } if (file_exists($daycachefile) && (time() - $daycachetime < filemtime($daycachefile))) { // Do nothing } else { $writenewdata = true; $cachetime = 1; } // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) { include($cachefile); echo "<!-- Cached ".date('jS F Y H:i', filemtime($cachefile))." -->"; exit; } ob_start(); // start the output buffer ?>

    Read the article

  • Programming methods design phase assignment

    - by Shakir
    Hey, i have an assignment (NCC) which deals with the design phase. The Scenario is that you have four soccer divisions (divisions 1,2,3 and 4) which consist of 22 teams each and hence each team plays 42 games (home and away). The concept is similar to the barclays premier league whereby ranking is based on points or else goal difference or else goals scored by team. The difference is that the top 2 teams are promoted and the bottom 2 are relegated and this includes Div 1 and Div 4 as the top 2 of Div1 are promoted to the national league which is above division 1 regional league and bottom 2 of Div4 are relegated to the local league below Division 4 regional league. Hence there are 3 total leagues and 4 divisions in the regional league (which has 22 teams each). Now the referee has to add the result of the match and thus automatic tables have to be generated now, There are two reports League Tables for 4 divisions List of all results for any chosen team during the season by date it was played on There are a couple of things to be done... i know its gonna be terrible to make everything but atleast explain to me how i should go about drawing these and what things i should include (generally) Logical Data Structure Diagram (DSD) for each report Preliminary Program Structure (PSD) for each report Detailed Program Specification for each report Flowchart for each report There are other things but i think our teacher will give us clear "clues" for it Thanks a lot Update - Project so far: Data Structure Diagram Preliminary Program Structure

    Read the article

  • Theory: "Lexical Encoding"

    - by _ande_turner_
    I am using the term "Lexical Encoding" for my lack of a better one. A Word is arguably the fundamental unit of communication as opposed to a Letter. Unicode tries to assign a numeric value to each Letter of all known Alphabets. What is a Letter to one language, is a Glyph to another. Unicode 5.1 assigns more than 100,000 values to these Glyphs currently. Out of the approximately 180,000 Words being used in Modern English, it is said that with a vocabulary of about 2,000 Words, you should be able to converse in general terms. A "Lexical Encoding" would encode each Word not each Letter, and encapsulate them within a Sentence. // An simplified example of a "Lexical Encoding" String sentence = "How are you today?"; int[] sentence = { 93, 22, 14, 330, QUERY }; In this example each Token in the String was encoded as an Integer. The Encoding Scheme here simply assigned an int value based on generalised statistical ranking of word usage, and assigned a constant to the question mark. Ultimately, a Word has both a Spelling & Meaning though. Any "Lexical Encoding" would preserve the meaning and intent of the Sentence as a whole, and not be language specific. An English sentence would be encoded into "...language-neutral atomic elements of meaning ..." which could then be reconstituted into any language with a structured Syntactic Form and Grammatical Structure. What are other examples of "Lexical Encoding" techniques? If you were interested in where the word-usage statistics come from : http://www.wordcount.org

    Read the article

  • How do I add fade in effect when I click expand on this script?

    - by kohei
    Hi, I found this content expand/collapse jQuery plugin. I want to add fade-in effect to this plugin when I click on the EXPAND button. How do I do this? $(document).ready(function () { var maxlines = 15; var lineheight = 15; // line height in 'px' var maxheight = (maxlines * lineheight); var allowedExtraLines = 3; var showText = "EXPAND"; var hideText = "CLOSE"; $('.ranking').each(function () { var text = $(this); if (text.height() > maxheight + allowedExtraLines * lineheight) { text.css({ 'overflow': 'hidden', 'line-height': lineheight + 'px', 'height': maxheight + 'px' }); var link = $('<a href="#">' + showText + '</a>'); link.click(function (event) { event.preventDefault(); if (text.css('height') == 'auto') { $(this).html(showText); text.css('height', maxheight + 'px'); } else { //$(this).remove(); $(this).html(hideText); text.css('height', 'auto'); } }); var linkDiv = $('<div></div>'); linkDiv.append(link); $(this).after(linkDiv); } }); });

    Read the article

  • How can I make keyword order more relevant in my search?

    - by Atomiton
    In my database, I have a keywords field that stores a comma-delimited list of keywords. For example, a Shrek doll might have the following keywords: ogre, green, plush, hero, boys' toys A "Beanie Baby" doll ( that happens to be an ogre ) might have: beanie baby, kids toys, beanbag toys, soft, infant, ogre (That's a completely contrived example.) What I'd like to do is if the consumer searches for "ogre" I'd like the "Shrek" doll to come up higher in the search results. My content administrator feels that if the keyword is earlier in the list, it should get a higher ranking. ( This makes sense to me and it makes it easy for me to let them control the search result relevance ). Here's a simplified query: SELECT p.ProductID AS ContentID , p.ProductName AS Title , p.ProductCode AS Subtitle , 100 AS Rank , p.ProductKeywords AS Keywords FROM Products AS p WHERE FREETEXT( p.ProductKeywords, @SearchPredicate ) I'm thinking something along the lines of replacing the RANK with: , 200 - INDEXOF(@SearchTerm) AS Rank This "should" rank the keyword results by their relevance I know INDEXOF isn't a SQL command... but it's something LIKE that I would like to accomplish. Am I approaching this the right way? Is it possible to do something like this? Does this make sense?

    Read the article

  • New desktop GUI developer; can choose any platform...

    - by alexantd
    I'm planning a client-server product for a tiny, low-volume, high-cost vertical market. One of the components of the product will be a desktop application, simple to moderate in complexity, for data entry and uploading to a central server from remote PCs and/or Macs via SOAP. The server is a Java web app. Customers will be choosing their platform (Windows or Mac) based on what the client app runs on, so my options are wide-open here. However, I will be developing on a Mac and have a strong allergy to MS-specific technologies (sorry). The app will not need to run on any non-desktop-computer devices and I have total freedom to say it will support X but not Y or Z without any negative consequences (quite the luxury, to be sure). I have a lot of experience in server-side development but very little in desktop GUI stuff, and am evaluating my options on the client - basically what do I want to commit to learning over the next 6+ months. I have server-side Java experience as well as a brief dabble in iPhone development, which went OK. Overall I'm looking for: Ease of learning & development IDE support Healthy surrounding ecosystem (libraries, tools, help, etc.) Quality documentation My options as I see them, in rough order of how I'm currently mentally ranking them: Java Swing Cocoa Java SWT JavaFX Adobe AIR XULRunner Am I leaving anything out?

    Read the article

  • Sorted array: how to get position before and after using name? as3

    - by user1560239
    I have been working on a project and Stack Overflow has helped me with a few problems so far, so I am very thankful! My question is this: I have an array like this: var records:Object = {}; var arr:Array = [ records["nh"] = { medinc:66303, statename:"New Hampshire"}, records["ct"] = { medinc:65958, statename:"Connecticut"}, records["nj"] = { medinc:65173, statename:"New Jersey"}, records["md"] = { medinc:64596, statename:"Maryland"}, etc... for all 50 states. And then I have the array sorted reverse numerically (descending) like this: arr.sortOn("medinc", Array.NUMERIC); arr.reverse(); Can I call the name of the record (i.e. "nj" for new jersey) and then get the value from the numeric position above and below the record in the array? Basically, medinc is medium income of US states, and I am trying to show a ranking system... a user would click Texas for example, and it would show the medinc value for Texas, along with the state the ranks one position below and the state that ranks one position above in the array. Thanks for your help!

    Read the article

  • How should I handle multiple links ot the same page with different Query Strings

    - by RandomBen
    In the website I am working on, there is a product page with 8 tabs on it, showing different aspects of the product. There are quick links on other pages within the site that take you to the page and to a specific link specified by a query string. For example the base page would be www.example.com/Product1. And then there are links like this: www.example.com/Product1?tab=CADDrawing www.example.com/Product1?tab=Schematics www.example.com/Product1?tab=Reviews My concern is that Google sees each of these links as a different URL but they aren't and the data on the page is 100% the same. Is there any easy way to make it so Google either knows that www.example.com/Product1 is the base page or doesn't follow the links with Query Strings? I thought about using rel="nofollow" but that seems like it would actually hurt my page ranking. Most of the websites, including Googles on webmaster pages, is unclear. The other option is to add the rel="canonical" to the pages that have a query string but not to the base page. Does that succeed in stopping all of the noisy links?

    Read the article

  • Database Structure for CakePHP Models

    - by Michael T. Smith
    We're building a data tracking web app using CakePHP, and I'm having some issues getting the database structure right. We have Companies that haveMany Sites. Sites haveMany DataSamples. Tags haveAndBelongToMany Sites. That is all set up fine. The problem is "ranking" the sites within tags. We need to store it in the database as an archive. I created a Rank model that is setup like this: rank ( id (int), sample_id (int), tag_id (int), site_id (int), rank (int), total_rows) ) So, the question is, how do I create the associations for tag, site and sample to rank? I originally set them as haveMany. But the returned structures don't get me where I'd like to be. It looks like: [Site] => Array ( [Sample] = Array(), [Tag] = Array() ) When I'm really looking for: [Site] => Array ( [Tag] = Array ( [Sample] => Array ( [Rank] => Array ( ...data... ) ) ) ) I think that I may not be structuring the database properly; so if I need to update please let me know. Otherwise, how do I write a find query that gets me where I need to be? Thanks! Thoughts? Need more details? Just ask!

    Read the article

  • Help me refactor my World Cup Challenge Script

    - by kylemac
    I am setting up a World Cup Challenge between some friends, and decided to practice my Ruby and write a small script to automate the process. The Problem: 32 World Cup qualifiers split into 4 tiers by their Fifa ranking 8 entries Each entry is assigned 1 random team per tier Winner takes all :-) I wrote something that suffices yet is admittedly brute force. But, in my attempt to improve my Ruby, I acknowlege that this code isn't the most elegant solution around - So I turn to you, the experts, to show me the way. It may be more clear to check out this gist - https://gist.github.com/91e1f1c392bed8074531 My Current (poor) solution: require 'yaml' @teams = YAML::load(File.open('teams.yaml')) @players = %w[Player1 Player2 Player3 Player4 Player5 Player6 Player7 Player8] results = Hash.new players = @players.sort_by{rand} players.each_with_index do |p, i| results[p] = Array[@teams['teir_one'][i]] end second = @players.sort_by{rand} second.each_with_index do |p, i| results[p] << @teams['teir_two'][i] end third = @players.sort_by{rand} third.each_with_index do |p, i| results[p] << @teams['teir_three'][i] end fourth = @players.sort_by{rand} fourth.each_with_index do |p, i| results[p] << @teams['teir_four'][i] end p results I am sure there is a better way to iterate through the tiers, and duplicating the @players object ( dup() or clone() maybe?) So from one Cup Fan to another, help me out.

    Read the article

  • Add a Hovering Image Toolbar to Firefox

    - by Asian Angel
    When you work with webpage images in Firefox you normally have to use the Context Menu to do anything with them. The Image Toolbar extension provides an extra toolbar to use when you hover your mouse over webpage images. Note: This extension will not function if you have the NoScript extension installed/enabled unless JavaScript has permission to be active on that page. Before You can see the available “Context Menu” options for working with images here. Not bad but it would be nice if some other convenient options were available as well. Image Toolbar in Action Once you have installed the extension you will be able to view the toolbar whenever you hover your mouse over an image. All of the commands are active by default but you can choose what is available in the options. The toolbar will also appear in the upper left region of the image but can be set to appear relative to the cursor. Note: The default minimum image size for the toolbar to appear over is “260 x 260 pixels” so you will probably want to change it to a much smaller size (see options below). Here is what is available in the Image Toolbar: Save – Choose between being prompted when saving or automatically saving to a specified location Copy – Copies image and image URL so that you can paste the image or URL depending on the app pasted into Print – Provides print preview and printing capabilities Info – Opens a window with “properties information” about the image Folder – Opens browser’s download folder in Windows Explorer The “Save, Copy, Print, & Folder Commands” are all pretty clear in what you can expect from them but what about the “Info Command”? This is what you will see if you use the “Info Command” and expand the window out all the way. Very nice… Options There are quite a few options available for what appears to be such a small toolbar. The first “Tab Area” lets you set up the “Save Scheme” that best suits your personal needs. You can choose which commands are available in the toolbar, decide if you would like text labels visible, and enable small icons if desired. As mentioned above the default image size for the toolbar to appear is “260 x 260 pixels”…we set ours for “10 x 10 pixels”. If you would like the toolbar to appear relative to your mouse cursor as opposed to the upper left corner of the image then you can select for that here. Conclusion If you have been wanting more options for working with webpage images in Firefox then this will make a very useful and convenient addition to your browser. Links Download the Image Toolbar extension (Mozilla Add-ons) Similar Articles Productive Geek Tips Conserve Space in Firefox by Combining ToolbarsShow Alexa Ranking in FirefoxLightweight Extension to Show PageRank in FirefoxSwitch Windows by Hovering the Mouse Over a Window in Windows 7 or VistaQuick Tip: Show PageRank in Firefox while Google Toolbar is Hidden TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Roadkill’s Scan Port scans for open ports Out of 100 Tweeters Out of band Security Update for Internet Explorer 7 Cool Looking Screensavers for Windows SyncToy syncs Files and Folders across Computers on a Network (or partitions on the same drive) If it were only this easy

    Read the article

< Previous Page | 28 29 30 31 32 33  | Next Page >