6 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Troy III

Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used for size and mime-type restrictions. When mime-type is not an issue, accepting any kind of image format can be done …

Member Avatar for Troy III
2
3K
Member Avatar for TrustyTony

This is bit funny code as you can first read from this excellent response: http://www.daniweb.com/software-development/python/threads/427341/custom-types-in-a-simple-way#post1828718 why should you not use it, even it maybe feels useful. Anyway I got curious to see how type signature could be implemented, even using it would generally just be stupid way of slowing down …

0
271
Member Avatar for TrustyTony

Finding efficiently primes, whose begining numbers are also primes. See the thread http://www.daniweb.com/software-development/cpp/threads/425821/prime-number-c in C++ forum for discussion on topic.

1
271
Member Avatar for TrustyTony

While looking stuff about idlelib, I came to [URL="http://stackoverflow.com/questions/3431498/what-code-can-i-use-to-check-if-python-is-running-in-idle"]this thread in stackoverflow[/URL], so I posted own solution. I post it also here, as maybe somebody needs it (as for example \b looks ugly in IDLE)

0
238
Member Avatar for TrustyTony

Picked up from old thread but currently applicable (the IBAN number became more widely required actually this year in Finland). The style was quite alien for modern Python coders, so I massaged the code to my own liking. I removed many temporary variables, as for my opinion they did not …

Member Avatar for TrustyTony
2
408
Member Avatar for TrustyTony

This code was in discussion of getting numeric input to Python. This function returns the zero-stripped, normalized string form the input string if it is correct, False truth value otherwise (it can not be mixed with number 0 as accepted '0' are returned as string '0'). If string passes the …

Member Avatar for TrustyTony
0
1K

The End.