converter

PHP not have a function for XML-safe entity decode? Not have some xml_entity_decode?

≯℡__Kan透↙ 提交于 2019-11-30 08:42:20
问题 THE PROBLEM : I need a XML file "full encoded" by UTF8; that is, with no entity representing symbols, all symbols enconded by UTF8, except the only 3 ones that are XML-reserved, "&" (amp), "<" (lt) and ">" (gt). And, I need a build-in function that do it fast : to transform entities into real UTF8 characters (without corrupting my XML). PS: it is a "real world problem" (!); at PMC/journals, for example, have 2.8 MILLION of scientific articles enconded with a special XML DTD (knowed also as

Showing Html in WinRT with RichTextBlock or other component

南楼画角 提交于 2019-11-30 08:28:55
问题 I want to show html in string with some component. Now I am using RichTextBlock and I tried few extensions for converting html to xaml or rtf but I didn´t found any working with WinRT. I know I can use WebView but it isn´t so pretty. I just want to do little change to ItemDetailPage (where is used RichTextBlock) to show users elementary html (bold, italics, links, images, ...). Is there some component or some way how to do this (not webview)? Or is there working convertor? 回答1: You have 2

Audio converting with Xuggler

心已入冬 提交于 2019-11-30 07:42:56
I'm trying to convert aac/wav/wma audio files to mp3 with Xuggler in Java. Unfortunately, I have a big loss of quality. My input file size is about 7MB and my output file size is only 1,5MB. The sample rate is set to 44100 Hz, is there other parameters to set? Thank you for your answers. if (args.length <= 1) throw new IllegalArgumentException("must pass an input filename and output filename as argument"); IMediaWriter writer = ToolFactory.makeWriter(args[1]); String filename = args[0]; // Create a Xuggler container object IContainer container = IContainer.make(); // Open up the container if

Python 2.7: How to convert unicode escapes in a string into actual utf-8 characters

笑着哭i 提交于 2019-11-30 07:39:23
问题 I use python 2.7 and I'm receiving a string from a server (not in unicode!). Inside that string I find text with unicode escape sequences. For example like this: <a href = "http://www.mypage.com/\u0441andmoretext">\u00b2<\a> How do I convert those \uxxxx - back to utf-8? The answers I found were either dealing with &# or required eval() which is too slow for my purposes. I need a universal solution for any text containing such sequenes. Edit: <\a> is a typo but I want a tolerance against such

How to convert cv::Mat to pcl::pointcloud

别说谁变了你拦得住时间么 提交于 2019-11-30 07:28:36
How to get from a opencv Mat pointcloud to a pcl::pointcloud? The color is not important for me only the points itself. you can do this like: pcl::PointCloud<pcl::PointXYZ>::Ptr SimpleOpenNIViewer::MatToPoinXYZ(cv::Mat OpencVPointCloud) { /* * Function: Get from a Mat to pcl pointcloud datatype * In: cv::Mat * Out: pcl::PointCloud */ //char pr=100, pg=100, pb=100; pcl::PointCloud<pcl::PointXYZ>::Ptr point_cloud_ptr(new pcl::PointCloud<pcl::PointXYZ>);//(new pcl::pointcloud<pcl::pointXYZ>); for(int i=0;i<OpencVPointCloud.cols;i++) { //std::cout<<i<<endl; pcl::PointXYZ point; point.x =

Convert.ChangeType How to convert from String to Enum

六眼飞鱼酱① 提交于 2019-11-30 05:52:20
public static T Convert<T>(String value) { return (T)Convert.ChangeType(value, typeof(T)); } public enum Category { Empty, Name, City, Country } Category cat=Convert<Category>("1");//Name=1 When I call Convert.ChangeType , the system throws an exception on the impossibility of conversion from String to Category. How to do the conversion? Maybe I need to implement any converter for my type? Use Enum.Parse method for this. public static T Convert<T>(String value) { if (typeof(T).IsEnum) return (T)Enum.Parse(typeof(T), value); return (T)Convert.ChangeType(value, typeof(T)); } .Net Core version :

Jade to HTML converter [closed]

空扰寡人 提交于 2019-11-30 05:39:28
I have started writing an application using nodejs and jade, but after a while my team decided to switch to Django. I would still like to use the web pages written using jade, without having to re-write them by hand. Does anyone know of a tool that transforms jade code into html? As far as I've seen, most of the tools involving jade concentrate on the opposite transformation. Jade is supposed to come with a command line utility that does exactly that. See here https://github.com/visionmedia/jade#jade1 Or see just above it for a make file that runs it. - Edit - it seems Jade was renamed to Pug

IP Address Converter

你说的曾经没有我的故事 提交于 2019-11-30 05:19:01
There is IP address: 66.102.13.19, and from this address as that received this address http://1113984275 But how? And how I can make this with the help of bash. For example, this service can do it, but I do not understand the algorithm. ip=66.102.13.19 IFS=. read -r a b c d <<< "$ip" printf '%s%d\n' "http://" "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))" By the way, the number in your question doesn't match the IP address. To convert a decimal to an IP: #!/bin/bash dec2ip () { local ip dec=$@ for e in {3..0} do ((octet = dec / (256 ** e) )) ((dec -= octet * 256 ** e)) ip+=$delim$octet delim

JSF page reflects Date incorrectly - 1 Day shifted [duplicate]

安稳与你 提交于 2019-11-30 05:06:08
问题 This question already has an answer here : JSF convertDateTime renders the previous day (1 answer) Closed 3 years ago . DB value of Date is: 04-OCT-10 Bean method returns: Mon Oct 04 00:00:00 EEST 2010 JSF returns: 03.10.2010 JSF code: ... <h:outputText value="#{paym.dueDate}" > <f:convertDateTime pattern="dd.MM.yyyy"/> </h:outputText> ... What reason(s),that JSF displays Date value incorrectly? thank you 回答1: The JSF date converters defaults to UTC timezone. But your date is apparently

What's the easiest way to represent a bytea as a single integer in PostgreSQL?

别说谁变了你拦得住时间么 提交于 2019-11-30 04:55:24
问题 I have a bytea column that contains 14 bytes of data. The last 3 bytes of the 14 contain the CRC code of the data. I would like to extract the CRC as a single integer to be stored in a new column. How would I go about doing this? To clarify, here's one way of doing it in Java: int crc = ((rawData[len - 3] & 0xff) << 16 | (rawData[len - 2] & 0xff) << 8 | (rawData[len - 1] & 0xff)) & 0xffffff; I'm hoping to find a solution without bit shifting, i.e. something like a method that accepts 4 bytes