hi,
in python, how can a custom format-specification be added, to a class ? for example, if i write a matrix class, i would like to
define a '%M' (or some such) which would then dump the entire contents of the matrix...
thanks
...
probably missing something simple:
<?php
$con=mysql_connect('localhost','xxx','xxx');
$db=mysql_select_db('xxx');
$sql = mysql_query("SHOW TABLE STATUS WHERE `name`=\"my_table\"");
$foo=mysql_fetch_array($sql);
return $foo['Update_time'];
// returns 2010-03-31 16:51:06
?>
how do i format this. I tried using
date('l jS F Y @ H:i...
Hi,
I'm currently creating a site for a musician. They are wanting to include the best quality video and audio files possible.
After a bit of research I'm thinking:
FLAC is the best option for audio.
FLV or MPEG-4 is best for video.
Can anyone in the know confirm or correct this?
Thanks
...
Newbie here. I have the following code:
myADC = 128
maxVoltage = 5.0
maxADC = 255.0
VoltsPerADC = maxVoltage/maxADC
myVolts = myADC * VoltsPerADC
print "myADC = {0: >3}".format(myADC)
print "VoltsPerADC = {0: >7}".format(VoltsPerADC)
print VoltsPerADC
print "myVolts = {0: >7}".format(myVolts)
print myVolts
This outputs the following...
So I have MP3 track and MJPEG Is there any container for combining those 2 and playing them as one video track in one container?
...
I found a C# game http://www.codeproject.com/KB/game/BattleField.aspx that does what I need to learn. The source code is poorly formatted and hard to follow. I used Visual Studio's format document, but the format is still bad. How do I reformat the source code to make it easer to read?
...
Is there an equivalent to Perl's format function in PHP? I have a client that has an old-ass okidata dotmatrix printer, and need a good way to format receipts and bills with this arcane beast.
I remember easily doing this in perl with something like:
format BILLFORMAT =
Name: @>>>>>>>>>>>>>>>>>>>>>> Age: @###
$name, ...
Hi all,
I want to type in Arabic in Xcode.
But I can't copy paste in the Xcode properly in right to left direction.
Please help me out.
Thanks in advance.
...
How do you prettify / align / format code in vi? What is the command?
I have pasted in a hunk of code and I need to have it all formatted/aligned... obviously I am a vi neophyte.
x
...
What is the best way to get formatted Int32 numbers?
Let say I have this o function:
string o(int x);
This is the value that o need to return according to x
x = 0 => o = 00
x = 1 => o = 01
x = 5 => o = 05
x = 10 => o = 10
x = 31 => o = 31
x = 106 => o = 106
...
Hello,
We're exporting our analytics reports in various formats, among them CSV. For some clients this CSV finds it's way into Excel.
Inside the CSV file one of the columns is a Date, for example
"Start Date","Name"
"07-04-2010", "Maxim"
Excel has trouble parsing this date format, obviously depending on the Locale of the user. Is "...
i am making a project for bulk emailing . In this I have added a richtext box . I want users to enter the email message body in it and want to give them the ability to format .Richtext box should be able to make the content bold,italics, underline , align it right left and center , increase font , decrease font,change color, change the f...
I'm trying to figure out how to specify a BGR 8 bit texture.
I've tried the following combinations (allowed), but all render with wrong colors:
Internal format: RGB; Format: RGB; Data Type: UNSIGNED_BYTE_3_3_2;
Internal format: RGB; Format: RGB; Data Type: UNSIGNED_BYTE_2_3_3_REV;
I've tried the following combinations, all with the ...
Hi:
I Suddenly found that I have no idea about the concept of data format and the encoding.
For exmpale, what is the differences about the ascii/binary/base64/text-xml ?
For a real case, I am working with a web service whose parameter I have to define,however one of the parameter should be ascii,another is binary and the last is netcdf....
Basically, I'd like to do the following, only using Common Lisp instead of Python:
print("Hello world.\r\n")
I can do this, but it only outputs the #\newline character and skips #\return:
(format t "Hello world.~%")
I believe I could accomplish this using an outside argument, like this:
(format t "Hello world.~C~%" #\return)
But...
I'm working on a project where I have to parse excel files for a client to extract data. An odd thing is popping up here: when I parse a date in the format of 5/9 (may 9th) in the excel sheet, I get 39577 in my program. I'm not sure if the year is encoded here (it is 2008 for these sheets).
Are these dates the number of days since some ...
This code:
System.out.println(String.format("%f", Math.PI));
System.out.println(Math.PI);
produces that result on my computer:
3,141593
3.141592653589793
Why does the first line print float number with comma while the second one uses dot?
...
Hi,
I have the following date format: 2010-04-15 23:59:59
How would I go about converting this into: 15th Apr 2010
Thanks
...
Hey!
I would like to create a custom render as specified in title.
For instance, I have my controller:
class MyController < ApplicationController
def index
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @objs }
end
end
end
, but I would like something like this:
class MyCont...
My end objective is to index documents using lucene. As lucene doesnt support indexing other formats. I want to convert these files to txt/html (lucene indexable file types).
I have a set of documents almost 1000 files of ppt, pdf, doc, xl etc
Please help me
...