I get data from a database in YYYY-mm-dd format, but I want to show just dd.mm (example - I get 2010-05-28; I want to show 28.05)
Could you help me?
Thanks
Hi all.., I have number : 1, 2, 3, 4, 10
But I wanna print that number
0001
0002
0003
0004
0010
I have search in google, the keyword is number format. but I've got nothing, I just get, frmat decimal such ass 1,000,000.00. hope you can suggest me a reference or give me some problem solving.
Thanks,
I want to perform some action ONLY IF my string has a meaningful value. So, I tried this.
if (!myString.eqauls("")) {
doSomething
}
and this
if (!myString.eqauls(null)) {
doSomething
}
and this
if ( (!myString.eqauls("")) && (!myString.eqauls(null))) {
doSomething
}
and this
if ( (!myString.eqauls("")) && (myString!=null)) {
doSomething
}
and this
if ( myString.length()>0) {
doSomething
}
And in all cases my program doSomething in spite on the fact that my string IS EMPTY. It equals to null. So, what is wrong with that?
Is there a better way to print the + sign of a digit on positive numbers?
integer1 = 10
integer2 = 5
sign = ''
total = integer1-integer2
if total > 0: sign = '+'
print "Total:%s%d" % (sign, total)
I installed Doxygen 1.6.1.
I used \section, \subsection and \subsubsection for titles in C++ sources.
I surprisingly obtained titles in which \subsubsection have large font size than for \subsection and \section.
How can this be fixed?
CSS should be used to workaround this or can I fix my doxygen installation to obtain expected common behavior?
i need to bold some text as i add them to the richtextbox control, currently here is my code
With txtDetails
If Not IsNullOrEmpty(title) Then
.SelStart = Len(.Text)
.Text = .Text & title
.SelLength = Len(title)
.SelBold = True
.SelLength = 0
.Text = .Text & vbNewLine
End If
If Not IsNullOrEmpty(value) Then
.Text = .Text & value & vbNewLine
End If
.Text = .Text & vbNewLine
End With
can anyone help me with the fix
I have a reStructuredText document. rST uses =====, etc. as a heading format.
However I need to include some lines that have this text in it, e.g.:
some of my text
=====
stuff
=====
some more of my text
And I don't want the ==== to be interpreted as a heading, i.e. I don't want stuff to be a heading. I would rather that those equal signs are just displayed as is.
Is this possible in rST?
hi
i want to design a theme for postnuke cms.
and want to use css condition in the template files.
postnuke use smarty tag like
<!--[if $n eq ''] -->....<!--[/if]-->
so when i use
<!--[if lt IE 7]>....<![endif]-->
it gives some errors about tags.
what can i do?
How do you put an "IF DEBUG" condition in a c# program so that, at run time, it will ignore a set of code if you are running in Debug mode and yet, execute a block of code if the program is not running in debug mode? A situation where this can be used is if a time stamp is taken at the start of a block and another time stamp is taken at the end. THey will hardly differ at run time. Yet, if you are stepping through the code in debug mode, they will differ a lot, and error conditions in an "if block" might be kicked off leading to the untimely (pun) execution of some code.
I want to add 'Year' or Years' to the end of a string depending on the string.
Like this:
$("#selector").val(conditional_value_here);
Using jQuery UI I have a slider that manipulates a value:
$("#slider").slider({
value: 1,
min: 1,
max: 25,
step: 1,
slide: function(event, ui) {
$("#amount").val(ui.value + ' Year' + function(){return (ui.value == 1) ? '' : 's';} );
}
});
// and again I want to do the same for the initialization of the value:
$("#amount_3").val($("#slider_3").slider("value") + ' Jahr' + function(){return ($("#slider_3").slider("value") == 1) ? '' : 's';});
This does not work. What is the correct way to to this?
I have this if condition,
if (sendSMS(Convert.ToInt32(DLComportNo.SelectedItem.Text), TxtDriMob.Text,
TxtCliDet.Text) && sendSMS(Convert.ToInt32(DLComportNo.SelectedItem.Text),
TxtCliMob.Text, TxtDriDet.Text))
{
// I am inserting details to my db
}
and my sendSMS method looks like this,
private bool sendSMS(int portNo, string mobNo, string details)
{
try
{
SerialPort SerialPort1 = new SerialPort();
SerialPort1.PortName = "COM" + portNo.ToString();
SerialPort1.BaudRate = 9600;
SerialPort1.Parity = Parity.None;
SerialPort1.DataBits = 8;
SerialPort1.StopBits = StopBits.One;
SerialPort1.RtsEnable = true;
SerialPort1.DtrEnable = true;
SerialPort1.Encoding.GetEncoder();
SerialPort1.ReceivedBytesThreshold = 1;
SerialPort1.NewLine = Environment.NewLine;
SerialPort1.Open();
SerialPort1.Write("AT" + SerialPort1.NewLine);
Sleep(500);
SerialPort1.Write("AT+CMGF=1" + SerialPort1.NewLine);
Sleep(500);
SerialPort1.Write("AT+CMGS=" + (char)34 + mobNo + (char)34 +
SerialPort1.NewLine);
Sleep(1000);
SerialPort1.Write(details + (char)26);
Sleep(2000);
SerialPort1.Close();
}
catch
{
}
return true;
}
What happens is when i use break point in my sendSMS i get my output (ie) both the methods get executed and messages are sent properly... But when i removed my breakpoint both the methods in the if statement are executed but message from the first method is sent and not from the second method.... Any suggestion?
i All,
I have deployed my site on internet and I am facing some formating issues, it's working fine in IE8, Firefox and Chrome but not in IE6.
I have used asp.net 3.5, please let me know where I have done mistakes.
http://www.anujtripathi.net/AboutMe.aspx
and the same in image gallery menu, as I don't have 10 reputation point I can't paste another URL here.
Thanks
It must be something stupid, but I can't figure it out so far...
Here is my HTML:
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="height: 8px"><img src="/media/note2.png" width="8" height="8" border="0"></td>
<td style="height: 8px"></td>
<td style="height: 8px"><img src="/media/note1.png" width="8" height="8" border="0"></td>
</tr>
<tr>
<td class="NoteCell"></td>
<td class="NoteCell">{{ text }}</td>
<td class="NoteCell"></td>
</tr>
<tr>
<td style="height: 8px"><img src="/media/note4.png" width="8" height="8" border="0"></td>
<td style="height: 8px"></td>
<td style="height: 8px"><img src="/media/note3.png" width="8" height="8" border="0"></td>
</tr>
I'm expecting the first and third rows to have a height of 8 pixels, but for some reason they are much higher (as if there was text inside, but there is no text!)
Puzzled... Any help will be appreciated!
I have a counter that counts up every 1 second and add 1 to an int.
Question
How can I format my string so the counter would look like this:
00:01:23
Instead of:
123
Things I've tried
Things I've tried so far:
for (int i = 0; i < 1; i++)
{
_Counter += 1;
labelUpTime.Text = _Counter.ToString();
}
My timer's interval is set to: 1000 (so it adds 1 every second).
I did read something about string.Format(""), but I don't know if it is applicable.
Thanks if you can guide me through this :D!
Given the following method: (real method has a few more parameters, but the important ones are below...)
public string DoSomething(string formatter, params string[] values)
{
// Do something eventually involving a call to String.Format(formatter, values);
}
Is there a way to tell if my values array has enough objects in it to cover the formatter, so that I can throw an exception if there aren't (short of doing the string.Format; that isn't an option until the end due to some lambda conversions)?
I would like to format a price in JavaScript.
Basically, I have a float variable, and I'd like to have a function that will receive that variable, and output:
"$ 2,500.00"
What's the best way to do this?
EDIT: OK, since I haven't gotten any answers better than the code I implemented, plus my own answer has been voted down and I can't put my own answer as the right one...
Here it is...
var DecimalSeparator = Number("1.2").toLocaleString().substr(1,1);
var AmountWithCommas = Amount.toLocaleString();
var arParts = String(AmountWithCommas).split(DecimalSeparator);
var intPart = arParts[0];
var decPart = (arParts.length > 1 ? arParts[1] : '');
decPart = (decPart + '00').substr(0,2);
return '£ ' + intPart + DecimalSeparator + decPart;
What is the best way for converting phone numbers into international format (E.164) using Java?
Given a 'phone number' and a country id (let's say an ISO country code), I would like to convert it into a standard E.164 international format phone number.
I am sure I can do it by hand quite easily - but I would not be sure it would work correctly in all situations.
Which Java framework/library/utility would you recommend to accomplish this?
P.S. The 'phone number' could be anything identifiable by the general public - such as
* (510) 786-0404
* 1-800-GOT-MILK
* +44-(0)800-7310658
that last one is my favourite - it is how some people write their number in the UK and means that you should either use the +44 or you should use the 0.
The E.164 format number should be all numeric, and use the full international country code (e.g.+44)
Hello....
I have an SSRS report that contains several subreports. The user has the ability to select/deselect which subreports they want to produce using several Boolean parameters. If a subreport is deselected then it is not rendered by setting the Visibility property. However, the DataSet associated with the de-selected subreport still executes causing the execution time to take longer than expected.
Is there any way to tell a dataset on a subreport or Tablix not to execute based on a Parameter selection?
Thanks
Looking at the information under the heading "Precision can be omitted or be any of:".
The example: printf("%.*s", 3, "abcdef"); works, outputting:abc (truncating the rest of the string.)
Now, I would like to have a string with multiple parameters formatted (truncated):
printf("%.*s", "%.*s", 3, 3, "abcdef", "xyz123");
but the program crashes.
What is the correct syntax?
Thank You.
I have a decimal datatype with a precision of (18, 8) in my database and even if its value is simply 14.765 it will still get displayed as 14.76500000 when I use Response.Write to return its value into a webpage.
Is it possible to override its default ToString method to return the number in the format #,###,##0.######## so that it only displays relevant decimal places?
UPDATE
I'm assuming that when one outputs number on a page like <%= item.price %> (where item.price is a number) that the number's ToString method is being called?
I'm trying to avoid having to change every instance where the value is displayed by defaulting the ToString() format somehow.
For example, I'd like to not indent namespaces in C++ code, but the prefpane doesn't seem to have any place to make a decision of this granularity. Is there some hidden config file or something? Or am I just out of luck?