convert

Convert HTML to DOCX

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My question is very specific and I hope that someone has done this conversion from HTMLto DOCX. To do this I took a sample code from github and tried it in my local Eclipse Setup. import java.io.File; import java.io.FileNotFoundException; import javax.xml.bind.JAXBException; import org.docx4j.convert.in.xhtml.XHTMLImporterImpl; import org.docx4j.openpackaging.exceptions.Docx4JException; import org.docx4j.openpackaging.exceptions.InvalidFormatException; import org.docx4j.openpackaging.packages.WordprocessingMLPackage; import org.docx4j

ImageMagick convert jpg images to gif slow

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Magick++(IM 7.0.3 platform:CentOS Linux release 7.0) to convert images to gif. I create Image objects from files, the problem is that when I convert 9 png files(each 50kb) to gif, it taks only 50ms. but when it turns to 9 jpg files (each 20kb), it takes 1900ms. What is the reason behind? How can I make it faster with jpg files? for(int i = 2; i < argc-1; i++) { // I pass the file path from command line cout << argv[i] << endl; Image img(argv[i]); img.animationDelay(delay); img.magick("GIF"); frames.push_back(img); } long

How to convert RGB from YUV420p for ffmpeg encoder?

匿名 (未验证) 提交于 2019-12-03 02:32:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to make .avi video file from bitmap images by using c++ code. I wrote the following code: //Get RGB array data from bmp file uint8_t* rgb24Data = new uint8_t[3*imgWidth*imgHeight]; hBitmap = (HBITMAP) LoadImage( NULL, _T("myfile.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); GetDIBits(hdc, hBitmap, 0, imgHeight, rgb24Data , (BITMAPINFO*)&bmi, DIB_RGB_COLORS); /* Allocate the encoded raw picture. */ AVPicture dst_picture; avpicture_alloc(&dst_picture, AV_PIX_FMT_YUV420P, imgWidth, imgHeight); /* Convert rgb24Data to YUV420p and stored

How to convert RGB from YUV420p for ffmpeg encoder?

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to make .avi video file from bitmap images by using c++ code. I wrote the following code: //Get RGB array data from bmp file uint8_t* rgb24Data = new uint8_t[3*imgWidth*imgHeight]; hBitmap = (HBITMAP) LoadImage( NULL, _T("myfile.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); GetDIBits(hdc, hBitmap, 0, imgHeight, rgb24Data , (BITMAPINFO*)&bmi, DIB_RGB_COLORS); /* Allocate the encoded raw picture. */ AVPicture dst_picture; avpicture_alloc(&dst_picture, AV_PIX_FMT_YUV420P, imgWidth, imgHeight); /* Convert rgb24Data to YUV420p and stored

Convert a bytea column to OID while retaining values

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to alter a bytea column to have type oid and still retain the values. I have tried using queries like: ALTER TABLE mytable ADD COLUMN mycol_tmp oid; UPDATE mytable SET mycol_tmp = CAST(mycol as oid); ALTER TABLE mytable DROP COLUMN mycol; ALTER TABLE mytable RENAME mycol_tmp TO mycol; But that just gives me the error: ERROR: cannot cast type bytea to oid Is there any way to achieve what I want? 回答1: A column of type Oid is just a reference to the binary contents which are actually stored in the system's pg_largeobject table. In

Convert a hex string to base64 in an excel function

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a lengthy string of hex values that need to be converted to base64. I'm looking for a simple format cell function such as =Hex2b64(Hexstring) that will accept any length of hex characters. I have found pieces here and there but no one simple code block. I have been using http://home.paulschou.net/tools/xlate/ in order to do my conversion manually up to this point. The conversion works well and the data is received by all relevant databases and parsed appropriately. The data I am receiving is hex represented binary, which has been

How to convert ILArray into double[,] array?

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How convert ILArray into double[,] array I have ILArray<double> A want to use A.ToArray() , but don't know how to use it I need to get a double[,] System.Array . 回答1: There is no natural support for converting an ILArray<double> into an multi dimensional System.Array double[,] in ILNumerics currently. So let's write it! private static System.Array ToSystemMatrix<T>(ILInArray<T> A) { using (ILScope.Enter(A)) { // some error checking (to be improved...) if (object.Equals(A, null)) throw new ArgumentException("A may not be null"); if (!A

Convert scientific notation to decimal notation

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There is a similar question on SO which suggests using NumberFormat which is what I have done. I am using the parse() method of NumberFormat. public static void main(String[] args) throws ParseException{ DecToTime dtt = new DecToTime(); dtt.decToTime("1.930000000000E+02"); } public void decToTime(String angle) throws ParseException{ DecimalFormat dform = new DecimalFormat(); //ParsePosition pp = new ParsePosition(13); Number angleAsNumber = dform.parse(angle); System.out.println(angleAsNumber); } The result I get is 1.93 I didn't really

Python: String will not convert to float

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I wrote this program up a few hours ago: while True : print 'What would you like me to double?' line = raw_input ( '> ' ) if line == 'done' : break else : float ( line ) #doesn't seem to work. Why? result = line * 2 print type ( line ) #prints as string? print type ( result ) #prints as string? print " Entered value times two is " , result print 'Done! Enter to close' As far as I can tell, it should be working fine.The issue is that when I input a value, for example 6, I receive 66 instead of 12. It seems like this portion of code:

Convert date in string to DateTime with same format

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a string that has a date stored in it. String date = "03-05-2013 00:00:00"; I parsed it to Datetime as follows: DateTime Start = DateTime.Parse(date); Start.ToString() gave me "3/5/2013 12:0:00 AM" I also used: DateTime Start = DateTime.ParseExact(date,"dd-MM-yyyy HH:mm:ss",CultureInfo.InvariantCulture); Then, Start.ToString() gave me "3/5/2013 12:0:00 AM" , which is the exact same result as the previous one. I need to keep the original formatting. How may I do it? Thanks. 回答1: The format you parse with does not dictate how the