conversion

Atom to rss feed

I have a rss reader portlet in websphere portal,which add the rss feed and render the feed items on it.i need to add Atom feeds also in the existing code.we use a third party API to parse the feed url,add it and render the news items on the portlet.Need to add some logic in my java code to initially recognize the atom feed and convert it...

How do you convert the following encryption code from Perl (or from PHP) to VB.NET?

I have some encryption code that has been written in Perl (also a code snippet in PHP) - but I just can't get a version written in VB.NET to work with the third party. Example in Perl package Sitemaker::API::Crypt; use warnings; use strict; use base qw( Exporter ); use Crypt::CBC; use MIME::Base64; our @E...

how can I make those changes in one go?

Hello everybody as an editor I have to republish a magazine but not before making minor modifications across the magazine. Any suggestions on how can I make those changes in one go? ...

Could a bored AWK master kindly convert this Python program?

I love Python but do not really care for AWK. For purposes of comparison (and to see how a Python-to-AWK master would do this), could someone rewrite the following Python program in AWK? Considering how short it is, some would think that the rewrite would be simple and easy for anyone with a little time. import os ROOT = '/Users/Zero/D...

How can I convert a string to an int in Python?

The output I'm getting for my little example app is the following: Welcome to the Calculator! Please choose what you'd like to do: 0: Addition 1: Subtraction 2: Multiplication 3: Division 4: Quit Application 0 Enter your first number: 1 Enter your second number: 1 Your result is: 11 This is because the addition() method is taking the ...

Python ogg vorbis encoder on Windows

I want to use Python to convert a wav file to ogg vorbis format, so it can be streamed to a browser for playback. I've been able to use PyMedia 1.3.7.3 to encode to mp3 format, but when I set the output stream type to 'ogg', I get the error: oggvorbis_encode_init: init_encoder failed and the script dies. Perhaps I don't have the right ...

PHP Notice: Array to string conversion

I have an ecommerce site based off of this tutorial. Now, in the cart.php page, whenever someone updates the quantity and proceeds to click the Update Cart button, they are greeted with the following notices: Notice: Array to string conversion in /home/aquadual/public_html/fiverrproject/plaincart/library/config.php on line 51 Notice: ...

Float to text behavior of MATLAB's fprintf()

When using fprintf to convert floats to text in a decimal representation, the output is a series of decimal digits (potentially beginning with 0). How does this representation work? >>fprintf('%tu\n',pi) >>1078530011 >>fprintf('%bu\n',pi) >>04614256656552045848 Apologies if this is very trivial; I can't find an answer elsewhere, in ...

Automation for JSP Multilingualization

An existing set of JSPs, hard-coded with English field labels, javascript error/info messages, image 'alt' message etc. needs to be multilingualized. What would be the best way to go about converting these JSPs to use the standard Java Multilingual features (resource bundles, locales etc)? ...

Exponent Function in C#

i've a string like1.00E+4 Is there any built in function to convert this string to 10000.(Integer convertion [1.00E+4=10000]).? Now i'm using regular expression for this kind of strings ...

converting a String to UTF8 format

Hi, I java code, i am having a string name = "örebro"; // its a swedish character. But when i use this name in web application. i prints some specail character at 'Ö' character. Is there anyway i can use the same character as it is in "örebro". i did some thing like this but does not worked. String name = "örebro"; byte[] utf8s ...

What should i use i if need a custom converter when using @RequestParam ???

I if have a method signature as follows public void deposit(@RequestParam("accountId") Integer accountId, @RequestParam("amount") BigDecimal amount) {...} And because i have a locale specific decimal value which needs to be converted to a BigDecimal, is there some annotation which allows me to set up incoming data...

Why NULL is converted to string*?

Hello all, I saw the following code: class NullClass { public: template<class T> operator T*() const { return 0; } }; const NullClass NULL; void f(int x); void f(string *p); f(NULL); // converts NULL to string*, then calls f(string*) Q1> I have problems to understand the following statement template<class T> operator T*() con...

C# String to Float Conversion

Hi there, I need to convert a string to a float. These is is my example string: 1 MW +00000.00 mm 2 MW +0000.000 mm 3 MW -00000.01 mm 4 MW +00000.00 mm 5 MW +00002.92 mm 6 MW +00002.69 mm And this is what i'm doing: text = text.Substring(pos + 5, 9).Trim(); float val = 0.0F; float.TryParse(texto, out val); this.txtDi...

Converting HTML Files into a PDF

I have a website that displays product information that the client wishes to offer as pdf format. I need a way to dynamically convert a particular HTML page into a PDF, does anybody know of a way to do this? I need to convert an html page into a PDF document and serve it to the end user on the fly (there are WAY too many products to do t...

Ensure international format for phone numbers provided by an Android app?

Hi stackies, the users of my app will provide me the recipient's phone numbers of the text messages they will be writing. How can I ensure the usage of the international phone number format when the user provides a NATIONAL format while sending a message to a person who is located in his own country? Would I have to actually KNOW all t...

WPF RichTextBox: save/load in custom format

I need to load/save data from the WPF RichTextBox in a custom format (similar to Markdown). RichTextBox supports saving/loading in several basic formats (Rtf, Text, Xaml) using TextRange.Save method: using (FileStream fs = File.OpenWrite(file)) { TextRange text = new TextRange(rtNote.Document.ContentStart, rtNote.Document.Content...

Performing operations on a double returns 0

Hello There! I have a method that receives a number in a NSString format. I wish to convert this string to a double which I can use to calculate a temperature. Here's my method. NSString *stringTemp = text; // text is a NSString NSLog(@"%@",stringTemp); // used for debugging double tempDouble = [stringTemp doubleValue]; NSLog(@"%f",...

How to parse a string that is in a different encoding from java

I have a string that I have read in from a Word document. I think it is in "Cp1252" encoding. Java uses UTF8. How do I search that string for those special characters in Cp1252 and replace them with an appropriate UTF8 character? specifically, I want to replace the "En Dash" character with a plain "-" The following code block takes t...

strange type conversion

I just can not figure out the following code. int d = 5; float f = 3.8f; int ret = d*f; The ret is 18, not 19 as I expected. Why? ...