Posts

Showing posts from April, 2012

javascript - When page is opened with window.open, how can the opened page allow the opener to access its contents? -

is possible page opened window.open allow examined cross-origin opener? (this use in internal applications, security not significant concern.) , if so, how? i've tried replacing of cors , same-origin policies can find , still access denied on properties child window. in particular trying use internet explorer 11 headers these of headers i've tried far access-control-allow-origin: http://web1.corp.local access-control-allow-credentials: true access-control-expose-headers: cache-control,content-language,content-type,expires,last-modified,pragma access-control-expose-methods: get,post,option,put,delete,head x-content-security-policy: default-src *;script-src * content-security-policy: default-src *;script-src * x-xss-protection: 0 x-permitted-cross-domain-policies: what i'm trying do... i want web1.corp.local execute javascript on page on web2.corp.local . control both domains; way web2 tell browser okay web1 read , execute things on web2 . request on

PHP Smarty Tags isset referer Session -

i can't figure out missing. plan: if customer come homepage products, shall save link , customer shall able point. if customer opens link directly, shall see link mainpage. {php} $go_back = htmlspecialchars($_server['http_referer']); {/php} {if $go_back|strpos:"https://kundencenter.example.org" === false} $_session['refererurl'] = $go_back; {elseif isset($smarty.session.refererurl)} <li id='primary_navbar-account'><a href='".$_session[refererurl]."'><i class='fa fa-home'></i> homepage</a></li> {else} <li id='primary_navbar-account'><a href='https://example.org'><i class='fa fa-home'></i> homepage</a></li> {/if}

unit testing - Running tests in single Python file with nose -

i'm using nose 1.3.7 anaconda 4.1.1 (python 3.5.2). want run unit tests in single file, e.g. foo.py . according documentation should able run: nosetests foo.py but when this, nose runs tests in files in directory! and if nose --help , usage documentation doesn't indicate there parameter. shows [options]. so can run tests in single file using nose? i have standalone python 3.4 version , nosetests foo.py runs tests in foo.py , nosetests spam.py runs test in spam.py . a plain nosetests command without option specified, runs tests in files names starting word test_ in directory. here's quoting test discovery documentation specifies rules test discovery.the last line of documentation clarifies cause anomaly. be aware plugins , command line options can change of rules. i suspect (and may wrong) has how anaconda configures nose install.

php - Redirect (headers already sent); I know they're sent, but how do I re-organize this to make sense? -

i have index calls "header.php" prior loading actual pages so: include 'includes/header.php'; if(isset($_get['page'])) { include'includes/pages/page.php'; } and then, in page, want user able "add new page" (from index.php?add_page=1) , redirect them "edit page created" (from index.php?edit_page=). if(isset($_post['add_page']) && $_post['add_page'] == 1) { if(!$add_user['error']) { //header("location: ".$page_url); //echo "<script type='text/javascript'>document.location.href='{$page_url}';</script>"; } } the 'header("location:")' fails because headers have been sent (which makes sense me); but, how possible me redirect in post , skip header since it's redirecting edit page without having code directly in header.php? quick answer: use javascript instead header(locati

python - Can I use a trigger to add combinations of foreign keys? -

i'm in situation want multiples inserts on table trigger after insert. here python code understand objective first: d = dict() d["table1"] = ["1", "2"] d["table2"] = ["a","b"] itertools import product d["table12"] = [ (t1,t2,-1) t1, t2 in product(d["table1"], d["table2"])] here result: table12 product of values of d. {'table1': ['1', '2'], 'table2': ['a', 'b'], 'table12': [('1', 'a', -1), ('1', 'b', -1), ('2', 'a', -1), ('2', 'b', -1)]} using database i'm trying have same behavior trigger, , complete association combinations of primary keys. table1: pk name1 varchar table 2: pk name2 varchar table 12: pk (name1, name2) val integer fk (t1_name) reference table1 (name1) fk (t2_name) reference table2 (name2) create trigger table1_insert aft

yii2 - PHP: Trying to get property of non-object, from BatchError object of Bing Ads API -

i error when try view error messages api. documentation says returns array of batcherror objects in partialerror field. when try access index property of batcherror, gives me error. wrong? https://msdn.microsoft.com/en-us/library/bing-ads-campaign-management-addadgroups.aspx#anchor_1 php notice – yii\base\errorexception trying property of non-object 1. in /cygdrive/c/users/chloe/workspace/bestsales/models/bingads.php @ line 384 $response = $campaignproxy->getservice()->addadgroups($request); } catch (\soapfault $e) { $this->handleexception($e); return null; } $adgroupsids = $response->adgroupids; $partialerrors = $response->partialerrors; foreach ($partialerrors $batcherror) { yii::error($batcherror); $adgroup = $adgroups[$batcherror->index]; # <<<< logs: 2016-09-11 22:15:59 [::1][1][v5adqit0fiae7bon3i1lks49m3][error][application] [ unserialize('o:8:"stdclass":8:{s:4:"c

php - Laravel eloquent relationship user id issue -

i have many tables simplicity going show 2 affected ones. consist of: users announces one user can have many announces , 1 announce belongs 1 user. seems many 1 relationship (or think). schema creation database: schema::create('x_user', function($table) { $table->increments('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password', 60); $table->remembertoken(); $table->timestamps(); }); schema::create('x_announce', function (blueprint $table) { $table->increments('id'); $table->integer('created_by')->unsigned(); $table->foreign('created_by')->references('id')->on('x_user')->ondelete('cascade'); $table->timestamps(); }); now models quite simple have on user model: public function announce

apache spark - Transforming PySpark RDD with Scala -

tl;dr - have looks dstream of strings in pyspark application. want send dstream[string] scala library. strings not converted py4j, though. i'm working on pyspark application pulls data kafka using spark streaming. messages strings , call method in scala code, passing dstream[string] instance. however, i'm unable receive proper jvm strings in scala code. looks me python strings not converted java strings but, instead, serialized. my question be: how java strings out of dstream object? here simplest python code came with: from pyspark.streaming import streamingcontext ssc = streamingcontext(sparkcontext=sc, batchduration=int(1)) pyspark.streaming.kafka import kafkautils stream = kafkautils.createdirectstream(ssc, ["in"], {"metadata.broker.list": "localhost:9092"}) values = stream.map(lambda tuple: tuple[1]) ssc._jvm.com.seigneurin.mypythonhelper.dosomething(values._jdstream) ssc.start() i'm running code in pyspark, passing p

java - Create API jar like Android does with stubbed methods? -

i'm looking distribute custom api , know classes available @ run time. public , protected methods / classes included in jar can distribute don't want other source code , throw exception if jars code executed. this exact behaviour android framework jar has when attempt execute jar directly. my question how create same jar source without manually going through , creating each stubbed method. scale api grows. i believe can use purpose mkstubs tool: https://github.com/android/platform_development/tree/master/tools/mkstubs as @commonsware mentioned stubs in aosp generated javadoc droiddoc script, read here: how .java files in android_stubs_current_intermediates directory generated?

c# - SQL multiple results with entity -

i want merge result of 2 sql select statements one. here sample : // class public class _product { public long productid { get; set; } public string description { get; set; } } public class _company { public long companyid { get; set; } public int posotion{ get; set; } } // c# entity void runqyery() { string multiquery = "select productid, description product;"+ " select companyid, posotion company;"; _product objpro = new _product(); _company objcom = new _company(); // right? should now? var result = _entities.database.executesqlcommand(multiquery); objpro = ... objcom = ... } how can finish code? there way read select on 1 trying? thanks attention

android - How to integrate a python program into a kivy app -

i'm working on app written in python kivy modules develop cross-platform app. within app have form takes numerical values. these numerical values passed python program i've written, used calculate other values, , passed app , returned user. outside program not recognizing values i'm trying pass exist. below sample code 3 files i'm using, 2 app , 1 outside program. apologize abundance of seemingly unused kivy modules being imported, use them in full app. main.py import kivy import flowcalc kivy.app import app kivy.lang import builder kivy.uix.screenmanager import screenmanager, screen kivy.uix.dropdown import dropdown kivy.uix.spinner import spinner kivy.uix.button import button kivy.base import runtouchapp kivy.uix.textinput import textinput kivy.properties import numericproperty, referencelistproperty, objectproperty, listproperty kivy.uix.gridlayout import gridlayout kivy.uix.scrollview import scrollview kivy.core.window import window kivy.uix.slider import s

Sorting a Two Dimensional List in python using Insertion Sort -

so want sort list of namedtuples using insertion sort in python, , here code. def sortit(tripods): in range(1, len(tripods)): tmp = tripods[i][3] k = while k > 0 , tmp < tripods[k - 1][3]: tripods[k] = tripods[k - 1] k -= 1 tripods[k] = tmp whenever runs gives me typeerror: int object not suscriptable. tripods list of namedtuples , index 3 of namedtuple want list ordered by. def sortit(tripods): in range(1, len(tripods)): tmp = tripods[i] k = while k > 0 , tmp[3] < tripods[k - 1][3]: tripods[k] = tripods[k - 1] k -= 1 tripods[k] = tmp i have modified code. assigning tripods[i][3] tmp, int . that's why compiler warns int not suscriptable.

python - Django: 400 Error with Debug=False and ALLOWED_HOSTS=["*"] -

i'm trying run relatively simple django server on python 3.5.3 on ubuntu digitalocean droplet. i'm using gunicorn server nginx. server runs fine when debug=true in settings.py. when set false, 400 error when trying visit page. tried setting allowed_hosts ['*'], still same error. i've looked on lot of forums , many questions on none of solutions have worked. edit: gunicorn logs, startup [2016-09-13 00:02:01 +0000] [27160] [debug] current configuration: nworkers_changed: <function numworkerschanged.nworkers_changed @ 0x7f9ac58d3d90> worker_class: sync pre_fork: <function prefork.pre_fork @ 0x7f9ac58c8f28> limit_request_fields: 100 statsd_host: none limit_request_field_size: 8190 default_proc_name: kivawebsite.wsgi capture_output: false raw_env: [] pidfile: none pythonpath: none when_ready: <function whenready.when_ready @ 0x7f9ac58c8d90> post_worker_init: <function postworkerinit.post_worker_init @ 0x7f9ac58d32f0&

html - how to pick second element starting from the last one? -

Image
i have 2 elements , have same class , want pick second element starting last one. ( hope image tells everything) i tried nth-child 2 elements have same class why can't nth-child idea ? you can use nth-last-child(2) or nth-last-of-type(2) , select 2nd last item. li { display: inline-block } li:nth-last-child(2) { color: red } <ul> <li>test</li> <li>test</li> <li>test</li> <li>test</li> <li>test</li> </ul> <hr /> <ul> <li>test</li> <li>test</li> <li>test</li> <li>test</li> <li>test</li> <li>test</li> <li>test</li> </ul>

node.js - Does node + socketio + express + https secure the socket data as well -

with following code snippet: var express = require('express'), app = express(), server = require('https').createserver(app), io = require('socket.io')(server); app.get('/', function(req, res, next) { res.sendfile(__dirname + '/assets/html/index.html'); }); /** more routing functions **/ io.on('connection', function(socket) { components.socket.onconnect(socket, config); }); io.on('save', function(data){ var saved = save(data); io.emit('response', saved); }); /** more socket.io functions **/ server.listen(443, function() { console.log("server ready."); }); assuming server side setup (with ssl cert) , clients connect securely, data value on save , saved value emitted socket.io encrypted ssl cert web data too? the answer yes long use https initial connection. in example, since you're ever using https, never problem you.

wordpress - .htaccess - how to force https -

i want redirect traffic ssl secured site bookmywash.co.uk. have searched how on stack , google. have seen few codes have not worked. this wordpress site, when try navigate site within 1and1 web control panel site goes http s://bookmywash.co.uk/ , error occurred during connection bookmywash.co.uk. peer reports experienced internal error. error code: ssl_error_internal_error_alert error. i contacted host (1and1.co.uk) , sent link states use rewriteengine on rewritecond % {http_host} !^www\.domain\.com$ [nc] rewriterule ^(.*)$ http: //www.domain. com/$1 [r=301,l] the code above doesn't work , maybe not editing correctly. full .htccess file content below: <ifmodule mod_deflate.c> addoutputfilterbytype deflate text/plain addoutputfilterbytype deflate text/html addoutputfilterbytype deflate text/xml addoutputfilterbytype deflate text/css addoutputfilterbytype deflate application/xml addoutputfilterbytype deflate application/xhtml+xml addo

Errors Trying to Fancy Ternary Statements with Arrays, Python -

the basic problem 1 of highly customized kernel density estimators not fit standard can't use existing code. here code works gaussian: for counter1 in range (0,int(samples)): edf[counter1] = np.sum( np.reciprocal(len(values)*sigmas[:]*2)*np.exp(-0.5*((edf_diam[counter1]-values[:])/sigmas[:])*((edf_diam[counter1]-values[:])/sigmas[:])) ) what doing is, @ every diameter point (counter1), add every gaussian piece every values, , each values has own bandwidth (sigmas). might not efficient, i've gotten work, that's something. where i'm running issues i'm attempting add in other kernel shapes. simple being "top hat" or uniform. gaussian unbound, other kernels want program can exist in diameter range. while iterate through each feature (values sigmas), less efficient if can use fancy indexing. i have tried ternary operator: for counter1 in range (0,int(samples)): edf[counter1] = 0 if np.logical_or((edf_diam[counter1] < (values[:]-s

r- how to edit elements on x axis in image.plot -

Image
i have created image plot data: sample p p.1 p.2 p.3 p.4 p 1.0000000 0.24077171 -0.66666667 -0.49009803 0.61237244 p.1 0.2407717 1.00000000 0.09028939 -0.83444087 0.14744196 p.2 -0.6666667 0.09028939 1.00000000 0.21004201 0.10206207 p.3 -0.4900980 -0.83444087 0.21004201 1.00000000 -0.08574929 p.4 0.6123724 0.14744196 0.10206207 -0.08574929 1.00000000 using code: image.plot(sample,col=redblue(191), zlim=c(-1,1)) i image: instead of 0.0 0.2 0.4.. on x , y axes, want p p.1 p.2... how that? thank time , consideration? my heatmap looks this: its not symmetric. can please fix this? using code: shades=c(seq(-1,-0.5,length=64), seq(-0.5,0.5, length=64), seq(0.5,1,length=64)) heatmap.2(sample, dendrogram='none', symm=true, rowv=false, colv=false, key=true, cexcol=0.7, cexrow=1,scale="row", keysize=1, col=redblue(191), breaks=shades) here better-ish solution: par(mar

android - How can i get the signal strong at real time? -

guys how can use asynchronous task , run loop gets updated rssi on every iteration, , how can update ui onprogressupdate(). and last how can use thread.sleep(500) in loop updates every half second? check this first. have use wifimanager scan available networks , receive result in broadcastreceiver shown in tutorial. can extract info available networks scanresult . after quite simple

PHP Regex Remove leading and trailing <br /> within <p> tags -

i can't figure out life of me. i need regex expression strip out leading or trailing <br> tags within <p> tags. for example. <p> <br />some test text. <br /> test text. test text. test text. test text. test text. test text. test text. test text. test text. test text. test text. <br /><br /><br /> </p> should become... <p>some test text. <br /> test text. test text. test text. test text. test text. test text. test text. test text. test text. test text. test text.</p> i feel though should simple i've hit road-block. appreciated. you need look-ahead , look-behind <p> , </p> , , non-capturing group 1 or more occurrences of variation of <br> . for matching leading <br/> tags: (?<=<p>)(?:\s*<br\s*\/?>)+\s* for matching trailing <br/> tags: (?:\s*<br\s*\/?>)+\s*(?=<\/p>) both together: (?<=<p>)(?:\s*<br

html - Javascript: Selecting List from UL -

var ul = document.getelementbyid("parent-list"); document.queryselectorall("#parent-list li").onclick = function() { alert('click!'); } <ul id="parent-list"> <li id="item-1">item 1</li> <li id="item-2">item 2</li> <li id="item-3">item 3</li> <li id="item-4">item 4</li> <li id="item-5">item 5</li> <li id="item-6">item 6</li> <li id="item-7">item 7</li> <li id="item-8">item 8</li> <li id="item-9">item 9</li> </ul> i'm trying have alert popup of item clicked when click on "li" element javascript only. know how in jquery can't figure out how javascript. fiddle: https://jsfiddle.net/7jcksznz/1/ queryselectorall returns html collection. need attach event each one.

osx - Use git rebase and I get 'Nothing to do' -

same title type "git rebase -i [commit_id]", , got this: error detected while processing /users/my_name/.vimrc: line 1: e117: unknown function: pathogen#infect e15: invalid expression: pathogen#infect() press enter or type command continue after type enter, success enter vim editor. 1 pick f694d12 test 2 3 # rebase 3dad5af..f694d12 onto 3dad5af (1 command(s)) 4 # 5 # commands: 6 # p, pick = use commit 7 # r, reword = use commit, edit commit message 8 # e, edit = use commit, stop amending 9 # s, squash = use commit, meld previous commit 10 # f, fixup = "squash", discard commit's log message 11 # x, exec = run command (the rest of line) using shell 12 # d, drop = remove commit 13 # 14 # these lines can re-ordered; executed top bottom. 15 # 16 # if remove line here commit lost. 17 # 18 # however, if remove everything, rebase aborted. 19 # 20 # note empty commits commented out i delete line 1 "pick f694d12 test"

oop - PHP Autoloading Extended Classes -

based on response this question expect code work reason not. have simple class extends class library of classes. _custom.php $custom = new myclass(); class myclass extends myabstractclass{ public function __construct(){ parent::__construct(); } } unfortunately fatal error: fatal error : class 'myclass' not found in ... but if remove extends myabstractclass error goes away. seems issue when attempting extend class, not attempt load myabstactclass causes myclass not found @ all. any thoughts or suggestions on this? php interpreted language, meaning known php define code parsed before statement. class myclass extends myabstractclass{ public function __construct(){ parent::__construct(); #you forcing construct call, not required if parent constructor has no args. } } $custom = new myclass(); with classes can prevent behavior using autoloader, when object called , undefined, try inject , parse class given code. you ca

vb.net - Datagridview CheckboxColumn Shaded or (X) Mark when unchecked -

Image
good morning i have column in datagridview generates checkbox , in relation have lot of columns in table called 2016,2017 , on , of tinyint now here image both of them: now here question, instead of uncheck how can make shaded or x mark in datagridview column? here code in populating datagridview : dim sql1 mysqlcommand = new mysqlcommand("select * period_closure", con1) dim ds1 dataset = new dataset dim adapter1 mysqldataadapter = new mysqldataadapter con1.open() adapter1.selectcommand = sql1 adapter1.fill(ds1, "mytable") datagridview1.datasource = ds1.tables(0) con1.close() ds1.tables(0).columns(2).datatype = gettype(boolean) me.datagridview1.columns(0).frozen = true dim integer = 0 datagridview1.columns.count - 1 datagridview1.columns.item(i).sortmode = datagridviewcolumnsortmode.programmatic next datagridview1.columns("periodid").visible = false datagridview1.columns(0).defaultcellstyle.backcolor = color.lightblue fir

How to catch Sublime Text exceptions on their Python interpreter? -

how catch sublime text exceptions on python interpreter? this migrated https://github.com/sublimetextissues/core/issues/1359 i trying catch exception: try: print( 'running' ) sublime.active_window().run_command( "side_bar_update_sync" ) isnotsyncedsidebarenabled = false print( 'running this' ) except baseexception: isnotsyncedsidebarenabled = true print( 'running also' ) but when ran, not catches it. not matter if try within typeerror , exception or baseexception classes. below full exception output. reloading plugin sublimedefaultsyntax.default_syntax read_pref_async!!!! updateissyncedsidebarenabled!!!! running traceback (most recent call last): file "d:\user\dropbox\applications\softwareversioning\sublimetext\sublime_plugin.py", line 538, in run_ return self.run() typeerror: run() missing 1 required positional argument: 'enable' running isnotsynceds

c++ - What's the complexity of this algorithm -

this question has answer here: time complexity of primality testing algorithm? 1 answer what time complexity of algorithm? void prime(int n) { int = 2; while ((n % i) && <= sqrt(n)) i++; if (i > sqrt(n)) print(“%d prime number\n”, n); else print(“%d not prime number\n”, n); } the complexity approximately o(sqrt(n)). books express o(n 0.5 ). the square root re-computed each iteration of loop. slow operation, it's slower optimal, constant factor, doesn't affect computational complexity.

ios - XCode 8 GM Seed - Error while uploading to TestFlight -

while uploading .ipa file (generated using xcode gm seed) testflight, receiving following error. error itms-90596: "invalid bundle. asset catalog @ 'payload/application.app/assets.car' can't read. try rebuilding app non-beta version of xcode , submit again." dbg-x: error code is: 1102 did across similar issue? 1) double check , make sure building xcode 8 gm seed. 2) make sure using latest version of el cap. 3) delete ~/library/developer/xcode/deriveddata folder.(it issue) 4) rebuild project. make sure environment submitting running latest el cap , xcode 8 gm. if working multiple version of xcode (i.e. 7.3.1 & 8.0 or higher), make sure launch application loader respective xcode version . if build ipa file xcode 8.0, open application loader xcode -> open developer tool -> application loader . good luck!

php - ERROR WHILE INSERTING USING MYSQLI -

i'm new php please me here i'm unable insert values table. if gave values directly insert command in place of variables works. <?php include ("db.php"); $msg = ""; if(isset($_post["submit"])) { $name = $_post["name"]; $email = $_post["email"]; $password = $_post["password"]; $name = mysqli_real_escape_string($db, $name); $email = mysqli_real_escape_string($db, $email); $password = mysqli_real_escape_string($db, $password); $password = md5($password); $sql="select email users2 email='$email'"; $result=mysqli_query($db,$sql); $row=mysqli_fetch_array($result,mysqli_assoc); if(mysqli_num_rows($result) == 1) { $msg = "sorry...this email exist..."; } else { $query = mysqli_query($db, "insert users2 (name, email, password)values ('$name', '$email', '$password')"); if($quer

java - SQLite certain word colors -

im busy bible app , want have text references in different color rest of text. there way this? use sqlite db thats in assets folder edit data in db browser , not in android studio strings. i want know if possible <textcolor>word<textcolor> , when in android studio should not display words in brackets color. ive got example uses in php doesnt work in sqlite <sup><font color="#3923d6">words in color goes here</font></sup> is there workaround make work in adroid studio? well, i'm assuming want display name of color in it's respective color, if text red , want red displayed in red color. for can store values in database this "<font color='red'>red</font>." you can make column in table text not null once fetch data table can display in textview follow textview.settext(html.fromhtml(colortext), textview.buffertype.spannable); here colortext string value retrieved database.

C++ fstream and printing to terminal -

this question has answer here: why iostream::eof inside loop condition considered wrong? 4 answers i've got bit of code trying work. want open file , print contents terminal. right i've got list (1-10) in .txt file in same folder .cpp file. int main() { ifstream infile; infile.open("numbers.txt"); if( infile.fail()) { cout<<"error opening file "<< endl; return 0; } while(!(infile.fail())) { int x; infile >> x; cout<<x<< endl; } } this have far , works open file , print console. issue is, prints last line of file twice ( print 1-10 fine prints 10 twice) i've stumped myself trying figure out. ideas? thanks helping me edit this! try below code #include <iostream> #include <fstream> using namespace std; int main() { ifstream infile;

Python class to JSON -

this question has answer here: how make class json serializable 20 answers i have requirement i'd construct lot of json objects. , there many different definitions , ideally want manage them classes , construct objects , dump them json on demand. is there existing package/recipe let's me following for keeping simple lets need represent people working, studying or both: [{ "name": "foo", "jobinfo": { "jobtitle": "sr manager", "salary": 4455 }, "name": "bar", "courseinfo": { "coursetitle": "intro 101", "units": 3 }] i'd create objects can dump valid json, created regular python classes. i'd define classes db model: class person: name = string() jobinfo = job() courseinfo = course() class job

spring - mvn jax2b not generating java classes from wsdl -

in spring project, following this tutorial have following in pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.example</groupid> <artifactid>demo</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>soaptest</name> <description>demo project spring boot</description> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.4.0.release</version> <relativepath/> <!-- lookup parent repo

javascript - I am using Jquery Social feed. I am getting alert box from another site. how to disable that alert from it -

here alert box. want disable alert box. <script type="text/javascript"> jquery(window).load(function() { var param = document.url.split('#')[1]; if( param != 'www.abc.com' ){ alert('here msg'); } }); </script> simply overwrite alert own, empty, function. window.alert = function() {}; integrating code : $(window).load(function() { var param = document.url.split('#')[1]; if (param != 'www.abc.com') { alert('here msg'); } }); window.alert = function() {}; <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

windows - vsubst in batch file -

in office every day double click on program vsubst assign partition of space on computer drive. want make batch file out of not have every day. takes 5 seconds, 5 people times 5 seconds times 250 working days 6250 seconds year! can me out here? shouldnt difficult. run windows machine , put in windows task manager. i guess like: start ....vsubst.exe param param1 ok. trial , error got me there. fill following line in , place batch file in startup programs , you're done :d start path\vsubst.exe newdrive folderpath exit

visual c++ - Some weird C compile error in Windows 7 -

Image
when compiled following method geohash_move_x vs 2013(windows version redis), give me many error such below, issue happened @ win7 , in win10 there no error. error 188 error c2275: “uint64_t”: expression illegal error 189 error c2146: grammar error: lack“;” error 190 error c2065: “x”: un declared identitier static void geohash_move_x(geohashbits *hash, int8_t d) { if (d == 0) return; uint64_t x = hash->bits & 0xaaaaaaaaaaaaaaaaull; uint64_t y = hash->bits & 0x5555555555555555ull; uint64_t zz = 0x5555555555555555ull >> (64 - hash->step * 2); if (d > 0) { x = x + (zz + 1); } else { x = x | zz; x = x - (zz + 1); } x &= (0xaaaaaaaaaaaaaaaaull >> (64 - hash->step * 2)); hash->bits = (x | y); } i suggest investigate output of pre-processor geohash.c file , compare vs 2013 , vs2015 ( or vs2013 on win 7 , vs2013 win 10). give answer why compiler has problem uint64_t type. to configure v

cordova - VoIP Push Notifications in Ionic for iOS -

from ios 8 can use voip push notifications . i found this request on phonegap plugin push repository. however, seems it's in status quo state. so, i'm wondering if of guys have dealt before , if have guidelines? guys on @ react-native seem have done this . i ended creating plugin myself. can on npm here . you can install plugin with: ionic plugin add cordova-ios-voip-push and use plugin in ionic/cordova app: var push = voippushnotification.init(); push.on('registration', function(data) { log("[ionic] registration callback called"); log(data); //data.devicetoken; //do device token (probably save backend service) }); push.on('notification', function(data) { log("[ionic] notification callback called"); log(data); // based on received data }); push.on('error', function(e) { log(e); }); there additional steps take in xcode, please refer official plugin site read full tutor

MySQL aborted connects -

on mysql 5.6.31 server, have static growth of aborted connects status variable. in 24h server has 1220 aborted connects. the mysql reference manual describes status variables follows: "the number of failed attempts connect mysql server. see section b.5.2.11, “communication errors , aborted connections”. additional connection-related information, check connection_errors_xxx status variables , host_cache table." so check connection_errors variables , 6 of them zero. additional host_cache table empty. log-warnings=2 shows "access denied", if prescribe password. tried tcpdump, there cryptical data. how can find out, connection/user causes growth of aborted connects? there table user - connecs - errors or somethoung that? best regards christian edit: of these messages in mysql-error.log 6757 [warning] aborted connection 19675 db: 'db_name' user: 'db_user' host: 'user_host' (got error reading communication packets)

json - Pagination not working when Dynamic result is displayed to datatable <tbody> -

using datatable (bootstrap ) i displaying result of ajax in part of datatable . result ged addded datable pagination not working on new result page loads once.who pagination work on new displayed result. in advance. <script> $(document).ready(function () { $('.datatables-example').datatable(); }); var data = $.parsejson(responsedata); var tbl_op =''; $.each(data.result,function(k,v){ console.log(v.id); $('.datatables-example').datatable(); tbl_op +="<tr class='odd gradex'>"+ '<td>'+v.id+'</td>'+ '<td>'+v.country_name+'</td>'+ '<td>'+v.created+'</td>'+ '<td>