Posts

Showing posts from March, 2010

office interop - What is VSTO exactly? -

i have few add-ins excel , word 2007-2016. , don't understand few things. project use dlls, microsoft.office.tools.common, office.dll, excel, word , common interop's. , these files can found in few places @ same time, different versions of them (like program files, windows/assembly, windows/microsoft.net/assembly). don't know version use. , also, if user has vsto installed, suppose has these files. why need provide them? install when install vsto? part , installation place component? think don't right, because found out excel loads 2 different versions of same file @ same time. those lot of questions, , many of them depend on provide solution... the case of pias ("office dlls") relatively clear cut: you not need (and should not) distribute office pias vsto solution, possible exceptions of 2007 , 2010. in these versions, installing .net support optional , not default. that's why there redistributables these versions, , not others. installe...

arrays - Reverse string using for loop only in php -

if there 1 array: $arr = array('o', 'v', 'e', 'r','f', 'l', 'o', 'w'); and want display output 1st string = revo , 2nd string = flow using for loop only in php. not use inbuilt php function . so how can it? please me. the solution is: $arr = array('o', 'v', 'e', 'r','f', 'l', 'o', 'w'); |_________________| |_________________| ^ ^ reverse half keep half then loop through array create first , second string. $arr = array('o', 'v', 'e', 'r','f', 'l', 'o', 'w'); // reverse first half of array $arrlength = count($arr); for($i = 0; $i < $arrlength / 4; ++$i){ $tmp = $arr[$i]; $arr[$i] = $arr[(($arrlength / 2) - 1) - $i]; $arr[(($arrlength / 2) - 1) - $i] = $tmp; } // loop through array create f...

javascript - JSLint errors: Undeclared 'Image', Undeclared 'Document', out of scope -

with basic javascript knowledge built simple slideshow (code below). works jslint shows following errors: undeclared 'image' slideimages[0] = new image(); undeclared 'setinterval' setinterval(mycounter, 50); 'mycounter' out of scope setinterval(mycounter, 50); undeclared 'document' document.getelementbyid('slide').src =slideimages[step].src; how can overcome issues e.g. declare elements? var slideimages = []; slideimages[0] = new image(); slideimages[0].src = "http://placehold.it/350x150?text=welcome"; slideimages[1] = new image(); slideimages[1].src = "imgs/slide_1.png"; slideimages[2] = new image(); slideimages[2].src = "imgs/slide_2.png"; var step = 0; var c = 0; var = 0; setinterval(mycounter, 50); function mycounter() { 'use strict'; document.getelementbyid('slide').src = slideimages[step].src; if ((c >= 0) && (c < 40)) { c += 1; = c...

angularjs - Jasmine test fails with error from a different suite -

experiencing peculiar behaviour karma-jasmine testing angular app. have test in 1 suite reports failure message comes separate test in test suite file. test result: factory: page should uncheck items failed expected undefined contain '<div class="ui-select-container ui-select-bootstrap dropdown ng-valid" ng-class="{open: $select.open}" ng-model="test.slctbx.selected" theme="bootstrap" ng-disabled="disabled"></div>' that test actually: describe 'factory: page', () -> ... 'should check items', () -> page.checkall null expect(page.actions).toequal {checkall: false} the error comes from: describe 'directive: select', () -> ... 'should replace select box', () -> replacementmarkup = '<div class="ui-select-container ui-select-bootstrap dropdown ng-valid" ng-class="{open: $select.open}" ng-model="test.slctbx...

winapi - C++ GetProcAddress not working -

this question has answer here: getprocaddress function in c++ 3 answers i have following code: typedef int (winapi* fnenginestart)(); int __stdcall enginestart() { bool freeresult = 0, runtimelinksuccess = 0; //variables later use hmodule libraryhandle = 0; //here handle api module/dll stored. fnenginestart fn = 0; libraryhandle = afxloadlibrary(l"flowengine.dll"); //get handle of our api module //so loaded. if (libraryhandle != null) //if library loading successfull.. { fn = (fnenginestart)getprocaddress(libraryhandle, "fnenginestart"); if (runtimelinksuccess = (fn != null)) //if operation successful... { int returnvalue = fn(); //call messageboxa function //from user32.dll } else { messagebox(0, l"error", 0, 0); } freeresult = freelibrary(libraryhandle); //from pr...

TypeScript with Jquery -

i getting error "uncaught referenceerror: $ not defined" please find code below. ///<reference path="jquery.d.ts" /> class test { name: string; constructor() { this.name = "gowtham"; } dispname() { alert("name :" + this.name); } } $(document).ready(function () { debugger; var test = new test(); $('#test').on('click', function() { debugger; test.dispname(); }); }); i having referance reference path="jquery.d.ts" in .ts file. missing here .? you're getting runtime error because haven't loaded jquery properly, if issue typings would've seen compiler error. see existing question: uncaught referenceerror: $ not defined?

reactjs - Why will enabling "pause on caught exceptions" improve my debugging experience? -

Image
couldn't find anywhere why should this: it's simple: if pause on exceptions, can see stack @ time of exception. can see call stack of functions lead exception, current scope's variables, @ time of exception. if don't this, js fail call stack, produce exception in console, , continue running next statement. lead loss of stack information @ time of exception.

android - Unwanted padding in CollapsibleToolbarLayout -

Image
i have following code in layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="global.sti.attendance.signupactivity"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="250dp" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsibletoolbarlayout" android:layout_width="match_parent" android:layout_height="match_par...

oop - Encapsulation / Data Hiding in Javascript? -

i understand concept of encapsulation in javascript, , how make properties , methods public or private. i'm playing around example: var person = function(newname, newage) { // private variables / properties var name = newname; var age = newage; // public methods this.getname = function() { return name; } // private methods var getage = function() { return age; } // public method, has acces private methods this.giveage = function() { return getage(); } } var jack = new person("jack", 30); console.log(jack.name); // undefined console.log(jack.getname); // jack console.log(jack.getage()); // typeerror: jack.getage not function console.log(jack.getage); // undefined console.log(jack.giveage()); // 30 so, variables var name , var age private. access them use public methods using .this reference. var inside function private, , that's .this inside object visible outside. i gues...

Getting names from HTML file via python -

def get_players(team_id, year): """ list of players in team in given year. inputs: team_id: string, three-letter id of team year: integer, year returns: list of strings players' names """ link = "http://espn.go.com/nba/team/stats/_/name/{}/year/{}/".format(team_id, year) soup = soup_link(link) game_stat_row = soup.find("tr", {"class": "colhead"}) player_names = [] name in game_stat_row: player_names.append(name) return player_names hi want player names url: http://espn.go.com/nba/team/stats/_/name/por/year/2015/ giving html text not list of players. need find first occurence of each name , once. can me. thanks. using beautifulsoup way. i use different way html code here source = urllib2.urlopen(link) html = source.read() source.close(); soup = beautifulsoup(html, "html.parser") since noticed rows end num...

quaternions - CMMotionManager changes from cached reference frame not working as expected -

when call startdevicemotionupdatesusingreferenceframe, cache reference first reference frame , call multiplybyinverseofattitude on motion updates after that, don't change reference frame expecting. here simple demonstration of i'm not understanding. self.motionqueue = [[nsoperationqueue alloc] init]; self.motionmanager = [[cmmotionmanager alloc] init]; self.motionmanager.devicemotionupdateinterval = 1.0/20.0; [self.motionmanager startdevicemotionupdatesusingreferenceframe: cmattitudereferenceframexarbitraryzvertical toqueue:self.motionqueue withhandler:^(cmdevicemotion *motion, nserror *error){ [[nsoperationqueue mainqueue] addoperationwithblock:^{ cmattitude *att = motion.attitude; if(self.motionmanagerattituderef == nil){ self.motionmanagerattituderef = att; return; } [att multiplybyinverseofattitude:self.motionmanagerattituderef]; nslog(@"yaw:%+0.1f, pitch:%+0.1f, roll:%+0.1f, att.yaw, att.pitch,...

PHP preg_replace only numbers -

i have string , want number witch between 5 , 7 charts. here problem: $string = "test 1 97779 test"; if(strlen(preg_replace("/[^0-9]/", "", $string)) >= 5 && strlen(preg_replace("/[^0-9]/", "", $parts[7])) <= 7) { $var = preg_replace("/[^\d-]+/", "", $string); } result is: 19779, want 97779. if have suggestion glad. in advance. your friend preg_match if(preg_match('/\b\d{5,7}\b/', $str, $out)) $var = $out[0]; \b matches word boundary \d{5,7} in between 5 7 digits \d see demo @ eval.in

lua - Unfinished long string near <eof> -

function writefloat([=[==[===[====["game.exe"+xxxxxxxx]+xxx====]+xxx===]+xxx==]+xxx=]+xxx, trackbar_getposition(trainerform_cetrackbar1)) end gives me error [string "--code..."]:4: unfinished long string near lua has "long strings", induced syntax of [=*[ , "=*" means "zero or more = characters". [[ begins long string, [==[ or [=[ , in case. a long string named because accepts every character between inducing syntax , terminating syntax. allows useful things add verbatim xml, c++, or lua code within lua script literal string. the terminating syntax ]=*] , "=*" means the exact same number of = characters used induce long string. if start [=[ , long string only end ]=] . ]] , ]====] or other terminus not end long string; they'll taken verbatim string. so this: local lit = [=[long string]==]=] results in lit taking value long string]== . in code, never see ]=] sequence. have ====] ,...

Synchronise a mobile light database with ASP.NET Web API 2 -

i building mobile application targeting ios, android , wp ionic/cordova. , using asp.net web api 2 rest apis backend. i have requirement mobile application can collect data , synchronise apis , if mobile offline, sync happen when online. data size small , light db including localstorage one. required sync needed 1 way, mobile apis. also, once record synchronised, can deleted mobile. i looking @ couchbase mobile, found mobile db db sort of solution. can recommend mobile db rest/web api sync solution? with native couchbase mobile solution android / ios coupled rest apis able data mobile device backend. delete documents off device once 200 status. windows phone, can explore using pouchdb or going javascript browser based solution across platforms since wp not supported. for replication or sync occur when device online again, require backend use couchbase server , implement replication class methods in native mobile app have push feature. or can use rest api ...

c# - WPF Invisible Cross cursor over gray background -

Image
the wpf cursors.cross becomes invisible on gray (#ff808080) background. i noticed cross cursor automatically inverts background color better visual perception. in case of gray color, inversion algorithm doesn't work well. see picture below: windows10, .net 4.5 note: might related caret disappears when background of textbox gray in wpf proposed solution not apply mouse cursor.

sql server - SQL Query that returns only records with multiple rows -

i have database 2 tables: customers , services . the customer table has account information , services table has individual records of every service company has performed. the services table linked customer table id column customers.id = services.customerid . i trying perform query return customer name , account number customers more 1 service has been performed within specified date range. example, show me customers i've performed work more twice in 2015. how write type of query multiple service visits returned? can using cursors, counting results, etc. seems there must more efficient way. just use join , group by so: select customers.id customers join services on customer.id=services.customerid --where services date check here group customers.id -- can add more columns customers table here , in select needed having sum(1)>1 you can add where clause filter services ' date range (just before group by ).

node.js - angularjs POST 405 method not allowed -

Image
i have angularjs project contains oauth github. i use satellizer plugin deal oauth protocol. every time try connect error: here route config (it's es6 using babel) : export default function routeconfig($routeprovider, $locationprovider) { $routeprovider .when('/', { templateurl: './modules/default/default.html', controller: 'defaultcontroller', controlleras: 'default' }) .when('/auth/:provider',{ controller: 'oauthcontroller', templateurl: './modules/auth/auth.html', }) .otherwise({ redirectto: '/' }); } i tested app using postman, requests work fine every post request returns 405. i use live-server host angularjs application. i've read issue might server-related. how can solve ? i use npm deal packages. **edit : ** tried simplehttpserver here got: well seems http post call somewhere in application. , sen...

javascript - Internet Explorer do not open php-file (can not find) -

i have simple login formular on website login next site using ajax: <form id="formlogin" method="post" action="login.php" role="login"> <img src="img/logologin.png" alt="" class="img-responsive" /> <div class="form-group"> <input id="user" type="username" name="username" required class="form-control" placeholder="enter username" /> <span class="glyphicon glyphicon-user"></span> </div> <div class="form-group"> <input type="password" name="password" required class="form-control" placeholder="enter password" /> <span class="glyphicon glyphicon-lock"></span> </div> <button type="submit" name="go...

python - Hiding the y-axis in this plot -

Image
simple question: need hide y-axis plot generated code: import matplotlib.pyplot plt import seaborn seaborn.set(style="white") import random objects = [("zachary's karate club", 78), ("dolphins social network", 159), ("c. elegans connectome", 2148 ), ("us power grid", 6594 ), ("pgp web of trust (2004)", 24316), ("linux kernel source file includes", 230213), ("enron emails (1999-2003)", 1148072), ("internet autonomous systems (2005)", 11095298), ("cs collaborations (dblp)", 18e6), ("wikipedia hyperlinks", 350e6), ("twitter follower graph (2012)", 20e9), ("facebook social graph (2011)", 68.7e9), ("nsa social graph (?)", 1e11), ("human connectome (neuronal)", 1e14) ] ...

rendering - How do i create a rich text editor component in sitecore -

in sitecore, steps involved in creating rich text editor rendering/component , having appear on page in experience editor (for asp.net mvc application) ? thank you! with item uses template has rich text field called body, rendering markup. field editable when rendered in edit mode. @using sitecore.mvc @using sitecore.mvc.presentation @model renderingmodel <div class="row"> @html.sitecore().field("body") </div>

android - Custom Adapter not populating GridView -

i have made custom adapter populate gridview. doing trying populate gridview 2 different data(that custom) are: movies , favouritemovies. when dridview updated using movies updates fine when favouritemovies not. storing favouritemovies in sqlite db , querying return cursor.the data returns , there no error. main problem moviesadapter. inside when add movies adapter adds list inside moviesadapter , works when add favouritemovies adapter not add inside favouritelist inside moviesadapter , size zero. please help!! here moviesadapter: package com.akshitjain.popularmovies; import android.content.context; import android.graphics.bitmapfactory; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.baseadapter; import android.widget.imageview; import com.squareup.picasso.picasso; import java.util.arraylist; import java.util.list; public class moviesadapter extends baseadapter { private context...

javascript - Three.js - mixing WebGL and CSS3D with iFrame -

i prepared working page mixes webgl , css3d (with little here ), , works great. throw in iframe measure: but lacks ability interact iframe. in mrdoobs pure css3d demo 1 can scroll pages , mark text etc: as seems, combination of webgl in front of css3d renderer hinders interaction. there way around this? thanks, dirk you can apply css pointer-events:none webgl node, events go through reach underlying css3d nodes , iframe. you attaching three.trackballcontrols document itself, no change needed there. note events on iframe, dispatched directly iframe. parent frame cannot directly observe these, catch , forward them, or send synthetic ones. lose navigation control events while pointer on iframe. mousewheel events have been exception in google chrome (forked webkit), perhaps not longer (2016-feb). maintain smooth navigation control, 1 approach cover iframe (possibly gray) transparent div when it's "not in use". , remove cover when be...

vb.net - Loading text into a list box -

the main goal need achieve make details entered user (such minutes used , total cost etc.) shown user in 1 list once boxes have been filled out. able save text within box/listbox txt file on pc. that pretty need do. cant seem happen , have no idea of how can that. code have far works how should. public class form1 private sub form1_load(sender object, e eventargs) handles mybase.load end sub private sub btn1totalcost_click(sender object, e eventargs) handles btn1totalcost.click 'declaring variables. dim minutesallowed integer dim minutesused integer dim textsallowed integer dim textsused integer dim dataallowed integer dim dataused integer dim minutestotalcost double dim textstotalcost double dim datatotalcost double dim monthlycost double dim totalcost double minutesallowed = val(txtboxminutesallowed.text) minutesused = val(txtboxminutesused.text) ...

php - Laravel Blade create Button with child -

i want convert html button laravel form button. dont know how. <button type="submit" class="btn btn-block btn-primary"> <i class="fa fa-plus"></i> benutzer hinzufügen </button> in blade template looks this: {!! form::submit('benutzer hinzufügen', array('class' => 'btn btn-block btn-primary')) !!} is there option this? {!! form::submit('benutzer hinzufügen', array('class' => 'btn btn-block btn-primary', 'child' => '<i class="fa fa-plus"></i>')) !!} you can this: {!! form::button('<i class="fa fa-plus"></i> benutzer hinzufügen', array('class' => 'btn btn-block btn-primary', 'type' => 'submit')) !!} it work want!

performance - Xamarin Android First web request deadly slow -

the first call made android xamarin app deadly slow, taking 10 times required time. i tried coding options "httpclient", "webclient" etc for instance: public string makewebrequest(string url) { try { string responsecontent; httpwebrequest request = (httpwebrequest)webrequest.create(url); request.method = "get"; request.headers.add(httprequestheader.authorization, "bearer " + token); request.proxy = globalproxyselection.getemptywebproxy(); // null; using (httpwebresponse response = (httpwebresponse)request.getresponse()) { using (stream responsestream = response.getresponsestream()) { using (streamreader sr = new streamreader(responsestream)) responsecontent = sr.readtoend(); } } return responsecontent; } catch (exception ex) { return ex.message; } } i tried sa...

sql server - How do I resolve ambiguous type names in PowerShell? -

i trying instantiate microsoft.sqlserver.management.smo.server in powershell 2 , later. have sql server 2012 2014 installed. when call following ambiguous type name error. [microsoft.sqlserver.management.smo.server]$srv = new-object "microsoft.sqlserver.management.smo.server" $serverinstance the result error ambiguity in type name because 2 versions of smo installed: new-object : type name 'microsoft.sqlserver.management.smo.server' ambiguous, 'microsoft.sqlserver.management.smo.server, microsoft.sqlserver.smo, version=12.0.0.0 , culture=neutral, publickeytoken=89845dcd8080cc91' or 'microsoft.sqlserver.management.smo.server, microsoft.sqlserver.smo, version=11.0.0.0 , culture=neutral, publickeytoken=89845dcd8080cc91'. i have tried add-type , other methods load specific assembly, ambiguity remains. a workaround might use get-item rather new-object, though have not tested script change. how resolve ambiguous type names i...

What does local relative filename means in Python? -

i found, proceess files given filename need do import os dir = os.path.dirname(__file__) filename = os.path.join(dir, '/relative/path/to/file/you/want') or import os dir = os.getcwd() filename = os.path.join(dir, '/relative/path/to/file/you/want') but if do filename = 'myfile.txt' then file? short answer: in current working directory. long answer: from https://docs.python.org/2/library/stdtypes.html#bltin-file-objects file objects implemented using c’s stdio package from https://docs.python.org/2/library/functions.html#open the first 2 arguments same stdio‘s fopen(): name file name opened so, answered looking @ documentation stdio : from http://www.cplusplus.com/reference/cstdio/fopen/ filename c string containing name of file opened. its value shall follow file name specifications of running environment , can include path (if supported system). "specifications of running environment"...

Python Windows Connect via a specific interface -

i'm trying connect host via specific network interface failed. here http://tangentsoft.net/wskfaq/advanced.html in paragraph 4.10 says bind() must call ip interface make connect(). here code: import socket time import sleep socketlocale= socket.socket(socket.af_inet, socket.sock_stream) socketlocale.setsockopt(socket.sol_socket,socket.so_keepalive,1) socketlocale.settimeout(10) #10.179.51.239 ip address of 1 of network interfaces socketlocale.bind(("10.179.51.239",45365)) #or socketlocale.bind(("10.179.51.239",0)) socketlocale.connect(("stackoverflow.com",80)) sleep(10) socketlocale.close() the error is: [errno 10049]the requested address not valid in context

javascript - How to avoid double event binding in Backbonejs View? -

var rowview = backbone.view.extend({ tagname: 'li', classname: 'course-row', events: { "click .table-row": "rowclick" // problem here! }, initialize: function() {}, template: _.template(tpl), render: function() { var rowstr = this.template({course: this.model}); $(this.el).append(rowstr); }, rowclick: function (e) { alert(e); } }); above code defines backbone row view. i'd create , render several several rows in table, did: data.foreach(function(rowdata){ var row = new rowview({model: course, el: mountpoint}); row.render(); }); if create 2 rows, event bind twice( 2 alert msg if click on row), 3 rows 3 times. avoided problem defining event @ parent views, if need attach event handler @ each row, how avoid double event biding problem? you're doing this: data.foreach(function(rowdata){ var row = new rowview({model: course, el: mountpoint});...

dataset - data matching/data selection with multiple conditions in a long shaped database r -

i have been struggling problem while, it's rather complex data selection multiple possible output , can't find expression want. measuring divorce rates in colony of birds. reproducible database: nest<- rep(seq(1:10),2) year<- c(rep(2014, 10), rep(2015, 10)) pair<- c("th4327_th4317", "2", "th8522_t75390" ,"4", "tj1704_tj1703", "th4335_th4333", "7", "8", "th4337_th4323", "t74703_th1797", "th4327_th4317", "12", "th8522_t75550","14", "tj1704_na" , "th4335_th4333", "17", "th8715_th8714", "th4388_th4323", "te9639_th9675") test<- data.frame(nest, year, pair) test$pair <- as.character(test$pair) test$year <- as.character(test$year) the underscore separates id of 2 members of pair. when no id present growing number placed. same nests e...

Multiple instances of ArangoDB on same server -

having looked through docs , come empty, hoping me. i run 2 copies (same version) of arango on same machine - 1 live, 1 test, on different ports. i prefer not setup docker environments or similar yet. any appreciated - os ubuntu take advice os. looking @ documentation here: arangodb docs looks should simple specifying database directory , port second service: create configuration file , make sure has: server.endpoint: ip address , port bind log parameters: if , log database.directory: path database files stored in then start this: arangod --configuration myconfigfile

javascript - How To Create methods(functions) in jQuery Plugins -

i want create plugin, looking img file on pc, , after load image file, user can choose methods apply in this. example, in call plugin: $('#test').myplugin({ legend: true }); and code plugin upload file this: (function( $ ){ var handlefileselect = function (evt) { var files = evt.target.files; for(var = 0, f; f = files[i]; i++) { if (!f.type.match('image.*')) { continue; } var reader = new filereader(); reader.onload = (function(thefile) { return function(e) { // render thumbnail. var span = document.createelement('span'); span.innerhtml = ['<img class="responsive-img thumb" src="', e.target.result, '" title="', escape(thefile.name), '"/>'].join(''); document.getelementbyid('list').insertbefore(span, null); }; ...

ssas - How to format (Bold) Row Labels -

Image
i use below scope statement bold measure values. there way make corresponding row labels bold well? scope ([reports].[income statement].members); // bold font report items // font_flags(this) = iif([reports].[income statement].currentmember [reports].[income statement].&[total sales],1,0); format_string(this) = iif([reports].[income statement].currentmember [reports].[income statement].&[variable margin],"#,##0.00 %;-#,##0.00 %","#,##0.00;(#,##0.00)"); end scope; this how looks in excel. measure value in bold , need row label "total sales" in bold font well. excel output

pip - How to install packages in different version of python? -

i have macbook pro came pre-installed python 2.7. later installed python3 , ipython notebook. installed pip install packages, , able install packages , run program python 3. however, project need run code in python 2.7, , not sure how install in python 2.7 folder. i tried using pip installing packages 2.7, kept giving error saying package exists. when check version of python using --version, see 2 pythons installed. however, when check pip , pip3, both seem in th same folder. any tips on how install packages in python 2.7, without making changes 3.3? using python3 , ipython notebooks project. viveks-mbp:~ vivekyadav$ pip /library/frameworks/python.framework/versions/3.3/bin/pip viveks-mbp:~ vivekyadav$ pip3 /library/frameworks/python.framework/versions/3.3/bin/pip3 viveks-mbp:~ vivekyadav$ python /usr/bin/python viveks-mbp:~ vivekyadav$ python3 /library/frameworks/python.framework/versions/3.3/bin/python3 you can use virtualenv create kind of sandbox. $ virtuale...

javascript - YouTube embedded videos not playing on iOS 9 in Safari -

i realized youtube embedded videos not play on ios devices on website unless click in top left corner of video. if strip out youtube parameters (i.e. ?rel=0&showinfo=0 , etc) , go standard youtube iframe embed code, videos still not play when click center play button. there have been few reports of similar issues posted, these 4 or 5 years old , resolved later either apple or youtube. example page: youtube video embedded directly in post we have not made changes our website's css or javascript, not sure caused or when started. happened notice problem today. any appreciated. thank you! after hours of trial , error, figured out. problem caused official mailchimp wordpress plugin , not using anymore. still active, deactivated , youtube videos began plugin on ios. my fault not starting first deactivating wp plugin 1 1 test @ beginning. lesson learned. hope helps else!

vb.net - Use streamreader to load data from text file into textboxes, code cannot find objStudent array -

option strict on imports system.text.regularexpressions imports system.io public class studenttestscores private structure student dim strstudentname string dim dbltestscores() double dim dblaverage double end structure public function getdoubletestscore(byval value string) double 'checks if value numeric , returns message if error found if isnumeric(value) dim dblvalue = cdbl(value) 'check make sure number positive , less or equal 100 if dblvalue >= 0 , dblvalue <= 100 return dblvalue else throw new exception("the number needs between 0 , 100") end if else throw new exception("please enter number in test score area.") end if end function private sub btncalc_click(sender object, e eventargs) handles btncalc.click 'creates variable , runs isvalidname ...

python - Astropy add checksum to existing fits file -

i have fits file written (someone sent me) , want add checksum , datasum header. examples found adding checksum using astropy.io.fits involve building new fits hdu , verifying it on adding each section hdu. do, seems have lot more overhead needed. is there way add checksum , datasum existing hdu? imagehdu objects have method called .add_checksum . should want. so open fits file in update mode , call , close file again. hdus = astropy.io.fits.open(filename, mode='update'): hdus[0].add_checksum() # fill in arguments need them hdus.close() or if with statement: with astropy.io.fits.open(filename, mode='update') hdus: hdus[0].add_checksum() # fill in arguments need them

php - forum posts have inappropriate, invisible line breaks -

Image
i cannot life of me figure out why, when people post on php forum (called forum, codecanyon [unsupported]), posts tend this: inspecting chrome dev tools, text looks fine , don't see evidence of line-breaks. i've played around textarea width, making match text container width, doesn't seem help. neither did making sure padding matches, font, etc. rather post bunch of css turn out irrelevant, guess i'll wait instruction. clue should look, things try. don't know begin, this. turns out, wrap="hard" culprit.

javascript - How to make div expand only from bottom down -

i have div in modal below. problem i'm having when click on add row, creates div row , expands both top , bottom. div goes off screen after couple of rows added. please see screenshots. note: query-row element angular directive, that's why don't see template (which includes actual fields , add row button). that's irrelevant in case. html <div class="ng-modal ng-cloak" ng-show="true"> <div class="ng-modal-overlay"> <div class="ng-modal-close"> <div class="ng-modal-close-x">close</div> </div> <div class="ng-modal-dialog"> <div class="ng-modal-dialog-content"> <div class="document-content-wrapper"> <div class="document-content"> <div ng-repeat="row in rows"> <q...

excel - Limiting cell values in formulas -

Image
i use kind of limit or over/under rule in formula. premise if number exceeds value, want take value. here's example: if employee's hours exceed 80 hours per month, use 80 hours accounting purposes. let's employee bob's timesheet looks this: jan = 20 hours feb = 40 hours mar = 100 hours apr = 60 hours etc. if bob gets paid $100/hours, final payment should $100/hour * total hours works. or in excel format, =100*sum(b1:b12) if hours stored in column b. but, want take maximum of 80 hours each month... hours in above example, far accounting concerned, this: jan = 20 hours feb = 40 hours mar = 80 hours apr = 60 hours etc. i'd rather not build in column =if(b1>80,80,b1). , honest, it's bugging me can't figure out. please help! try array formula: =100 * sum(if(b1:b12>80,80,b1:b12)) this array formula , must confirmed ctrl-shift-enter when exiting edit mode instead of enter or tab.

javascript - Close keyboard in UIWebView -

i working on web application accessed ios uiwebview . when user touches input text field, uiwebview automatically opens keyboard. fine point. now when user taps anywhere on page want dismiss keyboard. method this. i tried following code did not work me - $(document).on("tap", function (e) { document.activeelement.blur(); }); try document.foo.bar.myinput.blur();

java - Ignore case sensitivity while selecting option from a dropdown in Selenium Webdriver -

i have problem select dropdown menu using selectbyvisibletext ignoring case sensitivity. options' case dynamic. example code have used : public static void setdropdownvalue(by fieldid, string fieldvalue) { select dropdown = new select(driver.findelement(fieldid)); dropdown.selectbyvisibletext(fieldvalue); } is there way can select option menu ignoring cases. thanks it not possible using selectbyvisibletext(text) if still want somehow. use this: public static void setdropdownvalue(by fieldid, string fieldvalue) { select dropdown = new select(driver.findelement(fieldid)); int index = 0; (webelement option : dropdown.getoptions()) { if (option.gettext().equalsignorecase(fieldvalue)) break; index++; } dropdown.selectbyindex(index); } one last point add, depending on structure of web page option.gettext() may not return option value need. in such cases find attribute contains value of options in drop down , us...

java - how to intercept all requests in spring REST controllers? -

i have bunch of controllers like: @restcontroller public class areacontroller { @requestmapping(value = "/area", method = requestmethod.get) public @responsebody responseentity<area> get(@requestparam(value = "id", required = true) serializable id) { ... } } and need intercept requests reach them, i created interceptor example: http://www.mkyong.com/spring-mvc/spring-mvc-handler-interceptors-example/ but never enters :( because i'm using annotations, don't have xml define interceptor, i've found set this: @configuration @enablewebmvc @componentscan(basepackages = "com.test.app") public class appconfig extends webmvcconfigureradapter { @bean public controllerinterceptor getcontrollerinterceptor() { controllerinterceptor c = new controllerinterceptor(); return c; } @override public void addinterceptors(interceptorregistry registry) { registry.addinterceptor(getcontrolle...

node.js - Where to store a node_package specific settings on the client machine? -

i' have node_package bookiza (installed globally) posts/patches values receiving substrate using credentials taken off .rc file. i'm saving .rc file inside module itself, @ usr/lib/node_modules/bookiza , can anywhere like. problem in storing inside package settings overwritten whenever user npm -g installs again, update package. function updatebookizaconfig(res) { var bookizaconfig = json.parse(fs.readfilesync(path.join(__dirname, '..', '.bookizarc')).tostring()); bookizaconfig.token = res.body.key; bookizaconfig.username = res.body.username; bookizaconfig.email = res.body.email; fs.writefilesync(path.join(__dirname, '..', '.bookizarc'), json.stringify(bookizaconfig, null, 2)); // move or copy config file outside of package retain credentials upon package update. // cp('-r', path.join(__dirname, '..', '.bookizarc'), path.join(__dirname, '..', '..')); console.log(chalk.bold.c...

c++ - SDL Text Input returning white squares -

Image
i created event class , wanted text it. unfortunately text isn't reading correctly... i've set text gotten output command line when new key input, isn't working. here's "eventmanager" code update function: void eventmanager::update(){ while(sdl_pollevent(&e)){ switch(e.type){ case sdl_quit: running = false; break; case sdl_mousebuttondown: mousepressed = true; break; case sdl_keydown: if(shouldcollecttext && e.key.keysym.sym == sdlk_backspace && currentcollectedtext.length() > 0){ currentcollectedtext.pop_back(); }else if(shouldcollecttext && e.key.keysym.sym != sdlk_backspace){ currentcollectedtext += e.text.text; //the problem std::cout << currentcollectedtext << std::endl; } } ...