I added this tag:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
in to my header.
In IE 9 my browser crashes if I add the domain of my site in to the compatibility view list of the browser and then I call my website.
Also the browser crashes if I work on IE 11 and I am going to browsermode 9.
I have to add this meta tag.
What can I do?
Where do I wrong?
additional:
I found out that this meta tag doesn`t work well in combination with this part of script:
window.CSSHover = (function(){
var REG_INTERACTIVE = /(^|\s)((([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover))/i,
REG_AFFECTED = /(.*li?|.*ul?)\:(hover)/i,
REG_PSEUDO = /[^:]+:([a-z-]+).*/i,
REG_SELECT = /(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi,
REG_CLASS = /\.([a-z0-9_-]*on(hover))/i,
REG_MSIE = /msie (5|6|7|8|9)/i,
REG_COMPAT = /backcompat/i;
var CSSHOVER_PREFIX = 'csh-';
var CSSHover = {
elements: [],
I am calling this script in the body with: [%- IF BROWSER=="MSIE" AND BROWSERVERSION < "9.0" -%]style="behavior: url(/css/csshover.h);" [%- END -%]
callbacks: {},
init:function() {
if(!REG_MSIE.test(navigator.userAgent) && !REG_COMPAT.test(window.document.compatMode)) return;
var sheets = window.document.styleSheets, l = sheets.length;
for(var i=0; i<l; i++) {
this.parseStylesheet(sheets[i]);
}
},
Related
I have a Laravel 8 web project which need to stop downloading video files from my website. I need a function which will totally stop download & will say "The requested file doesn't exist" if the video file link input on IDM or at others downloader softwares. Tell me how can I stop?
View page & Controller code:
<video oncontextmenu="return false;" src="{{asset('uploads/drama-movie-video/trailers/'. $video->trailer)}}" controls controlsList="nodownload" width="250px" height="250px" poster="{{asset('images/profile1.jpg')}}">
</video>
**My video controller:**
public function show($id) {
//views count
$oldviews = Video_views::where('video_id', $id)->value('amount');
$newviews = $oldviews + 1 ;
$updateviews = Video_views::where('video_id', $id)
->update(['amount' => $newviews]);
//seen count
$visitor = request()->ip();
$searchvisitorip = Video_seen::where('video_id', $id)->where('visitor_ip', $visitor)->value('id');
if ($searchvisitorip < 1) {
$seen = new Video_seen;
$seen->video_id = $id;
$seen->visitor_ip = $visitor;
$seen->save();
}
$video = Video::find($id);
$user = Auth::User()->id;
$queryviewer= Viewer::where('video_id', $video->id)->where('viewer_id', $user)->value('viewer_id');
return view('frontend.pages.video.video.show', compact('video', 'queryviewer', 'user', 'newviews'));
}
I recently learning an image classifier using TensorFlow js in the browser, I made a simple image classification that can identify an image of Giorno and Jotaro, but when predicting a new image, the result always shows the first example(Jotaro) which I added, I'm trying to check the second function which added second example(Giorno), It just fine in console, and running well, this is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Giorno and Jotaro Classifier</title>
<script src="https://cdn.jsdelivr.net/npm/#tensorflow/tfjs/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/#tensorflow-models/mobilenet"></script>
<script src="https://cdn.jsdelivr.net/npm/#tensorflow-models/knn-classifier"></script>
</head>
<body>
<h1>Test Image</h1>
<img id="predict" src="anime/test_giorno.jpg" alt="" width="300">
</body>
</html>
<script>
const initScript = async function(){
const ClassifierKNN = knnClassifier.create();
const mobileneModule = await mobilenet.load();
for(let i=1; i<=3;i++){
const im = new Image(300,300);
im.src = 'anime/jotaro/'+i+'.jpg';
im.onload = ()=>{
let trainingImageJotaro = tf.browser.fromPixels(im);
let predJotaro = mobileneModule.infer(trainingImageJotaro,'conv_preds');
if(i)
ClassifierKNN.addExample(predJotaro,"Jotaro");
}
im.onload();
}
for(let i=1; i<=3;i++){
const im2 = new Image(300,300);
im2.src = 'anime/giorno/'+i+'.jpg';
im2.onload = ()=>{
let trainingImageGiorno = tf.browser.fromPixels(im2);
let predGiorno = mobileneModule.infer(trainingImageGiorno,'conv_preds');
ClassifierKNN.addExample(predGiorno,"Giorno");
}
im2.onload();
}
let imgX = document.getElementById('predict');
const tensorX = tf.browser.fromPixels(imgX);
const logitsX = mobileneModule.infer(tensorX,'conv_preds');
let result = await ClassifierKNN.predictClass(logitsX);
console.log('outout:');
console.log(result);
}
initScript();
</script>
the result of the script is always jotaro, but when I switch the loop position like this:
for(let i=1; i<=3;i++){
const im2 = new Image(300,300);
im2.src = 'anime/giorno/'+i+'.jpg';
im2.onload = ()=>{
let trainingImageGiorno = tf.browser.fromPixels(im2);
let predGiorno = mobileneModule.infer(trainingImageGiorno,'conv_preds');
ClassifierKNN.addExample(predGiorno,"Giorno");
}
im2.onload();
}
for(let i=1; i<=3;i++){
const im = new Image(300,300);
im.src = 'anime/jotaro/'+i+'.jpg';
im.onload = ()=>{
let trainingImageJotaro = tf.browser.fromPixels(im);
let predJotaro = mobileneModule.infer(trainingImageJotaro,'conv_preds');
if(i)
ClassifierKNN.addExample(predJotaro,"Jotaro");
}
im.onload();
}
the result always Giorno, can anyone help me with this problem?
Thanks #zer0sign, for sharing the solution in comments. For the benefit of community I am providing solution here (answer section)
This problem has been fixed, above issue occurs because, the second training data is executed after the testing data, therefore the code above only gets 1 label, because the second label has not been executed and therefore the output label of the predicted image always shows the label of the first training data.
I have a basic Janrain account where I have configured about 8 providers successfully. From the Widgets & SDKs section, I have also selected six providers to be shown on the widget. I have enabled Janrain integration on on Social Engine 4.8.12. However, the Janrain widget only shows only 3 default providers on my SocialEngine website's log-in page. Does anyone know how to fix this?
This is what I have designed and expect to see:
This is what I see on the login page:
The Janrain Social Login(Engage) widget has two main ways to configure the display of social providers. These are shown in the following screen shot:
The first option "Save and Publish" will save the settings to the Janrain CDN. The warning at the bottom states "Changes may take up to one hour to appear in deployed widgets" - however it typically (but not always) does not take more than 5 minutes. It is important that you actually click the "Publish" button in order to save these settings.
The second option is "Save and Embed" it will generate the necessary Javascript code that you can embed on a web page to use the widget. Similar to the following:
<script type="text/javascript">
(function() {
if (typeof window.janrain !== 'object') window.janrain = {};
if (typeof window.janrain.settings !== 'object') window.janrain.settings = {};
/* _______________ can edit below this line _______________ */
janrain.settings.tokenUrl = '__REPLACE_WITH_YOUR_TOKEN_URL__';
janrain.settings.type = 'embed';
janrain.settings.appId = 'REPLACE_WITH_YOUR_APP_ID';
janrain.settings.appUrl = 'https://APPNAME.rpxnow.com';
janrain.settings.providers = [
'facebook',
'linkedin',
'googleplus',
'twitter',
'instagram',
'paypal_openidconnect',
'yahoo',
'microsoftaccount'];
janrain.settings.providersPerPage = '8';
janrain.settings.format = 'two column';
janrain.settings.actionText = 'Sign in using your account with';
janrain.settings.showAttribution = true;
janrain.settings.fontColor = '#333333';
janrain.settings.fontFamily = 'arial';
janrain.settings.backgroundColor = '#FFFFFF';
janrain.settings.width = '380';
janrain.settings.borderColor = '#CCCCCC';
janrain.settings.borderRadius = '10'; janrain.settings.buttonBorderColor = '#CCCCCC';
janrain.settings.buttonBorderRadius = '5';
janrain.settings.buttonBackgroundStyle = 'gradient';
janrain.settings.language = '';
janrain.settings.linkClass = 'janrainEngage';
/* _______________ can edit above this line _______________ */
function isReady() { janrain.ready = true; };
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", isReady, false);
} else {
window.attachEvent('onload', isReady);
}
var e = document.createElement('script');
e.type = 'text/javascript';
e.id = 'janrainAuthWidget';
if (document.location.protocol === 'https:') {
e.src = 'https://rpxnow.com/js/lib/APPNAME/engage.js';
} else {
e.src = 'http://widget-cdn.rpxnow.com/js/lib/APPNAME/engage.js';
}
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(e, s);
})();
</script>
You can see in the above code how the providers are listed as a Javascript array.
If neither of these options work then there may be something wrong with your apps configuration and you should contact Janrain's support for assistance at http://support.janrain.com
I want to get the length of the playList, so I using the code below, it can work at FF, Chrome, IE8, except IE10.
Here is my code
var playListLength = jwplayer('jwplayer249').getPlaylist().length;
for (var i = playListLength - 1; i >= 0; i--) {
var htmlSpan = '<span class="">' + i +'</span>';
$(".ip_fs_prev").after(htmlSpan);
} ;
at IE10 it return undefined attributes.
I am creating some campaign swf banners and I don't use action script very often so any help from the experts would be great thanks.
I am supplying my banners on my website as resource downloads. And tutorials of how to embed the swf which has some javascript flashvars.
These flash variable is then concatenated into a google campaign link to change the utm_source.
This is my javascript...
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.campaignSource = window.location.hostname;
var params = {};
params.loop = "true";
params.quality = "best";
params.wmode = "opaque";
params.swliveconnect = "true";
params.allowscriptaccess = "always";
var attributes = {};
swfobject.embedSWF("banner.swf", "banner_mpu", "300", "250", "9.0.0", false, flashvars, params, attributes);
</script>
and my html...
<div id="banner_mpu">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
So the above js works great, however, not everyone will use my tutorial code and will probably use there own methods to embed the swf banner on their site.
So I need some back up action script 2 to get the current hostname into a action script variable
This is my action script which I have so far on my button (swf)...
on(release) {
function GetTheHostname() {
var RootFullUrl = _root._url;
txtFullUrl.text = RootFullUrl;
var lastSlashIndex:Number = RootFullUrl.lastIndexOf("/");
var DriveIndex:Number = RootFullUrl.indexOf("|");
if (DriveIndex>=0) {
baseUrl = RootFullUrl.substring(0, DriveIndex);
baseUrl += ":";
} else {
baseUrl = "";
}
baseUrl += RootFullUrl.substring(DriveIndex+1, lastSlashIndex+1);
txtBaseUrl.text = baseUrl;
return baseUrl;
}
var campaignSourceAS2:String= GetTheHostname();
if ( _root.campaignSource == undefined ) {
getURL("http://www.mysite.co.uk/?utm_source=" + campaignSourceAS2 + "&utm_medium=MPU&utm_campaign=My%20Campaign%202012", "_blank");
} else {
getURL("http://www.mysite.co.uk/?utm_source=" + _root.campaignSource + "&utm_medium=MPU&utm_campaign=My%20Campaign%202012", "_blank");
}
}
The problem with my action script is that it returns the full current URL.
Can any one please help me adapt the GetTheHostname function to get the host name instead of the baseURL
Thanks in advance
In that case, I guess it would be as easy as stripping the http:// from the url and then get all that's left to the first /
A one-liner to go from 'http://www.example.com/category/actionscript' to 'www.example.com' would be
var baseURL:String = _root._url.split("http://").join("").split("/")[0];
and to replace your full method
getURL("http://www.mysite.co.uk/?utm_source=" + (_root.campaignSource || _root._url.split("http://").join("").split("/")[0]) + "&utm_medium=MPU&utm_campaign=My%20Campaign%202012", "_blank");