format

How to print Array READABLE

北城余情 提交于 2020-01-16 00:45:36
问题 How do i print an Array readable? print_r($array); and var_dump($array); both produce some very ugly clutter of that $array. Ok it is what it says, it prints that array, but i'd like to have some well formated print of that array, how do i do that? 回答1: Actually, it is well-formatted but HTML ignores line breaks and double spaces. You just have to view the page's source code (CTRL+U or right-click > view source code) 回答2: echo '<pre>'; var_dump($array); echo '</pre>'; Or to a better yet

Wordpress: Style Post_Format loop-single.php using get_template_part?

[亡魂溺海] 提交于 2020-01-15 11:36:28
问题 I pretty much just want to remove the post metadata from the Gallery Posts. Here is my index.php// <?php get_header(); ?> <div id="right-content"> <?php get_template_part( 'loop', get_post_format() ); ?> </div> <div id="left-content"> <div class="inner"> <?php get_sidebar(); ?> </div> </div> Here is my single.php// <?php get_header(); ?> <div id="main-content"> <?php get_template_part( 'loop', 'single' ); ?> </div> <div class="clear"></div> <?php get_footer(); ?> What I don't understand is

dygraph on mouse over date format

◇◆丶佛笑我妖孽 提交于 2020-01-15 11:24:34
问题 Is it possible to change the format on the onMouseOver event in Dygraph? Currently the format is: YYYY/MM/DD HH:MM:SS I would like it to display as MM/DD/YYYY HH:MM:SS Is it possible to change the current format? Thanks for your assistance. Jay 回答1: You want to set the valueFormatter option on the x-axis: http://dygraphs.com/options.html#valueFormatter For example, new Dygraph(div, data, { axes: { x: { valueFormatter: function(ms) { return new Date(ms).strftime("%m/%d/%y %H:%M:%S"); } } } });

Convert EEE MMM dd HH:mm:ss ZZZ yyyy to YYYY-MM-dd JAVA

浪子不回头ぞ 提交于 2020-01-15 11:11:48
问题 I want to convert : Thu Feb 02 00:00:00 WET 2012 to 02/02/2012 (with date type not string) using JAVA. I did String date = "Thu Feb 02 00:00:00 WET 2012"; SimpleDateFormat formatnow = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy", Locale.ENGLISH); SimpleDateFormat formatneeded=new SimpleDateFormat("YYYY-MM-dd"); Date date1 = formatnow.parse(date); String date2 = formatneeded.format(date1); Date date3= formatneeded.parse(date2); System.out.println(date3); And I'm having : Thu Feb 02 00

Convert EEE MMM dd HH:mm:ss ZZZ yyyy to YYYY-MM-dd JAVA

旧时模样 提交于 2020-01-15 11:10:29
问题 I want to convert : Thu Feb 02 00:00:00 WET 2012 to 02/02/2012 (with date type not string) using JAVA. I did String date = "Thu Feb 02 00:00:00 WET 2012"; SimpleDateFormat formatnow = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy", Locale.ENGLISH); SimpleDateFormat formatneeded=new SimpleDateFormat("YYYY-MM-dd"); Date date1 = formatnow.parse(date); String date2 = formatneeded.format(date1); Date date3= formatneeded.parse(date2); System.out.println(date3); And I'm having : Thu Feb 02 00

Big Query - Convert INT to Date

为君一笑 提交于 2020-01-15 10:22:45
问题 Can not find any solution to this: Need to convert date(int) in the format - 20190101 to DATE in the format "2019-01-01" I have tried: Cast(cast(20190101 AS STRING) AS date) FORMAT_DATE("%F",CAST(20190101 AS STRING)) And so on...no success 回答1: You are looking for PARSE_DATE() : select PARSE_DATE('%Y%m%d', CAST(20190101 AS STRING)) 回答2: Below is for BigQuery Standard SQL #standardSQL SELECT PARSE_DATE('%Y%m%d', CAST(20190101 AS STRING)) 来源: https://stackoverflow.com/questions/54791436/big

Big Query - Convert INT to Date

蓝咒 提交于 2020-01-15 10:21:50
问题 Can not find any solution to this: Need to convert date(int) in the format - 20190101 to DATE in the format "2019-01-01" I have tried: Cast(cast(20190101 AS STRING) AS date) FORMAT_DATE("%F",CAST(20190101 AS STRING)) And so on...no success 回答1: You are looking for PARSE_DATE() : select PARSE_DATE('%Y%m%d', CAST(20190101 AS STRING)) 回答2: Below is for BigQuery Standard SQL #standardSQL SELECT PARSE_DATE('%Y%m%d', CAST(20190101 AS STRING)) 来源: https://stackoverflow.com/questions/54791436/big

R ggplot2 Using Italics and Non-Italics in the Same Category Label

此生再无相见时 提交于 2020-01-15 04:58:05
问题 For my ggplot figure, I want to label categories on a barplot with the first word being italicized, while the following words are non-italicized. I want the category labels to look like follows: Staphylococcacae (OTU 1) Streptococcus (OTU 300) I've found examples using expression() where I can italicize a few category labels, but I would like to be able to do this for many different categories. The code to make a plot is as follows (but my data has many more bars to plot). tmp.data <- data

ExtJS DateFormat Issue

混江龙づ霸主 提交于 2020-01-14 10:46:31
问题 I haven't found an existing question on this exact problem (there were several that were similar but did not help). I have a GridPanel with exam results, including when the exam was complete. The date returned from the SQL server is formatted like ' yyyy-mm-dd hh:mm:ss.uuu ' (2011-04-15 19:45:13.197). My problem is that even though the time is 19:45, it always displays as 7:45 AM. The dateformatter I am using in the datastore is ' Y-m-d H:i:s ' and ' F j, Y, g:i A ' in the column model. I

ExtJS DateFormat Issue

时间秒杀一切 提交于 2020-01-14 10:46:05
问题 I haven't found an existing question on this exact problem (there were several that were similar but did not help). I have a GridPanel with exam results, including when the exam was complete. The date returned from the SQL server is formatted like ' yyyy-mm-dd hh:mm:ss.uuu ' (2011-04-15 19:45:13.197). My problem is that even though the time is 19:45, it always displays as 7:45 AM. The dateformatter I am using in the datastore is ' Y-m-d H:i:s ' and ' F j, Y, g:i A ' in the column model. I