Posts

Showing posts from March, 2013

weird string concat in JavaScript -

i got weird on string concat in jquery follow : var name = button.data('name') var emailname = button.data('email') var username = button.data('username') var userstatus = button.data('active') var userid = button.data('id') alert(userid) var actionupdate = "{{action('usercontroller@update', "+userid+")}}" alert(actionupdate) and result/alert userid 28723050-71e9-11e7-a0a9-e9f620359699 (uuid user id) when concated/joined, got actionupdate variable {{action('usercontroller@update', "userid")}} instead of {{action('usercontroller@update', "28723050-71e9-11e7-a0a9-e9f620359699")}} expected. i tried join string , variable concat or +=, didn't result expected. any alternatives , solution appreciated. if, odd reason, want {{action('usercontroller@update', "28723050-...9699")}} with single-quotes...

python - finding duplicate words in a string and print them using re -

i need printing duplicated last names in text file (lower case , uppercase should same) program not print words numbers (i.e. if number appeared in last name or in first name whole name ignored) for example: text file : assaf spanier, assaf din, yo9ssi levi, yoram bibe9rman, david levi, bibi netanyahu, amnon levi, ehud spanier, barak spa7nier, sara neta4nyahu the output should be: assaf assaf david bibi amnon ehud ======== spanier levi import re def delete_numbers(line): words = re.sub(r'\w*\d\w*', '', line).strip() t in re.split(r',', words): if len(t.split()) == 1: words = re.sub(t, '',words) words = re.sub(',,', '', words) return words fname = input("enter file name: ") file = open(fname,"r") line in file.readlines(): words = delete_numbers(line) first_name = re.findall(r"([a-za-z]+)\s",words) in first_name: print...

JavaScript - Regex - Grab only matched pattern if there are multiple matches in a single line -

i'm trying read contents of css file , looking links external files. figured faster write quick regular expression me, proving frustrating. say have: @font-face{font-family:'fontawesome';src:url('../fonts/fontawesome-webfont.eot?v=4.6.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.3') that line goes on more, lets take now. as can see, there both src:url(...) , url(...) figured url(..) occurrences. here's tried: take 1: var contents.match = ... // contents of .min.css file. var matches = contents.match(/url\s*(.*);/g); take 2: var contents.match = ... // contents of .min.css file. var matches = contents.match(/url\s*(.*);/); //no g @ end. take 3: var contents.m...

http - Reading results of url request into python script -

i new python , trying read results of http request x parameters within python script can perform further tasks on it. to me more specific, request takes characteristics , sends list of files corresponding given parameters. part of resulting xml doc url each file, trying access. this segment of have far, prints result of request, need read part of result. import requests link = "http://examplelink.com" f = requests.get(link) print f.text i thinking possibly string matching search url, i'm positive there's easier way. using urllib in program, if thats solution i'm totally open it. i'm not tied using requests. let me know if have questions!

jquery - Put the value of every field with the same name attribute into an array using PHP -

this question has answer here: array string php? 10 answers i have 2 fields (at minimum) both have same name attribute. using little jquery, user can add more text boxes using jquery's .clone() feature. every possible input add have same name attribute first two. want try use php create comma separated list of every input value after form submitted. $competitor_names = $_post['competitor-name']; $competitorlist = ''; foreach($competitor_names $competitorlist) { $competitorlist = $competitorlist.', '; } the function implode() seems you're looking : $competitor_names = $_post['competitor-name']; $competitorlist = implode(',', $competitor_names);

php - Having trouble with web security -

this question exact duplicate of: website shows 'connection not secure' on firefox 1 answer the login web page of website not secure, whenever typing username or password on login page in firefox dialog box saying: the connection not secure. logins entered here compromised. should try prepared statements, or there issue? sorry broad question, i'm not familiar web security. here's login page code: <?php include("connect.php"); include('phpmailer/phpmailer-master/examples/gmail_xoauth.phps'); if (isset($_post['createaccount'])) { $username = $_post['username']; $password = $_post['password']; $email = $_post['email']; if (!connect::query('select username accounts username=:username', array(':username'=>$username))) { i...

java - With two tables in Cassandra of the same data but diff primary keys, how model in Spring Boot and use a data repository (or other DAO/ORM pattern)? -

if had 2 tables give me ability search email , username, how model in spring boot? can't have 1 auto-wired repository works on both since it's 2 different tables, data same. what's proper way gives 1 interface find/create/delete users (in both tables stay in sync)? create table users_by_username ( username text primary key, email text, age int ) create table users_by_email ( email text primary key, username text, age int )

javascript - How to properly use a variable to scrollLeft within the animate function -

first, in advance help. second, mention have looked @ different questions related topic read documentation both animate() , scrollleft() on mdn think question more based on syntax rather function usage , why other questions have not been helpful me. now, on issue. attempting modify javascript code have written 1 function can react viewport of user. on html side, have table 1 <tr> , 3 <td> 's. 3 <td> 's filled picture , info , when user clicks on buttons below, table scrolls appropriate content. buttons work fine. problem images bigger viewport (on device) , on initial page load, image needs scrolled distance proportional both viewport , asset size (i load different assets based on viewport also). formula scroll distance, discovered, 0.5( assetwidth ) - 0.5( viewportwidth ) . so, here js have come (this inside jquery(document).ready(function($){ var scrolldistance; if ($('#interactive-row:visible').length == 0) { //viewport ...

coreml - Fail to convert Caffe model to Core ML model -

when try convert model caffe core ml model coremltools, following: ================= starting conversion caffe coreml ====================== layer 0: type: 'data', name: 'data'. output(s): 'data', 'label'. warning: skipping data layer 'data' of type 'data'. recommended use input layer deployment. layer 1: type: 'split', name: 'label_data_1_split'. input(s): 'label'. output(s): 'label_data_1_split_0', 'label_data_1_split_1'. layer 2: type: 'convolution', name: 'conv1'. input(s): 'data'. output(s): 'conv1'. layer 3: type: 'slice', name: 'slice1'. input(s): 'conv1'. output(s): 'slice1_1', 'slice1_2'. layer 4: type: 'eltwise', name: 'etlwise1'. input(s): 'slice1_1', 'slice1_2'. output(s): 'eltwise1'. traceback (most recent call last): file "test.py", line 2, in <module>...

asp.net - Session-duration-only access control to DNN pages -

we have customer unusual request security of subset of dotnetnuke / evoq website. this special set of pages should accessed large group of company's employees make preferred-discount purchases. rather trying maintain set of thousands of user accounts, having employees register gain access passwords, want have employee welcome page, provide email address (which confirmed company's domain) , sent link or link , temporary rotating passcode grants access set of pages duration of session once visit link. i've searched type of 3rd party module accomplish no luck. it has been suggested might accomplished through type of url-masking process, suppose might done proxy outside of dnn. has provided similar type of security solution before, either within dotnetnuke or through proxy?

apache - How to customize vhost file for a WHM-CPanel host? -

i want change document root particular host. currently setting host : <virtualhost 123.164.132.142:80> servername abc.com serveralias mail.abc.com www.abc.com documentroot /home/abc/public_html serveradmin webmaster@abc.com usecanonicalname off customlog /usr/local/apache/domlogs/abc.com combined <ifmodule log_config_module> <ifmodule logio_module> customlog /usr/local/apache/domlogs/abc.com-bytes_log "%{%s}t %i .\n%{%s}t %o ." </ifmodule> </ifmodule> ## user abc # needed cpanel::apacheconf <ifmodule userdir_module> <ifmodule !mpm_itk.c> <ifmodule !ruid2_module> userdir enabled </ifmodule> </ifmodule> </ifmodule> # enable backwards compatible server side include expression parser apache versions >= 2.4. # selectively use newer apache 2.4 expression parser, disable ssilegacyexprparser in # user's .htaccess file. more information,...

excel - Auto refresh Pivot tables on data change -

i have worksheet data web scrapes data based on dynamic link. there pivottable pivot tables based on data worksheet. data worksheet uses following macro , clears contents of cells before web scraping new updated data. data updated every 1 minute. i have following code refresh pivot tables on data update. thisworkbook.worksheets("pivottable").pivottables("pivottable1").refreshtable since data takes 20 seconds complete updating, there no data (as cell contents cleared first) pivot table refresh. so, error. data uses following code update data: with thisworkbook.worksheets("data").querytables.add(connection:= _ "<url redacted>", destination:=thisworkbook.worksheets("data").range("$a$1")) .name = "datapull" .fieldnames = true .rownumbers = false .filladjacentformulas = false .preserveformatting = true .refreshonfileopen = false ....

wpf - Image Control Source property binding in PowerShel -

i've wpf image control, want set source dynamically through custom property added treeviewitem . here piece of code of image control: <treeview name="tvicomp" > <treeview.resources> <style targettype="{x:type treeviewitem}"> <setter property="headertemplate"> <setter.value> <datatemplate datatype="contentpresenter"> <grid> <stackpanel name="spimg" orientation="horizontal"> <image name="imgnoderoot" width="20" height="20" stretch="fill" source="{binding relativesource={relativesour...

javascript - Delete a vertical line worth of pixels -

i trying delete vertical line 10 px in width , height of image.i using canvas. cannot post jsfiddle because cannot load image. var canvas = document.createelement("canvas"); canvas.height = 200; canvas.width = 200; caman(canvas, "studipo.jpg", function () { var base64encoded = getresizedimage(canvas, 200, 200, 200, 160); }); function getresizedimage(canvas, width, height, croppingwidth, croppingheight) { var ctx = canvas.getcontext("2d"); var oldid = ctx.getimagedata(0, 0, width, height); var newcanvas = document.createelement("canvas"); newcanvas.width = croppingwidth; newcanvas.height = croppingheight; var newcontext2d = newcanvas.getcontext("2d"); var vnewid = newcontext2d.createimagedata(width, height); var oldarray = array.from(oldid.data); console.log(oldarray); var arraytoinsert = []; (var y = 0; y < height; ++y) { (var x = 0; x < width; ++x) { if (y > 90 && y < 130)...

Android: Toolbar elevation / Shadow -

i know why toolbar cast shadow if nestedscrollview there (i've got example internet) <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.nestedscrollview android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <!-- scrolling content --> </android.support.v4.widget.nestedscrollview> <android.support.design.widget.appbarlayout android:layout_height="wrap_content" android:layout_width="match_parent"> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android...

javascript - FormDataMultiPart files field is missing top directory -

i have java servlet uploads files in folder passed web page. works fine unless top folder contains folders , not files. example, if folder updating looks this: topfolder +file1 +file2 +subfolder ++file3 ++file4 and choose topfolder upload, works fine , can recreate file structure on target server. but if topfolder doesn't have files , looks this: topfolder +subfolder ++file3 ++file4 i cannot recreate structure on target server because topfolder missing output. here code clarify: map<string, list<formdatabodypart>> fields = multipart.getfields(); (string field : fields.keyset()) { logger.info("field="+field); list<formdatabodypart> formdatabodyparts = fields.get(field); (formdatabodypart part : formdatabodyparts) { formdatacontentdisposition disposition = part.getformdatacontentdisposition(); string filename = disposition.getfilename(); logger.info("filename="+filename); } } the output...

python - 'function' object has no attribute 'data' -

from sklearn import datasets iris=datasets.load_iris x = iris.data --------------------------------------------------------------------------- attributeerror traceback (most recent call last) <ipython-input-15-12a2d725131f> in <module>() ----> 1 x = iris.data attributeerror: 'function' object has no attribute 'data load iris dataset sklearn ,but when write "x = iris.data",an error occur "attributeerror: 'function' object has no attribute 'data'" load_iris function , needs called such: from sklearn import datasets iris=datasets.load_iris() x = iris.data

ios - Getting all data in a Firebase column -

Image
i created json database tree , can read specific values these codes. can see on table view "albert einstein" ref.child("personel").child("name").observesingleevent(of: .value, with: { (snapshot) in if let item = snapshot.value as? string{ self.mylist.append(item) self.lessonstableview.reloaddata() } }) but, want see categories under personal column? this, is there way or learn columns under "personal" table view output must -> age, name, photo you can iterate on snapshot, it's children , childrens keys say have users node user users user_0 fav_game: "wow" name: "leroy" then keys of name: , fav_game: let userref = self.ref.child("users").child("user_0") userref.observesingleevent(of: .value, with: { snapshot in child in snapshot.children { let snap = child as! datasnapshot ...

processbuilder - java block while run shell command using process -

i have java project find videos information in youtube playlist using youtube-dl. here main.java import java.io.*; public class main { public static void main(string[] args) throws exception { string command1 = "/usr/local/bin/youtube-dl --flat-playlist --dump-single-json https://www.youtube.com/playlist?list=plfcoh1yarquo1yejy5ly09rfbipuepf7g"; string command2 = "/usr/local/bin/youtube-dl --flat-playlist --dump-single-json https://www.youtube.com/playlist?list=plc6a0625dca9aae2d"; system.out.println(executecommand(command1)); } private static string executecommand(string command) throws ioexception, interruptedexception { int exitcode = 0; string result = ""; process process; processbuilder builder = new processbuilder(command.replaceall("[ ]+", " ").split(" ")); builder.directory(new file("/tmp/test")); process = builder.start(); exitcode = process.waitfor(); r...

javascript - Tooltip, accessibility -

building nice accessible web page hard. currently, im trying make tooltip web accessible , need help. guys have piece of advice it? aria attributes should use. or other important thing want add! moreover, how prevent screen reader reading tooltip, if hasnt been shown? approach here make using javascript, adding , deleting aria-hidden attribute, want avoid js as possible. you'll have show tooltip on focusable element (if element not focusable, should set tabindex attribute) <input type="text" id="mytextbox" aria-describedby="mytooltip" /> <span id="mytooltip" role="tooltip" class="tooltip" aria-hidden="true">tooltip textbox</span> the aria-describedby set relationship between focusable element , tooltip. tooltip role support not important, should use it's designed subject. once done, have set initial state in css: .tooltip[aria-hidden='true'] {display: ...

arduino - How do I connect a (concrete) push-switch / button to MIT app inventor -

how connect (concrete) push-switch / button mit app inventor or there way can connect actual button/switch (like ones used in bread boards) app making. know there way because there many videos doing opposite (controlling arduino app). thank much! i new robotics , programming not sure hardware (bluetooth/arduino/rasberry pie/bread board) should using. thank after briefly looking @ app inventor website, see android app ide mit library stuff baked in. when developing mit app inventor app, concrete buttons mention part of android app developing (usually touch screen button on phone shows when load app). if wanted leverage app inventor library , hook physical switch sort of embedded device, might want client-server sort of application. or find simple embedded device support android. this means might hook push switch sort of embedded device, esp32 or esp8266 capable of bluetooth , wifi. esp32 ask android app question based on button push. android app respond answer or disp...

math - find error total amount total 31049 35% =2572.3 -

find error total amount total 31049 35% =2572.3 amount % total -------------------------------- 5990 12% =718.8 4999 10% =499.9 5060 6% =303.6 15000 7% =1050 -------------------------------- total 31049 35% =2572.3 -------------------------------- = 31049 35% =10867.15 well cant add percentages did taking portions of something, of them bigger others. simple way of seeing applying same logic using 100% if add 4 times 100% 4 times original value! another way see percentages view them add fractions 50% x/2 or 33% x/3 way can remember way add fractions have common multiple of them (commonly minimum common multiple) after finding can add fractions.

java - Select Specific value from multiple rows returned by Oracle database -

i trying compare specific value values returned database. getting multiple rows storestaff trying compare 1 of values returned table.. contains() , equals() are not working. string qry = "select employe_id storestaff post='admin'"; pstmnt = conn.preparestatement(qry); resultset rs2 = pstmnt.executequery(qry); if (rs2.next()) { string aa = rs2.getstring("employe_id"); if (aa.contains(un.gettext())) { this.aa = aa; joptionpane.showmessagedialog(null, "exists"); } else { joptionpane.showmessagedialog(null, "username doesn't exist"); } } can suggestt me better solution or can tell me better solution it? if use if return first values, in case have use while , loop throw results, can check multiple results, instead can use : boolean check = false; while (rs2.next()) { string aa = rs2.getstring("employe_id"); if (aa.contains(un.gettext())) { this.a...

python - sklearn CountVectorizer returning all zeros - string conversion issue? -

i trying use sklearn's countvectorizer given vocabulary. vocabulary is: ['humanitarian crisis', 'vacations anti-cruise crowd', 'school textbook', "b'cruise vacations anti-cruise", 'budget deal', "b'public school", 'u.n. announces', 'wrong petrol', 'vacations anti-cruise', "b'cruise vacations anti-cruise crowd"] the input vectorize on taken pandas dataframe. read in csv pd.read_csv , encoding='utf8' : 29371 b'9 quirky , brilliant paris boutiques' 20525 b'public school textbook filled muslim bi... 2871 b'congress focuses on averting shutdown, t... 29902 b'yarmouk siege: u.n. announces trip syria ... 45596 b'fracking protesters arrested gluing them... 6266 b'cruise vacations anti-cruise crowd' after call countvectorizer(vocabulary=vocabulary).fit_transform() , matrix of zeros: (<6x10 sparse matrix of...

ios - Re-stream a live video from iphone to a server -

i getting video feed in app drone. drone's sdk giving me video data or nsdata app. want stream same or divert same server (for example wowza server). these 2 things should process simultanously. you can use ffmpeg library restreaming it. there sample ffmpeg swift or objective c

html - Flexbox not displaying properly in IE or Chrome -

ok, didn't want use flexboxes begin because of older browser support issues way working without flexbox involved floats, -margins, z-indexs, , ugly , unseenly. that being said, flexbox, left hand date block contorts both width , height in both ie , chrome despite hard setting height , width. https://jsfiddle.net/yuum08d9/ <style> body { font: 13px / 23px roboto, sans-serif; } #experience { } #experience h4 { color: #262626; font: normal normal 300 normal 23px / 29.12px roboto, sans-serif; margin: 0px 0px 30px; } #experience .experience { box-sizing: border-box; color: #404040; display: flex; margin: 0 0 30px 0; padding: 20px 0 0 0; transition: 600ms ease; -webkit-transition: 600ms ease; -moz-transition: 600ms ease; -o-transition: 600ms ease; } #experience .experience:hover { transform: translatex(20...

php - Uncaught exception 'mysqli_sql_exception' with message 'No data supplied for parameters in prepared statement' -

i trying write query using prepared statement. mysqli_report(mysqli_report_all); $query = $conn->prepare("insert notification(messageid,topicarn,subject,message,timestamp,signatureversion,signature,signingcerturl,unsubscribeurl,topicid) values (?, ?, ?, ?, ?,?, ?, ?, ?, ?)"); this throws following exception fatal error: uncaught exception 'mysqli_sql_exception' message 'no data supplied parameters in prepared statement' where following query works $query = $conn->prepare("insert notification(messageid,topicarn,subject,message,timestamp,signatureversion,signature,signingcerturl,unsubscribeurl,topicid) values (".$message['messageid'].", '".$message['topicarn']."', '".$message['subject']."', '".$message['message']."', '".$message['timestamp']."',".$message['signatureversion']...

javascript - JQuery Custom Column Sorting not working for columns that are alphanumeric -

i have set custom jquery column sorts work numeric or alphabetical data types can't work alphanumeric. imagine numbers sorted top , alphas go underneath cannot anything. im using bootstrap data tables , jquery. custom statements below can't see how allow them alphanumeric mixed field types. has have solution or point me in direction of find one? in advance. /* create array values of input boxes in column */ $.fn.datatable.ext.order['dom-text'] = function(settings, col) { return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) { return $('input', td).val(); }); } /* create array values of input boxes in column, parsed numbers */ $.fn.datatable.ext.order['dom-text-numeric'] = function(settings, col) { return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) { return $('input', td).val() * 1; }); } /* create array values of select options in column...

My app won't show up on the "Complete action" chooser dialog for android.intent.action.Call -

when incoming call on mobile time want ask user select action "in app wants pickup call". normally per research when use android:permission="android.permission.call_phone" action receiver automatically open "complete action using" unfortunately not getting popup. to open popup, have done below code intent = new intent(intent.action_call); it.setdata(uri.parse("tel:" +number)); it.setflags(intent.flag_activity_new_task); if (activitycompat.checkselfpermission(ctx, manifest.permission.call_phone) != packagemanager.permission_granted) { return; } ctx.startactivity(it); and using code "complete action using" popup open not getting app in selection i refer below link make scenario working how use android.intent.action.call_privileged , android.intent.action.new_outgoing_call? so can 1 please me make scenario working? action_call used outgoing call, not incoming call. not sure can want. somehow need ...

java - Can we change wrapper class into primitive data types? -

this question has answer here: unboxing long in java 8 answers can change wrapper primitive ?if not happening in code int = integer.valueof(46); system.out.println(i); i not getting error. yes, called unboxing : integer boxed = 10; // boxing int unboxed = boxed; // unboxing boxing conversions described in jls 5.1.7 ; unboxing conversions described in jls 5.1.8 . note if try unbox null reference, nullpointerexception thrown: integer boxed = null; int unboxed = boxed; // npe

android - Library for react native application icon badge -

i'm looking library can used in react native handle both android , ios application badge count. i'm using react-native-onesignal handle push notifications. onesignal not support handling application badge count on client side. for ios can programmatically set badge count. android can use react-native-badge-android library. but need library both ios , android ?, suggestions? mybe can try lib https://github.com/7kfpun/financereactnative library both ios , android

excel - Creating Dynamic Diagrams via VBA -

i tried create dynamic diagrams vba today. code works fine ive got problem line-diagram shows 10 out of 21 data series. code adds 21 data series via .newseries when code finished diagram shows 10 of them. has idea why happens or has solution problem? activesheet.shapes.addchart2(, xlline, 0, 0, 1400).select dim cht chart set cht = activechart cht.haslegend = true cht.charttitle.text = "test" activechart until .seriescollection.count = 0 .seriescollection(1).delete loop end = 2 clmns step 4 activechart.seriescollection.newseries activechart.fullseriescollection(cnt).name = worksheets(1).cells(1, i) activechart.fullseriescollection(cnt).values = worksheets(1).range(worksheets(1).cells(1, i), worksheets(1).cells(rws, i)) cnt = cnt + 1 next greetings benjamin i got solution, display bug, excel did not noticed there many data series. adjusted width , height little bit , refreshed diagram , series there. thank you.

ios - Using NSArray to populate collectionView -

i new objective-c , have function accepts nsarray parameter want store array in local var in function , populate collection view through array, ps i'll have update cellforitematindexpath delegate method in same class. this method in tableview's cell class. here i've embedded collectionview in cell. -(void)initcellwithsetsarray:(nsarray *)setsarray{ nsmutablearray *setarray = [nsmutablearray array]; } this calling method accept array in cellforrowat tableview's delegate method. -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ [cell initcellwithsetsarray :self.setshistoryarray]; } so need update collectionview based on array parsed in func when called in cellforrowatindexpath . hope guys picture now. you need add property cell class hold array: @property (strong, nonatomic) nsarray *setsarray; -(void) setsetsarray(nsarray *)sets { _setsarray = sets; [self.collectionvie...

hadoop - zookeeper+kerberos:server not found in kerberos database (7) - unknown_server -

i hbase+kerberos safety verification on linux rhel7,there 1 error show when use zookeeper client server command "zkcli.sh -server master": ...... mechanism level server not found in kerberos database (7) - unknown_server...... here detail logs hbase hmaster , regionserver can not work error. have checked kerberos , zookeeper configs,i not know why error occur.

java - Set different aliases for same class with Xstream -

i need create xml must next example. <eba_met:mi81 contextref="c-01" decimals="-3" unitref="u-01">0</eba_met:mi81> <eba_met:mi81 contextref="c-02" decimals="-3" unitref="u-01">0</eba_met:mi81> <eba_met:mi81 contextref="c-03" decimals="-3" unitref="u-01">0</eba_met:mi81> <eba_met:mi76 contextref="c-04" decimals="-3" unitref="u-01">0</eba_met:mi76> <eba_met:mi53 contextref="c-05" decimals="-3" unitref="u-01">0</eba_met:mi53> <eba_met:mi53 contextref="c-06" decimals="-3" unitref="u-01">0</eba_met:mi53> <eba_met:mi76 contextref="c-07" decimals="-3" unitref="u-01">0</eba_met:mi76> <eba_met:mi53 contextref="c-08" decimals="-3" unitref="u-01">0</eba_me...

javascript - Protractor script fails to execute on the android device -

my protractor config file looks this: var myhelper = require("./myhelper.js"); exports.config = { seleniumaddress: 'http://localhost:4723/wd/hub', of appium url chromedriver: 'c:/appium/chromedriver', specs: ['tests/file1.js'], jasminenodeopts: { defaulttimeoutinterval: 180000, }, prefs: { 'profile.managed_default_content_settings.geolocation': 1, 'profile.default_content_settings.popups':0 }, multicapabilities: [ { browsername: 'chrome', platformname: 'android', platformversion: '7.0', devicename: 'ce10160a3538442705', 'newcommandtimeout' : 120, 'chromeoptions': { 'args': ["--use-fake-ui-for-media-stream", '--use-fake-device-for-media-stream', '--disable-web-security','--start-maximized','--full-reset'] }, } ], onprepare: function() {...

ArrayOutOfBoundException when iterating through a data frame in spark SQL -

i have data set of called people.json {"name":"michael"} {"name":"andy", "age":30} {"name":"justin", "age":19} the following code gives me arrayoutofboundsexception. import org.apache.spark.sql.sparksession val sparksession = sparksession.builder .master("local") .appname("my-spark-app") .config("spark.some.config.option", "config-value") .getorcreate() val peopledf = sparksession.sparkcontext. textfile("c:/users/desktop/spark/people.json"). map(_.split(",")). map(attributes => person(attributes(0),attributes(1).trim.toint)). todf() peopledf.createorreplacetempview("person") val teenagersdf = sparksession.sql("select name, age person") teenagersdf.show() looks trying work through empty dataframe. can tell me why empty? when have valid json file, should use...

javascript - Refused to load the font 'data:font/woff.....'it violates the following Content Security Policy directive: "default-src 'self'". Note that 'font-src' -

Image
my react webapp give error on browser console refused load font 'data:font/woff;base64,d09........' because it violates following content security policy directive: "default-src 'self'". note 'font-src' not explicitly set, 'default-src' used fallback. also: refused connect 'ws://localhost:3000/sockjs-node/782/oawzy1fx/websocket' because violates following content security policy directive: "default-src 'self'". note 'connect-src' not explicitly set, 'default-src' used fallback. screenshot of browser console index.html have meta: <meta http-equiv="content-security-policy" content="img-src 'self' data:; default-src 'self' http://121.0.0:3000/">; webpack.cofig.js var debug = process.env.node_env !== "production"; var webpack = require('webpack'); var path = require('path'); module.exports = { context: path.join...