Posts

Showing posts from August, 2014

html - Can't seem to hover the drop-down menu via CSS -

to upfront, started web designing module in school, hence i'm quite new stuff. here's thing, attempted create css drop-down menu i'm not sure why drop-down menu isn't appearing. "display"/"visibility"/"opacity" property in "ul li ul" element causing trouble, or it's thing? /* navigation */ header nav ul { list-style: none; float:right; margin-right: 50px; } nav ul li { position: relative; display: inline-block; float:left; font-family: 'open sans condensed', sans-serif; padding-top: 15px; padding-bottom: 15px; margin-right: -5px; background: #fff; -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); } nav ul li a{ color: #000000;; text-decoration: none; -webkit-transition: 0.2s; -moz-transition: 0.2s; -ms-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; letter-spacing: 2px; font-size: 25px; padding: 15p

regex - Restrict Access to one of subdomains, excluding a directory with .htaccess & .htpasswd -

i'm have several websites different subdomains. have common .htaccess file. example: sub1.domainname.com sub2.domainname.com sub3.domainname.com exclude.domainname.com sub4.domainname.com ... and restrict access 1 of them, lets exclude.domainname.com . the problem want allow access different static files may served /files folder (ex: exclude.domainname.com/files/images/image.png ). i've fininshed 1 solution, now, when i'm trying access exclude.domainname.com , after entering username , password i'm getting server error message, static files can accessed without restrictions. i appreciate help. perhaps probelm setenvif or general logic . thank in advance. ## password protection & authentification ## authtype basic authname "access protection" authuserfile "/path/to/the/.htpasswd" require valid-user # exclude environments # set env deny access setenvif host ^exclude\.domainname\.com$

javascript - save selected options [<select> values in database -

Image
i need save selected options values in database . in form, need include select options inside input type , have code. <form method="post"> <td>designer order number </td> <td> <div id="ordernumbers"> <select> <option>select order</option> </select> </div> </td> <input type="text" name="duedate" value=""/> <input name="register1" type="submit" id="btnsubmit" value="update" onclick="return updatepayment(); "/> </form> to include select option inside form , tried link1 did't worked me. than i followed below code in mentioned in link2 <form> <td> <div id="ordernumbers"> <input type="text" name="designerorder_id" list="citynames"

pivot table - PivotTables Won't Update excel vba -

what missing?! i've got workbook set link external csv file. there formulas link values in pivot table. if you've got doc open , refresh manually/wait values in pivot tables/formulas update, programmatically stay same (both pivot , resultant formulas)? application.displayalerts = false dim wbk workbook dim pt pivottable set wbk = workbooks.open(filepath, true) each pt in wbk.pivottables pt.refreshtable next pt wbk.worksheets.application.calculate am using wrong kind of refresh? tried adding in wait time, did nothing. calculations set automatic. should refreshing pivot data source rather tables themselves??

database normalization - Decomposition into ABC & CDE and preserving functional dependencies -

consider relation r 5 attributes abcde. assume r decomposed 2 smaller relations abc , cde. define s relation (abc naturaljoin cde). a) assume above decomposition lossless join. dependency guarantees lossless join property. b) give additional fd such “dependency preserving” property violated decomposition. c) give 2 additional fd's preserved decomposition. question seems different me because there no fd given , asking: a) r1=(a,b,c) r2=(c,d,e) r1∩r2 =c (how can control dependency now) f1' = {a->b,a->c,b->c,b->a,c->a,c->b,ab->c,ac->b,bc->a...} f2' = {c->d,c->e,d->e....} then find f' ?? b,c) how check , need possible fd's r1 , r2 the question assuming things hasn't said clearly. abcde subject jd *{abc,cde} while not being subject nontrivial fds @ all. but suppose relation subject fds , isn't subject jds other ones imply. if c ck join lossless. c -> abcde holds, because ck dete

excel - VBA formula too long, ways to shorten it -

goodafternoon all, currently facing vba issue, "record macro" function work, when try rerun it, gives me 1004 error. recall 3 things: split formula in parts, refer next part in formula (ie part 2= abc+def+ghi, formula 123+3456+ ____, replace ____ part 2) put formula text in different cells, refer cells in formula (formula cell("a1").value(?) + cell("b2").value(?) give parts of code specific name, shorten formula (ie abc = 'input - motc!' refer abc in formula especially part 2 use with, since don't know exact reference, , can @ formula in excel instead of going vba. the formula is: activecell.formular1c1 = _ "=if(weekday(rc2)=6,countifs('input - motc'!c90,""confirmed"",'input - motc'!c101,""1"",'input - motc'!c74,""500"",'input - motc'!c86,""<>c"",'input - motc'!c47,""<""&

python - Use HTTP session in Django Channels -

i have following problem. have django web application , need upload csv files , stream them using django-channels. decided save path of uploaded csv file in http session. from django-channels documentation understood can access http session object inside websocket, using following code returns object not have file path added earlier. @http_session def ws_connect(message): print("connected on data websocket") print(message.http_session.__dict__) group("data").add(message.reply_channel) result of printing http session is: {'modified': false, 'accessed': false, '_sessionbase__session_key': '92zcls0hxqlk1352xwja6tvytjebjfw7', 'serializer': <class 'django.core.signing.jsonserializer'>} my question is, can access http session in websockets? or should consider way of doing this?

aspectj - handling a specific exception type -

i've defined 2 afterthrowing advices handle exceptions same pointcut. @afterthrowing(pointcut="...", throwing="ex") public void method1(exception ex) {} @afterthrowing(pointcut="...", throwing="ex") public void method2(gatewayexception ex) {} is there way me prevent generic method1 being executed if exception gatewayexception? any ideas appreciated c it easiest check instance of exception inside advice body , return if it's of more specific exception type: @afterthrowing(pointcut="...", throwing="ex") public void method1(exception ex) { if (ex instanceof gatewayexception) { return; } // handle more generic exception case } @afterthrowing(pointcut="...", throwing="ex") public void method2(gatewayexception ex) { // handle more specific gatewayexception } i know expected solution based on aspectj language construct, thing is, there's no such cons

kafka consumer api - KafkaStream not receiving any messages from Topic -

i'm playing around kafkastreams , kafkaconnect trying consume messages topic. have "standard" batch consumer set topic , works charm. first send couple of records kafka , consume them afterwards. want same using kakfa streams, don't single message topic. here's consumer code i'm using. final int number_of_partitions = 4; final properties consumerconfig = new properties(); consumerconfig.setproperty("zookeeper.connect", rule.getconfiguration().kafka.getzookeeperurl()); consumerconfig.setproperty("backoff.increment.ms", "100"); consumerconfig.setproperty("group.id", "java-consumer-example"); consumerconfig.setproperty("consumer.timeout.ms", "1000000"); consumerconfig.setproperty("client.id", "someclient"); consumerconfig.setproperty("auto.offset.reset", "smallest"); consumerconfig.setproperty("enable.auto.commit", "false"); co

java - Why session scope bean is the same for different mock session in tests -

i'm trying test session scoped bean in spring-boot i've encountered problem. i've created 2 mockhttpsession , try inject them controller method, add them scoped bean. if run application beans different in each scope, when try test it, object same. here test: @runwith(springjunit4classrunner.class) @springboottest public class observersessionscopedit { @autowired private observercontroller controller; @rule public temporaryfolder temporaryfolder = new temporaryfolder(); @test public void sessionscope() throws exception { mockhttpsession sessionfirst = new mockhttpsession(); mockhttpsession sessionsecond = new mockhttpsession(); sessionfirst.changesessionid(); sessionsecond.changesessionid(); controller.startobserving(temporaryfolder.getroot().getabsolutepath(), sessionfirst); controller.startobserving(temporaryfolder.getroot().getabsolutepath(), sessionsecond); subscriptions subscriptionsfirst = (subscriptions) sessionfirst.getattribu

Configure PrimeFaces with IntelliJ IDEA -

so first time building java ee application. watched lot of tutorials of them using eclipse. so problem this: <h:panelgroup layout="block"> <p:commandbutton ajax="false" action="#{loginbean.login()}" styleclass="btn btn-info" value="login" /> </h:panelgroup> when start wildfly server , try access login page. if there no brackets after login method get: the class 'loginbean' not have property login. if try brackets. method invoked when page initialized , exception values username , pass null. when commented method content got page initialize properly, issue occured. jsf components like: <h:panelgroup> <h3 class="logintitle">#{msgs['default.title']}</h3> </h:panelgroup> are rendered correctly, primefaces components <h:panelgroup layout="block"> <p:inpu

android - how i can intent from notification? -

why intent notification null? intent resultintent = new intent(context, myclass.class); resultintent.addflags(intent.flag_activity_new_task | intent.flag_activity_single_top); bundle extras=new bundle(); extras.putstring("key","value"); pendingintent resultpendingintent = pendingintent.getactivity( context, 0, resultintent, pendingintent.flag_update_current ); notificationcompat.builder n = new notificationcompat.builder(context) .setcontenttitle("test") .setcontenttext(text) .setsound(sound) .setcontentintent(resultpendingintent) .setautocancel(true) .setextras(extras) .setsmallicon(android.r.drawable.ic_media_play);

rebol2 - Detecting right clicks in Rebol -

view layout [ box red feel [ engage: func [face action event] [ if action = 'alt-down [print "alt down"] ; 1 if event/double-click [print "double-click"] ; 2 ] ] ] this code doesn't detect double right clicks. when double click right button detect 1 click (line 1). i've tried detecting double-clicks doesn't work on right mouse button (line 2). is there way detect successive right mouse button clicks?

java - How to make inner links in Android Studio project? -

for example have class named gotoprofile (string username) ... implemented intent opening profile activity. how make textview link gotoprofile("username goes here") inside recycleview ? right make invisible textview inside card value of username , after onclick (view v) ?

javascript - Jquery .animate()... returns wrong offsets; -

in following code, if 1 of conditions true , run animate code, why both console.log return same values (offsets)? $(document).on("click",".box",function(){ var transparent = $("#transparent"); var transparent_left = transparent.offset().left; var transparent_top = transparent.offset().top; var box = $(this); var this_top = box.offset().top; var this_left = box.offset().left; console.log(this_top +" "+this_left); if(transparent_top === (this_top + 100) && transparent_left === this_left){ box.finish().animate({top: "+=100"}); transparent.finish().animate({top: "-=100"}); }else if(transparent_top === this_top && transparent_left === (this_left + 100)){ box.finish().animate({left: "+=100"}); transparent.

c# - VSTO: Don't inlcude column header -

Image
i'm using vsto bring data database , displaying on worksheet the user presses button , worksheet gets populated data the problem when data gets written worksheet automatically includes column header, don't want column header i set listobject.showheaders = false; includes empty cell, don't want empty cell. this how declare listobject private void createlistobject() { worksheet = (excel.worksheet)this.application.activeworkbook.worksheets[1]; worksheet extendedworksheet = globals.factory.getvstoobject(worksheet); excel.range cell = extendedworksheet.range["c12", "c16"];//obtain range this.listobject = extendedworksheet.controls.addlistobject(cell, "data");//add listobject this.listobject.autosetdataboundcolumnheaders = false; this.listobject.showautofilter = false; this.listobject.showheaders = false; //i thought enough this.listobject.showtablestylerowstripes =

python - pySerial works in one script but not another -

now getting output, yet wrong post modified reflect progress. i have been reading documentation following links site. able find script works in reading data arduino serial output. it follows: import time import serial # configure serial connections (the parameters differs on device connecting to) ser = serial.serial( port='/dev/ttyacm0', baudrate=115200, parity=serial.parity_odd, stopbits=serial.stopbits_two, bytesize=serial.sevenbits ) ser.isopen() print 'enter commands below.\r\ninsert "exit" leave application.' input=1 while 1 : # keyboard input input = raw_input(">> ") # python 3 users # input = input(">> ") if input == 'exit': ser.close() exit() else: # send character device # (note happend \r\n carriage return , line feed characters - requested device) ser.write(input + '\r\n') out = ''

Cant build android studio project with compiledSdkVersion 17 -

i have build project compiledsdkversion 17 , worked in eclipse since moved adt project android stduio following errors: error:(3) error retrieving parent item: no resource found matches given name 'android:widget.material.spinner.underlined'. error:(3) error retrieving parent item: no resource found matches given name 'android:widget.material.spinner.underlined'. error:(15) error retrieving parent item: no resource found matches given name 'android:textappearance.material.large.inverse'. error:(21) error retrieving parent item: no resource found matches given name 'android:textappearance.material.medium.inverse'. ...etc.. my build.gradle file looks this: apply plugin: 'com.android.application' android { dexoptions { javamaxheapsize "4g" } lintoptions { disable 'validfragment' } compilesdkversion 17 buildtoolsversion '23.0.3' defaultconfig { applicationid "de.valve.halflife3&

php - Setting a Session Variable -

wonder if me. trying set session variable database table. need when logs in, takes value 'user_group' column of user table user has logged in , assign session variable. @ moment passing in username manually typed in user upon login. this current code login.php. have tried various things , looked on here tips haven't had luck. <?php session_start(); $host = "localhost"; $user = "root"; $pass = ""; $db = "california"; mysql_connect($host, $user, $pass); mysql_select_db($db); $username = $_post['name']; $password = md5 ($_post['password']); // check make sure both fields entered if ($username == '' || $password == '') { header("location:login-fail.htm"); } else $sql = "select * users name='".$username."' , password='".$password. "' limit 1"; $res = mysql_query($sql); if (mysql_num_rows($res) == 1

what are the penetration testing techniques for android application? -

i developed android application, want know penetration technique available testing secure application. can unzip apk , java files. tried using apktool on apk, java files converted smali format. there tool convert dex files java files? i have set debuggable false, think logs won't visible when try dig in. and, have used hardcoded string even, read somewhere use hardcoded strings. sorry, missed out diva tool & apk inspector, app testing not able use properly. what possibility 1 can penetrate through application , obfuscation in preventing? any specific obfuscation achieve that? you can try online apk decompilers , check datas visible. can try restrict proguard requirements.

objective c - IPv6 AutoDiscovery in iOS -

i not unable auto discover servers running in ipv6 network. please let me know should right multicast address need placed, servers can discovered. in existing code, able discover ipv4 servers, not ipv6. i have used ff02::1 multicast address, still didn't work. following code, setsocket returns error , failing. int status = setsockopt(socket6fd, ipproto_ipv6, ip_add_membership, (const void *)&imreq, sizeof(imreq)); if (status != 0) { err = [self errnoerrorwithreason:@"error in setsockopt() function"]; return_from_block; } kindly share thoughts

ruby on rails - Retrieving the correct model id -

i'm attempting edit data model, keeps listing user id instead of own id. why that? <% provide(:title, 'activations') %> <div class="row"> <div class="col-md-8"> <% if @user.activations.present? %> <h3>activations (<%= @user.activations.count %>)</h3> <ol class="activations"> <%= render @activation %> </ol> <%= will_paginate @activation %> <% end %> </div> </div> </div> this part of partial being rendered <span class="user"><%= link_to activation.id, edit_activation_path %></span> i've tried passing edit_activation_path(params[:id]) the activation id being listed correctly, don't know how set edit path id activation model. thank help. try passing model object link helper. edit_activation_path(activation) .

assembly - Pep8 - Base 2 to Base 10 converter -

i developing called simple pep8 program, converts base 2 number base 10. below requirements: ask user input in base 2 convert base 2 value decimal , output that. finally loop , ask user if want enter value. if ask question again, else display message 'done' (or effect) so far trying read character , store string. could help! thank you. br main letter: .block 1 ;global variable #1c ; main: chari letter,d ;cin >> letter lda 0x0000,i while: ldbytea letter,d ;while (letter != '*') cpa '*',i breq endwh charo letter,d ; cout << letter chari letter,d ; cin >> letter br while endwh: stop .end storing string work, on complicates problem. you might have found out during month between question , answer, can build number read each character,

java - What is the best way to define a set of constants in a web project? -

this question has answer here: what best way implement constants in java? 27 answers i'm working on ejb project , need define set of constants can use in whole of project create interface hold set of constants question there better way in define constants in web project ? this exemple of constant interface : public interface ejbconstant { final string const23= "ab23"; final string const24= "ab24"; // .......... } thank suggestion sonar has quite explanation of examples according joshua bloch, author of "effective java": the constant interface pattern poor use of interfaces. that class uses constants internally implementation detail. implementing constant interface causes implementation detail leak class's exported api. of no consequence users of class class implements constant in

ios - Why objective-c NS_ENUM variable automatically have default value -

i created enum this typedef ns_enum(nsinteger, permissionstages) { thepermissionnotdetermine = 0, thepermissiondenied = 1, thereminderpermissionallowed = 2, }; and create variable this permissionstages permissionstagevar; i have not assign value it, default variable has permissionstages enum first value, in case thepermissionnotdetermine why behavior? the line: permissionstages permissionstagevar; is getting default value of 0 . similar line: nsstring *foo; resulting in foo having initial value of nil . or bool abool; resulting in abool having initial value of no . the variables initialized value of "0". since enum happens have value 0 , variable appears initialized thepermissionnotdetermine .

C program not working with errors related to C++ -

i wrote program school, keep getting c++ related errors (apparently) #include <stdio.h> #define int num_of_chars 51 void switch (char *c) { //little letters if (((*c)>=97) && ((*c)<=122)) (*c)-=32; //capital letters if ((c>=65) && (c<=90)) (*c)+=32; //*c>=5 if ((c>=53) && (c<=57)) (*c)=56; //*c<5 if ((c>=48) && (c<=52)) (*c)=48; }*/ int main() { char string[51]; printf("please enter string \n"); scanf("%s", string); printf("%s => ", string); int i=0; char s[51]; while((string[i]!= "\0") && (i < num_of_chars)) { s[i]=switch (string[i]); i++; } printf("%s", s); return 0;*/ } i'm getti

javascript - How to make HTML display a default string that is later replaced by a string taken from angular brackets? -

so @ moment in handlebar file there this: <p>colour selected: {{selectedtype.colour}}</p> ... selectedtype object .js file looks like: selectedtype: [{clothing: 'shirt', size: 'big', colour: 'blue'}, {clothing: 'socks', size: 'small', colour: 'red'}], this part of ember-power-select box allows, example, website display colour selected: blue underneath when select shirt . this when nothing has been selected yet, webpage displays colour selected: without given. want change default blue shown until has been selected. in controller, can check if selectedtype.colour undefined or null. assign default value if undefined or null.

How to read/get cookies at the Client side using Java Springs? -

is possible cookie name known me set app? tried code - cookie[] cookie = request.getcookies(); i getting null in cookie there lot of cookies can see in browser settings-> cookiesand site data. is possible cookie don't set? can put springs app in same tomcat of app set cookie. ps: don't know springs need if possible, might have sounded bad while asking question.

javascript - Notify by email, when a value from a specific column to changed, using Script Editor -

Image
i need notify email when cells in aq column of spreadsheet changed. i wrote formula not working. an image of spreadsheet , formula below. function onedit( e ){ //to email notification if changes perticular cells var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheetbyname("notificações"); var cell = ss.getactivecell().geta1notation(); var row = sheet.getactiverange().getrow(); var cellvalue = ss.getactivecell().getvalue().tostring(); var recipients = "fabiano.ars95@outlook.com"; var message = ''; if(cell.indexof('aq')!=-1) { // means if edit column aq message = sheet.getrange('aq'+ sheet.getactivecell().getrowindex()).getvalue() } } var subject ='notificação de alta prioridade ' var body =' você acaba de receber uma notificação de alta prioridade. acesse sua planilha de notificações para que possa elaborar uma tratativa' logger.log(body); //mailapp.sendemail(&qu

how break out of scope ruby variable ruby -

i have used following code delete lines file: file.open("#{$whitelist}-tmp", "w") |outfile| file.foreach("#{$whitelist}") |li| outfile.puts li unless li.chomp[/\a#{instanceid}\z/] @comm = outfile end end fileutils.mv(@comm, $whitelist) it works, i'm thinking it's not right way it, had create variable '@comm' communicate filename out loop. if used 'outfile' first argument of fileutils.mv directly got undefined variable error. so, how should have done this? thanks in advance. the simplest way assign variable containing filename before block use it: tempfile = "#{$whitelist}-tmp" file.open(tempfile, "w") |outfile| file.foreach("#{$whitelist}") |li| outfile.puts li unless li.chomp[/\a#{instanceid}\z/ end end fileutils.mv(tempfile, $whitelist)

javascript - Development workflow with pixi.js and browserify (Error: browserify can't find pixi.js module) -

i started test pixi.js , followed tutorial http://frontender.info/introduction-to-pixijs/ (sorry it's in russian, can translate google translate). liked workflow of tutorial, need use "require" in browser, , need quckly test game in browser. works fine, when request beefy server on url http://localhost:9966/ getting error: error: cannot find module 'pixi.js' 'c:\users\painkiller\desktop\pixitest' @ c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:46:17 @ process (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:173:43) @ ondir (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:188:17) @ load (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:69:43) @ onex (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:92:31

kubernetes - Ingress reports unhealthy backend -

i'm using gce kubernetes host rails app ingress reports pod unhealthy. below setup ingress: spec: backend: servicename: my-service serviceport: 80 service: spec: type: nodeport selector: app: my-app ports: - port: 80 targetport: 3000 depoyment readinessprobe: httpget: path: /health_check port: 3000 initialdelayseconds: 20 timeoutseconds: 5 the ingress reports pod unhealthy , don't see /health_check shows in health checks list in gce console. seems it's not picked google load balancer controller. thank much. it turned out ingress didn't pick new path of readiness probe changed earlier. problem solved after recreated ingress (which not optimal solution).

asp.net mvc - Does NOT support http GET when sending POST -

tried looking around web bit , @ loss. setting rest api. locally using postman send post end point , well. once pushed test server , run post status: 405 method not allowed { "message": "the requested resource not support http method 'get'." } controller looks , said, able post locally not test server [httppost, route("")] [responsetype(typeof(string))] public async task<ihttpactionresult> createsomething([frombody] obj stuff) c# generated post man var client = new restclient("http://test-api.someurl.com/makestuff/makethisthing/"); var request = new restrequest(method.post); request.addheader("postman-token", "not sure if needed post man put here"); request.addheader("cache-control", "no-cache"); request.addheader("authorization", "bearer [a long oauth token]"); request.addheader("content-type", "applic

c# - Problems with Identity Server 3 -

we having bit of trouble putting identity server 3 our applications. currently have webapi nhibernate connect our oracle databases. use angularjs on our front-end, , call controller methods ajax. old coleague, used identity server on 1 of applications made, but, configured identity server windows credentials (since we're in corporate ad), we're making external website, have login , password, , use identity server our authentication , autorization. i have looked examples on github , other articles(like this one ), wasn't able connect is3 authenticate, give me 403.14 error. building , running gives no error, can't seem access identity server 3. here's startup public void configuration(iappbuilder app) { try { app.map("/identity", idsrvapp => { idsrvapp.useidentityserver(new identityserveroptions { sitename = "identity server", enablewelcomepage = false,

anonymize - In R - how do I replace all letters in a string with other letters? -

i need anonymize names in specific way format of entire string still same (spaces, hyphens, periods preserved) letters scrambled. want consistently replace a's c's, d's z's, , on. how that? we can use chartr chartr('ad', 'cz', str1) #[1] "cz,zc. c" data str1 <- c('ad,da. c')

Getting the first value from spark.sql.Row -

i have following json format : {"request": {"tranchelist": {"tranche": [{"trancheid": "500192163","ownedamt": "26500000", "curr": "usd" }, { "trancheid": "500213369", "ownedamt": "41000000","curr": "usd"}]},"fxrateslist": {"fxratescontract": [{"currency": "chf","fxrate": "0.97919983706115"},{"currency": "aud", "fxrate": "1.2966804979253"},{ "currency": "usd","fxrate": "1"},{"currency": "sek","fxrate": "8.1561012531034"},{"currency": "nok", "fxrate": "8.2454981641398"},{"currency": "jpy","fxrate": "111.79999785344"},{"currency": "hkd","fxrate":

compilation - Buildozer to android Signing Issues -

ok... things have changed. think can work ran new problem. error stating i'm out of space on vm drive. (god!!!) i tried doing compile using shared folder permission errors kill process doing that. idk @ point. .buildozer folder not 200mb in size how can vm drive out of space? ------solved first part------------------- solved first issue. buildozer's vdi download should not used. vdi size 8gb , that's not big enough compiling projects. instead create new larger vdi, downloaded linux ubuntu 14.04 , installed virtual machine. linux had it's issues , ended fixing system...one issue being window didn't auto resize after guess auditions installed. anyway, installed buildozer anew, along dependencies, cython 0.21 etc , re-ran build process. now, apk created doesn't install on android. there's no error message except, "apt not installed." know deal be? -----update i can't finish signing of apk because don't have sdk fol

Julia - UndefVarError in macro when used in function but not in REPL -

i want make macro substitute long expression used in several functions improve code readability. each function has same name argument, used in macro, when compiling function julia says variable used in macro undefined when escaped. minimal example: julia> macro mtest() esc(x) end @mtest (macro 1 method) julia> ftest(x) = @mtest error: undervarerror: x not defined now gets weird: julia> x = 1 1 julia> @mtest 1 julia> ftest(x) = @mtest ftest (generic function 1 method) julia> ftest(2) 1 why doesn't function definition evaluate ftest(x) = x ? how can tell macro use x scope of calling function rather repl? want use macro substitute literal block of text, in c library using: #define check_stuff \ big \ complicated \ expression \ involving x; void func(x, y, z) { //stuff check_stuff //more stuff } in case check_stuff must macro, not function, because contains goto label in func . task translate julia.

dataframe - mapply for SparkR R -

i have spark dataframe "a" header follows c1 | c2 | c3 | c4 i1 | 12 | 31 | 4 i2 | 14 | 32 | 13 i3 | 13 | 33 | 15 i4 | 16 | 29 | 25 i5 | 18 | 30 | 73 i6 | 17 | 36 | 19 column 2 (c2) smaller c3 i want compare c4 c3 , c2 following logic: if c4 between c2 , c3 return 1 else return 2 and add new column dataframe i can mapply when there no spark involved. how can in sparkr? you should able ifelse statement df_a <- data.frame(c1 = c('i1', 'i2', 'i3', 'i4', 'i5', 'i6'), c2 = c(12, 14, 13, 16, 18, 17), c3 = c(31, 32, 33, 29, 30, 36), c4 = c(4, 13, 15, 25, 73, 19)) <- as.dataframe(df_a) a$c5 <- ifelse(a$c4 > a$c2 & a$c4 < a$c3, 1, 2) head(a) c1 c2 c3 c4 c5 1 i1 12 31 4 2 2 i2 14 32 13 2 3 i3 13 33 15 1 4 i4 16 29 25 1 5 i5 18 30 73 2 6 i6 17 36 19 1

asp.net mvc - How to send an array items from UI to MVC Controller -

Image
i have array of objects in ui being sent mvc controller . array of objects : `doorid`,`doorname` , array of `schedules`. `schedules` array has `scheduleid` , `schedulename`. now how send mvc controller ? , every doorid , it's associated scheduleid can extracted separately form obeject ? presently , sending doorid array , scheduleid array separately , but not want . want send entire array itself. public async task<actionresult> addgroup(string[] doorids, string[] scheduleentity)//accessgroupentity entity, string accountid { groupentity groupentity = new groupentity(); var doorschedulelist = new list<doorinfoentity>(); for(int i=0;i< doorids.length;i++) { doorschedulelist.add(new doorinfoentity() { doorid = doorids[i], scheduleid = scheduleentity[i] }); } accessgroupentity.dooritems = doorschedulelist; and parse doors[in

mysql - Empty SQL Error creating tables through wizard in OpenOffice Base -

Image
environmentals: have new openoffice base file mysql file remotely hosted shared-server (linux based). have been able connect windows machine running base remote mysql using microsoft odbc 32-bit connection. problem: when attempting create new table, using new table wizard in base, can input needed information, , when hit finish @ create table step, presented openoffice error window red circle x icon, , buttons of "ok" or "more". when pressing "more" details, presented error> sql status: ÿ". - i can not passed problem. have faintest idea of going on , might causing error, or better, fix?

javascript - Prompt file download -

Image
i have link on page on click of trying generate pdf document , show open - save prompt on browser. my html (reactjs component) has below code onclick calls _getmydocument function calls webapi method. <div classname="row"> <a href="#" onclick={this._getmydocument.bind(this)}>test link</a> </div> _getmydocument(e) { getmydocument(this.props.mydata).then(()=> { }).catch(error=> { }); my controller has below code [httppost] [route("generate/report")] public ihttpactionresult getmyreport(mydata mydata) { byte[] mydoc = mybusinessobject.generatemyreport(mydata); var result = new httpresponsemessage(httpstatuscode.ok) { content = new bytearraycontent(mydoc) }; result.content.headers.contentdisposition = new contentdispositionheadervalue("attachment") { filename = "mydocument.pdf"

c++ - VS2015 UserMacro as Custom Build Tool -

i looking using custom build tool files of project. since command line similar of files , lazy type out entire command every time every file needs it, thought i'd create usermacro contains command line , every file needs custom build tool type $(mytool) command line. it works in vs calls process, macro defined using vs internal variables such %(fullpath) , %(filename) . unfortunately, though ui macro preview shows these variables are, appears they're being replaced once (at time visual studio parses macro?) rather every time macro used. usermacro: sometool.exe "%(fullpath)" -outputfile "$(projectdir)generated\%(filename).cpp" called: sometool.exe \path\to\project\generated\(filename).cpp looks if specified get's stripped away, command line missing drive letter , colon $(projectdir) weird reason. specifying macro content command line in file properties custom build tool working expected, that's lot of typing every file (and every new

c++ - Declaring a union pointer with a pointer inside -

i'm trying learn sse instructions , aspire multiply 2 matices. however, when try initialize 1 of them, program crashes access violation when typing in location here's code throws error: typedef union{ __m128 vec; float* afloat; }u_float; int main(){ __declspec(align(16)) u_float *mat1; mat1 = (u_float*)malloc(sizeof(u_float)*4); for(int = 0; < 4; i++) mat1[i].afloat = (float*)malloc(sizeof(float)*4); for(int = 0; < 4; i++) for(int j = 0; < 4; j++) mat1[i].afloat[j] = 1; // error. return 0;} why throwing error? and best way resolve problem? this has nothing union s. have typo in loop: for(int = 0; < 4; i++) for(int j = 0; < 4; j++) // <-- here mat1[i].afloat[j] = 1; notice inner loop loops while i less 4, not when j less 4, loops infinitely.

Delphi - Changing Chart Title in Excel causes AV - Updated with complete sample -

i using delphi seattle build , display chart in excel (2013). build chart pivot table. chart displays fine. has default title, want change that. should simple property change, keep getting av errors. when google, closest thing can find mentions need select chart and/or chart title before change it. [updated] here working sample shows problem. procedure tform1.button1click(sender: tobject); var oexcel : excelapplication; rawdatasheet :_worksheet; mychart: shape; begin oexcel := createoleobject('excel.application') excelapplication; oexcel.visible[locale_user_default] := true; // add new workbook, single sheet oexcel.workbooks.add(emptyparam, locale_user_default); // handle active sheet, , insert dummy data rawdatasheet := oexcel.activesheet _worksheet; rawdatasheet.range['a1', 'b10'].value2 := 10; // add chart mychart := rawdatasheet.shapes.addchart2(208, xlcolumnclustered, 200, 10, 300, 300, true); // try

openmp - Use omp simd without a for -

i have following instructions: unsigned long int xdiff = seq1.x ^ seq2.x; unsigned long int ydiff = seq1.y ^ seq2.y; unsigned long int zdiff = seq1.z ^ seq2.z; it's possible vectorize using omp simd ? actually if define positions array, don't need anything, compiler vectorize you. struct position { unsigned long pos[3]; }; struct position foo( struct position seq1, struct position seq2) { struct position diff; for( int = 0; < 2; ++i ) diff.pos[i] = seq1.pos[i] ^ seq2.pos[i]; return diff; } gcc since 4.6 vectorize using -o3 flag. if provide architecture specific flags (for example intel vector extensions: -msse42 , -mavx , etc.), can control vector instruction set compiler has use. if want build own machine, can compile -march=native . foo(position, position): movdqu xmm1, xmmword ptr [rsp+32] mov rax, rdi movdqu xmm0, xmmword ptr [rsp+8] pxor xmm0, xmm1 movdqu xmmword ptr [rdi], xmm0 ret if "unro

assembly - Write the value in the 8087's top of stack to a variable in memory -

i installed math coprocessor in old 286 computer, , i've been playing around it's instruction set in assembly. i own intel programmer's reference 8086 cpu, , has nice long section on programming 8087. i've learned need know section, never mentions how transfer value 8087's register stack memory variable. there doesn't appear 8087 instructions moving data around, except popping stack , exchanging data around within register stack. so, how transfer st(0) temporary real variable in memory.

sql - Update Trigger only update if the data has changed -

i have update trigger updates null records when record update in table. problem data in gridview, , when update runs update query on records in grid not updated record. when trigger fires updates every row in target table matches want update 1 data has changed. here trigger. alter trigger [dbo].[trigger_update_deschedule] on [dbo].[tbatchdetails] after update ,insert begin set nocount on declare @batchid int , @ethanol varchar(10) , @glucose varchar(10) , @sampleage varchar(10); select @batchid = b.[batchid] ,@ethanol = [ethanol] ,@glucose= [glucose] ,@sampleage = sa.sampleage inserted bd inner join [dbo].[tsampleage] sa on sa.sampleageid = bd.sampleage inner join [dbo].[tbatch] b on b.id =bd.id update [dbo].[deschedule] set [ethanol] = @ethanol , [glucose] = @glucose , [samplecompleted] = 1 [batchid] = @batchid , [sampleage] = @sampleage

Excel VBA. Compare if all letters in a string is in another string -

i compare if string has characters of string. example: string 1 hejslclo string 2 hello true string 2 has characters of string one. i have turned string 1 array , think there should loop check using instr my first attempt @ this: sub stringintoarray() dim temp string dim mystring string dim string2 string mystring = "heaslsflo" string2 = "hello" temp = strconv(mystring, vbunicode) temp = left(temp, len(temp) - 1) aletter = split(temp, chr(0)) 'dim startrow integer dim integer = 0 l(temp)    if instr(i, string2, aletter(i)) <> 0        msgbox ("yes")    else        msgbox ("no")    end if next end sub ok - got bored , bit. had @ code, there. think should want option explicit public function comparestrings(string1 string, string2 string) boolean dim long, j long, k long dim arr1 variant, arr2 variant ' set default comparestrings = false ' split strings a

java - inputmismatch exception -

Image
this question has answer here: scanner skipping nextline() after using next(), nextint() or other nextfoo()? 14 answers import java.util.*; public class ngg { static scanner numberentered; static scanner userinput = new scanner(system.in); static int guessednumber; static int randomnumber = (int) (math.random()* 11); static scanner reply; static string answer; public static void main(string[] args) { guesschecker(guessednumber); } public static void guesschecker(int userguess) { while (userguess != randomnumber) { intro(); userguess = intchecker(); if (userguess == randomnumber) { system.out.println("congradulations!"); system.exit(0); } else { system.out.println("that incorrect!");

how many log file types nexus sonatype does release and log format? -

i new nexus. can tell type of log files nexus sona type release , log format?. got different answers different sources looking expert answer clear details. in advance. here's official logging guide nexus 2.x. comparable guide nx 3.x exist @ point in future. https://support.sonatype.com/hc/en-us/articles/213464768-nexus-logging-guide

html5 - Angular 2 Reactive Forms Checkbox - Bind Bool to Number -

i have form model indicators represented checkboxes. model value true/false in form object json. value convert boolean number, 1/0 respectively. there smart way this? example code: @component template: ` <form [formgroup]="myform" (ngsubmit)="save(myform.value)"> <input type="checkbox" id="mytoggle" formcontrolname="mytoggle"/> </form> ` export class mycomponent implementes oninit{ private myform:formgroup; mytoggle: number; constructor(private _fb:formbuilder) {} ngoninit() { this.myform = this._fb.group({ mytoggle: [0] }); } hopefully above demonstrating i'm trying set type of "mytoggle" number. initializing form setting default 0 , correctly leaving checkbox unchecked. however, updating checkbox checked set form value true instead of 1. want updated 1. via this question see there options converting booleans numbers. however, i'm unsure of how i

plugins - Is There any ASTNode Library For IntelliJ? -

is there library can use on intellij equivalent org.eclipse.jdt.core.dom? i want able parse java code ast. the library called psi. see here information using psi.

what llvm store instruction pattern do i need? -

im trying make llvm backend , dont know need fix error llvm error: cannot select: t5: ch = store<st4[%retval]> t0, constant:i32<0>, frameindex:i64<0>, undef:i64 this ir im trying process define i32 @main() #0 { %retval = alloca i32, align 4 store i32 0, i32* %retval, align 4 ret i32 0 } but don't know dag pattern need able match it. a tablegen file contains of instructions arch supports here https://github.com/jfmherokiller/customllvm/blob/master/llvm/lib/target/zcpu/zcpuinstr.td i figured out issue looking @ issue wrong store<st4[%retval]> t0, constant:i32<0>, frameindex:i64<0>, undef:i64 can expessed in function form store(constant:i32<0>,frameindex:i64<0>) or store constant i32 0 in stack frame index 0. the information wasnt getting frameindex:i64<0> directly related line in targetselectiondag.td def frameindex :sdnode<"isd::frameindex",sdtptrleaf, [],"framein

python - While loops, if-else statements: Guess my number game -

i'm beginner using python, , writing "guess number game". far have working fine. computer picks random number between 1 , 3 , asks player guess number. if guess higher random number, program prints "lower", , vice versa. player has 5 tries, , when run out, player gets message , game ends. if player guesses correctly, congratulated , game ends. however, when number guessed correctly, program doesn't print congratulatory message , can't figure out why... import random print("\twelcome 'guess number'!:") print("\ni'm thinking of numer between 1 , 100.") print("guess carefully, have 5 tries!.\n") #sets initial values the_number = random.randint(1,3) guess = int(input("take guess: ")) tries = 1 guesses = 4 #guessing loop while guess != the_number: if guess > the_number: print("lower...") elif guesses <= 0: print("sorry, you're out of guesses! try aga

logging - Where is the JBoss EAP 7 log pattern format documentation? -

where jboss eap 6 log pattern format documentation? seems have format characters different log4j or logback (such %k , %s). a number of searches turn results older jboss versions don't have full set of characters. the formatstringparser source code best bet. here list of format characters differ log4j: %s message (like %m) including exception stack traces %m message, suppressing exception stack traces %e exception stack trace %k adds terminal-based colorization %k log resource key (for localization) %z time zone %p localized log level name see redhat's documentation .

css - How do I tie a Drupal template to a webform with multiple environments? -

disclaimer: inherited drupal 7.44 site no experience in drupal @ all. the business trying make new webform , want existing one. after looking around found webform has template tied it. docs seems i'm supposed create more template files format webform-form-[nid].tpl.php [nid] webform node id. we have multiple environments changes must go through - dev, test, , prod. wouldn't node id different in every environment newly created webforms? also, if want apply same template multiple webforms, need make multiple identical template files? i found css styling existing webform , looks .webform-client-form-25 button.webform-submit , such. 25 node id. have little css experience, feels bad. don't want copy blocks of css, changing node ids on , over. what's proper way assign generic, reusable css classes webforms? saw "custom classes" under "manage display" when editing form, didn't seem change actual html of form. on right track though, should r