Thursday, July 30, 2009

Big Brother - Spying On Your Waste?

Greetings,

I was very interested to hear about the recent scheme of waste tracking which is being implemented by MIT, 3000 pieces of rubbish in London, Seattle and New York will be fitted with hi-tech tags which use mobile phone technology to send out a real time tracking signal. In effect this means that MIT will be able to watch exactly where the waste is moving to in real time.

The aim is to highlight exactly what happens to the waste we throw away and that it doesn't always end up where we think, sometimes it will even end up in a completely different country, where the approach to waste management is not as stringent and as such it can end up becoming a pollutant.

The BBC have written a quite extensive article about the technology behind the transmitters and what MIT are hoping to achieve in the lifetime of the project.

I think that projects like these are great tools to raise awareness of our throw-away lifestyle and that waste doesn't simply disappear when the bin man collects it.

Onwards & upwards!

Lucy.

Monday, July 27, 2009

Typical Characteristic of Operation Amplifier and Types of Feed Back Lecture Vedio

Typical Characteristic of Operation Amplifier Lecture Vedio




Four Types of Feed Back Lecture Vedio 1



Four Types of Feed Back Lecture Vedio 2




Mathematical Operations Lecture Vedio




Mathematical Operations 1 Lecture Vedio



Mathematical Operations 2 Lecture Vedio

Wednesday, July 22, 2009

Asp.Net Ajax Extender Control Tutorial

I built several Extender Control and Script Control in my provious posts within PainControls assembly, which you can download. You can search the resource about how to build extender control or script control on web. However, I'd still like to write something on it in my words. If you are interesting on that, you can check this article.

Microsoft ASP.Net Ajax Extensions enables you to expand the capabilities of an ASP.Net Web Application in order to create a rich client user experience. We can make use of ScriptControl or ExtenderControl to build a rich client behavior or web control. The difference between ExtenderControl and ScriptControl is that Extender is used on creating client script capabilities on an existing control, which is called "TargetControl" for this behavior, whereas ScriptControl is an absolute web control which contains rich client functionality. For example, when we'd like to build a ModalPopup which will pop out an existing Panel, show/hide functionality is the client script application, then we can build it as ExtenderControl. However, for ScriptControl, for instance, TabContainer which is the entirely new web control contains the client script functionality, so we can build it as ScriptControl.

1. To encapsulate the client behavior for use by ASP.NET page developers, you can use an extender control. An extender control is a Web server control that inherits the ExtenderControl abstract class in the System.Web.UI namespace.
Extender control is used for client script functionality extension of an existing web control. It can be applied to specific Web server control types. You identify the types of Web server controls to which an extender control can be applied by using the TargetControlTypeAttribute attribute.
(The sample code as below is according to the TimePicker which is from http://vincexu.blogspot.com/2009/07/ajax-timepickerclockpicker-control.html)

[TargetControlType(typeof(Control))]
public class TimePicker: ExtenderControl

2. The following two methods of the ExtenderControl abstract class that you must implement in an extender control.

protected override IEnumerable GetScriptDescriptors(Control targetControl)
{
ScriptControlDescriptor descriptor = new ScriptControlDescriptor("PainControls.TimePicker", targetControl.ClientID);
descriptor.AddElementProperty("errorSpan", this.NamingContainer.FindControl(ErrorPresentControlID).ClientID);
descriptor.AddProperty("timeType", TimeType);
descriptor.AddEvent("showing", OnClientShowing);
yield return descriptor;

}
protected override IEnumerable GetScriptReferences()

{
yield return new ScriptReference(Page.ClientScript.GetWebResourceUrl(this.GetType(), "PainControls.TimePicker.TimePicker.js"));
}

3. Embed Css reference in PreRender phase.

private void RenderCssReference()
{
string cssUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "PainControls.TimePicker.TimePicker.css");
HtmlLink link = new HtmlLink();

link.Href = cssUrl;
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
Page.Header.Controls.Add(link);
}

4. Set all resources(contain images, css file and js file) embedded in this extender control as "Embedded Resource"(property "Build Action").

5. This extender control can derive from IExtenderControl interface and a server control, instead of ExtenderControl if you'd like to.

The control can derive from other server controls if you want to make it inherit a server control than ExtenderControl. In this scenario, it should derive from IExtenderControl interface and a server control class. Meanwhile, we have another three steps need to do:
1) Define TargetControl property
2) Override OnPreRender method. Register the web control as the ExtenerControl in OnPreRender phase.
ScriptManager manager = ScriptManager.GetCurrent(this.Page);
if (manager == null)
{
throw new InvalidOperationException("A ScriptManager is required on the page.");
}
manager.RegisterExtenderControl(this);
3) Override Render method. Register the script descriptor which has been defined.
ScriptManager.GetCurrent(this.Page).RegisterScriptDescriptors(this);

6. The rest work is on client-side. Register client NameSpace first.

Type.registerNamespace("PainControls");

7. Build client class.

PainControls.TimePicker = function(element)
{
}
PainControls.TimePicker.prototype = {
}


8. Register the class that inherits "Sys.UI.Behavior".

PainControls.TimePicker.registerClass('PainControls.TimePicker', Sys.UI.Behavior);

9. Call base method in constructor method

PainControls.TimePicker.initializeBase(this, [element]);

10. Implementing the Initialize and Dispose Methods.
Build "initialize" and "dispose" method in prototype of the class. The initialize method is called when an instance of the behavior is created. Use this method to set default property values, to create function delegates, and to add delegates as event handlers. The dispose method is called when an instance of the behavior is no longer used on the page and is removed. Use this method to free any resources that are no longer required for the behavior, such as DOM event handlers.

initialize: function() {
PainControls.TimePicker.callBaseMethod(this, 'initialize');
},
dispose: function() {

PainControls.TimePicker.callBaseMethod(this, 'dispose');
}

11. Defining the Property Get and Set Methods.
Each property identified in the ScriptDescriptor object of the extender control's GetScriptDescriptors(Control) method must have corresponding client accessors. The client property accessors are defined as get_<:property> and set_<:property> methods of the client class prototype.

get_timeType: function() {
return this._timeType;
},
set_timeType: function(val) {

if (this._timeType !== val) {
this._timeType = val;
this.raisePropertyChanged('timeType');
}
},

12. Defining the Event Handlers for the DOM Element
1) Defining the handler in constructor function:
this._element_focusHandler = null;
2) Associate the handler with the DOM Element event in initailize method:
this._element_focusHandler = Function.createDelegate(this, this._element_onfocus);
3) Add the handler in initailize method:
$addHandler(this.get_element(), 'focus', this._element_focusHandler)
4) Build callback method about this event:
_element_onfocus:function(){
}


13. Defining the Event Handlers for the behavior
Each event identified in the ScriptDescriptor object of the extender control's GetScriptDescriptors(Control) method must have corresponding client accessors. The client event accessors are defined as add_<:event> and remove_<:event> methods of the client class prototype. The method Raise<:event> is defined to trigger the event.

add_showing: function(handler) {
this.get_events().addHandler("showing", handler);
},
remove_showing: function(handler) {
this.get_events().removeHandler("showing", handler);

},
raiseShowing: function(eventArgs) {
var handler = this.get_events().getHandler('showing');

if (handler) {
handler(this, eventArgs);
}
},

14. Use this extender control TimePicker in page.
1) Register the assembly in page.


<%@ Register TagPrefix="PainControls" Assembly="PainControls" Namespace="PainControls" %>


2) Add a ScriptManager control in page, and create TimePicker control to bind on a TextBox.


<asp:textbox id="TextBox1" runat="server" text=""></asp:textbox>
<PainControls:timepicker id="t1" runat="server" targetcontrolid="TextBox1" timetype="H24">

Tuesday, July 21, 2009

South Korea Advocates Environmental Improvement

Greetings,

Some good news from the east, South Korean giant Samsung Electronics has just committed to investing $4Bn to reducing carbon emissions from its manufacturing plants, with the aim of reducing their carbon emissions by 50% by 2013.

This announcement follows on from a statement released by the South Korean government about their $84Bn Green Action Plan. This scheme is aiming to make improvements across the entire national infrastructure including manufacturing, transportation, construction & technology.

It's very reassuring to see one of the world's top ten carbon producers making such a commitment to reduce their emissions.

Onwards & upwards!

Lucy.

Thursday, July 16, 2009

AjaxControlToolkit ComboBox not showing in TabContainer

We have been refered that combobox is not appearing in ModalPopup: http://vincexu.blogspot.com/2009/05/ajaxcontroltoolkit-combobox-not.html

But somebody found that it also will pop out script error on the line b.width=c+"px" if combobox is in the TabPanel which is not the default active panel in tabcontainer.

For example, we have 2 combobox controls, one is in the TabPanel1, and the other is in TabPanel2. TabPanel1 is the default active tabPanel. After initialized, it will pop out the error, then combobox1 in tabpanel1 is displaying, but combobox2 not.

Check the following sample about it.


<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" Height="228px"
Width="400px">
<ajaxToolkit:TabPanel ID="tabpane1" runat="server" HeaderText="tab1">
<ContentTemplate>
<ajaxToolkit:ComboBox runat="server" ID="ComboBox1" MaxLength="100" AutoCompleteMode="Suggest">
<asp:ListItem Text="ABC" Value="ABC"></asp:ListItem>
<asp:ListItem Text="XYZ" Value="XYZ"></asp:ListItem>
</ajaxToolkit:ComboBox>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Tab2">
<ContentTemplate>
<ajaxToolkit:ComboBox runat="server" ID="ComboBox2" MaxLength="100" AutoCompleteMode="Suggest">
<asp:ListItem Text="ABC" Value="ABC"></asp:ListItem>
<asp:ListItem Text="XYZ" Value="XYZ"></asp:ListItem>
</ajaxToolkit:ComboBox>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>

(You can try this sample. Because Combobox2 is in the TabPanel2, which is an inactive panel, it will pop out the error and it will make Combobox2 off.)

This issue is attributable to the tabpanel which is not active is invisible, combobox can't get the correct offsetHeight and offsetWidth any more.

So, the approach to resolve it is setting the TabPanel2 to be visible so that combobox can create in gear.
Combobox will be created in initialized phase. So we have to set TabPanel2 to be visible before combobox creates and set it back in pageLoad phase.


<script type="text/javascript">
$get('<%=TabPanel2.ClientID %>').style.visibility = "visible";
$get('<%=TabPanel2.ClientID %>').style.display = "block";

function pageLoad() {
$get('<%=TabPanel2.ClientID %>').style.visibility = "hidden";
$get('<%=TabPanel2.ClientID %>').style.display = "none";
}

</script>


Put the above script after document body and form content. It will let Combobox1 and combobox2 showing according to he above HTML sample.

Cheer.

Ajax TimePicker/ClockPicker control

Hi,

Last time I made a Custom DropDown. Please check the following image about this Ajax control.


Blog link: http://vincexu.blogspot.com/2009/06/about-ajaxcontroltoolkit-combobox.html

It introduces how to build a DropDown/ComboBox by Asp.Net Ajax ScriptControl. You can download this control in above link.


I made a TimePicker/ClockPicker this time, hope it can help you. See the following image about this ajax TimePicker.



You can drag the hour/minute pointer to select a time. It supports 12h and 24h format.

You can download from:


(PainControls contain dropdown and timepicker so far)


If you'd like to use this ajax control, please check the below:


1.Add the reference PainControls.dll, and check the sample code as below.


<asp:TextBox ID="TextBox1" Text="" runat="server"></asp:TextBox> <Pain:TimePicker runat="server" ID="t1" TargetControlID="TextBox1" TimeType="H24" />
Properties:
TargetControl: which TextBox(only TextBox) is bound on TimePicker
TimeType: H24/H12 -- Time format
ErrorPrensentControlID: the control can display the time validation information. You can assign it as some span or label to bind on it.
And there are several client Events you can use:
OnClientShowing : client showing event
OnClientShown : client shown event
OnClientHiding: client hiding event
OnClientHidden: client hidden event
OnClientHourSelectionChanged: it triggers when you select new hour value by mouse. It will trigger when mouse up.
OnClientMinuteSelectionChanged: it triggers when you select new minute value by mouse. It will trigger when mouse up.
2. You need use FrameWork 3.5 sp1 to support this control. (You can recompile the files if you want to use in FrameWork 2.0)
3. Don't forget adding a ScriptManager control in the page.
4. If you want to set a default Time for TimePicker, please set a default value in TextBox. It will reset the time according to the value of TextBox bound.

Wednesday, July 15, 2009

Recycling in Manchester, MA.

Greetings,

I was very interested to see what's been happening 'across the pond' in Manchester, Massachusetts. I certainly makes for some interesting parallels with what the latest developments are here in the UK!

They are currently planning a move onto a pay-as-you-throw scheme as the statistics from Gloucester MA show a 13% increase in recycling rates and a 29% reduction in waste incineration since implementation of a similar scheme. Interestingly if these rates could be duplicated in Manchester MA, they could recoup as much as 35% of its spend on disposal through onward sale of recyclates.

Other developments in Manchester MA include the introduction of a single stream recycling scheme, which they hope will help to increase participation and subsequently total recycling rates for the town, as well as reducing the total cost of disposal by as much as $135,000 a year. Across the 5 year scheme they are projecting to make a total saving of $600,000 after costs.

It certainly makes for interesting comparison with recent developments here in Manchester UK. Especially after the announcment of the deal between GMWDA and Viridor Laing to build a series of facilities in Greater Manchester, it seems almost inevitable that the majority, if not all of Manchester will also move towards a single stream recycling system in the not too distant future.

Looks like we have more in common with our US cousins than you might think!

Onwards & upwards!

Lucy.

Monday, July 13, 2009

One Motor Walker Robot Without uC

Walker Robot Without uC
Robot is interesting electronic project. We often see that robot project need a microcontroller as main processor. But if you don't have any programming skill yet, don't worry, you can build one motor walker robot by Jerome Demers. Yes the it's a walker robot without a microcontroller. The robot is base on the principal of B.E.A.M robotics! Building simple and elegant robot inspired by insect.

See the robot in action



via circuitlake

One Motor Walker Robot Without uC

Walker Robot Without uC
Robot is interesting electronic project. We often see that robot project need a microcontroller as main processor. But if you don't have any programming skill yet, don't worry, you can build one motor walker robot by Jerome Demers. Yes the it's a walker robot without a microcontroller. The robot is base on the principal of B.E.A.M robotics! Building simple and elegant robot inspired by insect.

See the robot in action



via circuitlake

One Motor Walker Robot Without uC

Walker Robot Without uC
Robot is interesting electronic project. We often see that robot project need a microcontroller as main processor. But if you don't have any programming skill yet, don't worry, you can build one motor walker robot by Jerome Demers. Yes the it's a walker robot without a microcontroller. The robot is base on the principal of B.E.A.M robotics! Building simple and elegant robot inspired by insect.

See the robot in action



via circuitlake

Transistor Biasing, Frequency Analysis and Amplifer Lecture Vedio

Transmission of Analog Signal – II Lecture Vedio




Transistor Biasing Lecture Vedio




Basic Characteristic of an Amplifer Lecture Vedio




Hybrid Equivalent Circuit, H-Parameters Lecture Vedio



Circuit Analysis using H-Parameters Lecture Vedio




Frequency Analysis Vedio

Frequency Response of Amplifiers Lecture Vedio




Frequency Analysis Lecture Vedio



Amplifiers Lecture Vedio

Power Amplifiers Lecture Vedio




Differential Amplifiers CKT Lecture Vedio

Friday, July 10, 2009

Best Eco Adverts To Save The Planet!

Greetings,

Apologies for the blatant recycling (pardon the pun!) of someone elses blog post, but just I had a quick look at Materials Recycling Week's latest blog post which linked to a Guardian picture story about 'The Best Adverts to Save the Planet'.

Let me know which you think is the most effective.

Onwards & upwards!

Lucy.

Sunday, July 5, 2009

Basic Diodes Lecture Vedio

Semi Conductor Diodes Lecture Vedio



Applications of Diodes Lecture Vedio



Wave Shaping using Diodes Lecture Vedio



Zener Diode Characteristics Lecture Vedio

Friday, July 3, 2009

NING - Recycling In Manchester

Hi folks,

Just a quick post to inform you that I've set up a NING social network called: Recycling In Manchester. Please feel free to join and offer your input, I'd love to see this really take off as a hub for like minded people to discuss how we can make a real difference in Manchester.

Onwards & upwards!

Lucy.