Posts

Showing posts from July, 2015

android - How I set this List with Hashmap Datatype to a list view? -

i have list hash map data type , want set custom layout please guys me. m frustrated. public void showsongs(list<hashmap<string, string>> songs) { ...//what? list.setadapter(adapter); } use simpleadapter: ex. simpleadapter adapter = new simpleadapter(context, maps, r.layout.yourlayoutname, from, to)

c# - What is the easiest way to convert JSON into BSON in .net world -

i started working on mongodb. javascript client sending json string asp.net web api project. possible use json string directly , save mongobd? want know whether approach make sense ? i thinking of passing json client , on server side read string [system.web.mvc.httppost] public dynamic savedata([frombody] string data) { system.web.httpcontext.current.request.form[0] return null; } try this: string json = "..."; bsondocument.parse(json);

cordova - Rename Subfolders within the www-folder in Phonegap for Android, Windows Mobile and iOS? -

dear ladies dear sirs, i have short question pretty new phonegap , crossplattform programming. unfortunately created app many images , relations , changing css , html files affords time. additionally 1 knows editing causes creating new errors :-) thats why have question towards building/compiling phonegap. possible rename subfolders within www folder? i have css file on same "directorylevel" html file , images folder not called "img" images. can rename them within www-folder or should correct paths within html , css files? best regards dimitri petrik you can rename subfolders like. top level www folder , subfolders copied platforms (android, ios, etc) cordova cli automatically when calling command cordova prepare ios etc.. in short, can think of www folder regular web app folder.

mysql workbench not show columns - libglib2.0 issue -

i installed new version of ubuntu 14:10 , ran problem of mysql workbench , libglib. there guide on how fix it. read can downgrade libraries synaptic can solve problem. unfortunately, version 6.2.4 of wb not yet been published. the solution explained @ link https://www.notehub.org/2014/11/6/ok-so-here-is-the-entire-process-first-i

android - Run a progress dialog while an other process is running -

i trying run progress dialog while other process running, , can't it. the process want run this: public void onclick_editar (view view) { float porc; string repre; try{ porc = float.parsefloat(edit_porcentaje.gettext().tostring()); repre = edit_representante.gettext().tostring(); try { hilo hilo; hilo = new hilo(2, "update eleccion set porcentaje="+porc+", delegados='"+repre+"' id="+idd ); hilo.start(); while(hilo.isalive()){} hilo = new hilo(4, idd); hilo.start(); while(hilo.isalive()){} toast.maketext(this, "¡actualizada con éxito!", toast.length_short).show(); } catch(sqlexception e) { toast.maketext(this, "error: fallo en la base de datos", toast.length_short).show(); } }catch(exception e) { toas

jQuery carousel hide next and prev on first and last slide -

i'm new jquery , use jquery carousel. don't want use plugin. want ask how can hide next button, when on first slide , how can hide next butto, when on last slide. here demo http://jsfiddle.net/rglsg/24/ here jquery code $(function(){ var carousel = $('.carousel ul'); var carouselchild = carousel.find('li'); var clickcount = 0; var canclick = true; itemwidth = carousel.find('li:first').width()+1; //including margin //set carousel width won't wrap carousel.width(itemwidth*carouselchild.length); //place child elements original locations. refreshchildposition(); //set event handlers buttons. $('.btnnext').click(function(e){ if($(".carousel").find("li:eq(6)").text()!=14) { if(canclick) { canclick = false; clickcount++; //animate slider left item width carousel.stop(false, true).animate({ left : '-='+itemwidth

ruby on rails - Return error as a JSON response -

the question simple: return error controller json response: //controller def action1 # ..... return render(json: { status: :unprocessable_entity }) if !is_my_valid? # .... doing render(json: my_hash.to_json) end //view $.ajax({ url: 'some_url', //... }).done(function(data) { // gets here in case of error }).fail(function(jqxhr, textstatus) { alert("error: " + textstatus); }); so problem on html page, in case of error, callback function in .done() executed, not 1 in .fail() . how make .fail() ? send 500 http status code: render(json: { ... }, status: 500)

jquery - `console.log(responseText);` and `console.log(file);` not displaying any data -

i using following configuration dropzone. problem files uploading in server console.log(response); , console.log(file); not displaying content in console. remove link not added picture. <form action="uploadimages" class="dropzone" id="image-uploader" enctype="multipart/form-data"> <i class="fa fa-image" id="dzopen"></i> </form> <div id="media-upload-previews"> </div> dropzone.options.dz = { paramname: "file", maxfilesize: 10, url: 'uploadimages', previewscontainer: "#media-upload-previews", uploadmultiple: true, paralleluploads: 5, maxfiles: 20, acceptedfiles: "image/*,audio/*,video/*", init: function() { this.on("success", function(file, responsetext) { var response = jquery.parsejson(respons

ios - Xcode Storyboard not finding any custom classes -

im using custom segues , viewcontrollers in project. until not hooking storyboard viewcontrollers , segues custom ones worked usual. yesterday had force quit xcode. today when try change class of viewcontroller in storyboard view custom class xcode not give me autocomplete option, fill out manually. when simulate app , go the new viewcontroller error: "this class not key value coding-compliant key: button" button referenced outlet in view (i checked in connector inspector). other propsed solutions on stackoverflow problem did not solve me. looks me storyboard file broken or if single referencing outlet not work , storyboard not find of custom classes? have idea whats happening here?

forms - validate radio button before calling data-target -

on website im making kind of multi step form. each question had 2 possible answers (radio buttons) each question bootstrap accordion element. (only 1 visible @ time) when page loaded, first bootstrap accordion element open first question, each accordion element has next button, go the next accordion element. action of opening next data-toggle="collapse" data-target="#target" now want validate if answer givin before going next question. please me! stuck on days , cant find answers im looking for. below code of multistep form <form> <div class="testtitel 1 active">gemak</div> <div id="demo" class="collapse in"> <input type="radio" name="group1" value="1" class="radiostyle"> ik wil af van de administratie die hoort bij werkgeven. <br> <input type="radio" name="group1" value="2" class="radiostyle"> de a

c# - Reading an unfinished gzip file -

i creating file using cygwin bash script on remote: (echo $$ > tail.pid; exec tail -f -n+0 --retry fix.log) | gzip -c >> /faraway/log.gz at same time, on local machine, reading /faraway/log.gz in c# using: txtfilereader = new streamreader(new gzipstream(new filestream(@"log.gz"), filemode.open, fileaccess.read, fileshare.readwrite), compressionmode.decompress, true)); bool isdone = false; // set true when "done.txt" file appears signal log.gz completed while (true) // read until finished { if (!isdone) { if (txtfilereader.peek() == -1) // wait if file still being transferred { while (!file.exists(@"done.txt")) { thread.sleep(10000); } isdone = true; // goes wrong here when gzip closes on remote }

python - Contributing to SciPy -

i've never contributed scipy (or other python package, matter), have super simple code performs 2-d discrete cosine transform using existing scipy code 1-d discrete cosine transform. scipy has support 2-d (or n dimensional) fast fourier transform, not 2-d discrete cosine transform. looking @ scipy code on github, see of fourier-related code (everything in fftpack module) written in fortran, while code i've put in python (put overstatement -- it's 1 line). my question this: see code being pretty useful, , perhaps represents opportunity me contribute scipy. however, can't check boxes listed in scipy documentation regarding contributing code (e.g., don't have "test units", nor know is). how proceed in process of contributing? def dct2(x): """ x 2-d numpy array """ x = np.asarray(x, dtype=float) return fftpack.dct(fftpack.dct(x).t).t def idct2(x): x = np.asarray(x, dtype=float) return fftpack.i

xml - XSD attribut validation for MANY elements with the same name - not possible? -

hey guys, this situation: have xml-file containing many (>50) configuration-properties program. xml-content looks somehow that: <globalconfig> <configurationsettings> <property name="usecolors" value="true" visible="false"/> <property name="titlemenu" value="configurator" visible="true"/> <property name="informationtext" value="for information please read readme.txt" visible="true"/> [many more...] </configurationsettings> </globalconfig> wanted now, creating xsd-file validating stuff. each property corresponding value-attribute has different contenttype (with restrictions enums or regex), validation-rules content of value need adepted each case. case determined "name"-attribute i new xsd-topic, tried start with: <xs:schema attributeformdefault="unqualified" element

Python 3x class methods -

i'm learning basics of classes, , came basic code follows: class shape(object): def __init__(self, num_sides, type): self.num_sides = num_sides self.type = type class square(shape): def __init__(self, side_length): self.num_sides = 4 self.type = 'regular quadrilateral' self.side_length = side_length def perim(): return side_length * 4 def area(): return side_length ** 2 class circle(shape): def __init__(self, radius): self.num_sides = 1 self.type = 'ellipsis' self.radius = radius now, when type following: shape1 = square(5) shape1.perim() i following output: <bound method square.perim of <__main__.square object @ 0x0000000003d5fb38>> what this? how can python return perimeter of square? also, have question: class methods exist other __init__() , __str__() ? if so, can please list them can go off , research them? as shown, goin

javascript - How to pass a custom html tag in jQuery PrintArea -

i use jquery function printarea print part of page (some columns of table). if place selector class in 2 columns need print, this: <tr> <td class="printarea">content1</td> <td class="printarea">content2</td> <td>content3</td> </tr> the function print each column in 1 row: content 1 content 2 if place selector class tr instead, this: <tr class="printarea"> it prints every column in 1 single row: content 1 content 2 content 3 what need print 2 first columns in 1 row: content 1 content 2 does know how achieve this? first of hide rows in table show 2 columns in row using :lt selector in jquery. displays first 2 columns in below context $("table tr td").hide(); $("table tr td:lt(2)").show(); fiddle

php - DailyMotion Cloud API how to get an URL with referer strict security? -

i'm stuck dailymotioncloud api need sign url security levels on it geo-blocking allowing only: france referer strict allowing only: 1 domain (oxygenstream.fr) my code works don't know put security levels when signing url i'm supposed put in component [-<pub-sec-data>] here: https://www.dmcloud.net/doc/api/api-streaming.html#signing-a-url how supposed store de referer strict url , country in [-<pub-sec-data>] ? here code of cloudkey.php: https://github.com/dailymotion/cloudkey-php/blob/master/cloudkey.php here code: <iframe src="<?php require_once 'cloudkey.php'; $user_id = 'aaaaaaaaaaaaaaaaaaaaaa'; $api_key = 'bbbbbbbbbbbbbbbbbbbbbb'; $media_id = '5466232b947399290102cdb6'; $preset_id = '54662c7c06361d307810e3b5'; // player preset $preset_name = 'oxygenstream'; // preset name $seclevel = 32800 ; // need 2 security levels (country & referer strict) // 32800 = 1 &l

Calculate the percentage of zeros that I have in a column in R -

i have column of catch rate data in df (df$catch.rate) contains combination of decimal values , zeros. calculate percentage of 0 rows in whole column give me indication of contribution data. many thanks! sum(df$catch.rate %in% 0 ) / nrow(df) i suggest using %in% if have na values..... e.g. x <- c(0,na,1) sum(x == 0 ) / length(x) #[1] na

(Ruby) Counting in Loops -

could me out, please? i want write ruby code in such way when word "bye!" 3 times in row, terminates program. my code below quotes = file.readlines('quotes.db') puts = "what?" print ">" request = gets.chomp while request != "bye!" puts quotes[rand(quotes.length)] puts ">" request = gets.chomp end any amend code follow rules want? puts 'if type bye 3 times, program terminate' bye_counter = 0 loop input = gets.chomp if input == 'bye' bye_counter += 1 else bye_counter = 0 end break if bye_counter == 3 end

[Air ANE Java]How use FREObject in Thread? -

i want new thread load file.when complete call dispatchstatuseventasync , push frebytearray.but trigger frewrongthreadexception. only single thread? you can use fre* functions on main thread except dispatch status event function. normal process background operations following: trigger working thread frefunction store data in native types dispatch status event when working thread complete call frefunction retrieve native data freobjects any conversions between native , freobjects have done on main thread try keep minimum. michael

easy and clean puts in ruby -

i have situation, want debug in ruby. have output console "puts". following example: testvariable = 4 puts testvariable the output of course: 4 now have lot of outputs , therefore write this: testvariable = 4 puts "testvariable= " + testvariable the output then: testvariable= 4 now easy case hope shows question is. possibility exist??? testvariable = 4 prettyputs testvariable and output directly testvariable = 4 i hope understand, "problem" is? of course isnt lot of work write complete string down, want know if there fast , easy possibility? this duplicate to: ruby: getting variable name in short: can not name of variable, can put string or symbol name of variable want display def prettyputs(symb, the_binding) var_name = symb.to_s var_value = eval(var_name, the_binding) puts "#{var_name} = #{var_value.inspect}" end toto=1 prettyputs "toto",binding or prettyputs :toto,binding

forms - Hide label for input field -

i trying hide label specific field in _form.php without success. i have tried couple of variation like, none working: <?= $form->field($model, 'sample_text')->textarea('label'=>false) ?> and alternate code: <?= $form->field($model, 'sample_text')->textarea('label'=>'') ?> what right approach hide label? ok, found solution. <?= $form->field($model, 'sample_text')->textarea()->label(false) ?>

regex - How set Beyond Compare ignore summary comments .net -

i need beyond compare 4 compare code , not summary comments like /// <summary> /// instancia estática del contenedor. /// </summary> public static componentcontainer instance { { return componentcontainer._instance; } } /// <summary> /// inicializa la instancia estática del contenedor. /// </summary> public static void initialize() { if (!isinitialized) _instance = new componentcontainer(); } and other code: /// <summary> /// instancia estática del contenedor xx /// </summary> public static componentcontainer instance { { return componentcontainer._instance; } } /// <summary> /// inicializa la instancia estática del contenedor. /// </summary> public static void initialize() { if (!isinitialized) _instance = new componentcontainer();yyyy } the idea beyond compare show diferenc

java - Android Location Coordinates Low Accuracy Using 3G triangulation -

i using 3g location provider android application. onlocationchanged function , using if statement if(location.getaccuracy()<100){ //do stuff here. } this condition not being satisfied while being on 3g. guess 3g not providing enough accuracy. my question is: how accurate, on average, 3g location triangulation? suggest set value? that depends on multiple factors, signal strength, triangulation of 3g/4g towers... truth 3g not accurate gps is. more battery efficient. take on topic: android:gps coordinates different in 3g , wifi

WebFocus, two title columns and merging cells -

if have table in webfocus raport design +--------+---------+--------+---------+ | left_1 | right_1 | left_2 | right_2 | +--------+---------+--------+---------+ | v11 | p11 | v21 | v21 | +--------+---------+--------+---------+ | v12 | p12 | v22 | v22 | .... how such table syllabus column titles: +-------+-------+-------+-------+ | 1 | 2 | +-------+-------+-------+-------+ | left | right | left | right | +-------+-------+-------+-------+ | v11 | p11 | v21 | v21 | +-------+-------+-------+-------+ | v12 | p12 | v22 | v22 | .... thank you sorry delay of answer :) to rename columns, command. example: table file systable print name compute left1/a3 = 'v11'; 'left'; compute right1/a3 = 'p11'; 'right'; compute left2/a3 = 'v21'; 'left'; compute right2/a3 = 'p21'; 'right'; if recordlimit eq 10 end to put heading columns, can work across co

ios - why attributes properties in layoutAttributesForItemAtIndexPath does not get applied? -

if modified attribute property in layoutattributesforitematindexpath collectionview cell not modified -(uicollectionviewlayoutattributes *)layoutattributesforitematindexpath:(nsindexpath *)indexpath { uicollectionviewlayoutattributes *attributes = [super layoutattributesforitematindexpath:indexpath]; //this properties not applied attributes.zindex = 1; attributes.alpha = 0.5; return attributes; } but when moving properties modifications layoutattributesforelementsinrect gets applied: -(nsarray *)layoutattributesforelementsinrect:(cgrect)rect { nsarray *attributesarray = [super layoutattributesforelementsinrect:rect]; for (uicollectionviewlayoutattributes *attributes in attributesarray) { //this properties getting applied here attributes.zindex = 1; attributes.alpha = 0.5; } return attributesarray; } i'am applying uipangesturerecognizer on uicollectionview , want apply these properties on cell i'am dragging . i'am apple call

jquery - How to get a sum of column of GridView using JavaScript -

Image
i'm trying access column named time of gridview , calculate sum of whole column using javascript. i have this: so in report total want number 5, since entry right now. this definition of gridview: <div class="total"> <asp:gridview id="reportgrid" runat="server" autogeneratecolumns="false" datasourceid="sqlds" height="68px" width="813px" allowpaging="true"> <columns> <asp:boundfield datafield="date" headertext="date" sortexpression="date" dataformatstring="{0:mm/dd/yy}" /> <asp:boundfield datafield="name" headertext="team member name" sortexpression="name" /> <asp:boundfield datafield="projectname" headertext="projects" sortexpression="projectname" /> <asp:boundfield datafield="description

javascript - 'Gulp watch' event takes double the amount of time to compile less compared to normal 'gulp less' command -

i'm having issues gulp 'watch' less function in taking 2x longer compile less files compared individual less function. when use 'gulp less' takes average of 9/10 seconds [12:57:15] starting 'less'... [12:57:25] finished 'less' after 9.96 s however when use 'gulp watch-less', change file trigger watch function takes double time compared 'gulp less'. [13:03:43] starting 'watch-less'... [13:03:45] finished 'watch-less' after 1.31 s [13:03:48] starting 'less'... [13:04:06] finished 'less' after 18 s below gulpfile.js pulls in 'paths.json' i've got 5 different themes (names changed question) less file being used needs outputted relevant folder why use function 'updatedestfolder'. the way less imported change in base theme should update themes 2-5. /*jslint node: true */ 'use strict'; // require various plugins var gulp = require('gulp'); var watch

angularjs - Not displaying correctly by full-width-header-menu-footer use angular-material -

according official provide examples: full width, header, menu, footer header menu [flex-sm="33"][flex-md="20"] main [flex] footer use css angular-material.css ,but display wrong! make sure using latest version docs show latest versions docs. right seeing docs 0.6.0rc1 has several beaking changes/renamings 0.5.1 refer changelog fixes. if want full width header side menu , footer here correct markup 0.6.0rc1 <div layout="column" layout-fill> <div layout="row"> <span>your header</span> </div> <div layout="row" flex> <div layout="column" flex="33"> sidebar </div> <div flex="66"> main content </div> </div> <div layout="row"> footer! </div> </div> this basic layout replace header md-tollbar , si

sql - Database Recovery Model alter script error -

i trying deploy 1 of our server via teamcity (db project in vs 2012), getting error on staging server error sql72014: .net sqlclient data provider: msg 5069, level 16, state 1, line 5 alter database statement failed. error sql72045: script execution error. the executed script: if exists (select 1 [master].[dbo].[sysdatabases] [name] = n'$(databasename)') begin alter database [$(databasename)] set recovery simple rollback immediate; end any ideas appreciated. don't gloss on problem: understand it. it's because have sort of ha (you said mirroring in comment above, availability groups (for sure) or log shipping (i think) cause this) requires database in full recovery. when try set simple recovery, fails because can't set recovery model full such database. guard against checking environment you're deploying vs , act accordingly.

javascript - Wrap in special div tags -

i'm working template, have confused wrapping div tags on h2 , script : html: <style> .widget-title{ border:3px solid black; } </style> <div id="widget"> <h2>title 1.1</h2> <ul> <li>item 1.1.1</li> <li>item 1.1.2</li> <li>item 1.1.3</li> </ul> <br /> <h2>title 1.2</h2> <ul> <li>item 1.2.1</li> <li>item 1.2.2</li> <li>item 1.2.3</li> </ul> </div> <br /> <div class="footer"> <h2>title 2</h2> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> </div> <script type="text/javascript"> document.getelementbyid('widget') $('h2').each(function(){ var self = $(this); self.wrapall('<div class="widget-title" />'); }); </script> i want add tag

Is there a way to assess/measure the efficiency of code in java -

for instance, have 2 versions of simple count loop - both achieve same thing 1 more efficient (and presumably uses less memory) other. see below: code 1: int num; (num =0; num<10; num++){ system.out.println(num); } code 2: for (int num=0; num<10; num++){ system.out.println(num); } they compile identically , have identical performance , memory requirements. for proof @ compiled java byte code using javap -c <classfile> code: public static void a() { (int num = 0; num < 10; num++) { system.out.println(num); } } public static void b() { int num; (num = 0; num < 10; num++) { system.out.println(num); } } byte code: public static void a(); code: 0: iconst_0 1: istore_0 2: goto 15 5: getstatic #15 // field java/lang/system.out:ljava/io/printstream; 8: iload_0 9: invokevirtual #21 // method java/io/printstream.println:(i)v 12:

node.js - MongoClient.connect - Error: Could not locate any valid servers in initial seed list -

i trying connect mongodb using mongodb.mongoclient.connect() simple url connection string replicaset. when start server throwing error as error: not locate valid servers in initial seed list this code passing 3 mongodb server follows var mongoclient = mongodb.mongoclient; mongoclient.connect('mongodb://192.168.0.16,192.168.0.23,192.168.0.17/test', function(err, db) { if(err){ console.error("error! exiting... must start mongodb first"); console.log("the error :::::::::::::::", err); process.exit(1); }else{ console.log("connection successful"); } }); have done replica set also. have 3 servers 1 act primary , other act secondary.using rs.status(), can able see server working fine.but still receiving same error. mongodb version = 2.2.3 mongdb lib version = 1.3.18 { "set" : "rs01", "date" : isodate("2015-01-09t07:35:

jquery - Replace Flash Notice with Bootstrap Modal in Rails -

Image
so have page user clicks button , posts form , uploads pdf file in background. upon completion of posting form, flash notice appears saying pdf has been uploaded. i'd show modal instead of flash notice when background pdf upload complete. how can that? pages_controller.rb def send_pdf require "net/http" uri = uri('http://www.skillchest.com/users/receive_certificate') x = net::http.post_form(uri, params) puts x.body redirect_to pages_course_page_certificate_path, notice: 'you have sent pdf <u><a href=http://www.website>website</a></u>. login check out!'.html_safe ## how make above line show modal instead of flash notice? end course_page_certificate.html.erb <h1>congratulations! here certificate.</h1> <%= form_tag({controller: "pages", action: "send_pdf"}, method: "post") %> <%= hidden_field_tag(:end_date, @today) %> <% url = current_user.certificate.s3_o

ios - Implementing pre-roll video iAds -

in october 2014 apple announced pre-roll video new ad format iad https://developer.apple.com/iad/resources/implementing-iad-in-your-ios-apps.pdf however, there no official documentation on implementing them. format available yet , if how can implemented? check example working implementation of iad's prerolled video ads: #import "viewcontroller.h" @import iad; @import mediaplayer; @interface viewcontroller () { mpmovieplayercontroller *movieplayer; } @end @implementation viewcontroller -(void)viewdidload { [super viewdidload]; // preload ad [mpmovieplayercontroller prepareprerollads]; // create our mpmovieplayercontroller movieplayer =[[mpmovieplayercontroller alloc]init]; [movieplayer.view setframe: self.view.bounds]; [movieplayer setfullscreen:yes animated:yes]; } -(ibaction)playbutton:(id)sender { // add mpmovieplayercontroller our view [self.view addsubview:movieplayer.view]; // path of movie want p

ios8 - Autolayout constraints applied after viewdidappear on ios7 -

i have problem autolayout on ios 7. working on project in xcode 6.1, , screens created size classes (compact width, regular height). on ios 8 fine, on ios 7 looks constraints applied after view appears (i can see items jumping final positions). when writing log ios 8, viewdidappear , viewdidlayoutsubviews getting order: - viewdidlayoutsubviews - viewdidlayoutsubviews - viewdidappear, but ios 7 order like - viewdidlayoutsubviews - viewdidappear - viewdidlayoutsubviews. did have same problem , there solution this? tnx igor edit: didn't have time create test project this, after lots of hours of working, figured out problem in constraints pinned left , right positions of screen. , problem on ios7. used workaround: test if platform ios7, remove constraints pinned left , right positions of screen, , add new constraints left position , fixed width. this worked me, hope someone

python - Histogram returning inf values -

Image
i trying plot histogram of data, data looks quite ok me. however histogram not being showed, , returning inf values. not understand why. here doing: a sample of data plot: >>>y[0:20] array([ 9.03061197, 11.18613147, 10.20833309, 10.52459041, 12.35042774, 10.94318214, 11.47863285, 11.03543313, 11.51063833, 11.40573821, 10.91732319, 11.2765148 , 11.73077009, 10.19453873, 10.7591238 , 9.77956991, 9.7284345 , 11.8031496 , 11.11313849, 9.46416353]) then using matplotlib hist : >>> matplotlib.pyplot.hist(y,50) (array([-1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.]), array([ nan, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf,

Strange tomcat 8 and java 8 behavior during logout -

i had web application working tomcat 6.0.41 , java 1.7.0_60. migrated web app new server same version of java package tomcat 8.0.15 , java 1.8.0_25. the problem when several users logout in web app, logout not "working". when click on logout: 1. valueunbound called 2. valuebound called when click on logout button, logout working: 1. valueunbound called , i'm correctly logged out of app others users are. do know if there needed in tomcat or java configuration in order not have issue?

ruby - How to add custom name input field in rails simple_form_for -

@tech_data = tagnode.first outputs below object controller . p @tech_data #<tagnode _id: 5119dcf74054448e576f3392, parent_id: nil, parent_ids: [], name: "categories", path: "categories", _type: "tagnode"> i have form has fields name , _type , , category . object doesn't have field category . here's form = simple_form_for @tech_data, as: :techtags, :url => view_techtags_technologies_path, :remote => true,:method => :get,:html => {:id => "upsert_techtags",:data => {:spinner => "#tech-ui"}} |f| %label.pull-left type = f.input :_type, :collection => tech_types, :label => false, :input_html => {:class =>"chzn-select", :data => {:placeholder => "select technology type"}, :multiple => false} %label.pull-left name = f.input :name, :type=>"text", :required => true, :label => false, :placeholder =>"type new technology"

javascript - Set iPhone native popup's orientation -

i've built phonegap app iphone. in specific cases, landscape design , support required, , i've listened device orientation notifications, , had js app add '.landscape' css class rotated main container 90 or -90 degrees. js orientation handling easy , quick, problem native interface portrait-oriented. when native popups shown, they're in portrait mode, if device tilted landscape. there way set orientation of native popups, without having change interface orientation (which in js)? or have rebuild whole thing proper native landscape orientation?

c# - How to copy folder/files1..to..files5 during the installation of wix installer -

i have created installer project using wix.i have folders , files under project directory.i need copy folders , files installation path during installation. the 2 directory structure 1.somefolder/file1..to file5 2.some folder/subfolder/subfile1..tosubfile5 .these 2 directory inside project directory.i need copy same directory inside installation folder during installation program files/installationfolder/subfolder/subfile1..tosubfile5 . how copy directory project path installation path during installation. this rather simple question complicated answer... do have features defined? have components defined? have directory structure defined? here suggest... <feature id="filesfeature" level="1" allowadvertise="no"> <componentref id="c__file1_exe"/> <componentref id="c__file2_dll"/> .... </feature> <directoryref id="targetdir"> //this director defined somewhere els

html - How to align input box with a few sr-only labels in bootstrap -

i'm trying format form page bootstrap, of inputs have visible labels , others don't. according bootstrap documentation (column sizing section) have wrap in "row" classes set size of inputs, when add sr-only class labels doesn't fit. suggestions? here fiddle , typeid , dv not aligned general information <div class="form-group col-xs-6"> <label class="control-label" for="fullname">full name</label> <input id="fullname" name="fullname" type="text" class="form-control input-md"></input> </div> <div class="form-group col-xs-2"> <label class="control-label sr-only" for="typeid">type id</label> <select id="typeid" n

c# - How to write Decorator XAML custom control for Windows Runtime? -

wpf has decorator class can contain single child element. windows runtime has no decorator class has similar border class can contain child element. unfortunately border class sealed. i can derive control , write controltemplate contentpresenter child. how border class written? here's example not working. [contentproperty(name = "child")] public class textblockdecorator : frameworkelement { public static readonly dependencyproperty contentproperty = dependencyproperty.register( "child", typeof(textblock), typeof(textblockdecorator), new propertymetadata(null)); public textblock child { { return (textblock)getvalue(contentproperty); } set { setvalue(contentproperty, value); } } } when use child textblock not shown. how can add child decorator element? think, i'm missing call addvisualchild... or similar windows::ui::xaml doesn't have decorator concept wpf does. adornment layer unique wpf , n

Rails check_box does not hold data needed to update the model -

i have view contains form used create model. code worked fine until added attribute model obtained using checkbox. now, code fails, debate_type not updated , therefore model not created: the code i've added prevents creation of model: model: validates_presence_of :debate_type view: <div class="field"> <%= f.check_box :debate_type, {}, "technical", "management" %> <%= f.label :debate_type, "technical" %> </div> i not sure why attribute debate_type not updated. in controller, forgot permit debate_type parameter. def subject_params params.require(:subject).permit(:name, :body, :parent_id, :debate_type) end

Permission denied (missing INTERNET permission?) - android error -

when trying run application on device getting following error: permission denied (missing internet permission?). have internet permission in androidmanifest.xml. here androidmanifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="jamp.vsite.hr.weathervak" > <uses-permission android:name="android.name.internet"></uses-permission> <uses-permission android:name="android.permission.access_network_state"/> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android

android - Check SIMCards's PIN -

so i've research subject , didn't information, though did read few threads here check sim pin sdk android , ask user sim card pin neither of them answer question - app i'm trying write based on ussd , run on devices simcards. i read thread use system pin dialog in android application , i'm not trying overwrite os, i'm trying write simple app can check entered string against simcard pin. on last thread, user (a.ch.) said trying access or check simcard pin number not allowed os (at least without modifications, suppose). can guys confirm or give me link mentions prohibition? also, possible to, using ussd, check pin? example, know mmi code change pin: **04*current pin * new pin * new pin#. , returns fail or sucess messages, , if make current pin = new pin, can identify if pin introduced correct or not, see on text message. smartphone return info in attribute can check? how can access return code? i need can :)

javafx - Java MethodHandle -

@fxml private void handleleftbutton() throws throwable{ methodhandles.lookup lookup = methodhandles.lookup(); methodtype methodtype = methodtype.methodtype(void.class, listiterator.class, text.class); methodhandle leftbuttonclickmethod = lookup.findvirtual(homepresenter.class, "leftbuttonclick", methodtype); leftbuttonclickmethod.invoke(list, menutitle); } why error? java.lang.invoke.wrongmethodtypeexception: cannot convert methodhandle(homepresenter,listiterator,text)void (listiterator,text)void looking @ example in methodhandle - think need pass instance on want call method first argument leftbuttonclickmethod.invoke(this,list, menutitle); but because never worked java.lang.invoke might wrong.

Elasticsearch distinct filter values -

i have large document store in elasticsearch , retrieve distinct filter values display on html drop-downs. an example [ { "name": "john doe", "deparments": [ { "name": "accounts" }, { "name": "management" } ] }, { "name": "jane smith", "deparments": [ { "name": "it" }, { "name": "management" } ] } ] the drop-down should have list of departments, i.e. it, account , management. would kind person please point me in right direction retrieving distinct list of departments elasticsearch? thanks this job terms aggregation ( documentation ). you can have distinct departments values : post company/employee/_

Python: Using defined arguments with *args -

rewritten make more clear use-case , answer better anentropic's question. def use_all (step_todo, wait_complete=true, *args): execute_step1 (step-todo) handle_args (*args) if not wait_complete: do_somehing () return execute_stepn () @decorate def use_from (step_todo, *args): use_all (step_todo, args) @decorate def use_many (): use_all (step_todo1, wait_complete=false) use_all (step_todo2, args2) use_all (step_todo3) the use_all main "executive" process steps (exactly pxssh installation). shall not decorated start/stop comments may called several times procedure (e.g. step_many reboot - reason no wait_complete ), single step shall be. as use-case specific, may see solution handle *args _single named variable containing tuple, e.g. def use_all (step_todo, wait_complete=true, args_list=()): is correct (and recommended) solution? this somehow linked questions python function *args , **kwargs other specifi

grant - Select on anothr users connection does not work -

i have create user (except dba) in db. dba create table called emp. when new user connect db must have privilages select * emp. so used following code. @ dba connection. create table emp( empid varchar2(4), name varchar2(15), designation varchar2(10), primary key (empid) ); create user c##xyz; grant connect c##xyz; grant update,delete,insert,select on emp c##xyz; but when connect xyz , try run select * emp. says table not exsist. so can me this.. i used oracle 12c dbms.

OSGi Virgo integrated with Arquillian -

i know if possible integrate virgo arquillian testing web app ? thanks, junior from list of modules there no explicit arquillian support virgo out of box available. but there options try arquillian-container-osgi : if using virgo nano should fine equinox module. otherwise give remote container setup try , use osgi enterprise jmx. hope helps, florian

strongloop - loopback component push save push model into database -

is there way save models extends push (push base) . want save push model database after have sent push notification. thanks. have looked @ http://docs.strongloop.com/display/lb/push+notifications#pushnotifications-createapushmodel ? can describe scenario bit more?

excel - Setting FormulaArray to Formula skips every other row and column -

a fast way enter formulas this: range("e5:h10").formula = "=a1" the column , row references adjust, example formula code enters in cell h10 "=d6". however, doesn't work array formulas: range("e5:h10").formulaarray = "=a1" that puts array formula {=a1} in each of cells; no adjustments rows or columns. of course can loop through cells , enter unique array formula in each one, isn't fast. so tried this: range("e5:h10").formula = "=a1" range("e5:h10").formulaarray = range("e5:h10").formula but results surprising -- references skip every other row , every other column; example: -- formula in f5 {=c1} instead of expected {=b1}, and -- formula in d6 {=a3} instead of expected {=a2}, and -- formula in h10 {=g11} instead of expected {=d6}. wtf?? why skip rows , columns that?? btw i'm in excel 2007 sp3. for i'm doing this, fastest way found worked: range(&quo

git - Use Compass mixins in Brunch -

i`m trying use compass-mixins plugin git , compile brunch. problem cant use mixins inside main.scss. have import the compass.scss example makes compile time more 2000ms, compared 100ms. i`m sure there better way, doesnt compile scss compass or bourbon every time change main.scss. here structure , config: exports.config = # see http://brunch.io/#documentation docs. modules: definition: false wrapper: false sourcemaps: false optimize: false files: javascripts: jointo: 'js/app.js' : /^app/ 'js/vendor.js' : /^(vendor|bower_components)/ order: before: [ 'bower_components/jquery/jquery.js' ] stylesheets: jointo: 'css/app.css' : /^(app|bower_components)/ order: before: [ 'app/styles/_settings.scss' ] plugins: sass: debug: false options: includepaths: [ 'bower_components/foundati

Php from android in json not posting to table, is there something wrong in my code? -

i have android app converting info json , sending php/mysql, response on phone fine nothing getting table, i'm not experienced in php, did screw code? <?php include('../htconfig/dbconfig.php'); $dbsuccess = false; $dbconnected = mysql_connect($db['hostname'],$db['username'],$db['password']); if ($dbconnected) { $dbselected = mysql_select_db($db['database'],$dbconnected); if ($dbselected) { $dbsuccess = true; } } $data_back = json_decode(file_get_contents('php://input')); $username = $data_back->{"user"}; $password = $data_back->{"pword"}; $purchasedfrom = $data_back->{"pfrom"}; $vin = $data_back->{"vin"}; $color = $data_back->{"color"}; $makeindex = $data_back->{"make"}; $modelindex= $data_back->{"model"}; $year = $data_back->{"year"}; $bid = $data_back->{"