Gray_code_element
Monday, October 26, 2009
Parsing XML in Visual Basic
Once I recieve the XML from a REST web servce, I need to be able to extract the useful information about of the XML document. Some useful links along that line are:
Sunday, October 25, 2009
Calling a REST Service from VB
I did not have much luck calling the Yahoo REST service, so I created my own web service using the MyEclipse tutorial and tested it out. The VB code to call the REST service is as follows:
Now the next challange is to get the Microsoft XML parser working.
Sub Macro1()
url = "http://jjh.virtual.vps-host.net:8080/restdemo/services/customers/0"
Dim HttpReq As Object
Set HttpReq = New WinHttpRequest
HttpReq.Open "GET", url, False
'or use GET instead of POST
HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
HttpReq.send
'HttpReq.send postmydata
'Note - if using GET set postmydata to ""
MsgBox (HttpReq.responseText)
End Sub
Now the next challange is to get the Microsoft XML parser working.
Thursday, October 22, 2009
How to Post and Get from HTTP using VB6
Thanks to some help from Doc's Coding, I was able to get Microsoft Excel 2000 to do a GET request.
I had to add a reference by going to Tools|Reference, then select Microsoft winhttp service version 5.1
Then I added the following code:
Now that I have the basic GET working, the next challange is to make a Yahoo! Web Service REST Call
I had to add a reference by going to Tools|Reference, then select Microsoft winhttp service version 5.1
Then I added the following code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 22/10/2009 by John Hufnagel
'
url = "http://www.google.ca/"
postmydata = "variable=data&variable2=data2"
Dim HttpReq As Object
Set HttpReq = New WinHttpRequest
HttpReq.Open "POST", url, False
'or use GET instead of POST
HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
HttpReq.send postmydata
'Note - if using GET set postmydata to ""
MsgBox (HttpReq.responseText)
End Sub
Now that I have the basic GET working, the next challange is to make a Yahoo! Web Service REST Call
Friday, October 16, 2009
Are Upper and Lower control limits the same as tolerances
I was teaching about Statistical Process Control (SPC) and control charts today and a student asked an interesting question: Are the upper and lower control limit the same as the design tolerances on a manufactured part?
The answer is that they are not the same: the upper and lower control limit are based on the statistical information obtained from observing the process, while the design tolerances are what the designer wants to achieve.
This leads to the next question: what is the relationship between tolerances and upper and lower control limits? This hits on the core philosophy behind SPC. Traditionally people like to inspect quality into a part. To do this, every piece must be inspected and the rejects discarded - there is no thought put into the process that created these rejects. It can be a lot of cost and time to inspecting every part. In some ways it is easy to image every manufactured part being inspected, but what about services? Quality is also important in service. How can each service be inspected before it is delivered? Lets say the service is a bank teller. It is completely unfeasible for a third person to inspect every thing the teller is doing before the service is actually rendered to the customer.
This is where SPC comes in. SPC is not about inspecting every single part to see whether or not they are in tolerance, rather SPC is about monitoring the process and improving the process so that the process will automatically provide the desired quality. In other words, with SPC the process can be improved so that the upper and lower control limits fall within the desired tolerance.
This is a radically different way to look at manufacturing and servicing processes. With the old way of inspecting every part, people continually work in fear about ever making a mistake. The fear of an error is the predominate thought on their mind.
With an SPC controlled system, the focus is on trying to understand the process, where there is potential errors or defect (deviations from the desired outcome), and improving the process so the desired outcome can be achieved more predicatably.
The answer is that they are not the same: the upper and lower control limit are based on the statistical information obtained from observing the process, while the design tolerances are what the designer wants to achieve.
This leads to the next question: what is the relationship between tolerances and upper and lower control limits? This hits on the core philosophy behind SPC. Traditionally people like to inspect quality into a part. To do this, every piece must be inspected and the rejects discarded - there is no thought put into the process that created these rejects. It can be a lot of cost and time to inspecting every part. In some ways it is easy to image every manufactured part being inspected, but what about services? Quality is also important in service. How can each service be inspected before it is delivered? Lets say the service is a bank teller. It is completely unfeasible for a third person to inspect every thing the teller is doing before the service is actually rendered to the customer.
This is where SPC comes in. SPC is not about inspecting every single part to see whether or not they are in tolerance, rather SPC is about monitoring the process and improving the process so that the process will automatically provide the desired quality. In other words, with SPC the process can be improved so that the upper and lower control limits fall within the desired tolerance.
This is a radically different way to look at manufacturing and servicing processes. With the old way of inspecting every part, people continually work in fear about ever making a mistake. The fear of an error is the predominate thought on their mind.
With an SPC controlled system, the focus is on trying to understand the process, where there is potential errors or defect (deviations from the desired outcome), and improving the process so the desired outcome can be achieved more predicatably.
Tuesday, October 13, 2009
My Alter Ego
Thursday, October 8, 2009
Drop Down Menus
Drop down menus on web pages add an elegant style to the presentation, but they can be very quirky. Commonly, the menus are build with lists and using CSS that control the visiblity of list items based styles estalished for the the hover property in CSS.
Another method that I have seem demonstrated quite eligently at The Ojibway Club is to use a combination of tables and divs. That site was developed by The Big Brain.. The source code for that page shows a very clean layout of the menus. This was created with Joomla in conjunction with a third party joomla menu system.
Another method that I have seem demonstrated quite eligently at The Ojibway Club is to use a combination of tables and divs. That site was developed by The Big Brain.. The source code for that page shows a very clean layout of the menus. This was created with Joomla in conjunction with a third party joomla menu system.
Sunday, September 27, 2009
Epicurus On Death
Epicurus states: “Become accustomed to the belief that death is nothing to us. For all good and evil consists in sensation, but death is deprivation of sensation. And therefore a right understanding that death is nothing to us makes the mortality of life enjoyable, not because it adds to it an infinite span of time, but because it takes away the craving for immortality. For there is nothing terrible in life for the man who has truly comprehended there is nothing terrible in not living.”
What is very interesting about this text is Epicurus’s point blank statement that there is nothing after death. So now that we have that settled, lets move on and set about the task of making the best out the time we spend living.
We have started a new sermon series at our church today called “Live like you are dying”. I think the main point of it is to try to get us to make the most of our life, do the things that you know are important but have not been getting around to. So this sermon series has the exact opposite motivation of what Epicurus is trying to accomplish.
I find the contrast of these two points of view very fascinating. Epicurus come at it from the point of view “well there is nothing after death, so lets stop obsessing about it and get on with the task of enjoying life”. While “Live like you are dying” has the total opposite view: The tragedy of death could happen any time to you, so you need to make things right before that happens.
What happens after death is one of those weird things. You cannot prove or disprove any theory about because we cannot go there and come back, since by definition, a person is dead when they are gone. If they go and come back, were they really dead? It creates a brutal impasse for any further discussion about the meaning and purpose in life. You have to work backwards from what death means and life after death before you can make sense out of our lives.
No wonder Epicurus immediately addresses the issue of death before he dives into his dissertation on ethics and the meaning of life. In my opinion, I feel that he deals with it a bit too quickly. By the time he was writing this in 300 BC, the Septuagint (Greek translation of the Hebrew Old Testament) was already being translated. He would also be aware of many other religions at that time which held a concepts of an afterlife. Alexander the Great (356-323) had just conquered the majority of the known world so he would be bringing back to Athens knowledge about the various religions from Indians, Babylonians, Hebrews, and Egyptians.
Epicurus has made a very bold move to start off his arguments with the assumption that there is nothing after death. If a person just follows his line of thinking (without questioning the first assumption of nothing after death), then the other things following that make perfect sense. However, if his first assumption does not make any sense, or if he is making that assumption to quickly without addressing all the other people around him in his known world that think there is something after death, then the rest of the arguments that follow are not even worth considering.
What is very interesting about this text is Epicurus’s point blank statement that there is nothing after death. So now that we have that settled, lets move on and set about the task of making the best out the time we spend living.
We have started a new sermon series at our church today called “Live like you are dying”. I think the main point of it is to try to get us to make the most of our life, do the things that you know are important but have not been getting around to. So this sermon series has the exact opposite motivation of what Epicurus is trying to accomplish.
I find the contrast of these two points of view very fascinating. Epicurus come at it from the point of view “well there is nothing after death, so lets stop obsessing about it and get on with the task of enjoying life”. While “Live like you are dying” has the total opposite view: The tragedy of death could happen any time to you, so you need to make things right before that happens.
What happens after death is one of those weird things. You cannot prove or disprove any theory about because we cannot go there and come back, since by definition, a person is dead when they are gone. If they go and come back, were they really dead? It creates a brutal impasse for any further discussion about the meaning and purpose in life. You have to work backwards from what death means and life after death before you can make sense out of our lives.
No wonder Epicurus immediately addresses the issue of death before he dives into his dissertation on ethics and the meaning of life. In my opinion, I feel that he deals with it a bit too quickly. By the time he was writing this in 300 BC, the Septuagint (Greek translation of the Hebrew Old Testament) was already being translated. He would also be aware of many other religions at that time which held a concepts of an afterlife. Alexander the Great (356-323) had just conquered the majority of the known world so he would be bringing back to Athens knowledge about the various religions from Indians, Babylonians, Hebrews, and Egyptians.
Epicurus has made a very bold move to start off his arguments with the assumption that there is nothing after death. If a person just follows his line of thinking (without questioning the first assumption of nothing after death), then the other things following that make perfect sense. However, if his first assumption does not make any sense, or if he is making that assumption to quickly without addressing all the other people around him in his known world that think there is something after death, then the rest of the arguments that follow are not even worth considering.
Thursday, September 24, 2009
Branding... Where do you start?
I just finished a 1 hour marketing meeting with an organization that I volunteer with.
They are trying to create an new website and the look they create for their website really should be consistent with the rest of the documents and letter head. So that brought us to the question of the logo.
It turns out that they all think their logo is outdated. So we started talking about what the organization represents. What do other people think of when they think of the organization. We managed to boil it down to about 3 or 4 concepts.
Then we started playing with images that represent those concepts. Within another half an hour, we had a rough draft of a logo portraying the ideals valued by the organization.
That logo summarized the brand we are trying to establish and it is a grass-roots expression of them.
They are trying to create an new website and the look they create for their website really should be consistent with the rest of the documents and letter head. So that brought us to the question of the logo.
It turns out that they all think their logo is outdated. So we started talking about what the organization represents. What do other people think of when they think of the organization. We managed to boil it down to about 3 or 4 concepts.
Then we started playing with images that represent those concepts. Within another half an hour, we had a rough draft of a logo portraying the ideals valued by the organization.
That logo summarized the brand we are trying to establish and it is a grass-roots expression of them.
Saturday, September 19, 2009
Contract Law & Pet Rapture Insurance
There is this new insurance called pet rapture insurance
for people that believe in the rapture, but are concerned about their beloved pets they will leave behind when they are raptured.
So a believer pays a fee that is supposed to provide them with peace of mind that the pet will be cared for in their absence. I am not sure how much peace of much such a contract can provide. A contract is not of much value if it is not enforceable. Since the two parties entering into the contract are the beliver and Eternal Earthbound pets, when the rapture occurs, the believers will not be a position to enforce the contract since they will not be around to file a law suit.
It is a very funny legal situation. Eternal Earthbound is only required to perform their end of the contract if there is a rapture. However, in the event that there is a rapture, the believer is not in a position to enforce the contract. It seems like a pretty lucrative contract for Eternal Earthbound, except for that the people running Ethernal Earthbound are likely unbelievers, and they have to face the eternal consequences of that unbelief.
for people that believe in the rapture, but are concerned about their beloved pets they will leave behind when they are raptured.
So a believer pays a fee that is supposed to provide them with peace of mind that the pet will be cared for in their absence. I am not sure how much peace of much such a contract can provide. A contract is not of much value if it is not enforceable. Since the two parties entering into the contract are the beliver and Eternal Earthbound pets, when the rapture occurs, the believers will not be a position to enforce the contract since they will not be around to file a law suit.
It is a very funny legal situation. Eternal Earthbound is only required to perform their end of the contract if there is a rapture. However, in the event that there is a rapture, the believer is not in a position to enforce the contract. It seems like a pretty lucrative contract for Eternal Earthbound, except for that the people running Ethernal Earthbound are likely unbelievers, and they have to face the eternal consequences of that unbelief.
Wednesday, August 19, 2009
Disk Stress Analysis for Centrifugal Fans
I have been developing some formulas for calculating the stress in disks due to centrifugal force. These are useful to have when designing an industrial fan to ensure that the hub stresses and strains are acceptable. If the hub stresses are too high, the hub may crack at the keyway. If the hub radial strain is too high, the hub may come loose from the shaft as the strain exceeds the interference fit.
I combined formulas used for stress & strain due to centrifugal loading with the formulas for the pressure from an interference fit along with the formulas for radial strain due to pressure. The resulting formulas showed very good correlation with FEA results conducted in SolidWorks/CosmosWorks. The full paper describing the formulas along with an Excel spreadsheet containing the formulas, and Solidworks models can be purchased for providing training in developing analyticial and FEA methods for stress analysis of fans. Further details about fan engineering can be found at the Mechanical Design section of my FanEng.ca website.
I combined formulas used for stress & strain due to centrifugal loading with the formulas for the pressure from an interference fit along with the formulas for radial strain due to pressure. The resulting formulas showed very good correlation with FEA results conducted in SolidWorks/CosmosWorks. The full paper describing the formulas along with an Excel spreadsheet containing the formulas, and Solidworks models can be purchased for providing training in developing analyticial and FEA methods for stress analysis of fans. Further details about fan engineering can be found at the Mechanical Design section of my FanEng.ca website.
Subscribe to:
Posts (Atom)
y bar
y + hold Alt, type 0773
-
In a regular annotation note, create a stack that looks the way you like. It will take a couple of trial and error attempts since there...
-
The following code will update a Google sheet: function doGet ( e ) { // This function handles GET requests (for simplicity in...