Posts

linux - Elasticsearch can't write to log files -

I would like to activate the log of elasticsearch. When I run the elastic search binary, I know that I have problems with logging: the configuration can not be loaded! Here is the output: ~ $ sudo / usr / share / elasticsearch / bin / elasticsearch failed to configure logging ... org.elasticsearch.ElasticsearchException: org. on elasticsearch.common.logging.log4j.LogConfigurator.configure org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig (LogConfigurator.java:117) on org.elasticsearch.bootstrap.Elasticsearch.main failed to load configuration logging on ( because of org.elasticsearch.bootstrap.Bootstrap.main (Bootstrap.java:178) on org.elasticsearch.bootstrap.Bootstrap.setupLogging (Bootstrap.java:94) on LogConfigurator.java:81) (Elasticsearch.java:32) : java.nio.file.NoSuchFileException: sun.nio.fs.UnixException.translateToIOException at / usr / share / elasticsearch / config (UnixEx ception.java:86) sun.nio.fs.UnixException.rethrowAsIOException ( UnixExce...

Haskell: min distance between neighbor numbers on a list -

I am trying to define a factbook which finds a minimum distance between neighboring numbers on a list Something like this: Minneobresadence [2,3,6,2,0,1,9,8] => 1 My code looks like this: minNeighborsDistance [] = [] minNeighborsDistance (x: xs) = minimum [minNeighborsDistance xs ++ [subtract Although it starts running, once I enter a list, I get an exception error. I am new to Haskell. Any help in this case Ol> This will not match [] in the first line. , Then This will successfully match (x: xs) to specify a value for x and xs Forward, since you call the empty MinNeighborsDistance recursively, you are Mesa will call it on a single list, except that when you pass it empty list.

OpCache not caching -

Recently active opcache but this does not seem to work Phpinfo () you hit 0 Can see 1 miss 1 cached script (opcached GUI) Am I missing? The server is a Linux server centos 6.5 vps PHP 5.5 A bit more info about opcache configuration opcache_enabled true cache_full False restart_pending false false restart_in_progress used_memory 8.54 MB free_memory 503.46 MB wasted_memory 0 bytes 0.00% buffer_size current_wasted_percentage 4,194,304 used_memory 446.41 kB free_memory 3.56 MB number_of_strings 4895 num_cached_scripts 1 num_cached_keys 1 max_cached_keys 65,407 hit 0 start_time Saturn, 26 July 14 23:20: 32 +0000 never last_restart_time oom_restarts 0 hash_starts 0 Manual_Start 0 0 Do not remember bla cklist_misses 0 0.00% blacklist_miss_ratio 0.00% opcache_hit_rate Text after " It seems that you are using CGI instead of mod_php5 for both the shared memory area (SMA) , But it only continues to request-to-request for ...

ruby on rails - Erase Blank Json Loop -

I have a rail backend that receives JSON (when it is parsed): = "gtc: mediawiki-xid =" gtc: mediawiki-xid = "gtc: mediawiki-xid =" gtc: basically what I want to do, in every way (Such as magazine or book), if all the other attributes keys are empty except like , then do not save that array key / value. So in my example, the magazine will be in the array, but will be removed as a book (because the value of both the attributes and the title is empty. I know that I can loop through something ( The list has been parsed before JSON): list.each do | l | if l ["type"] == "magazine" if l ["value"] empty? # Then terminate this notice but this is not very repetitive and clear. How can I improve it? This can be used to idle unwanted lines to do so. You only remove the values Can remove the blank, and count the remaining values ​​... make sure that 'type' is one of them ... list.reject! {| Item> item.values.reject ...

svg - D3 ordinal scale only returning extremes. Why isn't it interpolating between range and domain? -

I'm trying to use d3.scale.ordinal () . I have a problem where the function returns only the minimum and maximum scale value. I am trying to use d3.map () to create a domain. Then I use an xScale function at the same price My data looks like this: Key, ToState, Value, Populate, District of Columbia, 836, Populated Populate, Maryland, 1938, Populated Populate, New Jersey, 836, Populated Populate, Pennsylvania, 939, Populated Populate, New York, 3455, Populate My Scale Function Looks like: xScale = d3.scale.ordinal () .domain (d3.map (thedata, function (d) {console.l Og (d.to_state); return d.to_state;}).) Range ([0, W - margin left - margin right]); My map selection looks like Y and the height values ​​are being calculated properly just X is bothering me. var thechart = chart.selectAll ("div"). Data (thedata) .enter () console.log (xScale ("New Jersey") + "" + XScale ("Pennsylvania" )); ("Rectangle", function ...

javascript - AngularJS $resouce is adding $resolved and $promise -

I'm getting data using $ $ resource in AngularJS. However, it is adding two additional properties to $ $ and $ in the result resolved. Below is my code. How can I get around this? MyStoreCheckoutService.factory ('checkout', function ($ resource) {return $ resource ('property / app / data / billing /: file.json', {}, {GetSalexTax: { Method: 'GET', params: {file: 'sales-tax'}, isArray: false}})}} myStoreCheckoutControllers.controller ('myStoreCheckoutCtrl', function ($ radius, checkout) {$ Scope.states = []; $ Scope.saleTaxMaster = Checkout.getSalexTax ({function () {console.log ($ scope.saleTaxMaster); getStates ();}); function getStates () {for $ scope.saleTaxMaster in var x} {if ( $ Scope.saleTaxMaster.hasOwnProperty (x)) {$ scope.states.push (x)}}}}} Here my $ Scope.saleTaxMaster Both properties are This is a $ resource Design / Feature If this is a problem, then you can skip properties starting with $, this is the same patt...

asp.net web api - Using Action link with Web Api Controller -

How can I use an application when an operator calls an action that is a WebAP controller. public class requestcontroller: API controller {[Actioneme ("Actisation")] [Response type (type off (request)) Public ASSink Task & lt; IHttpActionResult & gt; PostRequest (Request Request) {If (ModelState.IsValid!) {Change BadRequest (ModelState); } Db.Requests.Add (request); Wait db.SaveChangesAsync (); Return Created Arm route ("DefaultApi", new {id = request.Id}, request); }} In my layout page I can @ Html.ActionLink ("request", "create action", "API / request", new {domain = ""} , Null) Jawahar You can generate a link The following link will point to an album controller using the standard URL asset property and an API controller will pass along an ID parameter with the value of 3: . ", Id = 3}) Please refer to this link