Posts

Showing posts from April, 2012

javascript - AJAX refreshing part of a page why is not working? -

i spent 2 days trying write allowed me upload file through ajax, close want do, can upload files through ajax, whole point of idea upload files without refreshing page, refreshing page , don´t know how solve it... current js $('#profilovka').validate({ submithandler: function (form) { var aformdata = new formdata(); aformdata.append("subor", $('#subor').get(0).files[0]); $.ajax({ type: "post", url: "upravit.php", processdata: false, contenttype: false, data: aformdata, success: function (data) { $('#nove').load(document.url + ' #nove'); } }) } }); and form <form class="profilovka" role="form" id="profilovka" method="post" enctype="multipart/form-data" > ...

sql - Data Agent - SELECT from one table and insert into another -

is there type of product can write sql statement select 1 table , insert database (the other database out in cloud). also, needs able check see if record exists , update row if has changed. need run every 10-30 minutes check see has changed or if new records have been added. the source database , ending database have different schema (if matters?) i've been looking, seams products out there ones copy 1 table , insert table same schema.

entity framework - Create a DbGeography Polygon from a collection of DbGeography Points -

can tell me how can create dbgeography object of type 'polygon' collection of dbgeography objects of type 'point' so far i've got creates polygon i'm missing how initial step. 1. dbgeography multipoint = dbgeography.multipointfromtext("multipoint(53.095124 -0.864716, 53.021255 -1.337128, 52.808019 -1.345367, 52.86153 -1.018524)", 4326) 2. dbgeometry temp_multipoint = dbgeometry.multipointfrombinary(multipoint.asbinary(), 4326) 3. dbgeography polygon = dbgeography.polygonfrombinary(temp_multipoint.convexhull.asbinary(), 4326); (result) the problem creating initial multipoint geography object list of dbgeography(points) create each point dbgeography object using wkt: dbgeography point1 = dbgeography.fromtext("point(53.095124 -0.864716)", 4326); dbgeography point2 = dbgeography.fromtext("point(53.021255 -1.337128)", 4326); dbgeography point3 = dbgeography.fromtext("point(52.808019 -1.345367)", 4326); .....

sql server - Combine Parent-Child Rows - TSQL -

li trying flatten/combine rows table parent-child hierarchy. i'm trying identify beginning , end of each 'link' - if a linked b , b linked c , , c linked d , want output link a d . i'm trying best avoid using procedure loops, advice appreciated! the original dataset , required output follows: personid | form | linkedform ---------|---------|--------- 1 | | b 1 | b | c 1 | c | d 1 | d | null 2 | e | f 2 | f | g 2 | g | null 2 | h | 2 | | null 3 | j | null 3 | k | l 3 | l | null desired output: personid | form | linkedform ---------|---------|--------- 1 | | d 2 | e | g 2 | h | 3 | j | null 3 | k | l each personid can have multiple links, , link can made of 1 or multiple forms. --...

php - Laravel 5.1 views not found and got error 404 on site navigation -

i'm trying write project framework. when upload site in shared host, got error 404 in of site links, except site home page. while site works fine in xampp. my code: html : <li> <a href="soon"> آرشیو مقاله </a> </li> <li> <a href="contact"> ارتباط با ما </a> </li> <li> <a href="about"> درباره ما </a> </li> routes.php : route::get('/', function () { return view('home'); }); route::get('/soon', 'navigationcontroller@soon'); route::get('/about', function () { return view::make('about'); }); route::get('/contact', function () { echo 'contact '; }); navigationcontroller.php : <?php namespace app\http\controllers; use illuminate\http\request; use a...

java - JLabels in a JScrollPane -

i have scrollpane in want add multiple jlabel . code.. jpanel paneleast = new jpanel(); paneleast.setborder(new titledborder(null, "notifiche", titledborder.leading, titledborder.top, null, null)); paneleast.setpreferredsize(new dimension(250,120)); paneleast.setlayout(null); jlabel lblnewlabel_3 = new jlabel("label1"); lblnewlabel_3.seticon(new imageicon(home.class.getresource("/it/polimi/icon/contact.png"))); lblnewlabel_3.setbounds(10, 81, 240, 52); paneleast.add(lblnewlabel_3); jlabel label_3 = new jlabel("label2"); label_3.seticon(new imageicon(home.class.getresource("/it/polimi/icon/verified.png"))); label_3.setbounds(new rectangle(4, 0, 0, 0)); label_3.setalignmenty(component.top_alignment); label_3.setbounds(10, 30, 240, 52); paneleast.add(label_3); jlabel label_4 = new jlabel("label3"); label_4.seticon(new imageicon(home.class.getresource("/it/p...

fuzzy logic - Takagi Sugeno system in R with frbs something wrong with rulebase -

i've been trying use r statistical software build takagi sugeno fuzzy system. using r package frbs i've managed set of components of fis following example in demo files. unfortunately, i've hit problem: error in rule[, (4 * i), drop = false] : subscript out of bounds in line: res <- predict(object, newdata)$predicted.val i have no idea wrong in script. rules should good, same use in matlab script , works. in documentation , examples in frbs library. #rm(list=ls()) library(frbs) varinp.mf <- matrix(c( 5, -1, 0.8493, na, na, 5, 1, 0.8493, na, na, 5, -1, 0.8493, na, na, 5, 1, 0.8493, na, na), nrow = 5, byrow = false) num.fvalinput <- matrix(c(2,2), nrow=1) x1 <- c("a1","a2") x2 <- c("b1","b2") names.varinput <- c(x1, x2) range.data <- matrix(c(-1.5,1.5, -1.5, 1.5, -1.5, 1.5), nrow=2) type.defuz <- "5" type.tnorm <- "min" type.sno...

jquery - Vuejs display other input fields based on selected value from dropdown -

i have select dropdown list , 2 hidden input fields. when user select first item in dropdown list , first input field gets displayed , vice versa. here code i'm not sure how if statement when selected value equals xxx display input field 1, else display input field 2 new vue({ el: '#app', data: { selected: '' } }); <select name="parent" class="form-control" v-model="selected" required> <option value="" selected></option> <option value="item1">item 1</option> <option value="item2">item 2</option> </select> <div> <input name="test 1" v-show="selected"> //display when item 1 selected </div> <div> <input name="test 2" v-show="selected"> //display when item 2 selected </div> thank you you can like <...

javascript - Knockout mobile js refresh -

i have following code. <html> <head> <title>dan tv</title> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script> function currentprogram(context) { var title = ''; $.getjson(context.$data.uricurrent, function(current) { if (current.series != null) { title = current.series.serietitle if (current.series.episode.episodetitle != null) { title = title + '<br>' + current.series.episode.seasonnumber + ':' + current.series.episode.episodenumber + ' ' + current.series.episode.episodetitle; } ...

java - How to get parameters of a table column in a servlet? -

good evening, how parameters of chk_group input inside servlet using request.getparametervalues here's jsp form: <form name="mainform" action="deleteservlet" method="get"> <table border=2 bordercolor=yellow width="120px" id="product_table"> <tr> <td></td> <td><b>carid</b></td> <td><b>description</b></td> <td><b>quantity</b></td> <td><b>price</b></td> <td><b>cc.no</b></td> <td><b>engine</b></td> <td><b>cylinder.no</b></td> <td><b>maxspeed</b></td> <td><b>petroltype</b></td> <td><b>petrolcapacity</b></td> ...

Zend Framework 2 view helper and controller plugin -

i've been trying out zf2 couple of weeks , enjoy working it. have trouble though deciding specific tasks. function belong in model or in controller etc. @ moment understand view helper , controller plugin concepts. give few examples kind of functionality belongs in view helper? know same controller plugin, few examples make me understand why make plugin instead of programming functionality in controller? view helpers extend functionality on view layer , reusability throughout application. controller plugins extend functionality on controller layer. you use both keep controllers / views light , thin , reuse in application (keeping code dry).

javascript - jQuery - Using .slideToggle and .animate simultaneously -

i have portion of jquery doesn't seem working correctly. have link click, [show/hide] should slidetoggle div. @ same time, want animate page scrolls top of div. works when put animate function inside slidetoggle function, in jfiddle . however, means div want slides out, , then page scrolls down. id set both happen simultatneously, tried in this jfiddle doesn't work. tried doing scroll animation first, slidetoggle, didn't work - there way implement also?? cheers! $(document).ready(function () { $('.click_to_hide').click(function () { var visible = $('.hide_on_click').is(":visible"); $('.hide_on_click').slidetoggle(500); if (!visible) { $('html, body').animate({ scrolltop: $('.hide_on_click').offset().top }, 500); } }); }); http://fiddle.jshell.net/yfr2e/3/

java - Apply LongProperty to TableColumn programmatically (vs semantically) -

(following this question, prompted it) i have model class longproperty : public class model { private final simplelongproperty number = new simplelongproperty(this, "number"); public long getnumber() { return number.get(); } public void setnumber(long number) { this.number.set(number); } public longproperty numberproperty() { return number; } } now, in controller have tablecolumn<model, long> colnumber want bind property. know can use propertyvaluefactory , don't idea of giving property name when can pass programmatically, , have compiler/ide spell-check me. want (i want make more concise, example in end): colnumber.setcellvaluefactory( cdf -> cdf.getvalue().numberproperty() ); but gives me compilation error: java: incompatible types: bad return type in lambda expression javafx.beans.property.objectproperty cannot converted javafx.beans.value.observablevalue as said, know can use propertyvaluefactory , , have static...

php - Porting stored procedures between MySQL servers -

i have inherited web-application project (php/mysql) makes extensive use of stored procedures, , unsure how transfer these local machine development. specifically, exporting , importing of these stored procedures facing difficulty (with ultimate aim of being able automate installation of "base" version of application database, complete stored procedures). i shall state bits , pieces believe understand: i can export information_schema.routines table, cannot import (phpmyadmin) onto local server (i believe information_schema system database?) as not have shell/command-line access "online" mysql servers, tools such mysqldump of limited use (to port local testing machine, not vice versa) the command show create procedure procedure_name; supposed output sql can used create procedure, can't seem functioning correctly ( error 1305 (42000): procedure deladdress not exist ) assuming the above works, next step have looped export stored procedures (..and ...

hadoop - Hive on Tez Pushdown Predicate doesn't work in view using window function on partitioned table -

using hive on tez running query against view causes full table scan though there partition on regionid , id. query in cloudera impala takes 0.6s complete , using hortonworks data platform , hive on tez takes 800s. i've come conclusion in hive on tez using window function prevents predicate pushed down inner select causing full table scan. create view latestposition t1 ( select *, row_number() on ( partition regionid, id, deviceid order ts desc) rownos positions ) select * t1 rownos = 1; select * latestposition regionid='1d6a0be1-6366-4692-9597-ebd5cd0f01d1' , id=1422792010 , deviceid='6c5d1a30-2331-448b-a726-a380d6b3a432'; i've tried joining table using max function latest record, works, , finishes in few seconds still slow use case. if remove window function predicate gets pushed down , return in milliseconds. if has ideas appreciated. for interested, posted question on hortonworks community forum. guys on there raised bug issue on hive...

json4s - Generating json in this format using Scala -

i have string : "[[{\"cfunction\":\"sum\"},{\"cfunction\":\"groupby\"}],[{\"cfunction\":\"add here\"}]]"; which generated : val json2 = list(list(("cfunction" -> "sum"), ("cfunction" -> "groupby")), list(("cfunction" -> "add here"))) println(compact(render(json2))) how generate : "[[{\"cfunction\":\"sum\" , \"1\":\"1\"},{\"cfunction\":\"groupby\" , \"2\":\"2\"}],[{\"cfunction\":\"add here\"}]]"; ? i've tried : val json2 = list(list(("cfunction" -> "sum" , "1" -> "1"), ("cfunction" -> "groupby", "2" -> "2")), list(("cfunction" -> "add here"))) but causes compiler error : type mismatch; found : list[li...

html - JavaScript image array in NetBeans -

i new coder , newer stack please me out if question bad or not understandable! have been following number of tutorials on site , others on creating javascript slideshow gallery website project making school. have html written up, first image appear loaded through html, debug console keeps saying receiving empty responses when try run webpage through chrome connector. appears on site empty image holder. i reckon it's either netbeans , file structure within project can't find files or code, i've tried every method i've seen load images array. wiped , loaded whole new set of images! no joy. can't figure out going on, every tutorial makes easy! file tree in netbeans basic , html , css files find images no problem! tried loading screenshot of file tree i'm not allowed. photos in folder called images in site root folder. var bigpicturearray = []; bigpicturearray[0]= new image(); bigpicturearray[0].src='images/cup1.jpe)'; bigpicturearray[1]= new image...

MySQL column: Change existing phone numbers into specific format? -

i have mysql column contains phone numbers, problem they're in different formats, such as: 2125551212 212-555-1212 (212)5551212 i'd know if it's possible take existing 10 digits, remove formatting, , change them format: (212) 555-1212 not duplicate, i'm looking update several thousand entries instead of masking new entries. unfortunately, no regexp_matches() or translate() function comes standard mysql installation (they postgres ), way find dirty, works. first cleanse column removing characters aren't numbers using replace() then take several parts of string separate them out using substr() finally, concatenate them adding symbols between substrings concat() if have more characters need truncate, add replace() on top of 3 existing. sample data create table nums ( num text ); insert nums values ('2125551212'), ('212-555-1212'), ('(212)5551212'); query formatting data select num, c...

javascript - JS message in PHP return to HTML page -

html code <div id="fourmstyle" class="fourm"> <form action="scripts/mail.php" method="post"> <label for="name">your name <required>*</required> </label> <input type="text" name="name" id="name" placeholder="joe bloggs"> <label for="email">your email <required>*</required> </label> <input type="text" name="email" id="email" placeholder="joebloggs@example.com"> <label for="telephone">telephone </label> <input type="text" name="telephone" id="telephone"> <label for="type">type </label> <select name="type"> <option value="booking" selected>booking</option> ...

editor - Select all text between quotes, parentheses etc in Atom.io -

sublime text has same functionality via: ctrl+shift+m or cmd+shift+space how accomplish same thing in atom? select text between brackets supported default bracket matcher package. works {} , [] , () : ctrl + cmd + m to select text inside quotes, can install expand-selection-to-quotes package , use: ctrl + '

Where do I put files other than build.gradle? -

so standard / best practice files custom tasks or scripts? put them? rather not have them in project root , highly unlikely permitted create new stand-alone project in git. (i ask though) there's whole chapter on in user guide . there number of ways split , organize build logic, simplest way decompose complex build script via script plugins .

How to get array of objects with gson/retrofit? -

i have used gson before automatically convert pojo's. but im trying use retrofit convert api result objects. as long json has named arrays of objects no problem: e.g.: { items:[ {"name":"foo"}, {"name":"bar"} ] } public class anitem { string name; } public class myitems { list<anitem> items; } public interface myapi { @get("/itemlist") call<myitems> loaditems(); } public boolean onoptionsitemselected(menuitem item) { retrofit retrofit = new retrofit.builder() .baseurl("https://someurl.com/api") .addconverterfactory(gsonconverterfactory.create()) .build(); myapi myapi = retrofit.create(myapi.class); call<myapi> call = myapi.loaditems(); call.enqueue(this); return true; } @override public void onresponse(response<myitems> response, retrofit retrofit) { arrayadapter<anitem> adap...

Return type of operator = in C++ -

i have clarification make. example want override operator =. i've read, should return reference object. , i've read source, reference alternate name object. this? myobject myobject::operator =(const myobject &o2) { //insert processing code here return *this; } rather this? myobject& myobject::operator =(const myobject &o2) { //insert processing code here return *this; } in first case, return copy of *this , not reference *this . should stick second case. there big difference between 2 cases, types "expensive" copy.

Why would Matlab's `rand(1,1e9)` make 64-bit Windows 7 unresponsive? -

when start new matlab session, rand(1,1e9); command causes 64-bit windows 7 become unresponsive. means once every few minutes, might respond mouse click or such few minutes back, otherwise, can't flip between apps, can't invoke task manager, , if task manager running before rand(1,1e9); command, can't scroll matlab on processes tab. don't out-of-memory message. clicking on matlab's "x" icon close app doesn't anything. ctrl-c doesn't anything, , neither break in unison 1-, 2-, , 3-key combination of shift, ctrl, , alt. it might informative know rand(1,1e8); (10x fewer doubles) doesn't cause these problems , finishes in (relatively) no time @ all. the memory info memory command is: >> memory maximum possible array: 12782 mb (1.340e+10 bytes) * memory available arrays: 12782 mb (1.340e+10 bytes) * memory used matlab: 674 mb (7.068e+08 bytes) physical memory (ram): 8070 mb (8.462e+09 bytes) * limited sys...

ios - How to avoid relayout of content in a tableview? -

here read in cells , table view performance guide : avoid relayout of content. when reusing cells custom subviews, refrain laying out subviews each time table view requests cell. lay out subviews once, when cell created. what mean ? am applying : override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("customcell", forindexpath: indexpath) as! customcell cell.customcelldescription.text = data[indexpath.row] return cell } what you're doing fine. putting data in label (or whatever is), not moving around. cellforrowatindexpath — apply cell data corresponds index path.

wpf - Need assistance with making a button in one UserControl update the GUI in another UserControl using Properties in C# -

i'm trying code program if click on either listbox item or button in 1 usercontrol, update textbox in usercontrol. can't seem figure out how working dependencyproperties. listbox.xaml <usercontrol x:class="testdp3.listboxusercontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:testdp3"> <usercontrol.datacontext> <local:myviewmodel/> </usercontrol.datacontext> <grid> <listbox x:name="lstbox" horizontalalignment="left" height="144" margin="21,23,0,0" verticalalignment="top" width="149" selectionchanged="selector_onselectionchanged"/> <button content="button" horizontalalignment="l...

delphi - What kind of Cloud do I need? -

there's program metatrader4 can run scripts. script reading data text files (up 3 gb) , analyse them. it's excel vba script analysing sheet's data. billions of iterations. results of calculating stored in txt file (up few gbs) is possible run many instances of metatrader4 using cloud (azure?) if no can recode script delphi application possible azure or other cloud service? if how can that? have trial in azure don't know start. using azure, 1 option using azure webjobs , works exe files (if program .exe) acceptable file types scripts or programs used in azure web jobs: .cmd, .bat, .exe (using windows cmd) .ps1 (using powershell) .sh (using bash) .php (using php) .py (using python) .js (using node) .jar (using java) for more detail information take @ link: https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/

mysql - If else on WHERE clause -

i've query: select `id` , `naam` `klanten` ( `email` '%@domain.nl%' or `email2` '%@domain.nl%' ) but want this: select `id` , `naam` `klanten` if(`email` > 0, `email` '%@domain.nl%' , `email2` '%@domain.nl%' ) how check if email exist? want use email , if field empty want use email2. how accomplish this? if used select field, like clause placed after it: select `id` , `naam` `klanten` if(`email` != '', `email`, `email2`) '%@domain.nl%'

Understanding Haskell recursion in functions -

i've been using few resources haskell: learn haskell , wikibook. however, i'm struggling find explanation helps me understand recursion bit more. i've attached sample piece of code 'learn haskell' book partially understand. maximum' :: (ord a) => [a] -> maximum' [] = error "maximum of empty list" maximum' [x] = x maximum' (x:xs) | x > maxtail = x | otherwise = maxtail maxtail = maximum' xs i understand of above code until last line 'where maxtail = maximum' xs'. don't understand how code evaluated return maximum, calling maximum'. or how knows maximum' highest element of list. another example: reverse' :: [a] -> [a] reverse' [] = [] reverse' (x:xs) = reverse' xs ++ [x] understand until reverse' called on tail of list. in other words, how know reverse' means reverse tails elements. i appreciate explanation, , apologies if it's sim...

octave opens GUI when I type "octave" in terminal -

i have problem: installed octave , not know why, every time type octave in terminal opens gui interface (gui --force-octave) octave , not terminal octave right. how can fix this? if have octave 4.0, gui default: ** graphical user interface default when running octave interactively. start-up option --no-gui run familiar command line interface... https://www.gnu.org/software/octave/news-4.0.html

soap - Locating the parameter of an Operation in System.ServiceModel.Channels.Message in WCF -

suppose have following service contract: [servicecontract] public interface iping { [operationcontract] string ping(string parameter1, string parameter2); } i'm wondering, how possible find particular parameter value, value of parameter1 example, in system.servicemodel.channels.message created server side. thanks! it's task of idispatchmessageformatter convert between operation parameters , message object. message created xml body, , parameters xml elements, that's 1 possible implementation (it's valid formatter disregard message , assign whatever values sees fit operation parameters). you can learn more message formatters in blog post @ http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/03/wcf-extensibility-message-formatters.aspx .

javascript - keyup not working for multiple textareas -

im using keyup function , works fine first textarea wont work others. below html , javascript: <div class="form-group col-md-5"> <label for="sympton" class="control-label">observed symptom</label> <div class="output1"></div> </div> <div class="form-group col-md-5"> <label for="why" class="control-label">why?</label> <textarea id="mytextarea1" class="form-control" name="why" cols="20" rows="3"></textarea> </div> <div class="form-group col-md-2"> </div> <div class="form-group col-md-5"> <label for="sympton" class="control-label">symptom 2</label> <div class="output2"></div> </div> <div class="form-group col-md-5"> <label for="why" class="co...

c++ - How to draw a opaque image on the Aero glass window? -

Image
i have used dwm api create aero glass window calling dwmextendframeintoclientarea. void cmainframe::onactivate(uint nstate,cwnd* pwndother,bool bminimized ) { cframewnd::onactivate(nstate,pwndother,bminimized); bool fdwmenabled = false; if (succeeded(dwmiscompositionenabled(&fdwmenabled))) { if(nstate == wa_active ) { margins margins ={-1}; hresult hr = dwmextendframeintoclientarea(m_hwnd, &margins); if (!succeeded(hr)) trace0("failed dwmextendframeintoclientarea\n"); } } } and then, draw bitmap image on window (i have tried call drawthemeicon , cimagelist::draw draw image). void cmainframe::displaybitmap( cbitmap *p, cdc *pdc) { cdc dcmemory; bitmap bm; dcmemory.createcompatibledc(pdc); dcmemory.selectobject(p); p->getbitmap(&bm); pdc->bitblt(100,100,bm.bmwidth,bm.bmheight,&dcmemory,0,0,srccopy); } void cmainframe::onncpaint...

ruby - Pass select_tag value to load query in the same view rails -

i know question has been answered before, none of methods had worked me. i have view select_tag loads options database. <%= select_tag :nom, options_from_collection_for_select(usuario.all, :id, :tienda), prompt: "seleccionar tienda" %> then, use link_to <%= link_to("cargar", :action => 'rel') %><br> to load query on controller def rel @nom = params[:nom] @tie = av.find_by_sql(["select * avm.avs usuario_id in(select id avm.usuarios tienda = ?)", @nom]) render('rel') the problem when select value on select_tag not pass value , sets value nil... i used collection_select , doesn't work either. <%= collection_select(:tienda, :tienda, usuario.all, :id, :tienda)%> i broke head off trying figure out why. in advance! use form_tag : <%= form_tag action: rel %> <%= select_tag :nom, options_from_collection_for_select(usuario.all, :id, :tienda), prompt: "seleccionar tienda" ...

Fastest way to extract part of a long string in Python -

i have large set of strings, , looking extract part of each of strings. each string contains sub string this: my_token:[ "key_of_interest" ], this part in each string says my_token . thinking getting end index position of ' my_token:[" ' , after getting beginning index position of ' "], ' , getting text between 2 index positions. is there better or more efficient way of doing this? i'll doing string of length ~10,000 , sets of size 100,000. edit: file .ion file. understanding can treated flat file - text based , used describing metadata. how can can possibly done "dumbest , simplest way"? find starting position look on ending position grab indiscriminately between two this indeed you're doing. further inprovement can come optimization of each step. possible ways include: narrow down search region (requires additional constraints/assumptions per comment56995056 ) speed search operation bits, include...

ruby - Couldn't start riemann health -

i'm new riemann , new ruby , clojure well. when implementation of riemann command: riemann-health the error message is riemann::client::tcpsocket::error not connect 127.0.0.1:5555:errno::econnrefused: connection refused - connect(2) /var/lib/gems/1.9.1/gems/riemann-client-0.2.5/lib/riemann/client/tcp_socket.rb:233:in `connect_nonblock' my develop environment is: ubuntu 14.04.2 lts riemann version 0.2.10. java version "1.8.0_45" ruby 1.9.3p484 i'm assuming running riemann , riemann-dash on same computer , not using docker either of these: riemann listens port 5555 udp events port 5555 tcp events port 5556 tcp queries so there several combinations of possible problems: riemann not running @ all riemann started up, , fell on , died. happens when has no config file instance. riemann not listening on 5555 tcp riemann not listening on 5555 udp riemann listening incorrect interface (aka "bind addre...

apache spark - How to create an empty DataFrame? Why "ValueError: RDD is empty"? -

i trying create empty dataframe in spark (pyspark). i using similar approach 1 discussed here enter link description here , not working. this code df = sqlcontext.createdataframe(sc.emptyrdd(), schema) this error traceback (most recent call last): file "<stdin>", line 1, in <module> file "/users/me/desktop/spark-1.5.1-bin-hadoop2.6/python/pyspark/sql/context.py", line 404, in createdataframe rdd, schema = self._createfromrdd(data, schema, samplingratio) file "/users/me/desktop/spark-1.5.1-bin-hadoop2.6/python/pyspark/sql/context.py", line 285, in _createfromrdd struct = self._inferschema(rdd, samplingratio) file "/users/me/desktop/spark-1.5.1-bin-hadoop2.6/python/pyspark/sql/context.py", line 229, in _inferschema first = rdd.first() file "/users/me/desktop/spark-1.5.1-bin-hadoop2.6/python/pyspark/rdd.py", line 1320, in first raise valueerror("rdd empty") valueerror: rdd empty extending joe wi...

entity framework - How can I have a staging site for my Azure web app with its own database? -

Image
i have mvc website connected azure web app , has continuous deployment staging site set up. works great! after check in, successful build automatically deployed staging slot of webapp. after verify staging looks good, can swap 2 slots make prod stage , vice versa. recently decided wanted production , staging slots connect distinct databases can enter test data staging site without cluttering prod database. i naively though editing connection strings in configuration staging site point new database. seemed work, next time swapped configurations after deploy, realized connection strings swapped in process. not aiming for. does know how can have 2 deployment slots point different databases , maintain connections after swap? there way should thinking of this? azure provides answer here . copy-edited text below. some configuration elements follow content across swap (not slot specific) while other configuration elements stay in same slot after swap (slot specific...

grep in pipeline: why it does not work -

i want extract information output of program. method not work. write rather simple script. #!/usr/bin/env python print "first hello world." print "second" after making script executable, type ./test | grep "first|second" . expect show 2 sentences. not show anything. why? escape expression. $ ./test | grep "first\|second" first hello world. second also bear in mind shebang #!/usr/bin/env python , not #/usr/bin/env python .

html - background div color and the color of content div, making them different -

you confused way put,, let me display this. when enter http://www.golfledger.com/ or http://snapzu.com/ background color grey section has contents white. how make html way? setting background grey , contents div white? here's fiddle css body{ background-color:#ccc; } #main{ width:70%; height:600px; top:20px; margin-left:15%; background-color:#fff; } html <body> <div id="main"></div> </body>

scala - Spark Mllib .toBlockMatrix results in matrix of 0.0 -

i trying create block matrix input data file. have managed data read data file , stored in indexedrowmatrix , coordinatematrix format correct. when use .toblockmatrix on coordinatematrix result block matrix containing 0.0 same dimensions coordinatematrix. i using version 1.5.0-cdh5.5.0 import org.apache.spark.sparkconf import org.apache.spark.sparkcontext import org.apache.spark.sparkcontext._ import org.apache.spark.mllib.linalg._ import org.apache.spark.mllib.linalg.vector import org.apache.spark.mllib.linalg.distributed.coordinatematrix import org.apache.spark.mllib.linalg.distributed.indexedrowmatrix import org.apache.spark.mllib.linalg.distributed.indexedrow import org.apache.spark.mllib.linalg.distributed.blockmatrix val conf = new sparkconf().setmaster("local").setappname("transpose"); val sc = new sparkcontext(conf) val datardd = sc.textfile("/user/cloudera/data/data.txt").map(line => vectors.dense(line.split(" ").map(_.tod...

paperclip - Using paper clip gem on heroku -

i have model named post , trying add image content post using paper clip gem , works fine when run local. when deploy on heroku throws error "image has contents not reported be" post model class post < activerecord::base belongs_to :topic has_many :comments has_many :ratings belongs_to :user #scope :recent, -> {where :user_id = 3)} scope :t , ->(from) { where("posts.created_at > ?", from) } scope :f , ->(from) { where("posts.created_at < ?", from) } #scope :created_before, ->(time) { where("created_at < ?", time) } has_and_belongs_to_many :users , join_table: :posts_users_read_status has_and_belongs_to_many :tags has_attached_file :image validates_presence_of :name, :presence => true,message: "name should not blank" validates_length_of :name,:maximum => 20,message: "maximum 20 characters allowed" validates_attachment :image validates_attachment_content_t...

multithreading - Android Service running multiple times -

i making android app pulls data notifications server, have used service. service runs in background timer of 30 seconds. , every 30 seconds, service check , pull notification, problem mobile pulls 3 times more notification actual number of notification. not understand going on. here service class: public class notificationservices extends service { int iuniqueid = (int) (system.currenttimemillis() & 0xfffffff); private final int updateintercal = 30 * 1000; private timer timer = new timer(); private static final int notificationex = 0; private notificationcompat.builder mbuilder; private pendingintent resultpendingintent; int mnotificationid = 001; private notificationmanager mnotifymgr; private intent resultintent; private string messagerecipientid; private int recipientid = 0; int counter = 0; //private boolean lock = false; @override public ibinder onbind(intent arg0) { return null; } @override public int onstartcommand(intent intent, int flags, int startid) { //...