| Solaris |
|
|
The following are example scripts for tracing JavaScript using the Mozilla DTrace provider.
These scripts have been writen to trace activity from all browsers on the system that support the Mozilla DTrace provider; to trace single browser instances, modify the scripts to match the provider "javascript$target" and run the scripts with "-p PID" as the argument.
A feature of DTrace is that the browser does not need to be restarted for DTrace to work. The JavaScript probes cause zero overhead until they are enabled by a DTrace script, and tracing begins.
This simple JavaScript clock will be run as the target for the tracing demonstrations that follow,
  <TITLE>Clock, JavaScript</TITLE>

This is a simple script to count the number of JavaScript function calls while the script was running.
#!/usr/sbin/dtrace -Zs /* * js_funccalls.d - measure JavaScript function calls using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_calls.d # hit Ctrl-C to end * * FIELDS: * FILE Filename that contained the function * FUNC JavaScript function name * CALLS Function calls during this sample * * Filename and function names are printed if available, else "<null>". */ #pragma ident "@(#)js_funccalls.d 1.3 07/03/26 SMI" #pragma D option quiet dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); } javascript*:::function-entry { @funcs[basename(copyinstr(arg0)), copyinstr(arg2)] = count(); } dtrace:::END { printf(" %-32s %-36s %8s\n", "FILE", "FUNC", "CALLS"); printa(" %-32s %-36s %@8d\n", @funcs); }
Example output,
# ./js_funccalls.d Tracing... Hit Ctrl-C to end. ^C FILE FUNC CALLS nsMicrosummaryService.js GetSources 1 nsMicrosummaryService.js MSS__getBookmarks 1 nsMicrosummaryService.js MSS__updateMicrosummaries 1 nsMicrosummaryService.js getPref 1 nsMicrosummaryService.js getPrefType 1 nsMicrosummaryService.js getService 1 nsMicrosummaryService.js hasMoreElements 1 nsMicrosummaryService.js max 1 nsMicrosummaryService.js now 1 nsMicrosummaryService.js GetResource 2 nsMicrosummaryService.js MSS__resource 2 clock.html getElementById 3 clock.html getHours 3 clock.html getMinutes 3 clock.html getSeconds 3 clock.html setTimeout 3 clock.html startTime 3 clock.html padZero 9
Apart from events from clock.html, the script also traced some events from the browser.
This script is similar to js_funccalls.d, however prints additional call information which is especially useful for tracing anonymous functions,
# ./js_funcinfo.d Tracing... Hit Ctrl-C to end. ^C BASE[FILE:LINE] FUNCNAME RUN[FILE:LINE] CALLS clock2.html:7 getElementById clock2.html:12 1 clock2.html:7 getHours clock2.html:9 1 clock2.html:7 getMinutes clock2.html:10 1 clock2.html:7 getSeconds clock2.html:11 1 clock2.html:7 setTimeout clock2.html:13 1 clock2.html:7 startTime clock2.html:13 1 clocklib.js:2 padLibZero clock2.html:10 1 clocklib.js:2 padLibZero clock2.html:11 1 clocklib.js:2 padLibZero clock2.html:9 1
The "BASE" details show where the function was declared or first used; the "RUN" info shows where the function was executed.
This script traces the flow of JavaScript functions, by indenting as a function is entered and un-indenting as the function completes.
#!/usr/sbin/dtrace -Zs /* * js_funcflow.d - snoop JavaScript function execution using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_funcflow.d # hit Ctrl-C to end * * This watches JavaScript function entries and returns, and indents child * function calls. For busy JavaScript, the output will be very verbose. * * FIELDS: * C CPU-id * TIME Time of function call * FILE Filename that this function belongs to * FUNC JavaScript function name * * Filename and function names are printed if available, else "<null>". * * WARNING: Watch the first column carefully, it prints the CPU-id. If it * changes, then it is very likely that the output has been shuffled. */ #pragma ident "@(#)js_funcflow.d 1.3 07/03/26 SMI" #pragma D option quiet #pragma D option switchrate=10 dtrace:::BEGIN { depth = 0; printf("%s %-20s %-22s ~-- %s\n", "C", "TIME", "FILE", "FUNC"); } javascript*:::function-entry { depth++; printf("%d %-20Y %-22s %*s-> %s\n", cpu, walltimestamp, basename(copyinstr(arg0)), depth*2, "", copyinstr(arg2)); } javascript*:::function-return { printf("%d %-20Y %-22s %*s<- %s\n", cpu, walltimestamp, basename(copyinstr(arg0)), depth*2, "", copyinstr(arg2)); depth~--; }
Running this script while clock.html runs produces,
# ./js_funcflow.d C TIME FILE ~-- FUNC 0 2007 Mar 26 16:42:09 clock.html -> startTime 0 2007 Mar 26 16:42:09 clock.html -> getHours 0 2007 Mar 26 16:42:09 clock.html <- getHours 0 2007 Mar 26 16:42:09 clock.html -> padZero 0 2007 Mar 26 16:42:09 clock.html <- padZero 0 2007 Mar 26 16:42:09 clock.html -> getMinutes 0 2007 Mar 26 16:42:09 clock.html <- getMinutes 0 2007 Mar 26 16:42:09 clock.html -> padZero 0 2007 Mar 26 16:42:09 clock.html <- padZero 0 2007 Mar 26 16:42:09 clock.html -> getSeconds 0 2007 Mar 26 16:42:09 clock.html <- getSeconds 0 2007 Mar 26 16:42:09 clock.html -> padZero 0 2007 Mar 26 16:42:09 clock.html <- padZero 0 2007 Mar 26 16:42:09 clock.html -> getElementById 0 2007 Mar 26 16:42:09 clock.html <- getElementById 0 2007 Mar 26 16:42:09 clock.html -> setTimeout 0 2007 Mar 26 16:42:09 clock.html <- setTimeout 0 2007 Mar 26 16:42:09 clock.html <- startTime 0 2007 Mar 26 16:42:10 clock.html -> startTime 0 2007 Mar 26 16:42:10 clock.html -> getHours 0 2007 Mar 26 16:42:10 clock.html <- getHours 0 2007 Mar 26 16:42:10 clock.html -> padZero 0 2007 Mar 26 16:42:10 clock.html <- padZero 0 2007 Mar 26 16:42:10 clock.html -> getMinutes 0 2007 Mar 26 16:42:10 clock.html <- getMinutes 0 2007 Mar 26 16:42:10 clock.html -> padZero 0 2007 Mar 26 16:42:10 clock.html <- padZero 0 2007 Mar 26 16:42:10 clock.html -> getSeconds 0 2007 Mar 26 16:42:10 clock.html <- getSeconds 0 2007 Mar 26 16:42:10 clock.html -> padZero 0 2007 Mar 26 16:42:10 clock.html <- padZero 0 2007 Mar 26 16:42:10 clock.html -> getElementById 0 2007 Mar 26 16:42:10 clock.html <- getElementById 0 2007 Mar 26 16:42:10 clock.html -> setTimeout 0 2007 Mar 26 16:42:10 clock.html <- setTimeout 0 2007 Mar 26 16:42:10 clock.html <- startTime ^C
The execution of the clock.html script can be seen. This tool isn't as useful as it may appear - serious JavaScript applications will produce hundreds of pages of output per second. Perhaps this is more useful as a demonstration of DTrace capabilities.
The following script traces elapsed times for JavaScript functions. Elapsed is the time from the function entry to the return, and may include other JavaScript functions and time the JavaScript spent off the CPU. If you'd prefer other ways to calculate time spent in functions, hack away...
#!/usr/sbin/dtrace -Zs /* * js_functime.d - measure JavaScript function times using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_functime.d # hit Ctrl-C to end * * FIELDS: * FILE Filename that contained the function * FUNCTION JavaScript function name * COUNT Number of calls during this sample * AVG(us) Average function elapsed time, us * SUM(us) Total function elapsed time, us * * This measures the elapsed times for function entries to returns, and * provides some aggregated statistics. Be aware that the elapsed time for * a function is overlapping; it includes the elapsed times for child * functions that it called. * * Filename and function names are printed if available, else "<null>". */ #pragma ident "@(#)js_functime.d 1.3 07/03/26 SMI" #pragma D option quiet this string str; dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); depth = 0; } javascript*:::function-entry { self->depth++; self->start[copyinstr(arg2), self->depth] = timestamp; } javascript*:::function-return /(this->str = copyinstr(arg2)) != NULL && self->start[this->str, self->depth]/ { this->file = basename(copyinstr(arg0)); this->elapsed = timestamp - self->start[this->str, self->depth]; @num[this->file, this->str] = count(); @eavg[this->file, this->str] = avg(this->elapsed); @esum[this->file, this->str] = sum(this->elapsed); @edist[this->str] = quantize(this->elapsed); self->start[this->file, self->depth] = 0; self->depth~--; } dtrace:::END { normalize(@eavg, 1000); normalize(@esum, 1000); printf("ELAPSED TIME DISTRIBUTION,\n"); printa(@edist); setopt("aggsortpos", "2"); printf("%-33s %45s\n", "{{{___}}} OVERLAP TIMES: {{{___}}}", "{{{______}}} ELAPSED {{{_____}}}"); printf("%-24s %-23s %6s %10s %12s\n", "FILE", "FUNCTION", "COUNT", "AVG(us)", "SUM(us)"); printa("%-24.24s %-23.23s %@6d %@10d %@12d\n", @num, @eavg, @esum); }
Example output,
# ./js_functime.d Tracing... Hit Ctrl-C to end. ^C ELAPSED TIME DISTRIBUTION, getMinutes value ~------------- Distribution ~------------- count 2048 | 0 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 8192 | 0 getSeconds value ~------------- Distribution ~------------- count 2048 | 0 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 8192 | 0 getHours value ~------------- Distribution ~------------- count 8192 | 0 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 32768 | 0 padZero value ~------------- Distribution ~------------- count 2048 | 0 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6 8192 |@@@@@@@@@@@@@ 3 16384 | 0 getElementById value ~------------- Distribution ~------------- count 16384 | 0 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 65536 | 0 setTimeout value ~------------- Distribution ~------------- count 16384 | 0 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 65536 | 0 startTime value ~------------- Distribution ~------------- count 262144 | 0 524288 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 1048576 | 0 {{{___}}} OVERLAP TIMES: {{{___}}} {{{______}}} ELAPSED {{{_____}}} FILE FUNCTION COUNT AVG(us) SUM(us) clock.html getSeconds 3 6 20 clock.html getMinutes 3 7 22 clock.html padZero 9 7 64 clock.html getHours 3 26 78 clock.html getElementById 3 44 132 clock.html setTimeout 3 51 155 clock.html startTime 3 975 2925
The example output shows that the slowest function was startTime, which isn't suprising as startTime contains all the other function calls. The slowest individual function was setTimeout with 3 calls at an average elapsed time of 51 microseconds per call; and the fastest function was getSeconds, which was called 3 times at an average of 6 microseconds per call.
Care must be taken when using a tool like this to fully understand how the time measurements are taken, and what conclusions can and can't be made based on the output.
This script snoops (traces) JavaScript object creation,
#!/usr/sbin/dtrace -Zs /* * js_objs.d - snoop JavaScript Object creation using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_objs.d # hit Ctrl-C to end * * FIELDS: * TIME Time string * FILE Filename that contained the function * LINENO File line number where object was created * CLASS Class to which this new object belongs * * Filename and class names are printed if available, else "<null>". */ #pragma ident "@(#)js_objs.d 1.3 07/03/26 SMI" #pragma D option quiet dtrace:::BEGIN { printf("%-20s %24s:%-7s %s\n", "TIME", "FILE", "LINENO", "CLASS"); } javascript*:::object-create /arg2/ { printf("%-20Y %24.24s:%-7d %s\n", walltimestamp, basename(copyinstr(arg0)), (int)arg3, copyinstr(arg1)); }
Example output,
# ./js_objs.d TIME FILE:LINENO CLASS 2007 Mar 26 18:31:31 clock.html:13 Date 2007 Mar 26 18:31:32 clock.html:13 Date 2007 Mar 26 18:31:33 clock.html:13 Date 2007 Mar 26 18:31:34 clock.html:13 Date 2007 Mar 26 18:31:35 clock.html:13 Date 2007 Mar 26 18:31:36 clock.html:13 Date ^C
In the above output, several Date objects were created by line 13 of clock.html.

Sometimes the filename and line number are not available, and so "<null>" and -1 are printed to indicate this.
This is a simple script to summarize the number of new objects created,
#!/usr/sbin/dtrace -Zs /* * js_objnew.d - measure JavaScript new objects using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_objnew.d # hit Ctrl-C to end * * FIELDS: * FILE Filename that contained the function * CLASS Class to which this new object belongs * COUNT Number of objects created * * Filename and class names are printed if available, else "<null>". */ #pragma ident "@(#)js_objnew.d 1.3 07/03/26 SMI" #pragma D option quiet dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); } javascript*:::object-create { @objs[basename(copyinstr(arg0)), copyinstr(arg1)] = count(); } dtrace:::END { printf(" %-24s %-36s %8s\n", "FILE", "CLASS", "COUNT"); printa(" %-24.24s %-36s %@8d\n", @objs); }
Example output,
# ./js_objnew.d Tracing... Hit Ctrl-C to end. ^C FILE CLASS COUNT clock.html Date 6
Example "noisy" output,
# ./js_objnew.d Tracing... Hit Ctrl-C to end. ^C FILE CLASS COUNT browser.xul Call 2 menu.xml Array 2 sb-loader.js Function 2 sb-loader.js XPCWrappedNative_NoHelper 2 utilityOverlay.js Function 2 nsUpdateService.js Array 4 bookmarks.js Error 6 clock.html Date 6 nsUpdateService.js XPCWrappedNative_NoHelper 6 popup.xml Array 9 browser.js Function 18 menu.xml XPCWrappedNative_NoHelper 20 nsUpdateService.js Function 22 <null> MouseEvent 28 <null> Event 84 menu.xml XULElement 120 <null> Function 231
Sometimes the CPU time consumed to create new objects can be a performance issue. This simple script measures that time,
#!/usr/sbin/dtrace -Zs /* * js_objcpu.d - measure JavaScript Object create on-CPU time using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_objcpu.d # hit Ctrl-C to end * * This measures the on-CPU time consumed due to JavaScript Object creation. */ #pragma ident "@(#)js_objcpu.d 1.3 07/03/26 SMI" #pragma D option quiet dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); } javascritp*:::object-create-start { self->vstart = vtimestamp; } javascript*:::object-create-done /self->vstart/ { this->oncpu = vtimestamp - self->vstart; @dist["Object Creation on-CPU time (ns):"] = quantize(this->oncpu); @total["Total on-CPU time (us):"] = sum(this->oncpu); self->vstart = 0; } dtrace:::END { normalize(@total, 1000); }
Example output,
# ./js_objcpu.d Tracing... Hit Ctrl-C to end. ^C Object Creation on-CPU time (ns): value ~------------- Distribution ~------------- count 256 | 0 512 |@@@@@@@@@ 92 1024 |@@@@@@@@@@@@@@@@@@@@@@@@ 235 2048 |@@@@ 36 4096 |@ 13 8192 |@@ 19 16384 | 0 32768 | 1 65536 | 0 Total on-CPU time (us): 824
The following script is useful to check the behaviour of garbage collect. It tallys the number of objects and prints a summary every second. By watching the output for a while (several minutes or more), steadily increasing object counts into the thousands may be evidence of an object leak.
#!/usr/sbin/dtrace -Zs /* * js_objgc.d - measure JavaScript Object GC using DTrace. * Written for the Solaris Mozilla DTrace provider. * * This traces JavaScript activity from all running browers on the system * which support the mozilla DTrace provider. * * USAGE: js_objgc.d # hit Ctrl-C to end * * FIELDS: * FILE Filename that contained the function * CLASS Class to which this new object belongs * TOTAL Object entropy (positive == uncollected) * * This script provides information on which objects are not being garbage * collected, an issue which causes the browser to steadily leak memory. * We trace object creation (+1) and destruction (-1), and provide a * summary each second of the running tally of the object class and * originating filename. If over the period of several minutes an object * type is still steadily increasing, then that would be of interest. * Be patient, depending on the rate of object creation, it can take over * ten minutes for garbage collect to kick in. * * Filename and class names are printed if available, else "<null>". * * NOTE: there are other Things that GC handles, other than Objects; extra * probes can be added to trace them, should the need arise. */ #pragma ident "@(#)js_objgc.d 1.3 07/03/26 SMI" #pragma D option quiet #pragma D option dynvarsize=32m dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); } javascript*:::object-create /arg2/ { this->file = basename(copyinstr(arg0)); @objs[this->file, copyinstr(arg1)] = sum(1); filename[arg2] = this->file; } javascript*:::object-finalize /filename[arg2] == NULL/ { /* these are caused by dynvardrops. increase dynvarsize */ @objs["<missed>", copyinstr(arg1)] = sum(-1); } javascript*:::object-finalize /filename[arg2] != NULL/ { @objs[filename[arg2], copyinstr(arg1)] = sum(-1); filename[arg2] = 0; } profile:::tick-1sec, dtrace:::END { printf("\n %-24s %-36s %8s\n", "FILE", "CLASS", "TOTAL"); printa(" %-24.24s %-36s %@8d\n", @objs); }
Example output,
# ./js_objgc.d Tracing... Hit Ctrl-C to end. FILE CLASS TOTAL fastclock.html Date 88 FILE CLASS TOTAL fastclock.html Date 173 FILE CLASS TOTAL fastclock.html Date 259 FILE CLASS TOTAL fastclock.html Date 345 FILE CLASS TOTAL nsMicrosummaryService.js Array 1 nsMicrosummaryService.js Function 3 nsMicrosummaryService.js XPCWrappedNative_NoHelper 4 fastclock.html Date 431 [...time passes...] FILE CLASS TOTAL <null> MouseEvent 1 browser.js Array 1 browser.js CSSStyleDeclaration 1 browser.js ComputedCSSStyleDeclaration 1 browser.js XPCNativeWrapper 1 browser.xul XPCNativeWrapper 1 popup.xml Array 1 browser.js Constructor 2 browser.js XPC_WN_ModsAllowed_Proto_JSClass 2 nsMicrosummaryService.js Array 4 nsMicrosummaryService.js Function 6 nsMicrosummaryService.js XPCWrappedNative_NoHelper 7 <null> Function 14 browser.js Function 17 fastclock.html Date 5321 FILE CLASS TOTAL <missed> Function -172 <missed> Date -152 <missed> XPCWrappedNative_NoHelper -33 <missed> Object -19 <missed> Attr -15 <missed> Array -14 <missed> Call -8 <missed> XPC_WN_NoMods_Proto_JSClass -7 <missed> BarProp -6 <missed> BoxObject -1 <missed> HTMLDivElement -1 <missed> Iterator -1 <missed> NamedNodeMap -1 <missed> XULElement -1 <null> MouseEvent 0 browser.js Array 0 browser.js CSSStyleDeclaration 0 browser.js ComputedCSSStyleDeclaration 0 browser.js XPCNativeWrapper 0 nsMicrosummaryService.js Array 0 nsMicrosummaryService.js Function 0 nsMicrosummaryService.js XPCWrappedNative_NoHelper 0 popup.xml Array 0 browser.xul XPCNativeWrapper 1 fastclock.html HTMLDivElement 1 browser.js Constructor 2 browser.js XPC_WN_ModsAllowed_Proto_JSClass 2 <null> Function 3 browser.js Function 6 fastclock.html Date 7
In the above output, the Date object from fastclock.html steadily increased until there were 5321 of them, then the following output shows that the Date object count has dropped to 7 - this shows garbage collect working. Also in the final output are many negative count objects with a "<missed>" filename - these are objects that were already in memory when tracing began (so their count was zero), and we traced their destruction (so they count became negative).
Terms of Use
|
Privacy
|
Trademarks
|
Copyright Policy
|
Site Guidelines
|
Site Map
|
Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
© 2012, Oracle Corporation and/or its affiliates.


This plugin is meant to ensure that console.log() is as useful as it can be. It adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows. If you are happy with how console.log() works for you, then you probably don't need this plugin. This plugin defines a global console object.


Pi MusicBox
** This project is no longer maintained **
There will be no more releases and probably no more support from myself.
The Pi 4 and Zero W 2 do not work with the last release and I don't know of any workarounds.
Potential alternative software suggestions are available here.
The software will continue to be available for now but note it is very outdated, doesn't support the latest Pi hardware and is totally unsupported.
I encourage people to find alternatives.
Thanks to everyone that has helped with Pi Musicbox.
Make your Raspberry Pi stream!
Welcome to the Swiss Army Knife of streaming music using the Raspberry Pi. With Pi MusicBox, you can create a cheap (Sonos-like) standalone streaming music player for Spotify, Google Music, SoundCloud, Webradio, Podcasts and other music from the cloud. Or from your own collection from a device in your network. It won't drain the battery of your phone when playing. The music won't stop if you play a game on your phone.
Connect a 25$ Raspberry Pi to your (DIY) audio system, easily configure MusicBox and go! Control the music from your couch using a phone, tablet, laptop or PC, no tinkering required. AirPlay and DLNA streaming also included!
Features
-
Headless audio player based on Mopidy (no need for a monitor), streaming music from Spotify, SoundCloud, Google Music, Podcasts (with iTunes, gPodder directories), local and networked music files (MP3/OGG/FLAC/AAC), Webradio (with TuneIn, Dirble, AudioAddict, Soma FM directories).
-
Remote control it using a nice webinterface or using an MPD-client (like MPDroid for Android).
-
Also includes Spotify Connect, AirTunes/AirPlay and DLNA/OpenHome streaming from your phone, tablet (iOS and Android) or PC using software like BubbleUPnP.
-
USB Audio support, for all kinds of USB soundcards, speakers, headphones. The sound from the Pi itself is not that good...
-
Wifi support (WPA, for Raspbian supported wifi-adapters)
-
No need for tinkering, no need to use the Linux commandline
-
Play music files from the SD Card, USB, Network.
-
Last.FM scrobbling.
-
Several Pi soundcards supported (HifiBerry,
JustBoom,
IQ Audio)
Please note that Pi MusicBox does NOT currently support the Raspberry Pi 4
Screenshots
Requirements
-
Working Raspberry Pi (any model except Pi 4)
-
Speakers, amplifier or headphones (analog or USB)
-
SD-Card, 1GB minimum, 2GB+ prefered
-
Computer with a modern browser; tablet or phone. The webinterface is tested with
recent versions of Firefox, Chrome, Internet Explorer and iOS (iPad/iPhone), modern versions of Android (Chrome Mobile, Firefox Mobile).
Internet Explorer version 10 works, earlier versions don't. You can also use an
MPD client to connect.
-
Spotify Premium, Google Music (All Access) or SoundCloud account for streaming.
DIY Projects using Pi MusicBox
Pi MusicBox is proud to provide the software for an increasing number of Do It Yourself audioboxes, like these:
Download
Here you can find an SD card image to use on your Pi. It's around 300MB to download and will fit on a 1GB or larger SD card (changes):
This can take a while, so in the meantime, please spread the word!
Howto's
Alongside the install steps below, you'll also find more detailed instructions in the latest manual
(Catalan,
Spanish,
French).
Additionally, some helpful Pi Musicbox users have submitted their own instructions and guides.
Instructions
Extract the zip-file. Put the resulting image on your sd-card by using the wonderfully simple Etcher SD card image utility
or by following
these instructions. The image will fit on a 1GB card, but you should use a larger one if you
can as this will leave more space for your music files. The latest manuals are included on the release page.
Configuration
-
You can edit all settings in the new settings page from the webclient. To access it, you need a network connection. To enable Wifi, you can either first connect the Pi using a cable and use the settings page, or fill in the wifi-settings in the ini file on the SD Card. For that:
-
Put the SD-card into your computer. Open the contents of the 'config' folder of SD-Card in your
Finder/Explorer.
-
Add your Wifi network and password to the file (and edit other settings if you want)
settings.ini
It has instructions on what to put where.
-
MusicBox will autodetect usb audiocards/speakers/boxes and hdmi.
It's possible to override this in the settings. For example if you want to use analog out while having hdmi connected.
Detailed instructions can be found in the manuals.
Start me up!
-
Put the card in the Pi
-
Connect cables (You don't have to connect a monitor to the Pi if you
don't want to)
-
To use Wifi and USB-Audio you have to plugin the devices before you
start the Pi. Restart if you plug them in later.
-
Power on your Pi
-
Wait for a while... So in the meantime, follow us!
Accessing the music
-
Point your browser to the Pi. Depending on your network and computers,
it will be available at this address:
http://musicbox.local
-
Most OS X/iOS and Windows devices probably will find it immediately. If it doesn't work, you could try to
install Apple Bonjour/iTunes in Windows to make it work. Linux should also work if Avahi or Samba/Winbind is installed.
-
Using Android, you have to point your browser to the MusicBox using the IP-address of your Pi, e.g.
http://<IP_ADDRESS>/
(fill in your own!).
There is no way to change that for now, unless Android would support it,
The IP-address is printed on the screen when
MusicBox is started. Connect a monitor/tv to find out.
Or use a network/bonjour scanning utility such as Zentri Discovery.
Support & Contact
Please refer to the Frequently Asked Questions and manual before asking questions.
You can discuss features and problems on the
forum. Please report bugs about MusicBox itself at
the repo at Github. You can also try the
#mopidy
channel on
Freenode,
or the
Raspberry
Pi forums for more general Pi issues.
What's new?
Take a look at the latest changes.
Security
This is system not totally secured. Don't run it outside a firewall!
-
The Mopidy musicserver is not completely protected
-
Also, the passwords of Spotify and wifi are stored in plain text on
the SD-Card.
-
It's easy to login to the server with the root login and
the password musicbox (remote login is not enabled by default though).
Thanks
Pi MusicBox is based on the following great projects:


DataStoreAuthenticationType
@objc
public enum DataStoreAuthenticationType : Int
Constants that provide information regarding authentication type of data store manager.
-
The authentication type NTLM.
Declaration
Swift
case ntlm
-
The authentication type MSN.
Declaration
Swift
case msn
-
The authentication type DPA.
Declaration
Swift
case dpa
-
The authentication type RPA.
Declaration
Swift
case rpa
-
The authentication type HTTPBasic.
Declaration
Swift
case httpBasic
-
The authentication type HTTPDigest.
Declaration
Swift
case httpDigest
-
The authentication type HTMLForm.
Declaration
Swift
case htmlForm
-
The authentication type Default.
Declaration
Swift
case `default`
-
Creates a new instance with the specified raw value.
If there is no value of the type that corresponds with the specified string value, this initializer returns nil.
Declaration
Swift
public init?(rawValue: String)
Parameters
rawValue
The raw value to use for the new instance.
-
The corresponding value of the raw type.
Declaration
Swift
public var rawValue: String { get }
-
A textual representation of this instance.
Declaration
Swift
public var description: String { get }
-
A textual representation of this instance, suitable for debugging.
Declaration
Swift
public var debugDescription: String { get }


-
Apple - Privacy
www.apple.com
At Apple, we respect your privacy and protect it with strong encryption, plus strict policies that govern how all data is handled.
-
This is why your Internet is slow. And it’ll get worse. Unless you take 1 ...
www.battleforthenet.com
You’re our only hope.
-
For Big-Data Scientists, ‘Janitor Work’ Is Key Hurdle to Insights - ...
www.nytimes.com
Technology revolutions come in measured, sometimes foot-dragging steps. The lab science and marketing enthusiasm tend to underestimate the ...
-
iPhone camera evolution: How does the iPhone 6 camera compare to previous ...
snapsnapsnap.photos
How does the iPhone 6 camera stack up against previous hardware? In her ongoing series, professional iPhone photographer Lisa Bettany takes a hard ...
-
If programming languages were weapons • Bjorn Tipling
bjorn.tipling.com
C is an M1 Garand standard issue rifle, old but reliable. C++ is a set of nunchuks, powerful and impressive when wielded but takes many years of pain ...
-
The Secret Goldman Sachs Tapes
www.bloombergview.com
The public doesn't seem to understand just how dysfunctional our financial regulatory system is, Michael Lewis writes. That may change today with a ...
-
Steve Jobs Was a Low-Tech Parent - NYTimes.com
www.nytimes.com
When Steve Jobs was running Apple, he was known to call journalists to either pat them on the back for a recent article or, more often than not, ...
-
Hyperlapse, Instagram's New App, Is Like a $15,000 Video Setup in Your ...
www.wired.com
Today, Instagram is lifting the veil on Hyperlapse, the company's first-ever app outside of Instagram itself.
-
M6.0 - 6km NW of American Canyon, California (BETA) 2014-08-24 10:20:44 UTC
comcat.cr.usgs.gov
USGS Earthquake Hazards Program, responsible for monitoring, reporting, and researching earthquakes and earthquake hazards
-
Inside the building where Apple tortures the iPhone 6
www.theverge.com
A few blocks away from Apple's bustling campus in Cupertino is a rather nondescript building. Inside is absolutely the last place on earth you'd want ...
-
Apple Pulls iOS 8.0.1 Update After Bug Knocks Out Cell Service And Touch ...
techcrunch.com
Update: Apple has pulled the iOS 8.0.1 update from availability, a fix is likely incoming. For now, it appears to only affect iPhone 6 and iPhone 6 ...
-
Burn Baby Burn – AVC
avc.com
Andy sent me a WSJ piece with Bill Gurley yesterday. I don’t like to link to paid content so here’s a good Business Insider summary of the article ...
-
The Investigators: Dashcam video clears NJ man; Cops now indicted
7online.com
The tale of the police dashcam video has now helped clear a Bloomfield, New Jersey man who faced a multitude of charges.
-
You Are Not Late
medium.com
Can you imagine how awesome it would have been to be an entrepreneur in 1985 when almost any dot com name you wanted was…
-
You're invited to join App.net for free
join.app.net
App.net is your passport to great applications. Use your account to access a network of amazing social apps.
-
Progress Report: Continued Product Focus
yahoo.tumblr.com
By Jay Rossiter, SVP, Cloud Platform Group At Yahoo, focus is an important part of accomplishing our mission: to make the world’s daily habits more ...
-
Should publishers really think 'mobile-first'? - Digiday
digiday.com
One the big assumptions about publishing today is that mobile consumption is going up and desktop consumption is going down.
-
Miss a Payment? Good Luck Moving That Car - NYTimes.com
dealbook.nytimes.com
The thermometer showed a 103.5-degree fever, and her 10-year-old’s asthma was flaring up. Mary Bolender, who lives in Las Vegas, needed to get her ...
-
A Long, Ugly Year of Depression That's Finally Fading - Rand's Blog
moz.com
Yesterday morning I woke up early to speak at the Business of Software conference in Boston. It was my first time there, and it’s an exceptional ...
-
Venture Capitalist Sounds Alarm on Startup Investing
online.wsj.com
Silicon Valley may have taken on more risk than it can handle, according to prominent venture capitalist Bill Gurley, who cited potential cracks in ...
-
Requests for Startups
www.ycombinator.com
You shouldn't start a company just because it's on this list. 1. It’s mostly here to help stimulate you to think about ideas.
-
Man Dives Into An Active Volcano With A GoPro, Calls It A 'Window Into ...
www.huffingtonpost.com
George Kourounis stood at the edge of a red-hot lava lake, fiery molten rock gurgling just feet away as caustic acid rain splashed his protective ...
-
Welcome to Verge 2.0
www.theverge.com
You might notice something a bit different about The Verge today. Open our site on any device, make your window any size. It works. Everywhere. As of ...
-
Seeing Through the Illusion: Understanding Apple's Mastery of the Media
9to5mac.com
“Beautifully, unapologetically plastic.” “Feature for feature, it’s identical to iPad Air in every way." “Just avoid holding it in that way." Apple’s ...
-
It's Over: The Rise & Fall Of Google Authorship For Search Results
searchengineland.com
Anyone who follows Google knows that nothing it creates is immune from elimination. Like so many efforts before it, Authorship is fading into the ...


Microfinance industry’s loan portfolio grew 47.85 per cent till September this year
by Our BureauMicrofinance industry’s gross loan portfolio grew whopping 47.85 per cent year-on-year as on September 30, 2019 at Rs 2,01,724 crore, a industry report showed.
The total number of microfinance loan accounts also grew to 9.79 crore as at September 30, 2019, up from 7.43 crore accounts on the same date last year, the latest MFIN’s micrometer report for the second quarter (July-September) this fiscal showed.
Harsh Srivastava, CEO, MFIN, said “It is heartening that in the last thirty months, an additional 18.3 million women have taken microfinance loans.
This growth in unique borrowers is an endorsement of the unstinted trust that small borrowers have reposed on all RBI-regulated microfinance institutions. This is also seen in the strong track record of repayment that microfinance continues to demonstrate”.
He said that microfinance sector continues to grow steadily as new microfinance customers are being added. CAGR has been consistent for years-- 42 per cent for the last six years. There is a lot of unmet demand still as is evident from the fact that only 27 per cent of potential households have been reached by Microfinance, Srivastava said.
Microfinance industry serves estimated 5.46 crore unique borrowers through 9.79 crore loan accounts.
NBFC-MFI loan portfolio
Meanwhile, NBFC-MFI loan portfolio grew 16.67 per cent year-on-year to Rs 62,960 crore as at September 30, 2019.
As much as 94 per cent of loans are through cashless mode. Overall health portfolio remains good with Portfolio at Risk (PAR) greater than 90 days is 0.42 per cent of Gross Loan Portfolio.
Microfinance Institutions Network (MFIN) is a RBI recognized self-regulatory organisation and industry association of the microfinance industry. The latest micrometer report reveals that the access to microfinance is rising at a healthy pace, nationally, and increasing number of small borrowers across the country are paying back their dues on time. This endorses the fact that microfinance loans are increasingly seen by small borrowers as big economic facilitators, regulated and organized form of finance, over the unregulated forms of availing finance, as per Micrometer data.
Over the last 2.5 years, beginning March 2017, which also marked the end of demonetisation period, an estimated 1.83 crore unique borrowers have been added, which is an average of 0.73 crore per year (CAGR of 16.87 per cent).
Banks hold the largest share of portfolio in micro-credit with total loan outstanding of Rs. 80,570 crore, which is 40 per cent of the total micro-credit universe.
Non-Banking Financial Company-Micro Finance Institutions (NBFC-MFIs) are the second largest provider of micro-credit with a loan amount outstanding of Rs 62,960 crore, accounting for 31 per cent to total industry portfolio.
Small Finance Banks (SFBs) have a total loan amount outstanding of Rs 34,829 crore with total share of 17 per cent, NBFCs 11 per cent with total loan outstanding of Rs 21,381 crore and other MFIs account for 1.0 per cent share in the microfinance universe.
- Get Free Trial
- Hurry! Prices Increase Soon
Existing users, please Sign in here
Thank you for being a loyal user of Portfolio.
Portfolio will be a paid section hereon.
Please Subscribe to get access to one of our early bird packs. Or click on Free Trial to get 14 days free trial.
What You'll Get
-
Web + Mobile
Access exclusive content of the Hindu Businessline across desktops, tablet and mobile device.
-
Exclusive Portfolio and Investment Advice, Banking, Lifestyle and Specials
Get diverse set of perspectives from our trusted experts on Portfolio, Banking, Economy, Environment and others.
-
Ad free experience
Experience cleaner site with zero ads and faster load times.
-
Personalised dashboard
Customize your preference and get a personalized recommendation of stories based on your interest.
- Get Free Trial
- Hurry! Prices Increase Soon
Existing users, please Sign in here


Hi there, (sorry for my poor english)
I´ve been working form some nights now in developing a more precise (but more power expensive) EmonTX firmware based on interrputs, ind i´ve made some great progress that i wish to colaborate to the project.
I´m almost ready to post my first release of the code, as soon as i deal with the 3-phase shift. i´m working in a software solution to extrapolate all the 3-phase data based on only one voltage source (to make it possible with emontx original hardware).
In my code i´m dealing with configurable 1,2 or 3-phase systems with 0, 1,2 or 3 voltage transformers (2 and 3 voltage sources breaks emonTX hardware compatibility)
In my approach, every cycle is computed and analized in the metering interrupt service routine, similar to the AVR example on the atmel´s website.
Now there are some questions:
Where can i post the code? is there a page availiable for "non-official" firmwares? Shoud i post the code here in the forum?
Thanks
Paulo Cunha
Re: EmonTX New Code based on Interrupts
Hi Paulo,
you can post the code on the forum, or better, on GitHub if you have an account.
looking forward to see your code.
regards
amin
Re: EmonTX New Code based on Interrupts
Hi Paulo,
This sounds interesting. We have an OpenEnergyMonitor git hub: http://github.com/openenergymonitor. Feel free to post to this account. Let me know if I need to make a new repo in the emonTx firmware for you.
All the best,
Re: EmonTX New Code based on Interrupts
Thanks glyn,
I'm new with github. i'll create an account today to see how it works.
I'm testing and resolving some bugs that i found yesterday, and i'm not finished the 3-phase calculations. Im stuck in a mathematical problem that our language barrier keeps me from explaining it to you.
i need to put a desk in front of my energy panel to test and debug the code...
i think in 2 more days i'll have a stable beta.
Regards,
Paulo
Re: EmonTX New Code based on Interrupts
The code is not ready, not Fully commented, and not properly cleaned, but it´s working and it´s beta1.
Re: EmonTX New Code based on Interrupts
Hey guys,
The base code (not the one i posted) was updated and was running rock solid form more then 1 month monitoring the 3 phases with a great accuracy, so my home server (a linux freeagent goflex) flash disk crashed and i lost all my emoncms history. I then decided to continue with the development.
I´m now implementing the RFM code, eeprom config with remote adjustment of calibration values, pool period and RFM ids.
Trying to implement incremental kw storage i ´m thinking in a remote calibration mode to help with the calibration.
Any ideas? My base ideia is to control all the calibration parameters remotely using the Gmonlcd and nanode. I'm thinking in a calibration mode that you see the data near real time, and imputing an predefined resistive load to it it automatically adjusts itself to the load.
Future TODO´s, will include gemonlcd menus to control the Emontx. that way i think will be possible to deploy and calibrate emontx and gemonlcd without the need of a computer for a full working solution.
Sorry if i´m going in the opposite direction of the "Keep it simple". i´m going towards the "Keep it easy to maintain"...
Re: EmonTX New Code based on Interrupts
This Looks interesting, it would be great if you could put the code in the git repository, this would make it easier for others to look at and post changes as well as a bit more explanation as to how it works. I've had a quick look at the code, it looks pretty involved!
Re: EmonTX New Code based on Interrupts
1st public release of the code is on Github at: https://github.com/pcunha-lab/emonTxFirmware/tree/master/emonTx_Interrupts
This code is stable and running for 1 week. without watchdog.
I´ve just adapted the GLCD code to use the new payload format and i´m working on the nanode firmware to be able to control the config variables by a remote pc using a webserver.
Soon i´ll put the other codes too.
Re: EmonTX New Code based on Interrupts
Hi all,
This new code is running rock solid for 3 months now.
I am now moving forward to create a configurarion menu for glcd and a new firmware to emonbase to handle the new protocol. and other device types ( acting lile a proxy to a emoncmd or similar soluton)
Looks i'm moving into a not too simple solution, but a more "user friendly". i don't know if that's the objective of the project.
My goal this year is to implement more sensors that will integrate into the rfm network uning the protocol to comunicate via emonbase. That sensors will include an HVAC thermostat, a lamp dimmer switch, a wireless weather station, an aquarium controller and some other ideas for my home...
will this project be a good place to discuss that projects? since i'll be using all the basic concept of emontx, glcd and base? and they will be the heart of the system?
Re: EmonTX New Code based on Interrupts
Hi Pcunha,
i was just starting to write my own three phase monitoring code with nearly the same ideas like you when I found this post. This is just excellent! Very much the same what I wanted to do and ready to use.
The only thing that puzzled me a bit is the very high prozessor loading in the ADC ISR. I had only very few us per cycle left and quite a lot of jitter because some calculations seem to take even more time than available. This does not seem to harm accuracy as far as I can say, but is not really nice.
I found a very simple way to shorten the calculation by ~8-9us per interrupt:
- declare New and Previous in CurrentSampleS and VoltageSampleS as int (instead of float).
- calculate the .Filtered value as follows
xxxSample.Filtered = 0.996 * ( xxxSample.PreviousFiltered + (xxxSample.New - xxxSample.Previous) );
With this modification, (xxxSample.New-xxxSample.Previous) is calculated using integer math and this seems to make the difference.
Please try and comment.
Big Thanks again for your fantatstic code!!!
BR, Jörg.
PS: is there a way to change the optimization of the compiler from -Os for size to -O2 or -O3 for speed?
PPS: another 5 us per interrupt (and some memory space) can be saved by declaring ADC_V_BUFFER as int.
Re: EmonTX New Code based on Interrupts
I forgot to mention that I had to make one important change to get everything running:
- set bit 0x40 in ADMUX to select 'AVcc with external cap at AREF pin'
This was missing in Pcunhas code, maybe he is using a different hardware?
In this context I have one question: Is there a decent (eagle?) schematic and board file for the emontx available somewhere?
Re: EmonTX New Code based on Interrupts
Wow! I have just spent the afternoon studying your firmware, its really great work, very impressive! I will get back to you with some further thoughts soon
Trystan
Re: EmonTX New Code based on Interrupts
There are some small 'bugs' in the code which should be removed first. I have taken Pcunhas code as a starting point, done some modifications and have tested the code with a 1+3 (1 wall transformer + 3CTs) sensor arrangement for real three phase measurement. Accuracy is quite good. Compared it to a professinal mains analyzer tool the power readings and accumulated energy were within +/-3%.This is much better than my 'official' energy meter, which is up to +10% off!
If I am allowed to, I would attach my code (or I can send it as PN if someone is interested). There is for sure room for improvements and the code still has some deficiencies.
Regards, Jörg.
PS: forgot to mention that my version is more or less fixed for the abovementioned 1+3 arrangement because I removed a lot of the conditional defines from the original code .
Re: EmonTX New Code based on Interrupts
Thats clever use of the free-running mode of the ADC on the Arduino chip. Got me thinking about other uses now.
Re: EmonTX New Code based on Interrupts
You're not the only ones! I also had to read a lot about ADC interrupts to understand it all (I'm not sure I do now :D)
But definitely inspiring for other projects!
This needs to be documented in the wiki in a decent way
Re: EmonTX New Code based on Interrupts
There can be one small problem with using the free running ADC interupt like in Pcunhas code. The code in the ISR has to take less cycles than the ADC conversion (in this case 104us) otherwise the sampling will be jittering (or even delayed).
If the calculations can not be done in a shorter time then using a Timer interrupt (with periode >104us) starting the ADC is the better and more flexible solution.
Re: EmonTX New Code based on Interrupts
In going through the code I pulled out the core part of the interrupt code and the circular buffer used for delaying the voltage waveform so that I could test their workings in isolation, I've put them up here:
Interrupt Sampling
Circular Buffer, both Robert Wall's 3 phase code and Pcunha's code use a circular buffer to delay the waveform.
Re: EmonTX New Code based on Interrupts
Another part which was interesting to learn about was the ability to detect what kind of reset happened:
Re: EmonTX New Code based on Interrupts
Is this correct? According to the schematic of the emontx on solderpad (isn't there a better one?) the emontx uses AVcc as reference with external capacitor on the AVref pin. This was one of the problems I had with the original code. I am using now:
EDIT: Now I'm a bit puzzled.... do you really get correct ADC readings with your (== the original) code?
Re: EmonTX New Code based on Interrupts
JBecker: Are you asking me? I havent tested the full sketch in action only studied it, I havent quite got as far as doing an analog read with the IntterruptSampler extract example, only as far as counting the number of samples that are taken in a second.. ?
Re: EmonTX New Code based on Interrupts
Trystan,
sorry, I did not manage to address you correctly...(is there a possibility to quote?)
It would have been strange if you got correct results. Can you confirm that my assumption about the adc reference is correct?
This really puzzled me with the original code. It is very well done but has some real nasty bugs and I cannot believe that it worked as posted. This is why I made some comments in this thread.
Re: EmonTX New Code based on Interrupts
Trystan,
Another part which was interesting to learn about was the ability to detect what kind of reset happened:
»
this is also directly copied from the application note AVAR465, as is the complete basic code discussed in this thread including interrupts by free running adc. Paulo 'just' added the three-phase capability and the
configurationcalibration via RF. It is a bit surprising that nobody seems to know the AVR465 code although the hardware clearly follows this app note and the app note is sometimes even given as a reference.Re: EmonTX New Code based on Interrupts
Your quite right JBecker, ADMUX = 0x40 | (pin & 0x07) is correct, this is the same as the default setting set in Arduino-1.0/hardware/arduino/cores/wiring_analog.c, it is AVcc as reference with external capacitor on the AVref pin that should be selected.
Interesting stuff, I had never really tried to understand this low-level stuff, I've just read up about it will write a short blog post for people interested.
EDIT: here's the blog post: http://openenergymonitor.blogspot.co.uk/2012/08/low-level-adc-control-admux.html
Re: EmonTX New Code based on Interrupts
Hi eberybody,
Im very glad that the code was useful to you!
First of all, how we quote text from others? is there a quote button? I'll indent it then.
Let-me explain some points here. For some reasom i'm not receiving notifications from the forum, so i just watched the thread after a personal e-mail.
JBecker:
I found a very simple way to shorten the calculation by ~8-9us per interrupt:
- declare New and Previous in CurrentSampleS and VoltageSampleS as int (instead of float).
- calculate the .Filtered value as follows
xxxSample.Filtered = 0.996 * ( xxxSample.PreviousFiltered + (xxxSample.New - xxxSample.Previous) );
With this modification, (xxxSample.New-xxxSample.Previous) is calculated using integer math and this seems to make the difference.
PPS: another 5 us per interrupt (and some memory space) can be saved by declaring ADC_V_BUFFER as int.
First you are right. Im pushing the avr at its edge. there are ways to optimize the code! i did'nt had enouth time.
your ideas are great! I'll implement that and see what it happens. How did you have measured the interrupt times? I've counted the lines in the assemble compiled version. Do you know if this is ok?
In the AVR document that i was inspired, all tha math is in integer. I did'nt had enouth brain processing power to understand that, so i've proceeded with part emontx code part avr doc code.
set bit 0x40 in ADMUX to select 'AVcc with external cap at AREF pin'
That's absolutely correct and i'll add this to the docs. Im using my own hardware, based on EmonTX, with some minor modifications. The analog reference i'm using is from an external source provided by a variable resistor. so i can precisely calibrate the exact middle of the 3.3v source. The 3.3v Source i'm using is from an very precise dc-dc converter.
I have done several tests to came with this hardware. I wanted a configurarion that allows-me to go in a infinite loop, reading the ADC and only get 512 as a result with no load on the CT, without any noise. And the results i achived are 9.999 512 values per 10.000 samples! Thats very good result. I 'll take some pictures of the circuit later.
If I am allowed to, I would attach my code (or I can send it as PN if someone is interested). There is for sure room for improvements and the code still has some deficiencies.
Please send it to me, so i can merge your modifications in the git! I Like condicional defines because, as a global project, everyone can use the same source code.
Yes. You shoud be careful with that. The way i found to debug the code and see if it is performing well is to set a volatile variable at the start of the interrupt and unset it at the end, If in the main loop, the variable is still set, i increment a second variable to count the interrupts that did'nt reached the end. It workd in a weird way. I 've also found that you can still debug the code from the serial line, but you need to use the fastest speed your uart can provide. Im using 115200 for debug.
Thystan Lea:
Have you read my read-me? Im using a 20mhz crystal. The calculations of the number of samples per second are (from the manual):
For 16mhz Crystal: 16000000 / 128 / 13 = 9615 Samples Per Second
128 is the ACD prescaler
13 is the total number of cycles used by the adc circuit do give you an reading
16000000, well, the frequency...
Re: EmonTX New Code based on Interrupts
Hi Paulo, very nice to hear from you!
To make it short, I have found three major 'problems' in your code:
- setting of the external reference as explained above (OR 0x40 to ADMUX), solved!
- you put the 'Voltage.PhaseShifted' value into the ADC buffer. This is not so nice as this is already shifted by the phaseshift value for the first CT. Depending on the configuration, this might not be optimal (at least not for the 1+3 configuration). I would store the filtered voltage sample instead. And do the phase shifting when calculating the currents and depending power values. This means some more calculations after taking the current samples which will again need more processing time (see next item)
- runtime of the code. I found that the original code (run @16MHz !) jitters (= ISR is not entered at fixed 104us intervals), because some of the calculation just take too much time. The calculation time depends on the individual values and is not constant. So, sometimes the code jitters more and sometimes less. I made some improvements which help, but even in my code processing time is 'at or over the edge'. I would prefer to do all calculations in integer (as it is in the original AVR465 code. And, I never use float as it 'costs'). This can give big improvements. Float math is easy to do but can have a severe speed (and code size!) penalty. And it does not give more accurate results as some people seem to think!
Debugging, measuring runtime of code:
I measure processing times by setting and resetting an unused digital output before and after the critical code section (or at the beginning and at the end of the ISR). Off course, you will need a scope for that.
That's it for now, hope we can find ways to improve the code so that it becomes even more useful.
Regards, Jörg.
PS: .......count the interrupts that did'nt reached the end.
This assumption is not correct. Every ISR will reach the end and clear the volatile before returning to main.
Re: EmonTX New Code based on Interrupts
JBecker,
As i don't have a scope, you will need to help-me with that.
I'll begin studyng integer math to optimize the code. I Think it is possible.
I'll work on this weekend.
Re: EmonTX New Code based on Interrupts
Paulo,
I think I will also have some time on saturday and maybe sunday. My Emontx is at the moment 'permanently installed' in my distribution, but I will put it back on my desktop for this.
I have also made some tests already with conversion to integer calculations, but i had no time to finish it and then just wanted to have the system running.
Re: EmonTX New Code based on Interrupts
Hi Jbecker,
Thank you for the explanation on the other topic.
I didnt know where the 0.996 came from. i was trying to figure it out all the last weekend :)
I had made some minor improvements and corrections on the code that saved about 50 cycles per interrupt, with the same math code. and your suggestion. Its not much but it is something. (counted at avr studio)
The calculations are being done when the adc index is 0, but it shoud be when its (num_cts + num_voltage_Sensors), because we are geting one more voltage sample.
I had worked 2 days and i did'nt solved it. Can i leave that part to you? i think you got the 0.996 math better than me. If yes, i'll work on my idea of auto calibration routine.
As soon as im able to connect to my Github account again, i'll upload the code.
Thanks,
Re: EmonTX New Code based on Interrupts
Hi Paulo,
I just found out that my SSD is defect. First I will have to setup my computer again. I have copied the last (?) sketch that I did before the PC was wrecked and will try to append it here.
This sketch hast just the voltage measurement implemented correctly. The current measurement is not ok yet. But I think you can get the idea.
Cheers, Jörg.
PS: it is not allowed to attach .ino files? And .pde is ok?


$TITLE
Project Goal: $GOAL
Project Summary
$GOAL_TEXT
$SUMMARY
Description
$DESCRIPTION
Suggested Gifts
$GIFTS
$PRAYER


about
fun facts
- I am a graduate student at the University of Pennsylvania
- Learning all the Computer Graphics
- Read about my projects in my blog!
- I was a Cast Member at Walt Disney World through the Disney College Program
- If you were Casey's Corner or Tomorrowland Terrace at the Magic Kingdom from January 2016 to July 2016, you probably saw me!
- I studied Computer Science at Rutgers
- I miss riding the Rutgers busses


Jenkins displays text depending on the language of the browser. So all you need to do is change the language of your internet browser.
Note that, depending on the browser and on the language, you might need to download addons. For example, for Firefox, see Changing the language pack.
Under Firefox, a tool such as Quick Locale Switcher might help quickly test various languages.
You can additionally change the system language (used when builds are executing), as well as the user interface language for all users by using the Locale Plugin.
See an old example of Hudson in French:


{{ page.title }}
{% if page.subtitle %}{{ page.subtitle }}
{% endif %}Need help with your project?
We specialize in Ruby on Rails and JavaScript projects. Code audits, maintenance and feature development on existing apps, or new application development. We've got you covered.


.. title: Contact .. slug: contact .. date: 2016-12-14 14:41:45 UTC .. tags: .. category: .. link: .. description: .. type: text .. author: .. previewimage: .. nocomments: True
I would like to use this as a platform to be thankful for the whole community who help others by sharing their knowledge and thoughts openly and help amateurs like us to grow. I would also start my journey of learning by sharing my knowledge and views. I will be very happy to discuss with everyone either Academic or Non-Academic details.


changeObjectInfoViewModeAPI is an API that activates the object information display function. this The flag parameter in the API is of type Boolean, and if true, the information display mode is activated, and if false, it is deactivated Way. A database that manages the callback function when an object you want to know information is clicked while it is active The information display callback function is called according to the operation policy and the object information is Comes out. In addition, the information display callback function can be customized by the user.
| name | type | description |
|---|---|---|
| managerFactoryInstance | ManagerFactory | start of mago3D |
| flag | Boolean | true: active, false: Inactive |


{% extends "base.html" %} {% block title %}Activation Failed{% endblock %} {% block content %}
Activation failed for supplied activation key: {{ activation_key }}


Sara Antablian
Cell:<PHONE_NUMBER>
CalBRE#: 01265049
<EMAIL_ADDRESS>"Without exception, I must say our recent real estate transaction with Sara was excellent! She positioned our property effectively, then marketed it aggressively,
and finally negotiated the transaction with our buyer with great skill. As out-of-state sellers we relied on Sara heavily - and she didn't disappoint us. She stepped in
to manage all aspects of the process effectively on our behalf. Her considerable experience, patience, guidance and careful follow-through proved to be definite advantages.
We clearly value our partnership with Sara."
-Paul Roelofs
"Sara's counsel and advice was always supported by careful research. I especially needed that when the first buyer tried to reduce the price during escrow. Her preparation
regarding the options open to me in that circumstance made the decision so easy and, as events proved out, very correct. I also very much appreciated her work ethic and timely communication.
We never once got behind on anything that needed to be done and this made it possible to close escrow early, even on a short thirty day escrow. Finally, being an attorney, I was extremely
comfortable with her handling of all the paperwork. She understood content as well as the necessity of documenting the terms and events of the transaction. Sara certainly earned her commission in this sale!!!"
-Dennis Shanklin
"Sara Antablian was the office manager for our law firm and worked for us for over thirty years. Sadly for us, she left us to pursue her dream career in real estate. I am a lawyer and practice real estate law primarily.
Sara administered our medium-size law office with flawless efficiency and skill. Her intelligence, talent, memory and attention to detail continually kept it running smoothly. We were confidently able to leave the administrative
work to her, along with all that came with it.
It was about fourteen years ago, Sara commenced her real estate business on evenings and weekends. I learned of the knowledge and skills she had acquired as well as her successes. She continued to work fast and efficiently which
have left her clients satisfied with her work. Word of her abilities spread and brought her new clients.
I am impressed by how Sara is always current with the ever-changing real estate markets as well as the many rules, regulations, requirements and practices that govern it. It is not a surprise that she continues this excellence in
her real estate business. Sara uses her intelligence and resourcefulness to successfully market a property, to find information from hard-to-access sources and assisted me in estimating property values. I do not hesitate to recommend her to
my clients and acquaintances and she is the only real estate agent I would use myself. I speak and meet with Sara regularly and we continue to discuss our work. While my partners and I miss her services, we are very proud of her business accomplishments."
-Peter Wright
"I have known and worked with Sara for 30 years and have been referring clients to her for real estate services ever since she began to work in the real estate sales business.
I know her to be intelligent, honest, ethical, and competent.
My clients invariably have been pleased with her services as a sales agent.
I heartily recommend her."
-Norm Green


RES Manager
Reverse Proxy:
OFFLINE
Reverse Proxy Uptime
OFFLINE
Static Nodes
0
Dynamic Nodes
Static Nodes
Name
IP
Uptime
Stop
Dynamic Nodes
Name
IP
Uptime
Stop


The EmonTx3.4 seems to be a low power application. I have been reading reading that i can use a half wave instead of a full wave rectifier in low power applications, i already did the circuit in a protoboard, using a simple rectifier diode and been doing tests
Using the osciloscope you can see the wave forms from the Vin, the output of the diode, and finally the output of the diode using a Average sampling that ends up giving 600mV
My guess is that if i change the value of the cap, the rize will be lower, however, unless the diode used in the original design does something different, im wondering how is the EmonTX getting a steady DC value for its signals offset, and to power the microcontroler using 3.3v
My main concern here is, that at least in the osciloscope, i cant seem to get a 3.3v value, which makes me wonder how is this part of the circuit working
Duplicate post deleted - BT
Re: Question about the half wave rectifier
I also noticed the current limiter resistor at the output of the rectifier, but i miss to understand what its the porpuse, just to limit the amount of current at the Vreg? (probably to prevent it from getting damaged?)
Re: Question about the half wave rectifier
Did you include that MCP1754 in your design? That's the voltage regulator that does the bit you're interested in. It'll output a steady 3.3V regardless of what you feed it (within limits). It's good for at least 70dB of ripple rejection over quite a wide frequency range.
Re: Question about the half wave rectifier
The 56 Ω is there to limit the inrush current into the capacitor, it has nothing to do with the regulator. The amount of charge drawn from the capacitor is constant (over 1 cycle), therefore the charge that the capacitor requires is constant. Because the current is limited by the resistor, in order to charge the capacitor, the current has to flow for a longer time.
But why do this? You need to step back into the ac adapter. The same voltage is also being use to measure the supply voltage. The adapter has a finite internal impedance, which means that the voltage it delivers depends on the current drawn. When you draw a pulse of current, the voltage drops and spoils the measurement. By limiting the current pulse in this way, that voltage drop is made small so that it does not materially affect the voltage measurement.
It is only possible to do this because we have a much higher voltage from the ac adapter than the regulator needs.
My simulations, with the standard ac adapter, show that the dip on the positive peak reduces the rms value of the voltage by less than 0.34% at maximum supply voltage to less than 0.25% at minimum supply voltage. My mains supply is not stable to anywhere near that, I don't have a stabilised power supply so it is impossible to verify that figure.
Here is the simulation at minimum supply voltage. The red trace is the input sine wave, the cyan is the voltage to the analogue input, the blue is the difference × 100.


{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% block title %}RexChain{% endblock %}
{% block subtitle %}
{% endblock subtitle %}
{% block cssblock %}
{% endblock cssblock %}
{% block content %}
{# Alert messaging #}
{% language 'es' %}
{% endlanguage %}
{# SECTION HERO #}
Thanks for joining us today!
Do you want to know more about RexChain? Click the link below
{# SECTION CALL TO ACTIONS #}
{# article CALLTOACTION #}
READ OUR WHITEPAPER
LEARN MORE!
{# article CALLTOACTION #}
LEARN MORE ABOUT PRESCRYPTO
LEARN MORE!
{# article CALLTOACTION #}
LEARN MORE ABOUT OUR BLOCKCHAIN
LEARN MORE!
{% endblock content %}


| 1 | /** | |
| 2 | * Copyright (c) 2008, http://www.snakeyaml.org | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.yaml.snakeyaml.introspector; | |
| 17 | ||
| 18 | import java.lang.annotation.Annotation; | |
| 19 | import java.util.Collections; | |
| 20 | import java.util.List; | |
| 21 | ||
| 22 | /** | |
| 23 | * A property that does not map to a real property; this is used when {@link | |
| 24 | * PropertyUtils}.setSkipMissingProperties(boolean) is set to true. | |
| 25 | */ | |
| 26 | public class MissingProperty extends Property { | |
| 27 | ||
| 28 | public MissingProperty(String name) { | |
| 29 | super(name, Object.class); | |
| 30 | } | |
| 31 | ||
| 32 | @Override | |
| 33 | public Class<?>[] getActualTypeArguments() { | |
| 34 |
1
1. getActualTypeArguments : replaced return value with null for org/yaml/snakeyaml/introspector/MissingProperty::getActualTypeArguments → SURVIVED |
return new Class[0]; |
| 35 | } | |
| 36 | ||
| 37 | /** | |
| 38 | * Setter does nothing. | |
| 39 | */ | |
| 40 | @Override | |
| 41 | public void set(Object object, Object value) throws Exception { | |
| 42 | } | |
| 43 | ||
| 44 | @Override | |
| 45 | public Object get(Object object) { | |
| 46 |
1
1. get : replaced return value with null for org/yaml/snakeyaml/introspector/MissingProperty::get → NO_COVERAGE |
return object; |
| 47 | } | |
| 48 | ||
| 49 | @Override | |
| 50 | public List<Annotation> getAnnotations() { | |
| 51 | return Collections.emptyList(); | |
| 52 | } | |
| 53 | ||
| 54 | @Override | |
| 55 | public <A extends Annotation> A getAnnotation(Class<A> annotationType) { | |
| 56 | return null; | |
| 57 | } | |
| 58 | ||
| 59 | } | |
Mutations | ||
| 34 |
1.1 |
|
| 46 |
1.1 |


Published: {{ results?.Published }}
Modified: {{ results?.Modified }}
CWE: {{ results?.cwe }}
Summary: {{ results?.summary }}


Calculates the pagerank vector of a web graph saved in an NTWPR_WGFile form. More...
Go to the source code of this file.
Functions | |
| void | parseArguments (int argc, char *const argv[argc+1], double *delta, double *tel_coeff, int32_t *it_number, char **log_file_path, char **pagerank_file_path, char **wg_file_path) |
| Refactored main()'s code that handles command line arguments. More... | |
| int | main (int argc, char *const argv[argc+1]) |
| Calculates the pagerank of a web graph. More... | |
Variables | |
| const uint32_t | NTWPR_Max_Iterations_Limit = 150 |
| Τhe max number of specific iterations that are allowed. | |
Calculates the pagerank vector of a web graph saved in an NTWPR_WGFile form.
Documentation for the whole API behind this program can be found at: https://nicktheway.github.io/Pagerank/html/index.html
Definition in file NTWpagerank_serial.c.
| int main | ( | int | argc, |
| char *const | argv[argc+1] | ||
| ) |
Calculates the pagerank of a web graph.
| argc | The number of command line arguments. |
| argv | The command line arguments. |
Definition at line 44 of file NTWpagerank_serial.c.
| void parseArguments | ( | int | argc, |
| char *const | argv[argc+1], | ||
| double * | delta, | ||
| double * | tel_coeff, | ||
| int32_t * | it_number, | ||
| char ** | log_file_path, | ||
| char ** | pagerank_file_path, | ||
| char ** | wg_file_path | ||
| ) |
Refactored main()'s code that handles command line arguments.
| argc | The number of command line arguments. |
| argv | The command line arguments as char arrays. |
| delta | Address of the convergence's delta variable. |
| tel_coeff | Address of the teleportation coefficient's variable. |
| it_number | Address of the specific_iterations variable. |
| log_file_path | Address of the log file's path variable. |
| pagerank_file_path | Address of the output pagerank's file path variable. |
| wg_file_path | Address of the input web graph's file path variable. |
Argument parsing. opting and optarg are defined in <unistd.h>
Definition at line 99 of file NTWpagerank_serial.c.


Activated charcoal beard cloud bread, everyday carry mixtape wayfarers health goth dreamcatcher edison bulb shoreditch ethical godard. Pabst copper mug man braid, try-hard tilde gochujang williamsburg. Distillery sriracha paleo beard locavore twee swag intelligentsia heirloom williamsburg deep v 3 wolf moon vape. Enamel pin tilde sustainable bitters tousled subway tile bushwick microdosing quinoa kogi organic beard direct trade. Fanny pack actually keytar kombucha kinfolk. Flexitarian deep v raclette, single-origin coffee squid banh mi put a bird on it pabst. Vaporware irony poke yr sriracha woke leggings skateboard farm-to-table drinking vinegar franzen fixie art party. Street art lumbersexual narwhal chillwave helvetica air plant lomo sartorial locavore +1 microdosing sustainable single-origin coffee. Chillwave air plant single-origin coffee messenger bag tote bag cardigan. Bespoke chartreuse plaid 90's street art man bun coloring book squid franzen wayfarers cliche subway tile jean shorts literally semiotics. Bushwick four dollar toast farm-to-table, XOXO sriracha master cleanse keytar. Sustainable literally chillwave ennui hexagon brunch biodiesel humblebrag man braid typewriter fingerstache. Prism glossier waistcoat tousled, paleo microdosing hella fanny pack pork belly blog pop-up fixie vaporware. Banh mi readymade shabby chic fam letterpress meggings. Listicle jianbing master cleanse everyday carry. Man bun whatever meggings beard freegan selvage craft beer poutine photo booth artisan. Brooklyn mlkshk craft beer, pop-up tbh tote bag fingerstache actually viral distillery typewriter try-hard roof party. Unicorn pour-over affogato you probably haven't heard of them schlitz tote bag cred kickstarter keytar blog pitchfork street art. Tacos authentic chartreuse cloud bread irony lyft mixtape williamsburg etsy enamel pin kale chips pop-up succulents vape.
Street art lumbersexual narwhal chillwave helvetica air plant lomo sartorial locavore +1 microdosing sustainable single-origin coffee. Chillwave air plant single-origin coffee messenger bag tote bag cardigan. Bespoke chartreuse plaid 90's street art man bun coloring book squid franzen wayfarers cliche subway tile jean shorts literally semiotics. Bushwick four dollar toast farm-to-table, XOXO sriracha master cleanse keytar. Sustainable literally chillwave ennui hexagon brunch biodiesel humblebrag man braid typewriter fingerstache. Prism glossier waistcoat tousled, paleo microdosing hella fanny pack pork belly blog pop-up fixie vaporware.
Banh mi readymade shabby chic fam letterpress meggings. Listicle jianbing master cleanse everyday carry. Man bun whatever meggings beard freegan selvage craft beer poutine photo booth artisan. Brooklyn mlkshk craft beer, pop-up tbh tote bag fingerstache actually viral distillery typewriter try-hard roof party. Unicorn pour-over affogato you probably haven't heard of them schlitz tote bag cred kickstarter keytar blog pitchfork street art. Tacos authentic chartreuse cloud bread irony lyft mixtape williamsburg etsy enamel pin kale chips pop-up succulents vape.


Academic Support
Taking a course is about mastering a special area of knowledge. Good study and time management skills help you get there but the point is to learn how a subject is practiced.
Take control of your courses—don't let them control you! Know what you are getting into, decide what you want to know, and set some personal goals. For help managing the workload or using your study time more effectively, contact: https://www.humber.ca/learningresources/.
Essays and papers are intended to teach you about the methods practiced in your field and how to produce professional results. Fortunately, the process is almost the same for every subject and there's lots of help in this area:
Accessing the library covers more than just finding the right article. It’s about using the library’s resources (including people) to the fullest. After all, the library isn't just an earlier version of the internet—it has information you can't even find on the internet!
Start by getting a library card. It’s your access key to the library’s resources. You can get a physical library card in person or—if you’re learning remotely— a virtual library card online. Check out the Humber Library website at: http://library.humber.ca/get-account.
For most people, finding academic information is a whole new skill. You have to learn how to find things, where to look, and how to judge the quality of the information. Then you have to organize the details in a specific way to meet the needs of your current project.
These details can change drastically based on the subject area. So the library has organized some human and well documented practices to help you:
The sources you use affect the quality of your work. When you CITE an idea that is not your own, you gain credibility. When you QUOTE a phrase, sentence, or section you demonstrate accuracy. Adding a REFERence or a Biblography page, tells people about the quality of your paper.
At Humber, we use the American Psychological Association (APA) style for reporting sources. The library has a whole series of short videos on how to use the APA style for different types of media. Check out the website at: http://library.humber.ca/help/apa.


INDIA
Greeting
-
Indians hold their palms together and say 'Namaste’ (nuh-mus-tay) while greeting each other. Hugging and kissing on the cheeks, especially with the opposite sex is frowned upon and should be avoided.
-
Another common gesture is the infamous bobbing of the head. A vertical nod indicates yes while a horizontal nod means no.
Table Manners
-
Bring along a gift to dinner invitations, but do not get something too expensive.
-
Eat whatever has been offered to you, and when the host insists on a second helping say yes otherwise they assume you do not like the food.
Giving and Receiving Gifts
-
Give gifts with both hands. Gifts are not normally opened in the presence of the giver.
-
Gifts from your country are appreciated (perfume, chocolates, small china or crystal objects).
-
Gifts are not normally expected at the first meeting. Gifts may be given once a relationship develops.
General Do's and Don'ts
-
It is traditional to wear white, not black, to a funeral in India.
-
Do not wear shoes/sandals inside a home.
-
Many Indians find toilet paper repellent and consider it cleaner to splash water with the left hand in the appropriate direction. Consequently, the left hand is considered unclean and is never used for eating.
-
Do not give white flowers as gifts.
-
Do not point your feet at people.


CouchDesignDocument Class Reference
| Inherits from | CouchDocument : CouchResource : RESTResource : NSObject |
| Declared in | CouchDesignDocument.h |
Overview
A Design Document is a special document type that contains things like map/reduce functions, and the code and static resources for CouchApps. Optional support for native Objective-C map/reduce functions.
This is only available when talking to an embedded Couchbase database running in the same process as the app, e.g. Couchbase Mobile.
Tasks
Other Methods
-
– queryViewNamed:
Creates a query for the given named view.
If view definitions have been modified but not saved yet, they will be saved first.
-
– isLanguageAvailable:
Indicates whether a given language is available for writing functions in, in this database.
-
language
The language that the functions in this design document are written in.
propertyDefaults to kCouchLanguageJavaScript.
-
viewNames
Fetches and returns the names of all the views defined in this design document.
propertyThe first call fetches the entire design document synchronously; subsequent calls are cached.
-
– mapFunctionOfViewNamed:
Returns the map function of the view with the given name.
-
– reduceFunctionOfViewNamed:
Returns the reduce function of the view with the given name.
-
– defineViewNamed:map:reduce:
Sets the definition of a view, or deletes it.
After making changes to one or more views, you should call saveChanges to PUT them back to the database. If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
-
– defineViewNamed:map:
A shortcut that defines a simple view with no reduce function.
After making changes to one or more views, you should call saveChanges to PUT them back to the database. If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
-
filters
The filter functions defined in this design document.
property -
– defineFilterNamed:asFunction:
Sets the definition of a filter, or deletes it.
After making changes to one or more filters, you should call saveChanges to PUT them back to the database. If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
-
validation
The validation function, a JavaScript function that validates document contents.
property -
includeLocalSequence
Should view query results include the document local sequence number in the index?
propertySetting this to YES sets the 'local_seq' property of the design document's 'options' property to 'true'. This affects every view in this design document.
-
changed
Have the contents of the design document been changed in-memory but not yet saved?
property -
– saveChanges
Saves changes, asynchronously. If there are no current changes, returns nil.
Embedded Methods
-
– defineViewNamed:mapBlock:version:
Defines or deletes a native view.
The view's definition is given as an Objective-C block (or NULL to delete the view). The body of the block should call the 'emit' block (passed in as a paramter) for every key/value pair it wants to write to the view. Since the function itself is obviously not stored in the database (only a unique string idenfitying it), you must re-define the view on every launch of the app! If the database needs to rebuild the view but the function hasn't been defined yet, it will fail and the view will be empty, causing weird problems later on. It is very important that this block be a law-abiding map function! As in other languages, it must be a "pure" function, with no side effects, that always emits the same values given the same input document. That means that it should not access or change any external state; be careful, since blocks make that so easy that you might do it inadvertently! The block may be called on any thread, or on multiple threads simultaneously. This won't be a problem if the code is "pure" as described above, since it will as a consequence also be thread-safe.
-
– defineViewNamed:mapBlock:reduceBlock:version:
Defines or deletes a native view with both a map and a reduce function.
For details, read the documentation of the -defineViewNamed:mapBlock: method.
-
– defineFilterNamed:block:
-
– setValidationBlock:
An Objective-C block that can validate any document being added/updated/deleted in this database.
Properties
changed
Have the contents of the design document been changed in-memory but not yet saved?
@property (readonly) BOOL changed
Discussion
Have the contents of the design document been changed in-memory but not yet saved?
Declared In
CouchDesignDocument.h
filters
The filter functions defined in this design document.
@property (readonly) NSDictionary *filters
Return Value
An NSDictionary whose keys are filter names and values are function source code.
Discussion
The filter functions defined in this design document.
Declared In
CouchDesignDocument.h
includeLocalSequence
Should view query results include the document local sequence number in the index?
Setting this to YES sets the 'local_seq' property of the design document's 'options' property to 'true'.
This affects every view in this design document.
@property (nonatomic, assign) BOOL includeLocalSequence
Discussion
Should view query results include the document local sequence number in the index?
Setting this to YES sets the 'local_seq' property of the design document's 'options' property to 'true'.
This affects every view in this design document.
Declared In
CouchDesignDocument.h
language
The language that the functions in this design document are written in.
Defaults to kCouchLanguageJavaScript.
@property (copy) NSString *language
Discussion
The language that the functions in this design document are written in.
Defaults to kCouchLanguageJavaScript.
Declared In
CouchDesignDocument.h
validation
The validation function, a JavaScript function that validates document contents.
@property (copy) NSString *validation
Discussion
The validation function, a JavaScript function that validates document contents.
Declared In
CouchDesignDocument.h
viewNames
Fetches and returns the names of all the views defined in this design document.
The first call fetches the entire design document synchronously; subsequent calls are cached.
@property (readonly) NSArray *viewNames
Discussion
Fetches and returns the names of all the views defined in this design document.
The first call fetches the entire design document synchronously; subsequent calls are cached.
Declared In
CouchDesignDocument.h
Instance Methods
defineFilterNamed:asFunction:
Sets the definition of a filter, or deletes it.
After making changes to one or more filters, you should call saveChanges to PUT them back to the database.
If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
- (void)defineFilterNamed:(NSString *)filterName asFunction:(NSString *)filterFunction
Parameters
- filterName
The name of the filter, in the scope of this design doc.
- filterFunction
The source code of the filter function. If nil, the filter will be deleted.
Discussion
Sets the definition of a filter, or deletes it.
After making changes to one or more filters, you should call saveChanges to PUT them back to the database.
If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
Declared In
CouchDesignDocument.h
defineFilterNamed:block:
- (void)defineFilterNamed:(NSString *)filterName block:(TDFilterBlock)filterBlock
defineViewNamed:map:
A shortcut that defines a simple view with no reduce function.
After making changes to one or more views, you should call saveChanges to PUT them back to the database.
If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
- (void)defineViewNamed:(NSString *)viewName map:(NSString *)mapFunction
Parameters
- viewName
The name of the view, in the scope of this design doc.
- mapFunction
The source code of the map function. If nil, the view will be deleted.
Discussion
A shortcut that defines a simple view with no reduce function.
After making changes to one or more views, you should call saveChanges to PUT them back to the database.
If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
Declared In
CouchDesignDocument.h
defineViewNamed:map:reduce:
Sets the definition of a view, or deletes it.
After making changes to one or more views, you should call saveChanges to PUT them back to the database.
If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
- (void)defineViewNamed:(NSString *)viewName map:(NSString *)mapFunction reduce:(NSString *)reduceFunction
Parameters
- viewName
The name of the view, in the scope of this design doc.
- mapFunction
The source code of the map function. If nil, the view will be deleted.
- reduceFunction
The source code of the reduce function. Optional; pass nil for none.
Discussion
Sets the definition of a view, or deletes it.
After making changes to one or more views, you should call saveChanges to PUT them back to the database.
If the new definition is identical to the existing one, the design document will not be marked as changed or saved back to the database.
Declared In
CouchDesignDocument.h
defineViewNamed:mapBlock:reduceBlock:version:
Defines or deletes a native view with both a map and a reduce function.
For details, read the documentation of the -defineViewNamed:mapBlock: method.
- (void)defineViewNamed:(NSString *)viewName mapBlock:(TDMapBlock)mapBlock reduceBlock:(TDReduceBlock)reduceBlock version:(NSString *)version
Discussion
Defines or deletes a native view with both a map and a reduce function.
For details, read the documentation of the -defineViewNamed:mapBlock: method.
Declared In
CouchDesignDocument_Embedded.h
defineViewNamed:mapBlock:version:
Defines or deletes a native view.
The view's definition is given as an Objective-C block (or NULL to delete the view). The body of the block should call the 'emit' block (passed in as a paramter) for every key/value pair it wants to write to the view.
Since the function itself is obviously not stored in the database (only a unique string idenfitying it), you must re-define the view on every launch of the app! If the database needs to rebuild the view but the function hasn't been defined yet, it will fail and the view will be empty, causing weird problems later on.
It is very important that this block be a law-abiding map function! As in other languages, it must be a "pure" function, with no side effects, that always emits the same values given the same input document. That means that it should not access or change any external state; be careful, since blocks make that so easy that you might do it inadvertently!
The block may be called on any thread, or on multiple threads simultaneously. This won't be a problem if the code is "pure" as described above, since it will as a consequence also be thread-safe.
- (void)defineViewNamed:(NSString *)viewName mapBlock:(TDMapBlock)mapBlock version:(NSString *)version
Discussion
Defines or deletes a native view.
The view's definition is given as an Objective-C block (or NULL to delete the view). The body of the block should call the 'emit' block (passed in as a paramter) for every key/value pair it wants to write to the view.
Since the function itself is obviously not stored in the database (only a unique string idenfitying it), you must re-define the view on every launch of the app! If the database needs to rebuild the view but the function hasn't been defined yet, it will fail and the view will be empty, causing weird problems later on.
It is very important that this block be a law-abiding map function! As in other languages, it must be a "pure" function, with no side effects, that always emits the same values given the same input document. That means that it should not access or change any external state; be careful, since blocks make that so easy that you might do it inadvertently!
The block may be called on any thread, or on multiple threads simultaneously. This won't be a problem if the code is "pure" as described above, since it will as a consequence also be thread-safe.
Declared In
CouchDesignDocument_Embedded.h
isLanguageAvailable:
Indicates whether a given language is available for writing functions in, in this database.
- (BOOL)isLanguageAvailable:(NSString *)language
Discussion
Indicates whether a given language is available for writing functions in, in this database.
Declared In
CouchDesignDocument.h
mapFunctionOfViewNamed:
Returns the map function of the view with the given name.
- (NSString *)mapFunctionOfViewNamed:(NSString *)viewName
Discussion
Returns the map function of the view with the given name.
Declared In
CouchDesignDocument.h
queryViewNamed:
Creates a query for the given named view.
If view definitions have been modified but not saved yet, they will be saved first.
- (CouchQuery *)queryViewNamed:(NSString *)viewName
Discussion
Creates a query for the given named view.
If view definitions have been modified but not saved yet, they will be saved first.
Declared In
CouchDesignDocument.h
reduceFunctionOfViewNamed:
Returns the reduce function of the view with the given name.
- (NSString *)reduceFunctionOfViewNamed:(NSString *)viewName
Discussion
Returns the reduce function of the view with the given name.
Declared In
CouchDesignDocument.h
saveChanges
Saves changes, asynchronously. If there are no current changes, returns nil.
- (RESTOperation *)saveChanges
Discussion
Saves changes, asynchronously. If there are no current changes, returns nil.
Declared In
CouchDesignDocument.h
setValidationBlock:
An Objective-C block that can validate any document being added/updated/deleted in this database.
- (void)setValidationBlock:(TDValidationBlock)validationBlock
Discussion
An Objective-C block that can validate any document being added/updated/deleted in this database.
Declared In
CouchDesignDocument_Embedded.h


[Home]
This page addresses the use of Tengwar fonts in this lexicon. A more detailed discussion of Tengwar usage can be found at Måns Björkman’s Amanye Tenceli Website. As a rule, Quenya in this lexicon is transcribed in the classical mode, while Sindarin is transcribed in the mode of Beleriand.
Currently the only Elvish script appearing in this lexicon is tengwar, using a variant of Måns Björkman’s Tengwar Eldamar font, modified and converted to a web font by Bertrand Bellet and Benjamin Babut for their Glǽmscrafu web site (used with permission). This specific web font file is tengwar-eldamar-glaemscrafu.woff. As a web font, it is suitable for use on web sites and requires no special installation on a user’s browser.
Most of the tengwar content in this lexicon is produced by automated transcription using Benjamin Babut’s Glaemscribe library. This Ruby and Javascript library can (among other things) convert Quenya and Sindarin written in English characters into tengwar.
Most tengwar fonts, including Tengwar Eldamar, encode the standard tengwar glyphs based on the keyboard mapping established by Daniel Smith. Since the function of tengwar characters varies depending on the language and tengwar mode used, the keyboard mapping is based on the physical characteristics of tengwar as described in Tolkien’s tengwar chart from Appendix E in The Lord of the Rings (LotR/1119). For lowercase letters the layout is basically the tengwar grid from Appendix E arranged horizontally on a standard qwerty keyboard:
| Lowercase Characters | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ` ` |
1 1 |
2 2 |
3 3 |
4 4 |
5 5 |
6 6 |
7 7 |
8 8 |
9 9 |
10 0 |
- - |
= = |
\ \ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| q q |
w w |
e e |
r r |
t t |
y y |
u u |
i i |
o o |
1p p |
1[ [ |
] ] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| a a |
s s |
d d |
f f |
g g |
h h |
j j |
k k |
l l |
1; ; |
1' ' |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| z z |
x x |
c c |
v v |
b b |
n n |
m m |
, , |
. . |
1/ / |
In the diagram above, the black characters are the tengwar glyphs, the grey characters are the normal keyboard values and the red characters are placeholders illustrating the placement of tehta glyphs (see below). The top row is the t-series (tincotéma), the second row the p-series (parmatéma), the third row the k-series (calmatéma) and the bottom row the q-series (quessetéma). The “columns” underneath each number correspond to the number “grades” (tyeller) from Tolkien’s tengwar chart (1-9).
Tehta: The tehta are marks appearing above and below tengwar characters, usually indicating vowels. In general linguistic termininology, such marks are called diacritics. The characters and keyboard layouts for tengwar was established many years ago before font technology could effectively handle combining diacritic marks. As such, most tehta have 4 different keyboard mappings that manually control the placement of the tehta over the tengwa it modifies. The four mappings are for (1) wide tengwar, (2) medium tengwar, (3) tengwar with long upward stems, and (4) narrow tengwar. The diagram below illustrates the uppercase character mappings for tehta, with placeholders that indicate which tehta-mapping should be used for a given tengwa:
| Uppercase Characters | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ~ ~ |
! ! |
@ @ |
2# # |
2$ $ |
2% % |
2^ ^ |
2& & |
* * |
2( ( |
2) ) |
j_ _ |
1+ + |
a| | |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q Q |
W W |
1E E |
1R R |
1T T |
1Y Y |
1U U |
I I |
1O O |
2P P |
2{ { |
`} } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A A |
S S |
3D D |
3F F |
3G G |
3H H |
3J J |
K K |
jL L |
2: : |
2" " |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Z Z |
X X |
`C C |
`V V |
`B B |
`N N |
`M M |
< < |
`> > |
2? ? |
The tehta character always is placed after the tengwa character it modifies. As noted above, you should chose the tehta character appropriate to the width of your tengwa character: 2# = 2# (2 + C); 1E = 1E (1 + C); 3D = 3D; (3 + C); `C = `C; (` + C). Choosing the wrong tehta key-mapping results in an out-of-place tehta: 2C = 2C, 2D = 2D, 2E = 2E.
Copying Tengwar: The mappings above are common to most tengwar fonts and if copied to a different font, should display correctly. When you copy tengwar from this lexicon into a document, you will probably see what appears to be gibberish, for example `Cf#jTt$ (Ancalimë) becoming `Cf#jTt$. However, if you change the font to one of the Tengwar fonts based on Dan Smith’s keyboard layout, it should display correctly.
Rather than copying tengwar directly from this lexicon, though, I strongly recommend writing out your text using normal English (Latin) characters, and then using a transcription tool to convert it to tengwar, such as Benjamin Babut’s web-based Glaemscribe tool or the (easier to use) Tecendil website.