Posts

Showing posts from January, 2011

php - Howto Know difference - clicked Link vs email preview - for 1 time use URL's? -

i'm using email text gateway url stops further email texts. when text arrives on phone, provider preview attempt on url - triggers application stop sending future texts. is there way tell difference - way of env variables (php) running because clicked on link , not cellular provider doing preview attempt? i'm using apache web server, php server side. previously i've used ip check see if "barracuda" remote address , ignore - has not been successful - added new ip address blocks. seemed cellular provider using barracuda email->text gateway email services. wondering if has better suggestion keep searching logs new ip blocks add application. the log entries are: first hits base domain name, hits base url, full url itself. 64.74.215.166 - - [24/jul/2017:19:02:47 -0600] "get / http/1.1" 200 882 "-" "mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/56.0.2924.76 safari/537.36" 64.74.215.176 -...

xcode - How to change iOS in app purchase when changing to lifetime membership instead of subscription? -

our app allows users either have 1 month subscription, or lifetime subscription. 1 month auto-renew subscription, lifetime 1 time purchase. our issue arises when user has 1 month subscription, , wants change lifetime subscription, aren't sure how cancel user's monthly subscription them, or if possible.

multithreading - php exec() haphazardly working in pthreads -

i use loop exec() file 300 times in pthreads. full 300 exec() calls successful, times few of exec() fail , between 295 or 299 successful executes of file. the error code exec() comes @ #127, checked file_exists on failures , says "file exists", says "file not executable" on failures. strange because executable other 295 times within loop. my pthread version 2 months old. confident don't have pthread workers sharing files or writing same spots. scratching head else can do. class workerthreads extends thread { private $workerid; public function __construct($id) { $this->workerid = $id; } public function run() { $mainfile="/pastlotto_1/".$this->workerid."/preset_pthread.php"; for($x=0; $x<100; $x++) { for($o=0; $o<3; $o++) { $command="php $mainfile"; $finde=exec($command,$output,$return_var); if($return_var !== 0){ echo " fil...

Spring Controller Mapping Issues - Double Wildcard -

i map following url: /resource/{path/to/git/repo.git}/{branch}/{path/within/repository} to spring framework controller. having issues. have tried following pattern no success: /resource/**.git/{branch}/** matches resource/anything.git/branch/path/etc (no slashes in path git repo) does not match resource/path/anything.git/branch/path/etc expect i have tried /resource/**/.git/{branch}/** in testing behaves expected, allowing number of slashes in both ant pattern wildcards, not suit situation added slash. is there way map without resorting /resource/** , doing work of matching in controller? i ended fixing using mapping: /resource/**/*.git/{branch}/** a side effect of example given in original post working

matlab - Subplot with decomposed morphological structuring element -

Image
i using matlab 2014b, function strel behaves in different way respect newer versions [1] . in case, generating disk shaped structuring element approximation of 8 (in reality 10) linear structuring elements. i visualize these linear structuring elements , example in subplot. unfortunately, after these years using matlab, still have many problems understanding how obtain want plot. in case able visualize them "comparable" scale, 1 can notice differences in size , orientation. (note: using imcomplement black lines on white background, instead of opposite, printing reasons.) the minimal code this: se = strel('disk', 300, 8); seq = getsequence(se); k = 1:length(seq) subplot(5,2,k); imshow(imcomplement(seq(k).getnhood)); axis equal end as can see, results in suboptimal subplot: so summarize, question is: is possible obtain visualization (either subplot, or 10 different plots) where strels have same scale , , visible enough reader can idea of...

python - Write from Text files to CSV Files -

i trying write rows contain string: bunch of text files. code: import os import glob import csv import re #defining keyword keyword = '2012-07-02' #code merge relevant log files 1 file , insert open('combined-01022012.txt' , 'w', newline = '') combined_file: csv_output = csv.writer(combined_file) filename in glob.glob('fao_agg_2012_part_*.txt'): open(filename, 'rt', newline = '') f_input: #with gzip.open((filename.split('.')[0]) + '.gz', 'rt', newline='') f_input: csv_input = csv.reader(f_input) row in csv_input: row.insert(0, os.path.basename(filename)) try: if keyword in row[2]: csv_output.writerow(row) #row.insert(0, os.path.basename(filename)) #csv_output.writerow(row) except: continue ...

algorithm - Time complexity pseudo code -

i want calculate time complexity of following code : for(i=0;i<n;i++){ func(); . // other o(1) operations . } where func() has complexity of o(k). the time complexity o(k*n) then.

dynamics crm - How to retrieve all Opportunity Products for the specific Opportunity through c#? -

Image
i have opportunity shown in below image: yesterday, posted question on how create opportunity products (motor products) & dave provided me answer on how achieve this. now, requirement has been extended delete these existing motor products & add new products. i'm thinking first retrieving relative motor products opportunity. for creating opportunity product used below code: var opportunityproduct = new entity(entitymotorname); opportunityproduct["tmeic_opportunitymotorproductid"] = new entityreference("opportunity", guid("opportunityid")); var opportunityproductid = crmservice.create(opportunityproduct); but, i'm stuck here retrieing these motor products. once motor products related opportunity can use below query. crmservice.delete(entityname,guid); note: opportunity has opportunityid no tmeic_opportunitymotorproductid & motor product (opportunityproduct) doesn't have opportunityid has tmeic_opportunitymotorpr...

elasticsearch - Is an nGram fuzzy search possible? -

i'm trying ngram filter work fuzzy search, won't. specifically, i'm trying "rugh" match on "rough". i don't know whether it's not possible, or possible i've defined mapping wrong, or mapping fine search isn't defined correctly. mapping: { settings = new { index = new { number_of_shards = 1, number_of_replicas = 1, analysis = new { filter = new { edge_ngram_filter = new { type = "ngram", min_gram = 3, max_gram = 8 } }, // filter analyzer = new { analyzer_ngram = new { type = "custom",...

php - Variable + Number to Database -

i confused great. i trying press button add 40 sales in order add 40 need current number of sales used fetch array output number , see '40' set variable tried $varible + 40 set number. not seem working check online , anyhelp awesome! $query = "select `sales` `sales`"; if ($result=mysqli_query($link, $query)) { $row = mysqli_fetch_array($result); print_r($row); } if ($_post['update']) { echo 'updating...'; $query="update `sales` set `sales` = '$row+40' `sales`.`id` = 1"; mysqli_query($link, $query); echo '<br>successfully updated'; } else { echo 'unsuccessful'; } as far query goes in mysql don't need 2 separate ones add existing data. query go follows: update `sales` set `sales` = `sales` + 40 `sales`.`id` = 1; so code this... if($_post['update']) { echo 'updating...'; ...

objective c - iOS App crashes when it's updated in the AppStore, but not when it's installed in Xcode -

i'm using coredata in app. when modify entity or attribute, upload appstore , try update it, crashes. have uninstall , download again. there way bypass , update automatically deletes outdated version , installs latest version? how can resolve in user friendly , efficient way? you need create new core data model , migration. please use tutorial: https://code.tutsplus.com/tutorials/core-data-from-scratch-migrations--cms-21844

java - Invalid byte 1 of 1-byte UTF-8 sequence: RestTemplate -

i integrating third party api using rest template, send response in format of xml. of request, getting below error. could not unmarshal [class com.xxx.searchresponse]: null; nested exception javax.xml.bind.unmarshalexception\n - linked exception:\n[com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: invalid byte 1 of 1-byte utf-8 sequence. i tried contenttype "application/xml", "text/plain", "text/xml" , "text/xml,charset=utf-8" only of response, getting error , xml response has many lines. hard detect characters facing problem. guess content type missing it. xml element: <search-response xmlns="" xmlns:info="" xmlns:common=""> <search-response> when hit third party api in postman, getting content type "text/xml;charset=iso-8859-1"

python - Tracking decorator not passing arguments -

i'm working on alexa skill flask-ask. want log intent calls , arguments, , since intents conveniently annotated ask.intent decorator, figured either change code of flask-ask logging in code of decorator, or decorate myself, preferable avoid problems patching library when deploying production. i've built solution below, problem *args , **kwargs empty, instead of being passed on over voted solution this issue . def tracked_intent(intent_name, mapping={}, convert={}, default={}): def decorator(f): @ask.intent(intent_name, mapping, convert, default) def new_func(*args, **kwargs): print('got intent {} arguments {} , {}'.format(intent_name, str(args), str(kwargs))) return f(*args, **kwargs) new_func.__name__ = f.__name__ return new_func return decorator thus, when have intent call requires argument, typeerror: function() missing 2 required positional arguments: 'arg1' , 'arg2' how can...

android - Auto Focus Modes Not Working In Samsung S8 -

update 2: focus modes apparently don't work update 1: problem seems isolated samsung s8 device. it's working on nexus 5x , xiaomi phones i've been trying make focus_mode_continuous_picture work no avail. i've confirmed device supports continuous auto picture via getsupportedfocusmodes() , , not sure why doesn't work. here's code, continuous auto focus being set in startcamera() : class capturereceiptfragment : fragment(), capturereceiptcontract.view { private val my_permissions_request_camera = 1 private var camera: camera? = null private var hascamerapermission: boolean? = null private lateinit var preview: camerapreview override var presenter: capturereceiptcontract.presenter? = null private val picture = camera.picturecallback { data, camera -> val picturestoragedir = file(environment.getexternalstoragepublicdirectory( environment.directory_pictures), getappname()) presenter?.savereceipt(picturestoragedir, data) } ...

c# - Order of execution with multiple filters in web api -

i using latest web api . i annotate some controllers 3 different filter attributes. 1 [authorize] 2 [ressourceownerattribute derived authorizationfilterattribute] 3 [invalidmodelstateattribute derived actionfilterattribute] i can not sure filters run in order declared top down. how define order of execution in web api 2.1 ? https://aspnetwebstack.codeplex.com/workitem/1065# http://aspnet.uservoice.com/forums/147201-asp-net-web-api/suggestions/3346720-execution-order-of-mvc4-webapi-action-filters do still have fix myself ?? some things note here: filters executed in following order action: globally defined filters -> controller-specific filters -> action-specific filters. authorization filters -> action filters -> exception filters now problem seem mention related having multiple filters of same kind (ex: multiple actionfilterattribute decorated on controller or action. case not guarantee order based on reflection.). case, there way in...

nosql - How to delete in couchbase? -

hi having issues trying delete entries in couchbase. entry looks this, [ "default": {"status": "success", "traceback": null, "result": 13, "task_id": "003bba0e-a9ff-44a5-8c79-7829878eb1bb", "children": []}] where entry celery task add entry. i have tried following queries keep getting no result or entry not being deleted, delete default s s.task_id = "003bba0e-a9ff-44a5-8c79-7829878eb1bb" returning s delete default "task_id" = "003bba0e-a9ff-44a5-8c79-7829878eb1bb" but no avail. your first delete statement correct if document json object top-level field of task_id , perhaps document not well-formed json. ### add document default bucket insert default (key, value) values ("task1", {"status": "success", "traceback": null, "result": 13, "task_id": "003bba0e-a9ff-44a5-8c79-7829878eb1bb",...

api - Angular Promise<void>' is not assignable to type -

i building angular4 website using contentful cms api retrieve data. problem cannot assign right types returned data thought console shows types. the mock data: export const names: page[] = content.getentries({ content_type: 'mainmenu' }).then(function(response){ response.items.foreach(element => { return element.fields; }) }); which return via console (if used console.log ) : object { title: "about aliens" } object { title: "portfolio" } object { title: "meet team" } object { title: "contact us" } and class use assign data types : export class page { title: string; } i new typescript , want know got wrong , appreciate if guided me can go master returning such data api. thank you. you trying assign promise array, have assignment in callback of promise. your then call on promise not return anything, call foreach iterates on collection returns nothing. if want create/return use map creates n...

Javascript Push Product Info as Object to an Empty Array -

i have array of products add product information object empty array. var data = { "vegetables": [ { "id": "1", "title": "peas", "type": "green", }, { "id": "2", "title": "carrots", "type": "root", } ], "protein": [ { "id": "3", "title": "steak", "type": "meat", }, { "id": "4", "title": "eggs", "type": "dairy" } ]} i able push title empty result array following: function getcategory() { result = []; (let item in data) { data[item].foreach(v => result.push(v.title)); } document.write(result); } getcategory(); but able push product information object can formatting. example: var myobj= "" ; myobj = "<div class='b...

python - Django update migrations from sqlalchemy to south -

i've django project using alembic , sql alchemy migrations. i'd upgraded django 1.9 has south default migrations. there way switch south adding , removing of new fields without creating migrations tables? i'd tried python manage.py makemigrations creating migrations tables exists.

mysql - How to annotate ManyToMany relation Ebean in Play 2.6.x -

i trying implement manytomany relation histroy_user table bridge table between use r , history table. attached screen shot of mysql rendered play my user model package models; import java.util.*; import javax.persistence.*; import io.ebean.*; import io.ebean.annotation.enumvalue; import play.data.format.*; import play.data.validation.*; import io.ebean.model; /** * created shah on 7/20/17. * above line 1 explits package name * line 4 9 basic package importing required */ @entity public class user extends model{ //start of user model class @id //defines tables primanry key @constraints.min(10) //apply limit 10 digits @column(nullable=false) @generatedvalue public long id; @constraints.required //apply constraint "not null" @column(nullable = false) public string name; @constraints.required @column(nullable = false) public string email; @constraints.required @column(nullable = false) public string pas...

Scraping javascript website in R -

i want scrape match time , date url: http://www.scoreboard.com/game/rosol-l-goffin-d-2014/8drhx07d/#game-summary by using chrome dev tools, can see appears generated using following code: <td colspan="3" id="utime" class="mstat-date">01:20 am, october 29, 2014</td> but not in source html. i think because java (correct me if im wrong). how can scrape information using r? so, rselenium not answer (anymore). if can install phantomjs binary (grab phantomjs binaries here: http://phantomjs.org/ ) can use render html , scrape rvest (similar rselenium approach doesn't require java): library(rvest) # render html site phantomjs url <- "http://www.scoreboard.com/game/rosol-l-goffin-d-2014/8drhx07d/#game-summary" writelines(sprintf("var page = require('webpage').create(); page.open('%s', function () { console.log(page.content); //page source phantom.exit(); });", url), con=...

javascript - Google Tag Manager - Tag Firing After Another Tag -

Image
i having trouble firing tag after tag has been fired. have "ga - event translate click" & "ga - event - reader google translate scroll tracking". "ga - event translate click" tag fires after onchange event happens (when user click on google translator widget on page) , being placed under "gtm.change" event in google tag manager. "ga - event - reader google translate scroll tracking" tag fires when page loaded , being placed under "cescrolltracking" event in google tag manager. i "ga - event - reader google translate scroll tracking" tag fired , placed in "cescrolltracking" event in google tag manager after "ga - event translate click" tag being fired. i have attached screenshots of how looks in google tag manager debugger. could please me issue?

express - How to handle a post request in JavaScript from Arduino ESP8266 -

hey stackoverflow community. have entered world of javascript , node.js. know c# quite well. i'm trying make arduino collect data , send ubuntu server(rented @ digitalocean). i'm using esp8266 arduino make post request(arduino wifi module), , i'm sure that part works. the problem is, want recieve , display data arduino sent on server. javascript part not seem work (on server). the esp8266 uses library here: https://github.com/esp8266/arduino . here code esp8266 arduino uses. include arduino.h include esp8266wifi.h include esp8266wifimulti.h include esp8266httpclient.h #define use_serial serial esp8266wifimulti wifimulti; string ssid = "yourwifiname"; string password = "yourwifipassword"; string website = "http://165.227.138.230/"; string data = "20"; void setup() { use_serial.begin(115200); // use_serial.setdebugoutput(true); use_serial.println(); use_serial.println(); use_serial.println(); for(uint8_t t = 4; t > 0...

WPF window state when restored from maximized gets stuck in odd state -

i'm seeing strange behaviour wpf. have form 3 buttons on it. 1 button should make window fullscreen, 1 should center on monitor on, third button should restore window normal position. the xaml is <window x:class="testrestore.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:testrestore" mc:ignorable="d" title="mainwindow" height="350" width="525" resizemode="canresizewithgrip" windowstartuplocation="centerscreen"> <grid> <button content="max" horizontalalignment="left" margin="10,10,0,0" verticalalignment=...

javascript - Success does not fire after getJson -

i have getjson method in jquery fetches soe location data code $.getjson('https://nominatim.openstreetmap.org/reverse', { lat: lat, lon: lng, format: 'json', }, function (result) { var dn = result; var phn = localstorage.getitem("number"); var new_dn = json.stringify(dn); $.ajax({ url: 'http://cnn.com/nj.php' , type : "post", data: {phone: phn, location: new_dn }, datatype: 'json', success: function() { alert('success'); } }); }); i want on success code not fire alert success: function() { alert('success'); } why so?. the jqxhr.success(), jqxhr.error(), , jqxhr.complete() callback methods removed of jquery 3.0. can use jqxhr.done(), jqxhr.fail(), , jqxhr.always() instead. see http://api.jq...

web - Serve retina display images in Stack Exchange content? -

after recent hardware upgrade, i've run problem of not being able use screenshots take stack exchange questions , answers anymore because massive. if had image editor installed resize images rather quickly. photoshop droplet 1 easy solution. and there others. haven't installed image editing software yet, nor have found of other solutions suitible. i wonder though, if maybe answer doesn't lie in crushing content down again, rather in letting live in original retina glory. is there kind of syntax can put around images tell stack exchange "this retina res image", served @ full-res retina visitors , @ half-res non-retina visitors? thanks.

r - apply formula for certain columns using other columns -

i have data frame dat = data.frame(type = c("a","a","b","b","c","c","d"), nexttype = c("a", "b","b", "c","c","d",na), = c(rep(0,7)), b = rep(0,7), c = rep(0,7) , d = rep(0,7), stringsasfactors = f) dat type nexttype b c d 1 0 0 0 0 2 b 0 0 0 0 3 b b 0 0 0 0 4 b c 0 0 0 0 5 c c 0 0 0 0 6 c d 0 0 0 0 7 d <na> 0 0 0 0 what's best way populate columns a, b , c , d 1 if column name (a, b, c, d etc...) = type = nexttype so column 1,0,0,0,0,0,0 column b 0,0,1,0,0,0,0 column c 0,0,0,0,1,0,0 column d 0,0,0,0,0,0,0 note -- has dynamic. have 4 columns above a, b , c , d there can 10, 20 or number of columns. use dplyr , tidyr : library(dplyr); library(tidyr); dat %>% ...

php 7.0 vs 5.6 - array key to object difference -

question why code produce different results when run in php5.6 vs php7.0? background i have following code: <?php $assoc_array = [ 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 ]; $index_array = ['a','b','c','d']; $object = new \stdclass; foreach($index_array $item) { $object->$assoc_array[$item] = ""; } print_r($object); when run in ubuntu 17.4, apache 2.4.25, php 7.0, this: notice: array string conversion in /var/www/html/file.php on line 12 notice: array string conversion in /var/www/html/file.php on line 12 notice: array string conversion in /var/www/html/file.php on line 12 notice: array string conversion in /var/www/html/file.php on line 12 stdclass object ( [array] => array ( [a] => [b] => [c] => [d] => ) ) when run in same environment, switch php 5.6, this: stdclass object ( [1] =...

logging - Chrome crash after malware removal (browser_gpu_channel_host_factory.cc(103) Failed to launch GPU process.) Windows10 -

after removing malware withing chrome (which open ad tab , search yahoo) got issue. chrome crash frequently. sometime came without reason, other time after launching canary. isn't starting anymore, normal chrome or canary, , after having removed program, folder, restarted computeur, delete registry key, deactivated extension, deleted user data , tried using without account , synced data, i'm still having error. all page black error icon. can't acceed anything, not settings. tried log , saw in console : [5228:9564:0725/190255.609:error:browser_gpu_channel_host_factory.cc(103)] failed launch gpu process. 2 chrome. to rid of malware used malwarebyte, malwarebyte rootkit beta, adwcleaner, hitman pro, superantispyware portable, jrt, rkill , ccleaner, in safe mode (i follow post on net). got issue windows service, solved putting service activation list default. malware in chrome sync data had remove too. malware isn't there anymore, don't know if can cause of cu...

cql - Can't update Cassandra table in cqlsh -

i have simple table "test" set so: cqlsh> select * "default".test; name | address ------+------------ kim | 123 street john | 222 street i have cqlsh terminal open, , when try update row in table, error: cqlsh> update "default".test set name = mark name = john if exists; syntaxexception: line 1:38 no viable alternative @ input 'where' (..."default".test set name = [mark] where...) not sure what's wrong command. i've tried wrapping field names/ values in quotation marks makes no difference. always enclose string/date/timesamp value single quote so case : update "default".test set name = 'mark' name = 'john' if exists;

oauth 2.0 - Authenticate against AzureAD (OAuth2) without registering a client? -

i'm trying create web api in azure allows user access it. don't care whether user calls api via postman, curl or .net console app, long user can authenticate against azuread protecting resource, should in. however, documentation have seen far require me register client azuread. so, i've got example working, had register console app in azuread. now, there maybe hundreds or thousands of developers developing apps against api. don't want have register each single 1 azuread. in fact, don't want have know them. how can that? care users, not client apps. or azuread b2c does? now, there maybe hundreds or thousands of developers developing apps against api. don't want have register each single 1 azuread. in fact, don't want have know them. you need register 1 app(web app) protect web api. , if want web api consumed different organization, need enable multi-tenanted feature on azure portal. after that, if other developers want consumer ...

sql server - How to determine the schema of a REST service? -

i'm attempting build process import json data returned rest service sql server 2016 database on scheduled basis (every 5 mins). i'm aware there's new sql 2016 function called openjson can handle importing data, i'm concerned setting target tables in database since don't know rest service possibly return. is there way lookup full schema (required , optional fields) of rest service tables created in sql server can built handle of types of data rest service return? am being foolish since rest schema potentially change? if that's case, how process rely on rest data, of set in stone? do have control on rest service? if can publish schema using api explorer tool such swagger. can version end-points , dto's avoid contract changes. if don't have control on rest service , subject change you'll unfortunately need validate data contract side has agreed upon before importing data it.

npm - 'foundation watch' in Foundation 6 not serving project files -

i've installed zurb foundation 6 after having used past versions of foundation thru years. npm install -g foundation-cli i ran commands outlined in getting started: foundation new // website (foundation sites) // project-name // basic template: includes sass compiler the project directory created, then: cd project-name foundation watch and result is: $ foundation watch > foundation-sites-template@1.0.0 start /project-name > gulp [19:28:34] using gulpfile ~/documents/test-foundation-6/gulpfile.js [19:28:34] starting 'sass'... [19:28:35] finished 'sass' after 1.26 s [19:28:35] starting 'default'... [19:28:35] finished 'default' after 11 ms at point nothing else happens - there no errors. i've opened localhost:8080 , few other ports no pages loading. if open index.html file directly in browser renders fine. i tried foundation build no /build directory created. i read in places there issues if past (gem) version o...

python - File read performance test yields interesting results. Possible explanations? -

Image
i'm stress-testing system determine how punishment filesystem can take. 1 test involves repeated reads on single small (thus presumably heavily cached) file determine overhead. the following python 3.6.0 script generates 2 lists of results: import random, string, time stri = bytes(''.join(random.choice(string.ascii_lowercase) in range(100000)), 'latin-1') inf = open('bench.txt', 'w+b') inf.write(stri) t in range(0,700,5): readl = b'' start = time.perf_counter() in range(t*10): inf.seek(0) readl += inf.read(200) print(t/10.0, time.perf_counter()-start) print() t in range(0,700,5): readl = b'' start = time.perf_counter() in range(3000): inf.seek(0) readl += inf.read(t) print(t/10.0, time.perf_counter()-start) inf.close() when plotted following graph: i find these results weird. second test (blue in picture, mutable read lenght parameter) starts off linea...

angular2 changedetection - Angular change detection process repaint the dom -

Image
i'm learning angular change detection process , checking dev tools in chrome, see strange behavior. my plnkr demonstrate behavior: http://plnkr.co/edit/ctlf00nqdhvmkhyc8iou i have simple component view: <li *ngfor="let item of list">{{item.name}}</li> and constructor: constructor() { this.list = [{name: 'gustavo'}, {name: 'costa'}] to simulate simple request added: // simulating request repaint dom setinterval( () => { this.list = [{name: 'gustavo'}, {name: 'costa'}]; }, 2000); if noticed, array list receives list equal initial value. let's imagine when angular checks values in view in change detection process have code this: if( oldname !== name ) { // ( 'gustavo' !== 'gustavo') // update view } but values same, why angular repaint dom every 2 seconds.? but if i mutate object, repaint not occurs // simulating request there not repaint setinterval( () => { this.l...

link redmine without signing in -

i in application , need link wiki in redmine, necesary sigin. have others things in redmine , necesary signing in. dont want wiki public because user whould acces wiki jump signing in. i try this: application.showurl(' http://192.168.1.13/projects/integra-gestion/wiki/clientes?key=17ff558dbe22168d834a49b690ea19bb00573bfx ', '_blank') its working, problem imposible navigate in redmine. can see web in url, if want navegate in others places in redmine necesary sign in. some ideas, thanks. sorry bad english

c# - I moved the directory of visual studio to a different drive, now I cannot compile -

my c: drive strictly windows (a 64gb ssd), , learned full. changed program files directory d:/programfiles , contents of old program files new directories. now, trying compile program in visual studio 2017 community give me error: the reference assemblies framework ".netframework,version=v4.5.2" not found. how can tell visual studio moved files to? edit : have installed visual studio (devenv.exe) under "visual studio 2k17", i've moved assemblies (not visual studio) d drive. if choose reinstall, still put files on c drive. how can tell visual studio moved files to? by uninstalling visual studio , re-install , while doing choose installation path d:\ drive. moving installation directory different root drive won't make since there registry settings still pointing c:\ drive installation folder

css - Adding class to element in php code -

i given piece of code change variable prices on woocommerce store display "from" before price instead of range of prices. here's code in question: <?php function iconic_variable_price_format( $price, $product ) { $prefix = sprintf('%s: ', __('from', 'iconic')); $min_price_regular = $product->get_variation_regular_price( 'min', true ); $min_price_sale = $product->get_variation_sale_price( 'min', true ); $max_price = $product->get_variation_price( 'max', true ); $min_price = $product->get_variation_price( 'min', true ); $price = ( $min_price_sale == $min_price_regular ) ? wc_price( $min_price_regular ) : '<del>' . wc_price( $min_price_regular ) . '</del>' . '<ins>' . wc_price( $min_price_sale ) . '</ins>'; return ( $min_price == $max_price ) ? $price : sprintf('%s%s', $pre...

javascript - How to spy on static generator functions? -

i have utility function exposes generator: export class utility { // provides generator streams 2^n binary combinations n variables public static *binarycombinationgenerator(numvars: number): iterableiterator<boolean[]> { (let = 0; < math.pow(2, numvars); i++) { const c = []; //fill c yield c; } } } now, using generator in code follows: myfuncion(input){ const n = numberofvariables(input); const binarycombinations = utility.binarycombinationgenerator(n); let combination: boolean[] = binarycombinations.next().value; while (till termination condition met) { // , check whether termination condition met combination = binarycombinations.next().value; } } in unit tests (using jasmine) want verify how many times generator function invoked (i.e. how many combinations generated) before termination. below have tried: it("my spec", () => { //arrange c...

css - specific media query not overriding? -

so have element want change @ 750px , 500px: .footer-logo img { content:url(...); } and then: @media screen , (max-width: 700px) { .footer-logo img{ margin-top: -58px !important; padding:64px; } } @media screen , (max-width: 500px) { .footer-logo img { width: 80vw !important; max-width:none !important; margin-top:-10px !important; } the 500px changes happen changes when testing @ 700px not happen. know shouldn't using !important styling won't happen without it... appreciated you can try this. please check div color changes according media query html <div class="footer-logo"> <img src="http://dummyimage.com/100x50/000/fff&text=throbble!"> </div> css @media screen , (max-width: 700px) { .footer-logo > img{ margin-top: -58px !important; padding:64px; } .footer-logo { background-color:yellow; } } @media screen , (max-width: 500px) { .footer-logo > img { width: 80px !important; max-width:none !im...

c# - Microsoft.Office.Interop.Word Selection.InsertFile() Method->How to use Bookmark in Range Parameter -

Image
we're doing update ms word add-in allows users insert ms word files central ms word document using following function: //created rng variable microsoft.office.interop.word.range rng = globals.thisaddin.application.selection.range; //ms interop method. globals.thisaddin.application.selection.insertfile( filename, rng,//<--added range ref missing, //confirm conversions ref falsevalue, //link file ref falsevalue //attachment ); the second parameter: ref missing, //range - word can bookmark seems can pass range parameter can bookmark (which can use delete added content, if needed), haven't been able find implementation examples demonstrate how done. msdn describes parameter follows: range type: system.object optional object. if specified file word document, parameter refers bookmark. if file type (for example, microsoft excel worksheet), parameter refers named range or cell range (for example, ...