Maximum length of a cookie is 4K.
Only 300 cookies are allowed in a browser.
There’s also a limit of 20 cookies per server / domain.
Maximum length of a cookie is 4K.
Only 300 cookies are allowed in a browser.
There’s also a limit of 20 cookies per server / domain.
FF will display borders OUTSIDE of a div element, adding the border width to the element widget. IE will squeeze borders INSIDE and the total width stays the same.
Workaround for this which makes FF behave like IE:
* {
-moz-box-sizing: border-box;
}
(* applies it to all elements, if you don’t need that, add it only to a desired element)
PhpBB stores dates in INT fields in Unix time format, meaning the integer value equals to the number of seconds since 1/1/1970.
To view the date in standard format, use FROM_UNIXTIME(field) function:
select user_id, username, FROM_UNIXTIME(user_regdate) as d from phpbb_users
To select a time interval, we need to use FROM_UNIXTIME( ) function with a DATE_ADD() or DATE_SUB() .
Example: select fields created less than 23 hours ago:
select user_id from phpbb_users where
FROM_UNIXTIME(user_regdate) > DATE_SUB(NOW(), interval 23 hour)
In command line type:
wscript //H:cscript
or
wscript //H:wscript
This registers either Cscript.exe or Wscript.exe as the default script host for running scripts. If neither is specified, the default is Wscript.exe.
BACKUP LOG database_name WITH TRUNCATE_ONLY
USE database_name
GO
DBCC SHRINKFILE (database_name_log, 1)
GO
Call sp_spaceused.
If the size of a table is needed, use it with a table name: sp_spaceused table_name.
We have a lot of separate files and want to put them together into one.
Step 1: Create a list of all filenames as XML file
<files>
<file>file1.xml</file>
<file>file2.xml</file>
<file>file3.xml</file>
</files>
Step 2: Create an XSL transform
<xsl:template match="//files">
<Root>
<xsl:for-each select="file">
<xsl:copy-of select="document(.)"/>
</xsl:for-each>
</Root>
</xsl:template>
Note the use of “copy-of” – it will copy all the nodes and attributes from the source XML.
We have “DISTINCT” to select unique entries, but what about duplicates? Here’s how:
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )
Instead of using long “select-case when-else” construction, we can use COALESCE function when we want to check if the value is NULL (this makes the code much shorter)
This is the long CASE WHEN construction:
CASE
WHEN (expression1 IS NULL) THEN 0
ELSE expression1
Here’s the use of COALESCE function
COALESCE(expression1,0)
Code:
daysInMonth = Day(DateSerial(thisYear, thisMonth + 1, 0))
It adds 1 to the month and uses DateSerial to get a Date representing the 0th day of the following month. That is the last day of the month you entered. The Day function gives you the number of that day, which equals the number of days in the month.