Code Snippet vb.Net Progress Bar With Text
A long standing complaint with the standard progress bar control is that there is no easy way to display text. In spite of numerous requests, Microsoft has not included this capability. The following code includes a class, `CustomProgress` which inherits the standard `ProgressBar` and adds such a feature. It is fairly easy to use. If you want to show a percentage progress you set `Text` to a null string and the percentage will be calculated from the `Minimum` and `Maximum` value properties. If you want a custom string then assign it to `Text`. Either the percentge or custom text will …
|+4 forum 3|
Code Snippet Neat Text-Based RPG C++ Console
Pretty neat text-based RPG that I made. Currently my first game.
|+0 forum 18|
Code Snippet Exploring Tkinter's ScrolledText Widget (Python)
The Tkinter GUI toolkit comes with a scrolled text widget that is called ScrolledText. To get access to it you have to import it separately. It allows you to display large amounts of text in a small space.
|+0 forum 2|
Code Snippet A ticker for long messages (Python/Tkinter)
If you have a long message to display in a large readable font, then this little Tkinter GUI toolkit code might help.
|+1 forum 10|
Code Snippet Listing the methods in a .cs class listing
For a small class it doesn’t matter that much, but for a bigger class I find it handy to have an oversight of all the methods at hand. That’s what I did here. One requirement is that the class file has already been compiled error free. Don’t know if my algo to detect a “method” line is bullet proof, but it works in most if not all cases tested. Tips on how this could be improved are always welcome. Further highlights: How to: Show text in a listbox. How to: Save text in a file How to: Open and read …
|+0 forum 5|
Code Snippet Rotate Text (PySide)
Just the very basics on how to draw a rotated text using the Python GUI toolkit PySide (public PyQt). Please experiment and embellish.
|+2 forum 2|
Code Snippet Text - Based RPG V2
I accidentally posted a lower version of the game that had more flaws, and a few less features. This one has a few more minor bugs fixed, and a power attack instead of a normal attack.
|+0 forum 14|
Code Snippet Pygame Text (Python)
This simple code shows how to write text with a given font, font size and color using the module pygame ...
|+4 forum 8|
Code Snippet Adding lines of text to file that may not exist
Here is simple text file example for beginners, using try..except for reading old content as it may not yet exist.
|+1 forum 6|
Code Snippet Right Hand Rule Maze Solver
Demonstrates the Right Hand Rule maze solving algorithm, with some sweet console colors and text display and erasing, in Windows. Note that if the Start is moved away from all the walls in the maze, the right hand rule fails, circling endlessly. Also, a similar failure happens if the Start is put onto an "island" part of the walls in the maze. This algorithm will not solve all mazes.
|+0 forum 0|
Code Snippet Make e-mail text more secure (Python)
In today's environment where just about anyone can snoop around your e-mail, it is prudent to securely encrypt your more private writings. This little Python program will make it easier to do so.
|+4 forum 1|
Code Snippet A New Look at Python Speech
A somewhat newer look at Peter Parente's pywin32 based speech engine. It will read text on your computer.
|+3 forum 1|
Code Snippet Find and replace for files PHP.
A little find and replace function for PHP, not tested, but theoretically should work.
|-1 forum 5|
Code Snippet ComboBox Woes
Upon resizing an anchored combobox - I noticed the text was always selected. This sparked the initiative to fix this problem. (Microsoft decided not to) So by extending the combobox class we can fix this. The following class can be dropped into a form for designer manipulation or as a user control. This is an extremely simple fix.
|+2 forum 0|
Code Snippet Encrypt and Decrypt with the Swap Crypt
This shows the code for one simple crypt of text by swapping two adjoining characters each. You can make that more complex if you like. Can also be used for one nice riddle.
|+2 forum 1|
Code Snippet Read in text from CSV with TextFieldParser
Hi All, In my opinion, this is the best way to read in text from a csv file. Take for example if you are importing addresses: "1 Main Street","SmallTown","SmallCounty" The above is fine and easy to parse in BUT what if an address like this was entered: "App 1A, Tall Towers","SmallTown","SmallCounty" By setting the parser setting delimiter to the comma AND also marking that the fields are enclosed in quotes, the parser knows the comma in the middle of the quotes is not a delimiter and therefore brings the text in as one field.
|+1 forum 2|
Code Snippet Make your own text-based games with ease!
I wrote this program because I often am asked by people that know that I like to make games to make just a quick simple game for some reason or another. I always make a simple text based adventure game (like Zork, but simpler) and they are usually happy with it. Well, about 7 hours ago I was asked to make a game for somebody's birthday tomorrow, so naturally I started making yet another text based adventure game. Suddenly I realized that I basically had the code to make one of these games memorized... so I decided that enough is …
|+0 forum 0|
Code Snippet Text slice and split made easy.
Two litle functions to help on text slice and spliting. The code comments say it all. [CODE]# Slicer takes as arguments a tuple containing the string before, # the string after and the string to truncate. It returns the string # between the two given strings Slicer = lambda((b, a, t)): t.partition(b).partition(a)[/CODE] [CODE]# Spliter takes as arguments a tuple containing the string before, # the string after and the string to truncate. It returns a tuple # containing the string before, the string between and the string # after the given strings Spliter = lambda((b, a, t)): ((t.partition(b)),) + t.partition(b).partition(a)[0::2][/CODE] …
|+1 forum 2|
Aproach to the implementation of K-Nearest Neighbor (KNN) using the Euclidean algorithm. Sample Usage: [CODE]mywork = Words_Works() lit = 'literature.txt' mywork.add_category(lit, 'Literature') # adding files as category comp = 'computers.txt' mywork.add_category(comp, 'Computers') phy = 'physics.txt' mywork.add_category(phy, 'Physics') # saving categories dictionary to file mywork.save_categories() # can be loaded calling load_categories() print mywork.categories # prints categories dictionary print txts = ('sample1.txt', 'sample2.txt') # creating list of files to add for text in txts: mywork.add_text(text) # adding files print mywork.all_texts # prints files word ocurrence count print mywork.knn_calc() # perform calculation print mywork.knn_results # print overall results print mywork.knn() # print files …
|+0 forum 8|
Code Snippet Send text messages with PHP
I made a PHP class that dramatically simplifies sending text messages with PHP. I know this isn't really a "help me out!" type question per se, but I would like to share the code because I have found it to be tremendously useful. You're free to do whatever you'd like with the code . You can even go around telling people you made it. Just don't accuse me if anything goes wrong. Example Usage: [CODE]Cell::send('5551234567', VERIZON, 'Hi man, this message will be automatically paginated to be sent via text messages. How cool is that? Plus, you'll get page numbers in …
|+0 forum 9|
Code Snippet Simple WYSIWYG Text Editor
This is a very simple WYSIWYG Text editor that only has three options Bold, Italic, and Underline. just copy and paste on the page you want it on. it is really easy to add more features. ENJOY
|+0 forum 4|
The code from my answer to thread: [url]http://www.daniweb.com/forums/thread292949.html[/url] Any field names with any same separator separating the values. This is straight text file reading routine, see the original thread for csv module based code. sample.dat: [CODE]id; name; email; homeaddress 123; gishi; firstname.lastname@example.org; 456 happy st. 345; tony; email@example.com; Espoo Finland [/CODE]
|+0 forum 1|
Code Snippet Picking piece of string between separators
I used this pattern few times to answer a thread and thought to post it as snippet.
|+1 forum 1|