16 November 2008
This is just a trivial performance issue that I was curious about.
ASP .NET is known for bloated HTML page sizes. There are a number of reasons for this, all of which can be solved:
- Lengthy ids generated for dynamic elements (e.g. MyFunkyUserControl_8_MySwankyRepeater_ASmellyTextbox)
- Lengthy ids repeated in the name attribute
- Long javascript function names, (e.g. WebForm_GetElementById)
- Viewstate
If you are storing a lot of information in viewstate, you may be wondering if the size of the key itself
contributes to the size of ViewState.
ViewState["MyVeryLongKeyName"] = myValue;
ViewState["MVLN"] = myValue;
Does the shortened key name decrease the size of the HTML being sent across
the tubes (at the expense of code readability)? Whilst this may seem trivial, it can make a difference if you are appending unique identifiers, dates etc. to the
end of the key.
Answer
The answer, is yes - it does. A key of 20 characters will weigh more than 20 times a key of 1 character
(I guess the weight increases even further because of the hashing algorithm).
Should I bother?
If you are creating very large forms, with lots of data stored in ViewState, then you can probably look into
reducing the size of your ViewState keys - but only after you have reduced the size of control ids, limited the
amount of data being stored in ViewState and turned on GZipping.
My take on a custom paging control
12 November 2008
Download Control
There are plenty of custom pagers available on the web, but I never felt any of them were quite what I wanted.
This is what I was looking for:
- Clean, valid html (no tables), with enough hooks to style the control however I pleased
- Ability to include the page number in the querystring, so users can bookmark the page
- Alternative mode that uses postback, so that other form data is retained when paging through records
- Independence from repeaters, data grids, grid views, trees, data sources etc. I want to be able to add the paging
control to anything I want.
Download
Current release (v0.5)
The current release is written for C# 3.0. Let me know and I will put together a C# 2 version if anyone wants.
Documentation
More extensive documentation will be provided if this control generates interest. Until then, check out
the demonstration and usage examples.
12 October 2008
Introduction
At the start of 2008, along with many other young men of similar temperament, spurned by a familiar tight gastric fear,
I was momentarily caught up in the fervour of wanting to do something to stop global warming.
Somehow I overcame my usual cynicism and laziness, and the result was this energy use audit of my office.
I have chosen to make this public as I know there are many other people who would like to do something similar for their
own work place. Please enjoy.
The name of the company has been replaced with CompanyX but otherwise the report is presented in the same way that it was presented
to staff.
Contents
Overview - co2 emissions per year in tonnes
Average inner-suburbian Melbournian
US emissions per person
20
Company air conditioner
18-19
Australia's emissions per person (2004)
16 - 18
Recommended emissions per Australian
(2020)**
11-13
Japan, UK, Germany's emissions per person (2004)
10
China's emissions per person
4 - 5
Recommended emissions per Australian
(2050)**
1.6-6.5
CompanyX Coca-cola fridge
2.8
Brazil's emissions per person
1.8
Ghana's emissions per person
0.33
CompanyX - Reasonably Good Environmental Record
- Very efficient internal systems resulting in high sales to emissions ratio
- Knowledgable and sensible staff
- Carbon offset programme
- Little necessity for interstate or overseas trips
- Reasonably low paper and stationary use
- Reasonably central location
- Facilities for staff to work from home
- Access to local market
Recommendations
Summary
The following categories have the greatest potential for reducing emissions at a low cost:
- Air conditioning
- Lighting
- Computing
- Appliances left running 24/7
There is a potential to save between 30 and 50 tonnes of co2 each year at CompanyX,
just by cutting back wastage.
Within these four categories there is a potential to save between 30 and 50 tonnes of co2 per year
at CompanyX's Melbourne office, just by cutting back wastage. Approximately equivalent to every employee
becoming a bike rider.
Whilst recycling could be better at CompanyX, it is comparatively less effective in reducing emissions than
the above mentioned categories. The same can be said for various other actions such as dishwasher and paper use.
Most effective recommendations
Over air conditioning causes increase in spread of colds and flu, dehydration and obesity.
Run the air conditioner from 8:00am - 5:00pm, instead of until 7:00pm.
Cost:
$0, or $40 for two personal heater/fans
Savings:
3.3 tonnes co2 per year
Objections:
- "On extreme temperature days, people staying back late may get too cold or too hot."
- Buy one or two small personal heater/fan (combo unit) for people staying back late.
Justifications:
- Reducing the air conditioner for just 1 hour a day is more effective than most of the other recommendations in this report.
- Most people leave the office at 5:30pm. There is no reason to continue to air condition the office for over twenty people
when there are only a few people remaining.
Provide clear map of light switches and appliances that should be turned off at night. Stick map on door.
Cost:
$0
Savings:
2.6 tonnes co2 per year
Objections:
- "Some appliances are difficult to turn on or off."
- Use the label maker to explain how to turn them on or off.
Justifications:
- Many people neglect to turn off lights or appliances because they can't find the switch.
Effects of over illumination include headaches, fatigue, stress,
decrease in sexual function and anxiety.
Reduce lighting in office. 5 to 10 pairs of cathode lights can easily be removed.
Cost:
$0
Savings:
1.7-3.4 tonnes co2 per year
Justifications:
- In areas of the office, up to 5 lights are being used to service 1 person.
Ideally this should be closer to 1 light per person, although this is may be unrealistic given there is
no natural light. Cutting lights by 10%-20% seems like a good start.
- Surveyed staff agree the office is too bright.
Turn off coffee machine at night and on weekends.
Cost:
$0, or $15 for a timer
Savings:
2.4 tonnes co2 per year
Objections:
- I have contacted the manufacturer and they have assured me that it is ok to turn the machine off at night.
- "Someone might forget to turn the machine on in the morning, and everyone will have to wait 20 minutes for their coffee."
- A timer can be set to turn the machine on at 7:30am. This can also turn it off
at 6:00pm, so that noone has to remember to turn it off.
Justifications:
- The water does not need to be kept hot all night and all weekend.
Install timer on drinks fridge to turn off at night and on weekends.
Cost:
$15 for a timer
Savings:
1.8 tonnes co2 per year
Justifications:
- Soft drinks do not have to stay cold to last a long time.
Cost:
$15 extra per light
Savings:
4.2 tonnes co2 per year once all replaced
Tune PCs to run in their lowest power modes. This involves:
- Monitor brightness set at 75% (this is better for your eyes than 100%)
- Screens power off after 5-10 minutes (no screensaver)
- Hard drives power down after 10 minutes
Cost:
$0
Savings:
770kg co2 per year
Remove light from drinks fridge.
Cost:
$0
Savings:
440kg co2 per year
Justifications:
- The light's only purpose is to advertise the soft drinks, which has no benefit for CompanyX.
Keep board room lights off at all times unless someone is using it.
Cost:
$0
Savings:
Assuming turned off for 40 hours more each week: 600kg co2 per year
Provide incentives for riders, public transport users and car poolers, especially secure bicycle parking.
Cost:
Depends
Savings:
The table below shows savings per year after switching to riding, public transport or car pools
one day a week.
| Km from home->work |
Light Motorbike |
Efficient small car / hybrid (4.2l/100km) |
Small car (8.15l/100km) |
Efficient medium-sized car (9.25l/100km) |
| 10km |
115 kg |
120 kg |
240 kg |
270 kg |
| 15km |
170 kg |
180 kg |
360 kg |
405 kg |
| 20km |
225 kg |
245 kg |
490 kg |
540 kg |
| 30km |
340 kg |
365 kg |
730 kg |
810 kg |
A non-driver living 15km from work saves 1.2 tonnes of co2 per year over a small car driver,
not including co2 cost of manufacturing a car.
If 300km less was driven in small cars each week the savings would be 1.8 tonnes of co2 per year.
Justifications:
- Because CompanyX currently provides some car parking, drivers are effectively being subsidized whereas
there is no incentive to ride or take public transport.
- The bicycle is usually faster than the car for trips up to 15km heading in and out of the CBD.
- CompanyX appears to be above the state average and far above the CBD average for car usage.
Easier access to recycling.
Cost:
Approx $180 for 10 good recycle bins
Savings:
100kg co2 per year
Objections:
- "It could be extra trouble for the cleaners to empty recycling bins."
- The cleaners are actually taking plastic bottles out of the normal rubbish bins
and putting them into recycling. So having separate bins should reduce work for the cleaners.
- "Recycle bins cost co2 to manufacture."
- These recycling bins look professional, are Australian made, are made from 40% recycled materials:
http://www.papertopaper.com.au/site/index.php?pID=123.
Justifications:
- Many papers, bottles and coffee cups are not recycled simply because people do not have easy access to a recycle bin.
Buy less soft drink and instead buy 2 litre bottles of Victorian fruit juice.
Cost:
$0
Savings:
Assuming, each week two 2 litres bottles of fruit juice instead of 10 coca-cola bottles: 30kg co2 per year
Objections:
- "Some people need a sugar-hit half way through the day and fruit juice just doesn't cut it."
- Put two spoonfuls of sugar into a glass of fruit juice
Justifications:
- Coca-cola bottles are shipped 8000km from China to Sydney. They are filled in Sydney and then transported by truck
900km to Melbourne. Coca-cola provides few essential nourishments, and is damaging to the human body.
Most of the money spent on Coca-cola goes towards the Chinese and US economies and very little is returned to the Australian
economy.
- Victorian fruit juice is grown in Victoria and transported by truck less than 300km. Fruit juice is available at the market
in glass and plastic bottles recycled within 100km of Melbourne. Fruit juice is highly beneficial to the human body and provides
essential nourishment. Almost 100% of the money spent on Victorian fruit juice goes towards the Victorian economy, which
indirectly benefits the finances of all Victorians.
Buy recycled paper for the toilet instead of plantation paper. The brand should be endorsed by a well known environmental
company as toilet paper companies cannot be trusted.
Cost:
About $50 a year
Savings:
31kg co2 per year
Objections:
- "Recycled paper is not soft enough for some people."
- Buy a few rolls of soft paper for sensitive assholes.
Place paper limits on printer.
Cost:
$0
Savings:
20kg co2 per year
Justifications:
- Reducing is the better than recycling and reusing.
- Added benefit of creating a tidier office.
Recommendations for staff (for those interested)
Turn your computer off at the wall once it has shutdown (particularly on Friday night).
Cost:
$0
Savings:
250kg co2 per year for each computer turned off at the wall on nights
and weekends. If everyone in the office did this, total savings would be 6.6 tonnes co2 per year.
Turn off chargers (mobile phones, laptops, iPods etc) when they are finished charging
Cost:
$0
Savings:
8kg-60kg co2 per year per charger
Print double-sided if possible. The Kyocera cafe wall printer can print double sided. Click "Preferences" before printing
and you will see the double-sided option.
Cost:
$0
Savings:
31 kg co2 per year
More wealth does not mean more environmentally friendly.
"Why are inner-suburbian Melbournian's some of the worst polluters in the world?"
Those living in the inner suburbs already save between 1 and 3 tonnes of co2 each year because they tend to drive
less and for shorter distances. However, the amount of greenhouse emissions is still much higher than the average
Australian. The reasons for this are:
- Smaller and more transient households
- Inner suburbians have higher incomes. Richer people tend to:
- Eat more beef
- Renovate more
- Own and use more electronic appliances
- Fly more
- Buy more things
- Waste more
- Less likely to own or properly maintain a garden. Good gardens act as carbon sinks, resulting in negative co2
emissions.
- Victoria is the only Australian state whose main source of power is brown coal, which is more polluting than black coal.
Notice the fallacy in thinking that being environmentally friendly requires wealth. This is simply not true, both
at a personal and national level. Countries with more wealth or strong economies are almost always bigger polluters than
countries with less wealth or weaker economies. Generalizing from statistics, the richer you are, the more of a burden you are on the
world's natural environment.
Controversial recommendations
Don't let the Japanese make us look like a bunch of conservative pussies.
Increase/decrease air conditioner by 1-4 degrees. Dress more appropriately if necessary.
Turn off air conditioner entirely during mild months (e.g. April, May and September)
Cost:
$0
Savings:
Up to 10 tonnes co2 per year
Justifications:
- Since 2005, the Japanese government has run their "Cool-Biz" campaign that has recommended setting
air conditioners at 27 degrees during summer and 20 degrees during winter. Prime Minister Junichiro
appeared in parliament all summer without a tie. Considering that governments tend to be quite conservative in
their recommendations, 27 degrees/20 degrees seems like a fair temperature.
When purchasing office equipment and computers, consider purchasing secondhand. Conversly, make sure that
all unused office equipment is recycled effectively (preferably by selling or giving to charity). Refuse to buy
anything not Energy Star rated (or equivalent).
Cost:
$0
Savings:
Most electronic items cost between 5 and 20 times their own weight in chemicals and fossile fuels to manufacture.
On average, carbon emissions are equal to approximately half of the weight in raw materials. Therefore, a 24kg desktop computer
with monitor may emit around 120kg co2 during the manufacturing process.
Aim to continue to cut emissions - do not implement business requirements that increase emissions, such as requirements for air travel.
Change to renewable energy.
Cost:
Quite expensive
Savings:
Close to 100% of energy use emissions - or about 80% of entire office emissions.
Justifications:
- This has a silver bullet effect, in that many of the above recommendations are no longer necessary, or rather they
become purely money-saving endeavours. In terms of time and effort, all that is required is one phone call.
Continue funding carbon offset schemes. Rainforest protection schemes can be more effective than tree planting schemes.
Justifications:
- Accredited carbon offset programmes are effective in reducing carbon emissions, so carbon offset
schemes can be considered a good thing.
- Rainforest protection schemes can be more effective at offsetting carbon because dense
ancient rainforest creates a much greater carbon sink than plantations. Also it is generally less energy intensive to
protect existing rainforest than to plant new ones. It also helps saves endangered plants and animals from extinction.
The schemes will buy up land, but you should make sure that the land they are buying is actually threatened by loggers
and that they are protecting it adequately. Organisations such as Rainforest Rescue
offer opportunities that are easily marketed such as "Save a hectare of the Daintree".
Quiz
Is turning your computer off at night bad for the computer?
Yes
No
No
This is an urban myth. Constantly powering off and on may have been a little bit bad for
computers older than 15 years, but this is not true anymore.
Is turning your computer off at the wall a problem?
Yes
No
No
Two monitors and a computer can consume about the same energy as a fluorescent light bulb even when
they are turned off. Turning the entire board off at the wall once a day will not significantly reduce the life of the computer or monitors.
Is running a screensaver good for the computer or monitor?
Yes
No
No
Running a screensaver is of no benefit to your monitor unless your monitor was purchased more than 15
years ago.
Unless the screensaver is a black screen, running a screensaver probably uses the same or more energy than just leaving
your screen turned on normally.
Turning a light off and on again causes a surge in power that is equivalent to leaving the light
on for how long?
An hour
20 mins
Less than 5 seconds
Less than 5 seconds
There is a slight surge in power usage but for most light bulbs this is equivalent to less than a few seconds
of usage. The same applies in principal to most other appliances, except those that have to generate a lot of heat/cold
(e.g. refridgerators, the coffee machine etc).
On the other hand, modern fluorescents (CLFs) and other appliances can wear out more quickly if you turn them on and off
a lot, so it's generally not recommended to turn them off if you are coming back in less than 15 minutes. Incandescent lights
do not have this problem, so you should always turn them off.
Australians use a lot of energy, but at the same time we are very productive country. True or false?
True
False
False
Whilst Australians are in the top 10 worst greenhouse emitters per capita, they rank about 74th in the list of
GDP vs greenhouse emissions. We are beaten by both first and third world countries, including Rwanda, Spain, Peru, New Zealand and Italy.
(The US is 75th).
Australia has little or no impact on the world so it is not worthwhile bothering to make a change.
True
False
False
With a population of only 20 million, Australia manages to produce the same or more greenhouse emissions than:
- Greater Tokyo (population: 35 million)
- Poland (population: 38 million)
- Turkey (population: 70 million)
- Pakistan (population: 160 million)
Overall, Australia is the 19th worst emitting country in the world.
In addition, Australia is a very vulnerable country and will be one of the first and hardest hit by the effects
of climate change.
How many times more co
2 is emitted to produce beef as the same weight in vegetables.
x2
x4
x10
x60
More than 60 times
In 2006 scientists predicted the Arctic would have ice-free summers by 2040. A year later, in December 2007,
this estimate was changed. When is the Artic likely to experience its first ice-free summer?
2013
2020
2030
2013
Last year enough ice melted in the Arctic to cover the state of Washington in water half-a-mile deep. For the first time
ever ships could sail through the Northwest passage. 6000 walrus refugees came ashore in Alaska.
- All costs and savings are rough estimates meant to give a general means for comparing the effectiveness of
implementing recommendations. Almost every figure given is a conservative estimate - that is, stated emission are
probably lower than in actuality. Figures given in tonnes have been rounded down, not up.
- Carbon dioxide is the only greenhouse gas for which figures are given.
In most cases, carbon dioxide is adequate for comparing overall greenhouse emissions (aeroplane flights are a notable
exceptions).
- The dollar costs given for some recommendations do not include cost savings. Most recommendations will save money over the
long term.
- The ratio of co2 emissions to kWh for Victoria is approximately 1.444.*
- People are assumed to be in the office 61-66 hours per week, and out of the office for 102-113 hours per week.
Let's eat only native Australian food for a month
28 September 2008
I'm planning to only eat native food for dinner for a month! It'll be just like
Super Size Me, but with Australian flora and fauna, and probably not as funny.
Here are the rules:
- Every edible ingredient in the dishes must be native: that means no olive oil, no European wheat, no black pepper,
no dairy squeezed from a cow.
- No repeating any recipes and eating a wide variety of tasty meals.
- No eating anything that is harvested in a dangerously unsustainable manner (so nothing endangered... unless it's really tasty).
By association, my girlfriend will also be participating. She's not as excited as me.
Why eat Native Food
As Australia's precious, million year old soil rapidly washes away into the ocean, leaving a salty, poisonous landscape, there has
been widespread ringing of hands and shaking of heads. This silly display has intensified to a frenzy over the last decade as farmers
struggle to make a buck across the south east of Australia.
I was inspired by Prof Michael Archer and Bob Beale's
Going Native which is an indictment of the collective
silliness of Australia's agriculture, industry, lifestyle and culture.
Archer and Beale's line goes like this:
- to secure our food source, we must rescue the soil from the rising salty ground water
- to save the soil, we must save the plants and animals that adapted to that soil over millions of years.
- to save the plants and animals, it pays to make an industry out of them – eat them, hunt them, keep them as pets,
burn their land etc. etc.
I would personally add that moving away from sheep, cow and pig is critical for mitigating carbon emissions; but it is true that
salinity is probably a greater and more immediate problem for Australia than climate change.
To invoke the spirit of the long dead Aussie colonial, who would enjoy a tender, coal grilled carpet snake any day over a limp,
rubbery four-n-twenty, I ordered a copy of The Antipodean Cookery Book and kitchen companion (Mina Rawson) published in 1897, from
vintagecookbooks.com.au.
This book is filled with so much greatness you wouldn't believe, so I'll being quoting from it enthusiastically as I attempt various
meals from it. I hope you can join me.
Wombat steamer, here I come, baby.