199,114 Archived Topics
Remove Filter ![]() | |
This is a command line utility which lists the names of all functions defined in a python source file with a [icode]def <name>[/icode] statement | |
Just bouncing a red ball within the frame of a window, the twist here is that the image is stored within the code as a base64 encoded string of the gif image. This way you only have to distribute one file. The Python code is heavily commented, so you can … | |
The normal XOR crypting is used with a small base64 twist to produce printable crypted text. | |
This shows you how to draw a colorful bar graph of a data set using the Tkinter canvas and rectangles. An attempt has been made to use most of the canvas area for the graph. The bars are spaced and labeled with the corresponding value. The x-axis is simply the … | |
Just a small Python program to calculate monthly payments and other costs. I have compared it with some of the calculators available from many of the online mortgage companies, and results seem to match. | |
Suppose you are a medical researcher studying diabetes. Your boss has given you a big chart of data from diabetes patients. Each row of the chart has information for one patient. Each column of the chart is a health-related statistic, such as height, weight, age, blood pressure, cholesterol level, etc. … | |
Small image files can be embedded in Python code using the base64 encoded string of the image. If you have to present a number of small fixed images in your program, embedding might be easier than including a set of image files. Attached files can be lost, and than your … | |
This code shows you how to build a multiline story string that should display similarly to way it shows in the code. It should be relatively easy to maintain. | |
VPython's fame is with 3D animated modeling, but it's plotting abilities, while not flashy, are easy to understand and very useful. This program uses VPython to plot math functions y = sin(x) and y = cos(x) and y = sin(x)*cos(x). | |
If you have a Windows computer you can play musical beeps through the internal speaker. In this case it will sound like a very tiny Big Ben, brought to you by the module winsound and its method Beep(). | |
Did you ever want to know how how many square inches are in a square meter? This short Python code allows you to get the answer. It uses a dictionary to simplify the conversions. Could be the start of a nice GUI program using radio buttons. | |
The Python list container can be used for many practical things. In this somewhat light-hearted introspection of modern day politics we are looking at two lists and attempt to clear out elements that shouldn't be in both lists. No offense to anyone is intended, the outcome with the sets was … | |
A while ago I created a code snippet in C for the same question. Solving this question with Python is a lot simpler, and on top of that Python takes care of impossible dates with the appropriate error message. | |
While the calculation of the total resistance of two resistors in parallel is simple, this code shows you how to trap a number of potential errors that come with the entry of the required data. All is wrapped easily into a colorful GUI program, due to the simplicity of the … | |
The module datetime allows you to call several functions that can do computation with dates and times. How many days since my birth? How many days till Xmas? What's the date 77 days from now? The code snippet should give you a flavor, enough to explore on your own. | |
The wxPython library allows Python to create Windows GUI programs. Here is a look at the listbox component. Click a button to load the listbox with names, select the name by clicking on it on the list, and display it in the title bar of the window frame. Another button … | |
This program uses WinApi function SetPixel() to plot math functions y = sin(x) and y = cos(x) and y = sin(x)*cos(x) along a y-axis centered on the console screen. Make sure that gdi32.lib is included in the libraries to be linked. | |
The Simple DirectMedia Layer (SDL) library allows for manageable multimedia programming in console mode. Now you can mix graphics, animated or otherwise, with sound and make your game project more interesting. I am showing an example for Dev-C++ using math generated graphics, purloined from the NET, and give some instructions … | |
An example how to line up your decimal points in a column like output of floating point numbers. Both C and C++ versions are shown. Thanks are given to Bud Tugly, my 77 year old senior student. | |
Another application of the Python Image Library (PIL). This time we are loading an image and rotate it counterclockwise by a specified number of degrees. The image is shown rotated and then saved to the working folder. PIL handles a fair amount of image file formats easily. | |
This is an application of the Python Image Library (PIL) and shows you how simple it is to do pixel math on an image. | |
This code gets the local time from your computer, formats the date and the time and displays the result. Does not include the bavarian time measurement of how many steins you have finished since you got up in the morning. | |
You can have fun and learn something too. Not too much fun though! Here we take a lighthearted look at C++ string, various ways to assign a string and substring, spell forward and reverse, find characters and substrings, append, insert, replace, remove characters, separate a sentence into words and more. | |
Let's say you worked in the White House and had to keep two lists, one for the friends and one for the enemies. The boss came to you and said: "The Almighty talked to me out of a burning bush last night, telling me that I shall make my enemies … | |
Using the C++ Standard Template Libraries (STL) can be easy, once you know how to do it. No need to putz around with doubly linked lists anymore! Here is code showing how a STL list allows you to add, insert, remove, sort, splice, merge, display, and clean-out-duplicate strings. | |
Get simple information like serial number, bytes/sector, sectors/cluster, free and total disk space of your hard drive using Windows API calls. | |
This program shows how to display a JPEG (also GIF,BMP,WMF etc.) image using some Windows Graphical User Interface C code. The program uses the uuid.lib file that comes with many C compilers. | |
This code demonstrates AVL insertion and deletion. The code was originally written in C by myself a little while back for a tutorial. The translation to Java was fairly trivial, and to add a little excitement I even threw in a few generics. Yes, I'm aware of this line: tree.data … | |
Use a Windows API call to add some color to your text output. A rewrite of an earlier C++ snippet for the C crowd. | |
The continued fraction expansion gives us the answer to life's most persistent questions, like what is sin(x) or even tanh(x). This surprisingly short code allows you to estimate SIN, COS, TAN, EXP, SINH, COSH and TANH fairly accurately. Careful, this code is not for the usual TV crowd! You should … | |
An example of method overloading. The program calls a function to get the square root of a number. The appropriate function (integer or double version) is executed. | |
These are my instructions: - create a class containing a 10x10 two-dimensional array of characters. - class must have a constructor that puts the '.' character in each element. - In main, I must allow the user to enter an 'X' into six different spaces in the 2D array. (we're … | |
Ive been working on this poker program for a while now and ive tried several different ways to make a poker game...i have to make it using very basic c++ ...ill try to post what i already have done | |
Since listview control in .net framework 2.0 does not have a datasource property, it is not bindable to neither datatable nor generic lists. i created a derived custom listview that is bindable to lists of any type. i attach the .zip to this thread. I dedicate this custom windows control … | |
[U][B]Guidelines to OPs:[/B][/U] [U]Before you start a thread:[/U] Starting a thread is a critical task. It is so because it demands time and attention of other forum members. A thread should only be started when you have done enough drill to find your answer else where. You should always be … | |
hi I am new in c++ although I am reading about ti for a while now :). recently a made a silly code that I can not compile so please some help about it. ps: befo you even star to read it the following errors ocure while compilling [B]Undefined reference … | |
Hi all, I'm having some trouble with my program, I know my copy and my clone function is correct, basically I just need to create the functions to achieve the desired result. Here is my code so far [code=c] #include <stdio.h> #include <stdlib.h> // helpers size_t length(const char *s) { … | |
I w'd like tom Download Turbo C (window version). Can any one sugget any site, thank in advance :confused: | |
Heres the code, im pretty sure i missed something really stupid, No matter what number i type i get "The number oyu type must be a positive number" so i guess the problem is either in my if statements in main or in the checkuserinput function, most likely in my … | |
Hi, I am developing an application to generated Jasper Report. I am using Netbeans 6.5, jasperReport 3.1.3. I am developing it using Visual web JSF. My JSP file is [CODE] D:/Programs/Java/JasperReports/EmployeeReport/web/Page1.jsp [/CODE] My report file is stored in [CODE] D:/Programs/Java/JasperReports/EmployeeReport/web/WEB-INF/reports/employeeReport.jrxml [/CODE] I have used following statement to specify my source … | |
Hey, i am working on a project in which i am making a minesweeper game. The game part was written by my prof. all i had to do was make the class and header to run the background of the game. I have done so successfully, but i am having … | |
Hi Group, for a project[1] I am trying to find an OS independant way to measure the amount of cpu usage and memory consumption of the program. It would be nice if I could do that in my C++ code, so I can show the results at runtime or even … | |
help for this... want to set an attribute of file. 4 status Hidden, archive, system, read only. thank you all... Best Regards Neji | |
Hi everyone, I was wondering if anyone can recommend a good java ide. I have tried netbeans but i find it very confusing to use. I am looking for a very simple but free java ide to use. Can anyone recommend. Thank You Richard West | |
![]() | I want to read files and folder names from directories. I have used the following code. But the problem is that in the output the file name gets truncated.[I](See the output below)[/I] [code=C++] #include <dirent.h> #include <stdio.h> #include<conio.h> void main(void) { clrscr(); DIR *d; struct dirent *dir; d = opendir("."); … ![]() |
Hi all... I m working for my graduated project. and my method in using is Genetic K-means Algorithm. i m using vb.net 2003 and sql server 2000. Does Anyone know a sample code for this?or a website / link for this topic??? please help me... any reply really appreciated... Thx.Best … | |
i want to search data from access database and display it in datagrid. please help me.. thanks in advanced....:) | |
i make push procedure but its not working, there something wrong with my code?? please see my following push procedure : [CODE=pascal] procedure PUSH (var T: Stack; var Full: boolean; X: integer); begin if T.Top = MaxElemen then Full := true else begin T.Top := inc(T.Top); T.Contain[T.Top] := X end … | |
Post your tips for making life easier in C and C++. I'll start: [SIZE=3][B]Standard vector object initialization[/B][/SIZE] The biggest problem with the standard vector class is that one can't use an array initializer. This forces us to do something like this: [code] #include <iostream> #include <vector> using namespace std; int … | |
hi masters.... does any one know how to flash window form ?? i don't have idea to do this problem.. please help me.. best regards |
The End.