First of all, implement your view holder:
implements View.OnClickListener, View.OnLongClickListener
Then, register the listeners as follows:
Next, override the listeners as follows:
public void onClick(Vie...
Angular has reputation for having awesome bidirectional data binding. By default, Angular continuously synchronizes values bound between model and view components any time data changes in either the model or view component.
This comes with a cost of being a bit slow if used too much. This will hav...
If we have a Model as following,
from django.db import models
from django.contrib.auth.models import User
user = models.OneToOneField(User)
expired = models.DateTimeField()
admin = models.BooleanField(default=False)
employee_id = models...
With IpRateLimit middleware you can set multiple limits for different scenarios like allowing an IP or IP range to make a maximum number of calls in a time interval like per second, 15 minutes, etc. You can define these limits to address all requests made to an API or you can scope the limits to eac...
With ClientRateLimit middleware you can set multiple limits for different scenarios like allowing a Client to make a maximum number of calls in a time interval like per second, 15 minutes, etc. You can define these limits to address all requests made to an API or you can scope the limits to each URL...
The following example is a very useful basis when you are trying to convert transaction data to un-pivoted data for BI/reporting reasons, where the dimensions which are to be un-pivoted can have a dynamic set of columns.
For our example, we suppose that the raw data table contains employee assessme...
Command Structure is
sqlcmd -S yourservername\instancename -d database_name -o outputfilename_withpath -Q "your select query"
Switches are as follows
-S for servername and instance name
-d for source database
-o for target outputfile (it will create output file)
You can also make a switch statement switch based on the class of the thing you're switching on.
An example where this is useful is in prepareForSegue. I used to switch based on the segue identifier, but that's fragile. if you change your storyboard later and rename the segue identifier, it breaks ...
This will be our example data frame:
color name size
0 red rose big
1 blue violet small
2 red tulip small
3 blue harebell small
Accessing a single column from a data frame, we can use a simple comparison == to compare every element in the column to the given...