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

60 39 39 36 36 34 32 31 30 30
Member Avatar
A list of tuples is easy to sort for items in the tuples. This snippet shows you how to sort a (character, frequency) tuple either by character or by frequency. One useful example would be the sorting and display of a list of (player, score) tuples, you might find in …
by Ene Uran 638 in Software Development ()
Member Avatar
Returns the largest sum of contiguous integers in the array Example: if the input is (-1, 2, -3, 2, 0, 5, -11), the largest sum is 7 Time complexity is O(n).
by Jaks_maths in Software Development ()
c
Member Avatar
This is my first working perl script that does anything useful; that being to count the hits made on a web page and display the count graphically. To make the counter work on your web page (should you wish to), you will need to create images for the number tiles …
by Mushy-pea 36 in Software Development ()
Member Avatar
This is a short code example using the function os.stat() to get some of the basic file information. Things like file size, times the file was created (Windows), last modified, and last accessed. The program uses a dictionary in an interesting way to store and display the information. The times …
by vegaseat 1,720 in Software Development ()
Member Avatar
There are situations in Python code when a function is used as an object rather then a function call. Handling arguments becomes a mild problem, that can easily be handled by wrapping the function object and its arguments. One common way is the use of a curry function or class. …
by vegaseat 1,720 in Software Development ()
Member Avatar
This Python code shows a way to retrieve a picture from a web page and save it to a file.
by vegaseat 1,720 in Software Development ()
Member Avatar
function to solve hanoi tower game
by amatallah in Software Development ()
c++
Member Avatar
this small function calculate mCr
by amatallah in Software Development ()
c++
Member Avatar
Quick sort is a faster way to sort a given array by recursion The algorithm goes like this: it first takes some index element and seperates all elements lesser than this with larger numbers then places this element in right place and does the same thing with all other
by Raghuvamshi in Software Development ()
c
Member Avatar
A lotto simulator with a twist, you pick the winning numbers and the computer buys the lotto tickets. Anyway, the computer at least generates the tickets and checks how many of them would match the winning numbers you selected. Let's assume you would be the state lotto commissioner and your …
by vegaseat 1,720 in Software Development ()
Member Avatar
This algorithm proved to be effective when two images are combined. The picture beneath (background) is seen if alpha component of fronth picture is less then 0xFF. If alpha of front picture (src in snippet) is zero then all we see is background picture. The format of colour is ARGB …
by andor 25 in Software Development ()
c
Member Avatar
Java Code that creates a random number between 1 and 100 and then asks the user to guess the number and tells if the guess was too high, too low or, the right number. Loops until right number is guessed.
by kylethedarkn 23 in Software Development ()
Member Avatar
Some computer languages have a goto statement to break out of deeply nested loops. Python has chosen not to implement the much abused goto. There are other, really more elegant, ways to accomplish the same outcome. Here are three examples.
by vegaseat 1,720 in Software Development ()
Member Avatar
Code for connecting to Microsoft Access databse, opening and closing connection
by ManicCW 3 in Software Development ()
Member Avatar
If a word or sentence reads the same way forward and backward, then it is a palindrome. A small admonition is in place, whitespaces and punctuation marks can be ignored. Also, all the letters should be in one case, lower or upper, your choice. Ideal for Python to show off …
by vegaseat 1,720 in Software Development ()
Member Avatar
Because of their demand only nature, generators are ideal for finding the combinations of larger sequences. This code applies a Python generator to find the combinations of the sequence. Since permutations are a special case of combinations for all the items in a sequence, I have expanded the result to …
by vegaseat 1,720 in Software Development ()
Member Avatar
This short Python code gets the local time from the PC as a formatted string using time.strftime('%H:%M:%S'). The time string is displayed in a label using a larger font. A recursive function checks the time five times per second, and updates the time string, if it has changed. Five times …
by vegaseat 1,720 in Software Development ()
Member Avatar
A simple program to calculate combinations of a string using recursion, I have used a malloc string of size 100 , you can change it to whatever value you want. The author is currently working at Microsoft. for eg if input string is abcd and you want all 3 letter …
by roverphoenix in Software Development ()
c
Member Avatar
This is a routine task best done with two regexp's when using perl.
by KevinADC 192 in Software Development ()
Member Avatar
Convert 1000000 into 1,000,000 using a perl regexp.
by KevinADC 192 in Software Development ()
Member Avatar
This is somewhat a simple project I wrote by getting help from google groups I always recommend. assemble this code using this command: nasm -o 1.com 1.asm
by mostafadotnet 18 in Software Development ()
Member Avatar
This is a program I wrote for my x86 assembly class which is basically the Spade Invaders game in all its glory. It uses Irvine32.inc which came with the textbook.
by Dani 1,404 in Software Development ()
Member Avatar
This is a program I wrote for my x86 assembly class which generates matrices, multiplies them, and computes how long the arithmetic took. It uses Irvine32.inc which came with the textbook.
by Dani 1,404 in Software Development ()
Member Avatar
This is a program I wrote for my x86 assembly class which revolves a "roulette wheel" around. Wait about a minute and it will eventually slow down to a stop. It uses Irvine32.inc which came with the textbook.
by Dani 1,404 in Software Development ()
Member Avatar
This is a program I wrote for my x86 assembly class which bounces an ASCII ball across the screen. It uses Irvine32.inc which came with the textbook.
by Dani 1,404 in Software Development ()
Member Avatar
This is a program I wrote for my x86 assembly class which computes the sum of n numbers. It uses Irvine32.inc which came with the textbook.
by Dani 1,404 in Software Development ()
Member Avatar
Use the List::Util module. I believe List::Util is a core module starting with perl 5.8. For older versions of perl you may need to install the module. See the module documentation for more details: List::Util
by KevinADC 192 in Software Development ()
Member Avatar
I've seen this question (or similar) asked many times on forums: I have a variable in a file (text) and want to expand it. For example, I have this line in a text file: Mary had a little $lamb and I want to be able to expand $lamb but text …
by KevinADC 192 in Software Development ()
Member Avatar
"How can I find all the permutations of a list (or a word)"? I have seen this question asked a number of times on forums. There is a module that makes this task very easy: List::Permutor. It is not a core module so you may need to install it. See …
by KevinADC 192 in Software Development ()
Member Avatar
You will need to install the Email::Valid module if it's not already installed. See the module documentation for further details. Email::Valid
by KevinADC 192 in Software Development ()
Chat Log Latest Posts