外文分享

Calculate the string length in sed

Deadly 提交于 2021-02-20 02:36:29
问题 I was forced to calculate the string length in sed . The string is always a nonempty sequence of a 's. sed -n ':c /a/! be; s/^a/1/; s/0a/1/; s/1a/2/; s/2a/3/; s/3a/4/; s/4a/5/; s/5a/6/; s/6a/7/; s/7a/8/; s/8a/9/; s/9a/a0/; /a/ bc; :e p' It's quite long :) So now I wonder if it is possible to rewrite this script more concisely using the y or other sed command? I know that it is better to use awk or another tool. However, this is not a question here. Note that the sed script basically simulates

Is it possible to pass data after initializing the components?

北慕城南 提交于 2021-02-20 02:36:27
问题 I have three components as shown on the image below and use a custom form component in my feature component. However, there is not a direct parent-child relationship between these two components and there is also a form component between them. I pass data from feature to form using @Input propert that has input values inside a config data (let's say "configData") and then pass them to custom component via @Input property (let's say "configData.test" for test input) without any problem (I can

Troubleshooting SPARQL rCurl queries in R

旧城冷巷雨未停 提交于 2021-02-20 02:35:27
问题 I'm doing a sparql query against an authenticated endpoint in R using the SPARQL library. The same query/endpoint/user works using the rrdf package. Unfortuantely, once I get the query working, I need to process the data in R and update the graph with the answers, which rrdf can't do. Setting up a few variables first, the below query works using rrdf: sparql.remote(myEndpoint,myQuery,'rowvar',myUsername,myUserpwd) Using SPARQL, this does not work: SPARQL(myEndpoint,myQuery,curl_args=c(

Python Error: Using matplotlib: Truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

我们两清 提交于 2021-02-20 02:35:13
问题 So I am trying to plot a graph of 3 of my functions for a beam on one graph using the matplotlib module and am getting value errors when attempting to do so. The main bulk of code is: class beam(object): '''This class is models the deflection of a simply supported beam under multiple point loads, following Euler-Bernoulli theory and the principle of superposition ''' def __init__(self, E, I, L): '''The class costructor ''' self.E = E # Young's modulus of the beam in N/m^2 self.I = I # Second

Timespan formatting in Excel

邮差的信 提交于 2021-02-20 02:34:08
问题 I'm currently using the custom format, m:ss.00 , and it works perfectly for any times that exceed one minute, e.g. 1:02.47 . However, if I enter a time less than a minute, e.g. 57.66 , it gets transformed into 50:24.00 . I can get around this by entering 0:57.66 , but I'd rather not have to always type the leading 0: and I don't want the leading 0: displayed anyway. I'd like for it to understand that if I skip the number followed by a colon part, to interpret this as no minutes and simply

Access Attachment Dialog Window

流过昼夜 提交于 2021-02-20 02:33:03
问题 I am trying to open the window pictured in the following link using a commmand button in a form. Is it possible that anyone can show me how to do that? http://www.utteraccess.com/forum/Launching-Attachments-Dia-t1652872.html Thank you in advance! 回答1: I am not sure if you can call this specific dialog, but what you can do is use the generic FileDialog with the FilePicker option. Then save use that path to the file and copy the specific file to a shared location (probably somewhere where your

Performance is not increased even increased the work_mem size

无人久伴 提交于 2021-02-20 02:30:53
问题 I return a query which is taking Avg of 170 seconds to execute. I went through the PSQL documentation, they mentioned that if we increase work_mem the performance will increase. I increased the work_mem to 1000 MB even the performance is not improved. Note: I indexed all the field which are the part of the query. Below I am pasting the records present in the DB, query execution plan, query, result. The number of records present in the DB: event_logs=> select count(*) from events; count ------

ThreadPoolExecutor parameter configuration

纵饮孤独 提交于 2021-02-20 02:30:43
问题 I'm working with a client application which needs to request data from a Rest API. Many of these requests are independent, so they could be called asynchronously. I'm using ThreadPoolExecutor to do so, and I've seen it can be configured with several parameters: corePoolSize maxPoolSize queueCapacity I read this article and I understand the following: corePoolSize is the value below of which executor adds a new thread rather than queuing it maxPoolSize is the value above of which executor

Performance is not increased even increased the work_mem size

泄露秘密 提交于 2021-02-20 02:30:08
问题 I return a query which is taking Avg of 170 seconds to execute. I went through the PSQL documentation, they mentioned that if we increase work_mem the performance will increase. I increased the work_mem to 1000 MB even the performance is not improved. Note: I indexed all the field which are the part of the query. Below I am pasting the records present in the DB, query execution plan, query, result. The number of records present in the DB: event_logs=> select count(*) from events; count ------

Performance is not increased even increased the work_mem size

依然范特西╮ 提交于 2021-02-20 02:30:06
问题 I return a query which is taking Avg of 170 seconds to execute. I went through the PSQL documentation, they mentioned that if we increase work_mem the performance will increase. I increased the work_mem to 1000 MB even the performance is not improved. Note: I indexed all the field which are the part of the query. Below I am pasting the records present in the DB, query execution plan, query, result. The number of records present in the DB: event_logs=> select count(*) from events; count ------