FAQ Database Discussion Community


Convert String to CLLocationCoordinate2D in swift

string,swift,converter,cllocation,cllocationcoordinate2d
using Firebase as my backend, I've got a series of strings that are latitude and longitude coordinates, how can I convert them to CLLocationCoordinate2D so that I can use them for annotations? Here is the code that gets the info from Firebase every time its updated var UpdateRef = Firebase(url:"https://ici.firebaseio.com/users")...

Converting InkCanvas Strokes to a Byte Array and back again

c#,wpf,bytearray,converter,inkcanvas
I am working on a program which converts the inkcanvas strokes to a byte array for encryption and then saves it in a txt file. Essentially I need to convert a byte array to inkcanvas strokes. I have the first half of the code done (which converts the inkcanvas strokes...

How can I decode base32 to string in mysql

mysql,converter,base32
Im looking for a way to decode a string encrypted in base32 back to original string in mysql. I know there is a SP to do this with base64 but cannot find anything for base32. Is it possible? is there a stored procedure I can use somewhere? What are ways...

Save dictionary in application settings and load it on start

c#,wpf,dictionary,settings,converter
I've got Dictionary<string, double> which I would like to save and restore it when I restart the application. From what I have heard you cannot store dictionary in c#, so trying to make a workaround. Currently I have made string variable in setting called DB, and trying to use something...

XAML Converter in different namespace

c#,xaml,namespaces,windows-phone-8.1,converter
I'm developing a c# Windows Phone 8.1 App in VC2013 and stumbled over an odd issue. To make my Code more 'clean', I decided to put different parts of my App into different folders. There is no problem with calling XAML pages from these folders in the c# code. BUT...

f:convertNumber unexpectedly increments/decrements float value

jsf,jsf-2,floating-point,converter
I have a float property bound to <h:inputText>. For long values, it was automatically converting the values to exponential notation. I tried to use <f:convertNumber> to avoid the exponential value presentation. The value can be of two given below. Format 1: <18 digits> Format 2: <14 optional digits>.<3 option decimals>...

Decimal to Binary within an ArrayList java

java,binary,converter
Input is a decimal number and the output is supposed to be that same number in binary form in an ArrayList, but for some reason it is only outputting 1s Digit is a class whose only value is an int "bit" and a 2-bit adder. private ArrayList<Digit> numbers; private Digit...

Why can't I use IMultiValueConverter on Rectangle.Width?

wpf,mvvm,converter,ivalueconverter
I need to draw rectangles in an ItemsControl to a width calculated from a value defined in the bound collection and the max value of the collection. So I figured I need to use a MultiValueConverter to pass in the item's value and the max value of the collection. This...

how to convert date using awk linux

date,awk,converter
I have txt file (test.txt) contains the following data: 00:06:55.351;C39EE9AF;2015-01-05 09:52:20;0;5;295;test; 00:06:51.368;C39EE78B;2015-01-05 09:52:17;0;5;295;test2; I need to view date as below using awk, like this: 2015-01-05 test 2015-01-05 test2 I have tried the following: cat test.txt | awk -v FS=";" '{print $3,$7}' ...

Java: convert byte[] to base36 String

java,converter,base36
I'm a bit lost. For a project, I need to convert the output of a hash-function (SHA256) - which is a byte array - to a String using base 36. So In the end, I want to convert the (Hex-String representation of the) Hash, which is 43A718774C572BD8A25ADBEB1BFCD5C0256AE11CECF9F9C3F925D0E52BEAF89 to base36, so...

Python 3.4 code help - I can't make this work [closed]

python,function,python-3.x,converter,currency
I am new to python. This is my code: print("Welcome to the Currency Converter") print("This Currency Converter converts: ") print(" US [D]ollar") print(" [E]uro") print(" British[P]ound Sterling") print(" Japanese[Y]en") print() def input1() : a = input("Enter the currency inital {eg. [E] for Euro} you wish to convert from: ") if...

Byte array to struct

c#,struct,bytearray,converter
I'm having trouble converting the string parts of the byte array. My struct looks like this: [StructLayout(LayoutKind.Sequential, Pack = 1)] struct Message { public int id; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)] public string text; } Creation of test byte array: private static byte[] CreateMessageByteArray() { int id = 69; byte[] intBytes...

creating multiple .exe files using CX_freeze

python,converter,cx-freeze
I've been working on a little project and I want to convert the files to an executable. the files below are the files that need be included. Btn1 Btn2 Btn3 ... Scn1 Scn2 Snc3 ... Button.py ConSetup.py Lable.py PicBox.py Scenes.py SimpleGui.py TextBoxes.py I'm not sure if they all need to...

Converting very large files from xml to csv

c#,xml,csv,converter,large-files
Currently I'm using the following code snippet to convert a .txt file with XML data to .CSV format. My question is this, currently this works perfectly with files that are around 100-200 mbs and the conversion time is very low (1-2 minutes max), However I now need this to work...

Convert Double from String

asp.net,vb.net,visual-studio-2012,converter
When converting string to floating, the converter creates wrong results. ?Global.System.Convert.ToDouble("635705821821928755").ToString("0") "635705821821929000" ?Global.System.Convert.ToSingle("635705821821928755").ToString("0") "635705800000000000" I am working with VB.Net Visual Studio 2012, Framework 4 on ASP.Net Webpage. Is there any solution for converting huge numbers from string into floating?...

Convert int textbox input to negative in xaml?

c#,wpf,xaml,textbox,converter
I have a textbox where the user enters in a number that is to be used as the angle to rotate an image. Is there a way to convert that number in xaml to negative? So if the user enters 50, I want the image to rotate -50 degrees instead...

How to convert RTF to Markdown on the UNIX/OSX command line similar to pandoc

osx,unix,converter,markdown,rtf
How do I convert RTF (say from stdin) to Markdown with a command line tool under UNIX/OSX. I am looking for something like pandoc. However pandoc itself does not allow RTF as an input format. :-( So, I'd be happy either with a similar tool to pandoc or a pointer...

How to convert videos to ogg and mp4 and store in the database

html,database,video,converter
How can I convert a video to ogg and mp4 and automatically store it in the database? E.g., if a user uploads an mp4 video, it will have to convert the video to ogg as well and store it in the database. Can't find anything about this! Thanks in advance!...

WPF Multibind converter not returning value?

c#,wpf,xaml,converter,multibinding
I have a multibind calling a converter with two bindings. For some reason it does not return anything. I put <ItemsControl.Width> <MultiBinding Converter="{StaticResource ResourceKey=TimelineWidthConverter}"> <Binding Path="AnimationManager.MaxFrame" ElementName="UC" /> <Binding Path="AnimationManager.CurrentZoom" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:TimelineAnimationView}}" /> </MultiBinding> </ItemsControl.Width> in the XAML file, and the converter reads: internal...

af:convertNumber element removes zero in the end of the value

jsf,numbers,converter,oracle-adf
My code: <af:inputText id="it1" label="Test"> <af:convertNumber groupingUsed="true" type="number" messageDetailConvertNumber="#,###,##" maxFractionDigits="2"/> </af:inputText> When I type 100,51 -- everything is fine, but if I would type 100,50, then '0' will be removed and entered value will be 100,5. How can I leave this '0' in the end? I need <af:convertNumber> element for...

Python - Read CSV and output to strings

python,string,csv,converter
I'm pretty new to Python and I'd like to create a script that reads a UTF-8 CSV file containing two columns and writes the output into a UTF-8 strings file. Any help is greatly appreciated. CSV Example: KEY,LANGUAGE keyname1,"Nononono “%{placeholder}”?" keyname2,"Nononon %{placeholder} nononon." keyname3,"Open in %{placeholder}?" keyname4,GB keyname5,TB Desired output:...

NAudio File Conversion

c#,converter,naudio
I have Mp3 audio files with the same music, which are encoded at different sample rate and bit depth. For example: Titanic - 96 Kbps - 44 KHz.mp3 Titanic - 96 Kbps - 48 KHz.mp3 Titanic - 128 Kbps - 44 KHz.mp3 Titanic - 128 Kbps - 48 KHz.mp3 Titanic...

IValueConverter with MarkupExtension

c#,wpf,converter,ivalueconverter,markup-extensions
Recently I read about an IValueConverter which also inherits from MarkupExtension. It was something like: internal class BoolToVisibilityConverter : MarkupExtension, IValueConverter { private static BoolToVisibilityConverter converter; public BoolToVisibilityConverter() { } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool) { if ((bool)value) { return...

How do I convert HTML to a Word document on the fly in ASP.NET MVC? [closed]

c#,asp.net-mvc,ms-word,converter
I have an HTML string I would like to convert into a word document and download upon a button click. I know how to download a file, so that's not part of the question - just some context. I've been unable to find any libraries or code examples that do...

Converting seconds to Year Hour Minutes Seconds

java,time,converter
Im new, standard beginning, so I'll leave the rest out. Do I have to convert every int to seconds, or is this right? Because when I calculated backwards, manually and count the seconds together of the final statement, I get differences in hours. Thx Casu Scanner input = new Scanner(System.in);...

How do I convert this specific time into the one here?

php,sql,date,time,converter
body body body body body body body body body body body body body body body

How to convert SHA1 to array[5] of unsigned long ints?

c++,arrays,converter,sha1,unsigned-integer
For the purposes of library/subsystem that I use I have to convert SHA1 (calculated with use of e.g. opensll) to 5 element array of unsigned long ints (32 bits variables) or create the aforementioned SHA1-5-long-array by myself. Reason: SHA1 (160 bits) = 5 x unsigned long int (32 bits) I...

VAADIN: Why I can't set a converter to a ComboBox?

combobox,type-conversion,converter,vaadin7
I've made a converter: public class BooleanToDateConverter implements Converter<Boolean, Date> { private static final long serialVersionUID = 1L; @Override public Date convertToModel(Boolean value, Class<? extends Date> targetType, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { if (value == true) { return new Date(); } else { return null; } } @Override public Boolean...

Temp Converter Using JavaScript

javascript,converter,temperature
I created this temp converter in JavaScript, it runs and calculates appropriately, but I am receiving some "unexpected behavior" and I'm struggling to understand why its happening. The behavior that is happening is if I click in the Celsius or Fahrenheit textbox it auto produces values: -32 in Celsius textbox,...

convert 2 php functions into 2 javascript functions

javascript,php,converter
I have the following PHP functions: function cidr2ip($cidr) { $ip_arr = explode('/', $cidr); $start = ip2long($ip_arr[0]); $nm = $ip_arr[1]; $num = pow(2, 32 - $nm); $end = $start + $num - 1; return array($ip_arr[0], long2ip($end)); } function ip2cidr($ips) { $return = array(); $num = ip2long($ips[1]) - ip2long($ips[0]) + 1; $bin...

How convert any record into a map/dictionary in F#?

dictionary,f#,converter,record
I need to serialize arbitrary records into maps/dictionary. I imagine my end type look like this: type TabularData= array<Map<string, obj>> But I have problems in build a generic function that accept any record and turn them into Map....

Convert long int seconds to double precision floating-point value

c++,date,datetime,time,converter
I have a long int variable wich containes seconds since Jan. 1, 1970 in this format: long int seconds = 1231241242144214; i need to convert this seconds to double precision floating-point value. The integer part of the value is the number of days since midnight, 30 December 1899. The fractional...

Ovftool error “Unsupported value” when convert a virtual maschine

virtual-machine,converter,vmware,vcenter,ovf
I get some ovf images. And i have a problem when i try to import on vSphere. I was looking at solutions but i dont find it. When i do a "deploy ovf template" on vcenter i get an error "The OVF package requires unsupported hardware. Detail: line 26 unsupported...

Converting 8-length varchar to datetime

sql,converter
I have varchar column as dataset as: 20110712 20141229 20100222 20140408 20131117 20130912 20140702 20110405 That need to be converted datetime datatypes. I have tried: CONVERT(date, column_name) yet it returns the error: Msg 241, Level 16, State 1, Line 1 Conversion failed when converting date and/or time from character string....

Omnifaces - ListIndexConverter, principle of operation

jsf,converter,omnifaces
I try to understand the principle of operation of the omnifaces.converter.ListIndexConverter @FacesConverter("omnifaces.ListIndexConverter") public class ListIndexConverter implements Converter { private static final String ERROR_LIST_INDEX_BOUNDS = "Index {0} for value {1} in component {2} is out of bounds."; private static final String ERROR_VALUE_NOT_IN_LIST = "Object {0} in component {1} does not appear...

Convert excel file to jpg in c#

c#,excel,converter,spire
I am trying to use Spire dll to convert excel file to jpg . so i have a xlsm file like this : i use this code to convert it to jpg : Workbook workbook = new Workbook(); workbook.LoadFromFile(@"D:\a.xlsm"); Worksheet sheet = workbook.Worksheets[1]; sheet.SaveToImage("exceltoimage.jpg"); System.Diagnostics.Process.Start("exceltoimage.jpg"); but the output is like...

Python Simple PiggyBank Program

file,python-3.x,input,output,converter
This is my Python Program that I have been having some issues with: -- coding: cp1252 -- from time import gmtime, strftime print("Welcome to the PiggyBank version 1.") num_write = int(input("How much money would you like to store in your PiggyBank?")) f = open("PiggyBanks_Records.txt", "w") current_time = strftime("%Y-%m-%d %H:%M:%S", gmtime())...

Input String was not in Correct Format (C#: Radio buttons conversion)

c#,radio-button,format,converter
I am making a simple program where I/the user will select a number (the radio button) and when the "Click" is clicked, a message box will appear and show the result. i am almost there but everytime I click "Click", an error occurs and says: Input string is not in...

p:orderList converter getAsObject() doesn't call Object.toString()

jsf,primefaces,converter
I've written a custom converter as follows: @FacesConverter(value = "orderListConverter") public class OrderListConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { Object ret = null; if (component instanceof OrderList) { Object list = ((OrderList) component).getValue(); ArrayList<ExampleEntity> al = (ArrayList<ExampleEntity>) list; for (Object o : al)...

How to transform an .txt file to .csv with Java?

java,eclipse,converter,export-to-excel
How to transform an .txt file to .csv with Java? I did a Java project where I read a .txt file, and I need to use their data to create a .csv file, how should I split the data in the variable where the text is, and how do I...

Calculate AWG from Cross section unit mm² and vice versa

c#,converter
I want to convert values in the American unit AWG convert to the European metric system in mm² and vice versa. For instance I want to convert 11 AWG into 4.17 mm². I did not find implemented code so I added a solution here....

C# Dictionary > multiple keys dictionary

c#,list,dictionary,converter
I need to store the same key twice, so I tried doing this, but it ain't working. Can someone help me how to do this properly? But if the word is 1 time, I want it to be stored 1 time, and if it's 3,4,5.. still 2 times. private void...

VBA Code to Convert CSV to XLS

excel,vba,csv,converter,xls
Objective: I have a folder where multiple CSVs are dumped on my drive. These CSVs need to be converted to XLS files and saved (as XLS files) into the same, original folder. I have a code (pasted below) for it that works just fine, but... Problem: A window pops up...

How can I convert byte CP-1252 to byte UTF-8 in java [duplicate]

java,utf-8,converter,typeconverter,cp1252
This question already has an answer here: Encoding cp-1252 as utf-8? 2 answers I have already tried convert byte cp1252 to byte utf8 but all is in vain. For example: I have byte[] 0xB5(cp1252) and I want convert to byte[] 0xC3, 0xA0(utf8). I want to like this: µ -->...

Convert Grid square numbers to coordanates

javascript,arrays,grid,coordinates,converter
How in JavaScript, would I convert a grid square number on, say a 4x4 grid, and easily convert it to grid coordinates? (Example: grid square #6 -> 2, 2) ^ = selected square [][][][] [][^][][] [][][][] [][][][] So basically, how do I (quickly?) convert a grid number to two coordinates....

How to unpack a struct in Python?

python,file-io,converter,binaryfiles,unpack
I need to unpack a .bin file. The code used to make the file packed the data like so: x = '' x = x + struct.pack('q', random.randint(0, MAX_NUM)) x = x + struct.pack('q', random.randint(0, MAX_NUM)) When I do a f.read(16), where 16 is the size of the data I...

How to convert time string in milliseconds to DateTime object in c#?

c#,string,datetime,converter
I have the time in milliseconds as a string like this: 229935440730121 How to convert this string to a DateTime object. Thanks Update Sorry, The correct string is : 1423509923000 and should be 2/9/15 7:25:23 PM after conversion. It's a time string received from an telemetry device....

Converter for JSF passthrough input element (“HTML5 friendly markup”)

jsf,converter,jsf-2.2,passthrough-elements
I'm using a passthrough element inside Facelet page like this: <input jsf:value="#{...}"/> And I'd like to attach a Converter to it. How can I achieve this?...

Construct date for specific day of current month and convert it to epoch

date,converter,epoch
I need epoch of 4th day of current month. I have this: START_DT=$(date +"%Y-%m-04 00:00:00") START_DT_TS=$(date -d "$START_DT" +%s) Output is 1433368800 which is expected. How I achieve this on single line?...

Fortran type conversions

arrays,fortran,converter
I have the following command to set my array Use, Intrinsic :: iso_fortran_env Integer (Int8), Allocatable :: iu(:) Allocate (iu(4)) iu = [4,3,2,1] How can I stop the compiler giving me Allocate (iu(4)); iu = [4,3,2,1] 1 Warning: Possible change of value in conversion from INTEGER(4) to INTEGER(1) at (1)...

Python convert JSON to CSV

python,json,csv,field,converter
i have a JSON file which contains: { "leaderboard": { "$": [ { "userId": 1432024286216, "userName": "Joe Bloggs", "score": 111111, "gameType": "standard", "dateCreated": 1432024397833, "_id": 1432024397833 }, { "userId": 1432024626556, "userName": "Jane Bloggs", "score": 222222, "gameType": "demo", "dateCreated": 1432024730861, "_id": 1432024730861 } ] }, "users": { "$": [ { "userId_U":...

Arguments against a generic JSF object converter with a static WeakHashMap

jsf,jsf-2,converter
I want to avoid boiler plate code for creating a list of SelectItems to map my entities/dtos between view and model, so I used this snippet of a generic object converter: @FacesConverter(value = "objectConverter") public class ObjectConverter implements Converter { private static Map<Object, String> entities = new WeakHashMap<Object, String>(); @Override...

Python 3.4 tkinter real-time temperature converter

python,tkinter,converter,temperature
I wrote complicated program in Python 3.4 (with tkinter gui). It's temperature converter (Celsius to Fahrenheit and reverse) in real-time. It works almost good, but there is one problem. I have to add a space after input value every time. Anyone have idea what's wrong in this program? from tkinter...

How to add a word file content to a crystal report?

c#,visual-studio,crystal-reports,ms-word,converter
I am working on a web application project in visual studio Ultimate 2013. In this project, I am using crystal report templates where I need to design a template for a long word file (15 pages long). My question is: (Is there any possible way to add the word file...

MSVS2008 to MSVS2003 Conversion (Google Protobuf)

visual-studio,converter,protocol-buffers
I have to get Google Protobuf running on Visual Studio 2003, but it was built for Visual Studio 2008. Does anyone know wether that is possible and if so, how? I did some research and found, that sometimes just renaming the projects version number in the .sln should help, but...

Symfony2 fos_rest_bundle param converter not calling entity constructor

php,symfony2,converter,fosrestbundle
I'm developing an API and have the following entity: /** * Solicitud de registro. * * @ORM\Table() * @ORM\Entity(repositoryClass="DnD\RaHApiBundle\Repository\ApplicationRepository") */ class Application { public function __construct() { $pending = new Event("PENDING", "APPLICATION"); $this->status = new ArrayCollection($pending); $this->ownsVehicle = false; $this->resident = true; $this->timestamp = new DateTime(); } /** * @var...

How to convert datetime to integer in python

python,datetime,integer,converter
how can i convert YYYY-MM-DD hh:mm:ss format to integer in python? for example 2014-02-12 20:51:14 -> to integer. i know how to convert only hh:mm:ss but not yyyy-mm-dd hh:mm:ss def time_to_num(time_str): hh, mm , ss = map(int, time_str.split(':')) return ss + 60*(mm + 60*hh) ...

JavaScript convert a users input [closed]

javascript,input,converter
I'm currently in the process of creating a javascript converter to change a users input to morse code. I have this partially working - see fiddle I'm a relative beginner when it comes to javaScript (hence this project to try and improve). I've become stuck trying to remove the input...

Convert unix time to specific datetime format with culture info

c#,string,datetime,converter
I try to to convert string to specific datetime format. I have string: 1431075600 and I try convert this by: private static IFormatProvider culture = new System.Globalization.CultureInfo("en-GB"); model.DeliveryDate = DateTime.Parse(data.DeliveryDate, culture, System.Globalization.DateTimeStyles.AssumeLocal); I got error message: String was not recognized as a valid DateTime. Finally I want to have datetime...

Convert DDM to DD Geographic Coordinate Conversion C# [closed]

c#,math,coordinates,converter,coordinate
I have used http://www.pgc.umn.edu/tools/conversion to convert 52 37.9418 N 01.18.8020 E (DDM I Think?) To Latitude 52.632363 Longitude 1.313367 This seems to be very accurate, i have played about with the calculations to convert these values myself but they never seem to be accurate. http://en.wikipedia.org/wiki/Geographic_coordinate_conversion Does anyone have a good...

What is the fastest way to convert int to char

c#,performance,char,int,converter
What is the fastest way to convert int to char? I need a faster way because, convertingchar = Convert.ToChar(intvalue); is my slowest part in the program. I have multiple different int values, that have to be converted to char. My project is very big and I can't post my function....

Swift - how to convert hyphen/minus sign into + sign

string,swift,replace,converter
I am obtaining address in string variable from iOS reverse geocoding from below code. CLGeocoder().reverseGeocodeLocation(imageLocation, completionHandler: {(placemarks, error) in dispatch_async(dispatch_get_main_queue(), { if (error != nil) {println("reverse geodcode fail: \(error.localizedDescription)") textField.placeholder = "Address not found." } else { if placemarks.count > 0 { var placemark:CLPlacemark = placemarks[0] as! CLPlacemark var...

PL/SQL convert string to number

oracle,plsql,oracle11g,converter
I want to convert a string to numbers for a checksum. The string consists of universityCode || ' ' || countryCode || ' ' || studentNumber. An example string could be: TUE NL 123456789 I have to convert this sample string to numbers, and tried this with the TO_NUMBER function,...

From prototype to real APP

ios,user-interface,prototype,converter
I am a starter now developing my own IOS APP, but ran into the trouble: I really want to work out some cool UI, and do find lots of tools that will do exactly what I am thinking, however they seems to only give a prototype design. I am wondering...

From a Java method, how do I return an entire int converted from a string?

java,methods,converter
The purpose of this program is to type of a date like "9/7/1994" and return the numbers that are separated by the forward slashes. So it should come out as: 9 7 1994 The problem is that once I enter the date it'll return only 9 7 1 I've thought...

Error calling LibreOffice from Python

python,subprocess,converter,libreoffice
Calling LibreOffice to convert a document to text... This works fine from the linux command line: soffice --headless --convert-to txt:"Text" document_to_convert.doc But I get an error when I try to run the same command from Python: subprocess.call(['soffice', '--headless', '--convert-to', 'txt:"Text"', 'document_to_convert.doc']) Error: Please reverify input parameters... How do I get...

Convert docx to mediawiki and preserve [[Image:]]

converter,mediawiki,docx,libreoffice,soffice
Currently, I'm trying to move a docx to a mediawiki file and preserve the proper filenames in the [[Image:]] tags. For some reason, the proper image file gets swallowed (ie, normally it'd be media/image4.jpg, but instead it's just empty). I've tried extracting the docx and looking at docx/word/_rels/document.xml.rels but I...

How can I convert html.slim files to html or html.erb?

html,converter,erb,slim-lang
I need to convert the html.slim files in my Ruby on Rails application to html.erb. Is there any easy way to do it? I tried many options listed in Stack Overflow and other sites. But nothing worked for me. I found a converter http://slim2html.raving.systems/ and a html to slim converter...

Is there an existing Java class to convert data stored little-endian to integers by offset and length?

java,converter,little-endian
I have a data file that is made up of various fields in little-endian order. I know what the offset and length are for each of the various fields. Is there an existing Java class that will convert by offset and length to an integer? For example: 17 00 00...

Clean and convert HTML to XML for BaseX

html,xml,converter,xquery,basex
I would like to run some XQuery commands using BaseX over an HTML source that may be full of <script>, <style> nodes that must be removed and also unclosed tags (<br>, <img>) that must have a pair. (for example the dirty source of this page ) "Converting HTML to XML"...

Can't convert string have new line characters to JSONArray

java,json,string,exception,converter
I'm have problem with create JSONArray from string have new line characters example: String text = "[" + "'test line 1 \n" + "test line 2 \n" + "line 3', " + "'255.255.255.240' ," + "'<Not Set>'" + "] "; JSONArray tmpArray = new JSONArray(text); it will have exception: Exception...

EJB and managed bean injections in @FacesConverter and @FacesValidator in JSF 2.3

jsf,converter,jsf-2.3
@FacesConverter and @FacesValidator are not eligible for EJB or managed bean injection points up to JSF 2.2. They are supposed to work with JSF 2.3 (currently available as a milestone only) using an additional managed attribute with @FacesConverter and @FacesValidator as mentioned here. In JSF 2.1 very few JSF artifacts...

How to count the number of characters in a line in a csv file

java,csv,hex,converter
I have a Justice_League.csv file that has four lines with commas between them. I want to count the number of characters there are in each line and convert that number to hex. Below is the contents of Justice_League.csv: Bruce Wayne,Batman,None,Gotham City,Robin,The Joker 43 2B Oliver Queen,Green Arrow,None,Star City,Speedy,Deathstroke 50 32...

How can I convert from hexadecimal string to normal string?

java,android,hex,converter
I received to HTTP GET response as hexadecimal string data with socket in java. But I want to convert normal string to this data for HTML format. How can I make it ?

Rails: Convert string “04/30/2015” to valid datetime for storing inside postgres

ruby-on-rails,date,datetime,converter
Very simple question but could not find a solution or figure it out yet. How to convert this string "04/30/2015" to valid datetime for storing inside postgres database? I tried several ways to no avail: new_date = "#{ params[:interview][:expire_at]}00:00:00".to_datetime ...

Convert a number into a name

javascript,html,numbers,converter,names
For example, I have <span id="convertNumberToName">1</span> somewhere on my page. Notice the "1", I want to covert "1" into let's say "John" every time the "1" is within a span tag with "convert" as the id. I also want "2" to be converted to "Pete". And "3" to be converted...

Android: Convert Text Input to ASCII and print it as a string

java,android,converter
This is my code EditText textExtract = (EditText) findViewById(R.id.textInput); String textInput = textExtract.getText().toString(); TextView textOut = (TextView) findViewById(R.id.textOutput); I am taking input from the user and storing it in String textInput. Now, how do I convert the String textInput to a String of ASCII values which I want to print...

C# Trying to format datagridview data and pass back through the loop once formatted

c#,arrays,for-loop,datagridview,converter
I am trying to format my 'Speed' column in order for it to display as a decimal within a data grid that is collecting data from a text file but i'm having no luck. here is the code i'm trying to use: while ((r.Peek() != -1)) { string timeS =...

How To Change My Array Format In PHP

php,arrays,date,converter
My code generate array like this Array ( [0] => Array ( [0] => 2015-05-28 [1] => 1 ) [1] => Array ( [0] => 2015-05-29 [1] => 1 ) [2] => Array ( [0] => 2015-06-02 [1] => 2 ) ) i want to convert it same as bellow...

Primefaces selectOneMenu converter called but not working

java,jsf-2,primefaces,converter,selectonemenu
I've looked at the other questions this and this, etc, the problem is that my convert gets called but the values of selectOneMenu doesn't change. My entity class is generated, and has equals as well as hashCode and I would like not to change anything in it - if it...

refer to single character of argument passed by user

c,string,arguments,hex,converter
I am trying to make a hex to string converter. I want the argument to be passed in at run. So far I have this.. int main(int argc, const char *argv[]){ int i; for (i=0; i < strlen(argv[1]); i++) { printf("%s = %c\n",argv[1], (int)atol(argv[i])); } return 0; } but in...

How to convert from one type, to multiple types which are identical aside from package name?

java,generics,converter
I have a base class that I want to convert. All the types I want to convert to are identical to each other, except for the package name. They're created in specs I have no control over. Is there a way of creating a generic converter, so I'm not repeating...

What is the better design approach to convert object A to object B?

design-patterns,converter
I would like to design an Interface which will be used for converting Object A to Object B. Something like below snippet - Interface IConverter<S, T> { T convertTo(S objectA); } But sometimes more external input parameters are needed to get the Object B. Sample interface is as below -...

How to convert an array with 0(n log k)?

algorithm,converter
Input: Array A of n integers and k value (k<=n) Output: 1D Array B B[i]{ if i<k = 0 else k-th smallest number of A[1...i] B should have the 3rd value from the minimum in A[1] to A[i], but if i<k the B value is 0 O(nlogk) Example: A: 2...

F# sequence and array2d conversion

arrays,string,f#,converter
I am creating a function to convert an Array2D of Squares to a string and then save that string to a file. Moreover I am also creating a loading function that will take in a string from a file and convert that string to an Array2D. The Squares look like:...

Windows XAML: Replacement for WPF TextBox's CharacterCasing

c#,xaml,user-interface,windows-store-apps,converter
I have a TextBox that whenever a user types into it I want the text to only be uppercase. For example, if I type in "abc" the actual text in the TextBox and in the backend binding should be "ABC". In WPF there is the CharacterCasing property, but I can't...

Convert date to string format

vb.net,converter
I have successfully imported data from xls into dataGridView. The date column in dataGridView is showing the DateTime format. I want this date column to be displayed in "dd MMM yyyy" format. I have tried as shown below: connExcel.Open() Dim dtExcelSchema As DataTable dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing) Dim SheetName As...

how to convert this declaration of variables Oracle to Sql Server

sql-server,oracle,variables,converter
this is the code in Oracle: pUsuario IN SAV_CAMPANAS_ENCA.USUARIO_CREA%TYPE, pCodTipo IN SAV_TIPOS_CAMPANA.COD_TIPO%TYPE, pCantidadRegistros IN SAV_CAMPANAS_ENCA.CANTIDAD_REGISTROS%TYPE, pPrograma IN SAV_CAMPANAS_ENCA.PROGRAMA%TYPE, pCodPais IN SAV_PAIS.COD_PAIS%TYPE, pNumeroIntentos IN SAV_CAMPANAS_ENCA.MAXIMO_INTENTOS%TYPE, ...

c#: Self referencing object conversion [closed]

c#,converter,infinite-loop,self-reference
I have a self referencing object, which I need to converted from one to another object which is similar. I'm unable to find suitable method to do the convert with recursion without leading into an infinite loop. Any help would be appreciated.Still learning my ropes in c# Object 1: public...

How to speed up a complex image processing?

php,image,imagemagick,converter,imagemagick-convert
Every user will be able to upload 100 TIFF (black and white) images. The process requires: Convert tif to jpg. Resize image to xx. Crop image to 200px. Add a text watermark. Here is my PHP code: move_uploaded_file($image_temp,$destination_folder.$image_name); $image_name_only = strtolower($image_info["filename"]); $name=$destination_folder.$image_name_only.".jpg"; $thumb=$destination_folder."thumb_".$image_name_only.".jpg"; $exec = '"C:\Program Files\ImageMagick-6.9.0-Q16\convert.exe" '.$destination_folder.$image_name. ' '.$name.'...

How to avoid 'Invalid date' prefix in result when converting from milliseconds (13 digits)

json,converter,unix-timestamp,epoch
I'm working with converting a 13 digits time stamp fetched from json. Everything seems to work but one - the prefixed Invalid Date before the readable time. Here's the code: var timestamp=new Date(event.feature.getProperty('updated')) var humanTime=timestamp+Date(1970,1,1); where updated value from json is '1432205083551' (13 digits). So the result is : Invalid...

Assining values to numeric factor levels [duplicate]

r,converter
This question already has an answer here: How to convert a factor to an integer\numeric without a loss of information 4 answers I already went through different links like: How to convert a factor to an integer\numeric without a loss of information but could not solve the problem I...

Converting Valgrind XML Output to HTML

html,xml,converter,valgrind
I know there is a possibility to create a valgrind output in xml. But is there a possibility to convert it into html? Cause standard converter has problems with valgrind output convention. Or does anybody have a stylesheet for it?

Converting Integer to 32-bit Binary - Output is backwards

c,binary,integer,converter,backwards
I'm writing a simple program to convert an integer (between 0 and 2147483647) to 32-bit binary. I ran into a small problem that I can't seem to solve; the output is coming up backwards! For example, instead of 2 = 10, I get 2 = 01. Can someone help me...