All I really know is PHP and I used the decbin function etc, It was fairly easy to do. In this C++ program I want to do the same thing, just a simple number or string how would I do this?
Hello everyone,
I've got a bit of a complicated set up. I specialise in XSLT which I write for 3rd party system. All CSS looks fine in the browser. Now that system provides a button that converts my generated HTML into MS Word 2003.
However, table borders don't convert as they appear in a Browser. There are lots of tables and they have different borders setup. For example there is one that uses only outside border and no borders inside it. When converting to MS Word, a table appears with ALL the borders in between cells. Which I don't want.
I've tried search the Internet, but didn't come across anything useful. Maybe there are tips or tricks on how to set up tables borders so it's understood properly by MS Word.
The third party said the following: "The system just passes the HTML created through the converter it finds in the installed version of Word".
I would really appreciate any tips and help!
Dasha
Would you consider autoboxing in Java to be a form of polymorphism? Put another way, do you think autoboxing extends the polymorphic capabilities of Java?
What about implicit conversions in Scala?
My opinion is that they are both examples of polymorphism. Both features allow values of different data types to be handled in a uniform manner.
My colleague disagrees with me. Who is right?
In Java, is there a simple method to convert the format of a given string? For example, I have the string "test22". I'd like the binary value and hex value. As well as possibly the ascii values of each character?
In my application I inherit a javastreamingaudio class from the freeTTS package then bypass the write method which sends an array of bytes to the SourceDataLine for audio processing. Instead of writing to the data line, I write this and subsequent byte arrays into a buffer which I then bring into my class and try to process into sound. My application processes sound as arrays of floats so I convert to float and try to process but always get static sound back.
I am sure this is the way to go but am missing something along the way. I know that sound is processed as frames and each frame is a group of bytes so in my application I have to process the bytes into frames somehow. Am I looking at this the right way? Thanx in advance for any help.
I need to use @font-face feature and my fonts are in OTF/TTF format and Microsoft browsers support only EOT format. I tried to use Microsoft tool WEFT, but it didn't work or I didn't understand how it works. Is there any other way to convert my fonts to EOT format?
Is there a library or a class/function that I can use to convert an integer to it's verbal representation?
Example input: 4,567,788
Example output: Four million, Five hundred sixty-seven thousand, seven hundred eighty-eight
For reference, I am using C# and .NET 3.5.
I will get data in DataTable. I am going to iterate data in foreach. I will have all types of data in Datatable. Now I need to find Double for each item (string) in DataTable. How to find IsDouble for string?
Ex:
I have "21342.2121" string. I need to covert this to Double. But sometimes the data will be "TextString". So I can't use Double.Parse().
How to handle this?
I'm using Silverlight and need to display some OTF fonts. Now Silverlight supports OTF fonts in version 4 but it does not seem to support OTF fonts with PostScript outlines. I have some OTF fonts with postscript outlines that won't show up. Is there a (free) way of converting between OTF with postscript outlines to TrueType fonts or OTF with TrueType outlines. (Incidentally I've tried TransType but am having no joy with it).
I have a WinForms multiselect listbox, and each item in the listbox is of type MyClass.
I am also writing a method that needs to take a parameter that is a collection of MyClass. It could be of type MyClass[], List<MyClass>, IList<MyClass>, IEnumerable<MyClass>, etc. Any of those would work fine.
Somehow, I need to pass the selected items in the listbox to my method. But how would I convert SelectedObjectCollection to any of the MyClass collection types described above?
At work today, we threw together this attempt:
xquery version "1.0";
declare option saxon:output "omit-xml-declaration=yes";
declare variable $x := 99;
string-join(
for $b in (128,64,32,16,8,4,2,1)
let $xm := $x mod ($b*2)
return
if ( $xm >= $b ) then "1" else "0"
, "")
Do you have a better way?
I'm still getting the hang of lots of things and thought I should post some code I made with pygame and get some feedback^^.
I posted code here:
http://urlvars.com/code/snippet/39272/my-bouncing-program
http://urlvars.com/code/snippet/39273/my-bouncing-program-classes
There's tome things that I implemented that I'm not using yet I just realized like a timer at the bottom of the main while loop. If my code isn't readable, I'm sorry, I'm self taught and this is the first code I've ever posted anywhere.
By the way I made some variables that take the screensize and half it to find a point to spit out the squares, but when I try to use it, it makes a weird effect :/
Try switching the list i have in the newbyte() function with the halfScreen variable and see it freak out o.O
thank you
Both queries below translates to the same number
SELECT CONVERT(bigint,CONVERT(datetime,'2009-06-15 15:00:00'))
SELECT CAST(CONVERT(datetime,'2009-06-15 23:01:00') as bigint)
Result
39978
39978
The generated number will be different only if the days are different. There is any way to convert the DateTime to a more precise number, as we do in .NET with the .Ticks property?
I need at least a minute precision.
I need to convert an existing (datetime fields) db from local time ut UTC.
The values are stored ad datetimes on a server with time zone CET (+1) (with summertime +2). When selecting data I use UNIX_TIMESTAMP(), which magically compensates for everything, ie, time zone shift and dst (if i've read the docs right).
I'm moving the db to a new server with UTC as system time.
Simply subtracting -1 H won't work, as summer time is +2.
Any ideas for a clever way to do this? (using sql or some script lang)
i created a simple voice recording using wav format. my problem is i wanted it to save as PCM format without using comercial components. i have MSACM.pas but i dont know how to use it. My compiler is delphi.
I have a string of binary numbers that was originally a regular string and will return to a regular string after some bit manipulation.
I'm trying to do a simple caesarian shift on the binary string, and it needs to be reversable. I've done this with this method..
public static String cShift(String ptxt, int addFactor)
{
String ascii = "";
for (int i = 0; i < ptxt.length(); i+=8)
{
int character = Integer.parseInt(ptxt.substring(i, i+8), 2);
byte sum = (byte) (character + addFactor);
ascii += (char)sum;
}
String returnToBinary = convertToBinary(ascii);
return returnToBinary;
}
This works fine in some cases. However, I think when it rolls over being representable by one byte it's irreversable. On the test string "test!22*F ", with an addFactor of 12, the string becomes irreversible. Why is that and how can I stop it?
I want to implement a generic method on a generic class which would allow to cast safely, see example:
public class Foo<T> : IEnumerable<T>
{
...
public IEnumerable<R> SafeCast<R>()
where T : R
{
return this.Select(item => (R)item);
}
}
However, the compiler tells me that Foo<T>.SafeCast<R>() does not define parameter 'T'. I understand this message that I cannot specify a constraint on T in the method since it is not defined in the method. But how can I specify an inverse constraint?
I am writing a string parser and the thought occurred to me that there might be some really interesting ways to convert an ASCII hexadecimal character [0-9A-Fa-f] to it's numeric value.
What are the quickest, shortest, most elegant or most obscure ways to convert [0-9A-Fa-f] to it's value between 0 and 15?
Assume, if you like, that the character is a valid hex character.
I have no chance so I'll have a go at the most boring.
( c <= '9' ) ? ( c - '0' ) : ( (c | '\x60') - 'a' + 10 )
HI,
I want to convert MicrosoftOffice Docs(.doc,.docx,ppt,xlsx,xls) +PDF+Images++Audio/Video into an swf file. The idea behind this project is to open the documents on any machine which have a flash plugin. I want to do this in VC++.
I recently read (and unfortunately forgot where), that the best way to write operator= is like this:
foo &operator=(foo other)
{
swap(*this, other);
return *this;
}
instead of this:
foo &operator=(const foo &other)
{
foo copy(other);
swap(*this, copy);
return *this;
}
The idea is that if operator= is called with an rvalue, the first version can optimize away construction of a copy. So when called with a rvalue, the first version is faster and when called with an lvalue the two are equivalent.
I'm curious as to what other people think about this? Would people avoid the first version because of lack of explicitness? Am I correct that the first version can be better and can never be worse?
Hi,
In one of our databases, there is a table with dozens of columns, one of which is a geometry column.
I want to SELECT rows from the table, with the geometry transformed to another SRID. I want to use something like:
`SELECT *`
in order to avoid:
SELECT col_a, col_b, col_c, col_d, col_e, col_f,
col_g, col_h, transform(the_geom, NEW_SRID), ..., col_z
Any ideas?
Adam
First let me thank you all for your help.
What I need is a function that takes in a EPOCH time stamp, like 1452.235687 and converts it to a readable timestamp like '01-01-1970 00:00:00'. More specifically I only need the time not the date.
If at all possible I would prefer a .NET function instead of a SQL stored procedure. However an SQL stored procedure would work fine as well.
Thank you again,