Posts

Showing posts from July, 2010

file - How to avoid individual casting to byte during initialization of byte array in Java -

i using byte array store text file outside of filesystem. it looks this: private static final byte[] cdrives = new byte[] { (byte)0xe0, 0x4f, (byte)0xd0, 0x20, (byte)0xea, 0x3a, 0x69, 0x10, (byte)0xa2, (byte)0xd8, 0x08, 0x00, 0x2b, 0x30, 0x30, (byte)0x9d, (byte)0xba, (byte)0x8a, 0x0d, 0x45, 0x25, (byte)0xad, (byte)0xd0, 0x11, (byte)0x98, (byte)0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03, (byte)0x80, 0x53, 0x1c, (byte)0x87, (byte)0xa0, 0x42, 0x69, 0x10, (byte)0xa2, (byte)0xea, 0x08, 0x00, 0x2b, 0x30, 0x30, (byte)0x9d ... ... ... }; is there way avoid casting (byte) better visual interpretation? i don't mind using other data type, need able build inputstream out of , fastest way if possible. (for example storing text file string variable not best way...) well 1 simple approach use base64 - perform conversion on class initialization, take performance hit once: private static final byte[...

angularjs - Bower issue with Grunt serve -

i'm trying work on angular project school. having little bit of confusion in set problem , can't find issue online. i've installed grunt, bower, , yeoman , seemed install when ran "grunt serve", tutorial states should able open local host webpage served command completes , i'm not sure if it's because of error displays: "cannot find keep bower packages."

javascript - Z-index is broken -

why #opacwall covers #moviechoose ? <div id="moviechoose" style="width: 50px;height: 50px;background: #f2c249;border: none;position:absolute;left:50px;top:50px;z-index:1;border-radius:130px; display: none;"></div> jquery: $('.circlemenubutton').click(function(){ $('#moviechoose').show(200); $('<div/>', { 'id':'opacwall', 'style':' width: 100%;height: 100%;background: black;border: none;position:fixed;left:0%;top:0%;z-index:0;opacity:0.6' }).appendto('body'); }); here working demo of think you're trying https://jsfiddle.net/mzg1v0q5/ using jquery-2.1.3 people confused z-index, recommend reading article understand it: http://www.smashingmagazine.com/2009/09/15/the-z-index-css-property-a-comprehensive-look/ the key piece of information (in opinion) because z-index work on element position property has been explicitly set abso...

c# - MVC 4: View is not rendered with the correct data from a List<> in the Model -

having pretty tricky asp.net mvc bug (using mvc4). i've tried strip down code make example clear possible i have model //this mvc model public class customcolumnconfiguration //stripped down "problem" property { public customcolumnconfiguration() { columns = new list<columnconfig>(); } public list<columnconfig> columns { get; set; } } //mvc model contains list of these public class columnconfig { public columnconfig() { name = ""; alias = ""; order = 0.0; } public string name { get; set; } public string alias { get; set; } public double order { get; set; } public bool isenabled { get; set; } } here snippet razor view <tbody> @for (int = 0; < model.columns.count; i++) { <tr> <td>column @(i+1)</td> <td>@html.textboxfor(x => x.columns[i].name)</td> <td>@html.textboxfor(x => x...

excel - Trying to create a range from a set of values -

Image
so have range of cells contains list of cell addresses. column b & c show block of information starts , ends. column d states whether start of combination of tables, end of combination, or whether it's single table. so having difficulty combining answers b & c form combined range. in picture, column e shows start a170 , end a596. (i don't think necessary tbh) need make range containing a170:a543, a548:a554, etc. , needs dynamic. these should create based on values in column d. i'm looking in vba, if it's easier in excel formulas, that's okay too. can give me hints how accomplish this? brain mush. you can create small user defined function (aka udf) stitch non-contiguous cell ranges textual representations of respective addresses. can return range native worksheet function uses cell range sum function or counta function (to use 2 simple examples). function makenoncontiguousrange(startrngs range) dim rng range, runion range...

javascript - JQuery Autocomplete Widget - Up & Down Arrow Keys not working -

i new jquery , going through snippet of code of larger application (which have outsourced). snippet jquery widget autocomplete results. on html page, have search box. when user enters keystrokes, search performed (for places , events) on our database , results shown in un-ordered list. results show fine. however, hoping scroll through results using down , arrow key not seem work. opening developer tools in chrome, when press down key following error reported uncaught typeerror: cannot read property 'value' of undefined jquery-ui.min.js:8 the relevant widget code follows $.widget("custom.catcomplete", $.ui.autocomplete, { _rendermenu: function(ul, items) { ul.addclass('search-box'); var = this; var = 0; var j = 0; var index = 0; $.each(items, function(index, item) { if (item.space && == 0) { ul.append('<h4><i class="fa fa-car fa-fw">...

jquery - How do I run a form with Html+AngularJS inside a While of PHP? -

this angularjs works charm, if this: <html> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> </head> <body ng-app="ctrljs"> <a href='#' data-toggle='modal' data-target='#mlmid'>cobacing</a> <div class='modal fade' id='mlmid' tabindex='-1' role='dialog' aria-labelledby='mymodallabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-body'> <form method='post' action='' name='myform' ng-controller='formctrl'> nomor id member c2g: <br> ...

javascript - Why don't I get the CSS transition effect? -

i'm not getting css transition effect reason , i've made fiddle solved problem , overlay comes delayed sliding top. but on webpage not working , overlay immediate. why? code same works on other pages. <!doctype html> <html dir="ltr" lang="en-in" class="js"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta charset="utf-8"> <title> </title> <!-- css includes: --> <!-- le styles --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link href="/static/css/common_in.css?{{version}}" rel="stylesheet" type="text/css"> <!-- javascripts: --> <script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script> <script s...

java - How can I use my own annotation for Swagger? -

how can use own annotation building swagger ui page. example defined annotation , use it: @put @myownannotationforadditionalpropinswagger(value = "some text") @path( "/{carid}" ) @consumes(mediatype.application_json) @produces(mediatype.application_json) @apioperation( value = "updates car info" ) public response patchitem(@apiparam(value = "fields update") car item) { /*some code*/ } after should extend class swagger-core , specify scan annotation ( @myownannotationforadditionalpropinswagger ). as result want see additional column in swagger ui text. how can realize it? class need extend? the swagger 2.0 supports custom fields, there pull request in 2013 ( https://github.com/swagger-api/swagger-node/pull/47 ). while apparently it's easy add custom fields, since not present in swagger 2.0 spec, swagger-ui won't display them default. for work have change coup...

xcode - Create Remote Notification with Xcode7 and without to be a developer on iOS 9 -

is possible create remote notifications without having developer program, using xcode7-beta? i can push app device, can test notifications also? does know anything? this not possible without having developer program. to send remote notifications, you'll need ssl certificate can generate in member center: you must obtain security credentials remote notifications to develop , deploy provider side of app remote notifications, must ssl certificates member center. each certificate limited single app, identified bundle id; limited 1 of 2 environments, 1 development , 1 production. these environments have own assigned ip address , require own certificates. must obtain provisioning profiles each of these environments. ( source )

Error in constructor - C++ -

i have learnt object oriented programming concepts in python, want transfer knowledge c++, , have trouble basic implementation used easy using python. #include<iostream> using namespace std; class animal{ char name; int age; public: animal(char name, int age); }; animal::animal(char name, int age) { this->name = name; this->age = age; } int main() { animal dog ("megg", 10); cout << "name: " dog.name <<endl; return 0; } when compile code, lot of messages, such as: error: no matching function call 'animal::animal(const char[5], int)' note: animal::animal(char, int) <near match> note: candidate expects 1 argument, 2 provided thanks! you don't need this->name = name in constructor definition "megg" string literal. can cast "megg" const char * not char (this causing error). or better yet. can use c++ standard library string class std::stri...

amazon web services - Running AWS CLI through Python returns a "sh: 1: aws: not found" error -

i trying copy file s3 bucket, using python, so: cmd = 'aws s3 %s %s' % (filename, bucketname) os.system(cmd) it gives me sh: 1: aws: not found error. however, using s3cmd works fine. why s3cmd work, not aws ? also, did which aws , returned: /home/username/anaconda/bin/aws . which s3cmd returns: /home/username/anaconda/bin/s3cmd . why 1 work, not other, despite having same root? a quick way troubleshoot issue try full path on os call see if path problem: cmd = '/path/to/aws s3 %s %s' % (filename, bucketname) os.system(cmd) there few reasons why problem, related path variable (at first guess). however, might better steer away os.system noted in docs ( https://docs.python.org/2/library/os.html#os.system ) , use alternative methods. using subprocess: cmd = ['/path/to/aws', 's3', filename, bucketname] subprocess.popen(cmd) or use python aws client boto3 package. there many ways, 1 quick example question ( how save s3 ...

asp.net mvc - how to trigger notifications in mvc after something is saved in the database? -

how trigger notifications in mvc after saved in database? e.g: if admin saves new item in database employees notified there's new item in stock. you can either use polling reflect changes database or have push notification notify client

SELECT query that Selects from Next Row given certain criteria using SQL Server 2008 R2? -

i want create table shows employees' hire , accompanying term date on same line. i'm using data in 2 tables: employees , eechange . eechange has 3 columns important: employee_no , action_date , action_type . action_type 'h', 'r' or 't' 'hire', 'rehire' or 'term'. far i'm concerned 'hire' , 'rehire' dates effective dates , 'term' dates termination dates. i can create select query places effective dates (ed) in ed column , term dates (td) in td column. problem not on same row. difficulty i'm having there may not associated td every ed. see below: employee (ee) 14 hired on 5/1/98, rehired on 9/13/06 , termed on 3/23/98. not know why database has rehire followed hire. far concerned ee 14 hired on 5/1/98 , termed on 3/23/98. going assume there no break in employment. here tables: employees : ee no name 6 anil 12 viktor 14 sherry 15 juan 48 susan 50 kevin...

Php(sessions)...how to put textbox value in session and pass it to another page?i m getting error -

<?php session_start(); ?> <form action="harddisk.php" method="post">//form <input type="text" name="user" /> <?php if(isset($_post['user'])) { $_session['userget']=$_post['user']; } ?> <input type="submit" value="submit" /> </form> 2nd page <?php session_start(); ?> <?php if (isset($_session['userget'])) { $form_value = $_session['userget']; } echo $form_value ; ?> .......................................................................................................... you have used text box name check submit button name too. <form action="harddisk.php" method="post">//form <input type="text" name="user" /> <input type="submit" value="submit" name="submit" /> </form> <?php session_start(); if(isset($_post[...

php - Doctrine's "options" property in @UniqueConstraint not working -

context i'm using doctrine version 2.5.0 , have 2 entities: group , item . i'm trying create unique constraint items cannot have same position in group : /** * @entity * @table(uniqueconstraints={ * @uniqueconstraint(name="position", columns={"group_id", "position"}) * ) */ class item { ... } this works well. problem i added active field item entity, instead of deleting item , 'inactivate' it. unique constraint doesn't work anymore, since item stays in database group reference , position . attempts looking @ doctrine docs , i've discovered can use options property clause in @uniqueconstraint : /** * @entity * @table(uniqueconstraints={ * @uniqueconstraint(name="position", columns={"group_id", "position"}, * options={"where":"(active = 1)"})} * ) */ class item { ... } but same error...

Custom drop down CSS Submenu bar -

Image
so far, have made regular menu bar, not sure how make custom css submenu bar 1 shown. have pointers? picture: how make little arrow pointing layouts button? the little triangle combination of 3 things: the :before or :after pseudo selectors relative positioning css triangles so style :before of menu triangle using rules , set it's position appropriately. might need content: ' '; height: 0; width: 0; overflow: hidden; on pseudo selector make work.

c++ - utf8::next() of utfcpp - tries to iterate past the end of the string -

i'm using utfcpp work utf-8 encoded strings stored in std::string objetcs. i want iterate on code points. utf8::next() uint32_t next(octet_iterator& it, octet_iterator end); seems way this. here's test program illustrate use: std::string u8("hello utf-8 \u2610\u2193\u2190\u0394 world!\n"); std::cout << u8 << std::endl; uint32_t cp = 0; std::string::iterator b = u8.begin(); std::string::iterator e = u8.end(); while (cp = utf8::next(b,e)) printf("%d, ", cp); this extracts characters fine, however, program throws not_enough_room exception, indicates " it gets equal end during extraction of code point" after printing 10, ascii newline control character: hello utf-8 ☐↓←Δ world! 72, 101, 108, 108, 111, 32, 85, 84, 70, 45, 56, 32, 9744, 8595, 8592, 916, 32, 87, 111, 114, 108, 100, 33, 10, terminate called after throwing instance of 'utf8::not_enough_room' what(): not enough space obviously, providing end it...

javascript - How to remove the last node of a node array? -

i have dom like span span p p(to removed) p(to removed) and everytime event triggered, d remove last 2 p elements , append 2 more. there node.removechild method, tried, turned out array of p not father element of p, not know whether did whole wrong way. so, how remove last 2 p nodes in array of p, clean space , append 2 more? you want el.parentnode.removechild(el); the parentnode property allow use removechild in way intended to.

ios - How can I access articles from my school newspaper website and update my app when a new one is posted? -

my school newspaper switched print digital, , wanted make app newspaper more accessible. as of right now, students can access via this website, , articles largely ignored because no 1 bothers check it. i have moderate amount of experience making apps in swift (through bitfountain , ray wenderlich), i'm not sure how start project. if possible, how can fetch articles website above , display them on app? of now, i'm not looking mimic site sports feed, comment sections, polls, etc, want able to: get text of article, title, author, , date get category article filed under (news, sports, features, etc) get picture(s) included in article (this not crucial) i'm stumped on how can access information , create app can continually fetch new articles when posted , update show them. feasible endeavor, , if so, how can start? check out post w3schools. php script grabs feed url , renders in html. i think perfect project. http://www.w3schools.com/php/php_ajax_rs...

serialization - Entry and Serialisation -

my project in form: class persistant : @entity public class produit implements serializable { private static final long serialversionuid = -3352484919001942398l; @id @generatedvalue private long id; private string module; private string produit; //getter&&setter class dao public list<entry<integer, list<produit>>> parproduit(string cat) { ....... hashmap<integer, list<produit>> legaux = new hashmap<integer, list<produit>>(); ........ list<map.entry<integer, list<produit>>> entries = new arraylist<entry<integer, list<produit>>>(legaux.entryset()); return entries; } when execute code error : java.io.notserializableexception: java.util.hashmap$node java.util.hashmap.entryset<k, v> is not serializable. legaux.entryset() probably returns set of type java.util.hashmap.entryset, may want check that.

c - Can someone explain why my for loop stops at the wrong place -

sorry if dumb mistake i'm beginner. i'm answering question in book c programming modern approach. asks print squares between 1 , number given. this original code: #include <stdio.h> int main(void) { int n, i; printf("enter number: "); scanf ("%d", &n); (int = 2; <= n ; += 2) { printf("%d %d\n", * i, n); } return 0; } the problem stop once hits ten thousand divided "n" inside loop: for (int = 2; <= n / 10 ; += 2) { printf("%d %d\n", * i, n); } can explain why happens the loop check should i * <= n if want squares stop before n (int = 2; * <= n ; += 2) {

ruby - How to save nested form data in Rails? -

Image
i have data inside foods , drinks table: foods table id | name ------------ 1 | rojak 2 | lemang drinks table id | name ------------ 1 | barli 2 | sirap my model relationship is: class survey < activerecord::base has_many :questions accepts_nested_attributes_for :questions, allow_destroy: true end class question < activerecord::base belongs_to :survey has_many :answers accepts_nested_attributes_for :answers, allow_destroy: true end class answer < activerecord::base belongs_to :question has_many :foods has_many :drinks accepts_nested_attributes_for :foods, :drinks end class food < activerecord::base belongs_to :answer end class drink < activerecord::base belongs_to :answer end and _form.html.erb file inside app/views/surveys: <%= form_for @survey |f| %> <% if @survey.errors.any? %> <div class="error_messages"> <h2><%= pluralize(@survey.errors.count, "error")...

unity3d - Images issue in vuforia -

when tried import image vuforia target manager, appears in unity3d white plane, whatever image is, if black image. how can solve issue maybe didn't right in 1 of these steps: verify image target in site: (show features) download unity package in unity, import package… drag , drop prefab ar camera check box image target make sure enabled drag , drop prefab image target set db , image target in image target properties you have see texture of image target in prefab. (not white plane)

javascript - Floated layouts - items running up-down-up-down, rather than side-to-side? -

Image
when floating elements (list-items example) go side-by-side, wrap onto next line when there isn't enough space (width) left in container. i wondering there way, floated list-items/div's display on top of each other. groups of 2 floated alongside each other, in example 2 below, example 1 being norm: the frame in wireframe viewport, layout run off screen , scroll horizontally. i'd without wrapping 2 items in containing div if can. this... <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> and not items 1 + 2 wrapped in div , same 3 + 4 , on - parents divs floated alongside each other. my end goal create layout this, horizontally draggable rather scroll bar: i've made codepen here: http://codepen.io/moy/pen/ovapek the drag works ...when content fits on screen. divs cropped in viewport when attempting drag layout jumps around. if monitor isn't wide enough, can check r...

solrj - Solr Error This Indexschema is not mutable -

i want use schema.xml rather managed schema changed following in solrconfig.xml below <schemafactory class="managedindexschemafactory"> <bool name="mutable">true</bool> <str name="managedschemaresourcename">managed-schema</str> </schemafactory> to <schemafactory class="classicindexschemafactory"/> but indexschema not mutable error when try index flat file using post command. remove addschemafieldsupdateprocessorfactory section updaterequestprocessorchain config in solrconfig.xml the schemafactory option in solrconfig.xml. controls whether schema should defined "managed index schema": schema modification possible through schema api. default, if no schemafactory specified, default behavior use "classicindexschemafactory" the classicindexschemafactory requires use of schema.xml file, can edited manually , loaded when collection loaded. setting disal...

Asterisk catch a Incoming call and transfer it to a specific exten -

i have been building window form desktop application using c# interfaces asterisk using asterisk.net. first problem catch incoming call , transfer specific exten. first idea using originateaction, when call come, use dial event , catch , use originateaction call specific exten. redirectaction originateaction = new redirectaction(); originateaction.channel = e.channel; originateaction.context = "default"; originateaction.exten = "203"; originateaction.priority = 1; managerresponse originateresponse = manager.sendaction(originateaction); console.writeline(originateresponse); but not work wish. second idea using redirectaction: redirectaction originateaction = new redirectaction(); originateaction.channel = e.channel; originateaction.context = "default"; originateaction.exten = "203"; originateaction.priority = 1; managerresponse originateresponse = manager.sendaction(originateaction); console.writeline(originateresponse); and not wo...

c# - Kinect v2 Save/Load MultiSourceFrames -

i know if there way save multisourceframes disk in such way can load them use later. the reason because have far processing on each frame reasonably perform live. have no need process frames in real time so, find way save number of frames disk (or memory?) , perform processing afterwards. so far, have tried storing these in list<multisourceframe> but, each frame, find can't acquire colourframe component (for example), presumably because whole object structure not saved. potential solution idea? i know kinect studio able save .xed files need able code. moreover, don't know whether can turn .xed file collection of multisourceframes. i'd grateful if can me out problem! promise upvote/accept helpful answers! you can't save multisourceframe object. instead, should extract (raw) data need frames , save that.

angularjs - How to call one file from another file in protractor angular -

this first file log.js var user = 'raghavendra@gmail.com', pwd = '123'; describe(' login page.', function() { it('sending valid values:', function() { browser.get('http://gmail.com'); expect(browser.getcurrenturl()).toequal() second file create_file.js describe(' login page.', function() { it('sending valid values:', function() { } expect(browser.getcurrenturl()).toequal() } how call log.js file in create_file.js. please me. i got solution require('/home/raghavendra/desktop/python_pro/ng_test/e2e-tests/log.js');

php - Stripe Webhook not working -

so i'm trying simple stripe webhook. ideally shouldn't difficult. i'm using webhook so here code: <?php require_once('lib/stripe.php'); // replace "xyz" stripe secret live key // stripe::setapikey("xxx"); $body = @file_get_contents('php://input'); $event_json = json_decode($body); // setup: // 1. customize settings (stripe api key, email settings, email text) // 2. put code somewhere it's accessible url on server. // 3. add url of location settings @ https://manage.stripe.com/#account/webhooks // 4. have fun! // set secret key: remember change live secret key in production // see keys here https://manage.stripe.com/account // retrieve request's body , parse json $body = @file_get_contents('php://input'); $event_json = json_decode($body); // security, retrieve stripe api $event_id = $event_json->id; $event = stripe_event::retrieve($event_id); // send receipts on succesful invoices if ($event->ty...

c++ - how can I pause/stop threads on linux to run another thread of top priority -

i have linux service waits messages central , let tasks ordered messages. think need create new thread . moreover, 1 task have absolute priority compared others , when order task comes, need accomplish possible. also, since these stuff on embedded system , resources restricted, thought need pause other threads created. i imagine need thing similar here: how sleep or pause pthread in c on linux but question not duplicate. not have exact point pause threads. need pause them wherever possible, , continue when prioritized task finished. and here suggests way seems obsolete , use std::thread . how pause pthread time want? how achieve prioritize 1 task? (maybe before that) tasks, need design thing "thread manager", or there simpler thoughts? note: have used word "task" is, not technical term.

javascript - Is there a way of making my div background less and less transparent while user keeps scrolling the webpage? -

i have bootstrap webpage uses video background. more, i'm using following css code: .transparent{ box-shadow: 0 0 0 1000px rgba(0, 999, 0, 1); overflow:hidden; } #imgbox{ box-shadow: 0 0 0 1000px rgba(0, 999, 0, 1); } to make "hole" in covering layer, when user see's layer - see part of video underneath. it's hard explain, take @ example: http://jsfiddle.net/leytgm3l/31/ i want achieve effect, green layer transparent @ beginning (let's has rgba(0, 999, 0, 1) , when user keeps scrolling down , layer becomes more , more visible, gets less transparent (so when it's visible should have rgba(0,999,0,1) example. how can achieve jquery or css? i not sure requirement checkout updated jsfiddle of your's just added $("#black").css("opacity",$("body").scrolltop()/1000); in $(window).scroll such increase opacity on window scroll , using small amount since value of opacity can withing range of 0 1...

jquery - javascript replace multiple div tags -

as i'm working on calendar system product integration, want make possible see if there product attached event in calendar. currently have function opens file , sends id product name, problem if there multiple <div id="productx"></div> (replace x product id) on page, replace first div tag finds. function getproductname(id){ $.ajax({ type: 'get', url: 'http://xx.com/api/calendar_getname.php', data: 'id=' + id, success: function(data) { $('#product' + id).html(data); } }); }; is there somehow can make replace multiple of same div tags around page? if finds <div id="product0">x</div> 2 items replace x value get's page. hope it's understandable @ points. id unique 1 element, should use class instead , target that <div class="productx"></div>

d3.js - D3js Zooming chart with polylinear axis -

i trying create zoomable chart has polylinear x-axis. works expected if don't have polylinear axis. however, when using polylinear axis panning (and zooming) distorted. if drag chart pan see points , x-axis distortions. example uses default d3js zoom behaviour. suggestions smooth panning/zooming appreciated. i using transforms position elements because had issues when specifying cx , cy values (especially when adding new data panned or zoomed chart). here zoom function: var onzoom = function () { if (d3.event.scale == 1) { //panning } else { //zooming // don't scale points , lines graph.selectall(".point") .attr("r", 10 / d3.event.scale) .attr("stroke-width", 1 / d3.event.scale); } graph.selectall(".point") .attr("transform", function (d) { return "translate(...

c# - How to check if an element is actually holding some data -

my problem trying test if element present, able check if element holding data or empty. the element searching : <ul class="list-unstyled"> </ul> obviously unordered list empty. how can check if holding data inside or not ? suggestions? a) supposing ul nodes via findelement, can search within iwebelement further findelements method. var ulelements = driver.findelements(by.xpath("your xpath")); foreach (var ulelement in ulelements) { var contentelements = ulelement.findelements(by.cssselector("your css")); if (...) {} } ... or ... b) please note can search xpath or cssselector. if choose search cssselector, can form css selector ul has @ least li. not selenium neither c#, recommend ask (ul has li) separate question , tag css selector infamous not exists in current css spec knows future brings

java - Android app dynamically added button is different colour to layout buttons -

i'm trying add new button dialogfragment, , button appearing, font , colour different other buttons. the other buttons generated layoutinflater on layout in xml file. buttons in xml file like: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> ... other parts of layout... <linearlayout android:id="@+id/ll_buttons" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_aligntop="@id/rg1" android:layout_torightof="@id/rg1" android:layout_toendof="@id/rg1" android:layout_marginleft="30dp" android:layout_marginstart="30dp" android:orientation="vertical" > <button android:id="@+id/ok_button" android:layout_width="match_par...

php - CSV data comparison in mysql -

i have 2 mysql tables , want compare value of column in 1 table value of column in other table; data stored in csv format. want know how compare 2 values? example: candidate skills in candidate table java,html,sql job skills in job table jquery,html,css now have job requirement of jquery,html,css , list of candidates @ least 1 tech requirement match candidate: $sql = 'select co.corp_contact_num, co.corp_name, co.corp_contact_person, co.corp_email_id, co.corp_address, co.corp_email_id, co.corp_url, c.corp_id, c.cand_id, c.cand_name, c.cand_email_id, c.cand_current_location, c.cand_preferred_location, c.cand_rate_per_hour, c.cand_position_title, c.cand_experience, c.cand_technical_skills, c.cand_domain_skills, c.cand_leadership_skills, c.cand_certifications, c.cand_clients candidates c join corporations co c.corp_id = co.corp_id , c.is_available = "1" , co.corp_id != "'.$_session['sess_corp_id...

javascript - I am getting issue on accordion click event in bootstrap -

i have created 1 page in there on button more.if click on more next page display.in next page there 5 accordion tab created..the issue accordion tab click event not working.please me.. <html> <head> <meta charset="utf-8"> <title>dummy</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <meta name="format-detection" content="telephone=no"> <link href="favicon.ico" rel="shortcut icon" type="image/x-icon"> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/responsive.css"> <link rel="stylesheet" href="css/themes.css"> <link rel="stylesheet" href=...

javascript - Updating scope from outside AngularJs without using "angular.element.scope" -

i'd able update scope in angular function outside angular. e.g., if have jquery plugin returns success callback, i'd able update scope success callback. every solution i've seen involves calling angular.element(selector).scope , calling $apply on scope returned. however, i've seen many comments indicating doesn't work when debug info off , isn't recommended, haven't seen alternative solutions. does know of way update scope outside of angular without using angular.element(selector).scope ? here accepted solution in post: "you need use $scope.$apply() if want make changes scope value outside control of angularjs jquery/javascript event handler. function change() { alert("a"); var scope = angular.element($("#outer")).scope(); scope.$apply(function(){ scope.msg = 'superhero'; }); } here warning .scope() doesn't work when debug data off in post: "fyi according docs using .scop...

security - Non Admin users are not able to see all the language in "Language" dropdown in sitecore content tree -

we facing issue non- admin user of sitecore.the admin user of sitecore can see language there in sitecore->system->language, have total 12 language there. when create user sitecore client author , publisher , acess content item see 4 languages(i.e. en,en-gb,ru,ar-ae). in accessviewer have given "read,write,language:read , language:write" permission on language except 2 said can see 4 language after clicking on language button in popup , publishing non admin user can see these 4 languages. let me know if missing thing in configuration content editor i reading blog article , said following: if not apply permissions language members have write access. my users have write access 1 language (or several languages if members of more 1 language role). not have write access content. done using trivial sitecore security on content. use editor role setting read/write access content itself: in article users have permissions same roles, , language restric...

regex - Match particular CDATA sections in XML data -

i trying powershell regex, have following page (further below) want match from, 2 parts in bold information want capture , assign variable. need 2 regex's. text below, 2 area's need find king , years & years . please note, these 2 areas change (hence reason need capture them), rest of of code stays same. this regex have @ moment, it's not working me. \s+artist\s*>\s*<\s*!\s*[cdata\s*[(.*)\s*]\s*]\s*>\s*<\s*/artist and here page (or data) trying use regex with. <on_air> <publishedinfo publisheddate="2015-07-18 16:24:28" /> <stationname><![cdata[mix 106.5]]></stationname> <stationprefix><![cdata[mix1065]]></stationprefix> <generic_coverart><![cdata[http://media.arn.com.au/images/getimage.aspx?i=generic_mix1065.jpg]]></generic_coverart> <now_playing> <audio id="id_1705168034_30458146" type="song"> <title generic="f...

Ansible - Conditionally set volume and tls hostname based on inventory file in docker module -

i'm using ansible deploy containers production. during development, i'd have ansible deploy containers on localhost instead of production servers. production servers run on ubuntu, localhost os x boot2docker. i have 2 inventory files, production , localhost. dir structure looks this: . |--inventories | |localhost | |production | |--group_vars | |all | |localhost | |production | |--roles | |--web | |--tasks |main.yml | |web.yml web.yml defines host group , assigns web role. /roles/web/tasks/main.yml looks this: - name: run web container docker: name: web image: some/image state: reloaded ... tls_hostname: boot2docker volumes: - "/data/db:/data/db" env: ... tags: - ... i need set tls_hostname conditionally, if localhost inventory used; likewise, want set volume if production inventory file used. very new ansible - seems i'm not approaching right way there's easier way thi...

android - Amazon webview is not working properly? -

i making android app webview. the problem arises when try include amazon webview. while going through payment page of amazon, after selecting payment mode , while clicking selecting bank, screen goes white. has else encountered issue? this possibly security feature implemented amazon stop access of web page within webview. as replacement, suggest use actual amazon api implement payment features amazon. remember payment page keeping credit card details of customer buying product. these security features essential.

postgresql - Docker Backup and restore postgres -

i using docker postgres:9.4 image. need know how backup , restore volume container. created volume container: docker run -v /var/lib/postgresql/data --name dbdata postgres:9.4 /bin/true using volume docker run --name=postgres --volumes-from=dbdata -d -p 6432:5432 postgres:9.4 backup volume container docker run --volumes-from dbdata -v $(pwd):/backup postgres:9.4 tar cvf /backup/backup.tar /var/lib/postgresql/data restore volume in new container docker run --name=dbdata-new --volumes-from dbdata -v $(pwd):/backup ubuntu:14.04 /bin/sh -c 'cd /var/lib/postgresql/data && tar xvf /backup/backup.tar' use in new volume in creating new postgres container: docker run --name=postgres-new --volumes-from=dbdata-new -d -p 7532:5432 postgres:9.4 issue: i below error in logs when run new container. initdb: directory "/var/lib/postgresql/data" exists not empty if want create new database system, either remove or empty directory "/var/lib/post...