When to Write Code Tests

Michael Hartl on when to write tests based on his experience

  • When a test is especially short or simple compared to the application code it tests, lean toward writing the test first.
  • When the desired behavior isn’t yet crystal clear, lean toward writing the application code first, then write a test to codify the result.
  • Because security is a top priority, err on the side of writing tests of the security model first.
  • Whenever a bug is found, write a test to reproduce it and protect against regressions, then write the application code to fix it. Lean against writing tests for code (such as detailed HTML structure) likely to change in the future.
  • Write tests before refactoring code, focusing on testing error-prone code that’s especially likely to break.

Bike Laws

Important Disclaimer: The following are laws that regulate bicycle use in Fort Wayne, Indiana. The statute language and titles have been edited for clarity and length. This list is not complete. Please use the reference links at the end to look up the exact language of the applicable laws.


Indiana Law – Definitions

§ 9-13-2-14 "Bicycle"

"Bicycle" means any foot-propelled vehicle, irrespective of the number of wheels in contact with the ground.

§ 9-13-2-73 "Highway or Street"

"Highway" or "street" means the entire width between the boundary lines of every publicly maintained way when any part of the way is open to the use of the public for purposes of vehicular travel in Indiana. The term includes an alley in a city or town.

§ 9-13-2-157 "Roadway"

"Roadway" means that part of a highway improved, designed, or ordinarily used for vehicular travel. The term does not include the sidewalk, berm, or shoulder, even if the sidewalk, berm, or shoulder is used by persons riding bicycles or other human powered vehicles.

§ IC 9-13-2-196 "Vehicle"

"Vehicle" means, except as otherwise provided in this section, a device in, upon, or by which a person or property is, or may be, transported or drawn upon a highway. The term does not include the following: (1) A device moved by human power. … (d) For purposes of IC 9-30-5, IC 9-30-6, IC 9-30-8, and IC 9-30-9 [Drunk Driving Laws], the term means a device for transportation by land or air. The term does not include an electric personal assistive mobility device.


Indiana Law – Bicycles

§ 9-21-11-1 Parents and guardians; authorizing or permitting violation of chapter; bicycles; application of chapter

  1. The parent of a child and the guardian of a protected person may not authorize or knowingly permit the child or protected person to violate this chapter.
  2. Subject to the exceptions stated, the provisions of this chapter applicable to bicycles apply whenever a bicycle is operated upon a highway or a path set aside for the exclusive use of bicycles.

§ 9-21-11-2 Roadways; rights and duties

A person riding a bicycle upon a roadway has all the rights and duties under this article that are applicable to a person who drives a vehicle, except the following:

  1. Special regulations of this article.
  2. Those provisions of this article that by their nature have no application.

§ 9-21-11-3 Operation; seats; passengers

  1. A person propelling a bicycle may not: (a) ride other than upon the permanent and regular seat attached to the bicycle; or (b) carry any other person upon the bicycle who is not seated upon a firmly attached and regular seat on the bicycle.
  2. A person may not ride upon a bicycle unless seated under this section.

§ 9-21-11-4 Number of passengers

A bicycle may not be used to carry more persons at one time than the number for which the bicycle is designed and equipped.

§ 9-21-11-6 No more than two abreast in roadway

A person riding a bicycle upon a roadway may not ride more than two abreast except on paths or parts of roadways set aside for the exclusive use of bicycles.

§ 9-21-11-7 Packages, bundles, or other articles preventing proper use of handlebars

A person who rides a bicycle may not carry a package, a bundle, or an article that prevents the person from keeping both hands upon the handlebars.

§ 9-21-11-8 Use of siren or whistle prohibited

A bicycle may not be equipped with and a person may not use upon a bicycle a siren or whistle.

§ 9-21-11-9 Lamps and reflectors

A bicycle operated on a highway from one-half (1/2) hour after sunset until one-half (1/2) hour before sunrise must be equipped with the following:

  1. A lamp on the front exhibiting a white light visible from a distance of at least 500 feet to the front.
  2. A lamp on the rear exhibiting a red light visible from a distance of 500 feet to the rear or a red reflector visible from a distance of 500 feet to the rear.

§ 9-21-11-10 Brakes

A bicycle must be equipped with a brake that will enable the person who operates the bicycle to make the braked wheels skid on dry, level, clean pavement.

§ 9-21-11-11 Highways; regulations and requirements

A person who operates a bicycle upon a highway shall observe the regulations and requirements of this article.

§ 9-21-3-7 Exception for bicycles at Red Lights [Vehicle Detection Errors]

If the operator of a bicycle approaches an intersection that is controlled by a traffic control signal, the operator may proceed through the intersection on a steady red signal only if the operator:

  • (i) comes to a complete stop at the intersection for at least one hundred twenty (120) seconds; and
  • (ii) exercises due caution as provided by law, otherwise treats the traffic control signal as a stop sign, and determines that it is safe to proceed.

[ Note: Bells are no longer required ]


Indiana Law – Bicyclists As Pedestrians

§ 9-21-17-3 Duty to obey cross walk signals.

A pedestrian shall obey the instructions of an official traffic control device specifically applicable to the pedestrian, unless otherwise directed by a police officer.

§ 9-21-17-5 Riding into the path of a vehicle prohibited

A pedestrian may not suddenly leave a curb or other place of safety and walk or run into the path of a vehicle that is so close as to constitute an immediate hazard.

§ 9-21-17-7 Crossing roadway at point not marked as a crosswalk must yield of right-of-way to traffic

A pedestrian crossing a roadway at a point other than within a marked crosswalk or within an unmarked crosswalk at an intersection shall yield the right-of-way to all vehicles upon the roadway.

§ 9-21-17-8 Pedestrian tunnel or overhead crossing must yield of right-of-way to traffic

A pedestrian crossing a roadway at a point where a pedestrian tunnel or overhead pedestrian crossing has been provided shall yield the right-of-way to all vehicles upon the roadway.

§ 9-21-17-9 Jaywalking prohibited

Between adjacent intersections at which traffic control signals are in operation, pedestrians may not cross at any place except in a marked crosswalk.

§ 9-21-17-10 Pedestrians must not cross at intersections diagonally

A pedestrian may not cross a roadway intersection diagonally unless authorized by official traffic control devices.

§ 9-21-17-11 Pedestrians must use the right half of Crosswalks.

Pedestrians shall move, whenever practicable, upon the right half of crosswalks.


Indiana Law – Bicyclists on the Road (Selected Laws)

§ 9-30-5-1 Operating While Intoxicated

A person who operates a vehicle with an alcohol concentration equivalent to at least 0.08 gram of alcohol but less than 0.15 gram of alcohol per 210 liters of the person’s breath commits a Class C misdemeanor.

§ 9-21-8-25 Signal must be used before turning or changing lanes.

A signal of intention to turn right or left shall be given continuously during not less than the last 200 feet traveled by a vehicle before turning or changing lanes.

§ 9-21-8-32 Duty to Obey Stop Signs

A person who drives a vehicle shall stop at an intersection where a stop sign is erected at one or more entrances to a through highway that are not a part of the through highway and proceed cautiously, yielding to vehicles that are not required to stop.

§ 9-21-8-28 Hand and arm signals; left turn; right turn; decrease in speed

All signals required under this chapter may be given by hand and arm. A signal given under this section shall be given from the left side of the vehicle in the following manner:

  1. A left turn is indicated by extending the hand and arm horizontally.
  2. A right turn is indicated by extending the hand and arm upward.
  3. A stop or decreased speed is indicated by extending the hand and arm downward.

Indiana Law for Motorists

§ 9-21-8-37 Motorists must use due care to avoid bicyclists

Notwithstanding other provisions of this article or a local ordinance, a person who drives a vehicle shall do the following: Exercise due care to avoid colliding with a pedestrian or a person propelling a human powered vehicle, giving an audible signal when necessary.


Fort Wayne City Code for Bicyclists

§ 74.02 Serial Number Required

It shall be unlawful to destroy, remove, alter, cover or deface the manufacturer’s serial number of any bicycle. It shall be unlawful for any person to own or have custody of a bicycle, the original manufacturer’s serial number of which has been destroyed, removed, altered, covered or defaced.

§ 74.34 Operation Of Bicycles

  1. Every person riding a bicycle upon a street shall be granted all of the rights and shall be subject to all of the duties applicable to the driver of a vehicle. Every person riding a bicycle upon a sidewalk shall be granted all of the rights and shall be subject to all of the duties applicable to a pedestrian.
  2. The regulations in the traffic code applicable to bicycles shall apply whenever a bicycle is operated upon any roadway or public sidewalk or upon any shared-use path, subject to those exceptions stated herein.
  3. The operator of a bicycle shall not overtake standing vehicles in a travel lane.

§ 74.35 Speed To Be Reasonable And Prudent To Surrounding Conditions

No person shall operate a bicycle at a speed greater than is reasonable and prudent under the conditions then existing.

§ 74.36 Emerging From Alleys Or Driveways

The operator of a bicycle emerging from an alley, driveway or building shall, upon approaching a sidewalk or the sidewalk area extending across any alleyway, yield the right-of-way to all pedestrians approaching on such sidewalk or sidewalk area, and upon entering the roadway shall yield the right-of-way to all vehicles approaching on such roadway.

§ 74.37 Parking Of Bicycles

No person shall park a bicycle upon the traveled portion of the street. Bicycles may be parked only upon the sidewalk area in a rack provided to support the bicycle, against a building or in such manner as to afford the least obstruction to pedestrian traffic.

§ 74.38 Riding On Sidewalk Area

  1. Whenever any person is riding a bicycle upon a sidewalk, such person shall yield the right-of-way to any pedestrian and shall give an audible signal before overtaking and passing such pedestrian.
  2. No person shall operate a moped or motorized bicycle on any sidewalk.

Fort Wayne City Code for Motorists

§ 71.06 Operation Of Vehicles In Roadways Where Bicycles Are Present

  1. Drivers to exercise due care. Every driver of a vehicle shall exercise due care to avoid colliding with any person operating a bicycle or other device propelled by human or animal power, upon any** roadway, and shall give warning by sounding the horn only when necessary; and shall exercise proper precautions when sharing the travel lanes with bicycles .
  2. Turning right in front of a bicycle. When a motor vehicle and a bicycle are traveling in the same direction on any highway, street, or road, the operator of the motor vehicle overtaking such bicycle traveling on the right side of the roadway shall not turn to the right in front of the bicycle at an intersection or at any alley or driveway until such vehicle has overtaken and is safely clear of the bicycle .
  3. Turning left in front of a bicycle. The driver of a vehicle within an intersection intending to turn to the left shall yield the right-of-way to a bicycle approaching from the opposite direction and which is within the intersection or so close thereto as to constitute an immediate hazard.
  4. Passing of bicycles. The operator of a motor vehicle passing a bicycle proceeding in the same direction on a highway, street, or road shall leave a safe distance, but not less than three feet, when passing the bicycle , and shall maintain that distance until safely past the overtaken bicycle .

§ 71.07 Operation Of Vehicles In Roadways With Bicycle Lanes

  1. Operating on roads with bicycle lanes. The driver or operator of any vehicle shall yield the right-of-way to an individual operating a bicycle on a designated bike lane.
  2. Turning on roads with bicycle lanes. The driver of a motor vehicle can only enter a bicycle lane to make a right turn when it is safe and unobstructed of all cyclists.
  3. Driving on bicycle lanes. The driver of a vehicle shall not drive, stand, or park the vehicle upon any on street path or lane designated by official signs or markings for the use of bicycles unless entering or exiting a legal parking space; or otherwise drive or place the vehicle in such a manner as to impede bicycle traffic on such path or lane.

§ 72.22 Stopping, Standing Or Parking Prohibited In Bike Lane

No vehicle shall be stopped, standing or parked except when necessary to avoid conflict with other traffic or in compliance with law or other direction of a police officer or traffic control device in any of the following places… (S) Upon any on-street bicycle facilities designated by signage and/or pavement marking for the shared use of motor vehicles and bicycles , or in such a manner as to impede bicycle traffic on such lane.


References

Photo: Bike Lane by Bill Dickinson used under the Creative Commons license. (unaltered)

Updated: April 30, 2019

Restoring Public Trust

Dr. Jeff Bernstein writing for the FOP Journal:

We certainly can do more. For example, if you see a firefighter put an oxygen mask on a cat and the TV cameras are there, just walk over and insert yourself into the frame. Then, immediately start CPR on the cat, and make sure your departmental patch is clearly visible to the camera! A similar technique will also work with the baby ducks stuck in the storm drain. While the firefighters are rescuing the baby ducks, you should personally bring the mother duck over so that she can reunite with her baby ducklings. Again, just make sure your police departmental patch is clearly visible to the cameras. The baby ducks will instinctively follow you and the mother duck, which is what we want. Also, don’t be afraid to just push the firefighters out of the way.

😂😂😂

The “Killer App” For Career Advancement

A great episode of the accidental creative by Todd Henry. My summary follows:

Spoiler. Its thought. It’s taking "time to think deeply about the problems you are facing, the relationships that you are you’re dealing with at work or personally. Taking the time think about the problems that you’ve been handed by you manager… Taking the time that is absolutely necessary to distill the noise we encounter on a daily basis into something actionable, something meaningful something that will have help us progress toward our ambitions."

It is about turning knowledge and noise into wisdom. We need to stop reacting to everything and step back and think deeply about it.

I guarantee you that if you walk into a meeting and you say, here is what we should do… and here is are the reasons why we should do it… and here is what I think the potential outcomes are… If you are able to give that kind of a response in a meeting because you have have actually spent time thinking and developing your thoughts and really exploring. Then your manager will say, who are you and where can I get four more like you? Because that well reasoned response is very rare.

So how do we build thought time into our lives? Mr. Henry offers four ways:

  1. Plan it. Try to do it during the hours most likely to be interrupted.
  2. Be consistent. Rituals can be important.
  3. Keep yourself in the dark room and play. Staying in a place of uncertainty that is uncomfortable. Don’t gravitate to the first answer. Deal with ambiguity and uncertainty. Train yourself to look for deeper answers.
  4. Synthesize thoughts. Look for bigger patterns. Connect domains.

"The goal is to develop responsiveness not reactivity. We want to be able to respond meaningfully with wisdom to problems, not just react to them. "

Overcast® Link


2019 Law Enforcement E-Bike Roundup

Pedego

Ridge Rider: Patroller Edition – Link

Trek

2019 Police Electric – Link

Bulls

Sentinel (LAPD) – Link

Rad Power Bikes

RadRover Electric Fat Bike – Link

Fuji

E-Traverse EVO 1.1 – Link

ELV Motors

Police Magnum Ui5 Electric Bike – Link

OHM

ABPS OHM Police eBike – Link

RECON Power Bikes

Commando Police Interceptor – Link

IZIP

E3 Dash Electric Police Bike – Link

Raleigh

Lore iE Electric Police Mountain Bike – Link

Sampson

eNFORCER 4″ Tire – Link

Start Today!

Great advice from Joshua Becker on starting today. Don’t wait. Today.

But how? Here are some helpful ideas to get you started, right now, today:

  1. Make one small step
  2. Remind yourself of all the reasons to start right now.
  3. The next time you feel the urge, read a helpful article.
  4. Find external motivation.
  5. Set a reward for yourself.