Posts

Showing posts from April, 2014

git - How to rollback to a older commit as I have pushed a code? -

i working on 2 different branches a , b , had 1 prod branch master , created new branch c combining a , b . i have accidentally pushed c to master , , not know how go prod state, there many commits in place. commit 92e15c92d543e436bd5804ab6c9 author: user_a date: thu sep 22 15:51:47 2016 +0530 fixing user report commit dfd1f4e0d56f50d263d6e merge: 1a6bc83 f9b0a35 author: user_a date: thu sep 22 15:47:01 2016 +0530 merge branch 'master' of git_repo_branch b commit 1a6bc83c55cf1b3d7f88d author: user_a date: thu sep 22 15:46:46 2016 +0530 fixing user report commit dd11a998f380c70b579d2a0 author: user_a date: thu sep 22 13:09:29 2016 +0530 fixing rake task commit c194f900e58f93b0a06ed author: user_a date: thu sep 22 13:08:40 2016 +0530 fixing rake task commit f9b0a35430d29826622d95 author: user_b date: thu sep 22 11:36:50 2016 +0530 jobs save draft fix commit 3a1b233b365a96886e2d73 merge: 2eac96c c4f61b1 author: user_a da

java - How to get json schema $ref data from servlet -

i need data servlet when pass schema below. attrservlet servlet call. { "id": "../test#", "$schema": "../schema#", "title": "test", "type": "object", "format":"grid", "required": [ "/" ], "properties": { "/": { "title":"value", "$ref": "http://00.00.00.00:8080/test/attrservlet/#" } } } in place of $ref , need servlet data. data coming through servlet browser on front end it's not reflecting. idea?

sql - naming a row after using rollup -

having used 'roll up' i'm having issue 2 rows being called 'total'. bottom 'total' should called 'n/a' name col1 col2 total 10 12 5 2 b 4 4 c 0 4 total 1 2 should this name col1 col2 total 10 12 5 2 b 4 4 c 0 4 n/a 1 2 this part of query i'm doing wrong select case name when 'n/a' 'total' else name end name ,col1 ,col2 ( case nameid when '1' 'a' when '2' 'b' when '3' 'c' else 'n/a' end name ,col1 --these sums ,col2 --these sums table group nameid rollup )a if make change bit case nameid when '1' 'a'

java - CXF 3.1.6 file upload, attachment datahandler input stream is null -

i'm using cxf , working on file upload i'm receiving file content attachment. upon debug see file payload being present in datahandler object of attachment, when inputstream, content null. code snippet: @post @consumes({ mediatype.application_json, mediatype.application_xml, mediatype.media_type_wildcard }) @produces({ mediatype.application_json, mediatype.application_xml }) @path("/{catalogid}/file") public catalogresponse addfile(@context httpheaders headers, @pathparam("catalogid") string catalogid, @multipart(value = "requestfile")attachment file, boolean autolaunch) { catalogresponse res; try { inputstream = file.getdatahandler().getinputstream(); buffer = new bytearrayoutputstream(); int read = 0; byte[] data = new byte[1024]; [enter image description here][1]while ((read = inputstream.read(data, 0, 1024)) != -1) { buffer.write(data, 0, read);

string - Date from SQL datebase to JCalander -

i used http://toedter.com/ jdatechooser date user. want reset selected date calendar sql database. code wrote put selected date database. pst.setstring(5, ((jtextfield)datead.getdateeditor().getuicomponent()).gettext()); i figured out myself. java.util.date dateadx = new simpledateformat("yyyy-mm-dd").parse(dateadm); here dateadm string variable want store date in jdatechooser . then can call datead.setdate(dateadx) to set date.

How can I color input fields border red when I get validation error laravel 5.3 -

Image
my validation controller: public function store(request $request) { // dd($request->all()); /////validations//// $this->validate($request, [ 'name' => 'required|min:3|', 'email' => 'required|unique:customers' , 'favorite' => 'required', 'password' => 'required|min:6', 'confirm_password' => 'required|same:password', ]); $user = new customer; $user ->name=input::get("name"); $user ->email=input::get("email"); $user ->country=input::get("country"); $user ->gender=input::get("gender"); $user ->favorite=implode(" , " , input::get("favorite")); if(input::hasfile("image")){ $files = input::file('image'); $name = time()."_". $files->getclientoriginalname(); $image = $file

model view controller - Bind results to kendoGrid -

in following code i'm binding grid results controller action. works perfect method not stopping loading. time methid executing. here code: <script> $(function() { $("#invoices-grid").kendogrid({ datasource: { type: "json", transport: { read: { url: "@html.raw(url.action("list", "finances"))", type: "post", datatype: "json", data: additionaldata }, }, schema: { data: "data", total: "total", errors: "errors" }, error: function(e) { display_kendoui_grid_error(e); // cancel changes this.cancelchanges(); }, pagesize: 20, serverpaging: true, serverfiltering: true, serversorting: true }, databound: function () { var row = this.elem

UWP - Create push notification channel error -

i have strange issue creating push notification channel uri. when try execute following code: receivedchannel = await pushnotificationchannelmanager.createpushnotificationchannelforapplicationasync(); i catch exception following message: a notification channel request provided application identifier in progress. (exception hresult: 0x803e0103) (nothing special in call stack) the problem appeared while worked fine. tried restart phone without success. note: have issue on development mobile. works fine on others mobiles.

php - ZF2 Rest Api call not goes to proper function on Linux Server -

i used zf2 rest api module working fine in windows environment, if run application on linux environment call not goes proper function. example: 1) hit url postman on windows, url : myapi.net/api/testing/scp.vp@gmail.com here, api -module, testing -controller, scp.vp@gmail.com -parameter method : post => works fine, call goes create() function. 2) same url hit on linux, call not goes create() function , called get() function if change parameter , remove 'scp' email works on linux, might problem **scp** thanks,

python - How to print words (and punctuation) from a list of positions -

(removed code stop class mates copying) right create text file positions of each word, example if wrote "hello, name mika, hello" the positions in list [1,2,3,4,5,6,2,1], , list each word/punctuation once, in case ['hello', ',', 'my', 'name', 'is', 'mika'] the thing able words original sentence using positions in list, can't seem do. did try searching other posts seemed come other people wanting positions of words rather wanting put words sentence using positons. thought started doing this: for in range(len(readlines[1])): but have no idea how go around doing this. edit: has been solved @abhishek, thank you. indices = [1,2,3,4,5,6,2,1] namelst = ['hello', ',', 'my', 'name', 'is', 'mika'] newstr = " ".join([namelst[x-1] x in indices]) print (newstr) output: >> 'hello , name mika , hello' i agree there offsets / spaces,

angularjs - Refresh with localStorage and Multiple Logins -

i developing angular app in need give refresh ability user. using localstorage can login details of user. if login user in new tab override login details of previous user. so question can keep localstorage tab wise? use sessionstorage : sessionstorage similar window.localstorage, difference while data stored in localstorage has no expiration set, data stored in sessionstorage gets cleared when page session ends. page session lasts long browser open , survives on page reloads , restores. opening page in new tab or window cause new session initiated , differs how session cookies work.

c# - Simple way to yield an array in parallel -

newer version of c# has async / await . in unity there yield . how implement method can yield in parallel? similar promise.all([]) in javascript, don't care 1 finishes first, care when done. to give more context, imagine designing procedural terrain generator generate in chunks ; , have setup each chunk generate using threadpool , , provide api returns ienumerator : ienumerator generatechunk() { // procedural generation // queue onto threadpool // when done, yield } ienumerator generatechunks() { (int = 0; < chunks.length; i++) { yield return chunks[i].generatechunk(); } } void generatemap() { startcoroutine(generatechunks()); } can yield ienumerator[] ? update : not sure have expressed myself clearly. want kick start generatechunk @ once, , allow them finish fast possible, instead of yielding 1 after another. is code doing that, or need else? yield return startcoroutine(chunks[i].generatechunk());

plsql - How to add values to a VARRAY using a loop -

i have varray , want add elements varray using loop. have tried far. declare type code_array_ varray(26) of varchar2(6); codes_ code_array_; begin in 1..26 loop codes_(i) := dbms_random.string('u',6); end loop; end; above code gives me error "ora-06531: reference uninitialized collection" as error message says, need initialise collection variable : ... begin codes_ := code_array_(); ... but need size it, either single extension each time around loop: in 1..26 loop codes_.extend; ... or one-off extension before start: ... begin codes_ := code_array_(); ... codes_.extend(26); in 1..26 loop ... you use post-extend size control loop, save hard-coding 26 again: declare type code_array_ varray(26) of varchar2(6); codes_ code_array_; begin codes_ := code_array_(); codes_.extend(26); in 1..codes_.count loop codes_(i) := dbms_random.string('u',6); end loop; end; / pl

c - Modular arihmetics in AtMega -

i developing device firmware cryptographic functions. use codevisionavr ide , atmega324 microcontroller. need implement modular exponentiation function this: unsigned long xpowymodn(unsigned long x, unsigned long y, unsigned long n) but there no data types bigger long types in codevisionavr! is way implement function without operating numbers more 2^32-1( long )?

sql server - MSSQL Query optimization : remove functions from query and optimizing -

vm table id teacher1_id teacher2_id teacher table id teacherclass table teacherid classid class table id uni table id name classid i want fetch vm.id, teacher1.id,teacher1_uni.id,teacher2.id,teacher2_uni.id current query: select vm.id, vm.teacher1_id, getuni(vm.teacher1_id), vm.teacher2_id, getunit(vm.teacher2_id) vm getuni(@teacherid): select u.id uni join class c on uni.classid = c.id join teacherclass tc on tc.classid = c.id tc.teacherid = @teacherid the above query slow , return data after 21 seconds. kindly me speed up. suppose function calling making query slow. how optimize query?

javascript - req.body is Empty on angular file-upload, node js -

so i've been working on uploading excel file save database. form. <form method="post" enctype="multipart/form-data"> <label class="uk-form-file md-btn md-btn-primary" for="user_upload">upload file</label> <input style="display:none;" type="file" ngf-select ng-model="user_datasource" name="userdatasource_upload" id="userdatasource_upload" accept=".xlsx,.xls,.csv" ngf-max-size="20mb" fd-input ng-change="upload"/> </form> this controller handles upload $scope.upload = function() { upload.upload({ url: '/api/sr/user_upload', data: { username: 'test', file: file_upload } }).then(function(response) { console.log(response); });

asp.net - How can i set entire row as hyperlink in SSRS report? -

i have created ssrs report has multiple column date, time , location, note fields & group meeting-name. on date field, have created hyperlink open report of document related particular meeting. now want set hyperlink on entire row in ssrs report open report. it not possible using built in ssrs controls have row click take report, however, there hacks. unless want spend lot of time getting things right, suggest scaling requirements on ;) modify reportingservices.js this complete hack . file resides in reporting services installation folder on server , loaded reportviewer control render server side reports. add semantics there customize , extend functionality in reports. here little more detail , example of method. modify pagethatcontainreportviewer.aspx you can add javascript code page contains report viewer. since javascript call functions js place in root page reachable report. also, can interact report contents once report rendered in viewer, again, comp

java - Modify value of non static variable - reflection -

have non-static int variable define in: public class mainactivity extends appcompatactivity { @sharedfield(key = "sample") public int data = 2; sharedbind sharedbind = new sharedbind(); @sharedmethod(key = "sample") public void methodtest() { log.e("test", "" + data); } @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); sharedbind.bind(this); // run binding } public void onbuttonclick(){ sharedbind.runtest("sample"); } } and sharedbind public class sharedbind { hashmap<string, arraylist<bindhandler>> fieldbindhandlerhashmap = new hashmap(); hashmap<string, arraylist<bindhandler>> methodbindhandlerhashmap = new hashmap(); public void bind(object target) { class<?> obj = target.getclass(); (method method : obj.getdeclaredmethods(

c# - Combine/Merge Datasets From Multiple Excel Files -

i have 3 excel files have same primary key. uploading these excel files application , want merge them in 1 dataset/datatable (whatever easier). have tried couple things have been unsuccessful. here trying... [httppost] public async task<actionresult> index(icollection<iformfile> files) { var uploads = path.combine(_environment.webrootpath, "uploads"); dataset ds = new dataset(); iexceldatareader reader = null; datatable dt = new datatable(); foreach (var file in files) { dataset ds2 = null; if (file == null || file.length == 0) { viewbag.error = "please select excel file<br>"; return view("index"); } else { using (var filestream = new filestream(path.combine(uploads, file.filename), filemode.openorcreate, fileaccess.readwrite)) {

python - Selenium phantomjs webdriver hangs on click -

i trying navigate through pages clicking next button. works first 2 3 pages, after hangs while clicking. from selenium import webdriver selenium.webdriver.common.desired_capabilities import desiredcapabilities import time dcap = dict(desiredcapabilities.phantomjs) dcap["phantomjs.page.settings.useragent"] = ('mozilla/5.0 (windows nt 6.3; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/53.0.2785.89 safari/537.36') driver = webdriver.phantomjs("path phantomjs",desired_capabilities=dcap) driver.get("http://www.zappos.com/product/review/7391917/page/1/start/5") print driver.current_url in range(5): print driver.find_element_by_css_selector("p[class='top-pagination'] a[class*='next']").click() time.sleep(3) print driver.current_url the following output shows click happens first few pages , resulting url change. hangs after first few clicks indefinitely. http://www.zappos.com/product/review/73919

java - JLabel and icon mac issue -

so remember 2 years ago had issue displaying icon on label on mac. i've tried again year whilst working on project , still have same issue. check code works on different computer? either mac or windows know code works , if has idea why doesn't work on mine let me know! all happens frame appears text , buttons no background image. public class memoryroom extends jpanel { /** background image of menu screen */ private image bg = new imageicon("memoryroom.jpg").getimage(); /** jframe used in entire game */ protected jframe app; public memoryroom(jframe app) { app.setdefaultcloseoperation(jframe.exit_on_close); app.setvisible(true); app.setsize(1150, 680); this.app = app; initialize(); app.repaint(); } protected void initialize() { //final jpanel menuscreenpanel = new jpanel(); setvisible(true); setsize(1150, 680); setlayout(null); jlabel lblselectgame = new jlabel("please select game wish play:"); l

c# - select rows whose sum greater than 0 using Linq -

i need do, example: select customers total sum of amount greater 0. tried below code , reference result trying fetch data. not getting proper result. var query = (from in salelist group a.cust_ledger_entry_no groups select groups.sum( s => s.amount) > 0).tolist(); i did above query.now need data satisfying above condition.please me. you need where var query = in salelist group a.cust_ledger_entry_no g g.sum( s => s.amount) > 0 select new { cust_ledger_entry_no = g.key, sumamount = g.sum( s => s.amount) }; i need result like, customers sum of amount greater 0 columns if a customer , need select can use query: var query = in salelist group a.cust_ledger_entry_no g g.sum( s => s.amount) > 0 customer in g // flatten each group select customer;

javascript - Angular 1.xx and Firebase : Adding Subfolder or multidimensional array -

i new angular , programming , making simple web app. data structure in firebase in image i able create topics , display them on firebase console, cannot add lists under each topic in data structure image. editing , deleting topics work well. admin.js: .controller('adminctrl', ['$scope', '$firebase', '$firebasearray', '$firebaseobject', '$routeparams', function($scope, $firebase, $firebasearray, $firebaseobject, $routeparams) { $scope.id = $routeparams.id; var ref = firebase.database().ref().child('topics'); $scope.topics = $firebasearray(ref); $scope.addtopic = function() { $scope.topics.$add({ title: $scope.topic.title, curator: $scope.topic.curator, }); }; $scope.addlist = function(id) { //i dont know how add lists under each topic element. }; $scope.deletecnf = function(topic) { $scope.deletetopic = topic; }; $scope.deletepost = function(deletetopic) { $scope.topics.$remov

asp.net - Button in ItemTemplate of RadListView is losing its disabled property after PageChange -

i have radlistview control, has asp button in itemtemplate delete item . have requirement make controls in page read only. intially in page_prerender event traversing through controls , child controls , disabling them. working expected. when change page of radlistview asp controls have disabled them earlier again getting enabled. expected behaviour radlistview combining radpager. below properties have set. <telerik:radajaxmanagerproxy id="adcleintsradajaxmanagerproxy" runat="server"> <ajaxsettings> <telerik:ajaxsetting ajaxcontrolid="clientsradajaxpanel"> <updatedcontrols> <telerik:ajaxupdatedcontrol controlid="clientsradlistview" /> </updatedcontrols> </telerik:ajaxsetting> </ajaxsettings> </telerik:radajaxmanagerproxy> <telerik:radajaxpanel id="clientsradajaxpanel" runat

jquery - Javascript : How to properly check if selected option is empty? -

i have selected option here, don't know why if didn't choose option means (-select-) values="" no values, still not work. select option array because on loop. here code var randomgender_arr = []; var tae = true; if(randgender == 'random'){ $('select[name="randomgender[]"]').each(function(k,v){ if($(v).val()===''){ alert('please select gender') }else{ randomgender_arr.push($(v).val()); } }); }else{ } btw selected option here, can see first option disabled. how consider empty? , check if when leave 1 of the option (-select-) return false. echo'<div style="float:right; position:absolute; top:10px; right:0;"> <label for="randomgender">gender:</label> <select name="randomgender[]" id="randomgender" class="form-control randomgender"> <option disabled readonly selected>

linux - How to grep to matching multiple patterns with multiple options -

i need filter text file using grep multiple patterns , multiple options: grep -e "question" -e "query" file.txt this above works need add options -a grep -e -a3 "question" -e -a5 "query" file.txt you can in awk simple hack grep not support that. awk -v var1=4 -v var2=6 '/question/{while (count<var1) line[nr+count] count++;} \ /query/{count=0;while (count<var2) line[nr+count] count++; }; nr in line' file.txt here awk variables var1 , var2 control how lines of text including pattern needs printed. similar grep -a flags value + 1. you can see working below sample file:- $ cat file.txt question bc c d e f query a1 bc2 c3 d4 e5 f5 foo running command values 4 , 6 $ awk -v var1=4 -v var2=6 '/question/{while (count<var1) line[nr+count] count++; } \ /query/{count=0;while (count<var2) line[nr+count] count++; }; nr in line' file.txt question bc c query a1 bc2 c3 d4 e5 this can e

sql server - SQL - Query Join result is empty even though there are data in one of the tables -

i have 2 tables named tnetworksocket , tpatchpanelports use filter data. have data when execute select * tpatchpanelports but, when select * tnetworksocket there no data. correct. if execute select distinct hostid, hostname, hosttypeid, domainname thosts, tdomains, tpatchpanelports, tnetworksocketport thosts.domainid=tdomains.domainid , ( tpatchpanelports.connectedhostid = thosts.hostid or tnetworksocketport.connectedhostid = thosts.hostid) , accountid=1 i no data, if remove tnetworksocketport query looks like: select distinct hostid, hostname, hosttypeid, domainname thosts, tdomains, tpatchpanelports thosts.domainid=tdomains.domainid , ( tpatchpanelports.connectedhostid = thosts.hostid) , accountid=1 i data. what missing re-writing query explicit join syntax , table have used left join, may you select distinct hostid, hostname, hosttypeid, domainname thosts inner join tdomains on thosts.domainid=tdomains.domainid inner join tpatchpanelports on t

Azure Upgrading MySQL Database (ClearDB) Version from v5.5 to v5.7 -

i'm using django create api mysql database. i'm using jsonfield in code , local mysql version v5.7 json field supported. azure's mysql version v5.5 , json field not supported. is there way upgrade mysql on azure?

python - How to find a given element in nested lists? -

this iterative solution: def exists(key, arg): if not arg: return false else: element in arg: if isinstance(element,list): in element: if i==key: return true elif element==key: return true return false print(exists("f", ["a", ["h", "e", "j"], ["t", "e", "s", "c", "o"]])) however, l.a. wants double recursive function solve this. my attempt: def exists(key, arg): if not arg: //base case return false elif arg[0]==key: //if find key first trial return true else: return (exists(arg[0:],key)) this doesn't work; shouldn't, because there no stop. also, not account lists of lists; don't know how that. any answer, comment, etc. appreciated if consider these cases: my_list empty: key isn't fo

Scala :Returning a Function with variable argument from another function -

my requirement return function function in scala takes variable argument i.e while executing returned function , can pass multiple argument @ runtime. my code looks : object varargtest { def getfunction(): (map[string, string],map[string, any]*) => any={ (arg:map[string,string], arg2:map[string,any]*) => "random"//this gives compilation error } } in code , want return function take , map[string,string] 1 argument ,while other map[string,any] should optional it. but compilation error in return statement follow: type mismatch; found : (map[string,string], map[string,any]) required: (map[string,string], map[string,any]*) ⇒ can , have missed here? note: requirement returned function can take either 1 argument (map[string,string]) or can take 2 arguments max (map[string,string], map[string,any]) thanks it's impossible use varargs in anonymous function. can piece of code working making returned function nested instead of anonymous this:

objective c - NSUserdefault not saving value ios9.3 , ios 10 , using side navigation -

this issue has been cause of lots of frustration , nsuserdefaults stopped working. saving facebook information in userdefaults later use , returning nil. note : nil when try slide in side navigation (using swrevealviewcontroller) bar. here code : [[nsuserdefaults standarduserdefaults] setvalue:[nsstring stringwithformat:@"%@",[resparray valueforkey:@"image_url"]] forkey:@"profilepic"]; [[nsuserdefaults standarduserdefaults] synchronize]; what have tried : - add/remove synchronize - clearing nsuserdefaults app - using setobject , setvalue nsuserdefault key - using nsstring stringwithformat , retrieving strings. i tried each , every solution available on , web.

c++ - possible concurrent write of *same* value to an integer. Do I need an atomic variable? -

i want introduce optimization legacy code. optimization boils down following simple example: class foo{ static int m_count; // allocated , initialized -1 indicate it's uninitialized. void fun(){ if (m_count ==-1) m_count = execute_db_call(); // return val > 0. if (m_count == 1) { // call special == 1 optimized code. } else { // call expensive code. } } } fun() called millions of times on hundreds of threads, running concurrently on 256 core server. execute_db_call expensive, , return value constant lifetime of application. do need or want make m_count atomic? in worst case multiple threads might call execute_db_call , , same value, , write value same location in memory. race condition when both threads attempt write same integer value? if did make member atomic, kind of performance overhead looking @ subsequent read behavior?

jenkins - How to run same job parallel with different parameters for each run -

i have build job , test job parameters. i want after build job, simultaneously run test job 1 parameter , same test job different parameters in parallel execution. build job | / \ test job test job with 1 params other params | | how accomplish , whether possible perform without having write own plugin? can list<xmlsuite> suites = new arraylist<xmlsuite>(); (int = 0; < valuelist.size(); i++) { xmlsuite suite = new xmlsuite(); suite.setname("tmpsuite" + i); xmltest test = new xmltest(suite); test.setname("tmptest" + i); test.setparallel(parallelmode.classes); map<string, string> parameters = new hashmap<string, string>(); parameters.put("first-name", valuelist.get(i)); test.setparameters(parameters); list<xmlclass> classes = new arraylist<x

php - Symfony 3 Doctrine Select with Relantionship -

fellows have following function: /** * * {@inheritdoc} * @see \appbundle\interfaces\crudmanagerinterface::search() * * @return member[] */ public function search(array $searchparams, array $order , $page, $limit) { /** * @var \doctrine\common\persistence\objectrepository $querybuilder */ $querybuilder=$this->entitymanager->createquerybuilder(); $querybuilder=$querybuilder->select('m')->from('appbundle:member','m'); if(!empty($searchparams['name'])) { $querybuilder->andwhere('m.name :name')->setparameter('name','%'.$searchparams['name'].'%'); } if(!empty($searchparams['schools'])) { if(!is_array($searchparams['schools'])) { $searchparams['schools']=[$searchparams['schools']];

java - Tunring my android to beacon and detecting -

is right way of doing? using samples https://altbeacon.github.io/android-beacon-library/samples.html public class app extends application implements bootstrapnotifier, beaconconsumer, rangenotifier { private final string tag = "application "; protected static final region beaconregion = new region("2f234454-cf6d-4a0f-adf2-f4911ba9ffa6", null, null, null); protected beaconmanager beaconmanager = null; private regionbootstrap regionbootstrap; private backgroundpowersaver backgroundpowersaver; protected static string slog = ""; @override public void oncreate() { super.oncreate(); logit(tag, beaconregion.getid1()+"oncreate - in"+beaconregion.getuniqueid()); beaconmanager = org.altbeacon.beacon.beaconmanager.getinstanceforapplication(this); beaconmanager.getbeaconparsers().clear(); beaconmanager.getbeaconparsers().add(new beaconparser(). setbeaconlayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"

automation - MapView testing on UI Testing with Xcode -

i have map view in app working on. there current location , destination markers. when on page using ui testing automation, , call "po xcuiapplication().debugdescription" map view seen none of details of map view (current location, etc). is there way identify sub objects within map view (e.g. current location markers, etc)? there's not enough information sure (what kind of object map view?) sounds map view accessible element. accessible elements not tableview/collection cells, in xcuitests, cannot containers. should able set property false , elements within map should accessible, long them property set true .

Clojure equivalent of python's base64 encode and decode -

this question has answer here: clojure base64 encoding 5 answers i have python code snippet , need clojure equivalent. user_id = row.get('user_id') if user_id: user_id_bytes = base64.urlsafe_b64decode(user_id) creation_timestamp = int.from_bytes(user_id_bytes[:4], byteorder='big') dc_id = int.from_bytes(user_id_bytes[4:5], byteorder='big') & 31 if creation_timestamp > when_we_set_up_dc_ids: row['dc_id'] = dc_id} you can use clojure's java compatibility leverage java.util.base64 class. user> (import java.util.base64) java.util.base64 user> ;; encode message (let [message "hello world!" message-bytes (.getbytes message) encoder (base64/geturlencoder)] (.encodetostring encoder message-bytes)) "sgvs

android - Why GLES20.glGetAttribLocation returns different values for different devices? -

i'm trying using opengl2.0 , create multiple cubes in 3d space, android devices. the code runs in devices, not in others, , don't know why... (all devices have opengl 2.0 supported, , have recent android versions [5.0 or 6.0]) i know problem in -1 return value (see down) int vertexshader = loadglshader(gles20.gl_vertex_shader, r.raw.vertex); int gridshader = loadglshader(gles20.gl_fragment_shader, r.raw.grid_fragment); int passthroughshader = loadglshader(gles20.gl_fragment_shader, r.raw.fragment_color); cubeprogram1 = gles20.glcreateprogram(); gles20.glattachshader(cubeprogram1, vertexshader); gles20.glattachshader(cubeprogram1, passthroughshader); gles20.gllinkprogram(cubeprogram1); gles20.gluseprogram(cubeprogram1); cubepositionparam1 = gles20.glgetattriblocation(cubeprogram1, "a_position"); cubenormalparam1 = gles20.glgetattriblocation(cubeprogram1, "a_normal"); ----> returns -1 value cubelightposparam1

android - SQLite singular/plural search -

i'm building android app college project. searches sqlite database recipes according ingredients user specifies. i'm still @ beginning, , i've run problem. i'm storing ingredients singular in database. each ingredient appears once , i'm using junction table connect between recipes , ingredients (many-to-many), , table specifies quantity , unit of measurement. the problem search itself. if user types ingredients in plural form (which case)? example, if have "tomato" ingredient , user types "tomatoes", how can make work? thing, how can list ingredients in singular or plural forms needed when displaying recipes ("1 egg", "2 potatoes"... etc)? i'm starting think if store separate ingredients each recipe might easier, "2 cups of milk" 1 recipe , once again "1 cup of milk" instead of "milk" , specifying quantity , uom in separate columns, though it'd less efficient, though in case won'

angularjs - Angular and SVG filters -

i came accross strange behaviour when using svg angularjs. i'm using $routeprovider service configure routes. when put simple svg in templates, fine: <div id="my-template"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <rect fill="red" height="200" width="300" /> </svg> // ... </div> but when add filter, code instance: <div id="my-template"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <defs> <filter id="blurred"> <fegaussianblur stddeviation="5"/> </filter> </defs> <rect style="filter:url(#blurred)" fill="red" height="200" width="300" /> </svg> </div> then: it works on homepage . with firefox , svg isn't visible any

Wakanda websocket onclose not firing on network disconnect -

i have websocket implementation on wakanda server. tracking connected browsers server side. when reload page, onclose event of websocket expected. i have expected when break network connection have event fire. misunderstanding? there way have function fire when network connection lost websocket client? for reference, using wakanda 10. to understand problem give details websocket connections : it uses tcp if remote client(browser instance) closes tcp connection gracefully server notified (fin) if remote client crashes, os running client application notifies server (rst) if tcp connection open between server , client connection assumed open if there absolutely no exchange of data while unless keepalive activated. the websocket spec adds close message server/client can handle graceful close the websocket spec adds ping/pong message exchange not impose timeout. rfc : upon receipt of ping frame, endpoint must send pong frame in response, unless received close fram

php - Laravel : Entrust redirect & route protection -

im using entrust set user roles/permissions, working fine if not logged in not redirecting login page (it blocking pages error message need redirect login). route::group(array('middleware' =>'role:customer'), function () if try , use auth middleware white page (with no error) when logged in if not logged in redirect login page route::group(array('middleware' =>'auth','role:customer'), function () hi sintaxis route::group should be: route::group(['middleware' => ['role:customer']], function() { // .... }); or array notation. route::group(array('middleware' => array('role:customer')), function() { // .... }); add array role:customer condition. more detailed here: https://github.com/zizaco/entrust#middleware

html - Textarea not responding to css -

all i'm trying here add css textarea reason isn't responding it. there particular way it's odd isn't working. simple answer here clues guys? input[type="textarea"] { overflow: hidden; resize: none; border: none; overflow: auto; outline: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; height: 50px; width: 500px; margin: 0; } <form method="post" action="mydoc.php" autocomplete="off"> <textarea name="tb_a1" cols="1" rows="2"></textarea> </form> your css incorrect. field not input , it's textarea : textarea { overflow: hidden; resize: none; border: none; overflow: auto; outline: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; height: 50px; width: 500px; margin: 0; } <form method="post" action="mydoc.php&qu

google play - Android publishing two apps with same package id -

inside of android developer console have 2 applications, myappname , myappname-staging. differences between these 2 apps be: the api environment point (prod vs. staging) one external play store release while other (myappname-staging) intended internal users in company. would allowed use same package/app id both of these or need change package id each one? assumption need change it, if thats case can use same code base change app id , rebuild apk achieve this? for additional context i've built app using nativescript. packaging info handled through package.json file , code signing must done through cli. want make sure can't code sign myself situation can't release build production (the myappname build) guidance. from experience, google play store doesn't allow 2 apps having same package name published. need either: change package name or if want have same package name regardless, upload staging app (with same package name) beta channel of l

javascript - How To Pass A Static Token (Key) To API Endpoint? -

i'm working on web app, needs send ajax call apigee api endpoint - , needs send api key in order execute api call. how can in secure way? here need use multiple policies in apigee, try make use of these javascript policy, service call out policy , extract variable , assign message policies refer these sites: apigee docs: http://docs.apigee.com/ community: https://community.apigee.com/index.html

How do for-in loops in swift work? -

i've used them, i'm familiar code , read number tutorials still don't understand how work in can't run through head i'm doing , want achieve, opposed if statement can read in english quite well. for-loops have been i've struggled through lack of understanding, can offer insight please? the for-in loop performs set of statements each item in range or collection. swift provides 2 range operators a..<b , a...b , shortcut expressing range of values. // prints 1-10 in 1...10 { print(i) } // way has been removed in swift 3 use above var = 1; <= 10; i+=1 { print(i) }

html - Add text to background image using CSS -

i using background image on section covers whole screen while section in view. covered subsequent sections page scrolls. #section1{ background: url(../sitedata/images/sectionbackground.jpg) no-repeat center top fixed #f1ece2; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; min-height:800px; } i want add text half way down image. can do, want stay in position, if part of image. when screen scrolls up, text gets hidden rather scrolls top - stays in position on image. how this? thanks here demo answer make them both image , text responsive live on fiddle . try not copy paste. try understand css how text on image. if have questions ask me in comment. best of luck. .img-reponsive { display: block; max-width: 100%; height: auto; margin: 0 auto; } .textoverimage { position: relative; } p.title { position: absolute; top: 75px; left: 0; text-align: center;

selenium - Python Scraping - Unable to get required data from Flipkart -

i trying scrape customer reviews flipkart website. following link . following code scrape, returning empty list. >>> bs4 import beautifulsoup >>> import requests >>> r = requests.get('https://www.flipkart.com/samsung-galaxy-j5-6-new-2016-edition-white-16-gb/product-reviews/itmegmrnzqjcpfg9?pid=mobeg4xwjg7f9a6z') >>> soup = beautifulsoup(r.content, 'lxml') # tried 'html.parser' >>> soup.find_all('div', '_3dcdkt') [] >>> soup.find_all('div', {'class': '_3dcdkt'}) [] >>> soup.find_all('div', {'class': 'row _3wyu6i _3brc7l'}) [] >>> soup.find_all('div', {'class': '_1grhlx hfpo14'}) [] so, tried entire section, getting following: >>> soup.find_all('div', {'class': 'col-9-12'}) [<div class="col-9-12" data-reactid="96"><div class="row