Posts

Showing posts from June, 2015

excel - VBA Testing two values, if one is different, copy -

i having fair amount of trouble code below: sub testemail() dim long dim lastrow long dim worksheet dim b worksheet dim strtext dim objdata new msforms.dataobject set = workbooks("book2").worksheets(1) set b = workbooks("book1").worksheets(1) lastrow = a.cells(rows.count, "a").end(xlup).row = 2 lastrow if not iserror(application.match(a.cells(i, 7).value, b.columns(3), 0)) , iserror(application.match(a.cells(i, 4).value, b.columns(11), 0)) a.range("d" & i).copy objdata.getfromclipboard strtext = replace(objdata.gettext(), chr(10), "") b.range("k" & ).value = b.range("k" & ).value & " / " & strtext end if next end sub i face 2 problems, 1 has me stumped , other due lack of knowledge: the line after if supposed check if 2 values (numbers) in both workbooks match, , if 2 ...

c# - How to send e-mails using NLog? -

i'm using nlog, , i'm pretty new @ logging. created log files somehow have problem send e-mails. followed instructions can't make it. mail settings in configuration tags in web.config: <system.net> <mailsettings> <smtp deliverymethod="specifiedpickupdirectory" from="some@some.org"> <network host="localhost"/> <specifiedpickupdirectory pickupdirectorylocation="d:\tmp\email"/> </smtp> </mailsettings> </system.net> and target inside nlog.config: <target name="mail" xsi:type="mail" html="true" subject="error received" body="${message}" to="some1@some.com" from="some@gmail.com" encoding="utf-8" smtpusername="some@some.com" enablessl="false" smtppassword="password" smtpauthentication="basic" smtpserver="smtp.some.com" smtp...

excel vba code to export a Microsoft Excel 97-2003 .xls file -

i trying open file user specified path using vba function. when paste content of file desired worksheet, pastes weird unrecognizable characters in worksheet. can figure out doing wrong? here code: sub x_macro() '****************declaring relevant variables****************' dim t range dim path: path = application.getopenfilename("xls files (*.xls), *.xls") dim cht1 chartobject 'dim button_click vbmsgboxresult application.screenupdating = false sheets(2).activate if path = false exit sub activesheet.querytables.add(connection:="text;" & path, destination:=range("a1")) .fieldnames = true .rownumbers = true .filladjacentformulas = false .preserveformatting = true .refreshonfileopen = false .refreshstyle = xlinsertdeletecells .savepassword = false .savedata = true .adjustcolumnwidth = true .refreshperiod = 0 .textfilepromptonrefresh = false ...

javascript - Suggestion box only displays , , -

i making mashup website involves map, , search textbox in javascript. title says, no matter inputted search box, 2 commas appear in suggestion box , when suggestion clicked on, turn map gray , unusable. whats problem? javascript file, function located in configure function // google map var map; // markers map var markers = []; // info window var info = new google.maps.infowindow(); // execute when dom loaded $(function() { // styles map // https://developers.google.com/maps/documentation/javascript/styling var styles = [ // hide google's labels { featuretype: "all", elementtype: "labels", stylers: [ {visibility: "off"} ] }, // hide roads { featuretype: "road", elementtype: "geometry", stylers: [ {visibility: "off"} ] } ]; // options map // https://developers.google.com/maps/documentation/javascript...

html - Bootstrap row with columns of different height -

Image
i have like: <div class="row"> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> <div class="col-md-4">content</div> </div> now assuming that, content boxes of different height, same width - how keep same "grid based layout" , yet have boxes line under each other, instead of in perfect lines. currently twbs place next line of col-md-4 under longest element in previous third row., each row of items aligned clean - while awesome want each item fall directly under last element ...

python - how to make timer for quiting from python3 -

i have script , doesn't work proper, in bash let script in while loop , wanna script can close after while, tried use threading.timer code wont run quit() or exit() command, please me? #!/usr/bin/env python3 import threading time import sleep def qu(): print("bye") exit() t=threading.timer(5.0,qu) t.start() while(true): sleep(1) print("hi") you use os._exit function instead of exit() getting code follows: #!/usr/bin/env python3 import threading import os time import sleep def qu(): print("bye") os._exit(0) t=threading.timer(5.0,qu) t.start() while(true): sleep(1) print("hi") anyways suggest checkout this question similar yours.

mysql - Select data from the last complete row -

i have spreadsheet being migrated mysql database. in future spreadsheet won't filled in. data uploaded directly database. spreadsheet in 2 tables. one, called piles, contains info on product. other, called cubes, contains test results performed on products. sample data 2 tables below: piles: +----------+------------+---------+-----------------+ | id | date | mouldid | stockcode | +----------+------------+---------+-----------------+ | 23a42895 | 2017-06-09 | 23a | 250cdj09.0/0412 | | 23b42895 | 2017-06-09 | 23b | 250cdj07.0/0412 | | 642895 | 2017-06-09 | 6 | 250cdj09.0/0412 | | 8642895 | 2017-06-09 | 86 | 250cdj07.0/0412 | | 842895 | 2017-06-09 | 8 | 250cdj09.0/0412 | +----------+------------+---------+-----------------+ cubes: +---------+------------+-------------+---------+ | id | date | conctotalm3 | mouldid | +---------+------------+-------------+---------+ | 2342895 | 2017-06-09 | 18.1 | 23 | | ...

continuous integration - Build .net standard 1.4 class library TFS 2015 on premise -

we building web api application xamarin forms app. included .net standard class library project use view models. idea being build out web api endpoints - publish updated class library our internal nuget server. our ci failing. when check in code - getting build error (using tfs 2015 on premise). first error received the default xml namespace of project must msbuild xml namespace. if project authored in msbuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" element. if project has been authored in old 1.0 or 1.2 format, please convert msbuild 2003 format. so added xml namespace csproj now this: there no target in project. which version of visual studio use? can build project locally vs or build msbuild in command line? anyway, based on error message, seems related version of vs created project , msbuild version (new .csproj project format applied in vs 2017). can reference below threads troubleshoot iss...

css - Transitions won't work when transform:translate3d combined with opacity -

Image
on website have second header drifts down top when user scrolls down page. original header remains absolutely positioned @ top , scrolled out of sight second slides down. due google chrome bounce scroll effect, if user scrolls when browser @ top of page, they're able see second header hanging around outside document. looks strange, , happens in chrome. i've been trying make second header invisible when user scrolls top , slides out of view. have been attempting opacity value of 0 set ease value. problem is, using transform:translate3d animate slide-up / slide-down effect, , can't both opacity , transform work in same transition rule. ideally i'd following work, won't reason. .hidden-header { position:fixed; transform:translate3d(0,-100%,0); background-color:red; width:100%; height:55px; opacity:0; transition: translate 0.3s, opacity 0s ease .3s; } body.header-dropdown .hidden-header { transform:translate3d(0,0,0); opacity:1; tra...

enterprise guide - SAS function to remove data if the month matches between 2 dates in 2 set of columns -

i have large data dates on 2 columns (15 years data). looking remove date if month between 2 columns match (dont care day or year) ex: 01feb2006 - 01feb2017 need remove date month matches while 16feb2006 - 23jun2017 doesn't therefore need new column difference 4 months. if difference +/- 30 days between 2 months, have removed ex: 01jan2005 - 20dec2014. please help! still learning sas. in advance help. okay. question bit unclear. i've deduced question has number of potential questions: "delete obeservations have matching months" this may obtained using month function. (or if date string substring.) http://support.sas.com/documentation/cdl/en/lrdict/64316/html/default/viewer.htm#a000197966.htm data refined; set begin; month1=month(date_var1 ); month2=month(date_var2 ); if month1= month2 delete; run; "i need new column difference 4 months." intck if friendly function here. can calculate timedifferences between dates. h...

dockerfile - multiple binaries in a docker container based on scratch -

i have spec container requires 2 binaries executed 1 after other. prefer inherit scratch image container no larger sum of 2 executables. obvious way accomplish inherit alpine or other small os i'd prefer scratch. also, cmd, run , exec commands in dockerfile seems require shell , scratch not option. building 2 containers , docker swarm interesting not answer. i'm not entirely sure question here, here few ideas. first, correct run requires shell, doesn't sound need that. have 2 binaries, we'll call file1 , file2 , , need copy image: from scratch copy file1 /file1 copy file2 /file2 if wanted run single executable, life simple. cmd not require shell, add: cmd ["/file1"] using json version of cmd means binary executed without shell. while running single command easy, fact want run 2 different commands in sequence means need something handle workflow. easiest solution shell, because can run: cmd /file1;/file2 but if don't wa...

Delay or pause lynx -cmd_script execution -

i have need populate web form data using lynx -cmd_script functionality, hit button ( ^j ) , dump results ( -dump ) further processing. however, have make lynx pause 2-3 seconds , wait given web-form response, otherwise executes it's script , getting no results. how can that? thank you.

laravel 4.2 How to convert my php codes into laravel standards -

i'm trying convert php codes laravel standard, want add controller , render view. php code works fine it's function determine distance between 2 points. want convert php codes laravel standards, in simple way. knows how it? in advance. here's codes: <?php function getdistance($latrider,$lontrider,$latdriver,$londriver){ $earthradius=6371; $latfrom=deg2rad($latrider); $lonfrom=deg2rad($lontrider); $latto=deg2rad($latdriver); $lonto=deg2rad($londriver); $latdelta=$latto-$latfrom; $londelta=$lonto-$lonfrom; $angle=2*asin(sqrt(pow(sin($latdelta/2),2)+ cos($latfrom)*cos($latto)*pow(sin($londelta/2),2))); return $angle*$earthradius; } $latrider=11.707389; $lontrider=122.37194309999995; $latdriver=11.7105254; $londriver=122.36308980000001; $distance=getdistance($latrider,$lontrider,$latdriver,$londriver); echo"distance between rider position , driver position is:".$distance."km"; ?> the code...

javascript - AMP-friendly script for blogger ads -

assalamo alaicom, want modify following script become amp-friendly can use them in blogger template . should do make amp-friendly ? <div id='adsense-mohamed'><data:post.body/></div> <div id='adsense-algandy'> adsense code here </div> <script type='text/javascript'> function insertafter(addition, target) { var parent = target.parentnode; if (parent.lastchild == target) { parent.appendchild(addition); } else { parent.insertbefore(addition, target.nextsibling); } } var adscont = document.getelementbyid( & quot; adsense - algandy & quot;); var target = document.getelementbyid( & quot; adsense - mohamed & quot;); var linebreak = target.getelementsbytagname( & quot; br & quot;); if (linebreak.length & gt; 0) { insertafter(adscont, linebreak[1]); } </script> the second script:

ios - robovm codesign free provisioning -

i have problem run libgdx game robovm on iphone 5s. can run game on iphone simulator , fine there. want run game free provisioning created blank app in xcode bundle id same package main file in game. when try launch on iphone compiling fine , end info used identity , gradle crash. tried robovm 2.3.0, 2.3.1 , 2.3.2-snapshot the end of stack trace: 18:35:04.059 [info] [org.gradle.api.task] copying development provisioning profile: ios team provisioning profile: pl.umk.aimbug.game.ioslauncher (pc4sydxyfm.pl.umk.aimbug.game.ioslauncher) 18:35:04.075 [info] [org.gradle.api.task] code signing app using identity 'iphone developer: dzwonek@live.com (mj77rpean8)' fingerprint 1abdb5ae65be29badfe54ecba8658dbd89d533af 18:35:04.090 [info] [org.gradle.api.task] codesign -f -s 1abdb5ae65be29badfe54ecba8658dbd89d533af --entitlements "/volumes/robovm ram disk/tmp/users/lukasz/documents/projekty/aimbug/game + gameserver/ios/build/robovm.tmp/entitlements.plist" "/volumes/r...

amazon web services - Exporting AWS RDS tables or database to S3 bucket -

how can export rds tables s3 bucket? tried using data pipeline service export rds tables s3 getting following error. displaying policy below. warning: not validate s3 access role. please ensure role ('datapipelinedefaultrole') has s3:get*, s3:list*, s3:put* , sts:assumerole permissions datapipeline. here datapipelinedefaultrole: { "version": "2012-10-17", "statement": [{ "effect": "allow", "action": [ "cloudwatch:*", "datapipeline:describeobjects", "datapipeline:evaluateexpression", "dynamodb:batchgetitem", "dynamodb:describetable", "dynamodb:getitem", "dynamodb:query", "dynamodb:scan", "dynamodb:updatetable", "ec2:authorizesecuritygroupingress", "ec2:cancelspotinstancerequests", "ec2:createsecuritygroup", "ec2:createtags", ...

c# - RabbitMQ not receiving messages when used with TopShelf as a Windows Service -

i'm trying convert rabbitmq micro-service windows service. have used topshelf conversion. rabbitmq micro-service works fine on own when run service no longer receives messages. in public static void main(string[] args) have: hostfactory.run(host => { host.service<personservice>(s => { s.constructusing(name => new personservice()); s.whenstarted(tc => tc.start()); s.whenstopped(tc => tc.stop()); }); host.setdescription("windows service provides database access totables."); host.setdisplayname("service"); host.setservicename("service"); }); } then in personservice class have public void start() { consumeme...

SQL Update 2 Columns from 1 Case -

i have code selects price based on logic. our choices target margin, average historical price, , market price (and these have been calculated). sometimes, want ignore logic , explicitly "for model, please use price, instead of might've picked". hold price used. sets price no problem: update set [price] = case when [logic override] = 1 [target margin price] when [logic override] = 2 [average historical price] when [logic override] = 3 [market price] else [price] end pricetable ([logic override] <> 4 , [logic override] not null) , [model_id] = coalesce(nullif(@modelid, ''), [model_id]) what want able set [pricing method]. must create whole new case statement when want set both price , pricing method to, say, $20 , 'target margin', respectively, if logic override 1? can't seem right syntax this. you can create multiple sql logic in columns (as long trying update same table). your desired results confusing , not...

java - When using the Liberty Bells feature is there a way to order the loading ServletFilters? -

i using bells feature in liberty , wondering if there way order servlet filters dynamically added? i know can done via web.xml configuration, kind of defeats purpose of using bells. i have meta-inf/services/servletcontextintializer file initializer class defined there , overriding onstartup() method. these 2 filters applicable same url mappings. i use dynamic.addfilter() method add filter, there way add filters way , have them ordered? thanks!

xcode6 - Best way to create a xcode layouts grid -

Image
i new xcode, feel confortable using android studio , way work layouts , framelayouts. how can achieve distribution, of buttons? i tried each button elemnt . can buttons inside view? i quite new xcode let me give try. can create horizontal stack view, indeed 4 of them, 1 per row, , add buttons inside it. stack views contain 2 buttons each. then, can join them creating vertical stack view of 4 horizontal stack views, creating whole stack, buttons live. here created calculator keypad using exact method

Android Studio 3.0 Compile Issue (Cannot choose between Configurations) -

issue latest 3.0 build (beta 2) project has 1 sub module 3rd party have access build.gradle. my project has 3 flavours, snap, uat, production. each has 2 build types, debug , release. when try build this. error:cannot choose between following configurations of project :lp_messaging_sdk: - debugapielements - debugruntimeelements - releaseapielements - releaseruntimeelements of them match consumer attributes: - configuration 'debugapielements': - found com.android.build.api.attributes.buildtypeattr 'debug' wasn't required. - found com.android.build.gradle.internal.dependency.androidtypeattr 'aar' wasn't required. - found com.android.build.gradle.internal.dependency.variantattr 'debug' wasn't required. - found org.gradle.api.attributes.usage 'java-api' wasn't required. - configuration 'debugruntimeelements': - found com.android.build.api.attributes.buildtypeattr 'debug...

dataframe - R data.table: How to sum variables by group based on a condition? -

let's have following r data.table (though i'm happy work base r, data.frame well) library(data.table) dt = data.table(category=c("first","first","first","second","third", "third", "second"), frequency=c(10,15,5,2,14,20,3), times = c(0, 0, 0, 3, 3, 1)) > dt category frequency times 1: first 10 0 2: first 15 0 3: first 5 0 4: second 2 3 5: third 14 3 6: third 20 1 7: second 3 0 if wished sum frequencies category, use following: data[, sum(frequency), = category] however, let's wanted sum frequency category if , if times non-zero , not equal na ? how 1 make sum conditional based on values of separate column? edit: apologies obvious question. quick addition: if elements of column strings? e.g. > dt category frequency times 1: first ten 0 2: first ten ...

osx - Using pip modules in python Mac OS -

Image
i having trouble using installed packages on mac. have attached picture terminal code. any appreciated! running python 3 framework you have make sure have proper python 3 packages installed. pip3 install pandas pip3 install quandl then try running script again. looks installing python 2 packages (see ... versions/2.7 ... in output. you can try which pip see pip application being run , check version pip --version . running conda conda serves package manager (similar pip ) virtual environment (similar virtualenv virtualenv docs ). if running in conda environment, should install package dependencies conda (not pip ). installing dependencies conda with conda can install package dependencies when first create python environment: conda create -n my_env pandas quandl or can add packages existing environment: conda install -n my_env2 pandas quandl conda solution make new conda environment conda create my_solution pandas quandl activat...

C - Pass and operate on char pointers and pointer-to-pointer -

as novice c language fighting pointers, specially double pointers. my intention malloc char pointer in main pass malloced pointer different functions get result of each function within same pointer free pointer in main this code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> void process1(char **pointer) { //this should take , change pointer value x (*pointer)[0] = 'x'; (*pointer)[1] = '\0'; } void process2(char **pointer) { //this should take pointer, free , null it, new malloc , set pointer value y char* p = *pointer; free(p); p = null; p = malloc(sizeof(char)*2); p[0] = 'y'; p[1] = '\0'; *pointer = p; } void main() { char* p = malloc(sizeof(char)*2); p[0] = 'a'; p[1] = '\0'; //should print printf("%s\n",p); process1(&p); //should print x printf("%s\n",p); p...

python - 'BluetoothSocket' is not defined -

i trying set bluetooth server on raspberry pi using python. have error 'bluetoothsocket' not defined , however, followed sample code on bluez repository . however, have installed required libraries. from bluetooth import * server_sock=bluetoothsocket( rfcomm ) server_sock.bind(("",port_any)) server_sock.listen(1) port = server_sock.getsockname()[1] uuid = "94f39d29-7d6d-437d-973b-fba39e49d4ee" advertise_service( server_sock, "sampleserver", service_id = uuid, service_classes = [ uuid, serial_port_class ], profiles = [ serial_port_profile ], # protocols = [ obex_uuid ] ) print("waiting connection on rfcomm channel %d" % port) client_sock, client_info = server_sock.accept() print("accepted connection ", client_info) try: while true: data = client_sock.recv(1024) if len(data) == 0: break print(...

queue - Jenkins - How to pause queued job's runs and let a new build take priority -

Image
jenkins version. i have 2 versions: 1.642.3 or 2.32.3 i have jenkins job joba . let's assume job deploys artifact target deploy server. it takes 2 parameters, artifact name , target deploy server. execute concurrent build disabled i.e. not check marked. assuming launched multiple builds on job manually -or via jenkins cli -or via rest api way (i.e. via automation/integration/parent upstream job calling job). i see, there 1 jenkins build in-progress -and- other n no. of runs in " queued " mode. let's assume have close 100+ such builds in queue (ready launched in-progress 1 completes), i'm trying see if there's way can pause existing queued builds ( ps: not want cancel them) and launch new build (which want deploy urgently) , once that's done, unpause queued builds (so i don't have cancel of them and re-submitting/re-building them again remembering parameters passed -- artifact name , target deploy server). my 3 conditions...

Python ascii.read tab(?) delimiters -

i trying use ascii.read scan in large number of tabulated data files. column headings not appear have self-consistent delimiters. there range 2 7 spaces between each column header. files looks this: k waveln neff geom alb bond/qfit bond/geom q-fitted 1 0.3000000 0.0556723 0.0000000 0.0000000 2.1435934 2.0582306 [...] [...] i first suspected treat them tabs, not appear case: raw = (ascii.read('filename', delimiter='\t') will read file returns quite useless single column of data. now, not problem under normal cases - simple delimter='\s' could have done trick. frustration, 1 column named "geom alb" - complete space in middle. fouls delimiter, thinks 2 column headers, not one: raw = (ascii.read('filename',delimiter='\s') inconsistenttableerror: number of header columns (8) inconsistent data columns (7) @ data line 0 this solveable replacing "geom alb" header "geom_al...

reporting services - Looking for SSRS filter which is identical to the SQL "IN" clause -

i attempting set conditional format 1 of fields in ssrs report. basic formatting change font color. original expression in report builder: =iif(fields!delta.value < iif("ex1"=fields!id_name.value ,0.95 ,iif("ex2"=fields!id_name.value ,0.988 ,0 ) ) ,"red" ,"black") however, have on 100 different "id_name" values share common "delta" values. i wondering if there similar in clause in sql allow me paste "id_name" values inside ('','','') format easier? this: =iif(fields!delta.value < iif(fields!id_name.value in ('ex1','ex2','ex3','...') ,0.95 ,iif(fields!id_name.value in ('ex4','ex5','ex6','...') ,0.988 ,0 ) ...

ios - Two user types in Swift -

i trying make app 2 different user types. there 2 different home screens want route depending on type of user logging in. not able either user type respective home screen. edit: updated code @ibaction func signinbuttonpress(_ sender: uibutton) { //check if email , password fields filled , todo- valid if let email = emailtextfield.text, let pass = passwordtextfield.text { //sign in user firebase auth.auth().signin(withemail: email, password: pass) { (user, error) in //check user not nil if user != nil { let userid = auth.auth().currentuser?.uid self.ref.child("users").child(userid!).child("accounttype").observesingleevent(of: .value, with: {(snapshot) in if let accounttype = snapshot.value as? string{ // have retrieved account type // segue if accounttype == "user1"{ ...

html - Where to put the link in this code for the subscribe button? -

i found code template want use newsletter sign form. can't figure out put link in code subscribe button. don't want have create new button. have tried using action code href. <div class="span4"> <div class="p30"> <h3>newsletter</h3> <form class="soundest-subscribe" style="width: 100%;"> <input type="text" class="soundest-subscribe-input" placeholder="enter email address" style="width: 100%; height: 34px; display: block; color: #a0a0a0; font-size: 14px; font-family: times new roman, ; padding: 6px; border: 1px solid #cfcfcf; outline-width: 0px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;" /> <input type="submit" value="subscribe" style="width : 100%; height: 34px; display: block; color: #ffffff; font-size: 14px; font-weight: ; ...

database - Using alias with spaces in between in an SQL statement inside of ECLIPSE IDE -

resultset rs = stmt.executequery= (" select column1 string space ex employee name table1 condition1 = condition "); if use alias no space work, in case need alias spaces between words. how do when entire sql statement in string? the typical way use escape character. in other words, tell compiler follows part of string, not end of string itself. example, entering "she told me "i didn't hear you" face." compiled "she told me " plus nonsense i didn't hear you plus final string " face." escape characters, write "she told me ""i didn't hear you"" face." in case double quote, depends on compiler talking to. try this: resultset rs = stmt.executequery= (" select column1 ""string space"" ex employee name table1 condition1 = condition "); really though, recommend use underscores or no spaces. in experience, everything harder on , else works on after...

qt - Accessing Structure inside a structure in QML -

previously posted question on how access structures in qml , got perfect answers awesome people , need know there way access structure inside structure in qml , following code : //mynewstruct struct mynewstruct { q_gadget float m_range; q_property(float range member m_range) }; //mystruct struct mystruct { q_gadget int m_val; qstring m_name1; qstring m_name2; qstring m_name3; qstring m_name4; mynewstruct m_newstr; //**new struct declaration q_property(int val member m_val) q_property(qstring name1 member m_name1) q_property(qstring name2 member m_name2) q_property(qstring name3 member m_name3) q_property(qstring name4 member m_name4) q_property(mynewstruct newstr member m_newstr) //**currently getting error != cannot used }; the error getting in moc due operator " != " functionality still undefined. since these kinds of structure definitions required when building complex application/module that's thought of posting question here , the...

reactjs - Login with Google, using a Ruby on Rails API and React -

i'm current trying implement login google option make easier user login , create user. i have rails api uses devise login, , front using react makes requests rails 5 api. im not sure if have login on end or @ front end, greatest problem create user when login google, because cannot create user without password. i never created kinda of login system i'm not sure how works, believe have implement in end, using google oauth gem, wanna know if has tips how it. should use react components only? rails gems only? or both correct answer? thank you. i give direction archive this. first thing, have figure out grant flow going use in oauth provider. there 4 ways it, list common 2 ways. code grant flow (used in website omniauth-google or similar gem use way) implicit grant flow (native app, means have oauth flow in front-end) if going implement api server, should consider second way. because api server should stateless, first way need session save state ...

java - Applying a custom shape to android listview -

Image
hello trying apply custom shape , view android listview. works fine when there enough elements added listview have scroll see of them. if there less looks <listview android:id="@+id/recipe_list_view" android:layout_width="333dp" android:layout_height="163dp" android:layout_margintop="46dp" android:background="@drawable/shape" android:divider="@color/darkblue" android:dividerheight="10.0sp" android:gravity="center" android:textalignment="center" app:layout_constraintleft_toleftof="@+id/constraintlayout2" app:layout_constraintright_torightof="@+id/constraintlayout2" app:layout_constrainttop_tobottomof="@+id/imageview3"></listview> here shape in drawable <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient ...

python 3.x - E901, or TokenError: EOF in multi-line statement on repl.it -

i have been coding on website called https://repl.it . pep8 returning error @ last line: e901, or tokenerror: eof in multi-line statement`. i've tried rewriting section, redoing indents, , renaming variables. -edit- i've checked indentations , if statements, here new code. still pulling same issues. note not @ code , won't understand mean right of bat. try add comments code. from random import randint time import sleep advlist = ["crawl", "walk", "run", "sprint"] atklist = ["[a] punch", "[b] kick", "[c] magic"] restart = 1 myhp = 50 zomhp = 50 battle = 50 #game on screen if myhp <= 0: print("you died") print("game over") quit() #endless game function in range(0, reset): #traveling loop while battle > 5: print(advlist) trv = str(input("how advance?")) if trv == advlist[0]: sleep(8) myhp ...

Can't connect to Google Compute Instance VNC Server -

i followed tutorial: https://medium.com/google-cloud/linux-gui-on-the-google-cloud-platform-800719ab27c5 i opened ports in firewall. vncserver nc localhost 5901 rfb 003.008 ran vnc viewer (external-ip:5901) timed out waiting response computer

php - adLDAP group()->members() returns boolphp -

i trying use adldap list of members group, here documentation have used in past , swore worked. adldap wiki getting bool(false) output following: $checkquery = "select orgname, adgroup organization"; $stmt = $dbh->prepare($checkquery); $stmt->execute(); $data = $stmt->fetchall(pdo::fetch_assoc); foreach($data $row){ $groupmembers = $adldap->group()->members($row['adgroup'], true); var_dump($groupmembers); } the thing changed php versions, 5.6.0 7.1.7 , not working. have tested other functions within adldap such like: $usergroups = $adldap->user()->groups('usernamehere'); which returned groups. switched 5.6.0 , worked perfectly. running adldap 4.0.4 think latest according find. have suggestings on how working? explored using built in ldap functions couldn't find way recursive group memberships , can't remember if got simple group membership work. has been using adldap php 7.1.7 or php 7.0+ , got work? don...