formatting

Visual Studio 2008 HTML formatting - does it ever work?

此生再无相见时 提交于 2019-12-21 05:13:15
问题 It's another Visual Studio 2008 HTML formatting question...I think I have either found a bug in the infamously bad VS HTML formatting, or I'm doing something wrong. Here's what I'm doing: I remove all client side tags via: Tools -> Options -> Text Editor -> HTML -> Format -> Tag Specific options I then add b and span tags: alt text http://www.xtupload.com/new/thumb-3BB0_49B92330.jpg I press CTRL+E,CTRL+D and I get these two differing results: 1 alt text http://www.xtupload.com/new/image-CBF1

Format Double as Fraction [closed]

…衆ロ難τιáo~ 提交于 2019-12-21 04:34:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Is there a library that will convert a Double to a String with the whole number, followed by a fraction? For example 1.125 = 1 1/8 I am only looking for fractions to a 64th of an inch. 回答1: Your problem is pretty simple, because you're assured the denominator will always divide 64. in C# (someone feel free to

how to change color of a column in datagridview?

不羁岁月 提交于 2019-12-21 03:38:08
问题 I have a DataGridview, and I'm setting some of the columns to readonly for data entry purposes. When I do that, the column stays the normal white (although it does not allow entry). How can I color the column gray? I've seen lots of samples on how to color rows, but not columns. How can I make the readonly columns look gray? 回答1: Try setting the DefaultCellStyle property for the selected columns. Edit: grid.Columns["NameOfColumn"].DefaultCellStyle.ForeColor = Color.Gray; 回答2: just change the

Formatting timestamps

不羁的心 提交于 2019-12-21 03:16:11
问题 How do you format Rails timestamps in a more human-readable format? If I simply print out created_at or updated_at in my view like this: <% @created = scenario.created_at %> Then I will get: 2009-03-27 23:53:38 UTC 回答1: The strftime (from Ruby's Time) and to_formatted_s (from Rails' ActiveSupport) functions should be able to handle all of your time-formatting needs. 回答2: Take a look at the I18n functionality. It allows you to do the following in your views: <%= localize(scenario.created_at,

A “safe” python HTML text formatting (ala textile)

会有一股神秘感。 提交于 2019-12-21 02:53:11
问题 I've been looking around for an existing python library in the style of textile to format text for users to enter. If it was just me entering it, just textile would have been fine, but since the input is meant for a django app that will take user input and display it, while still maintaining some formatting. I managed to find little loopholes here in there in the existing libraries I saw. They sometimes wouldn't escape things the way they should have, would let me input straight HTML and the

Export custom formatted expressions from Mathematica

我的梦境 提交于 2019-12-20 23:47:32
问题 How can I get Mathematica to export/save/write a text file with proper Fortan77 formatting, that is, 72 columns and a continuation marker on the sixth column? I am using Mathematica to generate large and complex analytic expressions, which I then need to insert into pre-existing Fortran77 code. I have everything working correctly in the front end of Mathematica with FortranForm[] and SetOptions[$Output, PageWidth -> 72] However, I can't figure out how to get Mathematica to output correctly to

Convert Unix Timestamp to human format in Django with Python

╄→尐↘猪︶ㄣ 提交于 2019-12-20 23:29:15
问题 I'd like to a convert unix timestamp I have in a string (ex. 1277722499.82) into a more humanized format (hh:mm:ss or similar). Is there an easy way to do this in python for a django app? This is outside of a template, in the model that I would like to do this. Thanks. edit I'm using the python function time.time() to generate the timestamp. According to the doc: time.time() Return the time as a floating point number expressed in seconds since the epoch, in UTC. Note that even though the time

Utility to auto insert semicolons in JavaScript source code?

泪湿孤枕 提交于 2019-12-20 19:36:14
问题 I'm working with code from multiple developers, some of whom are inconsistent in their use of semicolons, and I just want them after every line for consistency (and to prevent any masking of errors). I use Aptana to format my source code, but it won't add semicolons for you AFAIK. 回答1: Ah ... just discovered YUI compressor has a preserve semicolons options that will actually add the semicolons to the appropriate lines. Then it's just a matter of sending the minified, unmunged version back

Utility to auto insert semicolons in JavaScript source code?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 19:36:01
问题 I'm working with code from multiple developers, some of whom are inconsistent in their use of semicolons, and I just want them after every line for consistency (and to prevent any masking of errors). I use Aptana to format my source code, but it won't add semicolons for you AFAIK. 回答1: Ah ... just discovered YUI compressor has a preserve semicolons options that will actually add the semicolons to the appropriate lines. Then it's just a matter of sending the minified, unmunged version back

Add pch symbol in R plot legend

不问归期 提交于 2019-12-20 17:35:16
问题 I have one time series which is represented by a black line and one which is represented by a red curve. Then I have single points which have the pch symbol of 8 in R. These are stars. See the following plot: Currently I have the following legend: legend("bottomleft", legend=c("log loss","daily VaR","exceedance"), bty = "n",lwd=2, cex=1.2,y.intersp=1.4, col=c("black","red","blue"), lty=c(1,1,1)) But I don't want to have a blue line in the legend for exceedance, but just the stars in the plot.