text stringlengths 454 608k | url stringlengths 17 896 | dump stringclasses 91
values | source stringclasses 1
value | word_count int64 101 114k | flesch_reading_ease float64 50 104 |
|---|---|---|---|---|---|
Interface Block (GLSL)
GLSL shader input, output, uniform, and storage buffer variables can be grouped into Interface Blocks. These blocks have special syntax and semantics that can be applied to them.
Contents
Syntax
Interface blocks have different semantics in different contexts, but they have the same syntax regardless of how they are used. Uniform blocks are defined as follows:
interface_qualifier block_name { <define members here> } instance_name;
This looks like a struct definition, but it is not.
interface:
uniform MatrixBlock { mat4 projection; mat4 modelview; };
You could simply use projection to refer to it. So the interface name acts as a namespace qualifier.
The instance name can also.
Linking between shader stages allows multiple shaders to use the same block. Interface blocks match with each other based on the block name and the member field definitions. So the same block in different shader stages can have different instance names.
Input and output
Input and output blocks are designed to compliment each other. Their primary utility is with geometry or tessellation shaders, as these shaders often work with arrays of inputs/outputs.
Data passed between shader stages can be grouped into blocks. If the input is in a block, then the output must also be within a block that uses the same block name and members (but not necessarily the same instance name)..
Buffer backed
Uniform blocks and shader storage blocks work in very similar ways, so this section will explain the features they have in common. Collectively, these are called "buffer-backed blocks.").
shared is the default. This layout means that individual members cannot be optimized out. The name comes from the fact that if you provide the exact same definition (including array counts and the like) to two different programs, OpenGL guarantees that they will have the exact same member variable layouts. Thus, you can query layout information for one, and use it in another.
packed gives the implementation the maximum freedom. It can optimize out definitions, rearrange their orders, etc. The layout for a packed block must be queried regardless of how it is defined.
std140 and std430 are layouts that are explicitly defined by the OpenGL standard. Thus, not only are the layouts guaranteed between programs, they are guaranteed across implementations. This is useful for being able to build C or C++ structs that contain exactly the values in the proper order that GLSL's blocks will take.
std430 can only be used on shader storage blocks; it offers greater packing and smaller alignment guarantees than std140..
If GL 4.2 or ARB_shading_language_420pack is defined, then140.
Shader storage blocks. | https://www.opengl.org/wiki_132/index.php?title=Interface_Block_(GLSL)&oldid=6694 | CC-MAIN-2017-04 | refinedweb | 429 | 65.52 |
changed FSF address in copyright messages
\ Forth output paging add-on (like more(1)) \ add-on is for those poor souls whose terminals cannot scroll \ back but who want to read the output of 'words' at their leisure. \ currently this is very primitive: it just counts newlines, and only \ allows continuing for another page (and of course, terminating \ processing by sending a signal (^C)) \ Some things to do: \ allow continuing for one line (Enter) \ count lines produced by wraparound (note tabs and backspaces) \ allow continuing silently \ fancy features like searching, scrollback etc. \ one more-or-less simple way to achieve all this is to \ popen("less","w") and output there. Before getting the next `key`, \ we would perform a pclose. This idea due to Marcel Hendrix. require termsize.fs variable last-#lines 0 last-#lines ! :noname ( -- c ) 1 last-#lines ! defers key ; is key :noname ( c -- ) dup defers emit #lf = if 1 last-#lines +! last-#lines @ rows >= if ." ... more ?" key drop 10 backspaces 10 spaces 10 backspaces endif endif ; is emit :noname ( c-addr u -- ) bounds ?DO I c@ emit LOOP ; is type | http://www.complang.tuwien.ac.at/cvsweb/cgi-bin/cvsweb/gforth/more.fs?rev=1.2;sortby=date;f=h;only_with_tag=v0-5-0 | CC-MAIN-2021-04 | refinedweb | 183 | 72.76 |
Get end-to-end visibility into your Hapi performance with application monitoring tools. Gain insightful metrics on performance bottlenecks with Node.js monitoring to optimize your application.
1. Install the Atatus Agent using npm or Yarn
npm install --save atatus-nodejs
2. Require the Atatus Agent and initialize it with your license key
var atatus = require("atatus-nodejs");
atatus.start({
licenseKey: "APM_LIC_KEY",
appName: "YOUR_APP_NAME"
});
3. Restart your Node.js server.
1. Install Atatus Node.js package.
npm install --save atatus-nodejs
2. Import "atatus-nodejs/start" in your Node.js app.
import atatus from 'atatus-nodejs/start'
3. Create "atatus-config.js" file in app home directory and initialize it with your license key
module.exports = {
licenseKey: "APM_LIC_KEY",
appName: "YOUR_APP_NAME"
);
4. Restart your Node.js server.
1. Go to your Node.js app directory and set your license key and app name to heroku config.
heroku config:set ATATUS_APP_NAME="YOUR_APP_NAME"
heroku config:set ATATUS_LICENSE_KEY="APM_LIC_KEY"
2. Install the Node.js agent and save it to your package.json.
npm install --save atatus-nodejs
3. Include Atatus to the first line of the main module of your application.
var atatus = require('atatus-nodejs');
atatus.start();
4. Run the following commands to commit the changes.
git add .
git commit -m "Added Atatus Agent"
git push heroku master
heroku logs --tail
5. Restart your Node.js server.
Atatus captures all requests to your Hapi Hapi app.Learn more
View the complete picture of the most time consuming Hapi database queries and focus on slow database queries along with traces that provide the actionable insights.Learn more
Visualize where your code is spending most of its time in your Hapi app, which functions were executed, for how long. Get the overview along with the breakdown of related database, and network calls.Learn more
See detailed overview of all the HTTP Failures that are impacting your users. Find the status codes breakdown and along with Hapi request parameters, find the root cause of the API failures.Learn more
Automatically visualize end-to-end business transactions in your Hapi application. Monitor the amount and type of failed HTTP status codes and application crashes with Hapi Monitoring. Analyze response time to identify Hapi performance issues and Hapi errors on each and every business transaction. Understand the impact of methods and database calls that affects your customer's experience.Learn more
Examine all SQL and NoSQL queries used by your Hapi Hapi error is tracked using error tracking and captured with full stacktrace and exact line of source code is highlighted to make bug fixing easier. Get all the essential data such as class, message, URL, request agent, version etc to fix the Hapi exceptions and errors. Identify buggy API or third party services by investigating API failure rates and application crashes. Get alerts for application errors and exceptions via Email, Slack, PagerDuty, or using webhooks.Learn more
Quickly view highest Hapi HTTP failures and get each request information along with custom data to identify the root cause of the failures. See the breakdown of the API failures based on HTTP Status Codes and the end-users having the highest impact.Learn more
Break down slow Hapi. | https://www.atatus.com/for/hapi | CC-MAIN-2022-05 | refinedweb | 529 | 59.7 |
1-781-743-2119 ext 2 Chat
This
ETA End October 2020
September 21, 2020
July 15, 2020
June 30, 2020
May 4, 2020
March 31, 2020
January, 27, 2020
December 16, 2019
The release notes give you late-breaking information about Atalasoft DotImage 11.2. Please read this document carefully, as it contains information that is not included in other Atalasoft DotImage documentation.
The build number for Atalasoft DotImage 11.2 is 11.2.0.0.0.224.
The following features were added to Atalasoft DotImage in version 11.
Recognition engine has been improved for the following symbologies:
Module loaders support has been added to WDV so it can be used as an Asynchronous Module Definition (AMD) or CommonJS module. This feature avoids polluting the global namespace and reduces the risk of conflicting dependencies in the client.
Support for the following has been deprecated in this version:
Version 11.2 is the final release of Atalasoft DotImage containing ABBYY. This feature will be replaced with OmniPage in the next release.
This section contains information about issues that have been resolved in Atalasoft DotImage since the prior release of this product.
1219586: When a product license without eVRS is used, the result when importing an image or scanning on a Windows operating system differed from the result on a macOS:
1213340: While using the Chrome of Firefox browsers in a macOS environment, you could not select multiple pages by holding down the Ctrl key.
1210883: If the value for ConvertIncompatiblePagesToImages was set to true, PdfARenderer was not able to create PdfA documents, even though the initial page contained Type 1 fonts with custom encoding.
1181476: When transparency was used, a PDF file was not compliant with the PDF/A-1b standard..
1332687: If you attempt to scan on macOS Catalina, nothing happens.
1213959: If a page includes two horizontal thumbnailers, drag and drop works successfully for the top thumbnailer. With the bottom thumbnailer, drag and drop works only after the top item is removed..5954: When the Dark Appearance setting is selected in System Preferences on macOS Mojave, the setting is not applied properly to dialog boxes.
1179745: If you do not have Administrator rights, and you attempt to perform the installation for the Atalasoft DotImage Service for macOS, you may be prevented from finishing successfully.
Workaround: To avoid the issue:
1121735: After a page is inserted into a new document, thumbnail images become corrupted..
864436: When the AbbyyOcrTextRegion region is manually defined, the Recognize method may return the incorrect results. This situation may occur if the text language is not specified for the custom regions, and the engine cannot determine which language to use... | https://www.atalasoft.com/KB2/KB/50329/INFO-112-Full-Release-Notes | CC-MAIN-2020-45 | refinedweb | 445 | 51.68 |
Can GPIO pins generate interrupts?jrychter Jun 6, 2012 11:53 AM?
Re: Can GPIO pins generate interrupts?jbeale Jun 6, 2012 2:09 PM (in response to jrychter)
Yes they can generate interrupts, and just yesterday some example code was posted. Note, I do not know whether 250 Hz pulses (4 msec interval) will always be reliable, depending on what other operations the R-Pi is doing (SD card I/O, USB and Ethernet, etc.) although you may be able to change interrupt priority if needed.
Support for GPIO-driven interrupts
Re: Can GPIO pins generate interrupts?Roger Wolff Jun 7, 2012 10:20 AM (in response to jbeale)
jbeale wrote:
. Note, I do not know whether 250 Hz pulses (4 msec interval) will always be reliable,
Normal modern CPUs can handle timer interrupts at a kHz. And they don't "lose time" by missing interrupts. So I'd say 250Hz is quite doable.
Re: Can GPIO pins generate interrupts?jrychter Jun 21, 2012 5:41 AM (in response to jbeale)
Thanks for the link!
I thought about it some more, and then remembered that this is Linux, where you deal with interrupts in kernel space, possibly creating an interface to user-space.
I think for the moment it is actually simpler for me to use a MSP430-based Launchpad board to do the counting and interface it via SPI to the Raspberry.
Re: Can GPIO pins generate interrupts?rdolson Jan 5, 2013 5:59 PM (in response to jrychter)
I was doing some experiments last night with a 555 timer set for around 1500 Hz connected to a GPIO on the pi, and a modification of the irq demo program linked from this page:
I used gettimeofday to time the interval between interrupts, and was getting numbers quite close (within 1% probably) of the frequency based on what I was reading from the frequency counter on my multimeter also attached to that input. CPU utilization was around 6-7%.
--bob
Re: Can GPIO pins generate interrupts?Roger Wolff Jan 6, 2013 1:49 AM (in response to rdolson)
That's a very interesting experiment. The question then is: Why are you getting a 1% difference?
Is the crystal on the RPI inaccurate? Are you missing interrupts? Is the multimeter inaccurate?
If you are just measuring the interval to be about 700 microseconds, and then doing 1/interval and getting 1500+/- 15 each time, you're not missing interrupts. If you count interrupts for a long enough period, maybe 1 day of wallclock or ntp-synced time, then you should be able to calibrate the crystal of the raspberry pi.
Re: Can GPIO pins generate interrupts?rdolson Jan 6, 2013 7:27 AM (in response to Roger Wolff)
The inter-interrupt times wandered around a central value (that wander is what I was estimating as 1%). This was a very sloppy experiment so I don't have any stored data to look back on. My assumption is that there's variation in the latency between the low-level GPIO interrupt and the time at which the userland code is able to take action, since the linux scheduler is involved (and there's a context switch required etc).
Re: Can GPIO pins generate interrupts?dkossman Jan 10, 2013 1:35 AM (in response to rdolson)
Hi,
Sorry to "break in" to this discussion but I've been trying to get the "gpio-irq-demo" program to work with no success, and it appears that you've got it (or some version of it) working just fine :-).
i fetched the code from here:
The poll() call always just times out - the program doesn't detect the rising or falling signal edge. Its probably something silly or obvious, but I've spent a few hours and no luck - can you help?
I'm running on the latest apt-get updated Raspbian Wheezy kernel on a Rev 2 Pi which i understand includes the kernel patch for interrupt support (right?). I'm using GPIO pin 17 (aka WiringPi pin 0) and have verified that i can read it using the "gpio" utility. e.g.
$ gpio mode 0 in
$ gpio read 0 # returns the correct 0 or 1 if pin is at ground or Vcc
# now pull the pin to ground
$ gpio edge 0 rising
$ ./gpio-irq-demo 17 # program is using the BCM pin numbers...
value is 0
timeout
timeout
# but when i pull the pin up to Vcc, i don't get the "interrupt, value is: " message
Any idea what is wrong?
thanks for your help!
Don
Re: Can GPIO pins generate interrupts?rdolson Jan 10, 2013 9:55 AM (in response to dkossman)
Hm, not offhand. However I did do the pin configuration directly using the /sys/class/gpio interface, not through wiring. Something like
echo 17 > /sys/class/gpio/export
echo rising > /sys/class/gpio/gpio17/edge
I forget if I had to set the pin direction as well, but I suspect it defaults to in.
Re: Can GPIO pins generate interrupts?dkossman Jan 10, 2013 10:05 AM (in response to rdolson)
hmmm. i was getting "permission denied" (even with sudo) trying to use the "echo" commands with /sys/class/gpio so opted for the gpio route. I think I saw some discussions somewhere about how to work around this, but can you let me know what you did?
It would also be really appreciated if you could send me your interrupt code - I'm new to this site, not sure how that is done...
thx
Don
Re: Can GPIO pins generate interrupts?rdolson Jan 10, 2013 10:27 AM (in response to dkossman)
You do need to run the commands as root ("sudo bash" will get you a root shell). My code is sitting on my pi which is powered off on my workbench - will put a copy up when I have it online next.
Re: Can GPIO pins generate interrupts?dkossman Jan 11, 2013 1:35 AM (in response to rdolson)
Eueka! "sudo bash" did the trick - thanks. Next step is to use threads so my main program can continue to run. I will have to handle multiple inputs - I need to count pulses coming in on several GPIO pins. I think i saw some example code (wfi.c) that does this, but I couldn't get it to work - probably for the same reason that I couldn't get gpio-irq-demo.c to work. Good news is that the frequency i need to handle is really low - not more than a few pulses per second.
If you have any example code that you think might help, let me know...
My application, by the way, is an aquarium control system - I will be building sensors that will allow me to count CO2 bubbles (for a CO2 injector) and water drips (for a Nitrate filter), read Ph and ORP sensors, and control some valves to maintain specific levels.
Thanks again for your assistance.
Don
Re: Can GPIO pins generate interrupts?rdolson Jan 14, 2013 8:54 AM (in response to dkossman)
This sounds like a classic event driven application (you have events coming in triggered by interrupts from your bubble/drip sensors, and presumably from one or more timers that drive periodic checks and maintenance that will turn valves on and off).
If I was writing this software for myself I'd probably not write it in C but rather use something like perl and the timer / event libraries that are available for it. I'm sure there are such event libraries for any of the scripting languages. The advantage of doing it with one of these languages is that the volume of code will be much smaller and the logic will be easier to represent. With the rates you are talking about performance will not be a problem at all.
--bob
Re: Can GPIO pins generate interrupts?dkossman Jan 14, 2013 11:36 AM (in response to rdolson)
Hi Bob,
you are almost certainly correct, but being an old C programmer with minimal Perl expertise, I'm just more comfortable with that language. Something about an old dog and new tricks?
Meanwhile, I've made good progress in C - i am able to read a temperature sensor (varistor) via an adc on the I2C bus, handle a pulse counter using edge-triggered interrupts and poll(), read an ORP probe via the Pi's serial port, and turn off/on some relays. Next step is to start using threads to take the pulse counter out of the main program loop, put the whole thing together, and actually hook it up to the tank...
regards
Don
Re: Can GPIO pins generate interrupts?rdolson Jan 14, 2013 11:54 AM (in response to dkossman)
Very cool ... if you're an old C hand I retract my suggestion :-)
Being a conservative sort I'd still bag the threads and make the application event driven though, since you can set up timers to be triggered and hang the whole program around a loop around the poll() call.
-bob
Re: Can GPIO pins generate interrupts?dkossman Jan 14, 2013 1:44 PM (in response to rdolson)
Not sure I'm following your suggestion... My idea is to create a thread that does the poll(), ie is event-driven and wakes up with activity on the pin to increment a counter. Thus the main program thread can handle the main control loop.
the gpio input is set up for edge-triggered interrupts.
Once i finish it (in a few days i hope, and assuming it actually works :-)) should I post my code here so you can review and clarify/make suggestions?
Thx
Don
Re: Can GPIO pins generate interrupts?rdolson Jan 14, 2013 1:52 PM (in response to dkossman)
What would your main program be doing while waiting for events from the thread? If it's only acting on external events, or on timeouts ("if no bubbles in 3 minutes do something"), you don't need a separate thread and the associated synchonization - you can use the poll mechanism to set up the timeouts.
I'd be happy to take a look at the code.
Re: Can GPIO pins generate interrupts?dkossman Jan 14, 2013 5:05 PM (in response to rdolson)
Hi Robert,
Here's the current code - no threads. Note that the program doesn't do anything useful yet - I'm still just playing around to figure out the basic structure.
My intent is to move the poll() into a thread, and change the timeout value so it waits forever. Then the main program thread would have a separate loop (perhaps running once per 5 minutes - aquariums don't change very quickly) where I check the counts (i believe i will need to use semaphone to protect read/write of the counts) and do stuff based on a control algorithm.
The main loop would be augmented to deal with the other sensors as well - temperature, ORP, Ph, and so on.
It seems to me that if I leave the poll() and pulse counter in my main program, I can't easily control the timing of my main control loop. Let me know if I'm missing something...
regards
Don
/*
* counts pulses on one or more gpio inputs using poll()
* based on code pilfered from various places. will add credits later...
* uses wiringPi library, currently must run as root. will deal with that later...
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <string.h>
#include <pthread.h>
extern int gpio_export(unsigned int gpio);
extern int gpio_unexport(unsigned int gpio);
extern int gpio_set_dir(unsigned int gpio, unsigned int out_flag);
extern int gpio_set_value(unsigned int gpio, unsigned int value);
extern int gpio_get_value(unsigned int gpio, unsigned int *value);
extern int gpio_set_edge(unsigned int gpio, char *edge);
extern int gpio_fd_open(unsigned int gpio);
extern int gpio_fd_close(int fd);
/****************************************************************
* Constants
****************************************************************/
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */
#define MAX_BUF 64
#define MAX_PINS 16
/****************************************************************
* Main
****************************************************************/
int main(int argc, char **argv, char **envp)
{
struct pollfd fdset[MAX_PINS];
int nfds = argc-1;
int gpio_fd[MAX_PINS], timeout, rc;
char *buf[MAX_BUF];
unsigned int gpio[MAX_PINS];
int i;
int count[MAX_PINS];
if (argc < 2) {
printf("Usage: %s <gpio-pin> .. <gpio-pin>\n", argv[0]);
printf("Waits for a rising edge on the specified GPIO pins\n");
exit(-1);
}
// set up
for (i=0; i < nfds; i++) {
gpio[i] = atoi(argv[i+1]);
gpio_export(gpio[i]);
gpio_set_dir(gpio[i], 0); // input
gpio_set_edge(gpio[i], "falling");
gpio_fd[i] = gpio_fd_open(gpio[i]);
printf("set up gpio input %d\n", gpio[i]);
count[i] = 0;
}
timeout = POLL_TIMEOUT;
memset((void*)fdset, 0, sizeof(fdset));
for (i=0; i < nfds; i++) {
fdset[i].fd = gpio_fd[i];
fdset[i].events = POLLPRI;
}
while (1) {
// poll() returns with 0 after a timeout or > 1 for activity on any of the specified pins
rc = poll(fdset, nfds, timeout);
if (rc > 0) { // activity occurred on one or more pins
for (i=0; i<nfds; i++) { // check each file descriptor
if (fdset[i].revents & POLLPRI) {
// there was activity on this pin
read(fdset[i].fd, buf, MAX_BUF); // this clears the interrupt, i think?
count[i]++;
printf("GPIO %d interrupt %d\n", gpio[i], count[i]);
} // if
fflush(stdout);
} // for
} else {
if (rc < 0) {
printf("poll() failed with %d!\n", errno);
return -1;
} // if
} // else
} // while
// clean up
for (i=0; i<nfds; i++) {
gpio_fd_close(gpio_fd[i]);
}
return 0;
}
Re: Can GPIO pins generate interrupts?rdolson Jan 14, 2013 7:39 PM (in response to dkossman)
Here's my code with some fairly crude high-level timer support. The idea here is that there are a number of timers that can be registered by the user code; you do this by calling
add_timer(when, interval, oneshot, callback)
when is a double denoting when the timer should trigger. The function get_now() returns a double representing the current time (in seconds).
interval is a double denoting the time between invocations of interval timers - timers that trigger indefinitely until disabled.
oneshot is an int that if true, says this is a one shot timer, and if false (0), says this is a repeating timer.
callback is a pointer to a function that looks like
int callback_function(ptimer_t *timer);
the timer parameter is a pointer to the underlying timer object, which can safely be ignored. If the timer is a repeating timer, the return value from the callback affects if the timer is removed or not. Return 1 and the timer will keep getting called, return 0 and the timer is removed.
In this example the poll will wake up the code to handle interrupts if there are interrupts, and will otherwise wake up to handle any timers that are registered.
--bob
#include <stdio.h>
#include <poll.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/time.h>
#define GPIO_FN_MAXLEN 32
#define POLL_TIMEOUT 1000
#define RDBUF_LEN 5
typedef struct ptimer ptimer_t;
typedef int (*ptimer_cb)(ptimer_t *);
struct ptimer
{
double when;
double interval;
int oneshot;
ptimer_cb cb;
ptimer_t *next;
};
static ptimer_t timers;
double times[1000];
int n;
double get_now()
{
struct timeval tv;
gettimeofday(&tv, 0);
return (double) tv.tv_sec + (double) tv.tv_usec * 1e-6;
}
void add_timer(double when, double interval, int oneshot, ptimer_cb cb)
{
ptimer_t *t = (ptimer_t *) calloc(sizeof(ptimer_t), 1);
t->when = when;
t->interval = interval;
t->oneshot = oneshot;
t->cb = cb;
t->next = timers.next;
timers.next = t;
}
int hi(ptimer_t *t)
{
printf("Hi!\n");
return 1;
}
int hi2(ptimer_t *t)
{
printf("Hi 2!\n");
return 1;
}
int hi3(ptimer_t *t)
{
printf("Hi 3!\n");
return 1;
}
double least_time()
{
ptimer_t *t = timers.next;
/* we only invoke this routine if there is at least one timer. */
double least = t->when;
t = t->next;
while (t)
{
if (t->when < least)
{
least = t->when;
}
t = t->next;
}
return least;
}
void call_timers()
{
ptimer_t *t, *last_t;
double now = get_now();
last_t = &timers;
while (last_t->next)
{
t = last_t->next;
if (t->when <= now)
{
int keep = (t->cb)(t);
if (t->oneshot || !keep)
{
t = t->next;
free(last_t->next);
last_t->next = t;
}
else if (!t->oneshot)
{
t->when += t->interval;
}
}
last_t = t;
}
}
int main(int argc, char **argv) {
char fn[GPIO_FN_MAXLEN];
int fd,ret;
struct pollfd pfd;
char rdbuf[RDBUF_LEN];
timers.next = 0;
add_timer(get_now() + 1.0, 1.0, 0, hi);
add_timer(get_now() + 2.0, 1.7, 0, hi2);
add_timer(get_now() + 2.1, 0.0, 1, hi3);
memset(rdbuf, 0x00, RDBUF_LEN);
memset(fn, 0x00, GPIO_FN_MAXLEN);
if(argc!=2) {
printf("Usage: %s <GPIO>\nGPIO must be exported to sysfs and have enabled edge detection\n", argv[0]);
return 1;
}
snprintf(fn, GPIO_FN_MAXLEN-1, "/sys/class/gpio/gpio%s/value", argv[1]);
fd=open(fn, O_RDONLY);
if(fd<0) {
perror(fn);
return 2;
}
pfd.fd=fd;
pfd.events=POLLPRI;
ret=read(fd, rdbuf, RDBUF_LEN-1);
if(ret<0) {
perror("read()");
return 4;
}
printf("value is: %s\n", rdbuf);
n = 0;
while(1) {
memset(rdbuf, 0x00, RDBUF_LEN);
lseek(fd, 0, SEEK_SET);
struct timespec wait;
if (timers.next)
{
double l = least_time();
double lwait = l - get_now();
if (lwait < 0)
{
wait.tv_sec = 0L;
wait.tv_nsec = 1000;
}
else
{
wait.tv_sec = (long) lwait;
wait.tv_nsec = (long) ((lwait - (double) wait.tv_sec) * 1e9);
}
}
else
{
wait.tv_sec = 1L;
wait.tv_nsec = 0L;
}
ret = ppoll(&pfd, 1, &wait, 0);
if(ret<0) {
perror("poll()");
close(fd);
return 3;
}
if(ret==0) {
printf("timeout\n");
call_timers();
continue;
}
ret=read(fd, rdbuf, RDBUF_LEN-1);
if(ret<0) {
perror("read()");
return 4;
}
/*
struct timeval tv;
gettimeofday(&tv, 0);
if (n < 999)
{
times[n++] = (double) tv.tv_sec + (double) tv.tv_usec * 1e-6;
}
else
{
int i;
for (i = 1; i < 1000; i++)
{
printf("%lf\n", 1.0/ (times[i] - times[i-1]));
}
n = 0;
}
*/
printf("interrupt, value is: %s\n", rdbuf);
}
close(fd);
return 0;
}
Re: Can GPIO pins generate interrupts?dkossman Jan 23, 2013 12:25 AM (in response to rdolson)
Thanks for this - I'll probably end up incorporating elements of this - I'll need to set up handlers that are invoked at different intervals. So, much appreciated.
Actually, I forgot to mention a primary reason for using a separate thread to handle the poll() for the GPIO edge interrupt, which is that this will enable me to change (raise) the priority of this relative to the rest of the code. The app will eventually be writing data to a mysql database, talking to an LCD display, driving relays, etc., and I don't want it to miss any interrupts when counting pulses.
regards
Don
Re: Can GPIO pins generate interrupts?efflandt Jan 23, 2013 12:52 AM (in response to dkossman)
I have done little programming lately, but seem to remember from PC Linux there may be a way to tell if you missed any interrupts from /proc/interrupts.
Re: Can GPIO pins generate interrupts?rdolson Jan 30, 2013 9:12 AM (in response to efflandt)
I'm not positive about this but as I understand the way the file descriptor logic works if a fd is signalled because of an interrupt, until you clear that status (by reading from the file descriptor) you'll still get notification that it happened. What you may lose is the number of interrupts that occurred. This is where the gpio-event code that's kicking around comes in - it will record and timestamp interrupts down at the linux kernel level, and then report those up to the user code.
if you're using threads it's still possible you will miss interrupts, particularly if you are doing something I/O intensive in the other thread.
Re: Can GPIO pins generate interrupts?dkossman Jan 30, 2013 10:58 AM (in response to rdolson)
Sorry - but which "gpio-event code that's kicking around" are you referring to?
Re: Can GPIO pins generate interrupts?rdolson Jan 30, 2013 11:13 AM (in response to dkossman)
This one, from the gumstix folks:
It will compile on the raspbian kernel, but I was getting kernel crashes with my first tests. I have not had a chance to debug it further.? | https://www.element14.com/community/message/68636 | CC-MAIN-2017-39 | refinedweb | 3,340 | 62.68 |
Issues
ZF-11519: Zend_Dojo doesn't take into account https with the CDN
Description
Zend_Dojo only contains the http url for the Google CDN, If someone wanted to use a https connection for their application they will receive the "unsecure elements" message in the browser while using the CDN.
ZendX_JQuery has implemented a mechanism for switching to the https connection on the Google CDN There should be comparable functionality available in Zend_Dojo.
Posted by Robert Basic (robertbasic) on 2011-08-26T07:54:48.000+0000
Will work on this over the weekend.
I noticed that AOL doesn't have an SSL version of the CDN, so I'll implement it for Google only.
Posted by Robert Basic (robertbasic) on 2011-08-26T13:31:25.000+0000
Patch + tests attached.
Posted by Robert Basic (robertbasic) on 2011-08-26T13:32:29.000+0000
Reassigning to Matthew to review the patch and tests.
Posted by Pádraic Brady (padraic) on 2011-08-28T10:28:28.000+0000
I've reviewed the patch and confirm it operates as intended. Recommend committing to trunk and merging to release branch.
Posted by Paul Verhoeven (paul verhoeven) on 2011-08-29T08:35:28.000+0000
Please don't commit to trunk. The patch works, but it only loads the dojo.js file over SSL. It then xhrloads the rest of default modulepaths (/dojo, /dijit & /dojox) and any additional module-namespaces over non SSL connection. This could be fixed by including the right paths through registerModulePath() but it wouldn't solve the main problem.
SSL should always work. ATM it also doesn't work when Dojo's hosted locally, which should be first priority. Also Google and AOL both support SSL for their CDN's (only AOL's unsigned). There's also a new CDN for Dojo (Yandex) which supports signed SSL, so SSL should work for any CDN. Fixing this problem by hardcoding the scheme into the class is not the way to go. There would need to be some kind of scheme detection, either through inspecting $_SERVER['HTTPS'] or $request->isSecure(). A correct fix opens up a whole can of worms, some of which i've already addressed but i needed to break BC and can in the light of ZF2.
Posted by Paul Verhoeven (paul verhoeven) on 2011-09-14T12:05:41.000+0000
Reworked my solution intented for ZF2 to not break ZF1. Setting of scheme is now applies to all dojo assets: base, source, layer, module and stylesheetpaths. Setting of scheme is per default based on $_SERVER['HTTPS'] but can be forced through setting resources.dojo.secure = true/false or api setSecure(true/false). Added tests to confirm behaviour. Please comment and/or review.
Posted by Adam Lundrigan (adamlundrigan) on 2011-11-08T13:27:54.000+0000
Reformatted and applied Paul's patches ({{ZF-11519-combined.patch}}). The Dojo suite ran (after adding it to Zend_AllTests) without any issues related to the dojo view helper itself, though I did get three failures in other view helpers due to encoding of attribute values (see ZF-11875). | http://framework.zend.com/issues/browse/ZF-11519?focusedCommentId=48186&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel | CC-MAIN-2015-40 | refinedweb | 512 | 67.15 |
People frequently need to use client scripts to create dependent drop-down (picklist) fields. You can find many different approaches to do this in the CRM Forums and blog posts.
We have had a “Dynamic Picklist” sample in the SDK for some time, but I received feedback that it didn’t work so well. The effort to fix that sample evolved into creating an entirely new sample. You can find the sample in the latest version of the Downloadable Microsoft CRM SDK. Look for it under \sdk\client\fullsample\dependentpicklist. The old “Dynamic Picklist” sample has been retired.
In addition to fixing the problems with the existing sample, this new “Dependent Picklist” sample provides more features and illustrates a best practice for defining functions within form event code.
Features
Supports defining more than two dependent picklists. This allows you to chain together a number of picklist fields to increasingly more specific set of options.
Option mappings are defined in a separate section. Once you define how each field and each option is mapped to a parent option, you don’t need to make any changes to the code that does the filtering of options. These options are mapped using an array of objects defined using literal notation. This style of defining objects in an array is intended to make the mapping easier to read and edit.
1: /* Map the dependencies START*/
2: /*
3: This sample maps 2 dependent picklists for this form.
4: * new_category > new_subcategory
5: * new_subcategory > new_type
6: */
7: var gArrDependentPicklists =
8: [{
9: "ParentFieldId": "new_category",
10: "ChildFieldId": "new_subcategory",
11: "ChildFieldLabel": "Sub-Category",
12: "OptionsGroup":
13: [
14: {"ParentValue": "1",
15: "ChildOptionValues": ["", "1", "2", "3"]
16: },
17: {"ParentValue": "2",
18: "ChildOptionValues": ["", "4", "5", "6", "7", "8"]
19: }
20: ]
21: },
22: {
23: "ParentFieldId": "new_subcategory",
24: "ChildFieldId": "new_type",
25: "ChildFieldLabel": "Type",
26: "OptionsGroup":
27: [
28: {"ParentValue": "1",
29: "ChildOptionValues": ["", "1", "2", "3", "4"]
30: },
31: { "ParentValue": "2",
32: "ChildOptionValues": ["", "5", "6", "7"]
33: },
34: {"ParentValue": "3",
35: "ChildOptionValues": ["", "8", "9", "10", "11"]
36: },
37: {"ParentValue": "4",
38: "ChildOptionValues": ["", "12", "13", "14", "15"]
39: },
40: {"ParentValue": "5",
41: "ChildOptionValues": ["", "16", "17", "18", "19"]
42: },
43: {"ParentValue": "6",
44: "ChildOptionValues": ["", "20", "21", "22", "23"]
45: },
46: {"ParentValue": "7",
47: "ChildOptionValues": ["", "24", "25", "26", "27"]
48: },
49: {"ParentValue": "8",
50: "ChildOptionValues": ["", "28", "29", "30"]
51: }
52: ]
53: }
54: ];
55: /* Map the dependencies END*/
Provides a warning when the script is not synchronized with the options. Any script that creates dependent picklist options can be broken when new options are added. It would be very easy for someone to add a new options and not immediately notice that the script is affected. This script compares the number of options against the number of options that are mapped. If the number is different, an alert message will provide details alerting the customizer that the script is out of sync with the current options.
More resilient. Many of the dependent picklist samples you may find when searching the internet can rely on sets of contiguous options or may actually depend on the text labels provided for each option. This can cause the script to break if someone sorts the way the options are presented or if you are using a localized user interface. This sample shows how to avoid those problems.
Defining reusable objects within the Onload event of a form
When you look at the client side JScript samples provided before now in the CRM SDK you may notice that none of the samples include the definition of an object (or a function – a type of object) that might be re-used in another event, such as OnChange or OnSave. Although this is a common (some would say essential) practice it poses some problems for upgradability. Which object in the DOM should you attach your objects or functions to? Many people attach them to the CrmForm object. What happens if you define a function to CrmForm that has the same name as one of the functions provided by Microsoft CRM? There is a risk that the CRM function will be overwritten, potentially breaking some CRM functionality. What if CRM introduces a new function with the same name as one you have defined? Same result.
This sample introduces the best practice of attaching objects to the window object through an arbitrary ‘namespace’ object. This should minimize the risk of overwriting objects in the DOM.
For example, this sample requires that code in an Onchange event can access the filterChildField function defined in the OnLoad event. To make this available it is attached to a crmSDKSample object which is then attached the window object.
//Create an arbitrary object to serve as a namespace
var crmSDKSample = new Object();
/*Attach the global dependancy array to the crmSdkSample object */
crmSDKSample.gArrDependentPicklists = gArrDependentPicklists;
/*Attach the function to the crmSDKSample*/
crmSDKSample.filterChildField = filterChildFieldFunction;
/*Attach the crmSDKSample to the window so it is globally available*/
window.crmSDKSample = crmSDKSample;
To call the function from the onChange event, the syntax looks like this:
crmSDKSample.filterChildField("new_category", "new_subcategory");
Because the window object is one part of the DOM that is almost certain to exist in future versions of CRM forms – this object is more likely to continue to be available after an upgrade.
Sample Code
As always, the sample code provided in the SDK are not intended to be used in a production environment without prior testing. You should deploy this sample to a test environment and examine it for interaction or interference with other parts of the system.
I hope this sample provides you with some insights into creating dependent picklists as well as ideas about defining reusable objects within client script.
Cheers
PingBack from
Hi Jim, thanks for the new dependent picklists sample.
One small issue that I've encountered in my first implementation is that the same child option cannot be depdendent on more than one parent option. For example, my child option "1" should be vaild for parent options "1" and "2", but this causes the option counter to complain about unmapped options.
Neil –
That is a good point. This sample assumes that each child option is valid for just one parent option. The logic for checking that all options are available depends on this assumption.
I think the main point is to be aware that picklist options change over time and they can be changed without understanding that they can affect scripts. This sample shows just one way to do that.
Hi,
How can we this in ms crm 2011. As am new in CRM,please tell me how to create dependent picklist in CRM 2011
See See msdn.microsoft.com/…/gg594433.aspx for a CRM 2011 example. | https://blogs.msdn.microsoft.com/crm/2009/06/08/new-dependent-picklist-sample/ | CC-MAIN-2016-30 | refinedweb | 1,104 | 50.67 |
Java 14 reached general availability on 17 March 2020. In this post, we will go through some features from the list of 16 new features added in Java programming language.
We can find the JDK 14 binaries here.
1. JEP 305 – Pattern Matching for instanceof (Preview)
In Java 14,
instanceof operator has been modified to have type test pattern. A type test pattern (used in
instanceof) consists of a predicate that specifies a type, along with a single binding variable.
In the code below, the phrase
String s is the type test pattern:
if (obj instanceof String s) { // can use s here } else { // can't use s here }
In above example, the
instanceof operator “matches” the target
obj to the type test pattern if
obj is an instance of
String, then it is cast to
String and assigned to the binding variable
s.
Note that the pattern will only match, and
s will only be assigned, if
obj is not null.
Read More : Java – Pattern Matching for instanceof
2. JEP 368 – Text Blocks (Second Preview)
In Java, a text block is a multi-line string literal. It means we do not need to get into mess of explicit line terminators, string concatenations, and delimiters otherwise used for writing the normal string literals.
Text blocks comprise multiple lines of text and uses three double-quote characters (
""") as its opening and closing delimiter.
The instance produced from a text block is of type
java.lang.String with the same characteristics as a traditional double quoted string. This includes object representation and interning into string pool.
Also, Text blocks can be used anywhere a string literal can be used. For example, we can use it for string concatenation.
String string = "Hello"; String textBlock = """ World"""; String joinedString = string + textBlock; System.out.println(joinedString);
Read More : Java – Text blocks
3. JEP 358 – Helpful NullPointerExceptions
Java 14 improves the usability of
NullPointerException generated by the JVM by describing precisely which variable was
null.
First, we need to pass
-XX:+ShowCodeDetailsInExceptionMessages JVM flag to enable this feature while running the application. Make sure, you are passing it.
public class HelpfulNullPointerException { public static void main(String[] args) { Employee e = null; System.out.println(e.getName()); } }
Only NPEs that are created and thrown directly by the JVM will include the null-detail message (messages we generally pass in the constructor when we create the exception in the program). NPEs that are explicitly created and/or explicitly thrown by programs running on the JVM are not subject to the bytecode analysis.
Read More : Java 14 – Helpful NullPointerException
4. JEP 359 – Records (Preview)
record type has been introduced as preview feature in Java 14 and shall be used as plain immutable data classes for data transfer between classes and applications.
Like
enum, record is also a special class type in Java. It is intended to be used in places where a class is created only to act as plain data carrier.
The important difference between class and record is that a record aims to eliminate all the boilerplate code needed to set and get the data from instance. Records transfer this responsibility to java compiler which generates the constructor, field getters, hashCode() and equals() as well toString() methods.
public record EmployeeRecord(Long id, String firstName, String lastName, String email, int age) { }
Read More : Java 14 – record type
5. JEP 361 – Switch Expressions (Standard)
A switch statement allows the application to have multiple possible execution paths based on the value of a given expression in runtime.
In Java 14, with switch expression, the entire switch block “gets a value” that can then be assigned to a variable in same statement.
It has the support of multiple case labels and using
yield to return value in place of old
return keyword.
In case of
enum, we can skip the
default case. If there is any missing value not handled in cases, compiler will complain. In all other expression types (int, strings etc), we must provide
default case as well.
public static Boolean isWeekDay (Day day) { Boolean result = switch(day) { case MON, TUE, WED, THUR, FRI -> { System.out.println("It is WeekDay"); yield true; } case SAT, SUN -> { System.out.println("It is Weekend"); yield false; } }; return result; }
Read More : Java 14 – switch expression
6. More Features
6.1. JEP 343 – Packaging Tool (Incubator)
With JDK 8, a tool called
javapackager was released as part of the JavaFX kit. However, after JavaFX split from Java with the release of JDK 11, the popular
javapackager was no longer available.
This JEP create a simple packaging tool, based on the
javapackager tool which supports native packaging formats to give end users a natural installation experience. These formats include msi and exe on Windows, pkg and dmg on macOS, and deb and rpm on Linux.
The tool can be invoked directly, from the command line, or programmatically, via the
ToolProvider API.
$ jpackage --name myapp --input lib --main-jar main.jar
6.2. JEP 345 – NUMA-Aware Memory Allocation for G1
In Numa (Non-Uniform Memory Access) memory architecture, each processor core receives a small amount of local memory, but the other cores are granted access to it.
The parallel garbage collector, enabled by -XX:+UseParallelGC, has been NUMA-aware for many years and has improving the performance of configurations that run a single JVM across multiple sockets.
With this JEP, G1 garbage collector has been enhanced for better memory management under Linux OS.
6.3. JEP 349 – JFR Event Streaming
This JEP exposes JDK Flight Recorder data for continuous monitoring, both for in-process and out-of-process applications.
To consume the data today, a user must start a recording, stop it, dump the contents to disk and then parse the recording file. This works well for application profiling, where typically at least a minute of data is being recorded at a time, but not for monitoring purposes.
The package
jdk.jfr.consumer, in module
jdk.jfr, is extended with functionality to subscribe to events asynchronously. Users can read recording data directly, or stream, from the disk repository without dumping a recording file.
6.4. JEP 352 – Non-Volatile Mapped Byte Buffers
This JEP adds a new JDK-specific file mapping modes so that the
FileChannel API can be used to create
MappedByteBuffer instances that refer to NVM (non-volatile memory). NVM is also known as persistent memory and is used to store data permanently.
Recent changes to the
MappedByteBufer API mean that it supports all the behaviours needed to allow direct memory updates and provide the durability guarantees needed for higher level, Java client libraries to implement persistent data types (e.g. block file systems, journaled logs, persistent objects, etc.).
6.5. JEP 363 – Remove the Concurrent Mark Sweep (CMS) Garbage Collector
This JEP aims to remove the CMS garbage collector after it was marked as deprecated in Java 9 (JEP 291). Interested users had two years to take care of the project and maintain it but it didn’t happened.
So now, CMS GC has been removed from Java 14. Note that CMS garbage collector has not been removed from prior releases and will be available till Java 13.
6.6. JEP 367 – Remove the Pack200 Tools and API
Remove the pack200 and unpack200 tools, and the
Pack200 API (compression scheme for JAR files introduced in Java SE 5.0) in the
java.util.jar package. These tools and API were deprecated for removal in Java SE 11 with the express intent to remove them in a future release.
6.7. JEP 370 – Foreign-Memory Access API (Incubator)
With this JEP, Java provides an API to allow Java programs to safely and efficiently access foreign memory outside of the Java heap.
Thegoal is that the same API should be able to operate on various kinds of foreign memory (e.g., native memory, persistent memory, managed heap memory, etc.).
It should not be possible for the API to undermine the safety of the JVM, regardless of the kind of memory being operated upon. Also, memory deallocation operations should be explicit in the source code.
Drop me your questions in comments related to Java 14 new features.
Happy Learning !!
Reference : Java 14 Release | https://howtodoinjava.com/java14/java14-new-features/ | CC-MAIN-2020-45 | refinedweb | 1,365 | 53.71 |
Atanua 1.2.1
Sponsored Links
Atanua 1.2.1 Ranking & Summary
RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 1.87 MB
Platform: Linux,Linux Gnome,Mac OS X,Win2000,Win7 x32,W
License: Shareware
Price: $25
Downloads: 338
Date added: 2011-05-19
Publisher: Jari Komppa (Sol)
Atanua 1.2.1 description
Atanua 1.2.1. Home & Education
Atanua 1.2.1 Screenshot
Atanua 1.2.1 Keywords
Bookmark Atanua 1.2.1
Atanua 1.2.1 Copyright
WareSeeker.com do not provide cracks, serial numbers etc for Atanua 1.2.1. Any sharing links from rapidshare.com, yousendit.com or megaupload.com are also prohibited.
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Software
import contacts from MS outlook Free Download
jIRC is an cutting-edge IRC Client. It has a pretty user interface with characters, which make chatting easier. They can talk! Theyre very pretty. Each of them have own animations. jIRC supports RFC14 Free Download
Manage your food service industry and labor costs Free Download
A Java class library for visualizing quantitative data using two-dimensional category charts Free Download
Helps themes and CSS work better with Firefox. Free Download
Changes window title text, icon and customizes windows user interface. Free Download
Scanmetender Standard is a multifunctional TCP/UDP network scanner and security suite, which unites a perfect graphical user interface (GUI) with professional functions. It is probably the best choice if you search for a port scanner. Free Download
AshEdit is a freeware text editor. Free Download
Latest Software
Popular Software
Favourite Software | http://wareseeker.com/Home-Education/atanua-1.2.1.zip/7f8d059ff | CC-MAIN-2015-35 | refinedweb | 276 | 53.58 |
- java.lang.Object
- java.io.InputStream
- java.io.FilterInputStream
- java.io.LineNumberInputStream
- All Implemented Interfaces:
Closeable,
AutoCloseable
@Deprecated public class LineNumberInputStream extends FilterInputStreamDeprecated.This class incorrectly assumes that bytes adequately represent characters. As of JDK 1.1, the preferred way to operate on character streams is via the new character-stream classes, which include a class for counting line numbers.This class is an input stream filter that provides the added functionality of keeping track of the current line number.when a
readreturns a newline character.
- Since:
- 1.0
- See Also:
LineNumberReader
Field Summary
Fields declared in class java.io.FilterInputStream
in
Method Summary
Methods declared in class java.io.FilterInputStream
close, markSupported, read
Methods declared in class java.io.InputStream
readAllBytes, readNBytes, transferTo
Constructor Detail
LineNumberInputStream
public LineNumberInputStream(InputStream in)Deprecated.Constructs a newline number input stream that reads its input from the specified input stream.
- Parameters:
in- the underlying input stream.
Method Detail
read
public int read() throws IOExceptionDeprecated.Reads the next byte of data from this input stream. The value byte is returned as an
intin the range
0to
255. If no byte is available because the end of the stream has been reached, the value
-1is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.
The
readmethod of
LineNumberInputStreamcalls the
readmethod of the underlying input stream. It checks for carriage returns and newline characters in the input, and modifies the current line number as appropriate. A carriage-return character or a carriage return followed by a newline character are both converted into a single newline character.
- Overrides:
readin class
FilterInputStream
- Returns:
- the next byte of data, or
-1if the end of this stream is reached.
- Throws:
IOException- if an I/O error occurs.
- See Also:
FilterInputStream.in,
getLineNumber()
read
public int read(byte[] b, int off, int len) throws IOExceptionDeprecated.Reads up to
lenbytes of data from this input stream into an array of bytes. This method blocks until some input is available.
The
readmethod of
LineNumberInputStreamrepeatedly calls the
readmethod of zero arguments to fill in the byte array.
- Overrides:
readin class
FilterInputStream
- Parameters:
b- the buffer into which the data is read.
off- the start offset of the data.
len- the maximum number of bytes read.
- Returns:
- the total number of bytes read into the buffer, or
-1if there is no more data because the end of this stream has been reached.
- Throws:
IOException- if an I/O error occurs.
- See Also:
read()
skip
public long skip(long n) throws IOExceptionDeprecated.Skips over and discards
nbytes of data from this input stream. The
skipmethod may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly
0. The actual number of bytes skipped is returned. If
nis negative, no bytes are skipped.
The
skipmethod of
LineNumberInputStreamcreates a byte array and then repeatedly reads into it until
nbytes have been read or the end of the stream has been reached.
- Overrides:
skipin class
FilterInputStream
- Parameters:
n- the number of bytes to be skipped.
- Returns:
- the actual number of bytes skipped.
- Throws:
IOException- if an I/O error occurs.
- See Also:
FilterInputStream.in
setLineNumber
public void setLineNumber(int lineNumber)Deprecated.Sets the line number to the specified argument.
- Parameters:
lineNumber- the new line number.
- See Also:
getLineNumber()
getLineNumber
public int getLineNumber()Deprecated.Returns the current line number.
- Returns:
- the current line number.
- See Also:
setLineNumber(int)
available
public int available() throws IOExceptionDeprecated.Returns the number of bytes that can be read from this input stream without blocking.
Note that if the underlying input stream is able to supply k input characters without blocking, the
LineNumberInputStreamcan guarantee only to provide k/2 characters without blocking, because the k characters from the underlying input stream might consist of k/2 pairs of
'\r'and
'\n', which are converted to just k/2
'\n'characters.
- Overrides:
availablein class
FilterInputStream
- Returns:
- the number of bytes that can be read from this input stream without blocking.
- Throws:
IOException- if an I/O error occurs.
- See Also:
FilterInputStream.in
mark
public void mark(int readlimit)Deprecated.Marks the current position in this input stream. A subsequent call to the
resetmethod repositions this stream at the last marked position so that subsequent reads re-read the same bytes.
The
markmethod of
LineNumberInputStreamremembers the current line number in a private variable, and then calls the
markmethod of the underlying input stream.
- Overrides:
markin class
FilterInputStream
- Parameters:
readlimit- the maximum limit of bytes that can be read before the mark position becomes invalid.
- See Also:
FilterInputStream.in,
reset()
reset
public void reset() throws IOExceptionDeprecated.Repositions this stream to the position at the time the
markmethod was last called on this input stream.
The
resetmethod of
LineNumberInputStreamresets the line number to be the line number at the time the
markmethod was called, and then calls the
resetmethod.
- Overrides:
resetin class
FilterInputStream
- Throws:
IOException- if an I/O error occurs.
- See Also:
FilterInputStream.in,
mark(int) | https://docs.oracle.com/javase/10/docs/api/java/io/LineNumberInputStream.html | CC-MAIN-2020-24 | refinedweb | 834 | 50.84 |
Long delay before you can connect to a domain-based DFS namespace
This article has been archived. It is offered "as is" and will no longer be updated.
After you reconnect to a network, you may not be able to open a domain-based Distributed File System (DFS) link or a domain-based DFS root for up to 15 minutes. Therefore, you may experience problems when your computer first tries to synchronize offline files to a DFS root or to a DFS link.
Symptoms
Microsoft Windows XP-based DFS clients that belong to a domain periodically query the domain controllers to distinguish queries for fully qualified domain names (FQDNs) from queries for fully qualified computer names. The results of the discovery process are cached in a special table that is named the "SPC cache." The client uses the SPC cache to avoid real-time queries to domain controllers in the domain. If the Windows XP-based client cannot populate the SPC cache when the computer first starts, the client will try again after one minute for three more times. After the third try, or after three minutes, the client will wait 15 minutes before it tries to populate the SPC cache again. Therefore, if the DFS server is unavailable at first, the Windows XP-based client may have to wait for up to 15 minutes before the client can connect to the domain-based DFS namespace.
Cause
Therefore, the Windows XP-based client cannot synchronize offline files to a DFS root or a DFS link until the client can access the DFS namespace. -------------------------------------------------------------- 13-Feb-2004 00:21 5.1.2600.1334 92,160 Cscdll.dll 10-Feb-2004 19:22 5.1.2600.1342 416,640 Mrxsmb.sys 13-Feb-2004 00:21 5.1.2600.1335 305,152 Netapi32.dll 10-Feb-2004 19:22 5.1.2600.1334 165,760 Rdbss.sys 13-Feb-2004 00:21 5.1.2600.1335 120,320 Wkssvc.dllNote You must enable Offline Files support to use this hotfix.After you apply this hotfix, the Windows XP-based client populates the SPC cache if it is empty and if one of the following conditions occurs:
- Offline files are synchronized.
- A new network connection is detected.
With this hotfix, you can access the domain-based DFS namespace faster than was previously possible.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article. This problem was first corrected in Microsoft Windows XP Service Pack 2.
Status
For additional information about how to control the frequency of Windows XP-based client DFS queries, click the following article number to view the article in the Microsoft Knowledge Base:
More information
834674 Domain DFS network path goes offline after you open Windows Explorer or My Computer in Windows XP
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
Properties
Article ID: 835261 - Last Review: 01/12/2015 23:09:56 - Revision: 3.0
Microsoft Windows XP Professional
- kbnosurvey kbarchive kbautohotfix kbhotfixserver kbqfe kbtshoot kbwinxpsp2fix kbwinxppresp2fix kbfix kbbug KB835261 | https://support.microsoft.com/en-us/kb/835261 | CC-MAIN-2016-50 | refinedweb | 523 | 63.7 |
The Anthos Service Mesh pages in the Google Cloud Console provide both summary and in-depth metrics, charts, and graphs that enable you to observe service behavior. You can monitor the overall health of your services, or drill down on a specific service to set a service level objective (SLO) or troubleshoot an issue.
Note: Some features, including Anthos Service Mesh pages in Cloud Console, are only available on GKE on Google Cloud. To learn about the service mesh features supported on each platform, see Supported features.
Viewing summary SLO and service status
The Anthos Service Mesh page is your point of entry. After you have created your SLOs, a summary of your alerts and SLOs is displayed near the top of the page.
Below the SLO status section is a summary view of the health of your services in the service mesh:
The icons next to each service name indicate the SLO status of the service. To monitor or view details for a specific service, click the service name. You can apply filters to control which services are displayed in the table:
- Click a Filter by link in the SLO status section to display only the applicable services in the table. For example, you can filter the table to show only the services that don't have an SLO set.
- Click filter_list Filter services in the top-left corner of the table to apply additional conditions.
In the upper-right corner of the window are the following controls:
- Click the Time Span drop-down list to display the status information for a specific time period.
- Click Topology to display the service graph.
- Click Table View to switch back to the table view.
Exploring the service graph
You can explore a service topology graph visualization that shows:
- Your mesh's services.
- The Kubernetes workloads that back those services.
- The relationships between the services.
In the screenshot below, the frontend service is backed by a single frontend Kubernetes workload. The workload in turn, sends requests to several other services. The icons beside each service are the same SLO status icons that are displayed in the table view.
When you click on a service icon, a card appears with details about the service, including some key metrics. The card also includes a link to the Overview page for that particular service.
There are several ways you can interact with the graph:
- To pan across the graph, click and drag in the background.
- To zoom the graph, use the mouse wheel.
- To reposition services or workloads in the graph for easier viewing, click and drag the graph node.
You can expand a workload to its underlying components by holding the pointer over a workload icon and clicking the Expand option that appears in the upper-right of the icon. By clicking the Expand option a few more times, you can drill down from workload to deployment, replica set, Pod, and even container.
As the services and their communication patterns change over time, the service graph tracks these changes. You can use the timeline at the bottom of the page to define a point in time to view the state of the graph. The Legend displays the time interval for the graph.
Communication relationships are based on observed network traffic. If services don't communicate at the specified time, then no edge exists between those services.
Above the timeline on the right side is the Enable time diff comparison
icon:
When you click this icon, the graph enters diff mode, which lets you compare
the graph at two points in time.
In diff mode, you can switch between different visualizations using the icons:
The timeline at the bottom of the window controls the two points in time that you are comparing. You can adjust the two sliders to change the time period.
Monitoring a specific service
On the Services Mesh page, you can select a service to monitor from either the table or topology view. After you select a service, a left-navigation bar appears with links to the following pages:
The Overview page displays SLO status, key metrics, and details about the service.
The Health page displays SLO details.
The Metrics page displays charts for key traffic and infrastructure metrics. You can break down the metrics in numerous ways, such as by cluster and Pod.
The Connected services page displays details about inbound and outbound requests.
The Diagnostics page displays error logs.
The Infrastructure page displays key metrics and details about each Pod. You can click the Pod name to go to the Workloads page in the Cloud Console.
Working with the timeline
At the top of each page for a specific service, you can click the Time Span drop-down list to display information for a specific time period.
To specify a custom time, click access_time Show Timeline.
You can use the timeline to refine the time interval that is applied to the page. The total time span displayed by the timeline is controlled by the Time Span drop-down list. When you select a new time span, the timeline and other elements on the page update to reflect that time span. For example, the graphs on the Metrics page show data corresponding to your chosen time span. To refine the time span even more, drag the blue sliders.
Viewing traffic metrics
On the Services Mesh page, click a service from the list and then click Traffic to see a visualization of your current traffic routing across workloads.
You can click a specific workload in the diagram to see a details panel on the right for the selected workload, including key details, request count, error rate, and latency.
Viewing security features
On the Security page, you can view the security features of your services mesh. The Policy Summary tab shows the status of Anthos security features, including policies and denials.
The Policy Audit tab shows a summary of the security configuration statistics of the service mesh.
The Workloads section shows the detailed workload policy status for each cluster and namespace, including the Kubernetes network policy, service access control and mTLS details.
Viewing security metrics
On the Services Mesh page, click a service from the list and then click Security to see the workload instances that access your service.
What's next
- Control access to Anthos Service Mesh in the Cloud Console
- Learn how to access logs in Cloud Logging | https://cloud.google.com/service-mesh/docs/observability/explore-dashboard | CC-MAIN-2021-17 | refinedweb | 1,067 | 61.77 |
UPDATE! Even better than listing out the individual errors, Phil Gyford has posted his working code for the examples in James Bennet’s “Practical Django Projects 2nd Edition“. You can find it on bitbucket here. Thanks Phil!
Since a quick Google search failed to turn up these e-book errate for James Bennets informative “Practical Django Projects 2nd Edition”, I’ll compile my own list. Hopefully my frustration in overcoming these errors will save you from the same.
Chapter 4, page 66:
(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
should be:
(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
(note the “P?” vs. “?P” before <slug>)
Chapter 4, page 70
Author should mention that the following must be added to the top of urls.py once you switch to generic views:
from coltrane.models import Entry
Chapter 4, page 71 and 73
Each of the four urlpatterns which include:
weblog/(?P<year>\d{4}/
Should actually be:
weblog/(?P<year>\d{4})/
(note the “)” after the {4})
7 Responses to “Errata: Practical Django Projects 2nd Edition (PDF)”
A big thank you for the error on the pattern on chapter 4 , page 66. Was struggling with that.
Just beginning Django , you saved me quite some time !!!
Christophe
Chapter 4 page 69:
(r’^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(?[-\w]+)/$,
‘django.views.generic.date_based.object_detail’, entry_info_dict)
should be
(r’^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$,
‘django.views.generic.date_based.object_detail’, entry_info_dict)
Note the ?P instead of ?
for the slug group
Chapter 4, page 71
(r’^admin/’, include(admin.site_urls)),
should be
(r’^admin/’, include(admin.site.urls)),
Thank you so much for posting this up, I was pulling my hair over this and finally you solved it for me thank you again
chapter 6 page 118 and page 120, the
Entry.objects.all()[:5]
instead by
Entry.live.all()[:5] I can’t find any documents about models.live from docs.djangoproject.com. How about that?
Hey Mitch, chapter 4 page 66 error just saved a lot of hair on my head. Thanks ! | http://mitchfournier.com/2010/03/08/errata-practical-django-projects-2nd-edition-pdf/ | CC-MAIN-2018-30 | refinedweb | 376 | 60.61 |
Myself and my team are willing to rewrite any article (Up to 2000 words) for just 50 cents per article! Now, to clarify a few things and to make sure that this topic doesn't get spammed by FAQ's, here is some info: Article Uniqueness: Guaranteed 40%+ (Average is 65%) Article Turnaround Time: 48 Hours (On Average) Spelling & Grammar Standards: Verified by Myself before return (Native English) Payment Method: Paypal Cost per Article: 50c Bulk Discount Prices: No Native Language of Rewriters: 16 English, 1 German, 5 Dutch Keyword Density Service: No Article Rewriting Method: By Hand - No Software Minimum Order: 20 Maximum Articles Per Day: 200 Payment: After Work Returned/Finished Order: First come first serve Review Copies Available?: No longer available (taken) Want to place an order? Blast me a PM here or e-mail me at [email protected] (< No spamming thankyou, I get enough already). If you want to take the review copy (1 Available), please include that in your message and I will do up to 5 articles in the review copy. Please send your articles in a .txt or .doc format contained in a single .rar or .zip file. Note: The service may be paused at any point if we receive too many articles to keep up with, but will reopen the service once we manage to bring the number back under control. | https://www.blackhatworld.com/seo/50c-article-rewriting-service.37723/ | CC-MAIN-2018-51 | refinedweb | 229 | 59.87 |
#include <mediasession_stream.h>
Single Stream within a MediaConverterInterface. Streams might have sub streams as children (see HierarchyObjectInterface).
returns the formatId of all available formats.
returns the format of the given id.
returns the selected format.
used by reader implementations to set the selected format of the stream. this must not be called from outside.
used by reader implementations to add formats to the stream. this must not be called from outside.
Subscribes to the stream. So if the media converter finds the data in the stream it triggers the specific callbacks defined by the inherited specialized interface. this allows to read data directly to the place where it needs to by without additional memory copy.
Unsubscribes from the stream.
Returns true if the stream is subscribed by a media converter. | https://developers.maxon.net/docs/Cinema4DCPPSDK/html/classmaxon_1_1_media_stream_interface.html | CC-MAIN-2022-40 | refinedweb | 130 | 53.68 |
Asked by:
login, redirect, armed, C # MVC3
- Hello.
I apologize for my first Indian middle translation.
I am an understanding of code problems. I'm doing some work for the faculty. and was 2 my partner did his part but forget to give me a base with comments. for me to follow and is traveling. alcanze and outside so I could communicate with him and get me doubts.
Languages: C # MVC3, SQL, Linq
I wanted to see if anyone might have more idea that can understand more.
work consists of these item. to consider
The client is an educational institution.
The customer wants to show his students notes for each subject.
Students can view their grades entering a Web site with your file and password.
The student can select the field by which you want to see your note.
The student will be able to comment on the proposed footnote.
The client requires a Web interface easy to modify.
The customer may require changes in the developmental stage.
The database server is in a remote location.
It is necessary to provide some mechanism to consume the information.
In future implementations, you might need to show cell information.
The logos, images and other graphical issues can be taken from the client's current website.
You must ensure that only students can see notes.
Students can only see their notes.
A teacher might want to see all the notes and students associated with their subjects.
Model
the part where I am lost in the logon.
first Question
as remarked at the beginning, the work was done by 2. my question would be who is making this code because I fail to get a value and not be null.
//show as ReturnUrl variable is generated public ActionResult LogOn(Login modelo, string returnUrl) //then later. is the code that I can not give you a non-null value if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\")) { return Redirect(returnUrl); }
second Question
In the part of AccountController. Students need to be Redirected to VerNotas. but VerNotas not working properly.
AccountController code
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Entities; using System.Web.Security; using BRL; namespace SegundoParcial.Controllers { public class AccountController : Controller { [Authorize()] public ActionResult Index() { return View(); } public ActionResult LogOn() { return View(); } [HttpPost] public ActionResult LogOn(Login modelo, string returnUrl) { string aux = new BRL.ServicioLog().ValidarPassword(modelo.Password, modelo.Email); if (aux.Equals("alumno")) {("VerNota", "Alumnos"); } } else { if (aux.Equals("profesor")) {("VerAlumno", "Alumnos"); } } return View(modelo); } } } }
this window if I charge a student (and entered the database). eg "german@alumno" Password = "1234"
and I should take VerNotas. but it tells me this error.
code VerNotas
@model List<Entities.Nota> @{ ViewBag. </div> } <hr /> @if (Model != null) { foreach(var item in Model) { <div>Materia: @item.NombreMateria</div> <div>Calificacion: @item.Calificacion</div> } } else { <h3>@ViewBag.Errores</h3> }
I repeat the question is how to implement the validation of not null. the code as said above (AccountController).
fourth question
I wonder if it is possible at the Logon (as showed in the picture above). if you can add a button or a link to the View-> Create.
reformulated. so that the user can, in the case of not having an account created. click this button and / or link. and said window fence "CrearAlumno".
and good at it you can create a student.
code Crear.
@using Entities @model Alumno @{ ViewBag. <div class="validation-summary-errors">@Html.ValidationSummary()</div> }
fifth question
a forum user (Leandro Tuttini). I recommended a few lines of code to prevent AUX remains equal to null.
the problem is that I have not found how to implement it as being in a controller I have no direct access. to lbl or txt or messanger box and do not know how to show that the user is not or does not exist in the database.
recommended code
if(string.IsNullOrEmpty(aux)){ lblMensaje.Text = "usuario o password invalidos"; return; }
if (userService.IsValidUser(model.Email, model.Password)) { }
how to implement it in AccoutControllers.
an answer of this is gained wings.
I will not forget any explanation if I miss something let me know I'll be outstanding to respond quickly.
from and I thank you for your kindness
Question
All replies
Hello boehler,
Your question is a bout ASP.NET, Please post your issue in the dedicated ASP.NET forum. You'll get more help from more engineers.
Thanks for your understanding.
Caillen
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. | https://social.technet.microsoft.com/Forums/en-US/78287929-12df-4d44-beb1-6a851888bcc6/login-redirect-armed-c-mvc3 | CC-MAIN-2017-13 | refinedweb | 783 | 52.87 |
Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
how to fetch all id of table when saving the record?
When i am saving any record the id of the current record is only fetched but i want to fetch all the ids of the table.
Any idea??
You can fetch all IDs of particular object by passing blank list [] in
search method.
For example you can fetch all the IDs of the
purchase.order like this:
purchase_order_ids = self.pool.get('purchase.order').search(cr, uid, [], context=context)
In background it will be executed like this:
select id from purchase_order
There are two methods which can be called when you click on save button
create: when you create new record.
write: when you update existing record.
You can overwrite
create &
write methods and inside it you can search for IDs.
Create is called when you create the records:
def create(cr, uid, vals, context=None): #Todo code my_search_ids = self.pool.get('object.name').search(cr, uid, [], context=context) #Todo code return super(your_class_name, self).create(cr, uid, vals, context=context)
Write is called when you update the records:
def write(cr, uid, ids, vals, context=None): #Todo code my_search_ids = self.pool.get('object.name').search(cr, uid, [], context=context) #Todo code return super(your | https://www.odoo.com/forum/help-1/question/how-to-fetch-all-id-of-table-when-saving-the-record-11495 | CC-MAIN-2017-09 | refinedweb | 234 | 65.52 |
> What if proc filesystem is removed from the kernel?> > Ability to access some other namespace through the proc filesystem does> not look clean. I think it should be cleanly supported through VFS.> > Also cd'ing into a new namespace just allows you to browse through> the other namespace. But it does not effectively change the process's> namespace. Things like mount in the other namespace will be failed> by check_mount() anyway.> > I think, we need sys calls like sys_cdnamespace() which switches to a> new namespace. Jamie's proposal was to make chroot() swich namespace.> Effectively the process's current->namespace has to be modified,> for the process to be effectively work in the new namespace.current->namespace could be dropped altogether, andcurrent->current->fs->rootmnt->mnt_namespace could be used instead.It's a nice logical extension of chroot(), without needing newsyscalls.Miklos-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at read the FAQ at | http://lkml.org/lkml/2005/5/11/182 | CC-MAIN-2016-44 | refinedweb | 170 | 59.7 |
Thanks to Dev.to, us developers have a niche platform to write without the need to start our own blog. This is awesome, but you built a portfolio specifically to showcase and consolidate your work, so leaving a link to your Dev.to profile hoping it'll be clicked isn't nearly as effective as a slick card with a preview of your post (click-bait, do your stuff). I'm going to go over how & why I decided to build my blog with a Dev.to backend.
Why?!
Why not Vuepress or Gridsome?
If I were starting my site from the ground up, Gridsome would've been the obvious choice, but I already have my site built in vanila VueJs exactly as I want it.
I did heavily consider Vuepress, but decided the effort couldn't be justified by my needs. I'm not worried about SEO and I don't need to write from my own admin panel. Plain and simply, I just want my portfolio to be a centralized repository of all my work relating to development.
Why Dev.to?
There's a few reasons I decided on using Dev.to.
1.) Its all tech, which means that I'm directly interacting with my peers whereas if I were to use say Medium, I'd be in a very deep pool and not accomplishing the interaction I'm shooting for with as much ease.
2.) No SEO or advertising to worry with. By using Dev.to to host my content I'm completely eliminating my need to worry with SEO. I'll use
vue-meta to aid with SEO on my blog by taking some data from Dev.to's API.
3.) Tiny impact to bundle, Netlify compatible, super quick. Gridsome boasts some crazy performance numbers for sure, but the flow of having to push changes to the overall codebase isn't nearly as elegant as just writing on Dev.to and knowing that the post will be on my site automatically.
4.) Dev.to's API provides all of the data I'd expect from any other CMS. There are some caveats for sure, but worth noting that their API is still in beta so who knows what more is to come.
Here's an example response from this article (I'll be omitting the keys
body_html &
body_markdown to avoid an inception level catastrophe):
{ "type_of": "article", "id": 203240, "title": "Start your blog with a Dev.to backend", "description": "", "cover_image": "", "readable_publish_date": "Nov 11", "social_image": "", "tag_list": "beginners, vue, javascript", "tags": [ "beginners", "vue", "javascript" ], "slug": "start-your-blog-with-a-dev-to-backend-13e2", "path": "/codespent/start-your-blog-with-a-dev-to-backend-13e2", "url": "", "canonical_url": "", "comments_count": 0, "positive_reactions_count": 0, "collection_id": null, "created_at": "2019-11-11T02:43:22Z", "edited_at": "2019-11-11T04:35:47Z", "crossposted_at": null, "published_at": "2019-11-11T04:09:07Z", "last_comment_at": "2019-11-11T04:09:07Z", "published_timestamp": "2019-11-11T04:09:07Z", "user": { "name": "CodeSpent", "username": "codespent", "twitter_username": "CodeSpent", "github_username": null, "website_url": "", "profile_image": "", "profile_image_90": "" } }
We have plenty of data available to create a stylish blog with some
vue-meta additions. Maybe even slug routing later.
Starting the project
I'm starting with an existing project, so I'm going to pick this article up where that begins. If you need help getting your Vue app started, check out this excellent write-up from @therealdanvega.
Fetching articles
WARNING: For this use case, we'll be using Dev.to's API publically with NO API_KEY. Currently there is no read only api_key and all your secrets will be baked into the application and accessible from the browser, giving an attacker the ability to post to Dev.to on your behalf. Please do not use your Dev.to api_key on the frontend.
We'll start by creating a
/services/ directory in your
/src/ folder. Inside this directory, create a file called
blogService.js which will house the api methods for collecting articles. First create an instance of axios with our
baseUrl pointing at Dev.to's API at.
import axios from 'axios' const api = axios.create({ baseURL: '', timeout: 5000, headers: { 'Content-Type': 'application/json', } })
This gives us a reusable axios instance for use in our blog service. We'll want to use that to start fetching articles, which sensibly is just at the
/articles/ endpoint, so lets add that method to our
blogService.
export default { async fetchArticles() { try { return await api.get(`articles`) } catch(e) { return e.response } }, }
In any of your components, go ahead and test this by importing it and calling the
fetchArticles() method.
import blogService from '@/services/blogService'
You'll find that this isn't quite right, its pulling all Dev.to articles, so we'll want to add a query parameter to filter to just our own posts. In your
fetchArticles() method, just append
?username=<your_username> to the url arg.
export default { async fetchArticles() { try { return await api.get(`articles?username=codespent`) } catch(e) { return e.response } }, }
All set! We can now get all of our articles!
Blog components
We're going to need to create 3 components:
- Blog Component -- Houses the
<router-view>for our nested Blog routes.
- Blog Home Feed -- This is where we're going to see an overview of all blog posts.
- Blog Post -- Appropriately named, this is where a single post will be available to read.
Blog.vue
<template> <div class="container text-center p-4 min-w-full"> <h1 class="text-white text-5xl">CodeSpent.dev</h1> <h3 class="text-gray-600 text-sm font-black italic">This blog is powered by </h3> <a href="" class="text-center text-white"><font-awesome-icon</a> <router-view></router-view> </div> </template>
The Blog component will be rather simple. Just a header, and a Powered by Dev.to badge. The important parts will be coming from our
<router-view></router-view> which is going to render our other 2 components based on the route.
Routing
For my site, I've got a home page which is located at
/, and the blog I'd like to be available at
My blog routes will look something like this.
/blog /blog/post/:articleId +------------------+ +-----------------+ | Blog | | Blog | | +--------------+ | | +-------------+ | | | BlogHome | | +------------> | | BlogPost | | | | | | | | | | | +--------------+ | | +-------------+ | +------------------+ +-----------------+
We can achieve this pretty easily by first creating a
/blog/ route for our
Blog.vue component.
export default new Router({ mode: 'history', routes: [ { path: '/', component: Home, name: 'home' }, { path: '/blog/', component: Blog, name: 'blog' }
Under
/blog/ we'll want to put our 2 nested routes, BlogHome and BlogPost, so these will be passed as
children under the
/blog/ route. Here is my complete
router.js with the nested routes for reference.
import Vue from 'vue' import Router from 'vue-router' import Home from '@/components/home/Home' import Blog from '@/components/blog/Blog' import BlogHome from '@/components/blog/BlogHome' import BlogPost from '@/components/blog/BlogPost' Vue.use(Router) export default new Router({ mode: 'history', routes: [ { path: '/', component: Home, name: 'home' }, { path: '/blog/', component: Blog, name: 'blog', children: [ { path: '/', component: BlogHome, name: 'blog-home' }, { path: '/blog/post/:articleId/', component: BlogPost, name: 'blog-post' } ] }, ] })
Now we have all the routing ready to handle both the BlogHome and BlogPost component. You'll notice the
:articleId/ at the end of the BlogPost path, this is used to get the Dev.to article id from a url parameter later!
BlogHome
The BlogHome component is where we'll be presenting all articles with some description text, tags, and the cover image used. Now I'm just getting started on Dev.to myself, so this screenshot you'll notice is other awesome developers' articles for testing. In your
fetchArticles() method in
blogService.js you can remove the
username query parameter to get all articles from Dev.to for the sake of testing/designing if you're new as well.
<template> <div class="container text-center p-4"> <div class="container flex flex-row flex-wrap m-8 p-8 min-h-screen"> <h3 v-No posts yet, stay tuned!</h3> <div v- <img class="w-full" : <div class="px-6 py-4" > <div class="font-bold text-xl mb-2 text-white">{{ article.title }}</div> <p class="text-gray-700 text-base">{{ article.description }}</p> </div> <div class="px-6 py-4"> <span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 m-2" v- #{{ tag }} </span> </div> </div> </div> </div> </template> <script> import blogService from '@/services/blogService' export default { data() { return { articles: [] } }, methods: { async fetchArticles() { await blogService.fetchArticles() .then((response) => { switch(response.status) { case 200: { this.articles = response.data break } default: { this.articles = false break } } }) }, openArticle(articleId) { this.$router.push('post/' + articleId) } }, mounted() { this.fetchArticles() } } </script>
I'm using TailwindCSS here to build the layout with the card object, then using the
v-for directive, I loop over the
articles that were set from the
fetchArticles() method called on the
beforeMount() hook. You're welcome to use this template for yourself, I'm not much of a designer, but this contains the basic elements I felt necessary; Title, Description, CoverImage, & Tags.
You'll notice that on the
@click directive for the card div, we have a method called
openArticle() which pushes the route to
blog/post/:articleId. This is where we'll use that url param from earlier. Lets go ahead and move over to the BlogPost component.
BlogPost.vue
This one is a work-in-progress, for sure. The Dev.to API does provide both
body_markdown &
body_html keys in the article data, but we'll still need to style based on that data. Considering I have very few posts yet to work with, I haven't caught a whole lot of conditions needed to style.
<template> <div class="container flex flex-col items-center m-5 min-h-screen"> <h1 v-That post can't be found.</h1> <img : <h1 class="text-white text-3xl font-black mt-4">{{ article.title }}</h1> <div class="article text-left" v-</div> </div> </template> <script> import blogService from '@/services/blogService' export default { data() { return { article: {} } }, beforeMount() { this.fetchArticle() }, methods: { async fetchArticle() { const articleId = this.$route.params.articleId await blogService.fetchArticleById(articleId) .then((response => { switch(response.status) { case 200: { this.article = response.data break } default: { this.article = false break } } })) } } } </script>
Another pretty basic layout with some very similar things from the BlogHome component. Take notice to the final
div in our template. This is where we use the
v-html directive to "inject" the html from the article into that
div. You'll notice by default, this comes out very ugly, so we'll want to style it. Now this part is very much still a work-in-progress for me as I haven't seen a whole lot of articles enough so to style, but I do want to make a comment about the
/deep/ >>> selector. Here are my current styles.
<style scoped> .article { padding: 4em; } .article >>> { color: #fff !important; } .article >>> h1 { font-size: 2.2em; } .article >>> p { font-size: 1.2em; margin: 1,2 0 1.8em; } .article >>> li { margin: 0.3em auto; list-style: square; } </style>
The
>>> selector has been deprecated some time ago, but with
scoped styles, this has been the only way I could actually get the styles to apply within the
v-html directive. Happen to have a better way of handling this? Please feel free to comment!
Netlify redirect
Just want to quickly address this as I've had a lot of people get stuck on this when using vue-router with Netlify. To keep nice syntactic urls, we'll want to use
history mode on vue-router, but this only works when the server is handling route redirects. Since we don't have access to Nginx/Apache on Netlify, we'll want to create a redirect in a
netlify.toml.
Create a file in the root of your project called
netlify.toml. The purpose of this file is to send a message to the builder robots when deploying with Netlify that lets them know some additional configurations are needed.
In this file, add the following:
[[redirects]] from = "/*" to = "/index.html" status = 200
What this will do is redirect all routes back to
index.html in your Vue app allowing vue-router to take care of the routing.
Note: Do not use the force = true argument if redirect doesn't work at first, this will also force redirects on /static /assets routes which is where your js files are hosted. Instead clear cache & deploy again.
Demo
You can see a live demo of this at and this specific article at
Conclusion
Well that's pretty much it, now you can just write up your blog posts on Dev.to as normal, but your site will still contain a good-looking blog to centralize all your work. Of course I am by no means a Vue or Javascript expert, so if you see an issue or spot a way this could be improved, please leave a comment!
Suggestions Welcome
Of course any suggestions or critique on this post, contents within, or the code provided are heavily welcome!
Issues
A few issues I'm currently working out:
- Adding Prism/Highlightjs syntax highligting
- Implement comments and like counts (Read only)
You can also find my portfolio/blog code on GitHub for reference.
Discussion
For syntax highlighting you could feed the raw markdown into the wc-markdown web component.
github.com/vanillawc/wc-markdown
It has markdown parsing (Marked) and syntax highlighting (PrismJS) built-in.
I'm going to try hosting this from a S3 Bucket.
This is huge. Thank you! May just be the solution to some styling hacks here as well. :)
In theory, it should work. I haven't actually tried integraring the web component into Vue yet. When you import, use the
dist/bundle.
I've been looking for a setup like this for my own blog. So, I'll be trying to do the same.
Except, I'm going to try hosting it on AWS. With the website code on S3, the Dev.to requests proxied through API Gateway, and everything sitting behind a Cloudfront distribution.
That should allow HTTPS, cache all requests (incl the ones proxied to Dev.to) for 24 hours, and be dirt cheap to host.
BTW, the component uses lightDOM. Meaning you can style it globally.
Styles can be defined relative to the component. Once parsed, it'll contain the Markdown rendered as HTML. So, you can define styles like this:
Thanks for your nice article. I also moved my blog site from wordpress to vuejs and netlify. I also wrote an article crediting you here
Moved My Blog Website From WordPress To Dev.to With VueJS
Sulman Baig ・ Jul 22 ・ 3 min read
It would be great for me to have something like this but using a lightweight framework like Stimulus or Trimmings
Great work :)
I'm preparing my blog with Nuxt for a while. This will help me. Thanks.
Fantastic! Let me know if you have any questions or figure out some better ways to display the article contents. The biggest challenge with this approach so far is style overrides & syntax highlighting.
Of course :) Maybe I will permanently move my blog to Dev.
Dude! This looks soo cool! I love the gif banner on your website.
Stackbit is also an alternative for publishing from dev.to, that takes away bit of the complexity of the setup.
Nice read! 🔥
The code typer animation on my site is actually a demonstration of of
setIntervalwith Prism.
It's a bit messy but you can check out the code here.
Thanks a lot! I'll definitely look into Stackbit as well.
Awesome
Cool!
Could you get document API dev.to for me?
Thanks! | https://dev.to/codespent/start-your-blog-with-a-dev-to-backend-13e2 | CC-MAIN-2020-50 | refinedweb | 2,606 | 65.73 |
]
MEMCMP(3) OpenBSD Programmer's Manual MEMCMP(3)
NAME
memcmp - compare byte string
SYNOPSIS
#include <string.h>
int
memcmp(const void *b1, const void *b2, size_t len);
DESCRIPTION
The memcmp() function compares byte string b1 against byte string b2.
Both strings are assumed to be len bytes long.
RETURN VALUES
The memcmp() function returns zero if the two strings are identical, oth-
erwise returns the difference between the first two differing bytes
(treated as unsigned char values, so that `\200' is greater than `\0',
for example). Zero-length strings are always identical.
SEE ALSO
bcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3)
STANDARDS
The memcmp() function conforms to ANSI X3.159-1989 (``ANSI C'').
OpenBSD 2.6 June 29, 1991 1 | http://www.rocketaware.com/man/man3/memcmp.3.htm | crawl-002 | refinedweb | 123 | 57.67 |
Opened 14 years ago
Closed 14 years ago
Last modified 14 years ago
#153 closed Bug (Fixed)
Running process with $STDOUT_CHILD kills ConsoleWrite.
Description
When the following code is run nothing appears in the console. It's not a big worry, but I thought it should be reported.
#include <Constants.au3> Global $iTimer = TimerInit() Global $iProcess = Run('cmd.exe /c', @SystemDir, @SW_SHOW, $STDOUT_CHILD) Do ConsoleWrite('No ConsoleWrite for you!') Sleep(100) Until TimerDiff($iTimer) > 5000 StdioClose($iProcess) ConsoleWrite('That''s all folks!' & @CRLF)
Attachments (2)
Change History (9)
comment:1 Changed 14 years ago by Valik
comment:2 Changed 14 years ago by Saunders <admin@…>
Hmm, strange. Just found something that may be important. I actually have (in SciTe) a separate hotkey to run a script without the AutoIt wrapper. It is when I do this that I get the confusing results. If I use the AutoIt wrapper I get the expected results in the console.
Without the wrapper I get this in the console:
>"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "D:\Rob\AutoIt\_Scraps\_scrap.au3" >Exit code: 0 Time: 5.198
I also tried without the /ErrorStdOut, same thing:
>"C:\Program Files\AutoIt3\autoit3.exe" "D:\Rob\AutoIt\_Scraps\_scrap.au3" >Exit code: 0 Time: 5.241
Sorry I didn't think of that before.
comment:3 Changed 14 years ago by Valik
Baffling. I wonder what obscure dance to a deity I must do to figure this one out. As best I can tell, there's no functional difference in the code between 3.2.10.0 and 3.2.11.x... yet things don't work.
comment:4 Changed 14 years ago by Saunders <admin@…>
Which dance indeed? And which deity for that matter?
I'm just glad I'm not the only one experiencing this bug, you had me worried there for a minute when it wasn't happening to you.
comment:5 Changed 14 years ago by Valik
- Milestone set to 3.2.11.3
- Owner set to Valik
- Resolution set to Fixed
- Status changed from new to closed
Fixed in version: 3.2.11.3
comment:6 Changed 14 years ago by Valik
If you only knew how obscure this was. I've actually known the entire time what the problem was, but it took some time to write a script to prove it and to debug it. Oh, then there's the fact that I only looked at the issue on 2 occasions in the last couple weeks.
Changed 14 years ago by Valik
Changed 14 years ago by Valik
comment:7 Changed 14 years ago by Valik
Added the scripts I used to test with.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
I can not reproduce that either via SciTE or compiling as a Console application. I always get the output as expected. | https://www.autoitscript.com/trac/autoit/ticket/153 | CC-MAIN-2021-43 | refinedweb | 511 | 75.61 |
Summary: In this tutorial "class Toolkit Get Font List", explained usage of ToolKit class to get font list supported by Java graphics.
java.awt.Toolkit is an abstract class and can be used by the programmer to interact with the operating system to know some data supported by the OS. In the program, we used to know the font names supported which can be used in the program to create a font object.
public abstract class Toolkit extends Object
import java.awt.*; public class JavaFontNames extends Frame { public JavaFontNames() { super("Knowing Font Names"); setSize(350, 200); setVisible(true); } public void paint(Graphics g) { g.drawString("Following is the list of Logical font names supported by Java:", 40, 50); // to obtain the font list Toolkit tk = Toolkit.getDefaultToolkit(); String names[] = tk.getFontList(); for(int i=0, y=85; i < names.length; i++, y += 20) { g.drawString(names[i], 60, y); } } public static void main(String args[]) { new JavaFontNames(); } }
Output screen JavaFontNames.java of class Toolkit Get Font List
Toolkit tk = Toolkit.getDefaultToolkit(); String names[] = tk.getFontList();
Toolkit is an abstract class and its object cannot be created directly. We require a factory method to do the job. The factory method here is getDefaultToolkit() which returns an object of Toolkit class. Now tk works like an object for all practical purposes. With tk, we can call all the methods of Toolkit class.
Similarly you can get color components information by using Color class methods. | https://way2java.com/awt-graphics-in-java/class-toolkit-get-font-list/ | CC-MAIN-2020-40 | refinedweb | 242 | 59.09 |
The Biopython Project is an international association of developers of freely available Python () tools for computational molecular biology. The web site provides an online resource for modules, scripts, and web links for developers of Python-based software for life science research. ().
Seqobject missing the (back) transcription & translation methods described in this Tutorial?
Bio.Seqmodule functions described in Section 3.13.
Seqobject translation method support the
cdsoption described in this Tutorial?
Bio.SeqIOwork? It imports fine but there is no parse function etc.
Bio.SeqIOname which has since been removed - and this is why the import “works”.
Bio.SeqIO.read()work? The module imports fine but there is no read function!
Bio.AlignIOpresent? The module import fails!
Bio.SeqIOand
Bio.AlignIOread and write?
Bio.SeqIOand
Bio.AlignIOinput functions let me provide a sequence alphabet?
str(...)give me the full sequence of a
Seqobject?
str(my_seq), use
my_seq.tostring()(which will also work on recent versions of Biopython).
Bio.Blastwork with the latest plain text NCBI blast output?
Bio.Entrez.read()work? The module imports fine but there is no read function!
Bio.PDB.MMCIFParserwork? I see an import error about
MMCIFlex
Bio.PDB.mmCIF.MMCIFlexmodule has not been installed by default. It requires a third party tool called flex (fast lexical analyzer generator). At the time of writing, you’ll have install flex, then tweak your Biopython
setup.pyfile and reinstall from source.
Bio.Blast.NCBIXML.read()work? The module imports but there is no read function!
SeqRecordobject have a
letter_annotationsattribute?
SeqRecordto get a sub-record?
_ 14, this has some cools tricks and tips), the Advanced section (Chapter 16), 8, extract data from Swiss-Prot from certain orchid proteins in Chapter 9, and work with ClustalW multiple sequence alignments of orchid proteins in Section 6 repr(seq_record.seq) print len(seq_record) handle.close() 14 14),GATGGGCCTATATAGGATCGAAAATCGC", IUPAC.unambiguous_dna) for index, letter in enumerate(my_seq) : print index, letter print len(letter)
You can access elements of the sequence in the same way as for strings (but remember, Python counts from zero!):
>>> print my_seq[0] #first letter >>> print my_seq[2] #third letter >>> print my_seq[-1] #last letter
The
Seq object has a
.count() method, just like a string.
Note that this means that like a Python string, this gives a
non-overlapping count:
>>> "AAAA".count("AA") 2 >>> Seq("AAAA").count("AA") 2
For some biological uses, you may actually want an overlapping count (i.e. 3 in this trivial example). When searching for single letters, this makes no difference:
>>> len(my_seq) 32 >>> my_seq.count("G").11 with a print statement:
>>>.
NOTE: If you are using Biopython 1.44 or older, using
str(my_seq)
will give just a truncated representation. Instead use
my_seq.tostring()
(which is still available in the current Biopython releases for backwards compatibility):
>>> my_seq.tostring() :
>>> protein_seq + dna_seq Traceback (most recent call last): ... TypeError: ('incompatable alphabets', 'IUPACProtein()', () ... ValueError: Proteins do not have complements!
The example in Section 5.4.2 combines the
Seq
object’s reverse complement method with
Bio.SeqIO for sequence input/ouput.
are new in Biopython 1.49. For older releases you would have to use the
Bio.Seq
module’s functions instead, see Section 3 14.1.2 combines the
Seq object’s
translate method with
Bio.SeqIO for sequence input/ouput.
Note: The
Seq object’s
translate method is new in Biopython 1.49.
For older releases you would have to use the
Bio.Seq module’s
translate
function instead, see Section 3.13. The cds option
is new in Biopython 1.51, and there is no simple way to do this with older versions
of Biopython.
In the previous sections we talked about the
Seq object translation method (and mentioned the equivalent function in the
Bio.Seq module – see
Section 3.unambiguous.
So, what does Biopython do? Well, the equality test is the default for Python objects – it tests to see if they are the same object in memory. This is a very strict test:
>>> from Bio.Seq import Seq >>> from Bio.Alphabet import IUPAC >>> seq1 = Seq("ACGT", IUPAC.unambiguous_dna) >>> seq2 = Seq("ACGT", IUPAC.unambiguous_dna) >>>) >>> my_seq[5] = "G" Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'Seq' instance has no attribute '__setitem__'] = "T" >>> mutable_seq MutableSeq('GCCATTGTAATGGGCCGCTGAAAGGGTGCCCGA', IUPACUnambiguousDNA()) >>> mutable_seq.remove("T") >>> mutable_seq MutableSeq('GCCATGTAATGGGCCGCTGAAAGGGTGCCCGA', IUPACUnambiguousDNA()) >>> mutable_seq.reverse() >>> mutable_seq MutableSeq('AGCCCGTGGGAAAGTCGCCGGGTAATGTGTACCG', IUPACUnambiguousDNA())
You can also get a string from a
MutableSeq object just like from a
Seq object (Section 3.4).
Biopython 1.50 introduced another basic sequence object, the
UnknownSeq object.
This to be associated with the sequence, and is used thoughout object in this chapter, you may also want to read the
SeqRecord wiki page (), and the built in documentation (also online):
>>> stored as attributes of the class. Usually you won’t create a
SeqRecord “by hand”, but instead use
Bio.SeqIO to read in a sequence file for you (see Chapter 5 and the examples below). However, creating
SeqRecord can be quite simple -(open( first level of dealing with sequence features is the
SeqFeature class itself. This class has a number of attributes, so first we’ll list them and their general features, and then work through an example to show how this applies to a real life example, a GenBank feature table. The attributes of a SeqFeature are:
SeqFeatureon the sequence that you are dealing with. The locations end-points may be fuzzy – section 4.3.2 has a lot more description on how to deal with descriptions.
refto provide a cross sequence reference. If there is a reference,
ref_dbwill be set as None if the reference is in the same database, and will be set to the name of the database otherwise.
sub_featuresunderneath it. This allows nesting of features, and helps us to deal with things such as the GenBank/EMBL feature lines in a (we hope) intuitive way.
To show an example of SeqFeatures in action, let’s take a look at the following feature from a GenBank feature table:
mRNA complement(join(<49223..49300,49780..>50208)) /gene="F28B23.12"
To look at the easiest attributes of the
SeqFeature first, if you got a
SeqFeature object for this it would have it
type of ’mRNA’, a
strand of -1 (due to the ‘complement’), and would have None for the
ref and
ref_db since there are no references to external databases. The
qualifiers for this SeqFeature would be a Python dictionarary that looked like
{'gene' : ['F28B23.12']}.
Now let’s look at the more tricky part, how the ‘join’ in the location
line is handled. First, the location for the top level
SeqFeature (the
one we are dealing with right now) is set as going from
`<49223' to `>50208' (see section 4.3.2 for
the nitty gritty on how fuzzy locations like this are handled).
So the location of the top level object is the entire span of the
feature. So, how do you get at the information in the ‘join’?
Well, that’s where the
sub_features go in.
The
sub_features attribute will have a list with two
SeqFeature
objects in it, and these contain the information in the join. Let’s
look at
top_level_feature.sub_features[0] (the first
sub_feature). This object is a
SeqFeature object with a
type of ‘
mRNA,’ a
strand of -1 (inherited
from the parent
SeqFeature) and a location going from
'<49223' to '49300'.
So, the
sub_features allow you to get at the internal information if you want it (i. e. if you were trying to get only the exons out of a genomic sequence), or just to deal with the broad picture (i. e. you just want to know that the coding sequence for a gene lies in a region). Hopefully this structuring makes it easy and intuitive to get at the sometimes complex information that can be contained in a
SeqFeature.
In the section on SeqFeatures above, we skipped over one of the more difficult parts of features, dealing with the locations. The reason this can be difficult is because of fuzziness of the positions in locations. Before we get into all of this, let’s just define the vocabulary we’ll use to talk about this. Basically there are two terms we’ll use:
<100and
3^5are all positions.
I just mention this because sometimes I get confused between the two.
The complication in dealing with five types of fuzzy positions, so we have five classes do deal with them:
positionattribute of the object.
`<13', signifying that the real position is located somewhere less then.
`2^3', which indicates that the real position happens between position 2 and 3. Getting this information from the object is very similar to
WithinPosition, the
positionattribute specifies the lower boundary (2, in this case) and the
extensionindicates the range to the higher boundary (1 in this case).
Now that we’ve got all of the types of fuzzy positions we can have taken care of, we are ready to actually specify a location on a sequence. This is handled by the
FeatureLocation class. An object of this type basically just holds the potentially fuzzy start and end positions of a feature. You can create a
FeatureLocation object by creating the positions and passing them in:
>>> from Bio import SeqFeature >>> start_pos = SeqFeature.AfterPosition(5) >>> end_pos = SeqFeature.BetweenPosition(8, 1) >>> my_location = SeqFeature.FeatureLocation(start_pos, end_pos)
If you print out a
FeatureLocation object, you can get a nice representation of the information:
>>> print my_location [>5:(8^9)]
We can access the fuzzy start and end positions using the start and end attributes of the location:
>>> my_location.start Bio.SeqFeature.AfterPosition(5) >>> print my_location.start >5 >>> my_location.end Bio.SeqFeature.BetweenPosition(8,1) >>> print my_location.end (8^9)
If you don’t want to deal with fuzzy positions and just want numbers, you just need to ask for the
nofuzzy_start and
nofuzzy_end attributes of the location:
>>> my_location.nofuzzy_start 5 >>> my_location.nofuzzy_end 8
Notice that this just gives you back the position attributes of the fuzzy locations.
Similary, to make it easy to create a position without worrying about fuzzy positions, you can just pass in numbers to the
FeaturePosition constructors, and you’ll get back out
ExactPosition objects:
>>> exact_location = SeqFeature.FeatureLocation(5, 8) >>> print exact_location [5:8] >>> exact_location.start Bio.SeqFeature.ExactPosition(5) >>> exact_location.nofuzzy_start 5
That is all of the nitty gritty about dealing with fuzzy positions in Biopython. It has been designed so that dealing with fuzziness is not that much more complicated than dealing with exact positions, and hopefully you find that true!.
Biopython 1.48 added a new
format() method to the
SeqRecord class which.4.3.
One of the new features in Biopython 1.50 was the ability) 29[11] type: gene location: [4342:4780] ref: None:None strand: 1 qualifiers: Key: db_xref, Value: ['GeneID:2767712'] Key: gene, Value: ['pim'] Key: locus_tag, Value: ['YP_pPCP05'] >>> print record.features[12] type: CDS location: [4342:4780]] ref: None:None strand: 1 qualifiers: Key: db_xref, Value: ['GeneID:2767712'] Key: gene, Value: ['pim'] Key: locus_tag, Value: ['YP_pPCP05'] >>> print sub_record.features[1] type: CDS location: [42:480] Section 14.1.4 for a FASTQ example where the per-letter annotations (the read quality scores) are also sliced.:
As of Biopython 1.49 Biopython 1.45 introduced seq_record.seq print len(seq_record) handle.close() >>> handle = open("ls_orchid.gbk") >>> identifiers = [seq_record.id for seq_record in SeqIO.parse(handle, "genbank")] >>> handle.close() >>> identifiers ['Z78533.1', 'Z78532.1', 'Z78531.1', 'Z78530.1', 'Z78529.1', 'Z78527.1', ..., 'Z78439.1']
There are more examples using
SeqIO.parse() in a list
comprehension like this in Section 14() method of an iterator to step through the entries, like this:
from Bio import SeqIO handle = open("ls_orchid.fasta") record_iterator = SeqIO.parse(handle, "fasta") first_record = record_iterator.next() print first_record.id print first_record.description second_record = record_iterator.next() print second_record.id print second_record.description handle.close()
Note that if you try and use
.next() and there are no more results, you’ll either get back the special Python object
None or a
StopIteration exception.
One special case to consider is when your sequence files have multiple records, but you only want the first one. In this situation the following code is very concise:
from Bio import SeqIO first_record = SeqIO.parse(open("ls_orchid.gbk"), "genbank").next()
A word of warning here – using the
.next() method handle = open("ls_orchid.gbk") records = list(SeqIO.parse(handle, "genbank")) handle.close()(open("ls_orchid.gbk"), "genbank") first_record = record_iterator.next() handle = open("ls_orchid.gbk") all_species = [] for seq_record in SeqIO.parse(handle, "genbank") : all_species.append(seq_record.annotations["organism"]) handle.close() print all_species
Another way of writing this code is to use a list comprehension:
from Bio import SeqIO all_species = [seq_record.annotations["organism"] for seq_record in \ SeqIO.parse(open( handle = open("ls_orchid.fasta") all_species = [] for seq_record in SeqIO.parse(handle, "fasta") : all_species.append(seq_record.description.split()[1]) handle.close()(open( handle. We hinted that handles are not always from files, and in this section we’ll use handles to internet connections to download sequences.
Note that just because you can download sequence data and parse it into
a
SeqRecord object in one go doesn’t mean this is a good idea.
In general, you should probably download sequences once and save them to
a file for reuse.
Section 8.6 talks about the Entrez EFetch interface in more detail, but for now let’s just connect to the NCBI and get a few Opuntia (prickly-pear) proteins handle = Entrez.efetch(db="protein", rettype="fasta", id="6273291") seq_record = SeqIO.read(handle, "fasta") handle.close() print "%s with %i features" % (seq_record.id, len(seq_record.features))
Expected output:
gi|6273291|gb|AF191665.1|AF191665 with 3 features
The NCBI will also let you ask for the file in other formats, in particular as a GenBank file:
from Bio import Entrez from Bio import SeqIO handle = Entrez.efetch(db="nucleotide", rettype="gb",
Now let’s fetch several records. This time the handle contains multiple records,
so we must use the
Bio.SeqIO.parse() function:
from Bio import Entrez from Bio import SeqIO handle = Entrez.efetch(db="nucleotide", rettype="gb", \ 8 for more about the
Bio.Entrez module, and make sure to read about the NCBI guidelines for using Entrez (Section 8.1).
Now let’s use a handle to download a SwissProt file from ExPASy,
something covered in more depth in Chapter']
The next thing that we’ll do with our ubiquitous orchid files is to show how to index them and access them like a database using the Python
dictionary data type (like a hash in Perl). This is very useful for large files where you only need to access certain elements of the file, and makes for a nice quick ’n dirty database.
You can use the function
Bio.SeqIO.to_dict() to make a SeqRecord dictionary (in memory). By default this will use each record’s identifier (i.e. the
.id attribute) as the key. Let’s try this using our GenBank file:
from Bio import SeqIO handle = open("ls_orchid.gbk") orchid_dict = SeqIO.to_dict(SeqIO.parse(handle, "genbank")) handle.close()
Since this variable
orchid_dict is an ordinary Python dictionary, we can look at all of the keys we have available:
>>> print orchid_dict.keys() ['Z78484.1', 'Z78464.1', 'Z78455.1', 'Z78442.1', 'Z78532.1', 'Z78453.1', ..., 'Z78471.1'] handle = open("ls_orchid.fasta") orchid_dict = SeqIO.to_dict(SeqIO.parse(handle, "fasta")) handle.close() handle = open("ls_orchid.fasta") orchid_dict = SeqIO.to_dict(SeqIO.parse(handle, "fasta"), key_function=get_accession) handle.close()(open(
That should have retrieved the record Z78532.1, the second entry in the file.
We’ve talked about using
Bio.SeqIO.parse() for sequence input (reading files), and now we’ll look at
Bio.SeqIO.write() which is for sequence output (writing files). This is a function taking three arguments: some
SeqRecord objects, a handle handle = open("my_example.faa", "w") SeqIO.write(my_records, handle, "fasta") handle.close(). Therefore as of Biopython 1.49, the
Bio.SeqIO.write() function returns the number of
SeqRecord objects written to the file.
In previous example we used a list of
SeqRecord objects as input to the
Bio.SeqIO.write() function, but it will also accept a
SeqRecord iterator like we get from
Bio.SeqIO.parse() – this lets us do file conversion very succinctly. For this example we’ll read in the GenBank format file ls_orchid.gbk and write it out in FASTA format:
from Bio import SeqIO in_handle = open("ls_orchid.gbk", "r") out_handle = open("my_example.fasta", "w") records = SeqIO.parse(in_handle, "genbank") SeqIO.write(records, out_handle, "fasta") in_handle.close() out_handle.close() Section 14.1.5 in the cookbook chapter which looks at inter-converting between different FASTQ formats.
You can simplify this by being lazy about closing the input file handles. This is arguably bad style, but it is more concise. Note that you should always close your outfile file handles as if you don’t, your file may not get flushed to disk immediately.
Alternatively, Python 2.6 includes
with as a new keyword (which can
also be enabled on Python 2.5):
from __future__ import with_statement #Needed on Python 2.5 from Bio import SeqIO with in_handle = open("ls_orchid.gbk") : with out_handle = open("my_example.fasta", "w") : SeqIO.write(SeqIO.parse(in_handle, "genbank"), out_handle, "fasta")
Behind the scenes this will automatically close the handle handles
(because the file objects are aware of the
with statement)..6):
from Bio import SeqIO in_handle = open("ls_orchid.gbk") for record in SeqIO.parse(in_handle, "genbank") : print record.id print record.seq.reverse_complement() in_handle.close()
Now, if we want to save these reverse complements to a file, we’ll need to make
SeqRecord objects.
For this I think its most elegant to write our own function, where we can decide how to name our
new records:
from Bio.SeqRecord import SeqRecord def make_rc_record(record) : """Returns a new SeqRecord with the reverse complement sequence.""" return SeqRecord(seq = record.seq.reverse_complement(), \ id = "rc_" + record.id, \ description = "reverse complement")
We can then use this to turn the input records into reverse complement records ready for output. If you don’t mind about having all the records in memory at once, then the Python
map() function is a very intuitive way of doing this:
from Bio import SeqIO in_handle = open("ls_orchid.fasta") records = map(make_rc_record, SeqIO.parse(in_handle, "fasta")) in_handle.close() out_handle = open("rev_comp.fasta", "w") SeqIO.write(records, out_handle, "fasta") out_handle.close()
This is an excellent place to demonstrate the power of list comprehensions which in their simplest are a long-winded equivalent to using
map(), like this:
records = [make_rc_record(rec) for rec in SeqIO.parse(in_handle, "fasta")]
Now list comprehensions have a nice trick up their sleeves, you can add a conditional statement:
records = [make_rc_record(rec) for rec in SeqIO.parse(in_handle, "fasta") if len(rec)<700] = (make_rc_record(rec) for rec in SeqIO.parse(in_handle, "fasta") if len(rec)<700)
If you don’t mind being lax about closing input file handles, we have:
from Bio import SeqIO records = (make_rc_record(rec) for rec in \ SeqIO.parse(open("ls_orchid.fasta"), "fasta") \ if len(rec) < 700) out_handle = open("rev_comp.fasta", "w") SeqIO.write(records, out_handle, "fasta") out_handle.close()
There is a related example in Section 14.1.2,(open(, Biopython 1.48 added a new
format() method to the
SeqRecord class (see Section 4.5).
Note that although we don’t encourage it, you can use the
format() method to write to a file, like this:
from Bio import SeqIO record_iterator = SeqIO.parse(open("ls_orchid.gbk"), "genbank") out_handle = open("ls_orchid.tab", "w") for record in record_iterator : out_handle.write(record.format("tab")) out_handle.close()
While this style of code will work for a simple sequential file format like FASTA or the simple tab separated format used in this example, it will not work for more complex or interlaced file formats. This is why we still recommend using
Bio.SeqIO.write(), as in the following example:
from Bio import SeqIO record_iterator = SeqIO.parse(open("ls_orchid.gbk"), "genbank") out_handle = open("ls_orchid.tab", "w") SeqIO.write(record_iterator, out_handle, "tab") out_handle.close()
In this chapter we’ll discuss the
Bio.AlignIO module, which is very similar to the
Bio.SeqIO module from the previous chapter, but deals with
Alignment objects rather than
SeqRecord objects.
This aims to provide a simple interface for working with assorted sequence alignment file formats in a uniform way.
Alignment
Alignment.
Biopython 1.49 introduced as a compressed archive from. We can load this file as follows (assuming it has been saved to disk as “PF05371_seed.sth” in the current working directory):
from Bio import AlignIO alignment = AlignIO.read(open("PF05371_seed.sth"), "stockholm") print alignment
This code will print out a summary of the(open("PF05371_seed.sth"), "stockholm") print "Alignment length %i" % alignment.get_alignment_length() for record in alignment : print "%s - %s" % (record.seq, record.id)
This will give the following output:
Alignment length 52 record.id, record.dbxrefs
giving:(open((open((open(
Alignment objects, a handle to write to, and a sequence format.
Here is an example, where we start by creating a few
Alignment objects the hard way (by hand, rather than by loading them from a file):
from Bio.Align.Generic import Alignment from Bio.Alphabet import IUPAC, Gapped alphabet = Gapped(IUPAC.unambiguous_dna) align1 = Alignment(alphabet) align1.add_sequence("Alpha", "ACTGCTAGCTAG") align1.add_sequence("Beta", "ACT-CTAGCTAG") align1.add_sequence("Gamma", "ACTGCTAGDTAG") align2 = Alignment(alphabet) align2.add_sequence("Delta", "GTCAGC-AG") align2.add_sequence("Epislon","GACAGCTAG") align2.add_sequence("Zeta", "GTCAGCTAG") align3 = Alignment(alphabet) align3.add_sequence("Eta", "ACTAGTACAGCTG") align3.add_sequence("Theta", "ACTAGTACAGCT-") align3.add_sequence("Iota", "-CTACTACAGGTG") my_alignments = [align1, align2, align3]
Now we have a list of
Alignment objects, we’ll write them to a PHYLIP format file:
from Bio import AlignIO handle = open("my_example.phy", "w") SeqIO.write(my_alignments, handle, "phylip") handle.close() as of Biopython 1.49, the
Bio.AlignIO.write() function returns the number of alignments written to the file.
Converting between sequence alignment file formats with
Bio.AlignIO works in the same way as converting between sequence file formats with
Bio.SeqIO – we load generally the alignment(s) using
Bio.AlignIO.parse() and then save them using the
Bio.AlignIO.write().
For this example, we’ll load the PFAM/Stockholm format file used earlier and save it as a Clustal W format file:
from Bio import AlignIO alignments = AlignIO.parse(open("PF05371_seed.sth"), "stockholm") handle = open("PF05371_seed.aln","w") AlignIO.write(alignments, handle, "clustal") handle.close()(open("PF05371_seed.sth"), "stockholm") handle = open("PF05371_seed.aln","w") AlignIO.write([alignment], handle, "clustal") handle.close() alignment = AlignIO.read(open("PF05371_seed.sth"), "stockholm") handle = open("PF05371_seed.phy","w") AlignIO.write([alignment], handle, "phylip") handle.close() PHYLIP alignment file format is that the sequence identifiers are strictly truncated at ten characters. In this example, as you can see the resulting names are still unique - but they are not very readable. In this particular case, there is no clear way to compress the identifers, but for the sake of argument you may want to assign your own names or numbering system. This following bit of code manipulates the record identifiers before saving the output:
from Bio import AlignIO alignment = AlignIO.read(open("PF05371_seed.sth"), "stockholm") name_mapping = {} for i, record in enumerate(alignment) : name_mapping[i] = record.id record.id = "seq%i" % i print name_mapping handle = open("PF05371_seed.phy","w") AlignIO.write([alignment], handle, "phylip") handle.close() new
format() method added to the
Alignment object in Biopython 1.48. This takes a single mandatory argument, a lower case string which is supported by
Bio.AlignIO as an output format. For example:
from Bio import AlignIO alignment = AlignIO.read(open((open("PF05371_seed.sth"), "stockholm") out_handle = StringIO() AlignIO.write(alignments, out_handle, "clustal") clustal_data = out_handle.getvalue() print clustal_data.3.5.
We won’t explore all these alignment tools here in the section, just a
sample, but the same principles apply.
ClustalW is a popular command line tool for multiple sequence alignment
(there is also a graphical interface called ClustlX). Biopython’s
Bio.Align.Applications module has a wrapper for this (and several
other alignment tools).. You can also tell Biopython the full path to the tool, for example:
>>> import os >>> from Bio.Align.Applications import ClustalwCommandline >>> clustalw_exe = r"C:\Program Files\new clustal\clustalw2.exe" >>> assert os.path.isfile(clustalw_exe), "Clustal W executable missing" >>> cline = ClustalwCommandline(clustalw_exe, infile="opuntia.fasta")
Remember in Python that for a default string
\n or
\t
means a new line or a tab – which is why we’re put a letter “r” at the
start for a raw string. This is generally good practice when specifying a
Windows style file name.
You can now run this command line, perhaps using the Python
subprocess
module, or maybe just with our
generic_run function.
This returns three things. First, a result object
includes the return code, an integer value which by convention is zero when
successful (check the documentation for particular tools about what return
codes they might use). Then, two handles which contain the “standard out”
(stdout) and “standard error” (stderr) text from the tool. These terms
originate in Unix, and are general the results from the program and any
progress or error messages.
>>> from Bio.Application import generic_run >>> result, out_handle, err_handle = generic_run(cline) >>> print result.return_code 0 >>> print err_handle.read() >>> print out_handle.read() ...
If you do print out the handles, you’ll see all the voluminous text that ClustalW likes to print as it is working – pages of stuff! There isn’t much of interest here (unless it fails in which case any error messages could be informative!).
What we care about are the two output files, the alignment and the guide
tree. You should be able to work out how to read in the alignment using
Bio.AlignIO by now:
>>> from Bio import AlignIO >>> align = AlignIO.read(open(.Nexus can parse these. You can either parse
the file directly (as though it were a light weight NEXUS file), or just go
directly to a tree object:
>>> from Bio.Nexus import Trees >>> tree_string = open("opuntia.dnd").read() >>> tree = Trees.Tree(tree_string) >>> print tree tree a)); >>> print tree.display() # taxon prev succ brlen blen (sum) support comment 0 - None [1, 6, 9] 0.0 0.0 - - 1 - 0 [2, 3] 0.0077 0.0077 - - 2 gi|6273291|gb|AF191665.1|AF191665 1 [] 0.00418 0.01188 - - 3 - 1 [4, 5] 0.00083 0.00853 - - 4 gi|6273290|gb|AF191664.1|AF191664 3 [] 0.00189 0.01042 - - 5 gi|6273289|gb|AF191663.1|AF191663 3 [] 0.00145 0.00998 - - 6 - 0 [7, 8] 0.00014 0.00014 - - 7 gi|6273287|gb|AF191661.1|AF191661 6 [] 0.00489 0.00503 - - 8 gi|6273286|gb|AF191660.1|AF191660 6 [] 0.00295 0.00309 - - 9 - 0 [10, 11] 0.00125 0.00125 - - 10 gi|6273285|gb|AF191659.1|AF191659 9 [] 0.00094 0.00219 - - 11 gi|6273284|gb|AF191658.1|AF191658 9 [] 0.00018 0.00143 - - Root: 0 None
The spacing has been adjusted here for display purposes. The tree object is actuall pretty powerful! Have a look at the list of methods with dir(tree) to get a hint of this....txt .txt -clwstrict:
>>> from Bio.Align.Applications import MuscleCommandline >>> help(MuscleCommandline)
You might run simple MUSCLE command line string as described above for
ClustalW, or opt to use the
subprocess module. >>> cline = MuscleCommandline(input="opuntia.fasta") >>> print cline muscle -in opuntia.fasta
Now, let’s run this can capture the output as handles:
>>> from Bio.Application import generic_run >>> result, out_handle, err_handle = generic_run(cline) >>> print result.return_code 0
Remember, a return code of zero is good – by convention this means no errors. Finally, the output handle should contain our alignment in the default FASTA format:
>>> from Bio import AlignIO >>> align = AlignIO.read(out_handle, !
At this point the limitations of the helper function
generic_run become
apparent, so we’ll switch to the Python
subprocess module for full control.(open( >>> cline = MuscleCommandline(clwstrict=True) >>> print cline muscle -clwstrict
Now comes the clever bit using the
subprocess module:
>>> import subprocess >>> import sys >>> child = subprocess.Popen(str(cline), ... stdin=subprocess.PIPE, ... stdout=subprocess.PIPE, ... stderr=subprocess.PIPE, ... this style of programming is much more complicated. It also becomes far harder to diagnose problems, because you can’t try running MUSCLE manually outside of Biopython (because you don’t have the input file to supply). There can also be subtle cross platform issues (e.g. Windows versus Linux), and how you run your script can have in impact (e.g. at the command line, from IDLE or an IDE, or as a GUI script). These are all generic Python issues though, and not specific to Biopython. >>> cline = NeedleCommandline(>> cline.>> cline.gapopen=10 >>> cline.gapextend=0.5 >>> cline.>> print cline needle -outfile=needle.txt -asequence=alpha.faa -bsequence=beta.faa -gapopen=10 -gapextend=0.5 >>> print cline.outfile needle.txt
Next we want to use Python to run this command for us. As explained above, for full control, we recommend you use the built in Python subprocess module. However, for simple usage Biopython includes a wrapper function that usually suffices:
>>> from Bio.Application import generic_run >>> result, out_handle, err_handle = generic_run(cline) >>> print err_handle.read() Needleman-Wunsch global alignment of two sequences >>> print out_handle.read() >>> print result.return_code 0
In the above, all we really care about is that the return code is zero
(success). Then we can load the output file with
Bio.AlignIO as
discussed earlier in this chapter, as the emboss format:
>>> from Bio import AlignIO >>> align = AlignIO.read(open(), and also read the input from stdin (just. We’ll start by talking about running the BLAST command line tools locally, and then discuss running BLAST via the web.
Running BLAST locally (as opposed to over the internet, see Section 7.2) has two advantages:
Dealing with proprietary or unpublished sequence data can be another reason to run BLAST locally. You may not be allowed to redistribute the sequences, so submitting them to the NCBI as a BLAST query would not be an option.
Biopython provides lots of nice code to enable you to call local BLAST executables from your scripts, and have full access to the many command line options that these executables provide. You can obtain local BLAST precompiled for a number of platforms at, or can compile it yourself in the NCBI toolbox ().
The code for calling local “standalone” BLAST is found in
Bio.Blast.NCBIStandalone, specifically the functions
blastall,
blastpgp and
rpsblast, which correspond with the BLAST executables that their names imply.
Let’s use these functions to run
blastall against a local database and return the results. First, we want to set up the paths to everything that we’ll need to do the BLAST. What we need to know is the path to the database (which should have been prepared using
formatdb, see) to search against, the path to the file we want to search, and the path to the
blastall executable.
On Linux or Mac OS X your paths might look like this:
>>> my_blast_db = "/home/mdehoon/Data/Genomes/Databases/bsubtilis" # I used formatdb to create a BLAST database named bsubtilis # (for Bacillus subtilis) consisting of the following three files: # /home/mdehoon/Data/Genomes/Databases/bsubtilis.nhr # /home/mdehoon/Data/Genomes/Databases/bsubtilis.nin # /home/mdehoon/Data/Genomes/Databases/bsubtilis.nsq >>> my_blast_file = "m_cold.fasta" # A FASTA file with the sequence I want to BLAST >>> my_blast_exe = "/usr/local/blast/bin/blastall" # The name of my BLAST executable
while on Windows you might have something like this:
>>> my_blast_db = r"C:\Blast\Data\bsubtilis" # Assuming you used formatdb to create a BLAST database named bsubtilis # (for Bacillus subtilis) consisting of the following three files: # C:\Blast\Data\bsubtilis\bsubtilis.nhr # C:\Blast\Data\bsubtilis\bsubtilis.nin # C:\Blast\Data\bsubtilis\bsubtilis.nsq >>>>> my_blast_exe =r"C:\Blast\bin\blastall.exe"
The FASTA file used in this example is available here as well as online.
Now that we’ve got that all set, we are ready to run the BLAST and collect the results. We can do this with two lines:
>>> from Bio.Blast import NCBIStandalone >>> result_handle, error_handle = NCBIStandalone.blastall(my_blast_exe, "blastn", my_blast_db, my_blast_file)
Note that the Biopython interfaces to local blast programs returns two values. The first is a handle to the blast output, which is ready to either be saved or passed to a parser. The second is the possible error output generated by the blast command. See Section 18.1 for more about handles.
The error info can be hard to deal with, because if you try to do a
error_handle.read() and there was no error info returned, then the
read() call will block and not return, locking your script. In my opinion, the best way to deal with the error is only to print it out if you are not getting
result_handle results to be parsed, but otherwise to leave it alone.
This command will generate BLAST output in XML format, as that is the format expected by the XML parser, described in Section 7.4. For plain text output, use the
align_view="0" keyword. To parse text output instead of XML output, see Section 7.6 below. However, parsing text output is not recommended, as the BLAST plain text output changes frequently, breaking our parsers.
If you are interested in saving your results to a file before parsing them, see Section 7.3. To find out how to parse the BLAST results, go to Section 7.4.4 below.
expectsets the expectation or e-value threshold.
For more about the optional BLAST arguments, we refer you to the NCBI’s own documentation, or that built into Biopython:
>>> from Bio.Blast import NCBIWWW >>> help(NCBI)
For example, if you have a nucleotide sequence you want to search against the non-redundant database using BLASTN, and you know the GI number of your query sequence, you can use:
>>> from Bio.Blast import NCBIWWW >>> result_handle = NCBI("blastn", "nr", fasta_string)
We could also have read in the FASTA file as a
SeqRecord and then
supplied just the sequence itself:
>>> from Bio.Blast import NCBIWWW >>> from Bio import SeqIO >>> record = SeqIO.read(open("m_cold.fasta"), format="fasta") >>> result_handle = NCBI("blastn", "n(open("m_cold.fasta"), format="fasta") >>> result_handle = NCBI("blastn", "n.4),
but you might want to save a local copy of the output file first.
Before parsing the results, it is often useful to save them into a file so that you can use them later without having to go back and re-blasting everything. I find this especially useful when debugging my code that extracts info from the BLAST files, but it could also be useful just for making backups of things you’ve done.
If you don’t want to save the BLAST output, you can skip to section 7.4. If you do, read on.
We need to be a bit careful since we can use
result_handle.read() to
read the BLAST output only once – calling
result_handle.read() again
returns an empty string. First, we use
read() and store all of
the information from the handle into a string:
>>> blast_results = result_handle.read()
Next, we save this string in a file:
>>> save_file = open("my_blast.xml", "w") >>> save_file.write(blast_results) >>> save_file.close()
After doing this, the results are in the file
my_blast.xml and the
variable
blast_results contains the BLAST results in a string
form. However, the
parse function of the BLAST parser (described
in 7.4) takes a file-handle-like object, not a
plain string. To get a handle, there are two things you can do:
cStringIO. The following code will turn the plain string into a handle, which we can feed directly into the BLAST parser:
>>> import cStringIO >>> result_handle = cStringIO.StringIO(blast_results)
>>> result_handle = open("my_blast.xml")
Now that we’ve got the BLAST results back into a handle again, we are ready to do something with them, so this leads us right into the parsing section.
As mentioned above, BLAST can generate output in various formats, such as XML, HTML, and plain text. Originally, Biopython had a parser for BLAST plain text and HTML output, as these were the only output formats supported by BLAST. Unfortunately, the BLAST output in these formats kept changing, each time breaking the Biopython parsers..
Though deprecated, the parsers for BLAST output in plain text or HTML output are still available in Biopython (see Section 7.6). Use them at your own risk: they may or may not work, depending on which BLAST version you’re using.. This is the type
of input the BLAST parser (and most other Biopython parsers) take.
Alignment = blast_records.next() # ... do something with blast_record >>> blast_record = blast_records.next() # ... do something with blast_record >>> blast_record = blast_records.next() # ... do something with blast_record >>> blast_record = blast_records.next() = blast_records.next().5.
The PSIBlast record object is similar, but has support for the rounds that are used in the iteration steps of PSIBlast. The class diagram for PSIBlast is shown in Figure 7.4.
The HTML parser in
Bio.Blast.NCBIWWW has been officially deprecated
and will issue warnings if you try and use it. We plan to remove this
completely in a few releases time.
Our plain text BLAST parser works a bit better, but use it at your own risk. It may or may not work, depending on which BLAST versions or programs you’re using. = blast_iterator.next() = iterator.next() ... except NCBIStandalone.LowQualityBlastError, info: ... print "LowQualityBlastError detected in id %s" % info[1]
The
.next() method verion of PSI-BLAST (the command line tool
blastpgp) using the
blastpgp function in the
Bio.Blast.NCBIStandalone verion of RPS-BLAST (the command line tool
rpsblast) using the
rpsblast function in the
Bio.Blast.NCBIStandalone module.
At the time of writing, the NCBI do not appear to support tools running an
RPS-BLAST search via the internet.
You can use the
Bio.Blast.NCBIXML parser to read the XML output from
current versions of RPS-BLAST. give an error message showing which DTD file is missing.
You can download the DTD file from NCBI; most can be found at or.
After downloading, the DTD file should be stored in the directory
...site-packages/Bio/Entrez/DTDs, containing the other DTD files. 8.10. 14 notes), which can be retrieved by EFetch (see section 8.6).
You can also use ESearch to search GenBank. Here we’ll do a quick search for the matK gene in Cypripedioideae orchids (see the Section 8.
From the Cypripedioideae example above, we can download GenBank record 186972394 using
Bio.Entrez.efetch (see the documentation on
EFetch for Sequence and other Molecular Biology Databases):
>>> from Bio import Entrez >>> Entrez.email = "A.N.Other@example.com" # Always tell NCBI who you are >>> handle = Entrez.efetch(db="nucleotide", id="186972394", rettype="gb") >>> argument
rettype="gb" lets us download this record in the GenBank format.
Note that until Easter 2009, the Entrez EFetch API let you use “genbank” as the
return type, however the NCBI now insist on using the official return types of
“gb” (or “gp” for proteins) as described on online.
Alternatively, you could for example use
rettype="fasta" to get the Fasta-format; see the EFetch Sequences Help page for other options. in particular) : print "Downloading..." net_handle = Entrez.efetch(db="nucleotide",id="186972394",rettype="gb") out_handle = open(filename, "w") out_handle.write(net_handle.read()) out_handle.close() net_handle.close() print "Saved" print "Parsing..." record = SeqIO.read(open'
If you want to perform a search with
Bio.Entrez.esearch(), and then download the records with
Bio.Entrez.efetch(), you should use the WebEnv history feature – see Section 8.13.
ELink, available from Biopython as
Bio.Entrez.elink(), can be used to find related items in the NCBI Entrez databases. For example, let’s try to find articles related to the Biopython application note published in Bioinformatics in 2009. The PubMed ID of this article is 12230038. Now we use
Bio.Entrez.elink to find all related items to this article:
>>> from Bio import Entrez >>> Entrez.>>>> handle = Entrez.elink(dbfrom="pubmed", id=pmid) >>> record = Entrez.read(handle) >>> handle.close()-diveded 17316423, is about the Biopython PDB parser.
We can use a loop to print out all PubMed IDs:
>>> for link in record[0]["LinkSetDb"][0]['Link'] : ... print link ... {u'Id': '19304878'} {u'Id': '14630660'} {u'Id': '18689808'} {u'Id': '17121776'} {u'Id': '16377612'} {u'Id': '12368254'} ......
For help on ELink, see the ELink help page.
EGQuery provides counts for a search term in each of the Entrez databases. This is particularly useful to find out how many items your search terms would find in each database without actually performing lots of separate searches with ESearch (see the example in 8.12.2.1 and >>> input = open("pubmed_result1.txt") >>> record = Medline.read(input) >>> input = open("pubmed_result2.txt") >>> records = Medline.parse(input) >>> for record in records: ... post of these examples, for simplicity we have naively combined ESearch and EFetch. In this situation, the NCBI would expect you to use their history feature, as illustrated in Section 8 8["TI"] ... if "AU" in records: ... print "authors:", record["AU"] ... print "source:", record[']:
>>> print len(record["IdList"]) 814
Let’s look at the first five results:
>>> print 8.13.
>>> idlist = ",".join(record["IdList"][:5]) >>> print idlist 187237168,187372713,187372690,187372688,187372686 >>> handle = Entrez.efetch(db="nucleotide", id=idlist, retmode="xml") >>> records = Entrez.read(handle) >>> print 8.2.1.
For simplicity, this example does not take advantage of the WebEnv history feature – see Section 8 you have to supply a comma separated list of GI numbers to Entrez:
>>> gi_str = ",".join(gi_list) >>> handle = Entrez.efetch(db="nuccore", id=gi_str, rettype="gb") 8.1. In particular, please note that for simplicity, this example does not use the WebEnv history feature. You should use this for any non-trivial search and download work, see Section 8 8.12, its better 8.10.1 above, you can then use
Bio.Medline to parse the saved.2.2', 'Tracheophyta', 'Spermatophyta', 'Magnoliophyta', 'Liliopsida', 'Asparagales', 'Orchidaceae', 'Epidendroideae', 'higher Epidendroideae', 'Cymbidieae', 'Bromheadiinae', = records.next() >>> record.accession 'PS00001' >>> record.name 'ASN_GLYCOSYLATION' >>> record.pdoc 'PDOC00001' >>> record = records.next() >>> record.accession 'PS00004' >>> record.name 'CAMP_PHOSPHO_SITE' >>> record.pdoc 'PDOC00004' >>> record = records.next() >>> ... >>> print >>> handle = open("lipoprotein.txt") >>>["CC"] ['Hydrolyzes triacylglycerols in chylomicrons and very low-density lipoproteins (VLDL).', 'Also hydrolyzes diacylglycerol.'] >>> record["PR"] ['PDOC00110'] >>>
Biopython also allows you to explore the extensive realm of macromolecular structure. Biopython comes with a PDBParser class that produces a Structure object. The Structure object can be used to access the atomic data in the file in a convenient manner.
A macromolecular structure is represented using a structure, model chain, residue, atom (or SMCRA) hierarchy. The figure below shows a UML class diagram of the SMCRA data structure. 10 blanc hetero field, that its sequence identifier is 10 and that its insertion code is "A".
Some other useful methods:
# get the entity's id entity.get_id() # check if there is a child with a given id entity.has_id(entity_id) #.
A Structure object is produced by a PDBParser object:
from Bio.PDB.PDBParser import PDBParser p=PDBParser(PERMISSIVE=1) structure_id="1fat" filename="pdb1fat.ent" s=p.get_structure(structure_id, filename)
The PERMISSIVE flag indicates that a number of common problems (see 10.5.1) associated with PDB files will be ignored (but note that some atoms and/or residues will be missing). If the flag is not present a PDBConstructionException will be generated during the parse operation.
You can extract the header and trailer (simple lists of strings) of the PDB file from the PDBParser object with the get_header and get_trailer methods.
The id of the Model object is an integer, which is derived from the position of the model in the parsed file (they are automatically numbered starting from 0). The Model object stores a list of Chain children.
Get the first model from a Structure object.
first_model=structure[0]
The id of a Chain object is derived from the chain identifier in the structure file, and can be any string. Each Chain in a Model object has a unique id. The Chain object stores a list of Residue children.
Get the Chain object with identifier “A” from a Model object.
chain_A=model["A"]
Unsurprisingly, a Residue object stores a set of Atom children. In addition, it also contains a string that specifies the residue name (e.g. “ASN”) and the segment identifier of the residue (well known to X-PLOR users, but not used in the construction of the SMCRA data structure).
The id of a Residue object is composed of three parts: the hetero field (hetfield), the sequence identifier (resseq) and the insertion code (icode).
The hetero field is a string : it is “W” for waters, “H_” followed by the residue name (e.g. “H_FUC”) for other hetero residues and blank for standard amino and nucleic acids. This scheme is adopted for reasons described in section 10.3.1.
The second field in the Residue id is the sequence identifier, an integer describing the position of the residue in the chain.
The third field is a string, consisting of the insertion code. The insertion code is sometimes used to preserve a certain desirable residue numbering scheme. A Ser 80 insertion mutant (inserted e.g. between a Thr 80 and an Asn 81 residue) could e.g. have sequence identifiers and insertion codes as followed: Thr 80 A, Ser 80 B, Asn 81. In this way the residue numbering scheme stays in tune with that of the wild type structure.
Let’s give some examples. Asn 10 with a blank insertion code would have residue id (’’ ’’, 10, ’’ ’’). Water 10 would have residue id (‘‘W‘‘, 10, ‘‘ ‘‘). 10.2.3.2.
A Residue object has a number of additional methods:
r.get_resname() # return residue name, e.g. "ASN" r.get_segid() # return the SEGID, e.g. "CHN1" 10.2.2..
An Atom object has the following additional methods:
a.get_name() # atom name (spaces stripped, e.g. "CA") a.get_id() # id (equals atom name) a.get_coord() # atomic coordinates a.get_bfactor() # B factor a.get_occupancy() # occupancy a.get_altloc() # alternative location specifie a.get_sigatm() # std. dev. of atomic parameters a.get_siguij() # std. dev. of anisotropic B factor a.get_anisou() # anisotropic B factor a.get_fullname() # atom name (with spaces, e.g. ".CA.")
To represent the atom coordinates, siguij, anisotropic B factor and sigatm Numpy arrays are used.
Disorder should be dealt with from two points of view: the atom and the residue points of view. In general, we have tried to encapsulate all the complexity that arises from disorder. If you just want to loop over all C α. Each Atom object in a DisorderedAtom object can be uniquely indexed using its altloc specifier. The DisorderedAtom object forwards all uncaught method calls to the selected Atom object, by default the one that represents the atom with DisorderedResidue object.”. It’s residue id could e.g. be (“H_GLC”, 1, “ “).
Parse a PDB file, and extract some Model, Chain, Residue and Atom objects.
from Bio.PDB.PDBParser import PDBParser parser=PDBParser() structure=parser.get_structure("test", "1fat.pdb") model=structure[0] chain=model["A"] residue=chain[1] atom=residue["CA"]
Extract a hetero residue from a chain (e.g. a glucose (GLC) moiety with resseq 10).
residue_id=("H_GLC", 10, " ") residue=chain[residue_id]
Print all hetero residues in chain.
for residue in chain.get_list(): residue_id=residue.get_id() hetfield=residue_id[0] if hetfield[0]=="H": print residue_id
Print out the coordinates of all CA atoms in a structure with B factor greater than 50.
for model in structure.get_list(): for chain in model.get_list(): for residue in chain.get_list(): if residue.has_id("CA"): ca=residue["CA"] if ca.get_bfactor()>50.0: print ca.get_coord()
Print out all the residues that contain disordered atoms.
Loop over all disordered atoms, and select all atoms with altloc A (if present).")
Suppose that a chain has a point mutation at position 10, consisting of a Ser and a Cys residue. Make sure that residue 10 of this chain behaves as the Cys residue.
residue=chain[10] residue.disordered_select("CYS").
There are also some tools to analyze a crystal structure. Tools exist to superimpose two coordinate sets (SVDSuperimposer), to extract polypeptides from a structure (Polypeptide), to perform neighbor lookup (NeighborSearch) and to write out PDB files (PDBIO). The neighbor lookup is done using a KD tree module written in C++. It is very fast and also includes a fast method to find all point pairs within a certain distance of each other.
A Polypeptide object is simply a UserList of Residue objects. You can construct a list of Polypeptide objects from a Structure object as follows:
model_nr=1 polypeptide_list=build_peptides(structure, model_nr) for polypeptide in polypeptide_list: print polypeptide
The Polypeptide objects are always created from a single Model (in this case model 1).
Bio.PopGen is a new CVS version. APIs that are made available on public versions should be much stabler..parse, SIMCOAL2 (). SIMCOAL2 allows for, among others, population structure, multiple demographic events, simulation of multiple types of loci (SNPs, sequences, STRs/microsatellites and RFLPs) with recombination, diploidy multiple chromosomes or ascertainment bias. Notably SIMCOAL2 doesn’t support any selection model. We recommend reading SIMCOAL2’s documentation, available in the link above.
The input for SIM SIM SIMCOAL2 to simulate the demography (below we will see how Biopython can take care of calling SIM SIMCOAL2 documentation to understand the full potential available in modeling chromosome structures. In this subsection we only discuss how to implement chromosome structures using the Biopython interface, not the underlying SIM paramater of 0.0 and a range constraint of 0.0 (for information about this parameters please consult the SIMCOAL2 documentation, you can use them to simulate various mutation models, including the typical – for microsatellites – stepwise mutation model among others).
We now discuss how to run SIMCOAL2 from inside Biopython. It is required that the binary for SIMCOAL2 is called simcoal2 (or simcoal2.exe on Windows based platforms), please note that the typical name when downloading the program is in the format simcoal2_x_y. As such, when installing SIMCOAL2 you will need to rename of the downloaded executable so that Biopython can find it.
It is possible to run SIM Sim = SimCoalController('.') ctrl.run_sim’). SIM SIM.parse (12.2) and (12.3).
Table 12 (12.2) and 12 (12.2) and (12 (12.2) and (12 12.1.
Using the data in Table 12.1, we create and initialize a k-nearest neighbors model as follows:
>>> from Bio import kNN >>> k = 3 >>> model = kNN.train(xs, ys, k)
where
xs and
ys are the same as in Section 12 is a new addition to Biopython 1.50,
having previously been available as a separate Python module dependent on Biopython.
GenomeDiagram is described in the Bioinformatics journal publication Pritchard et al. (2006),
doi:10.1093/bioinformatics/btk021,
and there are several examples images and documentation for the old separate version
available at.
As the name might suggest, GenomeDiagram was designed for drawing whole genomes, in particular prokaryotic genomes, either as linear diagrams (optionally broken up into fragments to fit better) or as circular wheel diagrams. It proves also well suited to drawing quite detailed figures for smaller genomes such as phage, plasmids or mitochrondia.(open(.move_track(1,3) # move track to make an empty space in the middle gd_diagram.draw(format="circular", circular=True, pagesize=(20*cm,20*cm), start=0, end=len(record))(open(="Stand 13.1, but you can also use arrows instead. Note this wasn’t available in the last publically released standalone version of GenomeDiagram.
#Default uses a BOX sigil gd_feature_set.add_feature(feature) #You can make this explicit: gd_feature_set.add_feature(feature, sigil="BOX") #Or opt for an arrow: gd_feature_set.add_feature(feature, sigil="ARROW")
The default arrows are show at the top of the next two images. The arrows fit into a bounding box (as given by the default BOX sigil).:
Now let’s return to the pPCP1 plasmid from Yersinia pestis biovar Microtus, and the top down approach used in Section 13.1.3, but take advantage of the sigil options we’ve now discussed. This time we’ll use arrows for the genes, and overlay them with strandless features (as plain boxes) showing the position of some restriction digest sites.
from reportlab.lib import colors from Bio.Graphics import GenomeDiagram from Bio import SeqIO from Bio.SeqFeature import SeqFeature, FeatureLocation record = SeqIO.read(open(")
And the output:
All the examples so far have used a single track, but you can have more than one track – for example show the genes on one, and repeat regions on another. You can also enable tick marks to show the scale – after all every graph should show its units.). As part of the integration into Biopython, both forms can now be used for argument names. However, at some point in the future the UK spellings may be deprecated. for Biopython 1.50, we have not yet included the
old module
GenomeDiagram.GDUtilities yet. This included a number of
GC% related functions, which will probably be merged under
Bio.SeqUtils later on.
The
Bio.Graphics.BasicChromosome module allows drawing of simple chromosomes.
Here is a very simple example - for which we’ll use Arabidopsis thaliana.
I first(open(filename),"fasta") print name, len(record)
This gave the lengths of the five chromosomes, which we’ll now use in
the following short demonstration of the
BasicChromosome module:
from Bio.Graphics import BasicChromosome entries = [("Chr I", 30432563), ("Chr II", 19705359), ("Chr III", 23470805), ("Chr IV", 18585042), ("Chr V", 26992728)] max_length = max([length for name, length in entries]) chr_diagram = BasicChromosome.Organism() for name, length in entries : cur_chromosome = BasicChromosome.Chromosome(name) #Set the length, adding and extra 20 percent for the tolomeres: cur_chromosome.scale_num = max_length * 1.2 #Add an opening telomere start = BasicChromosome.TelomereSegment() start.scale = 0.1 * max = 0.1 * max_length cur_chromosome.add(end) #This chromosome is done chr_diagram.add(cur_chromosome) chr_diagram.draw("simple_chrom.pdf", "Arabidopsis thaliana")
This should create a very simple PDF file, shown here:
This example is deliberately short and sweet. One thing you might want to try is
showing the location of features of interest - perhaps SNPs or genes. Currently
the
ChromosomeSegment object doesn’t support sub-segments which would be
one approach. Instead, you must replace the single large segment with lots of
smaller segments, maybe white ones for the boring regions, and colored ones for
the regions of interest.
This section shows some more examples of sequence input/output, using the
Bio.SeqIO module described in Chapter 5.(open(.4.3):
import random from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio import SeqIO original_rec = SeqIO.read(open((open(.8 we saw how to use the
Seq
object’s
translate method, and the optional
cds argument
which enables correct translation of alternative start codons.
We can combine this with
Bio.SeqIO as
shown in the reverse complement example in Section 5.4.2.(open("coding_sequences.fasta"), "fasta")) out_handle = open("translations.fasta", "w") SeqIO.write(proteins, out_handle, "fasta") out_handle.close()
This should work on any FASTA file of complete coding sequences.
If you are working on partial coding sequences, you may prefer to use
nuc_record.seq.translate(to_stop=True) in the example above, as
this wouldn’t check for a valid start codon etc. NCBI, (8MB) which unzips to a 23MB file SRR014849.fastq.
from Bio import SeqIO good_reads = (record for record in \ SeqIO.parse(open("SRR014849.fastq"), "fastq") \ if min(record.letter_annotations["phred_quality"]) >= 20) out_handle = open("good_quality.fastq", "w") count = SeqIO.write(good_reads, out_handle, "fastq") out_handle.close() print "Saved %i reads" % count
This pulled out only 412 reads - maybe this dataset hasn’t been quality trimmed yet?TTGGAACCG is a 3’ primer sequence we want to look for in some FASTQ formatted read data. As in the example above, we’ll use the SRR014849.fastq file downloaded from the NCBI (). The same approach would work with any other supported file format (e.g. FASTA files).
This code uses
Bio.SeqIO with a generator expression (to avoid loading
all the sequences into memory at once), and the
Seq object’s
startswith method to spot the primer sequence:
from Bio import SeqIO primer_reads = (record for record in \ SeqIO.parse(open("SRR014849.fastq"), "fastq") \ if record.seq.startswith("GTTGGAACCG")) out_handle = open("with_primer.fastq", "w") count = SeqIO.write(primer_reads, out_handle, "fastq") out_handle.close() print "Saved %i reads" % count
That should find 500 reads from SRR014849.fastq and save them to a new FASTQ file, with_primer.fastq.
Now suppose that instead you wanted to make a FASTQ file containing these 500 reads
but with the primer sequence removed? That’s just a small change as we can slice the
SeqRecord (see Section 4.6) to remove the first ten
letters (the length of our primer):
from Bio import SeqIO trimmed_primer_reads = (record[10:] for record in \ SeqIO.parse(open("SRR014849.fastq"), "fastq") \ if record.seq.startswith("GTTGGAACCG")) out_handle = open("with_primer_trimmed.fastq", "w") count = SeqIO.write(trimmed_primer_reads, out_handle, "fastq") out_handle.close() print "Saved %i reads" % count
Again, that should pull out the 500 reads from SRR014849.fastq, but this time strip off the first ten characters, and save them to another new FASTQ file, with_primer_trimmed.fastq.
Finally, suppose you want to create a new FASTQ file where these 500 reads have their primer removed, but all the other reads are kept as they were?
from Bio import SeqIO def trim_primer(record, primer) : if record.seq.startswith(primer) : return record[len(primer):] else : return record trimmed_reads = (trim_primer(record, "GTTGGAACCG") for record in \ SeqIO.parse(open("SRR014849.fastq"), "fastq")) out_handle = open("trimmed.fastq", "w") count = SeqIO.write(trimmed_reads, out_handle, "fastq") out_handle.close() print "Saved %i reads" % count
This takes longer, as this time the output file contains all 94696 reads. Again, we’re used a generator expression to avoid any memory problems. You might prefer to use a for loop:
from Bio import SeqIO out_handle = open("trimmed.fastq", "w") for record in SeqIO.parse(open("SRR014849.fastq"),"fastq") : if record.seq.startswith("GTTGGAACCG") : out_handle.write(record[10:].format("fastq")) else : out_handle.write(record.format("fastq")) out_handle.close()
In this case the for loop looks simpler, but putting the trim logic into a function is more tidy, and makes it easier to adjust the trimming later on. For example, you might decide to look for a 5’ primer as well.
Back in Section 5.4.1 we showed how to use
Bio.SeqIO to convert between two file formats. Here we’ll go into a
little more detail regarding FASTQ files which are used in second generation
DNA sequencing. FASTQ files store both the DNA sequence (as a string) and
the associated read qualities.
PHRED scores (used in some FASTQ files, and also in QUAL files and ACE records = SeqIO.parse(open("solexa.fastq"), "fastq-solexa") out_handle = open("standard.fastq", "w") SeqIO.write(records, handle, "fastq") out_handle.close()
If you want to convert a new Illumina 1.3+ FASTQ file, all that gets changed is the ASCII offset because although encoded differently the scores are all PHRED qualities:
from Bio import SeqIO records = SeqIO.parse(open("illumina.fastq"), "fastq-illumina") out_handle = open("standard.fastq", "w") SeqIO.write(records, handle, "fastq") out_handle.close()a standard as used by Sanger, the NCBI, and elsewhere.
For more details, see the built in help (also online):
>>> from Bio.SeqIO import QualityIO >>> help(Quality.8 about translation).
from Bio import SeqIO record = SeqIO.read(open() : for pro in nuc[frame:].translate(table).split("*") : if len(pro) >= min_pro_len : print "%s...%s - length %i, strand %i, frame %i" \ % (pro[:30], pro[-3:], len(pro), strand, frame)
This should give:(open( 13.1 >>> handle = open("ls_orchid.fasta") >>> sizes = [len(seq_record) for seq_record in SeqIO.parse(handle, "fasta")] >>> handle.close() >>> handle = open("ls_orchid.fasta") sizes = [len(seq_record) for seq_record in SeqIO.parse(handle, "fasta")] handle.close() the
list comprehension used here:
from Bio import SeqIO from Bio.SeqUtils import GC handle = open("ls_orchid.fasta") gc_values = [GC(seq_record.seq) for seq_record in SeqIO.parse(handle, "fasta")] gc_values.sort() handle.close() = record_iterator.next() rec_two = record_iterator.next() NCBI short read archive (SRA) FTP site (see the SRR001666 page and(open 14 we showed targetted a alignment summary object, which we’ll assume is called
summary_align (see section 14 16 Clustalw from Bio.Alphabet import IUPAC from Bio.Align import AlignInfo # get an alignment object from a Clustalw alignment output c_align = Clustalw.parse_file("protein.aln", IUPAC.protein) summary_align = AlignInfo.SummaryInfo(c_align)
Sections 6.3.1 and 14 6 E -5 5 H -15 -13 10 K -31 -15 -13 6 R -13 -25 -14 -7 7
Bio.SeqIO (Chapter 5).
Biopython’s BioSQL module is currently documented at which is part of our wiki pages.
The
Bio.InterPro module works with files from the
InterPro database, which can be obtained from the InterPro project:.
The
Bio.InterPro.Record contains all the information stored in
an InterPro record. Its string representation also is a valid InterPro
record, but it is NOT guaranteed to be equivalent to the record
from which it was produced.
The
Bio.InterPro.Record contains:
Database
Accession
Name
Dates
Type
Parent
Process
Function
Component
Signatures
Abstract
Examples
References
Database links 15 preferrably_ | http://www.biopython.org/DIST/docs/tutorial/Tutorial.html | crawl-002 | refinedweb | 10,120 | 60.21 |
Welcome to part 2 of the data analysis with Python and Pandas tutorials, where we're learning about the prices of Avocados at the moment. Soon, we'll find a new dataset, but let's learn a few more things with this one. Where we left off, we were graphing the price from Albany over time, but it was quite messy. Here's a recap:
import pandas as pd df = pd.read_csv("datasets/avocado.csv") albany_df = df[df['region']=="Albany"] albany_df.set_index("Date", inplace=True) albany_df["AveragePrice"].plot()
<matplotlib.axes._subplots.AxesSubplot at 0x11fd925f8>
So dates are funky types of data, since they are strings, but also have order, at least to us. When it comes to dates, we have to help computers out a bit. Luckily for us, Pandas comes built in with ways to handle for dates. First, we need to convert the date column to datetime objects:
df = pd.read_csv("datasets/avocado.csv") df['Date'] = pd.to_datetime(df['Date'])
albany_df = df[df['region']=="Albany"] albany_df.set_index("Date", inplace=True) albany_df["AveragePrice"].plot()
<matplotlib.axes._subplots.AxesSubplot at 0x11fa86828>
Alright, the formatting looks better in terms of axis, but that graph is pretty wild! Could we settle it down a bit? We could smooth the data with a rolling average.
To do this, let's make a new column, and apply some smoothing:
albany_df["AveragePrice"].rolling(25).mean().plot()
<matplotlib.axes._subplots.AxesSubplot at 0x1223cc278>
Hmm, so what happened? Pandas understands that a date is a date, and to sort the X axis, but I am now wondering if the dataframe itself is sorted. If it's not, that would seriously screw up our moving average calculations. This data may be indexed by date, but is it sorted? Let's see.
albany_df.sort_index(inplace=True)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel_launcher.py:1: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: """Entry point for launching an IPython kernel.
What's this warning above? Should we be worried? Basically, all it's telling us is that we're doing operations on a copy of a slice of a dataframe, and to watch out because we might not be modifying what we were hoping to modify (like the main df). In this case, we're not trying to work with the main dataframe, so I think this warning is just plain annoying, but whatever. It's just a warning, not an error.
albany_df["AveragePrice"].rolling(25).mean().plot()
<matplotlib.axes._subplots.AxesSubplot at 0x1223ccf98>
And there we have it! A more useful summary of avocado prices for Albany over the years.
Visualizations are cool, but what if we want to save our new, smoother, data like above? We can give it a new column in our dataframe:
albany_df["price25ma"] = albany_df["AveragePrice"].rolling(25).mean()
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7.
albany_df.head()
Perfect example of why
tail is useful sometimes...
albany_df.tail()
That warning sure is annoying though isn't it. What could we do? A common idea is to silence it all of the warnings. What if we instead...
albany_df = df.copy()[df['region']=="Albany"] albany_df.set_index('Date', inplace=True) albany_df["price25ma"] = albany_df["AveragePrice"].rolling(25).mean()
This way, we are explicit. Pandas is happy, we're happy. You can ignore pandas warnings, but I would strongly advise against silencing them. Now you know you can do it, but I am not going to show you how :)
Another subtle thing you might have glossed over is the requirement for us to sort things how we intend before we start performing operations and calcs. Many times, you wont be visualizing columns before you make them. You may actually never visualize them. Imagine if we wrote the above code before we sorted by date, basically just assuming things were ordered by date. We'd have produced bad data.
Then imagine maybe we're doing some machine learning or other statistical analysis on that data. Well, chances are, our MA column is not only fairly useless, it's also being informed often of future data!
It's very easy to make mistakes like this. Check your code early and check it often through printing it out and visualizing it where possible!
Alright, we want more cool stuff, what else can we do?
Let's graph prices in the different regions. We hard-coded the Albany region, but hmm, we don't know all of the regions. What do we do?! If we every just wanted to get a "list" from one of our columns, we could reference just that column, like:
df['region']
0 Albany 1 Albany 2 Albany 3 Albany 4 Albany 5 Albany 6 Albany 7 Albany 8 Albany 9 Albany 10 Albany 11 Albany 12 Albany 13 Albany 14 Albany 15 Albany 16 Albany 17 Albany 18 Albany 19 Albany 20 Albany 21 Albany 22 Albany 23 Albany 24 Albany 25 Albany 26 Albany 27 Albany 28 Albany 29 Albany ... 18219 TotalUS 18220 TotalUS 18221 TotalUS 18222 TotalUS 18223 TotalUS 18224 TotalUS 18225 West 18226 West 18227 West 18228 West 18229 West 18230 West 18231 West 18232 West 18233 West 18234 West 18235 West 18236 West 18237 WestTexNewMexico 18238 WestTexNewMexico 18239 WestTexNewMexico 18240 WestTexNewMexico 18241 WestTexNewMexico 18242 WestTexNewMexico 18243 WestTexNewMexico 18244 WestTexNewMexico 18245 WestTexNewMexico 18246 WestTexNewMexico 18247 WestTexNewMexico 18248 WestTexNewMexico Name: region, Length: 18249, dtype: object
Then convert to array with:
df['region'].values
array(['Albany', 'Albany', 'Albany', ..., 'WestTexNewMexico', 'WestTexNewMexico', 'WestTexNewMexico'], dtype=object)
Could go to list like:
df['region'].values.tolist() # and then maybe get the uniques with: print(set(df['region'].values.tolist()))
{'Orlando', 'RaleighGreensboro', 'Charlotte', 'NewOrleansMobile', 'Syracuse', 'Nashville', 'DallasFtWorth', 'Chicago', 'Columbus', 'SanFrancisco', 'Southeast', 'Tampa', 'Jacksonville', 'SanDiego', 'MiamiFtLauderdale', 'Seattle', 'Philadelphia', 'California', 'SouthCentral', 'Pittsburgh', 'GrandRapids', 'Atlanta', 'Indianapolis', 'CincinnatiDayton', 'RichmondNorfolk', 'Louisville', 'Roanoke', 'LasVegas', 'Northeast', 'NorthernNewEngland', 'Detroit', 'Portland', 'Plains', 'Spokane', 'LosAngeles', 'HarrisburgScranton', 'SouthCarolina', 'TotalUS', 'West', 'Albany', 'NewYork', 'WestTexNewMexico', 'BuffaloRochester', 'Sacramento', 'BaltimoreWashington', 'Boston', 'Boise', 'Denver', 'HartfordSpringfield', 'PhoenixTucson', 'Houston', 'GreatLakes', 'Midsouth', 'StLouis'}
So, very quickly you can take your pandas data and get it out into array/list form and use your own knowledge of python. Or, you could also just use some Pandas method. Just know, if you're trying to do it, it probably has a method!
df['region'].unique()
array([', 'HarrisburgScranton', 'HartfordSpringfield', 'Houston', 'Indianapolis', 'Jacksonville', 'LasVegas', 'LosAngeles', 'Louisville', 'MiamiFtLauderdale', 'Midsouth', 'Nashville', 'NewOrleansMobile', 'NewYork', 'Northeast', 'NorthernNewEngland', 'Orlando', 'Philadelphia', 'PhoenixTucson', 'Pittsburgh', 'Plains', 'Portland', 'RaleighGreensboro', 'RichmondNorfolk', 'Roanoke', 'Sacramento', 'SanDiego', 'SanFrancisco', 'Seattle', 'SouthCarolina', 'SouthCentral', 'Southeast', 'Spokane', 'StLouis', 'Syracuse', 'Tampa', 'TotalUS', 'West', 'WestTexNewMexico'], dtype=object)
That was quick and painless!
graph_df = pd.DataFrame() for region in df['region'].unique()[:16]: print! else: graph_df = graph_df.join(region_df[f"{region}_price25ma"])
I set the limit to 16 just to show we're getting bogged down. This one really tripped me up. I couldn't quite figure out what was going on. Things were taking exponentially longer and longer, then memory was getting exhausted. That's not what I know and love with Pandas, so what gives? Upon some digging, we find that hmm, dates are still getting duplicated. For example:
graph_df.tail()
Each row should be a separate date, but it's not. Through some debugging, we can discover what's happening, which actually informs us to why our previous data looked so ugly too.
Our avocados have multiple prices: Organic and Conventional! So, let's pick one. I'll go with organic. So we'll just start over pretty much.
import pandas as pd df = pd.read_csv("datasets/avocado.csv") df = df.copy()[df['type']=='organic'] df["Date"] = pd.to_datetime(df["Date"]) df.sort_values(by="Date", ascending=True, inplace=True) df.head()
Now, let's just copy and paste the code from above, minus the print:
graph_df = pd.DataFrame() for region in df['region']! (so df rather than series) else: graph_df = graph_df.join(region_df[f"{region}_price25ma"]) graph_df.tail()
5 rows A-- 54 columns
Now it's quick! Awesome!
Let's graph!
graph_df.plot(figsize=(8,5), legend=False)
<matplotlib.axes._subplots.AxesSubplot at 0x124046fd0>
Lots more we could poke around with here, but, in the next tutorial, we'll be visiting a new dataset with new challenges. | https://pythonprogramming.net/graph-visualization-python3-pandas-data-analysis/ | CC-MAIN-2021-39 | refinedweb | 1,369 | 57.67 |
(update 3/22/2007 1:59pm: see comments for .NetCF equivalent)
I’m Jay Ongg, and I’m a developer for Mobile Devices at Microsoft. I’ve been in this division for a little over four years, and as part of my job, I work with OEMs and ISVs. I’m here to write some articles on how to do some useful Messaging tasks.
Messaging is one of the areas that developers have trouble with, partly due to lack of documentation or examples. In order to deal with Messaging stores on a Windows Mobile device, developers have to work with MAPI. Unfortunately, until you get used to it, MAPI isn’t an easy beast to tame.
One of the common questions that we have is, “how do I enumerate all the accounts on a device?” Often, the developer is looking for a particular account by name or with a particular property. I’ll enumerate the steps needed to print out the name of every account on the device.
These are the steps needed:
Here is the function. I’ll break it down below …
#include <atlbase.h>
#include <cemapi.h>
#include <mapiutil.h>
#include <mapidefs.h>
#define CHR(x) if (FAILED(x)) { hr = x; goto Error; }
HRESULT DisplayMessageStores()
{
HRESULT hr;
CComPtr<IMAPITable> ptbl;
CComPtr<IMAPISession> pSession;
SRowSet *prowset = NULL;
SPropValue *pval = NULL;
SizedSPropTagArray (1, spta) = { 1, PR_DISPLAY_NAME };
// Log onto MAPI
hr = MAPILogonEx(0, NULL, NULL, 0, static_cast<LPMAPISESSION *>(&pSession));
CHR(hr); // CHR will goto Error if FAILED(hr)
//);
pval = prowset->aRow[0].lpProps;
ASSERT (pval[0].ulPropTag == PR_DISPLAY_NAME);
MessageBox(NULL, pval[0].Value.lpszW, TEXT("Message Store"), MB_OK);
}
pSession->Logoff(0, 0, 0);
Error:
FreeProws (prowset);
return hr;
}
In this code snippet (as well as future ones), I’ll tend to use ATL smart pointers and the CHR macro a lot. The CHR macro essentially checks the input parameter for an HRESULT failure, and if it fails, goto Error. For the purposes of sample code, I’ll be using it rather than doing manual error checking.
Pretty straightforward. Log into MAPI and get a pointer to an IMAPISession
CHR(hr);
Again, pretty straightforward.
First we initialized a struct at the beginning of the function. This struct is used to set the columns of the output from the upcoming message stores table query.
…
SizedSPropTagArray is a helper macro defined in mapidefs.h that creates a sized array. We assign it one element, with the value PR_DISPLAY_NAME, which is defined in mapitags.h. I’ll talk more about this later.
After we create the struct, we call IMAPITable::SetColumns to set the columns.
The actual iteration:
This code iterates through every row in the message stores table. We query one row at a time. FYI, IMAPITable::QueryRows will only return a max of 10 rows. IMAPITable::QueryRows will also automatically increment the internal row counter, so subsequent invocations will get the next row.
After querying the row, we do some ASSERTs to check that we got the expected number of columns as well as the correct property. PR_DISPLAY_NAME is the property that the account name is in, and is of type TCHAR *. You can infer this from the definition in mapitags.h:
#define PR_DISPLAY_NAME PROP_TAG( PT_TSTRING, 0x3001)
The SPropValue struct contains a member, Value, which is a union of a bunch of different types. So we have to access the wide-string member of the union, and print it out:
The memory pointed to by lpszW is allocated by MAPI, and we need to free the rowset (when we re-enter the loop, as well as when we exit the function):
The most complex part of the function :)
Make sure that when you build your project, you link in cemapi.lib as well.
So far I’ve given you a function that prints out the message store names, but there are many properties that you can query for. A quick glance of mapitags.h will give you some tips. Don’t go writing at tags if you don’t know what they do though!
In future articles I’ll talk about more advanced topics, such as getting the message store pointer, and iterating through folders/messages.
Hope this article helps some of you out. Feel free to leave a comment if you have any questions or ideas for blog topics!
If you would like to receive an email when updates are made to this post, please register here
RSS
Cool article. Now can you show us how to do that in managed :-)
...haven't used C/C++ since college!! Don't like arrows in my programming languages (or paragraphs for you COBOL folks - if you've learned to use the internet yet)
Please post C# (if possible).
Thanks!
It is better to write a wrapper for CEMAPI and add it into .net cf. Looking forward to use managed code to access message system on windows mobile in the next version of .net cf.
Yup, I'll post .Net version :). The initial requests I get for this example are usually from OEMs or in-ROM ISVs (who are more familiar with C++ I suppose :) ).
OK, here's how you do it in C#:
make sure you have added Microsoft.WindowsMobile.PocketOutlook to your project (you get this from the Windows Mobile 5 SDK).
This is the equivalent function:
using Microsoft.WindowsMobile.PocketOutlook;
private void showAccounts(object sender, EventArgs e)
OutlookSession session = new OutlookSession();
MessageBox.Show(session.SmsAccount.Name);
foreach (EmailAccount account in session.EmailAccounts)
{
MessageBox.Show(account.Name);
}
Hope this helps. Yeap, C# is way easier. However note that in .NetCF, the SMS account is separate from the collection of E-mail accounts.
Thanks for the post. Keep'em coming.
But could you go a little more into detail and cover what's not yet in the SDK docs, say, something about the databases used by MAPI, similar to the article by Werner "Menneisyys" Ruotsalainen on mail-related information?
In particular, how could I troubleshoot the mystery of disappearing email accounts (after radio failure).
Henry, the databases used by MAPI are not going to be in the SDK docs because this gives us the flexibility to make changes as necessary.
Given that, however, about your bug... I've personally never seen or heard of this bug before, but you can start by using the function that I wrote above. If the account disappeared, it may help you troubleshoot a little bit.
I really have to admit a certain degree of frusteration with the customization of my new WM5 device. Looking both through this blog and through old data on MSDN, there used to be a plethora of resources on writing XML files to customize the color schemes for your windows mobile device.
Since the release of the WM5 platform, ther ehave been several revamps of the microsoft website, including a rebuild of the windows mobile area of the Microsoft website.
The casualty? Old links. Old resource guides. The information availible now is either configured around programmatic modification through APIs (too deep, i dont want to write a program to do this stuff), or too high level and geared for "inforamtion workers".
As an example, customizing home screens is now a matter of just giving instructions on how to choose a different background picture.
I understand and can write XML. I understand and can rebuild images. I feel a deep sense of disappointment that I know the functionality is there but I cannot seem to find anything anywhere that would provide the specs on how to modify or create color schemes and imagery on the WM5 and WM6 platforms.
I've read that Microsoft is going to make public
the Outlook/Exchange protocol. Any chance of
getting information about this with regards
to MAPI on Windows Mobile?
Bill,
MAPI is designed for use with on-board messaging databases, not for network access. So it's unlikely that MAPI will be extended to access the Outlook/Exchange protocol directly. At least, I haven't heard anything.
Thanks for the response Jay! Sorry, let me rephrase
the question. Any chance of seeing how Windows
Mobile populates these on-board messaging
databases over the network by using the low
level Outlook/Exchange protocol?
We're writing a tool that will proxy this traffic.
I realize from the article I referenced that a
license will likely need to be acquired. Any help
would be really appreciated.
Thanks Jay for this detailed note. You have suggested that folks should look at mapitags.h (and mapi.h) -- but the most confusion part is that which properties are available in what objects? For example, account name is in message store and not in message itself.
There are numerous challenges in MAPI with Windows Mobiles. Appreciate you could cover some of them: Here is the non-exausted list:
1) Dynamic menu insertion (one of the most complex jobs -- menus vanish when you change 'views', there is no good way of knowing which menu is being selected, sub-menus pose their own problems)
2) Inserting menus for certain kinds of accounts
3) Retrieving properties such as From, TO, CC/BCC in POP/Outlook accounts
4) Retrieving message body (HTML, TEXT, MIME)
5) Creating your own form and rendering HTML body
6) Developing outlook plugin and establishing proper event notification
etc.
More later
nitin
Bill, I am looking into your question - so far I haven't heard anything about APIs to be made public.
Nitin - I have ideas for blog topics lined up along those lines. I agree that if you don't know what you're looking for, mapitags.h isn't going to help. However, hopefully in my future articles I will answer. I intend to cover:
1. How to read the from/to/text of an SMS (and later on, a POP3/Outlook message. The latter uses a different property).
2. How to add a menu extension (to use with the tool I write in #1).
I don't understand what you mean by "developing outlook plugin". What do you mean by Outlook plugin? a menu extension?
Creating your own form and rendering an HTML body is something that is more advanced and there exist demos for, especially if you have the OEM Adaptation Kit. I'm not sure if there is a demo in the SDK though.
The error handling in this should be an example of how NOT to handle errors. The CHR macro jumps to a label that is followed by a free. What really needs to be done before exiting is the POOM logoff, which is right before the label. So, we've actually jump right past the one thing that needs to be done to clean up. But wait, it gets better. The free after the error jump is for an item that is never allocated until after all uses of the CHR macro, so it never has any possible use where it is. This sample would be better without any error handling at all.
Matthew,
The destructor of the IMAPISession would handle that Logoff anyway, so the Logoff call strictly isn't necessary. I included it for illustrative purposes.
However, the last FreeProws() is actually necessary, otherwise there will be a leak. Note that the last iteration of the loop will obtain a rowset but not free it.
How would you forward a message using MAPI?
Is there any C++ sample code?
Thanks.
jayongg,
My point about the FreeProws() is that it is needed after the while loop, but not in the error jump. Putting it there implies its needed in some way for cleaning up when there is an error, but it all cases there is a juimp there, prowset will always be NULL.
Its good to know the logoff is automatic. In that case, you could just do a clean return in the macro rather than a goto and be done with it.
Hi Dorel, you can "forward" a message using MailComposeMessage and attach a body/subject - it will bring up a new compose form for the user to fill out. The user will still have to hit Send
Hi Matthew. I see your point. Without turning this into a blog about coding styles.. The CHR()/Error macro implies that all cleanup occurs at the end of the function. A developer can confidently know that any usage of rowset will be cleaned up at the end. I agree that it isn't necessary in this case (because everything will get cleaned up in the loop). For me, it's force of habit since it ensures that if I error out of the loop early, I won't leak any rowset. It's kind of like a poor-man's C++ destructor for cleanup (for the purposes of this article there's no point in writing a class to release on destruction). Thanks for looking at the code though.
Hi Jay,
I have tried MailComposeMessage(), bat cannot manage the attachments that are not downloaded yet on the device (and I don't want to download the attachments on the device). Beside that, I don't want to bother the user with a Message form , and to hit the Send button.
I was looking for a MAPI function similar to IMessage::SubmitMessage( ULONG ulFlags );
This imaginary function would work perfectly for me: IMessage::ForwardMessage(ULONG ulFlags, LPADRLIST lpTos);
What I want to achieve is to forward messages with attachments to a preset email address. The process would be triggered by the user clicking on a Menu Extension Item on Inbox: "Forward to my MSN account..."
Is there any programmatically way to invoke Active Sync to send a "SmartForward" Cmd request to Exchange Active Sync? [for example: POST /Microsoft-Server-ActiveSync?User=meme&DeviceId=4fa4&DeviceType=PocketPC&Cmd=SmartForward&ItemId=1:3&CollectionId=0a093-1d&SaveInSent=F HTTP/1.1]
Thanks for your help.
Hi Dorel,
What exactly have you tried so far? So you are saying that IMessage::SubmitMessage would work, as long as it allowed you to specify a message to forward, correct? imaginary function:
IMessage::ForwardMessage(ULONG ulFlags, LPADRLIST lpTos, DWORD cbEntryIdMessageOriginal, LPENTRYID pEntryIdMessageOriginal) ?
Unfortunately there is no public way of doing this. Here is the issues involved:
Activesync messages with Smart Forwarding use a private property to store information about text and attachments. If you need this public, you will have a stronger case if you have an OEM or operator who would desire this functionality. We can't just publicize this functionality because we haven't tested this property/scenario under all circumstances.
I hope this helps. Frankly this does sound like a cool feature to have.
Hi Jay,
Thanks for the clarification. I am going to enroll in one of the Microsoft ISV programs.
Whould you tell me how to using function IMAPITable::Restrict(...)? is there any C++ sample code for it?
Another problem is that we use xml to create new message account. So whould you please tell me if there is any other account type we can use besides "Email2" account type? Attached is our xml sample:
<wap-provisioningdoc>
<characteristic type="EMAIL2">
......
</characteristic>
</wap-provisioningdoc>
Cloud, what are you trying to do with IMAPITable::Restrict?
You can create "Email2" and "Sync" accounts via XML. Future versions of Windows Mobile may support more. What are you trying to do?
Hi jayongg,
I want to count all unread messages on inbox. for using XML, i just want to add a new message account,for example "MMS".
Thank you!
Cloud, you can't add an MMS account via the XML, only email accounts. To create an MMS account you need to create a message store using MAPI.
as for counting unread messages in an inbox, there is a MAPI property one the MAPI folder that will allow you to do this. looks this up in the SDK.
> To create an MMS account you need to create a message store using MAPI.
Can you give a sequence of operations how to create, for example, MMS account?
Let us suppose, we have a MMSTransport.dll -- empty analog of MAPI New Messaging Transport Sample. Then we register it, something like this:
ATL::CRegKey mms_trans_key;
mms_trans_key.Create( HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Inbox\\Svc\\MMS") );
mms_trans_key.SetStringValue( _T("Name"), _T("MMS") );
mms_trans_key.SetStringValue( _T("DefMsgClass"), _T("IPM.xMMS") );
mms_trans_key.SetStringValue( _T("DLL"), _T("MMSTransport.dll") );
mms_trans_key.SetDWORDValue ( _T("Port"), 0 );
There are questions:
1) where and when we should create a message store using ICEMAPISession::CreateMsgStore()?
2) how to create MMS account and link it with this message store?
3) what else we should make to view the results in builtin Messaging application GUI?
Thank you and please excuse me for my bad english.
_random, in order to create an MMS account, you should do what you did above, but also set this reg key (found in snapi.h):
////////////////////////////////////////////////////////////////////////////////
// MessagingMmsAccountName
// Gets the name of the MMS messaging account.
#define SN_MESSAGINGMMSACCOUNTNAME_ROOT HKEY_CURRENT_USER
#define SN_MESSAGINGMMSACCOUNTNAME_PATH TEXT("System\\State\\Messages\\MMS")
#define SN_MESSAGINGMMSACCOUNTNAME_VALUE TEXT("Account Name")
To answer your questions:
1. Create message store as early as possible. Obviously you want to do it before the user creates an MMS message (or receives one). ideally on cold boot. Or as part of your cab file install.
2. You will need to create a mail transport as in the sample. If you use the sample, it doesn't work?
3. You will need to create message forms to hook this up with the Messaging GUI. You will need to do this using native code. Have you looked in the SDK on this topic?
> _random, in order to create an MMS account, you should do what
> you did above, but also set this reg key (found in snapi.h):
For experiments, I created separate MMSInstaller.exe as some installer analog:
int _tmain( int argc, _TCHAR* argv[] ){
Register_DLLs_and_AccountName();
CreateMMSAccount();
return 0;
I have added this code to Register_DLLs_and_AccountName() function:
void Register_DLLs_and_AccountName()
// register MMSTransport.dll
{...} // you already saw it (roughly)
// register MMSForm.dll
{...} // similar as above, I have no questions about it
// register MMS Account Name, as you said
ATL::CRegKey mms_account_key;
mms_account_key.Create( SN_MESSAGINGMMSACCOUNTNAME_ROOT,
SN_MESSAGINGMMSACCOUNTNAME_PATH );
mms_account_key.SetStringValue( _T("Account Name"), _T("MMS") );
Then, I write CreateMMSAccount() function based on MSDN's samples:
void CreateMMSAccount()();
> 1. Create message store as early as possible. Obviously you want to do
> it before the user creates an MMS message (or receives one). ideally
> on cold boot. Or as part of your cab file install.
I performed the registrations with MMSInstaller.exe on PPC 5.0 Emulator.
Then I made soft reset (to restart native messaging application).
Nothing changes in the Messaging GUI... The only account I see is Outlook E-mail. What else I should make or, may be, there are some mistakes in samples above?
> 2. You will need to create a mail transport as in the sample.
> If you use the sample, it doesn't work?
It works... but I don't understand why we need to create account with
this schema (as it is described in \Windows Mobile 5.0 Pocket PC
SDK\Samples\CPP\Win32\Transportdemo\readme.txt):
"4) Create a new account:
a) Menu->Tools->New Account.
b) (E-mail setup 1/5) Enter an email address which will use your custom
transport. Click the Next softkey."
Why email address? I don't want any e-mail on MMS account :).
> 3. You will need to create message forms to hook this up with the
> Messaging GUI. You will need to do this using native code. Have you
> looked in the SDK on this topic?
I created simple MMSForm.dll that does nothing except show MessageBox(
"It works :)" ); in each method of the IMessageFormEx interface.
I would like to know how I can retrieve MMS attachments.
On my device, when I list the message store I get only Activesync and SMS.
So I suppose MMS are stored in the SMS store and indeed I can retrieve the MMS subject using the PR_SUBJECT property but nothing more.
How can I get pictures/sounds, ...
What is the MMS format and properties, nobody has been able to answer this simple question ...
Hi Mosfet,
Unfortunately, OEMs can provide whatever MMS properties and store messages any way they want - Microsoft doesn't dictate that. Therefore, MMS message information can be stored in any way. You can contact the MMS providers to find out how they store the data - I believe some might even have an SDK.
Hi, Jay.
And what about me? ;)
Is it possible to create not E-mail account (for example MMS) using MAPI and integrate it into Messaging GUI? My experiments reach a deadlock. And I can't find help in MSDN...
Thank you.
With the hope of your help,
random.
Hi Random, have you tried using the CreateMsgStore API? You will also need to create some registry keys - this should all be in the SDK.
Above I wrote about it.
First, I call a function (in installer.exe) with this code (on PPC WM 5.0 Emulator):
// register MMS Account Name, as you said
ATL::CRegKey mms_account_key;
mms_account_key.Create( SN_MESSAGINGMMSACCOUNTNAME_ROOT,
SN_MESSAGINGMMSACCOUNTNAME_PATH );
mms_account_key.SetStringValue( _T("Account Name"), _T("MMS") );
Second, I call this function:();
Then, I make soft reset of the Emulator (thinking it restarts Messaging application). Nothing changes in GUI...
I don't know what is the account itself: registry key + some directories? I think that pSession->CreateMsgStore( _T("MMS"), &pMsgStore ) -- will create the Directory. Can you point the MSDN article, where this mechanizm is described?
Forgot to say: all functions runs successfully. I was checked it.
some news:
second call pSession->CreateMsgStore( _T("MMS"), &pMsgStore ); returns 0x80040301 -- this HRESULT value is unknown for Error Lookup tool and doesn't exists in CreateMsgStore method description in MSDN.
I hope this result says something like "MsgStore with this name already exists". Isn't it?
Hi random, is there an email address I can reach you at? we should take this offline.
how do i get the list of messages present in Inbox/Drafts using Mapi and then read them individually?
Hi roohi, please take a look at this link for some info on doing what you're asking for:
Great articles on Mobile MAPI, but I do have a couple of questions that I can't seem to find an answer to anywhere:
1) If a message is only partially downloaded (ie has MSGSTATUS_PARTIAL set) what command or commands trigger the full download? (the equivalent of opening pocket outlook and hitting message download, but programmatic)
2) In WM6 there is now HTML mail support, so I want to display the HTML in say a WebBrowser control...works great except for one problem. Embedded images (images with a CID tag) are not displayed correctly. I can manually parse the HTML and after saving the embedded attachments to a temp file reroute the src= param however I was wondering if there was perhaps a callback to allow us to fill in the image bytes of an embedded image?
Hi Noel,
Regarding HTML Mail - you probably will have to write your own event handler to work with the HTML control to deal with embedded images. I thought there was a callback mechanism, but I haven't looked at that code in a while...
Regarding MSGSTATUS_PARTIAL, downloading a whole message is actually more complicated than just setting a flag. Depending on the transport, you have to think about downloading attachments, which is done different for HTML mail vs normal attachments, I believe. With that said, this might work... try setting the MSGSTATUS_REMOTE_DOWNLOAD flag to start out, and MSGSTATUS_REMOTE_DOWNLOAD_ATTACH as well. If that doesn't work, it's hard for me to give any advice without knowing exactly what your app is doing.
Thanks,
Jay
Yes, I figured there was a call to download the rest of the message, the MSGSTATUS_PARTIAL flag is already set by the message (I'm simply reading in the message and seeing that it is set)
I want to get the body and perhaps the attachments; I'll try setting the DOWNLOAD flags thanks.
I would really like to be able to change the automatic checking period for an email account. For example, have no automatic check in the evening and every half hour in the day. For activesync these properties are stored in the registry. So I suppose I am asking how do you programmatically change the check period of an email account.
Cheers
Hi Chris, I assume when you say "email account" you mean POP/IMAP accounts. Unfortunately, there isn't a concept of peak and non-peak schedules with POP/IMAP accounts - I don't believe this is in the UI.
This is true. I was refering to IMAP/POP. I was wondering if it were possible to programmatically set it and therefore, I could use the notification queue to give me the peak/off peak behaviour.
Hi Chris, that is not possible. there are ways to hack around it to have a background process/service do what you want, but otherwise we don't support it.
I found a way to do it :-) It's a bit of a hack, but it works. Bascially you can use the provising API. For example:
<characteristic type="EMAIL2" recursive="true">
....
<parm name="LINGER" value="60"/>
...
</characteristic>
Where Linger is the check period. You can package up the above into a cab file (_setup.xml) and use wceload.exe to silently load it. I have two cab files one with linger at 0 and with linger at 30. I use mortscript to run, using wceload, the appropriate cab file at the required time. You have to be careful, as using this method could mess your email settings up. I used settingssaviour to extract an initial provision xml file (so that I had the correct GUIDs for the accounts).
I have not explained this very well, so if anyone is interested give me a shout and I'll explain more.
Chris
Hi,
I am stuck with an issue in pmail.
I have an iMX31 board(armv4i processor) running on WinCE 5.0. I included 'Inbox' catalog component in my image. But I am not able call any of the Mail APIs like MAPILogonEx or GetMsgStoresTable. Should I include any other component for the same?
I am not able to find out cemapi.lib also in the image.
Can anyone help me out in this?
Thanks in advance.
Regards,
Hima S
Hi Hima, you will need to use Windows Mobile to get the MAPI APIs. I don't think that Windows CE supports them.
Hi, Jay Ongg,
can show me any samples on how to send and receive sms via pocket pc 2003
'============optional===========================
I had go though the smaples in Mobile 5 SDK, they did not work at all.
Errors like outlook.dll does not support ppc(though i found that sample in "ppc" folder), and Could not load type Microsoft.WindowsMobile.Utilities.Registry from assembly Microsoft.WindowsMobile.Utilities,
Can't find an Entry Point '#78' in a PInvoke DLL 'pimstore.dll' nearly drive me crazy.
'============End of optional======================
I 'm trying to use IMAPITable::Restrict function to filter messages in the inbox folder.
but it returns E_INVALIDARGS as result.
i'm not able to figure out where the problem is.
here's code for ur reference.
HRESULT FilterMessagesExt()
HRESULT hRes;
LPSRowSet pRows = NULL;
SRestriction sres;
SPropValue spv;
LPMAPIFOLDER pFldr;
LPMAPITABLE pCTbl;
ULONG lCount ;
SRowSet *prowset = NULL;
HRESULT hr = S_OK;
SizedSPropTagArray(1,spt) = {1,PR_SENDER_NAME };
//this is my utility function to return the folder
pFldr=OpenFolder(Inboxfolder);
hRes = pFldr -> GetContentsTable(0,&pCTbl);
// select columns first
hRes = pCTbl->SetColumns((LPSPropTagArray)&spt,0);
// sort depends on result of Restrict, do first
sres.rt = RES_PROPERTY;
spv.ulPropTag =PR_SENDER_NAME ;
spv.Value.lpszW = (LPWSTR)("Sharma, Kapil");
sres.res.resProperty.relop = RELOP_NE;
sres.res.resProperty.ulPropTag =PR_SENDER_NAME;
sres.res.resProperty.lpProp = &spv;
//here hRes gets E_INVALIDARGS as result
hRes = pCTbl->Restrict(&sres,TBL_BATCH);
pCTbl->GetRowCount(0,&lCount);
Please see if u can help..
thanks
Kapil
Off late i have been playing with windows mobile 5.0 apis mostly with the apis available with pocketoutlook namespace (C#).
This is what i am trying to implement:
I will be having a separate application that has similar UI as the Email compose form along with additional controls. Once user clicks on save/send i want the EmailMessage to be saved in the "Outbox" folder. After looking to the managed apis i did not find any apis that allow me to deal with folders other then contacts, tasks and appointments.
I also went through "SendMail" CPP example available with the sdk which does something similar to what i want. However i was wondering if this is possible in C#.
Any help of guidance in this respect will be appreciated.
-Amit
mathew, jay etc
can anyone help me in intercepting an sms and then using camera api to take picture using smartphone in windows mobile 5.0(using c#)
Hi jay
it seems when reading the body of a email ppc2003 returns an empty string..
I am using evc++ and using the tag PR_BODY
i can send you a copy of the source, just let me know where.
It seems if i create a email message and then read its body text, it works fine. But emails received , body text returns a empty string
Hi, the PR_BODY is a stream, not a string, so you will have to open a stream, not get the property.
Using this piece of code
HRESULT hr = m_pMessage->OpenProperty(PR_BODY ,&IID_IStream, STGM_READ, 0, (IUnknown**)&istream);
i 'm using the code below, but restrict returns E_INVALIDARG as result.
SPropValue spv;
spv.ulPropTag=PR_SENDER_NAME;
spv.Value.lpszA=(LPSTR)("1001000");
SRestriction srs;
srs.rt=RES_PROPERTY;
srs.res.resProperty.lpProp=&spv;
srs.res.resProperty.ulPropTag=PR_SENDER_NAME;
srs.res.resProperty.relop=RELOP_EQ;
any idea why it behaves like that??
thanks
Hi All,
What are the components needed to develop an MMS client application on Windows Mobile 5.0 using MAPI.
I have been following the documents and interfaces mentioned in the following site:
But the problem is, the messages are not posted to the receipient. It's blocked in the Outbox.
Basically I want to know to what extent Windows Mobile shell supports MAPI for MMS.
What are all the components supported by Windows Mobile Shell using MAPI? And what are the missing components?
Do we have to write our own implementation for reading MMS data (for eg: reading media(mp3, mp4, midi, etc), image (JPEG, GIF etc) and text) as well?
Please clarify.
I want to send SMS, MMS and MAIL from my PocketPC. I am using Messaging Tutorial on MSDN ([msdn.microsoft.com]) and SendMail project sample from the SDK.
I can send SMS and MAIL but I don't know how to send MMS?
Thanks
This can vary... are you trying to open a form? if so, MailComposeMessage with the MMS account should suffice. Otherwise you will need to work with the vendor of the MMS provider - Microsoft doesn't create the MMS client.
Arcsoft did't provided api,so I can but implement Wap\Wsp protocol to send mms?
Can anyone help me with this problem?
It seems if i create a email message and then read its body text, it works fine. But emails received , body text is empty
I am using pocket pc 2003 device
I have a MAPI application that gets notified when there is new mail coming. What I would like to do is automatically to accept/deny a meeting invite base based on some specific properties of the meeting invite message. I can check those mesage's properties, but I don't know how to do the accepting/denying. Could you let me know which MAPI interface should I use for this purpose? If it is possible, some small code would be great.
Rocky
does anyone know how to retrieve properties such as CC,BCC,FROM,TO... in the compose email?
I try to get ENTRY ID of the compose message but it always blank.
dzung249
Hello Jay,
I would like to create a new message and put it into Inbox. Could you provide a work example of saving PR_BODY, PR_BODY_HTML and PR_RTF_COMPRESSED properties into Outlook Mobile's message.
Hi Anton,
PR_RTF_COMPRESSED is not public.
PR_BODY and PR_BODY_HTML are both streams, not strings. You will need to open them into IStream's and proceed from there.
Hope this helps!
Actually I use sreams and I can put PR_BODY into Outlook Mobile on Windows Mobile 5.0. But I cannot put PR_BODY_HTML into it using the same approach. Please note, that on Outlook 2003 on PC this code works fine for both PR_BODY and PR_BODY_HTML as well as for PR_RTF_COMPRESSED (I used WrapCompressedRTF... function).
Could you advise something&
Is there any solution for how to read and write MMS...
Unfortunately, there's no way to guarantee reading and writing MMS. Microsoft doesn't create MMS clients, we simply allow others to plug into our Messaging application.
Jay:
I like to know if you plan to answer the question posted by Kapil about the problem of having E_INVALIDARGS in return in calling IMAPITable::Restrict
Below is the code posted by Kapil. Would you kindly let us know what steps are missing or incorrect? Thank you.
======================================
Kapil said:
ULONG lCount ;
==========================
hello,
i had to hard reset my o2 xdaII wm2003 and after the reset, im unable to send/recieve sms's.
when i go the messages, i only have an account for activesync, but no account for SMS.
unfortunately, i cannot create one myself.
my presumption is this feature is on SIM - no matter how many times i have put the sim in, i still dont have an sms account.
now im thinking, if this has a dll for sms and im missing it in the windows folder.
my service provider had no clue what i was talking bout.
any help is greatly appreciated!!
thanks in advance - navyn.
(navynbs@gmail.com)
There is a problem in my smartphone. If i send a sms, my phone is can`t work properly, or stuck in long time. Or recieve sms, error reporting in (we`re sorry about inconvienence..... problem with device.exe..... Please help me?
I have read this board through, But I can't find any effective solution in sending mms with MAPI. I know it can be sent through wap in wm2003, however wapopen etc seems to work improperly. Any one can help me. thanks. If you have any suggestion, contract me with msn: bjtulan@hotmail.com thanks a lots.
I encountered the same problem as Kapil, anyone have any idea?
how can I iterate through the collection of received sms??
thank you to all
I'm writing my own GUI for messaging. With native MAPI APIs, my module can browse through alll the message stores, folders and messages and take actions on them. But I could not find an API for sync (send/recv) request. Although IMailSyncHandler interface is provided, this interface is provided to the developers for transport development. May you tell me how a message application request the mail synchronization? Thanks.
Hi Jeff,
There should be an API. Look for MailSyncMessages here:
Jay,
Thanks a lot. Yeah, it is there. But somehow, when I browsedthrough MAPI functions and did not find it yesterday.
How can I get the EntryID of a Subfolder(from its name) of the Inbox folder (or the EntryID of the "Deleted Items" folder)?
If this has been answered anywhere, please just direct me there, but I could not find the answer so far.
Hi Hendrik, try this:
from the message store, get the PR_IPM_SUBTREE_ENTRYID property, cast it to IMAPIFolder.
The call IMAPIFolder::GetHierarchyTable, and for each entry in the table you can the PR_DISPLAY_NAME as well as boolean listing whether it has subfolders (PR_SUBFOLDERS).
Thanks Jay ... got it working like a charm ... and thanks for the very quick response.
Great! Hendrik, because what I wrote was a little complicated, if you can post some sample code for the benefit of the rest of the readers? :)
Sure ... error handling is not yet what it should be, but ...
// **************************************************************************
// Function Name: OpenFolder
//
// Purpose: Open a folder by searching for its name
// Arguments:
// IN IMsgStore* pMsgStore - Message Store to search (already open)
// IN LPCWSTR *fNameArray - ptr to array containing full path of folder
// in Message Store, ie. {"Inbox", "Subfolder"}
// IN ULONG cfNameLevel - The nuber of folders in fNameArray
// OUT IMAPIFolder *pFolder - ptr to open folder if found and opened
// Return Values: HRESULT depending on success of MAPI operations
// ... and S_FALSE if any part of pathname not found
HRESULT OpenFolder(IMsgStore *pMsgStore, LPCWSTR *fNameArray, ULONG cfNameLevel, IMAPIFolder *pFolder) {
HRESULT hr;
SPropValue * rgprops = NULL;
ULONG rgTags[] = {1, PR_IPM_SUBTREE_ENTRYID};
ULONG cCount = 0;
ULONG level = 0;
SRowSet *prowset = NULL;
IMAPIFolder *pParentFolder;
static const SizedSPropTagArray (3, spta) = { 3, PR_DISPLAY_NAME, PR_ENTRYID, PR_SUBFOLDERS };
hr = pMsgStore->GetProps((LPSPropTagArray) rgTags, MAPI_UNICODE, &cCount, &rgprops);
if (FAILED(hr) || cCount != 1) {
goto Exit;
}
hr = pMsgStore->OpenEntry(rgprops[0].Value.bin.cb,
(LPENTRYID)rgprops[0].Value.bin.lpb,
NULL,
0,
(LPUNKNOWN *) &pParentFolder);
if (FAILED(hr)) {
while(SUCCEEDED(hr)) {
IMAPITable *ptbl = NULL;
hr = pParentFolder->GetHierarchyTable(0, &ptbl);
if (FAILED(hr)) {
goto Exit;
}
// set the columns of the table we will query
hr = ptbl->SetColumns((SPropTagArray *) &spta, 0);
bool found = false;
while (!found && SUCCEEDED(hr)) {
// Free the previous row
FreeProws (prowset);
prowset = NULL;
hr = ptbl->QueryRows (1, 0, &prowset);
if ((hr != S_OK) || (prowset == NULL) || (prowset->cRows == 0)) {
goto Exit;
}
if(!(prowset->aRow[0].cValues == spta.cValues)) {
continue;
SPropValue *pval = prowset->aRow[0].lpProps;
if(!(pval[0].ulPropTag == PR_DISPLAY_NAME)
|| !(pval[1].ulPropTag == PR_ENTRYID)
|| !(pval[2].ulPropTag == PR_SUBFOLDERS)) {
DEB((wchar_t *)fNameArray[level], (wchar_t *)pval[0].Value.lpszW);
if(!wcscmp(fNameArray[level], pval[0].Value.lpszW)) {
pParentFolder->Release();
hr = pMsgStore->OpenEntry(pval[1].Value.bin.cb,
(LPENTRYID)pval[1].Value.bin.lpb,
NULL,
0,
(LPUNKNOWN *)&pParentFolder);
if(FAILED(hr)) {
goto Exit;
}
found = true;
if(++level == cfNameLevel) {
pFolder = pParentFolder;
} else if(!pval[2].Value.b) {
hr = S_FALSE;
if(!found) {
hr = S_FALSE;
ptbl->Release();
Exit:
FreeProws (prowset);
MAPIFreeBuffer(rgprops);
if(FAILED(hr)) MAPIFreeBuffer(pParentFolder);
return hr;
Sorry ...
...should of course be ...IMAPIFolder **pFolder) { ...
...with the return setup by *pFolder = pParentFolder;
...else you won't exactly get the refernce back :)
...also ignore the DEB(... line, just some debug stuff that got left behind...
hi,
I can able to create an SMS inthe Message folder inthe Drafts and can send it. After sending the message It returns " Message Sent"/. How can i dissable them in coding.
Can you give me point to do it.
Hi Selva, it is not possible to turn off that notification.
Hi jayongg, I would like to know how to read the from/to/text of an SMS. thanks.
How to remove the account picker and still have the account created?
I saw some questions by Anton above and I was trying to do the same thing. I basically want to store and email body that is in HTML format. I don't even see the PR_HTML flag in the SDK. Can you please shed some light on how to store a message body in HTML format and have it properly rendered in Pocket Outlook ("Messaging" application on device).
Thanks, Joe
Joe, you can write your HTML directly into the PR_BODY_HTML_A stream property. You may also need to set the MSGSTATUS_HAS_PR_BODY_HTML flag.
The SizedSSortOrderSet macro creates a named SSortOrderSet structure that contains a specified number of sort orders.
SizedSSortOrderSet (_csort, _name)
With first parameter value as 1 (one) it works fine....
But when I pass 2 as first parameter , it gives me error. I want to perform categorised sort. Can't we use 2 sort orders ?
Early reply will be highly appreciable.
Jay - thanks for the answer. I am now able to display HTML email on my device. I cannot find a way to create an email, on the device, in HTML format. Is this even supported?
I forgot to mention that I am referring to using the "Messaging" application on the device to create my emails.
I met a problem: I use MailSyncMessages API in my code, and I do include "cemapi.h" and link with "cemapi.lib", but when link I still get link error like "error LNK2019: unresolved external symbol "long __cdecl MailSyncMessages(wchar_t const *,unsigned long)" (?MailSyncMessages@@YAJPB_WK@Z) referenced in function "public: long __cdecl CEMail::SyncMessages(class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsOS<wchar_t> > > const &)" (?SyncMessages@CEMail@@QAAJABV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsOS@_W@ATL@@@@@ATL@@@Z)
1>Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Release\TestMail.exe : fatal error LNK1120: 1 unresolved externals".
Does anyone know what I missed and how can I fix it?
Thanks a lot!
Hi Bruce,
you need to link to cemapi.lib.
Yes, I do. I tried two ways: in the project link setting or use #pragma comment(lib, "cemapi.lib"), but I still got that link error. That's why confused me.
Bruce,
I don't have the answer, but faced a similar problem with the samples for CEMAPI after applying SP1 for VS2005. I have found the same sample works fine for VS2008.
Hello,
I need help with some iPAQs.
We own approx. 100 x HP iPAQ 2210, 30 x HP iPAQ 2410 and 50 x HP iPAQ 2490 iPaqs.
We`re having trouble using MAPI to retrieve e-mail`s GUIDs in order to make remote configurations for our Sales Force Team. If we follow MS`s documentation, the code works properly in Visual Studio`s emulator, but not in our equipment. We have found that the iPaqs have a different value for PR_CE_UNIQUE_STORE_ID when we query the property pRows->aRow 0 lpProps ePR_CE_UNIQUE_STORE_ID .ulPropTag (MS says it must be 0x81130048 but the iPaq returns another value). And even if we change this value to match iPaq`s one, the GUID returned does not points to a valid e-mail account and thus we cannot use it to manage them. We need to solve this ASAP, since we have a deadline from our Audit team and this problem is hindering the delivery of the solution.
Please if someone have any idea how to solve it, please send me an e-mail: michelle.rosario@garoto.com.br
Best Regards.
Michelle Santos
Michelle,
I asked a colleague and this is what he said:
"The value of PR_CE_UNIQUE_STORE_ID should not be different for different devices. It’s more likely that the property query is returning a different proptag value because the property cannot be found. (I think the value is PT_ERROR.)
From what I can tell, the property only exists on accounts that are created via CSP. Maybe they are configuring the accounts differently on the iPaqs than on the emulator?"
-Luis Cabrera
I am also doing the same thing like Random was doing and I also struck in the same way.I do not know how link the my MMSForm.dll with exsisting GUI , I am creating the registries under,
HKEY_CURRENT_USER\\Software\\Microsoft\\Inbox\\MsgTypes\\IPM\\MMS
I cannot able to see in the messaging menu and the respective Form dll is not getting loaded, is there anything more I need to do. I was referring the SDK documents but I am getting confused. If you can give me some directions on this I will be greatful to you.
Varun,
make sure that you have:
HKLM\Software\Microsoft\Inbox\Svc\<service>\MsgClasses
has
"IPM.MMS" = dword:1
set
in addition make sure you have
HKLM\Software\Microsoft\Inbox\Svc\<service>
"name" and "dll"
your dll needs to implement FormFactoryEx.
hi jay
As per SDK documents for registering the form dll
"Registering Customized Messaging Forms "
we need to register as per following way
1 To register the form as a message class
2 To register the list of supported messaging transports
3 To register the list of supported message classes
For the above steps I am doing the following steps to register my dlls
HKEY_CURRENT_USER\Software\Microsoft\Inbox\MsgTypes\IPM\MMS
Name : MMS
Dll : MMSForm.dll
GlyphInfo :INBOXGLYPHINFO igInfo (structure init with appropriate values)
2To register the list of supported messaging transports
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Inbox\Svc\MMS
DLL : MMSTransporter.dll
UserCanCreate : 1
Port: 120
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Inbox\Svc\MMS\MsgClasses
IPM.MMS : 1
I am using the Form Dll which implement the FormFactoryEx api,which internally loads the MUI file and returns the appropriate HRESULT, we have already implemented the interfaces IFormProviderEx::CreateComposeForm
IFormProviderEx::CreateReadForm in my form dll
I want to is there anything which I might be missing or something else I need to do so that it can load my form dll
Varun, did you create an account that uses your MMS transport? you can use the email CSP to create one.
I also want to know after setting the new account as per
Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Transportdemo\readme.txt
I tried to set a new account for MMS but unfortunately ther is no change in the messaging menu... what I need to do so that I can hook that messaging menu to insert the MMS as new menu and when user pressed that menu it will launch ComposerForm through MMSForm.dll
If you have any clue or directions regarding this please suggest.
regards
varun
jay
what do you mean by email CSP and i tried to create the account as mentioned in
Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Transportdemo\readme.txt
I follow the steps which is mentioned in this txt, anything else which I need to do ?
How can i run this code in microsoftvisualstudio2008..
can u help me
is sms transport hardcoded?
i want to change that transport but it seems always tpcutil.dll gets loaded!
is there anyway to change that?
Look in HKLM\Software\Microsoft\Inbox\Svc\Sms, value "Dll". it is tpcutil.dll. If you wish to replace it, you can.
well i replace it but there is no effect!
for example replace it to tpcuitllllll.dll,just meaningless dll,i guess this way sms sending/recieving ,moving sms's around should not work!
but it works perfectly!
i also checked that if it gets loaded by tmail.exe,and it seems anyway tmail.exe loads this dll!
i didnt dig more because i saw this post,and then i came here!
so,should i implement a dll and see if replacing it seems ok,or just dont waste my time?
Hi jayongg
It seems I am experiencing the same problems as random regarding account creation.
I have created the registry keys, and then I attempt to create a message store, but CreateMsgStore() returns an error (E_INVALIDARG).
Do you have any idea what could cause this?
Thanks in Advance
Registry key creation:
------------------------
void RegisterVVMClient()
HKEY hKey;
DWORD dwDisp;
long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT, L"CLSID\\{BEB30194-AEAE-BFBF-CDCD-118CCE923125}\\InProcServer32", 0, NULL, 0, 0, NULL, &hKey, &dwDisp);
DEBUG_INS->Print("RegisterVVMClient\n");
if (lResult == ERROR_SUCCESS)
{
HMODULE hModule = GetModuleHandle(IMAGENAME);
if (hModule)
{
TCHAR szName[MAX_PATH];
if (GetModuleFileName(hModule, szName, ARRAYSIZE(szName)))
{
RegSetValueEx(hKey, NULL, 0, REG_SZ, (const BYTE *)szName, _tcslen(szName)*sizeof(TCHAR));
TCHAR szModel[] = L"Free";
RegSetValueEx(hKey, L"ThreadingModel", 0, REG_SZ, (const BYTE *)szModel, _tcslen(szModel)*sizeof(TCHAR));
RegCloseKey(hKey);
lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Inbox\\Svc\\VVM", 0, NULL, 0, 0, NULL, &hKey, &dwDisp);
DWORD dwValue = 1;
RegSetValueEx(hKey, L"{BEB30194-AEAE-BFBF-CDCD-118CCE923125}", 0, REG_DWORD, (const BYTE *)&dwValue, sizeof(DWORD));
RegCloseKey(hKey);
lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Inbox\\Svc\\VVM\\MsgClasses", 0, NULL, 0, 0, NULL, &hKey, &dwDisp);
RegSetValueEx(hKey, kszVVMMsgClass, 0, REG_DWORD, (const BYTE *)&dwValue, sizeof(DWORD));
lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Inbox\\Svc\\VVM_Transport", 0, NULL, 0, 0, NULL, &hKey, &dwDisp);
TCHAR szName[] = L"VVM_Transport";
RegSetValueEx(hKey, L"Name", 0, REG_SZ, (const BYTE *)szName, _tcslen(szName)*sizeof(TCHAR));
TCHAR szDll[] = L"TV_Inbox.dll";
RegSetValueEx(hKey, L"DLL", 0, REG_SZ, (const BYTE *)szDll, _tcslen(szDll)*sizeof(TCHAR));
DWORD dwValue = 1;
RegSetValueEx(hKey, L"UserCanCreate", 0, REG_DWORD, (const BYTE *)&dwValue, sizeof(DWORD));
dwValue = 0;
RegSetValueEx(hKey, L"Port", 0, REG_DWORD, (const BYTE *)&dwValue, sizeof(DWORD));
RegCloseKey(hKey);
lResult = RegCreateKeyEx(HKEY_CURRENT_USER, L"System\\State\\Messages\\VVM", 0, NULL, 0, 0, NULL, &hKey, &dwDisp);
{
TCHAR szName[] = L"VVM";
//RegSetValueEx(hKey, L"Account Name", 0, REG_SZ, (const BYTE *)kszVVMStoreName, _tcslen(kszVVMStoreName)*sizeof(TCHAR));
RegSetValueEx(hKey, L"Account Name", 0, REG_SZ, (const BYTE *)szName, _tcslen(szName)*sizeof(TCHAR));
RegCloseKey(hKey);
}
Message Store Creation:
-----------------------
HRESULT CRuleClient::CreateMsgStore(LPCWSTR pszDisplayName, IMsgStore ** ppMsgStore)
HRESULT hr=E_FAIL;
ICEMAPISession* pSession = NULL;
IMAPITable* pTable = NULL;
IMsgStore* pStore = NULL;
LPSRowSet FAR pRows = NULL;
DEBUG_INS->Print("CRuleClient::CreateMsgStore\n");
// Initialize MAPI
hr = MAPIInitialize(NULL);
CHR(hr);
// Obtain MAPI session
hr = MAPILogonEx(
0, // Handle to parent window
NULL, // Profile name
NULL, // Password
MAPI_NEW_SESSION |MAPI_EXTENDED |MAPI_LOGON_UI, // Logon flags
(LPMAPISESSION*)&pSession); // Resulting MAPI session
ppMsgStore = NULL;
hr = pSession->CreateMsgStore(/*pszDisplayName*/_T("VVM"), ppMsgStore);
hr = pSession->GetMsgStoresTable(0, &pTable);
hr = pTable->QueryRows(1, 0, &pRows);
hr = pSession->OpenMsgStore(
0,
pRows->aRow[0].lpProps[0].Value.bin.cb,
(ENTRYID *)pRows->aRow[0].lpProps[0].Value.bin.lpb,
NULL,
&pStore);
DEBUG_INS->Print("CRuleClient::CreateMsgStore ERROR!\n");
if(pTable)
pTable->Release();
if(pRows)
FreeProws(pRows);
if(ppMsgStore && *ppMsgStore)
(*ppMsgStore)->Release();
pSession->Logoff(0, 0, 0);
return hr;
Hi Selva, you can turn off the notification using PR_CE_NO_NOTIFICATION. Set this in ulPropTag field of 'SPropValue' and invoke SetProps. You would see the message notification not being displayed.
Jay, Could you please help me with setting status of the outgoing SMS. I could dig out 'PR_MSG_STATUS' field as ulPropTag, but could not find an appropriate one for 'Value.ul' Appreciate your help. Thanks!
How do we delete an account? I created email account that appears as Other (POP/IMAP). How can I delete it through API (C/C++) or .NET?
I can see that it can be deleted from messaging application but couldn't find any API., I want to know can read mms through MAPI in windows mobile 6?
because i'm think SMS MMS box is combined in windows mobile 6
I use:
SPropValue rgProps[4] = {0};
int rgValues = 0;
rgProps[rgValues].ulPropTag = PR_CE_HIDE_FROM_TODAY_PAGE;
rgProps[rgValues].Value.b = TRUE;
rgValues++;
// prevent default notification
rgProps[rgValues].ulPropTag = PR_CE_NO_NOTIFICATION;
pMsg->SetProps(rgValues, rgProps, NULL);
and the default notification sounds still is playing...
note:
when I add to the above:
rgProps[rgValues].ulPropTag = PR_MESSAGE_FLAGS;
rgProps[rgValues].Value.ul = MSGFLAG_READ;
the sound does not play. of course (?)
Of course, I undestand, that PR_CE_NO_NOTIFICATION is for pop-up (bubble) notification.
but how to prevent from default sound notification too?
I think about MRC_HANDLED_DONTCONTINUE
but when someone uses also another mapi-rule application, this state breaks that 3rd parts function too, isn't it?
I want to create a new message store and see it displayed alongside the existing message stores in the Messaging application.
I call CreateMsgStore and it returns OK, and I can then enumerate using GetMsgStoresTable and I see my new store has been created.
I don't however see my message store displayed in the messaging application.
Is there something else I need to do? Are there registry keys I also need to set?
I am using MAPI to retrieve contact information from outlook. I am using outlook 2007.
I am able to get most of the contact fields, But i am not able to get Contact Image data.
Do you have any idea about this? i really need help on it.
Hi All!
As I understand, nobody finished the task - sending MMS. Is working code exist? Thanks.
Hi Jay/all,
If I tap into mapi (cemapi.dll) from managed code (C#) using com interop is this supported and/or wise. I note that the desktop mapi libraries are not supported by MS when used with managed code. If it is 'ok' to access cemapi.dll from managed C# then does anyone have any examples of how to call, say, IMAPITable.SetColumns (I've got code working as far as IMAPISession.GetMsgStoresTable but I'm stuck trying to define my prop array in C# for the SetColumns call). Any help would be hugely appreciated - thanks very much!
Can this MAPI stuff be done in visual basic?
if so can you post the example code
I love to see some why to send email from visual basic too..
Hi Can you plz help me out in sending an MMS from windows mobile using c#. | http://blogs.msdn.com/windowsmobile/archive/2007/03/21/getting-started-with-mapi.aspx | crawl-002 | refinedweb | 8,711 | 66.03 |
SciPy Tutorial
[+:
SciPy is a scientific computation library that uses NumPy underneath.
SciPy stands for Scientific Python.
Learning by Reading
We have created 10 tutorial pages for you to learn the fundamentals of SciPy:
Learning by Quiz Test
Test your SciPy skills with a quiz test.
Learning by Exercises
Learning by Examples
In our "Try it Yourself" editor, you can use the SciPy module, and modify the code to see the result.
Example
How many cubic meters are in one liter:
from scipy import constantsTry it Yourself »
print(constants.liter)
print(constants.liter)
Click on the "Try it Yourself" button to see how it works. | https://localdev.w3schools.com/python/scipy/index.php | CC-MAIN-2022-40 | refinedweb | 105 | 62.88 |
Note: the base problem for me is to be able to access a network share that I (Win 7 admin user) have set up when I run an elevated program. Normally the elevated program will not have access to my non-elevated network shares.
According to Microsoft the registry setting EnableLinkedConnections will allow elevated processes to access the network share of the currently logged in (non-elevated) explorer process.
This explanation makes some sense:
[...]. [...]
This forum thread asks about the vulnerabilities opened by this setting. The answer given links to an article about disabling UAC prompts (or so I understand).
The question now is, what does the registry setting EnableLinkedConnections do or allow on a Windows 7 system, given that we are not running in a domain environment.
Edit: One thing that I'm specifically interested in is whether this setting only affects the (visibility of) network drives or whether it has any other implications.
Not having source access to Windows it's difficult to say anything that isn't speculation. That disclaimer aside, here's what I've been able to glean by reading up on this:
UAC creates two security tokens on logon: the elevated token containing the user's full group memberships, and the restricted token which has membership of the "Administrators" group stripped out. Each token contains a distinct locally unique ID (LUID) that identifies the logon session. They are two separate and distinct logon sessions.
Starting in Windows 2000 Server SP2, mapped drives (which are represented as symlinks in the object manager namespace) are tagged with the LUID of the token that created them (you can find some Microsoft references to this behavior in this KBase article, and you can learn more about the mechanics of the feature in this blog posting). The gist of the feature is that mapped drives created by one logon session are not accessible to another logon session.
Setting the EnableLinkedConnections value triggers a behaviour in the LanmanWorkstation service and the LSA security subsystem (LSASS.EXE) to cause LSA to copy drives mapped from by either one of the users' tokens into the context of the other token. This allows drives mapped with the elevated token to be visible to the restricted token and the converse. There isn't any peculiarity of the behavior of this feature w/ respect to a domain versus non-domain environment. If your users are running with "Administrator" accounts in a non-domain environment their restricted tokens and elevated tokens, by default, will have independent drive mappings.
In terms of vulnerabilty, official documentation from Microsoft seems to be lacking. I did find a comment and a response from a Microsoft employee asking about the potential vulnerabilities in a conversation about UAC from 2007. Given that the answer comes from Jon Schwartz, who, at the time, was titled "UAC Architect", I'd tend to consider his answer having credibility. Here's the gist of his answer to the following inquiry: "...I have not found any information to describe what is actually happening technically or if this opens any kind of UAC loopholes. Can you comment?"
Technically, it opens a small loophole since non-elevated malware can now "pre-seed" a drive letter + mapping into the elevated context -- that should be low-risk unless you end up with something that's specifically tailored to your environment.
Personally, I can't think of a way to "exploit" this loophole, insofar as "seeding" the elevated token with a drive mapping would still require the user to actually elevate and execute something malicious from that "seeded" drive mapping. I'm not a security researcher, though, and I may not be approaching this with a good mind-set to come up with potential exploits.
I've dodged using the EnableLinkedConnections value in my Customer sites by continuing the trend that we began when Customers started deploying Windows NT 4.0-- having users logon with limited user accounts. That's worked well for us for years and continues to work well in Windows 7.
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
Simply put, it links your super-user credentials with your normal credentials. It is of course more complex, but basically, even your "administrator" account on windows 7 is not an admin, but needs to do the equivalent of SUDO on linux to perform a multitude of operations. When you map a network drive, you need to do this, but the network drive only becomes mapped for the super-user, not the normal user. This registry setting links the super-user credentials with your standard ones for the purpose of mapped drives. This way, both can access the mapped drive instead of just the super-user.
By posting your answer, you agree to the privacy policy and terms of service.
asked
4 years ago
viewed
18255 times
active | http://serverfault.com/questions/182758/what-does-registry-setting-enablelinkedconnections-do-on-a-technical-level/185885 | CC-MAIN-2015-18 | refinedweb | 817 | 50.97 |
I know there are a load of solutions out there already, but nothing that I could see that were as simple as I needed, or as flexible. In particularly I have one project which uses the core code across three sets of servers that do very different things – a webserver, a number of emailservers that prepare and send emails for a short period each day so are brought into existence with an AWS auto-scaling group, and a number of imageservers which don’t serve static images and these are always running but scale up and down with load. Each one runs a different set of cronjobs. And some cronjobs run every minute.
As AWS auto-scaling groups rely on defining the AMI and changing these is a bit of messing about I would prefer to minimise, I wanted the cronjobs under source control, and for them to be updated when the code base is updated on boot for the new machines brought up when scaling. And I want to be able to push crontab changes to any servers that are running when I deploy new code. And I have some servers that run more than one codebase (it’s complicated), so I can’t overwrite any existing crontab when adding cronjobs.
My first thought was to have a few files in a crontabs folder under git, symlink to the correct one from /etc/cron.d and that would be enough. Well, any file linked to in /etc/cron.d must be owned by root and not readable by anyone else. Which led to some permissions changes which ultimately breaks my deployment process with fabric. And a change of thinking. In the end, I have gone with this:
From boot:
In crontab for login user: @reboot /var/www/project/crontabs/reboot.sh suffix > /dev/null 2>&1 In reboot.sh: #! /bin/bash # Takes an argument that matches one of the crontabs.* files in the project webroot # Strips all lines between the CRONTAB_START and CRONTAB_END and inserts the matching file if [ -z "$1" ] then exit fi WEBROOT=/var/www PROJECT=myproject CRONTAB_START='# MYPROJECT START' CRONTAB_END='# MYPROJECT END' (crontab -l | sed "/^$CRONTAB_START/,/^$CRONTAB_END/d"; cat $WEBROOT/$PROJECT/crontabs/crontabs.$1) | crontab -
So the crobjob just kicks off a bash script with a parameter of ‘suffix’. This will allow me to call different files for the different flavours of production servers, and dev server. The bash script has a few variables to define, but here they all use ‘myproject’ or some variant.
The clever bit outputs the existing crontab, strips anything between and including CRONTAB_START and CRONTAB_END, then appends the correct crontabs.suffix file for the login user. So on boot, the script deletes what was there already for this project without affecting anything else in the crontab file, adds in the current version of the crontabs for this server, based on the file suffix, and the job is done. The crontab.* files look something like:
# MYPROJECT START # Build every minute throughout the day * * * * * curl "" > /dev/null 2>&1 # MYPROJECT END
For running servers, I use a fabfile that does pretty much the same thing:
from fabric.api import * env.user = 'user' env.key_filename = '/home/mark/.pem/server.pem' WEBROOT = '/var/www' PROJECT = 'myproject' CRONTAB_START = '# MYPROJECT START' CRONTAB_END = '# MYPROJECT END' # Other code stripped out for brevity def production(): env.hosts = [''] def crontab(file): run("(crontab -l | sed '/^%s/,/^%s/d'; cat %s/%s/crontabs/crontabs.%s) | crontab -" % (CRONTAB_START, CRONTAB_END, WEBROOT, PROJECT, file))
So to update the crontab on a running server, I can do something like this and the old cronjobs will be stripped from the crontab, and the contents of the file crontabs.emailserver (in this example) will be appended to it
fab production crontab:file=emailserver
Time will show if it’s worthwhile doing this. The crontabs are reasonably static. But when they do change, this will avoid recreating AMIs for the sake of small alterations or additions. | http://blog.somsip.com/2013/06/deploying-crontabcronjobs-with-php-projects/ | CC-MAIN-2019-30 | refinedweb | 657 | 69.21 |
Step 9
By default, Entity Framework will look for or create a table in a database with the same name as that of the class and here the class names are Student and Course. But in SQL Server the table name is tblStudent and tblCourse. So, in order to map these classes with the database tables we can use the Table attribute in which we will pass the database table name. This Table attribute is present in the System.ComponentModel.DataAnnotations.Schema namespace. And in the global.asax file, we will add the following code: Since we are not creating a new database we need to pass null. We have created our Model. Build the solution.
View All
Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free. | https://www.c-sharpcorner.com/UploadFile/219d4d/working-with-multiple-tables-in-mvc-using-entity-framework/ | CC-MAIN-2018-17 | refinedweb | 129 | 74.29 |
FileNotFoundError
I got an error when my program tried to open file f=open('dia.dat','r') if it starts from home screen.No errors if it starts from IDE. Error message:
FileNotFoundError
[Errno 2] No such file or directory: 'via.dat'
How to fix the problem?
iPhone 5SE iOS 10.3.3
When you run a script from the editor, the path is changed to the folder containing the script.
From the console, you might need a os.chdir.
When you get this error, try in the console:
import os print(os.path.abspath('.'))
Thank you! Now I can read file and also open .pyui file when program starts from home screen. | https://forum.omz-software.com/topic/4324/filenotfounderror | CC-MAIN-2022-21 | refinedweb | 113 | 87.52 |
On Thu, Oct 11, 2012 at 11:57:24PM +0200, Vincent Bernat wrote: > ❦ 11 octobre 2012 20:26 CEST, Steve Langasek <vorlon@debian.org> : > >>. > About the first part of the sentence, this is a good way to get a whole > community against us if it becomes publicized. We'll be happy to work > for a distribution that nobody uses because nobody likes us any more. I have no problem with the above statement being publicized. The rude behavior of node.js upstream in regard to their namespace handling is already well known. I'm not going to meekly pretend that their behavior is ok for fear of angering whatever the node.js equivalent of the Slashdot crowd is. The TC resolution carefully balanced the needs of both sets of users, but as for node.js upstream, they receive my full scorn for their role in this as namespace hijackers. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer slangasek@ubuntu.com vorlon@debian.org
Attachment:
signature.asc
Description: Digital signature | https://lists.debian.org/debian-devel/2012/10/msg00202.html | CC-MAIN-2015-32 | refinedweb | 187 | 67.45 |
This is another post based on a demo from my SQLSaturday session about Python integration in Power BI. The data file is also available from this link or download your own file from the Reserve Bank link below.
It is a pattern I use fairly often because flat files lend itself to the artistic license of the data provider i.e. they can do just about anything they want with the flat file.
Lets take a look at a real world example. The South African Reserve Bank provides daily exchange rate data (ZAR per USD) through an embedded Reporting Services environment. When you download the data as Comma Separated Value (CSV), this is what you get:
The data represents 3 days of data. We only require the section indicated as “useful data”. If you look at the file structure carefully, you will notice that it could still be treated as a CSV file. When you open the file with the Query Editor, you will see that Power BI already treats the file like a CSV (or an Excel file that does not have all cells populated).
I am going to illustrate two methods of dealing with this in Python. You may encounter scenarios where either one could be useful.
Method 1: Treat the file as CSV
This method will essentially mimic what the Power BI Query Editor does with the file. We will use the Pandas read_csv method, but we will use some parameters to handle our requirements. Without indicating that there are three columns, read_csv will throw an exception when it encounters a third field further down the file. To indicate three columns we simply specify the columns.
import pandas df = pandas.read_csv('D:\\data\\dirty\\ExchangeRateDetail.csv', skiprows=4, names =['Date','Value','Extra'])
You will notice that we have ignored the first four rows that we don’t need.
From this point on its a simple process that we have encountered in previous posts. We are going to do three things to get the file into a ready to use state:
- Drop the extra column
- Remove (filter) unwanted rows
- Explicitly cast the data types
import pandas df = pandas.read_csv('D:\\data\\dirty\\ExchangeRateDetail.csv', skiprows=4, names =['Date','Value','Extra']) df = df.drop(['Extra'], axis=1) # drop "Extra" column df = df[df.Date != 'The Value'] # filter rows df = df[df.Date != 'The Value_label'] # filter rows df['Date'] = pandas.to_datetime(df['Date']) # explicit data type cast df['Value'] = pandas.to_numeric(df['Value']) # explicit data type cast
The final output can now be used as a Python data source in Power BI
Method 2: Read the file line by line
In this example we will read the data line by line. Each line will get add to a list i.e. we will end up with a list of lines. We will then use some list comprehension techniques filter the data before adding it to a dataframe.
with open('D:\\data\\dirty\\ExchangeRateDetail.csv') as f: lines = [line for line in f]
The new line characters form part of the line as shown below in our list where each item is a line in the file.
There are also special characters at the start of the file, but we dont need to worry about this as we will not use this item in the list.
To strip off the “\n” we will use the rstrip method which removes characters from the right hand side of a string. By not specifying a character, whitespace characters are removed. This includes “\n”.
with open('D:\\data\\dirty\\ExchangeRateDetail.csv') as f: lines = [line.rstrip() for line in f]
With the newline removed, we can now start filtering the list of items(lines). We start by filtering out the empty items (blank lines).
lines = list(filter(None, lines))
Next we remove the first 3 items, but keep the rest of the list.
lines = lines[3:]
Our final filter condition is to remove all items that start with “The”
lines = [t for t in lines if not t.startswith('The')]
Now our list is ready to convert to a dataframe.
import pandas df = pandas.DataFrame(lines)
Note that we end up with a single column (0) dataframe. Our final steps to get the dataframe into a ready to use state are:
- split the column on comma separator
- drop the original column
- Explicitly cast the data types
Lets put a complete final script together that include the final steps.
import pandas with open('D:\\data\\dirty\\ExchangeRateDetail.csv') as f: lines = [line.rstrip() for line in f] lines = list(filter(None, lines)) # drop blank lines lines = lines[3:] # remove top rows lines = [t for t in lines if not t.startswith('The')] # remove rows starting with "The" df = pandas.DataFrame(lines) # add remaining rows to a dataframe df['Date'] = pandas.to_datetime(df[0].str.split(',').str.get(0)) # split of the Date column df['Value'] = df[0].str.split(',').str.get(1) # split off the value column df = df.drop([0], axis=1) # drop the original column (0) df['Date'] = pandas.to_datetime(df['Date']) # explicit data type cast df['Value'] = pandas.to_numeric(df['Value']) # explicit data type cast
The final result is the same as method 1.
Hopefully that provides some ideas on how to deal with flat files in general. As mentioned at the start of this post, it is often challenging to deal with flat files as it is up to the data provider to produce a well structured file. | https://dataideas.blog/2018/09/24/reshaping-ugly-csv-with-python/?share=google-plus-1 | CC-MAIN-2020-34 | refinedweb | 916 | 64.81 |
Hello,. And yes, I don't like the ``the above is not true, read info'' sentences added to each manpage. In ancient times, the GNU project tried to replace manpages by the info system. Though this has some resonance among emacs users, in general the concept failed, and I think it's time to accept that manpages will exist forever, as Fortran will. ;-): when was awk invented? GNU awk comes with a complete man page, which is good, yet it is not the best manual possible. It comes also with it's texinfo manual, which is a hypertext-version of a nicely written book, which teaches you the issues very gently, yet it also serves as a reference manual. In both these roles, the hyperlinks come very handy. Another documentation which shows that the man format don't fit ideally for it is procmail. Do you feel it is right that I have to remember that the tutorial is invoked by ``man procmailex''? Then you have the manual for Autoconf: besides documenting the usage of the programs delivered, which fit the manpage framework perfectly, there is a long section about portable shell programming. That wouldn't fit into manpages very well. The Automake manual is another example of thing which benefits from being written in a sane hypertext markup. Yes, there were attempts to abuse the manpage system to ``make it do''. TCL/Tk abused the section for C library calls, and placed more than 700 new manpages there. Others create new sections, which is more sane. But both of these solutions pollute the namespace. Would you still consider man so handy if ``man -a open'' would displayed dozen pages? Then there is Perl, which somehow combines the above two: the Perl itself brings more than hundred perl* pages to section 1, and then there is the 3pm manual section. All the above examples how that there is huge amount of documentation which doesn't belong to manpages. > It is counterproductive to have two distinct and seperate sets of > information for the same command... [...] Actually there are three: info, man, and --help. Each of them has it's role, --help is always at hend, but it's too terse to be usable. The manpage is a quick handy reference. And then there is the whole manual, written in a full-fledged hypertext markup. Yes, there should be one ultimate source for the three. Naturally, it should be the biggest one, the shorter ones should be excerpts. AFAIK, no one has solved this. BTW: I'd like to speak against help2man here: the above explains that man should have more information than --help. help2man creates too terse manpage from too long --help. (The --help need not otherwise list all options, or could rely that the names of some are self-explaining.) So the problem is clear: how can one have one ultimate source for info, man and possibly also --help? I think that a well-written proposal could be of great help. Have a nice day, Stepan | http://lists.gnu.org/archive/html/bug-texinfo/2006-04/msg00031.html | CC-MAIN-2014-41 | refinedweb | 506 | 73.27 |
This structure represents an External Route configuration.
#include <
include/openthread/netdata.h>
This structure represents an External Route configuration.
Member Data Documentation
◆ mNextHopIsThisDevice
TRUE if the external route entry's next hop is this device itself (i.e., the route was added earlier by this device).
FALSE otherwise.
This value is ignored when adding an external route. For any added route the next hop is this device.
◆ mRloc16
The Rloc associated with the external route entry.
This value is ignored when adding an external route. For any added route, the device's Rloc is used.
◆ mStable
TRUE, if this configuration is considered Stable Network Data.
FALSE, otherwise.
The documentation for this struct was generated from the following file:
- include/openthread/
netdata.h | https://docs.silabs.com/openthread/latest/structotExternalRouteConfig | CC-MAIN-2021-39 | refinedweb | 122 | 52.46 |
JavaFX Dialogs: How to set min-size and prevent closing?javafx
In this post I will write about two problems with JavaFX dialogs and how to solve them: How can you set a minimal size for a dialog and how can you prevent the dialog from closing?
How to set a min-size for JavaFX Dialogs?
If you create a JavaFX Application Window without further configuration, you can resize the window without limitations. This means you can change the size so that no content is visible anymore.
To prevent this you have to set a
minHeight and
minWidth on the
Stage of the window:
public class TestApp extends Application { @Override public void start(Stage primaryStage) { VBox root = new Vbox(); primaryStage.setMinHeight(200); primaryStage.setMinWidth(200); primaryStage.setScene(new Scene(root, 400, 400); primaryStage.show(); } }
With Dialog you have a similar situation. By default JavaFX Dialogs are not resizeable but it is possible to change this default behavior. However, if the Dialog is set to be resizeable you are then able to minimize the size to 0 pixel like with the application window. In contrast to the main application window you can't set the min-size on the Dialog though. At least not directly.
To fix this you have to set the min-size on the stage of the dialog. This can be done like this:
Dialog dialog = new Dialog<>(); dialog.setResizable(true); final Window window = dialog.getDialogPane().getScene().getWindow(); Stage stage = (Stage) window; stage.setMinHeight(200); stage.setMinWidth(200);
How to prevent the closing of a Dialog.
Another situation that we were facing in a real-world app lately was to prevent closing of a JavaFX Dialog when some validation logic has failed.
In the JavaDoc for the
Dialog class
you can find two paragraphs that look promising at a first glance: "Dialog Validation / Intercepting Button Actions" and
"Dialog Closing Rules".
The first one tells you how you can add validation rules for dialog buttons and how to prevent the dialog from closing if the condition is not met when attempting to close the dialog.
With the
lookup method of the
DialogPane you can get the buttons of the Dialog and add EventFilters on them. If your
validation fails you can consume the event to prevent the Dialog from closing:
Dialog dialog = new Dialog(); dialog.getDialogPane().getButtonTypes.addAll(ButtonType.OK, ButtonType.CANCEL); TextField textField = new TextField(); dialog.getDialogPane().setContent(textField); // Create an event filter that consumes the action if the text is empty EventHandler<ActionEvent> filter = event -> { if(textField.getText().isEmpty()) { event.consume(); } }; // lookup the buttons Button okButton = (Button) dialog.getDialogPane().lookup(ButtonType.OK); Button cancelButton = (Button) dialog.getDialogPane().lookup(ButtonType.CANCEL); // add the event-filter okButton.addEventFilter(ActionEvent.ACTION, filter); cancelButton.addEventFilter(ActionEvent.ACTION, filter);
The code above creates a Dialog with a TextField and two Buttons (OK and CANCEL). You can't close the dialog with these buttons as long as the TextField is empty. In many situations this may not be your desired behavior: Typically you like to prevent closing with the OK Button but allow the user to cancel the action and close the dialog with the CANCEL button. However, in other situations you may want to achive exactly this: Prevent the closing even when the cancel button is pressed. So everything is ok with this code? Not quite. You can still click the "x" in the window of the dialog and the Dialog will close no matter what your validation says.
This is when the second part of the JavaDoc page comes into play. It describes the rules when it's possible to close a Dialog "abnormally" (which includes clicking the "x" but also pressing some OS specific shortcut like Alt+F4 on Windows). These rules are not bad. You can only close a dialog this way if the dialog has a CANCEL Button. From a usability perspective this makes sense: If the user can't finish the process in the dialog she may want cancel it either by pressing the cancel button of the dialog or the "x" in the window title.
But what if (for some reasons) you have other requirements? What if you have to prevent the closing even though it might not result in good usability? For this usage there is no easy API available.
But it is still possible with some workarounds: In JavaFX you can prevent the closing of a
Stage by adding an
event-filter with the
setOnCloseRequest method. With this knowledge you can use the same approach from the beginning
of this article to access the Stage of the dialog to add this event-filter:
Stage stage = (Stage) dialog.getDialogPane().getScene().getWindow(); stage.setOnCloseRequest(event -> { if(tf.getText().isEmpty()) { event.consume(); } }); | https://lestard.eu/2018/dialogs_minsize_closing/ | CC-MAIN-2019-22 | refinedweb | 785 | 54.93 |
import "grpc.go4.org"
Package grpc implements an RPC system called gRPC.
See for more information about gRPC.
WARNING: this is an EXPERIMENTAL and unsupported version of the official gRPC-Go package. For the official version, see. For information about this experimental version, see
backoff.go call.go clientconn.go doc.go interceptor.go rpc_util.go server.go stream.go temp.go trace.go
SupportPackageIsVersion4 is referenced from generated protocol buffer files to assert that that code is compatible with this version of the grpc package.
This constant may be renamed in the future if a change in the generated code requires a synchronised update of grpc-go and protoc-gen-go. This constant should not be referenced from any other code.
var ( // ErrClientConnClosing indicates that the operation is illegal because // the ClientConn is closing. ErrClientConnClosing = errors.New("grpc: the client connection is closing") // ErrClientConnTimeout indicates that the ClientConn cannot establish the // underlying connections within the specified timeout. // DEPRECATED: Please use context.DeadlineExceeded instead. This error will be // removed in Q1 2017. ErrClientConnTimeout = errors.New("grpc: timed out when dialing") )
var ( DefaultBackoffConfig = BackoffConfig{ MaxDelay: 120 * time.Second, baseDelay: 1.0 * time.Second, factor: 1.6, jitter: 0.2, } )
DefaultBackoffConfig uses values specified for backoff in.
EnableTracing controls whether to trace RPCs using the golang.org/x/net/trace package. This should only be set before any RPCs are sent or received by this program.
var ( // ErrServerStopped indicates that the operation is now illegal because of // the server being stopped. ErrServerStopped = errors.New("grpc: the server has been stopped") )
Code returns the error code for err if it was produced by the rpc system. Otherwise, it returns codes.Unknown.
ErrorDesc returns the error description of err if it was produced by the rpc system. Otherwise, it returns err.Error() or empty string when err is nil.
Errorf returns an error containing an error code and a description; Errorf returns nil if c is OK.
func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) error
Invoke sends a non-streaming RPC request on the wire and returns after a response is received.
Invoke is generally only called by generated code.
SendHeader sends header metadata. It may be called at most once. The provided md and headers set by SetHeader() will be sent.
SetHeader sets the header metadata. When called multiple times, all the provided metadata will be merged. All the metadata will be sent out when one of the following happens:
- grpc.SendHeader() is called; - The first response is sent out; - An RPC status is sent out (error or success).
SetTrailer sets the trailer metadata that will be sent when an RPC returns. When called more than once, all the provided metadata will be merged.
type BackoffConfig struct { // MaxDelay is the upper bound of backoff delay. MaxDelay time.Duration // contains filtered or unexported fields }
BackoffConfig defines the parameters for the default gRPC backoff strategy.
Deprecated: don't use for now.
Deprecated: don't use for now.
CallOption configures a Call before it starts or extracts information from a Call after it completes.
func FailFast(failFast bool) CallOption
FailFast configures the action to take when an RPC is attempted on broken connections or unreachable servers. If failfast is true, the RPC will fail immediately. Otherwise, the RPC client will block the call until a connection is available (or the call is canceled or times out) and will retry the call if it fails due to a transient error. Please refer to
func Header(md *metadata.MD) CallOption
Header returns a CallOptions that retrieves the header metadata for a unary RPC.
func Trailer(md *metadata.MD) CallOption
Trailer returns a CallOptions that retrieves the trailer metadata for a unary RPC.
ClientConn is a gRPC client.
Despite its name, it is not necessarily a single connection. Depending on its underlying transport, it could be using zero or multiple TCP or other connections, and changing over time.
func Dial(target string, opts ...DialOption) (*ClientConn, error)
Dial is the old way to create a gRPC client.
Deprecated: use NewClient instead. This only exists to let existing code in the wild work.
func DialContext(ctx context.Context, target string, opts ...DialOption) (*ClientConn, error)
DialContext is the old way to create a gRPC client.
Deprecated: use NewClient instead.
func NewClient(hc *http.Client, target string, opts ...DialOption) (*ClientConn, error)
NewClient returns a new gRPC client for the provided target server. If the provided HTTP client is nil, http.DefaultClient is used. The target should be a URL scheme and authority, without a path. For example, "" for TLS or "" for unencrypted HTTP/2.
The returned type is named "ClientConn" for legacy reasons. It does not necessarily represent one actual connection. (It might be zero or multiple.)
func (cc *ClientConn) Close() error
Close tears down the ClientConn and all underlying connections.
type ClientStream interface { // Header returns the header metadata received from the server if there // is any. It blocks if the metadata is not ready to read. Header() (metadata.MD, error) // Trailer returns the trailer metadata from the server, if there is any. // It must only be called after stream.CloseAndRecv has returned, or // stream.Recv has returned a non-nil error (including io.EOF). Trailer() metadata.MD // CloseSend closes the send direction of the stream. It closes the stream // when non-nil error is met. CloseSend() error Stream }
ClientStream defines the interface a client stream has to satisfy.
func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error)
NewClientStream creates a new Stream for the client side. This is called by generated code.
type Codec interface { // Marshal returns the wire format of v. Marshal(v interface{}) ([]byte, error) // Unmarshal parses the wire format into v. Unmarshal(data []byte, v interface{}) error // String returns the name of the Codec implementation. The returned // string will be used as part of content type in transmission. String() string }
Codec defines the interface gRPC uses to encode and decode messages.
type Compressor interface { // Do compresses p into w. Do(w io.Writer, p []byte) error // Type returns the compression algorithm the Compressor uses. Type() string }
Compressor defines the interface gRPC uses to compress a message.
func NewGZIPCompressor() Compressor
NewGZIPCompressor creates a Compressor based on GZIP.
ConnectivityState indicates the state of a client connection.
const ( // Idle indicates the ClientConn is idle. Idle ConnectivityState = iota // Connecting indicates the ClienConn is connecting. Connecting // Ready indicates the ClientConn is ready for work. Ready // TransientFailure indicates the ClientConn has seen a failure but expects to recover. TransientFailure // Shutdown indicates the ClientConn has started shutting down. Shutdown )
func (s ConnectivityState) String() string
type Decompressor interface { // Do reads the data from r and uncompress them. Do(r io.Reader) ([]byte, error) // Type returns the compression algorithm the Decompressor uses. Type() string }
Decompressor defines the interface gRPC uses to decompress a message.
func NewGZIPDecompressor() Decompressor
NewGZIPDecompressor creates a Decompressor based on GZIP.
DialOption is a client option.
Despite its name, it does not necessarily have anything to do with dialing.
TODO: rename this.
func WithBalancer(b Balancer) DialOption
Deprecated: don't use for now.
func WithCodec(c Codec) DialOption
WithCodec returns a DialOption which sets a codec for message marshaling and unmarshaling.
func WithCompressor(cp Compressor) DialOption
WithCompressor returns a DialOption which sets a CompressorGenerator for generating message compressor.
func WithDecompressor(dc Decompressor) DialOption
WithDecompressor returns a DialOption which sets a DecompressorGenerator for generating message decompressor.
func WithInsecure() DialOption
WithInsecure returns a DialOption which disables transport security for this ClientConn. WithInsecure is mutually exclusive with use of WithTransportCredentials or https endpoints.
func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption
WithPerRPCCredentials returns an option which sets credentials which will place auth state on each outbound RPC.
func WithStatsHandler(h stats.Handler) DialOption
WithStatsHandler returns a DialOption that specifies the stats handler for all the RPCs and underlying network connections in this ClientConn.
func WithTransportCredentials(creds credentials.TransportCredentials) DialOption
WithTransportCredentials is controls whether to use TLS or not for connections.
Deprecated: this is only respected in a minimal form to let existing code in the wild work. Uew NewClient instead.
func WithUserAgent(s string) DialOption
WithUserAgent returns a DialOption that specifies a user agent string for all the RPCs.
type MethodConfig struct { // WaitForReady indicates whether RPCs sent to this method should wait until // the connection is ready by default (!failfast). The value specified via the // gRPC client API will override the value set here. WaitForReady bool // Timeout is the default timeout for RPCs sent to this method. The actual // deadline used will be the minimum of the value specified here and the value // set by the application via the gRPC client API. If either one is not set, // then the other will be used. If neither is set, then the RPC has no deadline. Timeout time.Duration // MaxReqSize is the maximum allowed payload size for an individual request in a // stream (client->server) in bytes. The size which is measured is the serialized, // uncompressed payload in bytes. The actual value used is the minumum of the value // specified here and the value set by the application via the gRPC client API. If // either one is not set, then the other will be used. If neither is set, then the // built-in default is used. // TODO: support this. MaxReqSize uint64 // MaxRespSize is the maximum allowed payload size for an individual response in a // stream (server->client) in bytes. // TODO: support this. MaxRespSize uint64 }
MethodConfig defines the configuration recommended by the service providers for a particular method. This is EXPERIMENTAL and subject to change.
MethodDesc represents an RPC service's method specification.
type MethodInfo struct { // Name is the method name only, without the service name or package name. Name string // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool }
MethodInfo contains the information of an RPC including its method name and type.
Server is a gRPC server to serve RPC requests.
func NewServer(opt ...ServerOption) *Server
NewServer creates a gRPC server which has no service registered and has not started to accept requests yet.
func (s *Server) GetServiceInfo() map[string]ServiceInfo
GetServiceInfo returns a map from service names to ServiceInfo. Service names include the package names, in the form of <package>.<service>.
GracefulStop stops the gRPC server gracefully. It stops the server to accept new connections and RPCs and blocks until all the pending RPCs are finished.
func (s *Server) RegisterService(sd *ServiceDesc, ss interface{})
RegisterService register a service and its implementation to the gRPC server. Called from the IDL generated code. This must be called before invoking Serve.
Serve accepts incoming connections on the listener lis, creating a new ServerTransport and service goroutine for each. The service goroutines read gRPC requests and then call the registered handlers to reply to them. Serve returns when lis.Accept fails with fatal errors. lis will be closed when this method returns. Serve always returns non-nil error.
Stop stops the gRPC server. It immediately closes all open connections and listeners. It cancels all active RPCs on the server side and the corresponding pending RPCs on the client side will get notified by connection errors.
A ServerOption sets options.
func Creds(c credentials.TransportCredentials) ServerOption
Creds returns a ServerOption that sets credentials for server connections.
func CustomCodec(codec Codec) ServerOption
CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling.
func InTapHandle(h tap.ServerInHandle) ServerOption
InTapHandle returns a ServerOption that sets the tap handle for all the server transport to be created. Only one can be installed.
func MaxConcurrentStreams(n uint32) ServerOption
MaxConcurrentStreams returns a ServerOption that will apply a limit on the number of concurrent streams to each ServerTransport.
func MaxMsgSize(m int) ServerOption
MaxMsgSize returns a ServerOption to set the max message size in bytes for inbound mesages. If this is not set, gRPC uses the default 4MB.
func RPCCompressor(cp Compressor) ServerOption
RPCCompressor returns a ServerOption that sets a compressor for outbound messages.
func RPCDecompressor(dc Decompressor) ServerOption
RPCDecompressor returns a ServerOption that sets a decompressor for inbound messages.
func StatsHandler(h stats.Handler) ServerOption
StatsHandler returns a ServerOption that sets the stats handler for the server.
type ServerStream interface { // SetHeader sets the header metadata. It may be called multiple times. // When call multiple times, all the provided metadata will be merged. // All the metadata will be sent out when one of the following happens: // - ServerStream.SendHeader() is called; // - The first response is sent out; // - An RPC status is sent out (error or success). SetHeader(metadata.MD) error // SendHeader sends the header metadata. // The provided md and headers set by SetHeader() will be sent. // It fails if called multiple times. SendHeader(metadata.MD) error // SetTrailer sets the trailer metadata which will be sent with the RPC status. // When called more than once, all the provided metadata will be merged. SetTrailer(metadata.MD) Stream }
ServerStream defines the interface a server stream has to satisfy.
type ServiceConfig struct { // Methods contains a map for the methods in this service. Methods map[string]MethodConfig }
ServiceConfig is provided by the service provider and contains parameters for how clients that connect to the service should behave. This is EXPERIMENTAL and subject to change.
type ServiceDesc struct { ServiceName string // The pointer to the service interface. Used to check whether the user // provided implementation satisfies the interface requirements. HandlerType interface{} Methods []MethodDesc Streams []StreamDesc Metadata interface{} }
ServiceDesc represents an RPC service's specification.
type ServiceInfo struct { Methods []MethodInfo // Metadata is the metadata specified in ServiceDesc when registering service. Metadata interface{} }
ServiceInfo contains unary RPC method info, streaming RPC methid info and metadata for a service.
type Stream interface { // Context returns the context for this stream. Context() context.Context // SendMsg blocks until it sends m, the stream is done or the stream // breaks. // On error, it aborts the stream and returns an RPC status on client // side. On server side, it simply returns the error to the caller. // SendMsg is called by generated code. Also Users can call SendMsg // directly when it is really needed in their use cases. SendMsg(m interface{}) error // RecvMsg blocks until it receives a message or the stream is // done. On client side, it returns io.EOF when the stream is done. On // any other error, it aborts the stream and returns an RPC status. On // server side, it simply returns the error to the caller. RecvMsg(m interface{}) error }
Stream defines the common interface a client or server stream has to satisfy.
type StreamClientInterceptor func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error)
StreamClientInterceptor intercepts the creation of ClientStream. It may return a custom ClientStream to intercept all I/O operations. streamer is the handlder to create a ClientStream and it is the responsibility of the interceptor to call it. This is the EXPERIMENTAL API.
type StreamDesc struct { StreamName string Handler StreamHandler // At least one of these is true. ServerStreams bool ClientStreams bool }
StreamDesc represents a streaming RPC service's method specification.
type StreamHandler func(srv interface{}, stream ServerStream) error
StreamHandler defines the handler called by gRPC server to complete the execution of a streaming RPC.
type StreamServerInfo struct { // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool }
StreamServerInfo consists of various information about a streaming RPC on server side. All per-rpc information may be mutated by the interceptor.
type StreamServerInterceptor func(srv interface{}, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error
StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server. info contains all the information of this RPC the interceptor can operate on. And handler is the service method implementation. It is the responsibility of the interceptor to invoke handler to complete the RPC.
type Streamer func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error)
Streamer is called by StreamClientInterceptor to create a ClientStream.
UnaryHandler defines the handler invoked by UnaryServerInterceptor to complete the normal execution of a unary RPC.
type UnaryServerInfo struct { // Server is the service implementation the user provides. This is read-only. Server interface{} // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string }
UnaryServerInfo consists of various information about a unary RPC on server side. All per-rpc information may be mutated by the interceptor.
type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, handler UnaryHandler) (resp interface{}, err error)
UnaryServerInterceptor provides a hook to intercept the execution of a unary RPC on the server. info contains all the information of this RPC the interceptor can operate on. And handler is the wrapper of the service method implementation. It is the responsibility of the interceptor to invoke handler to complete the RPC.
Package grpc imports 30 packages (graph) and is imported by 46 packages. Updated 2017-08-11. Refresh now. Tools for package owners. | https://godoc.org/grpc.go4.org | CC-MAIN-2018-26 | refinedweb | 2,828 | 51.65 |
Team,
We are facing some issues in using the PivotGrid and we need your inputs in addressing those issues. Please find the list below:
The below mentioned code doesn’t gets executed (either of them)
i.
flexmonster.customizeToolbar(function (toolbar: any)
{
debugger;
console.log(“In event flexmonster.customizeToolbar”);
console.log(toolbar);
var tabs = toolbar.getTabs();
//perform necessary logic here…
})
ii.
customizeToolbar(toolbar: any)
{
debugger;
console.log(“In event customizeToolbar”);
console.log(toolbar);
var tabs = toolbar.getTabs();
//perform necessary logic here…
}
Is there any event which can capture this browser resizing and automatically adjust the size of the PivotGrid? We’re currently calculating the screen size in the constructor function, when we set it 100%, it doesn’t work.
let getWindow = () => {
return window.innerHeight – 210;
};
console.log(“getWindow : ” + getWindow());
this.gridHeight = getWindow();
Can you please explain how internally your PivotGrid works with our code?
<fm-pivot [componentFolder]=”‘'”
…
>
Also in the components we refer to the interface components shared by you stored locally.
import { FlexmonsterPivot } from “../references/flexmonster/flexmonster.angular4”;
Please clarify if any code changes to be done from our side to keep upgrading your PivotGrid to be latest?
Please download the source code and video from the link
Hello, Navaneethakrishnan,
Thank you for writing to us!
First of all, we suggest updating files for integration with Angular 4 from our GitHub repository. Please make sure that
flexmonster.d.ts and
flexmonster.angular4.ts are updated.
Below are the comments on your issues:
1. 1. In order to customize Toolbar, you need to use
beforetoolbarcreated event. Previously it was not supported in Angular 4, that’s why when you defined
(beforetoolbarcreated)="customizeToolbar($event)", as a result
customizeToolbar(toolbar: any) was never executed. This issue is already fixed, so after updating everything should work as expected.
1. 2. As about
flexmonster.customizeToolbar method, it doesn’t get executed because there is no such method in our API. Please use
beforetoolbarcreated event instead.
1. 3. In your
PivotGrid.ts, we have also noticed the comment that
customizeCellFunction(cell: string, data: string) doesn’t get triggered. This issue is also fixed now. Please have a look how customizeCell should be defined and the way it should be used.
2. Thank you for providing the video to demonstrate the issues with resizing of the PivotGrid. We were able to reproduce this incorrect behavior on our side. The fix will be delivered with minor release 2.417, ETA Mar 26th.
3. Concerning upgrades and patches, we would like to explain how the full process works. We release minor release for Flexmonster every other week. Our CDN is updated as soon as each new version is released. So, if you are pointing to the CDN, you are automatically using the latest version of PivotGrid. In order to upgrade to the latest when you want to, you need to manually download the latest version of Flexmonster from Client’s Area, and refer to it locally instead of our CDN. This can be achieved in two steps. First, replace the path to
flexmonster.js with the path to your local file:
<script src="flexmonster/flexmonster.js"></script>
Second, replace the value of
componentFolder with the path to your local
flexmonster/ folder:
<fm-pivot [componentFolder]="''"
…
>
The
componentFolder parameter defines where all necessary files, like
.css , or toolbar files are taken.
[componentFolder]="''" means you are using files from our CDN. Referring your local
flexmonster/ folder will allow manual updating to the latest version.
One more point we want to mention regarding the update process, we suggest you watch our Angular 4 repository. Here is a guide that explains how to watch a repository.
When we update
.ts files for Angular 4 integration, you will need to update these files on your side. These files are not updated very often, mostly when adding new functionality. However, it is useful to watch this repository to get such updates.
I hope all your questions are answered. Please let me know if you need clarifications.
Regards,
Tanya
Hello, Navaneethakrishnan,
We are glad to inform that the version 2.417 has already been released. You are welcome to update it on our website. Also please update
flexmonster.angular4.ts file from our GitHub.
The issue with component resizing inside the tabs was fixed. Calling
refresh() is required after the tab is visible.
We suggest the following approach: add
#pivotX id to each
<fm-pivot> directive, where
X is a number of a tab where pivot instance is shown. To call
refresh() we need to know which tab is active now. This code demonstrates how we use an
onTabChange event for this purpose:
<mat-tab-group #tabs (selectedTabChange)="onTabChange(tabs.selectedIndex)">
<mat-tab
<fm-pivot #pivot1 [componentFolder]="''" [toolbar]="true" [width]="'100%'" [height]="500">
Flexmonster will appear here
</fm-pivot>
</mat-tab>
<mat-tab
<fm-pivot #pivot2 [componentFolder]="''" [toolbar]="true" [width]="'100%'" [height]="500">
Flexmonster will appear here
</fm-pivot>
</mat-tab>
</mat-tab-group>
Here is how we use the
onTabChange event to refresh the component when switching between tabs:
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
@ViewChild("pivot1") pivot1: FlexmonsterPivot;
@ViewChild("pivot2") pivot2: FlexmonsterPivot;
onTabChange(index) {
console.log("tab change", index);
index++;
if (this["pivot" + index]) {
this["pivot" + index].flexmonster.refresh();
}
}
}
Please let me know if you need more details.
Regards,
Tanya
Team,
Thanks for your answer. I updated only the
flexmonster.angular4.ts file from GitHub repo and I tried executing my application, and I notice that the resizing issue is resolved. Please note that I didn’t do any other changes as suggested by you in your reply.
Can you please clarify why the other code changes are required and is it addressing any other problem?
Regards,
Krishnan
Hi Krishnan,
Thank you for confirming that the resizing issue is resolved after the
flexmonster.angular4.ts file update.
The other suggested code changes are required to adjust the width and height of the Pivot Grid automatically after switching to the tab with the Pivot Grid. The idea of the code provided in the previous message is to call
refresh() API call for the pivot table instance after the tab change to make sure its width and height are adjusted properly after the visibility change.
Please let me know if the explanation of the code is clear for you.
Kind regards,
Iryna | https://www.flexmonster.com/question/customize-tool-bar-resizing-issues/ | CC-MAIN-2020-05 | refinedweb | 1,054 | 51.24 |
#include <db_cxx.h> int Db::set_re_delim(int re_delim);
Set the delimiting byte used to mark the end of a record in the backing source file for the Recno access method.
This byte is used for variable length records if the re_source file is specified using the Db::set_re_source() method.() method may not be called after the
Db::open() method is called. If
the database already exists when
Db::open() is called, the
information specified to
Db::set_re_delim() will be ignored.
The
Db::set_re_delim()
method either returns a non-zero error value or throws an
exception that encapsulates a non-zero error value on
failure, and returns 0 on success.
The
Db::set_re_delim() | http://idlebox.net/2011/apidocs/db-5.2.28.zip/api_reference/CXX/dbset_re_delim.html | CC-MAIN-2013-48 | refinedweb | 112 | 59.43 |
I have a Base64 (encoded from image), and I want to convert it again into an image in Ionic. Is it possible? and is there any example for do this?
Thanks before
I have a Base64 (encoded from image), and I want to convert it again into an image in Ionic. Is it possible? and is there any example for do this?
Thanks before
I guess you mean like using the image as
- just replace base64Value with the base 64 data.
Yes, do you have an example of that?
You can create a blob from image an then show it in [src] bind, I created a service that work on blob
@Injectable() export class ImageHandlerProvider { constructor () { } getBlob (b64Data) { contentType = ''; sliceSize = 512; b64Data = b64Data.replace(/data\:image\/(jpeg|jpg|png)\;base64\,/gi, '');; } }
and in you component you can use it like:
let urlCreator = window.URL || window.webkitURL; let dataBlob = this.imageHandlerProvider.getBlob(data); let imageUrl = urlCreator.createObjectURL(dataBlob); this.imageUrl = imageUrl;
<img [src]="imageUrl" alt="Image" />
You can check this codepen for more details.
I tried the variable
var data = '
But it says
Typescript Error: Unexpected token. A constructor, method, accessor, or property was expected.
And
var urlCreator = window.URL || window.webkitURL;
Property ‘webkitURL’ does not exist on type ‘Window’.
Do you have any solution?
I changed the variable become
private data = '/9j/4AAQSkZJRgABAQIAHAAcAAD/7RmQUGhvdG9zaG9w... //base64
and I give a comment to the
window.webkitURL
There is no error in my code, but the result is only “Image” caption, below the result
In my case, I created a specific typescript file for base64:
export const SELFIE_PREVIEW_IMAGES = { image1: 'base64FromImage' }
And then imported it on my component page
import { SELFIE_PREVIEW_IMAGES } from './selfie-preview.images'; images; constructor () { this.images = SELFIE_PREVIEW_IMAGES; }
And in html
<img [src]="images['image1']" alt="Image 1">
In your case, when you use
getBlob() function?
May I know the full context?
I use that for another reason, my server wants to receive a base64 but in device I get an image from file uri, so I need to convert this file url to base64 and blob to show it in page. | https://forum.ionicframework.com/t/how-to-convert-base64-into-an-image/118040 | CC-MAIN-2020-40 | refinedweb | 350 | 58.48 |
Set Dynamic Choice List in Groovy
(Doc ID 2082373.1)
Last updated on NOVEMBER 04, 2019
Applies to:Oracle Fusion Sales - Version 11.1.10.0.0 and later
Oracle Fusion Sales Cloud Service - Version 11.1.10.0.0 and later
Information in this document applies to any platform.
Symptoms
On : 11.1.10.0.0 version, Leads, Sales Campaigns
Set Dynamic Choice List in Groovy
I've defined a Custom Object in the Sales Application called Campaign.
I've created a Custom Field Record Owner of type Choice List to link with a Resource.
I try to set the default for this field via Groovy Script to a specific user. According to the documentation I understood that I can set the field RecordOwner_Id_c with the resource id, but this doesn't work and I get an error message (Invalid value for dynamic choice list). My code is the following, used within a Server Script of the custom object with trigger 'Create':
def resourceRowId = 300000001359369
setAttribute('RecordOwner_Id_c', resourceRowId)
In the end I need to get the ResourceProfileId within the Groovy Script
ERROR
-----------------------
Invalid value for dynamic choice list
STEPS
-----------------------
1. Put the script in a Trigger
2. Execute the trigger
3. Error Appears
Cause
In this Document | https://support.oracle.com/knowledge/Oracle%20Fusion%20Applications/2082373_1.html | CC-MAIN-2020-50 | refinedweb | 208 | 65.12 |
I need to have a project done in a few days, its a basic client and server interface. The catch is that it needs to be all raw sockets. I have no problem with creating that, I am just stuck on sending the packets.
First I tried to bind it to an interface 'en1' but it keeps giving me an error
nodename not known
def raw():
HOST = gethostbyname('192.168.1.10')
s = socket(AF_INET, SOCK_RAW, IPPROTO_IP)
s.bind((HOST, 0))
s.setsockopt(IPPROTO_IP, IP_HDRINCL, 0) #no headers - it wont work!!
pckt = packet("\x68\x65\x6c\x6c\x6f")
netpacket = pckt.getpacket()
print "Sending.. "
print ""
s.sendto(netpacket, ('192.168.1.1', 80))
data = s.recv(4096)
print data
007f 2809 6da2 28cf daee 2156 0800 4500 004d 1bfc 0000 4000 db59 c0a8 010a c0a8 0101* 007f
2809 6da2 28cf daee 2156 0800 4500 0036 2352 4000 4006 0000 c0a8 010a c0a8 0101 15c0 0050
0000 0000 0000 0000 8010 813b 0000 68656c6c6f -hello
thanks to the comments for this question, i managed to get a connection going with a server. all it took was changing the address family to af_packet in linux. then i binded it to my nic and sent it. it worked. thanks for the help people! here is some example code:
s = socket(AF_PACKET, SOCK_RAW) s.bind(("en1", 0)) pckt = packet() #my class that initializes the raw hex data = pckt.getpacket() s.send(data) message = s.recv(4096) print s print s.decode('hex')
It needs to be in linux or debian. to my knowldege it doesnt work in mac osx. idk about windows. if u have a mac use pycap or scapy, they work fine. | https://codedump.io/share/1gYqczocQE2v/1/how-do-i-send-an-raw-ethernet-frame-in-python | CC-MAIN-2017-39 | refinedweb | 279 | 85.49 |
Search the Community
Showing results for tags 'tweenmax'..
TweenMax and RequireJS 2014 update
bm1967 posted a topic in GSAPHi I love GreenSock tools, they're a first class complement to HTML5. I've just renewed my subscription and am in the process of understanding how TweenMax works with RequireJS. Through perseverance I've got TweenMax working, but I'm a bit unsure if my workflow is correct. I've read various posts that seem to confuse my understanding, perhaps as they may be out of date. It would be great if Greensock or community could post an up-to-date tutorial on how TweenMax and it's Plugins work with RequireJS and some clear examples. What I find confusing is based on various areas (and the following questions are based from other posts on sites/forums perhaps now out of date). So with TweenMax v 1.11.6 and RequireJS v 2.1.11 (latest downloads at the time of writing): Do we still need a GreensockAMDPath? Why define window.GreenSockGlobals? (Is this best practice with RequireJS). My understanding of RequireJS is that we benefit from avoiding the global namespace. Are we still expected to use a 'shim' in the RequireJS config object to get TweenMax working? How are TweenMax plug-ins added with RequireJS. Is the latest TweenMax AMD? I have a feeling that there could be quite a few others asking similar questions. If anyone in the GreenSock community can help then I (and am sure others) look forward to reading your posts. Many thanks in advance for any help / examples...
TweenMax - Rotating to 0 deg
Fred Tacon posted a topic in GSAPI am using TweenMax with Adobe Edge Animate, and I am trying to rotate a div to zero degrees from various starting points. If I set rotation equal to any positive or negative number, the div will rotate to that value. However, if I set rotation equal to 0, the div will not rotate at all. Is there a secret to this that I am missing? Here is a sample where photo1 is the div. It is a photo that is on the screen and initially at a -24deg rotation. I want it to move to the coordinates listed while rotating to 0deg. TweenMax.to(photo1, 1, {top:215, left:240, rotation:0, ease:Power1.easeInOut}); Any suggestions will be greatly appreciated. Thanks! F??
AS3 Tweenlite Image/Movieclip scroller
sorciereus posted a topic in GSAP (Flash)Hi there. This question isn't limited to Greensock but was hoping I could get a little help here. I have an image scroller that basically uses buttons to relatively position a movieclip containing a horizontal line of images. There is a mask over an area so that when you click a left or right arrow, it relatively positions the movieclip under the mask and reveals a section of the movieclip. I have this working fine, however the one functionality I'd like to add, is when the left or right border of the movieclip is reached, the appropriate button is disabled so that the movieclip isn't positioned outside of the mask. Or it loops back to the starting x position. Here is the code: import flash.display.MovieClip; import flash.events.MouseEvent; import com.greensock.*; import com.greensock.easing.*; function init():void { TweenLite.to(products_mc, 1, {x:696, alpha:1}); } init(); function productsLeft(events:MouseEvent):void { TweenLite.to(products_mc, .75, {x:"-255"}); } function productsRight(events:MouseEvent):void { TweenLite.to(products_mc, .75, {x:"255"}); } arrowL_btn.buttonMode = true; arrowL_btn.addEventListener(MouseEvent.CLICK, productsLeft); arrowR_btn.buttonMode = true; arrowR_btn.addEventListener(MouseEvent.CLICK, productsRight); if (products_mc.x == 696) { arrowR_btn.visible = false; arrowR_btn.buttonMode = false; } if (products_mc.x == -1086) { arrowL_btn.visible = false; arrowL_btn.buttonMode = false; } /* buttons */ arrowL_btn.doubleClickEnabled = true; arrowR_btn.doubleClickEnabled = true; arrowL_btn.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler, false); arrowR_btn.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler, false); function doubleClickHandler(evt:MouseEvent):void { evt.stopPropagation(); }
- :
How can I add onComplete to tl.reverse()?
Hysteresis posted a topic in GSAPI am trying to write a function that plays an animation when a link is clicked and then opens the link... so that I can play transitional animations between pages... This is my code, but I can't get the page to load after the animation: var tweenBtn = document.getElementById("one"); tweenBtn.onclick = function(event) { event.preventDefault(); tl.reverse(2.2); window.location.href = "POWERservices.html"; }; Is there a way I can add onComplete to my timeline that has just played in reverse? Or is there a better way of doing this?elineMax=new TimelineMax({paused:true,onComplete:done}); function createWords() { //create a word (attach symbol in library with Class Bubble) and position on stage var word:words = new words(); word.y=500; word.x=randomRange(100,400); word.alpha=1; addChild(word); //create timeline for each word var nestedTl:TimelineMax = new TimelineMax(); nestedTl.insert(TweenMax.to(word,17, {y:-50, ease:Linear.easeNone})); //append new timeline very close to when the previous one started //don't even ask about the offset...k? tl.append(nestedTl, 6); } function done() { trace("the party's over"); } function init() { for (var count:Number = 0; count<50; count++) { createWords(); } } init(); WordTest.fla.zip
Tweening a line using KinteicJS Plugin
RobbyT15 posted a topic in GSAPI'm getting an error that I'm not understanding. I'm trying to animate a kinetic line, however, the line is not animating and I'm getting the following error: TypeError: s.charAt is not a function TweenMax.min.js: 16 Why am I getting this error? I've attached my javascript file. script.txt
startAt with delay
Rabies posted a topic in GSAP (Flash)I just found out today that there was this "startAt" parameter that finally solves my problem with constantly setting starting values for properties. Unfortunately, it doesn't seem to work as expected when there are delays. Maybe I'm going about this the wrong way. Example: TweenMax.to(mc, 0.6, { scaleX:1, scaleY:1, delay:0.7, startAt:{scaleX:0,scaleY:0}, ease:Elastic.easeOut }); There is a 0.7 delay there. I would expect the startAt parameters to be used right away, not after the delay. Does this make sense? Is there an alternate way to do this? Otherwise I'm stuck setting the start property values like I always do. ie: mc.scaleX = mc.scaleY = 0; TweenMax.to(mc, 0.6, { scaleX:1, scaleY:1, delay:0.7, ease:Elastic.easeOut }); thanks, rb
Randomizing doesn't change in recursion
drewbit posted a topic in GSAPI'm trying to randomize some settings in a tween. The first time it gets random values, but each iteration thereafter is identical. function RandomTween(e,o,w,h){ TweenMax.to(e, 0, {x:(int(o.left*w)), y:(int(o.top*h)),rotation:getRandomArbitary(1.05,6.25)+"rad"}); TweenMax.to(e, getRandomArbitary(0.5,5), {y: o.animation.to.y*h,repeat:-1,x: o.animation.to.x*w,force3D:true, rotation:getRandomArbitary(1.05,6.25)+"rad",ease:Linear.easeNone,onComplete:function(e,o,w,h){ RandomTween(e,o,w,h); },onCompleteParams:[e,o,w,h]}); } /** * Returns a random number between min and max */ function getRandomArbitary (min, max) { return random() * (max - min) + min; } var seed = 1; function random() { var x = Math.sin(seed++) * 10000; return x - Math.floor(x); } Am I missing something here?
Create this mouseover effect with tweenmax?
nickycdk posted a topic in GSAPIm pretty new to tweenmax, and i was wondering how to create an mouseover effect like seen on this page (hover over the images) : (scroll down to the work) They are using this in the css: transform: scale(0.25, 0.1); transition: background 0.3s linear 0s, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1) 0s; and on the hover: transform: scale(0.7); transition-delay: 0.2s; However, I have no idea how to do this in TweenMax?
Very slow animations on iPad 2, how to optimize?
Mich posted a topic in GSAPHi, i'm working on a site using SuperScrollorama. My site has 6 big png-24 + alpha that are animated like this: // slide0 controller.addTween( '#slide0', (new TimelineLite()) .append([ TweenMax.fromTo( $('#sprite1'), 1, {css:{left:50+"%", top:170, scaleX:1.0, scaleY:1.0}}, {css:{left:30+"%", top:150, scaleX:1.2, scaleY:1.2}, ease:Quad.easeInOut}), TweenMax.fromTo( $('#sprite2'), 2, {css:{left:80+"%", top:230, scaleX:1.0, scaleY:1.0}}, {css:{left:50+"%", top:230, scaleX:1.1, scaleY:1.1}, ease:Quad.easeInOut}) ]), 0, // scroll duration of tween 0 ); On my computer, it's fast and fluid (perfect on IE 11 and Firefox, slower on Google Chrome). But on my iPad 2, it's a disaster : very very slow !! I tried with png 8, 256 colors + transparency. It's a little bit better. I tried the Superscrollorama on the iPad, and i noticed that's it's not very smooth. So my questions : - is it a processor problem / graphic card problem? - how to get perfect smoothness on iPad? Does anyone has a website example that i can test? Thanks for any help.=" Is there a way to only load the select things that I need and therefore save on file size? Please advise. Apologies for the noob questions! Thanks in advance for any help!
Flag animation
patcruz posted a topic in GSAP (Flash)Hello, I saw some animation done with greensock js flavor... Is this possible with as3 version? How can I create a animation to simulate a flag? Thank you...
Invalidate & from confusion
x0b posted a topic in GSAPHi, Firstly, let me say a huge thanks to Greensock for providing such amazing tools over the years, I've been using your products since AS2 Tweenlite and they never fail to amaze me with their power and usability...thank you!! I have made a simple fiddle to demo the problem here : My situation is this: I want to have a main timeline that has 3 sections - an intro, a changeable middle section and an outro, in that order. Once the user has completed the middle section and the outro, they click a button and a new middle section replaces the current one, the rest remains the same. Once the button is clicked I pause(0) both the outro and middle section to reset their tweens, then kill them both so they get removed from the main timeline (incidentally - remove does not seem to do anything for me as the duration of the main timeline remains the same if I check it after doing remove - is this a correct behaviour?). Then I add the new middle section and the outro back to the timeline. The timeline is controlled by scrolling the output window and runs correctly initially; the green box moves down (intro) the blue box goes left 100px further than the yelow (middle section) and then they come back to their starting positions whilst the red box comes from 1000px to cover the green box (outro). The problems once the button is clicked are two fold 1) The intro runs ok, the new middle section runs ok, but then as soon as the timeline enters the outro, the blue box jumps out to 200px and the yellow box jumps to 100px. I guess this is because the outro tween has for some reason stored these values the first time it is run, even though it was killed. 2) If I invalidate() the outro timeline, the blue box glitch disappears but then the from tween does not work correctly, I presume this is because the invalidate means the timeline has forgotten where the from tween started from? So I'm kind of stuck between two problems and not sure whether I'm using the API wrong or the API can't do what I need. Can anyone please provide some insight? Thanks!
TweenMax from an External Class
badkarma911 posted a topic in GSAP (Flash)Ok I hoping someone can help me out. I'm relatively new to action script and TweenMax but have learned a lot over the last year. I'm using Flash Professional and I am trying to ease in a map when the map icon is clicked. Once the user is done they click on the map and the map eases out. This is set up by using two external classes names MapToggleOnClass and MapToggleOffClass. I have been successful in doing this from the document class but only partially successful in doing it from an external class. I say partially because I am able to get the ease out function in the MapToggleOffClass to work when the user clicks on the map. However, I have not been able to get the map to ease in when the map icon is clicked. All my symbols are MovieClips. All the instance names are correct and the instances are on the stage. The visibility of the streetMap instance is set to off at runtime. Using a trace statement I know that Flash is detecting when I click on the Map Icon (mapBook) but nothing happens. The symbol StreetMap is linked to the Class of StreetMap and the Base Class of the MapToggleOffClass. The Symbol Map Icon has the instance name of mapBook and has its class linked to the MapToggleOnClass. I know the linkages are correct because of trace statement when I click on the instance of mapBook. The click is registered but the Tween (easeIn) does not occur. The following is my code: package { import com.greensock.*; import com.greensock.easing.*; import com.greensock.TweenMax; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; public class MapToggleOffClass extends MovieClip { public function MapToggleOffClass() { this.buttonMode = true; this.addEventListener(MouseEvent.CLICK,hideMap); function hideMap(event:MouseEvent):void { trace("movieClip Instance Name = " + event.target.name); TweenMax.to(event.currentTarget, 1, {autoAlpha:0, ease:Back.easeOut}); } } } } and package { import com.greensock.*; import com.greensock.easing.*; import com.greensock.TweenMax; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import StreetMap; public class MapToggleOnClass extends MovieClip { var streetMap:StreetMap; public function MapToggleOnClass() { streetMap = new StreetMap(); this.buttonMode = true; this.addEventListener(MouseEvent.CLICK,showMap); function showMap(event:MouseEvent):void { trace("The link is working"); TweenMax.to(streetMap, 1, {autoAlpha:1, ease:Back.easeIn}); } } } } The main difference is the easeOut function uses "event.currentTarget" and the easeIn function uses streetMap as the object. One more thing.... in the action script settings I have automatically declare stage instances checked. What am I missing? Any help would be much appreciated. thanks in advance.
- Hello everyone This might be a stupid question but i had to ask to better understand the JS API .. I know that when you include TweenLite.min.js in your page that you use the TweenLite constructor when using different methods in the API But lets say If i have TweenMax.min.js INCLUDED in my page: what is the best usage for using set() .. using the TweenLite or the TweenMax Constructor?Its been said in the forums that you can use either TweenLite or TweenMax IF TweenMax.min.js is INCLUDED in your page... so I was curious as far as performance and/or preferred usage.. which is appropriate to use if I have TweenMax.min.js included in my page? or can i use both using TweenLite: TweenLite.set(element, {x:100, y:50, opacity:0}); or using TweenMax: TweenMax.set(element, {x:100, y:50, opacity:0}); or can i use either or ??? Im sure that what Im asking can relate to other methods in the API, when i have TweenMax.min.js included in my page.. so any help will be highly appreciated thanks in advance ! | https://staging.greensock.com/search/?tags=tweenmax&updated_after=any&page=20&sortby=relevancy | CC-MAIN-2022-21 | refinedweb | 2,612 | 59.5 |
.
Turning URLs from your friends’ tweets into real hyperlinks via a regular expression
While the regular expressions subject is quite complex and lengthy, there are a lot of predefined patterns available for us to avoid the hassle. But if you have the time, I really recommend you to delve into the world of regular expressions, because you’ll probably need them sooner or later in your applications. In the following exercise, I’ll show you how to use a regular expression in our Twitter application to convert text URLs into clickable hyperlinks.
- Go to the import declarations section in your code and insert the following two lines right after the rest of the import statements:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
- Scroll down to the JEditorPane statusPane; line at the end of the code window and type the Matcher matcher; right after it, as shown in the following screenshot:
- Go to the try block just below the //code for the Friends timeline line and type the following lines just before the for statement:
// create a string for the regexp
String s = "";
Pattern pattern = Pattern.compile("http://((\\w|\\d)+\\.)+(\\w|\\d)+(/(\\w|\\d)+)+");
String$0</a>";
- Your code should now look like this:
- Now scroll down to the for loop and replace the statusText = new JLabel(String.valueOf(statusList.get(i).getText())); line with the following lines:
s = String.valueOf(statusList.get(i).getText());
matcher = pattern.matcher(s);
s = matcher.replaceAll(replacementStr);
statusText = new JLabel(s);
- The screenshot below shows how your code should look after the replacement process:
- Run your application. This time, the URL links in your friends’ tweets will appear as clickable hyperlinks:
- Cool, right? The only drawback is that if you click in a hyperlink, you won’t be taken anywhere because the statusPane component doesn’t know yet what to do when you click inside it! That’s why we’re going to add a hyperlink event via the addHyperlinkListener method next.
- Close your Twitter application to return to the NetBeans IDE. Add the following lines to the import declarations section in your code:
import java.io.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
- Now scroll down the code until you locate the statusPane.setEditable(false) line and add the following lines right after it:
statusPane.addHyperlinkListener(
new HyperlinkListener()
{
public void hyperlinkUpdate( HyperlinkEvent event )
{
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED )
try {
java.awt.Desktop.getDesktop().browse(
java.net.URI.create(event.getURL().toString()));
} catch (IOException e) {
JOptionPane.showMessageDialog (null, "IO Failed");
}
}
}
);
- Your code will look like the following screenshot:
- Run your application again, and this time click on a hyperlink. A web browser window will pop up automatically to show you the corresponding web page:
- Ok, let’s stop at this point and review what we’ve done. In step 1, you added two import statements to your Twitter application, to tell the Java compiler you’re going to use the Matcher and Pattern classes to create the regular expression that’s going to help you to convert the ordinary text URL links from your friends’ tweets into real clickable hyperlinks.
- In step 2, you added a Matcher object called (duh!) matcher that will take care of matching every occurrence of a URL in your friends’ tweets and replacing it with the required HTML code to convert the URL into a clickable hyperlink. Then in step 3, you added a Pattern object called (double duh!) pattern to store the regular expression pattern that represents a URL, along with two strings: s and replacementStr. The s string is going to store the text of an individual tweet, and replacementStr has the HTML code that’s going to replace every URL matched by the regular expression stored in pattern.
The real trick is in the
Pattern pattern = Pattern.compile("(http://)*((\\w|\\d)+\\.)+(\\w|\\d)+(/(\\w|\\d)+)+");
String$0</a>";
lines. First, we need to use the compile method from the Pattern class to compile the regular expression and store it in the pattern object. In this case, the regular expression will match any string starting with or without the famous http:// text sequence, which must then be followed by one or more letters or digits, a dot (.), then one or more letters or digits, the / character and finally one or more letters or digits. This text sequence represents almost every URL that I’ve seen in twitter posts, like,, etc.
In step 5, you replaced the line that assigns an individual tweet to the statusText component with several lines. The first one of them,
s = String.valueOf(statusList.get(i).getText());
assigns an individual tweet from your friend’s timeline to the s string variable. The next line,
matcher = pattern.matcher(s);
creates the specific matcher object used to match the s string –given to the matcher method as the input parameter –against the regular expression pattern, and the
s = matcher.replaceAll(replacementStr);
line replaces every URL sequence that matches the pattern with the given HTML code in replacementStr.
In step 9, you added the three import declarations required to use a hyperlink event in your code. In step 10, you added a block of code to handle the hyperlink events. The addHyperlinkListener method adds a HyperlinkListener object to listen to any of the hyperlink event inside the statusPane component. When you click on a hyperlink, the code inside the try block executes. The
java.awt.Desktop.getDesktop().browse (
line launches a web browser window and the
java.net.URI.create(event.getURL().toString())
line generates the Uniform Resource Identifier (URI) required by the browse method from the previous line. This line calls the getUrl() method from the event object to get the URL from the hyperlink event that is triggered when you click on a hyperlink in one of your friend’s tweets, and then uses the toString method to convert it into a string object so the create method can generate the appropriate URI.
If everything goes out well, a web browser window pops up automatically and shows you the webpage that corresponds to the URL from the tweet in your friend’s timeline. If an error occurs when trying to process the hyperlink event, an IOException is generated along with an error message and the web browser window doesn’t pop up.
Well, that was a great way of enhancing your Twitter application, don’t you think so? I hope you enjoyed reading as much as I enjoyed writing the final part of the article series.
Summary
In this article, we discussed:
-. | https://www.packtpub.com/books/content/build-your-own-application-access-twitter-using-java-and-netbeans-part-4 | CC-MAIN-2017-09 | refinedweb | 1,094 | 52.8 |
In our previous article, we have seen
five simple steps to create a web role application. Web role projects in Azure are like web applications. Azure has one more type of project,
Worker role. Worker role applications are background processing applications like Windows processes which run in the background. In this article, we will try to understand
the six basic steps to create a:
Please feel free to download my free 600+ questions and answers eBook which covers .NET, ASP.NET, SQL Server, WCF, WPF, WWF@.
In case you are a complete fresher to Azure, please ensure you have all the pre-requisites in place. You can read the following article to get the basic prerequisites:
Worker roles are nothing but background processes which run on the Windows Azure platform. We will create a simple background process which will run X number of times and every time it runs, it will wait for 10000 ms.
Create a new project using the Worker role template as shown below:
We need to import two namespaces, Microsoft.WindowsAzure.Diagnostics
and Microsoft.WindowsAzure.ServiceRuntime. Diagnostic will help us to display
a message using trace on the Azure profiler while ServiceRuntime provides functions for Azure services.
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.ServiceRuntime
Diagnostic
ServiceRuntime
The next step is to add a class and override the OnStart and Run methods. In the below code snippet, we have created a simple WorkerRole class which inherits from RoleEntryPoint.
OnStart
Run
WorkerRole
RoleEntryPoint
We have also defined a simple loop count variable called intLoops which is initialised to value 5. This value is initialised in the OnStart method.
The OnStart method is executed the first time your worker role is executed.
intLoops
Now override the Run method with a simple loop which decrements the loop count and has a thread which sleeps for 10000 ms as every loop is executed.
Run
Now run the worker role and see your Azure console. You should see that one worker role instance is running.
We have displayed trace information at various places in the start and run methods. You can see in the Azure prompt the number of loops executed in
the Azure diagnostic.
start
run. | https://www.codeproject.com/Articles/50411/Simple-6-Steps-to-Run-your-First-Azure-Worker-Role | CC-MAIN-2017-39 | refinedweb | 364 | 63.59 |
Solution for String index out of range even though I’ve circumvented it in my code
is Given Below:
I’m creating a function which returns a list of elements without any elements of the same value next to each other. However, I experience this error even though I don’t see how it could happen?
if s[i + 1] != s[i] or s[i - 1] != s[i]: IndexError: string index out of range
My program is as follows:
def unique_in_order(s): arr = [] for i in range(0, len(s)): if i == 0 or i == len(s): arr.append(s[i]) else: if s[i + 1] == s[i] or s[i - 1] == s[i]: pass else: arr.append(s[i]) return arr | https://codeutility.org/string-index-out-of-range-even-though-ive-circumvented-it-in-my-code/ | CC-MAIN-2021-49 | refinedweb | 122 | 73.78 |
Occasionally I want a slider to control 2 values, such as defining a date range or clipping parameters. In the past, I would just create 2 sliders using the RangeEditor. It worked fine, but took up 20 or so pixels and didn’t really visually show the relationship between the 2 variables.
BoundsEditor screen shot
Qt and PyQt made it ridiculously easy to create the control I wanted. I started off transcoding the Qt QSlider C++ code into python, then added the second slider. In all, its about 180 lines of Python, less than 50 of it specific to the seconds slider.
I also wrapped this into a Traits editor, which can be found at enthought.traits.ui.qt.extra.bounds_editor.BoundsEditor
Where exactly could I see the implementation ? Thks
Here is my test code, which also includes a button to increment the leftmost slider:
from enthought.traits.api import HasTraits, Range, Int, Button, Float
from enthought.traits.ui.api import View, Item
from enthought.traits.ui.qt4.extra.bounds_editor import BoundsEditor
class Foo(HasTraits):
bounds = Range(10,20,value=15)
incr_low = Button("incr_low")
first = Float(10)
traits_view = View(Item('bounds', editor=BoundsEditor(low_name='first', high=20)),
Item('incr_low'))
def _incr_low_changed(self):
self.first += 1
def _first_changed(self, old, new):
print "new low:", new
Foo().configure_traits()
of course, wordpress screwed up the formatting of my code, so beware…
Hello! I love this widget and it’s exactly what I need, however I don’t know how to add it to my QtDesigner… I know this is a n00b question, could you please point me to some good reading on the subject? Thanx! 🙂
I no next to nothing about QtDesigner. You’ll probably need to look at the BoundsEditor source and strip out the control, then follow the instructions on Riverbank’s website
Thanks for the demo. It presents a really nice way to implement a double slider. We need the similar widget in our program and I made my own version in C++ with Qt4. A recorded video was uploaded to
Hi Bryce. Do you have something similair using wxPython?
I misspelled the e-mail address sorry
John,
I did implement a wx version as well, but its not nearly as nice. If I remember correctly its just 2 sliders, stacked vertically.
Bryce,
Thanks for your reply. I have done the two sliders stacked vertically also but as you have noted it really is cumbersome. Your single slider is elegant. I think I will probably try to “roll my own” then. Again thanks
John, I was thinking about why I had to stack them- I tried putting 2 sliders on top of each other, but I had problems getting events on the bottom slider. Maybe you can make one slider the parent of the other & Skip the event so the parent gets it?
In any case, I recommend Qt if possible 🙂
Very interesting, but the widget itself is not very useful without valueChanged signals for the min/max/span | http://blog.enthought.com/enthought-tool-suite/traits/new-double-slider-editor/ | CC-MAIN-2017-22 | refinedweb | 499 | 64.51 |
Description
Nebulex is an in-process and distributed caching framework with a set of useful and powerful features such as:
- Inspired by Ecto; simple and fluent API, flexible and pluggable architecture (based on adapters).
- Built-in adapters; supporting local, distributed and multi-level caching.
- Support for different distributed caching topologies, such as: Partitioned, Near, Replicated, etc.
- Different eviction mechanisms, such as: time-based eviction through the expiry time property on the cached objects, multi-queue or generational caching (built-in local cache), etc.
- Object versioning (through the :version property); enabling Optimistic offline locks
- Pre/Post execution hooks
- Transactions and key-locking
Nebulex alternatives and similar packages
Based on the "Caching" category.
Alternatively, view Nebulex alternatives based on common mentions on social networks and blogs.
cachex9.6 3.6 Nebulex VS cachexA powerful caching library for Elixir with a wide featureset.
con_cache9.3 4.3 Nebulex VS con_cacheConCache is an ETS based key/value storage.
locker9.1 0.0 Nebulex VS lockerAtomic distributed "check and set" for short-lived keys.
lru_cache5.6 0.0 Nebulex VS lru_cacheSimple LRU Cache, implemented with ets.
stash5.1 0.0 Nebulex VS stashA straightforward, fast, and user-friendly key/value store.
gen_spoxy4.5 0.0 Nebulex VS gen_spoxyCaching made fun.
Mem3.9 0.0 Nebulex VS MemKV cache with TTL, Replacement and Persistence support
jc3.6 0.0 Nebulex VS jcIn-memory, distrbutable cache with pub/sub, JSON-query and consistency support.
elixir_locker3.1 0.0 Nebulex VS elixir_lockerLocker is an Elixir wrapper for the locker Erlang library that provides some useful libraries that should make using locker a bit easier.
Haphazard2.5 0.0 Nebulex VS HaphazardA configurable plug for caching
Scout APM - Leading-edge performance monitoring starting at $39/month
Do you think we are missing an alternative of Nebulex or a related project?
Popular Comparisons
README
Nebulex 🌌
In-memory and distributed caching toolkit for Elixir.
Nebulex provides support for transparently adding caching into an existing Elixir application. Similar to Ecto, the caching abstraction allows consistent use of various caching solutions with minimal impact on the code.
Nebulex cache abstraction shields developers from directly dealing with the underlying caching implementations, such as Redis, Memcached, or even other Elixir cache implementations like Cachex. Additionally, it provides totally out-of-box features such as cache usage patterns, declarative annotation-based caching, and distributed cache topologies, among others.
See the getting started guide and the online documentation for more information.
Usage
You need to add
nebulex as a dependency to your
mix.exs file. However, in
the case you want to use an external (a non built-in adapter) cache adapter,
you also have to add the proper dependency to your
mix.exs file.
The supported caches and their adapters are:
For example, if you want to use a built-in cache, add to your
mix.exs file:
def deps do [ {:nebulex, "~> 2.0"}, {:shards, "~> 1.0"}, #=> When using :shards as backend {:decorator, "~> 1.3"}, #=> When using Caching Annotations {:telemetry, "~> 0.4"} #=> When using the Telemetry events (Nebulex stats) ] end
In order to give more flexibility and fetch only needed dependencies, Nebulex makes all dependencies optional. For example:
For intensive workloads, you may want to use
:shardsas the backend for the local adapter and having partitioned tables. In such a case, you have to add
:shardsto the dependency list.
For enabling the usage of declarative annotation-based caching via decorators, you have to add
:decoratorto the dependency list.
For enabling Telemetry events to be dispatched when using Nebulex stats, you have to add
:telemetryto the dependency list. See telemetry guide.
If you are using an adapter different than the built-in ones (e.g: Cachex or Redis adapter), you have to add the adapter dependency too.
Then run
mix deps.get in your shell to fetch the dependencies. If you want to
use another cache adapter, just choose the proper dependency from the table
above.
Finally, in the cache definition, you will need to specify the
adapter:
respective to the chosen dependency. For the local built-in cache it is:
defmodule MyApp.Cache do use Nebulex.Cache, otp_app: :my_app, adapter: Nebulex.Adapters.Local end
Quickstart example
Assuming you are using
Ecto and you want to use declarative caching:
# In the config/config.exs file config :my_app, MyApp.PartitionedCache, primary: [ gc_interval: :timer.hours(12), backend: :shards, partitions: 2 ] # Defining a Cache with a partitioned topology defmodule MyApp.PartitionedCache do use Nebulex.Cache, otp_app: :my_app, adapter: Nebulex.Adapters.Partitioned, primary_storage_adapter: Nebulex.Adapters.Local end # Some Ecto schema defmodule MyApp.Accounts.User do use Ecto.Schema schema "users" do field(:username, :string) field(:password, :string) field(:role, :string) end def changeset(user, attrs) do user |> cast(attrs, [:username, :password, :role]) |> validate_required([:username, :password, :role]) end end # The Accounts context defmodule MyApp.Accounts do use Nebulex.Caching alias MyApp.Accounts.User alias MyApp.PartitionedCache, as: Cache alias MyApp.Repo @ttl :timer.hours(1) @decorate cacheable(cache: Cache, key: {User, id}, opts: [ttl: @ttl]) def get_user!(id) do Repo.get!(User, id) end @decorate cacheable(cache: Cache, key: {User, username}, opts: [ttl: @ttl]) def get_user_by_username(username) do Repo.get_by(User, [username: username]) end @decorate cache_put( cache: Cache, keys: [{User, usr.id}, {User, usr.username}], match: &match_update/1 ) def update_user(%User{} = usr, attrs) do usr |> User.changeset(attrs) |> Repo.update() end defp match_update({:ok, usr}), do: {true, usr} defp match_update({:error, _}), do: false @decorate cache_evict(cache: Cache, keys: [{User, usr.id}, {User, usr.username}]) def delete_user(%User{} = usr) do Repo.delete(usr) end def create_user(attrs \\ %{}) do %User{} |> User.changeset(attrs) |> Repo.insert() end end
See more Nebulex examples.
Important links
- Getting Started
- Documentation
- Cache Usage Patterns
- Instrumenting the Cache with Telemetry
- Migrating to v2.x
- Examples
Testing
Testing by default spawns nodes internally for distributed tests. To run tests
that do not require clustering, exclude the
clustered tag:
$ mix test --exclude clustered
If you have issues running the clustered tests try running:
$ epmd -daemon
before running the tests.
Benchmarks
Nebulex provides a set of basic benchmark tests using the library benchee, and they are located within the directory [benchmarks](./benchmarks).
To run a benchmark test you have to run:
$ MIX_ENV=test mix run benchmarks/{BENCH_TEST_FILE}
Where
BENCH_TEST_FILE can be any of:
local_with_ets_bench.exs: benchmark for the local adapter using
:etsbackend.
local_with_shards_bench.exs: benchmark for the local adapter using
:shardsbackend.
partitioned_bench.exs: benchmark for the partitioned adapter.
For example, for running the benchmark for the local adapter using
:shards
backend:
$ MIX_ENV=test mix run benchmarks/local_with_shards_bench.exs
Additionally, you can also run performance tests using
:basho_bench.
See nebulex_bench example
for more information.
Contributing
Contributions to Nebulex
mix check and ensure
all checks run successfully.
Nebulex source code is licensed under the [MIT License](LICENSE).
*Note that all licence references and agreements mentioned in the Nebulex README section above are relevant to that project's source code only. | https://elixir.libhunt.com/nebulex-alternatives | CC-MAIN-2021-21 | refinedweb | 1,136 | 50.84 |
Linear Regression
Linear Regression is the beginner’s algorithm for a kick-start in Machine Learning. Let's take a deep dive into the Math behind this algorithm.. The regression outcomes lead to the identification of the direction, size, and analytical significance of the relationship between predictor and response, where the dependent variable could be numerical or discrete in nature.
Where do we use this algorithm?
- Hours spent studying Vs Marks scored by students
- Amount of rainfall Vs Agricultural yield
- Electricity usage Vs Electricity bill
- Suicide rates Vs Number of stressful people
- Years of experience Vs Salary
- Demand Vs Product price
- Age Vs Beauty
- Age Vs Health issues
- Number of Degrees Vs Salary
- Number of Degrees Vs Education expenditure
So you may note that this is a widely used algorithm. Also, many other algorithms are derived from this algorithm.
Types of regression techniques
In addition to it, the types of regression analysis can be selected on the attributes, target variables, or the shape and nature of the regression curve that reveal the relationship between dependent and independent variables. In this blog, we will discuss linear regression with MATH in Detail.
Introduction
Linear Regression is a supervised machine learning algorithm where the predicted output is continuous and has a constant slope. It’s used to predict values within a continuous range (e.g., sales price) rather than trying to classify them as categories (e.g., cat, dog). There are two main types:
Simple regression
Simple linear regression uses a traditional slope-intercept form, where m and b are the variables. The algorithm will try to “learn” to produce the most correct predictions where x represents our input data and y represents our prediction.
y = mx + b ; m: slope, b: intercept
Multivariable regression
A more complex multi-variable linear equation might look like this, where we represent the coefficients or weights our model will try to learn.
f(x,y,z) = w1x + w2y + w3z;
x, y, z are three input parameters & w represents weight
The variables x, y, z represent the attributes or distinct pieces of information we have about each observation. For sales predictions, these attributes might include a company’s advertising spend on radio, TV, and newspapers.
Sales = w1Radio + w2TV + w3News
Simple Regression
Let’s say we are given a dataset with the following columns (features): how much a company spends on Radio advertising each year, vs. its annual sales of units sold. We are trying to develop an equation that will let us predict units sold based on how much a company spends on radio advertising. The rows (observations) represent companies.
Making Prediction
The prediction function outputs an estimate of sales given a company’s radio advertising spend and our current values for Weight and Bias.
Sales = Weight⋅Radio + Bias
Weight: the coefficient for the Radio independent variable. In machine learning, we call coefficients weights.
Radio: the independent variable. In machine learning, we call these variables features.
Bias: the intercept where our line intercepts the y-axis. In machine learning, we can call intercepts bias. Bias offsets all predictions that we make.
Our aim is to achieve the best values for weight and bias and to achieve that we will use different techniques. By the end of our training, our equation will approximate the line of best fit. For updating these weight and biases, we will introduce a cost function (or loss function) and try to reduce it’s value (loss value).
The Cost Function
The main set-up for updating weight and biases is to define a cost function (also known as a loss function) that measures how well the model predicts outputs on the test set. The goal is to then find a set of weights and biases that reduces the value of the cost function. One common method that is often used is the mean squared error (MSE) to measure the difference between the actual value of y and the estimated value of y (predicted value). The equation of the above regression line is:
hθ(x) = θ0 + θ1x (resembles y = mx + c)
It has only two parameters: weight (θ1)and bias (θ0). This equation is used to make a cost-function equation, as seen in the above image. Further, the cost function is calculated multiple times till its value is decreased (up to some extent) and we get acceptable results. To compare the real value vs. predicted value, we either use MSE or variance.
Given our simple linear equation y=mx + b, we can calculate MSE as:
MSE = (1/N) ∑(i=1 to n)(yi − (mxi + b))^2
N is the total number of observations (data points)
(1/N) ∑(i=1 to n) is the mean
yi is the actual value of an observation and mxi+b is our prediction
Are Variance and MSE the same?
Variance is the measure of how far the data points are spread out, whereas MSE is the measure of how the predicted values are different from the actual values. Though both are the measures of the second moment, there is a significant difference. In general, the sample variance measures the spread of the data around the mean (in squared units), while the MSE measures the vertical spread of the data around the regression line (in squared vertical units). Hope you don’t get confused by these terms. Further, to reduce the MSE, we perform gradient descent.
Gradient Descent
To reduce MSE, we use Gradient Descent and calculate the gradient of our cost function. Gradient Descent runs iteratively to find the optimal values of the parameters corresponding to the decreasing value of the given cost function using calculus. Mathematically, the technique of the ‘derivative’ is extremely important to reduce the cost function because it helps get the minimum point. The derivative is a concept from calculus and refers to the slope of the function at a given point. We need to know the slope so that we know the direction (sign) to move the coefficient values to get a lower cost on the next iteration.
Math
There are two parameters (coefficients) in our cost function we can control: weight m and bias b. Since we need to consider the impact each one has on the final prediction, we use partial derivatives. To find the partial derivatives, we use the Chain Rule. We need the chain rule because (y−(mx+b))² is the two nested functions: the inner function (y−(mx+b)) and the outer function x².
Returning to our cost function:
First, we will look at Chain Rule:
Based on this chain rule, we can calculate the gradient of this cost function as:
At this point, you must be thinking about how to code these functions. Relax!!
We don’t code these functions, instead, we directly import a linear regression module from the sci-kit learn library that automatically calculates the weights and biases. The sample code is shown below.
#First splitting data for training data(85%) and testing data(15%)
#test_size can be changed
#random_state Controls the shuffling applied to the data before applying the split 1==True
#Here x_data = df['Radio ($)'] & y_data = df['Sales']from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x_data, y_data, test_size=0.15, random_state=1)#Creating linear regression model
from sklearn.linear_model import LinearRegression
#Create the linear regression object
lm = LinearRegression()lm.fit(x_train, y_train)
test_y_hat = lm.predict(x_test)print("Mean absolute error: %.2f" % np.mean(np.absolute(test_y_hat - y_test)))print("Residual sum of squares (MSE): %.2f" % np.mean((test_y_hat - y_test) ** 2))print("Accuracy of train dataset is : ",lm.score(x_train,y_train))print("Accuracy of test dataset is : ",lm.score(x_test,y_test))
Multivariable regression
Let’s say we are given data on TV, radio, and newspaper advertising spend for a list of companies, and our goal is to predict sales of units sold.
Normalization
As the number of features grows, calculating gradient takes longer to compute. We can speed this up by “normalizing” our input data to make sure all values are within the same range. This is especially important for datasets with high-standard deviations or differences in the ranges of the attributes. Our goal now will be to normalize our features so they are all in the range of -1 to 1.
Making Prediction
Our predict function outputs an estimate of sales given our current weights (coefficients) and a company’s TV, radio, and newspaper spend. Our model will try to identify weight values that most reduce our cost function.
Sales = w1TV + w2Radio + w3Newspaper
Cost Function
Now, we need a cost function to audit how our model is performing. The math is the same, except we swap the mx+b expression for w1x1+w2x2+w3x3. We also divide the expression by two to make derivative calculations simpler.
MSE = (1/2N) (∑i=1n(yi−(W1x1+W2x2+W3x3))^2)
Gradient Descent
Again, using the Chain Rule, we can compute the gradient–a vector of partial derivatives describing the slope of the cost function for each weight.
f′(W1)=−x1(y−(W1x1+W2x2+W3x3))
f′(W2)=−x2(y−(W1x1+W2x2+W3x3))
f′(W3)=−x3(y−(W1x1+W2x2+W3x3))
Simplifying the Matrix
The gradient descent code above has a lot of duplication. Can we improve it somehow? One way to refactor would be to loop through our features and weights–allowing our function to handle any number of features. But there is another, even better technique called vectorized gradient descent.
We use the same formula as above, but instead of working on a single feature at a time, we use matrix multiplication to operative on all features and weights simultaneously. We replace the xi terms with a single feature matrix X.
gradient= −X(targets−predictions)
This is how math works in multivariable regression. Understanding this much is more than enough because we never use it directly in our code. We use the algorithm directly using the sci-kit learn library.
I hope you liked this blog. Please make a feedback response. | https://deeppatel23.medium.com/linear-regression-9a8d3b141b6b?source=post_internal_links---------1---------------------------- | CC-MAIN-2021-25 | refinedweb | 1,657 | 53.61 |
A few extra notes:- Several places use long (or unsigned long) formats for the result of ntohl(), this is a 32-bit quantity. Makes no difference on ia32, but could bite on Alpha (an int is 32, a long is 64 there)- There are several headers for NFS: include/linux/nfs.h include/linux/nfs2.h include/linux/nfs3.h include/linux/nfsd/const.h Several constants defined in nfs?.h are repeated in nfsd/const.h, which on the whole seems to be more complete than the others. Should this stuff be moved into nfs?.d, and nfsd/const.h deleted? What about nfs.h, which duplicates other stuff?- The whole nls stuff is a bunch of tables plus a few functions and structures that look like boilerplate code to my (untrained) eye. I'd rewrite the whole lot as the tables plus an #included file that gives the rest, to reduce the possibility of code skew. They all seem to have a (minor) bug in that their users (e.g, fs/vfat/namei.c:679)pass a const char pointer to ->char2uni() (one of the functions replicated in each nls module) which is declared to take a plain char pointer. This function doesn't modify anything, so const char pointer is really right. But to change them all is a mess... I'd prefer to do it as explained earlier. Comments? --- ./fs/isofs/joliet.c-2.2.18pre10 Wed Jun 7 17:26:43 2000+++ ./fs/isofs/joliet.c Tue Sep 26 20:40:26 2000@@ -19,8 +19,6 @@ struct nls_table *nls) { unsigned char *ip, *op;- unsigned char ch, cl;- unsigned char *uni_page; ip = uni; op = ascii;--- ./fs/fat/dir.c-2.2.18pre10 Sun Sep 24 00:14:47 2000+++ ./fs/fat/dir.c Tue Sep 26 19:41:31 2000@@ -68,8 +68,6 @@ struct nls_table *nls) { unsigned char *ip, *op;- unsigned char ch, cl;- unsigned char *uni_page; unsigned short val; ip = uni;--- ./net/ipv4/ip_masq_user.c-2.2.18pre10 Wed May 3 20:16:53 2000+++ ./net/ipv4/ip_masq_user.c Tue Sep 26 23:01:40 2000@@ -401,7 +401,7 @@ magic_control = atomic_read(&ms->n_control); if (!magic_control && ms->control) magic_control = -1;- sprintf(temp,"%-4s %08lX:%04X %08lX:%04X %08lX:%04X %-12s %3X %4d %3d %7lu %4d %4d",+ sprintf(temp,"%-4s %08X:%04X %08X:%04X %08X:%04X %-12s %3X %4d %3d %7lu %4d %4d", masq_proto_name(ms->protocol), ntohl(ms->saddr), ntohs(ms->sport), ntohl(ms->daddr), ntohs(ms->dport),--- ./net/ipv4/ip_masq_irc.c-2.2.18pre10 Sun Sep 24 00:14:50 2000+++ ./net/ipv4/ip_masq_irc.c Tue Sep 26 23:07:50 2000@@ -77,8 +77,6 @@ * List of supported DCC protocols */ -#define NUM_DCCPROTO 5- struct dccproto { char *match;@@ -93,6 +91,9 @@ { "SCHAT ", 6 }, { "ACCEPT ", 7 }, };++#define NUM_DCCPROTO (sizeof dccprotos / sizeof dccprotos[0])+ #define MAXMATCHLEN 7 static int@@ -225,7 +226,7 @@ * Replace the old "address port" with the new one */ - buf_len = sprintf(buf,"%lu %u",+ buf_len = sprintf(buf,"%u %u", ntohl(n_ms->maddr),ntohs(n_ms->mport)); /*@@ -347,7 +348,7 @@ * Replace the outside address with the inside address */ - buf_len = sprintf(buf,"%lu %u",+ buf_len = sprintf(buf,"%u %u", ntohl(n_ms->saddr),ntohs(n_ms->sport)); /*--- ./drivers/usb/usb-uhci.c-2.2.18pre10 Tue Sep 26 19:34:18 2000+++ ./drivers/usb/usb-uhci.c Tue Sep 26 19:32:19 2000@@ -1423,14 +1423,14 @@ continue; } - if(urb->iso_frame_desc[n].length > maxsze) { #ifdef ISO_SANITY_CHECK+ if(urb->iso_frame_desc[n].length > maxsze) { err("submit_iso: urb->iso_frame_desc[%d].length(%d)>%d",n , urb->iso_frame_desc[n].length, maxsze); tdm[n] = 0; ret=-EINVAL; goto inval;-#endif }+#endif ret = alloc_td (&td, UHCI_PTR_DEPTH); inval:-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgPlease read the FAQ at | http://lkml.org/lkml/2000/9/27/36 | CC-MAIN-2017-09 | refinedweb | 631 | 56.76 |
This post lets us create a publisher and subscriber messaging app using Azure Web PubSub Service and C#. In the previous post, Getting Started with Azure Web PubSub Service; we have learned how to create Azure Web PubSub Service in the Azure Portal and tested the messaging using one sample application. This post will use the Azure SDK client library for the Web PubSub service to build a simple messaging application using C#.
Getting Started with Azure Web PubSub Service
Messaging App using Azure Web PubSub Service
To start with, create a Blank Solution in Visual Studio, and add two console projects “AzureWebPubSubDemoPublisher” and “AzureWebPubSubDemoSubscriber“. Once you are done with that, your solution structure will look like the following.
Create the Publisher
Firstly, let us start create the publisher App. Add “Azure.Messaging.WebPubSub” NuGet package to the solution.
Once the package is added, the solution structure will looks like follows.
Replace the program.cs code with the following code block and update the Keys and Hub Name generated from the portal.
using Azure.Messaging.WebPubSub; using System; var webPubSubServiceClient = new WebPubSubServiceClient("Endpoint=;AccessKey=tGXgGGnOSpnCSiVdZIZ+P1L19/YWBjcqNjEf+xEgD/0=;Version=1.0;", "Hub"); string send = "y"; while (send.ToLower().Equals("y")) { Console.WriteLine("Sending Message.."); webPubSubServiceClient.SendToAll("This is a message from your publisher"); Console.WriteLine("Message Sent"); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Send another message? Y/N"); send = Console.ReadLine(); Console.ForegroundColor = ConsoleColor.White; }
The above code block used C# 9.0 Top-Level Statement feature: Top-Level Statement allows developers to write programs without explicitly defining the class or main method. Until C# 9.0, It was all about the Main() method where program control start and ends. With C# 9.0, you don’t need to mention the Main() method or Class definition explicitly using Top-Level Statement.
In case you are not using C# 9.0, you have the same code block written with the Main().Top Level Statement in C# 9.0
Get the PubSub Keys from Portal
We can connect with the application either using the Connection String or from the Client URL Generator. Here we have used the primary connecting string.
With that, we are done with the publisher part.
In the next section we will create the subscribers to consume the messages.
10 Azure Cloud services that every Developers, Consultant, and Architects should Know and Learn it well
Create the Subscriber
In the subscriber project, we need to add two package, “Azure.Messaging.WebPubSub” and “WebSocket.Client” .
Open the program.cs file, and update the following code. That’s should be enough from here.
using System; using Azure.Messaging.WebPubSub; using Websocket.Client; var webPubSubServiceClient = new WebPubSubServiceClient("Endpoint=;AccessKey=tGXgssdsdsdsdD/0=;Version=1.0;", "Hub"); var url = webPubSubServiceClient.GetClientAccessUri(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Connecting with Client...."); using (var websocketClient = new WebsocketClient(url)) { Console.ForegroundColor = ConsoleColor.Green; websocketClient.MessageReceived.Subscribe(receivedMessage => Console.WriteLine($"Message received: {receivedMessage}")); await websocketClient.Start(); Console.WriteLine("Connected.. Waiting for Message"); Console.Read(); }
Test the Azure Web PubSub Message App
Let us know test both the application together and see how it works. Run both the applications as “Debug – Start New Instance” so that you can run both the applications together.
Alternatively, you can setup multiple project as startup as well. check this out
Finally, when the both the console app is running, you can just sent out a message the publisher, and see the message is getting reflected to subscriber as well.
You can also run multiple subscriber, and you will find all of them are receiving message as we have used “SendAll()“
To summarize, in this post we have used one of the existing Azure Web PubSub services and created one simple message application using C#
Pingback: Dew Drop – May 7, 2021 (#3438) – Morning Dew by Alvin Ashcraft | https://dailydotnettips.com/create-a-messaging-app-using-azure-web-pubsub-service-and-c/ | CC-MAIN-2021-25 | refinedweb | 634 | 50.94 |
- Key: SYSML17-146
- Status: open
- Source: Software Centre of Excellence, Rolls-Royce Div. ( Dave Banham)
- Summary:
It would be very useful to have the ability to have literal values as parameter values to a constraint block property. (Helps with reuse of constraint blocks.) Even better, to be able to use named constants from a (shared) library package (i.e. a different namespace), which could combine a description of the value with quantity and unit attributes.
-
- Updated: Tue, 23 Apr 2019 00:20 GMT
SYSML17 — Numeric Literals as constraint block property parameter values
- Key: SYSML17-146
- OMG Task Force: SysML 1.7 RTF | https://issues.omg.org/issues/SYSML17-146 | CC-MAIN-2022-33 | refinedweb | 102 | 55.24 |
Arquillian + seam 2.2.0Gilles Dupont Tagne Tagne Mar 14, 2010 8:33 AM
Hi Guys,
first of all thanks for the great job you did. I just want to ask, whether it's possible to use Arquillian with Seam 2.2.0?
1. Re: Arquillian + seam 2.2.0Jun Li Mar 16, 2010 2:08 AM (in response to Gilles Dupont Tagne Tagne)
That's also my question.
Thanks.
2. Re: Arquillian + seam 2.2.0Aslak Knutsen Mar 16, 2010 4:52 AM (in response to Gilles Dupont Tagne Tagne)
Yes and No..
While Arquillian 'Core' does support it in the sense it could deploy a Seam application to a container, there is nothing in place in Alpha-1 that actually does it.
We're still working on getting the different Packaging styles working correctly, war / ear etc..
In Alpha-1, EJB 3.0 / CDI jars are pretty much the only testable deployments.
How would you like to test Seam 2.2.0?
- Test the UI ? ()
- Support for @In injections in the TestCase?
- ?
We havn't discussed Seam 2.2.0 support in Arquillian yet. Not sure if we're going to put any effort into making it testable or just wait for Seam 3 so you can test your 2.2.0 components in the compatibility layer.
3. Re: Arquillian + seam 2.2.0Jun Li Mar 16, 2010 8:19 AM (in response to Aslak Knutsen)
Thanks for the replay Aslak.
We'd love to see Arquillian works with Seam 2.2.0 because the project we're working on use java6, therefore can't use SeamTest with TestNG. We end up have to inject all dependencies manually and do mockups for intergration testing which is a pain to write and can't do the level of test we want, such as transaction and conversation related tests.. I also believe there are more seam users out there than CDI adopters.
4. Re: Arquillian + seam 2.2.0Aslak Knutsen Mar 16, 2010 8:46 AM (in response to Jun Li)
allanjun wrote:.
The Seam dev team has been hard at work with Weld (CDI EE6 ref impl). Seam 3 is in dev as we speak and will use Weld (CDI) as core. Seam 3 is essential a set of CDI components/extensions.
Arquillian support CDI in Alpha-1, so we support Seam 3 already.
In fact, Arquillian is being used as the test framework to test Seam 3 today(), and will be the recommended way to test Seam by the dev team.
I'll have a look at how much is needed to get Seam 2.2.0 running in Arquillian.
5. Re: Arquillian + seam 2.2.0Jun Li Mar 16, 2010 8:01 PM (in response to Aslak Knutsen)Thanks for clarify a few things here. Looking forward to the analysis of getting Seam 2.2.0 running in Arquillian.
6. Re: Arquillian + seam 2.2.0Jun Li Jun 9, 2010 8:05 PM (in response to Jun Li)
Any progress on this?
7. Re: Arquillian + seam 2.2.0Michael Schuetz Aug 9, 2010 5:58 PM (in response to Jun Li)
Hi to all,
I have arquillian running for Seam 2.2 on JBossAS5.1 container now. (Should be work just fine for AS4.2* as long there is an appropriate container implementation provided)
My usecase is to integration test EJBs, which itselfes have Seam dependencies, going through all layers and get some persistent data.
I do use IDEA and can easily run my tests within ide really fast (no maven projects needs to be build) against remote container.
Example Code:
@RunWith(Arquillian.class) public class MyServiceIntegrationTest { @EJB private MyService myService; @Deployment public static Archive<?> getTestArchive() { // WAR final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war") .setWebXML("web.xml") .addResource("components.xml", "WEB-INF/components.xml"); // EJB-JAR final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "test.jar") .addClasses( MyServiceIntegrationTest.class, MyService.class, MyServiceBean.class, MyServiceDao.class, MyDaoBean.class, My.class, AbstractEntity.class, SeamUtil.class) .addResource("seam.properties", "seam.properties") .addResource("components.properties", "components.properties") .addResource("ejb-jar.xml", "META-INF/ejb-jar.xml") .addResource("persistence.xml", "META-INF/persistence.xml"); // EAR final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear") .addModule(ejb) .addModule(war) .addModule(ArtifactResolver.resolve("org.jboss.seam:jboss-seam:2.2.0.GA")) .addLibrary(ArtifactResolver.resolve("org.jboss.el:jboss-el:1.0_02.CR4")); return ear; } @Test public void testIfSeamIsInitialized() { SeamUtil.initializeSeam(); } @Test public void testGetAll() { List<My> results = myService.getAll(); assertEquals(3, results.size()); } }
I could push a complete example to arquillian github sandbox, if requested.
regards
Michael
8. Re: Arquillian + seam 2.2.0Michael Schuetz Aug 5, 2010 7:39 AM (in response to Michael Schuetz)
Hi,
You could get this even shorter a bit.
// WAR
For
.addResource("components.xml", "WEB-INF/components.xml");
you could write
.addWebResource("components.xml");
// EJB-JAR
For
.addResource("ejb-jar.xml", "META-INF/ejb-jar.xml")
you could write
.addManifestResource("ejb-jar.xml");
Regards
Michael
9. Re: Arquillian + seam 2.2.0Sean Wu Aug 6, 2010 4:28 AM (in response to Michael Schuetz)
This definitely not what this post means. @EJB annotation can only inject EJB session bean. The question should be equal to: how can test seam component using @In. Seam component can be POJO and EJB, while if it is EJB, it can be treated as EJB test. But how about POJO?
10. Re: Arquillian + seam 2.2.0Martin Ball Aug 9, 2010 4:04 AM (in response to Michael Schuetz)
Michael, thanks for the post, I've just started looking at using Arquillian to test our Seam 2.2 projects and it's useful to know that it is possible. I am curious to know where the class SeamUtil originates, is this your own class that is initialising things or is it in some lib somewhere? I know JSFUnit has a SeamUtil class with isSeamInitialized() to test that it is, but not come across SeamUtil.initializeSeam()?
A complete example would be great.
Thanks.
Martin.
11. Re: Arquillian + seam 2.2.0Dan Allen Aug 9, 2010 6:05 PM (in response to Michael Schuetz)
Great job Michael! As I said in the Seam talk at JBoss World, the person who works out how to test Seam 2 apps using Arquillian will get a lot of hits on his/her blog Looks like you are off to the races.
In order to inject a POJO, you will need to do one of two things. The easy way is to lookup the Seam component using the static getInstance() method.
Component.getInstance("myService")
Once Seam is initialized, you can get a handle on any Seam component via its name in this way.
The more complete approach would be to support injection into the test case. For this, you would need to add an Arquillian test enricher. You can reference the EJBInjectionEnricher for ideas. It's just a matter of grabbing the field name (or explicit value of @In) and looking up the instance using Component.getInstance().
12. Re: Arquillian + seam 2.2.0Michael Schuetz Aug 29, 2010 6:05 PM (in response to Dan Allen)
Hi Dan,
thanks a lot.
Hm, the Seam2 Enricher approach really attracts me. So, if I would want to write an enricher for @In, I wonder what's the right place for the code base:
- Arquillian Core?
- Arquillian Framework?
- Seam Core?
- my own code base?
And than all containers would need to *implement* this enricher?
Thanks ans regards
Michael
13. Re: Arquillian + seam 2.2.0Aslak Knutsen Aug 29, 2010 6:44 PM (in response to Michael Schuetz)
You can start work on it in
Basically make a Seam 2 extension.
Implement the SPI org.jboss.arquillian.spi.TestEnricher
- use reflection to find fields / methods that has the @In annotations on the TestCase Object and look them up in the Container context
Implement the SPI org.jboss.arquillian.spi.AuxiliaryArchiveAppender
- create a ShrinkWrap JavaArchive that package up your TestEnricher extension so that it can be deployed along side the rest of the deployment.
e.g.
return ShrinkWrap.create(JavaArchive.class, "arquillian-seam-enricher.jar")
.addClass(SeamInjectionEnricher.class)
.addServiceProvicder(TestEnricher.class, SeamInjectionEnricher.class)
With this all you need is to add the Seam 2 Enricher extension to the Classpath and it will do it's magic.
14. Re: Arquillian + seam 2.2.0Bernard Labno Oct 7, 2010 4:49 AM (in response to Aslak Knutsen)
What is the progress in this topic?
Michael, have you created Seam enricher? What version of servlet-api do you use, 2.5 or 3.0?
Anybody successfull of running arquillian against Seam packaged as WAR? | https://developer.jboss.org/thread/149409 | CC-MAIN-2018-17 | refinedweb | 1,439 | 67.76 |
error with importing sage into a python file
Im trying to import a sage package (var) in a python file
from sage.all import var
but when run the file Im getting this error :
Error Traceback (most recent call last): execfile("/home/sagefolder/SageMath/myapp/core/test.py") problems was related to the env path. but even
sys.path.append('/path/to/the/sage/')
it does not work
It seems it has problem with the value of some env variables like 'SAGE_ROOT' and ... but according to the (installation manual), if I set the symbolic link
ln -s /path/to/SageMath/sage /usr/local/bin/sage
then all the required env variable are automatically handled.
this module is called from a django views.py which is also installed as a Sage package. if I run the the module using
sage test.py
everything is ok but when it is called from a django view which is also installed as sage packages I got the mentioned error
I would be pleased if anybody can help me as Im doing an important project and I really need to use sage. | https://ask.sagemath.org/question/43849/error-with-importing-sage-into-a-python-file/ | CC-MAIN-2019-13 | refinedweb | 187 | 63.19 |
Say what you want about the merits or lack thereof (I would’ve preferred to have namespaces, as well), but the discussion ended when Rust 1.0 came out.
Crates.io package policies
Huh, I’d think this would be easy to retrofit. I’ll existing package names become top-level. Not elegant, but totally sound.
Also, I was thinking about this earlier today because is complicated by the fact that new stdlib crates may be impossible to ever put on crates.io unless we are vigorous about reserving names.
But do crate names actually matter? My understanding is that crates are really anonymous, and it’s the job of a build system (currently cargo) to connect a certain
rlib with
extern crate foo. So you can, for example, have two completely different and orthogonal naming schemes on cates.io (and add more if you need to), like
[dependencies] // default global namespace time = "*" // maven style std = { groupId = "rust" artifactId = "libstd" version = "*" }
So you can even have different aliases for the exact same crate. There can’t be any naming conflicts between your direct dependencies, because, again, crates apparently have no names, and so you theoretically can introduce explicit names in
Cargo.toml yourself.
You already can make the name of the crate different than the name of the package. I do this in
winapi where you depend on
kernel32-sys from crates.io, yet do
extern crate kernel32;. So multiple crates could easily use the same crate name, and even better, Cargo has no way of differentiating between them! If you depend on two packages that choose the same crate, you’re stuck. While this problem would be worse with namespaces, it already exists under the current system, and I’m surprised nobody has attempted to solve this yet.
I wrote a thing about the history of package managers and where cargo fits in; several parts of the pains described in previous managers fit into the decisions we made here, looking back.
Thanks for the link to the history. As far as I can tell, the part of it that seems specifically relevant to this package namespacing discussion is the following:
But all was not well in package manager land. While you can install
mojombo-gritand
gritat the same time… do you want to? For those of you who don’t know Ruby, it has no real namespacing, so… yeah. It got messy. Furthermore, since you could so easily use these forks, people didn’t bother contributing fixes back upstream. They’d just say “oh cool I pushed a patch to
steveklabnik/gritso use that instead.” And now you had hundreds of forks of popular projects with their own little incompatible extensions. It was madness. It was not a good time. Nobody was happy.
It seems like there are two points made above: first, that Ruby didn’t have sufficient namespacing in the language to prevent conflicts between different forks of the same crates; second, that the ease of using forks meant that people didn’t put in the effort to merge their changes upstream.
As far as I am aware, Rust has namespacing in the language to prevent the first problem. Concretely, suppose that crates.io had namespaces, and my crate has one dependency using
foo/crate while another was using
bar/crate. What problem does this actually cause?
Having hundreds of slightly different but incompatible forks of popular projects is also a problem, but it’s not a problem caused by the availability of namespaces. Making it harder to fork existing crates doesn’t make it easier for people to merge their changes to a single upstream, which is the more important problem to solve. Moreover, there’s lots of good reasons why someone would want to fork a crate: because the maintainer is unresponsive, because there are different visions for what’s important, because there are different standards of quality, etc.
I remain deeply unconvinced that it’s a good idea to have a single global namespace for crates, for many of the reasons already described at length by others in this thread.
This discussion seems dead, but since I just got very annoyed at the lack of namespaces, I thought I’d add my experience just to document that yes, its still annoying.
I’m experimenting with embedded stuff, and there are some projects initiated by japaric that follow a certain naming pattern, e.g.
stm32f30x-hal. Those names make sense because they refer to a real life family of MCUs, there are f1, f3, f4 etc.
I found that there are crates that follow japaric’s naming pattern, but do not contain anything useful and haven’t been updated in a long time.
This is essentially a discovery problem - I’d like to know for which MCUs there are useable crates, but I have to click every single one of them and see what it contains, which is sometimes not obvious. If there was an “official” namespace, be it japaric’s own or some embedded working group one, I could trust that and navigate the repo much more easily.
Namespaces could be brands that one could trust, because there are gatekeepers. Crates could be named in logical, consistent ways, without fearing squatters or introducing “creative” names that would confuse more than they would help.
Thanks for the hint, I know that page. My point is that I wish something like that was unnecessary. Namespaces are really just one piece of the puzzle.
I think a good and relativley simple solution would be an official wiki (on crates.io?) where the users (everyone?) could organize the crates into arbitrary categories, groups, trees. For discovery you could browse the wiki and you wouldn’t really have to care about the name of the crate.
Yeah something like that. Trust in a given piece of code via association to a branding, e.g. a namespace, plus crowdsourced labels / ratings / categories to facilitate discovery. In the 90s we used to have “web directories”. They don’t scale infinitely, but thats not needed. In a given category, there are only so many libraries that really matter. Something like a wiki page as a starting point is not the worst idea.
We already have and
Thanks. I did not know those exist.
They are not easily discoverable and way too rigid at first glance. I think a wiki is a better solution. If people feel like hosting their collections on random GitHub pages then the current solution is probably not a good enough solution.
We may be able to make them more discoverable, but each crate has them on their page, so there is some way to find them, at least.
Categories is rigid, but tags are 100% free-form. That’s one of the primary differences between the two. | https://internals.rust-lang.org/t/crates-io-package-policies/1041?page=3 | CC-MAIN-2018-22 | refinedweb | 1,139 | 72.26 |
19 June 2008 16:36 [Source: ICIS news]
TORONTO (ICIS news)--Germany’s biodiesel prices have improved and raw material costs have stabilised, producer EOP Biodiesel said on Thursday.
Should current selling prices and cost trends continue, EOP expected to break even in its fiscal fourth quarter ending 30 June, said chief financial officer Karl-Wilhelm Giersberg.
For March and April the company had already recorded profits, he added.
?xml:namespace>
Also helping was a new railway connection, opened last month, to EOP's 130,000 tonne/year production side in ?xml:namespace>
In addition, EOP was making progress in gaining share in the market for blended biodiesel, called B5, or 5% blending, as it was establishing itself as a preferred supplier to refiners, it said.
For the nine months ended 31 March EOP doubled revenues to more than €67.7m ($106m), compared with the year-earlier period.
On a before interest and tax basis, EOP recorded a loss of €4.3m, compared with a loss of €600,000 in the year-earlier period when it benefited from investment grants, it said.
German biofuels industry association Verband der Deutschen Biokraftstoffindustrie said on Wednesday that the country's biodiesel producers continued to struggle amid high feedstock costs and a tax increase on biofuels.
Analysts said producers had been building up massive capacities in past years but came under pressure as raw material costs rose.
Also hurting results were the tax increase that took effect on 1 January, planned further tax increases through 2012, and imports, they said.
To discuss issues facing the chemical industry go to ICIS connect
Bookmark Simon Robinson’s Big Biofuels Blog for some independent thinking on biofuels
( | http://www.icis.com/Articles/2008/06/19/9133912/eop-biodiesel-notes-turnaround-in-german-market.html | CC-MAIN-2015-22 | refinedweb | 280 | 50.87 |
This is the ninth of a series of articles on “Type Parameters and Type Members”.
Scala’s
CanBuildFrom API
is relatively well-founded and flexible;
in combination with GADTs, it can provide that flexibility in a fully type-safe way,
if users choose not to circumvent it with typecasting.
However, it is designed in a purely mutable way; you cannot write a
useful
CanBuildFrom that does not rely on mutation, and you cannot
use the API externally in a functional way.
Let’s design an alternative to
CanBuildFrom that makes sense in a
purely functional context, allowing both implementers and users to
avoid unsightly mutation.
Spoiler warning! Our first pass will have one glaring inelegance. We will use concepts from previous articles in Type Parameters and Type Members to “invert the abstraction”, which will greatly simplify the design. Once you’re comfortable with the “inversion”, you can skip the intermediate step and use this technique directly in your own designs.
The pattern of use of
CanBuildFrom is
applythe CBF to produce a
Builder.
+=and
++=methods to “fill up” the
Builder.
resultto “finalize” or “commit” to the final structure.
import collection.generic.CanBuildFrom val cbf = implicitly[CanBuildFrom[Nothing, Int, List[Int]]] val b = cbf() b += 3 b ++= Seq(4, 5) b.result() res0: List[Int] = List(3, 4, 5)
Let’s set aside that this is only suited to eager collections, not
lazy ones like
Stream. You
can tell the problem by types:
+= and
++= have the return type
this.type. Effectively, this means that if their implementations are
purely functional, all they can do is return
this:
def +=(elem: Elem) = this def ++=(elems: TraversableOnce[Elem]) = this
Aside from the informal contract of
Builder, which suggests that
calls to these methods perform a side effect, the types enforce that
they must perform any useful work by means of side effects.
Returning
this.type permits these methods to be called in a
superficially functional style:
b.+=(3) .++=(Seq(4, 5)) .result() res1: List[Int] = List(3, 4, 5)
This retouch is only skin-deep, and can’t repair the defect making
CanBuildFrom unsuitable for functional programs, but it implies that
a functional alternative lurks nearby. Let’s go looking for it.
Builderstate
First, we need to take the essential mutation out of
Builder. That
means it needs to provide an initial state, and the other methods must
use it as a parameter and return value.
+=and
++=will take that state as an argument, returning the new state instead of
this.type.
resultwill take the final state as an argument, still producing the result collection.
While the intermediate state might be the same as the final state,
we don’t want to require that. So
Builder also gains a type
parameter to represent the type of state,
S.
trait FunBuilder[S, -Elem, +To] { /** Produce the initial state. */ def init: S // note everywhere 'S' was added def +=(s: S, elem: Elem): S def ++=(s: S, elems: TraversableOnce[Elem]): S def result(s: S): To }
FunBuilder
We can incrementally build a
Vector,
but it may not be the most efficient way. Instead, let’s try to
accumulate a
List,
then construct the
Vector once we’re done.
class VectorBuilderList[A] extends FunBuilder[List[A], A, Vector[A]] { def init = List() def +=(s: List[A], elem: A) = elem :: s def ++=(s: List[A], elems: TraversableOnce[A]) = elems.toList reverse_::: s def result(s: List[A]) = s.toVector.reverse } val vbl = new VectorBuilderList[Int] vbl.result(vbl.++=(vbl.+=(vbl.init, 2), Seq(3, 4))) res0: scala.collection.immutable.Vector[Int] = Vector(2, 3, 4)
(There’s a problem with
CanBuildFrom now, but we’ll hold off fixing
it.)
Maybe it would be better to optimize for the
++= “bulk add” method,
though.
class VectorBuilderListList[A] extends FunBuilder[List[Traversable[A]], A, Vector[A]] { def init = List() def +=(s: List[Traversable[A]], elem: A) = Traversable(elem) :: s def ++=(s: List[Traversable[A]], elems: TraversableOnce[A]) = elems.toTraversable :: s def result(s: List[Traversable[A]]) = s.foldLeft(Vector[A]()){(z, as) => as ++: z} } val vbll = new VectorBuilderListList[Int] vbll.result(vbll.++=(vbll.+=(vbll.init, 2), Seq(3, 4))) res0: scala.collection.immutable.Vector[Int] = Vector(2, 3, 4)
The type of these builders are different, even though their usage is
the same. This design also exposes what was originally internal
state as part of the API. Luckily,
CanBuildFrom makes a point of
this when we try to integrate
FunBuilder into our own CBF version;
there’s nowhere to put the
S type parameter.
trait FunCanBuildFrom[-From, -Elem, +To] { def apply(): FunBuilder[S, Elem, To] } …/FCBF.scala:42: not found: type S def apply(): FunBuilder[S, Elem, To] ^
We can hide the state by forcing the caller to deal with the builder in a state-generic context. One way to do this is with a generic continuation.
trait BuilderCont[+Elem, -To, +Z] { def continue[S](builder: FunBuilder[S, Elem, To]): Z } // in FunCanBuildFrom... def apply[Z](cont: BuilderCont[Elem, To, Z]): Z
Now we can implement a
FunCanBuildFrom that can use either of the
FunBuilders we’ve defined.
class VectorCBF[A](bulkOptimized: Boolean) extends FunCanBuildFrom[Any, A, Vector[A]] { def apply[Z](cont: BuilderCont[A, Vector[A], Z]) = if (bulkOptimized) cont continue (new VectorBuilderListList) else cont continue (new VectorBuilderList) }
Take a look at the type flow. The caller of
apply is the one who
decides the
Z type. But the
apply implementation chooses the
S
to pass to
continue, which cannot know any more about what that
state type is. (It can even choose different types based on runtime
decisions.) Information hiding is restored.
val cbf = new VectorCBF[Int](true) cbf{new BuilderCont[Int, Vector[Int], Vector[Int]] { def continue[S](vbl: FunBuilder[S, Int, Vector[Int]]) = vbl.result(vbl.++=(vbl.+=(vbl.init, 2), Seq(3, 4))) }} res1: Vector[Int] = Vector(2, 3, 4)
Now the code using the
FunBuilder can’t fiddle with the
FunBuilder’s state values; it can only rewind to previously seen
states, a norm to be expected in functional programming with
persistent state values.
This is rather a lot of inconvenient ceremony, though. Instead of
passing a continuation that receives the
S type as an argument along
with the
FunBuilder, let’s just have
apply return the type along
with the
FunBuilder. We have a tool for returning a pair of type and
value using that type.
def apply(): FunBuilder[_, Elem, To]
Remember that existential types are pairs.
Having collapsed callee-of-callee back to caller perspective, let’s apply the rule of thumb from the first post in this series.
A type parameter is usually more convenient and harder to screw up, but if you intend to use it existentially in most cases, changing it to a member is probably better.
The usual case will be from the perspective of a CBF user, so the
usual use of the
S parameter is existential. So let’s turn it into
the equivalent type member.
// rewrite the heading of FunBuilder as trait FunBuilder[-Elem, +To] { type S // and FunCanBuildFrom#apply as def apply(): FunBuilder[Elem, To] // and the parameter S moves to a member // for all implementations so far; // fix until compile or see appendix
And we can see the information stays hidden.
scala> val cbf = new VectorCBF[Int](true) cbf: fcbf.VectorCBF[Int] = fcbf.VectorCBF@4363e2ba scala> val vb = cbf() vb: fcbf.FunBuilder[Int,Vector[Int]] = fcbf.VectorBuilderListList@527c222e scala> val with1 = vb.+=(vb.init, 2) with1: vb.S = List(List(2)) scala> val with2 = vb.++=(with1, Seq(2, 3)) with2: vb.S = List(List(2, 3), List(2)) scala> vb.result(with2) res0: Vector[Int] = Vector(2, 2, 3)
As in
“Values never change types”,
vb.S is abstract, existential, irreducible.
Builder had to be separate from
CanBuildFrom because the latter
had to be stateless, with
Builder needing to be stateful. Now that
both are stateless, the
FunBuilder API can probably be collapsed
into
FunCanBuildFrom.
This leaves the question, what about the mutable-state
Builders?
They can mutate the
S, returning the input state from
+= and
++=. You can’t use
S values to rewind such a
FunBuilder, but you
couldn’t before, anyway.
In the next part, “Avoiding refinement with dependent method types”, we’ll look at the meaning of Scala’s “dependent method types” feature, using it to replace some more type parameters with type members in non-existential use cases.
This article was tested with Scala 2.11.8.
FunBuilderexamples
The rewrite from
S type parameter to member in the
FunBuilder
implementations is a boring, mechanical transform, but I’ve included
it here for easy reference.
class VectorBuilderList[A] extends FunBuilder[A, Vector[A]] { type S = List[A] def init = List() def +=(s: S, elem: A) = elem :: s def ++=(s: S, elems: TraversableOnce[A]) = elems.toList reverse_::: s def result(s: S) = s.toVector.reverse } class VectorBuilderListList[A] extends FunBuilder[A, Vector[A]] { type S = List[Traversable[A]] def init = List() def +=(s: S, elem: A) = Traversable(elem) :: s def ++=(s: S, elems: TraversableOnce[A]) = elems.toTraversable :: s def result(s: S) = s.foldLeft(Vector[A]()){(z, as) => as ++: z} } class VectorCBF[A](bulkOptimized: Boolean) extends FunCanBuildFrom[Any, A, Vector[A]] { def apply() = if (bulkOptimized) new VectorBuilderListList else new VectorBuilderList }
Unless otherwise noted, all content is licensed under a Creative Commons Attribution 3.0 Unported License.Back to blog | https://typelevel.org/blog/2016/05/10/internal-state.html | CC-MAIN-2019-13 | refinedweb | 1,556 | 55.13 |
- General Questions
- I have heard that TestCafe does not use Selenium. How does it operate?
- What is the difference between a paid and an open-source TestCafe version? What is TestCafe Studio?
- Which browsers does TestCafe support? What are the exact supported versions?
- Can I use third-party modules in tests?
- How do I work with configuration files and environment variables?
- Troubleshooting
- I have installed TestCafe, but I cannot run it. What should I do?
- When I run a TestCafe test, I get an unexpected error. What can cause that?
- I have installed TestCafe plugins but they do not work. What have I done wrong?
- My test fails because TestCafe could not find the required webpage element. Why does this happen?
General Questions #
I have heard that TestCafe does not use Selenium. How does it operate? #
Unlike most testing solutions, TestCafe is not built on Selenium. This allows us to implement features you cannot find in Selenium-based tools (for example, testing on mobile devices, user roles, automatic waiting, etc.).
TestCafe uses a URL-rewriting proxy which allows it to work without the WebDriver. This proxy injects the driver script that emulates user actions into the tested page.
You can read about this in our forum. Feel free to ask for more details.
What is the difference between a paid and an open-source TestCafe version? What is TestCafe Studio? #.
Which browsers does TestCafe support? What are the exact supported versions? #
You can find a list of supported browsers in our documentation. TestCafe is tested against the two latest versions of each browser except for the browsers whose versions are specified explicitly in this list.
We do not use the most recent JavaScript features in TestCafe code, which means it should work with any browser with HTML5 support released in the last three years.
Can I use third-party modules in tests? #
You can import third-party modules to test files in the same way as a regular node.js module.
On the server side, use the
import statement.
import fs from 'fs'; fixture `fixture` .page(''); test('test', async t => { var filePath = 'filepath.js'; await t.expect(fs.existsSync(filePath)).ok(); });
On the client side, use
t.eval to include the desired module in the test.
Then you can use this module inside client functions and selectors.
test('test', async t => { // eval jquery code to add jQuery to the page await t.eval(new Function(fs.readFileSync('./jquery.js').toString())); var clientFunction = ClientFunction(() => { // You can use $ here return $('div').text(); }); var text = await clientFunction(); });
How do I work with configuration files and environment variables? #
TestCafe works without any configuration. It does not have any config files where you can place custom variables. However, you can introduce your own configuration file and import it to the test code.
For example, you need to pass a website's base URL to test code. In this instance, you can create the following
config.json file:
{ "baseUrl": "" }
In the test code, import it as you would do with a regular JavaScript module.
import config from './config'; fixture `Fixture` .page `${config.baseUrl}/test1/index.html`;
Alternatively, you can use custom command line parameters or environment variables.
The following command passes the
env argument to the test code:
testcafe chrome test.js --env=development
In the test, use an argument parser library (like
minimist) to parse custom arguments.
import minimist from 'minimist'; const args = minimist(process.argv.slice(2)); const environment = args.env; fixture('example') .page(''); test('check environment', async t => { console.log('Environment:', environment); });
To set an environment variable use the following command on Windows.
set DEV_MODE=true testcafe chrome test.js
On macOS, the workflow is longer.
In test code, you can access this variable as
process.env.DEV_MODE.
Troubleshooting #
I have installed TestCafe but I cannot run it. What should I do? #
Check your firewall. First, make sure that your firewall does not block the ports TestCafe uses. TestCafe chooses free ports automatically by default. Use the --ports command line option or the createTestCafe API factory function to specify custom ports. After that, check that the firewall does not block these specific ports.
Check your proxy server. Another reason for this problem can be the proxy server you use to access the Internet. If your network is connected to the Web via a proxy, use the --proxy command line option or the useProxy API method to specify the proxy address.
For Linux check X11. Also note that if you run TestCafe on Linux, you need to make sure the system is running the X11 server. Without X11, you can only run tests in cloud services and headless Google Chrome. However, if you use the Xvbf server, you can run any other browser in the headless mode.
When I run a TestCafe test, I get an unexpected error. What can cause that? #
JavaScript errors. The most common reason for this is a JavaScript error on the tested page. Load this page in the browser, open the console and see if the page has any errors. In case there are errors, you can either fix them or use the --skip-js-errors flag to tell TestCafe to skip them.
Browser extensions. If this does not help, try running the problematic test in incognito mode. You can do this by adding an appropriate flag after the browser name.
testcafe "chrome -incognito" tests/test.js
testcafe "firefox –private-window" tests/test.js
If the test runs successfully, it might be browser extensions causing the issue. Try disabling them one by one and restart the test in the regular mode at each iteration. This way you can find out which extension prevents the test from running.
Third-party modules. In rare cases, third-party modules can be the cause. If you use a locally installed TestCafe, try installing it globally and running the test outside of the project to eliminate the influence of third-party modules.
I have installed TestCafe plugins but they do not work. What have I done wrong? #
Plugins should also be installed locally if you are using a locally installed TestCafe.
npm install --save-dev {pluginName}
If you are going to use a global TestCafe installation, or you wish to use the plugin in other projects as well, install it globally.
npm install -g {pluginName}
My test fails because TestCafe could not find the required webpage element. Why does this happen? #
This happens because either:
- one of the selectors you used in test code does not match any DOM element, or
- you have tried to specify an action's target element using a wrong CSS selector or a client-side function that returns no element.
To determine the cause of this issue, do the following:
- Look at the error message in the test run report to learn which selector has failed.
- Add the t.debug() method before this selector to stop test execution before it reaches this point.
- Run the test and wait until the browser stops at the breakpoint.
After this, use the browser's development tools to check that:
- the element is present on the page;
- the element is visible (TestCafe considers it visible if it does not have
displayset to
none,
visibilityset to
hiddenor the zero
widthor
height);
- the element's part targeted by the action is visible (the center of the element by default; it can be changed using the
offsetXand
offsetYparameters);
- the element is not in an
<iframe>(if it is, use the t.switchToIframe method to switch to the appropriate
<iframe>).
Also, try running the test at full screen. Use the t.maximizeWindow and t.resizeWindow actions to control the browser window size. If the test passes, it means your webpage hides the target element when the window is resized to smaller dimensions.
Finally, try updating TestCafe to the latest version to see if the problem persists. | https://devexpress.github.io/testcafe/faq/ | CC-MAIN-2018-51 | refinedweb | 1,309 | 68.26 |
This is the mail archive of the cygwin mailing list for the Cygwin project.
On Oct 12 11:09, patrick ficheux wrote: > In SANE (scanner project), the backend for snapscan failed to call shmget() > with error EACCES (Permission denied) if the current user isn't > administrator. > When I'am logged as windows administrator, shmget() is called successfully > > In both case, the env. variable CYGWIN exists and this value is > CYGWIN=server > cygserver is installed and runs > > > Is it possible to call shmget() without administrator's privileges ? > In this case, what kind of privileges a user must have ? and how to set > those privileges ? > > Thanks > > extract from snapscan backend > > #ifndef SHM_R > #define SHM_R 0 > #endif > > #ifndef SHM_W > #define SHM_W 0 > #endif ^^^^^^^^^^^^^^^^^^^^ This is the problem. SHM_R and SHM_W are not defined on Cygwin. These flags are not defined by POSIX and relying on them as above is non-portable. As a result, you create a shared mem region with permission bits set to 000. > int shm_id = shmget (IPC_PRIVATE, shm_size, IPC_CREAT | SHM_R | SHM_W); Try something like #include <sys/stat.h> int shm_id = shmget (IPC_PRIVATE, shm_size, IPC_CREAT | S_IRWXU); instead. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: Problem reports: Documentation: FAQ: | http://cygwin.com/ml/cygwin/2007-10/msg00284.html | CC-MAIN-2017-30 | refinedweb | 212 | 64.1 |
Googler Comments
Posted on Tuesday, August 26th, 2003 12:01 AMI just disabled comments for anyone that comes here via Google. I get random comments every few days from people who discover ooooold posts leave comments on them. I don't have any problem with seeing the comments because of my comments feed, but it's sort of a waste of their time and mine. Just now a comment was left urging me not to move to Philadelphia was the last straw. I mean, how many months ago did I quit that job and announce I was going to San Francisco? And a few days ago someone was urging me to give Struts a try (after I had bitched a bit about it) when all I'm doing right now is heads-down Struts stuff.
Most Googlers don't know what a weblog is or realize that the posts are well past now, so to avoid those quick insta-comments from helpful searchers, I've just disabled the comments if your referrer says you've arrived here from Google or Yahoo. Very simple solution. If they click around and get an idea what the site is, the comments return (as if by magic).
I think that should help.
-Russ | http://m.mowser.com/web/www.russellbeattie.com/notebook/1003990.html | crawl-002 | refinedweb | 209 | 76.56 |
int main() { string line; cout << "enter a line of text: "; getline(cin, line); cout << "text entered: \"" << line << "\"\n"; }Library identifiers (type names, function names, object names), such as string, cout, getline in the above example, are reserved identifiers. That means you, as a programmer, are not allowed to use these names -- or at least that you are not guaranteed to be able to use them without bugs and/or build errors arising from choosing to use a reserved identifier in the wrong context.
C and C++ have defined many reserved identifiers, and there are special rules about which ones you might be able to use and under what circumstances. The list of "forbidden" names is rather large.
When C++ was standardized, however, namespaces were added. This means, among other things, that all of these "forbidden" names can be tucked away into a namespace, which then means that these names are once again available to the programmer for use. Standard C++ places its identifiers in a namespace called std.
To use an identifier from the standard namespace, you can use the scope resolution operator :: to indicate that the programmer means the name defined in a particular namespace.
So the earlier example, with the addition of the necessary headers this time, would then look like this:
#include <iostream> #include <string> int main() { [COLOR="red"]std::[/COLOR]string line; [COLOR="red"]std::[/COLOR]cout << "enter a line of text: "; [COLOR="red"]std::[/COLOR]getline([COLOR="red"]std::[/COLOR]cin, line); [COLOR="red"]std::[/COLOR]cout << "text entered: \"" << line << "\"\n"; } /* my output enter a line of text: hello world text entered: "hello world" */The std:: "warts" may be seen as tedious or cluttered for some programmers. Fortunately, there are alternatives. One way would be to use the using directive to specify just the names you are using from a particular namespace. For example:
#include <iostream> [COLOR="red"]using std::cout; using std::cin; using std::getline;[/COLOR] #include <string> [COLOR="red"]using std::string;[/COLOR] int main() { string line; cout << "enter a line of text: "; getline(cin, line); cout << "text entered: \"" << line << "\"\n"; } /* my output enter a line of text: hello world text entered: "hello world" */In the above example, I have chosen to group together the using directives under the header in which the name is found. This is not a necessity, I just do it to help me remember where things come from or as an explanation of why I have #included a particular header.
Alternatively, a using directive can bring in all identifiers in a namespace.
#include <iostream> #include <string> [COLOR="Red"]using namespace std;[/COLOR] int main() { string line; cout << "enter a line of text: "; getline(cin, line); cout << "text entered: \"" << line << "\"\n"; } /* my output enter a line of text: hello world text entered: "hello world" */Beginners are often shown this method because of its simplicity. But in entirely defeats the purpose of a namespace in trying to avoid bugs and build errors (or, more specifically, naming collisions). I remember chasing one down that was related to having a variable named "count". If you want to avoid such potential problems, avoid using namespace std;.
So using namespace std; may be a quick and dirty workaround for "toy" code, but you really don't want to use it for any "real" code. You especially want to avoid using an entire namespace in a header file.
Edited by dcs, 15 February 2010 - 03:59 PM. | http://forum.codecall.net/topic/53895-using-namespace-std/ | crawl-003 | refinedweb | 573 | 54.15 |
How to interpret TradeAnalyzer's result?
- backtrader14 last edited by backtrader14
I am backtesting a single day trading strategy in backtrader in which I buy at current open and close at current close and no trade carry forward. This is my TradeAnalyzer's report.
# data.shape >>> (197, 6) TradeAnalyzer: ----------------------------------------------------------------------------- - total: - total: 196 - open: 1 - closed: 195 ----------------------------------------------------------------------------- - streak: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - won: - current: 0 - longest: 5 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - lost: - current: 2 - longest: 5 -----------------------------------------------------------------------------
If I am guessing it right then the
totalsection says that I took 196 positions in which 195 are completed and 1 position is still open. The confusion is in the win/lose stat that is I have won 0 and lost 2 positions, so according to this stat I only did a total of 2 trades which is contradictory to the 196 which is given in the
total. I also expected the sum of my win and lose trade should be near to 196. It also shows that my longest trading length is 5 days but my strategy involves only a single day. How to make sense of TradeAnalyzer's result?
This is my full code.
from datetime import datetime import backtrader as bt import pandas as pd from pandas_datareader import data as pdr data = pdr.get_data_yahoo('AAPL', start=datetime(2018, 8, 13), end=datetime.now()) data.columns=['high', 'low', 'open', 'close', 'volume', 'adj_close'] del data.adj_close class TestStrategy(bt.Strategy): def __init__(self): pass def next_open(self): self.buy(coc=False) def next(self): pos = self.getposition() if pos: self.sell() cerebro = bt.Cerebro(cheat_on_open=True) cerebro.addstrategy(TestStrategy) df=bt.feeds.PandasData(dataname=data) cerebro.adddata(df) cerebro.addanalyzer(bt.analyzers.TradeAnalyzer,_name="Basic_stats") cerebro.broker.set_coc(True) strats = cerebro.run(stdstats=False) strat = strats[0] cerebro.addobserver(bt.observers.Value)# print('Final Balance: %.2f' % cerebro.broker.getvalue()) for e in strat.analyzers: e.print() cerebro.plot()
This
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - won: - current: 0 - longest: 5 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - lost: - current: 2 - longest: 5 -----------------------------------------------------------------------------
is not win/loss stat but
streakrelated stat.
streakis a number of winning or losing trades in a row. So you had longest winning trades streak of 5 and longest losing trades streak of 5.
- backtrader14 last edited by
Thank you this makes complete sense. What is current: 0 and current: 2 means?
@backtrader14 means that your last two trades are losing trades. | https://community.backtrader.com/topic/1869/how-to-interpret-tradeanalyzer-s-result | CC-MAIN-2022-40 | refinedweb | 381 | 50.94 |
2 Minute Video: Groovy Makes Java Better
By Geertjan-Oracle on Oct 23, 2008
The first of several screencasts I am planning in relation to Groovy: <script type="text/javascript" src=""></script> <script type="text/javascript"> </script>
PS: When I said "on our dialog", I should have said "on our Groovy class".
Why do you have to call toString() on what is returned from the getText() call (in Java)?
Posted by Mario Aquino on October 23, 2008 at 11:52 AM PDT #
I wish we could have Jython support in NetBeans IDE: If you've jython installed on your machine, try following:
<pre>
ijazfx@mypc:~$ jython
Jython 2.2.1 on java1.6.0_07
Type "copyright", "credits" or "license" for more information.
>>> from java.awt import \*
>>> from javax.swing import \*
>>> frame1 = JFrame('Hello World', size = (400, 200))
>>> frame1.visible = True
>>> frame1.move(300, 100)
>>> frame1.dispose()
</pre>
I think jython is shorter than Groovy to write java programs, plus is completely dynamic.
Posted by Farrukh Ijaz on October 23, 2008 at 11:56 AM PDT #
Mario,
DisplayProvider#getText() will have the return type of java.lang.Object, because the field 'text' is not typed (defined with "def" and not a solid class).
Posted by Chris Broadfoot on October 23, 2008 at 12:10 PM PDT #
Great Demo... and great sound quality! What did you use for recording it?
cu tomorrow in Poznan!
Toni
Posted by Toni Epple on October 23, 2008 at 05:14 PM PDT #
That's so cool!
Go groovy & NetBeans!
Posted by O(∩_∩)O哈哈~ on October 23, 2008 at 06:59 PM PDT #
Chris,
I still don't think you need the call to toString(). Right?
Jeff
Posted by Jeff Brown on October 24, 2008 at 05:12 AM PDT #
I would expect Groovy and Jython to be similar length:
import javax.swing.\*
new JFrame(title:'Hello World', size:[400, 200], visible:true).with {
move(300, 100)
dispose()
}
Posted by Paul King on October 24, 2008 at 10:10 AM PDT #
I love the Groovy Support in Netbeans :) Makes Java fun again...
Posted by Michael on October 25, 2008 at 12:22 AM PDT #
This was pretty cool.
Definitely looking forward to checking out groovy now.
Posted by Shams Mahmood on October 25, 2008 at 02:10 PM PDT #
Jython is cool and make things very simple but I liked Groovy with the SwingBuilder, Griffon and now this support on Netbeans is pretty neat.
Posted by OtengiM on October 25, 2008 at 11:00 PM PDT #
While the groovy-java demo works fine in 6.5, when using 6.7 I get a "can not find symbol" error for the groovy class in the java code. Is there some additional configuration needed for 6.7 that is not needed in 6.5?
Posted by Jim Tucker on June 29, 2009 at 03:54 AM PDT #
That's a known bug, I am afraid. It should still run successfully though. The first patch to 6.7 (once it comes out) should resolve this issue.
Posted by Geertjan Wielenga on June 29, 2009 at 03:59 AM PDT # | https://blogs.oracle.com/geertjan/entry/video_groovy_makes_java_better | CC-MAIN-2015-48 | refinedweb | 520 | 83.25 |
One of the early design goals behind the D programming language was the ability to interface with C. To that end, it provides ABI compatibility, allows access to the C standard library, and makes use of the same object file formats and system linkers that C and C++ compilers use. Most built-in D types, even structs, are directly compatible with their C counterparts and can be passed freely to C functions, provided the functions have been declared in D with the appropriate linkage attribute. In many cases, one can copy a chunk of C code, paste it into a D module, and compile it with minimal adjustment. Conversely, appropriately declared D functions can be called from C.
That’s not to say that D carries with it all of C’s warts. It includes features intended to eliminate, or more easily avoid, some of the errors that are all too easy to make in C. For example, bounds checking of arrays is enabled by default, and a safe subset of the language provides compile-time enforcement of memory safety. D also changes or avoids some things that C got wrong, such as what Walter Bright sees as C’s biggest mistake: conflating pointers with arrays. It’s in these differences of implementation that surprises lurk for the uninformed.
This post is the first in a series exploring the interaction of D and C in an effort to inform the uninformed. I’ve previously written about the basics of this topic in an article at GameDev.net, and in my book, ‘Learning D’, where the entirety of Chapter 9 covers it in depth.
This blog series will focus on those aforementioned corner cases so that it’s not necessary to buy the book or to employ trial and error in order to learn them. As such, I’ll leave the basics to the GameDev.net article and recommend that anyone interfacing D with C (or C++) give it a read along with the official documentation.
The C and D code that I provide to highlight certain behavior is intended to be compiled and linked by the reader. The code demonstrates both error and success conditions. Recognizing and understanding compiler errors is just as important as knowing how to fix them, and seeing them in action can help toward that end. That implies some prerequisite knowledge of compiling and linking C and D source files. Happily, that’s the focus of the next section of this post.
For the C code, we’ll be using the Digital Mars C/C++ and Microsoft C/C++ compilers on Windows, and GCC and Clang elsewhere. On the D side, we’ll be working exclusively with the D reference compiler, DMD. Windows users unfamiliar with setting up DMD to work with the Microsoft tools will be well served by the post on this blog titled, ‘DMD, Windows, and C’.
We’ll finish the post with a look at one of the corner cases, one that is likely to rear its head early on in any exploration of interfacing D with C, particularly when creating bindings to existing C libraries.
Compiling and linking
The articles in this series will present example C source code that is intended to be saved and compiled into object files for linking with D programs. The command lines for generating the object files look pretty much the same on every platform, with a couple of caveats. We’ll look first at Windows, then lump all the other supported systems together in a single section.
In the next two sections, we’ll be working with the following C and D source files. Save them in the same directory (for convenience) and make sure to keep the names distinct. If both files have the same name in the same directory, then the object files created by the C compiler and DMD will also have the same name, causing the latter to overwrite the former. There are compiler switches to get around this, but for a tutorial we’re better off keeping the command lines simple.
chello.c
#include <stdio.h> void say_hello(void) { puts("Hello from C!"); }
hello.d
extern(C) void say_hello(); void main() { say_hello(); }
The
extern(C) bit in the declaration of the C function in the D code is a linkage attribute. That’s covered by the other material I referenced above, but it’s a potential gotcha we’ll look at later in this series.
Windows
The official DMD packages for Windows, available at dlang.org as a zip archive and an installer, are the only released versions of DMD that do not require any additional tooling to be installed as a prerequisite to compile D files. These packages ship with everything they need to compile 32-bit executables in the OMF format (again, I refer you to ‘DMD, Windows, and C’ for the details).
When linking any foreign object files with a D program, it’s important that the object file format and architecture match the D compiler output. The former is an issue primarily on Windows, while attention must be paid to the latter on all platforms.
Compiling C source to a format compatible with vanilla DMD on Windows requires the Digital Mars C/C++ compiler. It’s a free download and ships with some of the same tools as DMD. It outputs object files in the OMF format. With both it and DMD installed and on the system path, the above source files can be compiled, linked, and executed like so:
dmc -c chello.c dmd hello.d chello.obj hello
The
-c option tells DMC to forego linking, causing it to only compile the C source and write out the object file
chello.obj.
To get 64-bit output on Windows, DMC is not an option. In that case, DMD requires the Microsoft build tools on Windows. Once the MS build tools are installed and set up, open the preconfigured x64 Native Tools Command Prompt from the Start menu and execute the following commands (again, see ‘D, Windows, and C’ on this blog for information on how to get the Microsoft build tools and open the preconfigured command prompt, which may have a slightly different name depending on the version of Visual Studio or the MS Build Tools installed):
cl /c chello.c dmd -m64 hello.d chello.obj hello
Again, the
/c option tells the compiler not to link. To produce 32-bit output with the MS compiler, open a preconfigured x86 Native Tools Command Prompt and execute these commands:
cl /c hello.c dmd -m32mscoff hello.c chello.obj hello
DMD recognizes the
-m32 switch on Windows, but that tells it to produce 32-bit OMF output (the default), which is not compatible with Microsoft’s linker, so we must use
-m32mscoff here instead.
Other platforms
On the other platforms D supports, the system C compiler is likely going to be GCC or Clang, one of which you will already have installed if you have a functioning
dmd command. On Mac OS,
clang can be installed via
XCode in the App Store. Most Linux and BSD systems have a GCC package available, such as via the often recommended command line,
apt-get install build-essential, on Debian and Debian-based systems. Please see the documentation for your system for details.
On these systems, the environment variable
CC is often set to the system compiler command. Feel free to substitute either
gcc or
clang for
CC in the lines below as appropriate for your system.
CC -c chello.c dmd hello.d chello.o ./hello
This will produce either 32-bit or 64-bit output, depending on your system configuration. If you are on a 64-bit system and have 32-bit developer tools installed, you can pass
-m32 to both
CC and
dmd to generate 32-bit binaries.
The
long way
Now that we’re configured to compile and link C and D source in the same binary, let’s take a look at a rather common gotcha. To fully appreciate this one, it helps to compile it on both Windows and another platform.
One of the features of D is that all of the integral types have a fixed size. A
short is always 2 bytes and an
int is always 4. This never changes, no matter the underlying system architecture. This is quite different from C, where the spec only imposes relative requirements on the size of each integral type and leaves the specifics to the implementation. Even so, there are wide areas of agreement across modern compilers such that on every platform D currently supports the sizes for almost all the integral types match those in D. The exceptions are
long and
ulong.
In D,
long and
ulong are always 8 bytes across all platforms. This never changes. It lines up with the corresponding C types just fine on most 64-bit systems under the
version(Posix) umbrella, where the C
long and
unsigned long are also 8 bytes. However, they are 4 bytes on 32-bit architectures. Moreover, they’re always 4 bytes on Windows, even on a 64-bit architecture.
Most C code these days will account for these differences either by using the preprocessor to define custom integral types or by making use of the C99
stdint.h where types such as
int32_t and
int64_t are unambiguously defined. Yet, it’s still possible to encounter C libraries using
long in the wild.
Consider the following C function:
maxval.c
#include <limits.h> unsigned long max_val(void) { return ULONG_MAX; }
The naive D implementation looks like this:
showmax1.d
extern(C) ulong max_val(); void main() { import std.stdio : writeln; writeln(max_val()); }
What this does depends on the C compiler and architecture. For example, on Windows with
dmc I get
7316910580432895, with x86
cl I get
59663353508790271, and
4294967295 with x64
cl. The last one is actually the correct value, even though the size of the
unsigned long on the C side is still 4 bytes as it is in the other two scenarios. I assume this is because the x64 ABI stores return values in the 8-byte
RAX register, so it can be read into the 8-byte
ulong on the D side with no corruption. The important point here is that the two values in the x86 code are garbage because the D side is expecting a 64-bit return value from 32-bit registers, so it’s reading more than it’s being given.
Thankfully, DRuntime provides a way around this in
core.c.config, where you’ll find
c_long and
c_ulong. Both of these are conditionally configured to match the compile-time C runtime implementation and architecture configuration. With this, all that’s needed is to change the declaration of
max_val in the D module, like so:
showmax2.d
import core.stdc.config : c_ulong; extern(C) c_ulong max_val(); void main() { import std.stdio : writeln; writeln(max_val()); }
Compile and run with this and you’ll find it does the right thing everywhere. On Windows, it’s
4294967295 across the board.
Though less commonly encountered,
core.stdc.config also declares a portable
c_long_double type to match any
long double that might pop up in a C library to which a D module must bind.
Looking ahead
In this post, we’ve gotten set up to compile and link C and D in the same executable and have looked at the first of several potential problem spots. We used DMD here, but it should be possible to substitute one of the other D compilers (
ldc or
gdc) without changing the command line (with the exception of
-m32mscoff, which is specific to DMD). The next post in this series will focus entirely on getting D arrays and C arrays to cooperate. See you there!
One thought on “Interfacing D with C: Getting Started”
A typo in DRuntime provides a way around this in `core.c.config`. It must be `core.stdc.config`. | https://dlang.org/blog/2017/12/05/interfacing-d-with-c-getting-started/ | CC-MAIN-2018-47 | refinedweb | 2,003 | 61.77 |
See also: IRC log
<DanC> ah... httpRange-14 is not on the agenda... I kinda expected it to continue from last week... ah... two weeks... 29 MAr
<DanC> "Next week's scribe will be Norm."
<Norm> Crap. Sorry. I'm on another call and can't get away for a few minutes
<noah> Norm: I will scribe for a few minutes until you show up.
<noah> Agenda at is approved
<noah> Telcon on 29 March
<noah> Possible regrets from Noah next 3 weeks
<DanC> 15 March 2005 Tag Teleconference
<noah> VQ: Here: everyone except Roy, Tim and Norm
<noah> scribe: Noah
<scribe> scribe: Noah Mendelsohn
<scribe> scribenick: noah
Henry will scribe on 29 March
RESOLUTION: minutes of 15 March at are approved
VQ: shall we move the minutes in date space?
DC: No, leave them where they are.
HT: That means they are in an attachment in an email archive, which makes searching hard. I needed that today. Is it not policy to have them in date space?
DC: They need to be linked from the tag home page
VQ: Right, I've been doing that.
HT: Well, it's easier to grep if you mirror date space, but I can write a better tool.
ED: I somewhat agree, I'd prefer to see them all in common place in date space, per year.
DC: You don't have to go through
list archives, they're all one click away.
... In any case, in general, I'd like them to be in a final resting place before we approve them.
<scribe> ACTION: Henry with help from Ed to draft proposal on where in date space to put minutes [recorded in]
<DanC> (re filing the minutes in CVS/datespace, all of us can send mail, but only some of us can do CVS, and when it goes bad, it tends to fall on the team contact, i.e. me)
NM: Scribe's question: should we unapprove the minutes of 15 March until they land in whatever is the best place?
Several: No, they're approved, leave them.
VQ: Amy van der Heil reports MIT can host
DC: 3 real days?
VQ: maybe last day will be short, but otherwise yes, full 3 days.
NM: Remember that TimBL will leave early on 15 June due to family birthday
<DanC> TAG action items
<DanC> (very handy so far, thanks, ht)
VQ: When you make flight plans, please let me know so we can schedule wrapup on last day
+1 Noah
See pending actions at
DO: Asked some questions about which are assigned to him.
NM: Yes, ACTION: Henry and David to draft initial finding on URNsAndRegistries-50 [recorded in]]
DO: Yes working on it
... I also worked on terminology for extensibility and versioning.
... sent to Norm and Noah for early review
NM: Don't have it yet,
HT: I have finished ACTION: HT to review " Storing Data in Documents ..." [recorded in]
DC: right, and followup email is largely supporive
<DanC> action list Date: 2005/03/21 11:50:27
VQ: will update action list later today or tomorrow
<DanC> (re how long done action stay... a week or two, please)
Norm, Oasis announcement[11]
s /[11]//
VQ: Hmm, Norm's not here, let's skip it until he shows up.
We received a request at:
VQ: I would like to have some discussion on what to do with this issue.
Norm joins the call.
DO: A couple of comments: 1) This issue could use some authoritative comments
<Norm> DO: expresses concern that TAG is picking up a lot of issues but we aren't closing them very fast
<Vincent> no echo on my side
<Norm> DanC: I think you write an RFC and get consensus from the community
<Norm> NM: Some groups use a new header, some use a new method (WebDAV). These have different characteristics in the face of things like "must understand"
<Norm> NM: I think he's asking for good practice, clarity on who should do what and when
<DanC> (hmm... I still don't see an issue any smaller than "please predict the future for me")
<Norm> VQ: Agrees, it's a good practice request. Not clear who's supposed to do this, us or IETF, for example.
<Norm> VQ: Shouldn't we do something?
<Norm> DanC: No, we're not obliged to take on an issue or formally respond to every request
<Norm> DO: If the TAG is going to decline, we should at least say we decline.
<Norm> NM: +1
<Ed> +1
<Norm> DO: I'd prefer if we could provide a bit of rationale. I don't think we get an enormous number of requests such that we can't reply.
<DanC> (yes, it's polite to explicitly decline. but if you try to formalize that as a policy, you'll quickly get into denial-of-service, and "have we already declined that request?" stuff)
<Norm> NM: summarizes, asks if we're ready to decide
<Norm> NM: I'd be interested in the opinions of timbl and royf.
<Norm> NM: Two options? 1. reject or 2. pick up the issue and prioritize it later
<Norm> DanC: Putting it on the issues list is a commtiment to resolve it
<Norm> DO: Some issues that we took up were reduced in priority before the first webarch but those are being reexamined
<Norm> DO: Proposes that we defer talking about this issue until timbl and royf are present
<Norm> VQ: I'll draw their attention to the issue before next time
<Norm> VQ: Return to XRI.
<scribe> scribe: Norm Walsh
<DanC> "The public review starts today, 15 March 2005 and ends 14 April 2005."
<scribe> scribenick: norm
ht: Included it in new issue 50. Reinventions of URNs and registries.
NDW: That satisifies my expectations of what we would do with this
<Zakim> DanC, you wanted to express some patent concerns about reading it at all
DanC: XRIs have crossed my desk a
couple of times, but the package seems to be labeled "patent
incumbered" so I'm not inclined to read it at all
... their deadline is 14 Apr. HT, are you inclined to figure something out by 14 Apr?
ht: That seems unlikely
<DanC> (we had pretty close to a finding on .mobi; we had a web page with TAG endorsement)
ht: At the very least, should we say "uh, guys, would you like to talk to us about this before moving ahead?"
Ed: I'd be happy to review it and try to highlight some of the major issues
DanC suggests mailing comments to www-tag or tag or straight to them. Any of those is fine by me.
Ed agrees to read them and post some notes about it
ht suggests taking a quick glance at urnsAndRegistries-50
VQ: Does that address your concerns?
NDW: Marvelously.
<scribe> ACTION: Ed to review XRI and provide comments [recorded in]
DanC: I believe we closed it in Basel. There was some kickback but eventually it did stick.
<DanC>
DanC: I believe the issues list should be updated to record our decision to close the issue
VQ: I'll do that.
... Any other information about this issue?
ht: My memory is that the public believes that the TAG said you should use XLink, HTML WG pushed back, TAG said you should consider it, HTML WG went quiet.
My memory is that the HTML WG said even considering it was too strong, but we stuck our ground.
<DanC> (well, yes, mark it closed, but note some outstanding dissent)
VQ: Any other business?
ht: I would be happy if we brainstorm about on URNsAndRegistries-50
DanC: Countless discussions go
like this: I'll find some URN scheme or the equivalent, e.g.
doi: and urn:doi:
... They've gone so far as to deploy plugins for doi:.
... what the plugin does is lookup...
... So they own and operate a mapping from DOI to HTTP
... Ask these folks why not just use http? Why a separate scheme? One part of it is financial incentive for being at the center of one of these namespaces
... The other is that they don't trust DNS and HTTP.
... Engineers can't predict the future. I can't predict that DNS and HTTP will last forever.
... So they really do want their stuff to be looked up and they can't be talked out of it.
NM: They've got a mapping, the insurance they're getting is that if someone steals their DNS name, they can redirect to another.
DanC: Clearly they're creating
aliases here, which we've discouraged.
... The other folks don't want their stuff to be looked up.
... e.g., urn:googlesearch:, they don't do anything about grounding that in reality and they don't feel embarrased about it.
... But for some reason they don't want to promise that an address will persist for a long time.
... Consider urn:ietf:...
... How do you manage it? Well, we keep a website with all the names in it.
... Duh!
... So they have no mapping, but to actually manage the namespace...they use a webserver!
... I promised to renew that draft if someone would stand by me for the incoming barrage, but there have been no offers
ht: Two things I'd add:
apparently the IETF are now running a server that will lookup
those URNs.
... I haven't persued it, but someone asserted it exists.
<DanC> A Registry of Assignments using Ubiquitous Technologies and Careful Policies
ht: The other example, the ITU
are looking at doing this (as is OASIS, i.e. XRI)
... Both of these guys say they'll be running servers, in the OASIS case it'll be a SAML server of some kind
... The part of the puzzle that I don't understand how to respond to is, the argument that "we need something abstract" something not as concrete as URLs
... We need something independent of specific locations.
... That sounds like broken record stuff to me, but I'm hoping to hear "oh, they don't understand such and such..."
DanC: I can replay a conversation
where I convinced one person.
... The name of the XML spec was a subject of conversation.
... Do you feel bad that there's no URN for it? Answer: yes.
... Why? Because we want it to survive
... Redundancy is the key, putting something in a newspaper gets lots of copies.
... So the copy of the XML spec is all the web caches around the world provides that.
... So he says "gee, then maybe we shouldn never have done that URN stuff"
... The way you make things valuable is by getting agreement that things are shared. So you can use a link instead of sending a 15 page spec.
... The way the binding between the names and what they mean is established is through protocols of some sort. HTTP is one example.
... it makes sense to makup new URI schemes for totally new communication patterns, but if it looks like DNS and HTTP, *use* DNS and HTTP.
<DanC> ( is unavailable at the moment, but records some relevant experience of Norm's)
ADJOURNED
What's the incantation to get rrsagent to make the log public?
<DanC> norm, do you want it to draft minutes?
Sure.
I'll take a look at cleaning those up as soon as I get a couple of other things off my plate
<DanC> not bad... noah knows how to drive it. ;-)
<DanC> hmm... it doesn't recognize Norm as scribe too...
<DanC> ScribeNick: Norm
This is scribe.perl Revision: 1.117 of Date: 2005/03/10 16:25:39 Check for newer version at Guessing input format: RRSAgent_Text_Format (score 1.00) Succeeded: s/[10]// Found Scribe: Noah Inferring ScribeNick: noah Found Scribe: Noah Mendelsohn Found ScribeNick: noah Found Scribe: Norm Walsh Found ScribeNick: norm Found ScribeNick: Norm WARNING: No scribe lines found matching ScribeNick pattern: <Norm> ... Scribes: Noah, Noah Mendelsohn, Norm Walsh ScribeNicks: noah, norm Default Present: noah, DanC, [INRIA], Ht, Dave_Orchard, EdRice, Norm Present: noah DanC [INRIA] Ht Dave_Orchard EdRice Norm Regrets: TimBL RoyF WARNING: No meeting chair found! You should specify the meeting chair like this: <dbooth> Chair: dbooth Got date from IRC log name: 22 Mar 2005 Guessing minutes URL: People with action items: ed from help henry with WARNING: Input appears to use implicit continuation lines. You may need the "-implicitContinuations" option.[End of scribe.perl diagnostic output] | http://www.w3.org/2005/03/22-tagmem-minutes.html | CC-MAIN-2017-04 | refinedweb | 2,071 | 79.19 |
Rails Authentication Plugin: simplest_auth
Why?
simplest_auth is a plugin for Rails applications where RESTful Authentication is overkill – it handles authentication and nothing else. By "nothing else" we mean: no password resets, no cookies set to remember a user, etc. We chose to design simplest_auth in this manner because we didn't need those features. However, we did want to use the most secure hash algorithm, provide a familiar API, and we wanted to be able to have an authenticated user wherever one was needed (more on that in a minute). Lastly, we did not want to intrude too much into the decisions of the user of the plugin.
How?
Given the goals, we came up with simplest_auth. There are essentially two files to be mixed in: one for the model, and one for the controller.
Generate the Model
$ ./script/generate model User email:string crypted_password:string
Mix Lightly
class User < ActiveRecord::Base include SimplestAuth::Model before_create :hash_password end
And the Application Controller
class ApplicationController < ActionController::Base include SimplestAuth::Controller def user_class; User; end end
Note: the model skips any validation. Also note: the model could just as easily be Account instead of User, simply change:
def user_class; Account; end
More to Come
In the future, we plan to add new features only as they are required and only as long as they fit the original goals. As we work with the plugin, we'll be adding a few things; but, because the plugin is available on Github, we encourage forking and adding as you see fit. If you think you've added something everyone could use, please feel free to send us a pull request.
Learn More
simplest_auth (link to github) | https://www.viget.com/articles/rails-authentication-plugin-simplest-auth | CC-MAIN-2017-30 | refinedweb | 281 | 60.24 |
15 February 2013 17:40 [Source: ICIS news]
LONDON (ICIS)--The president of ?xml:namespace>
Prices for carbon dioxide (CO2) certificates on the ETS are trading at record lows, prompting calls that Brussels intervene in the market to raise prices by reducing the number of certificates.
However, VCI president Karl-Ludwig Kley said that the ETS market system is working exactly as it should, and that the low prices are the best evidence for that.
In an article he contributed to
First, in 2009
Third, industry is investing in environmentally-efficient equipment and plants.
“There is no justification at all for political intervention,” Kley said.
“On the contrary: The current price level is the best evidence that climate change targets can be achieved with market instruments, and without harming the competitiveness of our industry,” he said.
“And this proves that environmental protection does not always have to be expensive to work well,” he said.
“The cost is significantly lower than originally estimated. So we should all be happy,” he added.
Instead of putting forward proposals to “set aside” or “back load” CO2 certificates, Kley said that officials in Brussels should rather “lean back and think again” as the European emissions trading market was working out well.
The EU launched the ETS in 2005 as part of its policy to combat climate change and reduce industrial greenhouse gas emissions cost-effectively.
The ETS covers more than 11,000 power stations and industrial plants in 31 countries, as well as airlines. It is now in its third phase, running from 2013 | http://www.icis.com/Articles/2013/02/15/9641679/germany-vci-chief-speaks-out-against-intervening-in-eus-ets.html | CC-MAIN-2015-18 | refinedweb | 259 | 51.78 |
So far, with the linear model, we have seen how to predict continuous variables. What happens when you want to classify with a linear model?
Linear Probability Model
Suppose that our aim is to do binary classification : \(y_i = \{0,1\}\). Let’s consider the model :\[y = \beta_0 + \beta_1 X_1 + ... + \beta_k X_k + u\]
Where \(E(u \mid X_1, ... X_k) = 0\). How can we perform binary classification with this model? Let’s start with a dataset in which you have binary observations and you decide to fit a linear regression on top of it.
Statistically speaking, the model above is incorrect :
- we would need to define a threshold under which we classify as 0, and above which we classify 1
- what if the values are greater than 1? Or smaller than 0?
- …
Linear probability model has however one main advantage: the coefficients remain easily interpretable!\[\Delta P(Y=1 \mid X) = \beta_j \Delta X_j\]
In other words, the impact of a coefficient can be measured as a contribution percentage to the final classification. Overall, this model needs to be adjusted/transformed to throw the predicted between values between 0 and 1. This is the main idea of logistic regression!
Logistic Regression
We are now interested in \(P(Y=1 \mid X) = P(Y=1 \mid X_1, X_2, .. X_k) = G(\beta_0 + \beta_1 X_1 + ... + \beta_k X_k)\). As you might guess, the way we define \(G\) will define the way we make our mapping.
- If \(G\) is linear, this is obviously the linear regression
- If \(G\) is a sigmoid : \(G(z) = \frac {1} {1 + e^{-z}}\), then the model is a logistic regression
- If \(G\) is a normal transformation \(G(z) = \Phi(z)\), then the model is a probit regression
In this article, we’ll focus on logistic regression.
Sigmoid and Logit transformations
The sigmoid transformation is used to map values between 0 and 1 :\[Sig(z) = \frac {1} {1 + e^{-z}}\]
To understand precisely what this does, let’s implement it in Python :
import numpy as np import matplotlib.pyplot as plt import math def sigmoid(x): a = [] for item in x: a.append(1/(1+math.exp(-item))) return a
Then, plot if for a range of values of \(X\) :
x = np.arange(-3., 3., 0.2) sig = sigmoid(x) plt.figure(figsize=(12,8)) plt.plot(x,sig, label='sigmoid') plt.plot(x,x, label='input') plt.title("Sigmoid Function") plt.legend() plt.show()
The inverse transform is called the logit transform. It takes values that are in the range 0 to 1 and maps them to a linear form.
def logit(x): a = [] for item in x: a.append(math.log(item/(1-item))) return a
plt.figure(figsize=(12,8)) plt.plot(x,sig, label='sigmoid') plt.plot(x,logit(sig), label='logit tranform') plt.title("Sigmoid - Logit Function") plt.legend() plt.show()
The logistic regression model
Partial effect
In the logistic regression model :\[P(Y=1) = \frac {1} {1 + exp^{-(\beta_0 + \beta_1 X_1 + ... + \beta_p X_p)}}\]
How can we interpret the partial effect of \(X_1\) on \(Y\) for example ? Well, the weights in the logistic regression cannot be interpreted as for linear regression. We need to use the logit transform :\[\log( \frac {P(y=1)} {1-P(y=1)} ) = \log ( \frac {P(y=1)} {P(y=0)} )\] \[= odds = \beta_0 + \beta_1 X_1 + ... + \beta_k X_k\]
We define the this ratio as the “odds”. Therefore, to estimate the impact of \(X_j\) increasing by 1 unit, we can compute it this way :\[\frac {odds_{X_{j+1}}} {odds} = \frac {exp^{\beta_0 + \beta_1 X_1 + ... + \beta_j (X_j + 1) + ... + \beta_k X_k}} {exp^{\beta_0 + \beta_1 X_1 + ... + \beta_j X_j + ... + \beta_k X_k}}\] \[= exp^{\beta_j (X_j + 1) - \beta_j X_j} = exp^{\beta_j}\]
A change in \(X_j\) by one unit increases the log odds ratio by the value of the corresponding weight.
Test Hypothesis
To test for a single coefficient, we apply, as previously, a Student test :\[t_{stat} = \frac {\beta} {\sigma(\beta)}\]
For multiple hypotheses, we choose the Likelihood Ratio tests. The coefficients are now normally distributed, so the sum of several coefficients follows a \(X^2\) (Chi-Squared) distribution.
The Likelihood ratio test is implemented in most stats packages in Python, R, and Matlab, and is defined by :\[LR = 2(L_{ur} - L_r)\]
We reject the null hypothesis if \(LR > Crit_{val}\).
Important parameters
In the Logistic Regression, the single most important parameter is the regularization factor. It is essential to choose properly the type of regularization to apply (usually by Cross-Validation).
Implementation in Python
We’ll use Scikit-Learn version of the Logistic Regression, for binary classification purposes. We’ll be using the Breast Cancer database.
# Imports from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score from sklearn.metrics import f1_score data = load_breast_cancer()
We then split the data into train and test :
X_train, X_test, y_train, y_test = train_test_split(data['data'], data['target'], test_size = 0.25)
By default, L2-Regularization is implemented. Using L1-Regularization, we achieve :
lr = LogisticRegression(penalty='l1') lr.fit(X_train, y_train) y_pred = lr.predict(X_test) print(accuracy_score(y_pred, y_test)) print(f1_score(y_pred, y_test))
0.958041958041958 0.9655172413793104
If we move on to L2-Regularization :
lr = LogisticRegression(penalty='l2', solver='lbfgs') lr.fit(X_train, y_train) y_pred = lr.predict(X_test) print(accuracy_score(y_pred, y_test)) print(f1_score(y_pred, y_test))
0.9440559440559441 0.9540229885057472
We notice the importance of the choice of :
- the solver
- the regularization
We can now illustrate the impact of the tolerance factor C. The larger C is, the less restrictive is the regularization.
from sklearn.model_selection import GridSearchCV parameters = {'C':[0.1, 0.5, 1, 2, 5, 10, 100]} lr = LogisticRegression(penalty='l2', max_iter = 5000, solver='lbfgs') clf = GridSearchCV(lr, parameters, cv=5) clf.fit(X_train, y_train)
We fetch the best parameters using :
clf.best_params_
And find :
{'C': 10}
Using this classifier, we acheive the following results :
y_pred = clf.predict(X_test) print(accuracy_score(y_pred, y_test)) print(f1_score(y_pred, y_test))
0.958041958041958 0.9655172413793104
We get the same results as with the L1-Penalty, for a rather large value of C. This illustrates well the importance of wisely choosing those parameters, since a 2% accuracy or F1-Score different on a Breast Cancer detection algorithm can make a big difference.
I hope you enjoyed this article. Don’t hesitate to comment if you have any question.
Sources : | https://maelfabien.github.io/statistics/linreg3/ | CC-MAIN-2020-40 | refinedweb | 1,050 | 50.33 |
This action might not be possible to undo. Are you sure you want to continue?
08/29/2014
text
original
Building Systems
Green Strategies for
Operation and Maintenance
Dr. Lal Jayamaha
McGraw-Hill
New York Chicago San Francisco Lisbon London Madrid
Mexico City Milan New Delhi San Juan Seoul
Singapore Sydney Toronto
reserved. Printed in the United States of America. Except as permitted
under the United States Copyright Act of 1976, no part of this publica-
tion may be reproduced or distributed in any form or by any means, or
stored in a data base or retrieval system, without the prior written per-
mission of the publisher.
1 2 3 4 5 6 7 8 9 0 DOC/DOC 0 1 2 1 0 9 8 7 6
ISBN-13: 978-0-07-148282-0
ISBN-10: 0-07-148282-2
The sponsoring editor for this book was Cary Sullivan and the
production supervisor was Richard C. Ruzycka. It was set in Century
Schoolbook by International Typesetting and Composition. The art
director for the cover was Anthony Landi.
Printed and bound by RR Donnelley.
This book is printed on acid-free paper.
McGraw-Hill books are available at special quantity discounts to use as
premiums and sales promotions, or for use in corporate training pro-
grams. For more information, please write to the Director of Special Sales,
McGraw-Hill Professional, Two Penn Plaza, New York, NY 10121-2298.
Or contact your local bookstore. informa-
tion but are not attempting to render engineering or other professional
services. If such services are required, the assistance of an appropriate pro-
fessional should be sought.
Library of Congress Cataloging-in-Publication Data
Jayamaha, Lal.
Energy-efficient building systems : green strategies for operation
and maintenance / Lal Jayamaha.
p. cm.
Includes bibliographical references and index.
ISBN 0-07-148282-2 (alk. paper)
1. Buildings—Energy conservation. I. Title.
TJ163.5.B84J39 2006
697—dc22 2006033794
xiii
Preface
Energy in the form of electricity, oil, and gas is used in buildings for oper-
ating systems such as air-conditioning, heating, ventilation, lighting,
and vertical transportation, which are essential for ensuring the safety
and comfort of the building’s occupants. These systems account for
70 to 80 percent of the total energy consumed in buildings. Energy costs
roughly account for about 30 to 40 percent of the total operating cost of
a typical building. Therefore, as energy prices soar, more building owners
and operators are turning to energy management to trim their overall
operating costs. Energy management includes improving the energy effi-
ciency of building systems and energy conservation, involving cutting
down on energy wastage, which, based on past experience, is able to save
as much as 30 percent of the annual energy cost of buildings.
Further, in most countries, electricity, which is one of the main forms
of energy used in buildings, is generated using fossil fuels such as oil,
gas, and coal. These fossil fuels are nonrenewable and also, during com-
bustion emit carbon dioxide, which contributes to global warming. Since
buildings typically account for more than one-third of the total national
energy consumption, government agencies in many countries are also
promoting energy management as a means to control energy resources
and environmental emissions.
This book on energy efficient building systems is written mainly for
two categories of readers. The first category includes professionals who
are involved in the operation and maintenance of buildings and are
interested in reducing energy costs. The other category of readers are
students who are specializing in this subject and professionals working
in energy service companies (ESCOs), who want to broaden their knowl-
edge about the subject.
The book is written based on the author’s personal experience; having
been involved in research and energy saving projects for over 15 years.
It contains ten self-contained chapters on the different aspects and sys-
tems relating to energy consumption in buildings. The book is intended
to serve as a “practical” guide for readers interested in energy savings
xiii
and contain many actual case studies and examples from the author’s
past work. Further, the energy saving strategies and measures described
in the book have been implemented before and, therefore, are of a prac-
tical nature and can be applied by readers based on their individual
needs.
Chapter 1 provides an introduction to the subject of energy manage-
ment and energy audits and illustrates the use of energy audits to iden-
tify various energy saving opportunities in buildings. Thereafter,
Chapters 2 to 10 describe the different systems and aspects of energy
consumption in buildings. Each chapter includes a brief introduction to
the subject to help readers who may not be familiar with some of the
basic concepts associated with each topic. Most chapters also include a
few review questions for students who may use the book as an accom-
panying text in undergraduate and postgraduate studies. Worked solu-
tions have also been provided to assist them.
Chapter 2 on central air-conditioning systems provides a brief intro-
duction to refrigeration cycles and chiller operations, and includes a
number of energy management strategies, which cover, both, design
and operational aspects of chiller systems. Chapter 3 provides an
overview of boilers and how they operate, followed by potential energy
saving measures that can improve the efficiency of boilers through oper-
ational strategies and system design. Other opportunities for improv-
ing the efficiency of boiler systems, including optimization measures for
ancillary equipment are also described in detail. Chapter 4 on pumping
systems provides an overview of the pumping systems used in buildings
for air-conditioning and heating systems, followed by various energy
management strategies for chilled water, hot water, and condenser
water pumping systems. An overview of cooling towers and their appli-
cation in buildings, followed by a number of energy saving strategies to
ensure optimum efficiency of air-conditioning systems is described in
Chapter 5. Thereafter, various design and operational strategies for
reducing energy consumption by improving the energy efficiency of air
handling and air distribution systems are described in Chapter 6. Next,
various energy saving measures relating to building lighting systems,
such as optimizing lighting levels, improving lighting system efficiency,
lighting controls, and daylighting, are presented in Chapter 7. Utility
companies normally charge for electricity use based on energy con-
sumption, power demand, and power factor, and various strategies to
reduce these electricity charges are discussed in Chapter 8. Energy con-
sumed by building systems, such as air-conditioning, heating, and light-
ing systems, can be reduced by ensuring that their operations are
optimized by implementing various control strategies; and Chapter 9 illus-
trates how such strategies can be implemented using the various functions
and features of building automation systems. Finally, Chapter 10
xiv xiv Preface
outlines strategies that can be used to reduce the overall energy con-
sumption of buildings by improving the design of building envelopes.
I would like to thank my present and past colleagues without whom
I would not have been able to successfully complete so many energy
audits and energy saving projects. Special thanks to Adrian Wang, who
over the years has been continuously reminding me that I should write
a book when I retire (I couldn’t wait that long!). I would also like to thank
Goh Chwee Guan (York International), Teh Eng Chuan (Philips), Kim
Jae Soo (EnE System), Steve Connor (Cleaver Brooks), Phil Stockford
(Spirax Sarco), Jasmine Williams (Calmac), Robert Rathke (ITT), and
Umang Sharma (Desiccant Rotors/Bry-Air) for their assistance in pro-
viding pictures and diagrams.
Finally, I would like to thank my wife Kshani and sons Michael and
Andrew for putting up with me over the last few years, when I spent
most of my free time preparing the book.
DR. LAL JAYAMAHA
xv Preface xv
Contents
Preface xiii
Abbreviations and Terms Used xvii
Chapter 1. Energy Management and Energy Auditing 1
1.1 Introduction 1
1.2 Energy Management 2
1.3 Energy Audits 3
1.3.1 Level I—walk-through assessment 4
1.3.2 Level II—energy survey and analysis 4
1.3.3 Level III—detailed energy audits 9
1.4 Case Study 17
1.4.1 Description of the system 17
1.4.2 Main findings and recommendations 17
1.5 Summary 21
Chapter 2. Air-Conditioning and Central Chiller Systems 23
2.1 Introduction 23
2.1.1 Refrigeration 23
2.1.2 Vapor compression cycle 24
2.1.3 Absorption cycle 24
2.1.4 Refrigeration capacity 26
2.1.5 Central air-conditioning systems 26
2.2 Chillers 27
2.2.1 Introduction 27
2.2.2 Chiller efficiency rating 28
2.2.3 Economizers 31
2.2.4 Condenser sub-cooling 32
2.3 Energy Saving Measures for Chiller Systems 33
2.3.1 Water cooled versus air cooled chillers 33
2.3.2 Chiller efficiency and life-cycle cost 36
2.3.3 Sizing and configuration 40
2.3.4 Consolidation of chiller plant 48
2.3.5 Chiller sequencing 51
2.3.6 Reset of chilled water temperature 58
2.3.7 Reset of condenser water temperature 61
vii
2.3.8 Maintaining surface of condenser tubes 62
2.3.9 Dedicated chillers for night operation 65
2.3.10 Use of absorption chillers 67
2.3.11 Thermal storage 69
2.3.12 Chiller free cooling 73
2.3.13 Waterside economizer 74
2.4 Summary 75
Chapter 3. Boilers and Heating Systems 77
3.1 Introduction 77
3.1.1 Boilers construction 77
3.1.2 Boiler efficiency 79
3.1.3 Auxiliary equipment 82
3.2 Energy Saving Measures for Boiler Systems 83
3.2.1 Improving combustion efficiency 83
3.2.2 Optimizing steam pressure 85
3.2.3 Fuel switching 86
3.2.4 Optimizing operation of auxiliary equipment 87
3.2.5 Standby losses 89
3.2.6 Minimizing conduction and radiation losses 90
3.2.7 Preheating combustion air 91
3.2.8 Optimum start controls 91
3.2.9 Heat recovery from flue gas 91
3.2.10 Automatic blowdown control and heat recovery 93
3.2.11 Boiler operating configuration 94
3.2.12 Condensate recovery 95
3.2.13 Steam traps 96
3.2.14 Steam leaks 99
3.2.15 Feedwater tank 100
3.2.16 Fouling and scaling of boiler heat transfer surfaces 100
3.2.17 Isolating off-line boilers 100
3.2.18 Decentralized boiler systems 101
3.2.19 Boiler replacement 101
3.3 Ideal Boiler Systems 101
3.4 Heat Recovery Systems 101
3.5 Hydronic Heating Systems 103
3.5 Summary 103
Chapter 4. Pumping Systems 105
4.1 Introduction 105
4.2 Distribution Systems 106
4.3 System and Pump Curves 108
4.4 Affinity Laws 111
4.5 Energy Saving Measures for Pumping Systems 112
4.5.1 Pump sizing 112
4.5.2 Variable flow 116
4.5.3 Primary-secondary systems 118
4.5.4 Reset of variable flow pump set-point 125
4.5.5 Optimizing condenser cooling systems 126
4.5.6 Pressure drop (∆P) across chillers 126
4.5.7 Pressure losses in pipes and fittings 128
viii Contents
4.5.8 Condenser water systems for package units 129
4.5.9 Efficiency of pumps 130
4.6 Summary 132
Chapter 5. Cooling Towers 135
5.1 Introduction 135
5.2 Energy Saving Measures for Cooling Towers 138
5.2.1 Cooling tower sizing 138
5.2.2 Capacity control 139
5.2.3 Condenser water reset 144
5.2.4 Condenser water flow rate 145
5.2.5 Installation of cooling towers 146
5.2.6 Condition of cooling tower 147
5.2.7 Water treatment 148
5.2.8 Free cooling 148
5.3 Summary 150
Chapter 6. Air Handling and Distribution Systems 153
6.1 Introduction 153
6.2 System Losses 154
6.3 System Curves and Fan Performance 155
6.4 Affinity Laws 157
6.5 Energy Saving Measures for Air Handling and Distribution Systems 158
6.5.1 Ducting system design 158
6.5.2 Fan discharge and inlet system effects 160
6.5.3 Filter losses 161
6.5.4 Coil losses 164
6.5.5 Fan efficiency 166
6.5.6 Excess airflow 168
6.5.7 Type of air distribution system (CAV versus VAV) 169
6.5.8 Static pressure set point 170
6.5.9 VAV optimization algorithm 172
6.5.10 Air distribution and balancing 173
6.5.11 Runaround coils 174
6.5.12 Optimal start-stop 175
6.5.13 Space temperature reset 175
6.5.14 Economizer cycle 176
6.5.15 Fresh air control 177
6.5.16 Air-to-air heat recovery 177
6.5.17 Car park ventilation systems 180
6.6 Summary 181
Chapter 7. Lighting Systems 183
7.1 Introduction 183
7.2 Definitions 183
7.3 Types of Lamps 186
7.3.1 Incandescent lamps 186
7.3.2 Halogen lamps 187
7.3.3 Fluorescent lamps 187
7.3.4 High-intensity discharge lamps 189
7.4 Lighting Levels 191
Contents ix
7.5 Lighting Power Density 192
7.6 Common Energy Saving Measures 192
7.6.1 Reducing lighting levels 192
7.6.2 Use of energy efficient lamps 194
7.6.3 High-efficiency electronic ballast 196
7.6.4 Luminaires 198
7.6.5 Lighting controls 199
7.6.6 Lighting energy saving devices 200
7.6.7 Daylighting 201
7.7 Summary 203
Chapter 8. Building Electrical Systems 207
8.1 Introduction 207
8.2 Efficiency of Motors 208
8.3 Variable Speed Drives 212
8.4 Power Optimizing Devices 213
8.5 Transformer Losses 214
8.6 Elevators 216
8.7 Maximum Demand Reduction 218
8.7.1 Load factor 219
8.7.2 Peak shaving 219
8.7.3 Load shifting 220
8.7.4 Energy management 221
8.8 Power Factor Correction 222
8.9 Equipment Standby Losses 223
8.10 Summary 224
Chapter 9. Building Automation Systems 227
9.1 Introduction 227
9.2 Scheduling 227
9.3 Equipment Interlocks 228
9.4 Demand Limiting 229
9.5 Duty Cycling 229
9.6 Trend Logging 230
9.7 Alarms 232
9.8 System Optimization and Control 233
9.8.1 Chiller controls 233
9.8.2 Boiler controls 235
9.8.3 Pump controls 236
9.8.4 AHU controls 237
9.8.5 FCU controls 237
9.8.6 Ventilation fan control 238
9.8.7 Other optimization measures 238
9.9 Summary 243
Chapter 10. Building Envelope 245
10.1 Introduction 245
10.2 Envelope Heat Transfer 245
10.3 Walls and Roofs 248
x Contents
10.4 Windows 250
10.5 Air Leakage 254
10.6 Overall Thermal Transfer Value (OTTV) 255
10.7 Estimation of Building Energy Performance 256
10.8 Summary 258
Bibliography 259
Solutions 261
Appendix A. Reference Data for Boiler Operations 273
Appendix B. Enthalpy of Moist Air 279
Index 281
Contents xi
1
Chapter
1
Energy Management
and Energy Auditing
1.1 Introduction
Due to economic and environmental reasons, organizations around the
world are constantly under pressure to reduce energy consumption. As
energy cost is one of the main cost drivers for businesses, reduction in
energy consumption leads to reduction in operating costs, and thereby
helps to improve the profitability of organizations.
One of the main environmental concerns relating to energy con-
sumption is the emission of carbon dioxide (CO
2
), which is a “greenhouse
gas” that contributes to global warming. Due to the release of CO
2
during burning of fossil fuels, CO
2
emissions can be closely correlated
to energy use.
Another environment-related concern is the ever-increasing demand
for fossil fuels, such as oil and gas, to support economic development.
Since they are nonrenewable energy sources that take millions of years
to form, they draw on finite resources, which will eventually be depleted.
Reduction in energy consumption can be achieved through energy
efficiency and energy conservation programs. Such programs involve the
promotion of efficient or effective use of energy, which helps to save
energy and results in reduced environmental pollution and operating
costs.
The first chapter of the book provides an overview of how such energy
saving programs can be formulated through energy management and
energy auditing. Thereafter, the subsequent chapters of the book cover,
in detail, energy saving opportunities associated with different build-
ing systems and how to identify them, and the implemention of suitable
solutions.
2 Chapter One
1.2 Energy Management
Energy management is a procedure for containing and reducing the
overall energy consumption and energy costs of an organization. Some
typical objectives of energy management, which depend on the needs of
each individual organization, include; lowering operating cost, increas-
ing profitability, reducing environmental pollution and improving work-
ing conditions.
For an energy management program to be successful, it needs the com-
mitment and support of the organization’s management and should be
in synergy with the organization’s objectives.
Energy management requires a systematic approach— from the for-
mation of a suitable team, to achieving and maintaining energy savings.
A typical process is outlined in Fig. 1.1.
The first step is to select a team with the right skills to lead and exe-
cute the energy management program. In many cases, the organization
may not have people with the necessary technical expertise to implement
Measure and verify performance
Prioritize and implement
Gather historic database
Set goals and objectives
Perform energy audits
Establish team
Maintain measures
Report findings
Figure 1.1 Typical energy management
program.
Energy Management and Energy Auditing 3
all the aspects of an energy management program. In such situations,
a professional energy management company could be engaged to carry
out some of the tasks, but the organization should appoint a suitable
person or a team who will have the overall responsibility for the program.
The energy management team then needs to set the objectives and pri-
orities for the energy management program. Some aspects that should
be covered are targeted savings, available budgets, and time frame for
the project.
It is also recommended to create a historic database so that energy
savings achieved in the future can be evaluated by comparing with this
database. The historic database, depending on the type of facility, should
include data such as utility consumption, occupancy rates, operating
hours, occupied building floor areas, and production volumes.
Next, specific energy saving measures (ESMs) need to be identified.
This is the most important part of the energy management program, and
is achieved through energy audits. Energy audits can involve different
levels of detail, depending on the objectives of the study. As described later
(section 1.3), the American Society of Heating, Refrigerating and Air-
conditioning Engineers (ASHRAE) has categorized audits into three levels,
from 1 to 3, depending on the depth of the audit. For example, if the energy
management team is considering which buildings, out of a group of build-
ings, have the best potential for savings, then a Level I preliminary walk
through audit may be sufficient. On the other hand, if the energy man-
agement team requires an estimate of potential savings and cost for a par-
ticular facility for financial forecasting, a Level II energy survey and
analysis may be necessary. Similarly, if the objective is to identify and
implement specific savings measures, a Level III audit may be required.
Once the audit is completed, the reported findings should be used to
prioritize the implementation of the ESMs. Thereafter, the ESMs should
be implemented and the postinstallation performance data monitored
to ensure that projected savings are achieved. In the event that savings
fall short of the targeted values, remedial action needs to be taken.
Finally, once all the measures are implemented, they need to be main-
tained to ensure that the achieved savings can be sustained over the
expected life of the system. Where ever necessary, follow-up energy
audits should be performed periodically.
As can be seen, the most important part of an energy management pro-
gram is an energy audit to identify potential energy savings measures. The
next section of this chapter covers the different aspects of energy audits.
1.3 Energy Audits
Energy audits are carried out to understand the energy performance of
buildings and facilities so that areas with potential for energy savings
4 Chapter One
can be identified. An energy audit consists of a study of how a building
or facility uses energy, how much it pays for the energy, and the identi-
fication and recommendation of improvement measures to reduce energy
consumption.
The scope of work undertaken in an energy audit depends on the
objectives of the study and resources available. As per the ASHRAE
application handbook, energy audits can be classified into three main
categories, based on the scope of work covered in the study. These three
categories are described next.
1.3.1 Level I—Walk-through assessment
This involves the assessment of a building’s energy cost and efficiency
through the analysis of energy bills and a brief survey of the building.
A Level I energy survey helps to identify and provide savings and cost
analysis of low-cost or no-cost measures. It also provides a listing of
potential capital improvements that merit further consideration, along
with an initial judgment of potential costs and savings. The level of
detail depends on the experience of the person performing the audit
and on the specifications of the client paying for the audit.
Walk through studies provide an initial assessment of savings poten-
tial for buildings and therefore help to optimize available resources by
being able to identify buildings with the best potential for savings and
where further effort and study should be devoted.
1.3.2 Level II—Energy survey and analysis
Level II audits include a more detailed building survey and energy
analysis. ALevel II energy audit identifies and provides the savings and
cost analysis of all practical measures. It also provides a listing of poten-
tial capital intensive improvements that require more thorough data col-
lection and analysis, along with an initial judgment of potential costs
and savings.
Level II audits normally do not include data logging, but may involve
some “spot measurement” of parameters such as motor power, space
temperature and relative humidity, and airflow rates, where necessary.
Although Level II studies require more resources than Level I stud-
ies, they are able to identify and short list not only buildings for further
study (as in Level I surveys) but also areas or measures within a build-
ing that have a good potential for savings and where further study
should be carried out. Therefore, Level II studies are useful exercises
to be carried out before a detailed study so that the resources available
for the detailed study can be better utilized.
Energy Management and Energy Auditing 5
Following are some of the main tasks carried out during a Level II
audit:
Collection of information on facility operations. Since the auditor should
have a good understanding of the facility, a site plan and a set of build-
ing plans, showing the layouts of the different areas of the facility, are
reviewed. Other information, such as building floor areas, operating
hours for the facility, and details of equipment used, with technical
specifications, also need to be collected.
Utility bill analysis. Past utility consumption data for at least a one year
period is collected and plotted (Fig. 1.2). The data should ideally be for
a calendar year so that seasonal fluctuations can be identified.
The data can then be used to estimate monthly and annual indices
for kWh/ft
2
and $/ft
2 ,
which can be used to compare the energy efficiency
of the building with other buildings having the same characteristics.
Two commonly used indices are annual energy cost per square foot and
annual kWh use per square foot. Some typical data plots are shown in
Figs. 1.3 and 1.4.
Another electricity consumption related index is the load factor.
Load factor 5
total monthly kWh consumption
maximum kW demand 3 24 hours 3 no. of days in month
220,000
230,000
240,000
250,000
260,000
270,000
280,000
290,000
300,000
Month
k
W
h
c
o
n
s
u
m
p
t
i
o
n
Figure 1.2 Typical electricity consumption chart.
6 Chapter One
Figure 1.3 Annual energy cost per square foot.
Figure 1.4 Annual kWh consumption per square foot.
4.7
3.0
0
1
2
3
4
5
Building being studied Energy efficient facility
$
/
s
q
.
f
t
.
39
22
0
5
10
15
20
25
30
35
40
45
Building being studied Energy efficient facility
k
W
h
/
s
q
.
f
t
.
Load factor is the relationship of the facility’s kWh consumption to its
monthly peak demand. Profiling these data by month can indicate how
and when a facility consumes electrical energy, if equipment is being
shut down at night, and how much of the building’s demand profile is
weather sensitive.
End user profile. Understanding where and when energy is being con-
sumed is an important first step to understanding where it can be saved.
The end use profile, which breaks down the total consumption into the
different end users, helps to define where money is being spent and to
focus efforts where the highest net financial gain can be obtained.
The actual end user breakdown will depend on the facility and the dif-
ferent systems it contains. For a typical commercial building, the con-
sumption can be grouped into the following:
■
Chillers
■
Boilers
■
Pumps
■
Cooling towers
■
Air handling units (AHUs)
■
Fan coil units (FCUs)
■
Ventilation fans
■
Lighting
■
Miscellaneous
The consumption for each system can be estimated using the indi-
vidual kW consumption multiplied by the annual operating hours, as
illustrated in Example 1.1.
Example 1.1 Consider a chiller of capacity 500RT, which operates 55 hours a week
at an average loading of 70 percent. If the efficiency of the chiller at this loading
is 0.65 kW/RT, the energy consumption of the chiller can be estimated as follows:
kWh consumption ϭ 500 RT ϫ 0.65 kW/RT ϫ 70% ϫ 55 hours/week
ϫ 52 weeks/year ϭ 650,650 kWh/year.
Similarly, consumption for other equipment and systems such as
pumps, fans, and lighting can also be computed.
The estimated individual consumption values should add up to the
total metered consumption from utility bills. If the total of the estimated
values do not add up to the actual consumption figure, it indicates that
all the users have not been accounted for or some of the users may not
have been correctly estimated. In such a situation, further investigation
Energy Management and Energy Auditing 7
is necessary to ensure that all users are accounted for. The end use con-
sumption can be plotted as a pie-chart, as shown in Fig. 1.5.
Comparison with benchmarks. The computed values of kWh consump-
tion, kW demand, and cooling load can be used to assess how efficient
the facility is by comparing with benchmarks from other buildings.
Some benchmarking parameters and what they indicate are given in
Table 1.1.
For industrial plants, the specific energy consumption, which relates
the energy consumed in kWh of electricity or liters of fuel to the prod-
uct output, can be computed. These specific energy consumption values
can then be compared with other plants manufacturing identical or
similar products.
Identify and shortlist areas. The above benchmarking exercise assists in
short-listing areas that have the potential for energy saving and, there-
fore, helps to optimize the use of resources.
8 Chapter One
Lighting
10%
Fan coil units &
ventilation fans
3%
Air handling units
19%
Miscellaneous loads
26%
Chillers
42%
Figure 1.5 Typical end use consumption chart.
TABLE 1.1 Some Typical Benchmarking Parameters for Buildings
Parameter Description What it means
W/ft
2
(lighting) Lighting wattage/floor Efficiency of lighting
area served systems
RT/ft
2
Cooling load/air-conditioned Effectiveness of the
floor area building envelope
kW/RT (chiller/s) Chiller kW/cooling load Efficiency of chiller/s
kW/RT (chiller system) (Total kW for chillers, Efficiency of entire
pumps & cooling towers)/ chiller system
cooling load
For example, if the lighting efficiency for a building is found to be
2 W/ft
2
as compared to the benchmark of 1 W/ft
2
for buildings of simi-
lar nature, it indicates that the possibility of achieving significant energy
savings from lighting for that building is good.
An estimate of potential savings can then be made using the current
and proposed benchmark values (Example 1.2).
Example 1.2 Consider a building with a cooling load of 1000 RT. The chiller
system operates, on an average, 55 hours a week and the efficiency of the chiller
system is 0.9 kW/RT. If based on benchmarking data, the system efficiency can
be improved to 0.7 kW/RT,
Estimated savings ϭ 1000 RT ϫ (0.9 – 0.7) kW/RT ϫ 55 hours/week
ϫ 52 weeks/year ϭ 572,000 kWh/year
Similarly, savings can be computed for other areas of the facility.
These estimated savings values and associated costs can then be used
to identify whether a particular building, or which system within a
building, has the potential for savings before proceeding to a Level III
audit.
1.3.3 Level III—detailed energy audits
Level III audits focus on potential optimization and capital intensive
projects identified or short-listed during Level II audits and involve
more detailed field data gathering and engineering analysis. They also
provide detailed project cost and savings information with a high level
of confidence, sufficient for major capital investment decisions.
Therefore, Level III studies are also sometimes called investment grade
audits (IGA).
Following are some of the main tasks carried out during a Level III
audit:
Introductory meeting. The first step in initiating a detailed audit is the
kick off meeting with the facility management team. The meeting nor-
mally involves key members of the facility management team, includ-
ing the facility manager and maintenance supervisors. Some of the
aspects usually covered at the kick off meeting are:
■
Introduction of audit team to the facility management team
■
Procedures for reporting and transmitting all correspondence and
documentation
■
Preliminary work schedule
■
Special work considerations (if any)
■
Safety issues
Energy Management and Energy Auditing 9
■
Customer review and approval process
■
Schedule for future progress meetings
■
Access to information, drawings, utility data, metering data
■
Site access
Audit interviews. The next step is to interview or meet the relevant
people to gather accurate information that are required for the audit.
The facility manager, or any other relevant official, needs to be inter-
viewed to collect information such as equipment specifications, draw-
ings, operational data, and utility data.
The maintenance supervisor also needs to be consulted to gather
information on equipment operation strategies, equipment perform-
ance, process problems, and other details such as types of lamps and bal-
last used.
Data collection and logging. Data collection and logging is the most
important part of the detailed study, where data on equipment and
operations is collected so that ESMs can be identified.
Depending on the facility, data collection can cover areas such as, air-
conditioning systems, lighting, ventilation systems, motors, water heaters,
boilers, compressed air systems, and other specialized equipment.
Commonly used instruments
Portable power meters help measure power consumption, current drawn,
and power factor. The meters should have a clamp-on feature to meas-
ure current and probes to gauge voltage so that measurements can be
recorded without any disruption to normal operations.
Portable light meters measure lighting levels. Normally, light meters
measure in footcandles or lux.
Tachometers are useful for measuring the speed of pumps and fans.
Optical type tachometers are preferable due to the ease of measure-
ment afforded by them.
Airflow measurements can be made using anemometers, which can
measure the velocity of air flowing in ducts and at openings. The two
types of anemometers available are “vane” and “hot-wire.” The meas-
ured air velocity and flow area can be used to compute the volume flow
rate of air, usually in cubic feet per minute (cfm) or cubic metres per hour
(cmh).
Airflow hoods are used to measure the volume of airflow through
supply and return diffusers. Airflow hoods contain an air velocity inte-
gration manifold that averages the air velocity across a fixed flow area
and gives the airflow volume.
10 Chapter One
Flow meters are used for measuring the flow rate of chilled water, hot
water, or condenser water in pipes. Ideally, flow meters should be the
portable clamp-on type, which can be installed without disrupting the flow
in pipes. Portable flow meters are of the ultrasonic type, which use ultra-
sonic transmitter and receiver probes clamped onto the bare pipe surface
(insulation has to be removed for chilled water and hot water pipes).
Temperature sensors are required to measure chilled water, hot water,
condenser water, and air temperatures. The most commonly used sen-
sors are RTDs and thermistors. The accuracy of these sensors is impor-
tant for applications such as measuring the temperature difference
between chilled water return and supply, to compute the cooling load.
For such applications, specially calibrated sensors should be used. Such
temperature sensors need to be connected to a data logger so that tem-
perature data can be monitored and logged.
kW sensors, which have current transformers, potential transformers,
and kW transducers, can be used for measuring the power consumption
of major equipment like chillers. They normally come with clamp-on or
split core current transformers that can be fitted onto the current-
carrying conductors inside the electrical panel without the necessitat-
ing switching off of the power supply. Such devices usually give a
milliamp or voltage output which needs to be connected to a data logger.
Pressure gauges, manometers, and pressure transducers are used for
measuring the pressure in pipes and ducts. While pressure gauges are
used for taking instantaneous pressure readings, pressure transducers
are used where the profile of the pressure is required. Pressure trans-
ducers too need to be connected to a data logger.
Data loggers are used to monitor and log data such as temperatures,
flows, motor current and power, and pressures. Data loggers are nor-
mally portable and can accept different inputs from sensors.
Combustion analyzers are portable devices that are used to estimate
the combustion efficiency of boilers and other fossil fuel burning equip-
ment by sampling the exhaust gases.
Other standalone portable loggers such as amp loggers, run time log-
gers, temperature and relative humidity (RH) loggers, and lighting log-
gers are also used depending on the need.
Data collection. The parameters to be monitored vary from one facility
to another due to differences in designs and operations. Following are
some of the typical parameters that are measured in different systems:
■
Chillers
■
Chiller motor power
■
Chilled water supply and return temperatures
■
Condenser water supply and return temperatures
Energy Management and Energy Auditing 11
■
Flow rates
■
Cooling load profile
■
Chiller efficiency (kW/RT)
■
Cooling towers
■
Fan power
■
Fan speed
■
Condenser water supply and return temperatures
■
Outside-air dry bulb/wet bulb temperatures
■
Pumps
■
Pump motor power
■
Operating hours
■
Pressure across pumps
■
Flow rate
■
Distribution system pressures
■
Air handling units and air distribution systems
■
Fan motor power
■
Fan speed
■
Operating hours
■
Static pressure across fan
■
Supply and return airflows
■
Off-coil temperature
■
Return air temperature and RH
■
Outside air temperature and RH
■
Chilled water supply and return temperatures
■
Lighting
■
Lighting operating hours
■
Power consumed by lighting circuits
■
Lighting levels
■
Steam and hot water systems
■
Makeup water flow
■
Makeup water temperature
■
Condensate return temperature
■
Feedwater temperature
■
Feedwater/steam flow
■
Flue gas composition and temperature
■
Steam pressure
■
Fuel usage
■
Boiler efficiency
■
Amount of condensate recovered
12 Chapter One
Data analysis. Data collected are usually in raw form and need to be
refined to enable analysis. Some of the steps involved in data analysis
are listed here.
Computation of useful parameters. Various parameters that are not
directly measured need to be computed using the measured data. Some
examples include cooling load, which is computed using chilled water
flow and chilled water temperatures; chiller efficiency, which is com-
puted using the actual cooling load and compressor motor power.
Tabulation of data. Some data needs to be tabulated so that meaning-
ful calculations and analysis can be performed (see Table 1.2).
Plotting of data. As part of the data analysis, the measured data needs
to be plotted so that various operating trends and characteristics can be
identified. Some parameters are plotted against time to see how they
vary. For example, Fig. 1.6 (case study described later), shows how a
building’s cooling load demand varies with time. Similarly, some param-
eters need to be plotted against other parameters to see how they inter-
relate, as in Fig.1.7, which shows how the efficiency of a chiller varies
with loading.
Comparing performance with specifications. The performance of equipment
or systems also needs to be compared with design data so that short-
comings or possible improvements can be identified. Table 1.2 shows a typ-
ical comparison of measured data with design data for a group of chillers.
Energy Management and Energy Auditing 13
TABLE 1.2 Typical Comparison of Measured Data with Design Data for a Group
of Chillers
Parameter Design Chiller 1 Chiller 2 Chiller 3
Chilled water
supply temp (ºC) 5.6 5.3–5.6 5.5–6 5.4–5.7
Chilled water
return temp (ºC) 12.2 9–10 9–10 9–10
Chilled water
flow rate (GPM) 1500 1828–1875 1600–1,700 1550–1680
Condenser water
supply temp (ºC) 32.2 24–26 24.6–26 24.7–26.5
Condenser water
return temp (ºC) 37.5 28–31 29–31.5 28–30.5
Condenser water
flow rate (GPM) 2250 2000 1550–1600 2070–2126
Capacity (RT) 750 490–610 400–550 450–575
Power (kW) 504 330–400 300–400 300–375
Efficiency (kW/RT) 0.672 0.65–0.70 0.70–0.75 0.65–0.75
Evaporator ⌬P (bar) 0.41 0.63 0.54 0.57
Condenser ⌬P (bar) 0.55 0.57 0.34 0.61
CW approach Temp(ºC) — 2.9 0.8 2.5
Following are some examples where the actual performance needs to
be compared with design values:
■
Chiller capacity and efficiency
■
Boiler capacity and efficiency
■
Chilled water flow
■
Condenser water flow
■
Chilled water supply and return temperatures
■
Condenser water supply and return temperatures
■
Cooling tower capacity and performance
■
Pump flow, head and motor power
■
AHU cooling capacity, supply and fresh airflow
■
Motor power
■
Ventilation rates
Identification of ESMs and concept design. Once the data is analyzed, the
ESMs can be identified. The ESMs identified vary from one facility to
another due to differences in equipment, system design, and operations.
Some of the common ESMs are listed below and explained in detail in
the subsequent chapters of the book.
■
Chillers
■
Providing design flow rates and temperatures
■
Reducing operating hours
■
Sequencing chillers
■
Resetting chilled water and condenser water temperatures
■
Consolidating the chiller plant
■
Using small chillers for night operations
■
Replacing inefficient chillers
■
Balancing water flow rates
■
Installing automatic condenser tube cleaning systems
■
Cooling towers
■
Installing variable speed controls for cooling tower fans
■
Replacing under performing cooling towers
■
Reducing operating hours
■
Adding capacity if existing towers are undersized
■
Pumps
■
Reducing capacity of pumps (trimming impeller, reducing speed, or
replacing pumps)
14 Chapter One
■
Converting constant speed pumps to variable speed pumps
■
Optimizing pump operating strategies
■
Removing unnecessary restrictions in piping systems
■
Water flow balancing
■
Air handling units and air distribution systems
■
Reducing fan speed/use of variable speed drives (VSDs)
■
Converting constant air volume (CAV) systems to variable air
volume (VAV) systems
■
Improving controls and control strategies
■
Reducing operating hours
■
Ensuring ventilation control based on occupancy
■
Cleaning/replacement of coils and filters
■
Air balancing for distribution systems
■
Lighting
■
Replacing inefficient lamps with high-efficiency lamps
■
Using high-efficiency ballasts
■
Reducing lighting levels
■
Installing timer controls
■
Installing occupancy sensors
■
Using day lighting
■
Steam and hot water systems
■
Improving boiler operating efficiency
■
Heat recovery from flue gas
■
Heat recovery from blow down
■
Condensate recovery
■
Reduction of boiler pressure
■
Reduction of boiler operating hours
■
Compressed air systems (not covered in this book)
■
Eliminating leaks
■
Reducing operating pressure
■
Increasing downstream storage capacity
■
Reducing inlet air temperature
■
Recovering heat from compressors
■
Improving compressor controls
■
Installing variable speed compressors
Cost and savings analysis. Once the ESMs are designed, the cost for imple-
menting each measure and the achievable savings are estimated.
Cost estimation is usually done by listing the scope of work necessary
for each ESM and using unit rates for the different tasks (if available),
or by obtaining quotations from suitable contractors.
Energy Management and Energy Auditing 15
Once the cost and savings for each measure is computed, the finan-
cial viability for each can be considered based on agreed financial cri-
teria. The most common financial criteria used for evaluating energy
management projects are, simple payback period, life-cycle cost, and
internal rate of return (IRR).
Baseline data for savings verification. Usually, during the audit, a base-
line for system performance is also established so that postinstallation
system performance can be compared with these preinstallation data to
estimate the achieved savings. Such data are very important if the proj-
ect is undertaken as a “performance contract,” since the Energy Services
Company (ESCO) will be paid based on savings achieved. Even if it is
not a performance-based project, it is still a good practice to have base-
line data so that postinstallation savings can be quantified and com-
pared with projected savings.
1.4 Case Study
The following case study is used to illustrate typical findings and rec-
ommendations for an energy audit covering the central chilled water
system of a building. As such, it should be noted that the audit covers
only one system within the facility and that the identified energy saving
measures may not be applicable to other buildings (typical energy saving
measures applicable to different systems within buildings are explained
in detail in the subsequent chapters of the book).
1.4.1 Description of the system
The central chilled water plant consists of six sets of chillers of 450 RT
capacity, each with associated cooling towers, condenser water pumps,
and primary and secondary chilled water pumps.
The central chilled water plant operates 24 hours a day and provides
chilled water to an office tower, a residential apartment building, and
a retail podium block. Chilled water is supplied to the office tower build-
ing and residential apartments 24 hours a day, while the retail areas
are supplied daily with chilled water only from 9 a.m. to 10 p.m.
The number of chillers in operation is controlled based on the build-
ing’s cooling load, and the building automation system (BAS) automat-
ically cuts in and cuts out chillers, with their associated pumps and
cooling towers, depending on the load.
1.4.2 Main findings and recommendations
Provide additional small chiller. As can be seen from Fig. 1.6, the actual
daytime cooling load (between 9 a.m. and 6 p.m.) varies from 1300 to
16 Chapter One
1350 RT on weekdays and on Saturday mornings. The cooling load on
Saturdays, after about 1 p.m.) and on Sundays varies between 600 and
700 RT. The daily night load is between 200 and 250 RT.
The efficiency of chillers depends on how much they are loaded and
Fig. 1.7 shows the loading versus efficiency for one of the chillers. Based
Energy Management and Energy Auditing 17
Figure 1.6 Building cooling load profile.
0
200
400
600
800
1000
1200
1400
12:00 AM 12:00 AM 12:00 AM 12:00 AM 12:00 AM 12:00 AM 12:00 AM
Date and time
Thursday Friday Wednesday Sunday Monday
C
o
o
l
i
n
g
l
o
a
d
(
R
T
)
Saturday
f
Figure 1.7 Chiller efficiency.
0
0.2
0.4
0.6
0.8
1
1.2
0 50 100 150 200 250 300 350 400 450
Cooling load (RT)
C
h
i
l
l
e
r
e
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
on the measured data, the actual operating efficiency of the chillers is
between 0.62 and 1.2 kW/RT. The system efficiency (Fig. 1.8) for the
chiller system, which includes the efficiency of the chillers as well as that
of the chilled water pumps, condenser water pumps, and cooling towers,
is 1.1 kW/RT during daytime. The system efficiency reduces to between
1.4 and 2.4 kW/RT during nighttime operation.
The prime reason for the drop in system efficiency at night is due to
the need for running a 450-RT capacity chiller to meet the night load of
200 to 250 RT. During this time, the operating chiller is loaded only to
44 to 55 percent of its capacity. This results in a drop in chiller efficiency
from 0.65 kW/RT to about 0.9 kW/RT.
Therefore, it was proposed to install an additional small chiller to act
as the “night chiller.” The proposed chiller capacity was 250 RT to meet
the night load of 200 to 250 RT. This would help improve chiller efficiency
in the night from 0.9 kW/RT to about 0.6 kW/RT.
Reduce capacity of primary chilled water pumps and condenser water pumps.
The primary chilled water pumps and condenser water pumps are fixed
speed pumps and one set each is operated with one chiller.
The pumps have constant flow valves installed to control the flow of
water to each chiller. As the capacity of the pumps is much higher than
18 Chapter One
0
0.5
1
1.5
2
2.5
12:00 AM 4:48 AM 9:36 AM 2:24 PM 7:12 PM 12:00 AM
Time
S
y
s
t
e
m
e
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Figure 1.8 Chiller system efficiency.
required for the application, these constant flow valves reduce the water
flow by inducing extra pressure drop in the system. Further, the con-
denser water flow through some chillers was about 20 percent more
than required.
Therefore, it was recommended to remove the constant flow valves
that induce high-pressure losses in the system, and to reduce the capac-
ity of the pumps by trimming the impellers to suit the actual system
requirements.
Secondary chilled water pumps. The secondary chilled water pumps
(constant speed pumps) are arranged in three groups—the office tower,
residential apartments, and the retail area. Each group of pumps has
three pumps installed in parallel and a maximum of two pumps are
operated to meet the peak load, while the remaining pump acts as a
standby. There are also throttling valves installed at the discharge of
each pump to reduce the water flow by inducing extra pressure drop
in the system.
The chilled water system is designed to operate at a temperature
difference (⌬T) of 5.6ЊC between chilled water return and supply. In
Fig. 1.9, the actual chilled water ⌬T during daytime for the office tower
is 5ЊC to 6ЊC but drops to about 2ЊC to 3ЊC during nighttime and during
Energy Management and Energy Auditing 19
0.00
1.00
2.00
3.00
4.00
5.00
6.00
7.00
12:00 AM 4:48 AM 9:36 AM 2:24 PM 7:12 PM 12:00 AM
Time and date
T
e
m
p
e
r
a
t
u
r
e
d
i
f
f
e
r
e
n
c
e
(
°
C
)
Figure 1.9 Chilled water ⌬T (difference between return and supply temperatures).
daytime on Sundays. The chilled water ⌬T for the retail area varies from
4ЊC to 5ЊC, while that for the residential apartments varies from 3ЊC to
4ЊC during daytime and 2ЊC to 3ЊC at night. This indicates that there
is significant overpumping of chilled water to the residential apart-
ments at all times and to the office tower at night.
Therefore, it was proposed to convert the existing constant speed
secondary pumping systems to variable speed pumping systems. Each
group of three pumps serving a particular area of the facility would have
a differential pressure sensor, which can be used to maintain a set
pressure in that chilled water system by varying the speed of the
pumps.
Operation of chillers. The temperature of chilled water returning from
the residential apartments is lower than that returning from the office
tower and retail areas. The chilled water return pipe from the residen-
tial apartments is connected to the main chilled water return header in
the chiller plant room, which is closer to chillers 1 and 2, while the
return pipe from the office tower is connected near chillers 5 and 6.
Therefore, during normal operation, the temperature of return chilled
water to chillers 5 and 6 is higher than that to the other chillers. Since
the chilled water flow rate and the chilled water supply temperature are
fixed for each chiller and the loading of each chiller depends on the
return chilled water temperature (higher return temperature leads to
higher loading of chillers), chillers 5 and 6 are loaded more than the
other chillers. Therefore, during daytime, when four chillers are in oper-
ation, chillers 1 to 4 cannot be fully loaded. This leads to situations
where four chillers (450 RT ϫ4 ϭ1800 RT) need to be operated to meet
a cooling load of less than 1350 RT, when only three chillers (450 RT ϫ
3 ϭ 1350 RT) are necessary (Fig.1.10).
Therefore, when the operations of the secondary chilled water pumps
are optimized by converting from constant flow to variable flow sys-
tems, it will not only result in pumping energy savings, as described ear-
lier, but will also lead to better chiller loading (higher chilled water
return temperature) and further energy savings from improved chiller
efficiency. In addition, the small chiller proposed for nighttime opera-
tion can also be used during the daytime to act as a swing chiller to sup-
plement the big chillers and better match operating chiller capacity to
the cooling load.
As illustrated in this case study, the data collection and analysis
carried out as part of an energy audit can help identify shortcomings in
various energy consuming systems so that suitable solutions can be
recommended to overcome them.
20 Chapter One
1.5 Summary
The chapter provided an overview of energy management and energy
audit programs and highlighted how they are useful for any building,
organization, or industry to reduce energy consumption. The key tasks
of energy audits, which provide a systematic approach for identifying
energy saving opportunities, were described in detail. Typical findings
and recommendations of energy audits were also illustrated using a
simple case study.
The subsequent chapters of this book describe, in detail, the different
energy consuming systems in buildings and how suitable energy saving
measures or solutions can be applied to reduce the overall energy con-
sumption of buildings.
Energy Management and Energy Auditing 21
0
200
400
600
800
1000
1200
1400
1600
1800
12:00 AM 12:00 AM 12:00 AM 12:00 AM 12:00 AM 12:00 AM 12:00 AM
Date and time
0
1
2
3
4
5
Building cooling load (RT)
Number of chillers in operation
Thursday Friday Wednesday Saturday Sunday
Monday
Cooling load less than 1350 RT and 4 chillers in operation
C
o
o
l
i
n
g
l
o
a
d
(
R
T
)
Figure 1.10 Cooling load and number of chillers in operation.
23
Chapter
2
Air-Conditioning and Central
Chiller Systems
2.1 Introduction
Air-conditioning systems used in commercial and institutional buildings
can account for more than 50 percent of the total electricity consumed.
However, they are essential for buildings in hot and humid climates,
where air-conditioning is used to provide a comfortable internal envi-
ronment for the occupants so that they can work and perform productively.
Therefore, it is important to understand how air-conditioning systems
work so that they can be made to operate as efficiently as possible.
2.1.1 Refrigeration
Air-conditioning is normally used to remove heat from an occupied space
and maintain it at a temperature lower than the outdoor temperature.
This requires the use of a refrigeration system that can help maintain
a body at a comfortable temperature.
As shown in Fig. 2.1, a refrigeration machine “R” absorbs heat from the
cold body at temperature T
o
and releases the heat Q
s
into the surround-
ings at temperature T
s
. This process requires work “W” to be done on the
system. The heat released into the surroundings equals the heat absorbed
from the cold body plus the work done or mechanical energy consumed.
Refrigerants are used in refrigeration machines to perform this func-
tion. Refrigerants evaporate at low temperatures and condense at higher
temperatures. Therefore, refrigerants can be evaporated at low tem-
peratures, during which heat is absorbed, and then condensed at a
higher temperature and pressure, when the absorbed heat (plus that due
to the work done) is released into the atmosphere.
24 Chapter Two
2.1.2 Vapor compression cycle
The vapor compression cycle is the most commonly used refrigeration
cycle. It has four mechanical components through which the refrigerant
is circulated in a closed loop, as shown in Fig. 2.2.
The refrigerant enters the compressor as low-pressure vapor and is
compressed to high-pressure vapor. The high-pressure vapor then flows
to the condenser, which is a heat-exchanger, where heat is released
from the refrigerant and the refrigerant condenses from high-pressure
vapor to high-pressure liquid. Next, the high-pressure liquid refriger-
ant flows through the expansion valve to the evaporator and becomes
low-pressure liquid refrigerant. In the evaporator, the liquid refrigerant
evaporates at low temperature by absorbing heat from the surroundings.
This is the cooling effect of the refrigeration system. The refrigerant then
becomes low-pressure vapor and enters the compressor, and the cycle
is repeated.
The vapor compression cycle can be represented on a pressure–
enthalpy (p-h) diagram, as shown in Fig. 2.3, for an ideal case without
losses.
2.1.3 Absorption cycle
Another refrigeration cycle is the absorption cycle. This cycle is heat
driven unlike the vapor compression cycle, which is work driven. The
Q
S
= Q
0
+ W
Cold body T
0
R W
Q
0
Q
S
Surrounding temperature T
S
Figure 2.1 Operating principle of a refrigeration
machine.
Condenser
Evaporator
Expansion valve
Compressor
Figure 2.2 Vapor compression cycle.
Air-Conditioning and Central Chiller Systems 25
cycle involves a mixture of two substances, such as ammonia and water
or lithium bromide and water, that attract each other.
Figure 2.4 shows the components of an absorption cycle. In this cycle,
the solution of a salt, such as lithium bromide and water, enters the gen-
erator where heat is applied. The heat breaks the bonds of the mixture
and evaporates some of the water. The water vapor goes to the con-
denser, where it is condensed from vapor to high-pressure liquid. This
water, which acts as the refrigerant, passes through a metering valve and
enters the evaporator as low-pressure liquid. The water then evaporates
in the evaporator by absorbing heat, providing the cooling effect of the
cycle. The low-pressure vapor then enters the absorber where the strong
salt solution returning from the generator absorbs it and it is then
pumped back as a weak solution into the generator to complete the cycle.
The main difference between the absorption cycle and the vapor
compression cycle is that the former uses a heat source to power the
generator as compared to doing “work” in the compressor of the vapor
compression cycle. The absorption cycle is also less efficient than the
vapor compression cycle. However, it is useful for applications where
waste heat or cheap sources of heat are available.
Evaporator
Condenser
Expansion
valve
Compressor
Enthalpy
P
r
e
s
s
u
r
e
Figure 2.3 Pressure–enthalpy diagram for an ideal vapor
compression cycle.
Generator
Absorber
Throttle
valve
Condenser
Evaporator
Metering
device
Pump
Figure 2.4 Components of the absorption cycle.
26 Chapter Two
2.1.4 Refrigeration capacity
The capacity of air-conditioning machines is usually classified by how
many “tons” of refrigeration (RT) effect they can produce.
1 RT of refrigeration is based on the amount of cooling 1 ton (2000 lb)
of ice can produce by melting over a 24-hour period. 1 RT of refrigera-
tion has the ability to remove 288,000 Btu in a 24-hour period.
1 RT ϭ 2000 lb ϫ 144 Btu/lb ϭ 288,000 Btus
Therefore, 1 RT ϭ 12,000 Btu/h
Also, 1 RT ϭ 3.517 kW.
2.1.5 Central air-conditioning systems
Buildings use different air-conditioning systems such as central systems,
stand-alone package units, variable refrigerant volume (VRV) systems,
and water-cooled package units. Out of these systems, the most com-
monly used system in large buildings is the central type. Therefore,
this chapter will only cover central air-conditioning systems. In sys-
tems other than central ones, energy management strategies that can
be adopted are usually specific to each installation and cannot be easily
discussed in general.
In central air-conditioning systems, such as those found in commer-
cial buildings, the evaporator of a chiller cools water. This chilled water
is then pumped to air handling units (AHUs) and fan coil units (FCUs)
located in different areas of the building. The AHUs and FCUs have fans
that blow air through heat exchanger coils to transfer heat from the air
to the chilled water, thereby cooling the air. The chilled water, after
picking up heat from the coils, is then pumped back to the evaporator
of the chiller to cool down and complete the cycle. Such systems are
called chilled water systems. Atypical arrangement of a central chilled
water system is shown in Fig. 2.5.
Condenser water
pumps
Chilled water pumps
Fans
Chillers
Cooling
towers
Cooling coils
Figure 2.5 Typical arrangement of a central chilled water system.
Air-Conditioning and Central Chiller Systems 27
Chillers used in central chilled water systems normally work on the
vapor compression cycle or the absorption cycle. Since electric chillers
working on the vapor compression cycle are the most common, and sig-
nificant energy savings can be achieved from these machines through
various energy management strategies, the rest of this chapter is mainly
devoted to such chillers.
A chiller working on the vapor compression cycle contains four
main components—the compressor, evaporator, condenser, and
expansion device. The heat absorbed in the evaporator and the heat
added during compression is rejected in the condenser. In air-cooled
chillers, heat from the condenser is released directly into the ambi-
ent air, while in water-cooled systems, heat is released into the con-
denser water, which is then circulated to cooling towers where the
heat is finally released.
2.2 Chillers
2.2.1 Introduction
Chillers are the biggest energy consumers in central air-conditioning
systems. In commercial buildings where air-conditioning systems
account for more than half the total electricity consumption, chillers end
up being the single biggest consumers. Therefore, their efficiency has a
significant effect on the overall energy performance of these buildings.
Chillers are classified according to the type of compressor used for
compressing the refrigerant. The main types of compressors used are
reciprocating, scroll, screw, and centrifugal.
Reciprocating compressors use pistons and connecting rods driven by
a crankshaft, as shown in Fig. 2.6. The crankshaft is driven by a motor.
In open type drives, the drive motor is mounted externally and the
crankshaft extends through a seal out of the crankcase. In hermetic sys-
tems, the motor and the compressor are contained in the same hous-
ing and the crankshaft and motor are in direct contact with the
refrigerant. Normally, reciprocating compressors have a number of
cylinders in one unit. For high-capacity applications, multiple com-
pressors are used.
Scroll compressors use two interfitting, spiral-shaped scroll members
(Fig. 2.7). One scroll rotates while the other remains stationary. Due to
the profile of the scrolls, refrigerant drawn in through the inlet port is
compressed between the scrolls during rotation and then released at the
discharge port. Scroll compressors are used for low-capacity applications
of up to about 50 kW.
Screw compressors are used for medium-capacity applications up to
about 1055 kW (300 RT). They consist of a set of male and female helically
grooved rotors, as shown in Fig. 2.8. Compression is achieved by direct
volume reduction due to rotation of the rotors. Refrigerant is taken in
at the inlet port, compressed during rotation of the rotors, and finally
released at the discharge port.
Centrifugal compressors consist of a single impeller (Fig. 2.9) or a
number of impellers mounted on a shaft and rotating at high speed
inside a housing. Refrigerant enters the impeller in the axial direction
and is discharged radially at high velocity. The velocity pressure is then
converted to static pressure in the diffuser. Centrifugal compressors are
used for high-capacity applications, usually above 1055 kW (300 RT).
2.2.2 Chiller efficiency rating
Chiller efficiency is measured in terms of how many units of power is
used to produce one unit of cooling.
Chiller efficiency 5
Power input
Cooling produced
28 Chapter Two
Figure 2.6 Cutaway of a reciprocating compressor. (Courtesy of York International.)
Air-Conditioning and Central Chiller Systems 29
Figure 2.7 Cutaway of a scroll
compressor. (Courtesy of York
International.)
Figure 2.8 Cutaway of a screw compressor. (Courtesy of York
International.)
In the English IP system, chiller efficiency is measured in kW/RT
In the SI metric system, chiller efficiency is measured in coefficient
of performance (COP)
kW refrigeration effect ϭ RT ϫ 3.517
The energy efficiency ratio (EER), which is the ratio of the cooling
capacity (Btu/h) to the electric power input (W), is sometimes used to
rate reciprocating and scroll compressors in air-cooled chillers and
direct-expansion refrigeration units.
Since chiller efficiency varies with loading, it is usually rated at
full-load (100 percent of rated capacity) and part-load conditions (90,
80, 70 percent, and so on.). This information, normally provided by
chiller manufacturers, is useful in selecting chillers for different
applications.
where COP 5
kW refrigeration effect
kW input
where kW>RT 5
kW input
Tons of refrigeration
30 Chapter Two
Figure 2.9 Typical centrifugal compressor. (Courtesy of York International.)
Consider chiller A, which has an efficiency of 0.55 kW/RT at full load
and 0.65 kW/RT at 70 percent load, and another chiller B, which has a
full-load efficiency of 0.57 kW/RT and 0.61 kW/RT at 70 percent load.
If based on the expected load profile of the building, the chiller is going
to operate only for a short period of time at 100 percent load and most
of the time at 70 percent load, then chiller B would be a better option
due to its superior performance at the operating point that will be most
frequently encountered. As will be explained later, to ensure optimum
efficiency, the cooling load profile should be used to select the best chiller
for the job based on chiller part-load data.
If the actual cooling load profile is not known, and the chiller is
expected to operate under normally encountered conditions, the IPLV
rating can be used to evaluate the chiller’s performance. The IPLV
rating calculates the chiller efficiency based on weightage given to effi-
ciency at different points, which, in turn, is based on commonly encoun-
tered operating conditions.
where A ϭ kW/RT at 100 percent load
B ϭ kW/RT at 75 percent load
C ϭ kW/RT at 50 percent load
D ϭ kW/RT at 25 percent load
2.2.3 Economizers
Some chillers use economizers that enable flash refrigerant gas to be
introduced at intermediate pressure, between the evaporator and con-
denser pressures, into multistage compressors to improve efficiency.
Figures 2.10 and 2.11 show the arrangement of a two-stage economizer
and the related pressure–enthalpy (p-h) diagram, respectively.
In this cycle, when refrigerant leaving the condenser passes through
an orifice, some refrigerant is preflashed. The preflashing of some liquid
refrigerant cools the remaining liquid. The refrigerant vapor is removed
to ensure that the refrigerant at the economizer is in the liquid state (not
saturated liquid and gas). As a result, the condition of refrigerant enter-
ing the evaporator has a lower enthalpy (moves further left on the p-h
diagram) and increases the evaporator’s refrigeration effect.
In chillers using 3-stage compressors, the flashing of refrigerant can
be done at two different stages, and introduced between the first and
second stages and second and third stages to further improve the effi-
ciency of the chiller.
IPLV 5
1
c a
0.17
A
b 1 a
0.39
B
b 1 a
0.33
C
b 1 a
0.11
D
b d
Air-Conditioning and Central Chiller Systems 31
2.2.4 Condenser subcooling
Chillers that do not have multistage compressors use liquid subcooling
to improve the refrigerant’s effect and, therefore, the chiller efficiency.
In such a system, the refrigerant liquid leaving the condenser is further
cooled (subcooled). This enables the refrigerant to enter the evaporator
at a lower enthalpy, as shown in Fig. 2.12, to help increase the refrig-
erant’s effect.
32 Chapter Two
Figure 2.10 Arrangement of economizer.
Figure 2.11 Pressure–enthalpy diagram for cycle with
economizer.
Two-stage compressor
Flash refrigerant
Condenser
Orifice
Economiser
Evaporator
Enthalpy
Evaporator
Condenser
Compressor
Second stage
First stage
P
r
e
s
s
u
r
e
Without economizer
With economizer
In the following sections of the chapter, various energy-saving meas-
ures for chiller systems are described.
2.3 Energy-Saving Measures for Chiller Systems
2.3.1 Water-cooled versus air-cooled chillers
The heat removed by the refrigeration cycle of an air-conditioning system
is released in the condenser to either water or ambient air during con-
densing. Chillers are classified according to whether the condenser is
water-cooled or air-cooled.
In air-cooled chillers, a single fan or a number of fans are used to blow
ambient air through the condenser, which is normally a finned heat
exchanger. Water-cooled chillers, on the other hand, have shell and tube
heat exchangers, where the heat is released into the condenser water. This
warm condenser water is then pumped to cooling towers where the heat
is released into the environment. Heat transfer at the cooling towers
takes place mainly by latent cooling, wherein some of the warm con-
denser water evaporates, absorbing the latent heat of evaporation from
the condenser water, thereby cooling it (the operation of cooling towers is
explained in Chapter 5). The condenser water, after releasing heat in the
cooling towers, is pumped back through the condenser of the chiller to con-
tinue the heat removal cycle. However, since some of the water evaporates
in the cooling towers during this cycle, “makeup water” needs to be con-
stantly added to maintain the flow of condenser water through the system.
Water-cooled chillers operate at a lower condensing pressure than air-
cooled chillers. The lower condensing pressure is due to releasing heat
into the condenser water, which is first cooled to a temperature a few
degrees above the wet-bulb temperature of the ambient air (by the cool-
ing towers). In air-cooled chillers, heat is directly released to the ambi-
ent air and the heat transfer is dependent on the dry-bulb temperature
of the air. Further, the heat transfer in the water-cooled shell and tube
heat exchangers is better than in finned type air-cooled condensers.
Air-Conditioning and Central Chiller Systems 33
Enthalpy
Evaporator
Condenser
Compressor
P
r
e
s
s
u
r
e
Without subcooling
With subcooling
Subcooling
Figure 2.12 Pressure–enthalpy
diagram for cycle with condenser
sub cooling.
The lower condensing pressure leads to a lower pressure differential
between the evaporator and condenser, which results in lower power
consumption by the compressor. Therefore, water-cooled chillers are far
more efficient than air-cooled chillers.
Although air-cooled chillers are less efficient, they have many appli-
cations since they do not need a constant supply of makeup water (for
condenser water). They also do not need cooling towers and can be mounted
outdoors, such as on the roof of a building. Therefore, air-cooled chillers
are used where a constant source of water is not available or where
water is scarce. Air-cooled chillers are also used where space is limited,
such as when building space for installing water-cooled chillers or out-
door space for installing cooling towers is unavailable.
The capital cost for water-cooled systems is normally higher than for
air-cooled systems since the former needs an enclosed plant room, cool-
ing towers, condenser water pumps, and extra piping for the condenser
water system. The cost of piping for the condenser water system can be
substantial in cases where the plant room is located in the basement and
the cooling towers are located on the roof of the building.
Although the first cost of water-cooled systems is higher (than air-
cooled systems), due to their superior energy efficiency, the extra initial
cost can be paid back in just a few years. Even in situations where air-
cooled chillers are currently in use, usually conversion to a water-cooled
system, if practically possible, will yield a good return on investment.
However, when evaluating the benefits of water-cooled systems, the
additional costs associated with water-cooled systems for makeup water
and water treatment have to be considered as illustrated in Example 2.1.
Example 2.1 Consider a building that operates from 8 a.m. to 10 p.m. The current
hourly kWh consumption can be computed, as shown in Table.
Peak demand savings
ϭ Peak cooling load (RT)
ϫ difference in air-cooled and water-cooled chiller efficiencies (kW/RT)
ϭ 300 ϫ (1.2 – 0.57)
ϭ 189 kW
Some of the above savings are offset by the extra electricity consumed by the
condenser water pumps and cooling towers of the water-cooled system and can be
computed based on their rated motor power for the application. Alternatively, the
34 Chapter Two
value can be estimated by using a “rule of thumb” value of 0.15 kW/RT for the con-
denser water pumps and cooling towers.
Similarly, the makeup water consumption can be estimated assuming the com-
bined losses due to evaporation, drift, and blow down to be 1.5 percent of the total
condenser water flow. In typical systems, which are designed for a temperature
difference of 5.6ЊC (10ЊF), between condenser water leaving and entering the
chiller, the condenser water flow is 0.19 L/s per RT (3 USgpm per RT). In such a
system, the makeup water consumption will be 2.8 ϫ 10
–3
L/s per RT (0.19 ϫ1.5%)
or 1.02 ϫ 10
–2
m
3
/hr per RT.
The extra cost for makeup water and electricity consumption for the condenser
water pumps and cooling towers can be computed for the same building’s cooling
load profile as shown in Table 2.2.
Therefore, the net kWh savings ϭ (2112 Ϫ 458) ϭ 1654 kWh/day.
Makeup water consumption ϭ 31.11 m
3
/day.
If the utility tariffs are:
Electricity usage ϭ $0.10/kWh
Peak demand ϭ $10/kW per month
Water usage ϭ $1/m
3
The net annual savings (based on operating 365 days a year)
ϭ [(1654 kWh/day ϫ electricity tariff) Ϫ (31.11 m
3
/day
ϫ water tariff)] ϫ days/year ϩ [189 kW
ϫ monthly demand charges ϫ 12 months/year]
ϭ [(1,654 ϫ 0.1) Ϫ (31.11 ϫ 1)] ϫ 365 ϩ [189 ϫ 10 ϫ 12]
ϭ $71,700
Air-Conditioning and Central Chiller Systems 35
TABLE 2.1 Estimation of Energy Savings for Conversion from an Air-Cooled Chiller
to a Water-Cooled Chiller
Present Present Proposed Proposed
Number Cooling chiller kWh chiller kWh
Hours of load efficiency consump- efficiency consump-
of hours (RT) (kW/RT) tion (kW/RT) tion
operation A B C A ϫ B ϫ C D A ϫ B ϫ D
0800–0900 1 200 1.3 260 0.6 120
0900–1000 1 200 1.3 260 0.6 120
1000–1100 1 225 1.3 293 0.59 133
1100–1200 1 225 1.3 293 0.59 133
1200–1300 1 250 1.25 313 0.58 145
1300–1400 1 300 1.2 360 0.57 171
1400–1500 1 250 1.25 313 0.58 145
1500–1600 1 250 1.25 313 0.58 145
1600–1700 1 250 1.25 313 0.58 145
1700–1800 1 200 1.3 260 0.6 120
1800–1900 1 200 1.3 260 0.6 120
1900–2000 1 200 1.3 260 0.6 120
2000–2100 1 150 1.4 210 0.62 93
2100–2200 1 150 1.4 210 0.62 93
3915 1803
2.3.2 Chiller efficiency and life-cycle cost
Water-cooled chillers having efficiencies of 0.9 kW/RT were common
in the 1970s. The efficiency of these chillers has improved over the last
30 years and the average chiller efficiency has now improved to about
0.55 kW/RT (efficiency of high-efficiency chillers can be better than
0.5 kW/RT).
Due to their design, high-efficiency chillers tend to be more expensive
than chillers of average efficiency. Although high-efficiency chillers cost
more, since they have a lower running cost (due to lower energy con-
sumption), the extra initial capital cost is usually paid back in a few
years.
The financial benefits of installing high-efficiency chillers instead of
“lower” efficiency chillers can be confirmed through a life-cycle analy-
sis that takes into account the initial capital cost of the chillers as well
as the operating cost over their expected life, which is usually 10 to
15 years. The operating cost, which needs to be accounted for in a com-
plete life-cycle costing, should include the main cost components such
as the energy cost, peak power demand cost (if applicable), refrigerant
cost, and maintenance cost. In addition, if the pressure drop across the
evaporators and condensers of different chiller options considered are
different, then the energy consumption of the chilled water and con-
denser water pumps to overcome the extra resistance also needs to be
considered (discussed in Chapter 4).
36 Chapter Two
TABLE 2.2 Extra Water Consumption for Water-Cooled Chillers
Consumption for Makeup
Hours Number Cooling pumps & cooling water
of of hours load (RT) towers (kWh) consumption (m
3
)
operation A B A ϫ B ϫ 0.15 kW/RT B ϫ (1.02 ϫ 10
Ϫ2
)
0800–0900 1 200 30 2.04
0900–1000 1 200 30 2.04
1000–1100 1 225 34 2.30
1100–1200 1 225 34 2.30
1200–1300 1 250 38 2.55
1300–1400 1 300 45 3.06
1400–1500 1 250 38 2.55
1500–1600 1 250 38 2.55
1600–1700 1 250 38 2.55
1700–1800 1 200 30 2.04
1800–1900 1 200 30 2.04
1900–2000 1 200 30 2.04
2000–2100 1 150 23 1.53
2100–2200 1 150 23 1.53
458 31.11
Examples 2.2 and 2.3 illustrate life-cycle cost comparison for a 500-RT
capacity chiller for three different efficiencies—0.5 kW/RT (high effi-
ciency), 0.55 kW/RT (average efficiency) and 0.65 kW/RT (low efficiency).
For simplicity, only the first cost and operating energy costs of the chiller
are considered in the examples.
Example 2.2 (Chiller loading and efficiency are fixed) In this example, the life-cycle
cost for chillers with three different rated efficiencies of 0.5, 0.55 and 0.65 kW/RT
are estimated assuming that the chillers operate 10 hours a day and 250 days a
year.
The chiller loading (500 RT) and chiller efficiency are assumed to be fixed. If
the electricity cost is $0.10/kWh and the electricity cost is expected to escalate by
2 percent a year, the annual energy cost for operating the chiller can be computed
as follows:
Energy cost ϭ Cooling load ϫ hours of operation ϫ efficiency (kW/RT)
ϫ electricity tariff. will be $63,750
($62,500 ϫ 1.02).
Similarly, the annual energy cost for operating each of the three chillers can be
computed.
The life-cycle cost computed for the three chiller combinations based on the
following first cost is given in Table 2.3.
■
$300,000 for 0.5 kW/RT chiller
■
$275,000 for 0.55 kW/RT chiller
■
$250,000 for 0.65 kW/RT chiller
(All costs are annual energy costs except for Year 0, which includes the capital
cost of the chillers.)
This simple life-cycle costing shows that the first option of using a 0.5 kW/RT
high-efficiency chiller has the lowest total cost over a 10-year period, and is there-
fore the best option of the three.
Example 2.3 (Variable chiller loading) Normally, the loading of chillers vary with
time due to changes in the cooling load. Although, the energy cost for chillers can
be computed using the same equation as in Example 2.2, since the chiller load-
ing is not constant, the efficiency of the chillers cannot be taken as a fixed value.
Therefore, the chiller energy consumption has to be computed at different loads
and then summed up to give the total consumption. The easiest way to do this is
by discretizing the cooling load into suitable intervals (1-hour intervals in this
example) and computing the consumption for each interval, which can be added
to give the total daily consumption.
Air-Conditioning and Central Chiller Systems 37
In this example, the cooling load is expected to vary, as shown in column A of
Table 2.4. The energy consumption for the three different chillers can be estimated
as shown in Tables 2.4 to 2.6.
(Efficiency values at different load conditions given in column B are assumed
for this chiller and the other two chillers, but can normally be obtained from
chiller manufacturers.)
If the building operates 250 days/year at the same load profile,
the annual electricity cost for the 0.5 kW/RT efficiency chiller
ϭ 2258.5 kWh/day ϫ 250 days/year ϫ $0.10/kWh
ϭ $56,463
38 Chapter Two
TABLE 2.3 Life-Cycle Cost for the Different Chillers (Assuming Their
Annual cost
TABLE 2.4 Energy Savings Estimation for Case with Variable Cooling Load
for 0.50 kW/RT Efficiency Chiller
Cooling Chiller Chiller efficiency kWh
load (RT) loading (kW/RT) consumption
Time A B C ϭ A ϫ B
0800–0900 350 70% 0.59 206.5
0900–1000 375 75% 0.58 217.5
1000–1100 400 80% 0.55 220
1100–1200 450 90% 0.52 234
1200–1300 500 100% 0.5 250
1300–1400 500 100% 0.5 250
1400–1500 450 90% 0.52 234
1500–1600 400 80% 0.55 220
1600–1700 400 80% 0.55 220
1700–1800 350 70% 0.59 206.5
Total 2258.5 kWh/day
If the load profile of the building varies on some days (Saturdays and Sundays),
the kWh consumption has to be computed separately for each typical pattern
experienced and then multiplied by the number of days in a year that this pat-
tern is expected to be experienced by the building.
The annual electricity cost for the 0.55 kW/RT efficiency chiller
ϭ 2467 kWh/day ϫ 250 days/year ϫ $0.10/kWh
ϭ $61,675
Air-Conditioning and Central Chiller Systems 39
TABLE 2.5 Energy Savings Estimation for Case with Variable Cooling Load
for 0.55 kW/RT Efficiency Chiller
Cooling Chiller Chiller efficiency kWh
load (RT) loading (kW/RT) consumption
Time A B1 C1 ϭ A ϫ B1
0800–0900 350 70% 0.64 224
0900–1000 375 75% 0.63 236
1000–1100 400 80% 0.6 240
1100–1200 450 90% 0.57 257
1200–1300 500 100% 0.55 275
1300–1400 500 100% 0.55 275
1400–1500 450 90% 0.57 257
1500–1600 400 80% 0.6 240
1600–1700 400 80% 0.6 240
1700–1800 350 70% 0.64 224
Total 2467 kWh/day
TABLE 2.6 Energy Savings Estimation for Case with Variable Cooling Load
for 0.65 kW/RT Efficiency Chiller
Cooling Chiller Chiller efficiency kWh
load (RT) loading (kW/RT) consumption
Time A B2 C2 ϭ A ϫ B2
0800–0900 350 70% 0.74 259
0900–1000 375 75% 0.73 274
1000–1100 400 80% 0.7 280
1100–1200 450 90% 0.67 302
1200–1300 500 100% 0.65 325
1300–1400 500 100% 0.65 325
1400–1500 450 90% 0.67 302
1500–1600 400 80% 0.7 280
1600–1700 400 80% 0.7 280
1700–1800 350 70% 0.74 259
Total 2885 kWh/day
The annual electricity cost for the 0.65 kW/RT efficiency chiller
ϭ 2885 kWh/day ϫ 250 days/year ϫ $0.10/kWh
ϭ $72,125
The life-cycle cost comparison for the three different chillers is given in
Table 2.7.
This example too shows that the 0.5 kW/RT chiller has a lower life-cycle cost.
Ideally, the cost for the peak power demand needs to be added. This will be the
power drawn by the chiller at the time when the building experiences peak power
demand. For instance, if the building experiences peak power demand between
1200 and 1300 hours, the power drawn by the three chiller options will be 250 kW
(500 RT ϫ 0.5 kW/RT), 275 kW (500 RT ϫ 0.55 kW/RT), and 325 kW (500 RT ϫ
0.65 kW/RT), respectively.
If the monthly demand charges are $10/kW, the monthly demand cost for the
three options will be $30,000 (250 kW ϫ$10/kW per month ϫ12 months), $33,000,
and $39,000, respectively. This additional cost then needs to be added to the pro-
jected annual energy cost for the different options.
If the maintenance costs for the different chillers being considered are appre-
ciably different as can be the case if different brands of chillers are considered,
the annual operating cost should be the sum of energy, power demand, and main-
tenance costs expected for each year of operation.
2.3.3 Sizing and configuration
As explained earlier, the operating efficiency of chillers depends on their
in Fig. 2.13. As can be seen from this figure, chiller efficiency is best
when operating in the range 60 to 100 percent of its capacity, while
optimum efficiency is obtained at 80 percent loading (some chillers oper-
ate best at 100 percent).
Chillers are usually oversized for new building installations due to the
unavailability of accurate load estimation tools, leading to the use of high
safety factors in the design. This over sizing repeats even when the sys-
tems are retrofitted since replacement of chillers is often done on a one-
to-one basis. Also, chillers are normally sized to meet the peak load
without much consideration of the load profile. Since the cooling load of
40 Chapter Two
TABLE 2.7 Life-Cycle Cost for Chillers Operating at Variable Load
0.5 kW/RT 0.55 kW/RT 0.65 kW/RT
Year 0 $300,000 $275,000 $250,000 (First cost)
Year 1 $56,463 $61,675 $72,125 (Electricity cost
Year 2 $57,592 $62,909 $73,568 increasing
Year 3 $58,744 $64,167 $75,039 at 2%
Year 4 $59,918 $65,450 $76,540 annually)
Year 5 $61,117 $66,759 $78,070
Year 6 $62,339 $68,094 $79,632
Year 7 $63,586 $69,456 $81,224
Year 8 $64,858 $70,845 $82,849
Year 9 $66,155 $72,262 $84,506
Year 10 $67,478 $73,707 $86,196
Total $918,249 $950,324 $1,039,749
a building varies with time, this can result in chillers operating at part
load for long periods of the day, wasting much energy.
Therefore, sizing and configuration of chillers for new buildings should
be done using accurate load estimation tools, while the measured cool-
ing load profile should be used when retrofitting existing buildings.
Chillers should be sized based on the peak cooling load and the cooling
load profile of the building. If chillers of different capacities are avail-
able, depending on the load profile, various combinations of chillers can
be operated during the day to match the building’s cooling load profile.
This would ensure that the chillers are able to operate within their best
efficiency range at all times.
Examples 2.4 and 2.5 illustrate the importance of chiller sizing and
configuration for a new chiller installation and a chiller plant retrofit,
respectively.
Example 2.4 (new chiller installation) Consider the building cooling load profile
shown in Fig. 2.14. The cooling load of the building varies from about 500 RT in
the night to a peak of 1800 RT during the afternoon. This building cooling load
profile can be satisfied by an infinite number of chiller combinations. If one chiller
is used, an 1800-RT capacity chiller would be required. However, this would lead
to very inefficient operation of the chiller during periods of low cooling load, (in
the night when the load is about 500 RT). If two equally sized chillers of 900 RT
each are used to meet the peak load of 1800 RT, it will also result in very poor effi-
ciency at night during part-load operation. A chiller combination that provides a
smaller capacity chiller to operate at night and higher capacity chillers to oper-
ate during the daytime would lead to better efficiency due to better matching of
chiller capacity to load.
Since performance data for chillers can normally be obtained from chiller man-
ufacturers, if the building cooling load profile and operating hours are known, the
expected energy consumption of a chiller can be computed.
Air-Conditioning and Central Chiller Systems 41
0.54
0.55
0.56
0.57
0.58
0.59
0.6
0.61
0.62
0.63
0 100 200 300 400 500 600
Cooling load (RT)
E
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Figure 2.13 Typical chiller part-load curve.
Consider the part-load performance data for an 1800-RT chiller given in Table 2.8
(assumed for illustration purposes).
For the cooling load profile given in Fig. 2.14, the daily chiller energy con-
sumption can be estimated, as shown in Table 2.9, using the following equation,
kWh consumption ϭ cooling load in RT ϫ hours of operation
ϫ efficiency (kW/RT) of chiller.
Similarly, the energy consumption for two other combinations using chillers of
1000-, 650-, and 500-RT capacity (part-load data given in Table 2.10) to meet the
same building cooling load can be computed as shown in Tables 2.11 and 2.12.
The energy consumption for the three different chiller combinations is sum-
marized in Table 2.13.
42 Chapter Two
0
200
400
600
800
1000
1200
1400
1600
1800
2000
2
4
0
0
Time
C
o
o
l
i
n
g
l
o
a
d
(
R
T
)
Figure 2.14 Cooling load profile for a day in a building.
TABLE 2.8 Part-Load Performance Data for a 1800-RT Capacity Chiller
Percent loading Cooling capacity (RT) Efficiency (kW/RT)
100 1800 0.58
90 1620 0.57
80 1440 0.57
70 1260 0.57
60 1080 0.58
50 900 0.60
40 720 0.64
30 540 0.71
20 360 0.91
The above example shows that the energy consumption for the dif-
ferent options vary from one to another and that sizing and configura-
tion of chillers has a significant effect on the cooling-energy consumption.
This emphasizes the importance of accurately estimating the expected
Air-Conditioning and Central Chiller Systems 43
TABLE 2.9 Estimated Hourly Energy Consumption for an 1800-RT Chiller
Available Hourly power
Load capacity Loading Efficiency consumption
Time (RT) (RT) (%) (kW/RT) (kW)
0100 480 1800 27% 0.80 384
0200 480 1800 27% 0.80 384
0300 450 1800 25% 0.80 360
0400 460 1800 26% 0.80 368
0500 470 1800 26% 0.80 376
0600 480 1800 27% 0.80 384
0700 700 1800 39% 0.64 448
0800 750 1800 42% 0.64 480
0900 984 1800 55% 0.59 581
1000 1200 1800 67% 0.57 689
1100 1400 1800 78% 0.57 798
1200 1700 1800 94% 0.58 978
1300 1800 1800 100% 0.58 1044
1400 1750 1800 97% 0.58 1015
1500 1700 1800 94% 0.58 978
1600 1650 1800 92% 0.57 941
1700 1600 1800 89% 0.57 912
1800 1500 1800 83% 0.57 855
1900 1400 1800 78% 0.57 798
2000 1200 1800 67% 0.57 689
2100 1000 1800 56% 0.59 590
2200 800 1800 44% 0.62 496
2300 700 1800 39% 0.64 448
2400 600 1800 33% 0.69 414
Total 15,408 kWh/day
TABLE 2.10 Part-Load Performance Data for 500-, 650-, and 1000-RT Capacity
Chillers.
Efficiency (kW/RT) Efficiency (kW/RT) Efficiency (kW/RT)
Percent loading 500-RT chiller 650-RT chiller 1000-RT chiller
100 0.60 0.59 0.59
90 0.60 0.59 0.58
80 0.60 0.59 0.58
70 0.61 0.60 0.59
60 0.62 0.61 0.60
50 0.65 0.63 0.63
40 0.71 0.68 0.68
30 0.79 0.75 0.75
20 0.98 0.95 0.90
cooling load profile for a building and then selecting the most suitable
combination of chillers. When selecting the best combination of chillers,
one should also keep in mind that although one combination may have
a lower energy consumption, it may have a higher associated capital cost.
Therefore, it is advisable to use a life-cycle cost comparison to identify
the most economical solution.
The next example illustrates how chiller sizing and configuration can
be used to improve the efficiency of chillers in an existing building.
The improvement in chiller efficiency possible due to correct sizing and
configuration of chillers is the same whether it is a new building instal-
lation or an existing one. However, better results can normally be
achieved when retrofitting an existing chiller system since the actual
building cooling load profile can be measured accurately as opposed to
having to use simulation tools to predict the cooling load profile for a new
building.
44 Chapter Two
TABLE 2.11 Estimated Energy Consumption for Chiller Combination of Two
1000-RT Chillers
Available Hourly power
Load capacity Loading Efficiency consumption
Time (RT) (RT) (%) (kW/RT) (kW)
0100 480 1000 48% 0.64 307
0200 480 1000 48% 0.64 307
0300 450 1000 45% 0.66 297
0400 460 1000 46% 0.65 299
0500 470 1000 47% 0.65 306
0600 480 1000 48% 0.64 307
0700 700 1000 70% 0.59 413
0800 750 1000 75% 0.59 443
0900 984 1000 98% 0.59 581
1000 1200 2000 60% 0.60 720
1100 1400 2000 70% 0.59 826
1200 1700 2000 85% 0.58 986
1300 1800 2000 90% 0.58 1044
1400 1750 2000 88% 0.58 1015
1500 1700 2000 85% 0.58 978
1600 1650 2000 83% 0.58 957
1700 1600 2000 80% 0.58 928
1800 1500 2000 75% 0.59 885
1900 1400 2000 70% 0.59 826
2000 1200 2000 60% 0.60 720
2100 1000 1000 100% 0.59 590
2200 800 1000 80% 0.58 464
2300 700 1000 70% 0.59 413
2400 600 1000 60% 0.60 360
Total 14,971 kWh/day
Air-Conditioning and Central Chiller Systems 45
TABLE 2.12 Estimated Energy Consumption for the Combination of Two 650-RT
and one 500-RT Chillers
Available Average Hourly power
Load capacity Loading efficiency consumption
Time (RT) (RT) (%) (kW/RT) (kW)
0100 480 500 96% 0.60 288
0200 480 500 96% 0.60 288
0300 450 500 90% 0.60 270
0400 460 500 92% 0.60 276
0500 470 500 94% 0.60 282
0600 480 500 96% 0.60 288
0700 700 1150 61% 0.62 434
0800 750 1150 65% 0.61 458
0900 984 1150 86% 0.60 590
1000 1200 1300 92% 0.59 708
1100 1400 1800 78% 0.60 840
1200 1700 1800 94% 0.60 1020
1300 1800 1800 100% 0.60 1080
1400 1750 1800 97% 0.59 1033
1500 1700 1800 94% 0.60 1020
1600 1650 1800 92% 0.59 974
1700 1600 1800 89% 0.59 944
1800 1500 1800 83% 0.60 900
1900 1400 1800 78% 0.60 840
2000 1200 1300 92% 0.59 708
2100 1000 1150 87% 0.60 600
2200 800 1150 70% 0.61 488
2300 700 1150 61% 0.62 434
2400 600 650 92% 0.59 354
Total 15,116 kWh/day
TABLE 2.13 Annual Energy Consumption for the Three Different
Chiller Combinations
Daily kWh Annual kWh
Chiller combination consumption consumption
1 ϫ 1800 RT 15,408 5,623,920
2 ϫ 1000 RT 14,971 5,464,415
1 ϫ 500 RT ϩ 2 ϫ 650 RT 15,116 5,517,340
Example 2.5 (retrofit) Consider a building that operates daily from 7 a.m. to 10
p.m., where two chillers are operated from 11 a.m. to 9 p.m. and only one chiller
at other times. The capacity of the chillers is rated at 550 RT each.
The building cooling load profile is given in Fig. 2.15, while the chiller part-load
efficiency data for the existing chillers are given in Table 2.14.
Since the chillers normally operate at 375 RT each (750-RT combined load
shared by two chillers) during most of the day, the resulting operating efficiency
is about 0.8 kW/RT, which is a drop of 14 percent compared to the full-load effi-
ciency of the chiller. This indicates that the chillers are significantly oversized for
the application. Since the chillers are rated at 550 RT, they each operate at less
than 70 percent of their original capacity at the peak load of 750 RT.
This chiller system can be retrofitted to improve the efficiency by replacing the
chillers with new machines sized to match the building’s cooling load profile.
Based on the measured peak load of 750 RT for the building, the maximum
chiller operating capacity required during the warmer periods of the year is esti-
mated to be not more than 900 RT (extra 20 percent capacity). Since the off-peak
cooling load is about 450 RT for the building, a suitable capacity for the new
chillers would be 450 RT each, where two machines can be operated to meet
peak load while only one is operated at other times. This will ensure that the
chillers operate at their most efficient operating range of 80 to 100 percent of their
rated capacity.
Using the part-load efficiency of the proposed new chillers (typical data given
in Table 2.15), the expected savings can be estimated as shown in Table 2.16.
46 Chapter Two
TABLE 2.14 Part-Load Efficiency Data for the Existing Chillers
Chiller load (RT) Loading (%) Efficiency (kW/RT)
550 100% 0.70
495 90% 0.72
440 80% 0.78
385 70% 0.80
330 60% 0.85
275 50% 0.88
220 40% 0.90
0.00
100.00
200.00
300.00
400.00
500.00
600.00
700.00
800.00
6:00 AM 8:24 AM 10:48 AM 1:12 PM 3:36 PM 6:00 PM 8:24 PM 10:48 PM
Time
C
o
o
l
i
n
g
l
o
a
d
(
R
T
)
Figure 2.15 Building load profile.
kWh savings ϭ (7419 Ϫ 5268) kWh/day
ϭ 2151 ϫ 365 kWh/year
ϭ 785,115 kWh/year.
If the average electricity tariff is $0.10/kWh, kWh savings
ϭ 785,115 kWh/year ϫ $0.10 /kWh
ϭ $78,512 per year
kW peak demand savings, if applicable, is calculated as follows:
Present maximum power demand at peak cooling load
ϭ 735 RT ϫ 0.8 kW/RT ϭ 588 kW
Maximum power demand with new chillers
ϭ 735 RT ϫ 0.57 kW/RT ϭ 419 kW
Air-Conditioning and Central Chiller Systems 47
TABLE 2.15 Typical Part-Load Data for the New Chillers
Chiller load (RT) Loading (%) Efficiency (kW/RT)
450 100% 0.54
405 90% 0.55
360 80% 0.57
315 70% 0.59
270 60% 0.61
225 50% 0.65
180 40% 0.69
TABLE 2.16 Estimated Energy Savings with New Chiller
Present Proposed
Daily Cooling chiller Present chiller Proposed
operating Hours/ load efficiency consumption efficiency consumption
hours day (RT) (kW/RT) (kWh/day) (kW/RT) (kWh/day)
0700–0800 1 375 0.8 300 0.56 210
0800–0900 1 375 0.8 300 0.56 210
0900–1000 1 375 0.8 300 0.56 210
1000–1100 1 375 0.8 300 0.56 210
1100–1200 1 735 0.8 588 0.57 419
1200–1300 1 735 0.8 588 0.57 419
1300–1400 1 735 0.8 588 0.57 419
1400–1500 1 735 0.8 588 0.57 419
1500–1600 1 735 0.8 588 0.57 419
1600–1700 1 735 0.8 588 0.57 419
1700–1800 1 735 0.8 588 0.57 419
1800–1900 1 735 0.8 588 0.57 419
1900–2000 1 735 0.8 588 0.57 419
2000–2100 1 735 0.8 588 0.57 419
2100–2200 1 440 0.77 339 0.54 238
Total 15 7419 5268
Peak demand savings
ϭ (588 Ϫ 419) kW/month
ϭ 169 kW/month
If peak demand is charged monthly at $10/kW, Peak demand savings
ϭ 169 kW/month ϫ $10 ϫ 12 months
ϭ $20,280/year
Therefore, total annual savings
ϭ $78,512 ϩ $20,280
ϭ $98,792
2.3.4 Consolidation of chiller plant
Some facilities have more than one chiller plant or have stand-alone
direct-expansion (DX) systems serving some areas while a central chiller
plant serves the other areas. Such stand-alone systems and multiple
chiller plants tend to be less efficient than a single central chiller plant.
Therefore, in facilities that have more than one chiller plant or those
with stand-alone systems serving specific areas of a building, they can
be consolidated into one central chiller plant to improve the overall
energy efficiency of the cooling system.
One of the main reasons for better energy efficiency of central cooling
plants is the use of higher capacity chillers as compared to the use of small
chillers in the case of multiple plants. Higher capacity chillers used in cen-
tral plants usually have a higher rated efficiency than smaller chillers and
therefore result in better operating efficiency. Further, for central plants,
load diversity and the availability of multiple chillers leads to better match-
ing of chiller capacity to cooling load, resulting in increased efficiency.
Applications for such consolidation of plants include building com-
plexes that have an office tower and a retail podium served by two dif-
ferent chiller plants, and buildings, such as hotels, that have a number
of blocks, each served by its own chiller plant. The savings that can be
achieved by such chiller plant consolidation is illustrated in Example 2.6.
Example 2.6 Consider the following example of a building facility having one
chiller plant serving the office tower while another chiller plant serves the podium
retail block.
The chiller plant serving the office block has three 500-RT capacity chillers and
operates from 8 a.m. to 10 p.m. Out of the three chillers; only two are operated at
peak load, leaving the third machine on standby.
As shown in Table 2.17, the load for the office tower ranges between 500 and
650 RT during the daytime and drops to 150 RT in the evening. This kind of cool-
ing load profile, where the evening cooling load is very much less than the day-
time load, is common and is due to reduced heat gain through the building
envelope and reduced occupancy during late evenings. The chiller loading (cool-
ing load divided by the operating chiller capacity) varies from 55 to 100 percent
during daytime to 30 percent during late evenings. The low chiller loading in the
48 Chapter Two
evenings is because a 500-RT capacity chiller has to be operated to satisfy a load
of 150 RT. As a result, the chiller efficiency drops significantly during this period.
Similarly, the chiller plant serving the retail podium block has two 400-RT
capacity chillers and operate from 10 a.m. to 10 p.m. Out of the two chillers, only
one is operated, leaving the second machine on standby.
As shown in the Table 2.18, the load for the podium block ranges between 300 and
350 RT during the daytime and drops to 200 RT in the evening. The chiller loading
varies from 75 to 88 percent during daytime and 50 percent during late evenings.
The low chiller loading in the evenings is because a 400-RT capacity chiller has to
Air-Conditioning and Central Chiller Systems 49
TABLE 2.17 Energy Consumption for an Office Tower Chiller Plant
Hours of Number of Cooling Chiller Chiller Present kWh
of hours load (RT) loading efficiency (kW/RT) consumption
operation A B C A ϫ B ϫ C
0800–0900 1 500 100% 0.57 285
0900–1000 1 500 100% 0.57 285
1000–1100 1 550 55% 0.74 407
1100–1200 1 600 60% 0.7 420
1200–1300 1 650 65% 0.72 468
1300–1400 1 600 60% 0.7 420
1400–1500 1 600 60% 0.7 420
1500–1600 1 550 55% 0.74 407
1600–1700 1 500 100% 0.57 285
1700–1800 1 500 100% 0.57 285
1800–1900 1 350 70% 0.68 238
1900–2000 1 150 30% 0.95 142.5
2000–2100 1 150 30% 0.95 142.5
2100–2200 1 150 30% 0.95 142.5
Total 4347.5
TABLE 2.18 Energy Consumption for a Chiller Plant Serving a Retail Podium
Chiller
Hours Number Cooling Chiller efficiency Present kWh
of of hours load (RT) loading (kW/RT) consumption
operation A B C A ϫ B ϫ C
1000–1100 1 300 75% 0.7 210
1100–1200 1 325 81% 0.7 228
1200–1300 1 350 88% 0.68 238
1300–1400 1 350 88% 0.68 238
1400–1500 1 325 81% 0.7 228
1500–1600 1 325 81% 0.7 228
1600–1700 1 325 81% 0.7 228
1700–1800 1 300 75% 0.7 210
1800–1900 1 300 75% 0.7 210
1900–2000 1 300 75% 0.7 210
2000–2100 1 200 50% 0.95 190
2100–2200 1 200 50% 0.95 190
Total 2606
be operated to satisfy a load of 200 RT. As a result, the chiller efficiency drops sig-
nificantly during this period (chiller efficiencies used are based on typical data).
To satisfy the requirements of both the office tower and the retail podium, the
central plant can be a new plant with new chillers selected to match the combined
cooling load or one of the existing plants converted to serve as the central plant.
If an existing chiller plant is converted to the central plant, the existing chillers
can be used with or without additional chillers, depending on the combined cool-
ing load.. The analysis for this scenario is
given in Table 2.19.
Since this plant has three 500-RT chillers, only two machines need to be oper-
ated during daytime to meet the expected combined cooling load. Due to the load
diversity of the two blocks, the chillers would be better loaded during most times
of the day, leading to better chiller efficiency. The best improvement in efficiency
would be achieved in the late evenings when only one 500-RT chiller has to be oper-
ated to satisfy the combined load of 350 RT as compared to the need for operat-
ing two chillers previously.
The savings in this case is the difference between the kWh consumption for the
two separate plants and the central combined plant.
Therefore, savings
ϭ [(4347.5 ϩ 2606) Ϫ 5772]
ϭ 1181.5 kWh/day
ϭ 431,248 kWh/year.
50 Chapter Two
TABLE 2.19 Energy Consumption for Proposed Combined Chiller Plant
Combined Average Average chiller Proposed
Hours Number cooling chiller efficiency kWh
of of hours load (RT) loading (kW/RT) consumption
operation A B C A ϫ B ϫ C
0800–0900 1 500 100% 0.57 285
0900–1000 1 500 100% 0.57 285
1000–1100 1 850 85% 0.55 468
1100–1200 1 925 93% 0.56 518
1200–1300 1 1000 100% 0.57 570
1300–1400 1 950 95% 0.57 542
1400–1500 1 925 93% 0.56 518
1500–1600 1 875 88% 0.55 481
1600–1700 1 825 83% 0.55 454
1700–1800 1 800 80% 0.57 456
1800–1900 1 650 65% 0.72 468
1900–2000 1 450 90% 0.56 252
2000–2100 1 350 70% 0.68 238
2100–2200 1 350 70% 0.68 238
Total 5772
In this particular example, the cost that needs to be incurred to
achieve this saving would be to modify the chilled water piping and
pumping systems to enable the office tower plant to serve the podium
block. This makes it financially attractive when compared to con-
structing a new central plant with new chillers.
The decision whether to use one of the existing plants with or without
the existing chillers as compared to constructing a new plant depends
on factors such as whether the existing chillers can satisfy the combined
load, or if additional chillers are required, whether they can be installed
in the existing plant room, and the efficiency of the existing chillers.
Usually, if the chillers are old and inefficient, it would be better to replace
them with new machines suitably sized to satisfy the combined load.
2.3.5 Chiller sequencing
As explained earlier, the operating efficiency of chillers depends on their
in Fig. 2.13. As can be seen from this figure, the chiller efficiency is best
when operating in the range 60 to 100 percent of its capacity, while
optimum efficiency is at 80 percent loading (some chillers operate best
at 100 percent).
It was also explained earlier that it is important to have the right com-
bination of chillers so that the operating chiller capacity can be matched
to the varying building cooling load to ensure that the chillers are always
able to operate within the best efficiency range. However, to achieve this
objective, it is not sufficient to just have the correct combination of
chillers. It is also necessary to have a control system to ensure that the
matching of chiller capacity to load can be done continuously.
This is normally achieved through chiller sequencing, which enables
operation of the most efficient combination of chillers to meet the vary-
ing building load. Achiller sequencing programme will start an additional
chiller when the building load exceeds the capacity of the running
chillers and stop a chiller when the remaining chillers can handle the
building load.
If chiller operations are optimized based only on chiller efficiency, the
optimal point for adding or removing chillers may occur when the
chillers are not fully loaded since maximum chiller efficiency usually
occurs at part load (Fig. 2.13). For example, theoretically it may be
better to operate two chillers at part load rather than one big chiller at
100 percent capacity. However, this strategy ignores the need for addi-
tional chilled water pumps, condenser water pumps, and cooling towers
when the additional chiller is operated. Therefore, optimizing should be
carried out based on the total power consumption of the chiller system
(chillers, pumps, and cooling towers), as shown in Fig. 2.16.
Air-Conditioning and Central Chiller Systems 51
Normally for systems where chillers have dedicated pumps and cool-
ing towers, the operating chillers should be fully loaded before starting
an additional chiller because the power required for operating the pumps
and cooling towers for the additional chiller is greater than the saving
in chiller power when operating it at optimum part-load conditions.
However, for systems that do not have dedicated pumps (systems
with variable speed primary pumps or multiple primary pumps on a
common header), the optimal load condition for bringing chillers online
or offline may not occur at chiller full load. In such a case, the optimal
chiller switching point will depend on the combined chiller, pumping,
and cooling tower power consumption.
In most buildings, the relationship between cooling load and the chilled
water flow required to meet that load are not linear. Therefore, often
chillers need to be sequenced to satisfy both building cooling load and
chilled water flow requirements. The actual relationship between chilled
water flow and the capacity of typical constant air volume (CAV) AHU
cooling coils is shown in Fig. 2.17. As the figure shows, the relationship
between flow and capacity is logarithmic and also changes with chilled
water temperature. Further, other system operating conditions, such as
unequal loading of AHUs or low ⌬T (low temperature difference between
chilled water return and supply), can cause the relationship between flow
and capacity in a chilled water system to be non-linear. Figure 2.18
shows the ideal linear relationship with possible extremes for the chilled
water flow and capacity relationships for typical chilled water systems.
As Fig. 2.18 shows, generally for the lower curve, a higher percent-
age of flow is required to satisfy a particular load (e.g. 80 percent flow
52 Chapter Two
0.5
0.55
0.6
0.65
0.7
0.75
0.8
0.85
0.9
0.95
1
0 200 400 600 800 1000
Cooling load (RT)
S
y
s
t
e
m
e
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Change over point
Chillers + pumps + cooling towers
Figure 2.16 Typical system efficiency curves for different chiller operating scenarios.
to satisfy 50 percent capacity). Therefore, if this particular installation
has two equal sized chillers, each sized to meet 50 percent of the total
load, the second chiller has to be switched on when the building load
exceeds about 25 percent of the total because at this point, more than
50 percent flow (maximum flow for one set of chiller and pump) is
required to satisfy the load. In such situations, an additional chilled
water pump (and therefore an additional chiller) needs to be turned on
to satisfy flow requirements although the operating chiller has not been
fully loaded.
Air-Conditioning and Central Chiller Systems 53
0
10
20
30
40
50
60
70
80
90
100
0 20 40 60 80 100
% Design flow
Increase in chilled
water setpoint
%
D
e
s
i
g
n
c
a
p
a
c
i
t
y
Figure 2.17 Typical cooling coil characteristic for a constant air volume AHU
0
10
20
30
40
50
60
70
80
90
100
0 10 20 30 40 50 60 70 80 90 100
Chilled water flow (%)
C
a
p
a
c
i
t
y
(
%
)
Ideal (linear)
Extremes
Figure 2.18 Possible relationships between chilled water flow and capacity.
Another important operating parameter to be considered in chiller
sequencing is chiller motor loading. The motor of the chiller compres-
sor is sized to meet the requirements of the compressor when it is fully
loaded. However, the actual current drawn by the compressor motor at
a particular cooling load also depends on the chilled water and con-
denser water temperatures. If for instance, the chilled water supply
temperature is set higher during off-peak cooling periods or if the con-
denser water supply temperature is lower due to favorable weather con-
ditions, the current drawn by the motor at a particular load will be less
since the compressor has to work against a lower pressure differential
(explained later). Therefore, when a chiller reaches its maximum design
capacity, the motor may not be loaded to 100 percent of the design value
and as a result the chiller can be loaded further until the motor reaches
its maximum capacity, resulting in the chiller providing a higher capac-
ity than rated. If, in such an instance, the chillers are sequenced only
based on cooling load, an additional chiller will be turned on before the
running chiller is loaded fully.
Therefore, it can be seen that it is not sufficient just to sequence
chillers based on the cooling load since other parameters such as chilled
water flow requirements and motor loading need to be considered. Afew
typical chiller sequencing strategies of different complexities are illus-
trated next.
Typical chiller sequencing strategies
a. Simple control strategy using chilled water temperature to sequence
chillers. In the system shown in Fig. 2.19, an additional chiller is turned
on, when the temperature of chilled water leaving the chillers T
1
, T
2,
or
T
3
is greater than the set point (chiller/s in operation cannot satisfy load).
Similarly, if two chillers are in operation and they are of equal
capacity, an operating chiller is switched-off if chiller ⌬T/design ⌬T
54 Chapter Two
1 2 3 Chillers
Pumps
By-pass
pipe
Cooling
coils
Control
valves
T
4
T
3
T
2
T
1
Figure 2.19 Chiller sequencing using chilled water temperature.
is less than 0.5 (cooling load is less than half and can be satisfied by
one chiller) and chilled water leaving temperature is not greater
than set point. The chiller ⌬T and design ⌬T are the temperature dif-
ferences between chilled water return and chilled water supply under
operating conditions and design conditions, respectively.
This is a simple but crude way of sequencing chillers. Since param-
eters such as chilled water flow, cooling load and motor loading are
not measured, chiller operations cannot be optimized.
b. Commonly applied control strategy using cooling load and chilled
water temperature (Fig. 2.20).
In this system, the cooling load is calculated using the tempera-
ture difference for chilled water (T
2
– T
1
) and the chilled water flow
rate. An additional chiller is turned-on when the temperature of
chilled water leaving the chiller T
1
is greater than set point (chiller/s
in operation cannot satisfy load) or if the cooling load is equal to the
capacity of operating chillers.
An operating chiller is switched off if the cooling load is less than
the capacity of operating chillers, less the capacity of one chiller, and
T
1
is not greater than set point.
This is a better way of sequencing chillers since chillers are operated
based on the cooling load. However, as pointed out earlier, chillers can
provide more than the design capacity in some off-design operating
conditions, such as lower condenser water supply temperature or higher
chilled water temperature. Therefore, in such an instance, an addi-
tional chiller will be switched-on before the operating chillers are fully
loaded. The next strategy is designed to overcome this shortcoming.
c. Recommended strategy for chiller sequencing in systems with only
primary pumping. This strategy uses cooling load, chilled water tem-
perature, and chiller motor loading to sequence chillers (Fig. 2.21).
Air-Conditioning and Central Chiller Systems 55
T
2
T
1
1 2 3 Chillers
Pumps
By-pass
pipe
Cooling
coils
Control
valves Flow meter
Figure 2.20 Chiller sequencing using cooling load and chilled water temperature.
An additional chiller is turned on when the temperature of chilled
water leaving the chiller T
1
is greater than set point (chiller/s in
operation cannot satisfy load) or if the cooling load is equal to the
capacity of the operating chiller and the current drawn by the chiller
motor is equal or greater than the rated full load current of the motor
(fully loaded motor).
An operating chiller will be switched off if the cooling load is less
than the capacity of operating chillers, less the capacity of one chiller,
and T
1
is not greater than set point.
This method of sequencing chillers takes into consideration the
loading of chiller motors, which helps ensure that chillers are fully
loaded at off-design operating conditions, such as at lower condenser
water supply temperature and higher chilled water temperature,
when chillers are able to provide higher than the rated capacity.
d. Simple sequencing strategy for primary-secondary pumping sys-
tems. Primary-secondary pumping systems consist of two chilled
water pumping loops, a primary loop, which pumps chilled water
through the chillers, and a secondary loop, which pumps chilled
water to the terminal units such as AHUs and FCUs. These two loops
are hydraulically decoupled from each other (explained in detail in
Chapter 4).
As shown in Fig. 2.22, the simplest strategy is to use a bidirectional
flow meter on the decoupler pipe to indicate whether the chilled
water flow in the decoupler pipe is from the supply side to the return
side or in reverse, from the return side to supply side. If the flow is
from the return side to the supply side, it indicates that the chilled
water flow in the secondary loop is higher than that in the primary
loop and therefore an additional primary pump (and a chiller) needs
56 Chapter Two
T
2
T
1
1 2 3 Chillers
Pumps
By-pass
pipe
Cooling
coils
Control
valves Flow meter
Amps Amps Amps
Figure 2.21 Chiller sequencing using cooling load, chilled water temperature and motor
to be turned-on. Similarly, if the temperature of the chilled water
leaving the chillers (T
1
, T
2
, or T
3
) is greater than set point, it indicates
that the chillers in operation are unable to meet the cooling load and
an additional chiller needs to be operated.
If the flow in the decoupler is from supply side to return side and
the flow is greater than 110 percent of the flow of one chiller, it indi-
cates that if one chiller is switched off, the chilled water flow require-
ments can still be met. Simultaneously, the temperature difference
between return and supply chilled water is compared with the design
⌬T (like in the earlier example for primary only systems) to ensure
that if one chiller is switched off, the resulting ⌬T will not exceed the
design value. For example, when two equal capacity chillers are in
operation, if the value of the chilled water ⌬T/design ⌬T is less than
0.5, the cooling load can be satisfied by only one chiller.
One of the shortcomings of this system is that it does not sequence
chillers based on actual cooling load or loading of chillers, but is
based on indirect measurements. Abetter control strategy is described
e. Recommended strategy for chiller sequencing in systems with pri-
mary-secondary pumping. It is recommended that two flow meters
be used to measure the chilled water flow; one on the primary chilled
water loop and the other on the secondary chilled water loop, as
shown in Fig. 2.23. The difference in readings between the two flow
meters will yield the flow rate and direction of chilled water flow in
the decoupler pipe.
This indirect measurement of decoupler flow is more accurate than
direct measurement using a flowmeter on the decoupler pipe, where
the flow can vary from zero to more than the design flow for one
chiller.
Air-Conditioning and Central Chiller Systems 57
1 2 3 Chillers
Pumps
Decoupler
pipe
Cooling
coils
Control
valves
T
4
T
3
T
2
T
1
Flow
meter
Secondary pumps
Figure 2.22 Chiller sequencing for primary-secondary systems using decoupler flow and
chilled water temperature.
In this system, an additional chiller is switched on if the chilled
water supply temperature (T
1
) is greater than set point (chillers
cannot satisfy cooling load) or if the chilled water flow in the primary
loop is less than the flow in the secondary loop (insufficient chilled
water flow).
Similarly, an operating chiller can be switched off if the flow in the
decoupler from the supply side to the return side is more than 110
percent of the design flow rate of one chiller and the cooling load
(measured using flowmeter and chilled water temperature differ-
ence) is less than the total capacity of the operating chillers less the
capacity of one.
2.3.6 Reset of chilled water temperature
Figure 2.24 shows the p-h diagram for an ideal vapor compression cycle.
“Work” is done in the cycle by the compressor to compress the refriger-
ant vapor from the evaporation pressure to the condensing pressure.
Therefore, if the evaporating pressure is increased or the condensing
pressure is reduced (explained later), the amount of work to be done by
the compressor reduces. This will result in an increase in COP or reduc-
tion in the kW/RT of the chiller. In general, it is estimated that improve-
ment in chiller efficiency of 1 to 2 percent can be achieved by increasing
the chilled water temperature by 0.6ЊC. Figure 2.25 shows the improve-
ment in efficiency due to chilled water reset for a typical chiller.
Chiller systems are generally designed for chilled water supply at
6.7ЊC (44ЊF) to meet the design peak cooling load. However, chillers
seldom have to operate under full-load conditions. Under such operating
58 Chapter Two
1 2 3 Chillers
Pumps
Decoupler
pipe
Cooling
coils
Control
valves
T
2
T
4
T
1
T
3
Secondary pumps
Flow
meter 1
Flow
meter 2
Figure 2.23 Chiller sequencing for primary-secondary systems using individual flow
meters and chilled water temperatures.
conditions, most of the time it would not be necessary to provide chilled
water at the design value and therefore the chilled water temperature
can be reset upwards.
One method of resetting the chilled water temperature is by moni-
toring the position of the control valves on the cooling coils. The valve
that is open the most can be used to reset the temperature and the
chilled water temperature can be reset upwards in steps until this con-
trol valve or any other reaches a preset value (eg. maximum 90 percent
open). Similarly, the chilled water temperature can be reset downwards
if any control valve opens beyond this set maximum value.
Air-Conditioning and Central Chiller Systems 59
Evaporator
Condenser
Expansion
device
Compressor
Enthalpy
P
r
e
s
s
u
r
e
Reduction in
pressure differential
due to increase in
evaporating pressure
Increase in chilled
water temperature
Figure 2.24 Pressure–enthalpy diagram showing effect of increasing
chilled water temperature.
0.5
0.52
0.54
0.56
0.58
0.6
0.62
0.64
0 100 200 300 400 500 600
Cooling load (RT)
Increase in chilled
water temperature
E
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Figure 2.25 Typical relationship between chiller efficiency and chilled water tem-
perature.
Another method used for resetting the chilled water temperature is
based on the return chilled water temperature. When the return chilled
water temperature reduces (eg. from 12 to 10ЊC), the chilled water
supply temperature can be raised to bring the return temperature back
to the design value (12ЊC). This works on the assumption that the return
chilled water temperature drops if the cooling load drops, which will be
the case only if the chilled water flow is constant. Therefore, in variable
flow systems, where the flow reduces when the load drops, the return
temperature will not indicate load. Further, even if the system is a con-
stant flow one, if the loads are not homogeneous, the return tempera-
ture will be the average temperature of water returning from the
different loads and will only indicate the average load. This could lead
to situations wherein the chilled water temperature will be reset
upwards (because the mixed chilled water return temperature is low)
when some areas experience full load conditions and need chilled water
at the design temperature to satisfy the load.
The chilled water temperature can also be reset upwards based on the
cooling load or outdoor temperature. Since reduction in outdoor tempera-
ture leads to lower cooling load, the outdoor temperature or a direct meas-
urement of the load can be used to reset the chilled water temperature.
However, when the chilled water supply temperature is increased, the
chilled water flow would have to be increased to satisfy the same load for
CAV systems due to the performance characteristic of the coils (Fig. 2.17).
In variable flow chilled water pumping systems, when the chilled
water temperature is raised to improve chiller efficiency, the power con-
sumed by the chilled water pumps will increase due to the need for
more water flow to satisfy the same load. Therefore, when optimizing
savings from chilled water reset, the combined chiller and pumping
power should be considered to ensure that savings from the chiller
exceeds the extra energy consumption for chilled water pumping.
As Fig. 2.26 shows, chiller efficiency improves when chilled water
temperature is increased but results in a drop in chilled water pumping
60 Chapter Two
Chilled water supply temperature
Pumps
Chiller
Overall
(chiller + pumps)
Optimum
E
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Figure 2.26 Effect of chilled water temperature on chiller and pump
efficiency.
efficiency (more chilled water needs to be pumped to satisfy the same
load). The optimum operating point is when the overall efficiency (chiller
and pumps) is the highest. This optimum operating point will vary for
different installations as it depends on chiller and pump performance
characteristics.
Further, in variable air volume (VAV) air distribution systems,
increase in chilled water temperature leads to the need for higher supply
airflow from the AHUs to satisfy the cooling load. This too results in
higher AHU fan power consumption.
Based on research, at common AHU supply air temperatures of 11 to
13ЊC, the chilled water set point can be increased to about 8.5ЊC (47ЊF),
while maintaining the total system (chillers, pumps, and AHU fans)
power consumption within Ϯ1 percent of the optimum.
When resetting chilled water temperature, one should also bear in
mind that cooling coils of air-conditioning systems not only provide sen-
sible cooling but also remove moisture from the air in the air-conditioned
space and help to maintain the relative humidity. The moisture removal
ability of cooling coils depends on the chilled water supply temperature
since the air has to be cooled to its dew point temperature to condense
the moisture from the air. Therefore, raising the chilled water supply
temperature could lead to a reduction in the moisture removal ability
of the coils and higher relative humidity in conditioned spaces.
2.3.7 Reset of condenser water temperature
Similar to chilled water reset, the operating efficiency of chillers can
also be improved by reducing the condenser water temperature. The
improvement in chiller efficiency is due to the reduced pressure differ-
ential across which the compressor has to work when the condenser
water temperature is reduced (Fig 2.27). The savings from condenser
Air-Conditioning and Central Chiller Systems 61
Evaporator
Condenser
Expansion
device
Compressor
Enthalpy
P
r
e
s
s
u
r
eReduction in pressure
differential due to
decrease in
condensing pressure
Decrease in condenser
water temperature
Figure 2.27 Pressure–enthalpy diagram showing effect of condenser water
temperature.
water reset is similar to that for chilled water reset, and improvement
in chiller efficiency of 1 to 2 percent can be achieved by reducing the con-
denser water temperature by 0.6ЊC (1ЊF). Figure 2.28 shows the improve-
ment in efficiency possible due to condenser water reset for a typical
chiller.
Cooling towers are designed to cool condenser water to within a few
degrees of the wet-bulb temperature. This temperature difference
between condenser water supply temperature and wet-bulb temperature
is called the cooling tower approach. Therefore, when the wet-bulb tem-
perature of the outdoor air drops, cooling towers are able to provide
condenser water at a lower temperature, which helps to improve chiller
efficiency.
2.3.8 Maintaining surfaces of condenser tubes
The evaporator and condenser tubes of chillers provide the surface for
heat transfer between the refrigerant and chilled water or condenser
water, respectively. If there is scaling or fouling on the tube surfaces, the
resistance to heat transfer increases. This results in a higher tempera-
ture difference driving the heat transfer process, which leads to lower
chiller efficiency.
Condenser tubes are more prone to fouling since the circulating water
is open to the outside (at the cooling towers) and therefore need to be
cleaned regularly. Research has shown that 0.6 mm of scale will increase
the chiller compressor power consumption by 20 percent.
62 Chapter Two
0.5
0.52
0.54
0.56
0.58
0.6
0.62
0.64
200 250 300 350 400 450 500 550
Cooling load (RT)
C
h
i
l
l
e
r
e
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Increase in condenser
water temperature
Figure 2.28 Typical relationship between chiller efficiency and condenser water
temperature.
Scale and fouling in condensers is normally controlled by:
a. Water treatment systems to inhibit scaling and fouling
b. Blow down, where water is regularly drained from the bottom of the
cooling tower basin and topped up with clean water
c. Tube cleaning, where the insides of tubes are cleaned periodically by
brushing
The effectiveness of water treatment systems in controlling scaling
depends on the particular treatment programme employed. In chemi-
cal treatment programs the alkalinity of the water, which increases the
tendency for scaling, is controlled by increasing its acidity. However,
increase in acidity leads to increased corrosion and, therefore, chemi-
cal treatment programs are used more for controlling scaling than com-
pletely eliminating it.
Blow down and tube cleaning too are measures that are carried out
periodically, but cannot completely eliminate scaling and fouling. This
can result in chiller efficiency varying with time, as shown in Fig. 2.29.
When scale and fouling deposits collect on condenser tubes, the resist-
ance to heat transfer across the tubes from the condensing refrigerant
to the cooling water increases. This leads to an increase in the con-
densing temperature (and pressure) and causes the chiller efficiency to
drop since the compressor has to compress the refrigerant vapor to a
higher pressure. Over time, the thickness of the layer formed by scale
and fouling increases, resulting in a gradual drop in chiller efficiency.
Periodically, when tubes are cleaned by brushing, the efficiency returns
to the normal rated value. Thereafter, the efficiency gradually drops
again when scale and fouling builds up on tube surfaces. This results
in a kind of “saw tooth” pattern, where the length of the tooth denotes
the time interval between cleanings while the height of the tooth indi-
cates the maximum drop in chiller efficiency between cleanings.
Air-Conditioning and Central Chiller Systems 63
Time
Tubes cleaned
Change in chiller
efficiqency
C
h
i
l
l
e
r
e
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Figure 2.29 Variation of chiller efficiency due to scaling and fouling of con-
denser tubes.
To avoid this, automatic tube cleaning systems (with balls or brushes),
which clean the condenser tubes periodically during operation of the
chillers, can be used to maintain chiller efficiency.
Figure 2.30 shows a typical system using sponge balls for cleaning tubes.
These sponge balls have a slightly larger diameter than the inside bore of
the condenser tubes. The balls are circulated through the tubes at regu-
lar intervals. As the balls travel through the tubes, scale and fouling
deposits are removed. After passing through the tubes, the balls are col-
lected by a strainer. Thereafter, the balls are returned to the cleaning sec-
tion for automatic cleaning and are injected back again after a set time.
The financial viability of installing such an automatic tube cleaning
system depends on the drop in chiller efficiency before the tubes are
cleaned. Since chiller efficiency cannot be easily measured and since it
is even harder to detect a drop in chiller efficiency, the condenser water
“approach temperature” can be used as an indicator of scale and foul-
ing build up on condenser tubes. The condenser water approach tem-
perature is the difference between the condensing refrigerant temperature
and the temperature of the condenser water leaving the condenser.
Ahigh approach temperature usually indicates that tube cleaning is nec-
essary. Chiller condensers are normally designed for an approach of
about 1ЊC and therefore chillers that operate at approach temperatures
higher than this would be good candidates for the installation of auto-
matic cleaning systems. However, the actual savings that can be
achieved will depend on how much the approach temperature can be
reduced and the actual operating hours of the chiller.
64 Chapter Two
Condenser
water supply
Ball injector and
cleaning unit
Valve
Drain valve
Condenser
Ball return pipe
Balls Tubes
Strainer
Condenser
water return
Figure 2.30 Typical arrangement of an automatic condenser tube cleaning system.
2.3.9 Dedicated chillers for night operation
The cooling load of a building is dependent on the amount of heat gain
from internal and external sources. External heat gain is mainly due to
conduction of heat and transmission of solar radiation through the build-
ing facade, while internal heat gain is due to heat generated by the
building’s occupants, lighting, and other equipment.
The cooling load varies during the day mainly due to changes in exter-
nal factors such as outdoor temperature and intensity of solar radiation.
In addition, changes in internal factors such as occupancy also cause the
cooling load to vary.
As a result, buildings that operate 24 hours a day, like hotels or res-
idential apartments, experience much lower cooling loads during the
night as compared to the daytime. Therefore, a chiller or a combination
of chillers, which have been sized to meet the daytime cooling load of a
building, may be oversized for night load operation. This causes the
chillers to operate at lower efficiency since chiller efficiency depends on
their loading. This is illustrated further in Example 2.7.
Similar operating conditions that lead to inefficient operation of chillers
may also be experienced in buildings that do not operate 24 hours a day,
but operate during late evenings or weekends.
Example 2.7 Consider a case where the building’s cooling load varies as shown
in Fig. 2.31. The daytime cooling load varies from about 1000 to 1500 RT while the
night load is about 200 to 250 RT. This low night cooling load is experienced
daily from 10 p.m. to 8 a.m. During daytime, two to three chillers of 600 RT capacity
Air-Conditioning and Central Chiller Systems 65
0
200
400
600
800
1000
1200
1400
1600
12:00 AM 6:00 AM 12:00 PM 6:00 PM 12:00 AM
C
o
o
l
i
n
g
l
o
a
d
(
R
T
)
Figure 2.31 Typical daily cooling load profile of a building.
are operated, while only one chiller of 600-RT capacity is operated at night to meet
the building’s cooling load.
During daytime, when two to three chillers are operated to meet the cooling load of
1000 to 1500 RT, chillers are loaded to more than 70 percent of their capacity. Chiller
efficiency during daytime is therefore about 0.64 kW/RT (Table 2.20). However, at
night, when a 600-RT chiller has to operate to meet a load of 200 to 250 RT, it is loaded
to only about 30 to 40 percent of the capacity. This results in the chiller efficiency drop-
ping to below 1.0 kW/RT.
The solution, in this case, is to install an additional small chiller to act as the
night chiller. The new chiller capacity can be 250 RT to meet the night load of 200
to 250 RT. The efficiency of a 250-RT chiller at this operating load will be much
better and will help to improve the chiller efficiency at night from 1.2 kW/RT to
about 0.58 kW/RT.
The measure will result in a reduction in kWh consumption due to the
improved operating efficiency of the new chiller. However, it will not normally
result in the reduction of peak power demand since buildings usually experience
maximum power demand during daytime. An estimation of savings is illustrated
in Table 2.21.
66 Chapter Two
TABLE 2.20 Chiller Performance Data
100 600 0.64
90 540 0.63
80 480 0.63
70 420 0.65
60 360 0.68
50 300 0.73
40 240 1.0
30 180 1.2
TABLE 2.21 Estimated kWh Consumption Savings During Nighttime Chiller Plant
Operation
Present Proposed
Cooling chiller Present chiller Proposed
Hours/ load efficiency consumption efficiency consumption
day (RT) (kW/RT) (kWh/day) (kW/RT) (kWh/day)
Time A B C A ϫ B ϫ C D A ϫ B ϫ D
2200–2300 1 250 1.2 300 0.58 145
2300–2400 1 250 1.2 300 0.58 145
0000–0100 1 250 1.0 250 0.58 145
0100–0200 1 250 1.0 250 0.58 145
0200–0300 1 250 1.0 250 0.58 145
0300–0400 1 250 1.0 250 0.58 145
0400–0500 1 250 1.0 250 0.58 145
0500–0600 1 250 1.0 250 0.58 145
0600–0700 1 250 1.0 250 0.58 145
0700–0800 1 250 1.0 250 0.58 145
Total 10 2600 1450
Since the capacity of the new chiller is half the capacity of existing chillers, suit-
able chilled water and condenser water pumps would need to be installed to match
the capacity of the new chiller. Alternatively, variable speed drives can be installed
on the existing pumps to enable them to be operated at a lower speed to match
the needs of the new chiller. A similar strategy can also be used to enable opera-
tion of an existing cooling tower fan at lower speed to meet the requirements of
the new chiller.
kWh savings ϭ (2600 Ϫ 1450) kWh/day ϭ 1150 kWh/day
If the chiller plant operates 7 days a week
ϫ 52 weeks a year, kWh savings
ϭ 1,150 ϫ 7 ϫ 52 kWh/year ϭ 418,600 kWh/year
2.3.10 Use of absorption chillers
As explained earlier, absorption chillers need a heat source to operate.
Usually absorption chillers operate on low-pressure steam, hot water,
or are direct fired. Although such chillers are less efficient than those
working on the vapor compression cycle, if a waste heat source is avail-
able, it can be utilized to operate absorption chillers without incurring
any extra cost for fuel.
Waste heat from engine jacket water, engine or process exhaust gases,
and various industrial processes that generate heat are good sources of
heat that can be utilized to operate absorption chillers. The waste heat
sources can be either fed directly into the generator of the absorption
chiller or passed through a heat exchanger to recover useful heat. Atyp-
ical arrangement of an absorption chiller operating using waste heat is
shown in Fig. 2.32.
It should be noted that absorption chillers need higher cooling tower
capacity due to the need for higher heat dissipation, which include the
heat removed in the evaporator and that added in the generator. This
results in added electricity consumption for cooling tower fans and con-
denser water pumps when compared to conventional chillers.
Air-Conditioning and Central Chiller Systems 67
Waste heat
Heat recovery
unit
Chilled water
Absorption chiller
Hot water or
low pressure
steam
Exhaust
Figure 2.32 Arrangement of an absorption chiller with a heat-
recovery system.
The feasibility of utilizing an absorption chiller using waste heat,
instead of an electric chiller, is illustrated in Example 2.8.
Example 2.8 Consider the case of an industrial plant that has waste heat pro-
duced by a process system, which is currently released to the environment. If the
plant uses a 150-RT electric chiller to provide space and process cooling, the fea-
sibility of using an absorption chiller (using the waste heat) in place of the elec-
tric chiller can be assessed as follows:
The kW consumption for the two systems (excluding the chilled water pumps,
as the consumption will be the same for both options) is estimated as follows:
68 Chapter Two
kWh savings ϭ (155.5 kW Ϫ 32.5 kW) ϫ operating hours/year ϫ tariff
Peak demand savings (if applicable)
ϭ (155.5 kW Ϫ 32.5 kW)
ϫ monthly demand charges ϫ 12 months
The following assumptions can be used to compute the simple payback period
for the project:
Cost of the absorption chiller and heat exchanger ϭ $250,000
Electricity tariff ϭ $0.10/kWh
Peak demand charges ϭ $10/month
Operating hours ϭ 7000 h/year
kWh savings ϭ (155.5 kW Ϫ 32.5 kW) kWh ϫ 7000 hrs ϫ $0.10
ϭ $86,100 year
Peak demand savings ϭ (155.5 kW Ϫ 32.5 kW) kW ϫ $10 ϫ 12 months
ϭ $14,760/year
Total savings ϭ $86,100 ϩ $14,760 ϭ $100,860/year.
The simple payback period
ϭ cost for absorption chiller system/total savings
ϭ $250,000/$100,860
ϭ 2.5 years.
Electric chiller Absorption chiller
Chiller 135 kW 2.5 kW
(150 RT ϫ 0.9 kW/RT)
Condenser water pumps 15 kW 15 kW
Cooling tower 5.5 kW 7.5 kW
Hot water pump — 7.5 kW
Total 155.5 kW 32.5 kW
2.3.11 Thermal storage
Thermal storage is a form of storage that stores energy (cold or heat
energy) for use at a later time. Common thermal storage systems enable
cooling to be performed during non-peak periods and storing it for use
during peak periods.
Thermal storage systems provide building owners potential for achiev-
ing cost savings if the difference in electricity tariffs between peak and
off-peak is high, if peak demand charges are high, or the building max-
imum cooling load is much higher than the average cooling load.
The type of system depends on the storage medium. The three main
storage systems used are; chilled water, ice, and eutectic salts. Chilled
water storage systems (Fig. 2.33) use the sensible heat capacity of water,
which is 4.18 J/g C, to store cooling capacity. Ice storage systems use the
latent heat of fusion of water, which is 333 J/g, to store cooling capac-
ity. Similarly, eutectic salts too make use of the latent heat capacity to
store cooling capacity, but have the advantage of being able to operate
at higher temperatures than ice systems. The storage capacity depends
on the storage medium used and ice systems use the least space while
chilled water systems require the most space.
Since chilled water storage systems operate at normal chiller oper-
ating conditions, standard chiller systems can be used, while for ice
systems, special chillers that are designed to operate at low tempera-
tures or ice-making systems are required.
Air-Conditioning and Central Chiller Systems 69
Chilled water storage tank
(I) Radial diffuser
(II) H-diffuser
3-way valve
2-way valve
2-way valve
Chiller
Chilled water pump
14°C
4°C
Cooling water pump
Cooling tower
Figure 2.33 Arrangement of a chilled water storage system. (Courtesy of EnE System.)
Some technologies available for producing ice are; ice harvesting
systems (Fig. 2.34), ice-on-coil systems (Fig. 2.35), encapsulated ice
systems (Fig. 2.36) and ice slurry systems. In ice harvesting systems,
ice is formed on the surface of an evaporator and is periodically released
into a storage tank partially filled with water. In the ice-on-coil systems,
a coil is submerged in a tank containing water. The coolant medium,
normally a glycol and water mixture from a chiller, is passed through
the coil. Ice forms and accumulates on the surface of the coil. Storage is
discharged by passing warm return water through the coils which melts
the ice on the outside.
Encapsulated ice systems use water inside submerged plastic con-
tainers that are frozen and later thawed by passing cold coolant and
70 Chapter Two
Water/ice
Pump
Evaporator plates
Figure 2.34 Arrangement of an ice harvesting system.
Figure 2.35 Typical ice-on-coil tanks with cutaway. (Courtesy of Calmac.)
warm water, respectively, outside the containers. Figure 2.36 shows a
system with ball-shaped containers. Ice slurry systems store water or
a mixture of water and glycol in a slurry state, which comprises of a mix-
ture of ice crystals and liquid. The slurry is either pumped direct to the
load or a heat exchanger is used to cool a secondary fluid.
Eutectic salts use a combination of inorganic salts, water, and other
elements to form a mixture that freezes at a temperature above the
freezing point of water. This enables the use of standard chillers for such
systems.
Since in chilled water storage systems chillers operate at normal
operating conditions, there is no change in chiller efficiency. However,
for ice systems, since chillers have to operate at low temperatures, such
as –7ЊC, there is a significant drop in chiller efficiency. The drop in effi-
ciency for centrifugal chillers can be about 50 percent (e.g. from 0.6 to
0.9 kW/RT). However, the drop in efficiency for air-cooled chillers is not
Air-Conditioning and Central Chiller Systems 71
Cooling tower
Heat exchanger
Load
Pump
Ice TES tank
Chiller
Figure 2.36 Arrangement of an encapsulated ice system. (Courtesy of EnE
System.)
as significant as they can make use of lower ambient temperature at
night to work at a lower condenser temperature.
The two common storage strategies are full storage and partial stor-
age (Fig. 2.37 and 2.38). In full storage systems, the entire peak cool-
ing load is shifted to off-peak hours. The system operates at full capacity
during non-peak hours to charge the storage, which is later discharged
72 Chapter Two
0
100
200
300
400
500
600
700
800
900
1000
2:00
AM
4:00
AM
6:00
AM
8:00
AM
10:00
AM
12:00
PM
2:00
PM
4:00
PM
6:00
PM
8:00
PM
10:00
PM
12:00
AM
Time
A
m
o
u
n
t
o
f
c
o
o
l
i
n
g
(
R
T
)
Charging Charging
Discharging
(storage meeting cooling demand)
Figure 2.37 Full storage strategy.
0
100
200
300
400
500
600
700
800
900
1000
A
m
o
u
n
t
o
f
c
o
o
l
i
n
g
(
R
T
)
Charging
Charging
Chiller
supplementing
load
Discharging
2:00
AM
4:00
AM
6:00
AM
8:00
AM
10:00
AM
12:00
PM
2:00
PM
4:00
PM
6:00
PM
8:00
PM
10:00
PM
12:00
AM
Time
Figure 2.38 Partial storage strategy.
during the peak period. This strategy is attractive when peak demand
charges are high and there is a very big difference in electricity tariff
between peak and off-peak periods.
In partial storage systems, chillers operate to meet part of the cool-
ing demand during peak periods while the remainder of the cooling
demand is met by the storage system. The advantage of this system
is that equipment can be sized to be less than the design maximum
capacity. This strategy is attractive when the peak cooling demand is
much higher than the average cooling demand.
The evaluation of whether to install a thermal storage system, and
whether it should be chilled water or ice storage system can be com-
plex and will involve the consideration of many factors. Some of the
factors that need to be considered in the evaluation are; electricity tar-
iffs, peak power demand charges, daily and seasonal cooling demand pat-
terns, space availability, efficiency of systems, equipment cost, maintenance
costs, and type and configuration of equipment. Alife-cycle costing will
normally be necessary for such an evaluation.
Another potential application for thermal storage systems is in build-
ings where a “night load” (a relatively low cooling load at night) has to
be supported by high-capacity chillers sized to meet daytime cooling
load, which results in very inefficient chiller operation.
In such situations, if a thermal storage system is used, it can be
charged during daytime using the “day chillers” and discharged at night
to satisfy the night cooling load.
2.3.12 Chiller free cooling
Chiller “free cooling” involves using a chiller to provide cooling with its
compressors switched off. This strategy is possible only when outdoor
weather conditions are such that the outdoor wet-bulb temperature is
low enough to make condenser water colder than the chilled water and
building cooling is required. Such conditions are encountered in tem-
perate climates during autumn and spring. The chiller then operates like
a heat pipe where the refrigerant evaporated by the chilled water
migrates to the colder condenser, which causes the refrigerant to con-
dense and flow back to the evaporator.
To make this system function, a pipe with a valve needs to be
installed between the evaporator and condenser to enable the refrig-
erant to migrate from the evaporator to the condenser when the
compressor is not operating. Similarly, a piping connection is nec-
essary for the refrigerant to bypass the orifice used to control refrig-
erant flow to the evaporator under normal chiller operations. The
arrangement of a chiller functioning in the free-cooling mode is
shown in Fig. 2.39.
Air-Conditioning and Central Chiller Systems 73
2.3.13 Waterside economizer
The waterside economizer is also a form of free-cooling that can be used
in temperate climates during certain seasons to either precool or com-
pletely cool the return chilled water when the outdoor weather conditions
are favorable. The strategy can be applied to water-cooled chiller sys-
tems using cooling towers.
In this system, whenever the condenser water temperature is less
than the chilled water temperature, it uses cooling tower water to cool
return chilled water using a heat exchanger, (Fig. 2.40). Depending on
outdoor conditions and condenser water temperature, the chiller can be
completely turned off and the heat exchanger can be used to completely
cool chilled water, or the chiller can be operated at reduced load by
using the heat exchanger to precool the return water.
74 Chapter Two
Condenser
Evaporator
Compressor
Valves opened
Expansion
valve
Chiller
Cooling tower
Load
Heat exchanger
Chilled
water pump
Condenser
waterpump
Figure 2.39 Arrangement of a chiller performing “free-cooling.”
Figure 2.40 Arrangement of a waterside economizer.
2.4 Summary
In commercial buildings, chillers used for central air-conditioning sys-
tems are the biggest energy consumers. Therefore, significant energy
savings can be obtained by improving the energy efficiency of chiller sys-
tems. This chapter provided an introduction to principles of refrigera-
tion, refrigeration cycles, and types of chillers and how they operate.
Thereafter, a considerable number of energy management strategies,
which cover both design and operational aspects of chiller systems, were
presented and explained using the theory of refrigeration systems.
Various examples were also used to illustrate how the feasibility of
implementing the different improvement measures can be evaluated by
estimating the savings for each measure.
Review Questions
2.1. State four possible strategies to improve the efficiency of water-cooled
chillers. For each strategy, briefly describe how it will result in an improve-
ment in the chiller efficiency.
2.2. Briefly describe how variable speed drives (VSDs) can be used to reduce
the energy consumption of chilled water pumps.
2.3. A 500-RT chiller operates 10 hours a day and has an operating efficiency
of 0.6 kW/RT when the chilled water supply temperature is 7ЊC. If the
chilled water supply temperature is increased to 8ЊC, estimate the kWh sav-
ings per day that can be achieved assuming the chiller efficiency improves
3 percent for every degree Celsius increase in chilled water supply tem-
perature.
2.4. The rated efficiency and cost of three 500-RT capacity chillers are as follows:
Compute the life-cycle cost for a 10-year period for each chiller based on
the following:
Operating hours ϭ 10 h/day and 250 days a year
Electricity tariff ϭ $0.10/kWh
Electricity cost escalation ϭ 2% a year
Chiller First cost Efficiency (kW/RT)
1 $300,000 0.5
2 $275,000 0.55
3 $250,000 0.65
Air-Conditioning and Central Chiller Systems 75
76 Chapter Two
2.5. An office building uses a 150-RT chiller at night to provide after-office
hours cooling to satisfy a load of 20 RT from 6 p.m. to 2 a.m. (8 hours). The
resulting chiller efficiency is 1.75 kW/RT.
Calculate the daily kWh savings if the after-office hours cooling can be
provided using a chilled water storage system where the chilled water can
be produced using the day chillers operating at 0.65 kW/RT.
2.6. An industrial plant, which operates 24 hours a day, is considering replac-
ing one of its 500-RT capacity chillers. Based on measurements carried out,
the average daily electrical energy consumed by the chiller is 6000 kWh.
It is proposed to replace the existing chiller with a new chiller having
the performance characteristic given in Table A.
Table A Performance Data for new Chiller
The expected cooling load profile for the new chiller is given in Table B.
Table B Expected Cooling Load Profile
(i) Calculate the average daily energy savings (in kWh) that will result if
the existing 500-RT chiller is replaced with the new chiller (use linear
interpolation to obtain chiller efficiency data from Table A).
(ii) Payback period for replacing the chiller, assuming the chiller operates
300 days a year and the cost of the new chiller is $300,000 (you may
ignore power demand savings).
Time Cooling load (RT)
12 a.m. to 6 a.m. 300
6 a.m. to 10 a.m. 400
10 a.m. to 2 p.m. 450
2 p.m. to 8 p.m. 400
8 p.m. to 12 a.m. 350
Chiller loading (RT) Chiller efficiency (kW/RT)
500 0.55
400 0.56
300 0.57
200 0.6
100 0.75
77
Chapter
3
Boilers and Heating Systems
3.1 Introduction
Boilers are pressure vessels used in buildings and industrial facilities
for heating water or producing steam. They are primarily used for pro-
viding space heating for buildings in temperate climates as well as for
producing hot water and steam required by users such as laundries
and kitchens. For space heating, boilers function like chillers in central
air-conditioning systems and provide steam or hot water to different
parts of the building for heating. Atypical arrangement of a boiler plant
used for heating is shown in Fig. 3.1.
Boilers are either hot water boilers or steam boilers and are able to
burn fossil fuels like oil, gas, and coal (some use electric current). Water
boilers are normally low-pressure and are used primarily for space heat-
ing and producing hot water. Steam boilers are used for space heating
as well as in other applications that require steam.
In facilities that use boilers, a large percentage of the energy (fuel) con-
sumption is accounted for by the boiler plant. As such, significant energy
savings can be achieved by optimizing boiler systems. This chapter
describes some fundamental features of boilers and steam systems, fol-
lowed by possible energy saving strategies for such systems.
3.1.1 Boiler construction
Aboiler generally consists of a combustion chamber, which can burn fuel,
in the form of solid, liquid, or gas, to produce hot combustion gases, and
a tubular heat exchanger, to transfer heat from the combustion gases
to the water.
78 Chapter Three
As shown in Fig. 3.2, the main inflows to a typical boiler are fuel, air,
and feedwater while the outflows are steam or hot water, exhaust flue
gases, and blowdown.
Boilers are normally classified as fire tube or water tube boilers,
depending on the flow arrangement of water and hot gases inside the
boiler. In fire tube boilers, the hot gases pass through boiler tubes that
are immersed in the water being heated, while in water tube boilers,
water is contained in the tubes that are surrounded by the hot com-
bustion gases. Typical arrangements of fire tube boilers and water tube
boilers are shown schematically in Figs. 3.3 and 3.4.
To increase the surface area available for heat transfer between the
combustion gases and water, the tubes in boilers are arranged to have
a number of passes so that the hot flue gases and water can pass through
a number of sets of tubes before being exhausted. Cutaway pictures of
the two types of boilers are shown in Figs. 3.5 and 3.6.
Boiler capacity depends on the steam generation rate and steam pres-
sure. Steam generation is usually rated in kg/h, lb/h, or tons/h, while
steam pressure is rated in psi (pounds per square inch) or bar.
Sometimes, boiler capacity is rated in boiler horsepower (BHp), where
1 BHp is equal to 9.803 kW or 3.3457 ϫ10
4
Btu/h (3450 lb/h ϭ100 Hp).
1 2 3 Boilers
Pumps
By-pass
pipe
Heating
coils
Control
valves
Figure 3.1 Typical arrangement of boiler plant used for space heating.
Fuel
Exhaust
Steam
Feedwater
Air
Blow down
Figure 3.2 Main inflows and out-
flows for a typical boiler.
Boilers and Heating Systems 79
3.1.2 Boiler efficiency
Atypical heat balance for a boiler is shown in Fig. 3.7. As shown in the
figure, only part of the heat content of the fuel is converted into useful
heat, while the rest is lost through exhaust gases, blowdown, and radi-
ation losses. The efficiency of boilers is usually rated based on combus-
tion efficiency, thermal efficiency, and overall efficiency.
Combustion efficiency. The typical combustion process in boilers involve
burning of fuels that contain carbon (oil, gas, and coal) with oxygen to
generate heat. Oxygen required for combustion is normally taken from
air supplied to the burner of the boiler. The amount of air needed for com-
bustion depends on the type of fuel used. To ensure complete combus-
tion of fuel, more air than required (excess air) for combustion is
provided to ensure that the fuel is completely burnt. Since excess air
leads to lower boiler efficiency (due to removal of heat by the excess air
as it passes through the boiler), the objective is to ensure that the opti-
mum amount of excess air is provided.
Exhaust
Combustion
Steam
Feedwater
Fuel and air
Figure 3.3 Arrangement of fire tube boilers.
Fuel and air
Exhaust
Combustion
Steam
Feedwater
Figure 3.4 Arrangement of water tube boilers.
80 Chapter Three
Figure 3.5 Cutaway of fire tube boiler. (Courtesy of Cleaver
Brooks.)
Figure 3.6 Cutaway of a commercial water tube boiler. (Courtesy of Cleaver
Brooks.)
One of the most common measures of boiler efficiency is combustion
efficiency, which indicates the ability of the combustion process to burn
the fuel completely. It is normally measured by sampling the exhaust flue
gas to find the composition and temperature using a combustion analyzer.
Most good combustion analyzers are able to give a direct reading of the
combustion-efficiency based on the fuel used. If this facility is not avail-
able on the instrument used, combustion efficiency charts available for
different fuel types can be used to estimate the combustion efficiency.
Thermal efficiency. Thermal efficiency is a measure of the efficiency of
the heat exchange in the boiler. It provides an indication of how well the
heat exchanger can transfer heat from the combustion process to water
or steam in the boiler. It does not take into consideration the conduc-
tion and convection losses from the boiler.
Overall efficiency. Another measure of boiler efficiency is the overall
boiler efficiency, which is a measure of how well the boiler can convert
the heat input from the combustion process to the steam or hot water.
It is also called fuel-to-steam efficiency.
The heat input depends on the amount of fuel burnt and its calorific
value (heating value). The calorific value, normally expressed in kJ/kg,
multiplied by the amount of fuel burnt in kg/s gives the heat input in
kJ/s (kW).
The heat output is the difference in the heat content of the feedwa-
ter and steam (or hot water) produced multiplied by the flow rate of
water or steam. The heat content of water and steam is expressed in
kJ/kg and the flow rate of water or steam is expressed in kg/s, which
yields the heat output in kW.
Overall boiler efficiency 5
Heat output
Heat input
Boilers and Heating Systems 81
Fuel
heat 100%
Exhaust
10% to 30%
Steam
65% to 80%
Radiation
losses
0.5% to 2%
Blow down
1% to 2%
Boiler
Figure 3.7 Typical heat balance for a boiler.
The overall efficiency of a boiler is lower than the combustion effi-
ciency as it takes into account radiative and convective losses from the
boiler and other losses, such as cycle losses, due to passing of air through
the boiler during the “off ” cycle.
The efficiency of a boiler can also be estimated by subtracting stack
losses, radiative losses, and convective losses from the combustion effi-
ciency. While combustion efficiency can be measured directly by using
a combustion analyzer, the stack, radiative, and convective losses can
be estimated using boiler manufacturers’ data.
Table 3.1 shows the expected radiation and convection losses for a
boiler while Tables A.1, A.2, and A.3 in Appendix A show the approxi-
mate stack losses (based on CO
2
concentration in flue gas and the dif-
ference in temperature between the flue gas and boiler room). If the
combustion analyzer does not provide CO
2
concentration, Fig. A.1 in
Appendix Acan be used to convert O
2
values to CO
2
before using Tables
A.1, A.2, and A.3.
Example 3.1 Consider a 150 BHp (1471 kW) boiler operating on natural gas at
a 75 percent firing rate. The flue gas is sampled using a flue analyzer, which
shows that the flue gas temperature is 200ЊC and the CO
2
level is 5 percent.
If the boiler room temperature is 35ЊC, the temperature difference between the
flue gas and room temperature is 165ЊC (300ЊF).
Using the stack loss Table A.1 in Appendix A, the stack loss can be estimated
to be 22.2 percent
If the boiler operating pressure is 6.9 bar (100 psi), the radiative and convec-
tive losses can be estimated to be 0.7 percent (Table 3.1).
Therefore, the overall fuel-to-steam efficiency ϭ100 Ϫ(22.2 ϩ0.7) ϭ77.1 percent.
3.1.3 Auxiliary equipment
Boilers need various auxiliary equipment such as feedwater pumps,
draft fans, feedwater tanks, condensate recovery tanks, deaerators, and
82 Chapter Three
TABLE 3.1 Approximate Radiation and Convection Losses for a 4-Pass Boiler Well
Insulated for High Efficiency
100–350 BHp (981–3433 kW) 400–800 BHp (3924–7848 kW)
Operating Operating Operating Operating
Firing pressure pressure pressure pressure
rate 10 psig 125 psig 10 psig 125 psig
(% of load) (69 kPa) (863 kPa) (69 kPa) (863 kPa)
25% 1.6% 1.9% 1.0% 1.2%
50% 0.7 % 1.0% 0.5% 0.6%
75% 0.5% 0.7% 0.3% 0.4%
100% 0.4% 0.5% 0.2% 0.3%
(Courtesy of Cleaver-Brooks.)
water softening plants for their operation. Figure 3.8 shows a typical
arrangement of a boiler system with its main auxiliary equipment. The
fan shown is for an induced draft arrangement although the actual
operation can also be forced draft or natural draft. Some auxiliary equip-
ment such as deaerators and water treatment systems are not shown
in order to simplify the arrangement.
3.2 Energy Saving Measures for Boiler Systems
3.2.1 Improving combustion efficiency
The major loss in any boiler is due to the hot gases discharged into the
chimney. If there is a lot of excess air, the increased quantity of exhaust
gas will lead to extra flue gas losses. Similarly, insufficient air for com-
bustion results in wastage of fuel due to incomplete combustion and
reduces the heat transfer efficiency due to soot build up on heat trans-
fer surfaces.
The amount of excess air required depends on the type of fuel and,
in general, a minimum of about 10 to 15 percent excess air is required
for complete combustion. This translates to about 2 to 3 percent excess
oxygen.
Boiler combustion efficiency, which indicates the ability of the com-
bustion process to burn the fuel completely (with minimum excess air),
can be measured by sampling the exhaust flue gas to find its composi-
tion and temperature using a combustion analyzer. Most good combus-
tion analyzers are able to give a direct reading of the combustion
efficiency based on the fuel used. If this facility is not available on the
instrument used, a combustion efficiency versus oxygen (O
2
) concentra-
tion chart (Fig. 3.9) can be used to estimate the combustion efficiency.
The drop in combustion efficiency due to excess air is dependent
on the type of boiler and the amount of excess air. Based on the chart
Boilers and Heating Systems 83
Blowdown
Feedwater
tank
Pump
Flue gas
Steam
Pump
Condensate
return lines
Feed water
Combustion
air & fuel
Make-up
water
Boiler
Figure 3.8 Typical boiler plant.
(Fig. 3.9), if the excess air is increased from 15 to 30 percent, the O
2
con-
centration will increase from 3 to 5 percent (as normal air contains 21
percent oxygen) and the resulting drop in efficiency will be about 1 percent.
Example 3.2 If the flue gas from a boiler contains 10 percent oxygen, the amount
of excess air can be estimated as follows:
It is necessary to imagine that there are two streams of air going into the boiler,
one for complete combustion and the other to provide excess air. Since the oxygen
in the combustion air will all be used up, only the oxygen from the excess air will
be left in the flue gas.
Therefore,
Percentage of oxygen in air ϫ excess air flow ϭ total flue gas flow
ϫ percentage of oxygen in flue gas
21 percent ϫ excess air flow ϭ total flue gas flow ϫ 10 percent
Total flue gas flow/excess air flow ϭ 2.1
This shows that the total flue gas flow is double the excess air flow i.e. excess
air flow ϭ combustion air flow (100 percent excess air).
In Fig. 3.9, if the excess air is reduced from 100 to 15 percent (O
2
concentra-
tion from 10 to 3 percent), the combustion efficiency is expected to increase by
about 5 to 6 percent.
For boilers operating at high excess-air levels, the combustion burner
operation needs to be tuned to adjust the air-to-fuel ratio. This can nor-
mally be achieved by adjusting the mechanical linkages that control fuel
and air flow to the burner to provide the correct ratio between the two
at different operating loads for the boiler. Ideally, an oxygen (O
2
) trim
system should be installed, which can continuously monitor the oxygen
level in the flue gas and automatically adjust the air-to-fuel ratio to
maximize combustion efficiency.
84 Chapter Three
70
75
80
85
E
f
f
i
c
i
e
n
c
y
(
%
)
0 1 2 3 4 5 6 7 8 9 10
O
2
concentration (%)
Figure 3.9 Combustion efficiency versus O
2
concentration. (Courtesy of
Cleaver Brooks.)
The amount of excess air also increases sometimes due to excessive
draft created by the stack. If the stack is high, the natural draft created
by the buoyancy of the combustion gases can be significant. This effect
can be overcome by having a draft-control system, which consists of an
opening with a damper, installed on the exhaust duct between the boil-
ers and the stack, to automatically control the draft by opening or clos-
ing the damper.
The amount of excess air required for combustion also depends on the
type of burner. Some old burners require much more excess air for com-
plete combustion than others. Such burners can also be replaced with
low excess-air burners to improve combustion efficiency.
3.2.2 Optimizing steam pressure
Boilers have a maximum operating pressure rating, based on their con-
struction, as well as a minimum value to prevent carryover of water. The
actual operating pressure is normally set based on the requirements of
the end users, while ensuring it is within the specified maximum and
minimum values.
Since boiler efficiency depends on operating pressure, if the operat-
ing pressure is set much higher than required, energy savings can be
achieved by reducing it to match the actual requirements. Typically,
reducing boiler pressure can help improve boiler efficiency by 1 to
2 percent.
In addition to improving boiler efficiency, reducing steam pressure
helps to reduce steam leaks and wastage due to overheating in some
applications. Reducing pressure also lowers the temperature of the dis-
tribution piping, which helps to cut down on losses. Another benefit of
reducing pressure is the reduction of flash steam from vents of con-
densate recovery systems.
The heat carrying capacity (latent heat) of steam reduces with increase
in pressure. Since many applications of steam involve condensing of
steam in heat exchangers, it is best to keep the steam pressure at the
lowest acceptable value to extract the maximum latent heat from steam.
However, it should be noted that when steam pressure is reduced, the
distribution pipe sizing needs to be sufficient to transport the higher
volume of steam.
If it is not possible to reduce the pressure of the entire system, parts
of the distribution system can be operated at lower pressures by
installing pressure reducing valves at appropriate points in the distri-
bution network.
In some systems, one steam user may require steam at a much
higher pressure than the others. In such a system, if the steam usage
of the high-pressure user is relatively low, it may be better to have a
Boilers and Heating Systems 85
separate steam generator (located near the user) operating at the
required higher pressure while the rest of the system can be operated
at a lower pressure.
Further, the system pressure requirements may vary at different
times. For example, during daytime a higher pressure may be required
to operate certain laundry equipment while at night a lower pressure
may be sufficient for providing only space heating. In such a situation,
it may be possible to have different set points for boilers during daytime
and nighttime operations.
3.2.3 Fuel switching
Many modern boilers are the dual-fuel type and can operate on differ-
ent fuels like fuel oil or gas. Since most of the cost of operating a boiler
plant is accounted for by fuel cost, switching between fuels based on cost
can help reduce energy cost.
The cost of fuels, such as oil and gas, can vary depending on seasonal
factors and due to other reasons. Therefore, a particular fuel may not
be the most economical to use at all times and switching between fuels
can help minimize fuel cost.
The switch over from one fuel to another can be done manually by
plant operators or automatically in some boilers. The decision on when
to switch fuel should be used based on cost can be made by comparing
the cost of fuel per unit heat content. The heat content of fuels vary
depending on factors such as their composition, but the actual heat con-
tent of a particular fuel used can normally be obtained from the fuel sup-
plier. The approximate heat content values of some typical fuels are
listed in Table 3.2.
Example 3.3 A 400-BHp boiler requires 0.12 L/s of No. 2 oil when operating at
80 percent efficiency. The same boiler requires 0.13 m
3
/s of natural gas when
operating at the same efficiency.
If the cost of No. 2 oil is $0.30/L and the cost of natural gas is $0.18/m
3
, the
hourly operating cost for using No. 2 oil is 0.12 L/s ϫ3600 s/h ϫ$0.30 /Lϭ$129.60,
and the hourly operating cost for using gas ϭ 0.13 m
3
/s ϫ 3600 s/h ϫ $0.18/ m
3
ϭ $84.24. Based on this, it is cheaper to run the boiler on natural gas than on
No. 2 oil.
86 Chapter Three
TABLE 3.2 Approximate Heat Content Values for Fuels
Fuel Approximate heat content (MJ/kg)
Natural gas 55
No. 2 oil (light oil) 46
No. 4 oil (heavy oil) 45
No. 6 oil (heavy oil) 44
Ideally, other factors such as boiler efficiency and maintenance costs need to
be factored into the cost comparison as boiler efficiency and maintenance cost may
vary depending on fuel use.
3.2.4 Optimizing operation of auxiliary equipment
Auxiliary equipment such as feedwater pumps, boiler draft fans, hot
water circulating pumps, and condensate pumps also consume an appre-
ciable amount of energy. Therefore, significant energy savings can be
achieved by ensuring that they are operated only when required and at
the capacity required to maintain system requirements.
In some installations that have additional equipment to provide extra
reliability (standby equipment) or to match certain boiler load condi-
tions, plant operators may run more equipment than required to meet
the operating load. In such situations, some auxiliary equipment can be
switched off either manually or by using automatic controls.
Generally, each boiler has its own feedwater pump, which is auto-
matically switched on and off to maintain the level of water in the boiler.
Their operation is interlocked with the boiler so that the feedwater
pump is switched off when the boiler is not in operation.
In larger systems, multiple boilers can be served by a common set of
feedwater pumps, as shown in Fig. 3.10. In such an arrangement, indi-
vidual boilers take the required water flow by opening and closing the
feedwater valves to maintain the water level in the boilers. The excess
water is returned to the feedwater tank, which results in wastage of
pumping energy.
This system can be improved to reduce the energy consumption of the
pumps by varying the capacity (speed) of the feedwater pumps, which
helps maintain a set pressure in the feedwater header pipe, as shown
Boilers and Heating Systems 87
Return pipe
Boiler Boiler Boiler
Feedwater
tank
Pumps
Feedwater
valves
Figure 3.10 Feedwater pump arrangement for a multiple boiler
operation.
in Fig. 3.11. Apressure-activated valve (normally closed) can be installed
on the return pipe as a safety measure, so that it opens if the pressure
exceeds a set value (which may occur due to failure of the pump control
system).
Boiler fans used to create the draft necessary for combustion and
carry the flue gases through the boiler normally operate at constant
speed and dampers are used to control the air flow to match boiler load
conditions. In such systems, when the boiler operates at part load, a
damper throttles the air flow by inducing a resistance across the path
of the air flow. As a result, the energy consumption of the fan does not
reduce proportionately to the air flow. However, if a variable speed fan
is used for this application (Fig. 3.12), due to the cube law [fan power ϰ
(air flow rate)
3
], the reduction in fan energy consumption would be pro-
portional to the third power of the load. Therefore, theoretically, if the
load on the boiler reduces by 20 percent, the energy consumption of the
fan will be reduced by about 50 percent (0.8
3
).
The application of this energy saving measure depends on the load
profile of the boiler. If the load is highly variable and results in the
boiler operating at low loads for long periods of time, this is a good
88 Chapter Three
Pressure
sensor
Boiler Boiler Boiler
Feedwater
tank
VSDs
Figure 3.11 Suggested feedwater pump arrangement for a mul-
tiple boiler operation.
Boiler
Combustion air
Fuel
Controller
Boiler
pressure
VSD
Figure 3.12 Application of VSD
for boiler fan.
opportunity to incorporate a variable speed drive for the forced draft or
induced draft fan of the boiler. Generally, such a retrofit is most eco-
nomical in large boilers with modulating burners.
Installation of variable speed drives for boiler fans may require con-
sultation with the boiler manufacturer to ensure that the necessary
control modifications (to keep the damper fully open while controlling
the fan speed based on load) can achieve the proper air-to-fuel ratio at
different load conditions.
The savings achievable by using a VSD for boiler fan speed control can
be estimated by recording the boiler operating load profile and the fan
power consumption, as illustrated in Example 3.4.
Example 3.4 The operating loading and associated forced-draft fan power con-
sumption of a boiler is given in Table 3.3.
If the boiler users a damper system to control the air flow rate, the energy savings
that can be achieved by installing a VSD can be estimated as shown in Table 3.4.
Based on Table 3.4, the total savings is 296.8 kWh a day. This value can be mul-
tiplied by the number of operating days a year and the electricity tariff to calcu-
late the annual cost savings.
3.2.5 Standby losses
Standby losses take place when a boiler is not firing and the hot sur-
faces inside the boiler lose heat to colder air circulating inside it. Such
air circulation can take place due to natural convection and purging.
Boilers and Heating Systems 89
TABLE 3.3 Boiler Operating Data for Example 3.4
Boiler loading Operating hours a day Fan motor power (kW)
100% 2 22
80% 4 21
60% 10 19
40% 8 16
TABLE 3.4 Estimate of Savings for Example 3.4
Operating Fan motor Fan motor Energy
Boiler hours power with power with Power savings
A B C D ϭA
3
ϫ 22 E ϭ C Ϫ D F ϭ B ϫ E
100% 2 22 22 0 0
80% 4 21 11 10 40
60% 10 19 5 14 140
40% 8 16 1.4 14.6 116.8
Total 296.8
Note: Column D is (boiler loading)
3
ϫ fan power at full load which is 22 kW.
Losses due to natural convection occur when the air in the boiler gets
heated (by the hot surfaces), making it lighter and causing it to moves
up the stack circulating cold air through the boiler. This can be avoided
if dampers are installed to prevent the circulation of air when the boiler
is not being fired.
Purging losses take place when the boiler combustion space is purged
by the fan before firing the burners to ensure that there is only air (to
prevent possible explosions). Some burner systems also follow a purg-
ing cycle when firing stops. Losses due to purging can be reduced by min-
imizing the on-off cycle of the burner system. This can be achieved by
using burners that have a high turndown ratio (ratio of maximum heat
output to the minimum heat output of a burner) to enable the burner
to function even at low loads without switching off the flame.
3.2.6 Minimizing conduction
and radiation losses
Boilers, auxiliary equipment, and distribution piping of steam systems
are much hotter than the surrounding areas. Therefore, they lose heat
by radiation and conduction. The amount of heat lost depends on the sur-
face temperature of the hot surface, which in turn depends on the insu-
lation (thickness, thermal conductivity, and condition). To minimize
heat loss, all hot surfaces should be insulated with material having suf-
ficient resistance to heat transfer. Further, the insulation should be of
adequate thickness and it should be in good condition.
Heat loss also depends on the area of the hot surface. Since boilers
have large surface areas, heat loss from the boiler by radiation can be
significant when operating at low loads. For a typical boiler operating
at full load, heat loss due to radiation and convection is about 2 percent
(Table 3.1 shows the losses for a boiler insulated for high efficiency).
Since the radiative and convective losses remain the same irrespective
of boiler loading, the 2 percent loss at full load can increase to 8 percent
when the boiler is operating at 25 percent load (as illustrated in
Table 3.5) for a typical boiler.
90 Chapter Three
TABLE 3.5 Illustration of Radiation Losses for a Typical 200-BHp
(1962 kW) Boiler
Boiler Fuel input Radiation losses % Radiation
25% 500,000 40,000 8%
50% 1,000,000 40,000 4%
75% 1,500,000 40,000 3%
100% 2,000,000 40,000 2%
3.2.7 Preheating combustion air
In temperate climates, when boilers are used during winter to provide
space heating, the fresh air drawn in for combustion can be quite cold.
Since boilers and stacks release a considerable amount of heat into the
boiler room, some of the warm air from the boiler room can be used for
combustion. As warm air rises, resulting in stratification, the boiler air
intake can be arranged to draw air from the higher levels of the boiler
room. To make this effective, the ventilation openings at the higher levels
of the boiler room need to be closed while ensuring that minimum ven-
tilation requirements are maintained.
Typically, a 20ЊC increase in the temperature of combustion air can
lead to a boiler efficiency improvement of about 1 percent.
3.2.8 Optimum start controls
Boiler systems are operated by manual controls or timers to start and stop
them at fixed times. Such operations are scheduled based on routine
requirements such as preparing to meet the building’s heating require-
ments under the worst conditions, like the coldest period in the year.
Since the time taken to warm a building depends on factors like the
air temperature of the space to be heated and the outdoor temperature,
optimum-start controls, which use algorithms to predict the latest pos-
sible time to meet the system requirements based on the space tem-
perature and outdoor temperature, can be used instead of manual or
timer controls to minimize boiler operations.
Such a system would be able to start the boiler plant earlier on cold
days or on Mondays after a weekend shutdown, or later on warmer
days, while ensuring that the required space temperature is achieved
when building occupancy begins.
Since boilers and their auxiliary equipment consume large amounts
of energy to operate, minimizing their operating hours by an optimum-
start strategy can help to significantly reduce energy consumption.
3.2.9 Heat recovery from flue gas
Asignificant amount of heat energy is lost through flue gases as all the
heat produced by the burning fuel cannot be transferred to the water
or steam in the boiler. As the temperature of the flue gas leaving a boiler
typically ranges from 150 to 250ЊC, about 10 to 20 percent of the heat
energy is lost through it.
Therefore, recovering part of the heat from flue gas can help to
improve the efficiency of the boiler. Heat can be recovered from the flue
gas by passing it through a heat exchanger (commonly called an econ-
omizer) installed after the boiler, as shown in Fig. 3.13. The recovered
Boilers and Heating Systems 91
heat can be used to preheat boiler feedwater, combustion air, or for
other applications. The amount of heat recovered depends on the flue
gas temperature and the temperature of the fluid to be heated.
One of the major problems associated with flue gas heat recovery is
corrosion due to acid condensation. Acid condensation takes place when
the flue gas is cooled below its acid dew point. The sulfur in the fuel com-
bines with water to form sulfuric acid which is corrosive. Therefore, the
temperature of the flue gas needs to be maintained well above the acid
dew point to prevent corrosion unless a heat recovery system specially
designed to withstand acid corrosion is used.
The acid dew point depends on the sulfur content of the fuel. Some
typical values are given in Table 3.6.
The feasibility of installing a heat recovery system for flue gas depends
on factors such as by how much the stack temperature can be reduced,
the inlet temperature of the fluid to be heated, and the operating hours
of the boiler. Generally, the possible reduction in flue gas temperature
should be at least 25 to 30ЊC to make it economically viable to install a
heat recovery system.
Since economizers induce extra pressure losses on the flue gas and the
liquid being heated, care should be taken to ensure that the combustion
fan and the pump for the liquid being heated have adequate capacity to
overcome these losses.
Example 3.5 A 4000 kg/h (4 ton/h) boiler using approximately 167 L/h of low
sulfur oil operates with a flue gas temperature of 190ЊC. Find the energy savings
possible if an economizer is installed to preheat feedwater at 90ЊC.
92 Chapter Three
Boiler
Economizer
Flue gas
Pre-heated feedwater
Feedwater
Figure 3.13 Arrangement of a
typical economizer.
TABLE 3.6 Acid Dew point for Common Fuel Types
Acid dewpoint Allowable exit stack
Fuel temperature (ЊC) temperature (ЊC)
Natural gas 66 120
Light oil 82 135
Low sulfur oil 93 150
High sulfur oil 110 160
For low sulfur oil, since the minimum allowable stack temperature is 150ЊC,
the reduction in temperature possible for the flue gas is 40ЊC (190–150ЊC).
The amount of fuel used ϭ 167l/h Ϸ 150 kg/h (assuming the density to be
900 kg/m
3
).
For perfect combustion, with just enough air for complete combustion, the air-
to-fuel ratio is about 1:15 (stoichiometric mixture).
Therefore, the amount of combustion air is approximately 15 times the weight
of the fuel used. i.e. 15 ϫ 150 ϭ 2250 kg/h (would be slightly higher based on the
amount of excess air).
Total mass of flue gas ϭ (2250 ϩ 150) ϭ 2400 kg/h ϭ 0.67 kg/s.
Taking the specific heat capacity of flue gas to be 1.1 kJ/kg.K, the amount of
heat recovered can be estimated as follows:
Heat recovered ϭ mass flow rate ϫ specific heat capacity
ϫ temperature drop for flue gas
ϭ 0.67 ϫ 1.1 ϫ 40
ϭ 29 kW (kJ/s)
ϭ 0.029 ϫ 3,600 ϭ 104.4 MJ/hr.
If the heat content of the fuel is 40 MJ/kg,
the reduction in fuel usage ϭ 104.4/40 ϭ 2.6 L/h.
The increase in the feedwater temperature can be estimated as follows:
Heat recovered ϭ 29 kW ϭ mass flow rate ϫ specific heat capacity
ϫ temperature rise for water
ϭ (4000/3600) kg/s ϫ 4.18 kJ/kg.K ϫ (T – 90Њ)
From the above equation, the temperature of feedwater leaving the economizer
(T) can be computed to be 96ЊC (an increase of 6ЊC).
3.2.10 Automatic blowdown control
and heat recovery
Boiler blowdown is part of the water treatment process and involves
removal of sludge and solids from the boiler. Makeup water used for boil-
ers contain various impurities. As water is converted to steam, the con-
centration of the impurities that remain in the boiler increases. If this
concentration is allowed to increase, it will lead accelerated corrosion,
scaling, and fouling of the heat transfer surfaces of the boiler. Therefore,
it is necessary to remove part of the concentrated water from the boiler
and replace it with fresh water.
Boiler blowdown can be intermittent, where a fixed quantity of water
is drained periodically, or continuous, where a small amount of the
water is removed continuously to maintain the quality of water within
acceptable limits.
Blowdown involves discharge of water at steam temperature, which
has to be replaced by an equivalent amount of cold water. Energy losses
Boilers and Heating Systems 93
resulting from blowdown can be minimized by installing automatic
blowdown systems and recovering heat from blowdown.
Automatic blowdown control systems monitor the pH and conduc-
tivity of the boiler water and allow blowdown only when required to
maintain an acceptable level of water quality. Heat recovery from blow-
down involves utilizing a heat exchanger to preheat cold makeup water
using the blowdown. Such systems are feasible for boilers that operate
most of the year using at least 5 percent of makeup water. For high-
pressure systems having steam pressures over 300 psi, flash steam
can also be recovered from the blowdown and can be used as low-pressure
steam or condensed back as part of the boiler feedwater. A typical
arrangement of a boiler blowdown system with heat recovery is shown
in Fig. 3.14.
3.2.11 Boiler operating configuration
The efficiency of boilers vary at different load conditions depending on
how well the burner system can match load variations. Burner systems
on boilers normally use single-stage, two-stage, or modulating type
burners to vary the boiler output and match load requirements.
Single-stage burners have only one output setting and vary burner output
by switching the burner on and off. This can lead to high standby losses,
as explained earlier. Two-stage burners have low-fire (about 60 percent of
maximum) and high-fire output (maximum) settings. In modulating burn-
ers, the heat output is modulated between a set of maximum and minimum
settings to match load requirements. The minimum output can be as low
as 25 percent of the maximum output for modulating burners.
Therefore, a sequencing program needs to be used for systems with mul-
tiple boilers to optimize their operation. The system should be able to min-
imize the heat input for a given steam load. For example, for a two-stage
94 Chapter Three
Blowdown
Boiler
Flash vessel Heat
exchanger
Cold make up water
Discharge
Warm make up water
Boiler Boiler
Flash steam
Figure 3.14 Typical blowdown flash steam and heat recovery system.
burner, the system should be able to decide whether to fire a boiler on its
second stage or start another boiler on the first stage when the load
increases. Similarly, if the load is 120 percent of the capacity of one boiler,
whether to operate two boilers at equal load (60 percent load each) or oper-
ate one at a higher load. To optimize in this manner, data on the operat-
ing efficiency of the boilers at different load conditions need to be available.
Example 3.6 Consider the following situation (Table 3.7) where three boilers
have to supply a load of 170,000 kg/h and each has a different operating effi-
ciency (Table 3.8).
Based on operating capacity and efficiency data for the boilers, the required
170,000 kg/h of steam can be met by operating a minimum of two boilers (boilers
1 and 2).
By trial and error, it can be found that operating boilers 1 and 2 at equal load
(85,000 kg/h each) results in the lowest fuel input (118 ϫ10
6
kcal/h). Alternatively,
if boiler 1 is loaded to 100 percent and boiler 2 is operated at 70 percent load, the
resulting fuel input will be higher (118.5 ϫ 10
6
kcal/h).
3.2.12 Condensate recovery
In most steam systems, steam is used mainly for heating by extracting
its latent heat. The resulting condensate is at steam temperature and
Boilers and Heating Systems 95
TABLE 3.7 Boiler Operation
Boiler size Boiler operating load Heat input
Boiler no. (10
3
kg/h) (10
3
kg/h) (10
6
kcal/h)
1 100 70 47
2 100 70 51
3 50 30 24
170 122
TABLE 3.8 Boiler Operating Efficiency Data
Steam load Combustion Output Fuel input
Boiler no. (10
3
kg/h) efficiency (%) (10
6
kcal/h) (10
6
kcal/h)
100 85 66 67
1
85 86 48 56
65 84 37 44
50 81.5 28 35
100 77.5 57 73
2
85 78 48 62
65 77 37 48
50 74 28 38
50 78 28 38
3
40 78.5 24 31
30 76.5 18 24
25 73.5 14 19
still contains a considerable amount of heat energy. If steam is used at
100 psi (690 kPa), then the condensate contains about 25 percent of the
heat used to produce steam and will be lost if the condensate is not
returned to the system. Therefore, returning condensate to the boiler
feedwater tank will result in significant fuel energy savings.
Since condensate is distilled water, it is ideal for use as boiler feed-
water. Therefore, condensate recovery helps to reduce water consump-
tion (water cost), water treatment cost, and blowdown.
Usually, a low feedwater temperature or high makeup water flow
indicates that less condensate is recovered. If the makeup water flow is
metered, in applications that do not consume live steam (such as open
sparge coils and direct steam injection systems), the difference between
the amount of steam produced and makeup water flow will give an indi-
cation of the amount of condensate that is not recovered.
Similarly, temperature measurement of feedwater, condensate return,
and makeup water streams can also help to estimate the amount of
condensate recovered, as illustrated in Example 3.7.
Example 3.7 Consider the following situation where feedwater is provided to a
boiler at 60ЊC from the feedwater tank. Temperature of condensate water return-
ing to the tank is 88ЊC, while the temperature of makeup water is 27ЊC.
96 Chapter Three
Feedwater 60°C and 1 unit
Make-up water 27°C and x unit
Condensate 88°C and (1–x) units
Heat balance is,
27x ϩ (1 Ϫ x) 88 ϭ 60
Therefore, x ϭ0.36 (36 percent makeup water or only 64 percent of condensate
is recovered).
In some applications, condensate is not recovered due to possible con-
tamination from leaking steam coils or heat exchangers, which can
cause damage to boilers. This can be prevented by first returning the
condensate from such applications to a collection tank fitted with a
sensor to detect contamination before transferring to the main conden-
sate tank. If this is not possible, for applications with large amounts of
condensate, the heat can at least be recovered using a heat exchanger.
3.2.13 Steam traps
Steam traps are used in steam systems to remove condensate and
noncondensable gases. They are mainly used in buildings for steam
heating coils and for condensate removal from steam headers, as shown
in Fig. 3.15.
There are many types of steam traps (Fig. 3.16). Steam traps are
generally classified as thermostatic, mechanical, or thermodynamic.
Thermostatic steam traps are designed to work based on the difference
in temperature of steam and condensate. They contain a bimetallic strip
Boilers and Heating Systems 97
Figure 3.16 Common types of steam traps. (Courtesy of Spirax Sarco.)
Valve stem
Recess
Bimetal discs
Spring washer
Seat
Dynamic clack
Balanced
pressure
capsule
Bimetal steam trap Thermodynamic steam trap
Float type steam trap
Bleed hole
Inverted bucket
Orifice
Inverted bucket steam trap
Outlet
Steam header
Steam
Condensate
Steam
Condensate
Steam coil
Steam trap
Steam trap
Figure 3.15 Application of steam traps.
or bellows to allow subcooled condensate to be removed while prevent-
ing live steam, which is at a higher temperature, from passing through.
While bellows-type thermostatic traps can be used for steady light loads
on low-pressure systems, bimetallic traps can be used for jacketed
piping, steam tracers, and heat transfer equipment, which can accom-
modate backup condensate.
Bucket- and float-type traps are common types of mechanical steam
traps. As the names imply, they have floating balls or buckets that oper-
ate on the buoyancy of condensate to mechanically open and close ports
in the traps to discharge only condensate. They usually have built-in air
venting features and are used for continuous and intermittent loads.
They are commonly used on steam-heat exchanger coils.
Thermodynamic traps operate based on the difference in flow char-
acteristics of steam and condensate. When air or condensate enters the
trap, a disc lifts up to allow it to be discharged. When steam enters the
trap, due to its increased velocity (higher velocity pressure), the static
pressure below the disc is reduced, which lowers the disc, closing the
trap. They are often used for condensate removal from main steam dis-
tribution pipes.
The operation of steam traps is important because if they fail to oper-
ate properly and allow live steam to pass through them from the steam
side to the condensate side, it results in obvious loss of energy. In addi-
tion, if the traps are unable to remove air at start-up times or if they are
unable to remove condensate at a sufficient rate, the resulting reduced
capacity and longer periods to heat up would also result in energy
wastage.
Over time, internal parts of steam traps wear out and result in fail-
ure.
However, one of the main problems in maintaining steam traps is
identifying defective steam traps. Often, the condensate released by
traps is diverted to a condensate collecting tank, making it hard to spot
leaking traps. Further, it is sometimes hard to distinguish between leak-
ing steam and flash steam at the steam traps.
One way of identifying steam leaks from traps that are connected by
piping to condensate tanks is to install sight glasses after the traps to
facilitate visual indication of leaks. Ultrasound leak detectors can also
be used to detect leaking traps. Further, traps should be periodically
inspected and repaired or replaced to ensure that they are in good work-
ing condition. In addition, the correct type of steam trap should be
selected for each application.
98 Chapter Three
3.2.14 Steam leaks
Steam leakage occurs from pipes, flanges, valves, connections, traps, and
process equipment and can be substantial for some steam distribution
systems. The amount of steam leaking from various openings depends
on the size of the opening and the system pressure. Figure 3.17 shows
the approximate steam leak rates at different operating pressures for
various leaking-hole sizes. The figure also gives the approximate fuel
savings that can be achieved if a particular leak is eliminated based on
boiler operation of 8400 and 2000 hours a year. The fuel savings for other
annual operating hours can be estimated by interpolation.
Example 3.8 If the operating steam pressure is 600 kPa (6 bar) and the hole
size is 7.5 mm, drawing a horizontal line on the chart through the point where
the 600 KPa vertical line and the curve for the 7.5-mm hole intersect shows that
the approximate steam leak rate is 110 kg/h.
If the boiler operates on heavy fuel oil, extending the horizontal line shows that
the saving in fuel will be 70,000 L/year and 17,000 L/year, if the boiler operates 8400
and 2000 hours a year, respectively. Therefore, if the boiler operates 5000 hours a year,
by linear interpolation, the approximate annual fuel savings is 42,000 L/year.
If the cost of fuel is $0.5/L, the annual cost savings that can be achieved by elim-
inating the leak is $21,000 (42,000 ϫ 0.5).
Boilers and Heating Systems 99
Figure 3.17 Steam losses through leaks. (Courtesy of Spirax Sarco.)
3.2.15 Feedwater tank
The feedwater tank is a very important part of any steam system. It pro-
vides a reservoir of returned condensate and fresh makeup water for the
boilers. The feedwater tank gives a good indication of the system’s
health. Excessive feedwater temperature may indicate that some traps
may be passing live steam, while a high makeup water flow may indi-
cate that some condensate is not being returned to the tank.
Feedwater is normally hot due to returned condensate and recovery
of heat from other sources. Therefore, the tank should be elevated to
avoid hot water being flashed off as steam at the feedwater pump inlet,
in order to prevent cavitation.
Since the feedwater tank is hot, steps should be taken to minimize
heat losses from the tank. Other than insulating the tank, since a great
amount of losses usually take place at the water surface, the top of the
tank should be covered.
3.2.16 Fouling and scaling of boiler heat
transfer surfaces
Fouling, scaling, and soot build up on heat transfer surfaces of boilers
act as insulators and lead to reduced heat transfer. This results in lower
heat transfer to the water in the boiler and higher flue gas temperature.
If at the same load conditions and same excess air setting the flue gas
temperature increases with time, this is a good indication of increased
resistance to heat transfer in the boiler. Typically, 1- to 1.5-mm soot build
up on the fire-side can increase fuel consumption by about 3 to 8 per-
cent. Similarly, for the water-side, scale build up of 1 to 1.5 mm can result
in extra fuel consumption of 4 to 9 percent.
When this occurs, the boiler heat transfer surface should be cleaned.
On the fire-side, surfaces should be cleaned of soot, while on the water-
side, scaling and fouling should be removed. For boilers using gas and
light oil, it is generally sufficient to clean fire-side surfaces once a year.
However, for boilers using heavy oil, cleaning may need to be done sev-
eral times a year.
In addition, preventive steps should also be taken. For scaling, as it
is caused by inadequate water treatment, steps should be taken to
improve water softening and maintaining a lower total dissolved solids
(TDS) level. For soot build up, which is normally due to defective burner
or insufficient air for combustion, steps should be taken to repair or
retune the combustion system.
3.2.17 Isolating off-line boilers
Sometimes, during light-load conditions, one boiler is used to meet the
demand while other boilers are kept on standby. Such idling boilers can
100 Chapter Three
lose heat due to flow of air through the boiler into the stack. This can
be avoided by installing dampers to automatically isolate the off-line
boiler from the operational boilers and the stack.
3.2.18 Decentralized boiler systems
Usually, steam is generated by a central boiler and then distributed to
the different areas of the building complex. In the case of large cam-
puses, energy savings may be achieved by reducing distribution losses
by having a decentralized system with smaller package boilers. This also
enables the package boilers to be operated at different steam pressures,
depending on the requirements of the individual areas, and will help
lower the steam pressure.
3.2.19 Boiler replacement
Generally, the overall efficiency of boilers is similar. However, some
boilers may operate at much lower efficiency than others due to reasons
such as loading and characteristics of the burner. If a boiler is operated
at 10 to 15 percent of its capacity, radiation losses can account for a sig-
nificant percentage of the heat input from the fuel, resulting in low
boiler efficiency. In such situations, it may be financially justifiable to
replace the existing boiler with a new boiler that is sized to match the
low operating load conditions.
If on the other hand, boiler efficiency is low due to the burner cycling
on and off, due to low operating load leading to high standby losses caused
by convection and purging, replacing the burner with a modulating burner
with a high turndown ratio may help to improve boiler efficiency.
3.3 Ideal boiler system
A possible arrangement for a boiler system, incorporating some of the
important energy saving measures discussed earlier in this chapter is
shown in Fig. 3.18.
3.4 Heat Recovery Systems
Space heating and production of hot water can also be achieved using
heat recovery systems to extract heat from waste heat sources. In build-
ings, the most common sources of waste heat are condensers of air-con-
ditioning systems. In a typical air-conditioning system, the evaporator
provides useful cooling while the condenser rejects the absorbed heat
plus the heat added by the compressor to the environment. In such a
system, rather than wasting this heat energy, the heat released by the
condenser can be used for space heating or to produce hot water.
Boilers and Heating Systems 101
In typical heat recovery systems used with air-conditioning systems,
the hot refrigerant is first passed through a heat exchanger before the
condenser to extract heat (Fig. 3.19). Some of the common heat exchanger
arrangements used are coils immersed in hot water tanks, refrigerant
coils wrapped around hot water tanks, and plate heat exchangers. Since
the refrigerant pressure is normally higher than the pressure of the
water being heated, when using immersed coils and heat exchangers,
a double-walled heat exchanger surface is needed to prevent contami-
nation of the water in the event of a refrigerant leak.
In addition to recovering waste heat from the air-conditioning system,
a heat exchanger also helps to reduce energy consumption by the con-
denser fan as most of the heat will be released in the heat recovery heat
exchanger.
102 Chapter Three
Condenser
Evaporator
Expansion
valve
Compressor
Cold water Hot water
Heat exchanger
Figure 3.19 Typical arrangement of a heat recovery system
coupled to an air-conditioning system.
Blowdown
Boiler
Feed
water
tank
Pump
Economizer Steam
Pump
Condensate
return lines
Flash
vessel
Heat
exchanger
Cold make up water
Discharge
Warm make up water
Flash
steam
Feed
water
Fuel &
air
O
2
trim
VSD
VSD
Pressure
Flue gas
Figure 3.18 Possible arrangement of boiler system to maximize efficiency.
3.5 Hydronic Heating Systems
As described earlier in the chapter, boilers commonly provide space
heating for buildings by providing hot water from central plants, like
chiller plants used for cooling. In these systems, which are sometimes
called hydronic heating systems, hot water is pumped from the cen-
tral plant to terminal units that have heating coils to provide space
heating.
Energy savings achievable from such hydronic systems normally
relate to optimizing hot water pumping systems, air distribution sys-
tems, and operating strategies. The optimizing measures for heating and
cooling hydronic systems are similar and are therefore described
together in Chapter 4 (pumping systems), Chapter 6 (air distribution
systems), and Chapter 9 (building automation systems).
3.6 Summary
Boilers are used for providing space heating for buildings in temperate
climates as well as for producing hot water and steam required by other
users such as laundries and kitchens. Most boilers operate on fuel and
are generally the biggest users of fuel in buildings. Therefore, signifi-
cant savings in fuel consumption can be achieved by improving the effi-
ciency of boilers and ancillary equipment used in boiler plants. This
chapter provided an overview of boilers and how they operate. Thereafter,
potential energy saving measures, which can improve the efficiency of
boilers through operational strategies and system design, were described.
Other opportunities for improving the efficiency of boiler systems,
including optimization measures for ancillary equipment were also
described in detail.
Review Questions
3.1. The flue gas from a boiler contains 8 percent oxygen. If boiler tuning is per-
formed, the oxygen concentration in the flue gas can be reduced to 5 per-
cent. Estimate the improvement in combustion efficiency that can be
achieved by doing this.
3.2. A200-BHp (1962 kW) boiler operates on No. 2 oil at a 75 percent firing rate.
The flue gas is sampled using a flue analyzer, which shows that the flue
gas temperature is 180ЊC and the CO
2
level is 5.5 percent. If the boiler room
temperature is 38ЊC, estimate the overall boiler operating efficiency.
3.3. The operating load and associated forced-draft fan power consumption of
a boiler is given below.
Boilers and Heating Systems 103
If the boiler users a damper system to control the air flow rate, and the fan
consumes 35 kW of power when the boiler operates at 100 percent load-
ing, estimate the daily energy savings that can be achieved if a VSD is
installed to control the fan capacity based on boiler load.
3.4. A boiler is operated to provide steam to calorifiers and to a laundry. Only
part of the steam is returned as condensate to the system.
Feedwater is provided to the boiler at 80ЊC from the feedwater tank. The
temperature of condensate water returning to the tank and that of the
makeup water are 95 and 27ЊC, respectively. Estimate the amount of con-
densate that is recovered in the system.
3.5. Aboiler operating on heavy fuel oil provides steam 24 hours a day to a dis-
tribution system that operates at 300 kPa pressure. If there are three
holes of approximately 3 mm each in the distribution system that are leak-
ing steam, estimate the annual fuel cost savings that can be achieved if the
leaks are eliminated. Take the fuel cost to be $0.5 a liter.
104 Chapter Three
Boiler loading Operating hours a day Fan motor power (kW)
80% 4 22
60% 12 18
40% 8 16
105
Chapter
4
Pumping Systems
4.1 Introduction
Various pumping systems are used in buildings. The most common sys-
tems are those used for pumping chilled water and condenser water in
central air-conditioning systems and for pumping hot water in central
heating systems. Pumping systems are also used in buildings for domes-
tic hot water and cold water supply. This chapter deals mainly with
pumping systems used in central air-conditioning and heating systems
since they account for most of the energy consumed by pumping systems
in buildings. However, some of the proposed energy management strate-
gies may also be applicable to other pumping systems.
In chilled water and hot water (heating) systems, pumps are used to
provide the primary force to distribute and circulate cold or hot water
through the coils while overcoming pressure losses caused by the dif-
ferent components in the system. Similarly, in condenser cooling sys-
tems, water is circulated between the condensers and the cooling towers.
Centrifugal pumps are the most common type of pumps used in build-
ings. Centrifugal pumps have an impeller mounted on a shaft, which is
driven by a motor and rotates in a volute or diffuser casing. In pumps
with volute casings, water from the impeller is discharged perpendicu-
lar to the shaft, while in pumps with diffuser casings (in-line pumps),
water is discharged parallel to the shaft.
Pumps are generally classified according to their installation arrange-
ment and mechanical features. The most common pumps used in build-
ings are end-suction type pumps, which are horizontally mounted with
single-suction impellers, horizontally- or vertically-split case pumps
with double-suction impellers, and vertically mounted in-line pumps.
(Figs. 4.1 and 4.2).
106 Chapter Four
4.2 Distribution Systems
Chilled water and heating systems are closed systems where water is
circulated in a closed loop. Condenser water systems are open systems
where static pressure is present due to height difference when the water
is sprayed in open cooling towers. Arrangements of closed and open sys-
tems are shown in Fig. 4.3.
The two main piping systems used for water circulation are direct
return and reverse return systems. As shown in Figs. 4.4 and 4.5, the
difference between direct return and reverse return systems is that in
the latter, the water leaving the individual coils is combined together
before returning to the main return header, whereas in the direct return
system water return pipes are individually connected to the main return
header.
As a result, in reverse return systems, the piping lengths between the
circulating pumps and each coil is equal. Therefore, if the coils are
selected to have the same water pressure drop, the system will be self-
balancing and will eliminate the need for balancing valves. In direct
Figure 4.1 End-suction and in-line pumps. (Courtesy of ITT Industries.)
Figure 4.2 Horizontally- and vertically-split case pumps. (Courtesy of ITT Industries.)
Pumping Systems 107
return systems, the piping length between coils and circulating pumps
vary according to the location of the coils, with the nearest coil having
the shortest pipe length. Direct return systems, therefore, need to have
balancing valves on each branch of piping to prevent more water pass-
ing through the coils close to the circulating pump, leading to insuffi-
cient flow to the coils furthest away from the pump.
In addition to these water distribution systems, another variation, the
primary-secondary pumping system, is also sometimes used. As shown
in Fig. 4.6, a primary-secondary distribution system utilizes two sets of
pumps. The first set of pumps, the primary pumps, is used to pump
water through the chillers or boilers. The second set of pumps, the sec-
ondary pumps, is used to pump water through the coils located in the
different parts of the building. The primary and secondary pumps are
hydraulically isolated from each other by a bypass pipe called the decou-
pler pipe. The secondary distribution can be configured to be direct
return or reverse return.
The flow in the decoupler piping can be in either direction, depend-
ing on the “production” of chilled or hot water in the primary circuit and
the amount of “consumption” by the building (secondary flow). If the pri-
mary system produces more chilled or hot water than what the sec-
ondary system consumes, the flow of water in the decoupler pipe will be
Coils
Closed system Open system
Pump
Pump
Cooling
towers
Figure 4.3 Arrangement of closed and open systems.
1 2 3
Chillers
or
boilers
Pumps
By-pass
pipe
Coils
Control
valves
Figure 4.4 Direct-return distribution system.
from supply header to return header. On the other hand, if the second-
ary system requires more water than that produced by the primary
system, the flow of water in the decoupler pipe will be from return to
supply.
In such primary-secondary systems, hydraulic isolation allows the
secondary pumps to vary the flow (usually using variable speed drives)
with building load while maintaining a constant flow of water through
the primary circuit. The advantages of such a system will be discussed
later in the chapter.
4.3 System and Pump Curves
Pumps and pumping systems are normally rated based on the pressure
head and flow rate. The two parameters are dependent on each other
as the flow rate in a pumping system depends on the pressure head.
The pressure developed by a pump is necessary to overcome resistances
in the system, such as those due to frictional losses in piping, pressure
108 Chapter Four
1 2 3
Chillers
or
boilers
Pumps
By-pass
pipe
Coils
Control
valves
Figure 4.5 Reverse return distribution system.
1 2 3
Chillers
or
boilers
Primary
pumps
Decoupler
pipe
Coils
Control
valves
Secondary pumps
Figure 4.6 Primary-secondary pumping system.
losses across valves, and cooling coils and static head differences in
open systems. The relationship between head losses in a system to the
system flow rate is called the system resistance curve. Typical system
curves for closed and open systems are shown in Fig. 4.7.
The difference between the two curves is that for open systems the
static pressure difference or independent pressure due to height differ-
ence is added to the system curve. The system curve is parabolic in
shape since the pressure losses in the system are proportional to the
square of the flow (⌬P ϰ Flow
2
).
Pressure drop due to friction of a fluid flowing in a pipe is given by
the Darcy-Weisbach equation:
(4.1)
where ⌬h ϭ friction loss, m
f ϭ friction factor, dimensionless
L ϭ length of pipe, m
D ϭ inside diameter of pipe, m
V ϭ average velocity of fluid, m/s
g ϭ acceleration due to gravity, 9.8 m/s
2
This has the relationship (pressure ϰ Flow
2
).
Further, pressure losses in fittings are also proportional to the square
of the flow and can be expressed as:
(4.2)
where, K ϭ loss coefficient, depending on type of fitting, size and flow
velocity.
⌬h 5 K
V
2
2g
⌬h 5 f
L
D
V
2
2g
Pumping Systems 109
System curve for
closed systems
P
r
e
s
s
u
r
e
Flow
System curve for
open systems
P
r
e
s
s
u
r
e
Flow
Independent pressure or static
pressure difference
FIGURE 4.7 System curves (closed and open systems).
Each particular system will have its own system curve due to its
unique pipe sizing, pipe length, and fitting. The system curve will, there-
fore, change if components in the system are changed; for example, with
those having different flow resistances.
Similarly, the relationship between flow rate and pressure developed
by a pump is called a pump curve. The pump curve shows all the dif-
ferent operating points of a pump at a particular operating speed as its
discharge is throttled from zero to full flow. Since pumps can operate at
different speeds and with different impeller sizes, usually pump curves
are plotted on the same axis. Figure 4.8 shows the pump curves for a
particular pump using different impeller sizes.
Such pump curves provided by pump manufacturers usually show not
only the relationship between flow rate and pressure, but also the pump
power and operating efficiency. The pump curves can be flat or steep,
as shown in Fig. 4.9. In pumps with flat curves, large variations in flow
can be achieved with relatively less change in pressure. Therefore,
pumps with flat curves are preferred for closed systems with modulating
2-way control valves. For constant flow applications such as condenser
water systems serving cooling towers, pumps with a steep characteristic
can be used.
When a pump is selected for a particular application, a pump with a
performance curve that can intersect the system curve at the desired
operating point is selected, as shown in Fig. 4.10.
110 Chapter Four
Pump curves at
different impeller
sizes
P
r
e
s
s
u
r
e
Flow
Figure 4.8 Pump curve (differ-
ent diameters).
Figure 4.9 Flat and steep pump characteristics.
P
r
e
s
s
u
r
e
Flat curve
Flow
Steep curve
The power consumed by a pump is related to the product of the flow
and the pressure difference (between discharge and suction), that is,
(4.3)
In SI units:
Pump impeller power (kW)
(4.4)
In Imperial units:
Pump brake horsepower
(4.5)
Therefore, pumping power consumption can be lowered by reducing the
flow rate, the pressure difference, or both.
4.4 Affinity Laws
The performance of centrifugal pumps under different conditions are
related by the pump affinity laws given in Table 4.1. The pump affinity
laws relate pump speed and impeller diameter to flow, pressure devel-
oped across the pump, and brake horsepower of the pump.
Pump affinity laws are useful for estimating pump performance at dif-
ferent rotating speeds or impeller diameters, based on a pump with a
known relationship. Example 4.1 illustrates the use of pump affinity
laws.
5
flow rate sUSgpmd 3 pressure difference sft waterd
3960 3 efficiency
5
flow rate sm
3
/sd 3 pressure difference sN/m
2
d
1000 3 efficiency
Pump power ~
liquid flow rate 3 pressure difference
efficiency
Pumping Systems 111
System curve
Pump curve
P
r
e
s
s
u
r
e
Flow
Operating point
Figure 4.10 System and pump curve for a pumping system.
Example 4.1 A pump delivers 120 L/s at 1400 rpm and consumes 55 kW. If the
pump speed is reduced to 1120 rpm, calculate the new flow rate and power con-
sumption.
Q
1
ϭ 120 L/s
P
1
ϭ 55 kW
N
1
ϭ 1400 rpm
N
2
ϭ 1120 rpm
Q
2
ϭ Q
1
ϫ (N
2
/N
1
) ϭ 120 ϫ (1120/1400) ϭ 96 L/s
P
2
ϭ P
1
ϫ (N
2
/N
1
)
3
ϭ 55 ϫ (1120/1400)
3
ϭ 28 kW
Example 4.1 shows that when the speed is reduced by 20 percent
(1400 rpm to 1120 rpm), theoretically, the power consumption reduces
by about 50 percent (55 kW to 28 kW). However, it should be noted that
the pressure developed by the pump also reduces to the square of the
reduction in speed.
This is the well known “cube law” (power ϰ speed
3
), which is very
useful for energy savings in pumping systems, and its applications will
be described later.
4.5 Energy Saving Measures
for Pumping Systems
4.5.1 Pump sizing
Pumps are sized to take care of the design flow requirements while
overcoming the various resistances in the system. Friction losses in
piping and losses across valves and fittings are normally estimated
using specification and research data. Due to the uncertainty of these
estimated values and provision for possible changes during installation
112 Chapter Four
TABLE 4.1 Pump Affinity Laws
Change in speed (N) Change in impeller diameter (D)
Flow (Q)
Pressure (⌬p)
Power (P) P
2
5 P
1
a
D
2
D
1
b Q
2
5 Q
1
a
N
2
N
1
b
to suit site constraints, safety factors are added to the design. The safety
factor can range from a few percent to as high as 100 percent. As a
result, a pump can end up being over sized for the particular applica-
tion, as illustrated in Fig. 4.11.
Figure 4.11 illustrates a case where the system curve used at the
design stage has a high safety factor incorporated into it. The pump is
selected to intersect this design system curve at the design flow to give
the design operating point. However, since the design system curve has
a high safety factor, the actual system curve the pump experiences may
be quite different. This results in the pump operating point moving
along the pump curve to where it intersects the actual system curve,
leading to a higher than required pump flow rate.
Since the pumping power is related to the cube of the flow rate, over-
pumping by 20 percent results in 50 percent increase in pumping power
consumption. For chilled water, overpumping can also lead to increase
in the chilled water supply temperature since chillers are unable to pro-
vide chilled water at the design value when the flow rate is exceeded.
This can result in less moisture removal at the terminal units, since the
moisture removal ability of cooling coils is dependent on the coil tem-
perature.
Usually, when pumps are oversized, they are either operated to give
higher than required flow rates or a pressure loss is artificially created
in the system by adding a throttling valve. Usually, globe valves or bal-
ancing valves are used in the system to add sufficient resistance to the
system to move the actual system curve so that it intersects the pump
curve at the originally designed operating point (Fig. 4.12).
Although operationally it may be possible to tolerate these options,
they should not be accepted from an energy-efficiency point of view as
higher than required flow or pressure results in higher pumping power
consumption.
Pumping Systems 113
Design system curve
Pump curve at design speed
P
r
e
s
s
u
r
e
Flow
Required operating point
Design flow Actual flow
Actual system curve
Figure 4.11 Over sized pump for application.
In such a situation, the design flow rate can be achieved by reducing
the impeller diameter (trimming impeller) or reducing the speed of the
pump (using a variable speed drive). Variable speed drives (VSDs) are
also sometimes called variable frequency drives (VFDs) or adjustable fre-
quency drives (AFDs). They are devices that can convert the frequency
of the utility power supply and provide an adjustable output voltage and
frequency to vary the speed of motors.
The resulting energy saving due to speed reduction and impeller
diameter reduction is illustrated in Figs. 4.13 and 4.14.
The decision to reduce the speed or impeller diameter will depend on
the relative cost for the two options. Normally, reducing the pump speed
using a VSD is preferable since it can be used to vary the pump speed
and capacity if the load changes in the future. Also, reducing the impeller
diameter can result in a bigger drop in pump efficiency when compared
to the use of VSDs for reduction of speed. However, if the existing pump
is old and due for replacement, the option of replacing the pump with a
correctly-sized new pump should also be considered.
114 Chapter Four
Pressure absorbed by throttling
Actual system curve
Design system curve
Pump curve at design speed
Pressure
Flow
Required operating point
Design flow Actual flow
Figure 4.12 Oversized pump with throttling.
Figure 4.13 Energy consumed by pump that is “throttled”
to give the design flow.
Actual system curve
Design system curve
Pump curve
P
r
e
s
s
u
r
e
Flow
Design flow
Energy consumed
Usually, measurements of system flow rate and pressure are required
for estimating the savings potential through reducing pump speed, trim-
ming the impeller, or replacing the pump.
The simplest method of estimation is by using the pump affinity
laws, as illustrated in Example 4.2. The value of measured flow can
be used together with the operating pump speed to find the new speed
and thereby the required flow. Thereafter, the computed new speed can
be used to estimate the resulting power consumption, as illustrated
below.
Example 4.2 A pump is designed to pump 10 L/s of water when operating at
1400 rpm. Under actual operating conditions, the water flow is 15 L/s and the
pump motor consumes 15 kW. Calculate the reduction in pump power consump-
tion if the pump speed is reduced to provide the design water flow of 10 L/s.
From pump affinity laws, the pump speed can be reduced to give the design flow
as follows:
New pump speed ϭ 1400 ϫ (10/15) ϭ 933 rpm
New power consumption ϭ 15 ϫ (10/15)
3
ϭ 4.5 kW
Reduction in pump power consumption ϭ 15 – 4.5 ϭ 10.5 kW
Abetter, more accurate estimate can be made if the pump curves are
available for the particular pump in use. The measured flow rate and
pressure, which is the current operating point, can be plotted on the
pump curve, as shown in Fig. 4.15. Then, the system curve can be plot-
ted assuming a parabolic relationship. On this system curve, the required
operating point can be marked by drawing a vertical line at the value
of the required flow. Manufacturers’ pump curves can then be used to
find the new pump speed or impeller diameter by interpolation, as
shown in Fig. 4.15. Once the required impeller size or speed is selected,
the manufacturer’s curves can also be used to estimate the motor power
consumption at the new operating point.
Pumping Systems 115
New pump curve
Actual system curve
Original
pump curve
Flow
Design flow
Energy consumed
Energy saved
P
r
e
s
s
u
r
e
Design system curve
Figure 4.14 Energy consumed
by the same pump if impeller
diameter or speed is reduced to
give the design flow.
4.5.2 Variable flow
The sizing of pumps is done based on a set of design conditions, and in
buildings, since their cooling or heating load varies with time, pumps
are sized to satisfy peak load conditions.
Water distribution systems use either 2-way or 3-way valves to vary
the flow of water through the coils and thereby control the amount of cool-
ing or heating performed by the coils, as shown in Figs. 4.16 and 4.17.
In systems using 2-way valves, water flow through coils is controlled
by restricting the flow directly using the valves. In systems using 3-way
valves, flow through the coils is controlled by bypassing some of the
water from the inlet of the coil to the outlet of the coil.
In systems using 3-way valves, the flow of water through the system
has to be kept constant irrespective of the load. Therefore, for example,
if the system shown in Fig. 4.17, is designed to operate two chillers at
peak load (the third chiller is kept as standby), then two chilled water
pumps need to be operated even at times when the load can be satisfied
by one chiller. This necessitates operating the second chiller when it is
116 Chapter Four
Flow (l/s) 10 15
System curve
Pump curve for
current impeller size
P
r
e
s
s
u
r
e
Current operating point
Required operating point
Required impeller size
Figure 4.15 Using pump curves to select a suitable impeller size.
1 2 3
Chillers
or
boilers
Pumps
By-pass
pipe
Cooling
coils
Control
valves
Figure 4.16 Water pumping systems with 2-way valves.
not required or running the second pump when the chiller is not in
operation (leading to possible rise in chilled water supply temperature).
Owing to these shortcomings, systems using 3-way valves are not pop-
ular and those with 2-way valves are generally preferred.
In variable water flow systems with terminal units having 2-way
modulating valves, reduction in cooling load causes the modulating
valves to close, resulting in reduced water flow. If the pumps are con-
stant speed pumps, this causes the pump operating point to move
along the pump performance curve by increasing the system pressure
(Fig. 4.18).
However, in such situations, if the speed of the pump can be varied,
the pump can be operated at a lower speed to provide the required flow.
Since the power consumed by pumps is directly proportional to the cube
of the speed (cube law), significant savings can be achieved if pumps are
fitted with VSDs (Fig. 4.19).
Pumping Systems 117
1 2 3
Chillers
or
boilers
Primary
pumps
By-pass
pipe
Coils
3-ways
valves
Figure 4.17 Water pumping systems with 3-way valves.
Operating point at full-load
Operating point at part-load
Pump curve
P
r
e
s
s
u
r
e
Flow
At part-
load
Change in operating
point due to valve
At full-
load
Energy consumed
Figure 4.18 Pump operating point for system with 2-way
valves and constant speed water pumping (valve control).
4.5.3 Primary-secondary systems
Two types of variable speed pumping systems are used for chilled water
pumping. The most common system is the primary-secondary pumping
system where two sets of pumps are used, as shown in Fig. 4.20. The
first set of pumps, or primary pumps, is used to pump water through
the chillers. The second set of pumps or secondary pumps, is used to
pump water through the building distribution system. The primary
pumps operate at constant speed and provide a fixed chilled water flow
through each chiller in operation. The secondary pumps are operated
based on the chilled water requirements of the building. The speed of
the secondary pumps are varied based on the cooling load, which is nor-
mally sensed using a differential pressure sensor located at the hydrauli-
cally furthest AHU (air handling unit). The primary and secondary
loops are hydraulically isolated using a decoupler pipe. The purpose of
the decoupler is to ensure that the primary system is not affected by flow
118 Chapter Four
Operating point at full-load
Pump curves at
different speeds
P
r
e
s
s
u
r
e
Flow
At part-
load
At full-
load
Energy consumed
Operating point at part-load
Figure 4.19 Pump operating point for system with 2-way valves
and variable speed pumping (pump control).
1 2 3 Chillers
Primary
pumps
Decoupler
pipe
Cooling
coils
Control
valves
Secondary pumps
Figure 4.20 Arrangement of primary-secondary pumping systems.
and pressure variations in the secondary system. This enables the pri-
mary pumps to maintain a constant flow rate through the chillers
regardless of building’s cooling load.
The primary pumps circulate a fixed chilled water flow in the primary
circuit, while the secondary pumps provide sufficient flow to the cooling
coils to satisfy the cooling load. The difference in the chilled water flow
between the primary and secondary systems passes through the decou-
pler pipe. As explained earlier in chiller sequencing, the flow in the decou-
pler should be from the chilled water supply side to the return side. If the
chilled water flow in the decoupler is in the opposite direction, it indicates
that there is insufficient flow in the primary circuit and therefore an
additional primary pump (together with a chiller) needs to be operated.
Variable chilled water flow systems using primary-secondary pump-
ing are generally preferred since they are able to maintain a constant
flow of chilled water through the chillers while varying the flow of chilled
water in the distribution system. This satisfies the requirement of many
chillers for a constant flow of chilled water through the evaporator tubes
to enable stable operation (prevents safety systems shutting down
chillers to avoid tube freezing caused by sudden reduction in flow).
Constant chilled water flow also helps to maintain the heat transfer coef-
ficient in the evaporator of the chiller.
Although the speed of the primary pumps cannot be reduced at part-
load, they are generally small and are sized to pump chilled water only
through the primary chiller circuit. This enables the speed of the much
larger secondary pumps to be reduced at part load without affecting the
performance of the chillers.
Recent improvements in chiller controls have made it possible for
chillers to operate with some variation of chilled water flow through the
evaporator tubes. This has led to the use of VSDs on pumping systems
that have only primary pumps. Atypical arrangement of primary pumps
with VSDs is shown in Fig. 4.21.
In contrast to primary-secondary systems, this system varies the flow
of water through the entire system, including the evaporators of the
chillers and the cooling coils. The chillers are sequenced based on the
cooling load computed using the flow rate FM and chilled water return
and chilled water supply temperature sensors, T
R
and T
S
, respectively.
Motorized valves interlocked to the chillers are used to prevent chilled
water circulation through chillers not in operation.
The VSDs of the chilled water pumps are controlled based on the dif-
ferential pressure sensor DP-2 to maintain a set differential pressure
across the furthest AHU. The motorized bypass valve is controlled using
differential pressure sensor DP-1 to maintain a minimum differential
pressure across the chillers to ensure minimum flow. If the chilled water
flow is too low, the differential pressure sensor DP-1 will sense that the
Pumping Systems 119
pressure is below set point and will open the bypass valve, enabling some
water to by pass and circulate through the chillers. Due to this bypass-
ing of chilled water, the differential pressure sensor DP-2 will sense a drop
in pressure and will signal for the speed of the pumps to be increased. The
system should be designed to ensure that the flow is maintained within
minimum and maximum flow limits for chillers (usually 0.9–3.4 m/s).
One of the main advantages of variable primary flow systems is the
cost savings resulting from eliminating secondary distribution pumps
and their associated piping.
However, before implementing a variable primary flow system, it is
necessary to confirm that the chiller controls are able to support it and
that savings achievable is greater than for a primary-secondary system.
Example 4.3 illustrates how savings can be estimated for different
pumping systems.
Example 4.3 Consider a single building with a 500-RT peak cooling load The pump-
ing power consumed for three options (see Figs. 4.22 to 4.24); constant speed pump-
ing (base case – no VSDs), variable primary flow pumping (VSDs on primary pumps),
and primary-secondary pumping (VSD on secondary pumps) are considered.
The first option (Fig. 4.22) with constant speed pumps is where the pumping
power remains relatively constant irrespective of the building’s cooling load. The
system has 2-way valves and the pump operating point “rides” on the pump curve
(lower flow–higher pressure) at part load, as explained earlier. The same also
applies for systems with 3-way valves, where the flow rate remains constant irre-
spective of load.
If the chillers are 250 RT capacity each, only two chillers need to be operated
at peak cooling load of 500 RT. Therefore, at cooling loads up to 250 RT, only one
pump needs to be operated while two pumps are needed at other times.
If the chilled water system is designed for a ⌬T (difference in chilled water
return and supply temperatures) of 5.6ЊC (10ЊF), the chilled water flow rate
required for each 250-RT chiller is 37.8 L/s (600 USgpm). Assuming a total system
120 Chapter Four
C
h
i
l
e
r
#
1
C
h
i
l
e
r
#
2
C
h
i
l
e
r
#
2
Cooling
coils
Control
valves
Supply main
DP-1 DP-2
VSD
VSD
FM
TR
Ts
Isolation
valves
Figure 4.21 Variable primary flow system.
head of 210 kN/m
2
(70 ft. water), and pump and motor efficiencies are 80 percent
each, the theoretical pump power consumption can be calculated as follows:
From Eq. (4.5),
(4.6)
where P ϭ pump power consumption, kW
Q ϭ flow rate, m
3
/s
⌬P ϭ pump head, N/m
2
p
ϭ pump efficiency
m
ϭ motor efficiency
For operating two pumps,
P ϭ [0.0378 ϫ 2 ϫ 210 ϫ 10
3
]/[1000 ϫ 0.8 ϫ 0.8] ϭ 24.8 kW
Therefore, when two chillers operate, the pumping power will be 24.8 kW.
When one pump operates, the motor power can be taken as 12.4 kW (in actual oper-
aton, it will not be exactly half).
The second option (Fig. 4.23) considers variable speed primary pumps. The
theoretical pumping power is estimated using the affinity laws. Although the
actual pump power consumption may not follow this relationship exactly due
to drop in pump efficiency at lower speeds, it is convenient to use this rela-
tionship for estimation purposes. It is also assumed that the minimum chilled
water flow required by the chillers is 50 percent (pump speed can be reduced
by 50 percent).
In option 3 (Fig. 4.24), which is a primary-secondary system, the total system
head is assumed to be made of 60 kN/
2
(20 ft. water) for the primary circuit and
150 kN/m
2
(50 ft. water) for the secondary circuit. The pump and motor efficien-
cies are taken to be 80 percent. Using Eq. (4.6), the motor power consumption for
primary pump and secondary pump, at 100 percent speed, can be computed as
follows:
Therefore, P 5
sQ 3 ⌬Pd
s1000 3
p
3
m
d
Pump brake horsepower 5
flow rate sm
3
/sd 3 pressure difference sN/m
2
d
1000 3 efficiency
Pumping Systems 121
1 2 3 Chillers
Chilled
water
pumps
By-pass
pipe
Cooling
coils
Control
valves
Figure 4.22 Option 1—constant speed pumps.
Primary pumps
P ϭ [0.0378 ϫ 2 ϫ 60 ϫ 10
3
]/[1000 ϫ 0.8 ϫ 0.8] ϭ 7.0 kW (2 pumps)
Secondary pumps (at full capacity)
P ϭ [0.0378 ϫ 2 ϫ 150 ϫ 10
3
]/[1000 ϫ 0.8 ϫ 0.8] ϭ 18.0 kW (2 pumps)
Based on this, for simplicity, primary pumps and secondary pumps are assumed
to consume 3.5 kW and 9 kW each, respectively, at full load. At part load, the sec-
ondary pumps are assumed to follow the pump affinity laws for flow, head, and power
consumption. The minimum operating speed for the pumps is taken as 40 percent.
The pumping power consumed for the three options for a typical load profile is
summarized in Table 4.2.
Notes:
Option 1—Pump power for option 1 is taken as 12.4 kW for one pump and 24.8 kW
for two pumps.
122 Chapter Four
C
h
i
l
e
r
#
1
C
h
i
l
e
r
#
2
C
h
i
l
e
r
#
3
Cooling
coils
Control
valves
Supply main
DP-1 DP-2
VSD
VSD
FM
TR
Ts
Isolation
valves
Figure 4.23 Option 2—variable primary flow.
1 2 3 Chillers
Decoupler
Primary
pumps
Cooling
coils
Control
valves
VSD
VSD
VSD
DP
Figure 4.24 Option 3—primary secondary system.
1
2
3
TABLE 4.2 Summary of Pumping Power for Options 1, 2, and 3
Building
Pumping power (kW)
Daily
kWh consumption per day
cooling
Option 3
operating
Loading load (RT) Option 1 Option 2 Primary Secondary hours Option 1 Option 2 Option 3
100% 500 24.8 24.8 7.0 18 3 74.4 74.4 75
90% 450 24.8 18.1 7.0 13 8 198.4 144.6 161.0
80% 400 24.8 12.7 7.0 9 4 99.2 50.8 64.9
70% 350 24.8 8.5 7.0 6 3 74.4 25.5 39.5
60% 300 24.8 5.4 7.0 4 3 74.4 16.1 32.7
50% 250 12.4 12.4 3.5 2 2 24.8 24.8 11.5
40% 200 12.4 6.3 3.5 1 1 12.4 6.3 4.7
Total 558 343 389
Option 2—Pump power is taken to vary according to the cube law up to a min-
imum speed of 50 percent.
Option 3—Primary pump power is taken as 3.5 kW each (7 kW for two pumps)
and the secondary pump power consumption is taken to vary according to the cube
law up to a minimum speed of 40 percent.
Table 4.2 shows that for the particular operating pattern considered (load pro-
file and operating hours), the lowest daily power consumption is achieved for
options 2 and 3. Although option 2 has a 12 percent lower power consumption than
option 3, option 3 may still be preferred from an operational standpoint.
In a case where a single central chilled water plant supplies chilled
water to multiple buildings that have different chilled water require-
ments (different cooling loads and pressure heads), primary-secondary
systems would be more advantageous as the secondary pumps can be
sized to suit the requirements of different buildings (see Fig. 4.25).
If buildings Aand B are office towers that have a higher chilled water
flow and pressure head requirement compared to building C, which is
a podium block with retail outlets, the secondary pumps for the podium
block can be sized to match the lower flow and head requirements of this
building. However, if only primary pumps are used in this situation, the
pumps have to be sized to satisfy the higher capacity requirements of
the office blocks and will end up pumping chilled water at higher than
required pressure to the podium block, wasting much pumping energy.
Since the pumping energy savings depends on factors such as the load
profile, building pressure head, and configuration of buildings, the choice
of whether the VSDs should be on primary or secondary pumps (to max-
imize savings) should depend on the actual installation. Nonetheless,
124 Chapter Four
To building A
To building B
To building C
Chilled water
Return from
Buildings A, B and C
1 2 3 Chillers
Primary
pumps
Decoupler
pipe
Figure 4.25 Arrangement of a primary-secondary system to serve multiple buildings.
from a practical point of view, it may be better to have a primary-sec-
ondary system with VSDs on secondary pumps since it would enable
higher variations in the flow without affecting the chiller performance.
However, it should be noted that when reducing the speed of pumps, the
speed should not be reduced by more than about 40 percent to ensure suf-
ficient lubrication of pump seals and cooling of the motors.
4.5.4 Reset of variable flow pump set point
Further energy savings from chilled water pumping can be achieved by
varying the differential pressure set point used for controlling the VSD
speed according to demand. In such a system, a building automation or
energy management system (BAS or EMS) can be used to monitor the
position of the control valves at the AHUs and reduce the differential
pressure set point, while ensuring that none of the valves are starved
of chilled water. A possible control strategy is shown in Fig. 4.26.
The position of all the AHU chilled water modulating valves are mon-
itored and the valve that is open most is determined. The value of valve
position is compared with limits set for adjusting the set point. For
example, if the maximum valve position
Pumping Systems 125
Determine position of
each valve
Determine valve open most
(POS
MAX
)
POS
MAX
70%–90%
>90% <70%
VSD at
minimum
VSD at
100%
Decrease
pressure
setpoint
Increase
pressure
setpoint
Delay
Yes
Yes
No No
Figure 4.26 Control strategy for optimizing variable speed chilled
water pumps.
chilled water. This constant readjustment of the set point, used for con-
trolling the speed of the secondary chilled water pumps, can help to fur-
ther improve the efficiency of chilled water pumping systems.
4.5.5 Optimizing condenser cooling
systems
As in the case of chilled water pumping systems, if the condenser water
pumps are oversized for the application and the pumps are either pro-
viding too much flow or the flow is throttled using valves, pump capac-
ity can be reduced by lowering the operating pump speed or reducing
impeller diameter. Both measures will normally result in significant sav-
ings in energy consumption.
The choice of whether to reduce the impeller diameter or reduce the
pump speed will depend on the cost for each option. Normally, reduction
in pump speed using a VSD is preferred due to flexibility in implemen-
tation. This option also results in better operating efficiency as reduc-
ing the impeller diameter can significantly effect pump efficiency.
Condenser water pumping using variable flow systems (where pump
speed is varied based on the load) does not normally yield significant
energy savings. This is because at part load, full design condenser water
flow results in a lower condenser water return temperature (when load
drops, if flow rate is the same, the ⌬T drops, and because the condenser
water supply temperature is the same, the condenser water return tem-
perature is reduced), which results in better chiller efficiency. As shown
in Fig. 4.27, condenser water enters the condenser at temperature T
S
and leaves the condenser at temperature T
R
. The condensing tempera-
ture, T
C
, depends on the condenser approach temperature, which is the
difference between the condensing temperature and condenser water
leaving temperature (T
C
– T
R
). The condenser approach temperature
depends on heat transfer characteristics such as the thickness of the
condenser tubes and fluid velocity in the tubes. Therefore, the approach
temperature remains constant at part load, and lower condenser water
return temperature (T
R
) results in lower condensing temperature (T
C
)
at part load.
Lower condensing temperature and pressure leads to lower com-
pressor power, as seen in the p-h diagram of an ideal refrigeration cycle
(Fig. 4.28). The energy savings made due to improvement in chiller effi-
ciency at part load normally exceeds the possible pumping savings that
can be achieved by reducing condenser water flow rate at part load.
4.5.6 Pressure drop (⌬P) across chillers
When water flows through the evaporator or condenser tubes of
chillers, a pressure drop results due to the flow resistance offered by
126 Chapter Four
the tubes. The pressure drop is dependent on the flow velocity in the
tubes, which in turn is dependent on the water flow rate and tube
cross-sectional area.
Higher pressure drop across a chiller evaporator and condenser neces-
sitates the chilled water and condenser water pumps to work against a
higher pressure difference to deliver the same flow rate. This results in
Pumping Systems 127
Liquid
refrigerant
Condenser
water
return (TR)
Condenser (Tc)
Refrigerant
vapour
Condenser
water supply
(Ts)
Tc
Tc
Tc–TR = Condenser approach
Temperature
TR
Ts
Figure 4.27 Effect of condenser water temperature on the performance of the condenser.
Evaporator
Condenser
Expansion
device
Compressor
Enthalpy
P
r
e
s
s
u
r
eReduction in pressure
differential due to decrease
in condensing pressure
Decrease in condenser water
temperature
Figure 4.28 Effect of reducing condenser water temperature.
higher power consumption by the pump, since pumping power is directly
proportional to the flow and pressure head (kW ϰ Q ϫ ⌬P).
Usually, a pressure drop across chillers is not considered an impor-
tant criteria when selecting chillers as more emphasis is given to cri-
teria such as efficiency, cost, and brand of chiller. This some times
leads to selection of chillers with high pressure drops, which, in turn,
leads to higher energy consumption by the pumps, as shown in
Example 4.4.
Example 4.4 Consider the following two chiller options A and B.
Using the following equation, the theoretical pump power consumption to over-
come the resistance across the evaporator can be calculated as follows (assuming
efficiency of 100 percent):
Pump kW ϭ [Flow in m
3
/s ϫ Pressure difference in N/m
2
]/1000
Option A, pump kW ϭ [0.0756 ϫ 90,000]/1000 ϭ 6.8 kW
Option B, pump kW ϭ [0.0756 ϫ 30,000]/1000 ϭ 2.3 kW
Pump kW savings due to Option B ϭ (6.8 Ϫ 2.3) ϭ 4.5 kW
The same exercise can be performed to compute the extra pumping power con-
sumption due to different condensers’ pressure drops for chillers.
4.5.7 Pressure losses in pipes and fittings
When a liquid flows through a piping system, head or pressure losses
take place due to fluid friction in the piping and resistance offered to the
flow by the various devices such as valves, strainers, and bends used in
the piping system.
The friction losses depend on the pipe material, length of the piping,
fluid velocity, and properties of the fluid. Therefore, for a given fluid such
as water, the friction losses can be reduced by minimizing pipe length
and reducing flow velocity (increasing pipe diameter).
On the other hand, for a particular flow velocity, losses due to vari-
ous fittings and devices installed on piping systems depend on the design
of the device or fitting. Therefore, for a given flow velocity, different
types of valves can have different losses associated with them.
Option A Option B
Chiller capacity 500 RT 500 RT
Pressure drop across 90 kN/m
2
30 kN/m
2
evaporator (30 ft water) (10 ft water)
Chilled water flow rate 75.6 L/s 75.6 L/s
(1200 USgpm) (1200 USgpm)
128 Chapter Four
The losses for different types of valves can be significantly different
and, therefore, one has to be careful when selecting valves for different
applications. For instance, globe type valves are commonly used as iso-
lation valves in chilled water and condenser water piping systems.
These valves have a high-pressure drop even when they are fully open
due to the change in direction the flow has to make when passing
through them. On the other hand, butterfly valves, when fully open, offer
little or no resistance to the flow. Therefore, to minimize pumping energy
consumption, valves with low resistance (when fully open), such as but-
terfly valves, should be used for flow isolation.
Further, pipe fittings such as bends, elbows, tees, and flow transition
devices should also be selected to minimize head losses in the system.
4.5.8 Condenser water systems
for package units
Some buildings use water-cooled package units to provide air-condi-
tioning. In such systems, the package units are installed in different
parts of the building to serve the different areas. Water-cooled package
units reject the heat absorbed to the condenser water in the condenser
of each unit. Such package units are normally served by a central con-
denser water system consisting of pumps, cooling towers, and a network
of piping, as shown in Fig. 4.29.
Very often, in buildings using such systems, individual package units
are scheduled to operate at different times, depending on the requirement
of each user. This can result in condenser water circulating through
package units that are not in operation if individual package units cannot
be isolated from the condenser water system. This leads to pumping of
more condenser water than necessary and wastage of pumping power.
Such situations can be avoided if on-off valves are installed on the
condenser water pipes serving each water-cooled package unit and
Pumping Systems 129
Figure 4.29 Arrangement of a condenser water system
serving package units.
Pumps
Cooling
towers
Package units
are linked to the operation of the package units. This will enable the
condenser water flow to each unit to be automatically switched on or
off, depending on its operation. The condenser water pumps can be
fitted with variable speed drives and a control system to maintain a
minimum set pressure (P) for the condenser water system, as shown
in Fig. 4.30.
4.5.9 Efficiency of pumps
The equation for pump brake horsepower (discussed earlier) is:
Pump brake horsepower
The overall pumping efficiency refers to, both, the pump and motor
efficiencies, and pumping power can be expressed as follows:
where P ϭ pump power consumption, kW
Q ϭ flow rate, m
3
/s
⌬P ϭ pump head, N/m
2
p
ϭ pump efficiency
m
ϭ motor efficiency
P 5
sQ 3 ⌬Pd
s1000 3
p
3
m
d
5
flow rate sm
3
/sd 3 pressure difference sN/m
2
d
1000 3 efficiency
130 Chapter Four
Figure 4.30 Arrangement of variable flow condenser water
system.
Pumps
Cooling towers
Package units
VSD Controller
P
On/Off
Valves
(interlocked
with package
units)
Therefore, to minimize pumping power, the pump efficiency should
be as high as possible. This can be done be selecting suitable pumps,
which have a high efficiency (above 85 percent) at the desired operat-
ing point.
Figures 4.31 and 4.32 show two sets of pump curves for pump A and
pump B. As the figures show, both pumps are able to operate at the
desired operating point of flow rate, Q, and pressure, P. However, based
on the performance curves, pump A will operate at 90 percent while
pump B will only be able to operate at 78 percent (estimated by inter-
polation) at the desired operating point.
Pump efficiency also depends on capacity, and bigger capacity pumps
tend to be more efficient than smaller capacity ones. Therefore, it is
generally better to have a few higher capacity pumps than many
smaller capacity pumps to perform the same duty. This is the advan-
tage of having variable speed chilled water pumping systems where
Pumping Systems 131
Pump curves
Required operating point
Flow
Q
P
r
e
s
s
u
r
e
P
75% 80%
85%
90%
Figure 4.31 Operating point for pump A.
Figure 4.32 Operating point for pump B.
90%
Pump
curves
85%
Required
operating point
Flow
Q
P
r
e
s
s
u
r
e
P
80%
the number of pumps does not have to be the same as the number of
chillers because pump capacity can be varied to match load require-
ments (Fig. 4.23).
Example 4.5 Apumping system requires a pump with a capacity of 80 L/s and a
head of 150 kN/m
2
. Calculate the savings that can be achieved in pump power if
a pump having 90 percent efficiency is used instead of a pump with 78 percent
efficiency for this application.
From Eq. (4.6),
If the motor efficiency
m
is taken as 1.0,
Saving in pump power
ϭ 2.05 kW
4.6 Summary
Pumps are used in buildings mainly for air-conditioning and heating
systems. Pumping systems normally account for the second highest
energy consumption in buildings. This chapter covered the basics of
pumping systems, such as open and closed systems, pump character-
istics, and pump curves and system curves, followed by an overview of
the pumping systems used in buildings for air-conditioning and heat-
ing systems. Thereafter, various energy management strategies for
building chilled water, hot water and condenser water pumping systems
were described.
Review Questions
4.1. A pump delivers 200 L/s at 1200 rpm and consumes 45 kW. If the pump
speed is reduced to 1100 rpm, what will the new flow rate and power con-
sumption be?
4.2. Apump is selected to provide 20 L/s of water when operating at 1200 rpm.
Under actual operating conditions, the water flow is 35 L/s and the pump
motor consumes 25 kW. What will the reduction in pump power con-
sumption be if the pump speed is reduced to provide the design water flow
of 20 L/s?
5
s0.08 3 150 3 10
3
d
1000
a
1
0.78
2
1
0.9
b
5
sQ 3 ⌬Pd
1000
a
1
78 %
2
1
90%
b
P 5
sQ 3 ⌬Pd
s1000 3
p
3
m
d
132 Chapter Four
4.3. The condensers of two different chillers of equal capacity have pressure
drops of 80 kN/m
2
and 40 kN/m
2
, respectively. If the water flow rate
required is 150 L/s, calculate the saving in pump power for the condenser
water pump if the chiller with the lower pressure drop is used instead of
the chiller with the higher pressure drop.
4.4. A pumping system requires a pump with a capacity of 40 L/s and a head
of 120 kN/m
2
. If a pump having 85 percent efficiency is used for this appli-
cation instead of a pump with 65 percent efficiency, what is the saving in
power required to drive the pump?
Pumping Systems 133
135
Chapter
5
Cooling Towers
5.1 Introduction
Cooling towers are used to reject heat from air-conditioning systems and
process-cooling systems. They reject heat into the atmosphere through
sensible and latent heat transfer. In air-conditioning systems, cooling
towers are used with water-cooled central chiller systems and water-
cooled package units. A typical application of cooling towers in central
water-cooled chiller systems is shown in Fig. 5.1.
Cooling towers generally consist of water spray systems, “fill” pack-
ing material, and fans. Spray systems are used to spread the warm
water being cooled over the fill packing, which acts as a heat transfer
medium by increasing the contact surface area. Fans are used to induce
ambient air flow through cooling towers to facilitate heat transfer
between the warm water and the ambient air.
Cooling towers reject heat mainly by evaporative cooling. When water
is sprayed in cooling towers, some of the water evaporates, absorbing
heat from the surrounding water, thereby cooling it. The amount of
latent heat transferred depends on the moisture content of the air; the
more dry the air (lower the wet-bulb temperature), the more latent heat
that will be transferred. In addition, sensible cooling also takes place
between the warmer water and colder air. The amount of sensible cool-
ing depends on the dry-bulb temperature of air. Therefore, the amount
of heat rejected from cooling towers depends on, both, the dry-bulb and
wet-bulb temperatures of the outdoor air.
Cooling towers used for building applications are normally of the
counterflow or crossflow type. Counterflow cooling towers have square
or round cross sections and take air from the sides. Crossflow cooling
136 Chapter Five
towers have rectangular cross sections and take air only from the two
long sides. The air flow in cooling towers can be either induced draft,
where fans pull air out of cooling towers, or forced draft, where fans force
air into cooling towers. Cooling towers can be forced-draft counterflow
(Fig. 5.2), induced-draft counterflow (Fig. 5.3), forced-draft crossflow
(Fig. 5.4), or induced-draft crossflow (Fig. 5.5).
Cooling towers are manufactured in different sizes and capacities to
match various cooling requirements. They are selected for a particular
application based on the entering temperature of the warm water to be
cooled, leaving temperature to which the water needs to be cooled, the
flow rate of the water, and the wet-bulb and dry-bulb temperatures of
the ambient air.
Cooling towers used in central air-conditioning systems are commonly
sized to receive water at 35ЊC (95ЊF) and provide water to the chillers
Condenser water pumps Chilled water pumps
Fans
Chillers
Cooling
towers
Cooling coils
Figure 5.1 Central chiller system with cooling towers.
Cold water out
Air flow
Fill material
Warm water spray
Fan
Air discharge
Figure 5.2 Arrangement of forced-draft counterflow cooling
tower.
Cooling Towers 137
at 29.4ЊC (85ЊF). This difference between return and supply tempera-
tures of water is called the “range.” Since cooling tower performance
depends on the wet-bulb temperature of air, they are normally selected
to operate at a specific “approach” temperature, which is the difference
between the temperature of water leaving the cooling tower and the wet-
bulb temperature of the air.
Theoretically, cooling towers are able to cool water to the wet-bulb
temperature of the air. However, this would require a very large cool-
ing tower surface area. Therefore, cooling towers are normally designed
to economically cool water to an approach temperature of about
2.8ЊC (5ЊF).
Cold water out
Air flow
Fill material
Warm water spray
Fan
Air discharge
Figure 5.3 Arrangement of induced-
draft counterflow cooling tower.
Figure 5.4 Arrangement of forced- draft crossflow cooling
tower.
Cold water out
Fill material
Warm
water
Fan
Air
discharge
Air flow
5.2 Energy Saving Measures for Cooling Towers
5.2.1 Cooling tower sizing
Cooling towers in central air-conditioning systems need to reject not only
the heat removed from the air-conditioned space but also the heat added
by the compressors of chillers. The heat of compression added by a com-
pressor depends on the efficiency of the chiller, and is usually about
25 percent of the cooling load. Therefore, cooling towers need to be sized
to reject approximately 125 percent of the chiller cooling capacity.
Sizing of cooling towers is important to ensure that chiller efficiency
is optimized. If the cooling towers are undersized for the chillers, the con-
denser water supply temperature will rise and chiller efficiency will be
reduced. Similarly, if the condenser water temperature from the cool-
ing towers can be lowered, chiller efficiency can be improved.
Cooling towers are theoretically able to produce condenser water at
the wet-bulb temperature of air. However, to achieve this, it is necessary
to have cooling towers with higher surface area and air flow. Although
such a design will lead to better chiller efficiency (due to lower con-
denser water temperature), it will also result in higher capital cost and
operating cost as extra cooling towers need to be used.
Also, for the same cooling load, if the cooling tower surface area is
increased (oversized cooling tower is used), the air flow can be reduced,
leading to lower cooling tower fan power but higher first cost for the cool-
ing towers. Therefore, the sizing of cooling towers is a compromise
138 Chapter Five
Cold water out
Warm water spray
Air discharge
Warm water spray
Fill material
Figure 5.5 Arrangement of induced-draft crossflow cooling tower.
between the initial capital cost of the cooling towers and the running cost
of the chillers and cooling towers.
The selection of cooling towers should be based on the condenser water
supply and return temperature requirements of the chiller and the design
conditions for outdoor wet-bulb temperature for the region. The most
common design conditions are condenser water return from chillers at
35ЊC (95ЊF), condenser water supply to the chiller at 29.4ЊC (85ЊF), and
wet-bulb temperature of 26.7ЊC (80ЊF). Often cooling tower suppliers rate
cooling tower capacities at different operating conditions. If the cooling
tower capacity is rated at a wet-bulb temperature higher than what the
cooling tower is going to experience, the resulting capacity of the cooling
tower will be lower than the rated value during operation. Therefore, in
such situations, the rated capacity of the cooling tower needs to be “der-
ated” to account for different operating conditions. As a rule of thumb, cool-
ing towers with “nominal capacity” (cooling tower rated capacity) of
1.5 times the chiller’s maximum rated capacity are used.
5.2.2 Capacity control
The operation of cooling towers is usually interlocked with that of
chillers so that when chillers are switched on or off, based on the cool-
ing load, the operation of cooling towers also follows suit. In climates
with low ambient temperatures, condenser water supplied to the chillers
has to be maintained above the minimum temperature required by
chillers.
In such situations, a bypass valve is used in the condenser water cir-
cuit to enable some condenser water to bypass the cooling towers, as
shown in Fig. 5.6. Acontrol system is used to sense the temperature of
condenser water entering the chillers and maintain it by varying the
flow of condenser water to the cooling towers. However, such control sys-
tems are not required in climates where ambient conditions do not
result in low condenser water temperature.
The capacity of cooling towers is dependent on the air flow through
them. Therefore, when the chillers operate at part load (when cooling load
is low), the amount of heat to be rejected at the cooling towers is also low.
Under such operating conditions it is not necessary to run the cooling
towers at full capacity. The cooling tower capacity can be reduced by reduc-
ing the air flow, which would result in lower fan energy consumption.
One way of achieving this is by cooling tower fan cycling, where some
fans are switched on or off to control condenser water temperature.
This, however, can result in a swing in condenser water temperature and
can cause premature wear and tear of motor drives.
A better way is to use variable speed drives (VSDs) to control cool-
ing tower fan speed. As shown in Fig. 5.7, the speed of the cooling tower
fans in operation can be modulated to maintain a set temperature.
Cooling Towers 139
140 Chapter Five
Figure 5.7 Cooling towers with variable speed fans.
Condenser water
return from
chillers
Controller
Condenser water
supply to chillers
VSD VSD VSD
Colling
tower 1
Colling
tower 2
Colling
tower 3
T
Tower
bypass
valve
Chiller
condenser
Condenser
water pump
Colling
tower
Figure 5.6 Cooling tower water flow control.
The easiest control strategy is to maintain the condenser water supply
temperature at the design value. Therefore, for a system designed to
provide condenser water at 29.4ЊC (85ЊF), the control system can be used
to provide condenser water at this set value by modulating the cooling
tower fan speed. However, it should be noted that in cooling towers where
the warm water distribution system is driven by the fan motor, reduc-
ing fan speed can lead to poor water distribution. In such cases, if VSDs
are used to control fan speed, it is recommended to set a minimum speed.
Since, theoretically, the power consumed by fans is proportional to the
cube of the fan speed, when the cooling load drops to 80 percent, the
speed of the cooling tower fans can also be reduced accordingly, result-
ing in a drop of about 50 percent (0.8
3
ϭ 0.51) in power consumption.
Therefore, this control strategy can lead to very significant savings from
cooling tower fans at part load. Use of VSDs to control cooling tower
capacity, rather than fan staging, also leads to reduction in the wear and
tear of the drives due to lower fan speed and less drift losses (water
losses) due to lower air velocity.
Example 5.1 Consider a cooling tower of capacity 500 RT that has a 15 kW fan
(constant speed) and is designed to cool water from 35 to 30ЊC.
If, under normal operating conditions, the temperature of the warm water
entering the cooling tower is at 32ЊC, this indicates that the load on the cooling
tower is only 40 percent (2ЊC divided by 5ЊC).
Therefore, if a variable speed drive is installed on this cooling tower, the fan
will operate at approximately 40 percent of its speed to maintain the required leav-
ing water temperature of 30ЊC.
The theoretical fan power consumption will be (0.4)
3
ϫ 15 ϭ 1 kW
Saving in power consumption will be (15 – 1) ϭ 14 kW
Figure 5.8 shows the relationship between cooling tower efficiency in
kW/RT (fan power divided by amount of heat rejection) for three possible
fan operating strategies—constant speed fan (without fan cycling), fan
cycling, and using VSD.
Cooling tower performance also depends on the ambient wet-bulb tem-
perature. When the wet-bulb temperature drops from the design value
during nighttime or during different seasons of the year, the cooling
towers are able to economically provide water at a lower temperature,
while maintaining a fixed approach temperature. Since chiller efficiency
depends on condenser water temperature, this can lead to better effi-
ciency of the chillers. Therefore, a further enhanced control strategy can
be used for cooling tower fan speed control, as shown in Fig. 5.9. In this
system, the cooling tower approach temperature (difference in condenser
water supply and wet-bulb temperature) can be used instead of con-
denser water supply temperature to control the tower fan speed and fur-
ther optimize the cooling tower and chiller energy consumption.
Cooling Towers 141
142 Chapter Five
Condenser water
return from
chillers
Controller
Condenser water
supply to chillers
VSD VSD VSD
Colling
tower 1
Colling
tower 2
Colling
tower 3
T
WB
Figure 5.9 Cooling tower fan control to optimize condenser
water temperature.
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
20% 30% 40% 50% 60% 70% 80% 90% 100%
% Load
Constant speed
Fan staging
VSD
Figure 5.8 Cooling tower efficiency for different operating strategies.
Since cooling tower capacity depends on air flow, operating two iden-
tical towers at half the fan speed will result in capacity that is equiva-
lent to operating one tower at full speed. Since, theoretically, the power
consumption of the fans is proportional to the cube of their speed; the
power consumption of each tower fan will drop to 12.5 percent (0.5
3
ϭ 0.125)
at half the speed. This will result in a combined power consumption of
25 percent (12.5 percent ϫ2), which is a saving of 75 percent of the fan
power consumed if only one cooling tower is operated. Therefore, oper-
ating more cooling towers in parallel to meet the same load will allow
lower fan speed, leading to lower fan power consumption. An additional
benefit of running more cooling towers is that lower pumping power is
required due to lower pressure losses across the cooling tower spray noz-
zles (due to lower water flow through each tower).
Almost all installations have one or more extra cooling towers as
standby to allow servicing and repair of running cooling towers.
Therefore, if the standby towers are run in parallel with the duty cool-
ing towers and if all cooling tower fans are fitted with VSDs, they can
be run at lower speed to produce the same amount of heat dissipation.
Example 5.2 A particular installation has three cooling towers (each of 22 kW),
of which only two cooling towers are operated and the third cooling tower acts as
a standby tower. If all three cooling towers can be run at two-third capacity each
(three towers running at two-third capacity will provide the equivalent capacity
of two towers), the saving made in fan power can be estimated as follows:
The fan power consumption of each tower will be 22 ϫ(2/3)
3
ϭ6.5 kW (30 per-
cent of full load power).
The total power consumption of all three fans will be 6.5 ϫ 3 ϭ 19.5 kW.
Therefore, total savings will be (44 – 19.5) ϭ 24.5 kW.
The above savings estimation is based on the system operating at the full load
capacity of two cooling towers. Further savings will also be achieved at part-load
conditions, as shown in Table 5.1.
Cooling Towers 143
TABLE 5.1 Energy Savings from Cooling Towers Fitted with Variable Speed Drives
Without VSDs With VSDs
Cooling No. Total fan No. Fan Total fan Savings/
load of power of speed power Operating day
(RT) towers (kW) towers (%) (kW) hours (%) (kWh)
1000 2 44 3 0.67 19.6 10% 58.7
900 2 44 3 0.60 14.3 30% 214.2
800 2 44 3 0.53 10.0 20% 163.1
700 2 44 3 0.47 6.7 10% 89.5
600 2 44 3 0.40 4.2 10% 95.5
500 1 22 2 0.50 5.5 10% 39.6
400 1 22 2 0.40 4.4 5% 21.1
300 1 22 2 0.40 4.4 5% 21.1
Total 702.8
In Table 5.1, the fan power consumption to satisfy a particular cooling load is com-
puted for the two cases; with and without VSDs. In case of using VSDs, it is assumed
that additional cooling towers are operated to enable operation of fans at lower speed
and that the minimum speed of the cooling tower fans is set at 40 percent.
For example, when the load is 800 RT, if the fans are equipped with VSDs, they
can be operated at 80 percent of the speed (800/1000 ϭ 80 percent). Now, if an
additional cooling tower can be operated, this load can be shared by three cooling
towers instead of two (each running at two-thirds capacity) and the fan speed will
be (80 percent ϫ 2/3 ϭ 53.3 percent). The fan kW is computed by multiplying the
cube of speed by number of fans and fan kW at full speed (0.5333 ϫ 22 kW ϫ 3
towers ϭ 10 kW). In this estimation, it is assumed that the efficiency of the fan,
motor, and VSD remain constant.
This computation shows that energy savings of 702.8 kWh a day can be achieved
for this installation if the cooling tower fans are fitted with VSDs.
5.2.3 Condenser water reset
As explained earlier, in Chapter 2, the operating efficiency of chillers can
also be improved by reducing the condenser water temperature. An
improvement of 1 to 2 percent can be achieved in chiller efficiency by
reducing the condenser water temperature by 0.6ЊC (1ЊF) due to the
reduction in pressure differential across which the compressor has to
work (Fig. 5.10).
Cooling towers are designed to cool condenser water to within a few
degrees of the wet-bulb temperature. The most common cooling tower
design is for a “cooling tower approach temperature” (temperature differ-
ence between condenser water supply temperature and wet-bulb temper-
ature) of 2.8ЊC (5ЊF). However, under some operating conditions, such as
at part load, cooling towers are able to supply condenser water at lower
than the designed approach temperature. Since cooling towers are
designed to operate at a certain approach temperature, operating them at
a lower than the design value can result in reduction of tower efficiency.
Therefore, in installations where the condenser water temperature is
not controlled, the condenser water temperature will drop under such
144 Chapter Five
Reduction in pressure
differential due to decrease
in condensing pressure
Evaporator
Condenser
Expansion
device
Compressor
Enthalpy
P
r
e
s
s
u
r
e
Decrease in condenser
water temperature
Figure 5.10 Effect of reducing condenser water temperature on chiller efficiency.
off-design conditions, leading to improvement in chiller efficiency. However,
this may not be the optimum operating point since the improvement in
chiller efficiency may be at the expense of reduced cooling tower efficiency.
Figure 5.11 shows the variation in chiller and cooling tower efficien-
cies with condenser water temperature. Generally, lower condenser
water temperature results in improved chiller efficiency and a drop in
cooling tower efficiency (due to the need for working the towers “harder”
or operating extra towers to produce condenser water at a lower tem-
perature). Therefore, the overall optimum operating point for a system
may not be at the lowest condenser water temperature.
This optimum operating point will vary from one site to another,
depending on system design, equipment efficiencies, and configuration.
If accurate performance data is not conveniently available for a system,
it may be easier to use the control strategy described earlier, where
variable speed drives on cooling tower fans are used to maintain a fixed
approach temperature.
5.2.4 Condenser water flow rate
Another important aspect of condenser water systems is the water flow
rate. As explained earlier, it is essential to provide sufficient condenser
water flow to ensure that the heat rejected in the condenser can be dis-
sipated outdoors. The most common design is for a condenser water
“range” (difference between condenser water return and supply tem-
peratures) of 5.6ЊC (10ЊF). At this design condition, it is necessary to pro-
vide 0.19 L/s per RT of cooling capacity (3 USgpm per RT). This required
condenser water flow rate is 1.25 times the flow required for chilled
water (0.15 L/s or 2.4 USgpm per RT) to account for the heat of com-
pression added by the compressor, which is approximately 25 percent
of the cooling load. If sufficient flow is not provided, it will lead to higher
Cooling Towers 145
Condenser water supply temperature
Cooling towers
Chillers
Total
Optimum
E
f
f
i
c
i
e
n
c
y
(
k
W
/
R
T
)
Figure 5.11 Effect of condenser water temperature on chiller and
cooling tower efficiency.
condenser water return temperature, leading to higher condensing pres-
sure and, therefore, higher compressor power.
It is better to provide the designed condenser water flow rate even at
part load since this results in lower condenser water return tempera-
ture and, therefore, better chiller efficiency. However, it has to be
ensured that the designed condenser water flow rate is not exceeded.
Firstly, it will ensure that pumping energy is not wasted, and secondly,
it will ensure that the cooling towers are able to perform satisfactorily.
If the cooling towers are supplied with higher than the designed flow
rate (sometimes this happens when water flow to the cooling towers is
not balanced and some towers get more flow than others), the cooling
towers will be unable to provide water at the designed temperature. This
will lead to higher condenser water temperature and result in lower
chiller efficiency.
Hence, it is essential to have the correct condenser water flow. If the
flow is insufficient, the condenser water return temperature will rise,
leading to lower chiller efficiency. Similarly, if the condenser water flow
is more than that specified for the cooling towers, it will lead to a higher
condenser water supply temperature, which too will result in a drop in
chiller efficiency.
5.2.5 Installation of cooling towers
Since the performance of cooling towers depend on the air flow through
them, cooling towers should be installed such that air can flow freely into
them. As shown in Fig. 5.12, cooling towers should be sufficiently spaced
so that the air intakes of cooling towers are not too close to each other.
Further, cooling tower air intakes should not be less than a minimum
distance from obstructions such as walls. The minimum distance to be
maintained between cooling towers and from obstructions are normally
specified by the cooling tower suppliers, based on the design of their
towers.
Care should also be taken to ensure that the warm and moist air
being discharged from cooling towers is not recirculated back into the
146 Chapter Five
Minimum
distance to
wall or
obstruction
Minimum
distance
between
towers
Figure 5.12 Spacing of cooling towers.
air intakes as this will lead to a drop in tower performance. In some sit-
uations, an extension duct can be fitted to the cooling tower discharge
to direct the air flow away from the air intakes, as shown in Fig. 5.13.
5.2.6 Condition of cooling tower
The ability of a cooling tower to provide its designed cooling capacity
depends on the operation of the water spray system, the fill, and the fan.
Therefore, regular maintenance should ensure that the water spray
system is able to properly spread the water flow, the fill is in good con-
dition, and the fan is able to operate at the required speed.
If the spray system is defective, warm water may flow directly into
the discharge basin of the cooling tower rather than being sprayed onto
the fill material that is meant to facilitate the heat transfer between the
warm water and the ambient air. Similarly, if the infill is damaged or
blocked, water will flow directly into the discharge basin rather than
flowing through it, as shown in Fig. 5.14.
Cooling Towers 147
Air discharged out
Discharge air
recirculated back
Wall
Extension
duct
Figure 5.13 Extension duct used to prevent recirculation.
Warm water spray
Part of the
water
flowing
directly into
discharge
Warm water spray
Figure 5.14 Water flow in defective cooling towers.
Since many cooling tower fans use belt drive systems, the tension of
the belts should also be checked to prevent belt slippage, which would
result in lower fan speed and a drop in cooling tower performance.
All the above aspects, such as ineffective spray systems, damaged fill
material, and low fan speed can lead to poor cooling tower performance,
which normally results in cooling towers not being able to provide water
at the designed temperature. In chiller systems, this will lead to lower
chiller efficiency and higher energy consumption.
5.2.7 Water treatment
Another aspect of chiller efficiency, related to cooling towers, is the con-
dition of the condenser water. Since condenser water systems are open
systems that require makeup water (to compensate for water evaporated
in the cooling towers), water treatment is important to maintain chiller
efficiency. Water treatment usually consists of chemical or nonchemical
treatment to prevent scaling, corrosion, and fouling of the chiller’s con-
denser tubes. If water treatment is not adequate, fouling and scaling of
chiller condenser tubes leads to lowering of chiller efficiency, as
explained in Chapter 2.
5.2.8 Free cooling
Vapor migration. Cooling towers and condenser water pumps can be
used to provide “free cooling” in temperate climates during certain sea-
sons, as seen in Chapter 2. One way to achieve this is by switching off
the chiller compressor and allowing vapor to migrate from the evapo-
rator to the condenser when the condenser water is at a sufficiently low
temperature to allow condensation of the vapor without having to raise
its pressure.
Using a heat exchanger. Another approach is to use water from the
cooling towers to either precool or completely cool the return chilled
water when the outdoor weather conditions are favorable, as shown
in Fig. 5.15. In this system, whenever the condenser water tempera-
ture is less than the chilled water temperature, the cooling tower
water is used to cool the return chilled water with the help of a heat
exchanger. Depending on outdoor conditions and condenser water
temperature, the chiller can be turned off completely and the heat
exchanger can be used to completely cool the chilled water, or the
chiller can be operated at reduced load by using the heat exchanger
to precool the return water.
Switching off cooling tower fans. In some installations, which have a
large number of cooling towers to meet daytime peak cooling loads, if
148 Chapter Five
the off-peak (nighttime) cooling load is very low and only a few cooling
towers are operated at such times, it may be possible to achieve the
required heat rejection by switching off all the cooling tower fans and
circulating water through them. This is possible because, although the
capacity of cooling towers is proportional to the air flow, they can pro-
vide some cooling even when the fans are switched off. Figure 5.16
shows a typical relationship between fan air flow and cooling tower
capacity.
As shown in Fig. 5.16, a typical cooling tower can provide about 5 per-
cent of the design capacity when the tower fan is switched off. Therefore,
Cooling Towers 149
Chiller
Cooling tower
Load
Heat exchanger
Chilled water pump
Condenser water
pump
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Airflow (%)
C
a
p
a
c
i
t
y
(
%
)
Figure 5.15 Arrangement of free cooling using a cooling tower.
Figure 5.16 Typical relationship between cooling tower air flow and capacity.
if an installation has five cooling towers of 500-RT heat rejection capac-
ity each, they will be able to provide about 125 RT of free cooling (5 ϫ
500 ϫ 0.05 ϭ 125).
5.3 Summary
Cooling towers are used in buildings mainly for providing the heat rejec-
tion requirements of air-conditioning systems. Although cooling towers
themselves do not consume much energy in building applications, their
performance is important as they can have a significant impact on the
operating efficiency of air-conditioning chillers. The chapter provided an
overview of cooling towers and their application in buildings followed
by a number of energy saving strategies to ensure optimum efficiency
of air-conditioning systems in buildings.
Review Questions
5.1. Acooling tower is designed to cool 50 L/s of water from 35ЊC to 30ЊC at an
ambient wet-bulb temperature of 28.5ЊC.
However, under the following actual operating conditions, the temperature
of water leaving the cooling tower is 32ЊC. What are the possible reasons
for the higher than designed cooling tower water temperature and what
remedial action can be taken for each of the possible causes?
Actual operating conditions are:
Water flow rate ϭ 48 L/s
Entering water temperature ϭ 34ЊC
Wet-bulb temperature of air entering the cooling tower ϭ 28ЊC
5.2. Acooling tower is unable to provide the rated heat rejection capacity when
operating at the designed water flow rate, entering water temperature, and
ambient wet-bulb temperature. However, it was observed that the wet-bulb
and dry-bulb temperatures of air entering the cooling tower were much
higher than the ambient wet-bulb and dry-bulb temperatures. Why is the
cooling tower not able to provide its rated capacity?
5.3. Acooling tower of capacity 250 RT uses a constant speed fan that consumes
15 kW. If, under actual operating conditions, the load on the cooling tower
is only 60 percent of its rated capacity, estimate the savings that can be
achieved in fan power if a variable speed drive is installed to operate the
fan at 60 percent of its rated speed.
5.4. Aparticular installation has two cooling towers (each of 15 kW), of which
only one cooling tower needs to be operated and the remaining one acts as
a standby. Estimate the fan power savings that can be achieved if variable
150 Chapter Five
speed drives are installed on both cooling towers and both towers are oper-
ated at 50 percent capacity to provide the approximate heat rejection capacity
of one cooling tower.
5.5. Acooling tower installation has three 500 RT and two 200 RT capacity cool-
ing towers. If these cooling towers are able to provide up to 5 percent of their
capacity when the fans are switched off (free cooling), estimate the maxi-
mum total heat rejection capacity that that these cooling towers are able
to provide under free cooling conditions with the fans switched off.
Cooling Towers 151
153
Chapter
6
Air Handling and
Distribution Systems
6.1 Introduction
In buildings that are centrally cooled or heated, air is normally treated
in air handling units (AHUs) to control moisture content and tempera-
ture. Once the air is treated, it is transported and distributed to vari-
ous parts of the building. A typical air distribution system consists of
fans, ducting, dampers, filters, air inlets, and air outlets, as shown
schematically in Fig. 6.1.
In such systems, a mixture of outdoor air (provided for ventilation)
and part of the air returning from conditioned spaces (return air) is fil-
tered and then treated by the coils. Thereafter, the fan transports the
treated air through the supply ducting system, which distributes it in
required quantities to the spaces to be conditioned via outlets and
dampers. After performing the necessary cooling or heating, air is later
returned from the conditioned spaces through the inlets and return
ducting. Some of the return air is then recirculated back to the AHU
while the balance is expelled to allow sufficient fresh air to be added
to the system.
In an air distribution system, the fan provides the necessary energy
to move the air by overcoming frictional losses in the ducting and pres-
sure losses due to components in the system, such as filters, coils, and
various fittings. The electrical energy required to operate the system
can be minimized if the system design is optimized to reduce these
losses.
154 Chapter Six
6.2 System Losses
When airflows in ducting systems, there is pressure drop due to friction
losses and dynamic losses caused by change of direction or velocity in
ducts and fittings.
Friction losses are due to fluid viscous effects and can be expressed
by means of D’Arcy’s equation:
(6.1)
where ⌬P
f
ϭ frictional pressure drop
f ϭ friction factor
L ϭ length of duct
v ϭ mean duct velocity
g ϭ acceleration due to gravity
D
m
ϭ hydraulic mean diameter ϭ
Dynamic losses occur due to change in flow direction caused by fittings
such as elbows, bends, and tees and changes in area or velocity caused
by fittings like diverging sections, contracting sections, openings, and
dampers.
Normally, dynamic pressure losses (⌬p
d
) are proportional to the veloc-
ity pressure and can be expressed as
(6.2) ⌬P
d
5 C
o
#
P
v
cross-sectional area
perimeter
⌬P
f
5
f
#
L
#
v
2
2
#
g
#
D
m
Return air ducting
Supply air ducting
Cooling coil
Filter
Fan
Fan (optional)
Exhaust
air
Outdoor
air
Return
air
Supply air (outlets)
Return air (inlets)
Figure 6.1 Typical air distribution system.
Air Handling and Distribution Systems 155
where C
o
ϭ dynamic loss coefficient dependent on the geometry of the
particular fitting,
P
v
ϭ velocity pressure (1/2 v
2
, is the density of air).
The value of C
o
is measured experimentally and is tabulated in ref-
erence books such as the ASHRAE Handbook of Fundamentals.
6.3 System Curves and Fan Performance
The two main types of fans used for transporting air are centrifugal fans
and axial-flow fans. Centrifugal fans are also divided into a number of
types such as backward-curved, forward-curved, radial blade, and tubu-
lar centrifugal. Out of these, forward-curved and backward-curved fans
are the most commonly used in air distribution systems (Fig. 6.2).
Forward-curved centrifugal fans generally operate at relatively low
speeds and are used for transporting high volumes at low static pressure.
These fans are lower in cost and are preferred to backward-curved fans
in applications where high static pressures are not encountered. However,
the main disadvantage of these fans is that they have an “overloading”
characteristic that results in the power consumption curve having a pos-
itive slope until 100 percent airflow, as compared to backward-curved
fans, which have maximum power consumption at about 80 percent of
flow. Since backward-curved fans are more costly, they are generally
used for high static pressure applications while axial flow fans are used
to transport high volumes of air at low or no static pressure drops.
Fans and fan systems are normally rated based on pressure and flow
rate. The two parameters are dependent on each other as the airflow rate
produced by a fan depends on the system pressure (the pressure against
which it needs to work).
The system resistance of a ducting system is the total sum of all pres-
sure losses encountered in the system due to coils, filters, ducting,
dampers, and diffusers. The system curve is a plot of the system resist-
ance encountered at different volumes of airflow, as shown in Fig. 6.3.
The system resistance varies to the square of the airflow, and the curve
is parabolic in shape.
Figure 6.2 Backward- and forward-
curved centrifugal fans. Forward curved fan Backward curved fan
Similarly, the relationship between the flow and pressure developed
by a fan is called a fan curve. A fan curve shows all the different oper-
ating points of a fan at a particular operating speed as its discharge is
throttled from zero to full flow. Since fans can operate at different speeds
and with different impeller sizes, usually fan curves for different fan
speeds and impeller sizes are plotted on the same axis. Figure 6.4 shows
a typical fan curve for a fan operating at a particular speed and impeller
size.
The actual shape of the fan curve depends on the type of fan used. The
performance of some fans, such as axial-flow fans, also depends on the blade
angle, which can be adjustable. For such fans, manufacturers provide a
“family of curves” showing fan performance at different blade settings. Fan
curves also include data such as the fan power required and operating effi-
ciency at the different operating conditions, as shown in Fig. 6.5.
The system operating point is the point on the system resistance
curve that corresponds to the required airflow condition. When a fan is
selected for a particular application, a fan that has a performance curve
that can intersect the system curve at the desired operating point is
selected, as shown in Fig. 6.6.
As in the case of pumps, power consumed by fans is related to the prod-
uct of the volume flow and pressure developed.
(6.3) Fan impeller power ~
air flow rate 3 pressure developed
efficiency
156 Chapter Six
P
r
e
s
s
u
r
e
l
o
s
s
e
s
System curve
Air flow
Figure 6.3 Typical system curve
for an air distribution system.
P
r
e
s
s
u
r
e
Typical fan
curve
Volume flow rate
Figure 6.4 Typical fan curve.
In SI units:
Fan impeller power (kW)
(6.4)
In Imperial units:
Fan brake horsepower
(6.5)
Therefore, fan power consumption can be lowered by reducing the airflow
rate, the pressure losses, or both, and will form the basis of some of the
energy management measures for fan systems that are discussed later.
6.4 Affinity Laws
The performance of fans under different conditions are related by the fan
affinity laws given in Table 6.1. The fan laws relate fan speed and impeller
diameter to airflow, pressure developed by the fan, and impeller power.
5
flow rate scfmd 3 pressure difference sin.waterd
6350 3 efficiency
5
flow rate sm
3
/sd 3 pressure developed sN/m
2
or Pad
1000 3 efficiency
Air Handling and Distribution Systems 157
Fan power
P
r
e
s
s
u
r
e
a
n
d
f
a
n
p
o
w
e
r
Fan pressure
Volume flow
Fan efficiency
Figure 6.5 Typical fan curves provided by manufacturers.
System curve
Fan curve
P
r
e
s
s
u
r
e
Air flow
Operating point
Required air flow
Figure 6.6 Matching of system and fan curves.
Fan laws are used by manufacturers to estimate the performance of
fans at different impeller sizes and operating speeds. Since the speed
of fans can be easily changed by changing pulley sizes or by installing
variable speed drives, the fan laws are very useful to system designers.
They can be used to estimate the performance of fans at different speeds,
as illustrated in Example 6.1.
Example 6.1 A fan delivers 5 m
3
/s at 1400 rpm and consumes 20 kW. Calculate
the new airflow rate and power consumption if the fan speed is reduced to 1200 rpm.
Q
1
ϭ 5 m
3
/s
P
1
ϭ 20 kW
N
1
ϭ 1400 rpm
N
2
ϭ 1200 rpm
Q
2
ϭ Q
1
ϫ (N
2
/N
1
) ϭ 5 ϫ (1200/1400) ϭ 4.3 m
3
/s
P
2
ϭ P
1
ϫ (N
2
/N
1
)
3
ϭ 20 ϫ (1200/1400)
3
ϭ 12.6 kW
This example also shows that when the speed is reduced by 14 percent (1400 to
1200 rpm), theoretically, the power consumption reduces by about 37 percent (20 to
12.6 kW). It should be noted that this calculation does not take into account the
change in fan efficiency due to change in operating speed.
6.5 Energy Saving Measures for Air Handling
and Distribution Systems
6.5.1 Ducting system design
The power required by a fan depends on the airflow it needs to deliver
and the system pressure against which it has to work. While the airflow
required in a cooling or heating system depends on the load that needs
to be satisfied, the pressure losses are not directly related to the load.
Hence, although the amount of air to be delivered by a system may not
158 Chapter Six
TABLE 6.1 Fan Affinity Laws
Change in speed (N) Change in impeller diameter (D)
Flow (Q)
Pressure (⌬p)
Power (P) P
2
5 P
1
a
D
2
D
1
b
3
Q
2
5 Q
1
a
N
2
N
1
b
be totally within the control of a designer, the pressure losses can be min-
imized through ducting system design. As can be seen from Eq. (6.5), a
reduction in pressure losses helps to directly reduce fan power. For
example, if the pressure losses can be halved, the fan power can also be
reduced by half.
Another point to remember is that a fan also adds heat to the air that
it is moving. The temperature rise across the fan depends on the pres-
sure rise across the fan and the fan efficiency. For a fan working at 70
percent efficiency, which is developing a total pressure of 500 Pa, the
temperature rise can be about 0.5ЊC. In a typical air-conditioning system,
the difference in temperature of the air being delivered to the space being
cooled and the air leaving the space is about 10ЊC. For such a case, the
heat added by the fan can be about 5 percent of the total cooling load.
This percentage can be even higher at part load, when the supply air
temperature is higher.
Therefore, in air-conditioned systems, it is very important to minimize
the system pressure losses to enable fan power to be reduced while also
helping to decrease the cooling load on the chillers.
Pressure losses occur in air distribution systems due to frictional
losses and dynamic losses. As explained earlier, dynamic losses in duct-
ing systems occur due to change in flow direction, caused by fittings like
elbows, bends, and tees, and changes in area or velocity, caused by fit-
tings like diverging sections, contracting sections, openings, and dampers.
Usually, dynamic losses tend to be higher than frictional losses in duct-
ing systems.
From Eq. (6.1), it is evident that the fan energy required to overcome
frictional losses can be reduced by lowering the friction factor, duct
length, and air velocity in ducts. The most commonly used materials for
fabricating ducting are galvanized sheet metal and aluminium sheets,
both of which are smooth and have low friction factors. However, in duct-
ing systems, it is sometimes necessary to use flexible ducting or ducting
with internal lining, which results in higher frictional losses. In such
cases, the length of such ducts should be minimized as far as possible.
Frictional losses in ducts also depend on the velocity of airflow in the
ducting system. From Eq. (6.1) it can be seen that higher velocity or a
lower cross-sectional area (hydraulic mean diameter) result in higher
losses. Therefore, to minimize losses, the duct cross-sectional area needs
to be increased. However, selecting a duct with a large cross-sectional
area to minimize frictional losses would lead to higher cost for ducting
since ducting material and labor costs depend on size. As such, duct
designing is matter of economics, which requires balancing the first
cost and the running cost of the system. Based on experience, duct loss
of 1 Pa/m is found to be a reasonable value to be assumed while design-
ing ducting systems.
Air Handling and Distribution Systems 159
Similarly, dynamic losses can be minimized by using duct fittings
that have lower loss coefficients. Sudden changes in direction should be
avoided and where required, bends should be used rather than sharp
elbows. Further, obstructions in ducts should be avoided and diverging
and converging sections should be made gradual with the angle of diver-
gence and convergence not exceeding 12Њ and 30Њ, respectively.
6.5.2 Fan discharge and inlet system
effects
Fan inlet and outlet conditions also affect system losses, which can
result in higher fan power to satisfy the requirements.
Fans impart dynamic pressure on the air due to centrifugal action.
This dynamic pressure has to be converted to static pressure to enable
the fan to overcome the system losses. Usually, a minimum duct length
is required after the fan to enable this static regain to be completed.
Therefore, a system design should attempt to use straight ductwork for
three to five equivalent duct diameters downstream of the fan discharge.
Where transition to a duct with larger area is required after the fan, a
taper having an included angle of no more than 15Њ should be used, as
shown in Fig. 6.7.
Where fans discharge into a plenum, losses occur due to the sudden
enlargement in flow area. The addition of a short discharge duct of only
one or two equivalent diameters in length significantly reduces this
sudden enlargement loss.
Duct bends immediately at the fan discharge also create a high static
pressure drop due to turbulence and the velocity profile existing at the dis-
charge. If an elbow must be used at the fan discharge, it is recommended
not to have one with a short radius. Preferably, an elbow with a minimum
radius of 1.5 times the equivalent duct diameter should be used.
Similarly, fan inlet conditions also affect fan performance. Nonuniform
flow into the suction of a fan is typically caused by an elbow installed
too close to the fan inlet. This will not allow the air to enter the impeller
uniformly and will result in turbulent and uneven flow distribution at
the fan impeller. This results in lower fan efficiency and higher fan
power. If it is necessary to have a sharp bend at the fan inlet, vanes and
a splitter can be installed to minimize losses.
160 Chapter Six
15° max.
15° max.
Figure 6.7 Fan discharge transitions.
In many air handling units, the opening is not vertically centered to
the fan inlet. By adding a simple splitter sheet on each side of the fan,
as shown in Fig. 6.8, the performance of the fan can be improved.
6.5.3 Filter losses
Various types of air filters are used in air handling units to filter the air
before being supplied to the occupied spaces. These air filters remove
suspended solid or liquid materials from the fresh air (required for ven-
tilation) and the recirculation air.
The most common type of filters used for air handling equipment are
media filters. These filters, which are normally made of fibrous material,
trap particles while the air passes through them. Media filters offer a
resistance to the airflow depending on the type of filter and the amount
of airflowing through it. When these filters accumulate dust, the pres-
sure drop across them increases. Usually, filters are selected to work up
to a design pressure drop provided for in the design, after which they need
to be cleaned or replaced. As shown in Fig. 6.9, the pressure drop across
the filter is lower than the value assumed in the design when it is clean.
This results in higher airflow (Q
3
) when the filter is clean. Gradually,
when the pressure drop increases, the airflow drops to the value provided
for in the design (Q
2
). If the filters are not cleaned or replaced at this
stage, the higher pressure drop results in lower airflow (Q
1
).
Air Handling and Distribution Systems 161
Splitter
sheet
Figure 6.8 Splitter sheet for un-
balanced flow.
P
r
e
s
s
u
r
e
Air flow
Dirty filter
Design system curve
Clean/new filter
Q
1
Q
2
Q
3
Figure 6.9 Effect of filter on system performance.
From an energy efficiency point of view, two aspects need to be con-
sidered in such filter operations. Firstly, when the filter is clean, more air-
flow than required is provided by the system. From Eq. (6.3) we know that
the higher the airflow, the higher the energy consumption is. This means
that, during the period from when the filter is clean to when it reaches
the design pressure drop, if the airflow can be reduced, the energy con-
sumed by the fan can be reduced. The easiest way to achieve this is by
using a variable speed drive (VSD) to modulate the fan speed and provide
the designed airflow, as shown in Fig. 6.10. Since the airflow delivered by
the fan is proportional to the fan speed, the fan can be operated at speeds
lower than the designed speed and gradually increased to the designed
value. Since the fan power is proportional to the cube of the fan speed,
significant energy savings can be achieved by this measure.
Secondly, energy savings can be achieved by replacing or cleaning
the filter when the pressure drop reaches the maximum value allowed
for in the design. A sensor can be installed to provide an alarm when
the filter needs cleaning or replacing. If nothing is done to the filters at
this stage, the airflow will drop and will result in insufficient airflow to
some areas, causing discomfort to occupants in these areas. In extreme
cases the problem of insufficient airflow is solved by running the fan at
a higher speed by changing the pulleys or setting a higher set point on
the VSD, if such a device is used. Both these solutions lead to higher fan
power consumption.
When filters are not cleaned or replaced regularly, apart from result-
ing in higher pressure drops, dirt particles sometimes pass through
them and lodge in the cooling coils. This results in a higher pressure drop
across the coils, which leads to higher fan power (discussed later) and
the need for more frequent cleaning of the coils, which is even more
expensive than cleaning or replacing filters.
Another type of filter being used in air handling units are electronic
air filters, which use “electrostatic precipitation” to effectively remove
162 Chapter Six
P
r
e
s
s
u
r
e
Fan curve at lower speed
Design
flow
Clean/new filter
Design system curve
Higher
flow
Air flow
New operating point
Fan curve at
design speed
Figure 6.10 Effect of reducing fan speed with clean filter.
particles as small as 0.01 microns. Electronic air cleaners circulate air
contaminated with particles through a series of ionizing wires and plates
that generate positive ions, and a section of collection plates that pre-
cipitate the ionized particles out of the air. Electrons, which are randomly
present in the air, accelerate rapidly towards the positively charged ion-
izing wires. On the way to the wires, these accelerating electrons strike
electrons out of other air molecules, making them positive ions. The pos-
itive ions become attached to the pollutant particles and are collected in
the collector section, which has a series of thin metal plates that are alter-
natively charged positively and negatively with a high DC voltage.
Unlike media filters, which have pressure drops of 25 to 50 Pa (some-
times even much higher), these electronic air cleaners offer little resist-
ance to the airflow. Since, according to the fan affinity laws, fan pressure
is proportional to the square of the fan speed and fan power is proportional
to the cube of fan speed, fan power is proportional to the fan pressure
raised to the power of 1.5 ( i.e. kW ϰ pressure
3/2
). Therefore, significant
savings in fan power can be achieved by using electronic air cleaners.
Example 6.2 Asystem with a media filter has a fan that delivers 10 m
3
/s at 500 Pa
and consumes 10 kW. If the media filter has a pressure drop of 50 Pa, calculate
the savings in fan power consumption that can be achieved if the media filter is
replaced with an electronic air cleaner that has a negligible pressure drop.
Q
1
ϭ 10 m
3
/s
P
1
ϭ 10 kW
⌬p
1
ϭ 500 Pa
⌬p
2
ϭ (500 Ϫ 50) ϭ 450 Pa
P
2
ϭ P
1
ϫ (⌬p
2
/⌬p
1
)
3/2
ϭ 10 ϫ (450/500)
3/2
ϭ 8.5 kW
Therefore, savings in fan power consumption will be 1.5 kW.
The fan power savings achieved depends on the actual pressure drop
across the media filter, the total pressure drop in the system, and fan
characteristics. However, it should be noted that to achieve this saving
in a retrofit situation, it is necessary to reduce the fan speed to deliver
the designed airflow rate after the media filter is replaced with an elec-
tronic air cleaner. This can be achieved through a pulley change on the
fan drive or by using a variable speed drive to operate the fan at a lower
speed. Otherwise, if nothing is done to reduce the fan speed after the
electronic air cleaner is installed, the lower pressure drop will just result
in higher airflow without any significant savings in fan power. This is
a very important point to remember as sometimes vendors of electronic
air cleaners project the feasibility of installing their devices based on fan
power savings and the cost of the air cleaner, omitting the cost incurred
by reducing fan speed.
Air Handling and Distribution Systems 163
Due to the high first cost of electronic air cleaners as compared to
media filters, in many situations, it is not possible to justify their instal-
lation based on energy savings alone. In such cases, other benefits such
as the reduction in periodic maintenance cost, associated with cleaning
and replacing of media filters, and improved air quality should be
included in the cost benefit analysis.
6.5.4 Coil losses
Clean coils. Like filters, coils too offer significant resistance in air dis-
tribution systems. The pressure drop across coils depends on their design
(density of rows and fins), face velocity, and how well the coils have been
maintained (how clean).
Coils are placed downstream of filters so that any particles in the air
can be filtered before the air reaches the coil. However, if the filters used
are not efficient or well maintained they cannot remove dirt particles.
This results in the coil acting as the filter. Since cooling coils are wet
and consist of narrow passages for the air to pass through, anything
that gets past the filters normally tend to get stuck on cooling coils.
Cooling coils that have been in use for about 10 years and have not been
cleaned regularly result a significant drop in airflow due to blockage.
One way of checking the condition of the coil is by comparing the actual
coil pressure drop with the designed coil pressured drop. However, if
the design data is not available and the pressure drop across the cool-
ing coil is over 250 Pa, chances are that it is partially blocked and
needs cleaning.
As with filters, blocked coils result in lower airflow and can lead to
discomfort for the occupants of the building if there is a substantial
drop in coil performance. Often, when such problems are encountered,
the fans are operated at higher speed to increase the airflow. This leads
to higher fan power consumption.
Face velocity. Apart from keeping the coils clean, fan power consump-
tion can also be minimized through coil design and selection. The pres-
sure drop across coils depends on the number of coil rows and fin density
as well as the velocity of airflowing through them.
The face velocity of a coil is the velocity of air passing through the coil.
The pressure drop across a coil is proportional to the square of the veloc-
ity. Therefore, if the face velocity can be reduced by 10 percent, the pres-
sure drop can be reduced by about 20 percent. Reduction in coil face
velocity can be achieved by making the coil bigger. However, this leads
to higher first cost for the coil due to its larger size and also higher cost
for the entire air handling unit since it has to be made bigger to accom-
modate the larger coil. Usually, to minimize first cost, coils are designed
164 Chapter Six
for face velocities of about 2.5 m/s. Although low face velocity coils with
face velocities of about 1 m/s cost more at first, they have a much lower
operating cost due to lower fan energy consumption. Therefore, if coils
and air handling units are selected based on life-cycle costing, low face
velocity coils offer significant energy savings.
Example 6.3 For a system delivering 10 m
3
/s, the pressure drop across a cooling
coil is 200 Pa and the face velocity is 2.5 m/s. Calculate the pressure drop and the
reduction in fan power if the face velocity is reduced to 1.0 m/s for this applica-
tion. Assume the fan efficiency is 70 percent.
Q ϭ 10 m
3
/s
v
1
ϭ 2.5 m/s
v
2
ϭ 1.0 m/s
⌬p
1 (coil)
ϭ 200 Pa
⌬p
2 (coil)
ϭ ⌬p
1 (coil)
ϫ (v
2
/v
1
)
2
ϭ 200 ϫ (1.0/2.5)
2
ϭ 32 Pa
Reduction in pressure drop across the coil ϭ (200 – 32) ϭ 168 Pa
From Eq. (6.4), reduction in fan power ϭ [10 (m
3
/s) ϫ 168 (Pa)]/[1000 ϫ 0.7] ϭ
2.4 kW.
Dual-path air handling units. Deep coils with high fin density are nor-
mally required for dehumidification applications. Such coils not only
have high pressure drops but are also difficult to maintain. In conven-
tional air handling units (Fig. 6.11), outdoor air provided for ventilation
is mixed with the return air before passing through the cooling coil. The
outdoor air, with higher moisture content is mixed with a large quan-
tity of return air with lower moisture content. Since the quantity of
outdoor air is much less than the quantity of return air, this results in
a mixture of air with a lower overall moisture content. This makes dehu-
midification harder as the potential for moisture removal is reduced and
leads to the need for deep coils.
This shortcoming can be overcome by using dual-path air handling
units (Fig. 6.12). In such air handling units, two separate coils are used
to treat the outdoor air and return air before mixing them. The coil for
Air Handling and Distribution Systems 165
Filter cooling coil
Outdoor air
Return air
Supply air Fan
Figure 6.11 Conventional air handling unit.
treating the outdoor air is designed for carrying out most of the dehu-
midification while the return air coil is sized for mainly providing sen-
sible cooling. The two air streams are then mixed to give the desired
supply air conditions.
Since the quantity of outdoor air for dehumidification is small and the
moisture content is relatively high, low face velocity coils can be used for
treating outdoor air. This leads to lower coil pressure drop and reduced
energy cost. Similarly, since the return air coil mainly performs sensible
cooling, a shallow coil can be selected for this application. This too results
in lower coil pressure drop and helps reduce fan power consumption.
6.5.5 Fan efficiency
Normally, centrifugal fans used in air distribution systems are forward-
curved or backward-curved (Fig. 6.2).
Forward-curved fans rotate at relatively slow speeds and are gener-
ally used for producing high volumes at low static pressure. The maxi-
mum static efficiency of forward-curved fans is usually between 60 to
70 percent and occurs at less than 50 percent of the maximum airflow,
as shown in Fig. 6.13. The fan power curve has an increasing slope and
is referred to as an “overloading type.” The advantage of these fans is
that they are relatively low cost.
Backward-inclined fans operate at about twice the speed of forward-
curved fans. The maximum static efficiency is higher and is about 80 per-
cent, and occurs at about 60 to 70 percent of the maximum flow, as shown
in Fig. 6.13. The advantage of backward-curved fans is their higher effi-
ciency and the nonoverloading characteristic of their power curve.
However, they are normally more costly than forward-curved fans.
Due to the lower first cost, forward-curved fans are commonly used
in air handling units (AHUs). However, from Eq. (6.3) it can be seen that
fan power can be reduced by increasing fan efficiency. In a system where
the airflow and pressure is fixed, a 10 percent improvement in fan effi-
ciency will lead to an equivalent reduction in fan power consumption.
Therefore, although a backward-curved fan may have a higher first cost,
166 Chapter Six
Fan
Cooling coil Filter
Return air
Treated fresh air
Filter Cooling coil
Supply air
Outdoor air
Figure 6.12 Dual-path air handling unit.
based on a life-cycle cost, it may be much more attractive as the extra
cost of the fan may be recovered by the lower fan power consumption
during operation.
However, it should be noted that fan efficiency also depends on the
operating point, as shown in Fig. 6.14. Although a backward-curved
fan may have a maximum static efficiency of 80 percent, it may operate
at 60 percent static efficiency at the operating point. Therefore, when a
Air Handling and Distribution Systems 167
0
10
20
30
40
50
60
70
80
90
0 20 40 60 80 100
Flow (%)
Forward curved
Backward curved
Point of
maximum
efficiency
S
t
a
t
i
c
e
f
f
i
c
i
e
n
c
y
(
%
)
Figure 6.13 Fan efficiency for forward-curved and backward-curved fans.
Fan efficiency
at operating point
P
r
e
s
s
u
r
e
a
n
d
f
a
n
e
f
f
i
c
i
e
n
c
y
Maximum
efficiency
Volume flow rate
System curve
Fan curve
Figure 6.14 Fan efficiency at operating point.
fan is selected for an application, it should be selected so that it oper-
ates at its highest efficiency at the desired operating point.
6.5.6 Excess airflow
In air handling systems and ventilation systems, fans are selected to pro-
vide the airflow rate required for maintaining space conditions. This
designed airflow rate is normally computed based on expected cool-
ing/heating and ventilation loads. Since the airflow delivered by a fan
also depends on the pressure losses in the system, which it has to over-
come to deliver the required airflow rate, the system pressure losses too
need to be estimated prior to selecting a fan.
As described in Section 6.2, system losses depend on factors such as
friction losses in ducting, losses due to fittings, and changes in velocity
and direction. In system design, usually, a safety factor is added to account
for differences between computed values and actual system losses that
may result due to reasons such as changes in ducting layout during
installation to overcome site constraints. The safety factor used for design-
ing an air distribution system usually depends on how confident the
designer is about the design. It is not uncommon to see systems designed
with high safety factors, which result in excess airflow during actual
operation due to the intersection of the fan curve and actual system curve
at a point different from the design operating point (Fig. 6.15).
As explained earlier in Eq. (6.3), fan power depends on, both, the air-
flow delivered and the system pressure losses. Therefore, excess airflow
results in higher fan power consumption.
The best way to check whether the airflow is excessive is to measure
the actual airflow and compare with the design requirements. If design
data is unavailable, then a good indication of excessive airflow can be pro-
vided by dividing the AHU airflow by the floor area it serves. Although
the airflow provided per unit floor area varies with design conditions
168 Chapter Six
P
r
e
s
s
u
r
e
Design operating point
Actual system curve
Design system curve with
high safety factor
Actual operating point
Air flow
Fan curve at
design speed
Figure 6.15 Fan performance due to use of high safety factor
for estimating system losses.
such as ceiling height and supply air temperature, generally, for cooling
the ratio is in the range of 18 to 27 cmh/m
2
(1 to 1.5 cfm/ft
2
). Therefore,
if the actual ratio of airflow to floor area served by the AHU is higher than
this, it is very likely that the operating fan capacity is more than required.
If the airflow is found to be excessive, the simplest solution is to reduce
the fan speed since airflow is proportional to the fan speed (Table 6.1).
This can be easily achieved by changing the pulley sizes of the fan and
the motor.
Since reduction in fan speed is proportional to the required reduction
in airflow, if the airflow needs to be reduced by 20 percent, then the fan
speed also needs to be reduced by 20 percent. The pulley sizing to achieve
this reduction in fan speed is illustrated in Example 6.4.
Example 6.4 Asystem is found to be delivering 12 m
3
/s when the actual require-
ment is 10 m
3
/s. The fan speed is measured to be 800 rpm while the motor speed
is 960 rpm. The motor pulley size is 200 mm and the fan pulley size is 240 mm.
Find the new fan pulley size and motor power consumption.
Q
1
ϭ 12 m
3
/s
Q
2
ϭ 10 m
3
/s
N
1
ϭ 800 rpm
New fan speed, N
2
ϭ N
1
ϫ (Q
2
/Q
1
) ϭ 800 ϫ (10/12) ϭ 666 rpm
Since the fan and motor speeds and pulley diameters are related as follows:
N
(fan)
/N
(motor)
ϭ D
(motor)
/D
(fan)
New fan pulley diameter, D
(fan)
ϭ (D
(motor)
ϫ (N
(motor)
)/N
(fan)
Therefore, D (fan) ϭ 200 ϫ (960/666) ϭ 288 mm
Another common way of reducing fan speed is by using a VSD for the
fan motor and then running the motor at a lower speed. Although this
solution is normally more expensive than a pulley change, it is easier
to achieve the desired airflow through trial-and-error setting of the
VSD’s frequency to get the exact airflow requirements.
6.5.7 Type of air distribution system
(CAV versus VAV)
Fans for air handling units are normally sized to handle the maximum
airflow required to meet peak load conditions. However, peak load con-
ditions are usually experienced only for short periods of time and the
capacity of air handling units is controlled to match requirements by
varying the supply air temperature or the amount of air supplied.
In constant air volume (CAV) systems, the capacity is controlled by
varying the supply air temperature. In such systems, the fan is operated
Air Handling and Distribution Systems 169
at a fixed speed to give a fixed quantity of air. This not only wastes
energy by supplying a constant volume of air irrespective of the load, but
also leads to high space relative humidity in air-conditioning systems at
low loads due to higher operating supply air temperatures at part load.
To avoid these shortcomings, variable air volume systems with devices
such as discharge dampers, inlet guide vanes, or variable speed drives
can be used to regulate the air volume with load while maintaining a
fixed supply air temperature. Although discharge dampers and inlet
guide vanes are able to reduce the air volume, the energy savings achieved
are much less than for variable speed drives, which are able to closely
follow the theoretical “cubic” fan power relationship. Typical energy
savings achieved by varying the airflow in VAV systems using the dif-
ferent systems is illustrated in Fig. 6.16.
A VSD can vary the speed of the fan to produce different airflows by
changing the fan curve. As shown in Fig. 6.17, at part load conditions,
the fan speed can be reduced so that the resulting fan curve intersects
the system curve at the required operating point. Variable speed fans
are able to closely match the theoretical fan power consumption curve,
which is dependent on the cubic relationship kW ϰ (flow)
3
. Therefore,
theoretically, at 50 percent flow condition, the fan power consumption
is 12.5 percent (0.5
3
ϭ0.125) of the maximum power consumption. This
shows that it is possible to reduce the power consumption significantly
at part load conditions by using a variable speed drive.
6.5.8 Static pressure set point
In variable air volume (VAV) air distribution systems, the air supplied
to the different spaces is varied based on load requirements. This is
170 Chapter Six
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
% of flow
Damper
IGV
VSD
%
o
f
i
n
p
u
t
p
o
w
e
r
Figure 6.16 Fan energy consumption in different VAV systems.
achieved by using VAV boxes that have dampers to automatically con-
trol the airflow through each box. Each VAV box receives an input from
a thermostat, which monitors the respective space temperature. The
measured space temperature is continuously compared with the desired
space temperature set point and a signal is provided to automatically
vary the airflow through each VAV box by opening or closing its damper.
Therefore, depending on the load, the VAV boxes vary the quantity of
air supplied to the spaces being conditioned. When the load is high, more
air is provided, while at part load less air is provided. This causes the
static pressure in the distribution ducting system to vary with load. In
VAV systems, static pressure sensors are installed in the distribution
ducting to sense the load and the pressure signal used to control the air-
flow from individual AHU’s by varying the fan speed or adjusting the inlet
guide vanes to maintain a static pressure set point, as shown in Fig. 6.18.
Air Handling and Distribution Systems 171
P
r
e
s
s
u
r
e
Required operating
point at part-load
System curve
Fan curve at design speed
Air flow
Fan curve at
reduced speed
Figure 6.17 Reducing air flow at part load by reducing
fan speed.
VAV
box
Supply
air
Outdoor
air
Return air
Filter coils
Controller
Static pressure
Supply
air
VAV
box
Room
temperature
sensor
VSD
Room
temperature
sensor
Figure 6.18 Arrangement of a VAV system.
Since the static pressure in ducts is used to control the airflow based
on load requirements, the location of the static pressure sensors and
actual set point are important to maximize energy savings. If the duct
static pressure sensor is not located correctly or the static pressure set
point is too high, the system will operate at a much higher pressure
than required and will result in wasted energy. It is very common to
find the duct static pressure sensor located at the discharge of AHUs.
In such systems, since the duct pressure sensor is unable to sense the
lowest pressure in the system, the pressure set point has to be set
higher to ensure that sufficient pressure is maintained in all areas of
the system.
The static pressure sensor should be located in the ducting system in
the region where the lowest static pressure is expected. The location of
this point depends on the design of the ducting system, but is usually
about two-thirds of the way along the duct. The actual location can be
found by measuring the duct pressure at a few locations along the duct-
ing system.
The static pressure set point is important because it ensures that the
system performs by providing sufficient air to all areas (depending on
load) while saving energy during part load operation. A high-pressure
set point will ensure that the system airflow requirements of all areas
are maintained but will result in lower energy savings. Similarly, a low-
pressure set point may result in higher energy savings but may lead to
space comfort conditions not being met in some areas. Therefore, it is
essential to set the most optimum set point to maximize energy savings
while maintaining space comfort conditions in all areas served by the
system. This ideal set point can normally be found by trial-and-error,
by operating the system at different set points and monitoring the space
conditions.
6.5.9 VAV optimization algorithm
In VAV systems, further energy savings can be achieved by continu-
ously resetting the static pressure set point based on system opera-
tions. In such systems, the static pressure set point is continuously
varied (as opposed to a fixed set point in conventional systems) in
response to the damper positions of the VAV boxes to ensure that no box
is starved of air. The aim of such a system is to minimize AHU fan
energy consumption by reducing the static pressure in the system while
ensuring that the space cooling or heating requirements of all spaces are
met. However, for such a system to function, the VAV box damper posi-
tions should be monitored and be linked to the AHU fan controls through
a central BAS or EMS.
172 Chapter Six
Atypical static pressure reset algorithm is shown in Fig. 6.19. The con-
trol algorithm is set to reduce the AHU fan speed up to the minimum
set point while ensuring no VAV box is more than 90 percent open or
likely to be starved of air. The algorithm is able to achieve this by mon-
itoring the damper positions of all the VAV boxes in a particular system
and identifying the box with the damper open the most and, thereby, the
most likely box to be starved of air. If the box with the damper open most
is more than 90 percent open, then the static pressure set point is raised.
Similarly, if the box with the damper open most is open less than 70 per-
cent (other boxes are open even less), the static pressure set point is
reduced. This check is performed continuously by the control system to
ensure that the system pressure is maintained at the minimum possi-
ble. It is estimated that such systems are able to achieve further 20 per-
cent energy savings as compared to conventional fixed set point VAV
systems.
6.5.10 Air distribution and balancing
In central systems, air is treated normally in AHUs and distributed to
one or more of the conditioned spaces. The cooling or heating provided
to meet space requirements depends on the quantity of air supplied
and the temperature of the supply air. As the temperature of the air sup-
plied by a particular AHU to the different spaces it is serving is the same,
different quantities of air have to be supplied to each of the spaces as
Air Handling and Distribution Systems 173
Determine position of
each VAV box damper
Determine maximum
(POS
MAX
)
POS
MAX
70%–90%
> 90% < 70%
VSD at
minimum
VSD at
100%
Decrease
static pressure
setpoint
Increase
static pressure
setpoint
Delay
Yes Yes
No No
Figure 6.19 Typical static pressure reset algorithm.
they may have varying load requirements. Since treated air from an
AHU is distributed by a ducting system to the different spaces, the
ducting system needs to be able to distribute the airflow so that each
space receives the required quantity of air. This is normally achieved by
air balancing.
If airflows to the different areas are not balanced, some areas may
receive more airflow while others receive less airflow. This normally
results in hot and cold spots in air-conditioned spaces. Often, “hot spots”
are experienced in areas furthest from AHUs due to insufficient airflow
at such locations. If simultaneously, “cold spots” are experienced in
areas closer to AHUs, this would indicate that the airflow is not well bal-
anced.
In such situations, rather than increasing the airflow supplied by the
AHU fan to satisfy warm areas (which results in higher energy con-
sumption), the airflows should be balanced so that excess air can be
diverted from areas receiving too much flow to areas that have inade-
quate flow.
6.5.11 Runaround coils
For areas that require low space relative humidity, usually, the supply
air is “overcooled” by the AHU coil to remove sufficient moisture and
thereafter electric duct heaters are used to reheat the supply air before
releasing it into the occupied space. This strategy not only wastes energy
but also increases the cooling load on the chiller plant.
Reheating for humidity control can be avoided by using runaround
coils where two extra coils sandwich the main cooling coil of the AHU
(Fig. 6.20). Water is circulated through the two coils using a small pump,
which enables transferring of heat from the incoming air (pre cooling)
to the leaving air. Heat pipe systems can also be used to achieve the same
effect. Research has shown that runaround coils can achieve substantial
174 Chapter Six
Circulating pump
Outdoor air
Expansion tank
Fan
Filter
Pre-cooling coil
Cooling coil
Re-heating coil
Treated air
Figure 6.20 Arrangement of an AHU runaround coil.
energy savings (about 20 percent of the total annual cooling energy for
the cooling coil) in hot and humid climates.
6.5.12 Optimal start-stop
The optimal start-stop algorithm available on most building automation
systems (BAS) can predict how long a building or space will take to
reach the desired temperature based on the variables that affect it,
such as outdoor air temperature, indoor space temperature, and building
thermal characteristics. This algorithm can be used to start the AHUs
(and chillers/boilers) at the latest possible time to achieve the required
space conditions before the space is occupied. Similarly, at the end of the
day, the algorithm can help to shut down the cooling or heating plant
at the earliest possible time.
6.5.13 Space temperature reset
Air-conditioning systems maintain comfort conditions in occupied
spaces by removing heat and moisture generated by occupants and
equipment. Occupants in air-conditioned spaces reject heat to the sur-
roundings by sensible and latent heat transfer to maintain body ther-
mal balance. Sensible heat transfer is mainly by convection and
radiation while latent heat transfer is by evaporation of moisture from
the body. Therefore, the amount of heat rejected by an occupant into a
space depends on parameters such as space temperature, relative
humidity, and air circulation rate. An occupant is able to reject more
latent heat if the space relative humidity is low. Similarly, more heat
rejection takes place by sensible means if the space temperature is
lower. For example, if the relative humidity is low, the occupants feel
comfortable at a higher space temperature since less sensible heat trans-
fer is required to maintain the body’s thermal balance. The required
space comfort conditions also depend on factors such as occupant activ-
ity and their clothing. Therefore, the space temperature should be set
taking into account factors such as space relative humidity, occupant
activity, and clothing level.
The space temperature set point for comfort applications also
depends on the heat gain into a space by radiation. For spaces with
glazing, located in perimeter zones of buildings, the space temperature
is normally set lower to account for the radiant heat transfer between
the surroundings and the occupants. However, in such spaces at times
when the mean radiant temperature is lower (evenings, night time
or rainy days), occupants often feel cold if the normal space temper-
ature set point is maintained. Therefore, to avoid such situations, the
space temperature set point could be reset based on outdoor weather
conditions.
Air Handling and Distribution Systems 175
6.5.14 Economizer cycle
An energy saving feature that can be incorporated into AHUs in some
climates is the outdoor air economizer. The basis of this strategy is to
use 100 percent outside air when it is below a certain temperature to
cool the space rather than using a mixture of outside air and return air.
When the outdoor air dry-bulb temperature is below the indoor tem-
perature, the economizer cycle can be programmed to convert the AHU
to use 100 percent outdoor air by adjusting the position of the outdoor
air and return air dampers. In humid climates, it is better to use
enthalpy (sensible and latent energy level) based controls to activate this
energy saving strategy.
A typical arrangement of an AHU working on an economizer cycle is
shown in Fig. 6.21. An economizer system normally includes indoor and out-
door temperature sensors, motorized dampers, and controls. Since the out-
door air damper needs to be large enough to provide 100 percent outside
air, this becomes a constraint when fitting economizers to existing AHUs.
Example 6.5 illustrates how the savings in cooling load, achievable
through an economizer cycle, can be estimated.
Example 6.5 Abuilding AHU working on the economizer mode provides 0.5 m
3
/s
of outdoor air to replace return air at 22ЊC dry-bulb temperature and 65 percent
relative humidity. If the conditions of the outdoor air are 18ЊC dry-bulb tempera-
ture and 45 percent relative humidity, estimate the reduction in cooling load for
the building chillers. Take the density of air to be 1.2 kg/m
3
.
From the psychrometric data in Appendix B, the enthalpy of return air is
49.3 kJ/kg (at 22ЊC dry-bulb at 65 percent RH) and the enthalpy of outdoor air is
32.6 kJ/kg (at 18ЊC and 45 percent RH).
Reduction in cooling load ϭ airflow rate ϫ density of air
ϫ difference in enthalpy
ϭ 0.5 m
3
/s ϫ 1.2 kg/m
3
ϫ (49.3 – 32.6) kJ/kg
ϭ 10 kW (approximately 2.8 RT)
176 Chapter Six
Return air
Filter cooling coil
Supply air Outdoor air
Return air damper closed
Outdoor air
damper open
Figure 6.21 Typical arrangement
of an AHU on economizer mode.
6.5.15 Fresh air control
Outdoor air is required for ventilation and to ensure sufficient building
pressurization to prevent infiltration of air into buildings. To maintain
good building Indoor Air Quality (IAQ), ASHRAE Standard 62 is gen-
erally used as a guideline for determining the quantity of ventilation air
required per occupant.
The quantity of fresh air required to provide sufficient ventilation depends
on factors such as the number of occupants and the type of space usage.
Usually, the amount of fresh air provided works out to be about 10 to 15 per-
cent of the total supply air quantity. Therefore, if the fresh air intake is more
than about 15 percent of the total supply air quantity, it could indicate an
excess supply of fresh air. Reduction in the amount of fresh air provided
would help to reduce the cooling and heating load of buildings and, there-
fore, result in lower energy consumption, as illustrated in Example 6.6.
Example 6.6 If the outdoor air is at 32ЊC (dry bulb) and 70 percent relative
humidity, estimate the savings that can be achieved in cooling load when the
total outdoor air intake for a building is reduced by 1 m
3
/s. Take the condition of
room air to be 23ЊC (dry bulb) and 55 percent relative humidity.
From the psychrometric data in Appendix B, the enthalpy of outdoor air is
86.1 kJ/ kg (at 32ЊC dry bulb and 70 percent RH), and the enthalpy of return air
is 47.5 kJ/kg (at 23ЊC and 55 percent RH).
Reduction in cooling load ϭ airflow rate ϫ density of air
ϫ difference in enthalpy
ϭ 1.0 m
3
/s ϫ 1.2 kg/m
3
ϫ (86.1 – 47.5) kJ/kg
ϭ 46.3 kW (approximately 13 RT)
Further, as building occupancy also usually varies during different
periods of the day, it is not necessary to provide a constant amount of
fresh air at all times. Hence, fresh air provided can be varied based on
building occupancy.
One way to achieve this is to preprogram the expected occupancy pat-
tern on the building energy management system and use it to vary the
outdoor airflow. A simpler solution is to use carbon dioxide (CO
2
) sen-
sors to monitor the CO
2
level in the occupied spaces or the return air
at the AHUs and use it as an indicator of occupancy to vary the outdoor
airflow. The CO
2
level can be set at a predetermined value, such as 1000
ppm, and the proportion of the outdoor and return airflow quantities
varied to maintain this set point, as shown in Fig. 6.22.
6.5.16 Air-to-air heat recovery
As described earlier, ventilation in buildings is provided by introducing
outdoor air and exhausting an equal quantity of air to maintain the pres-
sure balance in the building.
Air Handling and Distribution Systems 177
In air-conditioned buildings, the exhaust air is normally colder and
has a lower enthalpy than the fresh outdoor air that is taken in for ven-
tilation. Therefore, energy recovery systems, such as those using heat
pipe systems and energy recovery wheels (Fig. 6.23), can be used to pre-
cool the fresh air using exhaust air. In centralized ventilation systems,
outdoor air is taken at one point and distributed to the individual AHUs.
Similarly, the space air removed from the different parts of a building
is also discharged using a single exhaust fan. Very often, both the fresh
air and exhaust air fans are located on the roof of the building, as in the
case of office towers. The exhaust air can then be easily used to precool
the outdoor air, as shown in Fig. 6.24. The same can be done in heating
systems to preheat fresh air using the warm exhaust air.
The amount of energy recovered depends on the efficiency of the recov-
ery system and can be expressed as follows for systems that exchange
sensible heat and those that can exchange total heat (both sensible and
latent).
178 Chapter Six
Return air
Filter cooling coil
Supply air
Outdoor air
CO
2
Return air and outdoor
air damper control
Figure 6.22 Outdoor air control based on CO
2
level.
1. Heating/cooling energy (e.g. 80%) is always returned to
where it came from
2. Moisture and dry air (e.g. 80%) is always returned to
where it came from
Heat in
Moisture in
Moisture out
Dry air out
Dry air in
Heat out
Cooling energy out
Cooling energy in
Figure 6.23 Arrangement and operation of a typical energy recovery wheel. (Courtesy of
Desiccant Rotors International Pvt. Ltd.)
Sensible heat only:
(6.6)
Total heat:
(6.7)
where ϭ efficiency (%)
T ϭ dry-bulb temperature (ЊC)
H ϭ enthalpy
OA ϭ outdoor air
SA ϭ supply air
RA ϭ return air
Similarly, the amount of energy recovered can be expressed as follows:
Q
sensible
ϭ ϫ v ϫ Cp ϫ (T
OA
– T
SA
) (6.8)
and
Q
total
ϭ ϫ v ϫ (h
OA
– h
SA
) (6.9)
total
5 a
h
OA
2 h
SA
h
OA
2 h
RA
b 3 100
sensible
5 a
T
OA
2 T
SA
T
OA
2 T
RA
b 3 100
Air Handling and Distribution Systems 179
Room
air
Supply air Outdoor air
Exhaust
air
AHU
Energy recovery system
Floors of
building
AHU
AHU
AHU
AHU
AHU
AHU
AHU
Figure 6.24 Typical arrangement of an energy recov-
ery system.
where Q ϭ energy recovered (kW)
ϭ density of air (kg/m
3
)
V ϭ airflow rate (m
3
/s)
Cp ϭ specific heat capacity of air (kJ/kg⋅K)
Based on the values for specific heat capacity and density, Eq. (6.8)
and Eq.(6.9) can be simplified as follows:
Q
sensible
ϭ 1.232 ϫ v ϫ (T
OA
– T
SA
) (6.10)
and
Q
total
ϭ 1.2 ϫ v (h
OA
– h
SA
) (6.11)
Example 6.7 illustrates how the amount of energy recovery can be
computed.
Example 6.7 Consider the case where 1.2 m
3
/s of outdoor air is provided to an air-
conditioning system to makeup for an equal amount of air removed by the exhaust
system. If the outdoor air temperature is 30ЊC and the return air temperature is
23ЊC, find the supply air temperature that can be achieved using an energy recov-
ery system that can only transfer sensible heat and has an efficiency of 75 percent.
Also, calculate the total amount of precooling done to the outdoor air.
Using Eq. (6.6),
T
SA
ϭ T
QA
Ϫ (T
QA
Ϫ T
RA
) ϫ
sensible
ϭ 30 Ϫ (30 Ϫ 23) ϫ 0.75
ϭ 24.75ЊC
Sensible cooling done:
Q
sensible
ϭ 1.232 ϫ v ϫ (T
OA
Ϫ T
SA
)
ϭ 1.232 ϫ 1.2 ϫ (30 Ϫ 24.75)
ϭ 7.8 kW (which is approximately equal to 2 RT)
6.5.17 Car park ventilation systems
Mechanical ventilation systems, consisting of supply and exhaust fans,
are widely used for ventilating building spaces such as basement car
parks. These ventilation systems are normally designed to provide the
ventilation rates required under extreme or worst case conditions.
However, ventilation rates required under normal operating conditions
are usually much less and it is possible to control the operation of the
fans to match the actual ventilation requirements.
For car parks, carbon monoxide (CO) and temperature sensors can be
used to monitor the quality of car park air and control the supply and
180 Chapter Six
exhaust fans. The values for temperature and CO level can be set based
on individual requirements or ventilation codes. Since the operation of
exhaust and supply fans normally need to be interlocked to ensure a
pressure balance in the areas served by them, the control system would
need to control both sets of fans simultaneously.
In car park ventilation systems that have many supply and exhaust
fans serving specific areas of the car park, sensors installed in various
parts of the car park can be used to switch on/off the sets of supply and
exhaust fans serving specific areas when the CO level and temperature
in a particular part of the car park reaches a set value.
6.6 Summary
Air handling and air distribution systems are used for providing heat-
ing, cooling, and ventilation requirements in buildings. In such sys-
tems, fans are used to transport air through ducting systems from one
part of a building to another. Since in a typical building, many fans are
used for such applications, collectively they can account for a significant
amount of energy consumed in buildings.
This chapter provided an overview of air handling and distribution
systems, which included losses in ducting systems and fan character-
istics. Thereafter, various design and operational strategies for reduc-
ing energy consumption by improving the energy efficiency of air
handling and air distribution systems were described. The savings
achievable for some of the energy saving measures were illustrated
using examples.
Review Questions
6.1. Afan delivers 15 m
3
/s at 1400 rpm and consumes 30 kW. If the airflow rate
is to be reduced to 10 m
3
/s, what will the new fan speed and power con-
sumption be?
6.2. The fan of an air handling unit is designed to deliver 20 m
3
/s. Estimate the
savings that can be achieved in fan power consumption if the AHU uses a
filter that has a pressure drop of 30 Pa instead of a filter having a pres-
sure drop of 80 Pa.
6.3. If a building uses outdoor air at 35ЊC (dry-bulb) and 60 percent relative
humidity, estimate the savings that can be achieved in cooling load when the
total outdoor air intake for a building is reduced by 1.5 m
3
/s. Take the con-
dition of room air to be 23ЊC (dry-bulb) and 55 percent relative humidity.
If the building operates for 12 hours a day and 250 days a year, estimate
the annual energy savings (in kWh) that can be achieved from the chiller
plant if the efficiency of the chiller system is 0.8 kW/RT.
Air Handling and Distribution Systems 181
6.4. 3 m
3
/s of outdoor air is provided to an air-conditioning system to makeup for
an equal amount of air removed by the exhaust system. If the outdoor air
temperature is 33ЊC and the return air temperature is 23ЊC, find the supply
air temperature that can be achieved using an energy recovery system that
can only transfer sensible heat and has an efficiency of 77 percent.
Also, estimate the resulting annual energy savings from the chillers if
the building operates 10 hours a day, 260 days a year, and the chiller
system efficiency is 0.83 kW/RT.
182 Chapter Six
Chapter
7
Lighting Systems
7.1 Introduction
Lighting systems normally account for more than 20 percent of the elec-
trical energy consumed in commercial buildings. Lighting systems not
only consume power directly to generate light, in air-conditioned build-
ings they also indirectly account for some of the power consumed by air-
conditioning systems, as the heat added by lighting has to be removed
by the building cooling systems.
However, lighting is essential for buildings to ensure the comfort,
productivity and safety of the building’s occupants. Therefore, lighting
systems need to be carefully designed to achieve the desired illumina-
tion level while using the minimum amount of energy.
Energy savings from lighting systems can be achieved by means such
as optimizing lighting levels, improving the efficiency of lighting sys-
tems, using controls, and daylighting (using natural light). This chap-
ter provides a brief description of some basic concepts of lighting followed
by typical energy saving measures for lighting systems.
7.2 Definitions
A few important definitions associated with lighting systems are
described here.
Lumens. Lumens is the SI unit for luminous flux, which is the quantity
of light emitted by a source or the quantity of light received by a surface.
Typical values of luminous flux emitted by some common sources of
light are given in Table 7.1.
183 183
Candela. Candela (cd) is a measure of luminous intensity. Originally
luminous intensity was measured in units called candles (based on the
approximate amount of light emitted by a candle flame). Later the term
candela was adopted to allow for consistent and repeatable measure-
ments of light, where 1 candela is equal to 1 candlepower.
Lux. Lux is the SI unit for illuminance, which is a measure of the
direct illumination on a surface area of one square metre. One lux is one
lumen/m
2
. Some typical lux values are given in Table 7.2.
Luminous efficacy. Luminous efficacy is the ratio of luminous flux emit-
ted by a lamp to the power consumed by the lamp and its control gear.
This ratio indicates the efficiency of a lamp in converting electrical
power into light. The units of efficacy are lm/W.
Edison’s first electric filament lamp had an efficacy of 1.4 lm/W.
However, with research and development, the efficacy of lamps has
improved significantly over the years. Typical values of efficacy for some
common lamps are given in Table 7.3.
Color temperature. The color temperature of a light source is a numeri-
cal measurement of its color appearance. It is based on the fact that when
an object is heated to a temperature high enough it will emit light and as
the temperature is increased, the color of the light emitted will also
increase. For example, when a blacksmith heats a horseshoe, it will first
appear red and will change to orange, followed by yellow and later white.
Color temperature is defined as the temperature of a blackbody radi-
ator which emits radiation of the same chromaticity as the lamp. The
184 Chapter Seven
TABLE 7.1 Luminous Flux Emitted by Common Light Sources
Lamp Lamp wattage Lumens
Torch lamp 3 W 30
Incandescent lamp 75 W 950
Compact fluorescent lamp 15 W 810
Fluorescent lamp 36 W 2,400
High-pressure sodium lamp 100 W 10,500
Low-pressure sodium lamp 131 W 26,000
TABLE 7.2 Typical Lux Values
Location Lux level
Basement car parks 15
Offices 500
Under the shade of a tree 10,000
Under the midday sun 100,000
unit of color temperature is Kelvin (K). The degree of “warmth” or “cool-
ness” of the space is related to the color temperature of the light source.
The lower the color temperature, the “warmer” the light appears. Light
sources that appear violet or blue color are “cool” while those that are
red, yellow or orange are “warm.”
Typical values of color temperature and associated warmness or cool-
ness are given in Table 7.4.
Color rendering. While color temperature is a measure of the color of a
light source, the color rendering index is an indication of the ability of
a light source to accurately show colors.
Color rendering expresses the appearance of object colors when illu-
minated by a given light source as compared to its appearance in a ref-
erence light source. It is usually expressed as an index called the color
rendering index (CRI), which is an indication of the appearance of an
object illuminated by a light source compared to its appearance under
natural light. Natural light will have a CRI of 100. Electric filament
lamps produce a continuous spectrum with all colors present and, there-
fore, they have a CRI of 100. Normally, CRI below 80 is considered poor
color rendering while CRI above 80 is considered good.
Typical values of CRI are given in Table 7.5.
Lighting Systems 185
TABLE 7.3 Typical Efficacy of Lamps
Lamp type Efficacy (lm/W)
Incandescent 10–15
Halogen 13–25
Compact fluorescent 50–60
Fluorescent lube 69–100
Metal halide 85–120
High-pressure sodium 80–140
Low-pressure sodium 150–200
TABLE 7.4 Color Temperature and Warmness of Common
Types of Lamps
Lamp type Color temperature (K)
Incandescent filament lamp 2600–3000
Tungsten halogen 3000–3400
Warm white fluorescent 3000
Cool white fluorescent 4000
Daylight fluorescent 5000
Metal halide 3300–5700
High-pressure sodium 2000–3200
Low-pressure sodium 1600
7.3 Types of Lamps
7.3.1 Incandescent lamps
Incandescent lamps (Fig. 7.1) produce light using an incandescent fila-
ment (normally tungsten), which is sealed in a glass bulb containing an
inert gas.
Incandescent lamps were previously one of the most commonly used
lamps due to their low initial cost and good color rendering (CRI above
95). However, they have been phased out from general applications due
to their low efficacy, which is only about 10 to 15 lm/W. The low efficacy
is because incandescent lamps convert about 92 percent of the energy
into heat and only 8 percent is converted to useful light. They also have
a relatively short life of only about 1000 hours.
However, they have good color rendering and a warm color tempera-
ture, which make them the preferred choice for many special applications.
186 Chapter Seven
Figure 7.1 Incandescent lamp.
(Courtesy of Philips.)
TABLE 7.5 Typical Values of Color Rendering Index
Lamp type Color rendering index (CRI)
Incandescent filament lamp 100
Tungsten halogen 100
Fluorescent 80–95
Metal halide 65–80
High-pressure sodium 25
Low-pressure sodium 0
7.3.2 Halogen lamps
Halogen lamps are filament lamps (Fig. 7.2) that operate at higher pres-
sure and temperature than standard incandescent lamps to produce
whiter light. They have halogen added to prevent evaporated tungsten
from blackening the bulb. This helps the lamps to maintain lumen levels
and provide a “sparkling” effect.
They have an efficacy of 13 to 25 lm/W, which is slightly higher than
that of incandescent lamps. They are commonly used in retail applica-
tions, such as for highlighting merchandise.
7.3.3 Fluorescent lamps
Fluorescent lamps are different from filament lamps and use an arc cre-
ated between two electrodes in a tube filled with a gas or vapor (mer-
cury) to produce light. The arc ionizes the gas and releases electromagnetic
radiation in the ultraviolet region. The ultraviolet energy of the dis-
charge activates the phosphor coating, which then emits light. They
have higher efficacy than filament lamps. Fluorescent lamps can be
Lighting Systems 187
Figure 7.2 Halogen lamp with reflector. (Courtesy of Philips.)
generally categorized into linear or tubular fluorescent lamps and com-
pact fluorescent lamps.
Linear fluorescent lamps. They are one of the most common types of
lamps used for general lighting. They come in varying lengths. The tubes
are classified by a T number (Fig. 7.3), which refers to the tube diame-
ter in 1/8 of an inch. T12 refers to 12 ϫ1/8 ϭ1-inch (38 mm) tubes, while
T8 refers to 1-inch or 26-mm tubes. The color rendering index for linear
fluorescent lamps is normally about 70 to 80. The lamp life is about
12,000 hours, which is much more than the life of filament lamps.
Linear fluorescent lamps have evolved over time from old T12 to T8
and later to T5 lamps. The reduction in tube diameter and improvement
in technology, including the use of electronic control gear (described
later), have resulted in efficacy improvement from about 50 lm/W in the
1970s to more than 100 lm/W.
Compact fluorescent lamps. Compact fluorescent lamps (Fig. 7.4) fold
the discharge path and are therefore smaller in size compared to linear
fluorescent lamps. The ballast is normally integrated with the lamp so
that they can be easily fitted into standard sockets used by incandes-
cent lamps. They have a much higher lamp efficacy compared to incan-
descent lamps and use only about 20 to 25 percent of electrical power
(compared to incandescent lamps) to produce the same amount of light.
They also have a much longer life, which is about 8000 hours, com-
pared to only 1000 hours for filament lamps. Although compact fluo-
rescent lamps cost more than incandescent lamps, they are more
economical to use due to their lower energy consumption and longer life.
They are available in a variety of shapes. The color temperature
ranges from 2700 to 6000 K compared to 2700 to 3000 K for incandes-
cent lamps. The CRI is about 82 to 88.
188 Chapter Seven
Figure 7.3 Different sizes of fluorescent lamps. (Courtesy of Philips.)
7.3.4 High-intensity discharge lamps
Metal halide lamps, mercury vapor lamps, and sodium lamps are called
high-intensity discharge (HID) lamps. They are able to provide better
efficacy and longer life than fluorescent lamps. They are commonly used
in high-bay lighting for industrial applications, outdoor floodlighting,
and street lighting.
Mercury vapor lamps (Fig. 7.5) use a mercury arc tube and a filament
in the same envelope coated with a fluorescent material. They have an
efficacy of about 30 to 55 lm/W, which is lower than other HID lamps. They
have a longer life than the other HID lamps and are therefore preferred
for high-bay applications in areas where lamp replacement is difficult.
Metal halide lamps (Fig. 7.6) are the basic mercury vapor lamp with
iodides of metals added to them. They have a higher efficacy than mer-
cury lamps (about 95 lm/W) and produce a higher quality of light.
There are two types of sodium lamps, namely, high-pressure sodium
lamps (Fig. 7.7) and low-pressure sodium lamps (Fig. 7.8). High-pressure
sodium lamps have a ceramic arc tube with a clear outer envelope. They
have a higher efficacy than metal halides and mercury vapor lamps.
They also have better color rendering than low-pressure sodium lamps
and are generally used for street lighting, industrial lighting, and
floodlighting.
Lighting Systems 189
Figure 7.4 Compact fluorescent
lamps. (Courtesy of Philips.)
190 Chapter Seven
Figure 7.5 Mercury lamp. (Courtesy
of Philips.)
Figure 7.6 Metal halide lamp. (Courtesy of Philips.)
Figure 7.7 High pressure sodium lamp. (Courtesy of Philips.)
Low-pressure sodium lamps consist of a U-tube containing the discharge
and an outer thermal jacket. They have a high efficacy (over 150 lm/W)
but produce light only in the yellow part of the spectrum. Therefore, these
lamps are generally used only for outdoor applications such as street
lighting and security lighting.
The main advantages of HID lamps are that they are compact sources that
can produce large amounts of lumens and are available in a wide range of
wattages. However, they have a warm-up time and therefore take a few min-
utes to reach the full light output. They also cannot be restarted for a few
minutes after switching off as they need to cool down before starting.
7.4 Lighting Levels
The lighting level or lux level required for a space depends on the type of
space, tasks performed in the space, and other visual requirements.
General guidelines for the illuminance range for different applications
that need to be used when designing of lighting systems are available in
lighting reference books and codes of practice. Asummary of recommended
lighting levels for some common building spaces are given in Table 7.6.
The lighting levels given in Table 7.6 are used generally as a guide-
line to ensure that lighting levels provided are adequate for the specific
Lighting Systems 191
Figure 7.8 Low-pressure sodium lamp. (Courtesy of Philips)
TABLE 7.6 Recommended Illuminance Levels
Recommended
Type of area Illuminance (lux) design value (lux)
General offices, conference 300–750 500
rooms, computer workstations
School classrooms 200–500 300
Shops, departmental stores 300–750 500
Supermarkets 500–1000 750
Hospitals 200–500 300
Lobbies, corridors 100–200 150
Hotel rooms:
General 75–150 100
Local 200–500 300
Car parks:
Parking areas 10–20 15
Entrance 50–300 100
tasks to be performed while preventing unnecessary wastage of elec-
tricity due to excessive lighting levels.
7.5 Lighting Power Density
The amount of electricity used for lighting also depends on the type of
lighting used (efficacy) and other lighting design criteria such as the type
of luminaries used, location and spacing of luminaries and whether
reflectors or covers are used. The overall efficiency of a lighting design
can be evaluated using the lighting power allowance (or lighting power
density) which is computed in W/m
2
or W/ft
2
.
ASHRAE Standard 90.1 prescribes two methods to determine com-
pliance for interior lighting. The simplest method of the two is the “build-
ing area method” where the gross lighted floor area is multiplied by the
allowable lighting power density in W/m
2
for a particular building area
type to determine the maximum allowable installed lighting power.
For offices, the maximum allowed is 10.8 W/m
2
(1 W/ft
2
) which can
easily be achieved using T8 lamps with electronic ballast. As a guide-
line, the lighting power density for office spaces, shops and car parks
should not exceed 10 W/m
2
, 20 W/m
2
, and 5 W/m
2
, respectively.
7.6 Common Energy Saving Measures
Based on the lighting fundamentals and concepts explained earlier,
some possible energy saving measures that can be applied for lighting
systems are described next.
7.6.1 Reducing lighting levels
As explained earlier, the lighting level for a particular space depends on
the tasks to be performed in the space and other visual requirements
for the space. Generally, higher lighting levels lead to higher lighting
energy consumption. Therefore, lighting levels should be minimized
and maintained based on the recommended values in Table 7.6.
For new installations, this can be achieved through good lighting
design by optimizing factors such as lamp wattage, number of lamps,
and lamp spacing.
For existing installations where it is not cost effective to redesign light-
ing systems, other means such as delamping, use of task lighting, and
replacement of lamps can be considered to reduce energy consumption.
Delamping. Delamping involves removing one or more lamps from a fix-
ture (that has more than one lamp) in areas where the lighting level is
higher than required. Delamping could be done by simply removing
lamps from fixtures or by converting existing luminaries to use less
192 Chapter Seven
number of lamps, which may involve using conversion kits with reflec-
tors and adaptors. The latter option, although more costly, is generally
preferred as simply removing lamps could sometimes give an impres-
sion of the building being poorly maintained. Delamping can be carried
out for areas such as offices, car parks, corridors, and toilets.
Use of task lighting. In many building spaces general lighting is provided
uniformly at a higher level so that the required lighting level can be
achieved on the work surfaces (Fig. 7.9). However, since the quantity of
light is inversely proportional to the square of the distance from the light
source (inverse square law), a more intense lighting level is required for
general lighting compared to task lighting to achieve the same lighting
level at the required area.
In general lighting applications savings can also be achieved by locat-
ing the ceiling fixtures directly over the work areas.
Replacing lamps. Another strategy is to replace high wattage lamps with
lower wattage lamps. For example, T12 lamps can be replaced with T8
lamps and T8 lamps can be replaced with T5 lamps. Although the lumen
levels for the higher efficacy replacement lamps may sometimes be lower,
the impact on the general lighting level is normally not noticeable.
Lighting Systems 193
Figure 7.9 Effective use of task lighting. (Courtesy of Philips.)
7.6.2 Use of energy-efficient lamps
The amount of light emitted by a lamp per unit of electrical power con-
sumed is the luminous efficacy of a lamp. The units of luminous efficacy
are lumens/watt (lm/W). The higher the efficacy, the better the efficiency
of the lamp. Since different types of lamps have different efficacies,
lamps with low efficacy can be replaced with those having higher efficacy.
Incandescent lamps. Incandescent lamps have a low efficacy of about
10 to 15 lm/W and, therefore, are not energy efficient. They can be easily
replaced with compact fluorescent lamps (CFL), which have a much
higher efficacy of about 50 to 60 lm/W. In general, compact fluorescent
lamps consume only about 20 to 25 percent of the power consumed by
incandescent lamps to produce the same amount of light.
Acomparison of power ratings for incandescent and compact fluorescent
lamps for producing equivalent illuminance levels is given in Table 7.7.
Compact fluorescent lamps also have a life span of about eight times
that of incandescent lamps (8000 hours compared to 1000 hours).
Although compact fluorescent lamps are costlier than incandescent
lamps, the extra cost can be normally paid back within about one to two
years of operation due to the lower energy consumption and longer life
span of these lamps.
Example 7.1 Calculate the simple payback period for replacing 100 nos. of 75 W
incandescent lamps with 15 W compact fluorescent lamps if they operate 24 hours
a day, seven days a week, and the electricity tariff is $0.10/kWh.
The lamp cost and lamp life are given below for the two types of lamps.
Energy savings per lamp ϭ (75 – 15) ϭ 60 W
Energy savings per day ϭ (60 ϫ 100 ϫ 24)/1000 kWh ϭ 144 kWh/day
Annual energy savings ϭ 144 ϫ 365 ϫ $0.10 ϭ $5250
Payback period based purely on energy savings
ϭ $(15 ϫ 100)/$5,250
ϭ 0.3 years (3.4 months)
Incandescent 75 W Compact fluorescent 15 W
Unit cost ($) 1 15
Lamp life (hours) 1000 8000
194 Chapter Seven
TABLE 7.7 Comparison of Lamp Power for Incandescent
and Compact Fluorescent Lamps
Incandescent lamp 40 W 60 W 75 W 100 W
CFL 9 W 11 W 15 W 20 W
Payback period taking into account longer lamp life:
Annual cost of incandescent lamps ϭ $1 ϫ (8760/1000) ϭ $8.87
Annual cost of CFL ϭ $15 ϫ (8760/8000) ϭ $16.43
Total additional cost ϭ $(16.43 Ϫ 8.87) ϫ 100 ϭ $756
Payback period ϭ 756/5250 ϭ 0.14 years (2 months)
Linear fluorescent lamps. Linear fluorescent lamps are used for many
general applications such as offices, corridors, and car parks. These
lamps have an efficacy of 69 to 100 lm/W and are more energy efficient
than compact fluorescent lamps.
In the past, the linear fluorescent lamps used were T12 (40 W) lamps
(38-mm diameter), which have an efficacy of 69 lm/W. They have been
gradually replaced by the T8 lamps, which have a smaller tube diame-
ter (26 mm) and are more energy efficient (90 lm/W). Since T12 and T8
lamps have the same tube length, T12 lamps can be replaced with T8
lamps without having to replace the fixtures. Typically, a two lamp,
1200-mm long T12 luminaire with low-loss magnetic ballast will con-
sume about 86 W compared to 72 W for an equivalent T8 system.
Therefore, savings of about 14 W can be achieved in such applications.
Example 7.2 Estimate the daily electrical energy savings that can be achieved if
a 1200 mm (4 feet) long two lamp luminaire using T12 lamps is converted to use
T8 lamps. Take the operating hours to be 12 hours a day.
Energy savings per luminaire ϭ (86 Ϫ 72) ϭ 14 W
Energy savings per day ϭ (14 ϫ 12)/1000 kWh
ϭ 0.168 kWh/day
The newer T5 lamps are even more compact (16 mm diameter) and
have an efficacy of about 100 lm/W. As such, T5 lamps should be con-
sidered as an alternative to T8 lamps for applications such as offices and
corridors. However, due to the shorter tube length of T5 lamps, they
cannot be directly fitted to existing T8 fixtures. Therefore, use of T5 lamps
should normally be considered for new installations rather than for
retrofitting existing fixtures. However, T5 lamps with integrated adap-
tors designed to fit into existing T8 fixtures for retrofit applications are
also currently available in the market.
High-bay. For high-bay lighting applications, such as warehouses, fac-
tories, large stores, and sports facilities, metal halide and high-pressure
sodium lamps should be used instead of mercury vapor lamps as they have
a higher efficacy. High-pressure sodium lamps are also able to produce a
fuller spectrum of light, which can help improve nighttime visibility.
Lighting Systems 195
Similarly, for outdoor lighting, metal halides, high-pressure sodium
and, where acceptable, low-pressure sodium lamps can be used. Low-
pressure sodium lamps have an efficacy of about 175 lm/W, which is
higher than that of other types of HID lamps. However, since the light-
ing quality of low-pressure sodium lamps is not good, they are gener-
ally used only for outdoor security lighting and street lighting.
Example 7.3 Calculate the simple payback period for replacing 100 nos. of 600-
mm (2 feet) long T8 lamps with T5 lamps costing $30 each if they operate 24 hours
a day, seven days a week, and the electricity tariff is $0.10/kWh.
The power consumption and lamp life are given below for the two types of
lamps.
Energy savings per lamp ϭ (22 Ϫ 15) ϭ 7 W
Energy savings per day ϭ (7 ϫ 100 ϫ 24)/1000 kWh ϭ 16.8 kWh/day
Annual savings ϭ 16.8 ϫ 365 ϫ $0.1 ϭ $613.20
Total cost ϭ $30 ϫ 100 ϭ $3000
Payback period ϭ 3000/613.20 ϭ 4.9 years
7.6.3 High-efficiency electronic ballast
Ballasts are used to start and operate fluorescent and HID lamps.
Ballasts provide the voltage necessary to strike the arc discharge and
to regulate current drawn by the lamp to maintain light output.
The two main types of ballasts are magnetic and electronic.
Conventional magnetic ballasts have a core of magnetic steel lamina-
tions surrounded by coil assemblies, while electronic ballasts have elec-
tronic components. These electronic ballasts (Fig. 7.10) operate at high
frequencies, between 20,000 and 60,000 Hz, which makes power-to-light
conversion more efficient than for magnetic coil ballasts. Electronic
ballasts are superior to magnetic ballasts because they are typically
30 percent more energy efficient. There are also improved versions of
the magnetic ballast called low-loss ballasts, which have lower losses due
to the design and construction of the core and coil assembly.
Fluorescent lamp ballasts operate typically as preheat, rapid start,
and instant start. In the preheat type operation, the lamp electrodes are
heated prior to application of the starting voltage to strike the arc. The
lamp flickers when starting in the preheat operation. In rapid start, the
T8 T5
Power consumption of lamp 22 15
& ballast (W)
Lamp life (hours) 1000 8000
196 Chapter Seven
electrodes are heated before starting and during operation. Usually,
starting is smooth compared to the preheat operation. In instant start,
lamp electrodes are not heated and the ballast provides a high open-
circuit voltage across the electrodes to strike the arc. The lamp life
tends to be shorter for this type of operation compared to rapid start.
Ballasts use energy during operation, which is called ballast losses.
Ballast losses vary depending on the type of ballast used. Magnetic bal-
lasts have the highest losses followed by low-loss and electronic ballasts.
In applications using magnetic or low-loss ballasts, the actual input
power is normally higher than the lamp rated watts. However, in appli-
cations using electronic ballasts, due to their lower losses, the total
system input power can be less than the lamp rated power.
Acomparison of power consumption for a fixture consisting of two 36 W
lamps (1200 mm length) with different types of ballast is given in Table 7.8.
Example 7.4 Calculate the simple payback period for replacing 100 nos. of low
loss ballast with electronic ballast for an application using 36 W lamps if they oper-
ate 24 hours a day, 7 days a week, and if the electricity tariff is $0.10/kWh. Take
Lighting Systems 197
Figure 7.10 Typical electronic ballast. (Courtesy of Philips.)
the unit cost of electronic ballast to be $20 (supply and installation) and the saving
in power consumption to be 4 W per lamp.
Energy savings per day ϭ (4 ϫ 100 ϫ 24)/1000 kWh ϭ 9.6 kWh/day
Annual energy savings ϭ 9.6 ϫ 365 ϫ $0.10 ϭ $350.40
Total cost of ballast ϭ $20 ϫ 100 ϭ $2,000
Payback period ϭ 2000/350.40 ϭ 5.7 years
7.6.4 Luminaires
Luminaires consist of lamps, ballast, lamp holders, optical devices, and
a housing. Optical devices normally consist of components such as reflec-
tors, lenses, or louvers to effectively deliver light to the space or work
plane. The optical efficiency of a luminaire depends mainly on the mate-
rial properties and geometry of the optical components.
Linear fluorescent lamps are the most commonly used lamps for gen-
eral lighting in commercial and industrial applications. Due to the cylin-
drical shape of linear fluorescent lamps, if reflectors are not used, about
half of the light emitted by them would be reflected on to the ceiling.
Therefore, various types of reflectors are used to improve the optical effi-
ciency of luminaries used in linear fluorescent lamps.
Most standard reflectors used in luminaries of fluorescent lamps have
a reflectivity of about 70 to 80 percent However, reflectors made of spe-
cial materials capable of improving the reflective effectiveness are avail-
able. These reflector materials have a mirror-like finish that allow better
redirection of light rays.
Some of the special reflector materials are anodized specular alu-
minum, having a total reflectivity of 85 to 90 percent, and vacuum-
deposited specular silver applied on a polyester surface, having a total
reflectivity of 91 to 95 percent.
Fluorescent luminaires can be retrofitted with such new reflectors,
often resulting in increased useable light, enabling building owners to
remove lamps and save energy while still maintaining acceptable light-
ing levels. In some applications, reflectors can be used to retrofit existing
luminaries to convert them from 4- to 2-lamp operation, thereby reduc-
ing the lighting energy consumption by about 50 percent.
198 Chapter Seven
TABLE 7.8 Comparison of Power Consumption
for a Fixture with Two 36 W Lamps
Ballast Watts Savings
Magnetic 84 –
Low loss 72 14%
Electronic 64 24%
Maintenance can also impact the optical efficiency of luminaries, and
the light available in the space or at the working plane can be reduced
due to the accumulation of dirt, discoloring of lenses and reflectors, and
aging of lamps. Therefore, regular maintenance is required to maximize
the lighting levels by cleaning dirty lamps and fixtures, replacing faded
reflectors, lenses and lamps which are nearing the end of their useful life.
7.6.5 Lighting controls
Energy consumed by lighting can also be reduced by minimizing their
usage by better matching operations with demand through lighting con-
trols. Various systems such as timers, occupancy sensors, and light sen-
sors can be used to control lighting operations.
Timer schedules. Simple timers can be used to switch on and off all or
some lighting circuits at predetermined times based on occupancy sched-
ules. Provision for manual override can be incorporated into the controls
so that occupants can extend the operating hours of lighting circuits
based on individual requirements. Lighting control systems can consist
of simple timers that have 24-hour clocks to switch on and off lighting
daily at preset times, or more sophisticated timers that can be used to
program lighting schedules for a year or more, where holidays and other
special requirements can be programmed in advance. Often lighting
operating schedules can also be programmed into building automation
systems to control the operating hours of lighting.
Occupancy sensing. Occupancy sensors can also be used to switch on
lighting when a space is occupied and switch off the lighting after a
preset time delay when the space is not occupied. Typical applications for
occupancy sensors are in toilets, car parks, meeting rooms, storage areas,
and common corridors.
The two basic technologies used in occupancy sensing devices are
infrared and ultrasonic. Infrared sensors scan the area around them to
detect heat generated by occupants. They are ideal for small open areas
such as offices and classrooms. Ultrasonic sensors emit high frequency
sound waves to detect occupancy. They are generally used in large or
obstructed areas. Due to the relative advantages and disadvantages of
the two types of technologies, sensors that incorporate both types of
technologies are available with more effective sensing capabilities.
Light sensing. Making adequate use of natural light is another way to
reduce a building’s energy load (Fig. 7.11). Exterior and interior areas
of buildings, which are exposed to natural light, can have light sensors
to switch off or provide dim artificial lighting when sufficient natural
light is available. The daylight controls can be the open-loop type where
Lighting Systems 199
the sensor detects available daylight or the closed-loop type where the
sensor detects available light at a work space.
7.6.6 Lighting energy saving devices
There are many energy saving devices, which help to reduce lighting
energy consumption. The design of these equipment vary from one to
the other but most contain transformers to reduce the voltage to a pre-
determined value after the lamps are switched on. This helps to reduce
the power drawn by the lighting, but result in a drop in lighting level.
These devices normally only work with lighting using magnetic or low-
loss ballasts.
Since reduction in voltage leads to a reduction in the current drawn,
the reduction in power consumption is proportional to the square of the
reduction in voltage. The reduction in the illuminance level is approxi-
mately proportional to the reduction in voltage.
Table 7.9 shows some typical data collected from a trial carried out
using a power saving device set at different voltage reduction levels.
200 Chapter Seven
Figure 7.11 Effective use of natural light. (Courtesy of Philips.)
TABLE 7.9 Results of Trial Carried Out with a Lighting Power
Saving Device
Voltage reduction 17% 21% 29%
Power (kW) reduction 32% 37% 51%
Lighting level (lux) reduction 19% 22% 31%
Various tests have been conducted on such power saving devices,
including under the National Lighting Product Information Program
(NLPIP), which is sponsored by U.S. Environmental Protection Agency
(EPA), and other state organisations. Based on the report, lighting power
saving devices using transformers to reduce voltage are able to reduce
lighting power while lowering light output. The report states that bal-
last life can improve due to lowering of ballast temperature by power
saving devices and that there are no published reports documenting
their effect on lamp life at lower than rated power.
Fluorescent-lamp life can be affected by the lamp’s current crest factor
(CCF) and the electrode starting temperature. Since power saving
devices limit lamp current, they do not increase lamp CCF. As most
power saving devices also provide the normal voltage during starting,
they do not alter the starting temperature. Therefore, power saving
devices are not expected to have a significant impact on lamp life if the
voltage is not reduced significantly.
Since power saving devices normally need to be installed at the light-
ing DBs (distribution boards), they are generally used on lighting cir-
cuits that have many lamps on a single circuit. They are ideal for car
park lighting systems because they tend to have all the lighting on a few
circuits and also because they are able to accept the reduction in light-
ing levels associated with such devices. Care should be taken to ensure
that nonlighting loads are removed from lighting circuits to prevent
possible damage to equipment when operating at lower voltage.
7.6.7 Daylighting
Sunlight falls on the exterior surfaces of most buildings even on cloudy
days. This natural light can be captured through daylighting techniques
to illuminate interior spaces of buildings and help reduce the energy con-
sumption of artificial lighting.
Hundreds of years ago when artificial light sources were not available,
daylight was the only efficient light source available and one of the
main goals of architecture was to have large openings to bring natural
light into buildings. With the availability of efficient artificial lighting
systems, capturing daylight has become less important in modern build-
ing architecture.
However, as artificial lighting accounts for a significant portion of
electrical energy consumed in buildings, daylighting techniques can be
incorporated into building architecture to make buildings more energy
efficient.
Daylighting strategies incorporated into building designs depend on
factors such as the availability of natural light (building latitude), cli-
mate, presence of obstructions, and building shape.
Lighting Systems 201
For example, high latitude areas have distinctive summer and winter
climates with appreciable variation in seasonal daylight levels com-
pared to lower latitudes where daylight levels do not have much seasonal
variation. Therefore, in high latitudes when winter daylight level is
low, the building design objective is to maximise daylight penetration
as opposed to restricting daylight penetration into buildings at low
latitudes.
In most situations, other structures in the surrounding area obstruct
natural light. Sometimes, building features can also act as obstructions
and the design needs to take into account such obstructions to maximise
the use of daylight.
The shape of buildings also affect daylighting strategies. For instance,
the daylighting needs of a particular building may be satisfied with
conventional windows whereas another may require more complex
design features.
Some common daylighting features used in buildings to maximise
the use of natural light are windows, skylights, light shelves, and light
tubes.
Windows. Windows are the most commonly used daylighting feature
in buildings. They are able to bring daylight into the perimeter areas
of buildings. The amount of daylight transmitted depends on factors
such as the window size, orientation, and material properties. To pre-
vent direct solar radiation from being transmitted into buildings, selec-
tive window coatings, blinds, or other shading devices can be used.
Skylights. Skylights are transparent areas of a roof, provided to allow
daylight to enter a space. They can range from small windows on the
roof to the entire roof of atrium areas. Skylights can be constructed
using glass or special materials that can help diffuse the light entering
a space while preventing transmission of direct sunlight, as shown in
Fig. 7.12.
202 Chapter Seven
Skylight on
the roof
Direct sunlight
into space
Skylight on
the roof
Diffuse
light into
space
Figure 7.12 Skylights with normal and special materials.
Light shelves. Alight shelf (Fig. 7.13) is a passive architectural feature
that consists of a horizontal reflecting surface that permits daylight to
enter into a building. Light shelves help to prevent direct sunlight from
entering a space by reflecting sunlight onto the ceiling, thereby mini-
mizing glare and increasing the lighting level in the space. They work
best at high solar angles but can be extended inwards at low angles to
capture the direct rays.
Light tubes. Light tubes and light pipes have internal light reflecting
surfaces that help to transmit natural light into the interior spaces of
buildings to minimise the use of artificial lighting. Figure 7.14 shows
the arrangement of a typical light tube.
7.7 Summary
Typically, lighting accounts for more than 20 percent of the electrical
energy consumption in commercial buildings. In air-conditioned build-
ings they also indirectly account for some of the power consumed by
Lighting Systems 203
Reflected light
Direct sunlight
Light shelf
Window
Roof
Light tube
Diffuse light
Direct solar radiation
Figure 7.13 Arrangement of a typical light shelf.
Figure 7.14 Arrangement of a light
tube.
air-conditioning systems as the heat added by lighting has to be
removed by building cooling systems. Therefore, lighting systems need
to be designed to be efficient to ensure the overall energy efficiency of
buildings.
The chapter provided a description of the types of lighting used in
buildings with definitions of some important terms. Thereafter, various
energy saving measures relating to building lighting systems, such as
optimizing lighting levels, improving lighting system efficiency, lighting
controls, and daylighting were described.
Review Examples
7.1. In an office space, lighting is provided by 150 nos. of T8 lamps on a single
lighting circuit. Each luminaire has three lamps and uses a magnetic bal-
last. The lighting level measured at the working space is on an average
700 lux.
Describe three possible energy saving measures for this application.
7.2. Describe three lighting control strategies that can be used to minimize
lighting energy consumption in buildings. For each strategy, list two pos-
sible applications.
7.3. Calculate the simple payback period for replacing 1000 nos. of 60-W
incandescent lamps with 11-W compact fluorescent lamps, based on the
following:
Unit cost of 11-W compact fluorescent lamp ϭ $12
Unit cost of 60-W incandescent lamps ϭ $1
Compact fluorescent-lamp life ϭ 8000 hours
Incandescent-lamp life ϭ 1000 hours
Operating hours ϭ 12 h/day ϫ 5 days a week
Electricity tariff ϭ $0.10/kWh
7.4. Calculate the simple payback period for replacing 100 nos. of 1200-mm
(4 feet) long T8 lamps with T5 lamps, based on the following:
Unit cost of T5 (lamp ϩ fixture) ϭ $40
Operating hours ϭ 24 h/day ϫ 7 days a week
Electricity tariff ϭ $0.10/kWh
Power consumption of T8 lamp ϭ 40 W (lamp ϩ ballast)
Power consumption of T5 lamp ϭ 28 W (lamp ϩ ballast)
204 Chapter Seven
7.5. A particular luminaire has two 36-W lamps using a single magnetic bal-
last. Calculate the simple payback period for replacing the magnetic bal-
last with an electronic ballast, based on the following:
Unit cost of electronic ballast ϭ $20 (supply and installation)
Operating hours ϭ 24 h/day ϫ 7 days a week
Electricity tariff ϭ $0.10/kWh
Power consumption per luminaire with magnetic ballast ϭ 84 W
Power consumption per luminaire with electronic ballast ϭ 64 W
Lighting Systems 205
Chapter
8
Building Electrical Systems
8.1 Introduction
Building electrical systems comprise of transformers, distribution sys-
tems, switchgear, control panels, and motors. Most of the electrical energy
consumed in buildings is accounted for by motors, which are used for oper-
ating equipment such as the air-conditioning plant, pumps, elevators, and
fans. Office equipment such as computers, printers, copiers, and lighting
account for most of the balance electrical energy used in buildings.
Utility companies, which supply electricity, charge for electrical energy
consumed in kWh. The tariff paid for each unit of kWh used can be fixed
rate, tiered (peak, off-peak, shoulder, and so on), or based on the time
of day. Depending on the tariff structure, utility companies also charge
for the maximum power demand (kW) and power factor.
For totally resistive loads, electrical power is the product of voltage
and current used.
Power ϭ voltage ϫ current (8.1)
The basic unit of power is watt (W) and is normally measured in kilo-
watts (kW), which is 1000 watts. Voltage is measured in volts (V) and
current in amperes (A).
Electrical energy is power used over a time and is the product of power
and time.
Electrical energy ϭ power ϫ time (8.2)
Therefore, electrical energy of 1 kWh is 1 kW used over one hour.
In circuits that have inductive elements such as motor windings, trans-
former windings, and fluorescent lamp ballasts, there are two components
207 207
of power. One is the actual power absorbed by the component to do useful
work, called real power (or active power), and the other is the reactive
power used for magnetizing the magnetic elements. The apparent power
is the vector sum of the reactive and active power and is normally com-
puted in kVA(product of volts and amperes divided by 1000).
Power factor is the ratio of active power to the apparent power, as
shown in Fig. 8.1. The power factor ranges from zero to 1.0. The high-
est power factor of 1.0 is achieved if there is no reactive power, as in the
case of totally resistive loads.
Therefore, Power kW ϭ kVA ϫ cos
(8.3)
The power factor for a building depends on the different equipments
and systems used in that building. In the case of motors, the power factor
can also vary with the load applied on the motor. Utility companies usu-
ally penalize consumers if the overall power factor is below a certain
value.
The different aspects of how electricity charges paid to utility com-
panies can be lowered by reducing electrical energy usage (kWh), max-
imum power demand (kW), and improvement of power factor are
described in the following sections of this chapter.
8.2 Efficiency of Motors
Efficiency is the measure of how well an electrical device converts the
power consumed into useful work. Some devices like electric heaters can
convert 100 percent of the power consumed into heat. However, in other
devices such as motors, the total energy consumed cannot be converted
to usable energy as a certain portion is lost and is not recoverable
because it is expended in the losses associated with operating the device
(Fig. 8.2). Therefore, it is necessary to provide more than 1 kW to pro-
duce 1 kW of mechanical output.
(8.4) Motor efficiency is 5
power
OUT
power
IN
Power factor 5 cos 5
active power skWd
apparent power skVAd
208 Chapter Eight
Reactive power
(kVAr)
Active power (kW)
Apparent power (kVA)
θ
Figure 8.1 Vector diagram for
power.
As shown in Fig. 8.3, the largest single loss in a motor is the stator
resistance loss (Stator I
2
R) followed by the rotor resistance loss (Rotor
I
2
R). These are followed by the core losses (hysteresis and eddy cur-
rent) resulting from the cycling magnetic forces within the motor. Other
motor losses are friction loss from bearings, windage loss due to drag
during rotation and motor cooling, and stray losses.
The efficiency of motors depends on size, and normally ranges from
about 78 to 93 percent for standard efficiency motors. In addition to these
standard motors, some motor manufacturers also produce premium effi-
ciency motors, which operate at efficiencies about 3 to 7 percent higher
than the standard designs.
In these energy efficient motors, losses are reduced by:
■
Use of wire with lower resistance
■
Improved design of the rotor electric circuit
■
Higher permeability in the magnetic circuits of the stator and rotor
■
Use of thinner steel laminations in the magnetic circuits
■
Improved shape of the steel stator core and rotor magnetic circuits
■
Smaller gap between stator and rotor
■
Internal fan, cooling fins, and cooling air passages designed to reduce
the cooling power requirement
■
Use of bearings with lower friction
Building Electrical Systems 209
Figure 8.3 Losses in a typical motor.
Copper (I
2
R)
loss 58%
Core (Iron)
loss 12%
Friction and
windage loss
14%
Stator loss
Rotor loss
Eddy current loss
Hysteresis loss
External fan windage
Internal fan windage
Bearing, grease, loading spring
Stray losses
15%
Surface loss due to current
Harmonics
Leakage flux
Power
IN
Power
OUT
Motor
Figure 8.2 Definition of motor
efficiency.
Figure 8.4 shows the comparison of full-load operating efficiency for
typical standard and premium efficiency motors. For motors over 7.5 kW
(10 Hp), the improvement in efficiency possible from premium efficiency
motors is 3 to 5 percent. Since the improvement achievable in efficiency
is only a few percent, it is normally not economically viable to replace
an existing motor with a premium efficiency motor merely based on
savings. However, in case of new installations or motor replacements,
premium efficiency motors should be considered in place of standard
ones as the savings can normally pay for the incremental cost of the
higher efficiency motors.
The following example illustrates how savings can be estimated for a
case where a standard efficiency motor is to be replaced with a pre-
mium efficiency motor.
Example 8.1 Consider an 18.7 kW (25 Hp) motor functioning at 88 percent effi-
ciency (standard efficiency), operating 24 hours a day 365 days a year. Calculate
the savings that will result if it is replaced with a (premium efficiency) motor func-
tioning at 93 percent efficiency.
Therefore, Energy saved in kWh ϭ motor kW
3 operating hours 3 c
1
S
2
1
P
d
Using Eq. s8.4d for the motor, Power
IN
5
power
OUT
210 Chapter Eight
75
80
85
90
95
100
Motor horsepower
1 5 10 50 100 200
Standard efficiency
Premium efficiency
%
F
u
l
l
l
o
a
d
e
f
f
i
c
i
e
n
c
y
Figure 8.4 Efficiency of standard and premium efficiency motors.
where
S
ϭ efficiency of standard motor and
P
ϭ efficiency of premium
motor
ϭ 10,008 kWh/year
In addition to the full load efficiency of motors, the operating efficiency
of motors also depends on their loading. Figure 8.5 shows a typical
motor characteristic curve, which relates the motor efficiency to its load-
ing. As the figure shows, motor efficiency is close to its full load efficiency
when loaded above 40 percent, but drops significantly if the motor is
loaded lower than this value. Therefore, if a motor is loaded to less than
about 40 percent, it would be a good candidate for replacement with a
correctly-sized motor. However, care should be taken to ensure that the
replacement motor can meet the starting torque required for the par-
ticular application, as in some instances motors are oversized to over-
come a high starting torque.
Example 8.2 The rated efficiency of a standard 55 kW motor used for a water
pump is 90 percent. When the pump is operating at its full load condition the power
drawn by the motor is measured to be only 9 kW. Using Fig. 8.5, estimate the
actual motor operating efficiency. If the pump operates 24 hours a day, estimate
Annual electrical saving 518.73 24 3365 c
1
0.88
2
1
0.93
d kWh/year
Building Electrical Systems 211
0
10
20
30
40
50
60
70
80
90
100
0 20 40 60 80 100
% Output horsepower
Standard efficiency
Premium efficiency
%
E
f
f
i
c
i
e
n
c
y
Figure 8.5 Motor efficiency versus loading.
the amount of electrical energy that can be saved if the pump motor is replaced
with a smaller capacity motor.
The estimated loading of the motor is 9/55 ϭ 16 percent
From Fig. 8.5, the motor operating efficiency is expected to be about 5 percent.
Based on this motor efficiency, motor output power ϭ 0.55 ϫ 9 ϭ 5 kW
If a 5.5 kW motor is used for this application, the expected motor efficiency (from
Fig. 8.4) is about 85 percent.
The input power for the new motor ϭ 5.5/0.85 ϭ 6.5 kW
Therefore, electrical energy saved ϭ (9 – 6.5) ϫ 24 ϭ 60 kWh/day.
8.3 Variable Speed Drives
Many building systems are designed to operate at maximum load con-
ditions. However, most building systems operate at their full load only
for short periods of time. This often results in many systems operating
inefficiently during long periods of time. Most such inefficient operations
in buildings are encountered in air-conditioning systems that are nor-
mally sized to meet peak load conditions, which are experienced only for
short periods of the day.
Some examples of such operations are:
■
Chilled water and hot water distribution pumps
■
Cooling tower fans
■
Air handling unit fans
■
Ventilation fans
As explained in earlier chapters, the efficiency of such systems can be
improved by varying their capacity to match actual load requirements.
As all the above are variable torque applications, the power required (to
drive the pumps or fans) varies to the cube of the speed and, therefore,
large power reductions result from small reductions in speed. The most
common method is to modulate the speed of the motors of pumps and
fans to vary their capacity using variable speed drives (VSDs).
The most commonly used motor in buildings today is the three-phase,
asynchronous AC (alternating current) motor, which is both inexpensive
and of very reliable construction. Ordinary asynchronous AC motors are
designed to make the operating speed dependent on the frequency and
the voltage connected to the motor. For example, when the mains supply
is 400 V and 50 Hz, a four-poled asynchronous AC motor operates at an
approximate speed of 1500 rpm.
AVSD [sometimes called a variable frequency drive (VFD)] is an elec-
tronic unit that provides infinitely variable control over the speed of
212 Chapter Eight
three-phase AC motors by converting fixed mains voltage and frequency
into variable quantities. It has no moving parts and uses a rectifier that
is connected to the mains supply to generate a pulsating DC voltage and
direct current, which is then passed to an inverter to generate the fre-
quency of the motor voltage.
The configuration of a typical VSD is shown in Fig. 8.6. The main com-
ponents of a VSD are the rectifier, inverter, intermediate circuit, and con-
trol circuit. The main functions of each component are listed here.
Rectifier. Converts the AC to DC (direct current).
Intermediate circuit. Stabilizes or smoothens the pulsating DC voltage
and reduces the feedback of harmonics to the mains supply.
Inverter. Converts DC voltage back into variable AC voltage with a
variable frequency.
Control circuit. Controls the VSD, enables exchange of data between
VSD and peripherals, gathers and reports fault messages and carries
out protective functions of the VSD.
8.4 Power Optimizing Devices
Various power optimizing devices, which are essentially “black boxes,”
are available in the market. They generally contain electronic circuits
that monitor parameters such as motor load and power factor and con-
tinuously adjust the power supply to the motor to minimize consumption.
Tests carried out on some devices have shown that they are able to
save on motor power consumption on variable torque applications, such
as fans, pumps, and escalators. Comparison of VSDs with such devices
indicate that the former is able to provide much higher savings for
applications, such as pumps and fans, where the speed can be varied to
match load conditions.
Building Electrical Systems 213
AC
power
Rectifier Intermediate circuit Inverter
Motor
Control circuit
Figure 8.6 Configuration of a typical VSD.
Tests with constant air volume (CAV) AHUs, where fan speed cannot
be modulated, showed that power optimizing devices are able to achieve
energy savings. The actual savings achieved depended on the motor
loading. For motors loaded to only 60 to 70 percent of the rated capac-
ity, energy savings of over 20 pecent was achieved.
For escalators, tests showed that power savings of about 10 percent
is achievable. Since for escalators the actual motor power consumption
is low (average 3 kW to 4 kW), the value of savings achieved may not
financially justify the installation of such devices.
8.5 Transformer Losses
Transformers are equipment used to change the voltage of alternating
current supplies. Normally, buildings are supplied electricity from the
grid at high voltages such as 66 kV and 33 kV. The supply voltage,
therefore, has to be reduced so that equipment in the building can make
use of the electricity supplied.
Transformers consist of a primary winding and a secondary winding
(Fig. 8.7). The primary winding is connected to the power source while
the secondary winding is connected to the load. Electrical energy is
transferred by induction and the ratio of primary voltage to secondary
voltage is proportional to the number of turns of primary winding to the
number of turns of secondary winding. Therefore, transformers can be
step-down or step-up depending on whether the secondary voltage is
lower or higher than the primary voltage.
There are two basic types of transformers, namely, dry type and liquid
filled. In dry type transformers cooling is achieved through the free
movement of air, while liquid filled transformers use a liquid to act as
coolant and as an insulation dielectric.
Transformers are generally efficient and have low energy losses. The
losses are normally about 1 to 2 percent of transformer capacity and
depend on transformer type and size. Transformer losses are mainly due
to copper losses, eddy current losses, and hysteresis losses.
These transformer losses can also be categorized into core losses
(no-load losses) and coil losses (load losses), as shown in Fig. 8.8. The
core losses originate in the steel core of the transformer, caused by the
214 Chapter Eight
Primary
winding
Secondary
winding
Iron core
Figure 8.7 Simplified arrange-
ment of a transformer.
magnetizing current needed to energize the core. They are constant, irre-
spective of the load on the transformer. They continue to waste energy
as long as the transformer is energized. Coil losses originate in the pri-
mary and secondary coils of transformers due to the resistance of wind-
ing materials.
Coil losses are due to power dissipated in the form of heat caused by
the resistance of the conductor. The amount of power dissipated is
directly proportional to the resistance of the conductor and the square
of current flowing through it (I
2
R).
No-load losses due to the magnetizing current, used to energize the
core of the transformer, can generally be categorized into hysteresis
losses, eddy current losses, I
2
R losses due to no-load current, stray eddy
current losses, and dielectric losses. Hysteresis losses and eddy current
losses contribute the most and account for about 99 percent of the no-
load losses, while stray eddy current losses, dielectric losses, and I
2
R
losses due to no-load current account for the rest.
Hysteresis losses come from the molecules in the core laminations
resisting being magnetized and demagnetized by the alternating mag-
netic field. This resistance by the molecules causes friction, which results
in heat. The Greek word, hysteresis, means “to lag” and refers to the fact
that the magnetic flux lags behind the magnetic force. Choice of size and
type of core material reduces hysteresis losses.
Eddy current losses occur in the core of the transformer due to the fluc-
tuating magnetic field and induced voltage, which cause random currents
to flow through the core dissipating power in the form of heat. Hysteresis
losses are losses associated with magnetic domains of the core material.
Transformers are often sized based on expected demand, which far
exceed actual load. Since the no-load loss is a function of the kVAcapac-
ity of the transformer and continue as long as the transformer is ener-
gized, transformers should be selected to better match actual load
requirements. In situations where transformer capacity exceeds demand
Building Electrical Systems 215
Transformer
losses
Coil losses Core losses
Copper losses
Eddy current losses
Hysterisis losses
Dielectric losses
Figure 8.8 Transformer losses.
but the transformers have already been selected and installed, it may
be possible to de-energize some transformers to minimize no-load losses.
The no-load losses for transformers over 500 kVA is estimated to be
about 0.3 percent of the rated capacity.
Example 8.3 A building uses one 750 kVA and three 1000 kVA capacity trans-
formers. If the maximum total building load is measured to be 2500 kVA, estimate
the electrical energy savings that can be achieved if the 750 kVA transformer is
de-energized. Assume, the average power factor to be 0.9.
If the no-load losses are taken to be 0.3 percent, the savings by de-energizing
the 750 kVA transformer
ϭ no-load kVA losses ϫ power factor ϫ operating hours
ϭ (750 ϫ 0.3%) ϫ 0.9 ϫ 24 ϫ 365 ϭ 17,739 kWh/year
8.6 Elevators
Elevators can account for a significant portion of the electrical energy
consumption in high-rise commercial buildings. In air-conditioned build-
ings, elevators typically account for more than 5 percent of the total con-
sumption. The two main types of elevators are hydraulic type, which
have hydraulic systems to provide movement, and traction type eleva-
tors, which use wire ropes pulled over sheaves driven by a motor.
Traction elevators have counterweights linked to the elevator cab by a
pulley system so that the counterweight lowers when the elevator cab
rises and vice versa. This helps to reduce the weight to be lifted.
In elevators, energy is primarily consumed by the elevator motor,
brake system, lights, and ventilation fans. The elevator motor generally
consumes the most amount of power. However, under certain operating
conditions the elevator motors can operate in regenerative mode, such
as when the weight of the elevator cab and passengers is less than the
weight of the counterweight when traveling up.
The electrical energy consumption of elevators depend on factors such
as the type of motor drive used, the number of starts (door openings), car-
rying capacity, building height, and building occupancy. Data available
from studies of elevators used in mid- and high-rise buildings indicate
that average consumption of elevators range from about 5 to 40 kWh/day.
Some energy saving measures for elevator systems are listed below.
Type of elevator. Hydraulic elevators are sometimes used in low-rise
buildings due to lower cost. However, they are less efficient than traction
elevators and consume about three times the amount of energy con-
sumed by traction elevators for the same application. Therefore, for new
installations in low-rise buildings and when replacing hydraulic eleva-
tors, traction elevators should be considered instead of hydraulic ones.
216 Chapter Eight
Type of drive. Old inefficient traction elevators use motor-generators as
DC power sources compared to the later more efficient units that use
solid state variable voltage (VV) and variable frequency (VF) drives
with permanent magnet motors instead of induction units. The most
modern systems, which convert line power to variable voltage, variable
frequency (VVVF) to suit load and speed, are more energy efficient and
should be considered for new installations and retrofits.
Regeneration. Traction elevators have counterweights that weigh about
the equivalent of the weight of the elevator cab and half of its maximum
load to help reduce the weight to be lifted by the elevator motor. Therefore,
an empty elevator needs energy to descend (to overcome the counter-
weight) while a full elevator needs energy to ascend.
Similarly, an empty elevator ascending or a full elevator descending
has potential energy that needs to be dissipated. In older elevators, this
potential energy is dissipated in the form of heat in resistor banks.
However, newer elevators are able to feed this regenerative power back
into the building electricity distribution system, which helps to reduce
the amount of electricity drawn from the mains supply. The amount of
energy savings that can be achieved with regenerative systems depends
on many factors but, typically, they are able to save as much as 30 per-
cent compared to a geared traction system.
Controls. Modern elevator control systems can range from simple
programs to schedule the turning on or off of all or some elevators
during low usage periods to sophisticated systems that can “learn” from
operations to position at specific locations based on usage patterns and
the time of day. This helps to reduce waiting time for users and the dis-
tance traveled by elevators (to reduce energy consumption). Some
sophisticated systems are even able to use control algorithms to optimize
energy usage by considering the potential energy available from the
counterweights of the different cabs based on their location. The savings
achievable by using advanced control systems is estimated to be about
5 percent.
Lights and ventilation fans. One of the most basic energy saving meas-
ures is to program the control system to switch off lights and ventila-
tion fans of elevators when they are not in use.
Another energy saving strategy is to use more efficient lighting systems
for elevator cabs. Typically, elevator cabs use halogen and incandescent
lamps, which result in a lighting power density of about 50 W/m
2
(compared to about 10 W/m
2
for typical office areas). As an alternative,
compact fluorescent lamps can be used for this application and the
power density can be lowered to between 10 and 15 W/m
2
.
Building Electrical Systems 217
Reducing capacity. In some buildings, due to reasons such as change in
occupancy, the capacity of lifts can be much higher than necessary. For
example, if a building initially designed for industrial use with eleva-
tors of capacity 10 tons each is converted for normal office use, the
capacity of the elevators need to be only about 1 ton each. In such a sit-
uation, the elevators can result in much energy wastage due to the need
for moving a cab that is much larger (heavier) than required and the
need to overcome the extra weight of the counterweight designed for the
original 10 ton capacity.
Energy savings can be achieved in such cases by replacing the eleva-
tor with a smaller capacity one or by reducing the counterweight (and
capacity of the elevator).
8.7 Maximum Demand Reduction
Maximum demand for a building is the maximum power drawn from the
grid in kW. The electrical demand is usually calculated by averaging the
integrated power demand over a fixed interval (normally 30 minutes)
using a maximum demand meter (Fig. 8.9). This computation is per-
formed continuously for the same fixed time interval. If the maximum
demand during a particular time period is lower than the previous
value, the meter retains the previous reading. However, if the new read-
ing is higher than the previously recorded highest maximum demand,
then the new value is retained. The maximum value remaining at the
end of a month is taken as the maximum demand for the building for
that month.
Utility companies charge consumers for the maximum demand as
their power generating equipment, distribution cabling, and switchgear
need to be sized to satisfy the maximum demand requirements of the
end users. For example, if a consumer has high power demand for a short
218 Chapter Eight
Power demand curve
Demand
interval= 30 min
Average power demand
Maximum demand =
Maximum value of 1/2
hourly average power
demand during a month
Figure 8.9 Maximum power demand.
period of time during the day compared to the demand during other peri-
ods of time, the utility company would still need to invest in additional
infrastructure to meet this demand even though it is only required for
a short period of time. Therefore, to compensate for this and to encour-
age consumers to reduce power demand, utility companies charge based
on maximum demand.
Maximum demand charges paid depend on the actual tariff struc-
ture and can represent a significant portion of the utility bill. Therefore,
considerable savings can be achieved by reducing the maximum power
demand.
8.7.1 Load factor
The load factor is the ratio of average load to peak load during a spe-
cific period of time, expressed as a percentage.
(8.5)
The load factor indicates to what degree energy has been consumed
compared to the maximum demand or the utilization of units relative
to total system consumption. The highest achievable load factor is 100
percent. Normally, the load factor for most buildings range from about
50 to 70 percent. Typical office buildings and retail malls, which oper-
ate about 10 to 12 hours a day, have a load factor of 50 percent, while
hotels and industrial establishments, which operate 24 hours a day,
normally have load factors over 70 percent.
Although the load factor depends on the operating characteristics of
systems and the operational requirements, if the actual load factor is
much lower than these approximate values, it is generally a good indi-
cator of potential for reducing maximum demand.
The maximum demand for buildings can be reduced in different
ways depending on the load characteristics of the building. They can
be normally categorized into three demand management strategies—
peak shaving, load shifting, and energy management—as illustrated
in Fig. 8.10.
8.7.2 Peak shaving
Peak shaving (sometimes called peak clipping) involves reducing the
maximum demand of a building. This strategy involves switching off
5
kWh for month
maximum demand for month 3 24 3 no.of days in month
Load factor 5
average power demand skWd
maximum power demand skWd
Building Electrical Systems 219
equipment and systems that are considered to be nonessential during
the period that a building experiences maximum power demand. The
loads switched off are those such as ventilation fans, CAV AHU fans, and
lighting which does not cause an increase in demand once they are
switched on. Peak shedding can be achieved by the building’s energy
management system (EMS) by programming it to switch off equipment
progressively, based on preset priority, as the building approaches its
maximum demand. In addition to the priority set on the EMS for each
of the equipment that can be switched off, other criteria such as the max-
imum duration (for switching off) and the maximum number of times
they can be switched off can also be programmed on the EMS to avoid
discomfort to occupants and to minimize wear and tear on equipment.
8.7.3 Load shifting
This load management strategy is similar to peak shaving as it involves
switching off loads during peak period. However, the main difference in
load shifting is that when it switches off equipment during peak peri-
ods, it is shifting this load to either before or after the peak demand
period. Some examples can be switching off fans of VAV AHUs or turn-
ing off a chiller during the peak demand period, which then have to
“work harder” when they are switched on later to meet the building’s
cooling requirements.
Another possible load shifting strategy is to use a thermal storage
system for cooling, which can store either chilled water or ice produced
during nonpeak periods and using it to cool the building during periods
of peak demand. This enables either switching off all chillers or some
chillers during peak periods to reduce maximum demand.
Other opportunities for load shifting also exist in situations where
intermittent loads are encountered. An example of how maximum
demand can be reduced by controlling the operation of loads that nor-
mally operate intermittently is illustrated in Fig. 8.11.
Example 8.4 An office building experiences a maximum power demand of 1200 kW
in the mornings between 8.00 and 8.30 a.m. due to the switching on of the cen-
tral air-conditioning system at 8.00 a.m. Thereafter, the power demand for the
220 Chapter Eight
Peak shaving Load shifting
Energy management
Figure 8.10 Demand management strategies.
entire day remains less than 900 kW. The total average electrical energy con-
sumption for the building is 9000 kWh a day.
A trial carried out by the building management personnel shows that the
building’s maximum power demand can be maintained below 900 kW through-
out the day if the central air-conditioning system is switched on earlier, at 7.30
a.m., with one less chiller operated over a longer period to cool the building.
However, the total electrical consumption for the building increases to 9300 kWh
a day.
Estimate the annual cost savings that can be achieved by switching on the air-
conditioning system at 7.30 a.m. if the building operates 250 days of the year. Take
the electricity tariff to be $0.10/kWh and the demand charge to be $1/kW (per
month).
Saving in demand charges ϭ (1200 – 900) ϫ $10 ϭ $3000/month ϭ $36,000/year
Extra cost for consumption ϭ (9300 Ϫ 9000) ϫ $0.10 ϭ $30/day
ϭ $30 ϫ 250 ϭ $7500/year
Net cost savings ϭ (36,000 Ϫ 7500) ϭ $28,500/year
8.74 Energy management
Energy management involves energy conservation and improving
energy efficiency of a facility to reduce the power demand and energy
consumption. As Fig. 8.6 shows this strategy helps not only to reduce
the maximum demand but also to reduce the power demand at all times.
As described in the earlier chapters, this is achieved by implementing
various energy management and energy efficiency strategies.
Building Electrical Systems 221
Intermittent Load 2 Intermittent Load 1
Time
Combined load with no
demand management
Time
Combined load with
demand management
Load
(kw)
Load
(kw)
Load
(kw)
Load
(kw)
Time Time
Figure 8.11 Illustration of demand reduction for intermittent
loads.
8.8 Power Factor Correction
As explained earlier, power factor is the ratio of active power to the appar-
ent power. The power factor ranges from zero to 1.0. The highest power
factor of 1.0 is achieved if there is no reactive power, as in the case of
totally resistive loads.
Electrical loads in commercial buildings and industrial facilities are
not totally resistive and the reactive power component can be significant.
Although only real power is consumed, the utility company has to make
available the consumer the total power requirement made-up of both the
real power and reactive power. Since reactive power constitutes an extra
load on the power transmission and distribution system, utility com-
panies penalize consumers if their power factor is low.
For utility companies this leads to extra load on the power transmis-
sion and distribution systems, leading to the need for higher capacity
power plants, transmission cables, and switchgear. For consumers, low
power factor results in overloading of equipment and higher energy
losses due to higher current flow. Therefore, power factor should be as
close as possible to unity and, generally, values above 0.9 are considered
to be good.
Power factor can be improved by installing capacitors in parallel to
reduce the reactive power. The power factor correction can be static cor-
rection, where capacitors are connected at each starter (Fig. 8.12) or bulk
correction, where capacitors are connected at the distribution boards
(Fig. 8.13). The effect of adding capacitors to reduce the power factor is
illustrated in Fig. 8.14.
(8.6)
and
2
<
1
,
cos
2
> cos
1
(power factor is higher).
Since, Power factor 5
active power skWd
apparent power skVAd
5 cos
222 Chapter Eight
Capacitors
Motor Supply
Figure 8.12 Static power factor
correction.
Example 8.5 Consider a circuit that has active power of 1.5 kW, line current of
10 A, and line voltage of 240 V. Calculate the kVAr rating of a suitable capacitor
that should be added to increase the power factor to 0.9.
Before (refer to Fig. 8.15):
Apparent power ϭ 240 ϫ 10 VA ϭ 2.4 kVA
Power factor, cos
1
ϭ 1.5/2.4 ϭ 0.625
1
ϭ 51.3Њ
Reactive power ϭ tan(51.3Њ) ϫ 1.5 ϭ 1.87 kVAr
After (refer to Fig. 8.15):
From Eq. (8.6), if power factor is to be 0.9,
Apparent power ϭ 1.5 kW/0.9 ϭ 1.67 kVA
2
ϭ cos
Ϫ1
(0.9) ϭ 25.8Њ
Reactive power ϭ tan (25.8Њ) ϫ 1.5 ϭ 0.725 kVAr
Therefore, size of capacitor required ϭ 1.87 – 0.725 ϭ 1.15 kVAr (capacitive)
Since the line voltage is the same, the new current of 7 A(1.67/0.24) represents
a reduction of 30 percent (from 10 A).
8.9 Equipment Standby Losses
Over the last 10 years, power consumed in commercial buildings has
been rising due to the increased use of office appliances such as comput-
ers, printers, and copying machines. Today’s commercial offices provide
Building Electrical Systems 223
Figure 8.13 Bulk power factor correction.
Transformer
Capacitor
bank
Capacitor
bank
Supply
θ
2
Reactive
power
(kVAr)
Active power
(kW)
Apparent
power
θ
1
Reactive
power
(kVAr)
Active power
(kW)
Apparent
power
θ
2
< θ
1
Figure 8.14 Effect of installing capacitors to improve power factor.
a PC or workstation for almost all staff, many with 17'' or 21'' monitors.
Further, due to increased cost of office space, offices are being com-
pressed, leading to higher density of staff per unit floor area and higher
power consumption in office buildings.
Most office equipment are actually used only for a few hours a day,
leaving them switched on in standby mode for rest of the day while
staff take breaks, eat lunch, attend meetings, and leave the office for
other appointments. Further, printers, copy machines, and even com-
puters are often left switched on after office hours.
Research has shown that such equipment can end up consuming up
to 50 percent of normal power consumption even when in standby or idle
mode if they are not switched off. In 1994, the Environmental Protection
Agency (EPA) started the Energy Star program for computers to address
the problem of wasted energy from computers and laser printers when
they are left on and not being used. The program required that computer
monitors have the ability to power down to power levels of 30 W or less.
Laser printers were required to power down when idle to power levels
of 30 to 60 W, depending on printing speed. Asimilar program was later
also introduced for copying machines and fax machines.
Staff should therefore be encouraged to select and purchase office
equipment complete with power management or energy saving fea-
tures, that power down unnecessary components within the equip-
ment, while maintaining essential functions or memory when the
equipment is idle or after a user-specified period of inactivity. It should
also be ensured that these energy saving features are not disabled by users
(commonly encountered) as otherwise it would defeat the purpose of
having them.
Steps should also be taken, where practically possible, to ensure that
office equipment are switched off after office hours so that power con-
sumption can be completely eliminated during such periods.
8.10 Summary
Motors used for operating equipment such as air-conditioning chillers,
pumps, elevators and fans account for most of the electrical energy con-
sumed in buildings, while computers, office equipment, and lighting
224 Chapter Eight
θ
1
Reactive
power
1.87 kVAr
Active power 1.5 kW
Apparent power
2.4 kVA
Reactive
power
0.725 kVAr
Active power 1.5 kW
Apparent power
1.67 kVA
θ
2
Figure 8.15 Vector diagram for Example 8.5.
account for the rest. Utility companies normally charge for electricity
use based on energy consumption, power demand, and power factor.
Various strategies to reduce these electricity charges were described in
this chapter.
Review Questions
8.1. Compute the annual energy savings (in kWh) achievable for a 55 kW
capacity motor if a 95 percent efficiency motor is used instead of an 91 per-
cent efficiency motor. Take the operating hours to be 24 hours a day and
250 days a year.
8.2. Two 1500-kVA transformers are to be used in a building that normally
operates 12 hours a day and 250 days a year. Calculate the kWh savings
that can be achieved if 99.5 percent efficiency transformers are used instead
of 98.5 percent efficiency transformers for this application. Assume the
power factor to be 0.9 and the no-load losses to be the same for both types
of transformers.
8.3. List five possible applications of variable speed drives (VSDs) in buildings
to reduce electrical energy consumption.
8.4. List five possible energy saving retrofit strategies used for old elevators.
8.5. A building has an active power demand of 1500 kW and a power factor of
0.75. Calculate the kVAr rating of bulk correction capacitors required to
be installed if the power factor is to be improved to 0.9.
Building Electrical Systems 225
Chapter
9
Building Automation Systems
9.1 Introduction
Building automation systems (BAS) are computer based systems used
for monitoring, controlling, and managing equipment and systems in
buildings. Building systems normally managed by a BAS include air-
conditioning, ventilation, lighting, heating, fire protection, electrical, and
security systems.
Due to advances in information technology, a BAS can be integrated
with other building services such as office automation systems, facility
booking systems, and utility metering and billing systems. Therefore,
in addition to monitoring and controlling, a BAS can assist in facility
management.
The main components of a BAS include, sensors, actuators, controllers,
data communication network, host computer, and software. Typical con-
figuration of a BAS is shown in Fig. 9.1.
Building automation systems are a very important energy manage-
ment tool. They can be used to control various energy consuming sys-
tems in buildings and perform many other functions required to optimize
their operations. The following sections of the chapter provide a brief
description of some of these functions and control strategies and how
they can be used to optimize the operation of building systems.
9.2 Scheduling
Scheduling allows a BAS to take automatic action such as starting or
stopping of equipment. The schedules are normally based on a one year
calendar and can account for different operations on weekdays, Saturdays,
Sundays, holidays, and different seasons.
227 227
This feature can be used to minimize energy consumption by operat-
ing equipment only when needed. For example, starting of chillers or
boilers and AHUs can be staggered in the mornings to match actual
requirements of the occupants in the different areas rather than switch-
ing them on all at the same time. Similarly, the scheduling feature can
be used to start some equipment earlier on certain days, such as on
Mondays, to account for the higher load or to switch off equipment
during low occupancy periods, such as at lunch time.
The scheduling feature is much easier to use than manual timers as
operating schedules can be easily entered, changed, or overridden
remotely through a central workstation. It is also more flexible than
normal timers since it can accommodate many different schedules to suit
varying operating requirements.
9.3 Equipment Interlocks
BAS have interlock features where operation of groups of equipment can
be interlocked so that they can be switched on or switched off together.
This feature is useful to prevent accidental operation of equipment,
which can cause harm or damage if they are not operated simultaneously
with other equipment. For example, chilled water pumps, condenser
water pumps, and cooling towers are usually interlocked with chiller
operations. Similarly, boiler controls can be interlocked with the air
intake and feedwater pumps for safety reasons.
This interlocking feature can also help to save energy by preventing
operation of equipment when their associated equipment are switched
off. A typical example is the interlocking of exhaust and supply fans to
prevent one fan operating without the other, which could lead to infil-
tration or exfiltration of air. Similarly, the operation of kitchen exhaust
fans can be interlocked to operate only when cooking is done.
228 Chapter Nine
Local area network
Printer
Workstation
Communication
unit
Communication
unit
DDC
controller
for chillers
DDC
controller
for AHUs
DDC
controller
for VAV
boxes
DDC
controller
for lighting
DDC
controller
for lifts
Communication
bus
Figure 9.1 Configuration of a typical BAS.
9.4 Demand Limiting
Most BAS have a demand limiting algorithm, which can help to main-
tain the maximum power demand for a building below a set target. This
feature helps to minimize maximum demand charges paid to utility
companies.
Figure 9.2 illustrates a typical demand limiting feature, which pre-
dicts the future power demand based on the actual rate of increase of
building demand and switches off (sheds) loads to ensure that the set
demand limit is not exceeded. Similarly, the feature also normally allows
the switching on (restoring) of loads when the demand drops.
In general, the demand limiting algorithm calculates the amount of
load to be shed or restored and then sheds loads up to the cumulative
load required to be shed. If there is an option to shed more than one load,
the algorithm will shed loads based on set priority, where loads with
lower priority will be shed before shedding loads with higher priority.
If there are multiple loads with the same priority, the load that has
been shed the least amount of time will be shed first. In this feature,
other parameters, such as maximum and minimum off-time for each
load, can be set based on operational requirements.
9.5 Duty Cycling
A duty cycling algorithm normally turns off loads for a short duration
of time based on set priority and maximum off-times. The loads shed are
“expendable” loads, which are loads that result in the reduction of both
instantaneous power demand and energy consumption when shed.
Building Automation Systems 229
Allowable
rate with
demand
limiting
Set demand limit
Demand interval Demand interval
Demand profile
for previous
interval
Actual
demand
during interval
Predicted
demand
Figure 9.2 Illustration of a demand limiting strategy.
These loads cannot be “deferrable” loads as they would only result in
instantaneous demand savings, because when they are restored the
loads will work harder to make up for the time they have been off, result-
ing little or no energy savings.
Some expendable loads are fans of CAV AHUs and constant speed ven-
tilation fans.
9.6 Trend Logging
Trend logging is a feature that allows recording of selected parameters
at preset intervals of time. The feature can be used to log the value of
parameters such as temperatures, flow rates, electrical power, and cool-
ing demand. The recording interval can be set from one minute to about
two hours.
The trend data can be used for various functions, ranging from trou-
ble shooting to identifying energy saving opportunities.
Figures 9.3 to 9.6 show some typical trend data that can be extracted
from a BAS. Figure 9.3 shows the power demand for a building and indi-
cates that the maximum power demand occurs in the morning between
8 a.m. and 10 a.m. Meanwhile, Fig. 9.4, which shows the cooling load of
the building, indicates that the maximum cooling load coincides with the
maximum power demand for the building. This data can be utilized to
reduce the maximum power demand for the building; for instance, by
starting the chiller plant earlier to gradually cool the building.
230 Chapter Nine
0
200
400
600
800
1000
1200
1400
1600
0
:
0
0
Time
Maximum power demand for the building
P
o
w
e
r
d
e
m
a
n
d
(
k
W
)
Figure 9.3 Trend data of building power demand.
Another example of the usefulness of the trend logging feature in BAS
is illustrated in Figs. 9.5 and 9.6. Figure 9.5 shows the trend data for chilled
water supply temperature, which indicates that it exceeds the set value of
7ЊC after 12 noon, while Fig. 9.6 shows that the condenser water supply
Building Automation Systems 231
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
8:00 9:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00
Time
Set value
High chilled water temperature
C
h
i
l
l
e
d
w
a
t
e
r
t
e
m
p
e
r
a
t
u
r
e
(
°
C
)
Figure 9.5 Trend data of chilled water supply temperature.
0
100
200
300
400
500
600
700
800
7
:
0
0
7
:
3
0
8
:
0
0
8
:
3
0
9
:
0
0
9
:
3
0
1
0
:
0
0
1
0
:
3
0
1
1
:
0
0
1
1
:
3
0
1
2
:
0
0
1
2
:
3
0
1
3
:
0
0
1
3
:
3
0
1
4
:
0
0
1
4
:
3
0
1
5
:
0
0
1
5
:
3
0
1
6
:
0
0
1
6
:
3
0
1
7
:
0
0
1
7
:
3
0
1
8
:
0
0
Time
Morning pull-down load
C
o
o
l
i
n
g
l
o
a
d
(
R
T
)
Figure 9.4 Trend data of building cooling load.
temperature exceeds the maximum design value after 11 a.m., indicating
that the high condenser water temperature may be the cause of the chillers
not being able to meet the chilled water temperature set point.
The trend logging feature can also be used for trouble shooting by
trending multiple parameters. For example, if a chiller frequently trips,
trending of related operating parameters, such as condenser water and
chilled water flows and temperatures, may help to identify the cause as
low flow or high condenser water temperature.
9.7 Alarms
This feature is designed to provide an alarm based on preset criteria. The
alarm can be on the workstation to alert the operator or sent to a printer
or other device, such as a pager.
The feature can be set to provide an alarm when a parameter reaches
a certain condition such as a minimum or maximum value. It is very
useful in energy management since it can alert the operator if a system
deviates from a set condition.
The applications of this feature can be numerous, based on individual
system requirements. One common application is to measure the static
pressure difference across AHU filters and provide an alarm if the filters
need to be cleaned or replaced. Similarly, for pumps, water flow rate and
pressure can be monitored to initiate cleaning of pump strainers.
232 Chapter Nine
25
26
27
28
29
30
31
32
33
34
35
8:00 9:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00
Time
High condenser water temperature
Maximum design value
C
o
n
d
e
n
s
e
r
w
a
t
e
r
t
e
m
p
e
r
a
t
u
r
e
(
°
C
)
f
Figure 9.6 Trend data of condenser water supply temperature.
Another application of the alarm feature is to monitor the condenser
approach temperature (difference between refrigerant temperature in
the condenser and condenser water leaving temperature) of chillers and
alert when it is necessary to clean the condenser tubes.
9.8 System Optimization and Control
9.8.1 Chiller controls
The basic control strategy for chillers involve the adjusting of refriger-
ant flow to the compressor in response to changes in cooling load to
maintain the chilled water supply temperature (Fig. 9.7). In addition,
chillers have additional control features to ensure their safe operation,
such as flow sensors, to ensure sufficient chilled water and condenser
water flow rates.
Chiller systems normally consist of chillers, pumps, and cooling
towers, and advanced control systems are able to control and sequence
operation of all equipment to ensure optimum system efficiency. Some
of these sequencing strategies are described here.
Chiller sequencing for systems with only primary pumping. This strategy
uses cooling load, chilled water temperature, and chiller motor loading
to sequence the chillers (Fig. 9.8).
An additional chiller is turned on when the temperature of the chilled
water leaving the chiller T
1
is greater than set point (chiller/s in oper-
ation cannot satisfy load) or if the cooling load is equal to the capacity
of the operating chiller and chiller motors amps is equal or greater than
full load amps (motors fully loaded).
An operating chiller will be switched off if the cooling load is less
than the capacity of operating chillers, less the capacity of one chiller,
and T
1
is not greater than set point.
This strategy for sequencing chillers takes into consideration the
loading of chiller motors, which helps to ensure that chillers are fully
loaded at off-design operating conditions, such as at lower condenser
Building Automation Systems 233
Condenser water
F
Controller
T
Chilled water
Chiller
F
Figure 9.7 Basic control parameters for chillers.
water supply temperature and higher chilled water temperature, when
chillers can provide higher than the rated capacity.
Strategy for chiller sequencing for systems with primary-secondary pumping.
Primary-secondary systems normally need to be sequenced based on the
chilled water flow in the decoupler pipe (Fig 9.9). If the flow is from the
return side to the supply side, it indicates that the chilled water flow in
the secondary loop is higher than that in the primary loop and, therefore,
an additional primary pump (and a chiller) needs to be turned on.
Similarly, if the temperature of chilled water leaving the chillers (T
1
) is
greater than set point, it indicates that the chillers in operation are unable
to meet the cooling load and an additional chiller needs to be operated.
234 Chapter Nine
T
2
T
1
1 2 3 Chillers
Pumps
By-pass
pipe
Cooling
coils
Control
valves Flow meter
Amps Amps Amps
Figure 9.8 Chiller sequencing using cooling load, chilled water temperature, and motor
1 2 3 Chillers
Pumps
Decoupler
pipe
Cooling
coils
Control
valves
T
2
T
4
T
1
T
3
Secondary pumps
Flow
meter 1
Flow
meter 2
Figure 9.9 Chiller sequencing for primary-secondary systems.
If the flow in the decoupler is from supply side to return side and the
flow is greater than 110 percent of the flow of one chiller, one chiller is
switched off as the chilled water flow requirements can still be met by
the remaining chillers.
Strategy for chiller sequencing for variable flow systems. The chillers are
sequenced based on the cooling load computed using the flow meter
(FM) and chilled water return and chilled water supply temperature sen-
sors, T
R
and T
S
, respectively (Fig. 9.10). Motorized valves, interlocked
to the chillers, are used to prevent chilled water circulation through
chillers that are not in operation.
The VSDs of the chilled water pumps are controlled based on the dif-
ferential pressure sensor DP-2 to maintain a set differential pressure
across the furthest AHU coil. The motorized by-pass valve is controlled
using differential pressure sensor DP-1 to maintain a minimum differ-
ential pressure across the chillers to ensure minimum flow. If the chilled
water flow is too low, the differential pressure sensor DP-1 will sense that
the pressure is below set-point and will open the bypass valve, enabling
some water to bypass and circulate through the chillers. Due to this
bypassing of chilled water, the differential pressure sensor DP-2 will
sense a drop in pressure and will signal for the speed of the pumps to be
increased. The system should be designed to ensure that the flow is
maintained within minimum and maximum flow limits for chillers (usu-
ally 0.9–3.4 m/s). This can be achieved by using the flow meter installed
on the primary circuit to fix the set point for the differential pressure
sensor DP-1 and setting a minimum speed for the pumps on the VSDs.
9.8.2 Boiler controls
Control systems are required for boilers to ensure optimum fuel to air
ratio for combustion and feedwater level control. A typically boiler
Building Automation Systems 235
T
R
lsolation
valves
Cooling
coils
Control
valves
T
S
FM
DP-1 DP-2
Supply main
C
h
i
l
l
e
r
#
1
C
h
i
l
l
e
r
#
2
C
h
i
l
l
e
r
#
3
VSD
VSD
Figure 9.10 Variable primary flow systems.
control system is designed to maintain a set steam pressure irrespec-
tive of the steam usage (load), as shown in Fig. 9.11. This is achieved
by varying the fuel flow to the boiler to vary the combustion rate in
response to changes in the load. When the fuel flow rate is adjusted, the
control system will automatically adjust the combustion airflow rate to
ensure that the required air-to-fuel ratio is maintained. In more advance
systems, the air-to-fuel ratio is also continuously adjusted based on the
composition of flue gas to optimize the air-to-fuel ratio.
In boiler systems, the operation of feedwater pumps are also inte-
grated with the boiler controls to maintain the water level in the boiler
within the minimum and maximum levels.
9.8.3 Pump controls
Most pumps used in buildings are normally part of chiller or boiler sys-
tems and their operations are therefore controlled by the respective
chiller or boiler control system. Other independent pumping systems can
be controlled based on parameters such as tank level, temperature, and
pressure or flow rate, as shown in Figs. 9.12 and 9.13.
236 Chapter Nine
Combustion air
Fuel
Boiler
pressure
Boiler
Controller
Feedwater
Level
control
VSD
L
L
Figure 9.11 Typical controls for boilers.
Pump
Level sensor
Level sensor
L
Low level tank
High level tank
Controller
L
Figure 9.12 Typical level control
system for pumps.
9.8.4 AHU controls
In constant air volume (CAV) systems, the AHU control strategy is to
modulate the chilled water flow through the coil in response to changes
in cooling load. This is achieved by monitoring the return or space air
temperature and varying the chilled water flow to maintain the return
air temperature at a fixed value (Fig. 9.14). In such systems, the supply
air temperature is effectively varied to maintain the space tempera-
ture at a fixed value.
In variable air volume (VAV) systems, the AHU control strategy is to
maintain the supply air temperature and modulate the supply airflow
rate in response to changes in cooling load. This is achieved by moni-
toring the static pressure in the supply air ducting and varying the
speed of the fan (or inlet guide vanes in some AHUs) to maintain a fixed
static pressure value (Fig. 9.15). The temperature of supply air is main-
tained constant by modulating the chilled water flow through the coil
using a control valve.
9.8.5 FCU controls
In fan coil units, the space temperature is maintained at a set value by
using a valve (normally the on/off type) to control chilled water flow
Building Automation Systems 237
Pump
P Pressure, temperature or
flow sensor
VSD Controller
Figure 9.13 Typical pump control system.
Temperature
sensor
Outdoor air
Return air
Filter Coils
Controller
Control valve
T
Figure 9.14 Control arrangement of a constant air volume AHU.
through the cooling coil in response to changes in the cooling load
(Fig. 9.16). FCU controls generally also have provision to adjust the fan
speed.
9.8.6 Ventilation fan controls
The control of ventilation fans depends on the actual application.
Generally, where fan capacity control is used, the requirement is to
maintain a parameter such as CO
2
level, CO level, or temperature below
a set maximum level in a space (Fig. 9.17). Sometimes, fan-capacity
control is also used to maintain a set static pressure in a space in rela-
tion to another space or the atmosphere (Fig. 9.18).
9.8.7 Other optimization measures
Optimum start-stop. The optimal start-stop algorithm available on most
BAS can predict how long a building or space will take to cool down
or heat up based on the variables that affect it, such as outdoor air
238 Chapter Nine
Outdoor air
Return air
Filter Coils
Static pressure
sensor
P
Temperature
sensor
T
Controller
VSD
Figure. 9.15 Control arrangement of a variable air volume AHU.
Return air
Outdoor air
Filter Cooling coil
Fan
Space
temperature
T
Controller
Figure 9.16 Control arrangement of a FCU.
temperature, indoor space temperature, and building characteristics.
The algorithm then predicts how long it will take to cool or heat the space
and starts the chiller or boiler system and AHUs at the latest possible
time to achieve the required space conditions before it is occupied.
Temperature reset for chillers. As explained in Chapter 2, chiller effi-
ciency improves with increase in chilled water supply temperature. In
general, it is estimated that improvement of 1 to 2 percent in chiller effi-
ciency can be achieved by increasing the chilled water temperature by
0.6ЊC (1ЊF).
Chiller systems are generally designed for chilled water supply at
6.7ЊC (44ЊF) to meet the design peak cooling load. However, chillers
Building Automation Systems 239
Supply fan Exhaust fan
P
CO2,CO or
temperature
sensor
VSD
VSD
Controller
Figure 9.17 Ventilation control arrangement for maintaining a parameter
in a space.
Supply fan
Differential
pressure
sensor
Exhaust fan
VSD
Space where
pressure needs
to be maintained
Controller
P
Figure 9.18 Ventilation control arrangement for maintaining static pres-
sure in a space.
seldom have to operate under full load conditions. Therefore, most of the
time it would not be necessary to provide chilled water at the design
value and the chilled water temperature can be reset upwards.
One method of resetting the chilled water temperature is by moni-
toring the position of the control valves on the cooling coils using a BAS.
The valve that is open most can be used to reset the temperature and
the chilled water temperature can be reset upwards in steps until this
control valve or any other reaches a preset value (eg. 90 percent open).
Similarly, the chilled water temperature can be reset downwards if any
control valve opens beyond the set maximum value.
Another method used for resetting the chilled water temperature uti-
lizes the return chilled water temperature. When the return chilled
water temperature reduces (e.g. from 12 to 10ЊC), the chilled water
supply temperature is raised to bring the return temperature back to
the design value (12ЊC). This is not a good strategy as the chilled water
return temperature is the average for all AHUs and may not represent
the loading of all AHUs. It could lead to situations where some areas
experiencing full load conditions may not be able to provide sufficient
cooling due to higher chilled water temperature.
The chilled water temperature can also be reset upwards based on the
cooling load or outdoor temperature. Since reduction in outdoor tem-
perature leads to lower cooling load, the outdoor temperature or a direct
measurement of the load can be used to reset the chilled water tem-
perature using a BAS.
Variable pumping systems. Variable speed pumps are often used to vary
the water flow rate to match load requirements. In such systems, the
speed of the pumps are varied to maintain a set pressure differential in
the system, which acts as the measure of building load.
Further energy savings can be achieved by varying the differential
pressure set point used for controlling the VSD speed according to
demand. In such a system, a BAS can be used to monitor the position
of the control valves at the AHUs and reduce the differential pressure
set point while ensuring that none of the valves are starved of water. A
possible control strategy is shown in Fig. 9.19.
In this algorithm, the valve actuator position of all AHU chilled water
modulating valves are monitored by the BAS and the valve that is open
the most is determined. The opening of this valve is compared with
limits set for adjusting the set point. For example, if the valve that is
open the most chilled water.
240 Chapter Nine
Variable air distribution systems. Most commercial buildings use variable
air volume (VAV) systems for air distribution where the amount of air pro-
vided to each space is varied based on load using thermostats and VAV
boxes. Such VAV systems normally have VSDs fitted to their AHU fans
to vary the amount of air supplied based on the load to save fan energy
during part-load operation. This is achieved by modulating the fan speed
to maintain a set static pressure in the distribution duct. The operations
of VAV boxes and AHU fans are normally controlled by a BAS.
In VAV systems where the VAV box damper positions are monitored
by a BAS, further energy savings can be achieved by continuously
resetting the static pressure set point based on system operations. The
static pressure set point can be continuously varied (as opposed to a
fixed set point in normal systems) in response to the damper positions
of the VAV boxes to ensure that no box is starved of air. This can help
in minimizing AHU fan energy consumption by reducing the system
static pressure while ensuring that the load requirements of all spaces
are met.
Atypical static pressure reset algorithm is similar to the one used for
variable speed pumping systems (Fig. 9.19). The control algorithm is set
to reduce the AHU fan speed up to the minimum set point while ensur-
ing no VAV box is more than 90 percent open or is likely to be starved of
air. The algorithm is able to achieve this by monitoring the damper posi-
tions of all the VAV boxes in a particular system and identifying the box
Building Automation Systems 241
Determine position of
each valve
Determine valve open most
(POS
MAX
)
POS
MAX
70% – 90%
> 90% < 70%
VSD at
minimum
VSD at
100%
Decrease
pressure
setpoint
Increase
pressure
setpoint
Delay
Yes Yes
No No
Figure 9.19 Control strategy for optimizing variable speed chilled
water pumps.
with the damper open the most and, therefore, the most likely VAV box
to be starved of air. If the box with the damper open most is more than
90 percent open, then the static pressure set point is raised. Similarly,
if the box with the damper open most is open less than 70 percent (other
boxes are open even less), the static pressure set point is reduced. This
check is performed by the control system continuously to ensure that the
system pressure is maintained at the minimum possible. It is estimated
that such systems are able to achieve further 20 percent energy savings
as compared to conventional fixed set point VAV systems.
Space temperature reset. Air-conditioning systems maintain comfort
conditions in occupied spaces by removing heat and moisture gener-
ated by occupants and equipment. The space temperature to maintain
occupant comfort in a space is set based on parameters such as occupant
activity, clothing worn by occupants, relative humidity of space, air cir-
culation rate, and radiant heat gain into the space.
Therefore, for spaces where occupants are active, the space temper-
ature is set lower to account for the extra heat that needs to be rejected
by the bodies of the occupants. Similarly, for spaces with glazing (in
perimeter zones of buildings), the space temperature is normally set
lower to account for the radiant heat transfer between the surroundings
and the occupants.
However, parameters such as the level of human activity and radiant
heat gain can vary during different times of the day and during differ-
ent periods of the year. Therefore, the space temperature set point can
be continuously reset by the BAS to match such changes and help main-
tain comfort conditions. Since energy consumed by central chilled water
cooling systems depend on the chilled water temperature, increasing
space temperature set point can help to raise the chilled water tem-
perature, which will result in better chiller efficiency.
Economizer cycle. Another energy saving feature that can be incorpo-
rated into a BAS in some climates is the outside-air economizer. The
basis of this strategy is to use outside air when it is below a certain tem-
perature to cool the space rather than using a mixture of outside air and
return air.
Normally, if the outdoor temperature is below the indoor temperature
(return air temperature), the economizer cycle can be set to convert
AHUs to use 100 percent outdoor air by adjusting the position of the out-
door air and return air dampers (Fig. 9.20). In humid climates, enthalpy
based controls are preferred. Generally, parameters such as the outdoor
temperature/enthalpy and indoor temperature are used for activating
this energy saving strategy.
242 Chapter Nine
9.9 Summary
Energy consumed by building systems such as air-conditioning, heat-
ing, and lighting systems can be reduced by ensuring that their opera-
tions are optimized by implementing various operating strategies. The
chapter provided a summary of how such control and optimizing strate-
gies can be implemented using the various functions and features of
building automation systems.
Building Automation Systems 243
Temperature sensor
Return air
Filter cooling coil
Supply air
Outdoor air
Return air damper closed
Outdoor air
damper open
Enthalpy/
temperature
sensor
Controller
Temperature
sensor
T
T
E
Figure 9.20 Arrangement of controls for a typical economizer.
Chapter
10
Building Envelope
10.1 Introduction
Buildings are designed to provide a comfortable internal environment
for the occupants all year round despite variations in external weather
conditions. This is achieved by using heating, ventilating, and air-
conditioning (HVAC) systems.
The building envelope, which mainly consists of walls, roofs, win-
dows, doors, and floors, allows heat to flow between the interior and exte-
rior of a building and, hence, plays a key role in regulating the indoor
environment. Therefore, the thermal characteristics of a building enve-
lope has significant influence on heating, ventilating, and air-condition-
ing systems, and affect, both, equipment capacity and energy required for
their operation.
Most measures to optimize the thermal performance of building
envelopes need to be incorporated at the design stage of buildings or
during a major upgrading exercise as they are not easy to implement
and involve considerable expenditure. Although such improvement
measures are relatively expensive, because they normally result in lower
heating and cooling loads, which in turn results in downsizing of equip-
ment and lower energy consumption, they are generally financially
viable when considered on a life-cycle basis.
10.2 Envelope Heat Transfer
Buildings gain or lose heat by heat transfer or air leakage through the
building envelope, as shown in Fig. 10.1. Heat transfer takes place by
conduction, convection, and radiation, while air leakage occurs by infil-
tration and exfiltration.
245 245
Heat transfer due to conduction and convection occurs across walls,
roofs, windows, and floors. It is dependent on the difference in temper-
ature between the inner and outer surfaces of the envelope and can
flow inwards or outwards. Heat transfer due to radiation takes place
through fenestration and is mainly due to solar radiation, which flows
inwards. Similarly, air leakage through building envelopes is depend-
ent on the pressure difference between the interior and exterior of build-
ings and can be in either direction.
Conduction. Heat transfer by conduction takes place when there is a
temperature gradient across a solid object. The rate of heat transfer
depends on the thermal conductivity of the material, its thickness, the
temperature gradient, and the surface area available for heat transfer.
The rate of heat transfer by conduction can be expressed using
Fourier’s law as follows:
(10.1)
where k ϭ thermal conductivity of the material
A ϭ area (perpendicular to heat flow)
dT ϭ temperature gradient
dx ϭ thickness
In buildings, heat is transferred by conduction mainly through walls,
roofs, and floors. Heat also travels by conduction through glazing of
building envelopes.
Convection. Heat transfer by convection takes place when a fluid comes
into contact with a surface at a different temperature. Normally, in build-
ing walls, roofs, and windows, heat transfer by convection takes place at,
both, the inner and outer surfaces.
q
cond
5 2kA
dT
dx
246 Chapter Ten
Solar radiation through
fenestration
Air leakage through gaps
Heat flow due to
temperature difference
across walls, roofs,
windows and floors
Inside Outside
Figure 10.1 Heat gain/loss mech-
anisms for building envelopes.
Heat transfer by convection can be expressed using Newton’s law of
cooling, as follows:
(10.2)
where h
c
ϭ surface heat transfer coefficient
A ϭ surface area
T
s
ϭ surface temperature
T
f
ϭ fluid temperature
The amount of convective heat transfer depends on the surface area,
temperature difference between the surface and fluid, and the surface
heat transfer coefficient. The surface heat transfer coefficient is depend-
ent on the wind conditions for outdoor surfaces, while for indoor surfaces
it is dependent on the airflow over the surface caused by HVAC systems.
Radiation. Heat transfer by radiation takes place due to electromagnetic
waves, which travel at the speed of light. In buildings, radiant heat
transfer is mainly due to the transmission of solar radiation through fen-
estration on the building envelope.
The amount of radiant heat transmission between two surfaces
depends on the absolute surface temperatures of the bodies exchanging
heat and the area of the body at the higher temperature. Radiant heat
transfer can be expressed as follows:
(10.3)
where ϭ Stefan-Boltzmann constant
A
1
ϭ area of surface 1
1
ϭ emissivity of surface 1
T
1
ϭ absolute temperature of surface 1
T
2
ϭ absolute temperature of surface 2
Radiant heat transfer can also be described by a simple expression
using the radiant heat transfer coefficient (h
r
), as follows:
(10.4)
Since, typically, a major portion of the energy consumed by buildings
is used for providing space cooling and heating, energy savings in
buildings can be achieved by reducing the heat gain or loss by build-
ing envelope components. Some of the important aspects of building
envelopes, which impact building energy consumption, are discussed
in this chapter.
q
rad
5 h
r
A
1
sT
1
2 T
2
d
q
rad
5 A
1
e
1
sT
4
1
2 T
4
2
d
q
conv
5 h
c
AsT
s
2 T
f
d
Building Envelope 247
10.3 Walls and Roofs
Heat transmission through opaque building walls and roofs is illustrated
in Fig. 10.2. Heat transfer by conduction takes place through the build-
ing fabric while convection heat transfer takes place at the inner and
outer surfaces. The actual direction of heat conduction depends on the
difference in temperature between the inner and outer surfaces and can
vary from inwards during summer to outwards during winter.
Generally, walls are composites made up of a few layers of different
materials, as shown in Fig. 10.3. Using Eq. (10.1) for each layer, the over-
all heat conduction can be expressed as:
(10.5)
where k ϭ thermal conductivity of each material
A ϭ area (perpendicular to heat flow)
x ϭ thickness of each layer
T
1,2
ϭ temperature of the outer and inner surfaces
Equation (10.5) can be simplified and expressed as:
(10.6)
where the overall heat transfer coefficient
U 5
1
c a
x
k
b
brick
1 a
x
k
b
insulation
1 a
x
k
b
plaster
d
q
cond
5 2U.A sT
2
2 T
1
d
q
cond
5 2
A
c a
x
k
b
brick
1 a
x
k
b
insulation
1 a
x
k
b
plaster
d
sT
2
2 T
1
d
248 Chapter Ten
Incident
solar
radiation
Absorbed solar radiation
Reflected
solar
radiation
Convection
and radiation
Convection
and radiation
Conduction
Inside Outside
Figure 10.2 Heat transfer through
walls and roofs.
Therefore, heat transfer by conduction through walls and roofs is
dependent on the thermal conductivity and thickness of the wall or roof
(overall resistance or U value), the thermal gradient, and the surface
area, as seen in Eq. (10.1).
As wall and roof surface areas are normally dependent on the build-
ing design while the thermal gradient is controlled by outdoor and
indoor conditions, heat conduction through walls and roofs can gen-
erally only be reduced by increasing the overall thermal resistance.
This can be achieved by using materials with lower thermal conduc-
tivity for walls and roofs or using insulation materials having low
thermal conductivity, like fiberglass bats, rigid board insulation, and
blown insulation.
Insulation is useful not only in cold climates, where it helps to reduce
heat loss, it is also useful in climates that require air-conditioning as it
can minimize heat gain. Increasing the insulation level of buildings to
minimize heat losses or heat gain can be more easily achieved for new
buildings by incorporating them into the design of buildings.
For roofs, since warm air moves upwards, the temperature difference
between the interior and exterior is higher, leading to a higher rate of
heat conduction. Therefore, roof and ceiling insulation is important to
minimizing heat loss. In existing buildings, roof insulation can be
improved relatively easily during reroofing exercises.
Since properties like texture and color of surfaces have an impact on
radiant heat transfer, such properties of walls and roofs affect the heat
loss or heat gain by buildings. Generally, smooth, light colored surfaces
reflect more solar energy than dark, rough surfaces. Hence, for build-
ings that are air-conditioned, smooth and light colored surfaces are pre-
ferred while for heated buildings, dark and rough surfaces are desirable.
For buildings that require heating during winter and cooling during
summer, the preferred color for the roof will depend on whether the
building has greater heating or cooling needs during the major part of
the year.
Building Envelope 249
Temperature, T
2
Temperature, T
1
Brick
Insulation
Plaster
Heat flow
Figure 10.3 Heat transfer through
a composite wall.
10.4 Windows
Glazed or fenestrated windows make a significant contribution to the
heat exchange between the building’s conditioned space and outdoors. In
tropical climates, where buildings are air-conditioned, glazing can trans-
mit as much heat as ten to twenty times the equivalent area of wall sur-
face. Since heat gain due to solar radiation has a bigger influence on the
cooling load of air-conditioned buildings than heat conduction and long-
wave radiation, in hot climates, most energy conservation measures for
fenestration are aimed at reducing heat gain by solar radiation. Similarly,
in heated buildings, as solar heat gain through fenestration actually
helps to reduce the heating load, energy saving measures for fenestra-
tion in such buildings are mainly aimed at minimizing conduction losses.
Heat flow through a typical window is illustrated in Fig. 10.4. As shown
in the figure, heat transfer takes place due to conduction and radiation.
The amount of radiant heat transfer depends on the amount of incident
direct solar radiation (the location of glazing), type of glass, and surface
area, while the conduction heat transfer depends on the thermal con-
ductivity, thickness, and surface area of the glazing.
Some of the important properties that provide a measure of window
performance are U-value, solar heat gain coefficient, shading coefficient,
and visible transmittance.
U-value. The U-value is a measure of heat flow through a window due
to temperature difference between the exterior and interior of buildings.
It is similar to the U-value in Eq.(10.6) for composite walls and can
account for the different layers in double and triple glazed windows. The
units of U-value are W/m
2
.K and the heat flow through windows is pro-
portional to the U-value. Therefore, the heat flow through a window with
a U-value of 1.0 will be double that for a window with a U-value of 0.5.
The U-value of a window depends on the type of glazing, its thickness,
coatings used, type of gas (air or inert gas), and thickness of gap in
250 Chapter Ten
Incident
solar
radiation
Transmitted radiation
Reflected
solar
radiation
Convection
and radiation
Convection
and radiation
Conduction
Outside
Inside
Figure 10.4 Heat flow through a
typical window.
multipaned windows. Typical U-values range from 0.9–1.1 for single
glazed to 0.4–0.5 for double glazed and 0.2–0.3 for triple glazed windows.
Solar heat gain coefficient (SHGC). The solar heat gain coefficient (SHGC)
is a measure of how much of the solar radiation incident on a window
is transmitted through it. SHGC can range from 0 to 1, where SHGC ϭ0
means none of the radiation incident on the window is transmitted
through as heat while SHGC ϭ 1 means all the incident radiation is
transmitted through the window.
Since lower SHGC results in lower solar heat gain through the glaz-
ing from the exterior to the interior, windows with low SHGC are pre-
ferred for air-conditioned buildings while windows with high SHGC are
preferred for buildings using passive solar heating.
Typical SHGC values range from 0.8 for single glazed to 0.6 for double
glazed and 0.4 for triple glazed windows.
Shading coefficient (SC). The shading coefficient (SC) is another term
used to measure the solar transmittance of glass. It is the ratio of heat
transmittance of a particular glass to the heat transmittance through
a 1/8 inch clear glass.
Visible transmittance. The visible transmittance (T
vis
) is a measure of
how much of the visible light incident on a window is transmitted
through it. Atypical clear, single-pane window has a T
vis
of 0.90, which
means that it will allow 90 percent of the visible light incident on it to
pass through.
Shading devices. Various shading devices can be used to minimize the
transmission of direct solar radiation through windows. Shading devices
are generally classified as internal or external shading devices. External
shading devices, such as louvers and overhangs, installed outside the
building envelope help to reduce transmission of direct radiation into
the building by intercepting direct radiation before it reaches the glaz-
ing (Fig. 10.5). However, they also cut off a portion of natural light,
which may lead to higher lighting loads for perimeter areas of buildings.
Interior shading devices, such as curtains and blinds, can also be
used but are less effective at reducing solar gains than the external
shading devices since the solar radiation first enters the conditioned space
and is then reflected back through the glazing before being absorbed by
the conditioned space (Fig. 10.6).
Special coatings. Since the properties of glazing can also be altered by
tinting or by applying various coatings or films, special coatings and
solar control films can be used to reduce solar heat gain through windows.
Building Envelope 251
These include tinted glass and spectrally selective coatings that can be
used to transmit visible light while reflecting part of the solar radiation.
Glass tints are generally achieved by either adding colors during pro-
duction or by applying colored films after production. Although tints are
normally able to reduce solar gains by absorbing part of the solar radi-
ation, they normally reduce the transmission of natural light. Another
disadvantage is that most of the absorbed heat energy is subsequently
transferred into the building through convection and radiation.
Coatings usually have microscopically thin metallic or ceramic coat-
ings to reduce the transmission of solar radiation while allowing part
of the visible light to be transmitted. They are ideal for energy conser-
vation as heat gain can be minimized while maximizing the use of nat-
ural light. They can be added during production or applied in the form
of a film for existing windows.
The percentage of solar energy rejected and the percentage of visible
light allowed to be transmitted depends on the actual type of coating or film
used. Typical infrared rejection and visible light transmission properties
252 Chapter Ten
Incident
solar
radiation
Reflected
solar
radiation
Conduction
Shading
device
Transmission of
diffuse radiation
Window
Figure 10.5 External shading
device.
Direct solar
radiation
Reflected
radiation
Internal
shading device
Window
Absorbed
radiation
Figure 10.6 Internal shading device.
of a high performance film is shown in Fig. 10.7. Since the solar spec-
trum consists of visible light, ultraviolet and infrared, part of the energy
in solar radiation is in the form of visible light. Therefore, when such a
special film is able to reject even more than 90 percent of infrared and
ultraviolet, the total effective solar energy rejection is about 55 percent.
Multipaned windows. While minimizing radiant heat gain through glazing
is the prime concern in climates that require building air-conditioning,
heat loss through glazing is important in buildings that require heating to
maintain occupant comfort. In such applications, the insulation property
of the glazing can be improved by using double or triple glazing, which con-
sists of two or three layers of glass sandwiching layers of air (or gas) between
them to make use of the low thermal conductivity of air (gas) to reduce heat
transmission, as shown in Fig. 10.8 for a double glazed window.
Building Envelope 253
94%
infrared
rejection
Visible light transmission
more than 70%
Outside Inside
98% ultra
violet
rejection
Total solar energy
rejection 55%
Figure 10.7 Performance of a typical solar film.
Incident
solar
radiation
Transmitted radiation
Reflected solar radiation
Convection
and radiation
Convection
and radiation
Conduction
Outside Inside
Figure 10.8 Heat flow through a typical double glazed
window.
10.5 Air Leakage
Air leakage through building envelopes can be a cause of energy wastage
in buildings. Leakage can occur due to infiltration, which is the leaking
of untreated air into the building and exfiltration, which is the leaking
out of treated air.
Excessive air infiltration occurs due to negative pressure in buildings.
This can be caused by unbalanced supply and exhaust airflows, where
the exhaust airflow is much higher than the supply airflow rate. Typical
reasons for such unbalanced airflows can be the design or sizing of the
ventilation system and reduction of supply air to reduce building cool-
ing or heating loads.
Exfiltration is the opposite of infiltration and can also be caused by
unbalanced supply and exhaust flows where supply airflow is higher
than exhaust airflow.
Infiltration and exfiltration can also occur in buildings due to wind
effects. Wind pressure is positive on the surface of the building facing
the wind while it is negative on the opposite face, leading to air pass-
ing through the building. Similarly, stack effect in buildings take place
where cold air from the outside flows in at the lower levels of the build-
ing to take the place of warm air rising within the building (which in
turn leaks out at the higher levels).
Some common means of reducing such air leakage through building
structures include weather-stripping, use of automatic doors, vestibules,
and air curtains.
Weather-stripping. Weather-stripping involves the sealing of gaps around
exterior doors and windows to prevent air leakage. Different types of
weather-stripping are available for different applications. The common
types of weather-stripping used are compression type for normal doors
and windows and sliding type for sealing sliding surfaces.
Automatic doors. Automatic doors can be used in applications where the
doors need to be frequently opened. Such doors can be completely auto-
matic, that is, they are opened and closed automatically using sensors,
which can detect the movement of people or doors that have hydraulic
or spring loaded mechanisms to simply close the doors when opened.
Vestibules. Vestibules are intermediate compartments that act as air
locks between the exterior and interior of buildings to minimize air
leakage at doorways. They usually have two sets of automatic or revolv-
ing doors so that the interior of the building is not directly exposed to
the exterior.
254 Chapter Ten
Air curtains. Air curtains can be installed over open doorways to pre-
vent air leakage and are commonly used in retail stores where the doors
are kept completely open (Fig 10.9). They consist of fans that take air
from the front and blow it vertically downwards to create an invisible
air barrier between the interior and exterior of the building.
10.6 Overall Thermal Transfer Value (OTTV)
Building codes in various jurisdictions generally specify minimum per-
formance criteria for building envelope components to address energy
conservation needs. These codes normally specify minimum design
parameters for thermal resistance and solar radiation transmission for
walls, roofs, floors, and fenestration.
An alternative approach is to specify a maximum allowable heat gain
for the entire envelope of buildings and provide the designers the free-
dom to choose individual components and materials. The overall ther-
mal transfer value (OTTV) used in some countries follows this approach.
The OTTV concept takes into consideration the basic elements of heat
gain through the envelope of a building, which are:
■
Heat conduction through opaque walls
■
Heat conduction through fenestration
■
Solar radiation through fenestration
■
Heat conduction through roofs
The OTTV for walls is defined as:
OTTV ϭ (TD
eq
ϫ (1-WWR) ϫ U
w
) ϩ (⌬T ϫ WWR ϫ U
f
)
ϩ (SF ϫ CF ϫ WWR ϫ SC)
Building Envelope 255
Air in
Air out Entrance
Air curtain
Figure 10.9 Operation of a typical
air curtain.
where WWR ϭ window to wall ratio
U
w
ϭ thermal resistance of wall (W/m
2
⋅K)
U
f
ϭ thermal resistance of fenestration (W/m
2
⋅K)
TD
eq
ϭ equivalent temperature difference (K)
⌬T ϭ temperature difference
SF ϭ solar factor (W/m
2
)
CF ϭ correction factor for solar heat gain through
fenestration
SC ϭ shading coefficient for fenestration
A similar OTTV computation for roofs will include heat conduction
through the opaque parts of the roof and skylights and solar radiation
through skylights.
The various weather dependent factors used in the OTTV calculation,
such as SF, TD
eq
, and ⌬T are derived from local weather data. The max-
imum OTTV value set for some countries is 45 W/m
2
. This maximum
value is periodically reviewed and revised downwards based on tech-
nological developments, which lead to improvements in the thermal
properties of materials used in building envelopes.
10.7 Estimation of Building Energy
Performance
At the building design stage or when retrofitting buildings, an accurate
evaluation of the thermal performance of building envelope components
is necessary to assist the selection of cost-effective options. Often, the
available options need to be evaluated not just for their thermal per-
formance but also for their effect on the overall energy performance of
the building.
Since building envelopes are exposed to outdoor weather conditions,
which are rarely steady, and because components such as walls and
roofs also exhibit a thermal storage effect, numerical techniques such
as finite element, finite difference, and time series, which can account
for the transient nature of the heat flow, need to be used to predict the
heat flow through building components.
The thermal response factor method, or transfer function method, is one
such method where heat flow through walls is expressed algebraically
in terms of the surface temperature history and thermal characteristics
of the wall material using time series techniques. The cooling load tem-
perature difference (CLTD) method uses factors developed by the method-
ology and equations of the transfer function method for direct one-step
calculation of heat gain through sunlit walls, roofs, and glass exposures.
One of the most commonly used building energy analysis codes is
DOE-2, which can be used to predict the energy use and cost for different
256 Chapter Ten
types of buildings. DOE-2 uses a description of the building layout, con-
structions, usage, and conditioning systems like HVAC, lighting, and
utility rates provided by the user, along with weather data, to perform
an hourly simulation of the building.
Various easy to use software such as PowerDOE, which operate using
DOE-2 as a platform, are also available to help perform quick and accu-
rate predictions of the thermal and energy performance of buildings.
Such computer modeling programs are very useful tools for building
designers as they are able to optimize designs by simulating the thermal
performance of individual components or the overall energy performance
of buildings.
Results of a parametric study carried out using DOE-2 to evaluate the
impact of various key parameters on the total energy usage and cooling
energy usage of a typical building in the tropics is shown in Table 10.1.
The table lists the variation in total building energy consumption and cool-
ing energy consumption for a 10 percent increase in various parameters
within a set minimum and maximum range. For each, two values are
listed where the first value refers to an increase in the minimum range
value while the other refers to a change in the maximum range value.
For example, a 10 percent increase in the COP from the maximum
range value of 5.5 will result in a reduction in the total energy con-
sumption and cooling energy consumption by 2.5 and 7 percent, respec-
tively (negative sign indicate reductions).
However, one of the main drawbacks of such simulation tools is that
they are normally not able to take into consideration the impact of rain
on the building envelope. Since rain is absorbed by porous building mate-
rials, such as walls and roofs, which is later evaporated during drying, it
leads to a reduction in the actual heat flow due to latent heat absorption,
resulting in less accurate prediction of thermal and energy performance
of buildings. The impact of this effect can be significant for buildings in
climates that experience rainfall during most parts of the year.
In such situations, if accurate data is required, correction factors can
be used to adjust the output data from standard simulation tools to
Building Envelope 257
TABLE 10.1 Impact of Changes in Various Parameters on Total and Cooling Energy
Consumption of a Building
Range Change in total Change in cooling
Parameter considered energy consumption energy consumption
COP of cooling plant 3.5 to 5.5 Ϫ3.5% to Ϫ2.5% Ϫ7.9% to Ϫ7%
Lighting power (W/m
2
) 10.8 to 20.4 ϩ3.6% to ϩ5.1% ϩ1% to ϩ2%
Window-to-wall ratio 0.3 to 0.6 ϩ0.82% to ϩ0.81% ϩ1.6% to ϩ1.5%
Shading coefficient 0.35 to 0.69 ϩ1.3% to ϩ2.3% ϩ2.4% to ϩ4%
Cooling set point (ЊC) 22.3 to 27.8 Ϫ1.5% to Ϫ7% Ϫ6% to Ϫ12%
account for the effect of rain. One study on this subject has shown that
on rainy days, the actual heat gain through porous walls can reduce by
10 to 20 percent, while the annual reduction in heat gain for a building
could be as high as 5 percent.
10.8 Summary
The building envelope, which consists of walls, roof, windows, doors, and
floor, acts as the barrier between the outdoor environment and the con-
ditioned indoor environment. This helps to minimize the load on HVAC
systems used in buildings to condition the indoor environment. In gen-
eral, HVAC systems account for a significant portion of the total energy
consumed in buildings. Therefore, the overall energy consumption of
buildings can be reduced by improving the thermal design of building
envelopes, and various strategies to achieve this were described in the
chapter.
258 Chapter Ten
Bibliography
ASHRAE, Handbook of Refrigeration, American Society of Heating, Refrigerating and Air-
conditioning Engineers, Inc., Atlanta, GA, 2002.
ASHRAE, Handbook of HVAC Applications, American Society of Heating, Refrigerating
and Air-conditioning Engineers, Inc., Atlanta, GA, 2003.
ASHRAE, Handbook of Fundamentals, American Society of Heating, Refrigerating and
Air-conditioning Engineers, Inc., Atlanta, GA, 2005.
ASHRAE Standard 90.1, Energy Standard for Buildings Except Low-Rise Residential
Buildings, American Society of Heating, Refrigerating and Air-conditioning Engineers,
Inc., Atlanta, GA., 2001.
ASHRAE Standard 62.1, Ventilation for Acceptable Indoor Air Quality, American Society
of Heating, Refrigerating and Air-conditioning Engineers, Inc., Atlanta, GA., 2004.
Berbari, G.J., “Fresh Air Treatment in Hot and Humid Climates,” ASHRAE Journal,
64–70, 1998.
Chou, S.K. and Y.K. Lee, “A Simplified Overall Thermal Transfer Value Equation for
Building Envelopes Energy,” The International Journal, 13(8), 657–670, 1988.
Chou, S.K. and W.L. Chang, “Effects of Multi-Parameter Changes on Energy Use of Large
Buildings,” International Journal of Energy Research, Vol. 17, 885–903, 1993.
Chou, S.K., N.E. Wijeysundera, and S.E.G Jayamaha, “Determining the Heat Flow
Through Building Walls Under Simulated Actual Weather Patterns,” International
Journal of Energy Research, Vol. 19, 243–251, 1995.
Chou, S.K. and W.L Chang, “AGeneralized Methodology for Determining the Total Heat
Gain Through Envelopes,” International Journal of Energy Research, Vol. 20, 887–901,
1996.
Cleaver Brooks, Boilerspec, WebCD, Version 1.0.
Desiccant Rotors International/Bry-Air product catalogue.
DOE-2 Engineers Manual, US Department of Commerce, National Technical Information
Center,1980.
Eppelheimer, D.M., “Variable Flow–The Quest for System Energy Efficiency,” ASHRAE
Transactions, 96 (12), 673–678.
Jayamaha, S.E.G., “Thermal Response of Building Materials and Components Under
Hot and Humid Conditions,” MEng thesis, National University of Singapore, 1993.
Jayamaha, S.E.G., N.E. Wijeysundera, and S.K. Chou, “Measurement of the External Heat
Transfer Coefficient for Walls Under Outdoor Weather Conditions,” Proceedings of the
Asia Pacific Conference on the Built Environment, Vol. 1, 498–509, 1995.
Jayamaha, S.E.G., “Heat and Moisture Transfer Through Building Envelope Components
Subjected to Outdoor Weather Conditions Including Rain,” PhD thesis, National
University of Singapore, 1996.
Krarti, M., Energy Audit of Building Systems—An Engineering Approach, CRC Press,
Florida, USA ,2000.
Mashuri, W. and L.K. Norford, “Integrating VAV Zone Requirements with Supply Fan
Operation,” ASHRAE Journal, 43–46, April 1993.
Moult, R and J. Tran, “Getting an Additional 20% Energy Savings from VAV Systems,”
ASHRAE Conference—Built Environment Trends and Challenges, Singapore, June
1995.
National Lighting Product Information Program (NLPIP), Specifier Report 1(2), 1992.
National Lighting Product Information Program (NLPIP), Specifier Report 6(2), 1998.
259 259
Philips Lamps and Gear Catalogue 2005/2006.
Spirax Sarco Learning Centre ().
Schanin, D.J., Plug Loads—The Fastest Growing Consumer of Commercial Power,
Bayview Technology Group, Inc.
SS CP 13: Code of Practice for Mechanical Ventilation and Air-conditioning in Buildings,
PSB, 1999.
SS CP 24: Code of Practice for Energy Efficiency Standard for Building Services and
Equipment, PSB, 1999.
SS CP 38: Code of Practice for Artificial Lighting in Buildings, PSB, 1999.
Tillack, L and J.B. Rishel, “Proper Control of HVAC Variable Speed Pumps,” ASHRAE
Journal, 41–47, November 1998.
Wang, K. S., Handbook of Air-conditioning and Refrigeration, McGraw Hill, Singapore,
2001.
Wijeysundera, N.E., S.K. Chou, and S.E.G. Jayamaha, “Heat flow Through Walls Under
Transient Rain Conditions,” Journal of Thermal Insulation and Building Envelopes,
Vol. 17, 118–141, 1993.
Wulfinghoff, D.R., Energy Efficiency Manual, Energy Institute Press, Maryland, USA,
1999.
260 Bibliography
Solutions
Chapter 2
2.1.
(i) Chilled water reset, which is to increase the chilled water supply tem-
perature set point for chillers. Increasing the chilled water set point
helps to reduce the compressor lift (pressure difference across com-
pressor), thereby helping to improve chiller efficiency.
(ii) Condenser water reset, which is to reduce the condenser water supply
temperature to the chillers. Reducing the condenser water supply tem-
perature helps to reduce the condenser water return temperature,
which also results in the reduction of compressor lift, which, in turn,
leads to better chiller efficiency.
(iii) Matching chiller capacity to cooling load. The operating efficiency of
chillers is generally dependent on the loading (ratio of cooling load to
chiller capacity), and higher loading results in better efficiency.
(iv) For water-cooled chillers, reducing the condenser approach tempera-
ture (temperature difference between refrigerant in the condenser
and water leaving the condenser) also helps improve chiller efficiency
by reducing the compressor lift. This can be achieved by condenser tube
cleaning and a good water treatment program.
2.2. VSDs can be used to vary the speed of chilled water pumps to better match
their capacity to the cooling load. The pump capacity can be varied to
maintain a set pressure in the chilled water distribution system.
2.3. Efficiency of the chiller is 0.6 kW/RT, when the chilled water supply tem-
perature is 7ЊC.
If the chilled water supply temperature is increased to 8ЊC, the chiller
efficiency will improve by 3 percent to 0.6 kW/RT ϫ 0.97 ϭ0.58 kW/RT. If
the chiller operates at 500 RT, 10 hrs a day,
Saving ϭ (0.6 Ϫ 0.58) ϫ 500 ϫ 10 ϭ 100 kWh/day
2.4.
Energy cost ϭ cooling load ϫ hours of operation
ϫ efficiency (kW/RT) ϫ electricity tariff
261 261 is $63,750 ($62,500 ϫ 1.02)
The annual life-cycle cost comparison for the three chillers can be computed
as follows:
(All costs are energy costs except Year 0 capital cost)
2.5.
Daily saving ϭ (1.75–0.65) ϫ 20 RT ϫ 8 h
ϭ 176 kWh/day
2.6.
(i) Daily kWh savings can be computed as follows:
Cooling Chiller efficiency Chiller
Time Hours load (RT) (kW/RT) kWh
12 a.m. to 6 a.m. 6 300 0.57 1026
6 a.m. to 10 a.m. 4 400 0.56 896
10 a.m. to 2 p.m. 4 450 0.555 999
2 p.m. to 8 p.m. 6 400 0.56 896
8 p.m. to 12 p.m. 4 350 0.565 791
Daily total 4608
Annual cost
262 Solutions
Present chiller consumption ϭ 6000 kWh/day
Saving ϭ 6000 Ϫ 4608 ϭ 1392 kWh/day
Daily savings ϭ 1392 kWh
(ii) Tariff ϭ $0.10/kWh
Operating days/year ϭ 300
Annual savings ϭ 1392 ϫ 0.1 ϫ 300 ϫ $41,760
Payback ϭ cost/savings ϭ 300,000/41,760 ϭ 7.2 years
Chapter 3
3.1. If the oxygen concentration in the flue gas is reduced from 8 to 5 percent,
in Fig. 3.9, the combustion efficiency will increase by about 2 percent.
3.2. The temperature difference between the flue gas and room temperature is
142ЊC (approximately 290ЊF).
Using the stack loss Table A.2 (for no.2 oil) in Appendix A, for CO
2
con-
centration of 5.5 percent in the flue gas, the stack loss is estimated to be
20.9 percent.
From Table 3.1, the radiative and convective losses are about 0.5 to
0.7 percent.
Therefore, the overall efficiency ϭ 100 Ϫ (20.9 ϩ 0.7) ϭ 78.4%
3.3. Savings can be estimated as follows:
3.4.
Feedwater 80°C and 1 unit
Make-up water 27°C and x unit
Condensate 95°C and (1–x) units
Operating Fan motor Fan motor Power Energy
Boiler hours power with power with saving savings
A B C D ϭA
3
ϫ 35 E ϭ C Ϫ D B ϫ E
80% 4 22 18 4 16
60% 12 18 8 10 180
40% 8 16 2.2 13.8 17.6
Total daily savings 213.6
Solutions 263
Heat balance,
27 x ϩ (1Ϫ x) 95 ϭ 80
x ϭ 0.22 (22 percent makeup water)
Amount of condensate is recovered ϭ (1 Ϫ x) ϭ 0.78
(78 percent condensate is recovered).
3.5. From Fig. 3.17, at 300 kPa, the approximate steam leak rate for a 3 mm
hole is 10 kg/hr. The amount of fuel that can be saved is 6000 litres a year
(based on 24 hours ϫ 7 days a week ϫ 50 weeks).
For three holes, the total leakage will be 18,000 litres a year. Annual fuel
cost savings that can be achieved if these leaks are eliminated ϭ 18,000
ϫ $0.5 ϭ $9000.
Chapter 4
4.1.
Q
1
ϭ 200 L/s
P
1
ϭ 45 kW
N
1
ϭ 1200 rpm
N
2
ϭ 1100 rpm
Q
2
ϭ Q
1
ϫ (N
2
/N
1
) ϭ 200 ϫ (1100/1200) ϭ 183 L/s
P
2
ϭ P
1
ϫ (N
2
/N
1
)
3
ϭ 45 ϫ (1100/1200)
3
ϭ 35 kW
4.2. From pump affinity laws, the pump speed can be reduced to give the design
flow as follows:
New pump speed ϭ 1200 ϫ (20/35) ϭ 686 rpm
New power consumption ϭ 25 ϫ (20/35)3 ϭ 4.7 kW
Reduction in pump power consumption ϭ 25 Ϫ 4.7 ϭ 20.3 kW
4.3.
Option A Option B
Pressure drop across 80 kN/m
2
40 kN/m
2
condenser
264 Solutions
The theoretical pump power consumption to overcome the resistance across
the condenser can be calculated as follows:
Pump kW ϭ [Flow in m
3
/s ϫ pressure difference in N/m
2
]/1000
Option 1, pump kW ϭ [0.150 ϫ 80 ϫ 10
3
]/1000 ϭ 12 kW
Option 2, pump kW ϭ [0.150 ϫ 40 ϫ 10
3
]/1000 ϭ 6 kW
Pump kW savings ϭ (12 Ϫ 6) ϭ 6 kW.
4.4.
If the motor efficiency
m
is taken as 1.0,
ϭ 1.7 kW
Chapter 5
5.1.
5.2. The wet-bulb and dry-bulb temperatures of air entering the cooling tower
are much higher than the ambient wet-bulb and dry-bulb temperatures;
possibly due to recirculation of air discharged from the cooling tower back
to the air intake.
Possible causes Remedies
Defective water spray Repair spray system
mechanism
Defective/damaged Repair/replace fill material
fill material
Inadequate airflow Tighten/replace drive belts
5
s0.04 3 120 3 10
3
d
1000
a
1
0.65
2
1
0.85
b
Saving in pump power 5
sQ 3 ⌬Pd
1000
a
1
78 %
2
1
90%
b
P 5
sQ 3 ⌬Pd
s1000 3
p
3
m
d
Solutions 265
5.3. At full load, the fan consumes 15 kW.
At 60 percent speed (60 percent capacity), from the cube law,
Fan kW ϭ 15 ϫ (0.6)
3
ϭ 3.2 kW
Savings ϭ (15 Ϫ 3.2) ϭ 11.8 kW
5.4.
Motor power of one fan ϭ 15 kW (at full speed)
If the fan operates at 50 percent speed, fan motor power
ϭ 15 ϫ (0.5)
3
ϭ 1.9 kW
Total fan power when both fans operate at 50 percent speed
ϭ 1.9 ϫ 2 ϭ 3.8 kW
Fan power savings ϭ (15 Ϫ 3.8) ϭ 11.2 kW
5.5.
Estimated free cooling capacity of each 500-RT cooling tower
ϭ 25 RT (500 ϫ 0.05)
Estimated free cooling capacity of each 200-RT cooling tower
ϭ 10 RT (200 ϫ 0.05)
Total free cooling capacity ϭ (25 ϫ 3) ϩ (10 ϫ 2) ϭ 95 RT
Chapter 6
6.1.
Q
1
ϭ 15 m
3
/s
Q
2
ϭ 10 m
3
/s
P
1
ϭ 30 kW
N
1
ϭ 1400 rpm
N
2
ϭ N
1
ϫ (Q
2
/Q
1
) ϭ 1400 ϫ (10/15) ϭ 933 rpm
P
2
ϭ P
1
ϫ (N
2
/N
1
)
3
ϭ 30 ϫ (933/1400)
3
ϭ 8.9 kW
6.2.
Fan impeller power (kW)
5
flow rate sm
3
/sd 3 pressure developed sN/m
2
or Pad
1000 3 efficiency
266 Solutions
Taking the efficiency as 1.0,
ϭ 1 kW
6.3. From the psychrometric data in Appendix B, the enthalpy of outdoor air
is 90 kJ/kg (at 35ЊC dry-bulb at 60 percent RH), and the enthalpy of return
air is 47.5 kJ/kg (at 23ЊC and 55 percent RH).
Reduction in cooling load ϭ airflow rate ϫ density of air
ϫ difference in enthalpy
ϭ 1.5 m
3
/s ϫ 1.2 kg/m
3
ϫ (90 Ϫ 47.5) kJ/kg
ϭ 76.5 kW (approximately 22 RT)
Savings in chiller power consumption
ϭ cooling load reduction ϫ system efficiency
ϭ 22 RT ϫ 0.8 kW/RT
ϭ 17.6 kW
Annual energy consumption ϭ 17.6 kW ϫ 12 h/day ϫ 250 days/year
ϭ 52,800 kWh/ear
6.4.
Using Eq. (6.6),
T
SA
ϭ T
OA
Ϫ (T
OA
Ϫ T
RA
) ϫ
T
ϭ 33Ϫ (33 Ϫ 23) ϫ 0.77
ϭ 25.3ЊC
Sensible cooling done,
Q
sensible
ϭ 1.232 ϫ v ϫ (T
OA
Ϫ T
SA
)
ϭ 1.232 ϫ 3 ϫ (33 Ϫ 25.3)
ϭ 28.5 kW
ϭ 8 RT
Fan power skWd 5
20 3 s80 2 30d
1000 3 1.0
Solutions 267
Savings in chiller power consumption
ϭ cooling load reduction ϫ system efficiency
ϭ 8 RT ϫ 0.83 kW/RT
ϭ 6.6 kW
Annual energy consumption ϭ 6.6 kW ϫ 10 h/day ϫ 260 days/year
ϭ 17,160 kWh/year
Chapter 7
7.1.
(i) Delamping (to reduce lux level to about 500)
(ii) Changing from T8 to T5 lamps (need to replace fixture or use T5 with
adaptors)
(iii) Using power saving device and dimming to achieve about 500 lux
7.2. Use of timers
a. Office lighting
b. Outdoor lighting
Use of occupancy sensors
a. Toilets
b. Meeting rooms
Use of light sensors to dim lighting
a. Perimeter office lighting
b. Outdoor/car park lighting
7.3.
Energy savings per lamp ϭ (60 Ϫ 11) ϭ 49 W
Energy savings per day ϭ (49 ϫ 1000 ϫ 12)/1000 kWh
ϭ 588 kWh/day
Annual energy savings ϭ 588 ϫ 5 ϫ 52 ϫ $0.10 ϭ $15,288
Payback period based purely on energy savings
ϭ $(12 ϫ 1000)/$15,288 ϭ 0.78 ϭ 9.4 months
268 Solutions
Payback period taking into account longer lamp life:
Annual cost of incandescent lamps ϭ $1 ϫ (12 ϫ 5 ϫ 52)/1000 5ϫ $3.12
Annual cost of CFL ϭ $12 ϫ (12 ϫ 5 ϫ 52)/8000 ϭ $4.68
Total additional cost ϭ $(4.68 Ϫ 3.12) ϫ 1000
ϭ $1,560
Payback period ϭ 1560/15,288 ϭ 0.1 ϭ 1.2 months
7.4.
Energy savings per lamp ϭ (40 Ϫ 28) ϭ 12 W
Energy savings per day ϭ (12 ϫ 100 ϫ 24)/1000 kWh
ϭ 28.8 kWh/day
Annual savings ϭ 28.8 ϫ 365 ϫ $0.1 ϭ $1051.20
Total cost ϭ $40 ϫ 100 ϭ $4000
Payback period ϭ 4000/1051.20 ϭ 3.8 years
7.5.
Energy savings per day ϭ (84–64) ϫ 24)/1000 kWh ϭ 0.48 kWh/day
Annual energy savings ϭ 0.48 ϫ 365 ϫ $0.10 ϭ $17.52
Cost of ballast ϭ $20
Payback period ϭ 20/17.52 ϭ 13.7 months
Chapter 8
8.1.
where
S
ϭ efficiency of standard motor
P
ϭ efficiency of premium motor
Energy saved in kWh 5 Motor kW 3 Operating hour 3 c
1
S
2
1
P
d
For the motor, Power
IN
5
Power
OUT
Solutions 269
Annual electrical saving
ϭ 15,269 kWh/year.
8.2.
Energy saved in kWh
where pF ϭ power factor
ϭ efficiency of transformers
Annual electrical saving
ϭ 41,323 kWh/year.
8.3.
a. Chilled water distribution pumps
b. Hot water distribution pumps
c. Cooling tower fans
d. Air handling unit fans
e. Supply and exhaust ventilation fans
8.4.
a. Replace hydraulic elevators with traction elevators
b. Replace old motor drives with modern VVVF drives
c. Install drives that can feedback regenerated energy back into the dis-
tribution system
d. Install controls to optimize multiple elevator systems
e. Install controls to switch off systems when elevator is not in service
f. Reduce counterweight and elevator capacity (if elevator capacity is more
than required)
5 1,500 3 0.9 3 12 3 250c
1
0.985
2
1
0.995
d kWh/year
5 Transformer load skVAd 3 pF 3 Operating hour 3 c
1
98.5
2
1
99.5
d
5 55 3 24 3 250 c
1
0.91
2
1
0.95
d kWh/year
270 Solutions
8.5.
Reactive power at 0.75 power factor
cos ϭ 0.75
ϭ 41.41Њ
Reactive power ϭ tan (41.41Њ) ϫ 1500 ϭ 1323 kVAr
Reactive power at 0.9 power factor
ϭ cos
–1
(0.9) ϭ 25.8Њ
Reactive power ϭ tan (25.8Њ) ϫ 1500 ϭ 725 kVAr
Therefore, size of capacitor required
ϭ 1323 Ϫ 725 ϭ 598 kVAr (capacitive).
θ
Reactive power
(kVAr)
Active power 1500 kW
Apparent
power
Solutions 271
Appendix
A
Reference Data for
Boiler Operations
274 Appendix A
Figure A.1 O
2
to CO
2
conversion chart. (Courtesy of Cleaver Brooks.)
TABLE A.1 Stack Loss Estimation Table for Natural Gas
Source: Courtesy of Cleaver Brooks.
2
7
5
TABLE A.2 Stack Loss Estimation Table for No. 2 Oil
Source: Courtesy of Cleaver Brooks.
2
7
6
Table A.3 Stack Loss Estimation Table for No. 6 Oil
Source: Courtesy of Cleaver Brooks.
2
7
7
This page has been reformatted by Knovel to provide easier navigation.
INDEX
Index Terms Links
A
absorption cycle 24 25 27
components of 25 25f
vapor compression cycle and, difference
between 25
adjustable frequency drives (AFD), See
variable speed drives
AFD. See adjustable frequency drives
AHU. See air handling units
air distribution systems 154f
axial-flow fans in 155 156
car park ventilation 180
centrifugal fans in 155 155f 166
coil losses in 164
dehumidification applications in 156 166
description of 153
ducting system design in 158
dynamic losses in 155 159 160
effect of filter on 161f
ESMs for 15
excess airflow in 168
fan affinity laws in 157 158 158t 163
fan curve and 156 156f 157f
fan efficiency in 166 167f
fan impeller power in 156
fan performance in 155 158
filter losses in 161
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
air distribution systems (Cont.)
friction losses in 155 159
minimizing pressure losses 159
outdoor air control 178f
parameters measured for 12
reducing fan speed in 162f 169 171f
reduction in coil face velocity within 164 165
system curves in 155 156f
system resistance of 155
types of 169 170
variable air volume 61
air handling units (AHU) 26 118 165f
air balancing 173 174
BAS and 237
cooling coil characteristic for constant
air volume 53f
description of 153
dual path 165 166 166f
duct static pressure sensor in 172
on economizer mode 176f
electronic air filters for 162 163 164
ESMs for 15
media filters for 161 163
reheating for humidity control in 174
runaround coils in 174 174f
air-conditioning systems, central 26 27
airflow measurements 10
air-to-air recovery, of heat 177
American Society of Heating,
Refrigerating and Air-conditioning
Engineers (ASHRAE) 3 4 177 192
Handbook of Fundamentals by 155
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
ASHRAE. See American Society of
Heating, Refrigerating and
Air-conditioning Engineers
B
ballasts
high efficiency electronic 196 197f 198
improving life of 201
losses from 197
magnetic 196 197
power consumption for different 198t
BAS. See building automation system
benchmarks
comparison through 8
typical parameters of 8t
blowdown control, automatic 93 94
heat recovery with 93 94
boiler fans 88
installing VSD in 89
VSD in 88f
boiler plant, arrangement of 83f
boilers
arrangement for maximum efficiency 102f
auxiliary equipment for 82 83
BAS and 235 236
blowdown of 93
burner systems on 94
capacity of 78
classification of 78
combustion efficiency of 79 81 82 83
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
ASHRAE (Cont.)
...combustion efficiency v.O
2
concentration in 84f
construction of 77 78
control systems for 235 236 236f
decentralized 101
efficiency of 101
excess air in 85
feedwater pump arrangement for
multiple 87f 88f
fouling/scaling of 100
heat balance for 81f
heat recovery from flue gas in 91
ideal system of 101
improving efficiency of 85 91
inflows/outflows of 78f
isolating off-line 100 101
minimizing conduction/radiation losses
in 90
operating configuration for 94
operating pressure of 85
optimum start controls for 91
overall efficiency of 81 82
preheating combustion air for 91
radiation losses in 90t
radiation/convection losses for 82 82t
replacing 101
sequencing programs for 94
space heating arrangements of 78f
standby equipment for 87
standby losses in 89
thermal efficiency of 81
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
boilers, fire tube
arrangement of 79f
cutaway of 80f
boilers, water tube
arrangement of 79f
cutaway of 80f
building automation system (BAS) 15 125 172
AHU and 237
alarms and 232 233
boilers and 235 236
chillers and 233
configuration of 228f
demand limiting algorithm of 229
duty cycling algorithm of 229
economizer cycle and 242 243f
fans and 237 238 238f
feedwater pumps and 236
interlock features of 228
main components of 227
optimal start-stop algorithm in 175
optimize start-stop in 238 239
resetting chilled water temperature
with 239 240
resetting space temperature
with 242
scheduling with 227 228
static pressure reset algorithm 241
trend data from 230f 231f 232f
trend logging with 230
variable pumping systems and 240 241f
VAV and 241 242
ventilation fans and 238 239f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
building energy performance, estimation
of 256
building envelope
air curtains and 255 255f
air leakage through 246 254 255
automatic doors for 254
basic elements of heat gain through 255 256
heat gain/loss mechanisms for 246f
heat transfer in 245
vestibules and 254
weather-stripping of 254
C
candela 184
carborn dioxide (CO
2
), emission of 1
CAV. See constant air volume systems
centrifugal pumps 105
performance of 111
chilled water system, flow and capacity
in, relationship between 52
chilled water temperature
chiller efficiency and 59f
chiller/pump efficiency and 60f
pressure-enthalpy diagram of 59f
reset of 58 239 240
chiller plant
consolidation of 48
chiller sequencing 51 119
chilled water temperature for 54 54f 55 235
control system for 51
cooling load/chilled water temperature for 55 55f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
chiller sequencing (Cont.)
decoupler flow/chilled water
temperature for primary-secondary
systems of 56 57 57f 234 234f
235
strategies for 54
chillers
BAS and 233
basic control system for 233 233f
centrifugal compressors in 28 30f
cooling towers and 136f
efficiency of 17 17f 18f 36 138
141 143
efficiency rating for 28 30 31
ESMs for 14
evaporators in 101
financial benefits of high-efficiency 36
free cooling 73 74f
heat recovery in 102 102f
improving efficiency of 44 58 61
IPLV rating for 31
life-cycle cost of 36
optimum efficiency of 40
part-load curve of 41f
reciprocating compressors in 27 28f
screw compressors in 27 28 29f
scroll compressors in 27 29f
sizing and configuration of 40
system efficiency curves for 52f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
chillers, absorption
heat-recovery system and, arrangement of 67f
use of 67 68
chillers, air-cooled 34
operation of 33
water-cooled chillers v. 33
chillers, water-cooled 33 34
air-cooled chillers v. 33
efficiency of 36
CLTD. See cooling load temperature
difference method
CO
2.
See carbon dioxide
color rendering index (CRI) 185
typical values of 186t
color temperature 184
compact fluorescent lamps 188
halogen lamps 187
incandescent lamps 186
lamps, common 185t
combustion analyzers 11
composite wall, heat transfer through 249f
compressed air systems, ESMs for 15
condensate recovery 95 96 100
condenser subcooling 32 33
pressure-enthalpy diagram for cycle
with 33
condenser tubes
automatic cleaning systems for 64 64f
blow down/cleaning 63
fouling/scaling of 148
scaling/fouling of 62 63 63f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
condenser water
flow rate of 145 146
range 145
treatment of 148
condenser water temperature
chiller efficiency and 62f 144f 145f
pressure-enthalpy diagram showing
effect of 61f
reset of 61 144 145
constant air volume systems (CAV) 169 214 230 237
control arrangement of 237f
cooling load temperature difference
method (CLTD) 256
cooling tower approach 62
cooling tower fans 135 147 148
cycling of 139
lowering speed of 141
power consumption of 143
speed control of 141 142f
switching off 148 149
VSD to control 139 140f 141 143 143t
cooling towers
airflow/capacity relationship in 149f
capacity control of 139
central chiller system and 136f
counterflow 135
crossflow 135 136
efficiency of 142f
ESMs for 14
fill packing material in 135 147 148
forced-draft counterflow 136 136f
forced-draft crossflow 136 137f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
cooling towers (Cont.)
free cooling with 148 149f
induced-draft counterflow 136 137f
induced-draft crossflow 136 138f
installation of 146
optimum operating point of 145
rated capacity of 139
sizing of 138
spacing of 146f
water flow control of 140f
water flow in defective 147f
water spray systems in 135 147 148
CRI. See color rendering index
D
Darcy-Weisbach equation 109
data loggers 11
decoupler pipe 56 57 107 119 234
purpose of 118
demand limiting strategy 229
demand management strategies 220f
DOE-2 256 257
dry-bulb temperature 135 176
E
Eeconomizers 31 32 91 92
air 176
arrangement of 32f 92f
BAS and 242
pressure-enthalpy diagram for cycle
with 32f
waterside 74 74f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
EER. See energy efficiency ratio
efficacy
compact fluorescent lamps 188 194
fluorescent lamps 187
halogen lamps 187
incandescent lamps 194
linear fluorescent lamps 188 195
low pressure sodium lamps 190
mercury vapor lamps 189
metal halide lamps 189
efficacy, luminous 184
lamps and 185t
elevators
control systems in 217
electrical energy consumption
of 216
hydraulic 216
lighting in 217
motor for 216
reducing capacity of 218
traction 216 217
type of drive in 217
types of 216
EMS. See energy management system
energy audits 3
baseline for system performance
during 16
case study for 16
computation of useful parameters for 13
data analysis in 13 14
data collection/logging for 10
end user profile in 7
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
energy audits (Cont.)
interviews in 10
introductory meeting for 9 10
investment grade 9
level one of 4
level three of 9
level two of 4
plotting of data in 13
scope of work in 4
short-listing in 8
tabulation of data in 13
utility bill analysis in 5
energy efficiency ratio (EER) 30
energy management 2 3 221
historical database for 3
objectives of 2
program for 2f
team 2 3
energy management system (EMS) 125 172 220
energy recovery systems 178
arrangement of 179f
arrangement/operation of 178f
energy saving measures (ESM) 3 10
air distribution system 15
air handling units 15
chillers and 14
compressed air systems and 14
cooling towers and 14
lighting and 15
pumps and 14 15
steam/hotwater systems and 15
Energy Services Company (ESCO) 16
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
Energy Star program 224
Environmental Protection Agency (EPA) 201 224
EPA. See Environmental Protection
Agency
equipment standby losses 223 224
ESCO. See Energy Services Company
ESM. See energy saving measures
F
fan(s). See also boiler fans; cooling
tower fans
affinity laws 157 158 158t 163
axial-flow 155 156
BAS and 237 238 239f
centrifugal 155 155f 166
curve 156 156f 157f
discharge 160 160f
efficiency 166 167f
heat from 159
impeller power 156
inlet/outlet conditions 160
performance 155 158
reducing fan speed in 162f 169 171f
VAV, fan energy consumption and 170f
ventilation 238 239f
fan coil units (FCU) 26
FCU. See fan coil units
feedwater pumps 87
BAS and 236
boilers and, multiple 87f 88f
varying speed of 87
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
feedwater tank 100
fuel
acid dew point for 92t
heat content values for 86t
switching 86 87
H
heat
air-to-air recovery of 177
conduction transfer of 246 248 249 250
convection transfer of heat 246 247 248
from fans 159
radiation transfer of 246 247
recovery of sensible 179
recovery of total 179
recovery system for 67 94f 101 102
sensible transfer of 175
solar radiation 250
HID. See lamps, high-intensity
discharge
high-bay lighting 195 196
hydronic heating systems 103
I
ice harvesting systems 70
arrangement of 70f
ice slurry systems 70 71
ice encapsulated systems 70
ice-on-coil systems 70 70f
IGA. See investment grade audits
insulation 249
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
investment grade audits (IGA) 9
K
kW sensors 11
L
lamps
color temperature for common 185t
energy-efficient 194
replacing 193
types of 186
typical efficacy of 185t
lamps, compact fluorescent 194 195
efficacy of 194
in elevators 217
incandescent lamps v. 194t
lamps, fluorescent
color temperature of compact 188
compact 189f
CRI for compact 187
CRI for linear 188
efficacy of 187
efficacy of compact 188
efficacy of linear 188
linear 188
reflectors and 198 199
sizes of 188f
lamps, halogen 187f
color temperature of 187
efficacy of 187
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
lamps, high pressure sodium 190f 195 196
color rendering index of 189
lamps, high-intensity discharge (HID) 189
advantages of 191
lamps, incandescent 186f
color temperature of 186
compact fluorescent lamps v. 194t
CRI of 186
efficacy of 194
lamps, linear fluorescent 198
efficacy of 195
lamps, low pressure sodium 189 191f
efficacy of 190 196
lamps, mercury vapor 190f
efficacy of 189
lamps, metal halide 190f 195 196
efficacy of 189
light pipes 203
light shelves 203 203f
light tubes 203
lighting controls 199
day 201
delamping 192 193
effective use of natural 200f
effective use of task 193f
in elevators 217
energy saving device for 200 200t 201
ESMs for 15
heat added by 183
high-bay 195 196
levels of 191 191t
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
lighting controls (Cont.)
light pipes 203
light sensing for 199 200
light shelves as 203 203f
light tubes as 203 203f
occupancy sensing for 199
outdoor 196
overall efficiency of 192
parameters measured for 12
power density of 192
reducing levels of 192
skylights as 202 202f
timers for 199
use of task 193
load, cooling 16 21f 65
importance of estimating expected 43
load factor 5 219
definition of 7
load shifting 220 221
loads, demand reduction for intermittent 221f
lumens, definition of 183
luminaires 198
of fluorescent lamps 198
luminous flux 183
common light sources and 184t
luminous intensity 184
lux
definition of 184
typical values of 184t
M
mechanical steam traps 97 98
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
motors
core losses of 209
efficiency of 208 209f 210f 211
efficiency v. loading of 211f
losses in 209f
reducing losses in 209
replacing 210 211
rotor resistance loss in 209
stator resistance loss in 209
three phase asynchronous AC 212
N
National Lighting Product Information
Program (NLPIP) 201
natural lighting, effective use of 200f
NLPIP. See National Lighting Product
Information Program
O
OTTV. See overall thermal transfer value
outdoor lighting 196
overall thermal transfer value (OTTV) 255 256
P
peak shaving 219 220
power, electrical 207
apparent 208
maximum demand of 218 218f 229
reactive 208 222
real 208
vector diagram for 208f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
power factor 208 222
bulk correction of 222 223f
correction of 222 223
improving 223f
static correction of 222 222f
power optimizing devices 213 214
power transmission/distribution systems 222
PowerDoe 257
primary chilled water pumps, reducing
capacity of 18 19
pump curve 111f 115
flat/steep characteristics in 110f
flow rate/pressure in 110
impeller size and 116f
pumping systems
closed/open, arrangement of 107f
constant speed 121f
consumption of energy in 114f 115f
control strategy for 125f
cube law of 117
direct return 106 107 107f
flow rate of 108
friction losses in 128
losses for different types of valves in 129
operating point in 131f
pressure head in 108
pressure losses in 128 129
primary-secondary 107 108 108f 118 118f 122f
124f
reducing impeller diameter in 113
reducing speed of 113 126
reverse return 106 108f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
pumping systems (Cont.)
system resistance curve of 109 109f
three-way valves 116 117 117f
throttling valve in 113
two-way valves 116 116f 117
variable flow 116 120 120f 122f 126 240
variable flow set point in, reset of 125 126
variable speed 118
VSD in 117 119 119f 124 126
pumps
affinity laws for 111 112t
classification of 105
control systems for 236 236f 237f
efficiency of 130
end-suction/in-line 106f
ESMs for 14 15
horizontally/vertically-split case 106f
operating point of 113 117 117f
oversized 113f 126
parameters measured for 12
power consumed by 111
sizing 112
pumps, centrifugal 105
performance of 111
pumps, feedwater 87
BAS and 236
boilers and, multiple 87f 88f
varying speed of 87
pumps, primary chilled water, reducing
capacity of 18 19
pumps, secondary chilled water 19 20
operation of 20
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
R
radiation transfer, of heat 246
refrigerant 24
refrigeration 23
capacity of 26
operating principle of 24f
refrigeration cycle, p-h diagram of ideal 126 127f
rotor resistance loss, in motors 209
S
secondary chilled water pumps 19 20
operation of 20
sensible transfer, of heat 175
shading coefficient (SC) 251
SHGC. See solar heat gain coefficient
skylights 202 202f
solar heat gain coefficient (SHGC) 251
stator resistance loss, in motors 209
steam pressure
maintaining set 236
optimizing 85 86
reducing 85
steam traps 96
identifying defective 98
leaks in 98 99 99f
mechanical 97 98
operation of 98
thermodynamic 97 98
thermostatic 97 98
types of 97f
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
steam/hot water systems
ESMs for 15
parameters measured for 12
T
task lighting, effective use of 193f
temperature
approach 137 141 143 233
radiant 175
space 175 237
space, reset of 175 242
temperature, color 184 185
lamps and 185t
temperature, dry-bulb 135 176
temperature, wet-bulb 62 135 137 138 139 141
143
thermal response factor method 256
thermal storage 69 220
capacity of 69
chilled water 69 69f
eutectic salt 69 71
full storage strategy for 72f
ice 69
partial storage strategy for 72f 73
thermostatic steam traps 97 98
transfer function method 256
transformers
arrangement of 214f
coil losses (load losses) of 214 215
core loses (no-load losses) of 214 215 216
dry type 214
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
transformers (Cont.)
eddy current losses in 215
hysteresis losses in 215
liquid filled 214
losses in 214 215f
primary winding 214
secondary winding 214
V
valves
control, and AHU 125
flow, constant 19
pumping systems and 113 116 116f` 117f` 129
vapor compression cycle 24 24f 27
absorption cycle and, difference
between 25
p-h diagram for ideal 58
pressure-enthalpy diagram for 25f
variable air volume systems (VAV) 170 237
arrangement of 171f
BAS and 241 242
control arrangement of 238f
discharge dampers in 170 171
fan energy consumption in 170f
inlet guide vanes in 170
optimization algorithm for 172 173 173f
static pressure sensors in 171
variable frequency drives (VFD). See
variable speed drives
variable speed drives (VSD) 88f 89 114 162 212
configuration of 213f
control circuit in 213
Index Terms Links
This page has been reformatted by Knovel to provide easier navigation.
variable speed drives (VSD) (Cont.)
cooling tower fans controlled with 139 140f 141 143 143t
intermediate circuit in 213
inverter in 213
in pumping systems 117 119 119f 124 126
rectifier in 213
VAV. See variable air volume systems
VFD. See variable frequency drives
VRV. See variable refrigerant volume
systems
VSD. See variable speed drives
W
walls and roofs
heat transfer through 248 248f
texture/color of 249
wet-bulb temperature 62 135 137 138 139 141
143
windows 202
heat flow through 250f
heat transfer through 250
multipaned 253 253f
SC of 251
shading devices for 251 252f
SHGC of 251
special coatings for 251 252 253 253f
U-value of 250 251
visible transmittance of 251
This action might not be possible to undo. Are you sure you want to continue? | https://www.scribd.com/doc/237625153/Building-Energy-Efficiency-excellent-Book | CC-MAIN-2016-07 | refinedweb | 87,615 | 52.6 |
Dumps/Rerunning a job
Fixing a broken dump
Back in the day, the dumps were meant to be generated in an endless loop with no human intervention; if a dump broken you wated another 10 days or so until your project's turn came around again and then there was a new one.
These days folks want the data Right Now, and some dumps take a good long time to run (*cough*wikidata*cough*). If you see a broken or failed dump, this is how you can fix it up.
Rerunning dumps on all wikis:
Really, you can just wait for cron to pick it up; it checks twice a day for aborted runs, unless the job has fallen outside of the run date range. You can check the date range by looking at the cron job entry on any snapshot host for the appropriate entry for fulldumps.sh.
If you're outside the range, just do this:
- be on each appropriate host as root
- start a screen session
su - dumpsgen
bash fulldumps.sh rundate 'today' regular|huge full|partial 28|20
rundateshould be replaced with the day of the month the run started, in DD format. Example: the first monthly run would use '01' to run on the first of the month.
todayshould be replaced with today's day of the month in DD format
regularmeans that everything but enwiki will be dumped, 'enwiki' means only enwiki will be dumped, 'wikidatawiki' means only wikidata will be dumped
fullmeans that page content history will be dumped along with everything else; 'partial' means this will be skipped
28should be used on snapshot hosts dedicated to xml/sql dumps. Don't run the script anywhere else. This number is the maximum number of processes to be dedicated to the run on the host.
Example:
bash fulldumps.sh 01 17 regular full 28
If the worker script encounters more than three failed dumps in a row it will exit; this avoids generation of piles of broken dumps which later would need to be cleaned up. Once the underlying problem is fixed, you can go to the screen session of the host running those wikis and rerun the previous command.
Rerunning a complete dump
If most of the steps failed, or the script failed or died early on, you might as well rerun the entire thing. If the date is within the date range for the cron job for the specific dump type (full = with history, partial = without content history), just wait for the entire dump to be rerun. You can check this by looking at the appropriate entry in the crontab for he dumpsgen user on a snapshot host that runs the wiki types you want (enwiki, wikidatawiki, or regular for all the rest). Have a look at hiera/hosts/snapshotXXX to see which snapshot hosts run which dumps; if the type isn't listed there it's 'regular'.
Otherwise, follow the steps below.
- Be root on any snapshot host.
- start a screen session (these dumps take a while to run).
su - dumpsgen
cd /srv/deployment/dumps/dumps/xmldatadumps
- determine which config file argument the wiki uses: enwiki uses /etc/dumps/confs/wikidump.conf:en, wikidatawiki uses /etc/dumps/confs/wikidump.conf.dumps:wd. "big" wikis (see list here, look for the definition of "$bigwikis") use /etc/dump/confs/wikidump.conf.dumps:bigwikis. The rest use /etc/dumps/confs/wikidump.conf.dumps with no extra parameter.
- Make sure any process dumping the wiki in question has stopped:
python3 dumpadmin.py --kill --wiki <wikiname here> --configfile confs/<config-file-arg here>
- Clean up the lock file left behind if any:
python3 dumpadmin.py --unlock --wiki <wikiname here> --configfile confs/<config-file-arg here>
- Rerun the entire dump. Steps already completed properly will be skipped
- If it's the full run with history, do this:
bash ./worker --date last --skipdone --exclusive --log --configfile <config-file-arg here> --wiki <wikiname-here>
- If it's not the full history, but the abbreviated run, do this:
bash ./worker --date last --skipdone --exclusive --log --configfile <config-file-arg here> --skipjobs metahistorybz2dump,metahistorybz2dumprecombine,metahistory7zdump,metahistory7zdumprecombine --wiki <wikiname-here>
NOTE THAT if a new dump is already running for the project by the time you discover the broken dump,
you can't do this. You should wait for the new dump to complete, and at that time do the above, replacing
--date last with
--date date_of_run where date-of_run is the same as the name of the dump directory, a date in YYYYMMDD format.
Rerunning one piece of a dump
ONLY do this if the dump on the wiki is already running another dump (and hence locked) and you really really have to have that output Right Now.
- As above, you'll need to determine the date, which configuration file argument you need, and which host to run from.
- You don't need to do anything about lockfiles.
- Determine which job (which step) needs to be re-run. Presumably the failed step has been recorded on the web-viewable page for the particular dump () in which case it should be marked as status:failed in the dumpruninfo.txt file in the run directory. Use the job name from that file, and remember that they are listed in reverse order of execution. If you were told by a user or aren't sure which job is the one, see Dumps/Phases of a dump run to figure out the right job(s).
- If there's already a root screen session on the host, use it, otherwise start a new one. Open a window,
su - dumpsgen
cd /srv/deployment/dumps/dumps/xmldatadumps
bash ./worker --job job-name-you-found --date YYYYmmdd --configfile /etc/dumps/conf/wikidump.conf.dumps:XXX --log --wiki name-of-wiki
- The date in the above will be the date in the directory name and on the dump web page for that wiki.
- Example: to rerun the generation of the bzip2 pages meta history file for the enwiki dumps for January 2012 you would run
bash ./worker --job metahistorybz2dump --date 20120104 --configfile /etc/dumps/confs/wikidump.conf.dumps:en --log --wiki enwiki
Rerunning an interrupted en wikipedia history dump
Clean up the underlying issue and wait for cron to pick it up.
If cron does not pick it up because the dump is going too late in the month and would not finish in time before the next run, you can run it by hand as explained above in 'rerunning a complete dump' and the rest will take care of itself. This includes checkpoint files and all the rest. HOWEVER you may be delaying the next dump run. It's your funeral!
Rerunning a dump from a given step onwards
ONLY do this if the output for these jobs is corrupt and needs to be regenerated. Otherwise follow the instructions to rerun a complete dump, which will simply rerun steps with missing output.
Do as described in 'Rerunning one piece of a dump' but add '--cleanup', '--exclusive', and '--restart' args before the wikiname.
You must not do this while a dump run for the wiki is in progress.
Rerunning a step without using the python scripts
ONLY FOR DEBUGGING.
Sometimes you may want to rerun a step using mysql or the MediaWiki maintenance scripts directly, especially if the particular step causes problems more than once.
In order to see what job was run by the worker.py script, you can either look at the log (dumplog.txt) or you can run the step from worker.py giving the "dryrun" option, which tells it "don't actually do this, write to stderr the commands that would be run".
- Determine which host the wiki is dumped from, which configuration file is used, the date of the dump and the job name, as described in the section above about rerunning one piece of a dump.
- Give the appropriate worker.py command, as in that same section, adding the option "--dryrun" before the name of the wiki.
Examples
First be root on a snapshot host that has some spare cpu cycles.
su - dumpsgen
cd /srv/deployment/dumps/dumps/xmldumps-backup
- To see how the category table gets dumped, type:
python3 ./worker.py --date 20190401 --job categorytable --configfile /etc/dumps/confs/wikidump.conf.dumps --dryrun elwiktionary
- to get the output
Command to run: /usr/bin/mysqldump -h 10.64.48.35 -u XXX -pXXX --max_allowed_packet=32M --opt --quick --skip-add-locks --skip-lock-tables elwiktionary category | /bin/gzip > /mnt/dumpsdata/xmldatadumps/public/elwiktionary/20190401/elwiktionary-20190401-category.sql.gz.inprog
- To see how the stub xml files get dumped, type:
python3 ./worker.py --date 20190401 --job xmlstubsdump --configfile /etc/dumps/confs/wikidump.conf.dumps --dryrun elwiktionary
- to get the output
Command to run: --filter=namespace:!NS_USER
- As you see from the above, all three stub files are written at the same time.
- The xmlstubs.py script calls a Mediawiki maintenance script. To see how that is called, FOR DEBUGGING/TESTS ONLY, type:
--dryrun
- to get the output-footer --start=1 --end=1-header --start=1 --skip-footer --end 5001
- and so on. if you are doing your own tests you can change the page range and adjust inclusion of Mediawiki xml headers and footers at will.
- To see how the full history xml bzipped file is dumped, type:
python3 ./worker.py --date 20190401 --job metahistorybz2dump --configfile /etc/dumps/confs/wikidump.conf.dumps --dryrun elwiktionary
- to get the output
Command to run: /data/xmldatadumps/public/elwiktionary/20190401/elwiktionary-20190301-pages-meta-history.xml.7
- Note that if the xml stubs job has not run for the date you specify, the script will refuse to run the meta history dumps, even in dryrun mode, and it will tell you so.
- Don't be surprised if you see that it would prefetch from a file more recent than the dump you are fixing up. If the more recent dump is marked as successful, the script will try to do just that, which may be unexpected behaviour but should give you good output... unless you suspect the more recent dump of having bad data. In that case you should see the sections about prefetch below.
General notes about the above commands:
- On a large wiki, you will specify --configfile /etc/dumps/confs/wikidump.conf.dumps:bigwikis (or perhaps en or wd) and jobs except tables will have several processes running at once, with numbered output files.
- Output is written into file(s) with the extension '.inprog', and rsync will skip these so they don't show up on our web server, for example.
- Output of some files goes into files in a temporary directory; this is true of stubs files which, in spite of the inner extension '.gz' are plain text. They are fed to gzip as they are created, and that file is written into the final output directory. When you do testing you may specfy gzip:/path/to/file.gz instead of file:/path/to/temp/file.
- Tests/deugging should never write to the public directory. Generate files in e.g. /mnt/dumpsdata/temp/dumpsgen/some-subdir and clean up or move them into place when you are done. If you have to, take a copy of the config file, and modify it to use a different output directory.
Generating new dumps
When new wikis are enabled on the site, they are added to all.dblist which is checked by the dump scripts. They get dumped as soon as a worker completes a run already in progress, so you don't have to do anything special for them.
Text revision files
A few notes about the generation of the files containing the text revisions of each page.
Stub files as prequisite
You need to have the "stub" XML files generated first. These get done much faster than the text dumps. For example, to generate the stubs files for en wikipedia without doing multiple pieces at a time, took less than a day in early 2010 but to generate the full hiistory file without parallel runs took over a month and today would take much longer.
While you can specify a range of pages to the script that generates the stubs, there is no such option for generating the revision text files. The revision ids in the stub file used as input determine which revisions are written as output.
Prefetch from previous dumps
In order to save time and wear and tear on the database servers, old data is reused to the extent possible; the production scripts run with a "prefetch" option which reads revision texts from a previous dump and, if they pass a basic sanity check, writes them out instead of polling the database for them. Thus, only new or restored revisions in the database should be requested by the script.
Using a different prefetch file for revision texts
Sometimes the file used for prefetch may be broken or the XML parser may balk at it for whatever reason. You can deal with this in two ways.
- You could mark the file as bad, by going into the dump directory for the date the prefetch file was generated and editing the file dumpruninfo.txt, changing "status:done;" to "status;bad" for the dump job (one of articlesdump, metacurrentdump or metahistorybz2dump), and rerun the step usin the python script worker.py.
- You could run the step by hand without the python script, (see the section above on how to do that), specifying prefetch from another earlier file or set of files. Example: to regenerate the ekwiktionary history file from 20190401 with a prefetch from the 20190201 output instead of the 20190301 files,/dumpsdata/xmldatadumps/public/elwiktionary/20190201/elwiktionary-20190201-pages-meta-history.xml.7z --report=1000 --spawn=/usr/bin/php --output=bzip2:/mnt/dumpsdata/xmldatadumps/public/elwiktionary/20190401/elwiktionary-20190401-pages-meta-history.xml.bz2.inprog --full
- Don't forget to move the output file into place (/mnt/dumpsdata/xmldatadumps/public/elwiktionary/20190401/elwiktionary-20190401-pages-meta-history.xml.bz2) when it's complete.
We don't keep many old dump runs on the dumpsdata hosts (which provide the filesystem mounted at /mnt/dumpsdata), so you can't go back more than two months for prefetch files. In a pinch you could grab older ones off the web server via rsync and put them in a temporary directory on the dumpsdata host; then adjust the path to the file in the prefetch argument to the script.
Skipping prefetch for revision texts
Sometimes you may not trust the contents of the previous dumps or you may not have them at all. In this case you can run without prefetch but it is much slower so avoid this if possible for larger wikis. In this case you can do one of the following:
- run the worker.py script with the option --noprefetch
- run the step by hand without the python script, (see the section above on how to do that), removing the prefetch option from the command. Example: to regenerate the ekwiktionary history file from 20120109 without prefetch, you would | https://wikitech.wikimedia.org/wiki/Dumps/Rerunning_a_job | CC-MAIN-2022-33 | refinedweb | 2,511 | 61.56 |
I am trying to understand Scala futures coming from Java background: I understand you can write:
val f = Future { ... }
scheduledFuture
The
Future { ... } block is syntactic sugar for a call to
Future.apply (as I'm sure you know Maciej), passing in the block of code as the first argument.
Looking at the docs for this method, you can see that it takes an implicit
ExecutionContext - and it is this context which determines how it will be executed. Thus to answer your second question, the future will be executed by whichever ExecutionContext is in the implicit scope (and of course if this is ambiguous, it's a compile-time error).
In many case this will be the one from
import ExecutionContext.Implicits.global, which can be tweaked by system properties but by default uses a
ThreadPoolExecutor with one thread per processor core.
The scheduling however is a different matter. For some use-cases you could provide your own
ExecutionContext which always applied the same delay before execution. But if you want the delay to be controllable from the call site, then of course you can't use
Future.apply as there are no parameters to communicate how this should be scheduled. I would suggest submitting tasks directly to a scheduled executor in this case. | https://codedump.io/share/ZRkXzwwSP3m7/1/scala---futures-and-concurrency | CC-MAIN-2016-44 | refinedweb | 213 | 55.54 |
Hope you kind folk can spare a bit of advice. I'm trying to find a clever way to modifying a part of an image without replacing the image completely. For instance, let's say I have an image of a car and I would like to show the tire is flat. Instead of replacing the image completely with another, I would like to layer a new image of a flat tire image on top of current tire image. Eventually I would like to extend this to show multiple stats of the car, flat tires, ajar doors, headlight burnt out, etc etc. Since each of these stats can occur independently, just replacing one entire image for each combination of stats is crazy inefficient.
I've been using a bit of code that layers a bitmap (with a transparent background) on top another. What I'm not sure about is how to modify the layered images. Let's say I have 5 smaller images layered on top of the large car image, is there a way I can change the bitmap of one of the layered images in real time and delete those I no longer wish to display?
In the below code, I draw the "low_tire.png" image on top the "car.png". Then when the button is clicked I would like the "low_tire.png" to be changed with the "flat_tire.png" image. How would I accomplish this? And how would I delete the layered image completely?
Here's my code thus far:
import wx class Frame1(wx.Frame): def __init__(self, prnt): wx.Frame.__init__(self, id=-1, name='', parent=prnt, pos=wx.Point(0, 0), size=wx.Size(600, 600), style=wx.DEFAULT_FRAME_STYLE, title='Frame1') self.panel1 = BmpPanel(self) self.Show() class BmpPanel(wx.Panel): def __init__(self, parent, id = -1): wx.Panel.__init__(self, parent, id) self.Bind(wx.EVT_PAINT, self.OnPaint) self.button = wx.Button(self, id, 'click to change layered image') self.Bind(wx.EVT_BUTTON, self.modTheImage, id=self.button.GetId()) self.BackBmp = wx.Bitmap('car.png') self.FrontBmp = wx.Bitmap('low_tire.png') self.hiBmp = wx.Bitmap('door_ajar.png') def OnPaint(self, event): self.dc = wx.PaintDC(self) self.Update() def Update(self): self.dc.DrawBitmap(self.BackBmp, 96, 72, True) self.dc.DrawBitmap(self.FrontBmp, 150, 110, True) def modTheImage(self, event): self.FrontBmp = wx.Bitmap('flat_tire.png') # ATTEMPT TO CHANCE IMAGE FILE (DOES NOT WORK) #self.Update #self.Refresh() # USING THIS SEEMS TO CRASH THE APPLICATION App = wx.PySimpleApp() application = Frame1(None) application.Show() App.MainLoop()
Thanks all! | https://www.daniweb.com/programming/software-development/threads/329028/trying-to-modify-part-of-image-by-layering-bitmaps | CC-MAIN-2017-17 | refinedweb | 425 | 61.43 |
I thought to make an animated population pyramid of the Canadian population, Colab Link
I got as far as making a working animation for just the males using this code:
# Working animated pyramid for males only import plotly.express as px fig = px.bar(males, x="Males", y="Age group", # color="Males", animation_frame="REF_DATE") fig.show()
When I tried to modify it to include the female data, it ended up plotting all the female data across all the years:
import plotly.express as px fig = px.bar(males, x="Males", y="Age group", # color="Males", animation_frame="REF_DATE") fig.add_trace(gp.Bar(y= y_age, x = females.Females * -1, name = 'Female', orientation = 'h')) fig.show()
I consulted this plotly community post which seems to be talking about the same issue:
But try as I might, I couldn’t figure out how to make my code conducive to it. Appreciate any help | https://community.plotly.com/t/animated-chart-over-time-plotting-second-axis-not-segregating-over-time/63701 | CC-MAIN-2022-21 | refinedweb | 149 | 50.12 |
Matplotlib Tutorial - Introduction and Installation
Matplotlib is the most widely used Python module to plot graphs. It could produce publication-ready figures easily and be used in different platforms.
pyplot module of Matplotlib has a MATLAB-like interface, therefore it is easier to use
pyplot if you are already user of MATLAB.
Install Matplotlib
Windows
-
pip
pip install matplotlib
This
pip command also installs the Matplotlib dependencies automatically.
- Install Wheel File
You could also download the unofficial pre-built 32 or 64-bit Windows Matplotlib wheel file of Python 2.7 or Python 3.4+ version from the famous site of Unofficial Windows Binaries for Python Extension Packages.
After the wheel file is downloaded, use the command below to install the wheel file.
pip install matplot_wheel_file_path
Refer to the wheel file installation guide here.
Linux
Open the Linux terminal and use the command below according to the Python version in your system.
Python 2.7
sudo apt-get install python-matplotlib
Python 3.4+
sudo apt-get instlal python3-matplotlib
Matplotlib Hello World
Now we will take the first bite of Matplotlib.
from matplotlib import pyplot as plt plt.plot([1,2,3], [4,5,6]) plt.show()
This example plots the graph of a straigt line that has the 2-D data -
[1,2,3],[4,5,6].
from matplotlib import pyplot as plt
As we mentioned above,
pyplot is a MATLAB-like plotting module.
plt.plot([1,2,3], [4,5,6])
It plots the
x and
y using default line and color style because no extra argument is passed here.
plt.show()
It displays the figure. The plotting figure will not be shown before this line is executed.
| https://www.delftstack.com/tutorial/matplotlib/introduction-and-installation/ | CC-MAIN-2021-43 | refinedweb | 281 | 58.18 |
Derek Denny-Brown, the dev lead for both MSXML & System.Xml, who's been involved with XML before it even had a name has finally started a blog. Derek's first XML-related post is Where XML goes astray... which points out three features of XML that turn out to have caused significant problems for users and implementers of XML technologies. He writes
First, some background: XML was originally designed as an evolution of SGML, a simplification that mostly matched a lot of then existing common usage patterns. Most of its creators saw XML and evolving and expanding the role of SGML, namely text markup. XML was primarily intended to support taking a stream of text intended to be interpreted as a human readable document, and delineate portions according to some role. This sequence of characters is a paragraph. That sequence should be displayed with a link to some other information. Et cetera, et cetera. Much of the process in defining XML based on the assumption that the text in an XML document would eventually be exposed for human consumption. You can see this in the rules for what characters are allowed in XML content, what are valid characters in Names, and even in "</tagname>" being required rather than just "</>".
...
Allowed Characters
The logic went something like this: XML is all about marking up text documents, so the characters in an XML document should conform to what Unicode says are reasonable for a text document. That rules out most control characters, and means that surrogate pairs should be checked. All sounds good until you see some of the consequences. For example, most databases allow any character in a text column. What happens when you publish your database as XML? What do you do about values that include characters which are control characters that the XML specification disallowed? XML did not provide any escaping mechanism, and if you ask many XML experts they will tell you to base64 encode your data if it may include invalid characters. It gets worse.
The characters allowed in an XML name are far more limited. Basically, when designing XML, they allowed everything that Unicode (as defined then) considered a ‘letter’ or a ‘number’. Only 2 problems with that: (1) It turns out many characters common in Asian texts were left out of that category by the then-current Unicode specification. (2) The list of characters is sparse and random, making implementation slow and error prone.
...
Whitespace
When we were first coding up MSXML, whitespace was one of our perpetual nightmares. In hand-authored XML documents (the most common form of documents back then), there tended to be a great deal of whitespace. Humans have a hard time reading XML if everything is jammed on one line. We like a tag per line and indenting. All those extra characters, just there so that our feeble minds could make sense of this awkward jumble of characters, ended up contributing significantly to our memory footprint, and caused many problems to our users. Consider this example:
<customer>
<name>Joe Schmoe</name>
<addr>123 Seattle Ave</addr>
</customer>
A customer coming to XML from a database back ground would normally expect that the first child of the <customer> element would be the <name> element. I can’t explain how many times I had to explain that it was actually a text node with the value newline+tab.
...
XML Namespaces
Namespaces is still, years after its release, a source of problems and disagreement. The XML Namespaces specification is simple and gets the job done with minimum fuss. The problem?.
Then there is the issue of the 'default namespace’. I still see regular emails from people confused about why their XPath doesn’t work because of namespace issues. Namespaces is possibly the single largest obstacle for people new to XML.
My experiences as the program manager for the majority of the XML programming model in the .NET Framework agree with this list. The above list hits the 3 most common areas people seem to have problems with working with XML in the .NET Framework. His blog post makes a nice companion piece to my The XML Litmus Test: Understanding When and Why to Use XML article on MSDN.
Argh, I never agree with the namespaces one. I just don’t get why people have such a hard time with them. I think part of it is that people love just having to work with well-formed documents or one’s that only have a single schema. Unfortunately in all but the simplest real world scenarios, that approach just doesn’t work.
Yes: "I can’t explain how many times I had to explain that it was actually a text node with the value newline+tab." Sadly, the author just explained this again—to me!
There is the implication here that XML is more friendly toward human-reading but, coming from a background in typography, I have to say that I had a problem with translating my use of HTML 4.x entities (e.g. é) into XHTML.
I am actually storing huge blocks of HTML 4.x prose in text-type fields in SQL Server. In order to "upgrade" to XHTML I have to translate all of this markup into well formed XML and change named entities back into glyphs.
Most web sites don’t show concern for displaying “smart quotes” and em dashes but mine do! So just for the sake of XML I have get rid of all of these entities and hope that the web browsers out there can translate glyphs like Æ, Ê, or ¡ correctly.
PingBack from | https://blogs.msdn.microsoft.com/dareobasanjo/2004/10/17/hindsight-is-2020-three-things-xml-got-wrong/ | CC-MAIN-2017-43 | refinedweb | 939 | 71.24 |
Thank you. I managed to add the date by adding a "date-edit" metadata in the post, and adding this part in the template :
Advertising
% if post.meta('date-edit'): <p class="dateline" itemprop="datedit">Édité : ${post.meta('date-edit')}</p> % endif But I don't get how to get it formatted, would you know how to do it ? Le mardi 6 mars 2018 13:47:21 UTC+1, Roberto Alsina a écrit : > > Don't worry it's pretty easy. > > If you are using the default theme, just run this: > > nikola theme -c post_header.tmpl > > That will tell you something like this: > > Copied template from bla/bla/bla/templates/post_header.tmpl to > templates/post_header.tmpl > > Then you edit templates/post_header.tmpl > > You will see a part that looks like this: > > <%def > > In there is the HTML fragment that shows the post metadata. It's a bit > messy but it should be understandable. Add your metadata in there. Dates > are specially tricky since we try to be smart about formatting them, but we > can try to figure something out. > > On Tue, Mar 6, 2018 at 9:36 AM asmoth <asmo...@gmail.com <javascript:>> > wrote: > >> Thank you for your answer. I didn't look at how templates work yet, I'll >> try :) Anyway that's a shame there is no way to do it automatically. >> >> >> Le mardi 6 mars 2018 13:21:45 UTC+1, Roberto Alsina a écrit : >> >>> You can add it as metadata in the post and then change the templates to >>> show it. >>> >>> El mar., 6 de mar. de 2018 9:17 AM, asmoth <asmo...@gmail.com> escribió: >>> >> Hey everyone, I discovered Nikola yesterday and thought I might be using >>>> it for a blog, it looks great. >>>> As I was exploring the configuration options and doing some tests, I >>>> was wondering if there was a way to show an edit date. You can display the >>>> creation date of course, and edit it later, but that's not exactly what I >>>> want. So do you know if there a way to keep the original creation date, >>>> *and >>>> *show that the post has later been edited and when ? >>>> >>>> Thanks! >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "nikola-discuss" group. >>>> >>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to nikola-discus...@googlegroups.com. >>> >>> >>>> For more options, visit. >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "nikola-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to nikola-discus...@googlegroups.com <javascript:>. >> For more options, visit. >> > --. | https://www.mail-archive.com/nikola-discuss@googlegroups.com/msg00484.html | CC-MAIN-2018-13 | refinedweb | 435 | 74.39 |
Objective
This article will give a basic introduction of Dynamic Object in c# 4.0
DynamicObject class
- This provides a base class for specifying dynamic behavior at run time.
- This class must be inherited to use.
- This class cannot be instantiated.
- This class is inside namespace System.Dynamic
- This class implements IDynamicMetaObjectProvider
- This class enables to define which operation can be performed at the run time.
- This class enables to decide how to perform operations on dynamic objects.
- Own member can be added to class inherited from DynamicObject.
Override TryInvokeMember Method
- It provides the implementation for operations that invoke members.
- Class derived from DynamicObject class can override this method to specify dynamic behavior for operation such as calling a method.
This method is defined as below,
There are three arguments for this method
Binder
- This argument provides information about dynamic operation.
- binder.Name provides the name of the member on which dynamic operation is performed.
- Type of this argument is InvokeMemberBinder.
Let us say, myDynamicObject is name of the instance and myDynamicMethod is name of the dynamic method in class inherited from DynamicObject. If you are calling
myDynamicObject. myDynamicMethod then in that case binder.Name = myDynamicMethod
Args
This parameter defines the arguments pass as the input to the method of dynamic class. Let us say myDynamicMethod takes two input parameters int x and string y. so Args parameter will define these two input parameters of the method in dynamic class.
Type: array of System.Object []
Result
This is result of the system invocation.
If result = true then operation is successful.
If result=false then, then runtime binder of language determine the behavior. In most cases it will throw run time exception.
Note: If you override the TryInvokeMember method, the dynamic dispatch system first attempts to determine whatever specified method exists in the class. If it does not find the method , it uses the TryInvokeMember implementation.
Sample
- Open Visual Studio 2010 and create a new console application.
- Add a class. Give name. I am giving name here as MyDynamicClass
- Inherit the class from DynamicObject
- Overriding TryInvokeMember method.
MyDynamicClass.cs
If you see the above class, we are overriding TryInvokeMember. We are checking if method name called is MyMethod or not?
Using the MyDynamicClass
Output
5 thoughts on “Working with Dynamic Object in c# 4.0 Part #1”
Superb tutorial……….Waiting for new posts
dhana it very nice….
nice post sir, | https://debugmode.net/2010/02/15/working-with-dynamic-object-in-c-4-0-part-1/ | CC-MAIN-2022-05 | refinedweb | 399 | 51.75 |
The React useEffect Hook helps you manage side-effects in functional React components. It also makes this task much easier than it used to be. In this tutorial you will learn about what useEffect hook is and how it works. You will also learn how to use it in your React applications.
Introduction to React useEffect hook
If you are familiar with React class components you know there are lifecycle methods available to use. You can use these methods to execute code at a specific moment you need. You can execute your code only when on component's initial render. You can also execute it on very re-render of the component, or if only some data change.
These lifecycle methods, along with other features of class components, don't work with functions. These methods don't exist in their scope or environment. React hooks made it possible to bring many of these features from classes to functional components so you can use them here as well.
The React useEffect hook is a hook that brings the functionality of lifecycle methods to functional components. To make this easier, you can think about the useEffect hook as
componentDidMount,
componentDidUpdate and
componentWillUnmount lifecycle methods in one package.
That said, there are some differences between useEffect hook and lifecycle method. One difference is that useEffect hook runs after render. It runs after the first render, and also after every next update. It doesn't run before it. This makes it easy to execute any code right after a component is rendered.
Another difference is that, by default, useEffect hook runs after every render. Fortunately, there is a way to prevent this behavior. When you use the useEffect hook, there is an option you can use to say when you want the useEffect hook to run. The hook will than run only under correct conditions and ignore others.
Another useful feature of useEffect hook is that it can also clean up after itself. This cleanup happens automatically before the hook is executed again. One example when cleanup can be handy is removing attached event listeners when you "change" page in your React application.
A word on side-effects
The name useEffect is based on the idea of side-effects. Put simply, side-effects are changes made by a function to anything other than inputs provided to that function. This usually means changes made to the outside world. Some examples of side-effects can be fetch requests and direct manipulation with DOM.
Another example can be using timer functions like
setTimeout() and
setTimeout(). One problem can be synchronizing the rendering of a component with side-effect you want to make. These two things happen independently and component rendering is outside of your control. This is one thing the React useEffect hook is trying solve.
The useEffect hook allows you to extract side-effects into a function that is provided and managed by React itself. All you have to do is to say what is the side-effect you want and when it should be executed. React will take care of the rest. This function provided and managed by React is the useEffect hook.
The syntax
The useEffect hook accepts two arguments. The first argument is a callback function. This callback function contains the code you want to execute. This is the side-effect you want to make. The useEffect hook executes this callback function after the component is rendered. The second argument is for array of dependencies.
This argument is optional. Whether you use it or not will depend on when you want the useEffect hook to execute the callback function. Above, I mentioned that there is an option to specify when the useEffect hook should run. This array of dependencies is this option. By working with it you change how the useEffect hook behaves.
// Syntax of useEffect hook: useEffect(callback, [dependencies]); // Simple example: // Import useEffect hook from React: import { useEffect } from 'react' function App() { // Use useEffect hook: useEffect(() => { // Execute some code. }, []) // ... }
Dependencies and when useEffect runs
The dependencies array is an optional argument. Nonetheless, it is a very powerful feature. By providing different values, or omitting it, you can fundamentally change when the useEffect hook will run. Dependencies give you three options for when the useEffect hook should run.
No.1: Run after every render
THe first option is to run the useEffect hook after every render of your component. For this, omit the dependencies array and provide only the callback function. From now, every time React renders your component, it will also run the useEffect hook and execute the code inside it.
// Import useEffect hook from React: import { useEffect } from 'react' function App() { // Use useEffect hook: useEffect(() => { // Run something after every render. }) // <= Omit the dependencies argument. }
No.2: Run after initial render
Another option is to run the useEffect hook only once, after the initial render. This is the very first render of the component. From now, if React re-renders the component, the useEffect hook will not run again.
// Import useEffect hook from React: import { useEffect } from 'react' function App() { // Use useEffect hook: useEffect(() => { // Run something only after initial render. }, []) // <= Pass [] as dependencies argument. }
No.3: Run when specific value changes
The third and last option is to watch specific value and run the useEffect hook when this value changes. This value can be almost anything. It can be all component props or just one specific prop. It can be some variable. It can also be a state created with useState hook.
When you know what value you want to watch, you pass that value into the dependencies array. What if you want to watch more than one value? No problem. You can pass as many values to the dependencies array as you want. Then, when just one of these values changes, the useEffect hook will run.
// Import useEffect and useState hooks from React: import { useEffect, useState } from 'react' function App(props) { // Create states: const [name, setName] = useState('') const [age, setAge] = useState(0) // Use useEffect hook: useEffect(() => { // Run something only when props.isLoading prop, // name state or age state change. }, [props.isLoading, name, age]) // <= Pass props.isLoading, name, age as dependencies argument. }
Simple useEffect and fetch example
In the beginning, when we talked about side effects, I mentioned fetch requests. Fetching data is one thing that is done frequently. It is also one example where useEffect hook can be very handy. Let's create a simple component that will use the React useEffect hook to perform a simple fetching.
We will use an async function to fetch Reddit posts from specific reddit. Then, we will extract some information from received data and store them in its state. When all this is done and the data are ready, we will render all posts with authors in a simple list. Below is one example of how to do this.
In this example, we will fetch the posts only on initial render. In a real app, you could add some value to dependencies array that you want to watch. For example, you could provide a way to change reddit from which to fetch posts. Then, you could watch for this and run the useEffect to fetch new posts, with modified URL to fetch.
// Import useEffect and useState hooks from React: import { useEffect, useState } from 'react' export default function App() { // Create state for Reddit feed: const [feed, setFeed] = useState([]) // Use useEffect hook: useEffect(() => { // Create async function to fetch Reactjs posts from Reddit: async function fetchRedditFeed() { // Make a request to fetch Reactjs posts from Reddit: const redditResponse = await fetch('') // Check if data are available (response code is 200-299): if (redditResponse.ok) { // Translate received response (promise) to JSON: const redditJSON = await redditResponse.json() // Extract title, author and post id: const posts = redditJSON.data.children.map(post => { return { title: post.data.title, author: post.data.author, id: post.data.id } }) // Save posts to feed state: setFeed(posts) } } // Invoke the fetchRedditFeed function: fetchRedditFeed() }, []) // <= Run only on initial render. // Render a list of posts return ( <div className="App"> <ul> {feed.map(feedItem => { return <li key={feedItem.id}>{feedItem.title} by {feedItem.author}</li> })} </ul> </div> ) }
Note 1: You don't have to put the whole fetching function to useEffect hook. You can just as well put it outside it, and then only call it from the useEffect hook.
Note 2: You can't use promises and async with useEffect hook directly (
(async () => ...)). This is not supported and React will warn you if you try it. The reason is that useEffect callbacks are synchronous to prevent race conditions. If you want to make an async call inside the useEffect hook you still can.
What you can do is to use the async function inside the useEffect hook and call it. This is why we created another function, now async, inside the useEffect hook callback function and used it to make the fetch request. So, remember that the useEffect callback itself must be always synchronous ... but the content doesn't.
Cleaning up side-effects
One interesting feature of the useEffect hook is automatic cleanup. This cleanup allows you to execute code right before the next useEffect run or before the component unmounts. Some scenarios where this can be useful are removing attached event listeners, clearing timers and closing external subscriptions and connections.
This cleanup is specified by a function and this function must be returned from the useEffect hook. This function can be a regular function, arrow function, and/or unnamed function. The only thing that is important is that it must be returned from the hook. Inside this function is a code you want to execute during the cleanup.
// Syntax: function App(props) { // Use useEffect hook: useEffect(() => { // Do something on every render // Specify returned cleanup function: return function() { // Do something during cleanup procedure. // Clean up will happen before next run // of this hook and before component unmounts. } }) // <= Run on every render. } // Example with event listener: // Import useEffect hook from React: import { useEffect } from 'react' export default function App() { // Use useEffect hook: useEffect(() => { // Create function to invoke when window resizes: function handleResize() { // Log message when window is resized: console.log('Resize! New width is: ', window.innerWidth) } // Attach event listener for "resize" event to window: window.addEventListener('resize', handleResize) // Add cleanup function: return function() { // Remove event listener from window // when component unmounts: window.removeEventListener(handleResize) } }, []) // <= Run only on initial render // ... }
One is not necessarily better
If you are coming from class components you might be used to having just one lifecycle method and one state. This approach is not necessary when it comes to React hooks and functional component. There is no rule saying that you have to use every hook only once. In fact, the opposite might be better.
It is often better to use the same hook multiple times. Having multiple smaller states can help you make application state easier to work with. The same applies to useEffect hook. If you need to create multiple side-effects, don't be afraid of using multiple useEffect hooks.
Using multiple useEffect to manage multiple side-effect can make your code more manageable, easier to read and work with.
// Import useEffect and useState hooks from React: import { useEffect, useState } from 'react' function App(props) { // Create few states: const [firstName, setFirstName] = useState('') const [lastName, setLastName] = useState('') const [age, setAge] = useState(0) const [email, setEmail] = useState(0) // Use few useEffect hooks to manage multiple side-effects: useEffect(() => { // Run something only on initial render. }, []) // <= Pass [] as dependencies argument. useEffect(() => { // Run something only when firstName and lastName change. }, [firstName, lastName]) // <= Pass firstName and lastName as dependencies argument. useEffect(() => { // Run something only when age changes. }, [age]) // <= Pass age as dependencies argument. useEffect(() => { // Run something only when email changes. }, [email]) // <= Pass email as dependencies argument. }
Conclusion: React useEffect Hook Made Simple
The React useEffect hook provides a friendly way to work with side-effects in your React components. It also makes it easier to manage these side-effects and keep them synchronized with the component itself. I hope that this tutorial helped you understand what useEffect hook is, how it works and how to use it.
Discussion (2)
Nice summary of useEffect hook. Cleared some of my confusions. Thanks a lot.
Especially for the fetch example, be sure to use an AbortController for cleanup. Otherwise, a nice summary how this works. | https://practicaldev-herokuapp-com.global.ssl.fastly.net/alexdevero/react-useeffect-hook-made-simple-50ha | CC-MAIN-2021-25 | refinedweb | 2,051 | 57.87 |
Subscriber portal
Older versions of the class hierarchy documentation included both base classes and descendants. This version only shows the base. I really, really miss being able to inspect the children. Among other things, it was really useful for building a mental model
of how the class hierarchy works (which we're all doing right now). For example, which UI layout widgets descend from the Panel, as opposed to directly from FrameworkElement? That's useful to know, because Panel provides a lot of core funtionality.
The object browser is obviously pulling the same metadata, so the info isn't there either, and class diagrams aren't included in the consumer preview, namespaces tell you nothing about inheritance, so the only way to figure this stuff out is by making guesses
and poking around the class library documentation. I'd like those hours of my life back, please....
Rebecca M. Riordan
Hi Rebecca,
thanks for the excellent feedback. I have created a content request to MSDN product group to add child inheritance/descendants for metro classes/controls. I have used your panel example versus the .NET Framework version. Hopefully,
we can get that in there soon. I will let you know the status of the request.
much appreciated,
Mike Wong
Microsoft Developer Support
Thanks!
If it's useful, a more compelling example might be ISemanticZoomInfo. Without being able to search for elements that implement that interface, the only way to determine which elements can be the direct children of a SemanticZoom control is to stick
them in there and see if they work...I'd rather clean the oven, I think :) | https://social.msdn.microsoft.com/Forums/en-US/4c13e3e8-e43d-499f-bde2-d16fb9127278/child-documentation?forum=toolsforwinapps | CC-MAIN-2018-30 | refinedweb | 270 | 56.86 |
PerlIO::via::ToFirePHP - log to FirePHP via an PerlIO layer
version 1.100860
use PerlIO::via::ToFirePHP; my $fire_php = FirePHP::Dispatcher->new(HTTP::Headers->new); open my $fh, '>:via(ToFirePHP)', $fire_php; # Everything you print on the filehandle will be sent to FirePHP
This PerlIO layer sends everything it receives to FirePHP. When constructing a filehandle using this layer using
open(), you need to pass an object of type FirePHP::Dispatcher that has been initialized with a HTTP::Headers object.
A typical use of this PerlIO layer is to send DBI trace output to FirePHP:
use PerlIO::via::ToFirePHP; my $dbh = DBI->connect(...); open my $fh, '>:via(ToFirePHP)', FirePHP::Dispatcher->new($http_headers_object); $dbh->trace(2, $fh);
Now the trace output of all calls to that database handle will be sent to FirePHP.
The PerlIO layer is implemented in
PerlIO::via::ToFirePHP instead of just
PerlIO::via::FirePHP because of a bug in
PerlIO::via in perl 5.10.0 and earlier versions. If we used just
PerlIO::via::FirePHP, we would not be able to use the shorthand layer notation of
open my $fh, ':via(FirePHP), $fire_php>.
PerlIO::via would look for a
PUSHED method in package
FirePHP. There is no such method, but because
FirePHP::Dispatcher has been loaded, the namespace
FirePHP has been autovivified. So
PerlIO::via would stop looking. This bug seems to be fixed in perl 5.10.1.
Called by PerlIO::via - read its documentation for details.
Called by PerlIO::via - read its documentation for details.
Called by PerlIO::via - read its documentation for details.
WRITE() accumulates input until a newline is seen, only then will it remove the newline and send the accumulated input to the FirePHP::Dispatcher object. The motivation for this was that DBI's
trace() method reports trace output in chunks, not necessarily whole lines.
Called by PerlIO::via - read its documentation for details.
The
get_fire_php_fh() method it places in HTTP::Engine::Response returns a filehandle constructed with PerlIO::via::ToFirePHP.
See this module for how to implement PerlIO layers in Perl.. | http://search.cpan.org/dist/PerlIO-via-ToFirePHP/lib/PerlIO/via/ToFirePHP.pm | CC-MAIN-2016-50 | refinedweb | 340 | 56.55 |
Time
Clone the code or follow along in the online editor.
Now we are going to make a digital clock. (Analog will be an exercise!)
So far we have focused on commands. With the HTTP and randomness examples, we commanded Elm to do specific work immediately, but that is sort of a weird pattern for a clock. We always want to know the current time. This is where subscriptions come in!
After you read through the code, we will talk about how we are using the
elm/time package here:
import Browser import Html exposing (..) import Task import Time -- MAIN main = Browser.element { init = init , view = view , update = update , subscriptions = subscriptions } -- MODEL type alias Model = { zone : Time.Zone , time : Time.Posix } init : () -> (Model, Cmd Msg) init _ = ( Model Time.utc (Time.millisToPosix 0) , Task.perform AdjustTimeZone Time.here ) -- UPDATE type Msg = Tick Time.Posix | AdjustTimeZone Time.Zone update : Msg -> Model -> (Model, Cmd Msg) update msg model = case msg of Tick newTime -> ( { model | time = newTime } , Cmd.none ) AdjustTimeZone newZone -> ( { model | zone = newZone } , Cmd.none ) -- SUBSCRIPTIONS subscriptions : Model -> Sub Msg subscriptions model = Time.every 1000 Tick -- VIEW view : Model -> Html Msg view model = let hour = String.fromInt (Time.toHour model.zone model.time) minute = String.fromInt (Time.toMinute model.zone model.time) second = String.fromInt (Time.toSecond model.zone model.time) in h1 [] [ text (hour ++ ":" ++ minute ++ ":" ++ second) ]
Let’s go through the new stuff.
Time.Posix and
Time.Zone
To work with time successfully in programming, we need three different concepts:
Human Time — This is what you see on clocks (8am) or on calendars (May 3rd). Great! But if my phone call is at 8am in Boston, what time is it for my friend in Vancouver? If it is at 8am in Tokyo, is that even the same day in New York? (No!) So between time zones based on ever-changing political boundaries and inconsistent use of daylight saving time, human time should basically never be stored in your
Modelor database! It is only for display!
POSIX Time — With POSIX time, it does not matter where you live or what time of year it is. It is just the number of seconds elapsed since some arbitrary moment (in 1970). Everywhere you go on Earth, POSIX time is the same.
Time Zones — A “time zone” is a bunch of data that allows you to turn POSIX time into human time. This is not just
UTC-7or
UTC+3though! Time zones are way more complicated than a simple offset! Every time Florida switches to DST forever or Samoa switches from UTC-11 to UTC+13, some poor soul adds a note to the IANA time zone database. That database is loaded onto every computer, and between POSIX time and all the corner cases in the database, we can figure out human times!
So to show a human being a time, you must always know
Time.Posix and
Time.Zone. That is it! So all that “human time” stuff is for the
view function, not the
Model. In fact, you can see that in our
view:
view : Model -> Html Msg view model = let hour = String.fromInt (Time.toHour model.zone model.time) minute = String.fromInt (Time.toMinute model.zone model.time) second = String.fromInt (Time.toSecond model.zone model.time) in h1 [] [ text (hour ++ ":" ++ minute ++ ":" ++ second) ]
The
Time.toHour function takes
Time.Zone and
Time.Posix gives us back an
Int from
0 to
23 indicating what hour it is in your time zone.
There is a lot more info about handling times in the README of
elm/time. Definitely read it before doing more with time! Especially if you are working with scheduling, calendars, etc.
subscriptions
Okay, well how should we get our
Time.Posix though? With a subscription!
subscriptions : Model -> Sub Msg subscriptions model = Time.every 1000 Tick
We are using the
Time.every function:
every : Float -> (Time.Posix -> msg) -> Sub msg
It takes two arguments:
- A time interval in milliseconds. We said
1000which means every second. But we could also say
60 * 1000for every minute, or
5 * 60 * 1000for every five minutes.
- A function that turns the current time into a
Msg. So every second, the current time is going to turn into a
Tick <time>for our
updatefunction.
That is the basic pattern of any subscription. You give some configuration, and you describe how to produce
Msg values. Not too bad!
Task.perform
Getting
Time.Zone is a bit trickier. Our program created a command with:
Task.perform AdjustTimeZone Time.here
Reading through the
Task docs is the best way to understand that line. The docs are written to actually explain the new concepts, and I think it would be too much of a digression to include a worse version of that info here. The point is just that we command the runtime to give us the
Time.Zone wherever the code is running.
Exercises: | https://guide.elm-lang.org/effects/time.html | CC-MAIN-2019-30 | refinedweb | 814 | 77.74 |
The client proxy base class. More...
#include <clientproxy.h>
Detailed Description
The.
Member Function Documentation
Request capabilities of device.
Send a message asking if the device supports the given message type and subtype. If it does, the return value will be 1, and 0 otherwise.
Fresh is set to true on each new read.
It is up to the user to set it to false if the data has already been read. This is most useful when used in conjunction with the PlayerMultiClient
Set a replace rule for this proxy on the server.
If a rule with the same pattern already exists, it will be replaced with the new rule (i.e., its setting to replace will be updated).
- Parameters:
-
- Exceptions:
-
The documentation for this class was generated from the following file: | http://playerstage.sourceforge.net/doc/Player-svn/player/classPlayerCc_1_1ClientProxy.html | CC-MAIN-2015-22 | refinedweb | 132 | 67.96 |
?
You can use Qt. Do this in a terminal window:
$ sudo apt-get install libqtcore4 libqtgui4 libqt4-dev qt4-qmake qt4-doc qt4-demos qt4-assistant qt4-designer qtcreator qtcreator-doc
Some of the above might be redundant, but what the heck. And most of it is probably installed already as part of the distro or as dependency of other, already installed packages (since Qt is pretty wide-spread in Linux GUI world).
At that point, you should be able to make a project like this one:
#include <QApplication> #include <QWidget> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setWindowTitle("Simple example"); window.show(); return app.exec(); }
Save it to file "simple_example.cpp", go to that directory in a terminal, and run:
$ qmake -project $ qmake $ make $ ./simple_example
If the above works, and it should (in the tradition of Linux being automatic and easy), then your setup is working, at least basically (you can browse synaptic for anything that starts with "libqt" for more plugins and add-ons, like opengl, sql, xml, svg, etc.). The above is just a simple example, the more usual approach is to design the GUI window using Qt Designer (by dragging and dropping GUI elements, instead of having to code everything in), save it to some .ui files, implement some event handlers (called "slots" in Qt), and create a qmake project file. It is a slightly more involved building process, but nothing to be afraid of.
There are plenty of tutorials on Qt. Like this, or that, or this.
I think the easiest way to make a window, or a simple game is using allegro4.2 or 4.3:
sudo apt-get install liballeg4.2-dev
or
sudo apt-get install allegro4.2-dev
.
Then open Code::Blocks and find linking in the settings adn put
`allegro-config --libs`
. Now you are ready to use Allegro:
#include <allegro.h> /*On windows*/ #include <winalleg.h> using namespace std; int main(void) { allegro_init(); /initialize window install_mouse(); install_keyboard(); SET_GFX_MODE(GFX_AUTODETECT_X,y,z,0,0); / X - WINDOWED / FULLSCREEN / y,z - e.g. 640,480/800,600/1024,768/1280,960 ... as u wish it can be 100,1 too :D /then find some sites with tutorials, but it is like pascal: color = makecol(r,g,b); line(x1,y1,x2,y2,color); }
You can code your GUI if you prefer but you can use Qt 4's Designer(good luck working with it I find it much easier to hard code it then to use the designer) as far a Gui libraries in general take a pick out of the litter you got GTK, QT4, WxWidgets as the main libraries and then you've got the cross platform SDL.
I can't really decide on which one is "easier" I like QT4's simplicity but alot of the documentation is obscure meaning your going to have to put it together which could take a while(depending on how complex the GUI needs to be) unless you use the gui QT designer but then you've got to learn how to use it.
if you just need a simple dialog you can use XDG
sudo apt-get install xdialog
or
pacman -Sy xdialog
for documentation on xdialog
man xdialog or xdialog --help or google.
thank you guys for all the help i'll see if it works :)
any time :P there are a couple of other ones but they aren't worth mentioning because they are kinda outdated and never worked on actively.
Related Articles | http://www.daniweb.com/software-development/cpp/threads/370842/c-linux-ubuntu-10.04-help-with-gui | CC-MAIN-2013-48 | refinedweb | 593 | 60.04 |
Hi Guys,I
I tried a Python source on a path with spaces and it work fine on my:startup, version: 2199 windows x64 channel: nightly
What's your OS and ST2 version ?
Are you sure the issue is not in your MyScript.ms ?Try writing a shell script that only print input parameter to the console.
Hi bizoo,I'm using Sublime Text 2 Beta 2181 on Windows 7 x64.
The script is fine, as it works if I put it into a folder where the path does not contain any space.It actually is just a print statement.
If I run the script from a DOS command prompt it is about the same, i.e.:
C:\mxscom.exe -f C:\test.ms - works
C:\mxscom.exe -f "C:\test.ms" - does not work
-- Runtime error: fileIn: can't open file - ""c:\test.ms""
during OLE automation function call
C:\mxscom.exe -f C:\MyFolder\test.ms - works
C:\mxscom.exe -f "C:\My Folder\test.ms" - does not work
-- Runtime error: fileIn: can't open file - ""C:\My Folder\test.ms""
during OLE automation function call
As an interesting debugging information if I feed the com with an invalid file, I get as an error in 3ds Max:
C:\mxscom.exe -f c:\testMe.ms - the file does not exists, so cannot work
-- Runtime error: fileIn: can't open file - "c:\testMe.ms" -- Note quotes are not doubled
during OLE automation function call
This is the reason why I was wondering if there is any way to strip the double quotes.I have been using this com object with PSPad for years, and never got a problem, but Sublime Text is way better and more customizable.
Thanks
If you open the console (View->Show Console) after running your build there must be something like:
Running python -u C:\Temp\folder with space\test.py
What do you have on your system ?
There is a brand new build on, try if it's resolve your issue.
Hi bizoo,thanks for your help.
After running the build, in console I've got:
Running mxscom.exe -f C:\My Folder\test.ms
Which seems perfectly fine to me.
But I still get the issue with Max:
I am going to try the new dev build as soon I can. I'll keep you posted with it.Thanks!
You can try adding this to your build file:
{
"cmd": "mxscom.exe", "-f", "$file"],
"shell": true,
"selector": "source.MaxScript"
}
Not sure it help, but actually your issue is very strange and I've no other idea.Good luck.
Hi bizoo,I tried the "shell" option on both versions of Sublime Text 2181 and 2200 with no luck.
I put the mxscom.exe in the Packages\user folder
{
"cmd": "mxscom.exe", "-f", "$file"],
"working_dir": "$packages\\User",
"shell": true,
"selector": "source.MaxScript"
}
The com is called but still in 3ds Max it appears the file path with doubled double-quotes.
SyncViewS: Your earlier post indicated that mxscom.exe doesn't handle paths with spaces even when called from the command line: is this true? If so, there's not much that can be done from within Sublime Text to help this.
Hi Jon,thanks for your reply.
I don't exactly know what is going on, because I can use this com component with PSPad and Notepad++ without issues, by specifying the same "-f" parameter and the full filepath.
In particular PSPad synthax is:
Compiler
%PSPath%MaxScript\mxscom.exe
Parameters
-f %File%
Provided mxscom.exe is located in a folder within PSPad called MaxScript.
Please let me know if I can help in any other way.
Thank you
Sublime Text expects command line utilities to work with quoted paths, if the command line program in question can't, then I can only suggest writing a wrapper program that will.
Enrico: I was having this same exact problem when trying to get this running today. I ended up fixing it by making my own plugin to use as the target command in the the build-system.
Create a new plugin like this:
import sublime, sublime_plugin
import subprocess
class ExecMsxCommand(sublime_plugin.WindowCommand):
def run(self, cmd = ], **kwargs):
subprocess.call(cmd[0] + " " + cmd[1] + " " + cmd[2], shell=False)
Set up your build file like this:
{
"cmd": "mxscom.exe", "-f", "$file"],
"selector": "source.MaxScript",
"target": "exec_msx"
}
Do you have plans on releasing the maxscript syntax highlighting to the community when they are done? I was going to begin that process as well, it seems pretty daunting. | https://forum.sublimetext.com/t/build-system-issue-with-paths-containing-spaces/5871/9 | CC-MAIN-2016-36 | refinedweb | 756 | 76.32 |
On Tue, 03 Jan 2012 16:27:35 +0000 Robert Kern <robert.kern at gmail.com> wrote: > On 1/3/12 2:57 PM, Matt Joiner wrote: > > Just a suggestion: > > > > Golang uses an "exp" namespace, this would translate to a exp package > > for grouping like modules in a similar way that xml, http and > > concurrent are currently used. > > > > > > The name is unoffensive, and somewhat more palatable than __preview__, > > which really isn't a protocol, or a bag for special interpreter > > switches like __future__. > > > > Under this scheme, the currently proposed modules would be: > > > > exp.regex > > exp.daemon > > exp.ipaddr > > > > Rather than > > > > __preview__.regex > > __preview__.daemon > > __preview__.ipaddr > >". Regards Antoine. | https://mail.python.org/pipermail/python-ideas/2012-January/013254.html | CC-MAIN-2016-50 | refinedweb | 108 | 55.54 |
Services¶
python-for-android supports the use of Android Services, background tasks running in separate processes. These are the closest Android equivalent to multiprocessing on e.g. desktop platforms, and it is not possible to use normal multiprocessing on Android. Services are also the only way to run code when your app is not currently opened by the user.
Services must be declared when building your APK. Each one
will have its own main.py file with the Python script to be run.
Please. It is recommended to use the second method (below) where possible.
Create a folder named
service in your app directory, and add a
file
service/main.py. This file should contain the Python code
that you want the service to run.
To start the service, use the
start_service function from the
android module (you may need to add
android to your app
requirements):
import android android.start_service(title='service name', description='service description', arg='argument to service')
Arbitrary service scripts¶
This method is recommended for non-trivial use of services as it is more flexible, supporting multiple services and a wider range of options.
To create the service, create a python script with your service code
and add a
--service=myservice:/path/to/myservice.py argument
when calling python-for-android. The
myservice name before the
colon is the name of the service class, via which you will interact
with it later. You can add multiple
--service arguments to include multiple services, which you
will later be able to stop and start from your app.
To run the services (i.e. starting them from within your main app code), you must use PyJNIus to interact with the java class python-for-android creates for each one, as follows:
from jnius import autoclass service = autoclass('your.package_ARGUMENT', '')
Services support a range of options and interactions not yet
documented here but all accessible via calling other methods of the
service reference.
Note
The app root directory for Python imports will be in the app
root folder even if the service file is in a subfolder. To import from
your service folder you must use e.g.
import service.module
instead of
import module, if the service file is in the
service/ folder.) | https://python-for-android.readthedocs.io/en/latest/services/ | CC-MAIN-2020-40 | refinedweb | 374 | 55.44 |
1. You'll need at least AllFiles capabilities to access contact database directly on device. You should work with contact API provided by Symbian or J2ME
2. It should be possible using public API...
1. You'll need at least AllFiles capabilities to access contact database directly on device. You should work with contact API provided by Symbian or J2ME
2. It should be possible using public API...
Those contacts may be templates used in contact model on your device.
You can check if they are templates (using Type() method). Also please notice that system attribute is not used any more so...
Yep...no solution yet for this problem. Looks like a defect in S60/Symbian contacts code
That's because contact items are based on templates.
If target contact db has those templates, all contact item will have them (imported or not)
Lucian
For example:
const TUid KMyCustomField = {/*value*/}; //make sure this is not duplicate value - check cntdef.h for this
CContactItemField*...
Almost agree with you but you have to keep in mind that there is a circular include.
In one of the h file there must be only the forward declaration
Look what you have in that file
//includes
#include "DeviceInfoAppUi.h";
class CDeviceInfoAppUi;
.....
You make a declaration and a forward declaration. Let only the forward declaration
And InfoController.h?
Can you show us DeviceInfoAppUi.h ?
I assume the problem is there
It's possible to add your custom fields. Just create your custom type and that should be it.
Words of advise:
- custom fields will be recognized only in your app
- import / export will not work...
Yep...that should do the trick
How do you import those contacts?
At import time, successful imported contacts are stored in memory. But you can release that memory.
L
GUID is different from UID.
If you create contacts on your machine, thy probably have only uid.
If they are created on different platform, they will have a guid.
However, when contacts are...
You should use GUID when export / import
If you look at method signature you have
CArrayPtr<CContactItem>* ImportContactsL(......)
So everytime you import, an arroy of contact items is created and its ownership passed to you.
Do you...
You won't have access to source code in the next month or so (see this announce). Didn't have time to check the example you...
Yep...I think the problem is with contact ids
How do you get the id used in contactDB->ReadContactLC(id)?
L
What sdk version do you use?
Another aproach to this problem would be to read owncard from your contact database (though not all users / phone set that)
I think the problem is this: contact database is not updated at the moment you try to read contact from it (even if the persistent db was updated). To check this listen for database events and see...
Can you check what's the value of TContactItemId id?
L
To be honest, I think this is a problem in contact app not in contact engine. May be contact app should take in consideration only default db. Other people would say that it should consider all db. I...
Yep, that's right....starting from 9.0 onward you can't create db in other places than private contact model private directory.
Unfortunatelly you can't replace default db as well since default db...
I think directories have to be created already.
Try first with _LIT( KOrgContactFile,"C:\\privatecontact.db" ); | http://developer.nokia.com/community/discussion/search.php?s=ce36593e7b901e220d7ff9b286dc2686&searchid=1953230 | CC-MAIN-2014-10 | refinedweb | 579 | 67.96 |
The preprocessor is perhaps best thought of as a separate program that runs just before the compiler when you compile your program. Its runs..
#include <filename>
#include "filename" tells the preprocessor into the same source file., the contents of mymath.h will have been included twice in main.cpp, which would cause the compiler to complain about cardsInDeck() being defined twice in the same place. and MYMATH_H is defined. main.cpp then #includes subtract.h, which #includes mymath.h. Since MYMATH_H has now been defined, the contents of mymath.h are skipped.
By adding the header guard, we’ve ensured that the contents of mymath.h are only included once in main.cpp.
For good form, we should also add header guards to add.h and subtract.h.
#pragma once
Many compilers support header file is are not copied more than once into any single file (to prevent duplicate definitions). However, header guards do not prevent the contents of a header file from being copied (once) into multiple different project files (such as add.h and subtract.h in the example above). This is a good thing, because we often need to reference the contents of a header from different project files.
Your right.?
Even I have the same error. I am not able to find what is wrong with the code.
I even tried with std::cout
The double quotes are wrong. They got formatted to “” instead of “”. Make sure you’re using standard double quotes, not the pretty ones...
Hello all,
I have tried both tying out and simply copying the text from the example, I keep getting an error message…
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Work\C++\main\Debug\main.exe : fatal error LNK1120: 1 unresolved externals
To me it seems for some reason it is unable to find the header files, I created them in the same was as I have in past tutorials which all worked. They are visible in the browser under Header files.
Any help would be appreciated.
regards
Daniel
Looks like it can’t find your main() function. Make sure you have a main function, and that it’s in lower case letters.
If it still doesn’t work, try creating a new console project.
Ok, I added an int main() AND #include "stdafx.h" i think before I was doing either or.
Silly question…
For the example you have given to be ran correctly it shouldn't read out anything to the console as nowhere in the code does it have a cout <<.
It now simply runs without throwing an error at me and asks for the user to press button to continue..?
Regards
I’m not sure what you’re actually trying to run. The above code bits are just snippets of programs, not full programs.
If your program doesn’t use cout, then nothing will be written to the console.
I managed to get it working,
for some reason I am yet to figure out it wouldn't let me cout without throwing a wobbler.
Tried it after work and it seems to cout ok :D.
You’ve already seen the #include directive in action. When you #include a file, "the preprocessor copies the contents of the included file are copied into the including file at the point of the #include directive". This is useful when you have information that needs to be included in multiple places (as forward declarations often are).
Please review the part of the sentence above that I’ve highlighted with quotations.
I think it should read:
the preprocessor copies the contents of the included file into the including file at the point of the #include directive.
Indeed. Thanks for pointing that out.
how does the last program in the tutorial work.
i didn’t understand the main.cpp part.
main.cpp is just a fragment of a program, not a complete program. The first two lines pull in the contents of add.h and subtract.h.
What main.cpp does with these isn’t defined in the example above, because it’s not relevant to what I’m trying to explain.
thank u for the reply but could u plz give me the main.cpp portion (entire)
i couldn’t figure it out myself as i started learning recently.
Also would u tell me the expected no. of months/days in which i could finish this entire tutorial.
You could do this:
I can’t give you an estimate to how long the tutorials will take because I have no idea how fast you read, understand, or remember the content.
thanku Alex
Hello, Thank you for the great lessons.I had been doing good with all these great lessons until i got this question in my mind.
Actually, I’m confused with these sentences >.<< These sentences are from "Updating our mymath.h example with header guards" section.
And the QUESTION is: If after main.cpp #includes add.h, which includes mymath.h MYMATH_H has not been defined.THEN why after main.cpp #includes subtract.h, which #includes mymath.h MYMATH_H has been defined ?
Shoudn’t both (add.h and subtract.h)have been including MYMATH_H as defined ? (This is bad I’m getting confused again)
I hope you got the idea.And this is really confusing me.Any answer would be appreciate.THANK YOU AGAIN.
Remember that when you #include a file, the included file is copied into the includer.
Therefore, when main.cpp #includes add.h, the contents of add.h are copied into main.cpp. Since add.h #includes mymath.h, the contents of mymath.h are copied into main.cpp.
Similarly, when main.cpp #includes subtract.h, the contents of subtract.h are copied into main.cpp. Since subtract.h also #includes mymath.h, the contents of mymath.h are copied (again) into main.cpp.
The end result is that main.cpp ends up with two copies of mymath.h. If mymath.h didn’t have header guards, the compiler would try to compile the contents of mymath.h twice, and this would cause an error.
However, since mymath.h does have a header guard, here’s what happens:
* The compiler encounters the contents of mymath.h that were included through add.h. Since MYMATH_H has not been defined, the contents of mymath.h are compiled, and MYMATH_H is defined.
* The compiler encounters the contents of mymath.h that were included through subtract.h. Since MYMATH_H has been defined, the contents are skipped.
Your answer was really helpful.Thank you.I think "Since MYMATH_H has not been defined, the contents of mymath.h are compiled, and MYMATH_H is defined." this sentence made it clear to me and I think if you add "… and MYMATH_H is defined" this sentence in the above lesson where it needed, it wouldn’t confuse again many people like me.And also should we skip lessons with MOVED marks ? And again thank you.
Good suggestion. I’ve updated the lesson.
Don’t skip lessons flagged as moved. Those lessons have been moved from somewhere else and are now in their proper location.
DO you have similar kind tutorial on mfc?, if so please share, it would be very useful.
Thanks in advance.
Nope.
Hey Alex, thanks for answering my previous questions. Here is a suggestion for this section. I think you should clearly define what macro is and where it should be used. Both the types of macro are defined (at least the important one "object-like") but I m still looking for a definition on macro.
One more:
#define identifier
#define identifier substitution_text
The second form (with substitution text) should be :
#define identifier “substitution_text”. I can tell this by looking at this line of the example:
Here you enclosed the substitution text (Alex) with double quotes. Let me know if I m wrong…
Great tutorial. Thanks again.
I’ve updated the lesson to better define what a macro is.
In the provided example, the substitution text was actually text meant to be printed, so it needs to be in double quotes. However, if the substitution text were something else (e.g. an integer) then it would not be.
I’ve also updated the example to a case where the substitution text is an integer.
Thanks…now it’s.
Hey Alex,
I just wanted to tell you that I think you made a typo here: "To summarize, header guards are designed to ensure that the contents of a header file is are not copied more than into any single file (to prevent duplicate definitions)". (It’s in the last paragraph).
Have a nice summer! 😀
Thanks, fixed.
Hi, Alex
Thanks again. I was struggling with this tutorial but did the quiz without too much difficulty. I feel like the quiz was easier than the tutorial……It was certainly shorter!.
Thanks for the quick response.
I faced another error Error C2084: ‘Function already has a body’. However, I fixed the problem.
The issue is when building a project, it is always better to keep the project name the same as the cpp file that contains the main() function.
Thanks again.
Hi Alex,
You told here :
<< #include <filename> tells the compiler to look for the file in a special place defined by the operating system where header files for the C++ runtime library are held. >>
"tells the compiler" / when #include is a preprocessor command so why tells the compiler,
doesn’t tell the preprocessor ?!
Yup, you are correct. Fixed..
Hello again,
Now I can’t understand why we #include mymath.h to add.h and subtract.h.
Why can’t we just #include mymath.h to main.cpp directly?
Thanks in advance.
The example is somewhat arbitrary -- there’s no reason add.h and subtract.h need to include mymath.h. But it’s being done to illustrate the larger point around why header guards are useful, and how a header can get included multiple times even if you don’t expect it to be.
You can include mymath.h directly, but then it would be included in main.cpp 3 times: once directly, once as part of add.h, and once as part of subtract.h., do you mean
if i have defined bob then if i use #ifndef it will not print it?
Right, if you’ve done a #define bob, then anything inside #ifndef bob will not execute.);
#endif.
Hey Alex,
I’ve created a mymath.cpp file as below :
#include "stdafx.h"
#include "mymath.h"
int cardsInDeck()
{
return 52;
}
and now mymath.h contains :
#ifndef MYMATH_H
#define MYMATH_H
int cardsInDeck();
#endif
I tried building and it worked but the output was " Press any key to continue" or No output there I guess…
I’m really confused about the process.. lol
Thanks again Alex!
Perfect. Look at the main() function. It does nothing but return 0, so no output.
You can add whatever you want in main() and make it do something else. But it wasn’t germane to the example.
Name (required)
Website
Please enter an answer in digits:
Current ye@r *
Leave this field empty | http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor-and-header-guards/ | CC-MAIN-2016-07 | refinedweb | 1,861 | 78.04 |
Since I've been writing the DirectX tiling tutorials, I thought I'd write an OpenGL tiling tutorial. This article is intended solely for porting basic tiling methods to the OpenGL API, so if you want an intro to tiling in general, you should read the What the Heck is a Tile section in my Tiling in DirectX: Part I tutorial.
There are not that many differences between tiling in OpenGL and tiling in DirectX (DirectDraw). We still have to define a 2D char array, loop through it, capture the ID of each tile, and draw each individual tile. However, with OpenGL, instead of bit blitting tile bitmaps, we have to render quads and texture them according to the ID at the particular location in the array.
Prerequisites
This article is not meant for the complete OpenGL newbie. The reader should be familiar to the basic form and function of the OpenGL API. For those of you who don't know OpenGL or want to brush up on your skills, I strongly suggest heading over to NeHe's site, which is chock full of beginner to advanced OpenGL tutorials.
Setup
In this section I'll be presenting all the global variables, defines, and extra functions that we'll need.
#define MAP_SIZEX 10 #define MAP_SIZEY 10Here we define the map size (in tiles) as 10 * 10.
GLuint texture[2];The use of texture[] is pretty self-explanatory. It will be used to hold the names of the two textures that make up our map; one in texture[0] and one in texture[1].
char map[10][10] = { {1, 1, 1, 1, 1, 1, 1, 1, 1,}, };This is the array that holds our map data. In this format, we can access any tile by map[y_tile][x_tile]. In this example, a tile defined as "1" is a wall, or a solid tile that the game characters cannot cross over. A tile with an ID# of "0" is a walkable area. We can redefine a tile’s ID# by doing map[y_tile][x_tile] = new_id;
I'm going to use NeHe's .bmp routine to load the texture bitmaps for this tutorial. Here's the code.
AUX_RGBImageRec *loadbmp(char *filename) { FILE *file = NULL; if (!filename) return NULL; file = fopen(filename, "r"); if (file) { fclose(file); return auxDIBImageLoad(filename); } return NULL; }Basically, the function loads a .bmp and stores it as a AUX_RGB_ImageRec type, which will then be used to attach the texture data to the textures we generate.
int load_gl_textures() { AUX_RGBImageRec *TextureImage[2]; memset(TextureImage,0,sizeof(void *)*1); TextureImage[0] = loadbmp("tile0.bmp"); TextureImage[1] = loadbmp("tile1.bmp"); glGenTextures(2, &texture[0]); // We are generating two textures glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[1]->sizeX, TextureImage[1]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[1]->data);In this piece of code, two textures are generated from two separate 64*64 bitmaps--tile0.bmp and tile1.bmp. (Note: If your bitmaps have different names or are not in the same folder as your program, make sure to make the correct changes to the code or else the program will crash, especially since I haven't optimized the function with any error detection.) These bitmaps are loaded with the function loadbmp() and are then used for creating the textures. The textures will be used later for texturing our quad tiles according to their ID# in the map[][] array. For an in depth explanation of very similar texture generating, check out NeHe's tutorials.
for (int t = 0; t < 2; t++) { if (TextureImage[t]) { if (TextureImage[t]->data) { free(TextureImage[t]->data); } free(TextureImage[t]); } } return(1); }And we free the TextureImage[]'s after we use them.
Now, you should set up the camera with which you'll view the 3D scene. This is the way I'd do it:
gluLookAt(10.0f, 8.0f, 20.0f, 10.0f, 8.0f, 0.0f, 0.0f, 1.0f, 0.0f);Calling gluLookAt this way will set the camera back (or the scene forward) 20 units along the z axis, as well as tweaking it a little bit left and right in order to view the scene better. (Note: You can also do this simple transformation with a glTranslatef(), but personally I find this way cleaner.)
Finally, any lighting, etc. that needs to be done should be done. Make sure that you have a working OpenGL program that creates two textures from two bitmaps before going on.
Drawing the Tiles
Ok, now we're ready to finally draw the tiles. I'll go through the code of this tile drawing function step by step.
int draw_tiles(GLvoid) { int tile;tile is our place holder variable that will be used in determining if the tile at map[y][x], for example, has an ID# of 0 or 1 when we loop through the map array.
for (int y = 0; y < MAP_SIZEY; y++) { for (int x = 0; x < MAP_SIZEX; x++) {Here we have initialized a doubly-nested loop which will run through our map array, capture each tile's ID#, and then store that ID# in tile, as shown in the next step.
tile = map[y][x];tile now holds the ID# of the tile at location map[y][x].
glBindTexture(GL_TEXTURE_2D, texture[tile]);Here we bind the texture that we need, either texture[0] or texture[1], based on the value of tile, which holds the current tile's ID#.
glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex3f(float(x), float(y), 0.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(float(x + 1), float(y), 0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(float(x + 1), float(y + 1), 0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(float(x), float(y + 1), 0.0f); glEnd(); } } return (1); }This is where the actual "tiling" takes place, and a square is rendered at the correct location with the correct texture (texture[tile]).
Conclusion
That's it! You now have a simple OpenGL-based tile engine. Here are a couple ideas on how you can optimize it some more yourself.
- The beauty of 3D is being able to be virtually everywhere in your "world." Try moving the camera (either by using gluLookAt() or something else) to suit your taste. You could even move the camera 45 degrees to give the tiles a pseudo-isometric look.
- You can also hack around with this piece of code and render the square in a different location, make it a different size, or even make it a different shape.
Visit my website at
This article is © 2000 Martin Estevao. This article may not be re-printed without the author's consent. | http://www.gamedev.net/page/resources/_/technical/opengl/tiling-in-opengl-r1256 | CC-MAIN-2016-44 | refinedweb | 1,143 | 62.48 |
thanq for providing excellent material to all learning people
Apaninng
Post your Comment... of the client. This contrasts with the request object. The class or the interface name
JSP Session Object
JSP Session Object JSP Session Object?
Session Object... or the interface name of the object session is http.HttpSession. The object session is written as:
Javax.servlet.http.httpsession.
The Session Object provides
Page object - JSP-Servlet
of PAGE object of implicit JSP object. If this is possible explain me about it's methods. I did not find any methods or explanation of this object. Pls help me.... Hi friend,
Implicit Objects in JSP are objects
JSP Request Object
JSP Request Object JSP Request Object ?
request object... an HTTP request. The request object is used to take the value from the client?s... of the object request is http.httpservletrequest. The object request is written
jsp object retrieval - Spring
jsp object retrieval I have a controller which calls a Service to build a List of data from the database. I want to pass the List to the jsp to use in rendering a grid. I know that I could pass and retrieve from the request
ArrayList object
ArrayList object i have am ArrayList object it containg data base records in it,
now i want to display this ArrayList object data in my jsp programe,
plz help me
implect object
implect object how i implment implect object
Hi Friend,
Please visit the following links:
Thanks
request object - JSP-Servlet
request object What is Difference Between request.getHeader("x-forwarded-for") and request.getServerName() pls give me reply as soon as possible
bean object
in jsp page.
1)Bean.java:
package form;
import java.sql.*;
import...);
RequestDispatcher rd = req.getRequestDispatcher("/jsp/beandata.jsp...;
For more information, visit the following links:
Request Object In JSP.
Request Object In JSP
Request Object In JSP
... to the server, is received by the HTTP request
object of the JSP. To access... provides two file for the best explanation
about the request object
Bussiness Object API - JSP-Servlet
Bussiness Object API I m feteching the reports from CMS server... = (IReportSourceFactory)enterpriseSession.getService("PSReportFactory");
Object...);
viewer.processHttpRequest(request, response, getServletConfig().getServletContext
JSP Implicit object "session"
JSP IMPLICIT OBJECT "SESSION"In this Section , we will discuss about JSP implicit object "session" with an
example. Session Object... of
object as string's value and you can get this value in other JSP page
JSP implicit object out
JSP implicit object out
In this Section, we will discuss about implicit object out & it's methods.
Out object denotes the Output
stream...;jsp.JspWriter". This object is instantiated implicitly from JSP Writer
class
Read MultipartRequest object twice. - JSP-Servlet
using ServletInputStream object?
Can we read MultipartRequest request object...Read MultipartRequest object twice. Hi,
Thanks for your reply for "How to revert back ServletInputStream object after reading once." Q.
Now I
getAttribute() Method Of The Request Object
for the illustration of the getAttribute()
method of the request object in JSP... getAttribute() Method Of The Request Object... that is set through the setAttribute()
method of the request object. The getAttribute
JSP implicit object "response"
JSP implicit object "response"
In this section, we will discuss about JSP implicit object "response" with an
example. Using 'response' object , reply is sent back to the
browser. It is an implicit object
JSP implicit object "request"
;html>
<head><title>Request
Object In JSP.</title><...JSP implicit object "request"
In this section, we will discuss about.... The 'request' object takes the value from the web browser
and pass
JSP implicit object "pagecontext"
JSP IMPLICIT OBJECT pagecontext
A PageContext instance provides access to all the namespaces associated with
a JSP page, provides access to several... and pageContext are implicit JSP Objects.
The page object represents
How to get jSon object in servlet from jsp - JSP-Servlet
How to get jSon object in servlet from jsp How to get jSon object in servlet from jsp?
In jsp page i have written:
var sel... object in servlet??? Hi Friend,
Please visit the following link
object
object is it possible to create object in the same class..?.
Yes, you can.
class CreateObject
{
CreateObject(){
System.out.println("I have an object.");
}
public static void main(String[] args... object in JSP. Here,
you will learn why this is used and how it is used... that gets the request
and response object sent by the RequestDispatcher
GOODA.SANTHOSH KUMAR July 8, 2011 at 5:34 PM
thanq for providing excellent material to all learning people Apaninng
Post your Comment | http://roseindia.net/discussion/20897-Request-Object-In-JSP.html | CC-MAIN-2015-35 | refinedweb | 753 | 58.38 |
sylware seems to have something against all languages other than C (and perhaps some flavour of assembler as well). I wonder if (s)he knows that most large C programs (including libbfd) are in many ways object-oriented...
whatever
Posted Mar 26, 2008 20:28 UTC (Wed) by elanthis (guest, #6227) [Link]
A lot of "old beards" dislike C++ for a variety of (mostly) no longer accurate reasons. Keep in mind I'm a huge proponent of C++ and use it for nearly all of my non-Web projects. It generally isn't about object-oriented programming, but more about low-level technical or political issues that were once an actual problem. C++ fractured a lot during its pre-standardization days. This led to a lot of issues with porting code between different compilers. Even after standardization, it's taken a long while for certain vendors (*cough* Microsoft) to catch up and play nice, and there are still a few corner cases where certain compilers don't meet the spec. This really isn't a real concern anymore though. C++ had a non-standard ABI on early Linux systems, leading to constant breakage of C++ programs. Upgrading one's system would often lead to many or sometimes even all C++ programs no longer working. This hasn't happened in many, many years, and is unlikely to ever happen again given that there is a standardized C++ ABI that all major compiler vendors follow. C++ suffers from a massively huge specification that no one compiler implements bug-free, and compiler updates often include standard-compliance fixes that break old non-compliant (but perfectly functional) code. Upgrading your compiler can sometimes result in old code no longer compiling. This is still true today, unfortunately - the GCC 4.3 release has broken a lot of software, and even though the fixes are generally extremely simple to make, they're still annoying. This is only an issue if you aren't 100% sure you're writing standard-compliant code; unfortunately, few of us can be, given how big that spec is. Valid fear. C++ can include some (negligible) performance regressions over C when using certain C++ features. However, these features really have no analog in C at all, and the few attempts at providing similar features in C often reason is horrifically ugly and difficult to use APIs or result in even worse performance than C++'s implementation. These features include exceptions and RTTI. Both of these features can be turned off in almost every compiler, so apps which don't really need them do not need to take the performance hit and can still take advantage of C++'s other features. C++ makes it easier to write bad code that masquerades as good code. That is, C++ allows you to hide what your code is doing behind operator overloading, function/method overloading, virtual vs non-virtual method calls, and so on. C would require the coder to be explicit about what he is doing, and looking at the code makes it obvious what is going on without having to look up every header to figure out which methods are virtual or which global operators or overloaded functions have been defined. Basically, this boils down to there being a lot of shitty programmers, C being less friendly to shitty programmers, and more of those shitty programmers flocking to C++ than to C. Not an issue when you're dealing with someone who is truly good at software engineering, like the gold author. C++ does nothing that C can't do. Anything you can write in C++ you can write in C, and make it just as efficient, possibly even more so in some circumstances. This argument is mostly bogus because it overlooks the fact that writing most of those things in C is way, way harder than writing them in C++ (getting the performance of templatized STL container classes out of C without manually maintaining a metric crap load of almost identical code is not really feasible). It's also bogus because, for those few things where doing it "the C way" or eschewing the standard "C++ way" (like using a custom container for a specific data set that allows for very specific optimization techniques that the STL can't use), C++ is entirely capable of doing it "the C way." Still, it's pretty common to see old beards claim C++ is pointless or meritless, even if it is easily refuted. C++ has additional runtime requirements that make it less suitable for low-level tools and libraries. A C program can get by with just libc. A C++ program needs some extra libraries, for things like iostreams, the new/delete operators, exception handling, and so on. As with exceptions in general, these features may be done without to avoid the additional dependencies, although the c++ compiler will still link them in anyway by default. These dependencies really don't have any true negative impact (not like some of the big GUI apps, C and C++ alike, that require dozens of shared libraries to run... hello GTK/GNOME), but there is a fear among some of having any kind of dependency that isn't 100% mandatory. If the dependency really is an issue it is avoidable without giving up C++'s other features, and the fear is pretty pointless any more, so this reason is bunk. So, there a few valid reasons to possibly avoid C++ for low-level work. Some of those can be worked around with a little effort. In general, given that complete OS kernels have been written in C++ with no ill effect, I think it's safe to say that this kind of fear of C++ in 2008 is greatly unjustified. Old beards aren't likely to change their tune now any more than they were a decade ago, though. :)
+5, Insightful
Posted Mar 26, 2008 20:48 UTC (Wed) by nix (subscriber, #2304) [Link]
I think I agree with everything you said there, but you said it *very* well.
+5, Insightful
Posted Mar 26, 2008 21:08 UTC (Wed) by JoeF (subscriber, #4486) [Link]
Ditto. I use C++ a lot, for my day job, and I agree with everything elanthis said. Before my current project, I had to maintain a complex program written almost completely in C. That turned out to be a nightmare, and it actually was fairly well-written code. In my current project, I make use of a lot of STL functionality. Implementing that in C would be hell...
yet another +5
Posted Mar 26, 2008 22:14 UTC (Wed) by pr1268 (subscriber, #24648) [Link]
Another C++ fanboy here who really like Elanthis' comments.
I write lots of personal utility programs in C, and yes, the C code is usually leaner and more spry than equivalent C++ code. But, it's hard to ignore just how well C++ satisfies virtually every programming paradigm in existence. For me, trying some new paradigm or language feature set in C++ is usually a fruitful academic exercise where I come away so much more enlightened.
I wrote a C++ program recently that had all kinds of libc calls (stat, mkdir, opendir, and readdir, to name a few) sitting next to standard library vectors and fstreams. It might have looked like a Frankenstein of a program suffering from a source language identity crisis, but I'll be damned if it didn't run perfectly and efficiently (using existing GCC and binutils). And this "hybrid" C/C++ program ran several orders of magnitude faster than my hand-coded linked list version it replaced (but let's not go to why my linked list version sucked - suffice it to say that code was a brown paper bag experience). ;-)
I do understand Sylware's sentiments towards C++ (even if I don't agree with them) - after all, Linus feels the same way. It's all about using the right tool for the right job. With C, you get a well-stocked hand-carry tool box. For many folks, that's perfectly adequate. With C++, you get the entire Sears Craftsman catalog.
I'm actively looking forward to seeing more of Gold and its performance gains. Kudos to the developers.
yet another +5
Posted Mar 27, 2008 4:15 UTC (Thu) by wahern (subscriber, #37304) [Link]
If the metric is easier development because the language provides more sugar for certain patterns, how do you justify not using Java or C#? I agree that C++ is in some respects a "better C". But I don't want a "better C". I like C because its simple, portable, and the lowest common denominator. I can compile most of my own libraries and applications on Linux, *BSD, and Win32 w/o so much as changing a compiler option. If I want a complex language, there are better ones than C++; the cost/benefit tradeoff is superior. When C++ gets garbage collection and closures, call me. (And Boehm better not be on the line.) If I have to put up w/ the extra baggage (language complexity, superfluous libraries, porting headaches), I demand more bang for my buck.
yet another +5
Posted Mar 27, 2008 7:09 UTC (Thu) by pr1268 (subscriber, #24648) [Link]
If the metric is easier development because the language provides more sugar for certain patterns, how do you justify not using Java or C#?
I can't find in my earlier post where I said I didn't use Java. In fact, I do from time to time. My earlier post was about why I'm such a fan of C++ - and how I can still enjoy all the benefits of both C and C++, even in the same program.
However, I take exception to your implication that Java provides competitive "sugar" to C++. Consider the following example of reading an integer from a file:
C++
int x; ifstream in_file; in_file.open("foo.txt"); assert(in_file); in_file >> x;
Java
int x; String line; try { FileReader fr = new FileReader("foo.txt"); BufferedReader br = new BufferedReader(fr); line = br.readLine(); x = parseInt(line); } catch (Exception e) { }
Not more sugar, IMO. Yes, I do realize that Java has to abstract a lot of file I/O due to the fact that it supports multi-byte character sets on dozens of architectures with different byte orders and file systems, thus explaining the syntactic "salt". But, still, even the C version is pretty simple:
C
int x; FILE* in_file; in_file = fopen("foo.txt", "r"); assert(in_file); fscanf(in_file, "%d", &x);
But again, I'm not trying to dismiss Java, only to provide a counter example of where Java fails to provide any programming benefit over C++. Actually, the C and C++ examples above would likely only work on ASCII or UTF-8 filesystems, but Java's UTF-16 support is native to the language1. So, Java gets to tell C and C++ what "portability" means (even if the programmer has to dig through 67 layers of abstraction to accomplish what he/she set out to do). ;-)
As for C#, well, despite my own thoughts about Microsoft getting in the way, I just don't see why C# even needs to exist. Microsoft was actively marketing Java development suites and compilers in the mid- and late-1990s (Visual J++, anyone?), adding their own APIs and language features, until Sun Microsystems had the guts to stand up to MS and tell them to stop violating the terms of Sun's license (with a successful lawsuit). It was all sour grapes for MS afterwards, so they just had to go run out and create their own Java imitation. C'mon, Microsoft, you already had legions of Visual Basic programmers! Why go out and create a whole new language when there are so many already out there? Was it because Visual Basic wasn't "Java-like" enough?
Not that I think C# is a bad language; it does have some interesting features. But, I get this strange feeling that C# skills will be useless come five years from now, just like Visual Basic skills are in much less demand than they were five years ago.
As for coding C#, well, I abandoned MS Windows four years ago for a single-boot Linux. And the only native C# compiler for Linux I know of is Mono. Which causes anomalous behavior on my Slackware machines. Come to find out Mono has library dependency issues with my current toolchain and dynamic linker. In other words, I experienced DLL HELL in Linux2, simply by installing Mono (version 1.24) in Slackware 12. How ironic this is considering I'm trying to write Windows applications in Linux. I suppose the gratuitous DLL hell is all part of the Microsoft "experience" I'm supposed to get whilst writing C# code. No thank you.
I mostly agree with the rest of your post - I do indeed like C's portability (hey, it was one of the core motivations for creating the language to begin with), and I also like its efficiency. I can't say that adding garbage collection to C++ would be worthwhile; Even Bjarne Stroustrup labored over whether to include garbage collection in C++ back in the early 1980s.
My personal thoughts are that garbage collection built-in to the programming language would send several mixed messages to programmers using that language:
(And Boehm better not be on the line.)
I LOLed at your comment. I downloaded a source tarball several months ago (I forget which program/application) that had a Boehm GC dependency. I thought to myself, C++ doesn't have garbage collection for a reason, but why does this particular project feel that it needs to slather a layer of protection over the code? Are the programmers lazy? Or, do they not know how to use new and delete?
When C++ gets garbage collection and closures, call me.
Perhaps some of your garbage collection needs could be met by using the C++ standard library container classes (e.g., vector, list, deque, etc.). Or, more appropriately stated, your need for a GC to begin with could be eliminated. But, perhaps that's a discussion for another time. I've rambled on long enough, it's been fun pontificating and bloviating (to quote one of my graduate professors). :-)
1 C++ does have explicit support for multi-byte character sets with its wchar_t type. I don't know what kind of support C has in this regards, or if it supports multi-byte characters at all.
2 I'll openly admit that Microsoft unfairly receives the brunt of user frustration over DLL hell when in reality the basic concept of library dependency hell is a Unix creation which predates DLL files by several years.
yet another +5
Posted Mar 27, 2008 10:54 UTC (Thu) by nix (subscriber, #2304) [Link]
GC support in the language has one major advantage over not having it: if the compiler and GC layer cooperate, the language can do type-accurate garbage collection. That's pretty much impossible with a 'guess if this bit pattern is a pointer' implementation like Boehm. (But still, why GC in a C/C++ program? Easy: sometimes, the lifespan of allocated regions is complex enough that you don't want to track it in your own code. A lot of large C/C++ systems have garbage collectors in them, often hand-rolled. GCC does, for instance, and while its effect on data locality slowed GCC down a lot, it *also* wiped out huge piles of otherwise-intractable bugs. In my own coding I find that Apache-style mempools and disciplined use of ADTs eliminates most of the need for GC while retaining the nice object-lifecycle benefits of C/C++, so I can use RAII without fear. Losing that pattern in Java is a major reason why I try to avoid the language: in effect Java eliminates memory leaks only to replace them with other sorts of resource leak because you can't use RAII to clean them up for you...)
Python
Posted Mar 27, 2008 12:43 UTC (Thu) by ernstp (subscriber, #13694) [Link]
Sorry, completely off topic, I just had to post this. Python: int( file("foo.txt").read() ) :-P
Python
Posted Mar 27, 2008 13:21 UTC (Thu) by pr1268 (subscriber, #24648) [Link]
Show-off!
You forgot to catch the exception of the file not opening. Where's your deadParrot() error-handling function?
;-)
Python
Ruby
Posted Mar 28, 2008 1:15 UTC (Fri) by Tuxie (guest, #47191) [Link]
sorry, I had to :-) x = File.read("foo.txt").to_i rescue deadParrot
c++ vs c
Posted Mar 27, 2008 14:51 UTC (Thu) by jimparis (subscriber, #38647) [Link]
> C++ > > int x; > ifstream in_file; > in_file.open("foo.txt"); > assert(in_file); > in_file >> x; > C > > int x; > FILE* in_file; > in_file = fopen("foo.txt", "r"); > assert(in_file); > fscanf(in_file, "%d", &x) Here's something that really bugs me about C++. Where's the documentation? With C, "man fopen" "man assert" "man fscanf" gives me all the info I need. With C++, I suppose some manual page for ifstream would be most appropriate, but I don't seem to have it. Which package is that in? Or must I resort to google searches every time? Of course, even if I did have C++ manpages, deciphering "in_file >> x" still requires that I track backwards to figure out the types of "in_file" and/or "x" (yay operator overloading!)
c++ vs c
Posted Mar 27, 2008 15:13 UTC (Thu) by pr1268 (subscriber, #24648) [Link]
I suppose some manual page for ifstream would be most appropriate, but I don't seem to have it.
All Glibc standard library functions have man pages (I'm unsure whether these came before or after the shell functions' man pages). I think this might be related to the founding philosophy that C is supposed to be portable, and the man pages were a convenient way of distributing documentation on the system call interfaces without having to decipher C code you've never seen before (not impossible, but time-consuming).
I can't recall ever seeing a C++ man page, but then again, the whole language standard was in limbo up until its 1998 ISO standardization. Not sure why they don't exist nowadays, but perhaps Stroustrup would prefer that you buy his book instead (stupid conspiracy theory). Some of the top links in Google searches for various C++ functions and standard library classes are quite decent (IMO).
Personally, I recommend anyone trying to "dive into" C++ go find a used C++ textbook. Just be sure to get one dated more recent than 1998 (because older C++ texts are rife with code that predates the ISO standard).
c++ man pages on gcc.gnu.org
Posted Mar 27, 2008 17:01 UTC (Thu) by bkoz (guest, #4027) [Link]
See: I believe some os vendors (debian, I think) package these. -benjamin
c++ vs c
Posted Mar 28, 2008 12:00 UTC (Fri) by cortana (subscriber, #24596) [Link]
Indeed, man pages are not really suitable for C++ (and many other languages) for the reasons you state.
If you are on a Debian system, run: apt-cache -n search libstdc++ doc and install one of those packages. Then check out its directory in /usr/share/doc.
The docs are also online at.
A very nice quick reference to iostreams and the STL can be found at.
I have to say I don't really prefer the man pages for C development because often they contain oudated or just plain incorrect information. I prefer to use the glibc manual directly for reference.
Use of assert
Posted Mar 30, 2008 4:53 UTC (Sun) by pjm (subscriber, #2080) [Link]
Incidentally, please don't use or encourage use of assert for checking for I/O errors or other can-happen runtime conditions. Such checks will disappear when compiled with -DNDEBUG (or conversely make it impractical to compile with -DNDEBUG, thus discouraging use of assertions), and fail to give a meaningful error message. That should be if (!in_file) { perror("foo.txt"); exit(EXIT_FAILURE); }.
The metric is SPEED not just easier development
Posted Mar 27, 2008 10:03 UTC (Thu) by khim (subscriber, #9252) [Link]
If the metric is easier development because the language provides more sugar for certain patterns, how do you justify not using Java or C#?
Java and C# are using virtual machines and thus are slower. End of story. C is closer to the metal, but suffers from human problem: it's not feasible to generate 10'000 specialization by hand. You need some metaprogramming. If you'll take a look on really fast "C libraries" (like FFTW or ATLAS) you'll find out that while they include bunch of .c files these .c files are not the source! They itself are generated by some automatic process. C++ allows you to do something similar without using yet-another-specialized system (STL and especially boost are big help, but simple template metaprogramming works as well in simple cases). Thus in practice C++ programs written by good programmers are faster then C programs (if you turn of rtti and exceptions, of course). AFAICS this was reason for C++ usage in gold, too.
Of course it's very easy to misuse C++, too...
The metric is SPEED not just easier development
Posted Mar 27, 2008 10:56 UTC (Thu) by nix (subscriber, #2304) [Link]
One point: RTTI and exception handling don't slow down C++ programs anymore, except if dynamic_cast<> is used or exceptions are thrown, and those are things which if you implemented them yourself you'd have a lot of trouble making as efficient as the compiler's implementation (I doubt that you *can* make them as efficient or reliable without compiler support).
Since WHEN?
Posted Mar 28, 2008 9:26 UTC (Fri) by khim (subscriber, #9252) [Link]
Last time we've checked (GCC 4.1.x) removal -fnortti and/or -fnoexceptions made real world programs 5-10% slower (up to 15% combined). What change happened in GCC 4.2 and/or GCC 4.3???
If you DO need RTTI and/or exceptions of course it's better to use compiler-provided ones, then to write your own, but if not... For things like gold abort() is perfectly usable alternative to the exceptions...
Since WHEN?
Posted Mar 28, 2008 21:26 UTC (Fri) by nix (subscriber, #2304) [Link]
I think I need to profile this, then, because exception frames should be very nearly free to set up and (non-throw) tear down, certainly not as expensive as 15%. This wasn't on an sjlj target, was it? 'cos they're *so* last millennium.
The metric is SPEED not just easier development
Posted Apr 2, 2008 11:12 UTC (Wed) by dvdeug (subscriber, #10998) [Link]
Java the programming language doesn't use a virtual machine any more than C does. It happens to usually be implemented using a virtual machine, but there are native compilers, like gcj. Furthermore, the coding matters a lot more than the language, and the language can frequently simplify the coding.
+5, Insightful
Posted Mar 28, 2008 0:56 UTC (Fri) by man_ls (guest, #15091) [Link]Another +5 here. Only a small detail bothers me:
C being less friendly to shitty programmersHaving seen lots of horrible C code I think that shitty programmers feel as confident obfuscating C, C++ or Java code. Just the liberal use of global variables and gotos can get as bad as the worst class hierarchy.
You missed the point
Posted Mar 26, 2008 22:41 UTC (Wed) by sylware (guest, #35259) [Link]
Anything that makes dependent a system tool on more than the complexity of a C compiler should be trashed, period. Why? This is my limit for containement of the size/complexity of the system software stack. I won't go any further. As you perfectly put forward, a C++ compiler, even a non optimizing one, is hell on earth to code compared to a C compiler. A linker as a system C++ program would damage the size/complexity of the system software stack. My conclusion is horribly simple:gold has to go to trash and its coder should work on speeding the properly (namely C) coded ld (oprofile?).
What a narrow-minded viewpoint!
Posted Mar 26, 2008 22:55 UTC (Wed) by felixfix (subscriber, #242) [Link]
I don't have a list, but I am sure you use tools every day that were developed in some language other than C. Perl and Python come to mind, but at any rate, restricting your tool chain to C-based code is not possible nowadays. It isn't just narrow-minded to want that, it is burying your head in the sand to pretend it is possible.
You missed the point
Posted Mar 27, 2008 0:47 UTC (Thu) by ncm (subscriber, #165) [Link]
If sylware thinks he understands Gcc's C compiler, it can only be because he hasn't looked at it in a long, long time.
You missed the point
Posted Mar 27, 2008 0:49 UTC (Thu) by epa (subscriber, #39769) [Link]
gcc has an extremely complex codebase. Your argument would seem to suggest replacing it with a simpler C compiler such as pcc, in order to reduce the total complexity of the 'system software stack'. Similarly you should be running Minix or another kernel that is simple enough one person can read and understand all the code. And I assume you have no truck with the horribly baroque autoconf/automake/libtool rat's nest. From what I've read, gold is much simpler than the overly-general ld implementation it substitutes for. Of course, part of this simplicity is because it is written in a higher-level language. Often this is a worthwhile tradeoff - after all the compiler only has to be written and debugged once. Were this not the case, all programs would be in assembly.
You missed the point
Posted Mar 27, 2008 2:12 UTC (Thu) by elanthis (guest, #6227) [Link]
Your argument makes no sense. The C++ compiler stack is part of GCC, and the C++ portions of the compiler make up such a small percentage of the complexity of the rest of the stack as to be not worthy of mentioning. Plus, I'm fairly sure (might be wrong) that the current versions of GCC have merged the C and C++ parsers. The complexity of C++ does not mean that you get huge, unwieldly compilers. It just means that you have trouble implementing the spec 100% accurately. It's no different some a protocol like HTTP. HTTP (esp v1.1) is actually pretty hard to get fully implemented correctly. A lot of HTTP servers get it wrong, as do a lot of clients, and thus there are certain combinations of HTTP server and client that just don't work together. Despite this, a fully correct HTTP server or client implementation is still pretty short, sweet, and easy to read. HTTP doesn't force ugly code, it's just not as simple a protocol as one might think it is. You can think of C++ the same way. It doesn't require that much extra effort on top of C to write a compiler for, but it trying to make sure you cover 100% of the spec is harder than you might think given how very little C++ adds to the C language.
You missed the point too
Posted Mar 27, 2008 2:31 UTC (Thu) by sylware (guest, #35259) [Link]
If I need to rewrite from scratch a non optimizing C compiler it's easy. Look at tcc, and I have plenty of students who had the "small and simple" project of writing a C compiler. Of course, when we bring C++ on the table, you hear "insane", "crazy", "far to complex" etc... I was refering to *that* complexity, not the current complexity of the best utra-super optimizing compiler which is gcc.
You missed the point too
Posted Mar 27, 2008 11:04 UTC (Thu) by nix (subscriber, #2304) [Link]
But a random C compiler reimplementation isn't capable of compiling most of the other parts of the stack in any case. GCC can be compiled with just about anything that supports ISO C, but you'll need to reproduce a lot of GCC's (largely undocumented) foibles and language extensions before you can compile, say, the Linux kernel with it. I don't really see why the complexity of the *compiler* is relevant anyway. It's not as if GCC is going to abruptly go away or stop working, so its complexity doesn't negatively impact you at all.
You missed the point too
Posted Mar 28, 2008 17:20 UTC (Fri) by landley (subscriber, #6789) [Link]
Actually, I'm working on making tinycc (a project derived from tcc) compile the rest of the stack, including the kernel. I have rather a lot of work left to do, of course. :) I find gold interesting, but not useful in my case because tinycc's linker is built-in. (I'm reorganizing the code to work as a "swiss army knife" executable ala busybox, but that's not in -pre2. Maybe -pre3.) As for the kernel, the linux-tiny project is working on getting that more modular so we need to select less of it... Rob
You missed the point
Posted Mar 27, 2008 19:17 UTC (Thu) by tjc (guest, #137) [Link]
> I'm fairly sure (might be wrong) that the current versions > of GCC have merged the C and C++ parsers. The C parser was rewritten in gcc 4.1, and I *think* its still separate from the C++ parser.
You missed the point
Posted Mar 27, 2008 4:59 UTC (Thu) by artem (subscriber, #51262) [Link]
Well then you should really stay away from the programming for some time already. Guess what the language is used for the tools used in designing computer chips? (for reference, see, scroll down to the bullet labeled 'Intel')
You missed the point
You missed the point
Posted Mar 27, 2008 7:37 UTC (Thu) by pr1268 (subscriber, #24648) [Link]
Google has written a memory allocator library (to compete with the Glibc 2.3 equivalent, ptmalloc2), in C++.
Now, my understanding of the memory allocator is that this is a library whose run-time efficiency should be unquestioned. This is code that interfaces with the kernel nearly continuously. Accordingly, C++ would not have been my first choice of programming language in which to implement this (I would have chosen C, but don't mind me--I've never written a memory allocator before!).
But, Google's allocator library appears to have improved performance over the incumbent Glibc ptmalloc2 in certain scenarios, according to the graphs near the bottom of that page. And to think this was accomplished with C++ (I'm assuming that the Glibc ptmalloc2 is written in C, but I do ask someone to correct me if I'm wrong).
You missed the point
Posted Mar 27, 2008 11:05 UTC (Thu) by nix (subscriber, #2304) [Link]
Actually the memory allocator largely interfaces with itself and its userspace callers. Its interface with the kernel is restricted to the occasional sbrk() and mmap() calls.
You missed the point
Posted Mar 27, 2008 5:49 UTC (Thu) by lysse (guest, #3190) [Link]
How dare you be this dismissive of *anyone's* work without an alternative to offer? Especially on that flimsiest of pretexts, ideology? You want something done *your* way, do it yourself. Otherwise, take what you're offered. Telling someone that they have to junk what they've done is bad enough when they're only as far as having it working; when they're handily trouncing what they aim to replace, telling them that their replacement isn't "good enough" - because their choice of implementation language doesn't satisfy *your aesthetic tastes* - only exposes *you* as the fool you are. (Unfortunately, yours is the voice of the majority, and humanity is doomed.)
Being dismissive of another's work
Posted Mar 28, 2008 0:02 UTC (Fri) by giraffedata (subscriber, #1954) [Link]
How dare you be this dismissive of *anyone's* work without an alternative to offer?
The way I read it, sylware did offer an alternative: classic binutils 'ld'. He says even as slow as it is, it's better because of the C++ issue.
You want something done *your* way, do it yourself. Otherwise, take what you're offered.
Surely you don't mean that. We all take a third option all the time: do without.
You missed the point
Posted Mar 27, 2008 10:59 UTC (Thu) by nix (subscriber, #2304) [Link]
Um, ld's *algorithms* are wrong, and the wrongness is deeply embedded. The only way to speed it up as much as gold is is to rewrite it from scratch. Ian did that, and preferred to do it in C++. Feel free to rewrite it yourself, in whatever language you prefer. When you make something faster and easier to maintain than gold, come back to us.
Good point!
Posted Mar 27, 2008 15:31 UTC (Thu) by pr1268 (subscriber, #24648) [Link]
Agreed. If you choose C over C++ merely because C++ is "slow", "bloated", or "inefficient" then don't complain any further until you've rewritten all your applications in assembly language! Then we'll talk about efficient code.
Now, if you choose C over C++ because you're more comfortable, familiar, or experienced at it, then fine, but don't start making unsubstantiated generalizations about how C++ is slow, bloated, inefficient, etc. C++ isn't nearly as bloated or slow as it might have been a number of years ago. And, the Gold linker may improve this even further.
You missed the point, again.
Posted Apr 2, 2008 17:56 UTC (Wed) by sylware (guest, #35259) [Link]
You are missing the point full throttle, reread my posts.
C++ incompatibility history
Posted Mar 26, 2008 23:03 UTC (Wed) by jreiser (subscriber, #11027) [Link]The C++ version incompatibility and interoperability nightmare was still very much alive only TWO years ago.
C++ had a non-standard ABI on early Linux systems, leading to constant breakage of C++ programs. Upgrading one's system would often lead to many or sometimes even all C++ programs no longer working. This hasn't happened in many, many years, ...
Fedora Core 3 was still leading edge in August 2005. Its then-current software updates had gcc-c++-3.4.4-2 and compat-gcc-c++-8-3.3.4.2 because there were incompatibilities between 3.3.4 and 3.4.4. In September 2005, the newly-issued Fedora Core 4 had gcc-4.0.1-4 which was again incompatible with 3.4.4. Fedora Core 5 was released in March 2006, finally signalling that FC3 truly had ridden into history.
C++ incompatibility history
Posted Mar 27, 2008 0:27 UTC (Thu) by solid_liq (guest, #51147) [Link]The was a gcc problem. gcc had ABI compatibility problems leading into the 4.0 release with C too, not just C++.
C++ incompatibility history
Posted Mar 28, 2008 0:12 UTC (Fri) by giraffedata (subscriber, #1954) [Link]It's also important to note that the echoes of those historical compatibility problems can be with us for a long time. I try to use C++, but it's a trial, because I have systems that have roots going back to Gcc 2 days. There is no switch on these systems I can flip to recompile every program and library with a current compiler. A C++ program compiled with Gcc 3 will not work with an existing C++ library, and vice versa. So when I write new C++ code, I compile with Gcc 2, and probably always will.
I recently learned, painfully, that current 'ld' has a similar compatibility problem -- something to do with throwing an exception across object modules.
It's worth noting that none of these problems exist with C. I.e. the zero-headache alternative for me is to use C.
C++ incompatibility history
Posted Mar 28, 2008 3:49 UTC (Fri) by pflugstad (subscriber, #224) [Link]
Heh - I'm still forced to use a EGCS 1.1 cross compiler for a certain embedded OS I work with. Talk about painful. Even more so: it's running under an _old_ version of cygwin on windows (and if you know much about cygwin, you know the old versions had lots of interesting bugs and multiple versions on the same system don't play nice together, so it ends up trashing the more modern cygwin installs)... sigh... Sorry, just had to whine...
Not quite
Posted Mar 27, 2008 0:44 UTC (Thu) by ncm (subscriber, #165) [Link]As useful as I find C++, some of the above is not right.
There is no standard ABI for C++. G++ (in different versions) has two in common use, with a third coming soon; MSVC++ has others. (Other compilers tend to copy one or other of Gcc's or MSVC++'s, depending on target.) What is different now is that people have learned to include version numbers in the names of library files and library packages, so one rarely tries to link to a library built with the wrong compiler.
C++ code can be substantially faster than the best macro-obscurified C code, even without fancy template tricks. The reason is, believe it or don't, exceptions. Checking return status codes at each level in C (besides obscuring code logic!) is slower than leaving the stack to be unwound by compiler-generated code in the (unlikely) case of an exception.
Shitty programmers are more likely to code in C++ not because they're drawn to it, particularly, but because C++ is what everybody uses in Windows-land, and that's where most of them come from. That could be taken as a slight on typical Windows development habits, but it's really more a matter of the law of big numbers.
The only valid reason to consider C++ unsuitable for some particular "low-level" application is if the environment it must be linked/loaded into was built with a C compiler, and lacks the minimal support needed for, e.g., exception handling. An example is the Linux kernel. There's no reason Linux couldn't all be compiled and linked with G++ -- modulo some undisciplined use of C++ keywords as identifiers -- and then C++ drivers would be fine. However, it would be unwise to throw an exception in many contexts there.
Finally, the instability introduced in Gcc-4.x has a lot more to do with the optimizer than with changes to C++ or its implementation. That instability affected C programs (including the Linux kernel) as much as C++ programs.
None of these affect the conclusion, of course.
Not quite
Posted Mar 27, 2008 4:51 UTC (Thu) by wahern (subscriber, #37304) [Link]
Your theory about C++ exceptions being more performant than a comparable C pattern doesn't pan out. It's a similar argument the Java folk give: "Java *can* be faster, because you can do code optimization on-the-fly". The extra tooling that C++ must put into function prologs and epilogs--and is mandated by the various ABIs--for stack unwinding, as a practical matter, adds at least as much work, and usually more. There are tables to index into--often from within another function which must be called, and maybe using a pointer dereference. Any one of those can add up to several register comparisons. I dunno how function inlining effects exception tooling, but I imagine the relative losses only increase. For the rare instance where you really need to fine tune a block or routine, both C and C++ suffice. I once shaved 20% runtime by changing a single line--loop to GCC built-in; it was in C but would've applied equally to C++. In reality, C applications will be moderately faster. But in most cases we're comparing apples to oranges because, for instance, many people prefer exceptions. If they improve _your_ ability to engineer better solutions, and don't hinder others, there is no other justification required. I don't understand why people try so hard to prove that some feature "tastes better and is less fattening".
Imaginary losses
Posted Mar 27, 2008 6:16 UTC (Thu) by ncm (subscriber, #165) [Link]Can.
Not quite
Posted Mar 27, 2008 16:13 UTC (Thu) by BenHutchings (subscriber, #37955) [Link]
Most C++ implementations use range tables for exception handling today, so no extra code is needed in the function prologue or the non-exception epilogue. The possibility of a callee throwing can constrain optimisation of the caller, but so does explicit error checking.
Not quite
Posted Mar 27, 2008 20:35 UTC (Thu) by wahern (subscriber, #37304) [Link]
From my limited research, it seems the constraint is much more in C++, because C++ must preserve stack state (minimally, the mere existence of an activation record), whereas in C a compiler can obliterate any evidence of a function call, no matter whether or how the return value is used. Granted, I'm not aware of what kind of requirements the C++ standard mandates; certainly I'd bet in non-conforming mode a compiler could cheat in this respect. I'd like to hear some analysis on this. Inlining in general, though, is actually important, because in C one of the biggest fixed costs you have to keep in mind is function call. As shown in my example else thread, there's comparatively quite a lot of work to maintain the stack. This is, of course, a big deal in most other languages, too. If you've ever written much PerlXS (and peered behind the macros), at some point it dawns on you how much work is being done to maintain the stack--it's incredible! The fixed costs of maintaining call state in Perl dwarfs most everything else--excepting I/O or process control--including manipulation of dynamically typed objects.
Not quite
Posted Mar 27, 2008 22:28 UTC (Thu) by ncm (subscriber, #165) [Link]
For the record, nothing about exceptions in the C++ standard or common implementation methods interferes with inlining. In practice, the body of an inlined function is just merged into the body of whatever non-inline function it's expanded in. The only place where exceptions interfere with optimization is in that the state of a function context at a call site must be discoverable by the stack unwinder, so it can know which objects' destructors have to run. In practice this means that calls in short-circuited expressions, e.g. "if (a() && b()) ...", sometimes also set a flag: "if (a() && ((_f=1),b())) ...". This only happens if b() returns an object with a destructor, i.e. rarely.
an "old beard" ?
Posted Mar 27, 2008 1:22 UTC (Thu) by tialaramex (subscriber, #21167) [Link]
I guess I'm an "old beard". It's strange to hear that, maybe I should be more pleased than I am. I have an old edition of Stroustrup's book, unlike K&R it is dusty and lives on the bottom shelf alongside other technical works that proved useless or unreadable. I must say that, as a beginning programmer with some experience of C++ when I bought it, it was disappointing. A triumph of ego and verbosity, even. Well, on the one hand you're right, after literally decades of work C++ has more or less matured into a language that you can use to write software for the real world without incurring significantly more pain that C. The stable ABI in particular took a lot longer to arrive than it had any reason to, and longer than you've really allowed in your description. But that maturity comes with a lot of caveats. It was already arguably too easy to write C that you couldn't understand, thus making it unmaintainable, C++ provides any number of features which make that worse, and nearly every beginner text seems to emphasise these features as benefits. The result is that a new "C++ programmer" is often pumping out a mixture of pseudo-code masquerading as program code and Perl-style unmaintainable gobbledegook.. Is that inevitable in a C++ program? No, but the language definitely isn't helping. No-one, so far as I can see, is claiming that C++ actually made it significantly easier to write this linker (except perhaps in the sense that the author prefers C++ and he was writing it) or that its performance benefits are in any way linked to the choice of language. So it's understandable that there's concern that we're going to get ourselves an abandoned and unmaintainable piece of software in the core of the tool chain. Maybe one of the people who feels more strongly than me (and has more spare time, it's 0100 and I'm still working) will implement the same approach in C and eliminate the perceived problem.
an "old beard" ?
Posted Mar 27, 2008 2:33 UTC (Thu) by felixfix (subscriber, #242) [Link]
The problem many of us commenters have with sylware's comment is that it is ludicrous to expect a modern system to rely only upon C and avoid anything fancier. I commented on that above -- but I want to say a little more in response to this. I avoid C++ like the plague for my own purposes, for, I think, pretty much the same reasons -- it is far more complex for not much gain. It's been a long time since I did anything with C++, so maybe these comments will be rusty too, but two bad memories come back. One is malloc/free in C, as horrible as they are and easy to abuse, turning into three pairs of calls (new/delete and new array/delete array) -- mix them and have an instant mess -- not just in the two new ways, but in the additional traps of mixing them up. How can that be considered progress? The other bad memory was needing to specify virtual if you wanted to override methods -- what is the point of object oriented if overriding wasn't the default? The entire language struck me as more of a rushed standard to beat other OO versions of C, and then one pile of rushed patches to the spec after another. Nevertheless, some people get along better with C++ than others do with C. Forcing everyone to write in C will simply result in more bad matchups between personalities, projects, and tools. Old beards like UNIX because it is a system of tools which allow the users and developers to pick the right combination for them and the job. If forcing everybody to use C were the answer, it wouldn't be UNIX, it would merely be Microsoft "my way or the highway" but on the C highway instead of the C++ highway.
C++ features and performance
Posted Mar 27, 2008 5:34 UTC (Thu) by zlynx (subscriber, #2285) [Link]
Two of the problems you mention are caused because C++ is all about performance. Any language feature that will slow things down requires the programmer to explicitly use it. Array new is a separate function because it has to store the number of elements in the memory allocation. Making new and array new the same would waste a size_t for every alloc. Virtual has to be specified because it slows down the function calls. I have personal recent experience with virtual. I used virtual functions in an interface base class. After I got done profiling, I did explicit calls to class functions instead of virtuals in the derived classes and one use of dynamic_cast and then using the pointers with a template function. The code was over 20 times faster. The real killer wasn't the indirect jump, it was how virtuals block inlining and most compiler optimization, since it can't know what function will really be called.
Making up falsehoods
Posted Mar 27, 2008 7:01 UTC (Thu) by ncm (subscriber, #165) [Link]
What the commenters above are expressing is simply fear of learning. (Read a modern C++ program, and you won't find any calls to "new" or "delete", array or otherwise. "Virtual" isn't the default because it's only rarely the right thing. It's been years since I typed the keyword "virtual" in my own C++ code.) If you don't chafe at the lack of expressiveness in C, Java, or C#, it can only be because you're not trying to express much of anything. Ian chose C++ not just because he "prefers" it (whatever that means). He chose it because it's demonstrably better at expressing complex solutions to complex problems. For an easy problem, any old language will do. Most problems are easy, and most programmers spend their lives solving one easy problem after another. They can use whatever toy language they first encountered, and never learn another thing. People drawn to hard problems want the sharpest tool they can get. Right now C++98 is that tool. (C++09 will be a sharper tool.) Nothing else even comes close, and nothing on the horizon looks like it will. That's too bad, because a language equally powerful but a tenth as complex ought to be possible, but none seems to be forthcoming yet.
Making up falsehoods
Posted Mar 28, 2008 2:34 UTC (Fri) by wahern (subscriber, #37304) [Link]
You don't chafe at the lack of lexical scoping? Nested methods? You don't pine for proper tail recursion?
People complain that C++ doesn't have threads built in, and the standard retort is invariably that the next standard will provide built in mutexes and other sugar. But that's not expressive. If you want expressive concurrency, checkout Limbo's channels or Erlang's messages. Just because you can approximate something doesn't mean you've captured its expressiveness.
And how is a language where the majority of the operators and modifiers are English keywords, wrapped in an endless series of punctuation marks, expressive? Reading overly wrought C++ code can be like reading a court reporter's short-hand, except you can never be sure what the proper translation is from one compilation unit to the next--certainly not from one project to the next. And if you keep it clean, you're not exercising all those expressive features.
Combine GCC extensions like the typeof() operator and statement expressions, and/or some M4 pre-processing, and you end up with code only nominally less readable than template definitions, yet just as type-safe.
The first step to solving a complex problem is to first reduce it to a set of simple problems. You then choose tools which best solve the simple problems. (Of course, most problems are really simple, so its sensible to use any one general purpose language.) I see these gargantuan C++ projects, and I think to myself C++ is more of a plague than anything else. Some people tout KIO as the greatest thing since sliced bread; but I'm sitting on the sidelines, thinking I wish my non-KDE applications could benefit from that. Some "solution", that feat of super-charged object-orientation, walled up behind a language that says "my way or the highway". That kind of expressiveness is light years behind fopen()--usable in C, C++, Perl, Awk, Java, C#, Lua, TCL, Python, Haskell, Ada, and nearly any other language one could find on their system.
People claim that C++ is "multi-paradigmatic". Oddly, it fails to provide the most useful and expressive alternative paradigms out there. And with all the nice shiny features, even all the tried-and-true paradigms--like process modularization--are too often left out in the cold. If you've got the world's greatest set of hammers, everything looks like a nail.
If you like C++, great. It is... a language. Just like any other, except a little more practical than most, and much more widely used (due in large part to near universality in the Microsoft community). I don't use C++, because I routinely use more than a half-dozen other languages--and the one that binds them all: C.
Making up falsehoods
Posted Mar 29, 2008 7:56 UTC (Sat) by ncm (subscriber, #165) [Link]
It's no crime not to like any particular language. (Lord knows I loathe my share of them.) When you have to invent one falsehood after another to justify your dislike, though, it makes you look silly, or dishonest. I know of plenty to dislike in C++; they tend to be inconveniences in features entirely lacking in other languages. But, for the record... Lexical scoping, we have. Tail recursion? Pass; over twenty-five years using C and C++, every time I have been tempted to leave a tail recursion in my code, changing it to explicit looping has turned out to make the code clearer and more maintainable. (Certainly there are languages that do or would benefit from it, but C and C++ seem not to need it.) Nested "methods"? Coming, more or less, in C++09. Also coming are mutexes and atomics, but more important is that they can be built into whatever higher-level apparatus you prefer. The great lesson of C was that anything you can build into a library, you are better off without in the core language. (For C, particularly, that was I/O. People miss how revolutionary that was thought, then.) C++09 adds enormous power for library writers, to enable easier-to-use libraries, which will in turn make the language markedly more competitive against scripting languages.
Making up falsehoods
Posted Apr 3, 2008 18:05 UTC (Thu) by jchrist (guest, #14782) [Link]
I'm genuinely curious. If "modern C++" programs don't use new/delete or virtual, how do you dynamically allocate/deallocate memory? What do you use instead of virtual functions?
C++ new and delete
Posted Apr 7, 2008 0:49 UTC (Mon) by pr1268 (subscriber, #24648) [Link]
how do you dynamically allocate/deallocate memory?
A big push for "modern" C++ programming is to use the standard library's container classes, e.g., vector, list, deque, etc. instead of arrays created with new and delete.
The primary rationale for using dynamically-allocated memory in the first place is to defer until execution time reserving only as much space as is needed (since memory is a scarce resource). The C++ containers have a rich set of methods which allow array-like operation while managing the dynamic allocation (and subsequent releasing) of resources at the library level (instead of making the programmer do it him/herself with new and delete).
I can't speak for why virtual methods are seldom described in literature, but my intuitive perception is that they're this philosophical concept in computer science (object-oriented programming in particular) whose existence programmers are expected to know but avoid using unless no other practical solution exists--kind of like recursion.
I see I have to be more explicit
Posted Mar 29, 2008 7:21 UTC (Sat) by felixfix (subscriber, #242) [Link].
an "old beard" ?
Posted Mar 27, 2008 10:17 UTC (Thu) by jschrod (subscriber, #1646) [Link]
>. If you read the article, this was not because he used C++. He was reluctant if other people will understand his finite state automaton, that needs to be understood overall to see what the code does. FSAs tend to distribute functionality to small pieces of code where the connection is often not easily visible. Many programmers can't handle that properly.
an "old beard" ?
Posted Mar 27, 2008 12:10 UTC (Thu) by tialaramex (subscriber, #21167) [Link]
I did read the article, and I agree that C++ doesn't inherently make his state transition stuff harder to understand. But it also doesn't help. That's all. I guess there are languages which would, but I don't know if they're also suitable for the low-down bit mangling the linker does elsewhere.
finite state machines
Posted Mar 29, 2008 1:33 UTC (Sat) by man_ls (guest, #15091) [Link]Not that I know of. Finite state machines are actually hard to code and read in any language, so your argument (C++ somehow made gold more difficult) sounds like a red herring to me.
Oddly enough, it seems this is an area where graphical programming should help: state diagrams (or flowcharts) can really help you understand a state machine. But apart from some of the new BPM tooling, which covers a similar but different problem space, that idea hasn't flown either.
finite state machines
Posted Mar 29, 2008 7:30 UTC (Sat) by salimma (subscriber, #34460) [Link]
FSMs are trivial in languages with tail-call optimization (Lisp et. al., ML, Haskell .. even Lua!). It is true, though, that most of these languages are not geared towards low-level bit manipulation. C--, perhaps. It's a C-like language used by the Haskell team as their intermediate language, a sort of souped-up assembler.
finite state machines
Posted Mar 29, 2008 12:39 UTC (Sat) by man_ls (guest, #15091) [Link]Oops, you are right: FSMs are indeed easier to implement in those languages. My big mouth again.
They are still pretty hard to follow and understand. Which is of course the concern of the author of gold. But maybe even this can be alleviated with functional programming; on the 7th Antual ICFP Programming Contest functional languages were shown to be an order of magnitude better at writing input for FSMs than imperative languages. I'm not so sure any longer.
So thanks for the clarification, and please disregard my earlier uninformed comment about a red herring.
No-one?
Posted Mar 27, 2008 10:18 UTC (Thu) by khim (subscriber, #9252) [Link]
<p>.
C++ problem
Posted Mar 27, 2008 16:16 UTC (Thu) by ikm (subscriber, #493) [Link]
In its essence, C++ just takes all the common concepts pretty much any complex C program uses and makes it part of a language itself, offloading the associated implementation costs from the shoulders of the programmer to the compiler itself. C people do the same C++ inheritance (in form of one structure having another one as the first member, and sometimes even having a macro to do upcasts, like e.g. offsetof macro in linux kernel), have the same member functions (which are usual functions that take the associated structure pointer as the first parameter), virtual functions (in form of the structures having pointers to functions, which in essence is making vtables by hand), same constructor and destructor functions which are to be carefully called every time the associated structure is created or deleted; instead of namespaces they put long common prefixes. If we drop here other C++'s concepts, namely templates and exceptions/rtti, we see that C++ is just automating things that were to be done same way manually, saving people from doing lengthy and error-prone routine they'd have to go into in bare C. The end result is supposed to be exactly the same, since the compiler pretty much does exactly what a human would do, it just does that very pragmatically and systematically. I have to admit that when I first saw linux kernel sources, I was amazed to see very strict C++ code carefully and duly implemented in bare C. From there, it was quite easy to feel the actual problem C++ has. It is not performance at all, or compatibility problems, or whatever else people usually like to attribute here it's just the complexity and the associated incorrect uses and/or abuses of power, resulting in bloat, inefficiencies and incorrect runtime behavior. To program in C++, one have to actually understand all the background work the compiler does, e.g., calling constructors/destructors in the right places and in the right order, building vtables and using them, passsing 'this' pointer to member functions, adjusting pointers when doing casts and so on. Templates and STL further complicate that by emitting large amounts of code at compile time and making heavy use of dynamic memory at runtime, with no apparent notice to the unwary programmer. In essence, C++ has some cost other than just an increased compile time. Thing is, this cost is not technical. If linux kernel were to be implemented in C++, it would have had much less developers, or would otherwise be turned into dysfunctional bloatware in no time. I myself would never start a project in bare C if I wouldn't have to. I even program for microcontrollers in C++ if there is a capable compiler available (i.e. a gcc port). But I understand that this approach does not always work for all people. It's simply just too complex, and therefore harder to do right many people would seem to sacrifice other resources to make it simpler, and in case of C that would be doing everything manually, by hand.
Linux is a registered trademark of Linus Torvalds | https://lwn.net/Articles/275137/ | CC-MAIN-2017-30 | refinedweb | 10,213 | 60.35 |
Using histograms to plot a cumulative distribution¶
This shows how to plot a cumulative, normalized histogram as a step function in order to visualize the empirical cumulative distribution function (CDF) of a sample. We also show the theoretical CDF.
A couple of other options to the
hist function are demonstrated.
Namely, we use the
normed parameter to normalize the histogram and
a couple of different options to the
cumulative parameter.
The
normed parameter takes a boolean value. When
True, the bin
heights are scaled such that the total area of the histogram is 1. The
cumulative kwarg is a little more nuanced. Like
normed, you
can pass it True or False, but you can also pass it -1 to reverse the
distribution.
Since we're showing a normalized and cumulative histogram, these curves
are effectively the cumulative distribution functions (CDFs) of the
samples. In engineering, empirical CDFs are sometimes called
"non-exceedance" curves. In other words, you can look at the
y-value for a given-x-value to get the probability of and observation
from the sample not exceeding that x-value. For example, the value of
225 on the x-axis corresponds to about 0.85 on the y-axis, so there's an
85% chance that an observation in the sample does not exceed 225.
Conversely, setting,
cumulative to -1 as is done in the
last series for this example, creates a "exceedance" curve.
Selecting different bin counts and sizes can significantly affect the shape of a histogram. The Astropy docs have a great section on how to select these parameters:
import numpy as np import matplotlib.pyplot as plt np.random.seed(19680801) mu = 200 sigma = 25 n_bins = 50 x = np.random.normal(mu, sigma, size=100) fig, ax = plt.subplots(figsize=(8, 4)) # plot the cumulative histogram n, bins, patches = ax.hist(x, n_bins, density=True, histtype='step', cumulative=True, label='Empirical') # Add a line showing the expected distribution. y = ((1 / (np.sqrt(2 * np.pi) * sigma)) * np.exp(-0.5 * (1 / sigma * (bins - mu))**2)) y = y.cumsum() y /= y[-1] ax.plot(bins, y, 'k--', linewidth=1.5, label='Theoretical') # Overlay a reversed cumulative histogram. ax.hist(x, bins=bins, density=True, histtype='step', cumulative=-1, label='Reversed emp.') # tidy up the figure ax.grid(True) ax.legend(loc='right') ax.set_title('Cumulative step histograms') ax.set_xlabel('Annual rainfall (mm)') ax.set_ylabel('Likelihood of occurrence') plt.show()
References
The use of the following functions, methods, classes and modules is shown in this example:
Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery | https://matplotlib.org/3.4.3/gallery/statistics/histogram_cumulative.html | CC-MAIN-2022-27 | refinedweb | 433 | 51.55 |
It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I was wondering if there is a way to restrict creation of an issue type based on which role or group the creator is in.
For example, I want only Developers to be able to create a new feature or enhancement.
Hi, this isn't possible for OnDemand. Only the downloadable version can do this.
There was an issue for this: but has been resolved as won't fix.
Discussion:
Yes, this can be done out of the box, Peter. First, create a group containing only the developers you want to have access to creating this type of issue. Next, on your workflow for that particular issue type, go to the origination step for the worklow - for example, 'Create Issue'. Add a validation step of type permission and select the group you created in the first step above. of course, you should test it to assure it's working correctly prior to publishing the change (if you don't want to cause potential problems with your users). Anyone not in this group has no access to creating that issue type. They simply would not see it in the dropdown.
I don't see an option to add validators based on groups. Can you post a screenshot? (probably not since this post is 3 years old!)
The permissions validator no longer contains an option to specify a user group; you may only specify a permission (e.g., Create Issue) which is useless since this would deny the person from creating any issue type.
That's what I thought. It looks like using Script Runner is the only option. Otherwise you need to create a separate project
Actually, there is another kludge I forgot about that I do one on our projects. I forgot to note this in my latest reply. I knew we had a working example of this somewhere.
Say you only want administrators to be able to create a certain issue type - in my case, I use a custom API to import a ticket from my support system into JIRA. You likely have one or more permissions in your project that are restricted to admins only (e.g., "Delete All Comments" in my case since this is something I only want a few people doing. For this permission, it should contain a group or persons able to do this. In my case, it contains the group, "administrators" with handful of people since we won't want to lose the trail of comments added for this project).
Now, from your workflow for that issue type, go to the Create step and add a validator of type "User Permission Validator" and choose the "Delete All Comments" permission.
Although everyone can still see that issue type, and even populate the Create form, when trying to submit the form, an error about not having this permission results.
We control it using the 'Move Issue' permission in manner mentioned here...so only users in group with 'Move Issue' permission can then create issues in that workflow which has the effect of restricting the issue types that the user can select when creating issues. e.g. we allow 'normal' users to raise stories and issues but not designate something as 'bug' etc. This has to be done after review.
I can't seem to get this working. Any suggestions?
What I did on the 'create' transition in the workflow specific for issue type Idea:
* Delete the standard validator 'only users with -create issue- permission van execute this transition'.
* Add the validator 'only users with -set issue security- permission van execute this transition'.
* In the permission scheme of the project I added only one specific user to the permission 'set issue security'.
Nonetheless, anyone with access to the project can create an issue of the issuetype Idea.
Technically, there is a "hack"ish work-around. You can add the group/s to a permission scheme setting (e.g., Set Issue Security, or something you're not currently using), and then add a Validation to the Create transition of the workflow for that permission (which is available in OnDemand).
I can't seem to get this working. Any suggestions?
What I did on the 'create' transition in the workflow specific for issue type Idea:
Nonetheless, anyone with access to the project can create an issue of the issuetype Idea.
@Tom De Cock Try running the Permissions Helper - - to see if that lists anything that helps understand what permissions the user has access to that they should not. Almost certainly, there's another permission or role that the users have access to granting them greater access than they should have. It's just too wide open of a scenario for me to help with without having access to your setup.
Also, you may have just been using a single user as a quick test for this solution, but I always recommend that Permissions be tied only to Roles, and Roles tied only to Groups. This makes it easier to manage permissions by making sure a User is in the correct groups. It also makes the traceability easier to follow to understand a user's permissions.
Hopefully, some of that helps!
Hello,
Could anybody point me to the solution for the downloaded version of JIRA?
Cheers & best :)
I recently created a plugin that might help you. I'm open for suggestions to make it better. Cheers.
Another option is to use the free Script Runner add-on. That adds the option to add a simple script as a validator on the Create transition. With this you could add the following validation to a transition is an issue-specific workflow:
import com.atlassian.jira.component.ComponentAccessor def groupManager = ComponentAccessor.getGroupManager() groupManager.isUserInGroup(issue.reporter?.name, 'some group')
Wilton's solution is more elegant, since (if I'm not mistaking) does not even offer the user to create an issue of a certain type. This solution will show an error when the user tries to submit an issue of the type he is not authorized for.
Hi
I am new to script runner and if I wish to put multiple groups in the below line , what should be the syntax ?
groupManager.isUserInGroup(issue.reporter?.name,
'some group'
)
Thanks !
hi,
Thanks for the code. What if I need to add a condition for issue type? Two of my issues use the same workflow action. So how do I modify your script to trigger only if the issue type is lets say "User story"
Hi Wilton,
Would you plugin work on JIRA 5.2.X version ? I've been looking for this kind of features for years !!
Thanks for your reply
I can see that this is an old question, but I had the same today. I put my solution here for anyone's benefit.
There is a suitable validation option called "Users in a field are/aren't in a project role".
So the steps to set it up:
- Optional: create a JIRA (security) group (say "Special Users Group").
- Create a role (say "Special Users Role") (see How to add project roles)
- Update your workflow
– Select the Create Task transition, and add a validation step
– Use the "Users in a field are/aren't in a project role" validator
– The "Special Users Role" should show up under the "Selected project roles" section
– Fill in validator properties as needed
- Assign your users to the "Special Users Role", optionally via the "Special Users Group".
Hi Balint,
I do not have the "Users in a field are/aren't in a project role" validator option, although I do have defined roles associated with the project. Any advice as to why this would be happening? I am using the cloud-based version.
Thanks.
Hi there,
unfortunately not. You should seriously update your JIRA.
With Workflow Enhancer for Jira you can create a Universal Validator that checks [groups] user is in, evaluating to true or showing a custom error message to user.
Hey, this sounds great. Can you point me to an example of how to formulate this validator ? I want to check that the user belongs to the group INT_ECO if he wants to create an issue of a certain type.
Might not be exactly what you're looking for, but we've just achieved this by creating a workflow for each of the task types. We can then apply different validators to to each workflow to ensure only certain groups can create certain task types.
This means our API can create Tasks, but users cannot. However, uses can create Sub-tasks on the tasks created by the API.
It's a right faff but it works and we refuse to pay for extra plugins for things that should really be built-in from the start,
Know this is an old thread - but I had the same dilemma and solved it by adding a 'Universal Validator' on the Create. | https://community.atlassian.com/t5/Jira-questions/Restricting-issue-creation-of-certain-types-based-on-user/qaq-p/32785 | CC-MAIN-2019-09 | refinedweb | 1,505 | 62.88 |
How to reduce video size [ up to 90%]
Step 1:
go to handbrake.fr click here.
Step 2:
download and install software.
Step 3:
import file which you want to convert.
Step 4:
select from available presets if you are beginner.or if you know about handbrake then you can do it manually.
Step 5:
select your video format mp4 or mkv.
Step 6:
select web optimized if you want to send video via the internet or want to upload video to youtube.
Step 7:
from video section if selected cropping automatic and values are not 0 then it will crop your video so change it to custom and set that values to 0.
Step 8:
select video codec as per your requirement.
* h.264 is recommended.
Step 9:
set your video quality. 20 to 23 is better.set it as your requirement.
Step 10:
from audio section set the bit rate to 128 kbps.
Step 11:
- subtitles and chapters are not that much important.
- previewing your video quality is better because video compression takes lots of time and if that quality is not as per your requirement then it is waste of time so let’s see how to watch your video preview.
- select preview and set your preview duration and select preview.
- After previewing your video click on start encode.
Discussions
1 year ago
Thanks for sharing :) | https://www.instructables.com/id/How-to-Reduce-Video-Size-Up-to-90/ | CC-MAIN-2019-22 | refinedweb | 229 | 77.03 |
OCTOBER 2013
Farming
Isuzu D-Max
Is latest automatically better?
CHALLENGER is gearing up to introduce its most powerful tracked tractor ever, the MT875E. Producing a rated output of 590hp, the new flagship generates a maximum power of 640hp – over 30hp more than the current MT875C.
See pages 16-17
the all new
Vacuum Bracket
■ Simple & quick fixing for modern electro-hydraulic control boxes straight to the glass, no more drilling of cab interiors. ■ Easily fixed & removed in seconds ■ Available from dealers throughout the area
Dynamica Ltd
Enterprise Road Industrial Estate, Mablethorpe, Lincs. LN12 1NB Tel: 01507 477355 • 01507 473052 Fax: 01507 478832
See pages 18-19
COVERING THE HEART OF ENGLAND’S FARMING COMMUNITY FROM THE THAMES VALLEY TO THE SCOTTISH BORDERS
It is due to make its debut at Agritechnica 2013 at the Exhibition Ground, Hanover, Germany, on November 12-16, and is one of four new MT800E Series models. The MT845E generates 494hp and 1611lb-ft of torque, the
John Deere goes compact for 2014
MT855E offers 542hp and 1778lb-ft and the MT865E 594hp with 1907lb-ft. Torque
produced by the MT875E is an incredible 2120lb-ft.
Continued on page 10
2
OCTOBER 2013
TV Philippa takes the wheel for BBC harvest PRESENTER Philippa Forrester pulled on her wellies to film a state-of-the-art New Holland CR8080 SmartTraxTM combine for a series of three BBC Harvest programmes. An experiment was held on the Essex farm of Guy Smith to establish what the difference is
between a modern combine harvester and a more traditional way of bringing in the harvest. Using the CR8080 from local dealer Ernest Doe, Forrester showed viewers how a modern machine brings together all the separate operations that our ancestors carried out during the
The film crew prepares to shoot the New Holland CR8080 SmartTraxTM.
harvest and took control to get a feel for the output of a modern harvester. A BBC spokesman said: “Equipped with New Holland’s GPS guidance system IntellisteerTM, Philippa managed to resist the temptation to grab the steering wheel and take a straight swath out of the field.” Apparently Philippa managed to harvest an average of 11kg of wheat a second during her stint behind the wheel. “To offer a contrast and a glimpse of a bygone age, volunteers learnt the art of hand cutting wheat with hooks and scythes while a veritable army of local schoolchildren was gathered to relearn the lost art of hand threshing,” said the spokesman.
Presenters Philippa Forrester, left, and Gregg Wallace, right, with farmer Guy Smith.
“Led by co-presenter Gregg Wallace and equipped with pillow cases, bats, sticks and even tennis rackets, the volunteers proceeded to thresh the cut crop and then using sieves and a further measure of manual labour, were introduced to the art of winnowing – using wind to clean the crop.” The BBC Harvest Programme, intended to give the wider public an in-depth view of harvest time, was broadcast on September 11-13 but is still available to view on iPlayer.
OCTOBER 2013
Maschio Power Harrow Spares New and Used
E lectro nic S o lutio ns:
A uto m a tic G a te K its
L o w C o st,U K bu ilt 12/24 vo lt,B a cklit H a ndheld L a ser R P M - N o w £45 A rea m eters H a ndheld W ind Speed Ta cho m eters, m eter - £30 D ista nce So la r P o w ered A ctu a to r D ista nce lighting ..
A nd M o re..
So la r o r M a insP o w ered
a nd po sitio n co ntro l Seed D rillTra m line C o ntro ls B a le W ra p C o u nters, C ha in B ra ke M o nito rs
Contact Richard Richard M iller Contact Miller 01430 860254 860254 •• 07889 07889 808745 808745 01430
L inea r A ctua to r Ram s
From £102
0 From £6
M o nito rs a nd C o ntro ls
3
K eyfo b C o ntro lled R o bust Industria lA ctua to r 2 ga te o r la rge ga te o ptio ns. M a ny ava ila ble extra s.
U K O fficia lD istribu to r N extD a y Sa lesa nd R epa irs. W a rner E lectric,Tho m pso n a nd L ina k. R epla cem entu nitsfo r M F,FN H Jo hn D eere,JF a nd m a ny m o re.
H o llin A pplica tio ns L td. Tel.01388 529000 Fa x.01388 526474 em a ilw rights@ ho llina pplica tio ns.co .u k w w w .linea ra ctu a to rs.co .u k
TYRE DISPOSAL TRADE & COMMERCIAL Collection & Environmental
Recycling of Tractor-Truck-Industrial & Car Tyres
UK LIMITED Collection throughout Central & Eastern England
PLEASE CALL 0845 331 2747
4
OCTOBER 2013
BULK BINS Finnish firm offers Available from 6 to 28 tons
Wanted and For Sale Tel: 07774 737966
KUHN POWER HARROW SPARES
REPAIRS OUR SPECIALITY
Large stocks of New and Used Spares Exchange Gearboxes and Bearing Housing Assemblies NEW BEARING AND SEAL KITS available for most popular makes and models KUHN POWER HARROWS FOR SALE WITH WARRANTY
DAVID WOOD
more little tractors
VALTRA is expanding its A Series tractor range with the introduction of new smaller models. The A53, A63 and A73 three-cylinder tractors are intended for fruit farming and property maintenance, among other applications. The Finnish manufacturer’s line-up now ranges from 50hp up to 400hp. The A Series model line-up also includes compact and orchard tractors. The compact tractors are available with or without a cab, while the orchard models are without a cab. Orchard tractors are 1.6m to 1.7m wide, while the compact tractors are 1.9m to 2m wide. The A53 offers 50hp, the A63 model has an intercooled turbo engine that produces 68hp and the biggest model, the A73, offers 75hp.
Tel: Doncaster (01302) 872257 / 872585
Some open cab N Series models will soon be rubbing shoulders with this older type.
All of the tractors come with Valtra’s 12+12R transmission with synchronised shuttle and creeper gear. The PTO has two speeds, and the linkage is operated mechanically. All models are available as either rearwheel drive or four-wheel drive and have hydraulic multidisc brakes. The open cab is fitted with a rollover bar and removable roof. The closed cab version is based on the traditional Valtra A Series cab and offers an ergonomic and optionally airconditioned workspace that can be accessed easily from either side of the tractor. Valtra has also expanded its N Series with the introduction of three new models. The N103.4 brings a four-cylinder alternative to the lower end of the model line-up alongside the compact N103 model. The bigger N103.4 is a front-loader tractor that offers a wide range of equipment and features. Valtra says the AGCO power 4.4 litre SCR engine has excellent low-end torque and is extremely fuel efficient. The maximum output of both models is the same at 111hp. The N103.4 is available with a three step HiTech transmission or a five step HiTech5 transmission. Also available on the new model, as on the N113 and N123, is the HiTrol turbine clutch, which enables smoother starts. HiTrol is also now available on three-cylinder N93 and N103 models.
Look a gift horse in the mouth A HORSE being offered as a swap for ‘a quid’ or a motorbike and a partially blind pony being offered free to a new home are just two examples of the worst online horse advertisements being highlighted by the Pet Advertising Advisory Group (PAAG). The group comprises representatives from the UK’s leading animal welfare groups and specialist agencies including Blue Cross which has to deal with the fallout of inappropriate advertising on a daily basis. PAAG has launched a set of minimum standards for websites offering pets for sale, including horses. They have been developed to improve the welfare of the pets and to protect members of the public from the risk of ending up with sick, dangerous or even illegal animals. The standards have also been endorsed by the Department for Environment, Food and Rural Affairs, and Lord de Mauley, the Minister for Animal Welfare, who gathered the leading online pet classified websites together to discuss the need for urgent improvement. Some of the worst online ‘pet’ adverts include: ● A free mini Shetland pony stallion who would make a good companion or lawnmower ● An 11-year-old girl pleading to borrow a pony for £10 a week ● Very rare zonkey (zebra/donkey cross) for sale ● An underweight and injured 20-year-old ex-racehorse needing a foster home ● Four miniature Shetlands free to good home. Kath Urwin, manager of the Blue Cross Rehoming Centre at Rolleston, said: “Indiscriminate advertising can be dangerously misleading, often resulting in inappropriate, but often well-meaning homes, which can put the animal’s future welfare at serious risk. “Horses and ponies are large and costly animals to keep. They need specialist facilities and care from knowledgeable and experienced people. It’s unethical to treat them as cheap or even disposable commodities as many of these advertisements do.”
Three new younger siblings will join this Valtra A93 – the A73, A63 and A53.
The selection of Versu and Direct models has also been expanded to include lower horsepower models in the N Series with the introduction of the N123 Versu and N123 Direct. Thesehp and 516lb-ft of torque with boost. For more information visit
Axion proves it can cut it
The new CLAAS Axion 950 goes to work with a Quadrant 3300 baler.
THE full production version of the CLAAS Axion 900 tractor has made its UK debut. CLAAS says that with power outputs ranging from 320hp up to 410hp, the Axion range includes the most powerful conventional tractor on the UK market. A spokesman for the firm said: “The Axion 900 range features a completely new ‘ground-up’ design which has set the model for subsequent new tractor ranges, such as the Axion 800, which will be launched next year, and the latest Arion 600 and 500 series tractors. “A key feature of the Axion 900 range is the new four pillar cab design, which offers a high degree of operator comfort and space, while also providing
superb all-round visibility. “To achieve this, the cab has been mounted forward of the rear axle and the ‘B’ pillars have also been moved forward to give the operator unparalleled visibility over the widest of implements.” He said that inside the cab, all the main functions were controlled using the new CMOTION hand control which enables all the main operational functions to be controlled using just three fingers. In total, four Axion 900 models are available, all powered by FPT Cursor 9, 8.7 litre six-cylinder 24-valve engines with SCR technology with power outputs of 320hp, 350hp, 380hp and 410hp. The Axion 900 made its UK debut at Tillage.
UK
IM PORTER OF
Only 79p an issue when you subscribe – see page 19 KA TE’S BRIDG E, THURLBY,BO URNE, LINC S PE10 0EN
Hom b urg Dra in c le a n e rs
•Sa les •Servic e •Hire Te l: 01778 560466/560425 M ob : 07767 816555
w w w .fe n ton s ofb ourn e .c o.uk E m a il: gle n @fe n ton s ofb ourn e .c o.uk
OCTOBER 2013
5
6
OCTOBER 2013
Farmer turns to Kramer after loader was stolen
The little Kramer can raise loads of 1200kg up 4.3m.
HALL Farm near Reading has taken delivery of a Kramer mini telehandler for cleaning, feeding and handling tasks in confined spaces after the farm’s previous skid steer loader was stolen. Supplied by local dealer Southern Harvesters, the Kramer 1245 now forms part of the farm’s extensive fleet of equipment and is being used seven days a week. Hall Farm’s dairy unit manager said: “Besides being highly versatile, the Kramer can pretty much manage
Hall Farm’s making the best of a bad situation – one of its skid steer loaders was stolen, so now they are using a new Kramer 1245.
Power for the 1245 comes from a 40hp Yanmar diesel.
80% of the jobs carried out by our large telehandler, which is impressive for such a small machine.” Powered by a 40hp Yanmar diesel engine, driving all four wheels via a hydrostatic
transmission, the 1245 has a lateral engine position, allwheel steering and centrally located boom arm. It measures 2.92m in length by 1.56m wide. It can lift 1200kg to a maximum height of 4.30m.
Alastair’s going online to give farming survival tips SPECIALIST advice and expert guidance is now available online for owners and operators of New Holland equipment. The firm has launched its own online community dedicated to the agricultural world, A spokesman for the firm said: “My New Holland offers all the functionalities of a virtual community, providing a meeting place to share information, experiences and opinions on topics related to farming and machinery. “The feature that will make My New Holland stand out from other online communities is called ‘the Special’. A guest expert – a recognised authority in his specialty – will be invited to hold a discussion on a topic of his choice that is relevant to the farming industry. “All My New Holland members will be invited to contribute their comments, opinions, material or images, driving the conversation forward with the guest expert. Topics will cover everything from conservation agriculture to efficient farming practices. “Each discussion will be open for a
number of weeks; subsequently a white paper will be produced and made available for downloading.” He said that the first ‘Special’ would involve Alastair Brooks. “Alastair is farm manager at Waddesdon Estate and winner of the Farmers Weekly 2010 Farm Manager of the Year award,” he said. “He makes the case for farmers joining environmental schemes in the first My New Holland Special. It’s about the survival of farming businesses, according to Alastair, whose unimpeachable credentials as a businessman are backed by his latest venture, where he turned Waddesdon Estate around in just four years. “He’s introduced new cultivation strategies and a new cropping policy, as well as constantly looking for new ways to make the estate ‘profitable to the max’. “Participation in environmental schemes is also about the sustainable intensification of agriculture: farms are part of an ecosystem, and farming practices that aim to intensify crop production through the management of biodiversity and ecosystem
Farm manager Alastair Brooks will be the first My New Holland ‘Special’ to appear online.
services will ultimately deliver growth that is sustainable in the longer term.” Owners of New Holland equipment can also gain access to extra premium content that will help them get the best from their machines. They can register the machines they own in their profile and download their models’ operator manuals and useful material from the training courses.
Put your combine up on blocks, says tyre specialist SPENDING a few minutes checking combine tyres after harvest and preparing them correctly before putting the machine into storage could result in big savings for farmers, according to Mitas Tyres. The Norfolk based company recommends taking the wheels off combines when they’re not in use and putting the vehicle up on blocks.
Mitas UK automotive engineering manager Ron Wood said: “Replacing combine tyres is very expensive and so it makes sense to look after them correctly. “A key part of the process is to ensure that tyres are stored correctly between harvests, because this will maximise their life, avoid costly failures and minimise unplanned downtime
at a critical time of the year. “During the nine or 10 months when the machine is not being used it should ideally be supported on blocks to take the load off the tyres, which should have their inflation pressure reduced to 0.7 Bar. If it is not possible to store the combine under those conditions, inflating the tyres to their normal operating pressure will prevent flat spots from developing when the machine is static for long periods. “Pressures should also be checked periodically and, if possible, the combine moved slightly to rotate the tyres, so that the weight rests on a different part of the circumference,” he said. “Tyres should also be protected from direct sunlight by storing the machine in a closed, dark barn, but if that is not possible then each one should be fitted with an opaque cover to prevent light from degrading the rubber. “Combine tyres do not tend to ‘wear out’ in the conventional sense and can have a very long service life. Most still have plenty of tread remaining even when they actually need replacing, so potential problems often go unnoticed.
“However, any shortfalls in the tyres’ integrity will be quickly exposed when the machine is used again due to flexing of the sidewalls, so it is important to check them carefully for signs of excess wear, damage and incorrect operation. “Punctures and accidental damage are the most common reasons for replacement, but older combine tyres often have to be withdrawn from service because of ageing cracks, which are caused by ozone in the atmosphere attacking the rubber compound and causing it to degrade.” He said this was particularly the case on farms in coastal areas. “Although ageing cracks, particularly those in the sidewall, may appear quite narrow and shallow, they can quickly become wide and deep with flexing in service, leading to gradual pressure loss or even sudden failure. In this case the tyres should be replaced as soon as possible with ones that match or exceed the manufacturer’s original specification.” For more information contact Mitas Tyres Limited, Unit 6, Bergen Way, North Lynn Industrial Estate, King’s Lynn, Norfolk PE30 2JG or call 01553 817740.
Only 79p an issue when you subscribe – see page 19
Italian flair for DeutzFahr’s latest combines
THE Italian styling house responsible for some of Lamborghini’s wildest designs has been working with DeutzFahr to create a new range of combine harvesters for the 2014 season. The C9000 series has been designed in collaboration with Giugiaro Design. Deutz-Fahr says the style of the new machines has been completely reworked to bring them into line with its latest tractors. The new range comprises four models: the C9205 TS and C9206 TS with five- and sixstraw walkers and the C9205 TSB and C9206 TSB hill models having the slope compensation balance system (20% lateral and 6% longitudinal). The hill models are also equipped with new adjustable rear axle, 4WD and an antiskid system. Powered by 7.8 litre TCD L6 T4i Deutz engines the C9205 has a maximum output in the field of 334hp. The C9206 makes 395hp. All models are equipped with the firm’s high performance cutter bar, now also available in the 9m version. A one-piece construction, an autocontrol device and the Schumacher Easy Cut II system are fitted to “ensure safe and efficient operation in all conditions,
The new Deutz-Fahr C9206 now heads up the Deutz-Fahr combine harvester range.
providing a uniform cut with minimal wear”. A new feature is use of a feed roller positioned at the start of the intake trunking which takes the crop to the threshing drum. A new electro-hydraulic bearing control system on the header is just one of several design developments on the new harvesters. Separation capacity performance is optimised by the Maxi-Crop system and also by the long straw walkers. Cereal cleaning and integrity are taken care of by other Deutz-Fahr systems, including a grain pan with two-step removable sections, a turboventilator, wide sieves and the DGR (Double Grain Return) recovery system on each side of the machine.
A high visibility driver’s cab is integrated into the new design, with an array of lights and mirrors with dualreflectors and electrical adjustment. The driver and passenger seats are equipped with a 21 litre integrated thermo cooler. In addition, the steering wheel and column have been completely redesigned . A spokesman for Deutz-Fahr said: .”
New Holland tractor’s off to a flying start THE RSPB wet grassland nature reserve at Berney Marshes, Norfolk, has taken delivery of a new T6.140 tractor. The machine has been fitted with a New Holland front loader and will be used for managing the reserve, which is home to thousands of wintering ducks, geese and swans. Site manager Mark Smart
Birds of a feather – pictured from left are Ian Robinson, Mark Smart, Ross Johnson and Paul Roberts. 435lb-ft of torque with engine power management. Ernest Doe & Sons Ltd dealership in Wymondham supplied the tractor. Branch manager Ross Johnson said: “We’re delighted to have met the RSPB’s needs with the British-made T6.140. The tractor is the perfect match for its.” The RSPB has more than 200 nature reserves around the UK covering 151,200 hectares of land.
Stripper wows the crowds at Tillage-Live A STRIP till cultivator intended to operate in a range of UK arable farming situations has been demonstrated by Kuhn Farm Machinery.stop hydraulic safety is fitted as standard on all models, with a tip pressure being regulated between 550 and 730kg to ensure that the working angle of the tool tip remains constant for optimum results.
Get a load of that rack! Kuhn’s strip till cultivator in action at Tillage.
The Striger can be fitted with a fertiliser kit or a liquid manure application kit. It was being demonstrated at Tillage-Live in Lincolnshire.
OCTOBER 2013
7
8
OCTOBER 2013
Kohler to put the fizz in JCB’s smaller machines JCB has signed a deal to adopt engines from Kohler’s Global Power Group for many of its compact machine lines. The water-cooled Kohler Direct Injection engines – which will be branded ‘JCB Diesel by Kohler’ – meet the next stage of emissions regulations without the need for a diesel particulate filter (DPF). The first JCB machine to be fitted with the new engine – a JCB 35D 4x4 Teletruk – was unveiled at the RWM waste management show at the NEC in Birmingham. The Teletruk is able to reach forwards, enabling single side loading. JCB director of engine programmes Alan Tolley said: “The decision to partner with Kohler to develop engines for JCB compact machines was driven by the synergy in the technologies used by JCB and Kohler to achieve stringent Tier 4 Final emissions legislation. European-built engines will be progressively introduced in JCB products, including midi
The first vehicle fitted with a ‘JCB Diesel by Kohler’ engine is this JCB 35D 4x4 Teletru use a common rail fuel injection system working at 2000 bar pressures, cooled exhaust gas recirculation, four valves per cylinder and a diesel oxidation catalyst within the exhaust system. Fuel consumption is up to 15% better on similar output engines equipped with lower injection pressures and a DPF. There are two 1.9 litre threecylinder engines, the KDI 1903M and the KDI 1903TCR, delivering 41hp with 98lb-ft of torque and 56hp with 166lb-ft of torque respectively. The 2.5 litre, four-cylinder KDI 2504M
and KDI 2504TCR deliver 48.8hp with 125lb-ft and 74hp with 221lb-ft. for compact performance.”
K ITBUILD IN GS
Steelw o rk,ea vesb ea m s,p urlin sa n d b o lts 6 0’x 30’from £2,495 plu sVAT ex w orks 084 5 4 5 9 4 079 •w w w.kitb u ild in g s.co .u k
Only 79p an issue when you subscribe – see page 19
OCTOBER 2013
9
10 OCTOBER 2013
Sports and hobbies
Mary’s Marshall Missions
Do the Hippi Hippi shake After the death of his beloved gundog Whisper, Chas Baird found himself chasing her replacement all over the internet. Finally, he managed to corner the ideal animal… IN my last piece I talked about losing my old and much loved friend Whisper the black Labrador. I was initially quite determined that I wasn’t going to bother with another gun dog; I would just have a canine companion, possibly a retired greyhound. The main change factor was one of my neighbours, Colin, telling me that he had a bit of land that he was willing to share with me – sadly, his good lady hasn’t been at all well for some time and he hasn’t been getting out as much as he would like. We went and saw the farmer and like the gentleman he is he signed the authority for my son and myself. Unfortunately the land, in my opinion, is not safe for the .22 LR and so we will have to do our static hunting with the overpower air rifles (held on FAC and quite legal). While I do not have exclusive rights to shoot there, it is somewhere to go and it appears that some game comes over the boundaries. Game shooting is all shotgun and therefore, as I said last time, a dog becomes a necessity. So, how to find a dog without paying a great deal more than I could, at present, afford? The choices of either a pup or a trained dog weren’t really starters so alternatives had to be sought. The first thing I did was to email the lady who sold me Whisper. I got no response so it was back to the start. One way to acquire a dog is to find one that has a fault that the owner considers serious but which may not bother you. For example a dog which ‘squeaks’ (Whisper did!) or runs in would not be acceptable on a formal shoot but might well suit a rough shooter. They don’t squeak when they are sent out and running in, while a nuisance, can possibly be cured or at worst put up with. One thing I had to do was register with a vet. A lot of dog rescue organisations will not even consider you for one of their dogs otherwise. I wasn’t happy with Whisper’s treatment but
Chas’s dog with her puppies.
Fuss-addicted Large Munsterlander Hippi awaits her latest fix.
I found another vet practice that came very highly recommended. They were a bit surprised at me registering without a dog but understood when it was explained to them. On the subject of animal charities and rescue organisations, many of them (especially a large, nationally based one known for its opposition to foxhunting) will not rehome a dog into a shooting household. I found that access to the internet was a great help – there are a lot of dedicated people out there who believe that, unless through age or other factors, a working dog should not be homed as a pet. In particular I must mention CAESSAR – Cocker And English Springer Spaniel Rescue – which took my details and organised a home check in very short order. If you want a cocker or springer, either pet or working, it is a good place to start. So, what did I find for myself? I was trawling gundog rescue sites when a Large Munsterlander bitch showed up as needing a home in North Wales. After several tries I managed to contact the lady and like every other dog I chased that day it had already been snapped up. I was, however, given the name of a lady in Cambridge who had a four-year-old bitch that she might wish to part with. After a bit of research on the breed (I knew the name but not much more), I made the phone call and arranged to go and look at the bitch. When we arrived, there were Munsterlanders everywhere. I have a strong belief that the right dog will find you and when Helen let my prospective dog out of the 4x4 where she had been having a sleep, she greeted Helen and said a very quick hello to my partner Shirley. She then planted herself in front of me, put her head on my leg and looked up at me – I have to say I was completely smitten. The background is that she and another of Helen’s breeding bitches do not get on. The other bitch is younger so she decided to offer Hippi (my dog) on a breeders’ agreement. Basically she came home with us but she will go to Helen to have another litter in the spring of 2014 and then make her home with us permanently. She has settled in really well and she has to be the most affectionate dog I have ever owned – a proper fuss addict. I haven’t yet shot over her although Helen and I took her down the field before I brought her home and she is fine with the bangs. In a future piece I’ll tell you about her first outing. Until next time, keep the faith.
A date Mary will never forget, the start of her latest long haul in June 2013.
If you have a lovely vintage Field Marshall Series 3A like Mary Phillips, what better joy is there to drive it – other than to raise funds for good causes along the way. MARY’S story begins in 2009 when she drove her Field Marshall Series 3A at 9mph from her home in St Teath, Cornwall to Hatherleigh cattle market, a distance of 50 miles and raised £4500. Then in 2010 she drove from Hatherleigh to St Teath raising £6330; while in 2011 it was a trip to Truro cattle market another 50 miles and £8520 raised. It was then, just before Christmas 2011, Mary announced to her partner Peter Treleaven, who is well known for his knowledge of Field Marshall tractors that she would like to drive the Marshall from John o’ Groats to Land’s End. Mary said: “He couldn’t believe I was serious at first, but eventually agreed to it as he knew I wouldn’t be able to do it without him. So the tractor was thoroughly examined and a date set for the end of July. “Bryn Jones from Newton Abbott picked the Marshall up on his lorry and took it to Scotland for me, while Peter and I went in Peter’s Land Rover with our two collie dogs and we took along our old caravan. We left John o’ Groats on August 2. The weather was good until we came over the border, then the heavens opened and it did not stop raining until I reached Land’s End, but it wasn’t cold and I raised £15,000.”
Time for a re-run
After this Mary went on to give a series of interesting talks to tractor clubs, young farmers and Women’s Institutes. But
Christmas 2012 came round and she announced to an amazed Peter that in 2013 she wanted to drive the Marshall from Land’s End to John o’ Groats. Mary added: “After a time he got used to the idea, and the tractor was fully inspected yet again; a date was arranged for June 30. “We had only driven 55 miles and the fog came in so we parked up; but, believe it or not, the next day I drove 95 miles at a speed of 9mph! We were invited to Dart’s Farm at Topsham, Exeter where we parked overnight. James Dart wanted us to stay all next morning for all his customers to see us and to be able to get donations, which went down very well. “I averaged between 60-70 miles a day, the traffic going through the big cities was horrendous but I was not afraid one little bit.
All shook up
“The things I saw on this drive were amazing, I had a book with me and when I saw something interesting I would pull over and write it down, but, as you know, when the Marshalls are ticking over you are being shook up all the time and I could hardly read my writing at the end of the day!
The joy of not knowing what’s around the corner.
We were soon at Falkirk and looking for somewhere to park up. Peter saw a farmer bringing his bales in so he asked if we could park in his field. He was delighted to let us, then came back in the evening with his friends to see the tractor and invite us to the Caithness County Show that weekend. “We agreed that we would get to John o’ Groats first, then see what time we had the next day. We wanted to go to Dunnett Head, the highest northerly point of Scotland, on the way there must have been millions of acres of open land and not a tree, house or animal in sight, just me on my tractor as Peter would drive on ahead.
Finishing post
“We eventually arrived at John o’ Groats, we did this trip in 17 days, exactly the same as last year, my total miles was 1188 at 9mph. But then our lorry driver telephoned us to say his load up to Scotland had been cancelled therefore he couldn’t pick up my tractor for another week. “Now we could go to the show and drove 16 miles back to Wick and were treated like royalty. I had to lead the parade of tractors around the ring, and was presented with £100 for my charity drive. I was so very grateful.”
If you like this story from Tractor magazine, why not get yourself a copy of the latest edition? It’s available from all good newsagents or online with FREE delivery anywhere in the UK from
Continued from page 1
Challenger ups the stakes with 640hp monster REPLACING the MT800C Series, the new tractors get a 12 cylinder 16.8 litre Agco Power engine linked to Challenger’s Mobil-Trac system. Another key feature of the new machines is a new radiator design to improve cooling and make it easier to clean them. Working in a similar fashion to current exhaust gas recirculation systems, Challenger’s new cEGR system differs in that engine exhaust gases are cooled before being mixed with air from the main intercooler.
Electronically actuated and water cooled, as well as decreasing NOx levels, cEGR also reduces the amount of diesel exhaust fluid (AdBlue) required during after treatment. Challenger is the only tracked tractor available with a steerable rear linkage. Currently offered only on the three smaller models, in launching the MT800E Series the steerable rear linkage is also offered on the range-topping MT875E. The latest version features a new design and positioning of the steering cylinders,
resulting in an improved steering angle. An optional high flow hydraulic pump is also available. The standard 220 litre/min oil flow from the current range has been retained, but all MT800E Series tracked tractors are available with an optional 321.8 litre/min system. A spokesman for Agco said: “In addition to a smoother shifting transmission, Challenger is also introducing other refinements on the MT800E Series to further improve operator comfort, boost performance and increase durability.
“The MT845E and the MT855E are fitted with the air ride seat, but the Deluxe VRS seat with fabric cover or leather, which is optional, from the current top model is standard on both MT865E and MT875E. “In addition, all four tracked tractors can be specified with the Deluxe VRS vented leather seat. This luxurious option features an in-built heating and cooling system to take operator comfort to a higher level.” Challenger is offering AutoGuide 3000,
a new integrated and affordable system, with the tractors. This is designed to provide accuracy ranging from sub-metre to centimetre precision. The new guidance option operates directly from the 7.4in tractor management centre display, eliminating the need for an additional screen. It is also possible to engage guidance through the One-Touch headland management system. The first deliveries of Challenger’s four new models are expected to arrive in Europe next summer.
Only 79p an issue when you subscribe – see page 19
296434 WF 01x1
296441 WF 01x1
296155 WF 01x1
296605 WF 01x1
OCTOBER 2013 11
12 OCTOBER 2013
Auctions and events ‘Strange’ auction of blacksmith’s treasures MORE than 600 lots including a selection of tractors formerly belonging to Shropshire blacksmith and author Alf Strange and his wife Vera have been sold at auction. Around 2000 people from all over the UK attended the sale by auctioneer Halls at The Brow Golf Club, Welsh Frankton, near Ellesmere on September 21.
Most of the lots had been part of a working blacksmith and farming museum set up by the couple. Alf was 75 when he died in November 2000 while Vera died in April last year, shortly after her 80th birthday. The lots ranged from a 100year-old mouse trap, that sold for £230, to a Morris Eight Tourer (Series II) which sold for £7800. Other top selling lots
The Morris Eight Tourer (Series II) that sold for £7800.
were an Austin A40 at £1700, a four cylinder Bristol crawler at £1350, an Excelsior motorbike at £1200 and a Morris Minor 1000 at £600. There was also a large collection of horse-drawn and other implements, machinery and tools, three Grey Fergusons, early Fordson Major and Fordson Dexta models and two Alliss-Chalmers Model Bs.
This ‘Strange’ Fergie looks more green than grey after years of sitting outdoors.
Auction dates for your diary oCtober
4: Shrewsbury Collective machinery Sale. Halls (01743 462620). 9: machinery Sale. York Auction Centre, Murton, York YO19 5GF (01904 489731). 10: on site sale. Ongar, Essex. Cheffins (01223 213777). 11: Collective Sale. Ardingly Showground. South East Marts Ltd (01323 844874). 12: Farmers’ Autumn machinery Auction. Bicker Bar. Pygott & Crone (01529 414555). 19: Cambridge vintage Sale. Cheffins (01223 213777). 21: Collective Sale. Osney Lodge Farm, South Godstone. South East Marts Ltd (01323 844874). 25: Stone Collective machinery Sale. Halls (01562 820880).
November
8: Collective machinery and equipment Sale. Hobbs Parker (01233 502222). 9: machinery Collective Sale. CCM, Skipton, North Yorkshire (01756 792375). 13: machinery Sale. York Auction Centre, Murton, York YO19 5GF (01904 489731). 23: Collective & Annual vintage Auction Sale of vehicles, farm machinery and associated tools and equipment. Hexham and Northern Marts (01434 605444).
DeCember
6: Shrewsbury Collective machinery Sale. Halls (01743 462620).
Triumphant Tillage ploughs ahead in ‘ideal’ conditions IDEAL conditions for cultivation and better than expected harvest results brought an excellent turnout of farmers and contractors eager to invest in new equipment to Tillage-Live on Wednesday, September 11. More than 1400 visitors saw working demonstrations of equipment from nearly all the main manufacturers in the UK. The 80 hectare limestone brash site at West Hall Farm, Welton, near Lincoln, made available by JJR Farms, provided ideal conditions for implements being demonstrated. “After last year’s very challenging autumn, visitors were very keen to seek new kit to help them cope with adverse conditions, remove soil damage from last winter, and improve crop establishment in future,” said Duncan Russell, AEA services manager and event organiser. A central demonstration arena featured nonstop demonstrations of a wide range of equipment beside static exhibits at the heart of the event, attracting up to 200 visitors at a time. There was plenty to see all around the site, with over 30 exhibitors demonstrating on their own large demo plots and new machines being launched or making their UK debut at the event.
“Exhibitors reported very strong interest from visitors, which can probably be attributed to the better than expected harvest and good progress this autumn,” said Mr Russell. “Farmers and contractors were clearly making buying decisions. “The varying approaches to strip tillage attracted a lot of attention, with a noticeable increase in the range of equipment working behind medium sized tractors, not just those with the highest horsepower.” The need for crop protection products was highlighted in the Knowledge Trail, where participants were brought up to date with the Get Pelletwise initiative from the Metaldehyde Stewardship Group, which aims to protect this key slug control option, and the Say No to Drift campaign to protect key insecticide chlorpyriphos. Fears over the rise of broadleaved weed resistance to ALS herbicides were also aired, with farmers invited to register cases of problematic control, and learn how best to avoid problems, with event sponsor BASF. Plans for Tillage-Live 2014 are already under way. The event is scheduled for September 10 next year in Gloucestershire, with a similar format and Knowledge Trail.
A complete Victorian cast iron cooking range and rare bicycles in need of restoration were also sold. Traditional butcher’s and baker’s bikes, some of which were complete with advertising plates, a rare invalid bicycle, a tandem and an unusual old ice cream seller’s tricycle went under the hammer. “We were staggered by the
A 100-year-old mousetrap that sold for £230.
number of people that attended the auction and how far they had travelled,” said auctioneer Allen Gittins, a director of Halls. “At one point we counted more than 1100 cars in the car park and collectors and buyers travelled from as far away as Cornwall and Scotland, which resulted in a very large crowd and some exceptional prices achieved.” It was fitting that the auction was held at the golf club, which Alf formed in 1995 and is now run by his son, Alan. The village blacksmith for 40 years, Alf gained a great reputation for his knowledge and collection of working tools and equipment. His reputation was further enhanced with the publication of four books, which he wrote about Shropshire rural life between the wars, including Me Dad’s the Village Blacksmith, Following Me Dad,
Blacksmith Alf Strange died in 2000 aged 75. His wife Vera died last year and their collection of items has now been sold.
Forging Ahead and Blacksmith to Briefcase. “Dad started the museum in the late 1970s, as he was a great hoarder,” said Alan. “He was a blacksmith and he had the personality to bring the tools and other items alive. It was sad to see the items go, but they had been sat in the shed for the last 12 years and it is nice to think that people will get enjoyment from and bring new life to them.”
Top dollar for top machinery at trio of sales HIGH end machinery from John Deere, CLAAS, JCB and Caterpillar went under the hammer at three on-site sales held by Cheffins in September. First up was E G King & Son on September 17 near Godmanchester, Cambridge, where Cheffins had previously sold the farm and the late, low houred machinery was subsequently surplus. Top lots on the day were a 2008 John Deere 7530 Premium (1585 hours) at £49,300, a 2009 John Deere 6930 Premium (1852 hours) hit £47,500, a 2011 John Deere 6330 Premium (753 hours) with JD 631 front loader knocked down at £42,700 and a 2004 John Deere 6220 made £23,400. With the tractors selling well two other lots hit big prices with a 2012 JCB 535-95 (493 hours) materials handler taking a winning bid of £44,000 and a very clean 2005 John Deere 9540i 18ft cut combine harvester knocking down at £60,500. The machinery on offer was also well received with a brace of AS Marston 11 and 12 tonne trailers selling for £6500 and £6600 respectfully, a very sharp 2009 New Holland BB9090 big square baler was well received at £37,000 and a tidy 2011 Farm Gem FS1200 mounted 24m sprayer took £10,000. On September 19, the Cheffins team moved on to Watford for a sale on behalf of McClelland Farming due to ill health. Well maintained arable and grassland machinery was on offer and another total dispersal sale was held where a large crowd snapped up the lots. A 2010 Claas Arion 640 sold at £32,200, a 2006 Claas Ares 657 hit £27,200, another popular yellow machine the form of a 2010 JCB Loadall 536-60 made £30,800 and a clean one owner 1997 Claas Lexion 405 15ft cut combine took a winning bid of £34,000. Other top lots were a 1997 Chaviot 2000 24m selfpropelled sprayer taking £7200,
A selection of the low-hours machinery that went under the hammer at E G King & Son on September 17 near Godmanchester, Cambridge.
a Hitachi EX60-5 360º excavator made £12,600 and a 1997 Land Rover 90 Defender with only 37,000 miles from new sold for £8700. Completing the trio was yet another complete dispersal sale for the executors of David Prime’s estate at Levels Green Farm near Bishop’s Stortford on September 23. Auctioneer Bill Pepper said: “Again we experienced strong demand from across the country with a 2012 Shelbourne 556 hedgecutter at £9800, an excellent set of 2011 HE-VA King Roller 12.3m went to Ireland for £15,800 and a Masters 25 tonne batch drier made a surprising £14,200. “Some serious horsepower was on offer and a 2008 CAT 855B Challenger went to Germany for £85,000, a low houred 2010 New Holland T6070 made £32,200 and a 2004 Claas Lexion 580 also went to Germany for £61,500. “We had three very successful sales, all boasting some very tidy machinery and subsequent prices to match. New tractor sales in 2013 appear down on previous years and with a late finish to the season many hire tractors are absent from dealers’ yards. “This has enhanced the demand for fresh from farm stock and machines if clean and tidy with sensible hours will receive considerable interest when offered by auction.” This month Cheffins will conduct a sale at Ongar in Essex on October 10 and a sale of ex-MoD and NATO equipment in Louth, Lincolnshire, on October 30.
Powerful 2008 Challenger MT855B will be in Germany now after it sold for £85,000.
This 2012 JCB 535-95 handler with a very modest 493 hours on the clock changed hands for a winning bid of £44,000.
Clean one owner 1997 CLAAS Lexion 405 15ft cut combine made £34,000.
A pair of John Deeres from the Cambridge sale. Neither had done much work up to now.
Only 79p an issue when you subscribe – see page 19
Energy and technology
OCTOBER 2013 13 Sponsored by
Farm Tyre Disposal Services 0845 331 2747
Ventilated wall panels are Devon-sent as they lighten lambing load
LAMBING in a dark and stuffy shed is a thing of the past at Upcott Farm, Nomansland, Devon, thanks to the installation of an innovative ventilated wall. Autumn lambing is now well under way across the UK, and farmers will already be planning next year’s spring crop. When Andy and Janet Dale moved to Upcott Farm three years ago, they were faced with upgrading six of the old farm buildings. “We knew it was going to be a big job, and as we needed more storage and a temporary lambing shed, the easiest route was to start by putting a lean-to lambing area on a newly-erected workshop,” said Andy. “The original intention was to Yorkshire board it, but then I discovered Highlight metal wall sheets.” With tiny perforated holes creating a 25% void,
Highlight allows light and air to pass through, while protecting against wind and rain. “It’s really done the job,” he said. “The shed is a lot lighter and airier than it would be with Yorkshire boarding, so it is ideal for the livestock.” While the metal sheeting worked out more expensive than boarding, the cost of erection was significantly lower, as it arrived in measured lengths and just needed fixing in place. Andy used panelled gates along the side and front of the building, with the wall sheets above that to the eaves. Lambing his 100 Wiltshire Horn ewes indoors from early April to mid-May this year, he found the shed a far nicer environment. “We don’t need to put the lights on until a lot later in the evening, and when we bed up with straw the
dust dissipates far more quickly – you really can feel the ventilation working,” he says. “Our vet is very impressed with it – it almost feels like an open shed with just a roof.” With 40 Dexter suckler cows as well as the growing sheep flock, Mr and Mrs Dale are planning to improve the remaining buildings and put up a new one next year. “We’re keeping all the ewe lambs so will be lambing a lot more sheep next year, so we need a bigger lambing shed,” he said. “We’re going through the buildings one by one. We’ll have to completely replace one of the buildings, but I want to try and improve the other sheds as they are so dark and airless; so I will use Highlight wherever possible. We’re on wet, exposed ground here, so the stock have to be housed over
Engineer Doug’s award for cow disease early warning system THE first winner of a new award for outstanding farming research has been announced. Doug Fleming, an agricultural engineering student at Harper Adams University, from Berwick-upon-Tweed, has been presented with the Nick Bird Award by Reading-based firm Farmex.. It is open to final year students at HAU. BRD, a disease that attacks the lungs of young calves, is estimated to cost the British dairy industry £60 million every year. Doug took an engineering approach to this problem and set about designing a prototype sensing system that could alert farmers to a potential outbreak. The system was integrated into automatic milk feeders and the final design was successfully validated on a commercial farm. The award, an engraved trophy and a cheque for £500,
was presented to Doug by Katie Bird at the HAU graduation ceremony. Farmex managing director Hugh Crabtree said: “The importance of information and communications technology for sustainable production in agriculture has been highlighted recently by the government, the Ossiach group and RASE, so the Nick Bird Award is very timely. “By inaugurating this award we hope it will both commemorate Nick’s work and encourage students at HAU to forge new career pathways in ICT and precision farming.” Currently Doug lives on the 850 acre mixed arable and beef family farm in Whitsome near Kelso in the Scottish borders, but will be putting the money towards a trip to New Zealand
Doug Fleming is handed the Nick Bird Award by Katie Bird during his graduation ceremony at Harper Adams University.
before taking up a graduate position with CLAAS UK. He said receiving the award was a great honour and surprise and that he was pleased to have recognition for all the hard work carried out on the project. BRD is also a main cause of loss within the beef industry.
FEIN blades are adapted for more tools The JCB Loadall recovered thanks to dealer Peacock & Binnington and the Livelink system.
Dealer helps recover stolen JCB thanks to tracker THIEVES were recently thwarted in their attempt to steal a JCB telehandler because the machine was fitted with a JCB LiveLink satellite tracking device. The JCB 541/70 Loadall purchased through JCB dealer Peacock & Binnington was stolen from farm premises, near Market Rasen, Lincolnshire, but was soon thanks to its LiveLink system. The farm owner was alerted to the theft via text. With the help of Peacock & Binnington staff they logged into JCB LiveLink, which revealed the location and the machine was promptly recovered. P&B Corringham branch sales manager Stephen Melbourne said: “The farm
owner was extremely happy to have his Loadall recovered so quickly. This is the second JCB this year that has been recovered due to Livelink and Peacock & Binnington. I cannot stress enough the great importance and value of using a tracking system in the battle against farm machinery theft. “Real Time information such as location, unauthorised movement and even fuel consumption can be monitored by this system along with an added benefit of helping to reduce your insurance premiums. Not many people are aware of another system called Livelink Lite that can be retrofitted to other makes.” Contact 07774 296384.
TOOL firm FEIN has redesigned its range of E-Cut saw blades for joiners and interior fitters to make them compatible with all major oscillating multi-function tools. The redesigned E-Cut The E-Cut saw blades were originally precision 65 with multi designed for use with FEIN’s MultiMaster mounting power tool and developed with the eight star tool mounting, also known as FEIN Star Technology. This is now joined by a 12-pin mounting which allows all major oscillating multifunction tools to be fitted with original FEIN E-Cut saw blades. Fitted with standard, long-life or precision teeth, E-Cut saw blades are suited to sawing wood, plasterboard, plastic and glass fibre-reinforced plastic and are available in a width of 35 or 65mm and a length of 50mm. The precision saw blade is designed for high cutting speeds and precise cuts, while the universal saw blades are available in a width of 29 or 44mm and a length of 60mm and cover a large range of applications. They can be used for sawing sheet metal up to a thickness of 2mm and cutting copper or aluminium pipes and profiles. The FEIN E-Cut saw blades with multi mounting can be fixed into 8 x 45 degree to give a clearer view of the cutting line. A spokesman for FEIN said: “When working with timber materials in particular, the E-Cut long-life saw blades display very little wear and last three times longer than E-Cut standard wood blades. They remain sharp even after 1600 cuts at full cutting speed in 25mm thick MDF board. Their bimetal teeth also ensure the level of robustness needed for the construction site. The blades easily withstand contact with foreign bodies such as plaster, bricks and nails up to 4mm thick.” To celebrate the launch of the E-Cut series, until December 31, FEIN is offering the new E-Cut saw blades with multi mounting in a ‘Best of E-Cut’ set for £49.95. It contains four E-Cut long-life and two universal saw blades in each of the different widths and lengths. The FEIN E-Cut saw blades with new multi mounting are available from specialist retailers. Go to:
Let there be light... and a bit more ventilation too – the newly Highlighted shed on Upcott Farm.
the winter, and we’re very conscious about the need for adequate ventilation.” For more information about Highlight panels visit or call 01884 839302.
14 OCTOBER 2013
FENCING CONTRACTOR • POST & RAIL • STOCK, NET AND BARBED WIRE • RABBIT FENCING
Stewardship Scheme work undertaken Tel. Julian Nugus 01469 - 531137 Mobile: 07850 - 857988
FA S T-GROW IN G TRE E S
PR O D UCIN G G R OW TH O F 6 -8 FT PER YEAR H Y B R ID W ILLO W S used forwindbreaks,gam e cover,screens,hedges,bank stabilisation etc. H Y B R ID P O P LARS used forgam e-lifting, windbreaks,tim ber,shelters etc. Both are tolerantofpoorsoiland sites.Allsizes from 60cm s to 240cm s.From £53 per100 or £480 per1000 plus VAT (30cm /1ftcuttings) Also suppliers ofEvergreen and native hedging, barerootand rootballed trees ofvarious sizes and large containerised trees (subjectto availability) Fora free inform ation pack and/oradvice contact:Jo hn o rM o nic a Spa nto n-Co a tes , B o w ha yes Fa rm , V enn O ttery, O ttery StM a ry, D evo n EX 11 1R Y Tel: 0 14 0 4 8 12 2 2 9 . Fa x : 0 14 0 4 8 15 8 0 0 P oplar tree 18 m onths after planting W eb s ite: w w w .b o w ha yes trees .c o .u k a 60cm slip E-m a il: b o w ha yes .trees @ b tc o nnec t.c o m
FA8! -#'8A77 G6; E487*8#*7D GAK;7=A9#K'D 1:8*768I AK; 1*K=#K' 5:K68A=6:87 B%$6G<=GJH 6&9H!<6H&!J <94 JF%%=G$!J H& ,5B/ ?5B <94 0&F9H!(JG4$ BH$@<!4JIG% J6I$;$J *F== -=<9HG9K <94 2<G9H$9<96$ B$!DG6$J "&! ?$4K$!&@J <94 7&&4=<94J B%$6G<=GJHJ G9 HI$ G9JH<==<HG&9 &" BH&6A/ .$$!/ ,#FG9$ <94 -&JH ) E<G= *$96G9K
1*K=#K' 5<!K$ JH&6AJ &" <== JG'$J &" !&F94 %&JHJ/ J#F<!$ J<@9 %&JH ) !<G= <94 K<H$ %&JHJ+ 3== JG'$J &"
&D$!9GKIH 4$=GD$!( J$!DG6$+ 0&9H!<6H K!&@G9K &" I&;$ %G6A$4 J$$4J+ 5&6<= %!&D$9<96$ J$$4 6&==$6HG&9J G9 <== <!$<J+
H*;'*MAI#K' 5G96&=9JIG!$ K!&@9 ?<'$= JH<A$J <94 :G94$!J <94 J#F<!$ J<@9 JH<A$J+ 0<!!(G9K &FH 0&F9H!(JG4$ BH$@<!4JIG%/ ,5B/ ?5B &! ,7CB @&!A FJG9K (&F! &@9 =<:&F!8 >I$9 =$H FJ #F&H$ &9 HI$ JF%%=( &" HI$ ;<H$!G<=J+
5:K6A=6N FA8! -#'8A77D G:46%D G#K=:MK7%#8*D GE>> @/J .*MN @>(@$C&@)<@> :8 @>(@$C+>@@+& 1A0N @>(@$C&>@(@> F:?#M*N @$"$>C>"@+)( 222BLA8!3#'8A77B=:B4!
Landscape and forestry
Walk tall as vibeless PRO mow is simply a cut above JOHN Deere has added a new entry level model to its range of walk-behind commercial mowers. The firm says its PRO 47V has been designed with smaller landscaping businesses, contractors, amenity managers and other turf professionals in mind. It has a cutting width of 18½in and features carry handles to allow one person to transport it and the main handle folds up to make it an easier fit in small vehicles. Equipped with a Subaru engine rated at a nominal 4.3bhp and with variable-speed two-wheel drive, the mower is suitable for working in a range of different
mowing conditions on grass areas up to 2500sq m. The rear collector capacity is 65 litres, and cutting height is adjustable from 1-3in. In addition, the PRO 47V has a corrosion-resistant, steelreinforced aluminium chassis including front protection. The TurboStar System delivers reliable mowing and collection performance, and other features include a professional standard transmission and tyres and an optional mulching kit. The standard AntiVibration System, which reduces the level of exposure to hand-arm vibration, is intended to help operators work for longer without It might be ‘entry level’ but the John Deere Pro 47V is a nifty little suffering fatigue. mower packed with neat design touches.
It’s mowers galore from Etesia this autumn MOWING machinery and turf maintenance company Etesia has launched five new products just in time for autumn – two professional pedestrian rotary mowers, two domestic lawn mowers and what it calls a “revolutionary” 100% electric wheelbarrow. The PKCTM 46cm and LKCGM 53cm mowers join the firm’s Duocut range. Both machines are available with mulching inserts allowing use of one machine for a multitude of different tasks – cut and collect, cut and drop or mulch. The PKCTM model is a single-speed machine equipped with a 6hp Kawasaki KAI-FS181 engine and comes complete with a long range fuel tank making it ideal for mobile grass cutting teams who require a machine to last all day without refuelling. The LKCGM model is equipped with a 6hp Kawasaki KAI-FS180 engine and has three speeds – 2.7, 3.5 and 4.5kph. Supplied with a 50 litre grass box, the PKCTM has seven cutting height settings, which are quickly adjustable from 2885mm, and Xenoy reinforced cutting deck. The LKCGM model has an 80 litre grass box with cutting height adjustment 2585mm and an aluminium cutting deck. Two new electric models aimed at the domestic market are also now part of the
Duocut range. The VECS and NECTS are available with mulching inserts ensuring that gardeners can complete a range of tasks to suit their individual needs. The VECS is a 1300W push model with eight cutting height settings, which are quickly adjustable using one lever from 20-60mm. The NECTS model is a 1500W single-speed (3kph) model with seven cutting height settings from 25-85mm and comes complete with Xenoy cutting deck for added robustness. Completing Etesia’s new product launches is the 100% electric wheelbarrow. It can be fitted with a range of attachments that can tackle a wide variety of jobs. A spokesman for the company said: “Power is from a 24v 1000W battery with two forward and two reverse speeds. Fitted with either wheels or ‘caterpillar tracks’, this is a truly.” The electric barrow’s optional accessories available include a snow blade, scarifier, side extension/side rail and spray lance.
A long range fuel tank, 46cm cutting width and seven height settings are all features of the Etesia PKCTM.
The 53cm cutting width Etesia LKCGM mower comes with a whopping 80 litre grass box.
Need to use your wheelbarrow as a snow plough? Etesia’s new electric wheelbarrow can be fitted with its own snow blade. Gardeners can take advantage of eight height settings on the Etesia VECS.
Unlike its little brother the VECS, gardeners don’t have to push the new Etesia NECTS, which will roll along at a steady 3kph.
Only 79p an issue when you subscribe – see page 19
OCTOBER 2013 15
Simon says get it green before winter strikes TURF expert Dr Simon Watson from Syngenta has urged greenkeepers to make sure their grass is in top condition ahead of the winter to avoid the risk of disease. Speaking at a BIGGA Golf Education Day turf management seminar during SALTEX, Simon urged turf managers to: “Go and produce more consistent surfaces for the spring,” said Simon. “There is immense value in preparations through the autumn and early winter to help protect turf through more severe months.” The SALTEX survey showed that over 40% of greenkeepers believed that building up essential carbohydrate reserves related to levels of potassium or iron in the turf, when efforts should really be targeted at increasing carbohydrate levels in the plant. Simon highlighted research that has shown an autumn Primo Maxx programme Simon. Michael Fance of lawncare products producer Everris said the potential to increase carbohydrate reserves needed to be carefully matched with appropriate nutritional inputs over the autumn. “Carbohydrate reserves do respond to increased nitrogen inputs to a point. But overfeeding leads to excessive top growth that needs to be mown off; soft growth that is more susceptible to disease and poor rooting,” he warned. “The net effect is reduced carbohydrate storage.” Michael said.
High speed mowers get floating suspension system
John Deere has launched a pair of mower conditioners designed to operate like a self-propelled machine.
JOHN Deere has launched new 600 side-pull and 800 centrepivot mower conditioners intended to serve a wide range of customer needs from the small and medium sized livestock farm to large livestock farms and contractors. The company believes that since smaller livestock farms are often mowing less than 100 hectares a year, they are primarily interested in low operating costs. In contrast, medium size farms mowing between 100 and 400 hectares per season, as well as large farms and contractors mowing more than 400 hectares a year, put a higher emphasis on uptime and performance. A spokesman for the firm said: propelled machine. The mowers’ balanced design and high ground clearance increase field performance, while the newly designed floating suspension system allows the machines to closely follow ground contours. “The 600 and 800 Series conditioners are swivel hitch for better coupling and decoupling and improved disc protection to reduce the impact of foreign objects.
Simon said that by promoting healthy turf in the autumn greenkeepers have the best opportunity to prevent disease outbreaks and loss of turf quality during high risk periods of weather conditions conducive to disease. The SALTEX seminar survey showed that while said. “That means less surface scarring and reduced stress on the turf. It can also reduce the number of fungicide applications required over the course of the season.” Simon areas. The trial highlighted the importance of product selection to tackle the disease threat, with infection levels following iprodione application reaching 10% of surface area within five weeks of the second treatment and continuing to develop for the rest of the winter. “It also reiterated that application during periods of high risk is crucial to prevent the disease pathogen developing and infection breaking out,” he said. “Over 50% of greenkeepers involved with the SALTEX survey were using the GreenCast disease forecasting system to help identify periods of disease risk.”
Syngenta’s Dr Simon Watson believes getting turf into tip-top condition before the onset of winter is essential.
Simon.
16 OCTOBER 2013
4x4
WoRDS BY MARK STonE
Big lights and bold badging ensure everyone knows it’s a new isuzu D-max.
isuzu’s new D-max utah automatic looks good but the accessories add considerably to the basic price.
AutomAtic for the people
the alternative black alloys look good but, whisper it, you don’t actually need them.
ALREADY well established within the UK 4x4 market, Isuzu’s new D-Max has quite rightly attracted a wide variety of customers. Keen to keep up this momentum Isuzu has now elected to tread the path of fitting an automatic gearbox to reduce driver effort and appeal to even more buyers, auto 4x4s now being far more capable than they used to be. And with the advent of the auto shift version has come a whole host of accessories in an attempt to tap into that most horrendous of segments – namely the lifestyle buyer.
Hikes in road tax, dubious green credentials and ever increasing fuel prices have seen the image conscious modern family shying away from the traditional hatchback in favour of more exotic fare and Isuzu wants its slice of the pie.
Colour keyed
Complete with a broad palette of colour options along with a new range of colour keyed and, I must say, impressively built and fitted load bed canopies, the new D-Max more than looks the part irrespective of the location. It still offers the traditional
pick-up format, with a broad single slat grille filtering into the angular lines of the vast front light clusters and colour keyed bumpers. These in turn feed into high arched front wings, a high waistline that passes over the well sized four doors and into the load bed that culminates in oversized rear lights and a deep tailgate. Sitting on Isuzu’s familiar ladder frame chassis design, the D-Max provides a useful 235mm of ground clearance and excellent axle articulation within the oversized wings. Buyers get 225/65R17 tyres sat on alloy rims and Isuzu has stayed with the tried and trusted arrangement of independent wishbone and coil spring front suspension and elliptical leaf springs to the rear with disc-drum ABS braking. Useful for those carrying physically larger loads, the 1063kg maximum deep load bed measures 1552 x 1530 x 465mm, sufficient depth to ensure most cargos are kept secure within its confines and
C L A S S IC LA N D RO V E R S B R ITISH C L A SSIC S H E R ITA G E M O TO R S P A R TS 1948 to D a te R E TA IL TR A D E E X P O R T SP E C IA L P R O JE C TS R E STO R A TIO N S M A N U FA C TU R IN G
C o untry W o rksho ps,R isega te, N r. S pa lding,L incs P E 11 4E Z
Tel/Fa x: 01775 750223
w w w .british4x4centre.co .uk
comes complete with a thick, rubberised plastic lining. Add to this a 3000kg maximum braked trailer weight, a turning circle of 12.2m and the fact that the new 2.5 litre D-Max outperforms larger engined equivalents including its Rodeo predecessor. Shorter overhangs also mean the approach and departure angles of 22º and 23º add to the D-Max’s very capable off road competence. Inside the well sized cabin function and form have become Isuzu’s byword. A thick rimmed adjustable steering wheel sits in front of a clear instrumentation binnacle while all the minor controls have now been grouped in a circular housing located just in front of the gear lever.
Driver comfort
The seating is large and supportive; the driver’s seat is electronically adjustable while the rear bench can be folded to increase internal capacity. Where the cabin quality suffers is in the excessive use of hard, shiny plastic. Easy to keep clean and withstand hard usage it may be, but the look of the trim detracts from and compromises what is actually a well thought out and comfortable cabin. Beneath the bonnet resides the 2.5 litre two-stage, fourcylinder turbodiesel. Delivering 163bhp and 295lb-ft of torque exactly when needed, its flexible and free revving nature gives more than acceptable emissions.
OCTOBER 2013 17
Only 79p an issue when you subscribe – see page 19
The cabin is concise and comfortable but the hard plastic surfaces detract.
Good wide access for cargo while the slide tray adds to ease of loading.
However, while the engine’s economy suffers when mated to Isuzu’s five-speed auto. The manual version’s easily attained 38mpg falls to a test run best of 27.4mpg due largely to the gearbox’s propensity to dwell in the lower gears. It’s ponderous, unusual for a modern automatic, and when compared to other similar units. Speed of change can be increased by shifting into sequential and changing by hand, but this does seem to negate the reason the automatic was fitted in the first instance. Useful when off-road, the efficiency of the sequential change allows the shift system to work to the overall benefit of the driver and the prevailing conditions. Similarly, by depressing the shift lock, the driver can remain in full automatic mode while ensuring the gearbox won’t shift above the highest gear determined to be appropriate. Evaluation wise, a total of 281 mixed miles were covered with no more than a light load
carried, the average consumption indicated meaning a full 69 litre tank of diesel would give a maximum distance of 470 miles between refills.
Easy to drive
Comfortable, easy to drive and straightforward to position even in tight situations, the D-Max handles well although the at times laborious response of the automatic gearbox tends to take the shine off the engine’s ability to perform. On smooth surfaces the D-Max ride is passable, the natural double-cab urge to pitch calming down considerably when it’s carrying a decent load. Where the D-Max does surpass expectations is when it’s offroad, most notably on rough tracks, the ride quality one of the best in class. There’s a comprehensive range of D-Max variations available and buyers can still opt for a 4x2 or 4x4 single-cabs that start at around £18,499, a 4x4 extended or what’s better
Engine economy suffers when mated to the automatic gearbox.
known as a King Cab or the more familiar double cab as seen here. Equally, in double cab form there are four variations of trim level intended to suit each users’ eventual end purpose with a variety of accessories intended to enhance and individualize each customer’s particular needs or whims. The new colour coded canopy is more than worth the £1800 investment as is to a degree the slide tray railed load bed at £648. The optional 18in black alloy rims complete with Pirelli Scorpion Zero 255/60R18 tyres add £2880 to the initial Utah Automatic showroom price of £27,244 which in itself is over £1000 more than the manual six-speed.
Additional outlay
Throw in the at times geographically challenged sat nav and reversing aids and the basic cost has risen to £32,572. If you can justify the additional outlay and need your
D-Max to change its own gears then go ahead. The larger wheels and tyres look good, the performance Pirelli rubber adding markedly to the D-Max’s cornering abilities and the canopy is attractive but I’d still consider my money better directed towards the manual version on standard wheels and tyres.
FAST FACTS Model: Isuzu D-Max Utah automatic Price: £32,572 (as tested) Engine: 2.5 litre four-cylinder 163bhp turbodiesel Transmission: Five-speed automatic Top speed: 111mph CO2 emissions: 194g/km Combined mpg: 27.4 (as tested)
Drive selection is via a large, centrally located knob.
The new five-speed auto is hesitant and hampers overall economy.
Instrumentation is clear and concise.
Cabin stowage isn’t bad but could be improved.
Switchgear is robust and positive.
18 OCTOBER 2013
Plant and machinery
P ELL P L ANT H IRE L TD PELL PLANT HIRE LTD
Groundworks & Construction, Civil Engineering Contractors t. 01754 881231 m . 07768 9 43722 Lym d a le Cro ftLa ne, Cro ft, Sk egnes s , Linc s PE2 4 4 PF
A . G ric e & S on (a d ivis io n o f Pell Pla ntHire Ltd )
•L a n d d ra in a ge •Je ttin g •Ditc h m a in te n a n c e •L a ke s & P on d s
ESTABLISHED O VER 50 YEARS AN Y REG IO N C O N SIDERED
Land D rainage Sp ec ialists
The big boys get bigger JOHN Deere’s 7R Series tractor range for 2014 features more powerful engines and a new top of the range model. The new line-up will consist of six models delivering 210, 230, 250, 270, 290 and 310hp at rated engine speed. The flagship 7310R will be available in limited numbers from spring 2014 and will have a new Stage IV compliant engine, while all the other 7R Series tractors will be powered by John Deere’s diesel-only technology. The 7230R, formerly powered by a nine litre engine, gets an advanced 6.8 litre unit which maintains the same maximum torque, torque rise and power bulge as before. The change to a smaller engine also increases the power density and reduces this tractor’s operating costs. While the 7250R, 7270R and 7290R continue with the nine litre engine with dual turbocharger, the new 7310R will feature Stage IV compliant engine technology. For transport and PTO applications, the engines’ intelligent power management system provides an extra 22hp on the 7290R and an extra 30hp on all other models. The range is expected to deliver 2% better fuel efficiency overall. John Deere has added a selective catalytic reduction system to its diesel-only engines and increased fuel pressure to achieve more thorough combustion. A new and more efficient cooling package on these engines reduces airflow resistance to provide higher cooling capacity. The individual components of the system have been rearranged and the fan has been redesigned to pull air through the engine rather than push it. The latest 7R Series tractors will be available with a newly designed e23 transmission offering 23 forward and 11 reverse speeds, and equipped with increase the speed of the tractor by 15% even when under full load. To precisely match operating conditions and implement needs, the e23 transmission has 14 gears between 1.6mph and 10mph. Depending on the task, the transmission can be operated in three different driving modes, and an optional left-hand reverser is also available. A new CommandArm console is standard on all 7R Series tractors and replaces the right-hand console of previous models. This groups the tractor controls by function and integrates with the new CommandCentre, which features a new interface and is available with either a 7in or 10in touchscreen display. The new CommandView III Cab has a 40º swivel seat with back rest extension, and customers can choose between a standard air spring seat, the field-proven ActiveSeat or hydraulic cab suspension (HCS) for extra driving comfort. The cab also features laminated glass for safety and a quiet operating
The penultimate 7R, the 7290R, keeps its whopping nine litre dual turbocharged diesel engine.
environment, and a refrigerator for storing food and drinks. Integrated systems enable the use of John Deere’s FarmSight precision farming technology, and a hydraulic joystick with gear shift is available for the CommandQuad and e23 transmissions. Other options include a 360º, while the 8RT tracked versions will be rated at
320, 345 and 370hp. Several of the new 7R Series tractor features will also be introduced on the 8R Series, including the e23 transmission with efficiency manager, though not until include widened hitch rails to simplify the connection of PTO-driven implements and keep the PTO shaft from contacting the rails, plus an additional 1000/1000E speed PTO option.
Powerful 6M and 6R series squeezed into compact frames JOHN Deere is introducing three new, more compact models to both the 6M and 6R Series tractor ranges. Built in Mannheim, the new 6MC and 6RC tractors have been designed specifically for medium size arable, livestock and mixed farms. The new 6090MC, 6100MC and 6110MC models are equipped with and an optional low profile cab allows easy access to small buildings. The tractors’ full frame is specifically designed to accept front loaders such as the John Deere H310 or H340. These are
Smaller but perfectly formed – the 6110MC and 6110RC.
available in non self-levelling, mechanical selflevelling and hydraulic self-levelling versions, with a wide variety of loader attachments. The 6090RC, 6100RC and 6110RC models come with a massive 205 litre fuel tank and John Deere’s PowerTech PWX 4.5 litre Stage III B dieselonly engines. As with the 6MC machines, the wheelbase is 2.4m. Other features include a pressure and flow compensated hydraulic system providing up to 114 litre/min, with 37 litre/min available for implement operation.
OCTOBER 2013 19
Narrower options for fruit farmers
Larger engines planned for 5E Series DESIGNED primarily for use on livestock and small arable farms, John Deere’s 5E Series three-cylinder tractors (55, 65 and 75hp) are also intended for municipal and landscaping applications. They will continue to be powered by Stage III A engines for 2014. By contrast, the new larger four-cylinder 85 and 95hp versions will feature Stage III B diesel-only PowerTech engine technology. The 5E three-cylinder tractors are now also available with a 12x12-speed power reverser in addition to the existing 9x3 synchronised transmission. Its 12 speeds between 1.2mph and 24mph offer a wider selection of gears for each application. The clutchless reverser also provides a
Small but perfectly formed AN ENTIRELY new John Deere model for 2014 is the 4M Series, which slots between the 3E Series compact utility tractor and the 5E Series. Available in 49hp 4049M and 66hp 4066M forms, the 4M is designed for agricultural applications where a narrow, low-profile compact tractor is needed. They are also suitable, the firm says, for large property maintenance and commercial applications such as landscaping, as well as part-time farming. Powered by a four-cylinder turbocharged diesel engine, both the 4049M and 4066M are equipped with a 12x12-speed transmission. This features an electrically engaged power reverser to enable simple changes of direction at the press of a button. The “ergonomic flat floor open station operator platform” features a foldable rollover system, which allows the tractor to be parked in a normal garage. The independent PTO can be engaged on the go without stopping or pressing the clutch pedal. Both tractors have a maximum lift capacity of 1400kg.
separate control enabling the operator to change the reversing speed from fast, for headland turns, to slow, for precise front loader work and easier manoeuvring in tight spaces. An electro-hydraulic PTO button also helps the operator to quickly engage and disengage the PTO
This 5095E is top of the (new) range.
tractors are equipped with a PowerTechE 4.5 litre high pressure common rail (HPCR) engine. Two transmission options will be available on these new models, the 12x12speed power reverser transmission for speeds up to 22mph and a 24x12-speed power reverser HiLo transmission for a maximum speed of 40kmh (25mph).
THE next generation of John Deere’s 5M Series tractors has been designed for small and medium size livestock, arable, mixed and speciality farms. The range consists of four higher horsepower models from 75 to 115hp and features Stage III B compliant engine technology. These redesigned machines will be available from January 2014 in several versions. There’s a standard cab or a newly designed low profile version which reduces overall height to 97.6in even on 28in tyres. There’s also an integrated open operator station, available on the 5085M, 5100M and 5115M models. Finally there’s a newly designed 5M Narrow version with an overall maximum width of 67.7in. The 5M Narrow tractors meet the needs of speciality producers such as vineyards, fruit and hop farms.
Latest addition to 5G family keeps a low profile FEW details of the new-for-2014 5GL low profile tractor have yet been made available but it’s likely to retain most of the features of its 5G Series siblings. First introduced in 2009, the 5G Series is positioned between the 5E and 5M Series tractors and aimed at smaller, arable livestock, mixed and speciality farms. There will be new 80 and 90hp 5G Stage III B Series tractors for 2014 and these will be available in both cab and open operator station versions, with either two or fourwheel drive. As a result, these versatile tractors can be used anywhere from small yards and low barns to large fields.
The higher ground clearance 5GH does its thing.
Equipped with equal front and rear wheels in the four-wheel drive version, the 90hp model is also available as the 5GH, which offers a high ground clearance of 30.7in in its two-wheel drive configuration. The ground clearance allows this tractor to operate in low height crops such as vegetables and soft fruit, as well as vineyards. The new 5G and 5GH Series tractors feature four-cylinder 3.4 litre diesel engines equipped with a common rail system, efficient charge air cooling and a turbocharger to comply with Stage III B emission regulations. They supply a constant power range of 400rpm and a torque rise of 31%. The intelligent power management option on the 5090G provides an additional 9hp at 2300rpm and a power bulge of 5% for PTO and transport applications. The three-point hitch on 5G Series tractors provides a standard maximum lift capacity of 2700kg at the ball ends. Additional lift cylinders are available to extend the maximum lift capacity to 3200kg.
More power from upgraded 5M series. The tractor in the foreground is the open station 5085M.
Tel:01724 852359 Fax:01724 84 8775 Ste a dfa s t in a w o rld o fw a ve ring s ta nda rds
BILLIARD TABLEM AN UFACTURERS Ta bleFittin g ! Ta bleRen ova tion
Din in g Ta b les
Over40 years experience
O a k Ba rleyTw istCo m b in a tio n S n o o ker/Po o l/Din in g Ta b le
•La rgestock ofa n tiqu eta bles •Com bin a tion sn ooker/ d in in g ta bles •Alla ccessoriesa n d spa res •Tota lrefu rbishm en tofta bles •Deliverya n d in sta lla tion s ca rried ou tperson a lly •Fu llSizeTa blesa va ila ble
SPRIN G W OOD LOD G E,ERM IN E STREET,APPLEBY,N R SCU N TH ORPE,LIN CS.D N 15 0D D Em ail:sales@ cheshirebilliards.co.u k
w w w.ch e sh ire b illiard s.co .u k
20 OCTOBER 2013
WrightsClassifieds
OCTOBER 2013 21
To advertise tel: 01507 524004 fax 01507 529499
ATV
BUILDINGS
BUILDINGS
22 OCTOBER 2013
BUILDINGS
To advertise your classiďŹ ed give Sue or Carol a call on
01507 524004
B. POPE & Sons Ltd. Cattle Buildings Grain Stores Potato Stores G.P. Buildings
STEEL FRAMED BUILDINGS AND CLADDING
Workshops Industrial Units Extensions Refurbishment & Alterations
Design, Fabrication, Erection, Cladding or Supply Only
Church Farm Yard Sempringham Sleaford Lincolnshire NG34 0LU Tel/Fax 01529 241493 - website : - email : sales@bpopeandsons.co.uk
OCTOBER 2013 23
MAX LAST CONTAINERS CONTAINERS FOR SALE OR HIRE
new and secondhand
•B AR N S R E-CLAD •STEEL CLAD D IN G SUPPLIED Box Profile Straight C orrugated Straight & C urved
Tel.01366 382294 Fax 01366 382878 Eastern C ounties H um ber to the Tham es
B U S S EN S & VIGR AS S ALL SIZES OF SHIPPING STORAGE AND REFRIGERATED CONTAINERS Tel: 01394 387728 Fax: 01394 388826 Mobile: 07860 413994
user@woodbridge41.fsnet.co.uk Nationwide Service
ROOFING & CLADDING SHEETS
BUILDINGS
CONTRACTORS
PLASTISOL - POLYESTER INSULATION - PURLINS METRE COVER “ONDULINE STOCKISTS”
DIRECT FROM THE MANUFACTURER
Unit 6, Capelhendre Ind. Estate, Nr. Ammanford, Dyfed SA18 3SJ
Telephone: 01269 831869 Fax: 01269 831870
TO ADVERTISE TEL SUE OR CAROL 01507 524004 GENERATORS
24 OCTOBER 2013
GENERATORS
LIVESTOCK
Ford e ta ils te l:
LIVESTOCK
01529 455280 S P E CIA L IS TS FO R M IL L A N D M IXE R U N ITS
U T T L E Y IN G H A M & C O LT D D . W . Ferniho ugh
Bulk Feed Silos Transported New & Used M adeto Orderc/w Feeding System s Bobcatcleaning outservices
Tel/Fa x: 01386 792967 M o bile: 07860 558674
• • • •
FITTED W ITH HA M M ER OR ROLLER M ILLS BULK FEED TRA ILERS A LL TY PES OF GRA IN & M ETERING BINS AUGERS & CONVEYORS
EQ U IPM EN T TA ILO R M A D E TO Y O U R R EQ U IR EM EN TS O VER 50 YEARS O F EXPERIEN C E
View the broker service online at
MACHINERY FOR SALE
trish_ferniho ugh@ ho tm a il.co m sa les@ uttleyingha m .co .uk
MOORE’S YARD, HEMINGBY LANE, HORNCASTLE, LINCS LN9 5PN
• BULK FEED BINS • • PIG & POULTRY FEED SYSTEMS • • DRINKER SYSTEMS • Contact:
K. BARK 07957 568 954, R. MOORE 07957 568 955 TEL: 01507 522386 FAX: 01507 522061
C LUTCHES
CLUTCHES
and m ore CLUTCHES Also FLY W
HEELS
Allm akes-TRACTORS,
COM BINES and TRUCK S
01724 855711 w w w .clutchnet.co.uk w w w .clutch-m anufacturer.co.uk
OCTOBER 2013 25
26 OCTOBER 2013
OCTOBER 2013 27
28 OCTOBER 2013
MACHINERY FOR SALE
BRO W N S O F LI VERS E DG E FOR
NEW & S/H BELARUS TRACTORS
spare parts also available
Tel: 01924 404534
OCTOBER 2013 29
30 OCTOBER 2013
MACHINERY FOR SALE
OCTOBER 2013 31
MACHINERY FOR SALE
P.V. DOBSON & SONS New Perkins Engines and Spares New 3 cyl to suit MF/JCB/Leyland New 4 cyl to suit MF/JCB/Case/Manitou etc New 6 cyl to suit MF/JCB. 200+ other new engines in stock Inc. industrial spec turbo and standard
Next day nationwide delivery service from £35.00 Credit cards accepted P.V. Dobson & Sons (ask for Ryan) Levens, Kendal. LA8 8PG Tel: 01539 560833 Fax: 01539 560675 e-mail: parts@pvdobson.com View engines on Mobile: 07843 314 695 *Prices subject to VAT
Wrights Farming Register covering the heart of England’s farming community from the Thames Valley to the Scottish Borders
32 OCTOBER 2013
MACHINERY FOR SALE
FO RKL R K L IFT I FT BRACKETS B R AC K ETS FO
W eld on fork lifta n d loa d erbra ck ets to fitm os tm a k es a n d m od els
JCB/ M ATBRO £6 8.50 + V AT a ll others PO A
All m a jo rDeb it/Cred itca rd s a ccep ted . S a m e d a y d es p a tch
Tee rr ry Bi T yB irc h
0796 233104/ 01529 455776 0 796 6 2 33104/ 0 1529 4 55776
ngi nee e rin ng@bt onne om tw be be n gin g@ btc o nne c t.c o m ngi nee e rin ng. om tw be be n gin g.c o m
TRADE DIS COUN TS
OCTOBER 2013 33
SERVICES
TRACK UNIT REPAIR
COMPRESSORS
& Reconditioning Specialists
For new and reconditioned air compressors and associated equipment contact the experts
Exchange & New Running Gear supplied Rubber and Steel Tracks for Mini Excavators
T.A. INDUSTRIES
F. MEDFORTH (ENGINEERS) LTD 01964 622692
TOWNSON TRACTORS LTD
01427 668436
SPRAYERS & SPREADERS
Stocking an extensive range of Agricultural Tractor & Machinery Parts at competitive prices. We are also the main distributors for KAB Seating, stocking a full range of replacement seating for tractors, handlers & diggers.
Tel: 01729 850374 Email: chris@townsontractors.co.uk or
TRAILERS
SPRAYER SPARES LTD
For all your sprayer needs Spares for all makes of sprayers New pumps, Spares for most makes of pumps in stock Nozzles from Lechler, Teejet, Hypro & BFS - Call for advice
Hypro Main Distributors Ex-Gem factory staff - specialists in Gem/ Case sprayer spares TYRES
Dale Whorlow 07811 982564 Mick Charlton 07721 513228 On farm testing for ALL makes of sprayers. Ensure your sprayer meets your crop assurance scheme requirements.
Poclain wheel motors spares and repairs available, hydraulic filters for self propelled machines - call for a quote Unit 2 & 3 Moorlands Trading Estate, Metheringham, Lincoln LN4 3HX Tel: 01526 323521 Fax: 01526 323529 Email: sprayer.spares@btconnect.com Most major credit cards accepted
TO MAKE THIS ADVERTISING SPACE WORK FOR YOU GIVE SUE OR CAROL A CALL ON 01507 524004
34 OCTOBER 2013
1
AUGERS
S6557 Transmatic 36Ft 6” auger c\w 5HP 3 phase motor, Galvanised tubes on adjustable stand with 2 wheels. Stored inside Good condition £600 % Shaun 07850 978188 C6807 TRANSMATIC Trolley auger 8” diameter with 15hp 3 phase electric motor drive, 30’+ long with flexi pipe discharge end, flights good (used on outdoor grain silo setup), winch type adjustable height. Also pair discharge augers fit into tube in silos with drying floor, 6” galvanised type fitted 5.5hp 3 phase motors, 16’ long used with 24’ diameter round silos - these priced at £595 each Good condition £925 % Chris C 01926 338639 C6768 ASTWELL Straight 20 ft long 6” diameter galvanised grain auger, bottom inlet slide with handle, 3 phase 5hp motor at discharge end, done little work as paint still on auger flights Very Good condition £450 % Chris C 01926 338639 S6605 RECO Recomatic 6 “ Transmatic auger appx 28ft long c\w 3 phase motor & armered cable. Has Double castor wheels each side to move. Kept inside Good condition £500 % Shaun 07850 978188
2
BALERS AND BALE HANDLING
C6686 NEW HOLLAND D1000 Big Square baler, 1996 model in red & yellow paintwork, makes 60cm x 90cm bales (2’ x 3’), 2m wide pick-up with feed augers & rubber tyred wheels, 4 knotter system with central lube system & twine box carriers either side, hydraulic bale density control, all good pto drive with wide angle coupling, 16.5L16.1 tyres, road lights, all good straight panelwork, done approx 95000 bales Good condition £5,350 % Chris C 01926 338639 W3513 MCCONNEL Bale Packer Mcconnel bale packer makes packs of 16 or 20 convential bales, trailed unit with drawbar and chute system, to fit behind convential baler, used in 2012 season. Cherry Products Bale Gripper included! Very Good condition £8,000 % Chris W 07957 870362 C6803 KVERNELAND Volac Silawrap 7510 round bale wrapper, trailed machine with self loading arm, 4 belt turntable fitted 750mm wrap spool, in cab cable control spool valves with bale counter, rear bale fall breaker mat, 11.0/65-12 tyres, last used 2012 Good condition £1,575 % Chris C 01926 338639 S6706 INTERNATIONAL 440 Convention small square baler, well maintained and ready to work. Good condition £1,000 % Shaun 07850 978188 S6579 INTERNATIONAL B46 Old Conventional Pick up, used this year. Barn stored. Average condition £250 % Shaun 07850 978188 S6902 2001 ARMSTRONG AND HOLMES
C6738 BROWNS Juggler Flat 8 bale collector, tubular frame type all complete with good tyres & bale chute, fits any conventional pick-up baler. Good condition £340 % Chris C 01926 338639 C6726 LAWRENCE EDWARDS Supa Pac static bale wrapper, tractor linkage mounted with remote control requires hydraulic spool valves to operate machine, 4 belt table with tilt ram, 500mm plastic wrap spool facility, unused & dry stored needs turntable operation repair Good condition £850 % Chris C 01926 338639 C6668 WELGER AP830 Conventional baler, 2008 high capacity model in Lely livery, 2 metre wide pick-up, 8 ball twine box, all shaft drives with hydraulic slew drawbar & pick-up lift, 540 pto drive, fully guarded with standard rear bale chute, manual screw density control, 11.5/80-15.3 & 8.0012 tyres, screw type jack & road lights. Very tidy baler just needs a service before work - £3000 less than Agri-Linc ! Very Good condition £10,950 % Chris C 01926 338639 W3512 WELGAR AP630 Serial Number: 1135-04-5199. Mid 1990’s. In working order and will go straight to work. Has been barn stored and the paint is generally good for its age. Baled an average of approx 7000 bales per year for the last 10 years. Operators manual and parts list for the baler. £5,450 % Chris W 07957 870362 S6708 1992 WELGAR AP 630 Conventional small square baler with 68” pick up and hydraulic drawbar offset ram. Tidy straight baler.Stored inside but has slightly faded paint. Good condition % Shaun 07850 978188 W3515 2003 WELGAR AP830 Dealer serviced every year. With hydraulic steel pipes and hydraulic draw at the back and for bale sledge. Hydraulic pick up and hydraulic draw bar, lights and wide angle PTO. Has done 7000 bales per year Very Good condition £9,350 % Chris W 07957 870362 C6729 TRAILEYRE 300 Round Bale Transporter, ex show model with electro/hydraulic controls (flow & return supply from tractor only), trailed unit with standard 6 bale system plus additional Ritchie supplied adjustable extension arms to operate with 12 bales (6’ bales x 6 or 12 bales at no more than 4’6” dia grass bales), 15.00/55-17 tyres on single axle with hyd brakes, screw jack, road lights. All operational well proven machine, only reason for sale is move to square bales. Good condition £3,495 % Chris C 01926 338639 C6814 PET BALE Machine made by ESSE-G to make plastic wrapped 2kg bales, 3 phase electric static unit with walking floor feed will handle all sizes of square & round bales, material (hay & straw) can be fed whole or chopped and finished bale is heat sealed, end accumulator sorts 5 bales to make 10kg easily handled pack Good condition poa % Chris C 01926 338639 S6208 WELGAR RP150 5ft by 4ft Belted round baler c\w mechanical twine tying. Fittted Road lights. Stored inside. Average condition £950 % Shaun 07850 978188
3
BB10 Bale Handling / Stackloading trailer to carry 16 bales ex MF 187 baler. Presently fitted with Nokian 560/45 R22.5 Floatation tyres (60%) Or could come on standard origainal super singles Very Good condition £9,500 % Shaun 07850 978188 S6011 Bale Handler 119cm (4ft) wide. Height 63cm. To suit Skidsteer or similar small loader. Frame is 10x10cm, bracers are 5x5cm.Fitted 2 Spikes which are 100cm (2.5cm ish thick) Very Good condition £300 % Shaun 07850 978188 C6470 BROWNS Buzzard flat 8 bale grab, all good tines with side guide bar, mounted on triangular headstock with steel framework to fit forklift pallet tine backframe, strong enough to handle big bales Good condition £425 % Chris C 01926 338639 C6636 NEW HOLLAND 378 wide pickup conventional baler with red & yellow paintwork has been on farm from new & dealer serviced, good pto drive, fully guarded machine with 8 ball twine box, 6 foot wide pick-up with solid tyre control wheel & main wheel behind to reduce transport width, some bearings & other work done on machine in last 2 seasons, needs service before work, always kept undercover, complete with Browns Bonda late type box section type flat 8 accumulator sledge. Lister 19’ long any level bale elevator with 6’ extension & 3 phase electric motor drive available at extra cost. All in good working order Good condition £2,495 % Chris C 01926 338639 S6788 1996 VICON
RV 186 Variable diameter Belted 4ft Round baler. Nett & Twine wrap, 2m wide pick up,Kicker bar. In cab controls. Very tidy for age. Only Done Hay and straw for last 8 years but could do silage. Very Good condition £2,500 % Shaun 07850 978188 C6813 STRAW CHOPPER Mobile unit made by Compact Systems, pto drive requires 90hp tractor, will handle all size square & round bales (including Hesston), cylinder with chopping knives plus fan for discharge along 6” pipe to either a heap or into buildings (i.e. poultry housing), capacity 3-4tph for litter or feed, chemical mist applicator suit ammonia treated straw. Ideal farm or contractors machine Good condition £15,750 % Chris C 01926 338639 S6888 JOHN DEERE 456A Conventional Square baler, Std pick up, Autolube barn stored, not used this year. Good model. Average condition £2,500 % Shaun 07850 978188 C6464 BALE SPIKE Moulton model, single top tine 1.15m long & 2 bottom tines at 50cm long, done little work with good red paintwork. Brackets to fit Bonser RTFLT tipping backplate but easily changed Very Good condition £345 % Chris C 01926 338639
OCTOBER 2013 35
• See also the wanted section and read the buying/selling details before calling
BEET HARVESTING EQUIPMENT
S6697 HESTAIR Todd Contractor Cleaner Loader, Lifted and fitted 12R 22.5 wheels, continental main web, Single cylinder Lister diesel Good condition £1,400 % Shaun 07850 978188 S6038 JONES High Capacity Cleaner Loader, Fitted 3 cylinder diesel engine, drives machine hydraulically. 5ft wide unloader web, Picking area with canopy over. Huge hopper. All on 4 wheel dray type chassis with 385/65 R22.5 tyres. Good condition £5,000 % Shaun 07850 978188 S6659 STANHAY Rocleaner R60 Hydraulic Folding Interow how configured for 8 rows but could be extended. Will Mount on Front or back of tractor Good condition £1,000 % Shaun 07850 978188 S6873 RATIONAL 3 Row Trailed tanker beet harvester with front mounted offset topper, feeler & knive crowning, self steering lifting,opel wheels, 2 cleaning turbines steering drawbar & steerage disc. Adjustable axles with 14.9/80 - 24 tyres with 70% tread. Good sized tank appx 4 - 5 ton. Average condition % Shaun 07850 978188 S6801 HESTAIR Todd Contractor Mk1V Plus Cleaner loader, Shaft drive, Lister Petter Diesel, Rod link Cleaning and elevator, Tidy for age Good condition £1,200 % Shaun 07850 978188
4
BUILDINGS/ STORES
S5789 Panel doors Electric 3.3m wide in 0.5m deep sections slide up rollers 3ph Poss with switch gear Very Good condition £900 each % Shaun 07850 978188 C6752 CONCRETE Panels as used on silage pit walls, size 6 feet long x 18 inches wide which bolt together, trough shape will stand on a concreteblock to give extra height. Quantity 55 to be sold as one lot, old but sound Good condition £695 % Chris C 01926 338639 S6173 CROPSCAN 15 Potato store control system. All Electric controls plus 6 controllable Louvred Vent panels, 2 - Woods 4ft Diameter 28kw Ventialtion fans and Tapered Kerouin Floor panels 38” By 20” By 1.75” To do appx 24m by 30m (These sort require prepared concrete floor with ducting cast in) Good condition £3,000 % Shaun 07850 978188 S3751 MOBILE Homes Various types available either 12 or 10 ft wide. Generally 22ft or 28ft long suitable for accomodation or office. Prices according to age. Even some late models if required % Shaun 07850 978188 S6546 MALGAR Outdoor Slurry Store Estimated 60,000 gallons, open topped enamelled steel tank appx. 55ft diameter. 24 panels of 8 by 4 sheets, 3 high. Fitted PTO driven stirrer. Good condition £3,800 % Shaun 07850 978188 S6713 HARLOW BROS Stable Block Twin 12 by 10ft stables plus tack room 7ft by 12 Ft deep. All 7ft 6” to the eaves. Proper stable doors etc. Traditional well built sectional loose boxes dismantled ready to load. Good condition £1,000 % Shaun 07850 978188 C6675 GALEBREAKER Doors green mesh type with chain winders & all galvanised steel fittings, Agridoor specification quantity 5 to suit 20’ (6m) wide opening approx 16’ high. All removed and dry stored ready for reinstalling, preferably sold as one lot Good condition £4,650 % Chris C 01926 338639
C6798 CRITAL Steel galvanised panels ex indoor grain silos, square profile type all taken down ready to transport. 3 metre (9’10”) long panels x 35 & 2.4m long panels x 16 complete with starter & finisher panels. Includes some corner posts if required. Originally made two x 10’ square & two 10’ by 8’ silos Good condition poa % Chris C 01926 338639 C6763 COLD ROOMS Choice of 30’ x40’ with 12’ high x 4’ wide panels 4” thick, sliding door for fork truck access. 30’ x 25’ with sloping roof section & door air screen, part steel sides. Blast Freezer room with 3 x 10hp Jerome Engineering compressor units takes it to minus 25 degrees, capacity up to 28 pallets. Also pair freezer banks with 4 fins per inch suitable for fitment to first store above. Quantity of other compressor fridge/freezer units available including outdoor located system by Coolers & Condensers Ltd Good condition poa % Chris C 01926 338639
5
COMBINE HARVESTERS & EQUIP
S6900 1998 NEW HOLLAND TX 62 17ft Cut Combine, Air Conditioned cab, 140 Kw motor, Strawchopper & chaff spreader. Fitted Goodyear 66-43-25 tyres to drive wheels. 16/70 - 20 rears. 2908 drum hours, 3397 engine. Good condition % Shaun 07850 978188 S6773 SHELBOURNE REYNOLDS Draper Header, 11ft wide, later hydraulic drive type suitable for 6 walker New Holland TX combine. 1 piece Canvas. Very Good condition % Shaun 07850 978188 S6163 SHELBOURNE Draper Pick up header suit smaller MF Droningberg Combines. 11ft wide. Sound Black tines with good tines (few Spare). Tidy Good condition £550 % Shaun 07850 978188 W3527 1978 CLASS Dominator 85 13’ header. 2500hrs, Ford engine, chopper, header trolley, rape knife. One owner from new. Was last used in 2010. Requires some tidying but essentially sound and complete. poa % Chris W 07957 870362 S6857 SHELBOURNE Draper Header Hydraulic Drive model with recent new motor. Fittings for JD ( Been on 9640) 11ft one piece canvas with good tines. Very Good condition £4,000 % Shaun 07850 978188 S6896 CLAAS Dominator 85 Combine, fitted cab. 13 ft Cut header with good trolley. Not used this season. Comes with strawchopper which isnt fitted Good condition £2,500 % Shaun 07850 978188 S6668 1997 NEW HOLLAND TX 68 20FT Cut combine with lateral float on header and self levelling seives. Only 2182 Drum hours. Chaff spreader and strawchopper. Goodyear 800/65 R32 fronts and 16/70 20 rears. Very tidy machine Very Good condition % Shaun 07850 978188 S6358 1989 NEW HOLLAND TX 36 Combine with lateral float header, Air Con Cab, Nicholls Concave & Straw chopper. Extensively prepared for harvest inc many new belts etc. Good condition £19,000 % Shaun 07850 978188
6
COMMERCIAL VEHICLES & EQUIP
C6739 MAN LE220C 7.5 tonne flat bed truck, 220hp 6 cylinder 2001model with 6 speed gearbox, double sleeper cab, 327189 rec kms with MOT & tax to end Aug ‘13, 7m long timber ply body 2.4m wide with high front headboard plus mesh screen behind cab, floor height 1.3m above ground, single rear axle fitted 225/75R17.5 all good tyres, built as drag trailer specification 24 tonne gross train weight, rear drawbar & air pipes, twin fuel tanks, leaf spring suspension. Very tidy unit for hay/saw carting or would make classic tractor transport with body adapted as beavertail Very Good condition £3,895 % Chris C 01926 338639 S6807 2009 MITSUBISHI
Outlander Equippe 4 Work, 5 Door comercial version. Only 40,000 miles. 6 speed manual, 2.0 Litre Audi Tdi, 35 - 40 Mpg. Fitted Detacheable Tow bar and Climate control. Good condition £6,500 Plus VAT % Shaun 07850 978188 S6806 2005 LANDROVER Freelander 3 Door Commercial Automatic in Black. Very Clean, Dog guarding and vent. Air Con and CD radio. 225/55 R 17s as new 35 40 MPG Very Good condition £3,750 Plus VAT % Shaun 07850 978188 S6781 FORD Cargo 7.5 ton de-mount body beaver tail and ramps, m.o.t. aug, 72,000 miles c reg Good condition % Shaun 07850 978188
7
CRAWLERS & EQUIPMENT
S6859 TRACK MARSHALL Weight Set Suit TM 90 Crawler, 16 Jerry Can type weights each appax 120lbs. Sustanrial weights. Good condition £600 % Shaun 07850 978188 S6803 SIMBA Tool Carier Heavy Duty Multi pin Linkage carier with 2 rams , bolt adjustable top link and 11.5/80 - 15.3 wheels. Sound Good condition £475 % Shaun 07850 978188 C6788 FIAT Crawler Bottom Track Rollers suit 100/120 models, all refurbished with 45mm gap between roller sides, quantity 8 plus pair additional rollers similar. Also Centre Actuator unit for Hymac 580C 360 degree excavator, fits to centre pivot slew mechainism, fully reconditioned - this priced at £495 Very Good condition £850 % Chris C 01926 338639
S6735 TRACK MARSHALL 90 Crawler c\w Cab, hydraulics and drawbar. (No linkage). Good 16” tracks and sprockets. Perkins 6.354 engine 4335 hours. % Shaun 07850 978188
8
C5458 HE VA
CULTIVATION EQUIPMENT
C6753 KONGSKILDE Triple K spring tine cultivator, mounted 9’ wide with 25 ‘S’ type tines in 4 rows, pair depth wheels one steel & one solid rubber. Suit small tractor much sought after in spring 2013! Good condition £500 % Chris C 01926 338639 C6212 COUSINS Level Lift trailed 5 metre wide unit with 3 subsoil legs on rear frame, adjustable drawbar, twin depth/transport wheels on hydraulic rams, 3 rows sweep tines in frame (10 in total) with subsoil legs behind followed by 24” diameter packer roller 16’ wide on screw adjusters. Sweep tines have bolt on wings making 18” width, all legs indiividually adjustable in height, some reinforcing done on frame & drawbar. One spare leg & some spare wings included. Note this a fixed width machine non folding for transport. Good condition poa % Chris C 01926 338639 S6643 HOUSEHAM 6m Heavy gang Rolls comprising 5 Gangs of 24” Crimps in frame to pull forward or end tow with hydraulic lifting wheels (10/75 - 15 tyres). Good condition £2,000 % Shaun 07850 978188 C6785 CAMBRIDGE Ring Roll single trailed 8 ft wide version, greasable bearings, 20” diameter all tight good ring cleats. Suit reseeding enterprise with compact tractor or similar Good condition £200 % Chris C 01926 338639 C6802 WILDER Pressure Harrow 6.8 metre hydraulic folding linkage mounted (cat 2 & 3), 6 sections 5’ deep in frame with 4 x pressure rams, round type adjustable depth tines in harrow sections - all good & some new, paintwork average but still a useful fast seedbed tool Good condition £895 % Chris C 01926 338639 S6525 Pigtail Tine Drag, 17ft Hydraulic folding, 3 bars 100mm frame, Sturdy tool with 1” section pigtail tines. £1,700 % Shaun 07850 978188 C6736 HAYLOCK Heavy Duty Dutch Harrow, 6.5m wide hydraulic folding tractor linkage mounted with centre section & pair wings, 4 rows tine bars fitted 1 inch round adjustable length tines, front angled timber clod boards & set rear zig zag rigid tined following harrows can be easily removed, cat 2 & 3 headstock, transport lock bar Good condition £900 % Chris C 01926 338639 S6403 SIMBA Single Press Trailed 1 Row cast 24” Ring press, 6” spacing c\w end tow kit. Good condition £1,600 % Shaun 07850 978188 S6559 AGRICAST 20” Press Rings 30 degree cast iron 50cms Diameter, 30 of bought & never used. Plus 4 Shafts each 1m long by 45mm and af ew bearings. New condition % Shaun 07850 978188 W3431 COUSINS Dutch Harrow 4m levelling harrow with manually folds to 3m. Points in good condition but a few missing. No levelling board or roller. Good condition % Chris W 07957 870362 S6853 GALLUCHIO RDA 660 Trailed 6.6M folding Press with levelling boards followed by 2 rows of Cast iron rings. Transport wheels with 300/50 -17 tyres. Good condition £5,500 % Shaun 07850 978188 C6727 PIGTAIL Cultivator linkage mounted 4.3m (14’) wide with end tow built in transport kit, adjustable wide rubber depth wheels, 14 x 1 inch square tines in 3 rows on box frame, built in Spring Tine following harrow (2 row) folds above machine fopr transport, mounting pad for Accord seeder unit & tines have rear boots to take seed tubes, all painted green. Ideal machine for use as bean drill base etc. Good condition £995 % Chris C 01926 338639 C6734 PARMITER Zig Zag set mounted drag harrows, 18 ft wide with 6 individual sections, hydraulic folding in blue paintwork, all good harrow bars fitted 3/4” straight tines. Still an inexpensive method of producing a good seedbed Good condition £575 % Chris C 01926 338639 C6550 JOHN DEERE 410 ‘C’ tine hydraulic folding 18’ (5.6m) linkage mounted cultivator, good 6.50-15 tyres on depth wheels, majority of tines original JD type but some replacements are 1” pigtail type, folds to 3 metres for transport, requires some attention to wheel brackets before work Good condition £795 % Chris C 01926 338639 S6268 SIMBA 4.6M Single press Trailed hydraulic folding type, 580mm Cast rings appx 150mm apart. Tidy condition Good condition £1,900 % Shaun 07850 978188 C6560 LYNX SUMO front linkage mounted tyre press, model LSF150, 1.5m wide in blue paintwork fitted 5 x 295/80R22.5 commercial tyres, some tyres fitted are poor but comes with replacements Good condition £825 % Chris C 01926 338639 C6472 FRONT TYRE Press farm workshop made with 4 x 9.00-20 tyres on commercial wheels mounted on centre axle with bearings, box section strong steel frame with top connecting strut to fit front linkage all painted blue, parking stand, adjustable width guide chains for use with drill marker Good condition £675 % Chris C 01926 338639 S6524 LEMKIN Kompactor S300 3m Tined cultivator. c\w levelling boards and crumblers Very Good condition % Shaun 07850 978188 S6320 VADERSTAD HV/MV 77 ROLLS 6M Vertical hydraulic folding rolls. Fitted 16” crimps and breaker rings. Recent new wheel bearing. £1,350 % Shaun 07850 978188 S6864 C tine Drag 15FT Hydraulic folding 3 Bars each 4” with 15 C tines ( Twin leaf) with 2.5” Reversible points. Rear Drawbar and side mounted 6 - 9 depth tyres Good condition £600 % Shaun 07850 978188
Disc Roller (Doublet) trailed 4m wide hydraulic folding, 2005 model, 2 sets front notched Sabre discs 500mm diameter recently fitted with hyd ram adjustment fo depth/aggression (DSD), adjustable soil mat prior to single row of 32 x ‘V’ profile packer rings with scrapers, rear carriage with 400/60-15.5 tyres, side soil retainers on sprung arms, road lights. Recent soil mat curtain fitted. Machine can be used for straw incorporation, on ploughing or as small seeds establishment tool (eg Rape seed) with Variocaster mounted on rear Very Good condition £9,950 % Chris C 01926 338639 S6886 DOWDESWELL Powavator 130 11ft Spike rotor, 1000 rpm c\w twin hoods and steel wheels. Tines about 6” % Shaun 07850 978188 S6189 COUSINS Points 7 Brand new Quck fit cousins subsoiler points. Part no 8100 8195 £250 % Shaun 07850 978188 S6663 AMAZONE 4m Packer C\with frame and 16 Vaderstad type levelling boards with ram to adjust depth. Good condition % Shaun 07850 978188 S6332 2011 COUSINS Contour 16.5m Hydraulic folding 24” crimp cambridge rolls. Fold into 7 banks,cat 3 linkage . 600/50 r22.5 wheels .Only used one season Excellent condition £33,500 % Shaun 07850 978188 C6399 KVERNELAND Trailed Press 4 metres wide (non folding) made up from set of 700mm diameter furrow press rings (25 in total), axle sets with 2 x 7 ring & 1 x 11 ring, cleaner chains, screw adjuster for drawbar height, rear depth wheel module hydraulic ram raise & lower with 12.5-15 tyres. Concrete ballast block in centre frame, can also take tractor weights on frame bars for extra ballast. Set spare rings on shafts (could be made double press) Good condition £1,995 % Chris C 01926 338639 S6823 SIMBA 3.3 m Press Trailed Rigid single standard 600mm Cast Ring press. 10/75 - 15.3 Tyres to transport. Very Good condition % Shaun 07850 978188 C5546 FLEXI COIL Front Packer Press bracket mounted to front of JD 6000 series tractors weight frame, 750mm diameter 1.7m wide steel toothed packer in frame with scrapers & steering system, hyd ram lift, barrel of packer can be liquid ballasted. Original solid 450mm diameter steel flexicoil included with bearings & star scrapers Very Good condition £500 % Chris C 01926 338639 C6735 KONGSKILDE Triple K spring tine linkage mounted cultivator, 4.7m (15 ft) wide hydraulic folding fitted 47 ‘S’ type tines with reversible points in 4 rows, steel depth wheels, sprung type floating headstock, quick hitch bar coupler Good condition £575 % Chris C 01926 338639 S6750 LEMKIN 2m Crumblers To Fit 4M Thorite 9 Cultivatoror similar. 2- Multi tubular crumblers c\w frames to attach to machine with bearings etc. Tried once hence as new Excellent condition % Shaun 07850 978188 C6781 PIGTAIL Cultivator fixed width linkage mounted 4 metre wide ex Browns Hectavator fitted 1” square section pigtail tine x 16 in 3 rows, rear solid section 18” diameter Flexicoil in full width frame with pin & hole depth adjustment on side arms. Strong machine with 5” square box section frame Average condition £795 % Chris C 01926 338639 C6642 KONGSKILDE Spring Tine cultivator points, genuine new reversible type painted green quantity 40 will require fixing bolts. Will also fit Kverneland/MF and many other springtine models. These are points only not tines & points. Very Good condition £65 % Chris C 01926 338639 C6398 BLENCH Dutch Harrow 10’ wide linkage mounted with 4 rows tines fitted extra length (18”) round adjustable depth tines in box section frame, rear drawbar assembly Good condition £445 % Chris C 01926 338639 C6500 ARAMIX Incorporation/Stubble cultivator, trailed 6m wide Razol hydraulic folding model new in 2004, 13 sprung loaded reset tine legs with winged feet in two rows give 800mm underbeam clearance, followed by 14 soil stirring lateral double disc coulters in sets with individual depth adjustment, rear crumbler rollers, rubber tyred depth wheels on end of wings, transport wheels on rear module at rear of machine, as new points & wings, machine has done little work over last few years & is in full working order all dry stored. Same machine as MF AMXS Aramix Very Good condition poa % Chris C 01926 338639 S6503 STANDEN Powavator 3.7m Heavy duty rotavator c\w Rear hydraulic linkage, plus gathering wheels, depth wheels and spare set of blades. Recent drives overhaul. Very Good condition £3,250 % Shaun 07850 978188 C6509 CAMBRIDGE Trailed set ring rolls with 24” diameter good cleats, primary set 8’ wide (needs repair to drawbar) & pair 4’ wide ‘pups’ to make 16’ width & all tow behind each other for moving field to field Good condition £575 % Chris C 01926 338639 C6748 MICHAEL MOORES Frame & wheel carriage ex 4.5m double press machine, yellow painted box chassis with single ram for folding wing mechanism, 11.5/80-15.3 tyres. No press rings fitted so could be adapted to make trailed 2 leg mole plough etc. photos available Good condition £1,400 % Chris C 01926 338639 C6728 BOMFORD Dynadrive mechanical rotary cultivator, tractor mounted 4.8m wide with rear crumbler roller behind twin rotor system, sound steel hood, recent crumbler bearings, all in working order with good tines, requires 150hp plus to operate. Good condition £1,125 % Chris C 01926 338639 S6218 TWOSE 8M Hydraulic folding cambridge set. 21” crimps on 55mm shafts. Fold horizontally, were originally a 12m set. Sound for age Good condition £3,850 % Shaun 07850 978188 S6341 1997 SIMBA 5.5M Double press Fitted Simba DD rings and detacheable leading tine frame, plus rear drawbar. 400/55 - 15 tyres. Very Good condition £10,000 % Shaun 07850 978188
C6132 FARM FORCE Front Press ‘Simple’ model 1.5m wide with 10 x 700mm type diameter cast press rings (26”), new shaft & end bearings just fitted, cleaner chains, steering arms, demount stands, front mounting bracket (Ford fittings easily adapted for other makes) with single hydraulic ram to raise & lower. All ready for work, 1.8m overall width £850 % Chris C 01926 338639 C6805 MICHAEL MOORES
Cambridge Ring Rolls, 12.5 metre wide trailed hydraulic folding set with 22” diametrer cleats, 5 section horizontal fold with ram on drawbar, flotation 550/45-22.5 all good tyres, ring hitch & screw jack, all good shaft bearings & tight cleat rings, hyd rams on each gang for pressure adjust if required. Well built set cover a lot of ground in one pass Good condition £4,500 % Chris C 01926 338639 C6599 TWOSE Spring Tine cultivator, 14’ wide linkage mounted with 3 rows tines, rear drawbar frame, end hitch ‘A’ frame for transport, total 33 tines with 3 broken, 22 spare new points, blue paintwork Good condition £400 % Chris C 01926 338639 C6598 JEFFES Big 3 pigtail type cultivator, 14’ wide linkage mounted with primary 9’6” section & fold round 4’6” section assists transport, 2 rows large section tines with wide feet (2 tines smaller section), depth wheel brackets but no wheels fitted Good condition £465 % Chris C 01926 338639 C6677 COUSINS Packa-Rolla 4.4m wide hydraulic folding model with double press rings & front leading tines, 15 adjustable height tines in 2 rows, 22 x cast press rings in 2 gangs (44 in total) all approx 22” diameter (24” when new) with scrapers, rear depth/transport wheels on 12.5-15 tyres, transport lock chains & pin & hole adjustment bar for front tine bar depth. Centre folding type with solid cast rings adjacent to axle bearing carriers. Will go straight to work Good condition £5,750 % Chris C 01926 338639 S6696 SIMBA Single Press 5.5m Wide Standard 18” cast rings plus leading tines and wheels to transport at back Good condition % Shaun 07850 978188 S6824 EDLINGTON 6.2m Horizontal Folding Rolls , Good 22 “ cast Rings, Repainted and fitted with Road lights. Upgraded 12.5/80 - 15.3 Transport tyres Very Good condition £3,500 % Shaun 07850 978188 C6732 FLEXI COIL Trailed 4.2m wideTwin Press, non folding model with rear deoth/transport wheels fitted 340/65R18 tyres, hydraulic ram on drawbar to main frame pivot, cast 30 degree press rings 24 front & 25 rear vary in diameter from 675mm to 700mm with 170mm spacing plus scrapers, transport lock valve, ideal for use as single implement or as combination tillage train. Good condition £1,975 % Chris C 01926 338639 C6647 FARM FORCE Front Press 3m wide fitted 700mm diameter 45 degree cast rings in set of 4 +9 + 4 across frame, model number F3300W with front module all adjustable for height of 2 rows spring tines, steering headstock, cleaner chains & greasable bearings to press rings, all good red & black paintwork, machine done little work Very Good condition £3,295 % Chris C 01926 338639 C6741 COUSINS Packa-Rolla 4.6m (15’) trailed hydraulic folding twin cultivator press (900kgs/metre weight), fully adjustable drawbar, 2 rows front adjustable height leading tines, cast 24” LP press rings quantity 23 front & rear, 12.5-15.3 tyres on rear carriage, centre folding to 2.5m transport width with lock bar, may need a couple of hanger bearings Good condition £5,395 % Chris C 01926 338639
9
DE-STONERS
S6178 REEKIE RT 170S Mounted Bed cultivation tiller c\w Reekie RDR SB2 Shearbolt leg bed forming bodies on back. Average condition £700 % Shaun 07850 978188 S4934 PEARSON Jumbo Bedformer c\w 2 Subsoiler legs, 2 C tines, Ridging Bodies. Very Good condition % Shaun 07850 978188 C6720 GRIMME Destoner Declodder, 1991 Mustang model 1500mm wide at discs, pto drive to twin webs first continental type 45mm in good order, front split shares with cutaway side discs & large Diablo above, steering axle with adjustable track, heavy duty scrubber web with hydraulic operation (farm addition), rear cross web for stones & clods, good tyres, not used last 2 seasons but plenty of work left in machine, will go straight to work Good condition £1,350 % Chris C 01926 338639 S5796 PEARSON 60 - 80 Jumbo Bedformer, 2 Bodies with New noses & Bullet points on Subsoil legs. Long arm markers Very Good condition £800 % Shaun 07850 978188 S6179 PEARSON Jumbo 60/80 Bed Former c\w 2 standard Pearson Bodies, with 2 trip leg subsiolers and later weighted markers. Good condition £700 % Shaun 07850 978188 S6230 1997 REEKIE RT 170S Rear mounted Bedtiller later model with chain case skid, tines appx 70% plus RBM 2 Ridgers on back with duck bill points. Very Good condition £1,350 % Shaun 07850 978188 S6813 GRIMME Trailed 1800mm Web Destoner, 40mm pitch, Rear Cross conveyer and bouldedr box. Not used lately, Needs a PTO Shaft. Average condition £800 % Shaun 07850 978188 S6694 2004 JONES Triple Bed Tiller Hydraulic Folding Single rotor Bed Tiller with 3 of 1.65m Heads. 2- 6.9- 6.00 Depth wheels. 4 Ridging bodies. Nice And Straight, Recent New clutch and yoke. Very Good condition £5,000 % Shaun 07850 978188 S6229 1997 GRIMME CS 1500 Combistar Trailed destoner with 2 large discs, large diablo, 4 full shares & 2 half shares. 7 rows of stars onto 45mm web and cross conveyer. Steering & levelling axle with 12.5 80 - 18 tyres. Good condition % Shaun 07850 978188
• See also the wanted section and read the buying/selling details before calling
36 OCTOBER 2013 10
DISC HARROWS
C6754 PETTIT 77 trailed offset disc harrows, 3.6m (12’) working width with part wing fold round section for transport, manual gang angling, cutaway front discs 22” diameter, plain rear discs 21-22” diameter, depth & transport wheels with hyd ram actuation (seal slight leak), rear drawbar, red paintwork, weight 74kg/disc. Same model as Dowdeswell 77’s Good condition £2,300 % Chris C 01926 338639 S6526 PETTIT 77 12 Ft Disc harrows, 24” discs. Transport wheels. Wings fold round and in for transport. Good condition % Shaun 07850 978188 S6860 PARMITER UTAH 12FT Rigid Offset dics harrows with 16 discs on front appx 18 - 20”, 16 rears appx 23 - 24”. Fitted Rear Drawbar, Vredestein 10/75 - 15.3 Tyres on transport wheels 6 stud axles. Good condition £1,500 % Shaun 07850 978188 S6872 DOWDESWELL 84 Series 4.0 M Offset Disc Harrows, 24” Cutaway fronts done 2 seasons, 22” rears. Very good 13/65 - 18 transport tyres. Hydraulic gang angling and folding. Hydraulics plumbed to rear with drawbar. Greasble bearings. Very tidy Good condition £3,750 % Shaun 07850 978188 S6892 RANSOMES HR 33 7ft 6” Trailed offset disc harrows. 22-23” Cutaway front discs, 24” plain rears.Hydraulic wheels with 6 - 16 tyres Good condition £450 % Shaun 07850 978188 S6171 BUSH HOG 1400 Series 7.8m Wide Hydraulic Folding X pattern disc harrows. Ideal for rapid wold cultivation with 22” plain discs front & back. Rear drawbar, recent lift ram. 6 wheels for depth control & transport. Good condition £4,250 % Shaun 07850 978188 S6854 OPICO 8m Hydraulic folding x pattern disc harrows, Fold down to appx 3m. 24” discs Front and back 9” spacing. Extra long rear drawbar with hydraulics. 4 Transport wheels under centre section with 11.5/80 - 15.3 tryres and 10.5/80 - 15.3 tyres on the wings. Good condition % Shaun 07850 978188 W3530 PARMITER 2.5m trailed offset disc harrows with hydraulic depth/transport wheels. Reasonable order for age. Average condition poa % Chris W 07957 870362 S6402 PARMITER UTAH 250 Heavy trailed 3m Disc harrows. 23” Cutaway front discs, 23 -4” cutaway rears. 15/55 - 17 transport tyres. Rear drawbar & hydraulics.Sound Good condition £3,000 % Shaun 07850 978188 S6765 OPICO 20FT X Pattern trailed discs. Recent 24” cutaway discs. Manually folds top 14ft. 4 depth / transport wheels Average condition % Shaun 07850 978188 S6695 GALLUCHIO GPAR 5.0m Folding Disc harrows, 4 depth wheels with 12.5 15 tyres. 24” discs. Hydraulic gang angle adjustment Good condition £4,500 % Shaun 07850 978188 S6898 SIMBA 2 B 3.2M Trailed Offset Heavy Disc harrows, Hydraulic depth/tranport wheels. Tidy order. Single press also to match up if required Good condition % Shaun 07850 978188
11
DRIERS
S5807 1985 LAW DENNIS Drier Double Section Contious flow 40TPH Outdoor Drier, Diesel fired plus 3 phase electric. Possibly Some supply elevators to feed. Buyer dismantles Average condition Offers % Shaun 07850 978188 C6795 OPICO
525XE GT Mobile grain drier, 2003 model completely professionally refurbished in 2012 & done just 150 hours since. 12 tonne capacity pto drive fan & lpg gas fired burner, 12 volt electrical system, all good screens, augers, bearings & unloader, twin wheel model with stabiliser legs, 50 tph fold up rear loading hopper, 12” central auger with agitator arms, swivel round high top unloader (removed ready for transport. All very good paintwork & screens Excellent condition £15,500 % Chris C 01926 338639 C6757 ALLMET Vertical grain drier Mk 4 model rated at 110 cwt per hour, 4 sections each with extractor fans, variable speed system, chain & slat conveyor moves grain through hot & cold sections, diesel fired burner. Large steel framed bucket pit elevator included. Old but all working. Suit spares etc. Good condition Offers % Chris C 01926 338639 C6494 ALLMET Continuous flow two section grain drier fitted rape screens in floor, 6.5tph diesel fired model refurbished by Allmet when installed on farm approx 20 years ago & regularly serviced by them. 3 drying plus 1 cooling sections operated by pair 15hp axial fans with silencers on 90 degree ducts. Gearbox drive with 3 phase motos & full control panel (auto ready). Removed ready to transport but main electrics connected or numbered Good condition £1,750 % Chris C 01926 338639 C6653 FARM FANS AB180A grain drier, automatic batch type 1998 model with only 1678 working hours, electric fan plus lpg burner, top feed & bottom discharge, control panel which allows control of intake & outlet systems, removed ready for transport & sold with full service prior use after reinstalling. Available with a Skandia aspiration precleaner 60tph capacity, model type DOB60F96, complete with quantity 10” (250mm) dia ducting. Drier & cleaner can be sold separately - both in excellent order Very Good condition poa % Chris C 01926 338639 C6703 DRYING TUNNEL & Fan comprising timber tunnel to make 42’ (7 x 6’ long sections) 8’ high & 3’ wide with access & fan flange, galvanised steel ‘A’ section perforated laterals to fit to tunnel sides 3’ long quantity 148 with end sections etc (all 10” high & 11” wide at base). 15hp centrifugal 30” dia fan 3 phase electric left handed type with recent starter & wiring Good condition £1,500 % Chris C 01926 338639
S6846 1997 FARM FANS
AB 180 Gas fired Batch Drier with 3 phase Fan. Mounted on a chassis to ease movement. Top Fill, bottom discharge. Galvanized screens suitable for most crops inc Beans, Linseed & rape. Fitted automated systems control which enable the Drier to switch supply conveyeres on and an off to automate process. Size overall 16ft by 6ft by 9ft tall.. Recently serviced Good condition £6,000 % Shaun 07850 978188 C6624 WELVENT Modulating Burner model 65, propane fired with 650,000 Btu total output from pair of heaters mounted vertically, single phase with gas pipe & Quick Dry burner control unit Series 2000 (Zentronic), new in 1997 & not used in last few years so may need a service before putting to work Good condition £1,395 % Chris C 01926 338639 C6725 WILDER Portamatic batch type grain drier, diesel fired 10 tonne capacity model DPM10 made in 1986, free standing unit on legs with top fill & bottom discharge, full control panel, Myson fan & extractor ducting. All in dry building Good condition Offers % Chris C 01926 338639 S6761 WILDER Portamatic Mobile Drier, Diesel Fired with 3 phase fans. Single Axle chassis. Unit 14ft 2” by 8ft wide 11ft tall, Drawbar and burner add 9ft to length. Rear Top fill & bottom Discharge. Plus 10ft square plywood supply hopper. Good condition % Shaun 07850 978188 S6776 Hardwood Floor 117ft by 55ft, took out in pieces ready to reinstall. Floor pieces 140mm by 45mm with 65mm wide meshes. Fllor complete but requires bearers. Good condition £11,000 % Shaun 07850 978188 S6792 LELY Top Flo 950 Mobile Gas Fired PTO driven drier c\w Stainless steel rape screens and hydraulic unloader. Only 416 hours. Kept and used under cover. Holds appx 9 ton Very Good condition £3,000 % Shaun 07850 978188 C6707 WILDER Robomatic grain drier parts. Pair Myson extractor fans circular type 50cm dia & 1m long with axial 3 phase electric motor drive, diesel burner unit complete with hot air duct adapter fitted NuWay control with magic eye. All removed from working drier Good condition £700 % Chris C 01926 338639
12
DRILLS
S6842 KRM Opti TL 4 Drill Toolbar fitted with Rti 305 Sprung suffolk coulter drill. Tool bar has 13 rigid tines, 2 rows of springtines and tyred packer roller. Drill features Hydraulically driven fan, 3 rows of staggered coulters, Access platform and pre emergence makers Very Good condition £3,000 % Shaun 07850 978188 C6790 KUHN Drill Combination comprising 4003 model 4 metre power harrow new in 2004 with quick fit tines and recent large centre markers fitted to frame, 1000 pto with both 1 3/4” & 1 3/8” tractor end shafts, good side plates, clod boards, 500mm dia rear packer with flexi scrapers. Andy Guest Accord rear drill unit with independent coulter lift, 32 Suffolk coulters in 3 rows with rear Z harrow bar, LH Agro ESC variable seed rate system, tramling, 1/2 tonne capacity hopper. Lely 1 tonne front hopper with hyd fan drive to move seed along Kongskilde pipes to rear unit. All in full working order Very Good condition £10,695 % Chris C 01926 338639 S6893 ACCORD DL 4m Mounted pneumatic suffolk coulter drill c\w tramlining, access step, Hopper extension & cover. Tidy for age Good condition £700 % Shaun 07850 978188 S6723 MATCO Moncentra SP 6 Row Precision drill with cell wheels for Sugar Beet, Done very little work Good condition £800 % Shaun 07850 978188 C6073 HORSTINE FARMERY Rape and small seeds distribution system, plastic 100 litre hopper supplying twin shaft drive outlets with manifolds to 4 outlets with deflector plates on end of plastic tubes, land wheel drive & 12 volt electric motor driven fan unit to blow seeds down tubes, selection drive sprockets for rate control. Used on 3m Spaldings Flatlift 4 leg subsoiler but will fit other machines - can have outlet adaptors for 8 seed tubes. Complete with 2 sets rape rollers for different varieties (not suitable for grass seeds) Very Good condition £1,350 % Chris C 01926 338639 S6880 2007 HATZENBICHLER Seeder Unit Suit subsoiler etc, up to 8 outlets, Wheel driven. Very Good condition % Shaun 07850 978188 S6851 FERRAG Accord DL Pneumatic Drill mounted on frame with 3 rows of Springtines with reversible points. Fitted Hydraulic markers, 20 - 12- 20 Floatation tyres, end tow kit, very good following harrow, access step & double disc pre emergence marker. Good condition £1,450 % Shaun 07850 978188 C6777 KRM SOLADRILL 799 Tine Drill, 6 metre linkage mounted version first used in 2008, sprung loaded tine coulters in 3 rows currently set at 15cm spacing but original tines with machine to make full 48 coulter model, front cultivation tines & rear covering tines on frame, Accord pneumatic metrering system with pto driven fan & extra large hopper, hydraulic folding wings, hydraulic bout markers, tramling x 2 either side, return to tank seed system, tractor wheel ereadicators, flotation 550/50-16 tyres, all good coulter tips, machine little used in 2012 Very Good condition £8,675 % Chris C 01926 338639 C6747 SMALL SEEDS APV PS250 M2 distribution hopper & seed tubes ex Discordon cultivator, 250 litre plastic hopper, star wheel drive, electric motor drive to air seeder unit, twin outlet bars with 4 outlets each. In cab control box. Will fit easily on other machines - subsoilers, Shakaerators, grass harrows etc Good condition £1,225 % Chris C 01926 338639 S6887 FARM FORCE FDM 45 Hydraulic folding 4m Drillmate fitted with 2 rows of springtines and Tyred packer (also steel ones not fitted). Plus Accord DA Drill with suffolk coulters, following harrow, access step and markers. Very Good condition £2,500 % Shaun 07850 978188
C6740 DRILL COMBINATION Maschio Recotiller 3m wide & Sulky Optiline MP air drill, pair new in 2007, quick release power harrow tines 10” long durafaced type, good side plates, front track eradicator tines, choice of standard rear steel packer or Guttler ring packer (steel outer & plastic inner rings) on adjustable bar with cleaners/scrapers. 24 suffolk coulter drill in 3 rows with MS seed distribution system adjustable from tractor plus or minus 10%, rear mini pigtail following harrow, disc markers, pre-emerge disc marker, twin tramling units per side, starwheel metering drive, road lights, de-mount stands Good condition £10,795 % Chris C 01926 338639 S6812 VICON 6m Supaseeder Suffolk coulter Air Seeder c\w Following harrow, hydraulic markers and End tow kit using 11.5/80 - 15.3 tyres Good condition % Shaun 07850 978188 C6518 MASSEY FERGUSON 30 grain drill, 3m version with narrow spaced disc coulters (23 at 5”), hyd disc markers, rear Reekie following harrow with pre emerge markers, front track eradicator tines, 6 tramlining units with 3T & 4T bout cams, 12.4-28 tyres on silver wheels, fine seed rolls on shafts plus set fluted rolls for beans. Large quantity of spares including feed spouts, tines, sprockets etc. Good condition £1,175 % Chris C 01926 338639 C6687 HE VA Till Seeding unit comprising 3m wide linkage mounted front Combi-Lift Doublet 6 leg subsoiler set at 0.5m spacing with adjustable height legs fitted winged feet, connected to 3m Disc Roller with 2 sets rubber mounted Sabre discs all 500mm diameter on hyd ram depth adjustment followed by ‘V’ profile packer rings with rubber soil mat in front, side soil retainers on sprung arms. Variocast air seeder unit on mounting platform above disc roller with 6 outlets (behind discs) for drilling rape seed (additional 2 outlets not used), Radar unit in tractor cab controls seed rate. Rear drawbar with hyd pipe connectors & road lights, seeder unit cover for use as cultivator machine only - all new for 2009 season. Simba DD ring trailed 3.3m double press used behind with 600mm dia good rings & wheels at rear, refurbished to match Till seeder in 2009 can be sold separately Very Good condition £17,000 % Chris C 01926 338639 S6678 2012 KRM PS 120 M1 Small Seeder unit with up to 8 Outlets for subsoiler etc, 2 spare sets of fine seed metering wheels, Electric fan, uses Sensor (wheel mountable) to meter rate. Digital in cab read out. Inc spare pipe and 5 distrubution tubes. Fitted but Never used New condition £2,375 % Shaun 07850 978188 C6811 KUHN KRM drill combination consisting of Kuhn 4002 power harrow 2003 model with quick fit tines & tractor wheel eradocators, KRM Soladrill pneumatic 4 metre grain drill 2011 model mounted above with hydraulic motor fan drive, tine coulters in 3 rows, pre-emergence markers, RDS controller with in-cab rate adjustment (requires no land wheel), large hopper (more than 500kg capacity), bout markers mounted on power harrow, tramlining. Please phone for more details Very Good condition poa % Chris C 01926 338639 S6881 ACCORD Monopill SE 12 Row Hydraulic folding electronic metering precision drill, many extras inc Hydraulic folding and Tellus colour screen full control box. Very Good condition % Shaun 07850 978188 C6778 FARMHAND JUKO 4 metre tine drill with front Drill Mate cultivator module, fully linkage mounted but drill & module can work alone. Drill Mate fitted 2 rows springtine cultivator tines & rear adjustable height levelling coil with ‘piggy back’ linkage mounting for drill. Juko spring tine type coulters x 32 under full width hopper & seed tube delivery to each coulter, tramling system x 2 each side, rear pigtail following harrow, new cassette metering system fitted 2012, 10.5/65-16 end wheels, hydraulic disc markers, calibration handle, good coulter tips & some spare tines, all fitted on ex Hayflake type transport trailer (end tow kit for drill unit included). Tidy good value drill combi Good condition £1,495 % Chris C 01926 338639 C6746 MASSEY FERGUSON 510 pneumatic 6 metre linkage mounted grain drill, fitted ‘S’ type spring tine coulters on box section drag bars, currently set at 5m but tines reposition to make 6m, disc markers, track eradicator front tines, following harrow, sound tyres, working drill ideal for beans etc. with 2 new fan drive belts Good condition £1,695 % Chris C 01926 338639 C6130 FLEXICOIL PC40 drill combi rear mounted 4m wide cultivator/packer unit, consisting of two rows mini 1” pigtail tines on 3” box section frame with standard width reversible points followed by fully height adjustable (pin & hole on side plates) rear tyre packer made up of 24 x 13” type car tyres on one shaft. Three point rear attachment behind headstock to take box drill or Accord type with hyd fan drive plus many other options. Originally used with KRM drill. Useful machine will go straight to work (no drill included) Good condition £875 % Chris C 01926 338639 S6646 WEBB 8 Row Precision drill, end gearbox model c\w cell wheels for sugar beet. Flat steel front press wheels and flat rubber rears. Tidy for age Good condition % Shaun 07850 978188 S6810 CONCEPT 4M Combination Aerodrill 1000 with Suffolk coulters in 3 rows, Hydraulic markersand following harrow mounted on Concept power harrow wth packer roller Average condition £1,600 % Shaun 07850 978188 C6718 ACCORD Hopper & distribution unit suitable for fitting to a subsoiler/cultivator for small seed establishment (rape), all mounted on a steel subframe (last fitted to a Discordon) with a hydraulic motor driven fan supplying 2 sets of 10 outlet pipes connected to a steel bar with seed deflectors, hopper cover, demount legs. Requires a star wheel (shaft etc complete) for rate control Good condition £895 % Chris C 01926 338639 S6802 STANHAY Mk 1 6 Row precision drill c\w Flat steel press wheels, front and rear, Belts for sugar beet. Seeding monitors Good condition % Shaun 07850 978188 S6339 2007 STOCKS AG Turbojet 8 Out let Seeder unit, Electric fan drive and radar control. Bolts onto Subsoiler or rolls etc to drill. Very Good condition % Shaun 07850 978188 S6675 TECHNEAT Autocaster Electric seeder attachment for rape & fine seeds. Will Fit subsoiler with 4 tines for job or On combine header. 8 outlets and metering wheel Good condition % Shaun 07850 978188
S6670 STANHAY S981 12 Row Hydraulic Folding sugar beet drill.Fitted Clod pushers and soft rubber press wheels front and back Good condition £1,600 % Shaun 07850 978188 W3493 WEBB WTB6 6 row beet drill Cell wheel type seeder units. Tidy drill suitable for fodder and sugar beet. Good coulters, tyres and markers. Last used 2 years ago. Good condition % Chris W 07957 870362 S6734 KUHN HR4001 Plus KRM Module R Drill , with recently tipped suffolk coulters in 3 rows, Hyd Lifting following harrow with V good tines, Long arm centre markers. Sound Power harrow fitted flexicoil, 300mm packer optional extra Good condition £2,500 % Shaun 07850 978188 S6122 1996 VICON LZ505 3m Suffolk coulter Combination drill, Pneumatic seeding, PTO fan, Following harrow, Pre emergence markers, Hydraulic markers & stands. Mounted on Kuhn 300 power harrow with HD 3 speed gearbox, Good PTO £1,750 % Shaun 07850 978188
13
ELEVATORS & CONVEYORS
S6607 ANGLEVEYER Grain conveyer Choice of 8 or 5m. Casings 280 mm by 125mm 3 or 4 Kw 3 phase motors. Took out ready to go. Usefull conveyer Good condition £800 each % Shaun 07850 978188 S6816 LANICHBURY Double leg 9” Belt and bucket elevator with 4.2 kw 3 phase motor. Appx 27ft long. Also 32ft Single leg elevator. Good condition % Shaun 07850 978188 S6885 GAMART ENGINEERING 6m Flat Belt Conveyer with 60 cms belt on 4 legs with caster wheels. 3 phase side drive. Used one season only Very Good condition £1,700 % Shaun 07850 978188 C6654 SKANDIA Grain Conveyors, Model KTB40.98 used as a top conveyor 40tph capacity 20m (60’) long, 3 phase electric motor drive, twin outlets, includes inclined section to follow roof profile & maximise drop height. Scandia bottom conveyor with inclined section to outlet at 1m above ground, 40tph with 2.2kw 3 phase motor 9 metres long, new plastic flights fitted on chain Very Good condition poa % Chris C 01926 338639 S6333 SWIFTLIFT Extendo Telescopic elevator, powers in out & side to side on track, plus powered drive wheels. All 3ph Electro hydraulic Variable speed. Good condition £12,000 % Shaun 07850 978188 S6771 SWIFTLIFT Interstore 32 Ft Elevator with 600mm belt and 8ft long powered auto slewing extension. Hydraulic powered up and down. Manual swivel wheels. Good condition £2,900 % Shaun 07850 978188 S6726 HERBERT Industrial Elevator 9m Plus 2m Head. 750mm main belt. Hydraulic raise & lower, plus head separately up and down. Good condition £5,750 % Shaun 07850 978188 S6883 1992 MEDIEMA Dimenso 10670 10m Telescopic Elevator c\w remote control, Powered wheels, Hyd Up & Down. 670mm belt Good condition £9,000 % Shaun 07850 978188 S6604 9 “ Single leg Elevator, 9” Buckets on 10” Belt 11” by 6” casing. 3 phase motor & drive. Appx 20ft long. Removed ready to go Good condition % Shaun 07850 978188 S6602 Top Conveyer 36FT Long 8” conveyer with 7.5” HD chain, 3 links between raddles (11” centres) 3 phase motor & Fenner 20 :1 gearbox Good condition £800 % Shaun 07850 978188 S6814 2001 CARIER 2030 G & F 9” Chain and flight top conveyer. Fully galvanised with Sprung loaded tensioning. Appx 60ft long with 6 vee spouted outlets each fitted with chain operated sliders. Seen Very Little use since installed. Excellent condition % Shaun 07850 978188 C6655 SKANDIA Belt & Bucket Elevators - 60tph model SE140/40 with 2.6kw 3 phase elec motor drive, 140mm wide buckets, outlet height 5.4 metres. SE140/40 belt & bucket model (40tph) with outlet height of 6.5m & 2.5kw motor drive. Also Carier 65tph belt & bucket elevator with 10” wide buckets, 5m outlet height, 4kw 3phase elec motor drive. All modern steel casing type done little work Very Good condition poa % Chris C 01926 338639 S6603 CARIER 6” Top Conveyer Late type with Sprung tensioners. 5.25” by 7.75” Internal casing. Raddles at 9” centres 3 link spacing. c\w 3 phase, motor Very Good condition £1,000 % Shaun 07850 978188 S6725 HIGH CAPACITY 12M Powered Commecial elevator, 600mm belt, Small Spreader hopper at feed end with a ccess pltform roud it. Splits and folds back to transport. Hydraulic up and down plus powered slewing and feeding wheels. Good condition % Shaun 07850 978188 C6386 SWIFT LIFT INTERSTORE Rubber belt elevator, 9 metres long with 600mm wide belt fitted curved chevron cleats, 7ft steel extension chute which swivels on hand wheel control at base, steel curved receiving hopper, removable drawbar, pneumatic tyres on swivel trunnions, 3 phase electric main motor with additional motor on pressure adjuster roller to power one wheel (allows forward/reverse & sideways movement). Raise & lower on hand pump hydraulic ram. High capacity machine in good straight order Very Good condition £3,950 % Chris C 01926 338639 W3266 FYSONS Rubber Belt 25 foot conveyor with chevron belt. 6 foot extention with manual slew. 3 phase motors, hand operated hydraulic pump and twin rams for lift, full width and narrow hoppers, towing eye. Good condition poa % Chris W 07957 870362
14
FANS
C6806 TYPHOON Centrifugal 25hp 3 phase electric drying fans, free standing right handed type used with outdoor grain silos, choice 3 painted red with switchgear & Tryac controllers for use with modulating burners. Price each to include square outlet ducting Good condition £475 % Chris C 01926 338639 S6841 MATHEWS AND YATES PU 1 Type LO Left hand Inlet fans 4ft diameter by 22” fitted 30kw Heater banks. All 3 phase 415v Good condition % Shaun 07850 978188 S6262 TYPHOON HE 30 PTO driven fan, 6ft Diameter by 2ft. RH Inlet. Shaft out with 2 pillar block bearings. Good condition £400 % Shaun 07850 978188
C6662 REKORD Centrifugal 15hp free standing drying fan, model LCL60 3 phase, 30” diameter fan left handed type with 18” x 24” square outlet, older blue painted type not used recently Average condition £345 % Chris C 01926 338639 S6393 15 HP LH Inlet 3 phase fan. Has heater banks, probably not working. Fan runs well. Average condition £350 % Shaun 07850 978188 S6819 REKORD RS 50 LH Inlet Drying fan.c\w 3 Heater banks. 6ft Diameter, 2ft across. Tunnel connection Good original red paintwork Very Good condition £900 % Shaun 07850 978188 S6683 REKORD Fan RH Inlet Model OF 2 c\w 7.5Kw motor. 15” wide 30” diameter. 15” by 20” outlet. Mounted adjustable frame. Very Good condition % Shaun 07850 978188 S5822 REKORD RS 15 LH Inlet, 3 Phase, Appx 4ft Dia, 2ft across. C\w star delta starter etc Good condition £400 % Shaun 07850 978188 S6565 ALLMET Drier Fans 3 Axial flow type, 12.5 HP Brrok motors 2920 rpm cmplete as removed from drier Average condition % Shaun 07850 978188 S5767 Fans 30” By 24” Centrifugal type c\w 3ph 2.2 kw motors. Also some smaller 1.1kw fans Very Good condition POA % Shaun 07850 978188 S6717 REKORD 20,000 CFM LH Inlet Corn drying fan. 36” Diameter 2ft across .Oringianlly had 30hp electric motor drive to drive now fitted with Gearbox belt driven to drive with PTO. Also 4ft diameter Axial flow fan for sale. Good condition £400 % Shaun 07850 978188
15
FEED & FORAGE BOXES
S6878 1995 HI SPEC Super 10 Diet Feeder c\w on board weighing. Feeds silage & Fodder beet well. 3ft wide LH delivery conveyer hydraulically raises to approx 3ft 6”. 15/70 - 18 tyres Good condition £2,400 % Shaun 07850 978188 S6385 1993 JOSKIN Feeder Box. Mounted Self filling silage feeder. Chops before feeding on the RH. Unload only to the left. Used once only Very Good condition £1,750 % Shaun 07850 978188 S6867 2006 KEENAN Klassik 140 Diet Feeder, Std Height LH Discharge with 2ft chute, rear ladder, STAD 04 Weighcell system. Small set blades to chop potatoes and Slabs of straw. Very Good condition £9,000 % Shaun 07850 978188 S6144 TEAGLE Tommahawk 5000 3Pt Linkage monuted Bale Shredder, Spreader. Round bale drum machine with spread left or right. Average condition £1,000 % Shaun 07850 978188 C6710 KEENAN 140 Klassic Diet Feeder, Refurb model new in 2012, top & bottom internal tub cutter blades, angled mixer paddles, top deck to support broken bales into mixer tub for processing, hydraulic operated feed outlet door adjacent to horizontal discharge auger, single axle fitted 365/65R22.5 super single tyres, hyd brakes & road lights, EZ210 DigiStar computer control panel with weigh cell actuation, all good 540 pto drive. All very good paintwork, change of policy sale on beef unit enterprise. Excellent condition £10,995 % Chris C 01926 338639
16
FERTILISER SPREADERS
S6107 1995 LELY Centreliner Supabowl 24 24M Spinning disc spreader, recent discs and bearings, Hopper grids & extension. New PTO bearings. Takes 2 half ton bags. Twin hydraulic shut offs and headland tilt ram. Sound machine Good condition £700 % Shaun 07850 978188 S6769 VICON Rotoflex RS XL 2 Disc Mounted Fert spreader Do 24M c\w Cover grids & road lights Good condition £1,500 % Shaun 07850 978188 C6695 AMAZONE ZA-M twin disc mounted fertiliser spreader, 20 to 28m OS type stainless spreading discs with TS 15-18 border disc, hopper cover, hydraulic shut off, approx 10 seasons old, tested annually by SCS, steel 1000 litre hopper with N2300 extension easily hold 2 x 600kg bags at top up. Good pto shaft, no slack in drive train from gearbox to discs, some slight rusting on hopper joints Good condition £875 % Chris C 01926 338639 S6611 FRAZIER Mounting frame To place Fertiliser spreader on back of Agribuggy c\w 2 hydraulic rams Good condition % Shaun 07850 978188 S6890 GAMBERINI Trailed Salt Single disc spreader. Suit quad bike or compact. Wheel driven. Good condition £400 % Shaun 07850 978188 S5958 KRM EX 1600s Spinning disc fertiliser spreader c\w hydraulic shut off & hopper grids. Straight & tidy Good condition TBA % Shaun 07850 978188 S6645 VICON 602 Wagtail varispreader. 12m, manual controls, greasable bearings. Sound Good condition £400 % Shaun 07850 978188 S6832 AMAZONE ZAU 1501 Twin disc spreader c\w 12m & headland discs, plus hopper grids. Sound spreader well looked after. Good condition £700 % Shaun 07850 978188 C6685 VICON RS-XL Rotaflow 1650 twin disc mounted fertiliser spreader, year 2000 model with hydraulic tilt ram for border work, good pto drive to gearbox currently set at 18m spread but comes with additional gear sets for different widths, all stainless discs and front deflector, hydraulic shut-off, adjustable rate settings, hopper with internal screens plus black hopper cover holds 3 x 600kg bags, road lights Good condition £1,295 % Chris C 01926 338639 S6707 AMAZONE ZAM 1200 Twin disc mounted spreaderwith SBS, Hopper cover, grids and road lights. Comes with 3 sets of discs inc OM24-36. Only used for seed. Very Good condition £3,000 % Shaun 07850 978188 C6696 NODET DPS12 Parts only for fertiliser/small seeds/granular application, all from used machine including fan with gearbox, metering rollers & small seeds kit (note no hopper or other items) Good condition Offers % Chris C 01926 338639 C6574 VICON Rotaflow RS-L mounted twin disc fertiliser spreader, hyd shut off control, hydraulic tilt ram for headland work, 1650 litre hopper with folding black cover sheet & internal grille screens, stainless spreading discs with rate adjusters, 10 to 24m spreading width currently set at 20 metres, front stone & mud guards, 1997 model all in working order Good condition £1,125 % Chris C 01926 338639
C6185 KUHN Levsak tractor mounted crane for fertiliser spreader mounting & big bag filling, 1998 model 1000kg lift capacity with hydraulic extending boom facility, pair spool valves on machine, fits to 3 point linkage & spreader mounts to units ‘A’ frame. Not used for 3 years, paint good but a little dull Very Good condition £995 % Chris C 01926 338639 W3526 2003 KRM BREDAL K65 K65 KRM Bredal trailed spreader fitted with greedy boards. 8300kg capacity. Has a roll over sheet, new floor belt (fitted approx. 500 acres ago), fertiliser kit with the appropriate chute and discs. Chalk/ Fibrophos discs with chute. Has been replaced by same machine but one fitted with weigh cells. It is in full working order and had a rear end re-spray while it was apart having the new floor belt fitted. Very Good condition £15,900 % Chris W 07957 870362 S6638 RECO SULKY DPX 2 Disc Fertiliser spreader, 12m discs c\w frame to fit onto Agibuggy. Done Little work Very Good condition £800 % Shaun 07850 978188 S6684 1999 KUHN Axera H Spreader parts 99 - 02 As follows : Setting Mechanism X2 LH R4072056 RH R4072058. Disk Positioning X2 LH R4072056 RH R4072026. Mud flaps. Electric Rate Meters X2 R2044718. Agitator R4072078. Sensors (Speed) X3 R2009440. Motor Console X1 R3072018.Motor X1 072050. Valve Block R4072074. Cylinder R4072041. Axera Box R2053163. White Box and Wiring R4072083.Grill- Middle. Grill- Side X2. Hyd Hose and wiring Very Good condition £700 % Shaun 07850 978188 S6219 RECO SULKY DPX Expert Twin Disc Spreader with 12 - 28 discs for 24m, hopper extensions, cover & Grids. Unusually good order Excellent condition £1,850 % Shaun 07850 978188 S6676 KUHN MDS 1141 Twin Disc 24 m spreader c\w hydraulic headland attachment, hopper extension, cove & grids. Plus Road lights. Very straight Good condition £600 % Shaun 07850 978188 S6401 1996 KUHN MDS 1121 Twin Disc mounted Fert spreader c\w Hydraulic shut off and manual adjustment. Fitted timber hopper extension. OK 24M Good condition £1,000 % Shaun 07850 978188
17
FORKLIFTS & HANDLERS
W3432 HYSTER SpaceSaver 70 Yard Forklift truck. 3t, free lift, mast to approx 20’. 6 cylinder gas engine. 2 speed manual transmission with clutch. Solid wheels Starts on the button. Mast chains, bearings and hydraulics in good condition. No oil leaks. Good condition % Chris W 07957 870362 C6583 SANDERSON SB60TC Rough Terrain Forklift, 1986 model 2wd with torque converter transmission, 3186 rec hours (clock working) on Ford 4 cylinder diesel engine, power steering, 4 post roll cage over operator area, Triplex low clearance mast with external service spool valve & pallet tines, 16.9-28 drive tyres 20%+ good tread, 9.00-16 steering tyres all good, road lights & rear drawbar. Very straight machine with good panelwork & paint, small arable farm use dry stored hard to find in this condition £3,995 % Chris C 01926 338639 S6656 2006 CATERPILLAR TH220B Telehandler Turbo Engine only 5428 hrs, Powershift box, Single lever control, Air Con, PUH, Trailer braking, Hydraulic locking/3rd service, Plus forks and grain bucket GY 460/70R24 tyres 60% good Very Good condition £19,500 % Shaun 07850 978188 S6869 MANITOU MC 20 AM Buggy Type Low height Forklift, suit poultry or container work. 2wd 10.5 - 18 Drive tyres, LPG Engine, ROPS. Only 3427 hours. Good condition % Shaun 07850 978188 S6285 1988 KOOI AAP RTWT Piggy Back Forklift, 3 wheeler designed to carry on back of lorry. Lifts 2 ton to 2.8m on telescopic tines. Sideshift, 4 cylinder Kubota diesel runs well. Hydro drive. 26.60 - 15.3 tyres. Good condition £2,750 % Shaun 07850 978188 C6634 CASCADE Slip Grab attachment to fit forklift pallet type backframe, model 35E allows stacked & bundled goods (ie boxes/cartons/bottles shrink wrapped or similar) to be handled off the pallet & loaded & stacked using ‘slip’ card only saves space on curtain siders, pallet racking etc. Scissor action cantilever mechanism operates with hydraulics above wide tines, includes sideshift. Can also facilitate pushing forward pallets & similar items into tight & awkward places without withdrawing tines Good condition poa % Chris C 01926 338639 S6737 SANDERSON PM 35 6ft Wide General purpose bucket c\w drillings for teeth. Own Hydraulic carriage with Kwiki fittings suit Sanderson Rough terrain or industrial forkilift Good condition £900 o.n.o. % Shaun 07850 978188 W3457 1970 NU WAY BENSON McConnel Tail Slave TS 20 Rear mounted forklift. 1t capacity on forks. Fits onto tractor mounted sub frame Average condition % Chris W 07957 870362 C6178 COVENTRY CLIMAX Yard type fork lift truck, Perkins 4 cylinder diesel engine, manual transmission with reverse shuttle & high/low selection, full free lift mast lifts 4000 lbs (1800 kgs), pneumatic tyres, front 7.00-12 & rear 5.50-10. 4 post roll cage, 2 lever controls to mast (no side shift), recent work on mast & steering. Just fitted new starter motor & ring gear plus transmission clutch. All in fully working order Good condition poa % Chris C 01926 338639 S5878 MOFFATT 2004 Lorry Mountable 3 wheeler forklift, 10ft duplex mast. Galvanised chassis & ROPS frame. 27-10-12 tyres. Very Good condition £3,500 % Shaun 07850 978188 S6551 2003 JCB TM300 Pivot Steer Telehanndler, JCB Smoothride, Air Con cab, Joystick controls 6000 hours. 60% 460/ 70 R24 Industrial tyres. JCB Q Fit carriage & Pallet lines Good condition £15,500 % Shaun 07850 978188 C6532 HYSTER Yard Truck forklift, Perkins 4 cyl diesel engine driving torque converter transmission, forward/reverse foot pedal, 6374 rec hours, duplex mast with 1’ of freelift will fit through 8’ clearance, pallet tines, 4 post rollcage, pneumatic good drive tyres size 7.00-15 & solid rubber rears size 6.50-10, diverter valve from mast ram to operate hydraulic service, good yellow paintwork Good condition £1,950 % Chris C 01926 338639
C6486 RIPVATOR FL80 Watveare tractor rear linkage mounted forklift with bottom pneumatic support wheels, cat 1 & 2 linkage with hydraulic top link, horizontal sideshift hydraulic ram system, fold up pallet tines, good orange paintwork, needs 3 spool valves to operate Good condition £825 % Chris C 01926 338639 S6778 CATERPILLAR V180 8 ton Heavy Duty Forklift, Will lift 10 to. Extenden tines on 180 degree rotating carriage. Cab, Caterpillar 200 HP V8 engine. Good condition £9,750 % Shaun 07850 978188
18
GRAIN EQUIPMENT
S6782 50 TPH Dresser Air driven so will also improve the bushel weight, only dressed 200 tons wheat so nearly new ,cyclone dust extractor included, 3 phase Excellent condition £25,000 % Shaun 07850 978188 S6235 REKORD RS 15 LH Inlet 3 phase fan c\w Switch gear, Took out ready to go Very Tidy. Plus 10 .5 sections of 6ft by 6 by 3ft Ply over timber framed grain tunnel. Each one fitted 2 flanges each side for 10” laterals. Good condition £800 % Shaun 07850 978188 S6775 WELVENT Hardwood Floor 90ft wide in 2 sides by 60ft long, Fully dismantled in pieces to reinstall as required Floor sections in various lengths, 140mm by 45mm. Bearers 2” by 4”, plus some complete end panels. 60ft plywood 6ft by 4ft in sections 15ft long with raised walkway above. Plus 2 - 15 HP fans. Hardly marked Excellent condition £16,000 % Shaun 07850 978188 S6901 LUNDAIN Portable Grain Stirrer 3 phase model with 3” Auger appx 5ft long. Handle bar type manually operated. Very Good condition £2,000 % Shaun 07850 978188 S6681 GALVANISED Ducts 121 6ft Galvanised steel grain laterals appx 15” tall by 16 wide at base 3” across the top. Plus 26 same 3ft long, some end caps. Very Good condition £6 each % Shaun 07850 978188 S6355 KONGSKILDE TRL 150 Grain Blower on trolley, fitted 3 phase with 11kw motor plus 2004 CAD 20 -11 Rotary valve. Rated 10TPH Appx. Very Good condition % Shaun 07850 978188 S6279 TYPHOON LH Inlet Downdraft 15 HP fan suitable for mounting on top of grain tunnel outlet at 45 degrees. Good condition £400 % Shaun 07850 978188 S6777 CHALLOW Hardwood Flooring 1100 square feet. Taken out in 7 pieces of 8ft by 20 ft Good condition £6,000 % Shaun 07850 978188 S6652 CRITTALL Grain panels Galvanised steel,10ft wide by apppx 30” Some in Situ some down, Priced accordingly Good condition % Shaun 07850 978188 C6657 SKANDIA & BRICE BAKER handling equipment ex grain store/drier. Skandia mechanical intake pit with drive over grid (size 2.5 x 0.9m), model KTG60-96 fitted 2.2kw 3 phase elec motor drive, capacity 60tph with total length of 8.4m & delivers at 2m above ground. Brice Baker ‘U’ trough auger, 6” flights with reversible flow (either direction), 8m long with 4 outlets, 3 phase elec motor & switchgear. Brice Baker GP straight auger 20’ long with 6” flights & 3 phase motor plus intake hopper. All taken out ready to transport Very Good condition poa % Chris C 01926 338639 S5192 BOSWELLS OF BLAIRGOWRIE 2 Screen Dresser 20TPH Pre cleaning dresser, 2 screen shoes with varous alternative screens. Mounted on platform in air. 7ft by 5ft6” by 6ft Tall. Plus extraction duct out. Good condition % Shaun 07850 978188 S6256 LISTER Triaduckt 75ft of Galvanised steel grain tunnelling, 8ft tall including walkaway. Taper sides with outlets for laterals (70 by 40mm). Appx 125 Laterals avaialble 1.8m long. Good condition % Shaun 07850 978188
19
GRASSLAND EQUIPMENT
S6595 Hayrake 6 Rotor Trailed rakes, choice of 2 just need donor Acrobats wheels to complete. Average condition % Shaun 07850 978188 S6743 TWOSE 10 FT Flat water balastable trailed Roller 30” Diameter. Fitted Top weight tray for stones or extra weights. Good condition £600 % Shaun 07850 978188 S6552 HAYTER LT 324 Ride On Mower, 84inch cut, power washed/sand blasted/primed and painted. New bottom blades/Cylinders reground/ new radiator/ new battery/replacement cylinder head/new set of piston rings/ new bearings and seals/ filter kit/ new pins and bushes to cutting reels/ complete set of new decals. Excellent condition £7,850 % Shaun 07850 978188 S6838 KRM
C6759 CLAAS Sprint 260P forage wagon, trailed self loading 1985 single axle model with 1.6m wide front pick-up reel, knife cutting system with rotary feed rakes, floor chain unload to rear, all complete with good tyres, unused recently so suitable for refurb or parts Average condition £895 % Chris C 01926 338639 S6352 1990 MACDON 3000 Trailed 7.5m wide Cutterbar Swather, knife cutterbar lays onto canvasses then out through centra swath 1.3m wide. End tows for transport. Rare tool Good condition £5,000 % Shaun 07850 978188 S6386 JOSKIN EB360 R3 Mounted folding grassland harrow. 3.6m Working width folds to 2.4m. Levells molehills dung etc.Cat 2 linkage Very Good condition £1,600 % Shaun 07850 978188 C6770 KUHN FC313FF linkage mounted centre pivot mower conditioner, 2 seasons work only approx 400 acres/year, 3.1m (10ft) cutting width with 6 disc bed, rear nylon ‘V’ shaped conditioner tines with all adjustable swath deflectors, full protection skirts all very good condition, twin pressure gauge headstock unit for ground following ‘lift control’ floating cutting bed system, fold up demount stand, all very good paintwork. Retirement sale - rare opportunity for excellent quality mocon Very Good condition £8,350 % Chris C 01926 338639 C6556 ROTADAIRON Stone Burier/Rotary Cultivator model RD350, linkage mounted 3.5m wide with pto & gearbox drive to reverse type bladed horizontal rotor, steel comb fingers behind rotor followed by steel mesh cage roller packer unit with screw type depth adjustment, 1000 pto driveshaft. Produces very fine seedbed & buries stones suitable reseeding or preparation of golf courses, playing fields & turf grass etc Good condition £5,995 % Chris C 01926 338639 S6889 TAARUP 337 Trailed mower with double yoke headstock drawbar, 10/80 -12 travelling tyres. Had conditioner originally but no longer fitted Good condition £1,500 % Shaun 07850 978188 C6758 OPICO Bush Hog Flex-wing model 2615 heavy duty 15’ rotary topper, all gearbox & shaft drives to 3 section hydraulic folding ‘batwing’ system, swinging chain deflectors to steel decks, free swinging twin cutting blades on central dishes, solid rubber tyres on rear x 6. Wide angle pto drive. Requires some small jobs before work Average condition poa % Chris C 01926 338639 C6697 KUHNFLEX 4 Rotor hay & grass tedder, tractor linkage mounted with rubber skirted vertical drums fitted steel tines, model KE4 requires pto shaft & swath deflector arm. Suitable for spares or repair Average condition £475 % Chris C 01926 338639 C6704 KUHN Flail Topper model VKM 240 fiited rear roller & hydraulic slew ram to offset machine, linkage mointed 2.4m (8’) wide with 540 pto drive, front steel stone deflectors & rear rubber curtain, horizontal rotor fitted wide section swinging flail heads, tidy paintwork & all in working order Good condition £2,850 % Chris C 01926 338639 S6388 JOSKIN D280 CZ Pasture Topper, 2.8m Breed, Mounted Cat 2 Machin, PTO driven. Skid height controlled Good condition £1,250 % Shaun 07850 978188 S6550 OPICO Hazenbichler 12m Hydraulic folding Grassland harrow, 8 section with rubber depth wheels Good condition £3,500 % Shaun 07850 978188 S6794 MAJOR 6ft Topper Single rotor with blades, runs on skids. Recent Gearbox and paint. Good condition £675 % Shaun 07850 978188 C6663 HUSTLER Zero Turn Ride-On mower, Fastrak Super Duty model new in July 2011 & done 31 hours only, Kawasaki 11.9kw petrol engine elec start, two lever controls with clutchless transmission, twin fuel tanks, 36” central cutting deck with fan ejector system to twin rear collector bins with lids, set mulching blades & deflector, fully adjustable cutting height from operators seat, 20x8-10 pneumatic tyres. All in as new condition - price includes VAT Excellent condition £6,495 % Chris C 01926 338639 S4847 2006 ECKO 400 ES High Performance strimmer c\w auto nylon cord head. Cracking tool. Less than half new price Very Good condition £120 % Shaun 07850 978188 S6863 RICHARD LONG ENG 1502 Versatile PTO Driven Trailed Flail Mower / collector with scarifying attachment. 1.5m cut with Rollers either side of flails. New Bearings and drive belts fitted. Collection Hopper tips at appx 1.4m high. Good condition £1,250 % Shaun 07850 978188 S6664 2009 OPICO 3m Sward Lifter Fitted 3 subsoiling legs with Discs and individual guttler 4 ring press modules on each leg. 2 spare sets of feet. Usefull bit of grassland kit hardly used Excellent condition £4,700 % Shaun 07850 978188 S6833 MURRAY 125/96 cm Ride On Mower with 12.5 HP Briggs and startton engine, 5 speed & reverse. Side discharge or rear grass collection Very Good condition £450 % Shaun 07850 978188 S6845 2011 TEAGLE 510 Mounted 6ft wide model with Cat 1 & 2 lift pins.Fixed Offset with Roller on back and adjustable side skids using widing handles.540 PTO. Very Good condition £700 % Shaun 07850 978188
20 Zenit 2300 Mounted Hydraulically Offsetable Flail Mower with rear roller and removable shields for a variety of work from Grass finishing to heavy scrub tidying. Good condition £2,250 % Shaun 07850 978188 S5984 2001 KRONE AMT323CV Tariled 3.2m Mower condtioner with steel flails.1000 rpm pto. Tidy Green paintwork Average condition £1,750 % Shaun 07850 978188 C6771 VICON Andex 783 trailed twin rotor rake, Terralink Quattro model fully adjustable with hyd rams from 7.0m to 7.9m working width (operates easily with 3 x3m swaths), single backbone frame with hyd folding wings carrying tined rotors with 4 pneumatic tyres per side, lower link hitch attach to tractor allows rear machine wheel steering on connecting linkage. Purchased as ex demo machine in 2012 & done 2 seasons on small farm. All in full & complete working order with centre rubber curtain partly missing. Very Good condition £9,995 % Chris C 01926 338639 S6523 BEAVER Trailed Gang Mower set of 5 gang mowers each 30”, hydraulically driven & folding. Good Standard heads, Cut appx 16ft. £3,800 % Shaun 07850 978188
OCTOBER 2013 37
• See also the wanted section and read the buying/selling details before calling
HEDGECUTTERS
C6679 BOMFORD Hedgecutter Flail head, Protrim 1500 model 5’ (1.5m) wide with own hydraulic motor drive (high capacity type) & belt drive to flail shaft, fitted ‘T’ section heavy duty flails, rear roller, box section mounting frame, done one season only on mid mounted machine note this is just a flail head for sale Very Good condition £3,850 % Chris C 01926 338639 S6387 BOMFORD 81 - 81 Barcket mounted swing round (LH > RH) 8m Hedger. In Cab electric multi joystick controls. 1.4m head. 540 PTO. In use recently. Good condition £3,800 % Shaun 07850 978188 S6395 TURNER Hydomower Bracket mounted Hedgecutter c\w 4ft 6” head. Springback arm, 4 spool control block on adjustable arm. Medium Duty Flails Average condition £1,250 % Shaun 07850 978188
21
IRRIGATION EQUIPMENT
S6665 ROVATTI S3KS80-60/7E-TM ‘ROVATTI MULTI-STAGE HIGH PRESSURE CENTRIFUGRAL Water PUMP, 7 Stage, Unused, Cost €2,500 (OEM Price) suit Irrigation etc. New condition £995 % Shaun 07850 978188
C6271 MARANI 75-300 Irrigation reel, turbine drive turntable type used for veg & potatoes, 3 wheel gun carriage with adj track, approx 300m long 75mm pipe, galvanised chassis, requires work on gearbox & new tyres to make operational but useful reel to use as mains for dirty water system etc. Average condition £795 % Chris C 01926 338639 S6721 WRIGHT RAIN 48M Boom Alluminium Mobile Folding type for Irrigator on Galvanised 4 Wheeled chassis. Suitable grassland or arable use Good condition % Shaun 07850 978188 S6584 AQUA Reel Irrigator o 3 small wheels, 25mm pipe, spining 2 outlet distributor Average condition £400 % Shaun 07850 978188 S5317 GOLDENRAIN 45M Alloy Boom Folding Set to use with Reel on on 4 wheel Galvanised Steel chassis c\w 90mm feed hose. Jets every 1.55m. Parts attainable through Wright Rain. Seen little use Excellent condition £1,400 % Shaun 07850 978188
23
LIVESTOCK EQUIPMENT
C6529 STEEL GATES Galvanised 4 bar type 12’ long mobile gates with wheels either end, 45mm diameter tube, hook & chain retainers to make penning etc quantity 3. Galvanised 5 bar heavy duty 12’ gates with hanging & closing furniture, one with box ends, 50mm tube, one with 35mm intermediates - quantity 3. To be sold as one lot Good condition £570 % Chris C 01926 338639 S6564 CLARK Feed Pump 2.2 Kw on stand (3ph) 2820 rpm 4.5 amp, also similar Brook Crompton Pump and 7.5 kw 3 ph Pump Good condition % Shaun 07850 978188 S6558 ZICHT ABEGG 400mm Wall mounted livestock building extractor fans. 230v 1300 rpm mounted in 540mm square frame. Up to 10 available some new Very Good condition % Shaun 07850 978188 C6693 MORRIS Cattle Crush standard type with yoke inside tubular crush frame, timber floor, opening side gates, full length modified yoke, painted black, can be tractor linkage mounted, 8’ long suit smaller cattle breeds Average condition £245 % Chris C 01926 338639 C6794 GRAYS
Silage Grab model 245, serrated front blade & solid sides, twin ram type 1.6m wide with all good tight tines x 10, Manitou fittings plus hydraulic couplings on top rail, new in 1999 all very straight & tidy with good rams & some new tines, operator instruction book included Very Good condition £750 % Chris C 01926 338639 S6583 GALVANISED Water Troughs 2 Of Appx 10ft by 4ft by 2ft in Sound order % Shaun 07850 978188 C6742 IAE Sheep Turnover Crate fully galvanised with end brackets to affix hurdles, circular type all fully adjustable free standing with foot pedal operation, mesh end gates, adjustable top rails, total length 5’6” Good condition £480 % Chris C 01926 338639 C6637 FULLWOOD Abreast milking parlour equipment with Mueller 3000 litre bulk tank all available as one lot or to be used for spares etc. 4 station parlour with 8 cluster unit ACR’s plus 4 feeder steel dropper hoppers with pipework etc. Vacuum pump, 7 gallon jars, plate cooler, Ambic flow filter. 15 year old DX Mueller Europa oval type free standing stainless bulk milk tank 0700 model size approx 6’6” long 5’9” wide with compressor etc. Last used Dec 2012 Good condition poa % Chris C 01926 338639 C6628 SHEEP Walk Through feeder troughs, timber constructed single sided type made to ADAS specification, 8ft (2.4m) long with 60cm wide trough & stand 1.1m tall, Marine ply trough base (19mm thick) & sides (12mm thick), All free standing. Quantity 12 to be sold as one lot. Have been used with Hoggets as well as sheep Good condition £875 % Chris C 01926 338639 S6063 Freestanding 6ft Cattle troughs, 2 galvanised, 2 painted, adjustable legs, varying condition. Still solid Average condition £350 each % Shaun 07850 978188 C6709 ALFA LAVALL Milking parlour equipment ex 20/20 system now dismantled - Glass jars & ACR units, Candle jetter washers, milk pump & 200 litre stainless receiver vessel with milk pump & liquid level control box. Please phone for more details Good condition poa % Chris C 01926 338639 C6641 LIVESTOCK Pet Cremator/Incinerator made by J G Shelton & Co, installed new in 2000 and used in commercial animal cremation business. Capacity up to 50kg/hr using diesel fuel (28 sec) and 3 phase electrics, Fully compliant free standing unit with footprint approx 10’6” x 6’, chamber size 4’6” x 2’6” and fitted with sluice gate type access door. Manual recording system , full control panel & uses small compressor for air control, twin burners, side fans, fire brick furnace, full vertical flue to outside. Hand type ashes grinder. All in working order. Very Good condition £4,750 % Chris C 01926 338639 S6849 Cattle Crush Portable Type, mounts on 3 point linkage to move. Has Small gate one end and full yoke gate at other with bar stops etc. Detachable timber floor. 8ft by 33” Good condition £350 % Shaun 07850 978188 C6791 CALF PENS Hardwood timber 5 rail type with front, sides and rear, total 18 made up in pairs all easily assembled with slot in metal brackets, pen size 6’ x 3’ & 3’6” high, adjustable front yoke with twin bucket rings, galvanised hay rack to fit pen partition, strongly made with bolted rails to uprights, full set buckets included. All neutralised by recent outdoor storage Very Good condition £450 % Chris C 01926 338639 S6560 BIG DUTCHMAN Platform Scale Suitable for small livestock or packages 20 - 600 kgs. 76” by 31” c\w 12/240v Control box. Galvanised steel. Unused but shopsoiled Very Good condition % Shaun 07850 978188
C6750 FEEDING Equipment for sheep & cattl., Pair IAE portable 2 in 1 galvanised cattle steel trough & feed barrier combined, free standing 15’ long with angled barrier & trough size 2’6” wide by 16” deep, all very straight with no rust. Bateman round bale feeders for sheep, galv type 5’ 3” diameter bottom sheeted, 24 vert bars total height 3’, quantity 6 all good. Lamb creep feeders double sided non shelter type, adjustable feed openings, 8’ long with strong timber lids, mobile with end wheels & stands - quantity 5. All to be sold in lots as listed Very Good condition poa % Chris C 01926 338639 S6585 MOTORWAY Crash Bariers Appx 4m Lengths, plus a few 1m length. Mixed condition, suit stock holding Good condition % Shaun 07850 978188 C6799 COTSWOLD Bulk Tank dairy hot water automatic washer unit, stainless steel with control panel, cold water feed, size 110 x 52 x 38 cms. Requires some refurb work (motherboard), 18 months old used with 2 tanks of 2000 & 1700 litre capacity Good condition poa % Chris C 01926 338639 W3531 COMPAK Bale Chopper Will chop bales of all sizes. Complete with applicator for applying additive to straw. poa % Chris W 07957 870362 C6358 ROKA Bulk Milk Tank & Parlour Modern oval cylindrical free standing stainless steel 7000 litre capacity tank with twin 3 phase refrigerator units & pair stirrers plus hot water wash system from wall mounted water heater, recent new stirrer & motor. Gascoigne Mellote 8x16 herringbone parlour with operator pit, cluster washer & hot water wash system all computer controlled with MR2000 parlour controller. Compressors etc. included. Fullwood Regent water heater for parlour hot water flush system. Also pair feeding stations with transponder collars for out of parlour feeding - controlled by parlour system. Phone for photos & full details Very Good condition poa % Chris C 01926 338639
24
LOADERS AGRIC/ INDUSTRIAL
S6705 FORDSON Power Major Fitted Sturdy Power loader, roll frame, 70% 1136 tyres, cast fronts. Power Steering, Very Good runner Good condition % Shaun 07850 978188 W3368 KOMATSU D31S 16 Drott Tracked Loading Shovel with 4-in-1 bucket. Komatsu 4 cylinder 63hp engine, 3 speed forward/reverse clutchless transmission. Low houred for age (late 1980’s), cab complete with all glass, seat recovered. Complete with rear ballast weights and new batteries. Running gear sound, sprockets good. The paint might be a bit faded but mechanics, hydraulics and metalwork very good. Good condition £4,250 % Chris W 07957 870362 W3426 KOMATSU D53S-17 Tracked Drott. 110hp, 3 speed powershift, 4-in-1 bucket. Heavy duty loading shovel. Track gear good. No ripper. 8300 recorded hours. Has had replacement engine. On farm use only recently. Good condition £12,500 % Chris W 07957 870362 C6449 JCB Micro mini digger on rubber tracks, 2006 model with only 677 hours, roll bar over operators seat, front levelling blade, piped for breaker, Perkins 3 cylinder 12.9kw diesel engine, 4 spool lever controls, 180mm wide tracks all very good, with set 4 buckets 30”, 24”, 12” & 6” plus breaker unit for concrete etc.. Very tidy owner driver digger always dry stored Very Good condition £8,995 % Chris C 01926 338639 S6899 MUIR HILL A 5000 4wd & 4 wheel steering Loader with Perkins 6.354 engine.Very Strong lifter. Average condition % Shaun 07850 978188 S6294 CATERPILLAR 308B 8 ton 360 degree excavator on Rubber tracks. Fitted 8ft Blade. Has Zero scour jointed arm. Comes with 4 Buckets, 6800 hours Very Good condition £11,500 % Shaun 07850 978188 S6799 CHEIFTAN 3 Ton 360 degree Mini digger on wide steel tracks. Fitted Mini dozer blade and Cab. Good Mitsubishi Diesel Engine Good condition £3,500 % Shaun 07850 978188 W3433 BOMAG K301 Sheeps Foot Compactor. Cummins V8, 3 speed powershift. Hydraulic blade. A large and formidable piece of kit! Average condition £6,450 % Chris W 07957 870362 C6441 LOADER Brackets weld on type to fit attachments, 4 pairs to fit Farmhand loader, 1 pair to fit Faucheaux loader and a pair of wide Chiilton loader frame brackets. Photos availoable Good condition poa % Chris C 01926 338639 S6787 HYMAC HM 610 Wheeled 360 degree digger, c\w Ford 6 Cylinder engine, 6ft dyking bucket and 2ft toothed bucket. Estimated weight 10 ton. Runs on 4 pairs of 20-10-20 tyres. Average condition £1,850 % Shaun 07850 978188 C6535 SANDERSON Bulk Bucket ex Rough Terrain Forklift, 8ft wide, 3’6” high & 4’6” deep, twin ram tip on backframe with fitting to suit pallet tine rail - could easily be modified to have brackets welded for other fitting type, yellow paintwork, bucket in all sound order Good condition £695 % Chris C 01926 338639 S6704 INTERNATIONAL 3434 Industrial loader tractor complete with power loader and twin cylinder compressor on back. 6ft power bucket, Pallet tines and muck fork. 70% 14.9 - 24 rears. Single door cab Good condition £2,300 % Shaun 07850 978188 C5953 SUTON Bulk Bucket heavy duty type to fit MF50B industrial loader/digger, 6’ wide & 32” high with centre gusset plate, top overhang lip, welded in bracket to take bale spike, brackets easily changed, all very sound. Also 5ft ditching bucket to fit MF 50B digger at £100 Very Good condition £385 % Chris C 01926 338639 C6796 JCB 8060 Excavator 6 tonne 360 degree type, 2004 model with Isuzu engine, 4852 recorded hours, rubber tracks, roof guard, work lights, cab with heater, piped for breaker, includes pair buckets, all straight & in full working order Very Good condition £15,495 % Chris C 01926 338639 C5877 DIGGER Back Actor ex tracked Fiat loading shovel, Benfra model E6ESP demountable type with single hydraulic connection & large bore return (similar to MF220), spool valve levers on machine, hyd stabiliser legs, 30” wide digging bucket with teeth, slight leak one ram (possible connector seal), 15’ reach. Ideal unit to fit to Telescopic loader or similar. Done little work as ex Army. Good condition £775 % Chris C 01926 338639
S6870 2004 KOBELCO 1.8 Ton 360 degree Minidigger c\w cab, Blade, Pipework for hydraulic tools, Various buckets, Only 930 hours. Very Good condition £7,995 % Shaun 07850 978188 C6786 DIGGER BUCKETS Set to fit Massey Ferguson, ex 50HX TDL wheeled digger (will fit other MF models), six in total all very sound mainly with front teeth, sizes 36 inch, 30 inch, 18 inch, 12 inch, plusTiling drainage bucket ‘V’ shaped with curved mouth and ditch former type ‘V’ shaped model. Priced as one lot but may split Very Good condition £695 % Chris C 01926 338639 C6450 MUCK TRUCK Mini Dumper 1/4 tonne model, Powerdrive to set 4 treaded pneumatic tyres size 4.00-10 & 4.80-8, Honda petrol engine 5.5hp model GCV160 pull start, wheel barrow type handles with controls, 3 forward & 1 reverse gears, mechanical trip metal dump skip size 3’ x 26” x 18” deep, choice of 2 only done 2 seasons work each Very Good condition £995 % Chris C 01926 338639 S6894 2012 MF 996 Power Loader c\w Brackets for MF 6290 4wd tractor plus 3rs service pipework, pallet tines. Alo Euro 3 attachment fitment. (Only tines been used) New condition % Shaun 07850 978188 S6871 1995 AGRILIFT 7m 2600 KGs Lift Telehandler with 4 wheel steering axles, 380/70 -20 tyres. Only 4500 hours. Pallet Tines & Bucket Good condition £8,500 % Shaun 07850 978188 W3403 FORD 550 Digger Buckets Complete with Greys back-plate adapter. Dirt bucket, muck fork, pallet tines and a ditching bucket available. % Chris W 07957 870362 S6548 2011 ALBUTT B810PP Buckrake 3m wide Fitted 18 Kverneland 1400 mm tines bottom & side. 3 Point linkage and Bolt on brackets for JCB Loading Shovel (Suitable up to 160HP) Hardly used Excellent condition £3,700 % Shaun 07850 978188
25
MILL & MIXERS
S6563 BRITON Christy & Norris LB4 Hammer mill, 4” screen inc spares, 2920 Rpm 3 phase 12.5 hp motor. Dismantled for inspection and removal. Average condition % Shaun 07850 978188 C6528 CORMALL HME500/30C straw & grain hammermill, 22kw (30hp) 3 phase electric motor drive to 500mm diameter hammer mill with both grain feed from top & horizontal straw feed from conveyor. Kongskilde set 6” pipes for outlet system with cyclone, chain drive on 2.5m long bale/straw feed conveyor with adjustable sluice gate & sawblade feeder drum (suitable for small square bales only). Hammer mill ready for new blades. Good selection of screens included. Good condition £1,250 % Chris C 01926 338639 C6694 FRASER FB7 Roller Mill on stand with steel feed hopper above (approx 1.5 ton capacity), 3 phase electric motor drive, 7” wide rollers 15” & 9” diameter need regrooving. With Bentall 1/2 ton vertical mixer & short auger from mixer, bottom bearing needs replacing but otherwise sound Average condition £845 % Chris C 01926 338639 C6711 FRASER Mill & Mix unit with large Rowlands galvanised steel hopper above, 1 tonne capacity horizontal chain & slat mixer, twin bag off chutes & additives hopper, auto mixer control can pulse system as mill fills unit. Fraser M9 roller mill above mixer with high capacioty 12” & 10” diameter rollers 8” wide, micro switch in mini feed hopper. 3phase electric motor drives with switch gear. Stands approx 15’ high & hopper fed by straight auger from free standing President trip weigher unit (model P5GDE). All in full working order. Hopper is on legs so easily separated for transport Very Good condition £2,495 % Chris C 01926 338639 S5900 FRAZER M5 Bruser Roller mill on stand c\w 7.5 Hp 3 phase motor. Small reception hopper on top. Very Good condition % Shaun 07850 978188 S6729 SIMON BARRON 125 series Extruding Press to make 6mm diameter pellets of Wood chippings Appx 20mm long. Plus Seperating Cooler to cool after pressing, Miracle Hammer mill with hopper over to prepare And Simon Barron (Paul Clochem) Type 200 -6 Verical dryer if woodchip is Damp. Set up as production line Very Good condition % Shaun 07850 978188 S6852 CARAVAGGI 120 - M - 25 Trailed mobile PTO driven 120 hammer mill with 2.5 ton Mixer & Weighing system.Also includes long high level discharge spout. All in good working order inc. recent set of hamer blades. Good condition £3,500 % Shaun 07850 978188 C6615 BENTALL Mayland 1 tonne Mill & Mixer unit, free standing galvanised horizontal mixer capacity 90 cu/ft with 2hp 3 pase electric motor & gearbox drive to chain & slat system, twin bag off chutes & additives hopper. Roller mill model 1000 fitted above mixer with 5.5hp motor & 5” x 12” grooved rollers. Complete with I tonne steel hopper that can be fitted above mill or free stands at side using auger to discharge to mill mini hopper. System can be automated to fill, mix, pulse & shut off as required. Dry stored disconnected ready to move Good condition £1,100 % Chris C 01926 338639 S6850 MC MASTER Roller mill PTO driven model on stand. Rollers 14” By 6” across. Small square supply hopper on top. Good condition £400 % Shaun 07850 978188 C5982 MARTIN MARKHAM Roller Mill free standing with small top hopper, 15” diameter rollers 5” wide with flat belt drive (from tractor pulley), could easily be converted to electric motor & vee belt system £325 % Chris C 01926 338639
26
MISCELLANEOUS
C6431 HOBART Butchers Meat Mincer machine, free standing unit with stailness top feed tray, model 4056 made in USA, 3 phase electric motor drive. Unused recently but kept dry stored. Good condition £625 % Chris C 01926 338639 S6411 PARMITER Post Knocker Reat Mounted Post Knocker, Side postion. Handy to own Average condition £500 % Shaun 07850 978188 W3521 2003 DESIGN Hydraulic Power Pack See Specials for details. £3650.00. Suitable for running Mini bale wrappers.Call for more details Very Good condition % Chris W 07957 870362
C6561 PALLET Racking APEX type model JK16, steel painted vertical sections 3’ wide & 3m high with cross bracing, profiled to allow different height shelves & facility to fix to floor - quantity 17. With 30 x box section (90mm x 59mm) horizontal bars, orange painted 2.8m long. All dry stored in good condition to be sold as one set to make 16 bays Good condition £1,275 % Chris C 01926 338639 C6765 WEIGHBRIDGE Avery drive over type in ground rated at 50 tonnes, 15m long to take artic trucks, please phone for full details poa % Chris C 01926 338639 C6378 PRO VAC Horse Muck collector vacuum, can also be used on general debris & leaves etc. Trailer mounted brackets with 5m long suction hose with handle & small wheels, delivery chute blows into trailer with sides (trailer not included). Powered by Honda GXV270 8.5hp 4 stroke petrol engine with electric & pull cord start (requires new battery). Approx 5 years old but used one season only on leaves Very Good condition £950 % Chris C 01926 338639 S6261 6 Cylinder Lorry Engine mounted on stand c\w Radiator, Fuel tank & 4 gearbox with PTO drive out. Suitable for driving fan etc. Good condition £700 % Shaun 07850 978188 C6721 SWIFT Challenger 470/2SE Touring Caravan, 2 berth single axle 4.7m long fully fitted with shower & built in cassette WC, double glazed windows, electric & gas appliances including water heater, room heater, hob & oven, fridge etc. recent new 12 volt battery & water pump, all good tyres with new spare, mains elec hook up lead, Calor & Propane regulators, water & waste containers tow hitch cover lock. Quality caravan with lots of storage space suit student or as a holiday tourer, includes awning Good condition £1,150 % Chris C 01926 338639 C6619 PRESSURE WASHER Commercial specification EHRLE model HSC-ST, hot, steam & cold facility with diesel burner, first installed in June 2009 & showing 5230 rec hours (includes 20 minutes stanby each use), output 20 litres/hr using 2 trigger gun lances with long hoses, max pressure 180 bar, TFR (detergent) tank, frost stat heater, 3 phase electric motor drive, all in stainless free standing lockable cabinet (model type HSC1240ST) Good condition £1,995 % Chris C 01926 338639 S6297 HOES Drainage Machine Self propelled, hydrostaically driven unit on 16” tracks with Ford engine. Comes with 7ft 100mm Draining chain. Plus Seperate clean up conveyer 8ft by 19” and filling slitter. Average condition £7,500 % Shaun 07850 978188 C6377 ELECTRIC Motors pair new 3 phase 1.5kw purchased for augers, make Brook Crompton & Leroy Somers running at 1420 & 2850 rpm, single GEC starter included Very Good condition £150 % Chris C 01926 338639 S6690 PERKINS 6.354 Engine c\w hand clutch & drive box with multivee pulley. Mounted in Strong frame c\w radiator and controls. Starts on the key and runs nicely. Frame would take fan, sawbench, generator etc. Built in adjustment to tension pulley drives Good condition £950 % Shaun 07850 978188 C6684 PERKINS Engines pair 6 cylinder diesel non turbo ex commercial vehicles, 6.354 type (one later 6.354.4) non running but believed to be all complete (some components loose). Ideal for use in irrigation pumps etc. or for spares. Price is for pair Average condition £560 % Chris C 01926 338639 S6702 TELEGRAPH Poles Appx 28ft long 10” at base appx 40 Good condition £45 each % Shaun 07850 978188 C6646 DANLINE Brushmate Rotary Brush/Sweeper, 3 point tractor hitch to fit front or rear linkage, pto drive to good 18” diameter nylon & wire brush 6’ wide, swivel head allows left & right angling, built in water tank for use as dust suppression, caster wheels to assist level working Good condition £1,250 % Chris C 01926 338639 C6764 B AND K 4 Bank industrial spec pressure washer system suitable for operating 6 hoses in separate locations simultaneously on demand. Hot & Cold facility with recent new Lochinvar water heater & tank rated at 132kw (450000 Btu). Compressor air tank Class 2 capacity 272 litres at 16.5bar pressure, vertical type painted black with adjacent air drier unit (no compressor). Heavy duty workshop tools including Hitachi hammer drill 950W in steel case, Hitachi variable speed drill in case both 110v, bench grinder twin wheel model as new in box Good condition poa % Chris C 01926 338639 C6436 LINCOLN Mobile Arc Welder, 300 amp SA1 model, Ford 4 cyl industrial diesel engine, road going with ball hitch, jockey wheel, 4 wheel type requires mudguards, also needs lighting board if used on road Average condition £575 % Chris C 01926 338639 C6465 AMBIRAD Mobile Radiant Tube space heater on wheels, 26kw model MH26AS LPG type with single phase electric cable. Thermostatic control with fan unit, gas hose & regulator, size 5’ wide, 5’6” high & 2’6” deep (not barrel type with high velocity fan). Very little used on office flood dry out, suit large store/workshop, warehouse, farm shop etc. Very Good condition £995 % Chris C 01926 338639 S6837 TRANSWAYS Phase Converter Will convert single phase from a 64 amp 1ph supply to up to 15HP 3 phase. Usefull unit appx 0.5m by 0.3m in size. Good condition £450 % Shaun 07850 978188 S5858 BOM Post Hole Borer 3 Pt linkage mounted Heavy duty model with 12” Auger, Good PTO shaft & new cutters Very Good condition POA % Shaun 07850 978188 W3435 Moving Floor Bulk Hopper 10t capacity with rubber belt floor driven by 3 phase motor. Ajustable shute. Suitable to feed veg washer or bulk bagging set-up. poa % Chris W 07957 870362 C6451 BOMAG BW55E vibrating roller, single drum model with 560mm wide steel roller & scrapers, recent new Honda GX120 petrol engine & vibrating kit fitted, water tank & dribble bar, operator handle & controls, yellow & black paintwork Good condition £895 % Chris C 01926 338639 C6620 WORKSHOP Heater Thermobile waste oil type model SEP5K rated at 60kw (205,000 Btu) max output (can also burn diesel/kerosene), cabinet type with steel day tank reservoir, single phase electric with pre-heater unit prior burner & fan, free standing with twin louvered top hot air outlets, includes primary 90 degree stainless flue (200mm diameter). Works from wall thermostat. Good condition £1,600 % Chris C 01926 338639
• See also the wanted section and read the buying/selling details before calling
38 OCTOBER 2013 C6751 BEMA Agrar Rotary sweeper, tractor linkage mounted for front or rear, 2.3m working width complete with detach steel tipping collector box, swivel headstock, hyd motor drive to good 18” nylon & steel brush, pair caster wheels on rear, demount stand. Done little work Very Good condition £1,350 % Chris C 01926 338639 S6238 SUPREME Choice Wood Shavings Prepacked for retail supply in packs 15” by 5.5 by 2.5”. On 5 pallets, 480 packs per pallet. Returned stock with very little damage. Dust Extracted and rated highly absorbant Good condition £150 each % Shaun 07850 978188 S6566 BROOK CROMPTON Electric motors Varous all 3 phase including 1.5 Kw 1435 rpm, 2.2 kw 2840 rpm, 4kw flanged 144 rpm, 0.3 Kw 940 rpm. 3 kw, 1420 rpm, damaged fins, no cover. AEC 1hp 960 rpm. Good condition POA % Shaun 07850 978188 S6601 PARKERFARM Weighbridge 9.00m By 3.5m Steel Brigde (6m deep) on 4 cell pads using Parkerfarm EV 2002 Terminal to weigh up to appx 40 Tons. Can be seen working. Good condition £4,000 % Shaun 07850 978188 S6875 100 Kva Cabinet installed generator with John Deere 140 HP diesel engine. 3 phase. Good condition £6,500 % Shaun 07850 978188 W3465 POSTMASTER 8000 Post Driver Has been used on a skid steer loader and would suit a telescopic loader or tractor. A compact machine that uses a hydraulic drop hammer that gives fast impact (50 per minute)as opposed to brute force! Very Good condition poa % Chris W 07957 870362 S6518 MABE Cardboard Baler 3phase Hydraulic powered press to compress packaging etc. Industrial stationary type Good condition £7,000 % Shaun 07850 978188 C6468 PLYWOOD Sheets 6mm thick size 1525x1525mm interior grade pack of 50 sheets. 5mm thick ‘bendy’ plyboard on pallet of 50 sheets. Hardboard 8’ x 4’ sheets quantity 100. All new shopsoiled dry stored (price is for lot). Also Jonas Woodhead cast iron sawbench with guides & top blade guard on rise & fall table, free standing unit with 3 phase electric motor & belt drive to 17” circular saw blade priced at £450 Very Good condition £1,125 % Chris C 01926 338639 S5445 PORTABLE Compressor Diesel engine driven Ex MOD high output 2 Cylinder compressor, hand start Lister Petter Single Cylinder Engine. Small tubular built under tank. Frame round it all 3ft by 2ft by 28” tall Very Good condition POA % Shaun 07850 978188 C6761 DOLABS Plastic tub skips, quantity 45 all stackable in blue colour, size 110 x 70 x50 cm Good condition poa % Chris C 01926 338639 S4735 BOM Post Hole Borers Hydraulically driven to fit on Forklift tine. 6”, (Opt 9” & 12”) Easy to fit & use prices from New condition £1,200 % Shaun 07850 978188
27
MUCK & SLURRY EQUIPMENT
S6682 SLURRY Stirrer PTO driven type c\w cat 1/2 linkage to mount on tractor. Appx 14 ft long. Soild and straight for age Good condition % Shaun 07850 978188 C6762 FLYGT Chopper Pump model M25 490mm, 13.5kw 3 phase electric motor drive. Also 3kw smaller model with 10” x 2” chopper impellor, stainless end section, will cope with poultry feathers Good condition poa % Chris C 01926 338639 C6766 LINCO Rotary Screen Separator unit located on high galvanised steel gantry for trailer/vehicle access underneath, unit size 3m long & 70cm (28”) diameter 3 phase electric motor drive. Exit chute on end of gantry platform, good quantity of large bore feed piping, currently utilised as feather screen in poultry processing unit bu can have other uses. Installed & in working order Very Good condition £3,375 % Chris C 01926 338639 C6800 SHELBOURNE REYNOLDS Powerspread 730 manure spreader, single axle top fill type with front offside discharge cylinder fitted replacable blades & deflector plate, hydraulic adjustable opening gate, single auger in base of machine feeds to front, wide tyres, road lights, good ring hitch & drawbar shoe, new 540 pto shaft, capacity 8.5 - 9 tonne, ideal slurry & loose material or very rotted fym only, sound body & tyres etc. auger flights have been repaired. Operator & parts book Good condition £1,995 % Chris C 01926 338639 S3202 1994 BRIGGS Agric Eng Ltd Scroll & Slater PTO driven Slurry pump on Galvanised framework with 8” feed & 6” outlet with priming pump & electric shut down control. 80 cubic mtrs/min (18000 gpm) Very Good condition £2,200 % Shaun 07850 978188 C6609 LOBE Slurry & dirty water pump ex road type tanker, ‘T’ section with mounting brackets, hydraulic motor drive, Bauer type & flange fittings, for spares or to reinstall Average condition £175 % Chris C 01926 338639
28
PLOUGHS
S6906 KVERNELAND EG 240 - 85 5 Furrow Auto Reset Variwidth plough c\w full set of discs. Good No 8 Bodies, shares & Man skims. Tidy plough not overused. Good condition £6,750 % Shaun 07850 978188 C6512 PLOUGH PRESS Front linkage mounted with pair hydraulic ram raised wings, 6”x6” box frame with pivot framed 2m wide presses fitted 10 x 700mm cast rings (Kverneland type). Used with 6 furrow reversible plough, some cleaning chains & transport lock bar. Some rings with cracks in web & 1 set hyd hoses required Farm workshop made strong unit. Good condition £995 % Chris C 01926 338639 C6672 KVERNELAND LB85 - 160 reversible 5 furrow plough with hydraulic variwidth, 85cm point to point & 70cm underbeam clearances, Number 8 bodies all new recently with tailpieces, full set skimmers, plough wearing metal all good, rear rubber tyred depth wheel, 160 horsepower headstock with pair genuine plough spanners, demount stand. Only ploughed game cover acreage in last few years Good condition £5,950 % Chris C 01926 338639
C6590 DOWDESWELL DP7E/1 reversible 6 furrow (5+1) plough, 1993 model 14” furrow width & 39” point to point long clearance, 27” underbeam clearance to shearbolt legs fitted UCN bodies & reversible points, full set skimmers, hyd front furrow adjust, shock absorber depth wheel with wide tyre, some welding on frame mainly between 2nd &3rd furrows, good straight plough with mixed wear on metalwork but comes with large quantity new parts retail value £1300 Good condition £3,295 % Chris C 01926 338639 S5202 DOWDESWELL Furrow press Standard Double ring press without arm but in very sound order. Suit 5 x 14” furrows. 30 degree 650mm Rings 200mm apart. Good condition £425 % Shaun 07850 978188 C6339 DOWDESWELL Furrow Press adjustable model currently set to follow 5 x 14” furrow plough, 700mm diameter 30 degree cast press rings 11 at front & 10 at rear (spare average ring to make 22) in 88” wide frame, cleaner chains, 3 point hitch frame for transport, hardwood bearings model which have been replaced with genuine type Average condition £750 % Chris C 01926 338639 C6706 WAGON PLOUGH GOIZIN Orion model 8 furrow (5+3), year 2007 with hydraulic auto reset legs & hyd front furrow, 16” furrow width on pitch adjustable bodies with reversible points, 100cm point to point & 80cm underbeam clearances, full set skimmers, hyd adjustable rear depth control wheel, 385 size super single tyres on central bogie with twin ram lift, modified hydraulic press arm to operate Cousins 3.5m wide cast ring double press, repair at one flange joint, original moulboards thinning at ends but all other metal good. Cousins compatible furrow press with 25 x 700mm dia rings in box section frame, cleaner chains, year 2000 model with end tow transport kit. Price includes press but would split Very Good condition £14,750 % Chris C 01926 338639 C6347 GREGOIRE BESSON SPWB semi mounted 10 furrow (8+1+1) reversible plough - recently converted to operate as a 6 furrow with bolt on sections to make up to 10 furrows, bar coupler headstock, hydraulic front furrow adjuster, bolted variwidth (6 position) furrow width, full set skimmers, rear discs, 16.0/70-20 rear land wheel tyre, all good mouldboards & tidy paintwork, demount stands, stored inside. Full set new points included. Very Good condition £7,450 % Chris C 01926 338639 S6491 1997 DOWDEWELL Furrow Press 2 rows of 30 degree cast rings appx 100” working width. Completely rebuilt last year at a cost exeeding £2000 Very Good condition £1,000 % Shaun 07850 978188 S6311 2000 NAUD 8 Furrow Semi mounted Hydraulic Autoreset plough. Pair of 400/65 - 22.5 depth tyres after 5th furrow. Good long DD type bodies, Manure skims and Claydon furrow cracker. Cat 3 drawshaft. Suit up to 300HP. Manual varaible width. Good condition £9,750 % Shaun 07850 978188 S6569 DOWDESWELL Skimmers To Fit DP7 D2 Hiclearance plough, Set of 4 % Shaun 07850 978188 C6680 RANSOMES 3 Furrow conventional plough, linkage mounted with large steel depth wheel on one side, YL bodies with arrow head shares, disc coulters to 2 furrows (possible third). Unused for some years & lived out so paint poor but all sound, suit classic tractor Average condition £325 % Chris C 01926 338639 S6568 DOWDSEWELL DP 9 7 furrow semi mounted plough, in the furrow with swivel headstock, ycn boards and vari width Good condition £1,500 % Shaun 07850 978188 S6763 DOWDESWELL DP7 E 5 furrow (4 plus 1) 14” Reversible, Good UCN bodies & Manure Skims Average condition % Shaun 07850 978188 S6421 1996 NAUD RX3 - 09 + 1 3 + 1 ( 4) 14” Furrow reversible plough, 38” point to point, 29” underbeam, Original digger bodies still very good, manure skims & depth wheel. Very Good condition £2,900 % Shaun 07850 978188 C6572 DOWDESWELL DP7E Reversible 6 furrow (5+1) mounted plough, 1986 model 12” furrow width with YCN pitch adjustable bodies, reversible points, full set skimmers, hyd front furrow width adjustment, 10.00/80-12 rubber depth wheel on damper type bracket, 34” point to point & 26” underbeam clearances, small welding repair on main beam at 4th to 5th furrow, some mouldboards worn but recent all new wearing metal fitted (points, wings, shares etc.). Some spares include new landsides, possible rear disc set also available. Good condition £2,800 % Chris C 01926 338639 C6643 DOWDESWELL Furrow Press model DTP 16/17M, 3.2m wide with cast ring 700mm diameter press gangs, front 16 ring & rear 17 ring with cleaner chains, 3 point hitch for transport, all complete painted red & includes hydraulic press arm last used with Naud plough (easily adapted) Good condition £1,100 % Chris C 01926 338639
29
POTATO HARVESTERS & PLANTERS
C6810 REEKIE Cleanflow 2000 B unmanned 2 row potato harvester (mid 1990’s model), 1600cm wide with 35 & 50mm continental main webs, split front shares with diablo rollers & discs, steering axle & drawbar plus machine levelling, Dahlman roller rear cleaning module with rise & fall facility plus water applicator kit above, pto drive to own hydraulic pump (recently fitted) for independent operation & all in-cab controls, Reekie reduced drop modification fitted Good condition poa % Chris C 01926 338639 W3471 1996 STANDEN H200 Big Boy Potato Planter Type BB2, 2 row planter can be used for ridges or bed system. Bulk hopper and cup type feeders. Electric controls and ridging bodies. Machine has done very little work, is in very good condition and stored under cover. Very Good condition £2,950 % Chris W 07957 870362 C6782 GRIMME GB Two row trailed harvester, 36” wide continental webs with scrubber, split front shares, steering ram, adjustable axle, high top picking off table under canopy with frame, long cart elevator slews over front of machine for transport. Unused & dry stored for a few years so suitable refurb or parts. Also Grimme Continental 89 two row harvester with front diablos & twin disc system, continental webs & clod fingers, treaded tyres, fold up cart elevator again suitable parts or refurb poa % Chris C 01926 338639
S6136 KEYAG GRUSE VL18 BM 2 row mounted automatic planter. Fitted Rigid Bodies, electric monitor, Cup inserts, Coulter wheels. 10/80 -12 wheels Good condition £950 % Shaun 07850 978188 C6639 ROBOT 2 Row potato planter will plant other bulbous items in ridges, tractor linkage mounted with single 6.00-16 drive wheel. Chain & sprocket driveline (spare sprockets) to twin horizontal rotating heads with cantilever cups fed by 2 operators on rear seats, carrier box for chitting tray type system, rear ridging bodies, adjustable width currently set at 32” centres. Ideal plot work machine or for small acreage etc. can suit smaller tractor Good condition £475 % Chris C 01926 338639 C6455 HASSIA 2 Row linkage mounted potato planter in green & red Pettit colours, front openers with following forming discs, 3 sets rear ridging bodies mounted on square section toolbar, twin tyred drive wheels, large steel hopper with twin cup & belt delivery system per side. All adjustable for planting width, in good order kept dry stored & will go straight to work Average condition £350 % Chris C 01926 338639 S6856 REEKIE Cleanflow 2000M4 2 Row unmanned hravester with Cart elevator replaced with a 1.8m By 0.8m Conveyer to Windrow crop 2 rows across. 40mm first & 2nd webs. Good condition £2,000 % Shaun 07850 978188 S6028 SCOTT GRIMME QRS 2 Row Unmanned harvester, 2 Full diablos, 4 discs, 2 2 piece shares, clod fingers, Ist web elecric agiatation, Rear wheel steering Dahlman rollers unmarked. Electric in cab controls. Very Good condition % Shaun 07850 978188 C6638 RANSOMES FAUN 2 row linkage mounted potato planter model 1400 in Faun orange paintwork, used in 2012 with front openers & rear ridging bodies on square toolbar, adjustable width bulk hopper currently set at 34” centres, chain drive & various sprockets to twin cups on each rubber belt each side, additional cup inserts, 5.60-15 tyres, ridging body small height extensions. All well maintained ready for work Very Good condition £550 % Chris C 01926 338639 C6421 KEYAG Gruse 2 row mounted potato planter model VT20B, large steel hopper with hyd ram operated front plate for sloping/sidling ground, front openers adjustable width (currently set at 34” centres) plus side plates with rear forming bodies, drive wheels with good tyres, rubber belt drive fitted plastic cups, variable rate sprockets. Tidy machine for age Very Good condition £475 % Chris C 01926 338639 S6865 2006 GRIMME
GT 170M 2 Row Unmanned Harvester with Hydraulic lane adjuster, Half diablos with pressure control, 2 piece and centre share. 40mm Main on to 2 rows of stars, 35mm 2nd web onto Multisep sytem . 850mm canvas unloader. Steering axle with 300/85 - 32 & 16/70 -20 tyres. Ver Tidy Grimme maintained machine only done 400 acres Very Good condition £42,500 % Shaun 07850 978188 S6855 2008 GEORGE MOAT TSRC 190 Potato Topper, front or rear mounted. 2 guide wheels & discs. Cross conveyer included but never fitted or used Excellent condition £4,500 % Shaun 07850 978188 C6047 KEYAG GRUSE 2 Row mounted potato planter model VL18, timber hopper extension to add capacity, cup inserts fitted, all good openers with adjustable height side plates, 3 rear forming bodies, good drive tyres, all adjustable but currently set at 72” beds (34” centres), in cab monitor. All put away ready for work Very Good condition Offers % Chris C 01926 338639 S6805 2009 AVR Esprit 2 Row Offset drawbar Wheeled drive harvester, 1700mm main web 50mm pitch. Crossflow Evolution cleaning system and Picking off table with canopy. Exceptional machine, also 2010 model without picking table Excellent condition % Shaun 07850 978188 S6521 AMAC LKU 1700 1.7m Wide front monuted topper unit c\w cross conveyer. PTO driven Good condition % Shaun 07850 978188 S6820 2010 AVR Rafale Front mounted Potato topper c\w RH outlet cross conveyer. Choice of 2 Very Good condition % Shaun 07850 978188
30
POTATO/BULB GRADERS & EQUIP
S6243 SQUIRE 6Ft Grading Line Rigid complete line with end tip hopper, 6ft feed belt up onto 30mm soil extraction web, 7 adjustable coils, Single screen with cross conveyer, soil conveyer under full length. Split flat belt picking table Good condition £8,000 % Shaun 07850 978188 S6876 PEARSON Cabbage Boxes Timber made 8ft by 4ft by 3ft 6” up to 600 available Good condition % Shaun 07850 978188 S6738 1997 TONG 425 Autoweigher Single 10” White food grade belt. Single phase on 13 amp plug with switch. 2 Bag clamps. On Castor wheels Good condition £675 o.n.o. % Shaun 07850 978188 S5853 CUTTING Chitting trays Standard timber 18” by 30” Trays, stacked inside on pallets appx 48 per pallett. Sound for age. Proabably 2 lorry loads. Also 4/5 Board Half ton boxes 50” by 42” by 36” tall average condition, around 100 @ £4.00 each Good condition £0.40 each % Shaun 07850 978188 C6775 CHITTING TRAYS Timber type all sound dry stored, stackable, quantity 100 to be sold as one lot Good condition £60 % Chris C 01926 338639 C6783 TONG Cleaner Hopper 1 tonne plus capacity steel sided filled with loader etc (top fill). adjustable height legs, full length continental cleaning web, single phase electric motor drive with variable speed. Tong Brusher table, variable speed adjustment to 13 black bristle brushes 24” wide (6 ft long), on adjustable height legs, requires rubber top covering mat to brushes, single phase elec motor drive Good condition poa % Chris C 01926 338639
S5246 2000 TONG Flat Belt Conveyer Choice avaiable Inc 300mm 3 - 6m long. 550mm by 2.6m. 650mm by 2.8m, 3.8m, 4.5m & 6.2m. 700mm by 3 & 3.6m. All with 3ph motors, some with legs. Very Good condition % Shaun 07850 978188 S6884 1986 MEDIEMA Disco SB55 All inone Hopper Cleaner c\w 7ft Belt & 6 coils also 7ft wide, Cross conveyers at end to takke ware & soil. 11.5/80 - 15.3 transport wheels Average condition £1,900 % Shaun 07850 978188 C6730 PEARSON
Hercules Potato receiving hopper/cleaner, wide section steel hopper for trailer operation feeds to 4’ wide central rubber belt conveyor, cleaner module fits to hopper with 7 rows all adjustable stars, twin cross conveyors with reversible motor drives, 3 phase electric all in good working order Good condition £1,695 % Chris C 01926 338639 W3436 HERBERT Rubber belt elevators x2. One 4m overall length including adjustable swan neck. 2m max drop, 750mm wide, 3 phase. Other, 2.5m long, 1.5m drop, 650mm wide belt and single phase. Good condition % Chris W 07957 870362 C6469 LOCKWOOD Potato Grader rotary screen type on raised fully adjustable metal legs, hedgehog rubber roller drive roller to 36” wide screen, flat belt dirt conveyor at 90 degrees under screen, 3 phase electric with 7 good screens of various sizes. Good condition £995 % Chris C 01926 338639 S6514 1987 TONG Bulk Cleaning Hopper 6ft Belted, End tip (overall 9ft 4” wide) up and over 6 rows of stars with 3ft wide cross conveyer under or over onto 11ft by 2ft conveyer across back. 3 phase variable speed Good condition £3,000 % Shaun 07850 978188 C6779 WALTHAMBURY W325 Pneumatic potato weigher bagger, all yellow paintwork with lower receiving hopper & 12” main plus 3” trickle belts (new 2 seasons ago), single head with air bag clamp, mobile on wheels with full switchgear & operator stop button, 3 phase electric, stabiliser legs, head clamp position has additional bracket to fit over conveyor, suitable to weigh 12.5 to 50 kg, requires compressor to operate Good condition £1,250 % Chris C 01926 338639 W3411 NICHOLSON SYSTEMS Rubber Coveyors 5m Picking-Off table with a 2.5m trash conveyor. 3ph variable speed & reversible motors. All mounted on a low trailer with full canopy. Good condition % Chris W 07957 870362 S6728 2006 WELVENT 50 by 30 Ft Cold Store, prefabriacted into shed so would remove. Appx 8ft 6” High c\w 2 Outlet in store Cooler and Welvent refrigeration unit inc Digital cotrol panel etc. Store doors and barriers also available. Very Good condition £8,500 % Shaun 07850 978188 S6075 TONG Caretaker 48 48” Inline grader c\w own hopper, 5 rows of cleaning stars with own cross conveyer, Single screen grader with own 3ft wide cross conveyer. Roller table with soil extraction conveyer underneath. 3 Phase variable speed, rewired recently Good condition % Shaun 07850 978188 C6682 HERBERT Roller type picking off table to use in grading line, 3.7m long & 65cm wide with all plastic white rollers, adjustable height legs, green paintwork, 3 phase electric motor drive Good condition £495 % Chris C 01926 338639 S5245 TONG 36” Screen Grader Choice mounted on Frames basically 50” discharge plus extension of 21”. Both Screens driven by single 3 phase motor. Possiblility of 25/30/35, 40& 50mm screens . Also similar machine with individually driven screens. Recently refurbished .Cross conveyers offered seperately to suit clients needs Good condition £1,400 each % Shaun 07850 978188
31
POWER HARROWS
C6573 LELY Power Harow Lelyterra 30033 Series, 3 metre model with good club tines, clod boards, all good side plates, 540 pto drive with through g’box, rear coil on pin & hole depth adjusters with star cleaners, hour clock with 290 recorded hours, coil requires repair to some broken sections Good condition £1,695 % Chris C 01926 338639 S6822 RECO Maschio DM4000 4M Power harrow c\w Packer roller and 80% Blades. Few Leaks and one rotor missing Average condition Offers % Shaun 07850 978188 C6181 DOWDESWELL End Tow kit to fit power harrow, drawbar section with mounting plates, end wheel section fitted 8.50R10 tyres & hydraulic d/a ram for lift/lower of machine, all painted green Good condition £360 % Chris C 01926 338639 S6121 RECO Maschio HM4000 4M power harrow , 1000 PTO, Standard crumbler, 50% Blades. Dry machine Good condition £750 % Shaun 07850 978188 S6590 FLEXICOIL 4m To Fit power harrow probably Dowdeswell Average condition Offers % Shaun 07850 978188
32
SILOS & STORAGE
S6815 SIMPLEX Drying Bins 12 Inside open top perforated 9ft 6” Diameter drying silos. Each with Central Drying tubes and connections. Buyer to dimantle and remove Very Good condition Offers % Shaun 07850 978188 C6591 BOYTHORPE Harvestore wet grain silo, 1982 model 4 rings high (55” high each ring, 7 rings circumference (each ring 106” long, single bolted). Can be professionaly dismantled if required Good condition £895 % Chris C 01926 338639 S6882 CRITTALL Hopper Bins 8ft by 5ft grain bins 5 sheets ( Appx 12 ft ) High over steel hopper bottom on legs. Still in Situ fort inspection (3 Available) Very Good condition % Shaun 07850 978188
33
SPRAYERS
C6712 SANDS SAM2000 self propelled 4wd/4 wheel steer sprayer fitted 24/18/12 metre hydraulic folding steel booms, 1995 model with service history & 12 months MOT, Deutz air cooled 5 cylinder 115hp engine 7215 rec hours, full hydrostatic transmission, aircon cab, air over hydraulic system boom controls, 2000 litre tank with rear induction hopper, twin plastic spray lines with single Billericay nozzles, flow meter, 6 cylinder pump, piped to front for self fill, set 48x25.00-20 Goodyear Terra tyres plus set 320/85R28 Continental tyres on narrow wheels - all 8 tyres very good. Some professioinal repairs on boom box ends. Very tidy sprayer with later cab - roof mounted work lights Very Good condition £10,950 % Chris C 01926 338639 C3228 MALGAR 1100 Gallon (5000 litres) water bowser, mild steel painted blue, single axle with hyd brakes fitted 386/65-22.5 super single tyres, top fill access hatch & bottom rear 2” outlet, Honda 4hp petrol engine driving centrifugal pump for fast sprayer fill. Rear ATV quad bike carry rack with loading ramps, side box rack & lockable steel cabinet, new 1997 farm use only in very clean order Very Good condition £2,550 % Chris C 01926 338639 S6897 HARDI TY 2400 Trailed sprayer fitted with Gambetti and Barr 24m hydraulic folding booms, Electric controls amd induction bowl. Very Good condition % Shaun 07850 978188 S6026 LELY 400 Litre Front mounted tank, c\w hyd driven pump, electrically switched. Brackets to fit MF front weight frame. Good condition % Shaun 07850 978188 C6635 BERTHOUD Mack 1200 mounted 21 metre sprayer, modern 2005 model with 1200 litre main tank & 10% clean water wash tank, all good pto drive to Berthoud pump, Autoregleur in cab controls for 4 section boom, induction hopper, wash down hose reel, full hydraulic box section construction folding boom in good straight order fitted stainless single lines & triple nozzles - can be easily made 20m by unbolting short end sections, boom tilt facility on suspension system. Owned from new on small farm (150 acres arable) & will have full MOT Very Good condition £7,495 % Chris C 01926 338639 S6118 1990 WILLMOT Litespray Selp propelled LGP Sprayer. Pommier 24m hydraulic folding booms. 1500 litre tank. Hydraulic raise & Tilt. Single Stainless lines, quad jets. Induction bowl. 38 x 20 x 16 IHNS terra tyres. Ford 2.5D York engine. 4771 hours. Good condition £2,800 % Shaun 07850 978188 S6310 LANCASTER MB1000 Forward control sprayer. Fitted Stainless steel 2500 litre tank, 24m booms, Dickey john, Renson Pump, set up for Ammonium sulphide. Only 6680 hours. Good 750/65 R26 Michelin tyres. Average condition £4,000 % Shaun 07850 978188 S6808 1997 GEM
Saphire 1225 24m 2500 Litre Self propelled Sprayer. 6 cylinder 93 kw Deutz engine. New Generation Control Box. Washout tank and induction bowl. Single stainless lines and jets. New Pump 2 years ago. Dry wheel motors. Conti 320/70 R32s 70% Very Good condition £18,500 % Shaun 07850 978188 S6504 HARDI Everaad AMM 2000 Litre self propelled sprayer, fitted with Knight 24m steel booms, 120 HP Deutz engine. Recent clutch and gearbox overhaul. Harditronic control system. 9.5 - 28 fronts with 13.6 - 38 rears. Good condition £6,750 % Shaun 07850 978188 C6776 CLEANACRES Atlas self propelled sprayer, 4wd/4ws 1995/6 model with Perkins 170hp engine & full hydrostatic transmission, terra tyres size 48x25.00-20 with 35-40% good tread 8 stud fitting plus set 4 rowcrop wheels & tyres, 2500 litre tank. Contractor specification 24m boom (joystick control) will also spray at 12, 18 & 20 metres, single nozzles on stainless lines, boom tilt ram, hyd driven 6 cylinder sprayer pump. RDS Landquip RS 8000 in cab spray controller with flow meter. Hydraulic axle suspension with oil tank at front of aircon cab. In full working order can have 12 months test if required Good condition £8,950 % Chris C 01926 338639 W3346 STOCKS Trailed Quad Bike Granular Applicator 12 x1meter Stocks Micro Meter applicators mounted on 12m folding boom on ATV trailed chassis. Applicator driven by Briggs and Stratton petrol engine. This unit has had very little use. Excellent condition poa % Chris W 07957 870362 W3506 HARDI 4.5m Shielded Boom Folding shielded spray boom off amenity sprayer. Looks “as new”, complete with back frame, electric lift and fold, 3 section electric shut-off controls, triple nozzles, bout marker and nozzle shields. Excellent condition % Chris W 07957 870362 S6895 1996 KNIGHT Crusader Based on multidrive unit with JD engine and Knight Intelligent 4ws. Nice clean cab with Air con. RDS Delta control system. 24M Knight sprayer with 2500 litre GRP tank, single stainless lines.Tested 28/6/14. Goodyear 48-25-20 terras and 270/95 - 44 rocrops with new Trelleborg TM 100 tyres Very Good condition £12,500 % Shaun 07850 978188 C6651 GAMBETTI BARR 18 Metre linkage mounted sprayer, 1000litre main tank with 100 litre clean water tank on side, full hydraulic folding boom with tilt ram & 5 section in cab controls, single stainless lines fitted triple nozzles & filters to each section, adjustable rubber bellows boom suspension, chemical induction hopper, good pto drive to pump, requires 3 spool valves to operate, new on farm in 1999, currently antifreeze stored. Booms all straight but showing rust sections where powder coting paint missing.Used with 700 litre Lely front tank and hyd drive transfer pump, tank frame fits to tractor weight frame. Can be sold less front tank at £2995 Good condition £3,295 % Chris C 01926 338639
C6551 HARDI LHY 800 mounted 18m sprayer, 800 litre tank with 6 cylinder pto driven pump, manual controls on machine with 4 section boom control, hydraulic folding gull wing type boom fitted plastic lines & triple nozzle holders (one spray nozzle only fitted) Average condition £995 % Chris C 01926 338639 C6722 SET 4 Wheels & Tyres ex self propelled sprayer, last used on GEM but fit other models with 8 stud 275mm pcd fitting, tyre size 600/65R28 tubeless - pair Goodyear with 20% tread & pair Michelin XM with approx 10% all sound, white painted rims with 300mm outer & 200mm inner offsets Good condition £1,195 % Chris C 01926 338639 S6879 2010 BERTHOUD Tenor 45/46 Trailed 24m Sprayer with DP tronic control system, (4 x 6 Mtr Shut Off) Quad Spray Nozzles, Side Mixer Tank & Fresh Water Storage,300 / 95 R 46 Row Crops( 60%) on Auto Steering axle with Hydraulic Brakes. Rear Mounted Stocks Slug Pellet Applicator (24 Mtr) Full Road & Work Lighting Equipment Very Good condition £27,500 % Shaun 07850 978188 S6758 LANCASTER 3000 Litre Self Propelled 24m sprayer, recent RDS Delta 341 Control box, Air Con Cab, hydro drive. Low houred John Deere 200 plus HP engine. Good Hyd folding booms, Induction bowl and washout tank. As New 18.4 - 38 tyres plus rocrops 270/95 R 48 rocrops Good condition £9,900 % Shaun 07850 978188 S6644 TEAM 600 Litre Mounted 12m Sprayer c\w Man folding booms, manual and recent electric controls. Triplet nozzles Very Good condition £1,400 % Shaun 07850 978188 C6581 EVRARD 1000 Litre mounted sprayer, 12 metre manual fold boom with 3 section in-cab electric controls fitted single nozzles, winch back frame for boom height control, Evrard pto driven pump, self fill facility, stored inside and antifreeze treated Good condition £950 % Chris C 01926 338639 S6328 24m Demount unit Suit MB trac or similar. Hyd folding & raise / lower. 2000 litre GRP tank. Single stainless lines.In cab controls. Very Straight Good condition Offers % Shaun 07850 978188 C6540 CHAVIOT Self Propelled sprayer, 1984 2wd model with VW diesel engine & 5 speed gearbox, 6441 rec hours, Evrard 800 litre plastic tank, Allman manual folding 12m boom with single nozzles on plastic lines, winch wire boom height adjust, manual boom controls from cab rear, 3 cylinder pto drive pump, self fill facility, induction hopper with can wash, bout marker. 14.5R20 drive tyres & 31x15.5015 wide front tyres. Set row crop wheels with good front 7.50-16 tyres. Good grassland machine Average condition £1,375 % Chris C 01926 338639 C6592 STAINLESS Steel 3000 litre Chafer sprayer tank, currently with steel 20 metre hydraulic folding boom with triple nozzles & part of pivot steer self propelled unit on Ford tractor. Tractor not for sale but tank easily made into bowser which will have tractor 8 stud wheels fitted, or unit can be made into trailed sprayer with tracking steering rams (includes Teejet controller, induction hopper, rear mounted pelleter unit). Requires drawbar extending with ring hitch & boom removing for bowser use. Please phione for photos & details Good condition £2,250 % Chris C 01926 338639 S6818 HARDI LX 800 12m Manual folding Mounted sprayer c\w 3 section Electric in cab controls, and hydraulic up and down. Bertolini 3 Cyl pump done 2 seasons.Triplet nozzles, Line and self cleaning filters.Induction bowl and clean water tank. Good condition £975 % Shaun 07850 978188
34
SUBSOILERS
C6111 PACKER Roller heavy duty type 3 metres wide ex Tim Howard subsoiler, 550mm diameter (400mm tube dia), all good spiralling points, 2” shaft, will require scrapers & bracket. Can fit other machines. Done little work Very Good condition £600 % Chris C 01926 338639 C6733 JOHN DEERE 3 Leg mounted subsoiler model 23B, pair legs fitted on 8’6” wide box frame (7” x 4.5”) with rubber tyres on rear depth wheels (can be fitted to front of frame) size 7.60-15, plain feet on 3’ long legs (no wings fitted). Third leg with mole foot will require repair Average condition £450 % Chris C 01926 338639 C6600 BOMFORD Twin Leg subsoiler, linkage mounted 8’ wide Superflow frame with pair legs fitted front shins & points, ideal for going down tramlines & compacted headlands Average condition £365 % Chris C 01926 338639 S6764 FLATLIFT 5 leg Subsoiler 2 Bar frame with 5 swivel legs, 2 large steel wheels and flat bar type 4m packer at back. Act Frame 3.8m. Solid Tool Good condition % Shaun 07850 978188 C6797 FLATLIFT
90/150 Swivel leg subsoiler, 2.6m wide fitted 5 legs on 3 leg frame, rear 500mm diameter steel packer roller with twin hydraulic depth adjust rams & all good scrapers. Leg brackets include front disc fitment (no discs), 90cm legs with winged feet, 2 part tapered front shins, pair heavy duty eradicator type tines on front of packer frame (assist full cultivation coverage in shallow work), all good legs (2 fairly new) and bright paintwork, all clean & oiled up Very Good condition £3,395 % Chris C 01926 338639 S6642 FARM FORCE F8640 Ultralift 5 Leg 3.5m subsoiler fitted with 6 cultivation legs to loosen soil before subsoiling. Then Guttler simple cast ring press behind. Subsoil legs 27” by 8” by 1”. Very Good condition £6,500 % Shaun 07850 978188 C5965 HAYLOCK 5 Leg mounted subsoiler, heavy duty linkage mounted 4m wide frame non folding, winged feet & front shins to legs with 2’3” clearance, all mounted in box section frame size 4” x 7”, rear flat bar crumbler roller 3.7m wide on pin & hole depth adjustment, 2 legs good & 3 getting thin at rear, needs big tractor to operate Average condition poa % Chris C 01926 338639 C6513 ARAMULCH linkage mounted subsoiler with rape drill, 2003 model made by Razol with 8 legs in a single row on 4m box frame, 800mm long legs with winged feet & front shins, rear 4.2m wide heavy duty round bar crumbler 560mm (22”) diameter on pin & hole adjusters. Techneat Autocast seeder unit on frame above with plastic hopper & seed tubes to each leg, split hopper model with 12 volt electronic speed regulation (no starwheel), additional fluted seed rollers. Good quantity spare parts included & machine has some new wings etc fitted. Good condition £3,995 % Chris C 01926 338639 S6671 SPALDING 150 + Flatlift 5 swivel leg model will work 24 - 30”, 150mm frame, 2 steel depth wheels Fitted wings on legs Good condition % Shaun 07850 978188 S6877 SIMBA Flowking 3m subsoiler with 5 legs, Fitted packer with good scrapers. Average paintwork Good condition £3,500 % Shaun 07850 978188 C6474 COUSINS Subsoiler 2 leg heavy duty model with 8”x4” box frame 3.5m wide, rear large diameter flat bar steel crumbler barrel 3.25m wide on screw depth adjusters, steel 8” wide 24” dia depth wheels fit to front of frame. Adjustable legs with good feet (no wings) & front shins, one very good the other part worn Good condition £1,395 % Chris C 01926 338639
35
TANKS
S6826 1987 ACRITE PIPEWORK LPG Tank 1 ton (1700 litre) Skid mounted LPG tank C\w George Meller single phase pump and baynet nozzle and pipe with shelter. Good condition £900 % Shaun 07850 978188 C6702 ROAD TANKERS Artic type with capacities of 25,000 to 30,000 litres, steel tanks on tri-axle chassis with air brakes & either air/spring or just spring suspension fitted super single tyres on steel 10 stud wheels. Single compartment tanks with twin filling hatches & rear outlets (not pressure or vacuum type), pipe racks & carriers. Choice of 5 tankers with varying quality of paintwork etc. all decommissioned without MOT. Tank sizes approx 10.6m long & 2m dia & 33’6” long 6’ diameter. Please phone for full details & photos. Prices from £3000 each Good condition £3,000 % Chris C 01926 338639 C6673 BUNDED Fuel Tanks pair lockable steel cabinets both free standing with lifting eyes fitted internal plastic diesel tanks. Western Trailers model in green paintwork capacity approx 500 gallons with no pump but internal platform for electric pump mounting, external size 8’6” x 4’9” x 4’6” high. Fuel Safe 500 model (500 gallon capacity) in yellow paintwork with hand pump, hose & nozzle, external size 8’ x 4’6” x 5’6” wide. Price each Good condition £850 % Chris C 01926 338639 C5954 FUEL BOWSER 800 Gallon tractor drawn with 2hp petrol engine drive to delivery pump, Golden Rod filtration & long hose with trigger nozzle. Steel non bunded ex gas tank on trailer chassis fitted single axle with13.00/65-18 tyres, mudguards, hydraulic brakes, road lights, top access hatch with ladder, front steel cabinet, lockable outlet tap Good condition £985 % Chris C 01926 338639 S6745 THOMPSON 27600 litres Mild Steel tanden Steel sprung axle road tanker c\w 5th wheel coupling and jack stands. Origianally 5 - 5000 litres compartments plus 1 - 2600 litre, now cut through into one. Solid but needs lids and tidy up. Average condition £1,500 % Shaun 07850 978188 S6067 CHAFER 2000 Litre Stailess Steel Bowser c\w Nearly new Petrol engine driven pump & pressure washer. Single axle Field floatation tyres. Good condition % Shaun 07850 978188 S6903 CHAFER 2000 Litre Trailed bowser with Honda water pump, 2 usefull storage boxes, one on the side and on at the back. 7.50 - 20 tyres. Good condition £750 % Shaun 07850 978188 C6760 STAINLESS Steel round tank on free standing legs, approx capacity 3000 gallons size 11’ long & 8’ diameter, top fill hatch, bottom discharge with gate valve, lower access door. Ex brewery spec so good thick tank Good condition £2,750 % Chris C 01926 338639 S6795 CHAFER 2000 Litre Trailed single axle spray bowser. 7.50 - 16 tyres, road lights, PTO driven Comma filler pump, Usefull Chemical store box on the back. Good condition % Shaun 07850 978188 C6784 FUEL TANK Steel square type 1000 gallon capacity size 8’ x 5’ x 4’ with outlet hose & gun attached to lockable gate valve. Single skin non bunded used for one fill of white diesel only, some light surface rust on top panel requires paint recoating. Complete with strong steel stand 5’ high. Ideal second tank or for grain drier etc. Very Good condition £455 % Chris C 01926 338639 S6172 SCHNEIDER INDUSTRIES 1400 Litre LPG Tank, mounted on frame c\w single phase Smiths Electric pump with bayonet gun & pipe. Proper Rig Good condition £1,250 % Shaun 07850 978188 S6727 Bunded Steel Fuel Bunker tank c\w own diesel pump. Actual stoarge tank 8 by 4 by 5 feet. Good condition % Shaun 07850 978188 S6907 WESTERN TRAILERS Bunded Bowser 1100 litre (250 gallon) Plastic tank installed inside Steel outer. C\w 12v pump & delivery hose. 185 R14 tyres Good condition £975 % Shaun 07850 978188 C6308 DIESEL Bowser trailed unit with 400 litre plastic tank, recent high capacity electric pump to filter & hose fitted filling nozzle with auto cutout. Front carrier box for cans etc. Long drawbar with ball hitch, wide single axle fitted 145R10 tyres, lighting board. Pump has long cable & crocodile clips for use with 12v battery. Suit towing with Quad bike or pickup etc. Tank is not bunded. Good condition £425 % Chris C 01926 338639
36
TRACTORS & EQUIPMENT
S6791 JOHN DEERE Model A 3 wheeler electric Start petrol TVO model. Restored nicely a while back. 11.2 - 42 drive tyres. Complete with drawbar, PTO and Mudguards Very Good condition £2,950 % Shaun 07850 978188 S6739 DAVID BROWN 880 2 wd tractor fitted trip loader . Good 7.50 -16 tyres and 40% 12.4 - 32 rears. Runs well. Average condition % Shaun 07850 978188
OCTOBER 2013 39
• See also the wanted section and read the buying/selling details before calling S6608 JOHN DEERE Weight Block cast type Fitted with A frame linkage to pick up on front linkage and add ewights as required Good condition % Shaun 07850 978188 C6700 JCB FASTRAC 2135 4WS Autoshift Turbo model with Perkins engine, first registered in 1999 with 8780 rec hours, 50kph transmission, 480/70R30 tyres front Continental 45-50% good tread, rear Stomil 85-90% good, front & rear fenders, 4 rear spool valves & front hyd service, pick-up hitch with Quadtronic 3 point linkage, 2 speed pto, aircon cab with air seat, recently only used for field work. Some paintwork a bit dull but useful high speed tractor Good condition £12,750 % Chris C 01926 338639 S6757 1990 JOHN DEERE 3650 4wd tractor c\w SG2 cab, Hi Lift model with 2 assister rams & Pick up hitch. 460/85 R38 rears 80% 420/85 R24 fronts 60% Very good tinwork. Good condition £9,750 % Shaun 07850 978188 S6793 1991 FORD 4000 Industrial 2 wd tractor c\w Heavy duty front axle, new seat, Sound mudguards, no cab 5700 hours. 50 % 480/70 R28 Rears. 50% 10.75 - 15.3 rears. Drawbar only (optional extra back end). Good condition £1,700 % Shaun 07850 978188 S6669 2008 NEW HOLLAND T 6080 4wd Tractor c\w Range Command 40K eco gearbox, Terraglide front axle, Front linkage and fenders. Only 4400 hours. 520/70 R38 Rears 50% , 420/70 R28 fronts. Very Good condition £37,500 % Shaun 07850 978188 C6692 TEAGLE Quick Hitch ‘A’ frame, tractor linkage mounted ‘male’ part with Cat 1 & 2 fittings, top catch with rope operated release lever, painted yellow had little use. Can be used on numerous implements such as yard scrapers, bale shredders etc. Very Good condition £220 % Chris C 01926 338639 S6746 FORDSON Dexta 2wd tractor, 3 cylinder engine starts and runs well. Roll bar and draw bar (no lower Linkage fitted). 6-16 Landrover fronts 50%, 12.4 ,11-36 rears 5%. PTO. & cover. Good condition % Shaun 07850 978188 S5986 FORD Jerry can Front end weights, Set of 8 for Ford thousand series tractors. Also 10 MF 100 style weights. Average condition £300 each set % Shaun 07850 978188 S6092 2006 NEW HOLLAND TC 27 4wd Diesel Compact tractor on Good Turf Tyres ,Appx 2000 hours. Comes with full road lighting, (powerfull headlamps). Front weights, wafer or Jerry can, 2 Spools & Folding Rollbar. Very capable worker for its size, suit scraping, mowing or just for the kids. Very Good condition £5,750 % Shaun 07850 978188 C6744 MASSEY FERGUSON 698 tractor & MF 85 power loader, 2wd 88hp tractor 1983 model with 12 speed 3 lever gearbox, hours showing 5676 but not working (approx 7000), rear 16.9R38 Dunlop tyres 75 &60% good tread 11.5/80-15.3 wide front tyres, 2 spool valves, telescopic type pick-up hitch with drawbar, hook type lower links with twin assist rams, cab sound but some rust areas at rear & on doors. Loader has front 3rd hyd service, double acting lift rams, demount stand & manure fork with tines for bale handling only Average condition £4,375 % Chris C 01926 338639 S6858 MF Weight Set 10 Front end weights suit MF 2000 series tractor with lower retention bolt. Good condition £350 % Shaun 07850 978188 C6804 JCB Fastrac 2150 Turbo 4wd high speed tractor, 2001 model with Smoothshift gearbox, 148 horsepower Perkins 1000 series engine 6456 recorded hours, 50kph road speed, 2 wheel steer, 520/70R30 tyres on 10 stud wheels all approx 5% to 20% good tread, 2 seat aircon cab (needs attention), load carrying rear chassis, ABS & air brakes,recent new battery, working machine in straight order Good condition £18,395 % Chris C 01926 338639 W3523 1983 ZETOR 8145 80hp 4wd complete with Grays Lynkon 430 quick-fit loader. As new Alliance 480/70R38 rears and Continental 360/70R24 fronts. Pick-up hitch, 2 spool valves. Duncan Cab, glass intact, all electricals working, cab interior good and new seat cushions. Front weights, pallet tine and dirt bucket available. In very good original condition. 1790 recorded hours (not total!). Only 3 owners since 1987 when registered. Previously Zetor’s own tractor. Serial no. 1000003. poa % Chris W 07957 870362 S5770 1994 CASE INTERNATIONAL 5140 Maxxum 4 wd Tractor, Pick up hitch, 2 spools, recent dealer back end ovderhaul inc handbrake. 8200 hours. 460/85 R38 20% 16.9 - 24 fronts. Tidy Good condition £9,500 % Shaun 07850 978188 S6677 1995 JCB Fastrac 1115 Tractor with 50K Selectronic Gearbox, 4 spools, Pick up hitch, 540/65 R28 Fronts 40 Rear 70%. Bosch lift control. Tidy Good condition % Shaun 07850 978188 C6731 FORDSON Model N Standard tractor, 1942 petrol paraffin (TVO) type in Hunting Green livery with Orange wheels, low speed transmission, narrow rear wings, twin original toolboxes, front radiator blind. refurbished some years ago & wheels recently shot blasted & repainted. 11.25-24 good tyres with spare rear. Complete with Ransomes Motrac 2 furrow trailed plough to match. Full working unit. Shortage of storage space reason for reluctant sale. Please phone for full details. Very Good condition £3,000 % Chris C 01926 338639 C6723 FENDT Favorit 612LSA Turbomatik 4wd Tractor, ‘F’ reg with 17407 rec hours on 140hp (at PTO) MWM engine, all very good tyres with 85%+ good tread size 580/70R38 & 420/70R28, 2 speed pto, pick-up hitch, 2 spool valves with flow & return system, all mechanical 20 speed gearbox with creep, front fenders, front wafer weights, aircon fitted nort working, piped for front linkage. He-Va heavy duty front linkage system with tractor currently not fitted, recent radiator & 4wd air type engage valve. Very straight tractor for age & all in good working order, suit big diet feeder or pto work Good condition poa % Chris C 01926 338639 S6714 INTERNATIONAL 275 Hi Clear 2 wd tractor, 12 - 38 rears 60%. Restored in recent years back and used for light grassland work. Genuine sound tractor with excellent engine and lighting kit. Very Good condition £3,500 % Shaun 07850 978188 C6094 DAVID BROWN Case set front weights with frame, quantity 10 last used on DB996 tractor, orange painted ‘jerry can’ slide on type with fixing bolts Good condition £245 % Chris C 01926 338639
37
TRAILERS
S6868 CHALLENGER Plant trailer Tanden Axle Galvanised with Fixed 12” sides & Mesh type ramp rear door. 175 13 tyres on the sides Good condition £1,500 % Shaun 07850 978188 W3492 Tilt Bed Low Loader Heavy Duty low loader suitable for carrying crawler or excavator. Commercial tandem axles, brakes and lights. Hydraulic tilt bed, steel floor, 18’ bed. Very Good condition £2,950 % Chris W 07957 870362 S6767 LEYLAND Alloy Bodied Converted lorry trailer. 19ft by 8ft by 3ft alloy body. Sprung tandem axles with 385/65 R22.5 tyres. Average condition % Shaun 07850 978188 S6905 11 Ton Monocoque Trailer , Tandem Commercial sprung axles, Brakes & lights. 385/65 - 22.5 Tyres. Front ladder, window and grain chute in standard back door. Body 19ft by 4ft by 8ft . Good condition £3,250 % Shaun 07850 978188 C6780 ETC Trojan Monocoque 6.5 tonne tipping trailer, single axle fitted good 12.5/80-15 tyres, manual rer door with grain chute, body size 12’ x 7’ x 3’3” rated at 7850 kg gross. All good paintwork & straight sided. Requires one new wheel stud. Availablw with set silage sides at extra cost Good condition £1,495 % Chris C 01926 338639 S6840 COMMERCIAL 32 Ft Flat Articulated trailer, tandem axle on Super Singles or twins, reboarded floor, Brakes and lights Good condition £2,250 % Shaun 07850 978188 S6847 1996 RICHARD WESTERN 12 ton Tandem Axle Monocoque trailer, Sprung 8 stud axles with very good 386/65 R22.5 tyres. Standard back door with grain chute. Blue paintwork and front ladder. Very Straight Very Good condition £7,000 % Shaun 07850 978188 W3397 2000 LEGG Fuel Bowser 2000l/500gal steel fuel bowser with ring hitch, lights, hand pump and 11.5/80-15.3 tyres. Very little use. Very Good condition £650 % Chris W 07957 870362 C6701 LIVESTOCK Transporter trailer, 6m long body on strong RSJ chassis with single axle fitted 400/60-15.5 tyres, ring hitch for tractor use & screw jack, road lights (no brakes), alloy panels on steel structure 7’9” high & 8’ wide, full size rear opening ramp spring assisted with timber loading gates, simple corrugated sheet roof, chequer plate floor above timber chassis base, no decks. Good condition £1,750 % Chris C 01926 338639 S5982 2000 KING Skeleton Trailer 28FT long, tandem axle, Air suspension, Air brakes, twin 215/75 R17.5 tyres. 16 Ton Gross carry appx 13 ton. Make very good bale trailer or low loader Very Good condition £1,400 % Shaun 07850 978188 C6773 BIG K Monocoque 12 tonne twin axle tipping trailer size 18’ long x 8’ wide x 4’ high sides, leaf spring suspension, super single 385 size tyres on 8 stud fitting, hydraulic brakes, manual tailgate with grain chute, ring hitch & drawbar shoe, front ladder, road lights, very strong & straight trailer painted green of a generous size. Ideal grain & muck trailer Good condition £3,995 % Chris C 01926 338639 C6789 SPECIALIST Box type trailers Engineer made with rear loading ramps & unused. Single axle model 2.5m long, 1.6m wide & 2m high, ball hitch & brakes, 175-13 tyres + spare, painted cream & gold, stabiliser legs, jockey wheel, mudguards, Avonride suspension, twin side doors open up as loading ramps. Suit ATV transport or Mobility equipment in fully enclosed environment. Similar twin axle model without side ramps, streamlined curved frontage, front locker box over drawbar fitted Robin EY20 petrol engined single phase electric generator built on Snipe chassis, twin spare wheels.- this model priced at £1350. Both all very strongly built, please call for more info & photos Very Good condition £995 % Chris C 01926 338639 W3342 2000 BLUE LINE GP 3500T 3500kg gross 14’ x 7’ tandem axle flatbed with 2 sets of ramps. Galvanised chassis, 26” loading height, hardwood floor, headboard, Avonride axles, 185/70R13 tyres, jockey wheel. Excellent condition £1,550 % Chris W 07957 870362 C6743 BATESON Cattle Trailer model 48L, 12 ft long with good rear ramp & timber loading gates, white roof type new in 1990 but had little use, all good hitch & plastic mudguards, Avonride rubber suspension on twin axles (rides quieter than an Ifor Williams) fitted all good tyres with spare (3 tyres new) size 6.00-16, hardwood floor under steel chequer plate top, 5’6” wide & 5’10” high internal. Unused recently so may need a service but very straigh trailer Very Good condition £1,250 % Chris C 01926 338639 S5942 WESTFIELD 20 Ton 30 Cubic Meter capacity hi-speed tipping trailer, Built On Refurbished Skelly trailer on Tandem Sprung axles, Refurbed Hyd brakes, 385/65R 22.5 Tyres on 10 stud rims.Monocoque tipping body, reinforced 10mm floor and tapered sides, 4mm to the top, built and painted in epoxy , underfloor multi stage ram cylinder, Tips to 52°. Slide tilt Hydraulic full tailgate door. Sprung drawbar on phosphor bronze bushed pin. New lights wiring and hoses, Road lighting. Excellent condition £15,600 % Shaun 07850 978188 S6749 SHOOT Bus Converted Single axle lorry body converted into shoot bus / trailer by Fittting side centre door seats for 20 plus tables and overhead racking. Roller and drop down door at the back .Lights No brakes.( Pull with tractor) Good condition £2,250 % Shaun 07850 978188 S6527 JONES 25ft Bale / plant Trailer 8ft wide tandem tilting trailer for plant or bales up to 10 ton . 11.5 / 80 - 15.3 tyres. Very clever multiprurpose trailer Very Good condition £5,000 % Shaun 07850 978188 S6766 G AND S KIRKE 10 Ton Monocoque bodied trailer . Sprung York tandem axles with 425 / 65 R22.5 Super singles. Body 15/16ft long with 4ft sides. Solid trailer Good condition £4,500 % Shaun 07850 978188 S6027 ARMSTRONG AND HOLMES Flat 21 Ft Trailer, tandem axles 6stud walking beam with 10.5 - 18 michelin Pilote tyres. Fitted lift off Potato Bulker bodie with narrow bottom belt unloader, 3 phase motor driven. Ply over steel frame with boards, Or Just the Flat trailer Good condition £3,500 % Shaun 07850 978188
C6774 BIG K 4 Wheel Drawbar turntable type 11 tonne tipping trailer, bolted dropsides & manual tailgate, size 18’ long, 7’ wide with 3’6” high sides, front axle fitted15.0/70-18 tyres, rear axle 385 size super singles both 6 stud fitting, hydraulic brakes, road lights, painted blue, tapered potato back section if required, sides have some rust areas so may need refurb but currently grain tight. Useful trailer to use as bulk or flatbed - rear extension could easily be fitted for bale transport. Similar 12 tonne version 22’ long with slightly lower sides (part side has 2’ removable section) again can be used as bulk or flatbed - this model priced at £3000 Good condition £3,395 % Chris C 01926 338639 S6154 Box Type Trailer Single Axle Lorry convertion interanlly 2.4m By 5m by 1.9m High. Roller door on back, sliding doors along sides. Hydraulic brakes on single sprung axle with 10 - 20 twins. Handy for seed, shoot or storage. Very Good condition £1,700 % Shaun 07850 978188 C6683 IFOR WILLIAMS P7e trailer suitable for carrying a Quad bike etc., single axle fitted 20.5x8.0-10 wide tyres with mudguards, avonride type rubber suspension, all galvanised steel construction with 7’2” long by 4’ wide body & 12” high fixed sides, long chequer plate loading ramp/rear door, phenolic coated timber floor, roping hooks, ball hitch, road lights, spare wheel, 750kg gross capacity does not require overun brakes Very Good condition £595 % Chris C 01926 338639
38
WHEELS/ TYRES DUAL/ROWCROP
S5866 11.2 - R48 Rocrops with 70% Bibagrip tyres, 8 stud centres Ex Case Maxxum, plus 9.5 - 32 fronts 8 Stud adjustable centres. Both 220 hole 275 pcd Good condition £1,600 % Shaun 07850 978188 S6016 GOODYEAR 66 - 43 - 25 INHS Terra Tyres70% Tread, 2 of OnSteel rims with bolt in centres to fit 8 stud 8” PCD, 6 inch hole suit Ford etc Good condition £1,600 % Shaun 07850 978188 S6647 BETTINSON 12 - 38 Duals fitted 13.6 - 38 Tyres, 2 sets one with 60% Goodyears, the other with imports. Good condition % Shaun 07850 978188 C6557 TERRA TYRES Avon Tredlite size31x15.50-15, pair fitted to 6 stud wheels with 8” pcd, chevron pattern all good tread, available with pair of stub axles to suit plus drawbar from small trailed drill (fit other machines). Also pair same size tyres with grass type block tread, Bridgestone Pillow DIA-1 pattern fitted to 8 stud wheels ex front axle of JD 2wd tractor, 200mm pcd fitting with 150mm centre hole, very good tyres done little work Very Good condition poa % Chris C 01926 338639 S6609 STOCKS 15 - 38 Steel Dual wheel rims and spacers (No tyres) Good condition % Shaun 07850 978188 C6808 FLOTATION
Pair rear tractor tyres size 66x43.00-25, Firestone 23 tubeless pattern on rims with twin flanges for bolted in swop plates (suit tractors or combines), 60% + good tread on both tyres, 2 sets of centre plates - 8 stud 8”pcd with a 6” centre hole (JD/MF/Case etc. fitting) & 8 stud 205mm pcd with 140mm centre hole Very Good condition £1,125 % Chris C 01926 338639 C6632 COMBINE Size set crossply tyres suit Claas,/MF etc. Size 23.1/18-26 set of four all good tread but a little aged currently on 8 stud wheels ex wheeled excavator (rubber duck) but ideal as a spare or kit your machine out with a pair of better tyres Good condition Offers % Chris C 01926 338639 C6095 ROWCROP Wheels pair 8.3-44 fitted Michelin Bibagrip 3 tyres 50-60% good tyres, 8 stud fitting 275mm pcd with 220mm hole diameter, last used on Case tractor Good condition £295 % Chris C 01926 338639 S6691 STOCKS 11.2 -48 Rocrop wheels Fitted 90% alliance tyres. Bolt in 8 Stud pans 8” PCD 6” Hole. (37.5” to outside of the pans) Suit MF / IH etc Very Good condition % Shaun 07850 978188 C6534 KLEBER Radial pair 480/65R28 tyres on wheels ex Sanderson forklift, radial tyres with good 10% tread, white painted 8 stud wheels with 8” pcd & 5.5” centre hole (large chamfered hole fit Ford tractor etc), welded centres non adjustable wheels Good condition £475 % Chris C 01926 338639 C6507 NARROW Tyres & wheels for row crop work, pair Kleber 9.5-44 tyres on rims to fit 8 stud 8” pcd fitting (ex MF but will fit Case/DB, JD etc.), good tyres but rims may require some repair. Vredestein 8.332 tyre with good sound tread. Pair complete wheel rims & centres (no tyres) to fit front axle of John Deere 4wd (2850 model etc) suit fitment of 9.5R32 or 8.3-32 tyres. Good condition % Chris C 01926 338639 S6018 GOODYEAR 48 - 25 - 20 Terra Grip tyres (pair) 60% tread 8 stud Fitting 405 mm PCD, 360mm hole. Offset appx. 6 or 18” Good condition £700 % Shaun 07850 978188 S6326 TAURUS 270/95 R48 4 Star Rocrops On HD rims and centres to Fit MB trac (8 stud, 275mm PCD & 220 hole) Tyres all 85% good Set of 4 Very Good condition £1,300 % Shaun 07850 978188 C6755 DUAL 16.9R34 Pirelli TM500 (420/85R34) tyres on pair heavy duty wheels with 4 clamps per wheel, round bar clamping rail, quality radial tyres as new, wheel rims all sound but could do with repaint. Hard to find set, ideal to swop tyres over & get new set on your tractor Very Good condition £895 % Chris C 01926 338639 C6348 NISSAN Terrano set 4 alloy wheels & tyres plus steel spare wheel & tyre, General Grabber AT2 tyres size 235/70R16 one as new plus 4 x approx 70% good tread, all ex Commercial Terrano model 4x4 vehicle, worth the cost in tyres alone Good condition £395 % Chris C 01926 338639
S5997 GOODYEAR 600/65 R28 DT 820 Tyres, treads appx 30%, Sound order Suit tractor front or sprayer Good condition % Shaun 07850 978188 W3425 BETTINSON 3 & 5 Star Dual Wheels 2 sets of 12 x 36 rims with worn Goodyear 13.6 - 36 tyres. Would suit a Classic tractor?! £125 % Chris W 07957 870362 S5187 GKN 11.2 R48 Rocrops , Alliance Tyres with JD 8 Stud HD centres plus Fronts 11.2 R32 Alliance, same PCD Fit JD 6400 - 6620. Good condition £1,200 % Shaun 07850 978188 C6083 MICHELIN Tractor tyres, all XM108 radial tread pattern. One pair 650/65R38 & two pairs 540/65R28 (ex JD 6900 tractor) - tread depth varies from approx 20% to 5%+ good all sound & suitable dual wheels etc. Photos available & can be sold in sets Good condition poa % Chris C 01926 338639 S6571 MB TRAC wheels Chioice of 16.9 - 24 Tyres 7 MB trac rims and deatcheable centres Varoius amounts if tread Good condition % Shaun 07850 978188 C6767 ROW CROP Set Wheels ex Case tractor, rear size 230/95R44 (9.5R44) Alliance tyres with 85% good tread, silver painted adjustable track Sam Moreton wheels with 8 stud 8” pcd fitting (will also fit MF, JD, DB, Leyland etc rear axles). Front 8.3/8R32 Kleber 40% tyres on yellow wheels with 8 stud 275mm pcd fitting Good condition £895 % Chris C 01926 338639 C6187 STANDEN Pair Row Crop wheels & tyres to fit Ford 7700/7710 or similar rear axle with 8 stud fitting, size 9.5R48 Michelin with 80% good tread. Also pair silver painted Stocks dual wheels with clamps fitted Goodyear 16.9R38 tyres which are sound enough as duals - Price £235 Average condition £245 % Chris C 01926 338639 C6091 ROWCROP Wheels & Tyres pair 9.5R48 Alliance tyres with 90% good tread on Mortons heavy duty wheels, 8 stud fitting with 275mm pcd & 220mm diameter centre hole (last used on Case 856 tractor) Very Good condition £695 % Chris C 01926 338639 S6236 FOSSITT AND THORNE Heavy Duty Rocrop wheels, 1 pair of 8.3 - 44 s with 70 % Bibagrip tyres have 8 very strong 3 hole lugs 32” PCD. Also Pair of 9.5 - 48 Rocrops Also 8 stud 32” PCD. Plus Pair of Ford Pans 8” PCD big hole with 5.5” centre Good condition £250 pair % Shaun 07850 978188 C6586 TERRA TYRES set of four 48x25.00-20NHS Goodyears on 8 stud wheels with 275mm pcd ex MB Trac 1000 model, good tread but some slight surface cracking on 2 tyres.This size will also fit other applications (tractors, sprayers etc.). Also set four Continental 9.5-42 row crop tyres (3 x 85% good tread & 1 x 20%) all on welded centre to rim wheels same fitting as above (suit 72” track setting). Good condition poa % Chris C 01926 338639 C5824 ALLIANCE Pair 600/60R30.5 flotation tyres 331 tread pattern traction type A8 12 ply with good tread, some small surface cuts but all sound carcass, rolling circumference when new 4340mm Good condition £450 % Chris C 01926 338639 C5766 MICHELIN 19.5LR24 M27 pair tyres on rims with 6 stud 325mm (13”) pcd & 285mm centre hole, tread 40%+, suit MF 3600 series tractors or similar. Set Rowcrop wheels for a JD 2850 4wd tractor with 12.4R32 fronts & 11.2R48 rears, Barum & Michelin tyres all tyres OK with between 10 & 20% tread Good condition poa % Chris C 01926 338639 S5678 11.5/80 - 15.3 tyres Pair of on 6 stud rims 160 hole plus 205 mm PCD plus s of 12.5 - 18 tyres 60% on similar rims. Also 4 40-14 x 24 aircraft type tyres on 8 stud trailer rims Average condition % Shaun 07850 978188 S5724 STOCKS 18.4 - 38 Duals C\w 20 % tyres & good clamps Good condition % Shaun 07850 978188 W3451 COLCHESTER TILLAGE 8.3/80R36 Row Crop wheels complete with pans to fit MF135 or similar. 80% tread. Good condition % Chris W 07957 870362 S6419 STANDEN STD 15 9.5 - 44 Rocrops, 90%tyres hardly used. DB/ MF 8 stud centres Excellent condition £275 % Shaun 07850 978188 C6713 SET ROW CROPS Rear 9.4R48 (230/95R48) Alliance very good tyres on wheels with 8 stud fitting & 8” pcd, Fronts 9.5R32 Kleber tyres 30% good tread on 8 stud fitting with 325mm pcd, last fitted on Case MXU 4wd tractor. Fronts will also fit New Holland/Ford Carraro axle & rears also fit MF/JD/DB/Leyland etc. Also pair Goodyear crossply tyres size 18.4-30 ex trailed sprayer on 8 stud wheels with 275mm pcd - this pair price £345 Good condition £995 % Chris C 01926 338639 S6252 HEAVY DUTY 270 / 95 R48 Rocrop wheels c\w New tyres. Also inc HD Standen type rims & centres (8 stud 275 mm PCD & 220mm holes Good condition £975 % Shaun 07850 978188 S6019 MICHELIN 9.5 - 48 Rocrop tyres, 6 ply on HDR type rims with pans, 280mm hole 8 stud 250mm hole. Also Pair of Kleber 9.5 - 48 rocrops 60% tread on HD rims with Pans 8 stud 8” 5.5” hole Ford Etc. Average condition % Shaun 07850 978188 C6133 GOODYEAR Wrangler 31.0015.50-15LT tyres ex Wilmot Lightfoot ‘buggy’ sprayer on 4 stud wheels (for Ford axles), multiple chevron type good tread, quantity 4 to be sold as one lot Good condition £365 % Chris C 01926 338639 C6298 WHEEL RIMS Set 4 to take tyre size 580/65R22.5 used as an lgp set of four on a self propelled sprayer, 8 stud fitting with a 275mm pcd suit Poclain motor drives etc. Very little used in as new condition, Excellent condition £420 % Chris C 01926 338639 C6809 ROWCROP WHEELS Set front & rear heavy duty type made by Sam Moretons tyres, rear size 9.5R44 Alliance on 8 stud fitting 205mm pcd with 140mm centre hole, front 8.3R32 Vredestein 8 stud 6” (150mm) pcd & 105mm centre hole, all tyres 90% good tread. Suit Lambourghini, SAME & other tractors Very Good condition £1,195 % Chris C 01926 338639 S6593 STOCKS 15 - 34 Dual wheel rims, pair of in Black. Tyres perished Good condition % Shaun 07850 978188 S5831 STANDEN 11.2 R 48 rocrops C\w 40% tyres & Bolt in Ford 8 stud centres. Also Set Of HDR Rims with 11.2 - 48Tyres & square Ford Pans Plus f Terry Johnson dualling kit to mount 2 pairs of Rocrops on each axle. Good condition % Shaun 07850 978188
S6744 2007 STOCKS 380 /90 R46 Heavy Duty Rocrop wheel with Solid Centres 8 Stud 275mm PCD 220 Hole fitted Goodyear tyres 80%. Plus 385/85 R30 Fronts solid centre, 10 stud 335 PCD 280 hole. 70% Goodyear tyres. Very Good condition £2,800 % Shaun 07850 978188 W3489 STANDEN HDR82 8.3x42 rowcrop wheels with 80% Kleiber 50 radials. Very Good condition £295 % Chris W 07957 870362 S6418 STOCKS 15 - 38 Dual wheels fitted Kleber 18.4 - 38 tyres, 60% tread but some aging cracks (OK for duals) 4 clamps per wheel Good condition £450 % Shaun 07850 978188 C5800 MICHELIN Trailer/Vehicle tyres on rims, size CC9.00-16 (cross country deep tread), quantity 2 on heavy rims painted red with 8 stud fitting 275mm pcd. Also same spec with 1 Dunlop & 1 India tyre. Suit some classic commercial & ex army vehicles. Price is for lot (4 wheels & tyres) Good condition £245 % Chris C 01926 338639 C6756 JOHN DEERE pair yellow painted complete wheels ex 2850 tractor size 1238 suit tyre size 13.6-38 with 8 stud 8” pcd fitting Very Good condition £225 % Chris C 01926 338639 C6312 JCB Fastrac set of 4 Flotation wheels & tyres, size 800/45-26.5 Alliance 331 pattern chevron tread 12 ply rating, 70% all good even tread, on 10 stud rims for front axle & 12 stud rims for rear axle (suit later high hp Fastrac models) Good condition £3,500 % Chris C 01926 338639 S6396 ALLIANCE 600 - 50 - 22.5 Flotation 328 tyres, 8 stud centres 8” PCD suit DB, MF etc. Good condition % Shaun 07850 978188 S6759 D AND S 12.4 R46 Rocrops To Suit MF 6150 (Adjustable track to 62”) Fitted Alliance A 350 tyres 4 star. 95% Centres have 6” hole 8” PSD Plus fronts 11.2 R 32, Alliance tyres 3 * Bolt in centres 220 hole 275 PCD Excellent condition £2,000 % Shaun 07850 978188
39
VEGETABLE EQUIPMENT
S5247 INVICTA Vibrating table on Long legs, Screen 750mm by 2m 20mm pitch rods. 960 watt motor. Tidy unit Took out ready to go Good condition % Shaun 07850 978188 W3434 NICHOLSON Fan Bladed Onion Toppers 2 x 10t/hr Onion Toppers that can be run in parallel or individually, complete with 1.5m wide rubber belt feed elevator. All motors 3 phase. Please call for details. poa % Chris W 07957 870362 C6681 STANDEN Front Linkage simple type fits to front of tractor to operate Standen Hoe, single ram lift, yellow paintwork, last used on Case tractor, could be adapted for other applications Good condition £350 % Chris C 01926 338639
40
VEHICLES/LGPV
C6745 CHERISED Number Plate transferable from Peugeot car, registration number K420 EWE suit any stockman with sheep. Transfer fee payable by purchaser £235 % Chris C 01926 338639 S6891 Agribuggy Type 4wd LPGV, Very tidy cab, VW Diesel engine. Hydraulic swith 2 spools.Fitted Vicon 802 spreader with hydraulic shut off. Goodyear 15-50- 15 Tyres and 7.50 - 16s. Good condition £1,800 % Shaun 07850 978188 C6812 MAZDA
323F 5 door hatchback car, first registered 30/09/03 with one owner plus supplying dealer, low mileage for year 63370, 1.6 litre petrol engine, manual 5 speed gearbox, GSi specification with aircon, front fog lights, alloy wheels, adjustable fore & aft rear seat, sunroof etc., Pearlescent blue paintwork, Road tax to 31/07/14 & MOT to 13/01/14, full documented service history, all good tyres, estate size boot. Some panelwork blemishes & scratches but a tidy clean car. Voted top 3 most reliable car in JD Power survey. Good value Good condition £1,295 % Chris C 01926 338639
Wrights Broker Service the safe and reliable way to buy and sell machinery and equipment
View the broker service online at
40 OCTOBER 2013
BEDEC ACRYLIC EXTERIOR
BARN PAINT THE SAFE ALTERNATIVE TO TAR VARNISH, BITUMEN AND CREOSOTE • • • •
EASY TO APPLY EXCELLENT COLOUR RETENTION MULTI-SURFACE APPLICATION FLEXIBLE - NO CRACKING OR FLAKING • LONG LASTING FINISH AVAILABLE NATIONWIDE THROUGH TRAVIS PERKINS, RIDGEONS, BREWER & SONS, BROMBOROUGH PAINTS, ERNEST DOE & DULUX DECORATOR CENTRES
TEL 01279 876 657 FAX: 01279 876 008 email: sales@bedec.co.uk
LUBRICANTS Tradition in Excellence since 1869
ORDER ONLINE TODAY!
morrislubricantsonline.co.uk or call us on 01782 410 391 Quote Voucher Code WFR888
Wrights Farming Register, October 2013, Full Edition. See more: | https://issuu.com/mortons-digital/docs/wfroct13-issuu | CC-MAIN-2017-22 | refinedweb | 42,998 | 67.08 |
Hide Forgot
Created attachment 1694972 [details]
screenshot
Description of problem:
When logged in as non-admin user in a namespace created by this non-admin user,
created Virtual Machines are not displayed in the Virtualization.
Browser console reads lots of 403 errors.
After discussion with Yaacov, the issue is probably either:
- if virtualmachineimports are not allowed for non-admin user, UI should ignore the missing data => UI bug
- if virtualmachineimports should be allowed for non-admin user, UI should display an error instead of failing silently => UI bug + CNV permissions bug
```
oc get virtualmachineimports
No resources found.
Error from server (Forbidden): virtualmachineimports.v2v.kubevirt.io is forbidden: User "test" cannot list resource "virtualmachineimports" in API group "v2v.kubevirt.io" in the namespace "test"
when in none-admin we cant get virtualmachineimports
```
Version-Release number of selected component (if applicable):
4.5.0-0.nightly-2020-06-02-220939
How reproducible:
100%
Steps to Reproduce:
1. log in as non-admin user
2. create a VM
3. navigate to Virtualization -> Virtual Machines
Actual results:
Expected results:
Additional info:
@Filip, hi
In this case vmImports is not null, and also not loaded ( it has an error )
we have a line that should handle cases where user can not get virtualmachineimports [1] should it also handle this case ?
const isVMImportLoaded = !vmImports || vmImports.loaded; // go in when CRD missing
[1]
targeting to 4.6 , since this is high profile, we may want to backport to 4.5
@Tomas FYI
after off line discusstion, cloning to 4.5 too
I suspect that this should be fixed by vm-import-operator, unless it already was. Piotr can you take a look?
The only alternative thing we could do in the UI for now, is to disable vm import functionality for non admin users and turn it back on once this is fixed.
I think that the flow we implemented should be managed only by admins.
@Peter do you think we should enable it for other users as well?
Verified with 4.6.0-0.nightly-2020-06-09-1905. | https://bugzilla.redhat.com/show_bug.cgi?id=1843780 | CC-MAIN-2021-49 | refinedweb | 343 | 54.93 |
Having Web Page Refresh and go to end of page
Discussion in 'ASP General' started by miTch,
thread end and make main program end also?, Mar 10, 2005, in forum: Python
- Replies:
- 2
- Views:
- 354
How do i refresh a datagrid from a pop up window without having to refresh the whole page?Pkenty, May 28, 2004, in forum: ASP .Net Web Controls
- Replies:
- 0
- Views:
- 398
- Pkenty
- May 28, 2004
Architecture question: should I use a web service as back end to my web front end?Karen Sundquist, Nov 29, 2003, in forum: ASP .Net Web Services
- Replies:
- 1
- Views:
- 148
- Saurabh Nandu
- Dec 1, 2003
Web Application end to end performance monitoringNagesh, Jul 28, 2003, in forum: ASP General
- Replies:
- 1
- Views:
- 112
- Bob Barrows
- Jul 28, 2003
def .. end is ok and class .. end is not ok .. Why??Kyung won Cheon, Aug 18, 2008, in forum: Ruby
- Replies:
- 1
- Views:
- 105
- Pit Capitain
- Aug 18, 2008 | http://www.thecodingforums.com/threads/having-web-page-refresh-and-go-to-end-of-page.799107/ | CC-MAIN-2014-41 | refinedweb | 159 | 79.3 |
This tutorial goes through how to make a VR (virtual reality) app for your mobile device using the new Google VR plugin for Unity (Daydream VR). The app can be built, if you look at the ground you stop walking.
I will also be doing a video on Daydream controller support as soon as I get my hands on one.
To follow along you will need:
Unity 3D:
The Google VR plugin:
(click "download the repo directly)
Thanks for looking and let me know in the comments if you have any questions!
Step 1: Create a New Project:
Create a new Unity Project and drag the two images above into the assets folder.
Go to the GVR plugin folder and drag "GoogleVRForUnity.unitypackage" into the assets folder as well.
Go the the asset store tab and download and import the Cope! free skybox pack.
Delete the camera in the hierarchy.
Go to the GVR folder in Unity, and navigate to the legacy, prefabs folder. Drag in the main prefab into the scene.
Right click in the hierarchy and create a new 3D object plane.
Drag the maze image onto the new plane.
Step 2: Start Creating the Scene.
Click the main camera, as well as the left and right, and change their background from solid color to skybox.
Go to the scope skybox pack folder and drag in your desired skybox from the materials folder into the scene.
Right click in the hierarchy and create a new 3D cube.
Scale the cube to make the first wall for the maze. Drag on the grass picture to this first cube.
Keep duplicating that cube to build the walls to the maze.
Step 3: Complete the Scene
Once the maze portion is complete it should look like the image above.
Click the GVR main in the hierarchy and go to the inspector side.
Add a rigidbody component and click the checkbox to freeze the x and z rotation.
Now add a capsule collider component.
Make sure to scale the collider so its bottom is just above the plane, and also scale it to make sure the collider will fit inside the walls of the maze.
Step 4: Write Some Code.
In the same inspector view click to add a component to the GVR main.
Add a new c sharp script, and call it "controller.cs"
Double click that script to open up Mono Develop.
Copy and paste this code into the new script.
using UnityEngine; using System.Collections; public class controller : MonoBehaviour { private bool walking = false; private Vector3 spawnPoint; // Use this for initialization void Start () { spawnPoint = transform.position; } // Update is called once per frame void Update () { if (walking) { transform.position = transform.position + Camera.main.transform.forward * .5f * Time.deltaTime; } if (transform.position.y < -10f) { transform.position = spawnPoint; } Ray ray = Camera.main.ViewportPointToRay (new Vector3 (.5f, .5f, 0)); RaycastHit hit; if (Physics.Raycast (ray, out hit)) { if (hit.collider.name.Contains ("plane")) { walking = false; } else { walking = true; } } } }
Step 5: Now You Have a Game
Click File, Build Settings, and change the bundle identifier to com."something"."something"
Now switch your build platform to IOS or Android depending on what type of phone you want to run the game on and click build and run.
Thats it!
Any questions, don't hesitate to ask!
Let me know in the comments what other tutorials you would like to see!
Runner Up in the
Puzzles Challenge
5 Discussions
2 years ago
start the game on pc works just fine, but if i build on my android device oneplus one 6.0 the maze is gone, only the skybox, what should i do?
2 years ago
What version of unity did you use? The google sdk doesn't work for me, it says the script has compiling errors. Thanks!
2 years ago
can't download the zip file..?
2 years ago
Nice, I recently had to make a game for a school comp and it included mazes made in unity. It's funny cause I used the same method you did and even used the same maze template
Reply 2 years ago
lol nice, but yeah it makes it so much easier. | https://mobile.instructables.com/id/Mobile-Virtual-Reality-Game-IN-UNDER-15-MINUTES/ | CC-MAIN-2019-18 | refinedweb | 695 | 75.1 |
Today, ECMAScript 6 is in the process of being finalized. ECMAScript is the foundation of JavaScript and, hence, exploring the proposed features today also means that we get a sneak peak at how we will be writing JavaScript in the near future! In this article, we'll explore ten new features, with a significant focus on tools, browsers and transpilers.
A Brief History: ECMA, ECMAScript and JavaScript
JavaScript was originally developed by Brendan Eich of Netscape, and officially released as part of Netscape Navigator 2.0 in 1995. A year later, JavaScript was submitted to ECMA International, a body that facilitates the standardization of information and communication technology and consumer electronics, so that it can be formalized industry-wise. ECMAScript, thus, became the name of the scripting language standardized in ECMA-262.
The ECMAScript standard forms the backbone of many other derived languages, including ActionScript and JScript. Through the years, ECMAScript has gone through four versions, with the discussions today very much revolving around version six, which has also been code-named, ECMAScript Harmony.
Version correspondence
Before we dive into these new features, it's important to note that the ECMAScript standard forms the foundation of JavaScript. There are numerical differences between each of the JavaScript versions and the corresponding ECMAScript editions. This is to say that JavaScript is compatible with the ECMAScript standard, while providing more features. The table below summarizes the relationship between JavaScript and ECMAScript:
ES6 Overview
Goals
JavaScript has come a long way since its humble beginnings nearly twenty years ago. Today, developers are writing thousands of lines of code creating complex JavaScript applications. Before we dive into the detailed features of ES6, you may want to look at the big picture that is defined in the specification drafts, in terms of requirements, goals, means and themes. One of the goals for ES6 is to be a better language for creating:
- complex applications
- libraries
- code generators
Compatibility
The ES6 compatibility table is very useful, as it tells us the ES6 features that are supported in the current browser. It also gives us a handy link to the specifications for each of the features listed. Do note that some of the features' existence might not mean full compliance with specifications. When working with Chrome, be sure to enable the "Experimental JavaScript" flags.
Features
Now that the big picture is defined, let's explore how we can implement them. In the following sections, we will discuss ten features of ES6, using various tools so that we can understand ES6 both in theory and practice. Prior knowledge of JavaScript is a pre-requisite, so feel free to check out many resources on JavaScript.
Listed below are the features that we'll go through with a different tool. Try them out one by one, or jump to the specific feature that you'd like to explore:
- Block scoping with
let[ using Firefox browser ]
- Block scoping with
const[ using Chrome browser ]
- Classes [ using Traceur ]
- Default function parameters [ using TypeScript ]
- Collections [ using NodeJS ]
- Destructuring [ using Firefox browser ]
- Rest parameters & Spread operator [ using Grunt plugin Traceur ]
- Iterators [ using Firefox browser ]
- Array comprehension [ using Firefox browser ]
- Modules (using ES6 Module Transpiler)
Feature 1 - Block Scoping with
let
- Documentation:
let
- Tool: Firefox browser 20.0: Menu > Tools > Web developer > Web Console
JavaScript variables are function-scoped. This means that, even if there are variables declared in a nested block, they are available throughout the function. Let's review a short example below; we'll simply use the web console in Firefox or Chrome to run them. What do you think will be the value of
jsFuture?
var jsFuture = "es6"; (function () { if (!jsFuture) { var jsFuture = "es5"; } console.log(jsFuture); }());
In the above example, the value of
jsFuture in the
console.log statement will be "es5". Crucial to your understanding is the fact that, in JavaScript, variable declarations are hoisted to the top, but variable initializations, on the other hand, are not. Hence, regardless of where the variables are initialized and declared, within the function scope, they will always be hoisted. The snippet below is exactly the same - with comments to illustrate this feature of variable hoisting.
var jsFuture = "es6"; (function () { // var jsFuture = undefined; // variable hoisting if (!jsFuture) { var jsFuture = "es5"; } console.log(jsFuture); // "es5" }());
ES6 tackles this issue with
let, which is like
var, except for the fact that it is block scoped instead of function scoped. Let's consider another example with
var below. Calling the function
es[6]() will give us the value of
i = 10. Notice that, even though
var i = 0; is declared in the
for loop, the scope of
var i defaults to global. Hence, when the function
es[6]() is executed, the value of
i is
10.
var es = []; for (var i = 0; i < 10; i++) { es[i] = function () { console.log("Upcoming edition of ECMAScript is ES" + i); }; } es[6](); // Upcoming edition of ECMAScript is ES10
Let's now use
let. To code this out, we'll use Firefox and open up the web console through the menu (Tools > Web developer > Web Console). Creating a block-scoped variable within the
for loop,
let c = i; made it block scoped.
var es = []; for (var i = 0; i < 10; i++) { let c = i; es[i] = function () { console.log("Upcoming edition of ECMAScript is ES" + c); }; } es[6](); // Upcoming edition of ECMAScript is ES6
Firefox already supports many upcoming ES6 features. Refer to the compliance table for Firefox to keep updated on which features are supported, and which ones are also compliant with the current specification.
Feature 2 - Block Scoping with
const
- Documentation:
const
- Tool: Chrome Browser > View > Developer > JavaScript Console
Constant definitions are now possible with
const.
let and
const behave similarly in the sense that both are block scoped, but with
const, the values are read-only and cannot be re-declared later on. Let's review a simple code example in Chrome:
Feature 3 - Classes
- Documentation:
class
- Tool: Traceur with Chrome Browser > View > Developer > JavaScript Console
In object-oriented programming languages, a
class is a representation of an object. It forms the blueprint, while an object is an instance of a class. With regard to JavaScript, it is a class-less programming language and everything is an object. Traditionally, we've used functions and prototypes to implement classes. Let's explore one common way of implementing class in ES5.
var Language = function(config) { this.name = config.name; this.founder = config.founder; this.year = config.year; }; Language.prototype.summary = function() { return this.name + " was created by " + this.founder + " in " + this.year; };
Next, let's see how ES6 implements classes with minimal class declaration syntax that can be extremely important to distinguish classes and functions. To code out
class using the ES6 syntax, we will use Google's Traceur, which is a transpiler that compiles ES6 code into ES5. First, let's create the
html file structure within which we will insert the ES6 syntax for classes. In order to compile the Traceur code, we require both
traceur.js to compile Traceur to JavaScript, as well as
bootstrap.js to bind them all. Finally, Traceur will look for
script type="text/traceur" tags to compile the relevant code inside the tags into vanilla JavaScript.
<!DOCTYPE html> <html> <head> <title>ES6 Classes</title> <script src=""></script> <script src=""></script> </head> <body> <script type="text/traceur"> // insert ES6 code </script> </body> </html>
Next, within the
script type="text/traceur" tags, let's use the ES6 syntax to implement the same class that we previously did for
Language.
class Language { constructor(name, founder, year) { this.name = name; this.founder = founder; this.year = year; } summary() { return this.name + " was created by " + this.founder + " in " + this.year; } }
We can now create an instance of the
class Language by opening the HTML file in the Chrome browser as
var js = new Language. In the console, we'll see the prompts for other properties of the language as well!
With such a clear syntax declaration, we can also move on to extend the class to implement a sub-class
MetaLanguage that will inherit all the properties from the parent class
Language. Inside the constructor function, we will require the function
super that will call the constructor of the parent class so that it is able to inherit all of its properties. Lastly, we can also add on extra properties, such as
version, as illustrated in the code below. Let's review the ES6 syntax and run it in the Chrome browser:
class MetaLanguage extends Language { constructor(x, y, z, version) { super(x, y, z); this.version = version; } }
Traceur is a useful transpiler that allows us to code using the ES6 syntax, while doing the heavy-lifting for us to compile it back to the current JavaScript version. Do try out other ES6 features in Traceur as well!
Feature 4 - Default Function Parameters
- Documentation:
default function parameters
- Tool: TypeScript 0.8.3
With default function parameters, we can always have function parameters as an option by setting some defaults. The syntax for this feature in ES6 is extremely intuitive. The default parameters are defined when the functions are defined. Let's have a look at the ES6 syntax below in a new TypeScript file with an extension of
*.ts.
function history(lang = "C", year = 1972) { return lang + " was created around the year " + year; }
Next, we will install TypeScript as an npm module and run the file
.*ts and compile it to vanilla JavaScript. Here are the installation and then compilation commands in the command line:
$ npm install -g typescript $ npm view typescript version 0.8.3 $ tsc 4-default-params.ts
The command above will create a vanilla JavaScript file, called
4-default-params.js, which can then be called from an HTML file. Here's the simple HTML file that will call the external JavaScript file that is created by the TypeScript compiler:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ES6 Default Parameters</title> </head> <body> <script src="4-default-params.js"></script> </body> </html>
Finally, we will open the HTML file in Chrome/Firefox and call the function
history() two times, with and without the function parameters. Notice that not passing in any function parameters will fall back to the default parameters:
Do check out other TypeScript features, including
class or go through a TypeScript tutorial for more in-depth usage.
Feature 5 - Collections
- Documentation: Sets and Maps
- Tool: NodeJS v0.10.4
ES6 offers new data structures previously not available in JavaScript. Before we jump into exploring two such data structure (Sets and Maps), let's see how we can run ES6 syntax with NodeJS. Install NodeJS; from here on, we will work in the command line. Firstly, we will check the NodeJS version installed, and then check which options will enable ES6 features with the command
node --v8-options | grep harmony.
$ node --version v0.10.4 $ node --v8-options | grep harmony --harmony_typeof (enable harmony semantics for typeof) --harmony_scoping (enable harmony block scoping) --harmony_modules (enable harmony modules (implies block scoping)) --harmony_proxies (enable harmony proxies) --harmony_collections (enable harmony collections (sets, maps, and weak maps)) --harmony (enable all harmony features (except typeof))
Next, start the NodeJS repl and query which properties are available for Set and Maps. We will start the NodeJS repl with
node --harmony to enable all ES6 features.
$ node --harmony > Object.getOwnPropertyNames(Set.prototype) [ 'constructor', 'add', 'has', 'delete' ] > Object.getOwnPropertyNames(Map.prototype) [ 'constructor', 'get', 'set', 'has', 'delete' ] > .exit $
Sets
Sets are simple data structures that are similar to arrays, but each value is unique. Let's create a new file, called
5-sets.js, and insert some code to create, add, delete and query the new set that we will create. Also, note that we will add "Hippo" data twice, but in the set, it will be registered only once!
var engines = new Set(); // create new Set engines.add("Gecko"); // add to Set engines.add("Trident"); engines.add("Webkit"); engines.add("Hippo"); engines.add("Hippo"); // note that Hippo is added twice console.log("Browser engines include Gecko? " + engines.has("Gecko")); // true console.log("Browser engines include Hippo? " + engines.has("Hippo")); // true console.log("Browser engines include Indigo? " + engines.has("Indigo")); // false engines.delete("Hippo"); // delete item console.log("Hippo is deleted. Browser engines include Hippo? " + engines.has("Hippo")); // false
Run the file in the node repl with the command
node --harmony 5-set.js. Note that, even though "Hippo" was added twice to the set, upon deleting it, the set didn't include it anymore. This once again illustrates that a set is a data structure that can only contain unique values.
Maps
Maps are quite similar to JavaScript object key-value pairs. Using a unique key, we can retrieve the value. In ES6, the key can be any JavaScript data type and not just strings. That's the interesting part! Let's create a new file, called
5-map.js, to try out the create, get and delete features:
var es6 = new Map(); // create new Map es6.set("edition", 6); // key is string es6.set(262, "standard"); // key is number es6.set(undefined, "nah"); // key is undefined var hello = function() {console.log("hello");}; es6.set(hello, "Hello ES6!"); // key is function console.log( "Value of 'edition' exits? " + es6.has("edition") ); // true console.log( "Value of 'year' exits? " + es6.has("years") ); // false console.log( "Value of 262 exits? " + es6.has(262) ); // true console.log( "Value of undefined exits? " + es6.has(undefined) ); // true console.log( "Value of hello() exits? " + es6.has(hello) ); // true es6.delete(undefined); // delete map console.log( "Value of undefined exits? " + es6.has(undefined) ); // false console.log( es6.get(hello) ); // Hello ES6! console.log( "Work is in progress for ES" + es6.get("edition") ); // Work is in progress for ES6
As shown with the ES6 collections features, NodeJS harmony option already supports others ES6 features such as block scoping, proxies and modules. Do try them out in NodeJS as well!
Feature 6 - Destructuring
- Documentation: Destructuring
- Tool: Firefox browser 20.0: Menu > Tools > Web developer > Web Console
In programming languages, the term "destructuring" denotes pattern matching. In ES6, we can do some pretty nifty pattern matching in arrays and objects that previously would have taken us more than one step. Let's explore some of them by coding it out in Firefox web console.
Array destructuring
With array destructing, we can initialize variables at once, or even swap them instead of having the conventional way of creating a
var temp; temporary variable.
var [ start, end ] = ["earth", "moon"] // initialize console.log(start + " calling " + end); // earth calling moon [start, end] = [end, start] // variable swapping console.log(start + " calling " + end); // moon calling earth
Destructuring also becomes a useful shorthand when returning multiple values from a function, as we do not need to wrap around an object anymore. Also, to skip certain variables, just leave the array element empty:
function equinox() { return [20, "March", 2013, 11, 02]; } var [date, month, , ,] = equinox(); console.log("This year's equinox was on " + date + month); // This year's equinox was on 20March
Object destructuring
Due to destructuring, variables can also be initialized from an object that is returned from a function even with deeply nested objects. Also, just like the array patterns, we can skip the ones not needed. Here's the snippet of code that illustrates just this:
function equinox2() { return { date: 20, month: "March", year: 2013, time: { hour: 11, // nested minute: 2 } }; } var { date: d, month: m, time : { hour: h} } = equinox2(); // h has the value of the nested property while "year" and "minute" are skipped totally console.log("This year's equinox was on " + d + m + " at " + h); // This year's equinox was on 20March at 11
Feature 7 - Rest Parameters and Spread Operators
- Documentation: Rest parameters & Spread operator
- Tool: Grunt plugin Traceur
Rest parameters
In ES6, rest parameters allows us to easily use a few fixed parameters in a function, along with the rest of the trailing and variable number of parameters. We already use
arguments, which is an array-like object that defines the arguments passed to a function, but clearly we cannot use the array function to manipulate these arguments. With a clear syntax in ES6, it also moves the intent of the developer into the syntax level with three dots
... to denote a variable number of arguments.
Let's try to use rest parameters in the ES6 syntax with gruntjs and its plugin for the traceur transpiler, which we used in the previous section.
Install grunt command line utility:
$ npm uninstall -g grunt $ npm install -g grunt-cli
Create a file, called
package.json, which will define the various modules needed to run Grunt. Note that this list of dependencies includes the traceur plugin:
{ "name": "rest-params", "version": "0.1.0", "devDependencies": { "grunt": "0.4.1", "grunt-traceur": "0.0.1" } }
Create the
Gruntfile.jswhich will contain just one task
traceurthat will convert ES6 syntax to today's JavaScript. With this, we will be able to try out ES6 rest parameters.
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), traceur: { custom: { files:{ 'js/': ['rest-spread.js'] // dest : [source files] } } } }); grunt.loadNpmTasks('grunt-traceur'); grunt.registerTask('default', ['traceur']); };
Create a simple
index.htmlto call the traceur-compiled JavaScript file,
js/rest-spread.js:
<!DOCTYPE html> <html> <head> <title>ES6 Rest parameters</title> </head> <body> <script src="js/rest-spread.js"></script> </body> </html>
Most importantly, we'll create the file
rest-spread.js, which will contain the rest parameter syntax:
function push(array, ...items) { // defining rest parameters with 3 dot syntax items.forEach(function(item) { array.push(item); console.log( item ); }); } // 1 fixed + 4 variable parameters var planets = []; console.log("Inner planets of our Solar system are: " ); push(planets, "Mercury", "Venus", "Earth", "Mars"); // rest parameters
Finally, we will run
gruntin the command line, which will, by default, run the traceur task and create the file,
js/5-rest-spread.js. Next, just view the file
index.htmlin the browser console:
$ npm install $ grunt ╰─$ grunt Running "traceur:custom" (traceur) task js/ [ 'rest-spread.js' ] Compiling... js/ Compilation successful - js/ Writing... js/ js/rest-spread.js successful. Writing successful - [object Object]
Spread operator
A spread operator is the opposite of rest parameters. When calling a function, we can pass in the fixed argument that is needed along with an array of a variable size with the familiar three dot syntax, to indicate the variable number of arguments.
We will use the same project as the rest parameters above and append in the spread operator code to the file
rest-spread.js. In the example below, the function requires six separate arguments. When calling the function, the data is passed as an array with the spread operator. Let's see how the syntax looks, when calling the function with fixed arguments as well as a variable number of arguments:
Append the spread operator code to
rest-spread.js:
// Spread operator "...weblink" function createURL (comment, path, protocol, subdomain, domain, tld) { var shoutout = comment + ": " + protocol + "://" + subdomain + "." + domain + "." + tld + "/" + path; console.log( shoutout ); } var weblink = ["hypertext/WWW/TheProject.html", "http", "info", "cern", "ch"], comment = "World's first Website"; createURL(comment, ...weblink ); // spread operator
Run the traceur compile through the Grunt task in the command line, and view the file,
index.html, in the browser:
$ grunt Running "traceur:custom" (traceur) task js/ [ 'rest-spread.js' ] Compiling... js/ Compilation successful - js/ Writing... js/ js/rest-spread.js successful. Writing successful - [object Object] Done, without errors.
If you're already using GruntJS as a build tool in your current project, it will be easy to integrate it with ES6 plugins. So do try out other GruntJS ES6-related plugins to compile ES6 syntax to current JavaScript.
Feature 8 - Iterators
- Documentation: Iterator
- Tool: Firefox browser 20.0: Menu > Tools > Web developer > Web Console
JavaScript offers
for-in for iteration, but it has some limitations. For example, in an array iteration, the results with a
for-in loop will give us the indexes and not the values. Let's take a look at the code below to illustrate this:
var planets = ["Mercury", "Venus", "Earth", "Mars"]; for (p in planets) { console.log(p); // 0,1,2,3 } var es6 = { edition: 6, committee: "TC39", standard: "ECMA-262" }; for (e in es6) { console.log(e); // edition, committee, standard }
Let's try the same concept, but, this time, with
for-of with an array, a set and a map:
var planets = ["Mercury", "Venus", "Earth", "Mars"]; for (p of planets) { console.log(p); // Mercury, Venus, Earth, Mars } var engines = Set(["Gecko", "Trident", "Webkit", "Webkit"]); for (var e of engines) { console.log(e); // Set only has unique values, hence Webkit shows only once } var es6 = new Map(); es6.set("edition", 6); es6.set("committee", "TC39"); es6.set("standard", "ECMA-262"); for (var [name, value] of es6) { console.log(name + ": " + value); }
Feature 9 - Array Comprehension
- Documentation: Array comprehension
- Tool: Firefox browser 20.0: Menu > Tools > Web developer > Web Console
Array comprehensions give us a shorthand syntax to manipulate each of the array contents in a certain pattern. It is very similar to the
map() or
filter() methods available in the Array object. Let's examine how we are using
map()
var temperature = [0, 37, 100]; function degToKelvin(deg) { return deg + 273; } temperature.map(degToKelvin); // [273, 310, 373]
Let's run through the same feature in Firefox to see the shorthand syntax in ES6 to create arrays with as many as three loops to create possible solutions for the game, Cluedo:
// Array created with 1 loop var temperature = [0, 37, 100]; [t + 273 for (t of temperature)]; // [273, 310, 373] // Array created with 3 loops var suspects = ["Miss Scarlet", "Colonel Mustard"], weapons = ["Candlestick", "Dagger"], rooms = ["Kitchen", "Ballroom"]; [(console.log(s + " with a " + w + " in the " + r)) for (s of suspects) for (w of weapons) for (r of rooms)];
Feature 10 - Modules
- Documentation: Modules, Modules examples, Modules loaders
- Tool: ES6 Module transpiler
In programming languages, modules perform isolated discrete functions and are independent of one another. This helps to not only build reusable components across projects, but also keeps errors isolated to the parts related to the current project. We have been creating modules in JavaScript typically with AMD or CommonJS. Let's create a simple module using the ES6 syntax and ES6 Module transpiler.
First, let's create the HTML file,
index.html, that will call the essential JavaScripts. We'll be using RequireJS as an AMD loader; hence, we refer to a CDN copy of the latest RequireJS file. Next, we also add the attribute,
data-main, on the
scripttag to tell RequireJS to load the
js/init.jsfile.
<!DOCTYPE html> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ES6 Modules</title> </head> <body> <script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.min.js" data-</script> </body> </html>
Now, we will create the file,
js/init.js, which will just invoke the
js/main.jsfile:
require(['main'], function(){ });
Create the module,
circle, in the file,
in/circle.js, in the ES6 syntax. This module exports two functions:
export function area(radius) { return Math.PI * radius * radius; } export function circumference(radius) { return 2 * Math.PI * radius; }
Create the file,
in/main.js, that will import the module
circleso that we can use the functions of that particular module. Notice the
importsyntax:
import { area, circumference } from 'circle'; console.log("Area of the circle: " + area(4) + " meter squared"); console.log("Circumference of the circle: " + circumference(14) + " meters");
At this point, the folder structure is shown below. We'll use the ES6 Module transpiler to create ES5 compatible code with two newly created files:
js/circle.jsand
js/main.js.
$ tree . |-- in | |-- circle.js | `-- main.js |-- index.html `-- js `-- init.js
Install the ES6 Module Transpiler:
$ npm install $ compile-modules --help
Finally, we will transpile these two files. Navigate to the folder,
in, from the command line:
$ compile-modules circle.js --type amd --to ../js $ compile-modules main.js --type amd --to ../js $ cd .. $ tree . |-- in | |-- circle.js | `-- main.js |-- index.html `-- js |-- circle.js |-- init.js `-- main.js
Do look at the transpiled code in the files
js/circle.jsand
js/main.js. We will now open up the file,
index.html, in the browser to see modules in action! We will need to use a web server to run this file. I'm using the Python SimpleHTTPServer. Navigate to the command line in the root of the file,
index.html:
$ python -m SimpleHTTPServer 8000
Resources
Many of our web development community members have openly shared about ES6 and what's coming up. I highly recommend going through their blog categories related to ES6:
And, for some further reading:
- ECMAScript 6 support in Mozilla
- Draft specification for ES.next
- The Future of JavaScript, a video by Dave Herman
- ECMAScript 6 - The Refined Parts (video and slides) by Kit Cambridge
- Latest Tweets on ES mailing list
- es6 - my fav parts
- ES6 has proper tail calls
- Power of Getters
- ECMAScript 6
- ES6 deep Dive by Dave Herman
Play with ES6 Today
There you have it: ten features of ES6 with tools that allow us to code with the new syntax today. I hope this has made you more excited about what's to come! Please note that, since the standardization work is in progress, the syntax, features and compliances might change. Nonetheless, it's definitely worth the effort to dig in sooner than later.
| http://code.tutsplus.com/articles/use-ecmascript-6-today--net-31582 | CC-MAIN-2014-42 | refinedweb | 4,228 | 56.96 |
Web Application Interface
It is a problem almost every language used for web development has dealt with: the low level interface between the web server and the application. The earliest example of a solution is the venerable and battle-worn Common Gateway Interface (CGI), providing a language-agnostic interface using only standard input, standard output and environment variables.
Back when Perl was becoming the de facto web programming language, a major shortcoming of CGI became apparent: the process needed to be started anew for each request. When dealing with an interpretted language and application requiring database connection, this overhead became unbearable. FastCGI (and later SCGI) arose as a successor to CGI, but it seems that much of the programming world went in a different direction.
Each language began creating its own standard for interfacing with servers. mod_perl. mod_python. mod_php. mod_ruby. Within the same language, multiple interfaces arose. In some cases, we even had interfaces on top of interfaces. And all of this led to much duplicated effort: a Python application designed to work with FastCGI wouldn’t work with mod_python; mod_python only exists for certain webservers; and these programming language specific web server extensions need to be written for each programming language.
Haskell has its own history. We originally had the cgi package, which provided a monadic interface. The fastcgi package then provided the same interface. Meanwhile, it seemed that the majority of Haskell web development focused on the standalone server. The problem is that each server comes with its own interface, meaning that you need to target a specific backend. This means that it is impossible to share common features, like GZIP encoding, development servers, and testing frameworks.
WAI attempts to solve this, by providing a generic and efficient interface between web servers and applications. Any handler supporting the interface can serve any WAI application, while any application using the interface can run on any handler.
At the time of writing, there are various backends, including Warp, FastCGI, and development server. There are even more esoteric backends like wai-handler-webkit for creating desktop apps. wai-extra provides many common middleware components like GZIP, JSON-P and virtual hosting. wai-test makes it easy to write unit tests, and wai-handler-devel lets you develop your applications without worrying about stopping to compile. Yesod targets WAI, as well as other Haskell web frameworks such as Scotty and MFlow. It’s also used by some applications that skip the framework entirely, including Hoogle.
The Interface
The interface itself is very straight-forward: an application takes a request and returns a response. A response is an HTTP status, a list of headers and a response body. A request contains various information: the requested path, query string, request body, HTTP version, and so on.
In order to handle resource management in an exception-safe manner, we use
continuation passing style for returning the response, similar to how the
bracket function works. This makes our definition of an application look
like:
type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived
The first argument is a
Request, which shouldn’t be too surprising. The
second argument is the continuation, or what we should do with a
Response.
Generally speaking, this will just be sending it to the client. We use the
special
ResponseReceived type to ensure that the application does in fact
call the continuation.
This may seem a little strange, but usage is pretty straight-forward, as we’ll demonstrate below.
Response Body
Haskell has a datatype known as a lazy bytestring. By utilizing laziness, you can create large values without exhausting memory. Using lazy I/O, you can do such tricks as having a value which represents the entire contents of a file, yet only occupies a small memory footprint. In theory, a lazy bytestring is the only representation necessary for a response body.
In practice, while lazy byte strings are wonderful for generating "pure" values, the lazy I/O necessary to read a file introduces some non-determinism into our programs. When serving thousands of small files a second, the limiting factor is not memory, but file handles. Using lazy I/O, file handles may not be freed immediately, leading to resource exhaustion. To deal with this, WAI provides its own streaming data interface.
The core of this streaming interface is the
Builder. A
Builder represents
an action to fill up a buffer with bytes of data. This is more efficient than
simply passing
ByteStrings around, as it can avoid multiple copies of data.
In many cases, an application needs only to provide a single
Builder value.
And for that simple case, we have the
ResponseBuilder constructor.
However, there are times when an
Application will need to interleave
IO
actions with yielding of data to the client. For that case, we have
ResponseStream. With
ResponseStream, you provide a function. This
function in turn takes two actions: a "yield more data" action, and a "flush
the buffer" action. This allows you to yield data, perform
IO actions, and
flush, as many times as you need, and with any interleaving desired.
There is one further optimization: many operating systems provide a sendfile
system call, which sends a file directly to a socket, bypassing a lot of the
memory copying inherent in more general I/O system calls. For that case, we
have a
ResponseFile.
Finally, there are some cases where we need to break out of the HTTP mode
entirely. Two examples are WebSockets, where we need to upgrade a half-duplex
HTTP connection to a full-duplex connection, and HTTPS proxying, which requires
our proxy server to establish a connection, and then become a dumb data
transport agent. For these cases, we have the
ResponseRaw constructor. Note
that not all WAI handlers can in fact support
ResponseRaw, though the most
commonly used handler, Warp, does provide this support.
Request Body
Like response bodies, we could theoretically use a lazy ByteString for request
bodies, but in practice we want to avoid lazy I/O. Instead, the request body is
represented with a
IO ByteString action (
ByteString here being a strict
ByteString). Note that this does not return the entire request body, but
rather just the next chunk of data. Once you’ve consumed the entire request
body, further calls to this action will return an empty ByteString.
Note that, unlike response bodies, we have no need for using
Builders on
the request side, since our purpose is purely for reading.
The request body could in theory contain any type of data, but the most common are URL encoded and multipart form data. The wai-extra package contains built-in support for parsing these in a memory-efficient manner.
Hello World
To demonstrate the simplicity of WAI, let’s look at a hello world example. In this example, we’re going to use the OverloadedStrings language extension to avoid explicitly packing string values into bytestrings.
{-# LANGUAGE OverloadedStrings #-} import Network.Wai import Network.HTTP.Types (status200) import Network.Wai.Handler.Warp (run) application _ respond = respond $ responseLBS status200 [("Content-Type", "text/plain")] "Hello World" main = run 3000 application
Lines 2 through 4 perform our imports. Warp is provided by the warp package,
and is the premiere WAI backend. WAI is also built on top of the http-types
package, which provides a number of datatypes and convenience values, including
status200.
First we define our application. Since we don’t care about the specific request
parameters, we ignore the first argument to the function, which contains the
request value. The second argument is our "send a response" function, which we
immediately use. The response value we send is built from a lazy ByteString
(thus
responseLBS), with status code 200 ("OK"), a text/plain content type,
and a body containing the words "Hello World". Pretty straight-forward.
Resource allocation
Let’s make this a little more interesting, and try to allocate a resource for
our response. We’ll create an
MVar in our
main function to track the number
of requests, and then hold that
MVar while sending each response.
{-# LANGUAGE OverloadedStrings #-} import Blaze.ByteString.Builder (fromByteString) import Blaze.ByteString.Builder.Char.Utf8 (fromShow) import Control.Concurrent.MVar import Data.Monoid ((<>)) import Network.HTTP.Types (status200) import Network.Wai import Network.Wai.Handler.Warp (run) application countRef _ respond = do modifyMVar countRef $ \count -> do let count' = count + 1 msg = fromByteString "You are visitor number: " <> fromShow count' responseReceived <- respond $ responseBuilder status200 [("Content-Type", "text/plain")] msg return (count', responseReceived) main = do visitorCount <- newMVar 0 run 3000 $ application visitorCount
This is where WAI’s continuation interface shines. We’re able to use the
standard
modifyMVar function to acquire the
MVar lock and send our
response. Note how we thread the
responseReceived value through, though we
never actually use the value for anything. It is merely witness to the fact
that we have, in fact, sent a response.
Notice also how we take advantage of
Builders in constructing our
msg
value. Instead of concatenating two
ByteStrings together directly, we
monoidally append two different
Builder values. The advantage to this is that
the results will end up being copied directly into the final output buffer,
instead of first being copied into a temporary
ByteString buffer to only
later be copied into the final buffer.
Streaming response
Let’s give our streaming interface a test as well:
{-# LANGUAGE OverloadedStrings #-} import Blaze.ByteString.Builder (fromByteString) import Control.Concurrent (threadDelay) import Network.HTTP.Types (status200) import Network.Wai import Network.Wai.Handler.Warp (run) application _ respond = respond $ responseStream status200 [("Content-Type", "text/plain")] $ \send flush -> do send $ fromByteString "Starting the response...\n" flush threadDelay 1000000 send $ fromByteString "All done!\n" main = run 3000 application
We use
responseStream, and our third argument is a function which takes our
"send a builder" and "flush the buffer" functions. Notice how we flush after
our first chunk of data, to make sure the client sees the data immediately.
However, there’s no need to flush at the end of a response. WAI requires that
the handler automatically flush at the end of a stream.
Middleware
In addition to allowing our applications to run on multiple backends without code changes, the WAI allows us another benefits: middleware. Middleware is essentially an application transformer, taking one application and returning another one.
Middleware components can be used to provide lots of services: cleaning up URLs, authentication, caching, JSON-P requests. But perhaps the most useful and most intuitive middleware is gzip compression. The middleware works very simply: it parses the request headers to determine if a client supports compression, and if so compresses the response body and adds the appropriate response header.
The great thing about middlewares is that they are unobtrusive. Let’s see how we would apply the gzip middleware to our hello world application.
{-# LANGUAGE OverloadedStrings #-} import Network.Wai import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.Gzip (gzip, def) import Network.HTTP.Types (status200) application _ respond = respond $ responseLBS status200 [("Content-Type", "text/plain")] "Hello World" main = run 3000 $ gzip def application
We added an import line to actually have access to the middleware, and then
simply applied gzip to our application. You can also chain together multiple
middlewares: a line such as
gzip False $ jsonp $ othermiddleware $
myapplication is perfectly valid. One word of warning: the order the
middleware is applied can be important. For example, jsonp needs to work on
uncompressed data, so if you apply it after you apply gzip, you’ll have
trouble. | http://www.yesodweb.com/book/web-application-interface | CC-MAIN-2014-49 | refinedweb | 1,911 | 55.74 |
Edge Browser xsl transform default output to html
Confirmed Issue #8401292 • Assigned to Travis L.
Steps to reproduce
xsltProcessor set xsl:output method default to html.
That is not right, see.
For testing load test-xsl.html in Edge.
In Firefox or Chrome it works correct.
Microsoft Edge Team
Changed Assigned To to “Brad E.”
I’ve looked over the repro sample you provided to us and as far as I can tell Chrome and Edge seem to report the exact same data, unless I am overlooking something.
Which of the three sections are you showing a discrepancy with between Chrome and Edge?
Thanks for the feedback.
Look at the first section “without xsl output” and you can see, that edge transform the “image” node to “img” with namespace xhtml.
See my picture chrome-edge.png.
Regards Jan
Microsoft Edge Team
Changed Assigned To to “Christian F.”
Changed Assigned To to “Rico M.”
Changed Assigned To to “Travis Title from “Edge Browser xsl transform default output to html” to “Edge Browser xsl transform default output to html”
You need to sign in to your Microsoft account to add a comment. | https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8401292/ | CC-MAIN-2018-51 | refinedweb | 190 | 75.91 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.