A copy of any written motion which may not be heard ex parte and a copy of the notice of the hearing thereof, shall be served on the adverse party a reasonable time before the time specified for the hearing.