Permalink
Browse files

Add lower bounds check for DOM tag reference

- Closes #189
  • Loading branch information...
lauft committed Nov 25, 2018
1 parent 067a475 commit c598f2bd669263c9296bcde014e296910bcef580
@@ -0,0 +1,13 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2

[**/man/**]
insert_final_newline = false
@@ -71,3 +71,4 @@ Thanks to the following, who submitted detailed bug reports and excellent sugges
sclo
ddombrowsky
triclops200
Valodim
@@ -37,6 +37,8 @@
(thanks to janikrabe)
- #174 Interval is split in two when it encloses month border
- #183 Hyphen in annotation gets padded with spaces
- #189 segfault on timew get dom.active.tag.0
(thanks to Valodim)
- Fixed error from totals.py while timer is active
(thanks to davisdude)
- Refactoring of Interval and Range
@@ -0,0 +1,88 @@
# Project Title

One Paragraph of project description goes here

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

What things you need to install the software and how to install them

```
Give examples
```

### Installing

A step by step series of examples that tell you have to get a development env running

Say what the step will be

```
Give the example
```

And repeat

```
until finished
```

End with an example of getting some data out of the system or using it for a little demo

## Running the tests

Explain how to run the automated tests for this system

### Break down into end to end tests

Explain what these tests test and why

```
Give an example
```

### And coding style tests

Explain what these tests test and why

```
Give an example
```

## Deployment

Add additional notes about how to deploy this on a live system

## Built With

* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
* [Maven](https://maven.apache.org/) - Dependency Management
* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

## Authors

* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth)

See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* Hat tip to anyone who's code was used
* Inspiration
* etc

@@ -0,0 +1,57 @@
#!/bin/bash

TODAY=$(date "+%Y%m%d")
YESTERDAY=$(date -d "yesterday" "+%Y%m%d")
CURRENT_HOUR=$(date +%k)

function get_current_date_with_delta()
{
local delta=${1}

let "hour = CURRENT_HOUR + delta"

if [[ ${hour} -lt 0 ]] ; then
let "hour = hour + 24"
day=${YESTERDAY}
else
day=${TODAY}
fi

if [[ ${hour} -lt 10 ]] ; then
hour="0${hour}"
fi

echo "${day}T${hour}0000"
}

export TIMEWARRIORDB=/home/lauft/Projects/timew/timewarriordb
rm -f ${TIMEWARRIORDB}/data/*.data
:> ${TIMEWARRIORDB}/timewarrior.cfg

cat <<EOF > ${TIMEWARRIORDB}/timewarrior.cfg
exclusions.monday = <9:00 >20:00
exclusions.tuesday = <9:00 >20:00
exclusions.wednesday = <9:00 >20:00
exclusions.thursday = <9:00 >20:00
exclusions.friday = <9:00 >20:00
exclusions.saturday = <9:00 >20:00
exclusions.sunday = <9:00 >20:00
reports.day.hours = auto
reports.week.hours = auto
reports.month.hours = auto
EOF

five_hours_before=$(get_current_date_with_delta "-5")
four_hours_before=$(get_current_date_with_delta "-4")
three_hours_before=$(get_current_date_with_delta "-3")
two_hours_before=$(get_current_date_with_delta "-2")
one_hour_before=$(get_current_date_with_delta "-1")
current_hour=$(get_current_date_with_delta "0")
one_hour_after=$(get_current_date_with_delta "1")
two_hours_after=$(get_current_date_with_delta "2")

src/timew track "${YESTERDAY}T1200" - "${YESTERDAY}T1400" FOO
src/timew start "${YESTERDAY}T1900" BAR
#src/timew week :month

echo "TI-103-1.sh: open interval from yesterday"
@@ -0,0 +1,58 @@
#!/bin/bash

TODAY=$(date "+%Y%m%d")
YESTERDAY=$(date -d "yesterday" "+%Y%m%d")
CURRENT_HOUR=$(date +%k)

function get_current_date_with_delta()
{
local delta=${1}

let "hour = CURRENT_HOUR + delta"

if [[ ${hour} -lt 0 ]] ; then
let "hour = hour + 24"
day=${YESTERDAY}
else
day=${TODAY}
fi

if [[ ${hour} -lt 10 ]] ; then
hour="0${hour}"
fi

echo "${day}T${hour}0000"
}

export TIMEWARRIORDB=/home/lauft/Projects/timew/timewarriordb
rm -f ${TIMEWARRIORDB}/data/*.data
:> ${TIMEWARRIORDB}/timewarrior.cfg

cat <<EOF > ${TIMEWARRIORDB}/timewarrior.cfg
exclusions.monday = <9:00 >20:00
exclusions.tuesday = <9:00 >20:00
exclusions.wednesday = <9:00 >20:00
exclusions.thursday = <9:00 >20:00
exclusions.friday = <9:00 >20:00
exclusions.saturday = <9:00 >20:00
exclusions.sunday = <9:00 >20:00
reports.day.hours = auto
reports.week.hours = auto
reports.month.hours = auto
EOF

five_hours_before=$(get_current_date_with_delta "-5")
four_hours_before=$(get_current_date_with_delta "-4")
three_hours_before=$(get_current_date_with_delta "-3")
two_hours_before=$(get_current_date_with_delta "-2")
one_hour_before=$(get_current_date_with_delta "-1")
current_hour=$(get_current_date_with_delta "0")
one_hour_after=$(get_current_date_with_delta "1")
two_hours_after=$(get_current_date_with_delta "2")

src/timew track "${YESTERDAY}T1200" - "${YESTERDAY}T1400" FOO
src/timew track "${YESTERDAY}T1900" - "${YESTERDAY}T2000" BAR1
src/timew start "${TODAY}T0900" BAR2
#src/timew week :month

echo "TI-103-2.sh: open interval today"
@@ -0,0 +1,56 @@
#!/bin/bash

TODAY=$(date "+%Y%m%d")
YESTERDAY=$(date -d "yesterday" "+%Y%m%d")
CURRENT_HOUR=$(date +%k)

function get_current_date_with_delta()
{
local delta=${1}

let "hour = CURRENT_HOUR + delta"

if [[ ${hour} -lt 0 ]] ; then
let "hour = hour + 24"
day=${YESTERDAY}
else
day=${TODAY}
fi

if [[ ${hour} -lt 10 ]] ; then
hour="0${hour}"
fi

echo "${day}T${hour}0000"
}

export TIMEWARRIORDB=/home/lauft/Projects/timew/timewarriordb
rm -f ${TIMEWARRIORDB}/data/*.data
:> ${TIMEWARRIORDB}/timewarrior.cfg

cat <<EOF > ${TIMEWARRIORDB}/timewarrior.cfg
exclusions.monday = <9:00 >20:00
exclusions.tuesday = <9:00 >20:00
exclusions.wednesday = <9:00 >20:00
exclusions.thursday = <9:00 >20:00
exclusions.friday = <9:00 >20:00
exclusions.saturday = <9:00 >20:00
exclusions.sunday = <9:00 >20:00
reports.day.hours = auto
reports.week.hours = auto
reports.month.hours = auto
EOF

five_hours_before=$(get_current_date_with_delta "-5")
four_hours_before=$(get_current_date_with_delta "-4")
three_hours_before=$(get_current_date_with_delta "-3")
two_hours_before=$(get_current_date_with_delta "-2")
one_hour_before=$(get_current_date_with_delta "-1")
current_hour=$(get_current_date_with_delta "0")
one_hour_after=$(get_current_date_with_delta "1")
two_hours_after=$(get_current_date_with_delta "2")

src/timew track "${YESTERDAY}T1200" - "${YESTERDAY}T1400" FOO
#src/timew week :month

echo "TI-103.sh: no open interval"
@@ -0,0 +1,58 @@
#!/bin/bash

TODAY=$(date "+%Y%m%d")
YESTERDAY=$(date -d "yesterday" "+%Y%m%d")
CURRENT_HOUR=$(date +%k)

function get_current_date_with_delta()
{
local delta=${1}

let "hour = CURRENT_HOUR + delta"

if [[ ${hour} -lt 0 ]] ; then
let "hour = hour + 24"
day=${YESTERDAY}
else
day=${TODAY}
fi

if [[ ${hour} -lt 10 ]] ; then
hour="0${hour}"
fi

echo "${day}T${hour}0000"
}

export TIMEWARRIORDB=/home/lauft/Projects/timew/timewarriordb
rm -f ${TIMEWARRIORDB}/data/*.data
:> ${TIMEWARRIORDB}/timewarrior.cfg

cat <<EOF > ${TIMEWARRIORDB}/timewarrior.cfg
exclusions.monday = <9:00 >20:00
exclusions.tuesday = <9:00 >20:00
exclusions.wednesday = <9:00 >20:00
exclusions.thursday = <9:00 >20:00
exclusions.friday = <9:00 >20:00
exclusions.saturday = <9:00 >20:00
exclusions.sunday = <9:00 >20:00
reports.day.hours = auto
reports.week.hours = auto
reports.month.hours = auto
EOF

five_hours_before=$(get_current_date_with_delta "-5")
four_hours_before=$(get_current_date_with_delta "-4")
three_hours_before=$(get_current_date_with_delta "-3")
two_hours_before=$(get_current_date_with_delta "-2")
one_hour_before=$(get_current_date_with_delta "-1")
current_hour=$(get_current_date_with_delta "0")
one_hour_after=$(get_current_date_with_delta "1")
two_hours_after=$(get_current_date_with_delta "2")

src/timew track "${YESTERDAY}T1200" - "${YESTERDAY}T1400" FOO
src/timew track "${YESTERDAY}T1900" - "${YESTERDAY}T2000" BAR1
src/timew track "${TODAY}T0900" - "${TODAY}T1200" BAR2
#src/timew week :month

echo "TI-103-4.sh: closed interval today"
Oops, something went wrong.

0 comments on commit c598f2b

Please sign in to comment.