I just posted a code snippet [here](https://www.daniweb.com/programming/code/515601/vbscript-implementation-of-quicksort) and noticed a couple of problems. 1. No matter how I try to fix it, the frst line refuses to display properly indented. 1. The few lines of code that I included in the top window, even though properly indented, refuse to display as properly formatted code.

Member Avatar
Member Avatar
+0 forum 3

I am making a text adventure and would like the command line window to be a specific size when you run the .py file in the command line window. eg. 300 wide by 250 height. I found a thread on here that shows how to specify the text colour which I also wanted to know. [url]http://www.daniweb.com/forums/post1150939.html#post1150939[/url] Can anybody help? Thanks.

Member Avatar
Member Avatar
+0 forum 11

Howdy I have a timespan that contain in excess of 24 hours. For the example lets use a value of 1 day 6 hours and 32 minutes. I would like to get this into a string that displays "30:32". Have so far tried something along the lines of `string.Format("{0}:{1}", TimeSpan.TotalHours, TimeSpan.Minutes)` however this gives me a scenario where it'll display 13:0 rather than 13:00 which I also failed to resolve.

Member Avatar
Member Avatar
+0 forum 2

In this thread: https://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/495011/jquery-gallery/3 I tried to format the html in the editor without success. I narrowed it down to <script> tags. All lines prior to the <script> tags seem to be missing a new line and HTML looks as if it's been posted as one long line. If a mod/admin, you can see the underlying format (in Edit Post view) is correct, but not viewed properly.

Member Avatar
Member Avatar
+2 forum 5

a) Program code is often written using procedures. Give THREE advantages of using procedures in programming. b) Write an algorithm (pseudocode or flowchart) for a procedure to validate the input of a date in February in any year. The date should be input in the form ddmmyyyy e.g. 07021998 You will need to store each numeric part of the date separately and validate each part. Include a calculation to determine whether the year entered is a leap year and then check that day is within the allowed range – in a leap year there are 29 days in February otherwise …

Member Avatar
Member Avatar
-2 forum 6

I wanted to format this string but I don't know how I can do the formatting part at all. class MyTime: def __init__(self, hrs=0, mins=0, secs=0): self.hours = hrs self.minutes = mins self.seconds = secs if self.seconds >= 60: self.minutes += self.seconds // 60 self.seconds = self.seconds % 60 if self.minutes >= 60: self.hours += self.minutes // 60 self.minutes = self.minutes % 60 if self.hours >= 24: self.hours = self.hours % 24 def get_sec(self): return (self.hours * 60 + self.minutes) * 60 + self.seconds def __str__(self): return "{:02d}:{:02d}:{:02d}".\ format(self.hours, self.minutes, self.seconds) def increment(self, t): totalsec = self.get_sec() + t return …

Member Avatar
Member Avatar
+0 forum 3

Could you tell me how I can use the .docx file with Visual Studio 2013 but only with C++ code, and in my application **without** using **MS Word** or another wordprocess. Thanks. I wanna change formatting(bold italy, centre..) and text in .docx-files.

Member Avatar
Member Avatar
+0 forum 1

I'm working with a LIST that am getting from a soup which after the clean up gives me: lists of variable length ['7.0', '7.5', '6.8', '6.9'] or ['7.0', '7.5'] so my problem is when I try formating the output: code snippet: if grades: print '\r\n["' + str(student[0]), if len(grades) == 1: print print ('%s'*len(grades)) % tuple(grades) the output of this is: >> ["John Doe 7.0 7.5 6.8 6.9 however what I need is: ["John Doe, ["7.0","7.5"],["6.8","6.9"]] or ["John Doe, ["7.0","7.5"]] I've tried with Formatter and Template and seems can't be done with those. thank you

Member Avatar
Member Avatar
+0 forum 5

Right now I'm typing in consolas, a favorite font among programmers but as soon as I submit this post, all that I've written will be in Arial. I'm sorry but, I hate Arial. I can't stand the narrow words. I almost always have to stop and examine each word individually and code doesn't look good in Arial. I don't want the storm dissonance to rage within me whenever my "consolas" goes Arial. I can stand Courier New, Comic Sans, Droid Sans, Monaco and even Times New Roman but I can't, I can't stand Arial. It's time for change.

Member Avatar
Member Avatar
+0 forum 3

Ok so I'm writing a program that outputs text to a file. Currently, I am writing it to a .TXT file for ease and convenience. Ideally, I would like to output some of the information so that it is formatted with Italics. I'm thinking that using a RTF file would be simplest but i'm not entirely sure as I have never bothered with this problem. Any help of guidance would be appriciated. Also if suggesting a file type, do you know of any useful Websites that have tutorials or guides to outputting formatted text using java. Thank you in advance

Member Avatar
Member Avatar
+0 forum 7

When lloking through code snippets on PHP, I noticed that formatting/indentation is looking a little strange. Example: http://www.daniweb.com/web-development/php/code/430455/configurable-table-class ![ef419832f9f07668996122411aaec172](/attachments/large/0/ef419832f9f07668996122411aaec172.png "ef419832f9f07668996122411aaec172")

Member Avatar
Member Avatar
+0 forum 2

I want to format today's date like this dd/mm/yyyy Please help me

Member Avatar
Member Avatar
+0 forum 8

Have a look at this thread... http://www.daniweb.com/web-development/databases/mysql/threads/466095/create-.mdf-file-from-mysql My machine shows seems to reformat this to plain text. So just plain page of text. Using Chrome/W7. Anybody else?

Member Avatar
Member Avatar
+0 forum 7

I am making a project in Number Theory and i want to display some formatting text in a textArea in my Gui. I have a method named padding which takes an integer as an argument and return a String consisitng of a number of spaces. This number is 12 - the number of the given integer length. public String padding(int number){ int NumberOfDigits ; String padding = ""; NumberOfDigits = 12 - Integer.toString(number).length(); for (int j = 0; j < NumberOfDigits; j++) { padding +=" "; } return padding; } I am using this method like this : for (i …

Member Avatar
Member Avatar
+0 forum 2

Please i need a sm1 to tel me how to correctly format my codes if i want to post them on daniweb

Member Avatar
Member Avatar
+0 forum 1

I have the following code which works fine to format text from an SQL table. It seems a little long winded though. It will create paragraphs from the line breaks but ignore header and list tags (not wrap those in "p" tags. Can anyone see an obvious way to condense this? <?php function format_html($content) { $content = str_replace("<h1>\r\n", "<h1>", $content); $content = str_replace("</h1>\r\n", "</h1><p>", $content); $content = str_replace("<h2>\r\n", "<h2>", $content); $content = str_replace("</h2>\r\n", "</h2><p>", $content); $content = str_replace("<h3>\r\n", "<h3>", $content); $content = str_replace("</h3>\r\n", "</h3><p>", $content); $content = str_replace("<h4>\r\n", "<h4>", $content); $content = str_replace("</h4>\r\n", "</h4><p>", $content); $content = str_replace("<h5>\r\n", "<h5>", $content); …

Member Avatar
Member Avatar
+0 forum 2

Hey Guys, I'm want to output a calculation to a JLabel. Example: double num1 = 14; double num2 = 3; double ans; ans = num1/num2; JLabel jl = new JLabel(); add(jl); jl.setText("The Answer is: " + ans); Currently the answer for this will be 4.666666667. Now if this was a System.out statement I could have just done: `System.out.printf("The answer is: %.2f", ans);`. However, I can't. So what can I do to make the number diplayed in the JLabel look like 4.66. Thank-you

Member Avatar
Member Avatar
+0 forum 3

Hi Everyone, I have been trying to teach myself how to code for more than a year now, having started with VBA and then switching to c++. Recently I have been forced to confront how horrific my coding practices are, and have been doing pennance by trying to modify 1500 lines of spaghetti code for a different, but related project. My questions is not about any specific code, but rather seeking guidance on how a project is best organized. I understand that class declarations go into header files and contain function prototypes, but where should I flesh out the function? …

Member Avatar
Member Avatar
+0 forum 1

Hi! Need help with conditional formatting of table rows... What i need to acheave is to change table row background in red if date_needed is <= than 48 hours than now(). This is what i have now `if (date('d',strtotime($data['date_needed'])) <= 2) $row["rowstyle"]='style="background:red"';` it works in a way... It changes background color for 1. and 2. of the month, but that is not what i need... Must mark rows where dedline is less or equal to 48 hours. Thank you!

Member Avatar
Member Avatar
+0 forum 4

Hi all I'm trying to shade a cell based on a date difference between column 7 & 8. It seams to work accept column 8 seams to be the one being shaded instead of column 7. I have googled but can't find a solution to have the calculatin being made on when column 8 being loaded but the formatting being applied to column 7. Private Sub gvStatus_CellFormatting(ByVal sender As Object, ByVal e As DataGridViewCellFormattingEventArgs) Handles gvStatus.CellFormatting Dim Closing, Tobemeasured, tobedesign As Date Dim NumberOfWeeks As Integer If Not IsDBNull(gvStatus.Item(6, e.RowIndex).Value) Then Closing = gvStatus.Item(6, e.RowIndex).Value End If Select Case e.ColumnIndex …

Member Avatar
Member Avatar
+0 forum 5

I'm curious. Why is so much code in this forum formatted like this [CODE]if (something) { do something } else { do another thing }[/CODE] rather than [CODE]if (something) { do something } else { do another thing }[/CODE] The first version is harder to read and takes up more lines, which means more blocks spanning more than 1 window vertically. The second version is easier to read, more compact, and is the style consistently used in the Java Language Specification, the Sun/Oracle tutorials, and the source code of the API itself. So why do people persist in using version …

Member Avatar
Member Avatar
+0 forum 19

Hi there! I am new to daniweb.com and C++ CLI. I am trying to make a program that will tell the user the text for the ListItem number they type in. The ListItem information is stored in a text file with my custom file formatting, which is: <~ListItem 1> text.... <~EndOf 1> <~ListItem 2> text.... <~EndOf 2> etc. I have been thinking of a strategy for days, but I can't find out anything. Thank you very much in advanced!

Member Avatar
Member Avatar
+0 forum 3

[CODE] Dim mDocDtT As Date Dim mDtPeriod as Integer = 4 mDocDtT = DateAdd(DateInterval.Month, mDtPeriod, mDocDtT) mDocDtT = Format(mDocDtT, "yyyy-MM-dd") [/CODE] But the codes are not working the date is still in #01/27/2011# format I want it in yyyy-MM-dd format Please help!!!

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, When I purchased my hard drive, its size was 1TB. Iformatted it a few times and I don't know why and how it has lost 70GB. Is there a way that I can get it back up to its original size? if yes, Will I be able to do the remove operation on it while it is plugged in?

Member Avatar
Member Avatar
+0 forum 8

I want to know if it possible for a code to automatically format a video once uploaded by a user to my website.

Member Avatar
Member Avatar
+0 forum 8

This is a program which I made back in the beginnings when I was trying to figure out how to work with strings, and how to work with files. This is suppose to format a C++ code, for example if the syntax of an if statement is if (condition) { do stuff; } if will format it to if (condition){ do stuff; } same as for `while` and `for` loops. It will also format the return values, if for example the syntax is return value; it will enclose `value` in open brackets `()` etc.

Member Avatar
Member Avatar
+0 forum 2

Hello all, Ive done some googling around, and cant find anything that explains why my date isnt being formatted to what i tell it. my code: dim date_now as date date_now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") So for example if the date/time is February 11 2015, 4:44:23pm it would be formatted as: 2015-02-11 04:44:23 Can somebody explaain where i have gone wrong? regards James

Member Avatar
Member Avatar
+0 forum 3

Working in Word 2010, I have a long document with many formatting changes to be made. To start with, throughout the document I'd like to replace "Click OK" with "Click [B]OK[/B]", so the OK will be bold but not "Click". I also need it to be case insensitive, as some places may be "Click ok" or "click OK" etc. There are other things I need to do as well, but this would get me started. I assume this requires a VBA macro, as Word search and replace doesn't seem to be able to handle formatting in only part of the …

Member Avatar
+0 forum 0

How can I formate my storage device using XP SP3.

Member Avatar
Member Avatar
+0 forum 2

Hi-- I am new to C++ and am having trouble with this program: The objective is to take input from a file and write it to output, using the '|' character as the delimiter, but displaying it using a comma (ex, if line 1 is "1000|6 1 6 5 3 2 | Paramus | NJ", the output would be "1000, 6 1 6 5 3 2, paramus, NJ". (the six random numbers are supposed to be test question responses, but that's largely irrelevant.) What i have so far is as follows: [CODE]ifstream reader; reader.open("SurveyResponse.txt"); char line[15]; int i=0; while( !reader.eof() …

Member Avatar
Member Avatar
+0 forum 1

The End.