Friday, 31 January 2014

Doubleclick for Publishers reference material

From: https://productforums.google.com/forum/#!category-topic/dfp/getting-started/208IT9kC6Xo

For Premium

DFP Premium Help Center
https://support.google.com/dfp_premium/

Please remember that are two main ways to contact DFP. There is a
Contact Us link on all DFP Premium support page (near the upper right
hand part of the page). There is also a Report a Bug link in your DFP
account (also in the upper right hand corner of your page).

Getting Started Guide (high level overview)
https://support.google.com/dfp_premium/answer/184981

Training
https://support.google.com/dfp_premium/answer/3419426

Partner Directory
https://support.google.com/dfp_premium/answer/2616938

DFP Training Videos:
http://www.youtube.com/dfp

Release Notes
https://support.google.com/dfp_premium/answer/179039


Other Resources

Google also provides additional tools to webmasters to help you track
traffic and improve your search rankings. If you have not signed up
already, you might want to at least take a quick look at them.

Google Analytics
http://www.google.com/analytics/

Google Webmaster Tools
http://www.google.com/webmasters/


Webinars

Google has been releasing quite a few webinars that people maybe
interested in. While not always specific to DFP, many of them are
helpful for webmasters and advertising in general.

You can register for Google Webinars here:
http://www.google.com/ads/experienced/webinars.html

Or use their Calendar to see upcoming Webinars
https://www.google.com/calendar/embed?src=google.com_fqpk56cl9ck36np1ip263m2hks%40group.calendar.google.com

Javascript: Finding the viewport width,

Useful for responsive design, determining same max-width used in @media queries

var windowWidth = window.innerWidth ||
document.documentElement.clientWidth || document.body.clientWidth;

Based on: http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript


"The responsive viewport breakpoint "staircase" in my opinion becomes:

320px, 480px, 603px, 768px, 966px, 1024px"

See: http://www.hardweb.com.au/nexus7viewportportrait603x797landscape966x444.html

Also read:

http://alistapart.com/article/vexing-viewports


Been working recently on Google DFP tag code, so keeping these references:

http://exisweb.net/how-to-use-google-adsense-on-a-responsive-website

https://productforums.google.com/forum/#!msg/dfp/gxHN91Z7PoI/yC14WsR0KoMJ

http://stackoverflow.com/questions/15423189/changing-ad-size-based-on-browser-width-in-dfp

http://stackoverflow.com/questions/15452905/adding-a-browser-width-component-to-ad-slots




<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<style type='text/css'>
</style>


<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$("#showValue").click(function () {
var windowWidth = window.innerWidth ||
document.documentElement.clientWidth || document.body.clientWidth;

$("#widthLabel").text(windowWidth);
$("#windowinnerWidth").text(window.innerWidth);
$("#documentdocumentElementclientWidth").text(document.documentElement.clientWidth);
$("#documentbodyclientWidth").text(document.body.clientWidth);
$("#viewportHeight").text($(window).height());

});
});//]]>

</script>


</head>
<body>
<p>Width: <span id="widthLabel"></span>

<br/>window.innerWidth: <span id="windowinnerWidth"></span>

<br/>document.documentElement.clientWidth: <span
id="documentdocumentElementclientWidth"></span>

<br/>document.body.clientWidth: <span id="documentbodyclientWidth"></span>

<br/>$(window).height(): <span id="viewportHeight"></span>
</p>
<input id="showValue" type="button" value="Show Width" />
</body>


</html>

Wednesday, 15 January 2014

TIL: Hibernate JPA NamedNativeQuery declaration requires a "resultClass" even for update/delete operations

I was writing some JPA code (Hibernate implementation) that used
NamedNativeQuery

and kept getting this when I ran the webapp in Tomcat:

nested exception is org.hibernate.cfg.NotYetImplementedException: Pure
native scalar queries are not yet supported

The exception was from an unrelated class but I suspected that this
was caused by changes I made.

According to this:

http://jdevelopment.nl/hibernates-pure-native-scalar-queries-supported/

resultClass is required for all NamedNativeQuery, even the ones that
don't return them, because of a longstanding BUG in Hibernate.
Apparently the bug was fixed as of Hibernate 4.2 but we're still on
3.6 so upgrading is not really an option.