Tutorial by Examples: ect

One common pitfall is to try and use this in a nested function or an object, where the context has been lost. document.getElementById('myAJAXButton').onclick = function(){ makeAJAXRequest(function(result){ if (result) { // success this.className = 'success'; } }) }...
Download Play! 1. Goto http://www.playframework.com/download and download latest Play! release (play-2.5.X.zip at the time of this writing). Unzip in a directory of your choice. We’ll refer to uncompressed folder directory as PLAY_HOME. Add PLAY_HOME folder to you PATH environment variable, so that...
In a string formula field, consider that some values might contain substrings which look to the browser like HTML. Unless this is intentional, it is important to protect the values from corruption. This is useful to avoid injection attacks: it prevents someone from entering HTML into a comment field...
JavaScript allows us to define getters and setters in the object literal syntax. Here's an example: var date = { year: '2017', month: '02', day: '27', get date() { // Get the date in YYYY-MM-DD format return `${this.year}-${this.month}-${this.day}` }, ...
var setValue; var obj = {}; Object.defineProperty(obj, "objProperty", { get: function(){ return "a value"; }, set: function(value){ setValue = value; } });
Requirement for Local development 1) MySQL server(I am Using XAMPP for MySQL server) 2) For Test API You can use Postman(optional) 3) Before run application,make sure MySQL server is running, properly prepare your application.properties file(DB_Name, Username,Password). 1.Add following depen...
For simple cases, you can filter data directly. a = np.random.normal(size=10) print(a) #[-1.19423121 1.10481873 0.26332982 -0.53300387 -0.04809928 1.77107775 # 1.16741359 0.17699948 -0.06342169 -1.74213078] b = a[a>0] print(b) #[ 1.10481873 0.26332982 1.77107775 1.16741359 0.176999...
Redirect without query params: RewriteRule ^route$ /new_route_without_query [L,R=301,QSD] Redirect with query params: RewriteCond %{QUERY_STRING} ^$ RewriteRule ^/?route$ %{REQUEST_URI}?query=param1&query2=param2 [NC,L,R=301]
This error is thrown when a process in your web dyno accepts a connection, but then closes the socket without writing anything to it. 2010-10-06T21:51:37-07:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=myapp.herokuapp.co...
The dyno did not send a full response and was terminated due to 55 seconds of inactivity. For example, the response indicated a Content-Length of 50 bytes which were not sent in time. 2010-10-06T21:51:37-07:00 heroku[router]: at=error code=H15 desc="Idle connection" method=GET path="...
Let's say you need to add a field to every document in a collection. import pymongo client = pymongo.MongoClient('localhost', 27017) db = client.mydb.mycollection for doc in db.find(): db.update( {'_id': doc['_id']}, {'$set': {'newField': 10} }, upsert=False, multi=False...
You can import an SVG file as a VectorDrawable in Android Studio, follow these steps : "Right-click" on the res folder and select new > Vector Asset. Select the Local File option and browse to your .svg file. Change the options to your liking and hit next. Done.
mkdir -p toplevel/sublevel_{01..09}/{child1,child2,child3} This will create a top level folder called toplevel, nine folders inside of toplevel named sublevel_01, sublevel_02, etc. Then inside of those sublevels: child1, child2, child3 folders, giving you: toplevel/sublevel_01/child1 toplevel/s...
new Error(message) Creates new error object, where the value message is being set to message property of the created object. Usually the message arguments are being passed to Error constructor as a string. However if the message argument is object not a string then Error constructor calls .toString...
Data in R are stored in vectors. A typical vector is a sequence of values all having the same storage mode (e.g., characters vectors, numeric vectors). See ?atomic for details on the atomic implicit classes and their corresponding storage modes: "logical", "integer", "numeri...
Once your test application is ready you can connect it with code for which you want to write unit tests. Either you have you code in PCL, or in UWP app project (I assume that you applied MVVM pattern) just add reference to it in Test Application project: Now you have access to all your code from...
The plugin can, among others, access information about the current Maven project being built. @Mojo(name = "project") public final class ProjectNameMojo extends AbstractMojo { @Parameter(defaultValue = "${project}", readonly = true, required = true) private MavenPro...
@Parameter(defaultValue = "${project.build.directory}") private File buildDirectory;
When you want for example enforce the use of the parameter Password if the parameter User is provided. (and vise versa) Function Do-Something { Param ( [Parameter(Mandatory=$true)] [String]$SomeThingToDo, [Parameter(ParameterSetName="Credentials", man...

Page 81 of 99