Day based Weekly Schedule for a particular date range

I would like my clients to specify a date range and then on a corresponding table or otherwise, specify the days of the week and the start and end times within this period they would like service. e.g. ‘Monday’ @ such a start time and such an end time, Tuesday@ such a start time and such an end time, etc.

I need it to then tally up the number of days within the range, that occur…

E.g. if I wanted service every Tuesday, Thursday and Sunday between 24 January 2019 and 6 February, it would return the number of bookings, i.e. 7 bookings. And then a separate tally on hours… lets say there are different schedules for each of these days?

Please help.

Gather list of all IDs ordered by submission date and ID by parsing file path

This code is to gather a sorted list of IDs (first by ID, then by date) recursively from a directory that submitted a particular type of file (that, as you can tell, includes the word “Magic”) and then outputs the IDs paired with the modified date (the closest proxy I have for the submission date) to a CSV. (Where I then dedupe by ID to get the earliest submission for each ID/find average number of unique IDs submitted a month over the year/ the total submitted for the year):

Get-ChildItem -Recurse -Include *Magic* |   Where-Object {$  _.lastWriteTime -gt '01/01/2018' -AND $  _.lastWriteTime -lt '12/31/2018'} |  Select-Object -Property Directory, lastWriteTime | ForEach-Object -Begin {      $  holder=@{}       $  results=@() } -Process {     $  holder.id= [regex]::match($  _.Directory,'(\d{8})')     $  holder.modifiedDate = Get-Date  $  _.lastWriteTime -Format 'yyyy/MM/dd'      $  results+=[pscustomobject]$  holder } -End {     $  results     }  |  Sort-Object -Property @{Expression = "id"; Descending = $  True;}, @{Expression = "modifiedDate"; Descending = $  False} |  Export-csv C:\Users\REDACTED\Desktop\REDACTED.csv 

This is my first attempt at writing something in powershell purely using the command prompt (which is to say, not scripting in the ISE as if it were Ruby using ifs and so forth) How could I have done this better and should I have organized the pipeline differently? I tried to avoid using variables like would have in the past and focused purely on piping the data I was interested in from beginning to end.

Docker: how to sync date between a CentOs host and a Debian container?

I have a CentOs host running a docker Debian container.

The container has the wrong localtime and timezone: how can I synchronize it with the host date?

I’m trying with mounting volumes on the docker-compose with /etc/localtime but it doesn’t work.

The solution I prefer should be one of them:

  • set a particular ENV in the Dockerfile
  • mount properly volumes in the docker-compose.yml

Simple local cache that checks by date else get from db

I’m looking for feedback on how this can be improved, basically what I’m trying to do is check if the cache has the object else check from the database.

I have list of ids, then I separate them based on if they already exist in the cache or not, based on the date as well. One list fetches from the cache, the other from the db. Then return the list. that way I don’t have to make multiple calls to cache/db.

The alternative is to implement a compound-key but I would rather not go that route

https://github.com/mel3kings/taxi-cab-api/blob/master/src/main/java/com/simple/controller/CabController.java

 private List<Cab> getFromCacheOrDb(CabTripsRequest request) {         Map<Boolean, List<String>> cachedCabs = request.getMedallions().stream().collect(                 partitioningBy(key -> {                     if (!cache.peek(key)) { return false; }                     return cache.get(key).stream().anyMatch(a -> a.getPickupDateTime().equals(request.getDate()));                 }));         List<Cab> response = cachedCabs.get(true).stream().map(k -> cache.get(k)).flatMap(List::stream)                 .filter(cab -> cab.getPickupDateTime().equals(request.getDate())).collect(toList());         if (cachedCabs.get(false).size() > 0) {             List<Cab> database = storage.fetch(cachedCabs.get(false), request.getDate());             response.addAll(database);             cache.save(database);         }         log.info("response from cache/db size:" + response.size());         return response;     } 

Should Android kernel version date match the release date?

In the process of checking the settings on my Sony Xperia XA I came across the Linux Kernel information. Version 3.18.35 was released in June 2016 but the date shown is from 2017:

3.18.35+ BuildUser@BuildHost #1 Fri Sep 15 05:31 CST 2017 

Is it normal for the date shown here to be later than the release date? I assume it may represent the last automatic update. Also, what does the + sign mean next to the version number?.

I have no idea what BuildUser@BuildHost is but I am hoping someone can reassure me that it is normal for Sony phones 🙂

What do I need to travel to London during the scheduled Brexit transition date? [on hold]

I’m a Belgian citizen. I’ll be traveling to London from March 25th until March 31th included. I’ll be working (following a training, actually) from March 25th until March 28th included, but will stay for tourism a few extra days to “live” the Brexit.

I’ll be able to come to London as a European citizen using only my European ID card, but how will I need to leave? Do I need a passport or something similar? I plan to come and go with the Eurostar.