Our Programming forum category encompasses application development, web development, programming theory, and everything in between.

95 68 65 63 60 60 59 54 51 48
Member Avatar
Just a couple of number tricks to check Go's mathematical abilities. If you have more, let's show them here.
by vegaseat 1,720 in Computer Science ()
Member Avatar
The story has it that a few hundred years ago the ruler 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 …
by vegaseat 1,720 in Computer Science ()
Member Avatar
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 no 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
Again, calculate the minimum number of bills or coins required for a given amount of money (change). This time we will use a Go map instead of a csv string converted to a structure.
by vegaseat 1,720 in Computer Science ()
Member Avatar
This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency is used in this example, but can be changed to another currency.
by vegaseat 1,720 in Computer Science ()
Member Avatar
I needed a random color selector. I found one ... . 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 …
by BustACode 15 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" ... AX pointing to 1 character before actual beginning allows for successive calls with that pointer so essentially one could convert a 1,024 bit …
by ShiftLeft 15 in Software Development ()
Member Avatar
Another translation of one of my Python snippets. This function will return a slice of consecutive prime numbers from 2 to a given value limit. In Go the 'int' type (int32) will go as high as 2147483647, but you can replace 'int' with 'uint64' and go as high as 18446744073709551615.
by vegaseat 1,720 in Computer Science ()
Member Avatar
Generators are rather familiar objects in Python. Generators supply data on demand. Using Go you can create a generator with a goroutine and a channel. Here the goroutine is an anonymous function within a function, simple to implement.
by vegaseat 1,720 in Computer Science ()
Member Avatar
Some folks go on vacation around the Easter holidays, so it would be nice to know when Easter happens in the years ahead. I had this as a Python snippet in my "oldies, but goodies" file and translated it to Go. It was actually quite easy in this case, and …
by vegaseat 1,720 in Computer Science ()
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 ... ... So, I wrote a simple code …
by Shark_1 85 in Software Development ()
Member Avatar
I've been playing with PDO and got quite a shock, so I thought I'd run this past you all. I love PDO, and I thought that the "prepare once, execute many" idea behind prepared statements was beautiful. Now previous to using prepared statements, I used to build up a long …
by diafol 2,960 in Web Development ()
Member Avatar
This time just a simple example of grading scores (0 - 100) with letters (A - F). Two approaches are presented, one using sitch/case in an "on the fly" function, and the other uses the score as an index to a string of letters F through A.
by vegaseat 1,720 in Computer Science ()
Member Avatar
Reading the content of a web page with a given URL is pretty simple with Go. Here we defer the closing of the response body (at an early point, so we won't later forget) until the program exits.
by vegaseat 1,720 in Computer Science ()
Member Avatar
Another little adventure into Go coding. This time a slice (a Go open ended array) of structures is used as a record for some data processing. For those who miss the ; at the end of a line of code, you can use them, but the lexer of the compiler …
by vegaseat 1,720 in Computer Science ()
Member Avatar
When recursion won't do, then memoizaton will.
by BustACode 15 in Software Development ()
Member Avatar
Allows multiple entries using raw_input. I often have to enter multiple items in my Python programs. Today I discovered a way, and with a few mods made it happen.
by BustACode 15 in Software Development ()
Member Avatar
Use Google's Go language to convert a denary number (base 10) to a roman numeral. Just a good exercise to explore Go's map, slice, sort and for loop features.
by vegaseat 1,720 in Computer Science ()
Member Avatar
Here lambda is used to create a one-line function for factorials.
by vegaseat 1,720 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
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
A while back, I was working on some web pages that required a tabbed menu at the top of the content. In addition, the requirement was that the page should not perform a post back when the user clicked on the individual tabs. It was very important to have a …
by JorgeM 966 in Web Development ()
Member Avatar
This is a special purpose boot loader for a system I've called Proto-Sys. Eventually it is going to become a 64 bit application that will encompass all the resources to hook into drivers, benchmark code and optomize algorithms. Synopsis: ... Fundementally, I just like experimenting with algorithms as a hobby, …
by ShiftLeft 15 in Software Development ()
Member Avatar
Hi all. This is somewhat the equivalent of .NET String.Format(String, Args); Usages: ... I know there's lots of String.formats out there(some simpler and some more complex), but this is the one i've been using for the past years and it works really well for me. Remarks: I didn't write this …
by AleMonteiro 216 in Web Development ()
Member Avatar
Shows how to convert a comma separated value (csv) string to a list of records, and then do some data processing. The csv strings usually come from csv files created by spreadsheets.
by vegaseat 1,720 in Software Development ()
Member Avatar
I have seen several posts through the years with questions about navigation menus. Menus can be built using different approaches. This example is easy to build and simple to integrate with your site. The menu is built only using HTML and CSS so you don't have to have a lot …
by JorgeM 966 in Web Development ()
Member Avatar
So I was recently working on a string program where the strings were easily megabytes long, and I ran into problems with there being out of memory exceptions etc. So I said to myself, this would be a perfect problem which lazy execution solves. Here is a split function that …
by overwraith 57 in Software Development ()
c#
Member Avatar
Let's assume you would have to design a 500 ml (about 1.1 pint) food/beverage container like a can and use the least amount of material. Here is a Python program that explains the steps to achieve this.
by vegaseat 1,720 in Software Development ()
Member Avatar
=======Download The Full Solution Below======== This will be my last VB.Net soure as I've made the move to C#. For a recent job application I was given the technical test to create a horse race simulator which would calculate the odds of a runner winning a race of up to …
by J.C. SolvoTerra 109 in Software Development ()
Chat Log Latest Posts