132,722 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for vegaseat

Another application of Python module base64, this time to embed midi music data in your program. You also need the module pygame to execute this Python code. Enjoy the music!

Software Development python
Member Avatar for Rufus_1
5
12K
Member Avatar for vegaseat

Just a relatively simple calculator using the Tkinter GUI. It has a few nice features such as correcting division by an integer (for older Python versions), error trapping, to and from memory buttons, and an editable display. The editable display allows you to backspace mistakes, and also to enter things …

Software Development abuse gui python tkinter
Member Avatar for Charles_24
5
10K
Member Avatar for Gribouillis

This snippet defines a function restart_program() which restarts your python program from within your python program.

Software Development python
Member Avatar for Gribouillis
5
75K
Member Avatar for vegaseat

The bubble sort is slow and I thought it would be interesting to visualize the progress as it sorts an array of integers.

Software Development c
Member Avatar for David_50
5
746
Member Avatar for J.C. SolvoTerra

Oh No, not another LockBits demo. Well hopefully this demo may also give you a little in site into actually playing with, and calculating some simple effects as well as understanding the advantages of LockBits as apposed to GetPixel and SetPixel. # A Useful Note. # It is important to …

Software Development data-structure
Member Avatar for J.C. SolvoTerra
5
685
Member Avatar for FireNet

File I/O With C++ Fstream **Intro** File handling is as simple as writing in a book, much easier to modify and find. It's so simple people get confused with it :-). Welcome to the world of file handling. We will use the c++ fstream classes to do our file handling. …

Member Avatar for Swalih
5
12K
Member Avatar for vegaseat

Run two calls to a function simultaneously with this threading @background decorator.

Software Development html-css multithreading python
Member Avatar for Lardmeister
5
3K
Member Avatar for Gribouillis

This snippet defines a function `printat()` which adds line and file information to the normal `print()` function output. The intended use is a quick and dirty debugging information for everyday's use. A more complete solution is to use a logging/debugging/tracing framework.

Software Development python
Member Avatar for Gribouillis
5
974
Member Avatar for masterofpuppets

Here's a simple tutorial on dictionaries in Python: Dictionaries: Dictionaries are similar to other compound types except that they can use any immutable type as an index. One way to create a dictionary is to start with the empty dictionary and add items. The empty dictionary is denoted {}: [CODE]end2sp …

Software Development python
Member Avatar for Alf1#
5
1K
Member Avatar for Learner010

# Tutorial On Operators# *Operators are the signs to the tell the compiler to perform specific task*. The Operators fall into following categories :- Arithmatic Operator Relational Operator Logical Operator Bitwise Operator Miscellaneous Operator(i added Assignment Operators in this categeory) **Arithmatic operators:-** There are following arithmetic operators:- + Add [6+2=8] …

Software Development c++ file-system
Member Avatar for Learner010
5
700
Member Avatar for ddanbe

Thought it would be very complicated to include speech in your programs. As it seems, in it most simplest form it can be done in two lines. Don't forget to include the System.Speech reference in your References. Enjoy!

Software Development asp.net
Member Avatar for kplcjl
5
563
Member Avatar for TrustyTony

There is free tools to do the same, but I was curious to see what it takes to make one myself. For info see: [url]http://en.wikipedia.org/wiki/LC-3[/url]

Software Development python
Member Avatar for TrustyTony
5
2K
Member Avatar for deceptikon

I was asked this in an interview today: Q: `malloc(0); /* What does it do? */` It's a great question because it covers a subtlety in the standard and a condition that not many people will consider. Unfortunately, I wasn't 100% confident that I remembered what the standard said about …

Software Development c legal
Member Avatar for deceptikon
5
224
Member Avatar for vegaseat

This code example shows how to create a dictionary with row,column indexed (r,c) key tuples from a typical list of lists 2D matrix. Also an example is shown of the ease of processing the resulting dictionary.

Member Avatar for TrustyTony
5
6K
Member Avatar for deceptikon

The annoying use case is this: for (vector<int>::size_type i = 0; i < v.size(); i++) { cout << v[i] << ' '; if (i == v.size() - 1) { cout << endl; } } C++11 offers the `auto` keyword for initializer type deduction so that we can avoid verbose and …

Software Development c++
5
322
Member Avatar for vegaseat

A small test program exploring the PySide/PyQT Label widget. With HTML code you can do some nice formatting of the label's text.

Software Development python
5
749
Member Avatar for vegaseat

Comparing a number of different approaches to finding the closest pair of numeric elements in a list. The timing is done with the mpmath module, but you can also use Python module timeit.

Software Development python
Member Avatar for Lardmeister
5
757
Member Avatar for vegaseat

If you have a smaller image, you can include it in your program as a base64 encoded string. This way you don't have to worry about an image file to go with your code. In your program you can then decode it back to the familiar bytes of an image …

Software Development image python
Member Avatar for HiHe
5
8K
Member Avatar for vegaseat

Python experiment to get an image from a web page and save it to an image file. Updated code to work with both Python versions ...

Software Development image python
Member Avatar for snippsat
5
2K
Member Avatar for Glass_Joe

[ATTACH=RIGHT]16645[/ATTACH]Oracle announced Thursday evening (August 12) that they would be filing a lawsuit against Google, claiming that their Android phone software infringes upon patents and copyrights of their Java software, which they acquired when they purchased Sun Microsystems in January for $7.4 billion. "In developing Android, Google knowingly, directly and …

Software Development java oracle seo
Member Avatar for dantinkakkar
5
422
Member Avatar for woooee

From a thread on another forum, I wondered how difficult it would be to create a Tic-Tac-Toe game that could not be beaten. Since it is easiest if the computer goes first and chooses the center square, this code implements that portion. The logic is fairly simple; occupy the center …

Software Development python tkinter
Member Avatar for TrustyTony
5
568
Member Avatar for ddanbe

Ever wanted to know how to implement running lights? well here is your chance to find out. Open a new Forms application enlarge the Form a bit and drop a Panel and a Timer on it. Add the class ChasingLights to the solution, see code. Implement a form Load, panel …

Software Development
Member Avatar for Saikalyankumar
5
999
Member Avatar for Momerath

This snippet shows how to use Mutex to prevent multiple copies of your software from running. For a WinForms application, this code goes into the Program.cs file. The magic starts in line 14 where we attempt to create a Mutex. A Mutex is a form of a lock, but it …

Software Development
Member Avatar for CsharpChico
5
560
Member Avatar for jeffcogswell

[ATTACH=left]17191[/ATTACH]Today at Intel's IDF 2010 was the official launch of the 2011 version of Intel Parallel Studio. Parallel Studio is a set of tools that enhance Visual Studio to support full parallel programming. This is more than just a simple plug-in for Visual Studio. It's an entire set of tools …

Software Development c++ visual-studio
Member Avatar for jeffcogswell
5
318
Member Avatar for jeffcogswell

With the recent release of Visual Studio 2010, Microsoft has updated.NET and the C# language, both now at version 4. One of the new features of C# is the ability to handle dynamic types. But what exactly does that mean? Essentially, if you're very careful, you can use C# in …

Software Development c# visual-studio
Member Avatar for Tekmaven
5
727
Member Avatar for Ancient Dragon

This shows how to get the size of all the files in a folder, and all its sub-folders on MS-Windows operating system. It uses recursion to transverse all the directories, and return a 64-bit integer. It was compiled with VC++ 2008 Express and Code::Blocks Version 8.02 with MinGW compiler.

Software Development c++ operating-system
Member Avatar for Ancient Dragon
5
5K
Member Avatar for vipul_cool16

PLEASE GIVE ME ANY [B]C++ PROJECT FOR CLASS 11[/B], WHICH [B]SHOULD INCLUDE[/B] IOSTREAM, CONIO, STDIO, STRING, PROCESS, STDLIB. GRAFICS ARE [B]NOT ALLOWED [/B]IN THE PROJECT. IT'S URGENT PLEASE SEND ME AT [email]email removed[/email] OR POST HERE. PLESAE GIVE ME !! I WILL BE WAITING...

Software Development c++
Member Avatar for zandiago
5
1K
Member Avatar for Comatose

There seems to be a serious number of posts regarding the use of VB with an Access Database... Due To The High Volume of questions about access, I'm posting this link. Please, Go through the tutorial, and if you have questions regarding access with VB still (after reading through the …

Software Development first-post visual-basic
5
1K
Member Avatar for Hanginium65

I wrote a Python script that included the python-swiftclient module to connect to the OpenStack Object Storage and upload some files to the OpenStack Object Storage container It works great if I upload a file that ends with the extension .gz however, I’m getting an error regarding the ‘TarFile’ object …

Software Development file-system python session storage
Member Avatar for Salem
4
164
Member Avatar for SoniyaJonas
Member Avatar for simhakidsden
4
442
Member Avatar for kasmar45

Yes I finally decided to continue on with my programming efforts. I would like to be able to refer to myself as a master programmer, but I may not have that much time, after all I am almost 80 years old. Right now I'm delving into C++ and finding it …

Software Development c++ java vb.net
Member Avatar for john_111
4
323
Member Avatar for Miguel Nicholas

To be honest with you, all the codes that i made were self taught, i had to advance myself to learn more stuff in C++ which my first challenge is to make a simple but clean made text based adventure game, but im at the wall atm. (don't judge me, …

Software Development c++
Member Avatar for kidspointdotin
4
3K
Member Avatar for Reverend Jim

**Requires:** 1. Python version 3.8 or newer 2. wxPython version 4.0 or newer 3. exif module 4. Windows with NTFS file system To ensure you have the required packages please run the following 1. python -m pip install --upgrade pip 2. pip install exif 3. pip install wxPython I have …

Member Avatar for kimwel
4
1K
Member Avatar for Reverend Jim

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 …

Software Development vb.net
Member Avatar for Mark@SF
4
79K
Member Avatar for vegaseat

This code shows how to obtain and display a GIF image from an internet website using the Tkinter GUI toolkit that comes with the Python installation.

Software Development display image python
Member Avatar for woooee
4
25K
Member Avatar for Unhnd_Exception

I was so amazed at how easy it was to embed google maps into a vb app I decided to post a quick example to help anyone get started. This is a simple example. Google's api has all kinds of things to help customize your map. You can find out …

Software Development google-api seo vb.net
Member Avatar for Jorge Braga
4
9K
Member Avatar for vegaseat

Shows how to create a basic slide show with the Python Tkinter GUI toolkit.

Software Development gui image python tkinter
Member Avatar for Daniele_2
4
19K
Member Avatar for avirag

This is a snippet I use to clear a form. Right now it clears: TextBox, RichTextBox, ComboBox, CheckBox and RadioButton. More can be added if needed... :)

Software Development
Member Avatar for JOSheaIV
4
809
Member Avatar for vegaseat

The module pyglet leans on OpenGL for graphics and is used in the scientific community together with Python. This short code snippet shows you how to use it to display an animated GIF file. The download is free, so give it a try. You don't have to download OpenGL to …

Software Development opengl python
Member Avatar for kwekey
4
17K
Member Avatar for vegaseat

This is the updated version of the Tiny Tkinter Calculator. It has more power, since you can type in functions contained in the Python math module then press the equals key. You can then move the result into memory for other calculations. The code is written in OOP class style …

Software Development oop python tkinter
Member Avatar for vegaseat
4
2K
Member Avatar for cgeier

I will be showing how to pass data between two forms in VB .NET. I will be using two forms, two classes which we will define, a delegate, an event, and an event handler. It is my first tutorial and is a bit long because I wanted to make it …

Software Development asp.net microsoft-access vb.net
Member Avatar for kplcjl
4
5K
Member Avatar for vegaseat

This shows the application of a Memoize decorator to speed up recursive functions in Python.

Software Development python
Member Avatar for vegaseat
4
689
Member Avatar for vegaseat

The Tkinter GUI toolkit's canvas object is very nice for all sorts of drawings and plotting. However, when it comes to saving the image Tkinter limits you to postscript printer files. One solution is to draw the same image in parallel on PIL's image-draw object in memory. This is made …

Software Development gui printer python tkinter
Member Avatar for MatthiasBl
4
19K
Member Avatar for vegaseat

Two third party Python modules imageio and visvis make it easy to load and view images. The modules come with the pyzo scientific package or can be downloaded separately. Module imageio can read many image file formats as shown in http://imageio.readthedocs.org/en/latest/formats.html You could also replace your image file name directly …

Software Development image python
Member Avatar for Ene Uran
4
7K
Member Avatar for Gribouillis

I uploaded a module named [symboldict](https://pypi.python.org/pypi/symboldict) to the python package index (pypi). This snippet shows how to use it to create a dictionary of symbols from various modules. This dictionary can be used as a common language shared by several modules. It can be used to load python libraries in …

Software Development python
Member Avatar for Gribouillis
4
524
Member Avatar for vegaseat

This simple code shows how to write text with a given font, font size and color using the module pygame ...

Software Development python
Member Avatar for lsallen
4
7K
Member Avatar for TrustyTony

Here some old fashioned line input routine, better idea nowadays would be to use GUI input box with real editing. Anyway, it is quite simple with Python to do this basic routine for terminal based program.

Software Development gui python
Member Avatar for fonzali
4
514
Member Avatar for Gribouillis

A simple way to resize an image programmatically, using the PythonMagick module. This module is a python port of the [the magick++ library](http://www.imagemagick.org/Magick++/).

Software Development image python
Member Avatar for Gribouillis
4
3K
Member Avatar for deceptikon

##Why Use Arrays?## Let's begin by considering why arrays might be needed. What is the problem that this feature solves? How does it make your life as a programmer easier? When studying new features, it's important to recognize what that feature does for you and where the incentive is in …

Software Development c++ storage
Member Avatar for mike_2000_17
4
766
Member Avatar for cgeier

I will be showing how to pass data between two forms in C#. I will be using two forms, two classes which we will define, a delegate, an event, and an event handler. It is a bit long because I wanted to make it easy to follow. If you want …

Software Development c# microsoft-access
Member Avatar for deceptikon
4
4K

The End.