Tuesday, March 17, 2020

Sustainable Transport Policy The WritePass Journal

Sustainable Transport Policy 1. Developing Countries and Transportation Sustainable Transport Policy ]. Aleklett, K. (2007).  Peak oil and the evolving strategies of oil importing and exporting countries  (No. 2007-17). Discussion paper. [online] internationaltransportforum.org/jtrc/DiscussionPapers/DiscussionPaper17.pdf [accessed October 26th 2013]. Candiracci, S. (2009). Climate change, urbanization and sustainable urban transport in developing country cities. Energy transport Policies Section. [online] unhabitat.org/downloads/docs/7997_10872_Sara%20Candiracci.pdf [accessed October 24th 2013]. Chapman, L. (2007). Transport and climate change: a review.  Journal of transport geography,  15(5), pp. 354-367. [online] boku.ac.at/fileadmin/_/nachhaltigkeit/Klimafreundliche_Arbeitsmobilit%C3%A4t/Chapman_2007_Transport_and_climate_change_a_review.pdf [accessed October 26th 2013]. Cheng, H., Hu, Y. (2010). Planning for sustainability in Chinas urban development: Status and challenges for Dongtan eco-city project.  Journal of Environmental Monitoring,  12(1), pp. 119-126. [online] http://pubs.rsc.org/en/content/articlelanding/2010/em/b911473d/unauth#!divAbstract [accessed October 25th 2013]. Dargay, J., Gately, D., Sommer, M. (2007). Vehicle ownership and income growth, worldwide: 1960-2030.  The Energy Journal. pp. 143-170. [online] xesc.cat/Et2050_Library/attachments/Imp_Vehicles_per_capita_2030.pdf [accessed October 25th 2013]. Gakenheimer, R. (1999). Urban mobility in the developing world.  Transportation Research Part A: Policy and Practice,  33(7), 671-689. [online] sciencedirect.com/science/article/pii/S0965856499000051   [accessed October 22th 2013]. Gwilliam, K. (2003). Urban transport in developing countries. [online] Transport Reviews, 23(2), 197-216. tandfonline.com/doi/abs/10.1080/01441640309893#.Umwm7XCb55g [accessed October 20th 2013]. Kutzbach, M. J. (2009). Motorization in developing countries: Causes, consequences, and effectiveness of policy options.  Journal of Urban Economics,  65(2), pp. 154-166. [online] https://webfiles.uci.edu/kutzbach/www/Kutzbach_Motorization_2008.pdf [accessed October 23th 2013]. TranSafety, (1998). Strategies for Solving Urban Transportation Problems in Developing Countries. Road Management Engineering Journal. [online] 1-800-777-2338 usroads.com/index.html [accessed October 22th 2013]. Transport Policy Advisory Services, (2010). Callenges of urban transport in developing countries- a summary. [online] sutp.org/ins-pol-supporting-docs?download=391:challenges-of-urban-transport-in-developing-countries-a-summary [accessed October 20th 2013]. Wright, L., Fulton, L. (2005). Climate change mitigation and transport in developing nations.  Transport Reviews,  25(6), pp. 691-717. [online] http://citeseerx.ist.psu.edu/messages/downloadsexceeded.html [accessed October 26th 2013]. Wright, L., Fulton, L. (2005). Climate change mitigation and transport in developing nations.  Transport Reviews,  25(6), pp. 691-717. [online] http://citeseerx.ist.psu.edu/messages/downloadsexceeded.html [accessed October 26th 2013].

Sunday, March 1, 2020

Using a Timer in MS Office VBA Macros

Using a Timer in MS Office VBA Macros For those of us who have our minds deeply into VB.NET, the journey back to VB6 can be a confusing trip. Using a Timer in VB6 is like that. At the same time, adding timed processes to your code is not obvious to new users of VBA Macros. Timers For Newbies Coding a Word VBA macro to automatically time a test that was written in Word is a typical reason for using a timer. Another common reason is to see just how much time is being taken by different parts of your code so you can work on optimizing the slow sections. Sometimes, you might want to see if anything is happening in the application when the computer seems to be just sitting there idle, which can be a security problem. Timers can do that. Start a Timer You start a timer by coding an OnTime statement. This statement is implemented in Word and Excel, but it has different syntax depending on which one youre using.  The syntax for Word is: expression.OnTime(When, Name, Tolerance) The syntax for Excel looks like this: expression.OnTime(EarliestTime, Procedure, LatestTime, Schedule) Both have the first and second parameter in common. The second parameter is the name of another macro that runs when the time in the first parameter is reached. In effect, coding this statement is like creating an event subroutine in VB6 or VB.NET terms. The event is reaching the time in the first parameter. The event subroutine is the second parameter. This is  different from the way it is coded in VB6 or VB.NET. For one thing, the macro named in the second parameter can be in any code that is accessible. In a Word document, Microsoft recommends putting it in the Normal document template. If you put it in another module, Microsoft recommends using the full path: Project.Module.Macro. The expression is usually the Application object. The Word and Excel documentation states that the third parameter can cancel the execution of the event macro in case a dialog or some other process prevents it from running within a certain time. In Excel, you can schedule a new time in case that happens. Code the Time Event Macro This code in Word is for the administrator who wants to display a notification that the testing time has expired and print the result of the test. Public Sub TestOnTime()Debug.Print The alarm will go off in 10 seconds!Debug.Print (Before OnTime: Now)alertTime Now TimeValue(00:00:10)Application.OnTime alertTime, EventMacroDebug.Print (After OnTime: Now)End SubSub EventMacro()Debug.Print (Executing Event Macro: Now)End Sub This results in the following content in the immediate window: The alarm will go off in 10 seconds!Before OnTime: 12/25/2000 7:41:23 PMAfter OnTime: 12/25/2000 7:41:23 PMExecuting Event Macro: 2/27/2010 7:41:33 PM Option for Other Office Apps Other Office applications dont implement OnTime. For those, you have several choices. First, you can use the Timer function, which simply returns the number of seconds since midnight on your PC, and does your own math, or you can use Windows API calls. Using Windows API calls has the advantage of being more precise than Timer. Heres a routine suggested by Microsoft that does the trick: Private Declare Function getFrequency Lib kernel32 _Alias QueryPerformanceFrequency (cyFrequency As Currency) As LongPrivate Declare Function getTickCount Lib kernel32 _Alias QueryPerformanceCounter (cyTickCount As Currency) As LongSub TestTimeAPICalls()Dim dTime As DoubledTime MicroTimerDim StartTime As SingleStartTime TimerFor i 1 To 10000000Dim j As Doublej Sqr(i)NextDebug.Print (MicroTimer Time taken was: MicroTimer - dTime)End SubFunction MicroTimer() As Double Returns seconds.Dim cyTicks1 As CurrencyStatic cyFrequency As CurrencyMicroTimer 0 Get frequency.If cyFrequency 0 Then getFrequency cyFrequency Get ticks.getTickCount cyTicks1 SecondsIf cyFrequency Then MicroTimer cyTicks1 / cyFrequencyEnd Function