Search Results

Search found 1873 results on 75 pages for 'andy score'.

Page 7/75 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Display the form again ?

    - by noralain
    Hi all, I want to ask about the form in javascript .. I want to do a game that the user enter the correct word, then alert message will apeared for correct word.. When the user do the first word correctly, the program will display another word (to be corrected) .. but the problem which i faced that i can't make the form display again to continue play the game .. i used : var d = document.getElementById("form1"); d.style.visibility = "visible"; but it doesn't work !! This is my code: <title>Word Decoder</title> <script type="text/javascript"> function checkWord(word, score){ var ok = words[score].valueOf(); var ok1 = document.getElementById("wordid"); if(ok1.value == ok){ score ++; alert("Correct, your score is: " + score); var d = document.getElementById("form1"); d.style.visibility = "visible"; return false; } else { alert("Wrong Spelling"); return false; } } </script> </head> <body> <script type="text/javascript"> var words = new Array ("apple", "orange", "banana", "manago", "table"); var reWords = new Array ("alpep", "ergano", "aaabnn", "goamna", "lbeat"); var count = 0; var score = 0; "</br>"; </script> <form id="form1"> <br> <dir id="displayForm" style="position: relative; visibility: visible; display: block"> <h3><b> <script> document.write(reWords[score]);</script> </b></h3> <br> Enter the correct word: <input type="text" value="" id="wordid"/> <input type="submit" value="Check Answer ??" onclick="return checkWord(wordid, score);" /> </dir> </form> </body> Can help me to solve the problem? Again: I want the game will display a scrambled word and the user must unscrambled the word to move to the other word. The problem is i can't display the form again to make the user unscrambled the second, third ..etc words..

    Read the article

  • How to optimize my PostgreSQL DB for prefix search?

    - by asmaier
    I have a table called "nodes" with roughly 1.7 million rows in my PostgreSQL db =#\d nodes Table "public.nodes" Column | Type | Modifiers --------+------------------------+----------- id | integer | not null title | character varying(256) | score | double precision | Indexes: "nodes_pkey" PRIMARY KEY, btree (id) I want to use information from that table for autocompletion of a search field, showing the user a list of the ten titles having the highest score fitting to his input. So I used this query (here searching for all titles starting with "s") =# explain analyze select title,score from nodes where title ilike 's%' order by score desc; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------- Sort (cost=64177.92..64581.38 rows=161385 width=25) (actual time=4930.334..5047.321 rows=161264 loops=1) Sort Key: score Sort Method: external merge Disk: 5712kB -> Seq Scan on nodes (cost=0.00..46630.50 rows=161385 width=25) (actual time=0.611..4464.413 rows=161264 loops=1) Filter: ((title)::text ~~* 's%'::text) Total runtime: 5260.791 ms (6 rows) This was much to slow for using it with autocomplete. With some information from Using PostgreSQL in Web 2.0 Applications I was able to improve that with a special index =# create index title_idx on nodes using btree(lower(title) text_pattern_ops); =# explain analyze select title,score from nodes where lower(title) like lower('s%') order by score desc limit 10; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------ Limit (cost=18122.41..18122.43 rows=10 width=25) (actual time=1324.703..1324.708 rows=10 loops=1) -> Sort (cost=18122.41..18144.60 rows=8876 width=25) (actual time=1324.700..1324.702 rows=10 loops=1) Sort Key: score Sort Method: top-N heapsort Memory: 17kB -> Bitmap Heap Scan on nodes (cost=243.53..17930.60 rows=8876 width=25) (actual time=96.124..1227.203 rows=161264 loops=1) Filter: (lower((title)::text) ~~ 's%'::text) -> Bitmap Index Scan on title_idx (cost=0.00..241.31 rows=8876 width=0) (actual time=90.059..90.059 rows=161264 loops=1) Index Cond: ((lower((title)::text) ~>=~ 's'::text) AND (lower((title)::text) ~<~ 't'::text)) Total runtime: 1325.085 ms (9 rows) So this gave me a speedup of factor 4. But can this be further improved? What if I want to use '%s%' instead of 's%'? Do I have any chance of getting a decent performance with PostgreSQL in that case, too? Or should I better try a different solution (Lucene?, Sphinx?) for implementing my autocomplete feature?

    Read the article

  • mysql join default value

    - by andy
    I've been trying to use the IsNull() function to ensure that there is a value for a field. $result = mysql_query(" SELECT crawled.id,IsNull(sranking.score,0) as Score,crawled.url,crawled.title,crawled.blurb FROM crawled LEFT JOIN sranking ON crawled.id = sranking.sid WHERE crawled.body LIKE '%".$term."%' ORDER BY Score DESC LIMIT " . $start . "," . $c . " ") or die(mysql_error()); But I get the error message:Incorrect parameter count in the call to native function 'IsNull' Anybody have any ideas? I'm pretty new to mySQL.

    Read the article

  • Objective-c Novice - Needs help with string with variable

    - by user544006
    Im trying to get my label to print out "your score is ." All i can find online is how to print using printf: int score=2; printf("You scored %i", score); But this does not work when using the setText method. I have also tried labelAnswer.setText:("You scored %i", score); [labelAnswer setText:("You scored %i", score)]; But these do not work. I get an error: "request for member in something not a structure or union" Can anyone help?

    Read the article

  • How to get this XmlAttribute

    - by user328738
    From the MusicBrainz REST service, I get the following xml: <artist-list offset="0" count="59"> <artist type="Person" id="xxxxx" ext:score="100"> ... Using WCF and XmlSerializationFormat, I'm able to get the type and id attributes... but How do I get the "ext:score" one? This works: public class Artist { [XmlAttribute("id")] public string ID { get; set; } [XmlAttribute("type")] public ArtistType Type { get; set; } But this doesnt: [XmlAttribute("ext:score")] public string Score { get; set; } It produces a serialization exception. I've also tried just using "score", but it doesn't work. Any help?

    Read the article

  • Order hybrid mixed mysql search result in one query?

    - by Fredrik
    This problem is easy fixed clientside. But for performance I want to do it directly to the database. LIST a +------+-------+-------+ | name | score | cre | +------+-------+-------+ | Abe | 3 | 1 | | Zoe | 5 | 2 | | Mye | 1 | 3 | | Joe | 3 | 4 | Want to retrieve a joined hybrid result without duplications. Zoe (1st higest score) Joe (1st last submitted) Abe (2nd highest score) Mye (2nd last submitted) ... Clientside i take each search by itself and step though them. but on 100.000+ its getting awkward. To be able to use the LIMIT function would ease things up a lot! SELECT name FROM a ORDER BY score DESC, cre DESC; SELECT name FROM a ORDER BY cre DESC, score DESC;

    Read the article

  • SQL Simple ORDER BY

    - by AeroDroid
    I'm new to SQL and I don't think this question should be hard to answer. I have a high-score table for a game that contains the columns name, score, and rank. I want to know how I can order the table by descending order each time a new score is added so the table can always stay ordered by score. I know this is the wrong way of doing this, but I hope this makes my point kind of clearer. UPDATE `HSTable`.`Highscores` ORDER BY `Highscores`.`score` DESC; What is the correct way of approaching this? One more thing, is there a way I can set it so that the ranking value always stays where it's suppose to be from the SQL, for example, 1st place is always at the top regardless the score? Thanks!

    Read the article

  • GROUP BY as a way to pick the first row from a group of similar rows, is this correct, is there any

    - by FipS
    I have a table which stores test results like this: user | score | time -----+-------+------ aaa | 90% | 10:30 bbb | 50% | 9:15 *** aaa | 85% | 10:15 aaa | 90% | 11:00 *** ... What I need is to get the top 10 users: user | score | time -----+-------+------ aaa | 90% | 11:00 bbb | 50% | 9:15 ... I've come up with the following SELECT: SELECT * FROM (SELECT user, score, time FROM tests_score ORDER BY user, score DESC, time DESC) t1 GROUP BY user ORDER BY score DESC, time LIMIT 10 It works fine but I'm not quite sure if my use of ORDER BY is the right way to pick the first row of each group of sorted records. Is there any better practice to achieve the same result? (I use MySQL 5)

    Read the article

  • Facebook writing on a wall problem - retrieves only null value.

    - by Viral
    hi all friends, I am making a game application in that I want to pass my score on wall of face book. I've completed all the things (the log in and message passing part) but when I passes the score via global variable, I am getting only null as a value and not the score that I want. Is there any way to pass data or string to Face book and write on a wall? My code is (void)viewDidLoad { static NSString* kApiKey = @"be60415be308e2b44c0ac1db83fe486b"; static NSString* kApiSecret = @"4f880c7e100321f808c41b1d3c813dfa"; _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain]; score = [NSString stringWithFormat:@"%@",appDelegate.myTextView]; [_session resume]; [super viewDidLoad]; } whre score is NSString and myTextView is NSString in other viewcontrollerfile, And appDelegate is global variable. Any help?? thanks in advance.

    Read the article

  • what is the return value of BeautifulSoup.find ?

    - by prosseek
    I run to get some value as score. score = soup.find('div', attrs={'class' : 'summarycount'}) I run 'print score' to get as follows. <div class=\"summarycount\">524</div> I need to extract the number part. I used re module but failed. m = re.search("[^\d]+(\d+)", score) TypeError: expected string or buffer function search in re.py at line 142 return _compile(pattern, flags).search(string) What's the return type of the find function? How to get the number from the score variable? Is there any easy way to let BeautifulSoup to return the value(in this case 524) itself?

    Read the article

  • Adding values from different tables

    - by damdeok
    Friends, I have these tables: Contestant Table: Winner Peter Group Table: Id Name Score Union 1 Bryan 3 77 2 Mary 1 20 3 Peter 5 77 4 Joseph 2 25 5 John 6 77 I want to give additional score of 5 to Peter on Group Table. So, I came up with this query. UPDATE Group SET Score = Score+5 FROM Contestant, Group WHERE Contestant.Winner = Group.Name Now, I want also to give additional score of 5 to the same Union as Peter which is 77. How can I integrate it as one query to my existing query?

    Read the article

  • SQL query to get field value distribution

    - by Bryan Lewis
    I have a table of over 1 million test score records that basically have a unique score_ID, a subject_ID and a score given by a person. The score range for most subjects is 0-3, but some have a range of 0-4. There are about 25 possible subjects. I need to produce a score distribution report which looks like: subject_ID 0 1 2 3 4 ---------- --- --- --- --- --- 1 967 576 856 234 2 576 947 847 987 324 . . So it groups the data by subject_ID, then shows how many times a specific score value was given within that subject. Any SQL pointers to generate this would be greatly appreciated.

    Read the article

  • Function for averages of tuples in a dictionary

    - by Billy Mann
    I have a string, dictionary in the form: ('the head', {'exploded': (3.5, 1.0), 'the': (5.0, 1.0), "puppy's": (9.0, 1.0), 'head': (6.0, 1.0)}) Each parentheses is a tuple which corresponds to (score, standard deviation). I'm taking the average of just the first integer in each tuple. I've tried this: def score(string, d): for word in d: (score, std) = d[word] d[word]=float(score),float(std) if word in string: word = string.lower() number = len(string) return sum([v[0] for v in d.values()]) / float(len(d)) if len(string) == 0: return 0 When I run: print score('the head', {'exploded': (3.5, 1.0), 'the': (5.0, 1.0), "puppy's": (9.0, 1.0), 'head': (6.0, 1.0)}) I should get 5.5 but instead I'm getting 5.875. Can't figure out what in my function is not allowing me to get the correct answer.

    Read the article

  • SQL query to get field value distribution (mode)

    - by Bryan Lewis
    I have a table of over 1 million test score records that basically have a unique score_ID, a subject_ID and a score given by a person. The score range for most subjects is 0-3, but some have a range of 0-4. There are about 25 possible subjects. I need to produce a score distribution report which looks like: subject_ID 0 1 2 3 4 ---------- --- --- --- --- --- 1 967 576 856 234 2 576 947 847 987 324 . . So it groups the data by subject_ID, then shows how many times a specific score value was given within that subject. Any SQL pointers to generate this would be greatly appreciated.

    Read the article

  • Passing Global Variable value to Facebook - Gets NULL only

    - by Viral
    hi all friends, I am making a game application in that I want to pass my score on wall of face book. I've completed all the things (the log in and message passing part) but when I passes the score via global variable, I am getting only null as a value and not the score that I want. Is there any way to pass data or string to Face book and write on a wall? My code is (void)viewDidLoad { static NSString* kApiKey = @"be60415be308e2b44c0ac1db83fe486b"; static NSString* kApiSecret = @"4f880c7e100321f808c41b1d3c813dfa"; _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain]; score = [NSString stringWithFormat:@"%@",appDelegate.myTextView]; [_session resume]; [super viewDidLoad]; } whre score is NSString and myTextView is NSString in other viewcontrollerfile, And appDelegate is global variable. Any help?? thanks in advance.

    Read the article

  • Strange sql query result from Mysql and from PHP mysqli_query!

    - by qinHaiXiang
    this is the query command echo from php web page: SELECT DISTINCT FT.file_type_name AS type,FT.file_type_en AS tp,FT.file_type_id AS fti, MATCH(keywords) AGAINST ('words <2' IN BOOLEAN MODE ) AS score FROM movie AS M,file_type AS FT WHERE MATCH (keywords) AGAINST ('words <2' IN BOOLEAN MODE ) AND M.type_cn = FT.file_type_id HAVING score >=1 ORDER BY FT.file_type_order; I am running above query in MySQL tools HeidiSQL and got only tow row records which score are 1.66666 and 2. If I remove the HAVING clause I would got three row records with one's score less than 1. But the same query I get from PHP mysqli_query() were all the three records and the one which score less than 1 became 1. What is the problem. Any tips will be pleasure. Thank you very much!!

    Read the article

  • Quick, Beginner C++ Overloading Question - Getting the compiler to perceive << is defined for a spec

    - by Francisco P.
    Hello everyone. I edited a post of mine so I coul I overloaded << for a class, Score (defined in score.h), in score.cpp. ostream& operator<< (ostream & os, const Score & right) { os << right.getPoints() << " " << right.scoreGetName(); return os; } (getPoints fetches an int attribute, getName a string one) I get this compiling error for a test in main(), contained in main.cpp binary '<<' : no operator found which takes a right-hand operand of type 'Score' (or there is no acceptable conversion) How come the compiler doesn't 'recognize' that overload as valid? (includes are proper) Thanks for your time.

    Read the article

  • Ruby on Rail - Format for fetching and displaying Dymanic drop down

    - by Ruby
    Hi, I have 3 tables : Student , Subject and Score Every student can add 3 Subjects (Physics, Mathematics and Chemistry) marks. The combination of (student_id + subject_id) is added to Score table. i.e., capturing that sudent '1' has added 'Mathematics' marks with the actual score (say 0-100 range) student id : subjectid Score 1 Mathematics 95 The Add page of Score has a "subject" drop down. which is displayed from "subject" table. When the student wants to add the 2nd subject marks, in the add page, he should not be displayed the previoys added subject in the drop down. Can any1 tell me how to do this?

    Read the article

  • Pass value of a field to Silverlight ConverterParameter

    - by eidylon
    Hi all, I'm writing my very first Silverlight app. I have a datagrid with a column that has two labels, for the labels, i am using an IValueConverter to conditionally format the data. The label's "Content" is set as such: Content="{Binding HomeScore, Converter={StaticResource fmtshs}}" and Content="{Binding AwayScore, Converter={StaticResource fmtshs}}" The Convert method of my IValueConverter is such: Public Function Convert( ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert Dim score As Long = value, other As Long = parameter Return If(score < 0, "", If(score - other > 5, (other + 5).ToString, score.ToString) ) End Function So what i want to do is in the converter for HomeScore, i want to pass AwayScore to the ConverterParameter, and for AwayScore i want to pass the HomeScore to the converter. In the converter for either score i need to be able to know the value of the other score for formatting purposes. But i cannot figure out the syntax for binding the ConverterParameter to another field. I've tried the following: Content="{Binding HomeScore, Converter={StaticResource fmtshs}, ConverterParameter=AwayScore}" Content="{Binding HomeScore, Converter={StaticResource fmtshs}, ConverterParameter={AwayScore}}" Content="{Binding HomeScore, Converter={StaticResource fmtshs}, ConverterParameter={Binding AwayScore}}" But none of those seem to work. How do i pass a field value to the ConverterParameter?

    Read the article

  • C++ Set Erase Entry Question

    - by Wallace
    Hi. I encountered a problem here. I'm using C++ multiset. This is the test file. Score: 3-1 Ben Steven Score: 1-0 Ben Score: 0-0 Score: 1-1 Cole Score: 1-2 Ben I'm using while loop and ifstream (fin1) to read in from the test file above. multiset<string, less<string> > myset; while(!fin1.eof()) { fin1 >> scoreName; if(scoreName == "Score:") { //calculates number of matches played } else { goalCheck = scoreName.substr(1,1); if(goalCheck == "-") { string lGoal, rGoal; lGoal = scoreName.substr(0,1); rGoal = scoreName.substr(2,1); int leftGoal, rightGoal; leftGoal = atoi(lGoal.c_str()); rightGoal = atoi(rGoal.c_str()); if(leftGoal > rightGoal) //if team wins { //some computations } else if(leftGoal < rightGoal) //if team loses { //computations } else if(leftGoal == rightGoal) //if team draws { //computations } else { myset.insert(myset.begin(), scoreName); } } } I'm inserting all names into myset (regardless of wins/loses/draws) in my last else statement. But I only require the names of those matches who won/draw. Those names whose matches lost will not be included in myset. In the test file above, there's only one match that lost (1-2) and I wanted to remove "Ben". How can I do that? I tried to use myset.erase(), but I'm not sure how to get it point to Ben and remove it from myset. Any help is much appreciated. Thanks.

    Read the article

  • event flow in action script 3

    - by Shay
    i try to dispatch a custom event from some component on the stage and i register other component to listen to it but the other component doesn't get the event here is my code what do i miss public class Main extends MovieClip //main document class { var compSource:Game; var compMenu:Menu; public function Main() { compSource = new Game; compMenu = new Menu(); var mc:MovieClip = new MovieClip(); addChild(mc); mc.addChild(compSource); // the source of the event - event dispatch when clicked btn mc.addChild(compMenu); //in init of that Movie clip it add listener to the compSource events } } public class Game extends MovieClip { public function Game() { btn.addEventListener(MouseEvent.CLICK, onFinishGame); } private function onFinishGame(e:MouseEvent):void { var score:Number = Math.random() * 100 + 1; dispatchEvent(new ScoreChanged(score)); } } public class Menu extends MovieClip { //TextField score public function Menu() { addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, init); //on init add listener to event ScoreChanged addEventListener(ScoreChanged.SCORE_GAIN, updateScore); } public function updateScore(e:ScoreChanged):void { //it never gets here! tScore.text = String(e._score); } } public class ScoreChanged extends Event { public static const SCORE_GAIN:String = "SCORE_GAIN"; public var _score:Number; public function ScoreChanged( score:Number ) { trace("new score"); super( SCORE_GAIN, true); _score = score; } } I don't want to write in Main compSource.addEventListener(ScoreChanged.SCORE_GAIN, compMenu.updateScore); cause i dont want the the compSource will need to know about compMenu its compMenu responsibility to know to what events it needs to listen.... any suggestions? Thanks!

    Read the article

  • Cakephp how to use Set Class to make an assoc array?

    - by michael
    I have the output array from a $Model-find() query which also pulls data from a hasMany relationship: Array( [Parent] => Array ( [id] => 1 ) [Child] => Array ( [0] => Array ( [id] => aaa [score] => 3 [src] => stage6/tn~4bbb38cc-0018-49bf-96a9-11a0f67883f5.jpg [parent_id] => 1 ) [1] => Array ( [id] => bbb [score] => 5 [src] => stage0/tn~4bbb38cc-00ac-4b25-b074-11a0f67883f5.jpg [parent_id] => 1 ) [2] => Array ( [id] => ccc [score] => 2 [src] => stage4/tn~4bbb38cc-01c8-44bd-b71d-11a0f67883f5.jpg [parent_id] => 1 ) ) ) I'd like to transform this output into something like this, where the child id is the key to additional child attributes: Array( [aaa] => Array ( [score] => 3 [src] => stage6/tn~4bbb38cc-0018-49bf-96a9-11a0f67883f5.jpg ) [bbb] => Array ( [score] => 5 [src] => stage0/tn~4bbb38cc-00ac-4b25-b074-11a0f67883f5.jpg ) [ccc] => Array ( [score] => 2 [src] => stage4/tn~4bbb38cc-01c8-44bd-b71d-11a0f67883f5.jpg ) } Is there an easy way to use Set::extract, Set::combine, Set::insert, etc. to do this efficiently? I cannot figure it out.

    Read the article

  • Solr/Lucene Scorer

    - by TFor
    We are currently working on a proof-of-concept for a client using Solr and have been able to configure all the features they want except the scoring. Problem is that they want scores that make results fall in buckets: Bucket 1: exact match on category (score = 4) Bucket 2: exact match on name (score = 3) Bucket 3: partial match on category (score = 2) Bucket 4: partial match on name (score = 1) First thing we did was develop a custom similarity class that would return the correct score depending on the field and an exact or partial match. The only problem now is that when a document matches on both the category and name the scores are added together. Example: searching for "restaurant" returns documents in the category restaurant that also have the word restaurant in their name and thus get a score of 5 (4+1) but they should only get 4. I assume for this to work we would need to develop a custom Scorer class but we have no clue on how to incorporate this in Solr. Another option is to create a custom SortField implementation similar to the RandomSortField already present in Solr. Maybe there is even a simpler solution that we don't know about. All suggestions welcome!

    Read the article

  • XP Leveling System - PHP

    - by Michael Rich
    Rank Table ID, Primary Key RANK, The rank or level, 1 being the highest and 3 the lowest MIN_SCORE, The minimum amount of point or XP needed to reach the rank NAME, The associated name of the rank Rank Table +----+------+-----------+-------------------------+ | ID | RANK | MIN_SCORE | NAME | +----+------+-----------+-------------------------+ | 1 | 1 | 18932 | Editor-in-Chief | | 2 | 2 | 15146 | Senior Technical Writer | | 3 | 3 | 12116 | Senior Copywriter | +----+------+-----------+-------------------------+ Ranking Table ID, Primary Key FK_MEMEBER_ID, Foreign Key to member's Primary Key FK_RANK, Foreign Key to Author Rank Table's Rank column (top) SCORE, The member's current earned score or XP Ranking Table +-----+--------------+---------+-------+ | ID | FK_MEMBER_ID | FK_RANK | SCORE | +-----+--------------+---------+-------+ | 1 | 1 | 1 | 17722 | | 2 | 2 | 2 | 16257 | | 3 | 3 | 3 | 12234 | +-----+--------------+---------+-------+ In my class I have stored the ranks -- matching those in the Rank Table -- and correlating minimum scores; RANK as key and MINIMUM_SCORE as value. When a member's score (XP) is updated (up/down) I want to test that updated score against the below array to determine if their rank needs updating too. private $scores = array('3' => '12116', '2' => '15146', '1' => '18932',); Using the updated score, how could I determine the correlating rank from the above array? Everything is open to scrutiny, this is my first time creating a ranking system so I hope to get it right :)

    Read the article

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