Posts

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.

Logstash + ElasticSearch: initial type mapping results in missing log lines -

we have classic logstash + elasticsearch + kibana setup log aggregation. use aggregate logs across servers , applications, , we've stumbled upon following problem: first time es receives log line (a json document in our case), creates mapping document (see http://bit.ly/1h3qwc9 ). of time, properties mapped strings, in cases they're mapped dates or numbers. in latter case, if log line (from different application) has same field, string value, es fail index (throwing exception log , continue usual). workaround we've configured es ignore malformed documents (index.mapping.ignore_malformed: true), feels more of hack. any ideas how solve issue in elegant way? it sounds guys don't care date types, or type. think best solution define dynamic template define types string: { "_default_" : { "dynamic_templates" : [ { "long_to_string" : { "match" : "*", ...

sql - Invalid Identifier. Is it the concat code? -

i keep getting error "invalid identifier" , know columns right... thoughts? also, know concat coding kind of messy. offered code it: ,mp_asin.parent_asin_name || ', ' || mp_asin.color_name teen which better? select mp_asin.category_code category_id ,mp_asin.subcategory_code subcategory ,mp_asin.parent_asin ,mp_asin.parent_asin_name ,mp_asin.color_name color_name ,mp_asin.product_site_launch_day psld ,concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))) teen ,mp.brand_code brand_code ,mp.replenishment_code replen_code ,mp.replenishment_category_id replen_tier ,mp.asin asin , min(mp.replenishment_code) on (partition (concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))))) min_teen_rc , max(mp.replenishment_code) on (partition (concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))))) max_teen_r...

vb.net - Can Multiple BackgroundWorkers use the same Function / end Variable? -

is okay if let's have backgroundwoker1 backgroundwoker2 both of them having : addhandler backgroundwoker1.dowork, addressof requestdatatravelpackagesname addhandler backgroundwoker1.progresschanged, addressof showloadinganim and in other line (with different time usage) addhandler backgroundwoker2.dowork, addressof requestdatatravelpackagesname addhandler backgroundwoker2.progresschanged, addressof showloadinganim is allowed? because tried similar thing, , appeared form malfunctions. doesn't gives me error / message. frame (gui) vanished. i'm thinking perhaps because of multiple background workers have. accessing same variable (at completed function) or in similar function / etc. there's absolutely no issue you're suggesting in principle. if there's issue it's implementation. the dowork event handler method gets executed on secondary thread. it's common have same method executing on multiple threads @ same time , there'...

How do I indent a text line in TextView in android? -

i writing text in android take more 2 lines problem how indent second line text lines are. 1.my name qadeer hussain iam fine how ru. but want 1.my name qadeer hussain iam fine how ru. here second line not start right below 1 right below name use leadingmarginspan.standard spannablestring , or if need bullets use bulletspan : just create function this: static spannablestring createindentedtext(string text, int marginfirstline, int marginnextlines) { spannablestring result=new spannablestring(text); result.setspan(new leadingmarginspan.standard(marginfirstline, marginnextlines),0,text.length(),0); return result; } and then, everytime need indented line can do: mytextview.settext(createindentedtext("my text that's gonna indented", 10, 10)); the first parameter indentation of first line, second parameter indentation of next lines, in case want indent first line differently following ones.

update css on AJAX loaded html -

i loading in html ajax using jquery. triggering click event on elements within newly loaded html. i having problem setting css on newly loaded elements. here code... function updatescreen(year, month) { $.ajax({ url:'ajax_php/get_year_data.php', data: 'year=any', type: 'post', success: function(data) { $('.top-container').html(data); // highlight year $("#" + year).click(); // , month $("#" + year + ' .' + month).click(); $("#" + year + ' .' + month).css('background-color', converthex('#9fc7f5', 20)) console.log($("#" + year + ' .' + month).css('background-color')); } }); } the console.log returns expect see screen not show change in background color. can tell me why? cheers, george why doing post on get_year_data.php ? since it's getter request, more restful ge...

javascript - ASP.NET Bootstrap Modal with UpdatePanel - possible solution? -

i'm no expert, please correct me if i'm wrong. don't believe twitter bootstrap modal dialogs work when used in asp.net updatepanels. @ least, never able simple confirmation bootstrap modal dialog work one, , i've read plenty of posts it's not possible. assuming above correct, , if it's not, i'd love know answer... i wondering if there might way solve issue somehow disabling updatepanel - not disabling controls - stop updatepanel acting updatepanel. work this: user clicks button in updatepanel, calls client-side javascript disables updatepanel , pops modal dialog. when user clicks "ok" in modal dialog, client-side javascript re-enables updatepanel call server. does think possible? don't know enough javascript , client-side programming have clue how this. mean, saying "i don't know enough" makes sound know more do, if know mean. so thought i'd post (probably silly) idea , see if come way make work. thanks! ps: ...

sql server 2008 - SQL-select previous day and exclude today -

i need include records registered yesterday exclude records has been registered today. not sure if query giving me correct numer of records. please help select id, lastmodifieddate stu_tbl last_modified_date > dateadd(d, - 1, getdate())) , _last_modified_date <> getdate()) try this: select id, last_modifieddate stu_tbl last_modified_date >= dateadd(d, -1, cast(getdate() date)) , last_modified_date < cast(getdate() date)

java - Override the method -

i'm asked override method implement new behaviors, have made constructor , method. private string name; private boolean disease; public area(position pos, string name, boolean disease) { super(pos); this.name = name; this.disease = disease; } public string getname() { return name; } and method have override disease can stopped on area if medicine enough public boolean hasdisease() { return disease; } i tried using if (medicine = true) { disease = false } return disease = true; } but cause other tests fail. you used = instead of == test equality. if(medicine == true) { // <-- fixed this. disease = false } return disease = true; } you can fix more: if(medicine) disease = false return disease;

animation - Animating circle to increase and decrease in size over a period of time - matlab -

Image
i create simple visualization whereby circle (country) increase/decrease in size(base on variables) respect time. how can done on matlab current dataset ? want each circle represent country , size of circle determined value in particular year. c1990 represents year 1990 can anyhow point me in right direction or me started ? thanks here 2 possible ways start, using scatter (note area of circles proportional values of 10*d , not radius or diameter) close figure(1) d=rand(10,10) cx=1:10; cy=cx; i=1:length(d(:,2)) scatter(cx,cy,(10*d(:,i))) drawnow pause(.1) end or plotting circles manually, radius of circle corresponding d figure(2) d=rand(10,10) cx=1:10; cy=cx; phi=0:pi/100:2*pi; i=1:length(d(:,2)) k=1:length(cx) r=d(k,i); plot(cx(k)+r*cos(phi),cy(k)+r*sin(phi)) hold on end drawnow pause(.1) hold off end (you can have area or radius of circles proportional d in either case)

reporting services - Visible Export Data Feed option SSRS report -

i working on ssrs reports , need visible "export data feed" option in ssrs reports. updated tag in render section adding attribute visible="true" in reportconfig file, don't find solution. can 1 me how can solve this. thanks, sid

php - rewriterule to prevent 500 internal error with accented Characters in url -

i got unsolved problem maybe basic 1 dont find answer. problem accent characters in url, i got 500 error(error code: 500 internal server error. request rejected http filter. contact server administrator. (12217)). for instant when search "blé", in url got: /content/search?searchtext=blé , result 500 error, in blog keywords: /content/keyword/blé : (result 500 error). i have created directory out of website folder , have created alias website directory. www.mysite.com/directory if put file accented name result same! can use rewriterule change accented words non-accented or can make url accept these accents? i need , appreciate if can me. this looks issue on tmg/isa firewall. on publishing rule have enable high bit character (right click on publishing rule, configure http, general tab).

php - How to delete an item into an array with a button -

Image
i have code array saves need each time press button, these items saved array showed later erase buttons, don't know how delete it, there part of code shows meant: echo "<table border=1>"; echo "<tr class='tabpreciostitles'>"; echo "<td>nom activitat</td> <td>nom tipus activitat</td> <td>tipus tarifa</td> <td>temps/km</td> <td>preu</td>"; echo "</tr>"; ($x=0;$x<count($savedarray[4]);$x++){ echo "<tr>"; echo " <td>".$savedarray[0][$x]."</td>"; echo " <td>".$savedarray[1][$x]."</td>"; echo " <td>".$savedarray[2][$x]."</td>"; echo " <td>".$savedarray[3][$x]."</td>"; echo " <td>".$savedarray[4][$x]."</td>...

Google Search Appliances -

how customize xml output of google search applianes.we need add images , ratings in search result.by default after crawling, when go search, items on indexes not proving details users needed.how cutomize or extend searh result google search appliances. if information in metadata of indexed documents isn't being displayed in xml of results when remove proxystylesheet url parameter, try adding getfields=* url parameter.