last

Audit(二)--清理Audit数据

五迷三道 提交于 2019-12-03 05:17:28
(一) 概述 Audit的数据主要存储在sys.aud$表中,该表默认位于system表空间中,我们根据需求,将该表移到了sysaux表空间中。由于审计数据量较大,需要经常关注sysaux表空间的使用情况,同时根据实际情况对sys.aud$表进行数据清理。 (二) 清理步骤 (1)使用sys账号登陆数据库,打开计时功能,方便查看每一个命令的执行时间 SQL> set timing on (2)在清理数据之前先查看数据量大小 SQL> select count(*) from sys.aud$; (3)查看Audit表中最早一笔数据的时间,即审计表中记录的最早的时间 SQL> select min(ntimestamp#) from sys.aud$; MIN(NTIMESTAMP#) ---------------------------------------- 23-11月-16 08.18.54.496893 上午 (4)查看审计数据最后归档时间,只有归档的数据才能删除 SQL> SELECT * FROM dba_audit_mgmt_last_arch_ts; AUDIT_TRAIL RAC_INSTANCE LAST_ARCHIVE_TS ----------- ------------ -------------------------------- STANDARD

[算法模版]子序列DP

点点圈 提交于 2019-12-03 04:29:17
[算法模版]子序列DP 如何求本质不同子序列个数? 朴素DP 复杂度为 \(O(nq)\) 。其中 \(q\) 为字符集大小。 \(dp[i]\) 代表以第 \(i\) 个数结尾的本质不同子序列个数。注意,这里对于每一个字符,只计算 上一个相同字符 带来的贡献。如果全部计算的话会算重复。 最后统计答案的时候也只统计每个字符最后一次出现的位置的答案。 例题: 【线上训练13】子序列 中的50分部分分 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; const int maxn=2e6+100,mod=998244353; typedef long long ll; char s[2][maxn],ori[maxn]; int n,len=1; int last[30]; ll dp[maxn]; void init() { scanf("%s",ori+1); s[1][1]=ori[1]; for(int i=2;i<=n;i++) { int md=i&1; for(int j=1;j<=len;j++) { s[md][2*j-1]=ori[i]; s[md][2*j]=s[md^1][j]; } s[md

测试函数——PYTHON编程从入门到实践

孤人 提交于 2019-12-03 03:44:28
更多技术资讯可关注:gzitcast 学习测试,得有测试的代码。下面是一个简单的函数: name_function.py def get_formatted_name(first, last): """Generate a neatly formatted full name.""" full_name = first + ' ' + last return full_name.title()   为核实get_formatted_name()像期望的那样工作,编写一个使用这个函数的程序: [url=] [/url] names.py from name_function import get_formatted_nameprint("Enter 'q' at any time to quit.")while True: first = input("\nPlease give me a first name: ") if first == 'q': break last = input("Please give me a last name: ") if last == 'q': break formatted_name = get_formatted_name(first, last) print("\tNeatly formatted name: " + formatted

getting the last modified date of a html file

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: how can i figure out the last modified date of a html file im importing into my web app? The html file is on another server and different users can make updates, when i retrieve the page i want to be able see when it was last updated so i can label the updated date on my homepage. I 回答1: Use the document.lastModified Javascript property. quirksmode has a nice function to format the date too: http://www.quirksmode.org/js/lastmod.html 回答2: I assume you are using HTTP to retrieve the page. In that case you can use the HEAD method of HTTP to get

Using SED to Get the Last n Lines of a Huge Text File

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I use "sed" command to get the last n lines of a huge text file (e.g. A.txt) and copy them into a new text file(e.g. B.txt)? I do not want to remove that lines from A.txt. 回答1: You don't. You use tail -n NUMLINES for that. tail -n 100 A.txt > B.txt 回答2: Here's how to use sed to print the last 10 lines of a file: sed -e :a -e '$q;N;11,$D;ba' You should probably only use this if you're planning on executing more sed commands on these lines. Otherwise the tail command is designed for this job. 回答3: Using GNU sed, here's how to get the

Last Modified Date of a file on a web site

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to get the Last-Modified-Date of a file on a Web Site? i.e. Here is an example file I have out there: http://www.ymcadetroit.org/atf/cf/%7B2101903E-A11A-4532-A64D-9D823368A605%7D/Birmingham_Youth_Sports_Parent_Manual.pdf 回答1: Go to the website you want to know about, wait for it to fully load, then go to the address bar and write this: javascript:alert(document.lastModified) You'll get a popup that says when it was last modified. 回答2: The HTTP intends the Last-Modified header field to declare the last modification date. But

cumulative histogram has last point at y=0

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am creating histogram with pylab.hist(data,weights,histtype='step',normed=False,bins=150,cumulative=True) getting (there are other plots, which are irrelevant now) the violet line Why is the histogram dropping to zero at the end again? Cumulative functions should be in general non-decreasing. Is there a way to work around this, be it bug or feature? EDIT: solution (hack): # histtype=step returns a single patch, open polygon n,bins,patches=pylab.hist(data,weights,histtype='step',cumulative=True) # just delete the last point patches[0].set

Get current user's last logon

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to get the current's user last logon. I might be this current session or it might be one before that. I am calling GetUserName() to get the current username. I feed that into NetUserGetInfo() to try to get the last logon time. All this fails with error 2221 (user not found). When I tried with "administrator" it works. Even when I hardcode my username it returns a 2221. This is what I am using: nStatus = NetUserGetInfo ( NULL , L "administrator" , dwLevel , ( LPBYTE *) & pBuf ); How can you get the current user's last

How to import last 100 rows using read.csv() in R

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi I've a huge file and i want to import only the last 100 rows from that file. How can we do that using read.csv() or any alternative? 回答1: The package R.utils has a function called countLines(). You could do: l2keep <- 10 nL <- countLines("your.csv") df <- read.csv("your.csv", header=FALSE, skip=nL-l2keep) 回答2: If you are on a *nix system, you are better off using the tail -n 100 command to take the last 100 rows. Anything implemented in R would be slower and potentially much slower is your file is truly huge. If you are using Windows, you

get_or_create throws Integrity Error

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Given that the whole point of object.get_or_create() is to get the object if it already exists, I fail to see why it's throwing an integrity error for this code: class UserAdd(TemplateView): def post(self, request, *args, **kwargs): context = self.get_context_data(*args, **kwargs) form = UserAddForm(request.POST) if form.is_valid(): first_name = form.cleaned_data['first_name'] last_name = form.cleaned_data['last_name'] myemail = form.cleaned_data['email'] mypass = form.cleaned_data['password'] if myemail and mypass: myuser,created = User