Our Software Development forum encompasses topics related to native application programming design and development.

60 39 39 36 36 34 33 31 31 30
Member Avatar
karmstrong ask in the Python chat if any one was farmilar with converting a for loop in C to Python. Here is a program in python that will do it for you! Thank You!
by DragonMastur 23 in Software Development ()
Member Avatar
This is a test to get the Python snippets going! For those of you who are scared of snakes, the language is named after the TV program, not the snake. Python is an interpreted language, but programs to compile/combine the code to an exe file are available (Py2Exe). The latest …
by vegaseat 1,720 in Software Development ()
Member Avatar
I made a little py editor because I didn't want to go to all the troble of installing an idle, but I didn't like notepad either. Here it is!
by DragonMastur 23 in Software Development ()
Member Avatar
Sometimes, when I have really, really nothing else to do, I start doodling with some code. Wanted to display the coordinates of the mouse pointer. Thought it was complicated, but it was rather easy. Look, starting at line 94. Then: why not explore a [Bezier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve), and what if I …
by ddanbe 2,418 in Software Development ()
Member Avatar
Quite a while ago, I made [URL="http://www.daniweb.com/code/snippet217147.html"][B]this[/B][/URL] snippet. This code is basically the same, except that it adds animation. This method of blitting is very fast assuming you don't use a surface that's too large. On a 500 x 500 surface, I managed 350fps using only 0-1% of the cpu. …
by William Hemsworth 1,339 in Software Development ()
Member Avatar
This snippet defines a function restart_program() which restarts your python program from within your python program.
by Gribouillis 1,265 in Software Development ()
Member Avatar
The bubble sort is slow and I thought it would be interesting to visualize the progress as it sorts an array of integers.
by vegaseat 1,720 in Software Development ()
Member Avatar
Here lambda is used to create a one-line function for factorials.
by vegaseat 1,720 in Software Development ()
Member Avatar
Needed a func to convert base 2 into 10, and back. Found the referenced code in this func for moving between three bases, and generalized it to between bases 2 and 62, and all in between. Upconvert a number, then down convert, then upconvert again. Go wild, have fun.
by BustACode 15 in Software Development ()
Member Avatar
Let's say you want to send a short private message to your friend, but don't want grandma to snoop around and find it. One way is to use the Python Image Library (PIL) and hide the message in a picture file's pixels. Just looking at the picture you will barely …
by vegaseat 1,720 in Software Development ()
Member Avatar
In my quest to learn more regarding programming in Python, I "dissect" a lot of other people's code. While doing this, or writing my own code, I end up with 10's of debug print lines. Things like this: if v_Debug == 1: print("DEBUG - ".format()) # DEBUG If I decide …
by BustACode 15 in Software Development ()
Member Avatar
I, and many others, desired a "switch" keyword in Python. For me it was to a desire to make some of my code more compact and readable, as I often have many user selected options for the code to weed through. So I set off on a journey to figure …
by BustACode 15 in Software Development ()
Member Avatar
I have just seen a resurrected thread about issues with loading images to a PictureBox and the inability to delete the file while the program is running. There was no clear explaination of the problem, only suggested hacks and apparent frustration. So I thought I would offer this explanation from …
by TnTinMN 418 in Software Development ()
Member Avatar
Just trying to find out which of these five isprime functions is the fastest.
by vegaseat 1,720 in Software Development ()
Member Avatar
too many new and intermediate users of C attempt to use the command [icode]fflush(stdin)[/icode] to "flush the input buffer". this is patently wrong. the rule is (and click if you don't believe me) : [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1052863818&id=1043284351"]NEVER [/URL][URL="http://answers.yahoo.com/question/index?qid=20071013052534AAuxWmW"]USE [/URL][URL="http://www.gidnetwork.com/b-57.html"]"FFLUSH()"[/URL] [URL="http://www.linuxforums.org/forum/linux-programming-scripting/41287-problem-fflush-stdin-function.html"]ON [/URL][URL="http://www.it.usyd.edu.au/~dasymond/mirror/c-faq/stdio/gets_flush2.html"]INPUT [/URL][URL="http://www.cplusplus.com/forum/general/6554/"]STREAMS [/URL][URL="http://c-faq.com/stdio/stdinflush.html"]SUCH [/URL][URL="http://gcc.gnu.org/ml/gcc-help/2009-01/msg00287.html"]AS [/URL][URL="http://www.dreamincode.net/forums/showtopic45833.htm"]"STDIN" [/URL] here is one method of properly …
by jephthah 1,888 in Software Development ()
Member Avatar
I have joined the thousands who have done it before, and have compared a number of sorting routines. The sorting is done on the same random-integer arrays. No surprises, quicksort wins this simple comparison hands down. There are clever combinations of sorting routines that are faster, like the snippet by …
by vegaseat 1,720 in Software Development ()
Member Avatar
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain of rice put on the first square of the chessboard, two grains on the second, then doubling it for every …
by vegaseat 1,720 in Software Development ()
Member Avatar
I needed a random color selector. I found one [here](http://peepspower.com/python-script-to-generate-random-css-colors). I rewrote it to make it more general purpose. "f_GenRandomColor" is the picker. The output is in list form, which should make it suitable for most general applications. "f_HTMLRandomColorChart" is just a way to create an HTML table to test …
by BustACode 15 in Software Development ()
Member Avatar
Sometimes when you get a large check from your employer, the value is written out in words. I get those all the time of course. So I wrote this little Python code to convert an integer value to english words. Numbers as high as 999 vigintillion can be used. In …
by vegaseat 1,720 in Software Development ()
Member Avatar
As it seems to come up often enough I figured I'd throw together a quick snippet outlining basic methods for data manipulation in SQL Server using C#. In all examples the coder will need to substitute their own connection string details and variables. I utilised parameters for 3 of the …
by Lusiphur 185 in Software Development ()
Member Avatar
This will take a value in EAX or AX, convert to ASCII hex with optional padding and upper or lower case This example would yield "---fc103a" push word 0x222d ; 32 bit conversion, padd output with '-' push word ASCPntr ; Pointer to end of conversion buffer push 0xfc103a call …
by ShiftLeft 15 in Software Development ()
Member Avatar
Now I am going through a project with colors. And then I think that if I try to display color values with their names in a simple combobox, it could be amazing. I tried and did it and it is looking like ![Capture3.png](/attachments/small/4/4473f7608016edcb5981090cccc80593.png "align-left") And ![Capture4.png](/attachments/small/4/87a5e5686d66033648a3e0ab787d6778.png "align-left") And finally the …
by Shark_1 86 in Software Development ()
Member Avatar
I am posting this in response to those who ask about replacing the webbrowser (WB) control’s default browser. You cannot ask the WB control to use a different browser, it is hardwired to use the current version of Microsoft’s Internet Explorer that is installed on the target computer. It may …
by TnTinMN 418 in Software Development ()
Member Avatar
Just some interesting applications of the bitwise and (&), or (|) operators. You might find some other uses.
by vegaseat 1,720 in Software Development ()
Member Avatar
You can put an image and text on a Tkinter button widget. This small code shows you how. The GIF image file you want to use for the button should be in the working directory, or you have to give it the full path. Incorporate the Python Image Library (PIL) …
by vegaseat 1,720 in Software Development ()
Member Avatar
When recursion won't do, then memoizaton will.
by BustACode 15 in Software Development ()
Member Avatar
This shows the application of a Memoize decorator to speed up recursive functions in Python.
by vegaseat 1,720 in Software Development ()
Member Avatar
Allows multiple entries using raw_input. I often have to enter multiple items in my Python programs. I desired an easier way than using a loop(s). Today I discovered a way, and with a few mods made it happen.
by BustACode 15 in Software Development ()
Member Avatar
Just an example of a persistent list class that could have interesting applications in data mining.
by vegaseat 1,720 in Software Development ()
Member Avatar
This is just for fun. You know how old you are(I hope), but do you know how many days you are walking around on this planet? The two routines presented here could be used more practically in an ever present employee application.
by ddanbe 2,418 in Software Development ()
Latest Posts