Posts

.htaccess - How does PHP create new html pages? -

as many of know when creates stackoverflow question new page generated , visible in various search engines well. wondering how php code created these pages. turns out websites have 1 page, profile.php , loads data mysql database. question follows: if there 1 physical file how can url change , how google list of pages/profiles/question sites stackoverflow or facebook if there 1 actual page? look @ url page question on: http://stackoverflow.com/questions/39457314/how-does-php-create-new-html-pages there isn't physical file on server's harddrive it. there's 1 master script called "show question page". happen, in general, dynamically generated page: user clicks or otherwise surfs dynamic page webserver accepts request, , triggers rewrite on url url gets changed "friendly" url "ugly" internal one. while stackoverflow isn't written in php, if was, you'd end internally: http://stackoverflow.com/showquestion.php?id=3945...

WordPress Genesis child-theme - why doesn't it pull parent css? -

i'm new genesis framework , confused it's child-themes. genesis theme has it's own theme stylesheet you're required install child-them use genesis. child-themes i've seen (ex. genesis sample http://demo.studiopress.com/genesis-sample/ ) totally recreate stylesheet. seems pointless me—can tell me missing? there best-practice way import parent style sheet , customize child styles off of it? if child theme relied on genesis style sheet, then, when genesis changes style.css (as did 2.3.0 , may future versions), update genesis (which may applied automatically depending on setup) break of site. another reason, including genesis/style.css , , your-child-theme/style.css http request (with subsequent overhead) may impact performance slightly, if not on http/2 .

java - Test Memory Efficiency Comparing Data Structures on a Large Data Set -

is there online resource can use simulate how snippet of code perform on large data set , provide me metrics? otherwise method suggest achieve this? (in case, want see how linkedlist vs arraylist perform in terms of memory usage (being able view bottlenecks on period of time amazing) on inserting list of things them read 5gb file) thanks! you can use memory profiler, oracle jdk has 2 of them visualvm , jmc you can take full gc , see how memory used looking @ total heap size. on hotspot, system.gc(); honoured default. being able view bottlenecks on period of time amazing this cpu , memory profiler designed for.

sql - How to compare temporary columns created from select in order to calculate SLA? -

this whole query have now, first part seems fine starting "y as" shows columns underlined red. have marked statements in bold shows red underline. need calculate percentage of sla not able figure out query. business hours saturday-sunday 4:30 5:30pm , mon-friday 4:30am 10:30pm. select [job_ticket].[job_ticket_id], [job_ticket].[report_date], [job_ticket].[first_response_date], [job_ticket].close_date, ,[job_ticket].last_updated, [priority_type].[priority_type_name] 'ticket_priority' , datediff(minute, report_date,first_response_date) 'time_to_accept' , sum (case when (datediff(minute,report_date,first_response_date) <= '10' ) 1 else 0 end) "sla time_to_accept status", datediff(minute,[job_ticket].[first_response_date],[job_ticket].[close_date]) 'time_to_resolve' , (case when priority_type_name='low' sum(case ...

type conversion - Java BigDecimal data converting to opposite sign long -

according java 7 documentation , method longvalue class java.math.bigdecimal can return result opposite sign. converts bigdecimal long. conversion analogous narrowing primitive conversion double short defined in section 5.1.3 of java™ language specification: fractional part of bigdecimal discarded, , if resulting "biginteger" big fit in long, low-order 64 bits returned. note conversion can lose information overall magnitude , precision of bigdecimal value return result opposite sign . in case possible? it possible whenever value of bigdecimal larger long can hold. example: bigdecimal num = new bigdecimal(long.max_value); system.out.println(num); // prints: 9223372036854775807 system.out.println(num.longvalue()); // prints: 9223372036854775807 num = num.add(bigdecimal.ten); // num large long system.out.println(num); // prints: 9223372036854775817 system.out.println(num.longvalue()); // prints:...

apache spark - Scala: Xtream complains object not serializable -

i have following case classes defined , print out clientdata in xml format using xstream. case class address(addressline1: string, addressline2: string, city: string, provincecode: string, country: string, addresstypedesc: string) extends serializable{ } case class clientdata(title: string, firstname: string, lastname: string, addrlist:option[list[address]]) extends serializable{ } object ex1{ def main(args: array[string]){ ... ... ... // in below, x try[clientdata] val xstream = new xstream(new domdriver) newclientrecord.foreach(x=> if (x.issuccess) println(xstream.toxml(x.get))) } } and when program execute line print each clientdata in xml format, getting runtime error below. please help. exception in thread "main" org.apache.spark.sparkexception: task not serializab...

PHP date_sub. can't substract today and date -

i trying output number of days between today , date enter have problem encounter error: "warning: date_diff() expects parameter 2 datetimeinterface" what's problem ? <?php $today=date("y-m-d"); $date=date_create("2016-09-16"); echo date_diff($date,$today); ?> your problem lies in when using date_diff have make sure you're comparing objects actual date objects. return type date_diff dateinterval object. you're treating string. $today = new datetime(); // $today datetime object $date = new datetime("2016-09-16"); // $date datetime object! $diff = date_diff($date,$today); // compare 2 objects of same type ftw! echo $diff->days; // $diff dateinterval object, echo it's 'days' property. // output: 3 (as of writing) further reading: http://php.net/manual/en/class.dateinterval.php http://php.net/manual/en/class.datetime.php http://php.net/manual/en/function.date-diff.php ...