10 Topics

Member Avatar for
Member Avatar for joshl_1995

Hello Daniweb Community, I'm wanting to slice a square image into 9 pieces like below ![Image_Grid_Expected.png](/attachments/small/3/92037daf6101645e42f7718c3f4ccf65.png "align-center") the code I'm currently using is this Private Function CropBitmap(ByRef bmp As Bitmap, ByVal cropX As Integer, ByVal cropY As Integer, ByVal cropWidth As Integer, ByVal cropHeight As Integer) As Bitmap Dim rect …

Member Avatar for joshl_1995
0
1K
Member Avatar for vegaseat

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.

1
451
Member Avatar for vegaseat

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.

1
1K
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
1
3K
Member Avatar for vegaseat

Use Google's modern Go language (aka. golang) 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. Note that in Go the **:=** is shorthand for assigning a type (by inference) and a value to …

2
577
Member Avatar for TrustyTony

I did code for challenge that I saw posted for C# by deceptikon: http://www.daniweb.com/software-development/csharp/threads/479304/coding-challenge-string-to-date Here it is. Of course normally the code would be without prints and put in function, but this is enough for now for me. There could also be normalization from '/' separated form not producing ambiguous …

1
267
Member Avatar for TrustyTony

To continue[ my quiz series](http://www.daniweb.com/search/query/0?q=%22quiz+of+the%22+pytony#gsc.tab=0&gsc.q=%22quiz%20of%20the%22%20pytony&gsc.page=1), explain what happens with this code (how you would name this action and is there other way to get same result), why, and what is actually the value of `a` at end. a = ['a', 'b','e'] a[2:2] = ['c', 'd']

Member Avatar for TrustyTony
0
254
Member Avatar for beck4456

I'm trying to write a program that takes a string and prints one letter per line. I need to use a while loop based on string length. I googled, so sorry for the newbie question. Thanks!

Member Avatar for JoshuaBurleson
0
1K
Member Avatar for TrustyTony

I thought to post some not quite so trivial as it looks quiz for Python, to test if your brain has Python installed OK ;) Try to figure out what interpreter answers (#? lines), then check with your Python interpreter of choice: [CODE]>>> a = list(range(10)) >>> a[1:1] #? >>> …

Member Avatar for TrustyTony
3
642
Member Avatar for Beat_Slayer

Two litle functions to help on text slice and spliting. The code comments say it all. [CODE]# Slicer takes as arguments a tuple containing the string before, # the string after and the string to truncate. It returns the string # between the two given strings Slicer = lambda((b, a, …

Member Avatar for Beat_Slayer
1
563

The End.