Posts

Showing posts from March, 2014

reactjs - Confirmation message after redirect in React/Redux -

i using react , redux , redux router , , redux form web application, , implement "edit" form. form lives under url /components/1/edit . when form submitted redirect /components/1 , display toast confirmation message. can redirect work hooking react-form's props.submitsucceeded , rendering <redirect/> tag. but not sure how propagate confirmation message displayed. ideally react/redux take on flash messages in ruby on rails.

java - HTML within JLabel doesnt show same result in Browser -

i have jlabel html formatted text in it. ultimatly im trying wrap lines within jtable. however, problem can simplified jlabel. html formatting within looks this: <html> <body style='width: 250px;'> <p style='word-wrap: break-word;'>some string</p> </body> </html> running in browser works expected, , long 1 word string, wraps want to. if put in jlabel so: import java.awt.borderlayout; import java.awt.dimension; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.swingutilities; public class htmlinlabelexample extends jframe { private static final long serialversionuid = 2194776387062775454l; public htmlinlabelexample() { this.settitle("html within jlabel"); this.setdefaultcloseoperation(jframe.exit_on_close); this.setlayout(new borderlayout()); this.setsize(new dimension(300, 100)); this.setlocationrelativeto(null); string html_1 =...

html - Two divs, one scrolls, other static -

i'm creating blog website top part displaying recent posts, , below part displays blog posts. have recent posts along side div show popular posts, social icons, etc. want happen have sidebar stay static alongside recent posts, , have recent posts scrollable. code have causes sidebar disappear. when take section out debug along css, works perfectly. when put together, sidebar disappears again. here relevant code works itself: /* relevant css */ .wrapper { position: relative; width: 100%; height: 100%; margin: auto; padding: 0; } .maincontent { top: 0; left: 0; width: 80%; height: 100%; } .sidebar { position: fixed; float: right; /*top: 200px;*/ left: 80%; width: 20%; height: 100%; z-index: 999; padding: 5px; } /* ============================================================================= index > recent posts ============================================================================= */ .desc...

java - Fail to connect to mysql when I using spring boot -

i want make web server spring boot, when try connect database, comes errors. here parts of code. @controller public class backgroundcontroller { private jdbctemplate jdbctemplate; @requestmapping("/rankinglist") @responsebody public string rankinglist(model model){ string sql="select username,score user;"; list<map<string, object>> list = new arraylist<map<string, object>>(); try { list = jdbctemplate.queryforlist(sql); }catch (exception e){ return e.tostring(); }//return "rankinglist"; } } here dependencies in pom.xml ; <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-jdbc</artifactid> </dependency> here p...

r - correlation matrix by group on a single column -

i have dataframe has single column want calculate correlation matrix for, group. each group has same number of rows, it's big dataframe don't want have cast wide due memory constraints. there way in r without having recast? ex: dt <- data.table(group=rep(1:100,each=100000), value=rnorm(100000*100)) some_corr_function_not_requiring_recast(dt, value, by=group) should return 100x100 matrix of correlations here's example smaller data , base r (without using data.table ). #data set.seed(42) dt <- data.table(group=rep(1:5, each = 20), value = rnorm(20 * 5)) 1 this works first obtaining list of unique elements group , running cor between value corresponding pairs of unique group . groups = unique(dt$group) sapply(1:length(groups), function(i) sapply(1:length(groups), function(j) cor(x = dt$value[dt$group == groups[i]], y = dt$value[dt$group == groups[j]]))) # [,1] [,2] [,3] [,4] [,5] #[1,] 1.0...

c# - Strange behavior of await -

i have async method this public async task<bool> fooasync() { return await somethirdpartylib.somemethodreturningboolasync().configureawait(false); } i have code invokes in loop: for (var = 0; < 10; i++) { ok &= await fooasync().configureawait(false); } in case hang process after 2 or 3 or amount of cycles. when change code to for (var = 0; < 10; i++) { ok &= await fooasync() .continuewith(t => { if (t.iscompleted) { return t.result; } return false; }) .configureawait(false); } the exact same code works. ideas? edit : changed sample code little bit show fooasync in principle. in reply given answers , comments: don't know somemethodreturningboolasync does. fact continuewith in fact nothing useful strucked me. your fooasync() despite name, doing work synchronously, since you're starting work on ui thread, continue of work on ui...

How to use custom DNS settings in Drone Docker plugin -

i using drone behind corporate proxy. when i'm building docker containers there, docker inserts correct search server dns addresses container's /etc/resolv.conf . however, when using docker plugin , search server patched whileas nameservers set default google nameservers ( 8.8.8.8 resp. 8.8.4.4 ). this breaks build corporate proxy dns address cannot resolved associated ip address. is behavior intended and/or there workaround allowing me connect internet through proxy? this can resolved providing docker plugin configuration dns server address. note example below uses dummy ip addresses; please replace actual ip addresses. pipeline: docker: image: plugins/docker custom_dns: [ 10.10.0.1, 10.10.0.2 ] if using enterprise edition can configure following global environment variable: - name: plugin_custom_dns value: 10.10.0.1,10.10.0.2 why necessary? why issue surface configurations , not others? , in these instances, why dns configuration not ...

java - bottomsheet stops between EXPANDED and HIDDEN -

i'm trying create bottomsheet that's either expanded or out of view - don't want anywhere in middle or peeking. here's xml: <linearlayout android:id="@+id/bottom_sheet" android:layout_width="250dp" android:layout_height="250dp" android:layout_gravity="center_horizontal" android:background="@android:color/holo_blue_bright" android:cliptopadding="true" android:orientation="vertical" android:elevation="10dp" app:behavior_peekheight="0dp" app:behavior_hideable="true" app:behavior_skipcollapsed="true" app:layout_behavior="android.support.design.widget.bottomsheetbehavior"> <textview android:id="@+id/delete_btn" android:layout_width="wrap_content" android:layout_height="wrap_con...

Connect mobile devices (iOS & Android) to VNC Server with QT / C++ and mirror display -

i've problem, i'm not expert of vnc but, i've installed http://www.karlrunge.com/x11vnc/ on rasperry, , connect him display. now, i'get display mirroring thought vnc, didn't found documents connect vnc server. target write code qt cross platform, connect on vnc server on rasperry , start mirroring on client devices (tablet or smartphone - ios & android). exist documentations ? thanks here, check out: http://amin-ahmadi.com/2016/09/23/full-featured-vnc-client-widget-for-qt/ this guy programmed custom view vnc clients in qt. looks that's need; if not, please more specific.

Angular-FusionCharts : How to fetching data from external .json file? -

ar app = angular.module('chartapp', ['ng-fusioncharts']); app.controller("mycontroller2", function($scope, $http){ $http.get('js/data.json').then(function(res,status,xhr){ $scope.countries = res.data; }); }); i want use above json chart data. $scope.datasource = { "chart": { "caption": "column chart built in angular!", "captionfontsize": "30", "captionpadding": "25", ........ }, "data": [ ] how can use "countries" json data chart above? many examples declare json inside "data:[]" , there anywhere use external .json file? hey can following: angular.module('plunker', ['ng-fusioncharts']) .controller('mainctrl', ['$scope', '$http', function($scope, $http) { const chartprops = { "caption": "monthly", ...

SQL access to an XL device using HTTP Post vb.net -

i working on project supposed pull data xl device central location. emailed company , said need make http post request , parse returned json. additionally said should make post request in format. post /sql-request.do http/1.0 content-length: 141 response_type=application/json&sql_statement=select sequence_number, start_time timeline_stream order sequence_number desc limit 5; i have put believe code vb.net, , response server. not requested table information. here code using. private sub webrequester() dim response httpwebresponse = nothing dim replystreamreader streamreader = nothing dim request httpwebrequest = httpwebrequest.createhttp("http://192.168.100.223/data/schema/expanded?response_type=application%2fjson&sql_statement=select%20*%20from%20intervals") dim postdata string = "test" dim data() byte = utf8encoding.utf8.getbytes(postdata) request.contenttype = "application/x-www-form-urlencoded" request.cr...

angular - Use JSON url to navigate/push to page -

i working on ionic2 app. have json file using , want set type or url param can use each element in list, navigate specific page in ionic2. tried like: [navpush]="{{ data.url }}" not work. tried like: (click)="gotopage({{data.url}})" not work either. i want able set page want navigate dynamically (read json), instead using separate functions each item in list like: gotopage() { this.nav.push(pagetonavigateto); } ionic provides example this. create new project this: ionic start name sidemenu (or manually select template sidemenu). in app.component.ts find example json array pages , function called openpage() . can use own project. or can right here , in github repository. if want use strings page navigation, need lazy load pages. here quick tutorial on how lazy load page: remove page declarations , imports app.module.ts , app.component.ts . you need create module.ts every page have (for example home.module.ts ). t...

c# - Gracefully closing a named pipe and disposing of streams -

i have two-way named pipe. i'm not sure how shut down gracefully, though, once i'm done - if close connection client side, server side throws exception when tries dispose of streamreader , streamwriter i'm using. i'm catching it, seems kludge job me. server side code: thread pipeserver = new thread(serverthread); pipeserver.start(); private void serverthread(object data) { int threadid = thread.currentthread.managedthreadid; log.debug("spawned thread " + threadid); pipesecurity ps = new pipesecurity(); securityidentifier sid = new securityidentifier(wellknownsidtype.worldsid, null); ps.addaccessrule(new pipeaccessrule(sid, pipeaccessrights.readwrite, system.security.accesscontrol.accesscontroltype.allow)); ps.addaccessrule(new pipeaccessrule(windowsidentity.getcurrent().owner, pipeaccessrights.fullcontrol, system.security.accesscontrol.accesscontroltype.allow)); log.debug("pipe security settings set [thread " + t...

javascript - How can you control who sees a button on a page using Meteor and React -

i building first application using meteor , react. have modal: import react, { component } 'react'; import { modal, button, tooltip, link, controllabel } 'react-bootstrap'; import reactplayer 'react-player'; import { browserhistory } 'react-router'; import { removecomment } '../../api/comments/methods.js'; var rand const handleremove = (_id) => { if (confirm('are sure? permanent!')) { removecomment.call({ _id }, (error) => { if (error) { bert.alert(error.reason, 'danger'); } else { bert.alert('comment deleted!', 'success'); } }); } }; const handleedit = (_id) => { browserhistory.push(`/comments/${_id}/edit`); } export class commentsmodaluser extends component { constructor(props) { super(props); this.state = { showmodal: false, }; this.close = this.close.bind(this); this.open = this....

How to build UI that support all screen sizes and devices in android -

Image
i'm trying develop android application i've been stuck while trying scale views in activity. in picture can see resolution-width 10px (it's make more understandable guys) @ both devices. size of screens differentiate 5 inch 10 inch . blue rectangle edittext want scale on different devices. so can see, edittext in both devices have same sizes different amount of pixels. want both devices same , have tried fix nothing seems work out me. (this example image draw show problem, second image try make , goes wrong) this i'm trying fixed: basically this, should work : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:weightsum="100"> <textview android:layout_width=...

ios - Use right to left UIScreenEdgePanGestureRecognizer on UITableView that has section indexes -

i want add uiscreenedgepangesturerecognizer uitableview can edge swipe right side go next screen in controller hierarchy. this works fine except when table view has section indexes shown on side. in case, section index area handles touches, can't swipe edge. able support both edge pan , section index tap , vertical pan functionality. i tried adding view on top of uitableview handle swipe, handles touches , table view no longer gets anything. okay, tried bunch of stuff , came non-ideal working solution. the first part of problem section index in own view subview of uitableview. captures touches or gesture recognizers might add uitableview. the second problem section index view not part of public api. so solution add uiscreenedgepangesturerecognizer section index view. the view instance of private class uitableviewindex. created uitableview extension: extension uitableview { var sectionindexview: uiview? { view in self.subviews { ...

Minimum API level required for non-Support Library android projects -

does know lowest minimum api level android projects don't require support libraries? 21 or 22 guess may wrong. don't need support library features future project. does know lowest minimum api level android projects don't require support libraries? api level 1. after all, support library did not come existence until after api level 11 shipped. developed android apps few years without such library.

legend - R stacked barchart label mismatch -

Image
i have molecular sequencing data of relative abundance (in %) of various phyla in 9 different samples , trying plot colour-coded barchart (where each phyla corresponds different colour). simple enough on excel, complete newbie on r, struggling quite bit. data in excel format (formated tabs), first line labels (e.g.sample name)- when plotting it, bar labels misplaced, not match, , r plots first line of excel file (the names) separate value (pictures attached). have far is: attach(data) data.1<-as.matrix(data) par(mfrow=c(1,1)) barplot(data.1, col=c("aquamarine3","azure2","blue2","brown3","cadetblue3","deepskyblue3","firebrick3","gold3","darkorange3","darkorchid3","darkseagreen","darkslateblue","darkviolet","deeppink4"), main=".", xlab="unit/treatment", ylab="% relative abundance") detach(data) legend("to...

bash - Extract multiple values between XML tags -

i have xml file tripadvisor page, , shows restaurants in specific area. i want extract 'cuisines' offered of restaurants in search result. of values stored between <a> , <span> html tags. for each restaurant, data stored between <div> tag, snippet of cuisines 1 restaurant shown below: <div class="cuisines"> <span class="item price">££ - £££</span> <span class="item cuisine" onclick="ta.restaurant_list_tracking.clicknonlinkedcuisine()">bar</span> <a class="item cuisine" href="/restaurants-g1096751-c7-whittlebury_northamptonshire_england.html" onclick="ta.setevtcookie('restaurant_details', 'restaurants_details_cuisine', '', 0, this.href);">british</a> <span class="item cuisine" onclick="ta.restaurant_list_tracking.clicknonlinkedcuisine()">pub</span> <span class="item cuisine...

Trying to find duplicate values in TWO rows and TWO columns - SQL Server -

using sql server, i'm not dba can write general sql. been pulling hair out hour now. searching i've found several solutions fail due how group works. i have table 2 columns i'm trying check duplicates: userid orderdate i'm looking rows have both userid , orderdate duplicates. want display these rows. if use group by, can't pull other data, such order id, because it's not in group clause. you use grouped query in subquery: select * mytable exists (select userid, orderdate mytable b a.userid = b.userid , a.orderdate = b.orderdate group userid, orderdate having count(*) > 1)

jquery - SOAP Service fails with AJAX call but works fine in SOAPUI -

Image
invoking soap service throws 404 error works fine in soap ui. somewhere found due cors problem set header 'access-control-allow-origin': '*' no luck below how calling service let _this=this; var webserviceurl = 'http://localhost:8082/ode/processes/ws_invocation.ws_invocationport'; var soapmessage = '<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.invocation.tps"><soapenv:header/><soapenv:body><ws:ws_invocationrequest><ws:input>1</ws:input><ws:input1>mohan</ws:input1></ws:ws_invocationrequest></soapenv:body></soapenv:envelope>' $.ajax({ url: _this.webserviceurl, type: "post", datatype: "xml", crossdomain: true, headers: { 'access-control-allow-origin': '*' }, data: _this.soapmessage, cont...

python - ARIMA modelling for more than 1 time series -

so data looks this date1 date2 date 3.....date n instance1 instance2 . . . i don't want build arima model instance1. want universal model takes instances consideration. found lot of examples show me how fit for date1 date2 date 3.....date n instance1 but none instances if believe time-series correlated , want take correlations account in forecast/simulation, should @ vector auto-regression models (var). here couple options in python: statsmodels pyflux if don't believe correlated, there's no reason can't loop through each time-series , apply arima model 1 @ time.

php - authorize.net hello world Charge Credit Card ERROR : Invalid response -

trying hello world example authorize.net work composer installed here json. identical example. { "require": { "symfony/console": "^3.3", "php": ">=5.6", "ext-curl": "*", "authorizenet/authorizenet": ">=1.9.3" } } the following cut & pasted ssh >composer update loading composer repositories package information updating dependencies (including require-dev) nothing install or update writing lock file generating autoload files the thing i've changed in hello world php example sandbox login id , transaction key , path vendor/autoload.php. what missing here example return other charge credit card error : invalid response solution problem rather simple. posting solution here pay forward. first, need basic working composer.json { "require": { "symfony/console": "^3.3", "authorizenet/authorizenet...

python - Django - Form FileField error "This field is required" -

i want add post form django project , i've got problem filefiled. here code: forms.py class postform(forms.modelform): class meta: model = post fields = [ 'author', 'image', 'title', 'body' ] models.py class post(models.model): author = models.foreignkey('auth.user') image = models.filefield(default="", blank=false, null=false) title = models.charfield(max_length=200) body = models.textfield() date = models.datetimefield(default=timezone.now, null=true) def approved_comments(self): return self.comments.filter(approved_comment=true) def __str__(self): return self.title if helps. set enctype="multipart/form-data in <form> thanks help. class post(models.model): author = models.foreignkey('auth.user') image = models.filefield(upload_to='path') title = models.charfield(max_leng...

php - Perform multiple simultaneous POST calls to the same API endpoint -

i trying perform multiple post rest call. the catch : doing multiple post calls @ same time. aware , have worked library guzzle haven't figured away properly. can perform get calls asynchronously nothing @ same level post calls. came across pthreads , read through documentation , bit confused on how start off. have compiled php pthreads extension. could advise how perform multiple post calls @ same time , able gather responses later manipulation? the below basic implementation loops , waits. slow overall. $postdatas = [ ['field' => 'test'], ['field' => 'test1'], ['field' => 'test2'], ]; foreach ($postdatas $postdata) { $curl = curl_init(); curl_setopt_array($curl, array( curlopt_url => "https://www.apisite.com", curlopt_returntransfer => true, curlopt_encoding => "", curlopt_maxredirs => 10, cu...

ios - Cannot asign value type '()' to type String? -

i trying information request using completionhandler. thing need array information other part of code , seems can't access it. here access data: private func loaduserdata(completionhandler: @escaping ([string]) -> ()) { // we're getting user info data json response let session = twitter.sharedinstance().sessionstore.session() let client = twtrapiclient.withcurrentuser() let userinfourl = "https://api.twitter.com/1.1/users/show.json" let params = ["user_id": session?.userid] var clienterror : nserror? let request = client.urlrequest(withmethod: "get", url: userinfourl, parameters: params, error: &clienterror) client.sendtwitterrequest(request) { (response, data, connectionerror) -> void in if connectionerror != nil { print("error: \(connectionerror)") } { let json = json(data: data!) if let username = json["name"].string, ...

javascript - jQuery document load not being called -

this question has answer here: why don't self-closing script tags work? 10 answers when click button nothing happens, can't find error: <html> <head> <script type="text/javascript" src="jquery-3.2.1.min.js" /> </head> <body> <script type="text/javascript"> $(document).ready(function(){ $("#btnsubmit").click(function(){ alert("button"); }); }); </script> <input id = "btnsubmit" type="submit" value="release"/> </body> </html> can give me hing? try code. <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(f...

sas macro - SAS: Most frequent value (Like a MODE) ties solved by recency? -

i have data this: data mydata; input id $ val $ date; datalines; 1 2010-12-01 1 b 2010-12-03 1 2010-12-04 1 b 2010-12-08 2 x 2009-10-01 2 x 2009-10-02 2 z 2009-10-03 ; run; i mode returned exists. id 1, however, doesn't have true mode. in case of ties modes not exist recent val break tie (as in id 1). desired output: id mode 1 b 2 x i tried proc univariate (which handles numeric modes, problem) gives dataset mode null; sas has correct not desired output. in datastep. code: proc univariate data=mydata noprint; class id; var val; output out=modetable mode=mode; run; output: id mode 1 2 x use idgroup proc means an example of statement can fount in identifying top 3 extreme values output statistics let extend example data little bit ; data myinput; infile datalines dsd delimiter='09'x; input @1 id 1. @4 val $1. @7 date yymmdd10.; format date yymmdd10.; datalines; 2 x...

css - How to make flexbox list elements maintain its height when same row items are taller? -

Image
this question has answer here: is possible flex items align tightly items above them? 5 answers make div span 2 rows in grid 2 answers i have flex list may have elements of variable heights. items on same row taller elements auto-grow row height. how can make them stay @ size, , element on bottom of them vertically align top. this happens: this want happen:

python - How to import a submodule relative to the caller? -

importing module can done in function, passed caller, take simple utility. def import_reload_or_none(name, reload=true): try: mod = __import__(name) if reload: import importlib mod = importlib.reload(mod) return mod except exception: import traceback traceback.print_exc() return none this works root-level modules, i'm not sure how done when function in module or when relative imports used. how function made work replace eg: from . import my_package_module try passing path module want import function example: def import_reload_or_none(name, reload=true, path=none): mod = __import__(path + '/' + name) if path not none else __import__(name) if reload: import importlib mod = importlib.reload(mod) return mod then, if want import relative path can use import_reload_or_none(my_package_module, path = '.')

powershell - How can I extract a string from a text file and rename a file with it? -

for project working on have thousands of forms (.pdf) need rename using contents within forms. so far, have run ocr on them , exported content text files. each pdf form has .txt file of same name containing information. use powershell (if possible) extract specific part of text file rename pdf file, not sure how can that. to give better idea of i'm working on, form contained in pdf , text files (ex-12345.pdf , 12345.txt) looks this- ~~~ constituency: xxxyyyzzz polling station: abc def ghi (001) stream: 123 ~~~ what need extract polling station name , rename pdf file that. "12345.pdf" -> "abc_def_ghi_(001).pdf" so need figure out how extract string between "station:" , "stream:" 12345.txt. make things bit more complicated, text files want extract string have irregularities when comes spacing. for example, previous form may in text file- ~~~ constit uency: xxxyyyzzz polling stat on: abc de f ghi (00 1) s tr...

glsl - Three.js ShaderMaterial shaders: What's the identity ("hello world") vertex and fragment code? -

i'm trying write custom shader three.js shadows, new glsl , having trouble getting started. think best approach start "identity" functions produce same shading default shadermaterial function , hack on those. can't seem work. here's i've tried: // vertex function void main() { gl_position = projectionmatrix * modelviewmatrix * vec4( position, 1 ); } // fragment function uniform vec3 shadowcolor; void main() { gl_fragcolor = vec4(shadowcolor, 1); } the uniforms provides black shadow color: uniforms: { shadowcolor: { type: 'c', value: new three.color(0x000000) } }, vertexshader: vshader, fragmentshader: fshader, side: three.doubleside, blending: three.additiveblending, transparent: true }); this produces nothing in way of shadow, though it's firing correctly, see, be...

mysql - SQL - Calculation with Union All and Join -

i have 3 sql tables, 1 each vendor. tables have 3 identical columns: (id), (spend), , (date). (id) stands product id. (spend) how spent on product. , (date) of transaction. thanks stackoverflow, able sort total spent on each product (id) including tables. here union statement works: select id, sum(spend) total ( select id, spend, date vendor1 date between '$datestart' , '$dateend' union select id, spend, date vendor2 date between '$datestart' , '$dateend' union select id, spend, date vendor3 date between '$datestart' , '$dateend' ) spendtotal group id order total desc now incorp...

typescript - GET http://localhost:4200/api/user/ 404 (Not Found) angular 2 -

Image
i have error when try login app have problems 404(not found) included... put lines of code , image of error..... please me fix issue . @injectable() export class authguard implements canactivatechild { loggedinuser: string; constructor( private localstorage: localstorageservice, private router: router ) { this.loggedinuser = localstorage.get('discogs-user') string; } canactivatechild(route: activatedroutesnapshot, state: routerstatesnapshot): boolean { if (this.loggedinuser) { return true; } this.router.navigate(['/login']); } } this login.component.ts subscribe import { component } '@angular/core'; import { store } '@ngrx/store'; import { router } '@angular/router'; import { observable } 'rxjs/observable'; import { mdlsnackbarservice } 'angular2-mdl'; import * fromroot '../../reducers'; import * user '../../actions/user'; import { discogsuser, userlogin } '../.....

Can we use Bootstrap to design Apache FreeMarker email template in Spring MVC project -

Image
i want design email template in spring mvc project , using apache freemarker template send email content. newuserregrequest.ftl (email template file in resource folder) <html><head> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"/> </head> <body> <h2>hi,</h2> <h3>new registration bidmanager development</h3> <div> first name : ${bmusermodel.firstname} last name : ${bmusermodel.lastname} country : ${bmusermodel.country} </div> <pre><a class="btn btn-default" href="https://stackoverflow.com/">accept</a> <a class="btn btn-default" href="https://stackoverflow.com/">reject</a></pre> </body></html> i have used bootstrap button classes don't know should keep c...

ruby - having trouble with creating new rails app -

i've created rails app simple "rails new filename", reason, i'm getting following error when attempt create new app: $ rails new powtr uninitialized constant appgenerator::config did mean? rbconfig i'm not sure means/where look. appreciated, thanks.

html - Use CSS to Modify Radio Buttons without Label fol="id"? -

i trying edit way radio buttons appear in css , trying label encompassing button , not using label function. in other words, don't want use this: <input type="radio" name="rb" id="rb2" /> <label for="rb2">hello</label> i want use this: <label><input type="radio" name="rb" />hello</label> the reason html dynamically generated , cannot create id or other field in input. when add css modify button/text doesn't work because requires label on text , "for" used. here css: .container{ display: block; position: relative; margin: 40px auto; height: auto; width: 500px; padding: 20px; font-family: 'lato', sans-serif; font-size:18px; border:2px solid #ccc; overflow-y: scroll; resize: both; } .container input[type=radio]:checked ~ .check { border: 5px solid #0dff92; } .container input[type=radio]:checked ~ .check::before{ backgr...

active directory - Listing users of all groups in a particular OU -

so trying list groups , users of groups in ou. can list groups under ou. i'm not sure how list users in groups well. ideas? i outputting csv. here have: import-module activedirectory $aduserparams=@{ 'server' = 'myplace.local' 'searchbase' = 'ou=my user groups, dc=myplace, dc=local' 'searchscope'= 'onelevel' # possible values: base, onelevel, subtree 'filter' = '*' 'properties' = '*' } $selectparams=@{ 'property' = 'name','displayname', 'description', 'emailaddress' } get-adgroup @aduserparams | select-object @selectparams | export-csv "c:\temp\mylist.csv"

python - Getting a list of arrays into a Pandas dataframe -

so have list of arrays in python: [[0, 1, 0, 1], [1, 0, 1, 1], [0, 1, 1, 1]] . make list of arrays pandas dataframe, each array being row. there way , in python? tried values = np.split(values, len(values)) split list of arrays multiple arrays (well, tried). , tried create dataframe df = pd.dataframe(values) . error came from. got "must pass 2-d input" error message. idea i'm doing wrong , how fix it? or easier way go this? thanks! no need splitting, etc. if have list of lists 2 dimensional (meaning rows have same number of elements), can pass dataframe constructor: data = [[0, 1, 0, 1], [1, 0, 1, 1], [0, 1, 1, 1]] pd.dataframe(data) generating expected: >>> pd.dataframe(data) 0 1 2 3 0 0 1 0 1 1 1 0 1 1 2 0 1 1 1

python - Jupyter method not allowed: why does this flag appear in my notebook menu? -

Image
i'm starting learn python , i'm following mooc using jupyter, seems great tool. it's composed of several questions, each 1 requiring write piece of code. i submit code on regulary basis know particular notebook works. have orange "method not allowed" flag top right on browser:                                        when click on it disappears while , come back. code chunks executed without error. how informations how solve issue ? edit : wasn't code written in notebook. see answer below. thanks :) i figured out case : this flag meant command jupyter menu somehow failed/was rejected (e.g. save & checkpoint @ moment login session had expired) when using automatic commands (e.g. auto-save), can appear randomly , hard understand it had no link code in notebook this i...

java - Converting this line of code to a for loop -

so in java, i'm trying execute: num [0]=list.get(2); num [1]=list.get(4); num [2]=list.get(6); num [3]=list.get(8); i have arraylist of integers called list , want put values in number indices starting @ 2 array of integers called num in indices 0,1,2,3,etc. problem is, i'm trying within loop i'm not sure how go it. here have: for (int i=0; i<list.size()-2; i++){ num[i] = list.get(i+2); } my problem here is, after incrementing i, arraylist goes next index instead of every other index. i've tried multiple variations of loop keep coming same problem. this should it: int max = list.size()/2; if(list.size()%2==0) max-=1; // prevents indexoutofbounds list lengths (int i=0; i<max; i++){ num[i] = list.get(i*2 + 2); }

git - Visual Studio: Pushed solution to Team Services but won't push submodule -

Image
i'm having trouble connecting team code because submodule did not pushed during initial commit. shows change needs committed, when try commit it, error says "fatal: unexpected sequence in commit output." i've looked everywhere , seems i'm 1 having problem. of course, team cannot pull code because not contain submodule. has else experienced before? for adding submodule git repo , push remote , should use these commands: git submodule add <sub repo url> git commit git push then submodule pushed remote repo successfully. to pull changes remote (including submodules) other developers: git pull git submodule update --recursive to clone remote repo submodules : git clone <url> --recursive or select recursively clone submodules using vs clone repo.

DynamoDB: How to fetch single item where attribute value is not in a given list of values? -

i understand query might inefficient since can involve full table scan in worst case, need fetch single item @ time. for example, have table containing values this: { id: 'bc63a25e-b92b-483e-9ad3-ad6d474dfae2', domain: 'xyz.com', template_url: `https://s3.us-east-2.amazonaws.com/bucket/some-random-url.html`, data_elements: { message_link: 'http://www.google.com' zodiac_sign: 'scorpio' } } i have gsi domain hash key. want fetch items table: where domain == 'xyz.com' , id not in <a list of ids> limit 1; how can achieve type of query ? checked documentation , see there in operator not find not in operator. i had same issue, , don't think can. need use key 'get' method , 'scan' method. alternative (i think) fetch items , string comparison on each , everyone. don't think need mention how incredibly expensive be. as mentioned, had deal same issue , ended changing data structure...

sublimetext3 - open HTML file from desktop directly into Sublime? -

Image
i have saved html file sublime desktop, saves web link, fair enough, understandable... but i'd know is there way open file desktop directly sublime, instead of browser i can right click , open - sublime text, annoying i've saved plain text, when open in sublime, no longer gives option open in browser. i assumed common question can't seem find anywhere, sorry if it's been asked , answered before! the main way set in os .html opened in sublime rather browser. (this changes default behavior though if ever want opened in browser have decide 1 want default , 1 okay right clicking , opening with) on mac os x can right click , go get info , select different app open with: option: for windows 10, see document: https://www.digitaltrends.com/computing/how-to-set-default-programs-and-file-types-in-windows-10/

r - create function to format a column in a dataframe -

i have date time i'm trying strip , clean. i'm not sure if there out of box this. i've done searching couldn't find anything. date format is.. 2017-01-01t01:36:17.000z reproducible example: startdate <- c("2017-01-01t01:36:17.000z", "2017-01-01t01:36:17.000z") num <- c(1,2) dataframe <- data_frame(num, startdate) i've fixed doing following require(dplyr) require(tidyr) require(lubridate) dataframe <- dataframe %>% separate(startdate , = c("newdate", "tail"), sep = "t") %>% mutate(newdate= ymd(newdate)) %>% select(-tail) what turn function can pipe when need to. i came following, haven't been able work. i've tried variations of separate_, , mutate_. still no luck. ztime <- function(df, datecol, newcol) { library(lubridate) library(tidyr) library(dplyr) df <- df %>% separate_(datecol, = c(newcol, "extra"), sep = "t") ...