formatting

Controlling format/placement of axis labels when plotting 2D table objects in R

孤街浪徒 提交于 2019-12-11 01:24:40
问题 I'd like to gain greater control over axis label size and placement when plotting a 2-dimensional table in R, but the plotting rules seem to work differently for table objects than for data frames. To make my questions concrete, I've pasted in fake data at the end of this message using dput() . Running that code will create the dept.table object used in the plotting code below. When you run plot on a 2D table in R, it creates a mosaic plot, as in the following: plot(dept.table, col=c("yellow"

C++ Text File Reading

浪尽此生 提交于 2019-12-11 01:15:15
问题 So I need a little help, I've currently got a text file with following data in it: myfile.txt ----------- b801000000 What I want to do is read that b801 etc.. data as bits so I could get values for 0xb8 0x01 0x00 0x00 0x00. Current I'm reading that line into a unsigned string using the following typedef. typedef std::basic_string <unsigned char> ustring; ustring blah = reinterpret_cast<const unsigned char*>(buffer[1].c_str()); Where I keep falling down is trying to now get each char {'b', '8'

Showing a code snippet in an HTML page

∥☆過路亽.° 提交于 2019-12-11 01:07:59
问题 Like there is a code sample inserter in the stackoverflow's WYSIWYG text editor (see image here) I want such a formatter to show a code snippet in an html page with colored keywords and strings etc. Please help. 回答1: Check out google code prettify: http://code.google.com/p/google-code-prettify/ 回答2: Check http://code.google.com/p/syntaxhighlighter/ it's pretty popular and awesome. 回答3: This maybe? http://plugins.jquery.com/plugin-tags/syntax 回答4: Geshi is quite awesome too: http://qbnz.com

How would you implement auto-capitalization in JavaScript/HTML

烂漫一生 提交于 2019-12-11 00:50:43
问题 I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX page as a user types. This can be an IE specific solution (IE6+). I currently capture every keystroke (down/up) as the user types to support a separate feature called "macros" that are essentially short keywords that expand into formatted text. i.e. the macro "so" could auto expand upon hitting spacebar to "stackoverflow". That said, I have access to the keyCode information, as well I am using the

JFormattedTextField destroys DocumentFilter

余生长醉 提交于 2019-12-10 23:40:12
问题 I have a Problem with the JFormattedTextField (I use it as a base class for all of our text fields). Today I tried to add a document filter to the document of this field which works just fine, but only as long it doesnt have a formatter factory set. The Problem is, when the formatter factory is set (in my case the default classes) and processFocusEvent is called following happens (JFormattedTextField.java:595): // if there is a composed text, process it first if ((ic != null) &&

easy hex/float conversion

核能气质少年 提交于 2019-12-10 23:38:41
问题 I am doing some input/output between a c++ and a python program (only floating point values) python has a nice feature of converting floating point values to hex-numbers and back as you can see in this link: http://docs.python.org/library/stdtypes.html#additional-methods-on-float Is there an easy way in C++ to to something similar? and convert the python output back to C++ double/float? This way I would not have the problem of rounding errors when exchanging data between the two processes...

Visual Studio 2017 C# Formatting: One-Line If Statements

*爱你&永不变心* 提交于 2019-12-10 23:35:02
问题 In Visual Studio 2017 for C#, is there a way to leave one-line if statements on one line without affecting the formatting of other control blocks? The "Place open brace on new line for control blocks" rule under "Text Editor > C# > Code Style > Formatting > New Lines" will allow if statements to remain on one line, but it will also force all other control blocks to have the curly bracket on the same line. For example, I'd like the following statement's formatting to be left alone: if(x ==

JavaFX Set an Input filter by Pattern on a TextField

空扰寡人 提交于 2019-12-10 23:16:51
问题 I can't believe I haven't been able to find anything on this. It has to be a very common use-case. I want to set my TextField (JavaFX) up so that the user is limited to entering data by pattern. For example, a standard US telephone number with a pattern like (###) ###-####. I have no problem formatting after the fact, and I see lots of tutorials/examples on restricting input to just numbers and the "(", ")", and "-" in the right places, but I don't want the user to have to enter the

jqGrid - date & time format not being applied

こ雲淡風輕ζ 提交于 2019-12-10 22:12:49
问题 I have a jqGrid that displays 3 columns, one of which is a date-time (SQL Datetime field that is being returned). The colModel settings follow: colModel:[ {name:"col1",....,sortable:false}, {name:"col2",....,sortable:false}, {name:"SendTime",index:"SendTime",width:col3width,align:"left",formatter:"datetime",formatoptions:{srcformat:"ISO8601Long",newformat:"LongTime"},xmlmap:"SendTime",sortable:false} ], The date that is being returned from SQL is in the following format: YYYY-MM-DDTHH:mm:ss

Formatting HTML code in PHP [closed]

孤街醉人 提交于 2019-12-10 21:23:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . How could I use PHP to format HTML code that has had all whitespace stripped? 回答1: Use HTMLTidy: http://php.net/manual/en/book.tidy.php 来源: https://stackoverflow.com/questions/4699487/formatting-html-code-in-php