6 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for tekagami

1) onkeyup send textarea values to script 2) converts textarea value to array 3) loops thru the array 4) uses regex to check if its an email address 5) changes inner html of recipient div

Member Avatar for LastMitch
1
365
Member Avatar for vegaseat

This Python code allows you to get selected statistics of a story text. It will count lines, sentences, words, list words and characters by frequency, and give the average word length. It should be easy to add more statistics using the dictionaries created.

Member Avatar for Ene Uran
3
798
Member Avatar for TrustyTony

Now that MITx first test is over, I got feeling that this one task requested for generate and test solution is begging also for less efficient recursive solution as it is so simple. Here it is! Single liner aproved by the released grader! If you wander if you are able …

0
311
Member Avatar for TrustyTony

Another task from C++ forum is trivial in Python even taking handicap of not using Counter.

0
518
Member Avatar for Shankye
Member Avatar for William Hemsworth

Here's a function that manually converts an integer to any base between 2 and 36, the parameter list is: [CODE]void toBase( int value, // Integer value to convert char *target, // Pointer to a large enough buffer int base, // Base (from 2 to 36) int fixedDigitCount // The minimum …

Member Avatar for William Hemsworth
0
200

The End.