Compiling Bare-Metal Rust for PinePhone
HppNote: The way I'm writing this is all relatively clean and linear. It was not simple to figure out. I did my fursona proud and screamed endlessly for, like, a month and a half.
I got a pleasant surprise: My serial cable showed up earlier than expected! And now that I've added an extremely cursed 3.5mm-to-USB cable to my collection, I can play with UART.
Unfortunately, that's going to have to wait. See, while I was waiting for the cable, I started cleaning up the code. I turned this:
unsafe {
core::ptr::write_volatile(0x01C20874 as *mut u32, 0x77711177);
core::ptr::write_volatile(0x01C2087C as *mut u32, 0x001c0000);
}
into this:
PD_CFG_REG.index(@).write(0x77711177);
PD_DATA_REG.write(0x001c0000);
into this:
hw::led::init();
hw::led::set(hw::led::Color::White);
In doing so, though, the code no longer works on my hardware. After a bit of digging, I've realized that the issue is by no means impossible to solve, but it is a sign that things are going to start getting difficult. There are two specific problems:
- Rust, by default, is storing data in
.rodata
, even for constants that could fit entirely in registers. Then it loads out of that part of memory. Unfortunately, my extremely basic script just copies the.text
section out, so it won't work as-is. It won't be impossible to fix, but it will mean a fairly major change to the build script. - Rust also expects the stack to be set up and usable. I'm not sure where the stack pointer is by default, but I'm pretty sure it's not pointing at valid memory.
Luckily, the solution here is fairly simple. I'm going to need to insert a little bit of preamble Assembly to set the stack in the right spot, and building this image is going to get a little more complicated. I've been planning out how to do this sort of thing for a while, but I was hoping I could get a little further before I had to. Oh well.
In short, I need a custom linker script -- to make sure everything gets put in the right place in the final binary, for my shell script to be able to yoink it out -- and a custom runtime object, to set things up and call main
.
I can package both into a somewhat janky custom compile target.
It won't get merged into the mainline anytime soon, but it'll make this compilation quite a lot easier than any of the alternatives.
As a nice bonus, it'll make my build more repeatable, and (very nearly) eliminate the risk of an internal rustc change breaking things1.
See, up until now, I've just been yoinking the .text
section and hoping that the entry point is the beginning of .text
, because I'm replacing _start
.
With a custom runtime, hpprt.o
, written in Assembly, I can guarantee that that thing's text section starts with the executable code I want.
The linker script can put the hpprt.o
's .text
at the beginning of the output .text
section, so that it definitely starts with my executable code.
Then the runtime can call a main function, and the linker will automatically put things together.
The linker script will also stuff all of the data that needs to be stored in the firmware into the .text
section.
That keeps the Bash wrapper script nice and simple, since I can just keep pulling out .text
, without having to worry about pulling other sections out of the binary and putting them in the right spot in the firmware, to get them loaded into the right spot in memory.
Finally, the linker script has a .bss
section defined, but only so it can calculate where it starts and ends, as __bss_start
and __bss_end
respectively.
We'll get to what they're used for and why we need them in a bit.
Now, for the runtime object: It could do a lot. I could do most of the startup, load the rest of the kernel, switch to AArch64, and so on. There are two issues with that:
- It'd be incredibly complex.
I want to keep
hpprt.o
as simple as possible to keep it auditable. Implementing all of the startup code in Assembly would make auditing a lot harder. - It wouldn't get me anything.
Especially for right now, when I'm just exploring the peripherals, I wouldn't get anything out of a more complex
hpprt.o
. This point might change eventually, but the first won't.
Instead of anything complex, hpprt.o
will do just four things:
- Turn on an LED
- Zero out
.bss
- Set the stack pointer
- Call
k_main
The LED's purpose is simple: Give the user instant feedback, as soon as the device is powered on, that the device is on. As it progresses through the boot, it'll go through the colors, starting at red on first powerup.
Zeroing out .bss
is a little bit more complex.
In short, .bss
is the section where all of the modifiable global variables go.
Rust expects the whole region to be zeroed by default.
Luckily, that's fairly simple.
Because .bss
will always be all zeroes, I don't actually need to store its information.
I can just define a couple of symbols in my linker script, marking the start and end of .bss
, then zero out that memory region.
Strictly speaking, I don't need it yet, but I expect I will before too long.
Setting the stack pointer is self-explanatory. I just set that to the end of the RAM area, so the stack can grow down into open space.
Finally, I call k_main
.
It's just a function, exactly the same as any other.
It serves as my entry point into Rust.
I called it k_main
rather than just main
because I expect to have a proper main function; k_main
is mostly going to be setting up the platform to be as the kernel expects it.
At the end, k_main
will never return, either by powering off the device or looping infinitely.
We'll get to how I can guarantee that in a later blogpost, but for now, a TL;DR: !
.
If you look at the source, you may notice there's some code after the k_main
call.
All it does is rapidly flash the LED, so that if things go really wrong and k_main
does return, there's some indication.
Compiling that against another tiny assembly file, where k_main
just returns immediately, does produce the binary I want.
So I've got all the pieces assembled, and now I just need to make Cargo accept them!
There are basically four ways to do this. In rough order of cleanliness:
- Use a build script which links in
hpprt.o
and adds the linker script. - Write a custom target which incorporates the linker script and
hpprt.o
. - Switch away from workspaces and configure things through
.cargo/config.toml
. - Switch to building with
cargo rustc
and pass the relevant arguments through that.
Unfortunately, number 1 doesn't (yet!) work. So number 2 it is! It's not quite as nice as I'd like. It has some paths relative to the working directory of the build command, so it's pretty brittle, but since I wrap the build in a Bash script, and will eventually be wrapping it up in a custom Cargo subcommand, it's something I can fairly simply deal with. For now. Eventually, I'm hoping to figure out a cleaner solution, or that one gets added.
Now, naturally, things didn't just work out straightaway.
I spent a while re-laying-out the target spec format, because I want each target to have a customized spec for itself.
I also had to hunt down a few bugs in my code.
I mixed up MOVW
and MOVT
a few times in my Assembly, a BNE
where I wanted a BLT
, and some duplicated bitshifts accidentally zeroed things out.
Interestingly, the optimizer managed to detect that, and elided the bitshifts entirely.
I also needed to tweak the linker script a bit, to make room for the boot header. See, the A64 boots from a (proprietary, only partly reverse-engineered) disk format. It's more-or-less compatible with standard partitioning, but it does mean that more data than I thought is copied the disk. In short, the boot header and my code are both copied; I thought it was just my code. That left all the pointers offset by a bunch, which broke everything Rust tried to generate.
Anyway, with all that, I think I have all of my issues fixed. I haven't bricked the device, and I've got somewhat complex code actually running. From here, I can get to properly exploring the device! That's where we'll pick up next time, in this slow and extremely irregular series of blogposts documenting my slow descent into the abyss.
Happy Halloween!
1: Given the level of hackery I'm doing right now, it's basically impossible to code against any sort of officially stabilized interface. Technically, a rustc change that breaks things for me could happen whenever. However, with the linker script and custom runtime object, I've eliminated a lot of the unknown territory that breakages could come from. The target specs are also kept incredibly stable, despite technically not being stabilized, so that's unlikely to change and break.


Jenn Huck
UVA Library
Fall 2021
Image: https://reproducible-science-curriculum.github.io/
Contains files generated from other files
Examples include:
Image: https://reproducible-science-curriculum.github.io/
Image: https://datacarpentry.org/r-socialsci/00-intro/index.html
Image: Ties de Kok: https://towardsdatascience.com/how-to-keep-your-research-projects-organized-part-1-folder-structure-10bd56034d3a
Image: https://github.com/Reproducible-Science-Curriculum/rr-init
Build out a project structure with explorer/finder
and then visit bit.ly/org4repro
Just a little bit of documentation
Useful README file content:
Three principles for file names
Jenny Bryan https://speakerdeck.com/jennybc/how-to-name-files?slide=7
Jenny Bryan https://speakerdeck.com/jennybc/how-to-name-files?slide=10
This means that when you look at project files in your directory, the files undergo default ordering in the display
Like so:
If you don't, it might lead to this:
Use YYY-MM-DD. Leads to far less confusion among humans. Machines will always interpret this correctly. Default ordering will work correctly every time.
Yes
No
Much of the Project Organization and README material has been adapted from: Reproducible Science Curriculum: Data & Project Organization https://reproducible-science-curriculum.github.io/organization-RR-Jupyter/
Much of the file naming material has been adapted from: Jenny Bryan. How to Name files https://speakerdeck.com/jennybc/how-to-name-files
Project TIER. TIER Protocol 3.0.https://www.projecttier.org/tier-protocol/specifications-3-0/
Data Carpentry. R for Social Scientists: Before We Start.https://datacarpentry.org/r-socialsci/00-intro/index.html File Organization: https://datacarpentry.org/rr-organization1/ Reproducible Research in R Workshop Overview https://datacarpentry.org/rr-workshop/
Dryad. Best Practices for creating reusable data publications: Organize files in a logical schemahttps://datadryad.org/stash/best_practices#organize
Martin Chan. 2020. "RStudio Projects and Working Directories: A Beginner's Guide." Musings on R.https://martinctc.github.io/blog/rstudio-projects-and-working-directories-a-beginner's-guide/
Leon Jessen. 2018.https://twitter.com/jessenleon/status/964236119658418176 and How to organize a project: The most important talk you never heard! https://github.com/leonjessen/talks
Ties de Kok. How to keep your research projects organized, part 1: folder structure. https://towardsdatascience.com/how-to-keep-your-research-projects-organized-part-1-folder-structure-10bd56034d3a
"Good enough practices in scientific computing." PLOS Computational Biology. 2017. https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510#pcbi.1005510.ref001
Noble, W. S. "A Quick Guide to Organizing Computational Biology Projects." PLOS Computational Biology. 2009https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000424
Jenny Bryan. How to name files.https://speakerdeck.com/jennybc/how-to-name-files
Rich Fitzjohn. Designing Projects.https://nicercode.github.io/blog/2013-04-05-projects/
Chris Von Csefalvay. Structuring R Projects. https://chrisvoncsefalvay.com/2018/08/09/structuring-r-projects/(Note: best source for more complicated, data science projects.)
Krista L. DeStasio. R Best Practices.https://kdestasio.github.io/post/r_best_practices/#fn1


--- layout: page title: Tags header: Posts By Tag group: navigation position: 4 --- {% include JB/setup %} {% for tag in site.tags %}


Towards Ubiquitous Location Intelligence
My research interest has been focused on developing desirable and user-friendly Location-Based Services (LBS). With the evolution of technology and the growth of my research experience, I gradually built my research architecture as presented below.
Towards ubiquitous location intelligence that makes everywhere of the physical world perceptible, computable, and serviceable, my research vision is to provide sustainable supports for location-dependent applications such as logistics, mobile health, transportation, and public resource planning.
The realization of ubiquitous location intelligence requires data with high availability, algorithms with high adaptability, and computing infrastructure with high flexibility. Hence, my research intersects the topics in the field of data-intensive systems, machine learning, and mobile computing.
In my research, the ubiquitousness of LBS relies on the pervasive IoT infrastructure. It provides multiple types of data such as locations, environmental information, user behaviors, and semantics. Therefore, how to effectively and efficiently manage these IoT data is an important part of my research. Secondly, how to combine semantics with location-relevant data to extract valuable knowledge is also worthy of study. Finally, how to precisely apply the extracted knowledge to user services and deal with feedbacks is an important problem for location intelligence. Corresponding to the above issues, my current research topics are categorized into three themes:
-
IoT Data Management that deals with the data quality control, data organization and representation, and query processing for location-sensing data from IoT.
-
Queries over Uncertain Indoor Mobility Data. Proper analysis of indoor mobility data can reveal great insights for intelligent decision making. For example, finding currently crowded regions in an airport helps eliminate security risks, and knowing the most popular semantic locations and routes in a mall enables efficient management of mall space. The biggest challenge in querying and analyzing indoor mobility data comes from the spatiotemporal uncertainty of the data. Traditional methods of modeling object movement in free spaces or road networks do not apply to the indoor topology. My research outcomes include the precise modeling of object movements over complex indoor topology and spatiotemporal uncertainty, and efficient indexing and search algorithms for density and flow queries.
-
Learning-based Cleansing for Wi-Fi Positioning Data (Ongoing work). The mainstream indoor positioning technique is the fingerprinting method based on Wi-Fi signal strengths, but its accuracy is limited by the drastic fluctuation of signal propagation. Compared with the traditional methods that refine positioning data based object dynamics model, my research is dedicated to improving the availability of fingerprinting positioning data from the perspective of data cleansing. We have been working on unsupervised noise extraction and probabilistic modeling of indoor positioning procedure at both signal strength level and positioning result level.
-
Data Quality Control for Location-of-Things Data (Ongoing work). Location-of-Things is an Internet-of-Things paradigm in which mobility data is being gathered, processed and transmitted among heterogeneous data nodes in a decentralized manner. Data quality control for Location-of-Things has become a prominent challenge as traditional techniques cannot cope with the decentralized characteristics of Location-of-Things. My current studies include the data quality modeling at decentralized nodes, quality-aware algorithms for resolving data heterogeneity and inconsistency, and task scheduling mechanism for data quality management in Location-of-Things.
-
-
Semantic-oriented Mobility Analytics that incorporates internal or external semantics into the extraction and exploitation of mobility knowledge.
-
Semantic Annotation of Trajectory Data. High-level mobility analytics applications have been in urgent need of a concise but semantics-oriented representation of trajectory data. Existing semantic annotation methods focus on outdoors and require extra knowledge such as POI category or human activity regularity. These conditions are difficult to meet in indoor venues with relatively small extents but complex topology. My research focuses on the annotation of indoor mobility semantics that describe an object’s mobility event (what) at a semantic region (where) during a time period (when). We have proposed a complete pipeline method including data cleansing, trajectory segmentation, semantic matching, and data complementing. At present, we are working on using probabilistic graphical models to learn the correlation between locations and events to improve the annotation accuracy.
-
Spatial-Semantic Fact Search (Ongoing work). In location-based services such as POI recommendation and travel planning, user requests usually embody both spatial and semantic information. Traditional spatial-keyword query and semantic search techniques can hardly meet the new-emerging user needs: On the one hand, users prefer to express flexible semantics using natural language; on the other hand, users need more concise and rich query results rather than unstructured contents. To enable users to obtain location-relevant facts by natural language, my current study is dedicated to processing natural language spatial-semantic queries over complex knowledge graph.
-
-
Context-aware Computing that provides smart mobility services to understand and respond to the user requests implicitly based on contextual information.
-
Vision-enhanced Localization. Identifying the surroundings and displaying relevant information on the camera view provides immersive user interactions. Wireless positioning techniques have limited accuracy and cannot estimate the camera pose of device. Simultaneous localization and mapping (SLAM) techniques need a high cost of offline modeling and online matching, and cannot deal with dynamic scenes. My studies focus on the vision-enhanced localization that estimates a device’s precise position and camera pose simultaneously. In particular, we designed a metric learning algorithm that fuses Wi-Fi, compass and gyroscope data to index a visual scene consisting of a set of offline images. When an online query is issued, the fused data index helps quickly find the target visual key points, and subsequently the device position and camera pose are estimated precisely with visual geometry.
-
Context-based Indoor Routing. Route planning is among the popular location-based services. Appropriate route planning based on the context can facilitate a huge number of people, especially when they have to go through large and/or unfamiliar environments such as shopping malls, railway stations, and airports. The context in indoor routing can be divided into environment-related (e.g., opening and closing of doors and corridors, traffic in the space), user-related (e.g., preferences, costs, and intermediate destinations), event-related (e.g., emergencies and power failure) and so on. My research focuses on modeling and management of complex contextual information, constructing efficient data structures and indexes based on indoor context, and designing efficient and effective routing algorithms.
-
Relationship of the themes: IoT Data Management provides platform supports for Semantic-oriented Mobility Analytics, the intermediate services and Context-aware Computing, the end-user services. In turn, the high-level information and knowledge obtained from the service side boost the management and exploitation of low-level IoT data at the platform side.


{-# OPTIONS --allow-unsolved-metas #-}
module Lang.debugging where
open import Agda.Builtin.Nat
Debugging and tooling are arguably the most vital parts of the development process and a language ecosystem. Tools tend to help developers figure out issues and assist them in the entire process. Agda has a small set of indispensable tools for such purposes. We look at how to use some of them to make our lives easier.
The agda compiler supports type checking and providing hints while writing code. Unknown types can be represented with a placeholder ?
and the compiler can help deduce the type.
data _even : Nat → Set where
: zero even
ZERO : ∀ x → x even → suc (suc x) even
STEP
: suc (suc (suc (suc zero))) even
proof₁ = ? proof₁
The agda compiler hints the ?
should be 4 even
. This placeholder ?
is called a hole.
Agda supports various Interaction
commands to provide several features via the agda --interaction
command. This implements a client-server protocol whereby a client can communicate with the agda compiler to do various tasks on the source files.
Agda supports the following commands:
| Name | Description | Internal name |
|---|---|---|
| load | Load a file and type check it. | Cmd_Load |
| compile | compile a file using the various agda backends (GHC , GHCNoMain , LaTeX , QuickLaTeX etc) |
Cmd_compile |
| abort | abort the current operation, do nothing otherwise | Cmd_abort |
| toggle-display-of-implicit-arguments | ToggleImplicitArgs |
|
| show-constraints | Show constraints or goals | Cmd_constraints |
| solve-constraints | Solve all constraints in a file | Cmd_solveAll |
| show-goals | Show all goals in a file | Cmd_metas |
| search-about | Search about a keyword | Cmd_search_about_toplevel |
| Name | Description | Internal name |
|---|---|---|
| why-in-scope | Explain why a keyword is in scope | Cmd_why_in_scope |
| infer-type | Infer type | Cmd_infer |
| module-contents | List all module contents | Cmd_show_module_contents |
| compute-normal-form | Compute the normal form of either selected code or given expression | Cmd_compute |
| Name | Description | Internal name |
|---|---|---|
| give | Fill a goal | Cmd_give |
| refine | Refine. Partial give: makes new holes for missing arguments | Cmd_refine_or_intro |
| auto | Automatic proof search, find proofs | Cmd_auto |
| case | pattern match on variables (case split) | Cmd_make_case |
| goal-type | Goal type | Cmd_goal_type |
| context | Context of the goal | Cmd_context |
| goal-type-and-context | Type and context of the goal | Cmd_goal_type_context |
| goal-type-and-inferred-type | Infer goal type and the context of the goal | Cmd_goal_type_context_infer |
The interaction commands mentioned above can be tied to text editors and IDEs to provide additional assistance for programmers. Such integrations exist for the following text editors:
There is discontinued support for sublime, eclipse.
C-c C-l load (type checking)
C-c C-f forward (jump to next hole)
C-c C-b backward (jump to previous hole)
C-c C-d deduce (type of expression) C-c C-n normalize (evaluate expression)
Commands inside a hole
C-c C-, information about the hole
C-c C-d deduce (type of contents of hole)
C-c C-Space give (checks whether the term in the hole has the right type and if it has, replaces the hole with the term)
C-c C-c case split (pattern match on variables)
C-c C-r refine (one step further) C-c C-a auto (try to find a solution)
Agda-mode for emacs can be installed using
agda-mode setup
This entire project can be loaded into emacs like:
```bash
emacs ./contents.lagda.md
followed by loading agda-mode
by typing space
space
agda-mode
. Using spacemacs is recommended.


Accelerated C++
Practical Programming by Example
by Andrew Koenig and Barbara E. Moo
Addison-Wesley, 2000
ISBN 0-201-70353-X
Pages 336
Second Printing
Table of Contents


title = "Viral eco-evolutionary dynamics of wild and domestic pollinators under global change" url = "/" layout = "default" meta_description = "homepage desc" is_hidden = 0 seo_keywords = "keywords" robot_index = "index" robot_follow = "follow" [article_highlights] maxItems = 10 title = "Latest from the project" [Timeline] limit = 5 [homepage_intro] [publications_list] == {% component 'homepage_intro' %} {% component 'article_highlights' %}


Chapter 3 Derivatives
3.1 Derivative Definition and Rules
Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).
3.1.1 Linear and Non-linear Functions
Linear functions have a constant slope, but what is the rate of change for a non-linear function as we shift along its domain?
3.1.2 Definition
(SB) Let \((x_0 ,f(x_0 ))\) be a point on te graph of \(y=f(x)\).
The derivative of \(f\) at \(x_0\) is the slope of the tangent line to the graph of \(f\) at \((x_0 ,f(x_0 ))\).
There are some common ways of denoting derivative of funtion \(f\) at \(x_0\):
\(\displaystyle f^{\prime } (x_0 )\)
\(\displaystyle \frac{df}{dx}(x_0 )\)
\(\displaystyle \frac{dy}{dx}(x_0 )\)
\(f_x (x_0 )\): this is popular in economics
We write this analyticaly as:
\[f^{\prime } (x_0 )=\lim_{h\to 0} \frac{f(x_0 +h)-f(x_0 )}{h}\]
If this limit exists, then the function \(f\) is differentiable at \(x_0\).
We will use this formula to derive first order taylor approximation. And this will also appear when we derive the formula for point elasticity.
3.1.3 Derivative Rules–Constant Rule
given constant \(k\),:
\(\displaystyle f(x)=a\cdot x\)
\(\displaystyle f^{\prime } (x_0 )=a\)
syms x a
f(x, a) = a*x
f(x, a) =
1em \(\displaystyle a\,x\)
dfk = diff(f,x)
dfk(x, a) =
1em \(\displaystyle a\)
3.1.4 Derivative Rules–Power Rule (Polynomial Rule)
(SB) For any positive integer \(k\) (or real number \(k\)), the derivative of \(f(x)=x^k\) at \(x_0\) is:
\(\displaystyle f(x)=x^k\)
\(\displaystyle f^{\prime } (x_0 )=k\cdot x_0^{k-1}\)
syms x a k
f(x, a, k) = a*x^k
f(x, a, k) =
1em \(\displaystyle a\,x^k\)
dfk = diff(f,x)
dfk(x, a, k) =
1em \(\displaystyle a\,k\,x^{k-1}\)
3.1.5 Derivative Rules–Chain Rule
\(\displaystyle f(x)=p(q(x))\)
\(\displaystyle f^{\prime } (x_0 )=p^{\prime } (q(x_0 ))\cdot q^{\prime } (x_0 )\)
syms x a k
f(x, a, k) = (a*x)^k
f(x, a, k) =
1em \(\displaystyle {{\left(a\,x\right)}}^k\)
dfk = diff(f,x)
dfk(x, a, k) =
1em \(\displaystyle a\,k\,{{\left(a\,x\right)}}^{k-1}\)
3.1.6 Derivative Rules–Sum (and difference) Rule
Given functions \(p\) and \(q\) that are differentiable at \(x\), then:
\(\displaystyle f(x)=p(x)+q(x)\)
\(\displaystyle f^{\prime } (x)=p^{\prime } (x)+q^{\prime } (x)\)
syms x a b c d
f(x, a, b, c, d) = a*x^b + c*x^d
f(x, a, b, c, d) =
1em \(\displaystyle a\,x^b +c\,x^d\)
dfk = diff(f,x)
dfk(x, a, b, c, d) =
1em \(\displaystyle a\,b\,x^{b-1} +c\,d\,x^{d-1}\)
3.1.7 Derivative Rules–Product Rule
Given functions \(p\) and \(q\) that are differentiable at \(x\), then:
\(\displaystyle f(x)=p(x)\cdot q(x)\)
\(\displaystyle f^{\prime } (x)=p^{\prime } (x)\cdot q(x)+p(x)\cdot q^{\prime } (x)\)
syms x a b c d
f(x, a, b, c) = (a*x^b)*(c*x^d)
f(x, a, b, c) =
1em \(\displaystyle a\,c\,x^b \,x^d\)
dfk = diff(f,x)
dfk(x, a, b, c) =
1em \(\displaystyle a\,b\,c\,x^d \,x^{b-1} +a\,c\,d\,x^b \,x^{d-1}\)
3.1.8 Derivative Rules–Quotient Rule
Given functions \(p\) and \(q\) that are differentiable at \(x\), then:
\(\displaystyle f(x)=\frac{p(x)}{q(x)}\)
\(\displaystyle f^{\prime } (x)=\frac{p^{\prime } (x)\cdot q(x)-p(x)\cdot q^{\prime } (x)}{(q(x))^2 }\)
Note that the quotient rule is based on the product rule, because:
- \(\displaystyle f(x)=\frac{p(x)}{q(x)}=p(x)\cdot \frac{1}{q(x)}\)
So you can derive the quotient rule formula based on the product rule where the first term is \(p(x)\) and the second term is \(\frac{1}{q(x)}\).
syms x a b c d
f(x, a, b, c) = (a*x^b)/(c*x^d)
f(x, a, b, c) =
1em \(\displaystyle \frac{a\,x^b }{c\,x^d }\)
dfk = diff(f,x)
dfk(x, a, b, c) =
1em \(\displaystyle \frac{a\,b\,x^{b-1} }{c\,x^d }-\frac{a\,d\,x^b }{c\,x^{d+1} }\)
3.1.9 Derivative Rules–Exponential
We use exponential functions in economnics a lot:
\(\displaystyle f(x)=\exp (a\cdot x)\)
\(\displaystyle f^{\prime } (x)=a\cdot \exp (a\cdot x)\)
syms x a
f(x, a) = exp(a*x)
f(x, a) =
1em \(\displaystyle {\mathrm{e}}^{a\,x}\)
dfk = diff(f,x)
dfk(x, a) =
1em \(\displaystyle a\,{\mathrm{e}}^{a\,x}\)
This is a special case of any power function
\(\displaystyle f(x)=c^{a\cdot x}\)
\(\displaystyle f^{\prime } (x)=a\cdot (\log c)\cdot c^{a\cdot x}\)
note that \(log(exp(c))=c\)
syms x a c
f(x, a, c) = c^(a*x)
f(x, a, c) =
1em \(\displaystyle c^{a\,x}\)
dfk = diff(f,x)
dfk(x, a, c) =
1em \(\displaystyle a\,c^{a\,x} \,\log \left(c\right)\)
3.1.10 Derivative Rules–Log
We use Log functions in economnics a lot:
\(\displaystyle f(x)=\log (a\cdot x)\)
\(\displaystyle f^{\prime } (x)=\frac{1}{x}\)
note that the c cancels out.
syms x a
f(x, a) = log(a*x)
f(x, a) =
1em \(\displaystyle \log \left(a\,x\right)\)
dfk = diff(f,x)
dfk(x, a) =
1em \(\displaystyle \frac{1}{x}\)
3.2 Continuity and Differentiability
Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).
In the real world, households and firms general consume and use discrete units of goods. Households can buy \(N\) apples, and firms can hire \(M\) numbers of workers. The world is full of discreteness. To derive mathmatical expressions that summarize the aggregate behavior of economic agents, we generally approximate our discrete world with continuous functions.
3.2.1 Definition Continuous
Visually, "a function is continuous if its graph has no breaks" (SB). "The graph of a function cannot have a tangent line at a point of discontinuity"
This function, for example is not continuous. Note that we can not use both \(\le\) and \(\ge\), otherwise this would no longer be a function:
- \(\displaystyle f(x)=\left\lbrace \begin{array}{c} 1\;\textrm{if}\;x\ge 0\\ 0\;\textrm{if}\;x<0 \end{array}\right.\)
This is the simplest continuous function
- \(\displaystyle f(x)=\left\lbrace \begin{array}{c} 1\;\textrm{if}\;x\ge 0\\ 1\;\textrm{if}\;x<0 \end{array}\right.\)
The more formal definition of continuity is based on convergence of sequences, which you do not need to remember (SB P32):
Continuous at a point: A function \(f:D\to {{\textrm{R}}}^1\) is continuous at \(x_0 \in D\) if for any sequence \(\left\lbrace x_n \right\rbrace\)which converges to \(x_0\) in \(D\), \(f(x_n )\) converges to \(f(x_0 )\).
Continuous on a set: A function is continuous on a set \(U\in D\) if it is continuous at every \(x\in U\).
Whole function is continuous: Finally, we say that a function is continuous if it is continuous at every point in its domain.
Often, if you write down an economic model where functions have discontinuity, you might need to rely on brute-force type solution method to solve for household and firm maximization problems, and can not take advantage of derivatives.
3.2.2 Definition Continuously Differentiable
As stated before, if the following limit exists, then the function \(f\) is differentiable at \(x_0\): \(f^{\prime } (x_0 )=\lim_{h\to 0} \frac{f(x_0 +h)-f(x_0 )}{h}\)
\(f\) is a differentiable function, if "it is differentiable at every point \(x_0\) in its domain \(D\)" (SB P29), which means "its derivative \(f^{\prime } (x)\) is another function of \(x\)" (SB P32):
If \(f^{\prime } (x)\) is a continuous function of \(x\), we say that the original function \(f\)is continuously differentiable, or \(C^{{\textrm{1}}}\)
The 2 period savings problem involved a utility maximization equation that was continuous over the domain, and that was differentiable everywhere over the domain. The derivative we obtained was also continuous. Hence we were dealing with a continuously differentiable function. With that function, we were able to easily find the optimal savings choice
3.3 Elasticity and Derivative
Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).
3.3.1 Demand and Supply
At price \(p_0\), the current price level, the demand and supply of good \(x\) ( \(x\) could be capital, labor, apples ect) could be written as:
\(\displaystyle x_{\textrm{demand}} =\textrm{D}(p_0 )\)
\(\displaystyle x_{\textrm{supply}} =\textrm{S}(p_0 )\)
Note that we solve for the maximization problem of the demander of good \(x\) and the supplier of good \(x\) at price \(p_0\) to find the quantity demanded and quantity supplied at this particular price. We derive the demand and supply curves by solving for quantity demanded and supplied at many prices points and connecting the resulting pairs of price and quantity demanded and supplied in a graph together.
3.3.2 How does demand (or supply) respond to a change in price?
What happens to demand and supply if \(p_0\) increases to \(p_0 +h\)?
\(\displaystyle x_{\textrm{d}} =\textrm{D}(p_0 +h)\)
\(\displaystyle x_{\textrm{s}} =\textrm{S}(p_0 +h)\)
With normal goods, we expect that demand for \(x\) decreases when price increases, and supply for \(x\) increases when price increases.
3.3.3 How sensitive are demands to price changes?
If when movie ticket doubles in price, the number of theater goers goes down just a little bit, perhaps theater chains could make a lot more money by raising price. In this case, price has a hard time shifting demand, hence demand is fairly inelastic with respect to price. If orange juice buyers find apple juice to be largely substitutable, then if the price of orange juice goes up, demand for orange juice might decrease a lot as consumers switch to apple juice. In this case, price has an easy time shifting demand, hence demand is fairly elastic with repsect to price.
To avoid thinking about the unit of price and unit of goods, we think of percentage changes: what is the percent change in quantity of goods demanded given a percent change in the price of that good?
- \(\displaystyle \frac{\textrm{Percent}\;\textrm{change}\;\textrm{in}\;\textrm{demand}\;\textrm{given}\;h\;\textrm{change}\;\textrm{in}\;\textrm{price}}{\textrm{Percent}\;\textrm{change}\;\textrm{in}\;\textrm{price}\;\textrm{when}\;\textrm{price}\;\textrm{increase}\;\textrm{by}\;h}\)
The price elasticity of demand at price \(p_0\) given \(h\) increase in price is:
- \(\displaystyle \frac{\left(\frac{\textrm{D}(p_0 +h)-\textrm{D}(p_0 )}{\textrm{D}(p_0 )}\right)}{\left(\frac{p_0 +h-p_0 }{p_0 }\right)}=\left(\frac{\textrm{D}(p_0 +h)-\textrm{D}(p_0 )}{\textrm{D}(p_0 )}\right)\cdot \left(\frac{p_0 }{h}\right)\)
If we know how to solve for the optimal demand, we can calculate this at every point \(x_0\) for small \(h\).
3.3.4 Point Elasticity and Derivative
If you solve for the elasticity formula above, you will find that as \(h\) decreases, the price elasticity of demand at \(p_0\) converges to a number. The number that the elasticity formula converges to is the point price elasticity of demand:
- \(\displaystyle \textrm{DemandElasticity}(p_0 )=\lim_{h\to 0} \left(\left(\frac{\textrm{D}(p_0 +h)-\textrm{D}(p_0 )}{\textrm{D}(p_0 )}\right)\cdot \left(\frac{p_0 }{h}\right)\right)\)
Some of the terms in the fomrula do not include \(h\), we can move them outside of the \(\lim\) symbol
- \(\displaystyle \textrm{DemandElasticity}(p_0 )=\left(\lim_{h\to 0} \left(\frac{\textrm{D}(p_0 +h)-\textrm{D}(p_0 )}{h}\right)\right)\cdot \frac{p_0 }{\textrm{D}(p_0 )}\)
This should look very familiary, it is exactly the formula for derivative of the demand funtion at \(p_0\).
- \(\displaystyle \textrm{DemandElasticity}(p_0 )={\textrm{D}}^{\prime } (p_0 )\cdot \frac{p_0 }{\textrm{D}(p_0 )}\)
This formula applies to all price \(p\)
- \(\displaystyle \textrm{DemandElasticity}(p_0 )={\textrm{D}}^{\prime } (p)\cdot \frac{p}{\textrm{D}(p)}\)
If we can derive the demand function, and it is differentiable over the domain of \(p\), then we can solve analytically for demand elasticity as a function of \(p\).
3.3.5 Inelastic, elastic and unit elastic
If the elasticity is \(0\), that means demand is fixed and does not change with price. If the demand elasticity obtained above is between \(0\) and \(-1\), the good is inelastic with respect to price. If the price elasticity is less than \(-1\), the good is elastic with respect to price. At \(1\), the good is unit elastic:
- \(\displaystyle \left\lbrace \begin{array}{c} -1<{\textrm{D}}^{\prime } (p)\cdot \frac{p}{\textrm{D}(p)}<0\textrm{,}\;\textrm{inelastic}\\ {\textrm{D}}^{\prime } (p)\cdot \frac{p}{\textrm{D}(p)}=-1\;\textrm{,}\;\textrm{unit}\;\textrm{elastic}\\ {\textrm{D}}^{\prime } (p)\cdot \frac{p}{\textrm{D}(p)}<-1\;\textrm{,}\;\textrm{elastic} \end{array}\right.\)
Theorem 3.6: If a good is inelastic, an increasein price leads to an increase in total expenditure, for an elastic good, an increase in price leads to a decrease in total expenditures.
3.4 Differential and Marginal Product
Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).
In economics papers, we often see these symbols: \(\Delta\), \(d\), \(\partial\)
\(\Delta y\) and \(\Delta x\) are changes along the function graph: given some \(x_0\):
- \(\displaystyle \Delta y=f(x_0 +\Delta x)-f(x_0 )\)
\(\textrm{d}y\) and \(\textrm{d}x\) are differentials, which are, at each point \((x,f(x))\), the changes in y for the tangent line given a change in \(x\):
\(\displaystyle \textrm{d}x=\Delta x\)
\(\displaystyle \textrm{d}y=f^{\prime } (x_0 )\cdot \textrm{d}x\)
we have seen that the tangent line to \(f(x)\) at \(x_0\) approximates the function \(f(x)\) around \(x_0\) (and is identical at \(x_0\)), so approximately, for small \(\Delta x\):
- \(\displaystyle \Delta y\approx \textrm{d}y\)
3.4.1 MPL for Cobb-Douglas
With this Cobb-Douglas production function:
\[F(K,L)=K^{\alpha } \cdot L^{1-\alpha }\]
As derived earlier, the derivative with respect to labor is (MPL=marginal product of labor):
\[\textrm{MPL}(K,L)=(1-\alpha )\cdot K^{\alpha } \cdot L^{-\alpha }\]
3.4.2 Interpreting MPL
In the above problem, suppose \(K_0 =1\) and \(L_0 =1\), and \(\alpha =0.5\). Without a calculator, we can calculate what output and marginal product of labor is:
\[F(K_0 =1,L_0 =1)=1\]
\[\textrm{MPL}(K_0 =1,L_0 =1)=0.5\]
This means the total output with one unit of worker and one unit of capital is \(1\).
Becareful about interpreting the \(\textrm{MPL}\) term (we are treating it as a function of continuous \(L\), some define MPL in terms of discrete increases in \(L\)), it is a derivative, which as we have discussed is the slope of the tangent line to the production function line with fixed \(K\) and \(L\) along the \(\textrm{x}\textrm{-}\textrm{axis}\). Which means if you increase labor by a infinitestimally small amount when existing \(K=1\) and \(L=1\), the slope of output increase will be \(0.5\). The actual output increase is that infinitestimally small increase in labor multiplied by \(0.5\). It is perhaps difficult to conceptualize what it means to multiply something infinitely small by another number. To make the idea more conconcret, we will think using \(\textrm{MPL}\) to approximate the increase in output given a small increase in labor.
3.4.3 Exact Output Calculated with Matlab
Continuing with the two numbers we can calculate without a calculator:
\[F(K_0 =1,L_0 =1)=1\]
\[\textrm{MPL}(K_0 =1,L_0 =1)=0.5\]
Suppose we are interested in the increase in output when labor increases from \(L_0 =1\) to \(L_1 =1.03\), what is the new output? What is the increase in output? (You can think of this as increasing the number of workers by 3 percentage points.)
Exact Solution: We can directly calculate this, very hard by hand, but using matlab:
% Define parameters, fixed K0
alpha = 0.5;
K0 = 1;
% Define equation with L is unknown
syms L
f(L) = K0^(alpha)*L^(1-alpha);
% two different L levels
L0 = 1;
L1 = 1.03;
% Fill the L0 and L1 values into the symbolic function
YL0 = subs(f, L0)
YL0(L) =
1em \(\displaystyle 1\)
YL1 = subs(f, L1)
YL1(L) =
1em \(\displaystyle \frac{\sqrt{103}}{10}\)
% Take difference
increaseOutput = YL1 - YL0
increaseOutput(L) =
1em \(\displaystyle \frac{\sqrt{103}}{10}-1\)
% Turn symbolic answer to double (easier to read), increase in output
increaseOutput = double(increaseOutput)
increaseOutput = 0.0149
% new level of output
newLevelOutput = double(YL1)
newLevelOutput = 1.0149
3.4.4 Approximate Output Increase with Derivative (MPL)
Remember as we have seen, the slope of the tangent line at \(L_0\) is similar to the slope of the line between \(L_0 +h\) and \(L_0\), from the definition of derivative, for \(h\) small, the following should be true:
- \(\displaystyle F_L^{\prime } (K_0 ,L_0 )\approx \frac{F(K_0 ,L_0 +h)-F(K_0 ,L_0 )}{h}\)
Just move the \(h\) from the right to the left, the increase in output is approximately:
- \(\displaystyle F(K_0 ,L_0 +h)-F(K_0 ,L_0 )\approx F_L^{\prime } (K_0 ,L_0 )\cdot h\)
Furthermore, the level of output is approximately:
- \(\displaystyle F(K_0 ,L_0 +h)\approx F(K_0 ,L_0 )+F_L^{\prime } (K_0 ,L_0 )\cdot h\)
In our case above, we can now approximate output levels using the two numbers we calculated by hand, with \(K_0 =1\) and \(L_0 =1\):
- \(\displaystyle F(K_0 ,L_0 +h)\approx F(K_0 ,L_0 )+F_L^{\prime } (K_0 ,L_0 )\cdot h=1+0.5\cdot h\)
Now with \({1+0.5\cdot h}\), that is something we can use very easily, back to 1st grade math. We calculated previously that if \(h=0.03\), the exact new level of output is \(1.0149\):
newLevelOutput
newLevelOutput = 1.0149
What is our approximated increase that we can calculate by hand? It is \(1.015\)
approximatedLevelOutput = 1 + 0.5 * 0.03
approximatedLevelOutput = 1.0150
These are almost identical.
3.4.5 First Order Taylor Polynomial Approximation
What we have just done is called First Order Taylor Polynomial Approximation, which can be written more generally as:
- \(\displaystyle F(X_0 +h)\approx F(X_0 )+F^{\prime } (X_0 )\cdot h\)
Often you see this written as below, these are equivalent:
- \(\displaystyle f(x)\approx f(a)+f^{\prime } (a)\cdot (x-a)\)
This is just another way to write down the differential formula described at the beginning
- \(\displaystyle F(X_0 +\Delta x)-F(X_0 )=\Delta Y\approx \textrm{d}Y=F^{\prime } (X_0 )\cdot \textrm{d}X\)
When solving economics problems, we often end up with functions that takes too much time to evaluate. To save time, we often approximate functions by the first order taylor approximation. We do this when we are solving for points around a point where we have already evaluated (a point where perhaps it is easier to evaluate the function). We just demonstrated this idea using the MPL example here, where we used something we can approximate using 1st grade algebra something that we would need a calculator (matlab) to compute accurately for us.
Analyze the functional form of MPL, what accurate is the 1st order taylor approximation or differential approximation for the same \(h\) increase in \(L\) if existing \(L\) is high vs if it is low?
3.5 Higher Order Derivatives–Cobb Douglas
Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).
We have the following general form for the Cobb-Douglas Production Function
\[Y(K,L)=K^{\alpha } \cdot L^{\beta }\]
The first order condition is
\[\frac{dY(K,L)}{dL}=(\beta )\cdot K^{\alpha } \cdot L^{\beta -1}\]
The derivative we have obtained is just another function. We can take additional derivatives with respect to this function.
\[\frac{{\textrm{d}}^2 Y(K,L)}{dL^2 }=(\beta )\cdot (\beta -1)\cdot K^{\alpha } \cdot L^{\beta -2}\]
Matlab symbolic toolbox gives us the same answer:
syms L K0 alpha beta
f(L, K0, alpha) = K0^(alpha)*L^(beta);
frsDeri = diff(f, L)
frsDeri(L, K0, alpha) =
1em \(\displaystyle {K_0 }^{\alpha } \,L^{\beta -1} \,\beta\)
secDeri = diff(diff(f, L),L)
secDeri(L, K0, alpha) =
1em \(\displaystyle {K_0 }^{\alpha } \,L^{\beta -2} \,\beta \,{\left(\beta -1\right)}\)
You can specify an additional parameter for the matlab diff function, if we want to take multiple derivatives:
syms L K0 alpha beta
f(L, K0, alpha) = K0^(alpha)*L^(beta);
% 5 for 5th derivative
fifthDeri = diff(f, L, 5)
tenthDeri(L, K0, alpha) =
1em \(\displaystyle {K_0 }^{\alpha } \,L^{\beta -5} \,\beta \,{\left(\beta -1\right)}\,{\left(\beta -2\right)}\,{\left(\beta -3\right)}\,{\left(\beta -4\right)}\)
3.5.1 Curvature and Second Derivative, Concave Function
Let’s graph out the second derivative when \(\beta =0.5\). The production function is concave (concave down). For a function that is twice continuously differentiable, the function is concave if and only if its second derivative is non-positive (never accelerating).
alpha = 0.5;
beta = 0.5;
K0 = 1;
% Note that we have 1 symbolic variable now, the others are numbers
syms L
f(L) = K0^(alpha)*L^(beta);
% note fDiff1L >= 0 always
fDiff1L = diff(f, L)
fDiff1L(L) =
1em \(\displaystyle \frac{1}{2\,\sqrt{L}}\)
% note fDiff2L <= 0 always
fDiff2L = diff(f, L, 2)
fDiff2L(L) =
1em \(\displaystyle -\frac{1}{4\,L^{3/2} }\)
% Start figure
figure();
hold on;
% fplot plots a function with one symbolic variable
fplot(f, [0.2, 3])
fplot(fDiff1L, [0.2, 3])
fplot(fDiff2L, [0.2, 3])
title({'Concave f(x), with K=1, beta=0.5 (decreasing return to scale for L)' 'First and Second Derivatives'})
ylabel({'First derivative is slope=f increase or decrease' '2nd deri is curvature=f increase faster or slower'})
xlabel('Current level of Labor')
legend(['f(x)'], ['First Derivative'], ['Second Derivative'], 'Location','SE');
grid on
3.5.2 Curvature and Second Derivative, Convex Function
Let’s graph out the second derivative when \(\beta =1.2\). The production function is convex (concave up). For a function that is twice continuously differentiable, the function is convex if and only if its second derivative is non-negative (never decelerating).
alpha = 0.5;
beta = 1.2;
K0 = 1;
% Note that we have 1 symbolic variable now, the others are numbers
syms L
f(L) = K0^(alpha)*L^(beta);
% Note here fDiff1L >= 0
fDiff1L = diff(f, L)
fDiff1L(L) =
1em \(\displaystyle \frac{6\,L^{1/5} }{5}\)
% Note here fDiff2L >= 0
fDiff2L = diff(f, L, 2)
fDiff2L(L) =
1em \(\displaystyle \frac{6}{25\,L^{4/5} }\)
% Start figure
figure();
hold on;
% fplot plots a function with one symbolic variable
fplot(f, [0.1, 3])
fplot(fDiff1L, [0.1, 3])
fplot(fDiff2L, [0.1, 3])
title({'Convex f(x), with K=1, beta=1.2 (increasing return to scale for L)' 'First and Second Derivatives'})
ylabel({'First derivative is slope=f increase or decrease' '2nd deri is curvature=f increase faster or slower'})
xlabel('Current level of Labor')
legend(['f(x)'], ['First Derivative'], ['Second Derivative'], 'Location','NW');
grid on


Cultural Blog - Empathy
Try the 'Just Like Me' and 'Loving Kindness' practices. How did you feel?
It was actually quite relaxing and also energizing. I finished it feeling quite refreshed.
Try the 'Traditional Practice of Loving Kindness' - Did you prefer this technique?
Obviously this is pretty easy when you are thinking about a loved one. With a neutral person in mind this is also not hard. But when one focuses on a very unpleasant person this one feels very insincere to me. I guess things take time!
Have you been in a situation in which Empathetic Listening could have improved a conversation? Or, describe a situation where empathetic listening practices worked well
Hmmm, I can't readily bring such a situation to mind. I'm sure there must have been a number of times when this pracitice would have been useful but I just can't think of any! (Memory failure...Oh dear...)
Give an example of "person praise" and "process praise"
Person praise: "You're a real natural at tennis". Process praise: "You've worked really hard on your tennis".


Library: layout.js
Overview
This is where we define the entrypoint for all of the different default
layouts that Timegrid is capable of, e.g. month, week, n-day, etc. Both
LayoutFactory and the common Layout superclass are defined in this file.
- author: masont
Constructors
Instantiates a Layout object. This constructor should always be overridden.
parameters
| EventSource | eventSource | the eventSource to pull events from |
| Object | params | a parameter hash |
methods
properties
Functions
Registers a layout class with this layout factory. Automatically places the
given layout under the common Layout superclass, and binds the name string
to the constructor.
parameters
| String | name | the name to bind to the given constructor |
| Function | constructor | the constructor to a layout class |
Instantiates a Timegrid layout with the given parameter hash.
parameters
| String | name | the name of the layout |
| EventSource | eventSource | an EventSource object to layout and render |
| params | a hash of parameters to be passed into the desired layout |
returns
| Timegrid.Layout | a Timegrid.Layout instance of the specified subclass |
A function to map date objects to a custom timezone
parameters
| date |
Takes a parameter hash and extends this layout with it, flattening key names
to lowercase as it goes. This is done to eliminate browser-specific
attribute case sensitivity.
parameters
| Object | params | a parameter hash |
Timegrid.Layout.computeCellSizes()
Computes the grid dimensions (gridheight, gridwidth, ycell, xcell) for this
layout. This is relatively complex since any of the above values can be
either user-specified or computed.
Renders out this layout into a DOM object with a wrapping div element as its
parent, returning the div.
parameters
| Element | container | the parent element |
returns
| Element | a rendered DOM tree descended from a div element |
An abstract method to render events for this layout. This method is where
specific layout implementations hook into the main rendering loop. While
generally used to render events, this method can return any valid input to
the jQuery
append
method, which is then appended under the grid
div
element.parameters
| Document | doc | the document to create elements from |
returns
| Content |
any valid argument to jQuery's append, to be appended under
the grid div
|
Timegrid.Layout.renderGridlines()
Renders the gridlines for this layout. Gridlines are represented in the DOM
as absolutely positioned
div
elements with one dimension set to
one pixel.returns
| Element | a DOM element containing this layout's gridlines |
Timegrid.Layout.renderXLabels()
Renders the horizontal column labels that run above the grid. The labels
themselves are provided by the implementing layout subclasses by
getXLabels()
returns
| Element | a DOM element containing the horizontal labels |
Timegrid.Layout.renderYLabels()
Renders the vertical row labels that run along the side of the grid. The
labels themselves are provided by the implementing layout subclasses by
getYLabels()
returns
| Element | a DOM element containing the vertical labels |
Timegrid.Layout.getXLabels()
An abstract method to get the horizontal column labels for this layout. This
method must be implemented by all layout types subclassing Layout.
returns
| Array | an array of strings to use as column labels |
Timegrid.Layout.getYLabels()
An abstract method to get the vertical row labels for this layout. This
method must be implemented by all layout types subclassing Layout.
returns
| Array | an array of strings to use as row labels |
Objects
An object containing a parameter hash
The number of columns in the grid
The number of rows in the grid
The height of the horizontal labels in pixels
The width of the vertical labels in pixels
Timegrid.Layout.tabHeight
The height of the tabs that page between views


|
Emotion
(Destiny's Child) |
|
It's
over and done
but the heartache lives on inside And who's the one you're clinging to instead of me tonight? And where are you now, now that I need you?   Tears on my pillow wherever you go I'll cry me a river that leads to your ocean You never see me fall apart In the words of a broken heart It's just emotion that's taken me over Caught up in sorrow, lost in my soul But if you don't come back Come home to me, darling Nobody left in this world to hold me tight Nobody left in this world to kiss goodnight Goodnight, goodnight |