formatting

How would I go about parsing a text file of thousands of DNA bases?

笑着哭i 提交于 2019-12-11 14:25:11
问题 Here's what I would have, I would have a massive text file of a bunch of dna bases (A, T, C, G) and what I would like to do is take every 60 characters (arbitrary) and put it on a new line so that way the bases get separated out in chunks. But, I would also like for there to be overlap of each chunk by a certain number of bases. For example, if this 10 letter chunk ATGGCTGCTA was given, and the initial 4 block chunk was ATGG, if there overlap parameter was specified to be 2, then the next 4

How to pad the integer withe preceeding 0?

£可爱£侵袭症+ 提交于 2019-12-11 13:38:13
问题 I am having an integer value like 6 or 65 . If the value is single digit I want to display it like 06 and if it is 65 then as it is ( 65 only ) . I have searched into the NSNumberFormatter class of iphone but not getting what to do exactly . Can any one help me in this ? Thanks in advance !! 回答1: Use %02d format specifier, e.g. NSLog(@"%02d", number); That will output integer number with at least 2 characters length and output will be padded with leading zeroes if required 回答2: For using the

DataGridView Different cell formatting in same column possible?

半世苍凉 提交于 2019-12-11 13:30:01
问题 Again need help from this awsome comunity. I have a WinForms app with DataGridView to display some data. There are especcialy two columns that are important to me. One is "Unit" and the second one is "Value". Unit has strings inside format and Value has numeric values. I would like to format the Value in each DataGridViewRow depending on what the Unit is. For example: if unit is 'piece', I need Value to be int (no decimal places). If unit is 'mm', I need to divide Value with 1000 and show two

Conditional change of text colour inside table cell

人盡茶涼 提交于 2019-12-11 13:24:21
问题 I'm try to use jQuery to conditionally change the color of some table cells. I have a table: <tr> <td>Class Code</td> <td class="qty">3</td> <td>Science</td> </tr> <td>Class Code</td> <td class="qty">4</td> <td>Science</td> </tr> . . . A style definition lowqty{color:red;} I want to change the color of the second column when the number is below 4 . I'm attempting to do that with the following, but haven't got it to work. $('.qty').change( function() { if ($(this).text() <= 3 ) { $(this)

E-Mail body is lost when sending (outlook vba)

狂风中的少年 提交于 2019-12-11 12:02:22
问题 I'm trying to write a macro that sends an automatic notification to specific addresses before sending the original email. (Like a cc, without actually using cc.) The content of the original formatted email, (including text, tables, and pictures,) should be copied and pasted into a new email which is then automatically sent. Everything works when I just display the message, but not when actually sending the email. Here is my code: Dim objMsg As Outlook.MailItem Dim activeMailMessage As Outlook

WPF - TextBlock - Cannot override OnRender

∥☆過路亽.° 提交于 2019-12-11 11:52:53
问题 I am creating a custom control by deriving TextBlock, my intention is to do some custom rendering based on some dependency properties. However the OnRender method is sealed on TextBlock. Although I can get my work done by overriding OnRenderSizeChanged, this is not correct. Any ideas on how can i do it the right way? Thanks in advance. 回答1: In WPF you normally work with styles or Control templates to change the appearance of a control. You can download templates for all controls from

Converting Strings in Excel to Dates

99封情书 提交于 2019-12-11 10:57:53
问题 We imported a bunch of data into cells. But when you click on the cell, their is an apostrophe before the data, so it thinks its a string. By removing the apostrophe, the data gets recognized as dates. How do I avoid doing this by hand? 回答1: Use a column beside the dates column. Add a formula like this one: =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)) it will vary depending on your date format, copy this formula for all rows. Then copy the results, and do a paste special where you paste values.

Formating a date in excel when combining text from multiple cells

烂漫一生 提交于 2019-12-11 10:47:44
问题 I have an excel sheet with some text in numerous cells and need to combine them into one cell. Easy, except one of the cells is a date and when combining the text you get the date in base number format and not in date format. Example: A1 = "One" A2 = "Two" A3 = "05.12.2012" A4 = =A1&" "&A2&" "&A3 = "One Two 41248" Anyone know what I need to do before A3 in order for the formula to return 05.12.2012 instead of 41248. I have tried "DATE" and "DATEVALUE" etc. If it is relevent, the date is

XSLT decimal-format causes exception

一曲冷凌霜 提交于 2019-12-11 10:42:57
问题 I am trying to use the xslt:decimal-format element, but I get the same error message whether I use my own code or the example code provided by w3schools.com. This is the w3 sample code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/> <xsl:template match="/"> <xsl:value-of select="format-number(26825.8, '#,###.00', 'euro')"/> </xsl:template> </xsl:stylesheet> And this is the

What would be a good way of determining number of decimal places from a format string?

寵の児 提交于 2019-12-11 10:35:26
问题 I'd like a function that looks like this: int GetDecimalPlaces(string format, IFormatProvider formatProvider = null); The inputs would be exactly the same as those which can be legally passed to methods responsible for formatting numbers, e.g., double.ToString , decimal.ToString . The output would be an int indicating the lowest number of decimal places required by the format string. So here are a couple of example inputs/outputs I would expect (let's just say leaving formatProvider as null