Posts

Featured post

php array slice every 2th rule -

i have array on php outputs in txt file: printing grid -- 1 values -- undef = -9.99e+08 20.2 \nprinting grid -- 1 values -- undef = -9.99e+08 102.0 \nprinting grid -- 1 values -- undef = -9.99e+08 55.1 \nprinting grid -- 1 values -- undef = -9.99e+08 -18.3 \n what point, need nummeric values @ beginning of each rule. 20.2, 102.0, 55.1, -18,3 etc... example, there can more or less in txt file. now do? have tested array slice function can't exclude rule: printing grid -- 1 values -- undef = -9.99e+08 this array slice code... $arraygood = array_slice($arraybad, 1, 4); and foreach loop create text file: $file = fopen("array.txt","w"); foreach ($arraygood $meting => $waarde) { echo fwrite($file,$waarde . '\n'); } fclose($file); thanks! as posted in comments, understanding have array of strings similar following: $lines = array( "printing grid -- 1 values -- undef = -9.99e+08", "20.2 \nprinting grid --

My HTML document is not linking to my CSS stylesheet properly -

i have been copy , pasting html , css tutorials try make work, right have; page (html) <!doctype html> <html> <head> <meta charset="utf-8"> <title>title of document</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> </head> <body> <h1>1this site</h1> <p>welcome site</p> </body> </html> style.css body {background-image:url(“background.png”);} h1 {font-family:arial, sans-serif;} the when load html in safari still unformatted. thanks in advance! check see if setting paths right if still have problem try use fill path : <link rel="stylesheet" type="text/css" href="http://127.0.0.1/test/style/style.css" />

phpstorm - JavaScript with function having inconsistent return points -

let's have class: function point(x,y){ var _x=x,_y=y; this.x = function(newx){ if (typeof newx !== 'undefined') { //function x() working setter _x=newx; } else { //function x() working getter return _x; } } } phpstorm complains function (x()) having inconsistent return points. found adding return undefined; after _x=newx; solves whine , code looks this. function point(x,y){ var _x=x,_y=y; this.x = function(newx){ if (typeof newx !== 'undefined') { //function x() working setter _x=newx; return undefined; } else { //function x() working getter return _x; } } } the question is: there way make phpstorm stop whining this? another option annotate methods return type properly, phpstorm knows function expected return undefined in cases. /** * @param {number} [newx] * @returns {number|undefined} */ this.x = function(newx) { // ... }

node.js - Sending sockets to client side, Error: Converting circular structure to JSON -

i'm working in node js , i'm trying send array, clients, server every client normal emit, keeps giving me error: data = json.stringify(ev); typeerror: converting circular structure json shortly, do. var clients = new array(); io.sockets.on('connection', function(socket) { clients.push(socket); socket.on('loginuser', function(data){ io.sockets.emit("getusers", clients); }); i've seen couple of other people having problem, answers didn't work out me. looking @ bigger problem, can't send array of sockets client side. sockets objects make sense in current context/process. if want control sockets client side, instead add sort of rpc functionality.

java - spring amqp rabbitmq MessageListener not working -

i trying use rabbitmq using spring amqp, below configuration. <rabbit:connection-factory id="rabbitconnectionfactory" port="${rabbitmq.port}" host="${rabbitmq.host}" /> <rabbit:admin connection-factory="rabbitconnectionfactory" /> <rabbit:queue name="${rabbitmq.import.queue}" /> <rabbit:template id="importamqptemplate" connection-factory="rabbitconnectionfactory" queue="${rabbitmq.import.queue}" /> <beans:bean id="importexchangemessagelistener" class="com.stockopedia.batch.foundation.importmessagelistener" /> <rabbit:listener-container connection-factory="rabbitconnectionfactory" concurrency="5"> <rabbit:listener queues="${rabbitmq.import.queue}" ref="importmessagelistener" /> </rabbit:listener-container> this simple message listener class, import org.springframework

database - iOS Insert Row with 2 Date Fields -

how 1 insert row table i've created 2 sqlserver smalldatetime fields via windows azure mobile services library? i'm trying use: [nsdate timeintervalsince1970] to store date-time value nstimeinterval or double. however, causes following error: error domain=com.microsoft.windowsazuremobileservices.errordomain code=-1302 "error: bad request." datetime fields should represented nsdate field in nsdictionary object sending insert or update call. so do: [table insert:@{ @"id": @"myid", @"deliverydate": [nsdate date] } completion:... ]; if send nsnumber instead, see -1302 error shown above.

java - How to Bypass restrictions on the hosts file in windows 8 programmatically? -

i want using hosts file in windows 8 in order block websites redirecting it, knew there restrictions put windows defender on hosts file in order prevent malicious softwares missing it, want programmatically (by java) bypass these restrictions in order edit hosts file.