Some jQuery Event Methods.

Some jQuery Event Methods.

jQuery events are those tasks that can be detected by your web application. They are used to create dynamic web pages. An event represents the exact moment when something happens. This section contains a comprehensive list of event methods belonging to the latest jQuery library. All the methods are grouped into categories.

Below are some examples of jQuery events:

A mouse click, hover, etc.
Select a radio button.
An HTML form submission.
clicking on an element.
Scrolling of the web page etc.

List of jQuery Event Methods.

Mouse Events.

Method
Description

click()
Bind an event handler to be fired when the element is clicked, or trigger that handler on an element.

dblclick()
Bind an event handler to be fired when the element is double-clicked, or trigger that event on an element.

hover()
Bind one or two handlers to the selected elements, to be executed when the mouse pointer enters and leaves the elements.

mousedown()
Bind an event handler to be fired when the mouse button is pressed within the element, or trigger that event on an element.

mouseenter()
Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.

mouseleave()
Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.

mouseout()
Bind an event handler to be fired when the mouse pointer leaves the element, or trigger that event on an element.

mouseup()
Bind an event handler to be fired when the mouse button is released within the element, or trigger that event on an element.

Keyboard Events.

Method
Description

keydown()
Bind an event handler to be fired when a key is pressed and the element has keyboard focus, or trigger that event on an element.

keypress()
Bind an event handler to be fired when a keystroke occurs and the element has keyboard focus, or trigger that event on an element.

keyup()
Bind an event handler to be fired when a key is released and the element has keyboard focus, or trigger that event on an element.

Form Events.

Method
Description

blur()
Bind an event handler to be fired when the element loses keyboard focus, or trigger that event on an element.

change()
Bind an event handler to be fired when the element’s value changes, or trigger that event on an element.

focus()
Bind an event handler to be fired when the element gains keyboard focus, or trigger that event on an element.

focusin()
Bind an event handler to be fired when the element, or a descendant, gains keyboard focus.

focusout()
Bind an event handler to be fired when the element, or a descendant, loses keyboard focus.

select()
Bind an event handler to be fired when text in the element is selected, or trigger that event on an element.

submit()
Bind an event handler to be fired when the form element is submitted, or trigger that event on an element.

Document/Browser Events.

Method
Description

load()
Bind an event handler to be fired when the element finishes loading. Deprecated in favor of Ajax load() method.

ready()
Bind an event handler to be fired when the DOM is fully loaded.

resize()
Bind an event handler to be fired when the element is resized, or trigger that event on an element.

scroll()
Bind an event handler to be fired when the window’s or element’s scroll position changes, or trigger that event on an element.

Read Also.

The post Some jQuery Event Methods. appeared first on PHPFOREVER.

Flatlogic Admin Templates banner

.NET Foundation Advisory Council Call for Public Comment

Friends in the .NET community,

When the .NET Foundation was created, there was an important principle that the foundation and its work be transparent, open, and community driven. In order to ensure that the foundation delivers on this primary objective, the board of the .NET Foundation asked Shaun Walker, who has a long history leading and contributing to .NET open source projects, to develop an initial proposal for a community based advisory council to help guide the governance of the .NET Foundation. That proposal is now available for community comment.

There are many reasons we feel that an advisory council is needed. Our goal is to ensure that the foundations operation and governance is both efficient and effective when viewed from a community building perspective. Some of the practical reasons for the creation of the council are:

Providing a clear communication channel between the community and the board on the foundations community building activities. To provide a channel for community stakeholders to provide feedback and guidance on the foundations value proposition, governance model, and other important foundation level decisions.
Provide a set of known, high profile individuals who can advocate for and evangelize the benefits and services provided by the .NET foundation and evangelize the foundation’s mission.
Establishes a group of individuals, experienced in open source community cultivation and project governance, who can provide stewardship, education and leadership to open source .NET projects of all size, popularity, and stature.
To augment the capacity of the board, and distribute work of the foundation across more community members to increase the governance bandwidth of the foundation.

The proposal outlines the rationale for the advisory council, along with its mission, composition and structure. Shaun Walker did a masterful job in crafting a proposal that the board feels will contribute greatly to ensuring the foundation operates in a transparent, open, and community driven manner.

Today, we make the proposal available to you for review. Our objective is to solicit community feedback in order to improve the council proposal and ensure we are headed in an appropriate direction. The advisory council proposal review period will be 4 weeks (ending 11/10), after which Shaun and the board will incorporate appropriate feedback. The resulting proposal will be brought back to the board for discussion and, if appropriate, approval. Please direct your feedback and comments to the discussion forum.

I’d like to thank you in advance for the time you take to read the proposal and the guidance you provide to help us develop an advisory council that works for the community.

Jay Schmelzer President,
.NET Foundation

.NET Foundation Advisory Council Proposal (PDF)
Advisory Council Discussion on the Forums

How to Alter Column Datatypes in Snowflake

Snowflake is a great and ease to use platform. I am constantly moving workloads from Teradata, SQL Server, and Oracle to this platform.

However, I have encountered an interesting situation with an Oracle migration, specifically when you specify a column like number, such as in the following situation:

CREATE TABLE AS TEST_TABLE(A NUMBER, T VARCHAR2(10));

INSERT INTO TEST_TABLE(A,T) VALUES(10.123,‘A’);

INSERT INTO TEST_TABLE(A,T) VALUES(10.123567,‘B’);

In Oracle, when no precision is specified, numbers are stored as given.
In Snowflake, if we run the same code, NUMBER will be interpreted as NUMBER(38,0).
When you use SnowConvert, it will turn those column types to NUMBER(38,19) because the tool does not have enough information to determine the right precision.

But you might know which is the right precision. Let’s say NUMBER(20,4). I had hoped it would be as easy as using an ALTER COLUMN statement, but… sadly it is not. Snowflake’s ALTER COLUMN does not allow you to do that. So what can be done? Let’s take a look.

I came up with this solution. I can use a Snowflake JS procedure that will get the table definition, create a statement that will change my table, and run it.

CREATE OR REPLACE PROCEDURE ALTER_COLUMN(TABLE_NAME VARCHAR, TABLE_SCHEMA VARCHAR, TABLE_COLUMN VARCHAR, NEW_VALUE VARCHAR) RETURNS STRING
LANGUAGE JAVASCRIPT AS
$$
var EXEC = (sql,…binds)=>snowflake.execute({sqlText:sql,binds:binds});
var cols = EXEC(`SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME=UPPER(‘${TABLE_NAME}’) AND TABLE_SCHEMA=UPPER(‘${TABLE_SCHEMA}’)`);
var newSQL = `CREATE OR REPLACE TABLE ${TABLE_SCHEMA}.${TABLE_NAME} ASn SELECT n`;
var count = cols.getRowCount();
while (cols.next())
{
count–;
if (cols[‘COLUMN_NAME’] == TABLE_COLUMN)
newSQL += NEW_VALUE + “AS “ + cols[‘COLUMN_NAME’];
else
newSQL += cols[‘COLUMN_NAME’];
if (count > 0) { newSQL += “,n”;}
}
newSQL+=`n FROM ${TABLE_SCHEMA}.${TABLE_NAME}`;
EXEC(newSQL);
return `Column ${TABLE_COLUMN} change using expression ${NEW_VALUE}`;
$$;

(You can get the code from here.)

For the previous example, you can just run the following:
CALL ALTER_COLUMN(‘TEST_TABLE’,’PUBLIC’,’A’,’A::NUMBER(20,4)’);
Notice that the first parameter is the table name, the second is the table schema, the column name is the third, and finally the expression that will be used for conversion. Usually just a CAST expression, but it can be used for any conversion expression.

This proc has been a great timesaver for me, so I hope it is a good addition for your Snowflake Toolbox.