In Index page change the following:
error_reporting(E_ALL | E_STRICT);
to
error_reporting(E_ALL);
Set $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true
and uncomment this line (remove the #)
#ini_set('display_errors', 1);
You can also Set Dev Mode using SetEnv in your .htaccess file
To make th...
Template
<div id="example">
a={{ a }}, b={{ b }}
</div>
JavaScript
var vm = new Vue({
el: '#example',
data: {
a: 1
},
computed: {
// a computed getter
b: function () {
// `this` points to the vm instance
return this.a + 1
}...
The general format for namespaces is:
<Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>].
Examples include:
Fabrikam.Math
Litware.Security
Prefixing namespace names with a company name prevents namespaces from different companies from having the sa...
# Extract strings with a specific regex
df= df['col_name'].str.extract[r'[Aa-Zz]']
# Replace strings within a regex
df['col_name'].str.replace('Replace this', 'With this')
For information on how to match strings using regex, see Getting started with Regular Expressions.
The minimum required to use Webpack is the following command:
webpack ./src/index.js ./dist/bundle.js
// this is equivalent to:
webpack source-file destination-file
Web pack will take the source file, compile to the output destination and resolve any dependencies in the source files.
.htaccess can be used to force your HTTP site to redirect to HTTPS.
Here's a quick way that doesn't require editing the code for your domain:
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Warning: The code above assumes that you can tr...
Active patterns are just simple functions.
Like functions you can define additional parameters:
let (|HasExtension|_|) expected (uri : string) =
let result = uri.EndsWith (expected, StringComparison.CurrentCultureIgnoreCase)
match result with
| true -> Some true
| _ -> N...
The plotly package allows many kind of interactive plots, including maps. There are a few ways to create a map in plotly. Either supply the map data yourself (via plot_ly() or ggplotly()), use plotly's "native" mapping capabilities (via plot_geo() or plot_mapbox()), or even a combination o...
A do-while loop is very similar to a while loop, except that the condition is checked at the end of each cycle, not at the start. The loop is therefore guaranteed to execute at least once.
The following code will print 0, as the condition will evaluate to false at the end of the first iteration:
i...
Fortran 2003 introduced support for object oriented programming. This feature allows to take advantage of modern programming techniques. Derived types are defined with the following form:
TYPE [[, attr-list] :: ] name [(name-list)]
[def-stmts]
[PRIVATE statement or SEQUENCE statement]. . .
...
In order to obtain class-like behavior, type and related procedures (subroutine and functions) shall be placed in a module:
Example:
module MShape
implicit none
private
type, public :: Shape
private
integer :: radius
contains
procedure :: set => sh...
C++11
std::string supports iterators, and so you can use a ranged based loop to iterate through each character:
std::string str = "Hello World!";
for (auto c : str)
std::cout << c;
You can use a "traditional" for loop to loop through every character:
std::stri...
It should be noted that Fetch does not support progress callbacks. See: https://github.com/github/fetch/issues/89.
The alternative is to use XMLHttpRequest https://developer.mozilla.org/en-US/docs/Web/Events/progress.
fetch('https://mywebsite.com/mydata.json').then(json => console.log(json));
...
Note: You cannot develop react-native apps for iOS on Windows, only react-native android apps.
The official setup docs for react-native on windows can be found here. If you need more details there is a granular guide here.
Tools/Environment
Windows 10
command line tool (eg Powershell or window...
Starting with Asp.net 4.5 web controls can take advantage from strongly-typed binding to get IntelliSense support and compiletime errors.
Create a class, which holds your model:
public class Album
{
public int Id { get; set; }
public string Name { get; set; }
public string Artist {...
Let's say we have model Travel with many related fields:
class Travel(models.Model):
tags = models.ManyToManyField(
Tag,
related_name='travels', )
route_places = models.ManyToManyField(
RoutePlace,
related_name='travels', )
coordinate = models.F...
You can use Gradle to auto-increment your package version each time you build it. To do so create a version.properties file in the same directory as your build.gradle with the following contents:
VERSION_MAJOR=0
VERSION_MINOR=1
VERSION_BUILD=1
(Changing the values for major and minor as you s...