This code sends a simple text-only email to [email protected]
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'The Profile Name',
@recipients = '[email protected]',
@body = 'This is a simple email sent from SQL Server.',
@subject = 'Simple email'
HTML content must be passed to sp_send_dbmail
SQL Server 2012
DECLARE @html VARCHAR(MAX);
SET @html = CONCAT
(
'<html><body>',
'<h1>Some Header Text</h1>',
'<p>Some paragraph text</p>',
'</body></html>'
)
SQL Server 2012
...
auto is used in the syntax for trailing return type:
auto main() -> int {}
which is equivalent to
int main() {}
Mostly useful combined with decltype to use parameters instead of std::declval<T>:
template <typename T1, typename T2>
auto Add(const T1& lhs, const T2& rh...
To obtain an instance of an HTTP Request, class Illuminate\Http\Request need to be type hint either in the constructor or the method of the controller.
Example code:
<?php
namespace App\Http\Controllers;
/* Here how we illuminate the request class in controller */
use Illuminate\Http\Re...
HTML email is the use of a subset of HTML and CSS to format an email message like a web page using colors, graphics, table columns and links.
When you send an email it’s important to send both plain text and HTML. You do this by sending your email as multi-part MIME. Most email service providers ha...
ActionMailer supports three callbacks
before_action
after_action
around_action
Provide these in your Mailer class
class UserMailer < ApplicationMailer
after_action :set_delivery_options, :prevent_delivery_to_guests, :set_business_headers
Then create these methods under the private ...
To detect multiple features at once, use the and operator.
@supports (transform: translateZ(1px)) and (transform-style: preserve-3d) and (perspective: 1px) {
/* Probably do some fancy 3d stuff here */
}
There is also an or operator and a not operator:
@supports (display: flex) or (display...
In this example, Tags array may contain various keywords like ["promo", "sales"], so we can open this array and filter values:
select ProductID, Name, Color, Size, Price, Quantity
from Product
CROSS APPLY OPENJSON(Data, '$.Tags')
where value = 'sales'
OPENJSON will op...
OPENJSON function parse JSON text and returns all key:value pairs at the first level of JSON:
declare @json NVARCHAR(4000) = N'{"Name":"Joe","age":27,"skills":["C#","SQL"]}';
SELECT * FROM OPENJSON(@json);
keyvaluetypeNameJoe1age272ski...
Subdomain-based routing can be handled in Symfony using host parameter. For example, _locale parameter can be used as subdomain value.
Assuming
locale: en
domain: somedomain.com
parameters are defined in parameters.yml config file, route would be:
/**
* @Route(
* "/",
* ...
CommandUsageaboutShort information about ComposerarchiveCreate an archive of this composer packagebrowseOpens the package's repository URL or homepage in your browser.clear-cacheClears composer's internal package cache.clearcacheClears composer's internal package cache.configSet config optionscreate...
The fact that the garbage collection will clean up does not mean that you should wait for the garbage collection cycle to clean up.
In particular you should not wait for garbage collection to close file handles, database connections and open network connections.
for example:
In the following code...
class Tutorial extends Game {
public ScreenNumberOne screenNumberOne;
public void create(){
screenNumberOne = new ScreenNumberOne(this);
this.setScreen(screenNumberOne);
}
public void render() {
super.render();
}
}
That is the basic...
In this example you will learn how to generate RSA-OAEP key pair and how to convert private key from this key pair to base64 so you can use it with OpenSSL etc. Please note that this process can also be used for public key you just have to use prefix and suffix below:
-----BEGIN PUBLIC KEY-----
--...
So, have you ever wondered how to use your PEM RSA key pair that was generated by OpenSSL in Web Cryptography API? If the answers is yes. Great! You are going to find out.
NOTE: This process can also be used for public key, you only need to change prefix and suffix to:
-----BEGIN PUBLIC KEY-----
...
When the only thing returned from a function is a recursive call, it is refered to as tail recursion.
Here's an example countdown written using tail recursion:
def countdown(n):
if n == 0:
print "Blastoff!"
else:
print n
countdown(n-1)
Any computat...
By default Python's recursion stack cannot exceed 1000 frames. This can be changed by setting the sys.setrecursionlimit(15000) which is faster however, this method consumes more memory. Instead, we can also solve the Tail Recursion problem using stack introspection.
#!/usr/bin/env python2.4
# This...
class Example
def example_method
:example
end
def subexample_method
:example
end
def not_missed_method
:example
end
def method_missing name
return :example if name == :missing_example_method
return :example if name == :missing_subexample_method
...