private void buildPlaylist() { blankPlaylist(); // For every number in the msgList, look up the corresponding word in enum words // if there is no IWMPMedia object with that name, create one and add it to the new playlist // else just add the one that already exists foreach (int number in msgList) { IWMPMedia clip; words word = (words)number; IWMPMedia dword = dictionary.get_Item(number); if (dword.name == word.ToString()) { playlist.appendItem(dword); } else { string addr = @"Resources\" + word.ToString() + ".wav"; clip = Player.newMedia(addr); clip.name = word.ToString(); playlist.appendItem(clip); } } Player.currentPlaylist = playlist; }
public registered() { InitializeComponent(); words w = new words(); w.initialize(); }
public void primeData() { master = masterObj.GetComponent <MasterCont>(); testModeReady = true; masterInt = MIUA.GetComponent <MasterIntelUnitAlpha>(); wordList = wordObj.GetComponent <words>(); }
private void buildDictionary() { // Create playlists to hold Dictionary and message dictionary = Player.newPlaylist("Dictionary", null); playlist = Player.newPlaylist("ATIS", null); // For every word in enum words, create a corresponding IWMPMedia object int length = Enum.GetNames(typeof(words)).Length; for (int i = 0; i < length; i++) { words word = (words)i; string addr = @"Resources\" + word.ToString() + ".wav"; if (File.Exists(addr)) { IWMPMedia clip = Player.newMedia(addr); clip.name = word.ToString(); dictionary.appendItem(clip); } else { MessageBox.Show("Could not find the file " + addr); break; } } Player.settings.setMode("loop", true); Player.settings.autoStart = false; }
void Start() { int rand = Random.Range(0, sets.Count); words temp = sets[rand]; GetComponentInChildren <MultiGame>().SetWord(temp.word.ToUpper(), temp.hint); SceneManager.LoadScene("MultiGame"); }
public uHome() { InitializeComponent(); word = new words(); word.initialize(); SearchWord.ItemsSource = word.word; SearchWord.SelectedIndex = 0; }
public ActionResult Count() { words newWords = new words(); newWords.SetParagraph(Request.Form["inputPara"]); newWords.SetWord(Request.Form["inputWord"]); newWords.Compare(); return(View("index", newWords.GetScore())); }
void fireUpFiles() { testMode = testObject.GetComponent <testMode>(); learn = learnModeObj.GetComponent <learnModeLet>(); MastIntUA = MIUA.GetComponent <MasterIntelUnitAlpha>(); startB = startObj.GetComponent <StartBut>(); xml = XMLObj.GetComponent <XmlManager>(); worldList = wordObj.GetComponent <words>(); }
/// <summary> /// This method loads data from dll and reads and rites into list /// </summary> public void LoadDataFromDLL() { //create a words object and store the words into list<word> words objDllData = new words(); ltDllData = new List <word>(); for (int i = 0; i < objDllData.Count; i++) { ltDllData.Add(objDllData[i]); } }
public aHome() { InitializeComponent(); stat = new string[] { "noun", "verb", "adjective", "adverb" }; word = new words(); word.initialize(); aStatus.ItemsSource = stat; aStatus.SelectedIndex = 0; SearchWord.ItemsSource = word.word; SearchWord.SelectedIndex = 0; }
public void UserWord_GetWord_True() { //Arrange string newWord = "pizza"; words newWords = new words(); //Act newWords.SetWord(newWord); string result = newWords.GetWord(); //Assert Assert.AreEqual(result, newWord); }
public void UserParagraph_GetParagraph_True() { //Arrange string newParagraph = "oh boy, i sure love pizza"; words newWords = new words(); //Act newWords.SetParagraph(newParagraph); string result = newWords.GetParagraph(); //Assert Assert.AreEqual(result, newParagraph); Console.WriteLine(result); }
public void tester() { t.tester(); ques = t.ques; answer = t.answer; words w = new words(); w.initialize(); question.Content = (count + 1) + ".What is the translation of \"" + w.word[ques] + "\" ?"; a1.Content = w.translation[answer[0]]; a2.Content = w.translation[answer[1]]; a3.Content = w.translation[answer[2]]; a4.Content = w.translation[answer[3]]; a5.Content = w.translation[answer[4]]; }
public void UserParagraph_SplitParagraph_True() { //Arrange string newParagraph = "oh boy, i sure love pizza"; string[] array = { "oh", "boy,", "i", "sure", "love", "pizza" }; words newWords = new words(); //Act newWords.SetParagraph(newParagraph); newWords.GetParagraph(); string[] result = newWords.Split(); //Assert CollectionAssert.AreEqual(array, result); Console.WriteLine(result); }
public bool delete_word(int id) { using (english_projectEntities db = new english_projectEntities()) { words w = db.words.Find(id); try { db.words.Remove(w); db.SaveChanges(); } catch { return(false); } return(true); } }
static void Main(string[] args) { string[] words = new string[] { "practice", "makes", "coding", "perfect", "makes" }; words ws = new words(words); var result = ws.wordList; Console.WriteLine(string.Join(',', result)); string word1 = "practice"; string word2 = "coding"; var num = ws.shortestDistance(word1, word2); Console.WriteLine(num); }
public void UserParagraph_Compare_True() { //Arrange string newWord = "pizza"; string newParagraph = "oh boy, i sure love pizza"; words newWords = new words(); //Act newWords.SetWord(newWord); newWords.SetParagraph(newParagraph); string testWord = newWords.GetWord(); string[] testPara = newWords.Split(); int result = newWords.Compare(testWord, testPara); //Assert Assert.AreEqual(result, 1); }
public bool update_word(int id, int technos_id, string word, string translation) { using (english_projectEntities db = new english_projectEntities()) { words w = db.words.Find(id); w.technos_id = technos_id; w.word = word; w.translation = translation; try { db.SaveChanges(); } catch { return(false); } return(true); } }
// POST api/count public HttpResponseMessage Post() { var httpRequest = HttpContext.Current.Request; //HttpRequestMessage request = this.Request; //if (request.Content.IsMimeMultipartContent()) { // Console.WriteLine("yes"); //} if (httpRequest.Files.Count < 1) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } int totalWords = 0; foreach (string file in httpRequest.Files) { var postedFile = httpRequest.Files[file]; var filePath = HttpContext.Current.Server.MapPath("~/TempStorage/" + postedFile.FileName); postedFile.SaveAs(filePath); totalWords = totalWords + getTotalWordCount(filePath); // NOTE: To store in memory use postedFile.InputStream } var origin = HttpContext.Current.Request.Headers["Origin"]; HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", origin); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET,POST"); //string callback = HttpContext.Current.Request.QueryString["callback"]; var word = new words(); word.word = totalWords; return(Request.CreateResponse(HttpStatusCode.OK, word)); //return callback + "([{ words:" + totalWords.ToString() + "}]);"; }
/// <summary> /// Load the Table with the details from wordContainer.dll /// </summary> private void LoadFlashTable() { words objDllData = new words(); ltDllData = new List <word>(); for (int i = 0; i < objDllData.Count; i++) { ltDllData.Add(objDllData[i]); } //Open the connection and insert the words into flash-word-table by checking if the word already exists or not try { using (SqlConnection conn = new SqlConnection(connString)) { conn.Open(); foreach (WordEventArgs word in ltFlashWords) { //check if the word already exists else discard it string checkquery = "select Spelling from \"flash-word-table\" where Spelling='" + word.Spelling + "'"; SqlCommand sqlcmd = new SqlCommand(checkquery, conn); Object spelling = sqlcmd.ExecuteScalar(); if (spelling == null) { string queryText = "insert into \"flash-word-table\" values('" + word.Spelling + "')"; SqlCommand cmd = new SqlCommand(queryText, conn); cmd.ExecuteNonQuery(); } } } } catch (Exception ex) { MessageBox.Show("There is some error caught. Err: " + ex.Message); } ReadFlashTable(); }
=> ReadStaticSize(words, Size, w => new JumpOnConditionInstruction(w));
private void radio(object sender, RoutedEventArgs e) { a1.IsEnabled = false; a2.IsEnabled = false; a3.IsEnabled = false; a4.IsEnabled = false; a5.IsEnabled = false; words w = new words(); w.initialize(); string a = w.translation[ques]; if (a1.IsChecked == true && a1.Content.ToString() == a) { r.insert(w.word[ques], a, a1.Content.ToString()); result.Content = "True :)"; } else if (a2.IsChecked == true && a2.Content.ToString() == a) { r.insert(w.word[ques], a, a2.Content.ToString()); result.Content = "True :)"; } else if (a3.IsChecked == true && a3.Content.ToString() == a) { r.insert(w.word[ques], a, a3.Content.ToString()); result.Content = "True :)"; } else if (a4.IsChecked == true && a4.Content.ToString() == a) { r.insert(w.word[ques], a, a4.Content.ToString()); result.Content = "True :)"; } else if (a5.IsChecked == true && a5.Content.ToString() == a) { r.insert(w.word[ques], a, a5.Content.ToString()); result.Content = "True :)"; } else if (a1.IsChecked == true && a1.Content.ToString() != a) { result.Content = "False :("; r.insert(w.word[ques], a, a1.Content.ToString()); } else if (a2.IsChecked == true && a2.Content.ToString() != a) { result.Content = "False :("; r.insert(w.word[ques], a, a2.Content.ToString()); } else if (a3.IsChecked == true && a3.Content.ToString() != a) { result.Content = "False :("; r.insert(w.word[ques], a, a3.Content.ToString()); } else if (a4.IsChecked == true && a4.Content.ToString() != a) { result.Content = "False :("; r.insert(w.word[ques], a, a4.Content.ToString()); } else if (a5.IsChecked == true && a5.Content.ToString() != a) { result.Content = "False :("; r.insert(w.word[ques], a, a5.Content.ToString()); } else { } }
words[i] = words[i].Remove(words[i].Length - 1, 1);
return parse(words);
=> ReadStaticSize(words, Size, w => new MoveByteImmediateInstruction(w));
public string lang(words word) { return(Dic[word]); }
SwapLastChars(ref words[i - 1], ref words[i]);
if (IsDelimChar(words[i][^ 1])) // Если второе слово оканчивается не-буквой
public ActionResult Index() { words newWords = new words(); return(View(newWords.GetScore())); }
if (!words[i - 1][^ 1].Equals(words[i][0]))
/// <summary> /// /// </summary> /// <param name="textid"></param> /// <param name="w">The single word to be converted to a number</param> /// <returns> the new maxid from textwords</returns> private async Task CompressRange(Text t, string w, bool pAddSpace, bool addDot, bool addComma, bool pIsFootNote, bool pIsHeader, bool isColon, bool bAddSemiColon, bool pIsHyphen, bool paddLBracket, bool ppaddRBracket, bool paddRParenthesis, bool paddLParenthesis, bool paddLSQuote, bool paddRSQuote, bool paddLDQuote, bool paddRDQuote, bool paddLT, bool paddGT, bool paddSlash, bool paddBang, bool addPreSpace, bool pAddQMark, bool pAddSlashAfter, bool pAddEqual, bool pAddAmp, int langid ) { //short wordid = 0; // we only find case sensitve searches IsCapitalized(w, out bool capitalized, out bool allCaps); if (capitalized || allCaps) { w = w.ToLower(); } // numbers can become huge, and thus, waste space! bool isNumber = int.TryParse(w, out int number); var foundWord = await FindWord(w, langid); if (foundWord == null) { foundWord = new words() { IsNumber = isNumber, //TODO: make language LangId = (short)langid }; if (isNumber) { foundWord.number = number; } else { foundWord.word = w; } //TODO findout if this is optional, if so, leave out. if (maxWordId == null) { maxWordId = await _context.Words.MaxAsync(m => m.id.Value); } maxWordId++; foundWord.id = maxWordId; if (!isNumber) { foundWord.hash = new Models.WordLanguageKey(w, langid).GetHashCode(); } _context.Words.Add(foundWord); } var wordid = foundWord.id.Value; var tw = new TextWords { id = ++maxTextWordId, textid = t.textid, IsAllCaps = allCaps, AddSpace = pAddSpace, IsFootNote = pIsFootNote, IsHeader = pIsHeader, wordid = wordid, IsCapitalized = capitalized, AddComma = addComma, AddDot = addDot, AddColon = isColon, AddHyphenMin = pIsHyphen, LSQuote = paddLSQuote, RSQuote = paddRSQuote, RDQuote = paddRDQuote, LDQuote = paddLDQuote, RParentThesis = paddRParenthesis, LParentThesis = paddLParenthesis, AddGT = paddGT, AddLT = paddLT, AddSlash = paddSlash, AddBang = paddBang, LBracket = paddLBracket, Semicolon = bAddSemiColon, RBracket = ppaddRBracket, PreSpace = addPreSpace, QMark = pAddQMark, AddSlashAfter = pAddSlashAfter, AddEqual = pAddEqual, PrefixAmp = pAddAmp }; tw.words = foundWord; t.TextWords.Add(tw); }