(v)sprintf

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-16 06:13:56

软件介绍

Implements both a somewhat stripped down "classic" version of the C sprintf (no support for width, sign, padding and flags), and a python-like one employing named parameters.

Why another implementation, when we already have one? well:

  • size: 2262 bytes;
  • features: I wanted named arguments, like in python;
  • license: the existing implementation uses a BSD license, I wanted GPL;
  • and fun, of course.

Usage

//sprintf
//positional arguments
var classic = $.sprintf('%s %d%% %.3f', 'string', 40, 3.141593);
// classic = 'string 40% 3.142'

//named arguments
var named = $.sprintf('%(name)s: %(value)d', {name: 'age', value: 40});
// named = 'age: 40'

//vsprintf
var classic = $.vsprintf('%s %d%% %.3f', ['string', 40, 3.141593]);
// classic = 'string 40% 3.142'

//named arguments
var named = $.vsprintf('%(name)s: %(value)d', [{name: 'age', value: 40}]);
// named = 'age: 40'

本文地址:https://codercto.com/soft/d/23477.html

Processing语言权威指南

Processing语言权威指南

Casey Reas、Ben Fry / 张静 / 电子工业出版社 / 2013-10-1 / 139.00

本书介绍了可视化艺术中的计算机编程概念,对开源编程语言Processing作了非常详尽的阐述。学生、艺术家、设计师、建筑师、研究者,以及任何想编程实现绘画、动画和互动的人都可以使用它。书中的大部分章节是短小的单元,介绍Processing的语法和基本概念(变量、函数、面向对象编程),涵盖与软件相关的图像处理、绘制,并且给出了大量简短的原型程序,配以相应的过程图像与注释。书中还有一些访谈文章,与动画......一起来看看 《Processing语言权威指南》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试