This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Takes arguments and produces an array of functions that accept context. | |
function handle_args() { | |
var args = Array.prototype.slice.call(arguments); | |
return args.map(function(arg) { | |
if (arg instanceof Function) return arg; // Presumably already a contex-accepting function. | |
if (arg instanceof Array) return and.apply(this, arg); // Make arrays behave as and. | |
// Presuming a string, build a function to check. | |
var my_regex = new RegExp(arg.toString(), 'i'); | |
return function(context) { | |
return context.search(my_regex) > -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r""" | |
vCard_S30.py -- Convert vCards into suitable for Nokia Series 30+ format, or | |
How to solve the only one phone number per contact problem. | |
1) Import contacts "contacts.vcf" from Google account (vCard format). | |
2) Place it beside this script. | |
3) Run the script with Python 2.7. | |
4) Copy the result "backup.dat" into "Backup" folder on the phone SD card. | |
5) Restore contacts from backup on the phone. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please read StepicTest.md carefully) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file coroutine.h | |
* \brief Coroutines in C. | |
* \author Vitaly Kravtsov (in4lio@gmail.com) | |
* \copyright The MIT License | |
* | |
* Coroutine mechanics, implemented using the C language extension "Labels as Values". | |
* Based on Simon Tatham "Coroutines in C". | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file binary.h (generated by binary_h.pl) | |
* \brief Definition of binary numbers. | |
* \code | |
* B010, B01010111, B8( 1000111 ) --> 2, 87, 71 | |
* B16( 1, 11000011 ) --> 451 | |
* B32( 0, 11000000, 11111111, 11101110 ) --> 12648430 | |
* \endcode | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file unfold.h (generated by unfold_h.py) | |
* \brief Unfolding of C macros (up to 255). | |
* \code | |
* UNFOLD( 3, T0, T, arg1, arg2 ) --> T0( 0, arg1, arg2 ) T( 1, arg1, arg2 ) T( 2, arg1, arg2 ) | |
* UNFOLD_FROM( 10, 3, T0, T, arg1, arg2 ) --> T0( 10, arg1, arg2 ) T( 11, arg1, arg2 ) T( 12, arg1, arg2 ) | |
* \endcode | |
* In case of `UNFOLD_FROM`, you must use `__concat_X` in macros (`T`) to concatenate index (`N`), for example: | |
* \code | |
* #define T0( N ) BIT_##N |