Posts

Showing posts from May, 2013

javascript - Restricting The Viewing of Forms Per User -

please assist following: i'm trying restrict viewing of forms using bootstrap , meteor. in other words, user logs in , creates simple (or 2, or 3...) form using modal displays in html on panel. how ensure when user b logs in, sees particular forms , not "user a's" forms? i haven't included code haven't started working on problem yet. thank you. that's need deal using publications/subscriptions. see here , here learning ressources. basically, should happen when user creates form (or object), store collection along user id ( meteor.userid() ). subscribe publication in page send items belonging current user id. that should solve problem, , make ready similar (and common) cases need disclose selected information only, depending on context or user. moreover, means users able find items left in previous sessions.

android - Cannot resolve method 'openFileOutput(java.lang.String,int) -

a night before, implemented code snippet in android studio access file , write string in file.but how not able build sucessfully. don't know wrong "openfileoutput()" method. have tried adding context before openfileoutput() method, doesn't work , if not wrong must not. please me. here code part implementing snippet. package com.medaino.www.twitterapp; import android.app.listactivity; import android.content.context; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.widget.listview; import java.io.fileoutputstream; import java.io.objectoutputstream; import java.lang.string; import java.util.arraylist; import java.util.list; import android.view.view; import android.content.intent; public class tweetlistactivity extends listactivity { // private listview tweetlistview; private string[] stringarray ; private tweetaapter tweetitemarrayadapter; public list<tweet> getdataforlistview() {

javascript - What's the correct syntax for Data-Toggle Bootstrap on React.js -

so i'm new react , javascript in general, trying lay out how see in html el.button({ type: 'button', classname: 'navbar-toggle', data-toggle: 'collapse', // syntax error here data-target: 'navbar' // syntax error here }, el.span({ classname: 'sr-only' }, 'toggle navigation'), el.span({ classname: 'icon-bar' }), el.span({ classname: 'icon-bar' }), el.span({ classname: 'icon-bar' }) ), using purely js react.js from react docs on dom differences bit tucked away, "all dom properties , attributes (including event handlers) should camelcased consistent standard javascript style. intentionally break spec here since spec inconsistent. however, data-* , aria-* attributes conform specs , should lower-cased only." that helps determine cases, have correctly, since hypens not allowed javascript variable names default need quote identifiers. so, using exam

r - RStudio crashes when invoke file.choose() -

errors occur randomly when trying execute: myfile <- file.choose() mydata <- read.csv(myfile, header=false, sep=",") however mydata <- read.csv(file.choose(), header=false, sep=",") works stable. what's wrong first implementation? sessioninfo(): r version 3.2.0 (2015-04-16) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows 8 x64 (build 9200) locale: [1] lc_collate=english_new zealand.1252 lc_ctype=english_new zealand.1252 [3] lc_monetary=english_new zealand.1252 lc_numeric=c [5] lc_time=english_new zealand.1252 attached base packages: [1] stats graphics grdevices utils datasets methods base loaded via namespace (and not attached): [1] tools_3.2.0

xcode - How do I make the text of one label node take up 2 lines? -

i have text below long fit on screen when runs. how can make 2 lines rather one? mylabel.text = "the weather today going partly cloudy chance of rain" you can create own method display multi line text follow: import spritekit class gamescene: skscene { override func didmovetoview(view: skview) { displaymultilinetextat(cgrectgetmidx(self.frame) - 100, y: cgrectgetmidy(self.frame) + 50, align: sklabelhorizontalalignmentmode.left, lineheight: 20.0, text: "welcome stackoverflow!\nthe weather today going to\nbe partly cloudy chance\nof rain.") } func displaymultilinetextat(x: cgfloat, y: cgfloat, align: sklabelhorizontalalignmentmode, lineheight: cgfloat, text: string) { let textnode = sknode() textnode.position = cgpointmake(x, y) var lineat: cgfloat = 0 line in text.componentsseparatedbystring("\n") { let labelnode = sklabelnode(fontnamed: "arial") labelnod

vb6 - Excel file locked after opening in Microsoft Data Report Designer -

i develop application in vb6 , data source excel 2007. , have created 2 reports in microsoft data report designer . my program working. can save data (update)in excel file , view existing data via vb6. , have written code backup (copy paste) excel file in folder. working wanted. but after open or view datareports, cant save data in excel , backup excel file. have close application update , backup excel sheet. when try save data in excel file after viewing report receive message the excel file exists when try backup after viewing , closing report receive error message run time error 70" permission denied need please.

java - new Intent not starting from Service ( Tried all solutions from Google) -

here how activity defined in androidmanifest.xml file:- <activity android:name=".mydialog" android:launchmode="singletask" android:theme="@android:style/theme.dialog"/> how service defined :- <service android:name=".chatheadservice" android:process=":chathead"/> how call service:- intent intent = new intent(this, mydialog.class); intent.setaction(intent.action_view); intent.setflags(intent.flag_activity_new_task); startactivity(intent); still activity doesn't start ! please help. :) from inside service class intent intent = new intent(this, mydialog.class); intent.addflags(intent.flag_activity_new_task); startactivity(intent );

"Error inflating class com.android.internal.widget.ActionBarContainer" on some Sony devices -

i've got lot of error reports sony devices android 5.0.2 in past few weeks. seems arrayindexoutofboundsexception occurs when inflating actionbarcontainer . actionbarcontainer internal class, never used directly in code. line of code in stack trace call activity.setcontentview() . ideas? thanks. the stack trace: java.lang.runtimeexception: unable start activity componentinfo{com.my.app/com.my.app.mainactivity}: android.view.inflateexception: binary xml file line #31: error inflating class com.android.internal.widget.actionbarcontainer @ android.app.activitythread.performlaunchactivity(activitythread.java:2345) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2405) @ android.app.activitythread.access$800(activitythread.java:149) @ android.app.activitythread$h.handlemessage(activitythread.java:1324) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:211) @ android.app.activitythread.main(activitythread.java:5317

css - How to highlight text in chrome -

i highlight text in chrome conditionnaly. website using type of code each element on page , highlight lenght lower 1:00:00 <div class="entry_content"> <p> "title" <br> <a href="a link" target="_blank"> <img src="alink.jpg" alt="name"> </a> <br> size: 11111111 bytes (111.11 mb), duration: 00:11:11, avg.birate: 111 kb/s <br> audio: aac, 16000 hz, mono <br> video: h264, 320×240, 15 fps </p> </div> ps: know number don't add it's example ;) i if possible in css stylish dont know if it's possible , how make condition in css. thank help. i can't see way use css conditionally highlight element based on content. however, simple bit of javascript it: var divs = document.getelementsbyclassname("entry_content"); (var = 0; < divs.length; i++) { if (/duration:\s00:/.test(divs[i].innerhtml)) { divs

Convert Snort string to Python timestamp -

i'm using snort, generates timestamps in mm-dd/time format, such as: 06/18-19:31:05.688344 i want convert python timestamp, including current year. what's pythonic way? use datetime module's strptime function. >>> import datetime >>> datetime.datetime.strptime(str(datetime.datetime.now().year) + ... '/' + '06/18-19:31:05.688344', '%y/%m/%d-%h:%m:%s.%f') datetime.datetime(2015, 6, 18, 19, 31, 5, 688344)

javascript - how to make jquery autocomplete simplify -

i use jquery autocomplete , code, call plugin, not good. there more simple way call jquery autocomplete js $(document).ready(function(){ $("#m_occupation").autocomplete("search/moccupation.php", { selectfirst: true }); $("#foccupation").autocomplete("search/f_occupation.php", { selectfirst: true }); $("#g_address").autocomplete("search/g_address.php", { selectfirst: true }); $("#relationship").autocomplete("search/relationship.php", { selectfirst: true }); }); what you've got isn't terrible. if you're ever initializing these autocompletes 1 time, it's pretty readable overall, although have repetition. cache jquery objects future use. in snippet above, reference each jquery object (e.g., $("#m_occupation") ) once, in real webapp, there's pretty chance you'll use more. caching helps reduce number of jquery finding

android - How to add Ripple effect in RecyclerView -

Image
i add nice effect recyclerview items don't know start. if knows , simple tutorial on topic appreciate sharing me. here's library: rippleview hope helps. update library above buttons , pointed out. this library, rippleeffect , can have ripple effect views too.

compilation - How would a closed-source (i.e. precompiled) Swift library work without headers? -

in c, c++ , objective-c can compile part of executable own "object file" , use (and/or library containing multiple object files) other code including "header file". highly-templatized c++ code notwithstanding, "header" typically contains declarations needed validate correctness of calling code (and assist ide autocomplete, etc.). but swift not have header files. now, apparently not possible make swift static library, in future how situation above work, wanting use existing precompiled code "new" source code, given swift not have headers? would work how [i infer] java must work, compiled form can introspected enough compiler verify being used properly? bitcode in addition intermediate representation provide necessary "protocol" retaining such metadata? if apple port cocoa swift (and keep closed source), how "imported" swift apps? although, really, question not "closed source" per se rather trying unde

python - Django 1.8 'default' option only executes external function once -

i trying add uuid field existing table. specified default = uuid.uuid4 however, django doesn't seem call uuid.uuid4 function every row. when migrate keep getting duplicated uuid error. my django version 1.8.2 . from django.db import models, migrations import uuid class migration(migrations.migration): dependencies = [ ('conv', '0008_video_video_uri'), ] operations = [ migrations.addfield( model_name='conversation', name='channel_id', field=models.uuidfield(unique=true, default=uuid.uuid4, editable=false), ), ] below error: > > file "/home/yonk/projects/trailerapp/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", > line 64, in execute > return self.cursor.execute(sql, params) django.db.utils.integrityerror: not create unique index > "conv_conversation_channel_id_68f7d58df7c78d61_uniq" detail: key &

c# - Is there a way to call generic repository methods on an entity that was generated at run time with codeDOM? -

i using codedom generate entity classes @ run time. have generic repository deal various db functionality. here insert method example method in generic repository: public void insert<tentity>(tentity entity) tentity : class, ibusinessentity { if (entity == null) { throw new argumentnullexception("entity"); } tentity existing = existing(entity); if (existing == null) { _context.set<tentity>().add(entity); this._context.savechanges(); } } here example code of how generate entity class , how create entity based on entity class using codedom: //generate fields of new entity class entitygenerator.entityfieldinfo entityfield1 = new entitygenerator.entityfieldinfo("name", typeof(string), relationshiptype.norelation); entitygenerator.entityfieldinfo entityfield2 = new entitygenerator.entityfieldinfo("shape", typeof(string), relationshiptype.norelation); icollection<entitygenerator.entity

java - JButton ActionListener not responding -

Image
i couldn't find answer anywhere else online, came here. apologize in advance if mistake in code obvious; i'm still quite new java swing. here's what's going on: have created jbutton named toggleelevators , , want change text when clicked. have created actionlistener , added toggleelevators . want right jbutton change text when clicked click me clicked . first, here's picture of jframe looks when executed: note: there third class, purely drawing picture on left. has nothing gridlayout or jbutton. run class (created frame , adds toggleelevators jbutton: import java.awt.color; import java.awt.eventqueue; import java.awt.gridlayout; import javax.swing.jframe; public class run extends input{ input = new input(); public static void main(string[] args) { new run(); } public run() { eventqueue.invokelater(new runnable() { @override public void run() { jframe frame = new jframe("elevators"); fra

regex - Making Regular Expression SQL Anywhere -

Image
i'm trying make regular expression match specific strings. regular expression: (a[\s.avc]+) for example: i need words @ leading of string this: "aa", "aavv", "a.", "avenida", "a.v", "aa vv" but matches more words per line. idea i'm doing wrong? you can use special character ^ @ start of regex, finds occurrences start of line. more information here

appcompat - Android Support Toolbar Styling -

Image
i trying implement light theme of appcompat dark toolbar (action bar), when adding toolbar dynamically or using <include /> text fails display in correct color (black instead of white). default action bar styled correctly, when add toolbar not. here code: toolbar.xml <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" app:theme="@style/apptheme" android:layout_width="match_parent" android:layout_height="wrap_content" android:minheight="?attr/actionbarsize" app:navigationcontentdescription="@string/abc_action_bar_up_description" android:background="?attr/colorprimary" app:navigationicon="?attr/homeasupindicator" app:title="@string/action_settings" /> styles.xml <resources> <

javascript - Week schedule in FullCalendar -

i building scheduling application university, , view deals classes have dayindicator, starttime, , endtime. example of class: { title: 'chemistry', dayindicator: '0101010', starttime: '08:00', endtime: '08:50' } this needs broken 3 events on monday, wednesday, , friday (translation of 0101010). don't have dates imply repetition throughout semester. this weekly schedule week in entire semester. there way display such events without having worry date? i know can create moment() object, calculate day offset determine date, set hours , minutes, , set 'start' property, thats pain. wondering if there simple more straightforward way. thanks. for interested, ended doing: classes.foreach(function(class) { var dayarray = class.dayindicator.split(''); var start = class.starttime.split(':').map(number); var end = class.endtime.split(':').map(number); dayarray.foreach(function(d,i) { if

java - Swagger UI causing HTTP 406 Not Acceptable response for operations producing content types other than json -

i have rest api published jersey , documented swagger, have swagger ui installation consuming api. almost operations produce application/json , work expected, except 1 operation produces: 'text/plain;charset=utf-8' when try call service swagger ui, server logs javax.ws.rs.notacceptableexception , returns 406 response. if call same service rest client works expected. @get @path("/text") @produces(mediatype.text_plain + ";charset=utf-8") @apioperation(value= "return text") public response gettext(@queryparam("user") string user) { return response.ok(textservice.gettextforuser(user)).build(); } if change @produces(mediatype.application_json + ";charset=utf-8") works fine, don't want set wrong content type. the problem seems swagger ui wrongly setting accept headers application/json can seen observing request: get /supertext/text?user=1 ... accept: application/json when using rest client accept header are:

c# - DateTime.Parse Not Parsing -

i'm trying return date "2015-06-18" string strdate = datetime.now.tostring("yyyy-mm-dd"); datetime newdate = datetime.parse(strdate); this returns "2015/06/18 hh:mm:ss" what missing? if want particular output format, can specify 1 yourself. string strdate = datetime.now.tostring("yyyy-mm-dd"); datetime newdate = datetime.parse(strdate); string output = newdate.tostring("yyyy-mm-dd"); console.writeline (output); // produces 2015-06-18 right the datetime structure in .net includes time of day, , there no built-in way store date, if want exclude it, you'll need use formatting options.

Can't extend closure in Swift? -

flush excitement extending bool , thought fun extend closures in swift (we did no fuss @ in smalltalk, why not?). here's playground: typealias niladicclosure = () -> () extension niladicclosure { var theanswertolife:int { return 42 } } let block:niladicclosure = {} block.theanswertolife it doesn't work, saying niladicclosure not have member named 'theanswertolife' . looking in console, bit more information: playground execution failed: /var/folders/2k/6y8rslzn1m95gjpg534j7v8jzr03tz/t/./lldb/33726/playground119.swift:3:1: error: non-nominal type 'niladicclosure' cannot extended extension niladicclosure { ^ ~~~~~~~~~~~~~~ what non-nominal type ? there pattern/workaround? other similar questions predated swift 2, specific enough people offered workarounds specific extension. i'm interested in whether swift closures first class objects can add additional behavior to, other things in swift. what non-nomina

ios - How to make a dictionary of dictionaries in JSON? -

Image
right have structure in json "types":[ { "lowcadence":[ { "reinforcement":"-1", "weight":"100", "message":"pay attention. you're running low cadence. cadence %d steps per minute." } ] }, { "normalcadence":[ { "reinforcement":"0", "weight":"100", "message":"great, cadence on target. cadence %d steps per minute.", "enforcementsound":"ding" } ] }, { "highcadence":[ { "reinforcement":&quo

angularjs - getAttribute return unresolved -

i'm trying save attribute of input value variable. this code: var slidernumber = element.all(by.model('color.red')).get(1); var firstnum = slidernumber.getattribute('value').then(function(value) { return value; }); //some code changes slidernumber attribute expect(slidernumber.getattribute('value')).toequal(firstnum + 1); this gives me error this: expected '184' equal promise::433 ([[promisestatus]]: "pending")1. i've tried: var firstnum = function() { return slidernumber.getattribute('value').then(function(value) { return value; }); } that didn't @ all. how resolve promise? since .getattribute() returns promise, invoke callback asynchronously, need put test logic within callback: var slidernumber = element.all(by.model('color.red')).get(1); // initial value slidernumber.getattribute('value').then(function(value) { // once we've got initi

r - making a choropleth from SpatialPolygonsDataFrame- ggplot vs ggplot2 vs plot? -

i have shapefile, specifically, spatialpolygonsdataframe, called cdtract. contains 1 variable each district called varcount. varcount either "na" or 1. when plot(cdtract) ...i see map printed out don't see tracts '1' in varcount marked differently 'na.' ideally want have spectrum of values in varcount , see reflected in different colors. considered using ggplot according this post here resource intensive , might better use plot() instead of ggplot() create choropleth. i'm not sure how go it. using different shapefile states/countries not sure choroplethr package way go. can explain how take spatialpolygonsdataframe , turn choropleth, efficiently? thanks! shamefully taken ari's post on gis.stackexchange.com . see link pictures. there more examples here . library(sp) srs1 = polygons(list(polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))), "s1") srs2 = polygons(list(polygon(cbind(c(5,4,2,5),c(2,3,2,2)))), "s2") spdf

c++ - Why is std::cin outputting whatever is given to it? -

i've been working on learning c++, , 1 of first steps learning input , output. however, i've encountered issue where, when call std::cin , use put returned information variable, prints out whatever given it, whatever printed out on same line. code: #include <iostream> int main() { using std::cout; using std::cin; using std::endl; cout << "hello world" << endl; cout << "testing "; int x; cin >> x; cout << x; return 0; } returns: c:\users\...\learncpp.exe hello world testing this5 testing 5 5 process finished exit code 0 it's noteworthy when entered 5, directly next this, in "this5", though there should space there. then, once hit enter, prints out should look, "this 5". i've tried without space , same, , i've tried newline after "testing ", , prints 5 twice: c:\users\...\learncpp.exe hello world testing 5 5 5 process finished exit

wpf - UniformGrid and ItemsSource -

i have uniformgrid . inside, put grid contains 2 children - , image , canvas . have list<grid> member contains grid definition. i'm updating source of image null actual image, expecting image shown inside uniformgrid , nothing happens. here's code: xaml: <border grid.row="0" > <itemscontrol x:name="streamsitemscontrol" itemssource="{binding streams}"> <itemscontrol.itemspanel> <itemspaneltemplate> <uniformgrid x:name="streamsgrid" cliptobounds="true" height="300" /> </itemspaneltemplate> </itemscontrol.itemspanel> </itemscontrol> </border> viewmodel: private list<grid> m_streams = new list<grid>(); public list<grid> streams { { return m_streams; } set { m_streams = v

php - Opencart search and special pages image bug -

there error in product search , special offers page. when run product search , results (or check special offers page). put mouse on product image , get: "notice: undefined index: image_add in /home/database/public_html/catalog/view/theme/marcus/template/product/search.tpl on line 105notice: undefined index: image_add in /home/database/public_html/catalog/view/theme/marcus/template/product/search.tpl on line 115"... (also add pic of problem) code of part undefined index is: <?php if($product['image_add'] != ''){ $file_headers = @get_headers($product['image_add']); if($file_headers[0] == 'http/1.1 404 not found') { $exists = false; } else { $exists = true; } } if($product['image_add'] != '

C# How i use linq with explicit interface attribute? -

i have 1 class 2 inheritance interfaces , yours attributes explicits because both have equals attributes, so, need use linq class, can't access explicits attributes when use "select new foo" ... case: public class questaomontaprova : iquestao, iexercicio { public int discordo { get; set; } public int rever { get; set; } public int anotacao { get; set; } public int realizada { set; get; } public int ativo { set; get; } int iquestao.id { get; set; } string iquestao.enunciadoquestao { get; set; } string iquestao.exerciciotipo { get; set; } .... and linq : var flags = (from b in dt.asenumerable() select new questaomontaprova { idquestao = convert.toint32(b["id_questao"]), // can't access idtipoexercicio = convert.toint32(b["id_tipoexercicio"]),// can't access

netbeans - java - Sharing an executable .jar file -

i wrote program in netbeans, , want share coworker. however, when tries running on computer, gets error message: "could not find main class: excelcomparator.excelcomparator. program exit." here's confusing part: wrote on laptop has netbeans, , make sure worked, copied dist folder onto flash drive, , ran on computer. worked fine. when emailed coworker, got error. based on i've seen, solutions run .jar command line. while might work, need file double-clickable. i sent coworker file via email in zipped folder, possible unzipping entire folder messed .jar file (don't see why should, included might help)? this manifest.mf that's within .jar file. there carriage return @ end of file, doesn't copy text box: manifest-version: 1.0 ant-version: apache ant 1.9.4 created-by: 1.7.0_71-b14 (oracle corporation) class-path: lib/poi-3.12-20150511.jar lib/poi-examples-3.12-20150511.j ar lib/poi-excelant-3.12-20150511.jar lib/poi-ooxml-3.12-20150511.jar l

c - Zlib minimum deflate size -

i'm trying figure out if there's way calculate minimum required size output buffer, based on size of input buffer. this question similar zlib, deflate: how memory allocate? , not same. asking each chunk in isolation, rather entire stream. so suppose have 2 buffers: input , output , , have buffer_size , - say, 4096 bytes. (just convenient number, no particular reason choose size.) if deflate using: deflate(stream, z_partial_flush) so each chunk compressed, , flushed output buffer, there way can guarantee i'll have enough storage in output buffer without needing reallocate? superficially, we'd assume deflated data larger uncompressed input data (assuming use compression level greater 0.) of course, that's not case - small values. example, if deflate single byte, deflated data larger uncompressed data, due overhead of things headers , dictionaries in lzw stream. thinking how lzw works, seem if our input data @ least 256 bytes (meaning worst ca

mysql - Access denied for 'root'@'%' when loading files from my computer -

i've logged in , accessed database , can insert data manually newly created table when try load .csv file desktop error: "access denied user 'root'@'%' (using password: yes) i'm assuming means don't have access own files or something? stuck. keep in mind user root@% different user root@localhost . i'm assuming accessing server locally, trying gain access desktop machine. you need grant access desktop machine using grant command. i.e. grant on * . * 'root'@'%' identified 'password'

Perl: Static vs Package methods -

i need create package used other developers. best way implement static methods? static (class) methods must expect 1st parameter $class, , method must called class method: my::package->sub1(); from other hand can write "regular" package subroutine (no $class parameter expected) same, needs called differently my::package::sub1(); so, there no difference business functionality perspective (at least don't see it, except package name availability through first parameter), 2 different ways implement , call. kinda confusing. way should use , when? there rule? also, should check if method called expected (static vs package)? first, functional point: if 2nd class create inherits my::package , child::class::sub1() undefined, , if sub1 written non-oo subroutine, child::class->sub1() ignore fact it's being called child::class . as such, sake of programmers using module, you'll want make of subroutines in package/class respond consistent calli

c# - Cannot send a content-body with this verb-type with GET request -

i'm receiving request through webapi, , trying resend site. the goal receive request, example: http://localhost:9999/#q=test . , forward real site:(for test set google.com) http://google.com/#q=test i've following code: protected override async task<httpresponsemessage> sendasync(httprequestmessage request, system.threading.cancellationtoken cancellationtoken) { string url = request.requesturi.pathandquery; uribuilder forwarduri = new uribuilder(_otherwebsitebase); forwarduri.path = url; if (request.method == httpmethod.get) { //request.method = httpmethod.post; } request.requesturi = forwarduri.uri; request.headers.host = forwarduri.host; return await _client.sendasync(request, httpcompletionoption.responseheadersread);//_client httpclient } currently got system.net.protocolviolationexception states: cannot send content-body verb-type. but input request request(

java - maven exec plugin exception -

i getting following exception. how know command failing , why? [error] failed execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (xyz) on project abc: command execution failed. process exited error: 127 (exit value: 127) -> [help 1] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (xyz) on project abc: command execution failed. @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:216) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:108) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:76) @ org.apache.maven.lifecycle.internal.builder.singlethreaded.singlethreadedbuilder.build(single

How avoid error "TypeError: invalid data type for einsum" in Python -

i try load csv file numpy-array , use array in logisticregression etc. now, struggling error shown below: import numpy np import pandas pd sklearn import preprocessing sklearn.linear_model import logisticregression dataset = pd.read_csv('../bookie_test.csv').values x = dataset[1:, 32:34] y = dataset[1:, 14] # normalize data attributes normalized_x = preprocessing.normalize(x) # standardize data attributes standardized_x = preprocessing.scale(x) model = logisticregression() model.fit(x, y) print(model) # make predictions expected = y predicted = model.predict(x) # summarize fit of model print(metrics.classification_report(expected, predicted)) print(metrics.confusion_matrix(expected, predicted)) i got error: > c:\anaconda32\lib\site-packages\sklearn\utils\validation.py:332: > userwarning: normalize function assumes floating point values > input, got object "got %s" % (estimator, x.dtype)) traceback (most > recent call last): file >

ElasticSearch - Get extra field in aggregation -

i trying field aggregation. below query /iacmpi/_search?_source=false { "query": { "match": { "document_type": "invoicedoc" } }, "aggs": { "groupbycdminvoiceid": { "terms":{ "field" : "invoice_id" }, "aggs":{ "latestversion":{ "max":{ "field":"docversion" } } } } } } so @ level of invoice_id field aggregation, need fetch 1 more field 'name'. dont want in query part show me hits , have traverse hits , match. is possible? thanks, sameer i think top hits you're looking for.

JavaScript not returning expected regex results -

this question has answer here: why regexp global flag give wrong results? 4 answers i'm abstracting code bit going commercial product. i'm having trouble getting regex test return proper results. var files = [ "jurassic%20park%20-%20nedry.mp4", 'jeb%20corliss%20grinding%20the%20crack.mp4' ]; var filtersearch = function(text){ var filter = new regexp(text, 'gi'); var displayfiles = files.filter(function(file){ return filter.test( file.tolowercase()); }); console.log(displayfiles); } if run filtersearch('j') or filtersearch('n') i'd expect 2 results, jurassic park , jeb, instead i'm getting one. seems work other characters shared between 2 files, not j or n. know why isn't working me? thanks, edit: i'm able repeat on repl.it . use string.prototype.search() inste

ios - How to get an unabbreviated version of a CLPlacemark administrative area -

when call delegate method: func displaylocationinfo (placemark: clplacemark) { self.locationmanager.stopupdatinglocation() // find current state self.currentstate = placemark.administrativearea } the administrative area returns, example, ca instead of california. there anyway can make administrative area return full name instead of abbreviated version. appreciative!

android - Cannot change active text color on TabLayout -

i trying style tabs in android.support.design.widget.tablayout can not selected tab color change, set textcolorprimary in app theme, need them different colors. i have tried setting values in styles.xml applies tablayout, read can not change active tab text color way, though can change unselected tab text colors. have tried: tablayout.settabtextcolors(getresources().getcolorstatelist(r.color.selector)); and tablayout.settabtextcolors(r.color.green, r.color.blue); is possible override selected tab text color? edit: got working, tablayout.settabtextcolors(getresources().getcolorstatelist(r.color.selector)); needed called before attached view pager

html - Unwanted Margin Between Element - Unable to Remove -

there large 'white-space' between 'div: image' , 'div: slider' cannot account for. cannot see have coded margin between 2 elements , no matter seem stylesheet, cannot remove it. part of code causing this? , clean solutions there? many thanks. .wrap { margin: 0px auto; width: 80%; margin-top: 10px; padding: 3em 0em; position: relative; color: #fff; } .image { background-image: url("http://www.thestrandnyc.com/d/main/media/destination/__thumbs_1200_700_crop/ny_city.jpg"); background-size: 110% 100%; padding: 0px 0px 210px 0px; border: 1px solid red; } .slider { padding: 2em 0em; background-color: #f4f4f4; position: relative; height: 200px; margin: 0px auto; border: 1px solid red; } .slider p:first-child { color: #fff; background: #35afba; font-size: 2.8em; font-weight: 900; border-radius: 100%; width: 200px; height: 200px; display: inline-block; vertical-align: mi

excel vba - LookupConcat in Google Script -

i'm trying re-create xls macro in google script. macro works in xls not working in google sheets. i'm trying apply vlookup , concat functions together. i'm getting error message: missing ; before statement. (line 1, file "code") here below i'm using: function lookupconcat(byval searchstring string, searchrange range, returnrange range, _ optional delimiter string = " ", optional matchwhole boolean = true, _ optional uniqueonly boolean = false, optional matchcase boolean = false) dim x long, cellval string, returnval string, result string if (searchrange.rows.count > 1 , searchrange.columns.count > 1) or _ (returnrange.rows.count > 1 , returnrange.columns.count > 1) lookupconcat = cverr(xlerrref) else if not matchcase searchstring = ucase(searchstring) x = 1 searchrange.count if matchcase cellval = searchrange(x).value else cellval = uc

java - Can't pass in YAML Values using Spring -

i have config.yml file looks this --- name: archive: documentfiles: username: rafa password: hello my configuration looks this @configurationproperties(prefix = "name") public class yamlconfig { private list<string> servers = new arraylist<string>(); public list<string> getservers() { return this.servers; } } in test class, try first value list returned, returns indexoutofboundsexception know config.yml values, not passed in. can offer help? below test @runwith(springjunit4classrunner.class) @contextconfiguration(classes = {applicationconfiguration.class}) public class offlinefileviewerresourcetest { @test public void password(){ fileviewer = new offlinefileviewerresource(); yamlconfig yaml = new yamlconfig(); list<string> list = yaml.getservers(); assertequals("archive", list.get(0)); } } any of spring annotations (e.g. @configura

javascript - Show UI dialogs using data-popup attributes -

i using jquery ui dialog show more 1 popup on 1 page, each popup have own id , triggered anchor data-popup="" attribute. for example, <a class="popup-button" data-popup="#popup-a">popup a</a> will trigger popup has id #popup-a below js snippet put in attempted achieve this, however, reason lunches popups in page instead of requested popup. //popups $('.popup-button').each(function() { var popupid = $(this).attr("data-popup"); $.data(this, 'dialog', $(popupid).dialog({ modal: false, open: function(){ $(".dialog").addclass("dialog-opened"); $('.popup-close').fadein(); $('#falsemodal').fadein(); jquery('#falsemodal').bind('click',function(){ jquery('.popup').dialog('close'); }); }, close: function(){ $(".dialog").removeclass("dialog-opened&qu

doctrine2 - how to insert records into a table with Doctrine -

i using zf2 , doctrine project developing, , need create function takes of records select query , inserts or appends them table (or entity). doctrine documentation says querybuilder offers select , delete , update functionality, , remember reading somewhere insert , append not included because doctrine doesn't want lose control of related records might go missing updating 1 table has relationships others. how can use doctrine add group of records table? you can create enities records , push them db: foreach ( $records $record ) { $someentity = new sometable(); $someentity->setname($record['name']); $someentity->setfoo($record['bar']); $em->persist($someentity); } $em->flush();

javascript - Angular, UI Router, Nested Navigation, and Tabs Issues -

i'm trying build navigation system using angular, ui-router, , tabs. pretty have working, having strange behavior. there's top level navigation in form of navbar @ top. routing defaults 'dashboard'. @ same 'level' of 'dashboard' 'recordings'. inside 'recordings', there's secondary nav in form of tabs. 1 tab search form, other results set. when submitting form, should switch results tab. clicking on tabs should take corresponding view. , clicking on top level navigation (dashboard,logs) should take correct state. issues include: active state of tabs applies after clicking on tab twice. applies active inconsistent behavior top level navigation. requires 2 clicks well here's stripped down plunker of setup. plunker routing $urlrouterprovider.otherwise('/dashboard'); $stateprovider .state('dashboard', { url: '/dashboard', views: { 'main': { controller: 'das

CPU new features enabled in Linux kernel -

if cpu has new features, how linux kernel handle ? remembered, pae not need rebuild entire system , linux seems installing driver , things work. say, if cpu provides more execution modes, need rebuild entire system? if so, why pae not need rebuild while 1 may need? the types of new features linux kernel support without rebuilding kernel depend on instruction set , nature of features. since x86 provides direct means save processor state (as indicating how state exists), features add application-level state used new kernel. some isas provide software layer can independent of operating system; example, alpha had pal (privileged architecture library). such layer can abstract hardware operating system (somewhat how bios used), allowing operating system use software perform implementation-specific operations. obviously without isa-specified interface, linux extended support use of module provide similar abstraction. because linux open source there less incentive provide

Android Auto Backup Conflict Resolution -

android m introduced auto backup apps: https://developer.android.com/preview/backup/index.html how service handle conflict resolution? example: have 2 android devices linked same google play account, running same app; , app has different data on between 2 devices. when android backs data how google determine keep? tl;dr: both kept backup data app associated 1 specific device. if factory reset device henceforth considered new device. what means if have 2 android devices on same google account both have duplicated backup sets, independent of each other. next time go through setup-wizard on new device , add google account, have option restore either of 2 devices.

wordpress - Keeping robots.txt blank -

i have couple of wordpress sites , current google seo algorithm update site should mobile friendly ( here ) my query here follows, have written rule in robots.txt disallow crawling url's wp- user-agent: * disallow: /cgi-bin disallow: /wp-admin disallow: /wp-includes disallow: /wp-content/plugins disallow: /feed disallow: /*/feed disallow: /wp-login.php i don't want google crawl above url's. earlier working fine recent google algorithm update, when disallow these url's start giving errors in mobile friendly test ( here ). css , js behind wp- url's. wondering how can fix one. suggestions appreciated. if keep crawler away files page may , work different google looks visitors. google wants avoid. there no problem in allowing google access css or js files else can open html-source , read links can access them either. therefore google wants access css , js files used on page: https://developers.google.com/webmasters/mobile-sites/mobile-seo/common-mist