Is user given filename valid?

...and try & catch comes to help.

Code in pastebin - http://pastebin.com/HCsDFtUv

Shortly - the function tries to write file and if success, then it deletes it and returns True. Otherwise it returns False. The function could be extended by trying the writing in specified temporary folder.

Such method allows to avoid from using specific and complex regular expressions.


dummy csv/xyz writer for latvians

Software (written in Visual Basic 2010, dependent of .NET framework)

the class code (in VB2010) -

Different countries has their own different regional settings. Sometimes it is very inconvenient when in spreadsheet function the decimal separator is comma (as in Latvia) but for programs you need dot as the decimal separator.
In this simple tool just copy columns, choose settings and save somewhere the file.


Local max,min and slope count in python list.

Simple function written in python - local maximum and minimum count and slope count in the given 1D array (list). M-shaped function has two maximums (or better say - two ascending/upward numbers in row) and minimums (two descending/downward numbers in row), but Λ shaped- one for both. Sometimes it is needed to know exact count of such maximums or minimums, or both.