Search Results

Search found 1181 results on 48 pages for 'letters'.

Page 4/48 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Create alphabetical Pagination in wordpress

    - by user1870689
    I need to display list of names with alphabetical pagination in wordpress. Example.... when B is selected.. A B C D...X Y Z Bassil | Bastien | Belta | Billy | Bynoo and when i click A, i need only names starting with A... I found this code on PasteBin ... but it create the full list, I need all letters to appear like A B C D ..... X Y Z ........... and only display names with starting letter selected...

    Read the article

  • Letters in base-conversion

    - by tech_geek23
    I have this code written so far and is correct, aside from not using A-F when the value is over 10: public class TenToAny { private int base10; private int newBase; public TenToAny() { } public TenToAny(int ten, int base) { base10 = ten; newBase = base; } public void setNums(int ten, int base) { base10 = ten; newBase = base; } public String getNewNum() { String newNum=""; int orig = base10; //int first = newBase - 1; while(orig > 0) { newNum = orig%newBase + newNum; orig = orig/newBase; } return newNum; } public String toString() { String complete = base10 + " base 10 is " + getNewNum() + " in base " + newBase; return complete; } } Obviously I don't have anything relating to values over 10 converting to A-F as I've never dealt with these before. Any help is appreciated. Here's my runner class: public class Lab09i { public static void main( String args[] ) { TenToAny test = new TenToAny(234, 9); out.println(test); test.setNums(100, 2); out.println(test); test.setNums(10, 2); out.println(test); test.setNums(15, 2); out.println(test); test.setNums(256, 2); out.println(test); test.setNums(100, 8); out.println(test); test.setNums(250, 16); out.println(test); test.setNums(56, 11); out.println(test); test.setNums(89, 5); out.println(test); test.setNums(23, 3); out.println(test); test.setNums(50, 5); out.println(test); test.setNums(55, 6); out.println(test); test.setNums(2500, 6); out.println(test); test.setNums(2500, 13); out.println(test); } } this is what my results should be: 234 base 10 is 280 in base 9 100 base 10 is 1100100 in base 2 10 base 10 is 1010 in base 2 15 base 10 is 1111 in base 2 256 base 10 is 100000000 in base 2 100 base 10 is 144 in base 8 250 base 10 is FA in base 16 56 base 10 is 51 in base 11 89 base 10 is 324 in base 5 23 base 10 is 212 in base 3 50 base 10 is 302 in base 4 55 base 10 is 131 in base 6 2500 base 10 is 9C4 in base 16 2500 base 10 is 11A4 in base 13

    Read the article

  • Learning Python and trying to get first two letters and last two letters of a string.

    - by Sergio Tapia
    Here's my code: # B. both_ends # Given a string s, return a string made of the first 2 # and the last 2 chars of the original string, # so 'spring' yields 'spng'. However, if the string length # is less than 2, return instead the empty string. def both_ends(s): if len(s) <= 2: return "" else: return s[0] + s[1] + s[len(s)-2] + s[len(s-1)] # +++your code here+++ return Unfortunately my program doesn't run. :( I'm sure I'm overlooking something since I'm a newbie with Python. Here's the error: > Traceback (most recent call last): File "C:\Users\Sergio\Desktop\google-python-exercises\google-python-exercises\basic\string1.py", line 120, in <module> main() File "C:\Users\Sergio\Desktop\google-python-exercises\google-python-exercises\basic\string1.py", line 97, in main test(both_ends('spring'), 'spng') File "C:\Users\Sergio\Desktop\google-python-exercises\google-python-exercises\basic\string1.py", line 44, in both_ends return s[0] + s[1] + s[len(s)-2] + s[len(s-1)] TypeError: unsupported operand type(s) for -: 'str' and 'int' Thanks for the help guys. :D

    Read the article

  • Display Special Characters (Korean Letters) in RichTextBox

    - by Peter Lee
    Hi, My question might be a little bit confusing, but I think it's still worth of paying some attention. Basically I'm designing a program to display all printable Unicode characters in a RichTextBox. I'm using VC# 2010 Express Edition. However, the RichTextBox has a critical problem: some special characters cannot be displayed correctly. For example, some Korean Characters (??????????????????????????????), can be displayed correctly in Microsoft Word. After I copy to the RichTextBox, the characters cannot be displayed correctly. However, when I copy back to Microsoft Word, it can be displayed correctly. Therefore, it's a display problem (the characters themselves are correct). I guess it might be a font problem. Some related property info: RichTextBox.Font.GdiChaSet RichTextBox.Font How can I solve it? So that all printable Unicode characters can be displayed correctly (using different fonts for different CharSets are acceptable). Actually, I need further assistance about removing all formatting when pasting rtbxFileContent.Paste(DataFormats.GetFormat(DataFormats.Text)); // DataFormats.UnicodeText I still need to have all printable characters to be displayed correctly, but without any formatting (except font). Thanks. Hope I made myself understood.

    Read the article

  • ASP Classic, SQL 2008, XML Output, and DSN vs DSN-Less Produces Chinese Letters

    - by RoLYroLLs
    I've been having a problem for the past month and can't seem to figure out what is wrong. Here's the setup and a little background. Background: I have a web-host who was running my website on Windows Server 2003 and SQL Server 2000. One of my webpages returned a result set from a stored procedure from the SQL server as xml. Below is the code: Stored Procedure: select top 10 1 as tag , null as parent , column1 as [item!1!column1!element] , column2 as [item!1!column2!element] from table1 for XML EXPLICIT ASP Page: index.asp Call OpenConn Set cmd = Server.CreateObject("ADODB.Command") With cmd .ActiveConnection = dbc .CommandText = "name of proc" .CommandType = adCmdStoredProc .Parameters.Append .CreateParameter("@RetVal", adInteger, adParamReturnValue, 4) .Parameters.Append .CreateParameter("@Level", adInteger, adParamInput, 4, Level) End With Set rsItems = Server.CreateObject("ADODB.Recordset") With rsItems .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockBatchOptimistic Set .Source = cmd .Open Set .ActiveConnection = Nothing End With If NOT rsItems.BOF AND NOT rsItems.EOF Then OutputXMLQueryResults rsItems,"items" End If Set rsItems = Nothing Set cmd = Nothing Call CloseConn Sub OpenConn() strConn = "Provider=SQLOLEDB;Data Source=[hidden];User Id=[hidden];Password=[hidden];Initial Catalog=[hidden];" Set dbc = Server.CreateObject("ADODB.Connection") dbc.open strConn End Sub Sub CloseConn() If IsObject(dbc) Then If dbc.State = adStateOpen Then dbc.Close End If Set dbc = Nothing End If End Sub Sub OutputXMLQueryResults(RS,RootElementName) Response.Clear Response.ContentType = "text/xml" Response.Codepage = 65001 Response.Charset = "utf-8" Response.Write "" Response.Write "" While Not RS.EOF Response.Write RS(0).Value RS.MoveNext WEnd Response.Write "" Response.End End Sub Present: All was working great, until my host upgraded to Windows Server 2008 and SQL Server 2008. All of the sudden I was getting results like this: From Browser: From View Source: However, I found that if I use a DSN connection strConn = "DSN=[my DSN Name];User Id=[hidden];Password=[hidden];Initial Catalog=[hidden];" it works perfectly fine! My current host is not going to support DSN any longer, but that's out of scope for this issue. Someone told me to use an ADO.Stream object instead of a Recordset object, but I'm unsure how to implement that. Question: Has anyone run into this and found a way to fix it? What about that ADO.Stream object, can someone help me with a sample that would fit my code?

    Read the article

  • Convert alphabet letters to number in python

    - by altin
    Can someone help me finish this characters = ['a''b''c''d''e''f''g''h''i''j''k''l''m''n''o''p''q''r''t''u''v''w''x''y''z'] numbers = ['1''2''3''4''5''6''7''8''9''10''11''12''13''14''15''16''17''18''19''20''21''22''23''24'] text = raw_input(' Write text: ') Ive tryed to many ways but couldnt get to the pint, I want to make exc if i type hello the output to be in numbers lined like in alphabet... example a = 1 < in alphabet Can anyone give ideas ? or help sth ?

    Read the article

  • .NET RegEx for letters and spaces

    - by user70192
    I am trying to create a regular expression in C# that allows only alphanumeric characters and spaces. Currently, I am trying the following: string pattern = @"^\w+$"; Regex regex = new Regex(pattern); if (regex.IsMatch(value) == false) { // Display error } What am I doing wrong?

    Read the article

  • C# + RegEx for letters and spaces

    - by user70192
    Hello, I am trying to create a regular expression in C# that allows only alphanumeric characters and spaces. Currently, I am trying the following: string pattern = @"^\w+$"; Regex regex = new Regex(pattern); if (regex.IsMatch(value) == false) { // Display error } What am I doing wrong? Thank you!

    Read the article

  • ORDER BY letters and not numbers of a field

    - by Jon
    Is there a way to order mysql results by the first letter and ignore numbers? For example, I have a list of addresses: 123 Main Street 456 Second Street 234 Third Street and I want to order by the street name and ignore the street number. Is there an easy way to do this?

    Read the article

  • Rule of thumb for capitalizing the letters in a programming language

    - by William
    I was wondering if anyone knew why some programming languages that I see most frequently spelled in all caps (like an acronym), are also commonly written in lower case. FORTRAN, LISP, and COBOL come to mind but I'm sure there are many more. Perhaps there isn't any reason for this, but I'm curious to know if any of these changes are due to standards or decisions by their respective communities. Or are people just getting too lazy to hit the caps lock key? (I know I am)

    Read the article

  • How to send news letters in zend

    - by Sherif
    i am trying to send something like news letter Via Zend_Mail but after 12 mail i got this message Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Zend\Apache2\htdocs\forga\library\Zend\Mail\Protocol\Abstract.php on line 321 my Code is like: $smtpHost = 'smtp.gmail.com'; $smtpConf = array( 'auth' = 'login', 'ssl' = 'tls', 'port' = '587', 'username' ='[email protected]', 'password' = 'xxxxxxxx' ); $transport = new Zend_Mail_Transport_Smtp($smtpHost, $smtpConf); foreach($users as $user) { $mail = new Zend_Mail(); $mail-setFrom("[email protected]", 'Forga'); $mail-setSubject($subject); if($html=='on') $mail-setBodyHtml($message); else $mail-setBodyText($message); $mail-addto($user); $transport-send($mail); }

    Read the article

  • Search by Letters using LINQ

    - by Biswo
    hi i m using Linq & C# and i want to filter my data as this syntax in Sql Syntax in sql is I hav one table name Customer in which name is field 'Select name from customer where name like 'C%'' can u help to solve this code in Linq

    Read the article

  • Scan Numbers among letters in a Sentence

    - by ZaZu
    Hello, I have a pretty easy question. (using C) In a sentence such as In this document, there are 345 words and 6 figures How can I scan 345 and 6 while ignoring all that is in between ? I tried fscanf(FILE *pointer,"%d %d",&words,&figs); But it only gets the first value ... What am I doing wrong ?

    Read the article

  • C# Regex: only letters followed by an optional .

    - by TheDude
    Hello, I am looking for a way to get words out of a sentence. I am pretty far with the following expression: \b([a-zA-Z]+?)\b but there are some occurrences that it counts a word when I want it not to. E.g a word followed by more than one period like "text..". So, in my regex I want to have the period to be at the end of a word zero or one time. Inserting .? did not do the trick, and variations on this have not yielded anything fruitful either. Hope someone can help!

    Read the article

  • Remove trailing letters at the end of string

    - by wang
    I have some strings like below: ffffffffcfdeee^dddcdeffffffffdddcecffffc^cbcb^cb`cdaba`eeeeeefeba[NNZZcccYccaccBBBBBBBBBBBBBBBBBBBBBB eedeedffcc^bb^bccccbadddba^cc^e`eeedddda`deca_^^\```a```^b^`I^aa^bb^`_b\a^b```Y_\`b^`aba`cM[SS\ZY^BBB Each string MAY (or may not) end with a stretch of trailing "B" of varied length. I'm just wondering if we can simply use bash code to remove the "B" stretch? thx

    Read the article

  • Using `.index()` on repeating letters

    - by Yarden
    I'm building a function that builds a dictionary with words, such as: {'b': ['b', 'bi', 'bir', 'birt', 'birth', 'birthd', 'birthda', 'birthday'], 'bi': ['bi', 'bir', 'birt', 'birth', 'birthd', 'birthda', 'birthday'], 'birt': ['birt', 'birth', 'birthd', 'birthda', 'birthday'], 'birthda': ['birthda', 'birthday'], 'birthday': ['birthday'], 'birth': ['birth', 'birthd', 'birthda', 'birthday'], 'birthd': ['birthd', 'birthda', 'birthday'], 'bir': ['bir', 'birt', 'birth', 'birthd', 'birthda', 'birthday']} This is what it looks like: def add_prefixs(word, prefix_dict): lst=[] for letter in word: n=word.index(letter) if n==0: lst.append(word[0]) else: lst.append(word[0:n]) lst.append(word) lst.remove(lst[0]) for elem in lst: b=lst.index(elem) prefix_dict[elem]=lst[b:] return prefix_dict It works great for words like "birthday", but when I have a letter that repeats itself, I have a problem... for example, "hello". {'h': ['h', 'he', 'he', 'hell', 'hello'], 'hell': ['hell', 'hello'], 'hello': ['hello'], 'he': ['he', 'he', 'hell', 'hello']} I know it's because of the index (python chooses the index of the first time the letter appears) but I do not know how to solve it. Yes, this is my homework and I'm really trying to learn from you guys :)

    Read the article

  • Replace occurance of character with all letters in the alphabet

    - by McAvoy
    I have created a scrabble game with a computer opponent. If a blank tile is found in the computer's rack during the word generation if needs to be swapped out for every letter in the alphabet. I have my current solution to solve this problem below, but was wondering if there is a better more efficient way to accomplish this task. if (str.Contains("*")) { char c = 'A'; String made = ""; while(c < 'Z') { made = str.ReplaceFirst("*", c.ToString()); if (!made.Contains("*")) { wordsMade.Add(made); if (theGame.theTrie.Search(made) == Trie.SearchResults.Found) { validWords.Add(made); } } else { char ch = 'A'; String made2 = ""; while (ch < 'Z') { made2 = made.ReplaceFirst("*", c.ToString()); wordsMade.Add(made2); if (theGame.theTrie.Search(made2) == Trie.SearchResults.Found) { validWords.Add(made2); } ch++; } } c++; }

    Read the article

  • Regular expression - starting and ending with a letter, accepting only letters, numbers and _

    - by jreid9001
    I'm trying to write a regular expression which specifies that text should start with a letter, every character should be a letter, number or underscore, there should not be 2 underscores in a row and it should end with a letter or number. At the moment, the only thing I have is ^[a-zA-Z]\w[a-zA-Z1-9_] but this doesn't seem to work properly since it only ever matches 3 characters, and allows repeated underscores. I also don't know how to specify requirements for the last character.

    Read the article

  • jquery - how to get number from a string with mixture of letters and number

    - by Alex
    How do I use JQuery to get number from the drop down select? <select aria-invalid="false" id="RatePercent" class="wpcf7-form-control wpcf7-select ratePercent" name="RatePercent"> <option value="">---</option> <option value="Floating-6.5%">Floating-6.5%</option> <option value="6 Months-5.65%">6 Months-5.65%</option> <option value="1 Year-5.85%">1 Year-5.85%</option> <option value="18 Months-5.99%">18 Months-5.99%</option> <option value="2 Years-6.19%">2 Years-6.19%</option> <option value="3 Years-6.85%">3 Years-6.85%</option> <option value="4 Years-7.19%">4 Years-7.19%</option> <option value="5 Years-7.40%">5 Years-7.40%</option> </select> If you choose 1 Year-5.85%, it returns '5.85', instead of '1 Year-5.85%'?

    Read the article

  • Is it faster to loop through a Python set of number or a set of letters?

    - by Scott Bartell
    Is it faster to loop through a Python set of numbers or a Python set of letters given that each set is the exact same length and each item within each set is the same length? Why? I would think that there would be a difference because letters have more possible characters [a-zA-Z] than numbers [0-9] and therefor would be more 'random' and likely affect the hashing to some extent. numbers = set([00000,00001,00002,00003,00004,00005, ... 99999]) letters = set(['aaaaa','aaaab','aaaac','aaaad', ... 'aaabZZ']) # this is just an example, it does not actually end here for item in numbers: do_something() for item in letters: do_something() where len(numbers) == len(letters) Update: I am interested in Python's specific hashing algorithm and what happens behind the scenes with this implementation.

    Read the article

  • A solid nickname regexp

    - by iBram
    I want a regular expression to validate a nickname: 6 to 36 characters, it should contain at least one letter. Other allowed characters: 0-9 and underscores. This is what I have now: if(!preg_match('/^.*(?=\d{0,})(?=[a-zA-Z]{1,})(?=[a-zA-Z0-9_]{6,36}).*$/i', $value)){ echo 'bad'; } else{ echo 'good'; } This seems to work, but when a validate this strings for example: 11111111111a is not valid, but it should aaaaaaa!aaaa is valid, but it shouldn't Any ideas to make this regexp better?

    Read the article

  • C# HashSet<T>

    - by Ben Griswold
    I hadn’t done much (read: anything) with the C# generic HashSet until I recently needed to produce a distinct collection.  As it turns out, HashSet<T> was the perfect tool. As the following snippet demonstrates, this collection type offers a lot: // Using HashSet<T>: // http://www.albahari.com/nutshell/ch07.aspx var letters = new HashSet<char>("the quick brown fox");   Console.WriteLine(letters.Contains('t')); // true Console.WriteLine(letters.Contains('j')); // false   foreach (char c in letters) Console.Write(c); // the quickbrownfx Console.WriteLine();   letters = new HashSet<char>("the quick brown fox"); letters.IntersectWith("aeiou"); foreach (char c in letters) Console.Write(c); // euio Console.WriteLine();   letters = new HashSet<char>("the quick brown fox"); letters.ExceptWith("aeiou"); foreach (char c in letters) Console.Write(c); // th qckbrwnfx Console.WriteLine();   letters = new HashSet<char>("the quick brown fox"); letters.SymmetricExceptWith("the lazy brown fox"); foreach (char c in letters) Console.Write(c); // quicklazy Console.WriteLine(); The MSDN documentation is a bit light on HashSet<T> documentation but if you search hard enough you can find some interesting information and benchmarks. But back to that distinct list I needed… // MSDN Add // http://msdn.microsoft.com/en-us/library/bb353005.aspx var employeeA = new Employee {Id = 1, Name = "Employee A"}; var employeeB = new Employee {Id = 2, Name = "Employee B"}; var employeeC = new Employee {Id = 3, Name = "Employee C"}; var employeeD = new Employee {Id = 4, Name = "Employee D"};   var naughty = new List<Employee> {employeeA}; var nice = new List<Employee> {employeeB, employeeC};   var employees = new HashSet<Employee>(); naughty.ForEach(x => employees.Add(x)); nice.ForEach(x => employees.Add(x));   foreach (Employee e in employees) Console.WriteLine(e); // Returns Employee A Employee B Employee C The Add Method returns true on success and, you guessed it, false if the item couldn’t be added to the collection.  I’m using the Linq ForEach syntax to add all valid items to the employees HashSet.  It works really great.  This is just a rough sample, but you may have noticed I’m using Employee, a reference type.  Most samples demonstrate the power of the HashSet with a collection of integers which is kind of cheating.  With value types you don’t have to worry about defining your own equality members.  With reference types, you do. internal class Employee {     public int Id { get; set; }     public string Name { get; set; }       public override string ToString()     {         return Name;     }          public bool Equals(Employee other)     {         if (ReferenceEquals(null, other)) return false;         if (ReferenceEquals(this, other)) return true;         return other.Id == Id;     }       public override bool Equals(object obj)     {         if (ReferenceEquals(null, obj)) return false;         if (ReferenceEquals(this, obj)) return true;         if (obj.GetType() != typeof (Employee)) return false;         return Equals((Employee) obj);     }       public override int GetHashCode()     {         return Id;     }       public static bool operator ==(Employee left, Employee right)     {         return Equals(left, right);     }       public static bool operator !=(Employee left, Employee right)     {         return !Equals(left, right);     } } Fortunately, with Resharper, it’s a snap. Click on the class name, ALT+INS and then follow with the handy dialogues. That’s it. Try out the HashSet<T>. It’s good stuff.

    Read the article

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