converter

Convert RTF to PDF format

≯℡__Kan透↙ 提交于 2019-12-13 10:43:13
问题 Any ideas how to convert RTF to Text format and to keep both style and fonts? NOTE: I want to avoid using System.Windows.Forms Update I have something like this in RTF <P style="TEXT-ALIGN: center; MARGIN: 0in 0in 0pt" class=MsoNormal align=center><FONT face=Calibri><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 14pt"><STRONG>Questions and Answers<BR style="mso-special-character: line-break"></STRONG><BR style="mso-specialcharacter: line-break"></SPAN><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE:

Convert DateTime to string “yyyy-mm-dd”

荒凉一梦 提交于 2019-12-13 09:33:18
问题 Im wondering how to convert a DateTime to a string value (yyyy-mm-dd). I have a console application and i want the user to be able to write a Date as "yyyy-mm-dd" which are then converted as a string. I have tried this but it works in oposite direction it seem. The idea is that the user enters a Start date and an End date with Console.ReadLine. Then these values are stored as strings in string A and B wich could then be used later. Is that possible? string A = string.Empty; string B = string

CSV data into a 2D array of integers [closed]

时光怂恿深爱的人放手 提交于 2019-12-13 09:10:36
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I have a .csv file with integers in two columns and many rows. It looks like this: A B 1 584 146 2 586 167 . . . . . . I want to create a 2D array of integers from this .csv file in C++. I've searched dozens of websites but all of the answers I could get was with strings. This is

How to send generics over UDP connection C#?

半城伤御伤魂 提交于 2019-12-13 08:36:09
问题 I'm wondering is there a way to send some kind of generics for example List <float> floatValues = new List<float>() need to be sent to udp client. I don't know how to do that, any help will be appreciated! 回答1: You can serialize floatValues using some serialization facility (like XmlSerializer, BinaryFormatter or DataContractSerializer) and than deserialize it back. Or you can create your own "application level protocol" and put to the stream type name and serializer type and use this

How to print character array in reverse order of C program

自古美人都是妖i 提交于 2019-12-13 07:41:30
问题 #include <stdlib.h> #include <stdio.h> #define SIZE 25 int main (void) { int d, b, c; printf(" Enter an integer and press 'enter':\n"); scanf("%d" , &d); printf(" Enter the desired base and press 'enter':\n"); scanf("%d" , &b); if (b < 2) { printf(" Your base is to low! \n") } else { while (d != 0) { int radix; radix = d % b; d = d / b; char basechars[] = "0123456789ABCDEF"; printf("%c" , basechards[radix]); } } return 0; } This Program prompts the user for a decimal and a base to convert

convert xml to json while keeping code working

社会主义新天地 提交于 2019-12-13 07:40:26
问题 I have a xml file, and an html file associated with it. the html file takes the xml elements and outputs a tree with hyperlinks and pictures for each node type included. how can I convert the code to work for JSON instead of XML. this is the code and the xml I added a function to attr elements so it opens a table when I click on it: <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript"> $

simple wav 16-bit / 8-bit converter source code?

拜拜、爱过 提交于 2019-12-13 07:00:51
问题 could someone provide me a link to source code (preferably C/C++) of a simple WAV 16-bit to 8-bit (and back if possible) converter? I have basic knowledge of C++ and I need to have a resource to understand wav writing and converting values for my new project. At this moment I have a lecture about RIFF chunks structure. Also any formulas for converting values between different bit depths (also these un standard) appreciated... I'll prefer it to be simple and command line so I can edit it with

How can I generate all possible IPs from a CIDR list in Python?

拜拜、爱过 提交于 2019-12-13 07:00:30
问题 Let's say I have a text file contains a bunch of cidr ip ranges like this: x.x.x.x/24 x.x.x.x/24 x.x.x.x/23 x.x.x.x/23 x.x.x.x/22 x.x.x.x/22 x.x.x.x/21 and goes on... How can I convert these cidr notations to all possible ip list in a new text file in Python? 回答1: If you don't need the satisfaction of writing your script from scratch, you could use the python cidrize package. 回答2: You can use netaddr for this. The code below will create a file on your disk and fill it with every ip address in

ASCII to Binary conversion, read line by line c++

六眼飞鱼酱① 提交于 2019-12-13 04:09:03
问题 I'm trying to adapt an "ASCII to a binary" solution found here, to my task. This solution read the line, which the user enters. For me, I'm looking to read a file line by line and assign every line to this solution, in order to convert it, then write to the binary output file. The code works fine, but when I open the binary file, I find only the first line converted. any idea? Thank you for your time. #include <iostream> #include <stdlib.h> #include <iomanip> #include <math.h> #include

WP7: change the background of a border with converter

南笙酒味 提交于 2019-12-13 03:56:37
问题 I'm going crazy with converters. I know that I must use it to change the "exit value" of my values, when needed, but I don't know how to use right for my case. I have my simple MVVM (3 fields only) and my main window with a list of my items. The first item is calculated depending on a function, and can show YES or NOT, the other values are binded directly. This is working well, but I need to change the background and foreground colors depending on the YES or NOT value I have in the first