cursor

巡风视图函数源码学习--view.py

我的梦境 提交于 2019-12-01 17:10:09
记录一下巡风扫描器view.py这个脚本里的视图函数的学习,里面有一些print 代码是为了把数据打印出来小白我自己加的,勿怪勿怪。可能存在一些理解错误和不到位的地方,希望大佬多多指正。。 0x01:跳转到登陆页面 第二遍看这个脚本的源码时,想到一个问题,如果你在浏览器地址栏里输入 http://127.0.0.1/login 可以跳转到登陆页面,如果只输入 127.0.0.1 ,这时候并没有运行Login这个视图函数,却也能直接跳转到登陆页面,这是为什么呢?原来,在Main视图函数上面有这样两行代码: @app.route('/') @logincheck def Main(): 只输入127.0.0.1时,相当于访问了根目录,会运行Main视图函数,而要运行Main函数,要先运行logincheck这个用于判断是否已经登陆的修饰函数,因为此时还未登陆,在logincheck函数里给我们跳转到了Login函数。 return redirect(url_for('Login')) 好了,下面开始看代码(掉头发)。。 0x02:Login视图函数 为什么先看这个呢?因为你要先登陆啊(ps:屁话,不登陆怎么进入) @app.route('/login', methods=['get', 'post']) def Login(): if request.method == 'GET':

PL/SQL FOR LOOP IMPLICIT CURSOR

别说谁变了你拦得住时间么 提交于 2019-12-01 17:03:58
There are 2 tables EMPLOYEES and DEPARTMENTS with department_id as primary key for DEPARTMENTS and foreign key on EMPLOYEES . I want to print all the employee names that belong to a particular department. I know it can be easily achieved by JOINS or EXPLICIT cursors. I thought why not try with FOR loop and a IMPLICIT cursors. My question is if it is syntactically correct to write INTO like this. If so why is not assigning any values? DECLARE emp_dept_id employees.department_id%TYPE; emp_emp_id employees.employee_id%TYPE; emp_last_name employees.last_name%TYPE; dept_dept_id departments

Windows Forms RichTextBox cursor position

心已入冬 提交于 2019-12-01 15:38:29
I have a C# Windows Forms program that has a RichTextBox control. Whenever the text inside the box is changed (other than typing that change), the cursor goes back to the beginning. In other words, when the text in the RichTextBox is changed by using the Text property, it makes the cursor jump back. How can I keep the cursor in the same position or move it along with the edited text? Thanks You can store the cursor position before making the change, and then restore it afterwards: int i = richTextBox1.SelectionStart; richTextBox1.Text += "foo"; richTextBox1.SelectionStart = i; You might also

How do I change the color of the text cursor in an input field in IE?

二次信任 提交于 2019-12-01 15:19:51
From what I saw, in Firefox and Chrome, the color of the text cursor in an input field changes to the value of the "color" css property. However in IE it has no effect whatsoever. Is there any way to achieve this effect in IE? Joey The color of the text cursor in an input on IE is always the inverse of the background color. So you can't on IE. This is also unspecced by W3C so don't expect support to be anywhere, if there is, then it's merely an artifact :-) Edit: 9-years later and we now have caret-color , but not for IE or Edge. Works on other browsers. 来源: https://stackoverflow.com/questions

Source Insight 常用设置和快捷键大全

旧巷老猫 提交于 2019-12-01 14:42:58
Source Insight 4.0 文件类型、编码格式、tab转空格、tab键自动补全设置。。。 http://www.cnblogs.com/bluestorm/p/6864540.html 1.括号配对高亮: “在前括号左侧,后括号左侧” 双击鼠标左键,可以选定匹配括号和其中内容(<>,(),L{R},[]之间) 2.让{ 和 } 不缩进: Options -> Document Options -> Auto Indenting -> Auto Indent Type 选 Simple 还有:让{ 和 } 不缩进: options->document options->auto indent 去掉indent Open Brace和Indent Close Brace。 (不好使,括号无法配对对齐!) 3.添加文件类型 用户可以定义自己的类型,Options->Document Options->add type,定义文件类型名以及文件名后缀。 勾选include when adding to projects在添加目录下文件到工程是该类文件就会添加进SI的工程。 如果需要将所有文件添加进SI的工程,可以定义一种文件类型*.*。 如: *.java;*.jav;*.xml;*.json,*.gradle,*.bat,*.pro,*.mk,*.aidl,*.so, *.jpg

SQL: compare two table record by record

 ̄綄美尐妖づ 提交于 2019-12-01 14:32:36
I want to compare two tables recordby record. I have two cursor for each table. The code looks like this Declare Cursor c1 for SELECT * from Table1 OPEN c1 While @@Fetch_status=0 Begin Declare Cursor c2 for SELECT * from Table2 OPEN c2 WHILE @@Fetch_Status=0 Begin /*Comparison happens here*/ END END When fecthing, must I specify which cursor I am fetching and how do I do that? EDIT For each record in Table1 I want to Search Table2 for that record based on the primary key. When it is found, I want to update the extra column values in Table2 based on the value of a column in table1. When this

Windows Forms RichTextBox cursor position

懵懂的女人 提交于 2019-12-01 14:25:56
问题 I have a C# Windows Forms program that has a RichTextBox control. Whenever the text inside the box is changed (other than typing that change), the cursor goes back to the beginning. In other words, when the text in the RichTextBox is changed by using the Text property, it makes the cursor jump back. How can I keep the cursor in the same position or move it along with the edited text? Thanks 回答1: You can store the cursor position before making the change, and then restore it afterwards: int i

Edge customize cursor doesn't work

最后都变了- 提交于 2019-12-01 12:45:35
Below is my code, cursor1.cur icon is under the same root folder as index.html. The cur icon can be downloaded from this link: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/cursors/cursor1.cur It works well in IE11, but doesn't work in Edge. Can anyone help me? Update: if replace cursor1.cur with url: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/cursors/cursor1.cur . It works in Edge as well. But still I'd like to know how to use relative path in Edge. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title of the document</title> <style

Creating a cursor on a temp table - is it safe?

北城以北 提交于 2019-12-01 12:29:36
I know that creating and using cursors in SQL is neither safe nor efficient but sometimes it's the only alternative. And right now it is the only alternative I have. My question not how to avoid using cursors but how safe safe and what performance issues I will incur if the cursor is only operating on a temp table created on the fly within a stored procedure. I know cursors run slower than set operations and put a lock on tables that they're iterating. My temp table is a relatively small table containing just one field of type int and max 50 records. DECLARE @pD int DECLARE CurDB CURSOR FOR

Creating a cursor on a temp table - is it safe?

喜夏-厌秋 提交于 2019-12-01 11:15:25
问题 I know that creating and using cursors in SQL is neither safe nor efficient but sometimes it's the only alternative. And right now it is the only alternative I have. My question not how to avoid using cursors but how safe safe and what performance issues I will incur if the cursor is only operating on a temp table created on the fly within a stored procedure. I know cursors run slower than set operations and put a lock on tables that they're iterating. My temp table is a relatively small