Posts

Showing posts from February, 2013

java - Resources$NotFoundException -

so whenever run app, it'll instantly crash , give me following error: no package identifier when getting value resource number 0x00000000 fatal exception: main process: com.example.wessel.weer, pid: 3095 android.content.res.resources$notfoundexception: resource id #0x0 @ android.content.res.resources.getvalue(resources.java:1351) @ android.content.res.resources.getdrawable(resources.java:804) @ android.content.res.resources.getdrawable(resources.java:771) @ com.example.wessel.weer.mainactivity.servicesuccess(mainactivity.java:52) @ com.example.wessel.weer.service.yahooweatherservice$1.onpostexecute(yahooweatherservice.java:91) @ com.example.wessel.weer.service.yahooweatherservice$1.onpostexecute(yahooweatherservice.java:40) @ android.os.asynctask.finish(asynctask.java:651) @ android.os.asynctask.-wrap1(asynctask.java) @ android.os.asynctask$internalhandler.handlemessage(asynctask.java:668) @ android.o

sql server 2005 - SQL update for the varchar column -

Image
i want change string of attachmentcopyloc columns d:\it\public\ftx_robotalerts\336 v:\it\public\ftx_robotalerts\336 change here d v, remaining string same (i don't event want change that). how can that? thanks in advance help. another way basic string manipulation update {table} set attachmentcopyloc ='v' + substring(attachmentcopyloc,2,len(attachmentcopyloc )) attachmentcopyloc 'd%'

eclipse - Android Map V2 map load in one activity but not in other two -

Image
i new android map api v2. trying load map in 3 different activities(on user action), 1 one. map loads fine in 1 activity remaining show gray boxes zoom buttons. following xml layout(map_view.xml) including in 3 different layouts using include tag. <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margintop="10dp" > <fragment android:id="@+id/maplocationdetail" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.mapfragment" /> <imageview an

Deploy python app and as part of process install python, git, virtualenv on windows -

how have self contained setup file following processes... install python 2.7 (it download/launch python installer doesn't have automate , launch it) install git (same above) install pip install python virtualenv clone repo create virtualenv activate virtualenv pip install requirements folder create desktop shortcut i not looking how trying save myself 100 steps when deploy app have finished. before write custom scripts wanted make sure there wasn't tool or best practice handle kind of setup process. in past have frozen apps , deployed them exe using setup wizard inno idea of dropping repo on users machine , letting app pull master when new release comes out without having repackage , distribute exe each time. my other thought maybe turn entire thing egg , deploy python package installed pip using git repo. seems best bet still leaves me installing requirements. other downside lose virtualenv updating app egg update requirements in users main python lib , d

java - Compilation Error while using throw keyword -

sample code:1 public class classtest { public static void main(string[] args) { throw new java.lang.arithmeticexception(); } } ----no compilation error above code, compiler not asking handle exception sample code:2 public class classtest { public static void main(string[] args) { throw new java.lang.exception(); } } --compiler wants handle exception using try-catch or throws. can explain behavior of compiler.i think because need mention xyzexception class(other exception class). arithmeticexception runtimeexception , not checked compiler. exception checked , therefore prevent compilation if rules violated, such not handling method throws exception.

json - Express REST API response methods are not recognized -

i have simple request returns json trying implement. have followed tutorials express web framework rest api, reason keep getting same error error: typeerror: res.status not function or typeerror: res.json not function index.js: var express = require('express'); var router = express.router(); var pg = require('pg'); var connectionstring = 'pg://postgres:postgres@postgres/feed'; /* home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'express' }); }); router.get('/api/leaderboard', function(resp, req){ var results = []; pg.connect(connectionstring, function(err, client, done){ if(err){ done(); console.log(err); return res.status(500).json({ success: false, data: err}); } var query = client.query("select * log (logged >= date_trunc('week', current_timestamp - interval '1 week') , logged <

Regex to remove duplicate letters but not numbers -

what appropriate regex remove adjacent duplicate letters not numbers? for example: p11ppppl --> p11pl i had following regex: /[^\w\s]|(.)(?=\1)/g but replaces duplicate numbers. i (visualized here ): /([a-za-z])(?=\1)/g here's example in python: in [21]: re.sub(r'([a-za-z])(?=\1)', '', 'p11ppppl') out[21]: 'p11pl' you use: /([\d])(?=\1)/g for except digits, or: /([\w])(?=\1)/g for "word characters". as @casimir et hippolyte mentioned in comments, can use: /([a-za-z])\1+/g with \1 replacement string, may better approach.

iphone - You must set myJID before calling connect error -

i want implement 'openfire' server chat application. got source code on git @ https://github.com/rayaleen/openfireclient . on login button action shows me following error: error connecting: error domain=xmppstreamerrordomain code=2 "you must set myjid before calling connect." userinfo=0x7a87c80 {nslocalizeddescription=you must set myjid before calling connect.} but not find document implement this. 1 have idea type of error? link documentation more helpful. if u r using xmppframework ios, can find class named xmppjid , xmppstream. sure u had called xmppstream's instance method "connect" caused u said. there u can search variable instance ,for example named 'asteam',and search ur whole project sentence 'asteam connect'. if success ,what u need add 1 line before connet.it should be [asteam setmyjid:[xmppjid jidwithstring:@"yourname@domain.com/resouse"]] if u don't know jid means please search xmpp's

oracle - EXECUTE IMMEDIATE COMMAND -

i getting error ora-00900: invalid sql statement ora-06512: @ line 125 00900. 00000 - "invalid sql statement" when execute sql: set serveroutput on; declare smartsoftversionitem varchar2(20); maxscriptlevel number; sessionno number; sqlcommand varchar2(8000); begin select max(software_version) smartsoftversionitem s1_grainsmart_dbupdate; select max(script) maxscriptlevel s1_grainsmart_dbupdate; select max(session_no) sessionno ssc_dbupdate; insert ssc_dbupdate values (seq_ssc_dbupdate.nextval, sessionno, sysdate, smartsoftversionitem, maxscriptlevel, null, '17.00.01', 'ssc_ivc_transaction_detail_v', 'v'); sqlcommand := 'create view ssc_ivc_transaction_detail_v select ivc_transaction_detail.ivc_transaction_nbr, ivc_transaction_detail.plc_id, ivc_transaction_detail.commodity_

Standalone java program reading from ActiveMQ queue won't auto reconnect after broker is down -

the activemq setting, server, properties in jndi.properties file. example: java.naming.provider.url=failover:(tcp://localhost:61616?keepalive=true) java.naming.factory.initial = org.apache.activemq.jndi.activemqinitialcontextfactory queue.myqueue = testupdate while program this: public class mqreader{ public final string jndi_factory = "connectionfactory"; public final string queue = "myqueue"; private queueconnectionfactory queueconnectionfactory; private queueconnection queueconnection; private queuesession queuesession; private queuereceiver queuereceiver; private queue queue; public static void main(string[] args) throws exception { // create new intial context, loads jndi.properties file javax.naming.context ctx = new javax.naming.initialcontext(); mqreader reader = new mqreader(); reader.init(ctx); try { reader.wait(); } catch (interruptedexception ie) { ie.printstacktrace(); } reader.close(); }

wordpress - Woocommerce targeting the shop page only with css -

this need do: to target only main shop page css (a specific custom class created mentioned below). this i've done , tried far: i have override template of archive-product.php in child theme. in override template i've added div custom class custom-shop-class before product loop start, because want target looped products specifically. i tried targeting class page-id-4 because if hover on "shop" page in wp-admin, gave me http://.../post.php?post=4&action=edit the problem i'm having follows: from i've discovered same archive-product.php template being used in other various shop pages , not in main "shop" page (correct me if i'm wrong), when target custom-shop-class css, affects other shop pages using same template file, , must not. there no unique identifier or class shop page, page-id-?? class in body tag (as in usual wp pages). any suggestions on best method/solution? thanks in advance, mario. set cond

R - Parse HTML only if http status response is 200 -

i have dataframe urls list of urls want crawl obtain variable pagename defined in source code. purpose use following code: # crawl page names for(n in 1:length(urls$url)) { if (domain(urls$url[n])=="www.domain.com") { doc = readlines(con = file(as.character(urls$url[n]), encoding = "utf-8")) close(con) rownumber = grep('s.pagename', doc) datalines = grep(pagenamepattern,doc[rownumber],value=true) gg = gregexpr(pagenamepattern,datalines) matches = mapply(getexpr,datalines,gg) matches = gsub(" ", "", matches[1], fixed = true) result = gsub(pagenamepattern,'\\1',matches) names(result) = null urls$pagename[n] = stri_unescape_unicode(result[1]) } else { urls$pagename[n] <- na } } if (domain(urls$url[n])=="www.domain.com") uses function domain included in urltools package , let me crawl urls know pagename variable defined, in specific domain. however, code interrupted if pars

angularjs - Common transformResponse in factory $resource -

we using factory interact series of custom apis around common entities. however, part of need evaluate custom responses sent in headers , seems way use transformresponse. have seems working, i'm literally repeating same thing on , on in each definition. tried creating function make reusable, reference seems fail. doing wrong? (function() { 'use strict'; angular.module('aumbills', ['ngresource']) .factory('bills', ['$resource', function($resource) { return $resource( '/ua_aumcore/bills/api/v1/bills/:billableeventi', { billableeventi:'@billableeventi' }, { getlist: { method: 'get', isarray: false, transformresponse: function(data, header, status, config, statustext) { var response = {}; if (isjson(data))

html - Override CSS Classes Infinitely -

this more of theoretical question. is stack of overrides css ad-infinitum? instance, there css override every override? lets have written this: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <style> .a { color: red; } /* override again */ div.a { color: blue; } /* again! */ body div.a { color: yellow; } /* again!! :) */ html body div.a { color: yellow; } /* , again!! */ html body div.a { color: pink !important; } </style> </head> <body> <div class="a">a</div> </body> </html> is !important combined html body div.a absolute highest level override div.a ? must there exist higher override? in theory can repeat rule increase specificity. .foo.foo.foo { } in practise

javascript - Are there any security implications of serving a page over HTTP on the same domain, but different port, as a service served over HTTPS? -

if have html page served on http @ http://example.com:123 , , served on https @ https://example.com:456/some_app , there risk https app? note following mitigations assumed in place: the http page entirely unauthenticated , contains public information the cookies https page marked secure the https page uses standard anti-csrf patter such double submit the main risk see attacker intercept http request , send page malicious javascript. while undesirable, can't see way attack escalate. despite the overly permissive access controls on cookies, attacker should not able steal https page's cookies, because marked secure. far cross origin requests go, requests made http page considered coming different origin, csrf protections work there. are there attack venues i'm missing? or https app reasonably safe? the "secure" attribute of cookies prevents cookies being sent http request sent https. there nothing prevent javascript on http page reading cooki

mysql - Add auto_increment unique id to my sql? -

i have created table in mysql , want add column i.e, 'myid' table i.e, 'mytable'. there primary key defined. i use follwing query add auto increment: alter table mytable add myid int unsigned not null auto_increment unique; but want auto increment should start 30 rather 1. what modification query required? other way add this? secondly if use following procedure, first run query: alter table mytable auto_increment = 30; then run alter table mytable add myid int unsigned not null auto_increment unique; will okay? yes or no? if table empty or small first add auto_increment column , set it's start value this: make myid auto_increment column: alter table `mytable` add `myid` int unsigned not null auto_increment unique; set start value 30 alter table mytable auto_increment = 30; caveat if have lots of records in mytable , use alter table mytable auto_increment = 30; mysql server create new table, copy data old table

f# - Check several option types and then convert to type -

i new programmer in general, , f#. i've ran particular problem several times, , have yet solve efficiently in opinion. here problem: i have these example types: type retail1 = | fashion | auto | sports type wholesale1 = | fashion | auto | sports type events1 = | wedding | birthday type product = | retail of retail1 | wholesale of wholesale1 | events of events1 | noproduct i want convert possibility of first 3 types product type via function: let converttoproduct (retail: retail1 option) (wholesale: wholesale1 option) (events: events1 option) = // convert product here if retail.issome retail retail elif wholesale.issome wholsale wholseale elif events.issome events events else noproduct the way have handled in pass chain long if elif statement check each condition , return final type of product, not feel correct, or @ least idiomatic f#. recommended approach problem? how this: let converttoproduct (r

Markdown Syntax highlighting in Atom - bolding/italicizing partial words -

Image
in atom editor, if this: i want bold **t**he **f**irst **l**etter, or italicise in m_iddl_e of w_or_d i can't. bolding , italicizing don't start , stop in right place. (i don't know if partial-word markup part of original md spec. use pandoc processing, , produces desired output --- source files become unreadable in atom.) update: the html output fine. trying figure out how fix syntax highlighting in atom . the asterisks in middle of word don't end bolding syntax highlighter. problem trying solve.

php - How to drop empty responses in an array of fields? -

i've got php script take answers referral form , send email client (below). client has asked questions have been answered sent them. how can strip out fields empty email? $from = $_request['email'] ; $name = $_request['name'] ; $headers = "from: $from"; $subject = "web contact data-medical referral"; $fields = array(); $fields{"referrer"} = "referral source"; $fields{"referraldate"} = "date of referral"; $fields{"filenumber"} = "file number"; $fields{"hearingdate"} = "hearing date"; $fields{"legalfirm"} = "legal firm"; $fields{"address"} = "legal firm address"; $fields{"plantiffattorney"} = "plantiff attorney"; $fields{"plantiffaddress"} = "plantiff attorney address"; $fields{"plantifftelephone"} = "plantiff attorney telephone"; $fields{&

php - Securing an API with shared secret -

i'm starting rest api, , have begun researching hashing , shared salts/secrets. have been able generate sha256 hash, sent server via json , matched stored hash. thats great , all, i'm thinking, ive done json, actual hash generated still visible wants it. under impression these hashes changed everytime re-hashed string using hash_hmac. so how make sure random user wont find little json snippet, grap hashed key , start making api calls? i might have misunderstood concept completely, bumps appreciated. heres "client" page: <?php $key= hash_hmac('sha256', '66c74620db28603fe4bec7b0f3a8e53b', 'gwerganaevawe21_3faseghbamoirvqwd'); ?> <script> $.getjson( "domain.com/api/publiccoursesession.php?key=<?php echo $key;?>", function( data ) { $.each( data, function( key, val ) { console.log(val); }); }); </script> and here publiccoursesession.php: header("content-type: application/json");

jquery - Highlight current page navigation link -

i've hardcoded subnavigation , highlight navbar item of current page adding class 'active' links. following html-markup in combination javascript adds active class every li(.irp-menu-item) , not closest li. necessary script adds class closest li , not other ones aswell, somehow not able solve issue. html-markup: <nav id="irp-subnav" class="css-sticky" role="navigation" aria-label="irp-subnav" lang="de-de"> <div class="irp-wrapper"> <div class="irp-background"></div> <div class="irp-content"> <span class="irp-title"> title</span> <div class="irp-menu"> <div class="irp-menu-tray"> <ul class="irp-menu-items"> <li class="irp-menu-item"><a href="/link-1/" clas

c++11 - c++ static_cast returns zero -

this question has answer here: why division result in 0 instead of decimal? 6 answers integer division 0 [duplicate] 1 answer here problem: #include <stdio.h> #include <math.h> int main() { int n = static_cast<int>(50 * (60 / 99)); printf("floor: %d\n", n); return 0; } why function print 0 when should print 30? because result of calculation : 30.30303030 the result of calculation not 30.30303030 0 because 60 / 99 calculated. result truncated toward 0 because integer division , result 0 50 * 0 calculated. result 0. you should calculation using double . #include <stdio.h> #include <math.h> int main() { int n = static_cast<int>(50.0 * (60.0 / 99.0)); printf("floor: %d\n",

utc - Is gmtime() affected by daylight savings? -

my local time zone edt. have time stamp: 29 aug 2003 04:18:52, have converted time_t value using mktime(), tm_isdst set -1. time_t value 1062145132. when run gmtime() value, 29 aug 2003 09:18:52. looking @ struct tm returned gmtime(), value of tm_isdst 1. why isn't time 08:18:52 instead? isn't gmtime supposed equivalent utc, without daylight savings dependence? i have used bash follows: date --date=@1062145132 fri aug 29 04:18:52 edt 2003 tz=utc date --date=@1062145132 fri aug 29 08:18:52 utc 2003 the above shows expected 4 hour difference between edt , utc. why doesn't gmtime() show same difference? i found problem. in between call gmtime(&tmgmt) , output of asctime(&tmgmt), had call mktime(&tmgmt). had not realized mktime possibly change values in structure, values printed out not returned gmtime().

javascript - Force AutoComplete to depend on another's result -

i trying have 2 autocomplete textboxes, second 1 being dependent on whatever value input in first one. full autocomplete: <script> var stateid = 0; $(document).ready(function () { $.ajax({ datatype: "json", type: 'post', contenttype: 'application/json; charset=utf-8', url: '/api/services/app/generics/statelist', cache: true, success: function (data) { var array = $.map(data.result, function (item) { return { label: item.statename, value: item.id } }); $("#statename").autocomplete({ source: array, minlength: 1, change: function (event, ui) { if (!ui.it

Soundcloud API for uploading files has stopped working with 401 error -

i'm not sure when stopped working, until application had no trouble uploading tracks soundcloud. now, after uploading track (using post), 401 unauthorized response server. file has been uploaded successfully, , can see on user's home page. additionally, not getting error messages other interactions such authorizing etc. well can't post comment previous answer ashish chaturvedi because don't have enough reputation, i'll have here. the problem not access token. can use exact same token carry out sorts of other tasks. this code has been working years without trouble. stopped working recently. server side has changed. also, said in original post, though server returns error, audio file in fact uploaded.

android - Loading Dialog on HTTP call OptimusHTTP -

im using optimushttp library on android project. im trying show loading if app contacting server. problem why progress dialog not dismiss. here code. public void connectrest() { //using data json dummy string server = "http://jsonplaceholder.typicode.com/posts/1"; optimushttp client = new optimushttp(); client.enabledebugging(); client.setmethod(optimushttp.method_get); //parameter arraymap<string, string> params = new arraymap<>(); params.put("email", "abc@abc.com"); params.put("pass", "abc"); //make request arraylist<httpreq> refhttpreqlist = new arraylist<>(); try { //mprogressdialog.show(this, "", "loading", true); // makerequest() returns reference of request made // can used later call cancelreq() if required // if no request made makerequest() returns null httpreq req = client.makerequest(

Phoenix-Elixir assigns not available in eex template during test -

i'm in middle of learning elixir using phoenix web framework. i've gotten pretty far on own, i'm running error during test has me stumped. error occurs during testing, not when running app. error: 1) test not create resource , renders errors when data invalid (potion.commentcontrollertest) test/controllers/comment_controller_test.exs:25 ** (argumenterror) assign @num_approved_comments not available in eex template. source code here: test https://github.com/wsharp07/potion/blob/ui-improvements/test/controllers/comment_controller_test.exs controller https://github.com/wsharp07/potion/blob/ui-improvements/web/controllers/post_controller.ex#l52 page https://github.com/wsharp07/potion/blob/ui-improvements/web/templates/post/show.html.eex#l48 i've read documentation numerous times, it's seems i'm still missing implementation detail. appreciated. the test failing testing create action of commentcontroller, not show action of

How to pass Google OAuth 2 token to Azure API Authentication? -

i followed steps here hook google oauth azure authentication. unfortunately, instructions stop short of full solution , don't mention google oauth access_token once have it. tried putting authorization header bearer token ( bearer <access_token> ), doesn't appear work application sitting behind authorization service sees original authorization header, not expected x-ms-client-principal-name , x-ms-client-principal-id , x-ms-token-google-access-token , etc. also, when navigate /.auth/me authorization bearer token 401 response. sadly, of documentation either specific ad (which doesn't seem apply scenario) or specific server-side rendered applications, not spas hosted separate api calling. an ideal answer tell me need google oauth 2 access_token azure authorization service authenticate token , add expected headers. edit: access_token not jwt token, may part of problem. if in fact problem , need jwt token how do that? i'm using google client api ja

scope - Javascript: rounded parentheses surrounding comma separated expressions -

playing on js console faced curious syntax. wonder if can tell me more on that.. try this: >( function f(){console.log('i f')} , (function x(){console.log('i x')})() , y=2 , console.log('hello') ) x hello undefined >f() referenceerror: f not defined >this.y 2 this fail: ( var c=2 ) syntaxerror: unexpected token var so comma separated expressions inside parentheses evaluated, assignments happens against global scope, named function declarations references stay trapped inside closure more... putting line inside function declaration called new : function c(){ ( function f(){console.log('i f')} , (function x(){console.log('i x')})() , y=2 , console.log('hello') ) } and instantiating: >var c=new c() x hello undefined >c.y undefined >this.y 2 happens same, executed in global scope! what's usage / purpose of construct? one more: >( function f(){console.log('i f')} , f() )

checkbox - How to select 2nd to 4th td from a row inside jQuery selector -

i have table of checkboxes , want select 2nd 4th td row of 7 tds. want select input:checkboxes of 2nd 4th td, of first row in table, my code far $('tr:nth-child(1) td:gt(2) input:checkbox') any suggestions? thank you you can use slice method: $('tr:first td').slice(1, 4).find('input[type=checkbox]');

java - How to use Google Forms in Android -

i'm using webview call form google docs in android. when run on emulator , phone, checkbox es can't clicked. please help. hope can figure out. thank you. here's activity class package com.example.nevigrof.ymuc; import android.app.activity; import android.os.bundle; import android.webkit.webview; import android.webkit.webviewclient; public class surveyform extends activity { private class mywebviewclient extends webviewclient { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } } webview webview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_survey_form); webview = (webview) findviewbyid(r.id.webview1); webview.setwebviewclient(new mywebviewclient()); openurl(); } private void openurl() { webview.loadurl("t

c - Making linked list more generic -

could me understand void pointers using linked list. i have: struct listnode { int nodevalue; struct listnode * next; }; typedef struct listnode listnode; which works ints. if change int nodevalue void *nodevalue, how send values linked list using void pointer instead? for instance, had add front function: void addfront(listnode *l, int number); which takes listnode , number. if void* pointer, change signature to: void addfront(listnode *l, void* value); in main function using ints have like: int main(void) { listnode *list; list = createlist(); (int x = 0;x < 8;x++) { addfront(list,x); } return(0); } where createlist defined as: listnode *createlist() { listnode *anynode; anynode = malloc(sizeof(listnode)); anynode->next = null; return anynode; } listnode *initnode(int number) { listnode *newnode; newnode = malloc(sizeof(listnode)); newnode->nodevalue = number; newnode-

What is the URL in opeshift for javascript? -

i want use external javascript libraries in openshift hosted account ? url should refer javascript files. ( have stored javascript files inside project)? i think can refer js files using local url system. example if have files in same location can refer using {path file}/javascriptfile.js style <link rel="stylesheet" type="text/css" href="../../libraries/dhtmlxcalendar/dhtmlxcalendar/codebase/dhtmlxcalendar.css"> <link rel="stylesheet" type="text/css" href="../../libraries/dhtmlxcalendar/dhtmlxcalendar/codebase/skins/dhtmlxcalendar_dhx_skyblue.css"> <script src="../../libraries/dhtmlxcalendar/dhtmlxcalendar/codebase/dhtmlxcalendar.js"></script>

ios - How to make UITextView hashtag link open another viewcontroller -

i using code make hashtags on app link: import uikit extension uitextview { func resolvehashtags(){ // turn string in nsstring let nstext:nsstring = self.text // needs array of nsstring. string not work. let words:[nsstring] = nstext.componentsseparatedbystring(" ") // can't set font size in storyboard anymore, since gets overridden here. let attrs = [ nsfontattributename : uifont.systemfontofsize(17.0) ] // can staple urls onto attributed strings let attrstring = nsmutableattributedstring(string: nstext string, attributes:attrs) // tag each word if has hashtag word in words { // found word prepended hashtag! // homework you: implement @mentions here too. if word.hasprefix("#") { // range character position, followed how many characters in word. // need because staple "href" range. let matchrange:nsrange = nstext.rangeofstring

html5 video - unsupported keySystem Exception occure accroding to EME Specification -

in chrome browser (version 51.0.2704.63), according eme specification, when use navigator.requestmediakeyaccess(keysystem, supportedconfig) unsupported keysystem exception occured, parameters follows keysystem: 'com.widevine.alpha' supportedconfig: [{ initdatatypes: ['keyids', 'webm'], audiocapabilities: [{ contenttype: 'audio/webm; codecs="opus"' }], videocapabilities: [{ contenttype: 'video/webm; codecs="vp9"' }] }] somebody can tell me why unsupported keysystem exception occured? could because chrome "deprecating powerful features on insecure origins" https://sites.google.com/a/chromium.org/dev/home/chromium-security/deprecating-powerful-features-on-insecure-origins so navigator.requestmediakeyaccess(keysystem, supportedconfig) must used in "secure origin" aka. https.

javascript - Alfresco Java script API Reference error 'document' is not found -

my apologies being newbie. have configured javascript api amps , can access java script console via admin tools. challenge 'document', 'search', logger , 'companyhome' receiving reference error e.g reference error 'document' not defined. have been reading alfresco documentation , show have access using javascript server side. how can in alfresco or how can overcome these errors if using javascript console. there action available on each of documents "open in javascript console" if click on open javascript console context set selected document. now "document" object points current document on have clicked action. should able see api's associated adding dot after document. point root objects "companyhome","document" etc.. available on server side javascript. you can find server side javascript 2 places. under company home>data dictionary> script (from here can associate them rule) . c

cordova - Redirecting from an iframe back into Ionic -

i creating shop website ionic utilities external payment provider works in standard way (runs in iframe , redirects original page, once payment successful). as ionic runs website locally can't redirect url each url different. i imagine not first person come across problem. how can redirect payment provider inside iframe inside app 1 of ionic states? you can make custom url scheme application plugin: https://github.com/eddyverbruggen/custom-url-scheme good luck!

.net - Calling `Contains` method from C# dynamic type yields error - why? -

i simplified problem tiny program examples exact error receive during run-time. you can copy-paste console application , see yourself. using system.collections.generic; namespace consoleapplication5 { class program { static void main(string[] args) { var list = new list<mydataclass>() { new mydataclass {a = 1, b = 1}, new mydataclass {a = 3, b = 8} }; var ops = new myoperationsclass(); ops.reallygreatoperation(list, list[0]); } } public class mydataclass { public int { get; set; } public int b { get; set; } public void adddatapartstoeachother() { var c = + b; = c; b = c; } } public class myoperationsclass { public void reallygreatoperation(object obj, object z) { dynamic x = obj; if (x.contains(z)) //<-- g

cocoa touch - iOS scroll view is not working -

i have button @ 1000 height pixel mark , need uiscrollview in order access button. implemented scrollview code below , shows scroll view ,but doesn't allow me scroll down. might missing key function. tips or advice appreciated. uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 0, 320, 680)]; scrollview.contentsize = cgsizemake(320, 1000); scrollview.clipstobounds = yes; super.view.backgroundcolor = [uicolor whitecolor]; [scrollview setuserinteractionenabled:yes]; [[self view] addsubview:scrollview]; the problem button's y coordinate 1000 pixels, have stated. , y-coordinate of scrollview's contentzize maximum upto 1000 pixels well. scrollview can jus scroll button starts. uibutton *btn =[uibutton buttonwithtype:uibuttontypecustom]; btn.frame = cgrectmake(50, 1000, 100,45); [scrollview addsubview:btn]; set content size of scrollview this scrollview.contentsize = cgsizemake(320, 1100); this surely solve it.

Quoting issue with expect script -

i have script automatically connect vpn, because have connect , disconnect several times day. (certain things screenhero , gotomeeting fail on vpn, , mail servers , other things blocked while on vpn, but can't connect git server unless i'm on vpn, , app i'm working on can't reach back-end services unless i'm on vpn, development limited when disconnected.) the script lessens hassle, have $ in password (which available in environment through environment variable vpn_password 1 ), , password value gets interpolated before passed vpn program expect. #!/bin/bash { /usr/bin/expect << end_of_login_session set timeout 30 spawn /opt/cisco/anyconnect/bin/vpn -s connect blah.blahblah.com expect "username:*" send "\r" expect "password:*" send "$vpn_password\r" expect "accept? \[y/n\]:*" send "y\r" expect eof end_of_login_session } how pass password literally, without letting subj

c# - linq lambda expression for sql contains -

i using generic repository, this: itemslist = (from myrow in uow.filerepository.get() select new filemodel() {record_id = myrow.type_id, descr = myrow.descr}).tolist();}); and method: public virtual ienumerable<tentity> get() { // _aquery = _thedbcontext.set<tentity>(); ienumerable<tentity> query = _aquery; return query; } how implement generic linq lambda expression if wanted create similar query search particular string in particular field? in viewmodel call like: myrow in uow.filerepository.srch(nameoffieldtosearch, searchstring). the query this? public ienumerable<tentity> srch(expression<func<tentity, bool>> expression) { ienumerable<tentity> srchlist = _aquery.tolist(); return srchlist.where(????); } thank suggestions. edit----------------------- have queries , srch in general repository class , need know how declare query in repository class ,