DFP sizeMapping Breaks Sponsorships - responsive-design

In my experiences so far, sizeMapping(), for responsive ads in DFP breaks sponsorships.
For example, if I define a sizeMapping like so:
addSize([1024, 768], [970, 90], [728, 90], [320, 50], [300, 250])
Then I setup a sponsorship on a particular ad unit that's a 728x90.
I also setup a Run of Site (placement) 970x90 that includes all ad units, including the sponsored one, at a lower priority.
The result is that the 970x90 will show before the sponsored 728x90 because of the sizeMapping variable, even on the ad units that are specifically sponsored by the 728x90.
Help!?!

Have you solved this? you need to use defineSizeMapping instead of addSize.
So it should be something like:
googletag
.defineSlot('AD_UNIT_PATH', [0, 0], 'ID')
.defineSizeMapping([[1024, 768], [[970, 90], [728, 90], [320, 50], [300, 250]]])
// Assuming [1024, 768] is the VP size & [[970, 90], [728, 90], [320, 50], [300, 250]] are the creative sizes.
.addService(window.googletag.pubads());

Related

Jest vscode-jest Extension Running All Tests (Despite Proper Configuration and Using Git)

As the title says, I'm using Git as source control for my project, and I'm using the below configuration:
"jest.autoRun": "watch",
"jest.debugCodeLens.showWhenTestStateIn": ["pass", "skip", "fail", "unknown"],
"jest.coverageFormatter": "DefaultFormatter",
"jest.coverageColors": {
"covered": "rgba(9, 156, 65, 0.9)",
"uncovered": "rgba(121, 31, 10, 0.3)",
"partially-covered": "rgba(235, 198, 52, 0.1)"
but no matter what, any change in any file triggers all tests to run, not just the affected tests. I've also tried "jest.autoRun": "on-save" and it also triggers all tests to run, not just the ones for the saved file, whether I've got code-coverage enabled or disabled.
Try to specify/play the single parameters. This should be the configuration you are searching for. But it is the equivalent of "on-save", so it might not work.
"jest.autoRun": {
"watch": false,
"onSave": "test-src-file",
}
For further information check: https://github.com/jest-community/vscode-jest#autorun

curl command to get shard information of a solr collection

Please let me know if there is a curl command which would give us the shard information of a given collection in solr. That is, information about how many shards the given collection is split into and its replication factor. I understand that it can be seen through solr admin UI. But, we are looking for the curl command which would yield the same result.
The Admin UI is a Javascript application. If you look in your browser's development tools under the "Networking" tab you'll see exactly which requests the UI are making to display the required information. You can then use the same endpoint in curl to retrieve the same information and process it according to your wishes.
The CLUSTERSTATUS endpoint will give you the information you're looking for:
http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS
{
"responseHeader":{
"status":0,
"QTime":333},
"cluster":{
"collections":{
"collection1":{
"shards":{
"shard1":{
"range":"80000000-ffffffff",
"state":"active",
"health": "GREEN",
"replicas":{
"core_node1":{
"state":"active",
"core":"collection1",
"node_name":"127.0.1.1:8983_solr",
"base_url":"http://127.0.1.1:8983/solr",
"leader":"true"},
"core_node3":{
"state":"active",
"core":"collection1",
"node_name":"127.0.1.1:8900_solr",
"base_url":"http://127.0.1.1:8900/solr"}}},
"shard2":{
"range":"0-7fffffff",
"state":"active",
"health": "GREEN",
"replicas":{
"core_node2":{
"state":"active",
"core":"collection1",
"node_name":"127.0.1.1:7574_solr",
"base_url":"http://127.0.1.1:7574/solr",
"leader":"true"},
"core_node4":{
"state":"active",
"core":"collection1",
"node_name":"127.0.1.1:7500_solr",
"base_url":"http://127.0.1.1:7500/solr"}}}},
"maxShardsPerNode":"1",
"router":{"name":"compositeId"},
"replicationFactor":"1",
"znodeVersion": 11,
"autoCreated":"true",
"configName" : "my_config",
"health": "GREEN",
"aliases":["both_collections"]
},
"collection2":{
"..."
}
},
"aliases":{ "both_collections":"collection1,collection2" },
"roles":{
"overseer":[
"127.0.1.1:8983_solr",
"127.0.1.1:7574_solr"]
},
"live_nodes":[
"127.0.1.1:7574_solr",
"127.0.1.1:7500_solr",
"127.0.1.1:8983_solr",
"127.0.1.1:8900_solr"]
}
}

Access Cell tower Objects using Telephony package in react native

I am trying to make geolocation request with API call (in react native) https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_API_KEY. This API takes following inputs in request body.
{
"homeMobileCountryCode": 310,
"homeMobileNetworkCode": 410,
"radioType": "gsm",
"carrier": "Vodafone",
"considerIp": "true",
"cellTowers": [
// See the Cell Tower Objects section below.
],
"wifiAccessPoints": [
// See the WiFi Access Point Objects section below.
]
}
{
"cellTowers": [
{
"cellId": 42,
"locationAreaCode": 415,
"mobileCountryCode": 310,
"mobileNetworkCode": 410,
"age": 0,
"signalStrength": -60,
"timingAdvance": 15
}
]
}
I am able to get all properties listed above except following using package Telephony and CarrierInfo in react native. It would be great if someone can locate the package and function to get these details in react-native.
locationAreaCode
age
signalStrength
timingAdvance

CRITICAL ERROR: Magic number mismatch - Insight, Bitcore

Edit: Apparently I need rep here to post links, so I apologize for the lack of urls.
I am trying to adapt a bitpay's insight blockchain explorer and API to an alt coin(https://github.com/potcoin/Potcoin) using the PoSV algo. The coin itself uses an older version of the Reddcoin PoSV algo. I've tried to follow Reddcoin's version of the block explorer/api/etc) and have gone as far as cloning it to try to make this work.
networks.js:
exports.livenet = {
name: 'livenet',
magic: hex('fbc0b6db'),
addressVersion: 55, // 37
privKeyVersion: 189,
P2SHVersion: 5,
hkeyPublicVersion: 0x0488b21e,
hkeyPrivateVersion: 0x0488ade4,
genesisBlock: {
hash: hex('ec3513ee046dcd52dd41975fcfab4f878f91890a4d17c07a1d7d9c2acbb036de'),
merkle_root: hex('3de5af055300a913c07e178efc107c9184dddcbc9d888aae7eea6ee00686a0d5'),
height: 0,
nonce: 471993,
version: 1,
prev_hash: buffertools.fill(new Buffer(32), 0),
timestamp: 1389688315,
bits: 3165306666666630
},
dnsSeeds: [
'seedz.potcoin.info'
],
defaultClientPort: 45444,
lastPoWBlock: 974999
};
The chain will sync until ~27% without any issue and then gives this error:
Error: CRITICAL ERROR: Magic number mismatch: 00000014!=fbc0b6db
I'm at a complete loss as to why this is happening. This is at block 458581. I have a discussion open with a Reddcoin developer as well and can be found here(https://github.com/reddcoin-project/reddcore/issues/3). Any help or a point in how to debug or fix this is much appreciated.

Migrating from Python 2.5 to 2.7 with appengine and django non-rel

I read the "what is a metaclass in Python" but am still confused over it.
I am new to python and have been thrown into upgrading it from 2.5 to 2.7.
I have the following:
class UsersDB(db.Model):
Email = db.EmailProperty(required=True,verbose_name='Email *')
Enable = db.BooleanProperty(default=True)
and
class UsersQuickAddForm(forms.ModelForm):
def is_user_exist(self, account):
users_query = UsersDB.all().filter('Email =', account).fetch(1)
if len(users_query) > 0:
return True
return False
class Meta:
model = UsersDB
exclude = ['Enable']
but when I try to execute it on the google site, I get:
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 239, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 298, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 84, in LoadObject
obj = import(path[0])
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/LDSGH.py", line 8, in
from core.decorators import permissionRequired
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/core/decorators.py", line 7, in
from core.initialization import loginIf
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/core/initialization.py", line 6, in
import photo_images
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/core/photo_images.py", line 1, in
from core.db_models import ImagesDB
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/core/db_models.py", line 222, in
class UsersQuickAddForm(forms.ModelForm):#only account, firstname and last name is required
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/django/forms/models.py", line 205, in new
opts.exclude, opts.widgets, formfield_callback)
File "/base/data/home/apps/s~ldsdgidev/glen27.371429613087607751/django/forms/models.py", line 145, in fields_for_model
opts = model._meta
AttributeError: type object 'UsersDB' has no attribute '_meta'
and I don't understand what I need to add to the UserDB class to get rid of the error.
Any help would be great!
This isn't anything to do with Python versions, or metaclasses.
ModelForms only work with Django models. db.Model is the App Engine model class, not the Django one. You can't use a modelform with that class.
You mention django-nonrel in your question tags. That project allows you to use the Django models - subclasses of models.Model with the App Engine datastore. You probably want to do that.

Resources