period

Linux recursively replace periods for all directorys and all but last period for files with underscores

匆匆过客 提交于 2021-02-10 15:13:57
问题 I have the following command which recursively renames all the files/directory's to lowercase and replaces spaces with _. find . -iname "*" | rename 'y/A-Z/a-z/; s/ /_/g;' How do I extend it to remove all periods from directories and leave just the last period for files? So input would be: this.is.a.directory this.is.a.file.txt Output this_is_a_directory this_is_a_file.txt 回答1: You can do this using find in a while loop and using a regex to leave last DOT for files: while IFS= read -rd ''

How to compare two java.time.Period in java 8?

半城伤御伤魂 提交于 2020-05-27 05:58:25
问题 How do I compare two Periods in java 8? E.g. Period one = Period.of(10,0,0); Period two = Period.of(8,0,0); here in this case one is greater than two. 回答1: It is true that the comparison of two Period objects does not make sense in a general case, due to the undefined standard length of a month. However, in many situations you can quite well live with an implementation similar to that which follows. The contract will be similar to the contract of compareTo() : public int

Intersection and consolidation of time periods in SQL

一个人想着一个人 提交于 2020-02-22 15:32:05
问题 I want to achieve similar function that is available in Time Period Library for .NET, but in SQL. First, I have a table with several rows with an Start Date and an End Date, and I want to consolidate them together like this: Then with that result and another coming from a different table, I want to find out the intersection between the two of them, like this but only 2 inputs (find the periods that are present in both): Once I have the intersection is just summing up the time on it. Here I

Noda Time: Period.Between returning incorrect value

僤鯓⒐⒋嵵緔 提交于 2020-01-13 11:35:08
问题 I have a trouble with NodaTime lib. My goal: compute Year/Month/Date between two dates. So, here is my test example: private static void Main() { var list = new List<Tuple<DateTime, DateTime>> { new Tuple<DateTime, DateTime>(new DateTime(1980, 1, 1), new DateTime(1983, 12, 31)), new Tuple<DateTime, DateTime>(new DateTime(2009, 1, 1), new DateTime(2015, 01, 23)) }; var totalPeriod = Period.Zero; foreach (var tuple in list) { var dateFrom = tuple.Item1; var dateTo = tuple.Item2; var ld1 = new

How to use period in PARM parameters (JCL)?

浪子不回头ぞ 提交于 2020-01-06 08:04:24
问题 The situation is the following. I have PARM parameters: CSQ1 - Queue manager name CARD.PAYMENTS - Request queue name CCD3050.REPLY - Reply queue name CCD3050 - Contestant user ID 400.05 - Payment amount "MY PAYMENT" - Payment description In my JCL I wrote this so: //PAYMENT EXEC PGM=PAYMENT,REGION=1024K, // PARM='CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050, // 400.05,"MY PAYMENT"' I had a trouble. I wrote: // PARM=('CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050', // '400.05,MY PAYMENT') And had a

How to measure the period between the peaks or lows of waves?

蓝咒 提交于 2020-01-06 03:49:06
问题 I want to measure the period between the peaks/lows of the adjacent waves shown in the figure. This is an oscillatory behavior of calcium concentration in a cell. The peaks are not the same, hence I would need to calculate the peak/lows for each wave , obtain the corresponding time associated with the peaks/lows , and find the difference between adjacent peaks/lows . I have stored the calcium concentration values for every time " 0.01 ". Can anyone suggest me how I should code it? I would

postgresql: splitting time period at event

谁说胖子不能爱 提交于 2020-01-05 05:30:24
问题 I have a table of country-periods. In some cases, certain country attributes (e.g. the capital) changes on a date within a time period. Here I would like to split the country-period into two new periods, one before and one after this change. Example: Country | start_date | end_date | event_date A | 1960-01-01 | 1999-12-31 | 1994-07-20 B | 1926-01-01 | 1995-12-31 | NULL Desired output: Country | start_date | end_date | event_date A | 1960-01-01 | 1994-07-19 | 1994-07-20 A | 1994-07-20 | 1999

RTCP receiver report sending interval

≯℡__Kan透↙ 提交于 2020-01-04 13:39:03
问题 What is the sending interval of RTCP Receiver Report? In RFC 3550 I was only able to find computation the RTCP Transmission Interval for the server. But as a client I have no idea about members and senders (or do I?). So I'm a little bit confuse how to calculate the interval or should I send RTCP RR in periods or should I only send RR packet when SR is received? 回答1: The RTP and RTCP protocols don't make a distinction between client and server. Both are members within the RTP session and both

RTCP receiver report sending interval

混江龙づ霸主 提交于 2020-01-04 13:38:58
问题 What is the sending interval of RTCP Receiver Report? In RFC 3550 I was only able to find computation the RTCP Transmission Interval for the server. But as a client I have no idea about members and senders (or do I?). So I'm a little bit confuse how to calculate the interval or should I send RTCP RR in periods or should I only send RR packet when SR is received? 回答1: The RTP and RTCP protocols don't make a distinction between client and server. Both are members within the RTP session and both