Search Results

Search found 2655 results on 107 pages for 'conversion'.

Page 4/107 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Java string to double conversion.

    - by wretrOvian
    Hi, I've been reading up on the net about the issues with handling float and double types in java. Unfortunately, the image is still not clear. Hence, i'm asking here direct. :( My MySQL table has various DECIMAL(m,d) columns. The m may range from 5 to 30. d stays a constant at 2. Question 1. What equivalent data-type should i be using in Java to work (i.e store, retrieve, and process) with the size of the values in my table? (I've settled with double - hence this post). Question 2. While trying to parse a double from a string, i'm getting errors Double dpu = new Double(dpuField.getText()); for example - "1" -> java.lang.NumberFormatException: empty String "10" -> 1.0 "101" -> 10.0 "101." -> 101.0 "101.1" -> 101.0 "101.19" -> 101.1 What am i doing wrong? What is the correct way to convert a string to a double value? And what measures should i take to perform operations on such values?

    Read the article

  • Providing *implicit* conversion operator for template specialization

    - by Neil G
    I have a templated sparse_vector<T> class, and I am also using Boost UBLAS. How would I provide implicit conversions between sparse_vector<double> and boost::numeric::ublas::compressed_vector<double>? I would also like to provide similar conversions between std::vector<double> and boost::numeric::ublas::vector<double>. (I am using gcc 4.4 with C++0x enabled.)

    Read the article

  • Conversion between different template instantiation of the same template

    - by Naveen
    I am trying to write an operator which converts between the differnt types of the same implementation. This is the sample code: template <class T = int> class A { public: A() : m_a(0){} template <class U> operator A<U>() { A<U> u; u.m_a = m_a; return u; } private: int m_a; }; int main(void) { A<int> a; A<double> b = a; return 0; } However, it gives the following error for line u.m_a = m_a;. Error 2 error C2248: 'A::m_a' : cannot access private member declared in class 'A' d:\VC++\Vs8Console\Vs8Console\Vs8Console.cpp 30 Vs8Console I understand the error is because A<U> is a totally different type from A<T>. Is there any simple way of solving this (may be using a friend?) other than providing setter and getter methods? I am using Visual studio 2008 if it matters.

    Read the article

  • prevent conversion of <br/>

    - by Chris
    Hello, I fear this is a dumb question, but I can't seem to find the answer. Pretty sure what that makes me...... I have C# generated HTML (HtmlGenerator), to which I sometimes want to insert a line break at a certain part of a cell's innertext. Here is how that comes out: <TD >There are lots of extra &lt; br /&gt; words here </TD> This then displays the <br/> as a part of my cell text - not good. Am I missing an easy way to have the <br/> preserved and not converted to &lt, etc...? thanks

    Read the article

  • String / DateTime Conversion problem (asp.net vb)

    - by Phil
    I have this code: Dim birthdaystring As String = MonthBirth.SelectedValue.ToString & "/" & DayBirth.SelectedValue.ToString & "/" & YearBirth.SelectedValue.ToString Dim birthday As DateTime = Convert.ToDateTime(birthdaystring) Which produces errors (String was not recognized as a valid DateTime.) The string was "01/31/1963". Any assistance would be appreciated. Thanks.

    Read the article

  • NHibernate Entity code conversion from #C to VB.Net

    - by CoderRoller
    Hello and thanks for your help in advance. I am starting on the NHibernate world and i am experimenting with the NHibernate CookBook recipes, i am trying to set a base entity class for my entities and this is the C# code for this. I would like to know whats the VB.NET version so i can implement it in my sample project. This is the C# code: public abstract class Entity<TId> { public virtual TId Id { get; protected set; } public override bool Equals(object obj) { return Equals(obj as Entity<TId>); } private static bool IsTransient(Entity<TId> obj) { return obj != null && Equals(obj.Id, default(TId)); } private Type GetUnproxiedType() { return GetType(); } public virtual bool Equals(Entity<TId> other) { if (other == null) return false; if (ReferenceEquals(this, other)) return true; if (!IsTransient(this) && !IsTransient(other) && Equals(Id, other.Id)) { var otherType = other.GetUnproxiedType(); var thisType = GetUnproxiedType(); return thisType.IsAssignableFrom(otherType) || otherType.IsAssignableFrom(thisType); } return false; } public override int GetHashCode() { if (Equals(Id, default(TId))) return base.GetHashCode(); return Id.GetHashCode(); } } I tried using an online converter but puts a Nothing reference in place of default(TId) that doesn't seem right to me that's why I request for help: Private Shared Function IsTransient(obj As Entity(Of TId)) As Boolean Return obj IsNot Nothing AndAlso Equals(obj.Id, Nothing) End Function I Would appreciate the insight you may give me on the subject.

    Read the article

  • Conversion of text to unicode strings...

    - by user154301
    I have to process JSON files that looks like this: \u0432\u043b\u0430\u0434\u043e\u043c <b>\u043f\u0443\u0442\u0438\u043c<\/b> \u043d\u0430\u0447 Unfortunately, I'm not sure how this encoding is called. I would like to convert it to .NET Unicode strings. What's the easies way to do it? Thanks in advance!

    Read the article

  • Implicit type conversion in DB/2 inserts?

    - by IronGoofy
    We're using SQL Inserts to insert some data via a script into DB/2 tables, e.g. CREATE TABLE TICKETS (TICKETID VARCHAR(10) NOT NULL); On my home installation, this statement works fine (note that I'm using an integer which is autoatically cast into a VarChar): INSERT INTO TICKETS (TICKETID) VALUES (1); while at my customer's site I get a type error. My question(s): Is this behavior version dependent? (I use a DB2 Express V9.7, while the customer has an Enterprise V9.5) Is there a config option to change the behavior? (I would like my home install to behave as close as possible as the production environment is going to be.)

    Read the article

  • Intercept method calls in Groovy for automatic type conversion

    - by kerry
    One of the cooler things you can do with groovy is automatic type conversion.  If you want to convert an object to another type, many times all you have to do is invoke the ‘as’ keyword: def letters = 'abcdefghijklmnopqrstuvwxyz' as List But, what if you are wanting to do something a little fancier, like converting a String to a Date? def christmas = '12-25-2010' as Date ERROR org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '12-25-2010' with class java.lang.String' to class 'java.util.Date' No bueno! I want to be able to do custom type conversions so that my application can do a simple String to Date conversion. Enter the metaMethod. You can intercept method calls in Groovy using the following method: def intercept(name, params, closure) { def original = from.metaClass.getMetaMethod(name, params) from.metaClass[name] = { Class clazz -> closure() original.doMethodInvoke(delegate, clazz) } } Using this method, and a little syntactic sugar, we create the following ‘Convert’ class: // Convert.from( String ).to( Date ).using { } class Convert { private from private to private Convert(clazz) { from = clazz } static def from(clazz) { new Convert(clazz) } def to(clazz) { to = clazz return this } def using(closure) { def originalAsType = from.metaClass.getMetaMethod('asType', [] as Class[]) from.metaClass.asType = { Class clazz -> if( clazz == to ) { closure.setProperty('value', delegate) closure(delegate) } else { originalAsType.doMethodInvoke(delegate, clazz) } } } } Now, we can make the following statement to add the automatic date conversion: Convert.from( String ).to( Date ).using { new java.text.SimpleDateFormat('MM-dd-yyyy').parse(value) } def christmas = '12-25-2010' as Date Groovy baby!

    Read the article

  • Oracle Tutor: XPDL conversion (and why you should care)

    - by mary.keane
    You may have noticed that the Oracle Business Process Converter feature in Tutor 14 supports "XPDL" conversion to Oracle Business Process Analysis Suite (BPA), Oracle Business Process Management Suite (BPM), and Oracle Tutor, and you may have briefly wondered "what is XPDL?" before you moved on to the Visio import feature (a very popular feature in Tutor 14). This posting is for those who do not yet understand (or care) about XPDL and process modeling. Many of us (and I'm including myself) have spent years working in the process definition arena: we've written procedures, designed systems and software to help others write procedures, and have been responsible for embedding policies and procedures into training material for employees. We've worked with tools such as Oracle Tutor, Microsoft Visio, Microsoft Word, and UPK. Most of us have never worked with "modeling tools" before, and we certainly never had to understand BPMN. It's a brave new world in this arena, and companies desperately need people with policy and procedural system expertise to be able to work with system analysts so there is a seamless transfer of knowledge from IT to employees. When working with applications, a picture is worth a thousand words, so eventually you're going to need to understand and be able to work with business process models. XPDL is an acronym for XML Process Definition Language, and it is an interchange format for business process models. It allows you to take a BPMN model that was developed in one workflow application such as BizAgi and import it into another workflow application or a true BPMN management system such as Oracle BPM. Specifically, the XPDL format contains the graphical information of a model as well as any executable information. By using a common format, models can be moved from a basic modeling application used by business owners to applications used by system architects. Over 80 applications support the XPDL format, including MetaStorm ProVision, BEA ALBPM, BizAgi, and Tibco. I mention these applications because we have provided XSLT mapping files specifically for these vendors. Oracle Business Process Converter was designed with user extensibility in mind, and thus users can add their own XML files so that additional XPDL models from other vendors can be converted to BPM, BPA, and Oracle Tutor. Instructions on how to add your own files can be found in Appendix 4 of the Oracle Business Converter manual. Let's take a visual look at how this works. Here is an example of a model devloped in BizAgi: This model can be created by the average business user without a large learning curve, and it's a good start for the system analyst who will be adding web services as well as for the business manager who manages the process described in the model. By exporting this model as XPDL, the information can be converted into Oracle BPA and Oracle BPM as well as converted to Oracle Tutor to become the framework for a procedure. Through this conversion feature, one graphic illustration of a business process can be used by a system analyst, business analyst, business manager, and employee, as seen below. Model Converted to Tutor Procedure Below is the task section of the procedure after conversion from an XPDL file. Model converted to BPA Model converted to BPM End users still want step by step instructions on how to perform their jobs, so procedures (Oracle Tutor) and application simulations (UPK) are still a critical piece of the solution. But IT professionals need graphic descriptions of how the applications work, regardless of whether there are any tasks involving humans. Now there is a way to convert procedures (Oracle Tutor docx files) and basic models (XPDL files) so that business managers and system analysts can share process information. References Wikipedia XPDL. Workflow Management Coalition, XPDL Support and Resources Oracle Business Process Converter manual, Oracle Tutor 14 Oracle Business Process Management 11g If you have any XPDL conversion stories to share, we'd love to hear from you. Best wishes for the coming new year, Mary Keane, Senior Development Manager, Oracle Tutor and BPM

    Read the article

  • How to optimize process of outlook files (*msg) conversion to .pdf?

    - by Lilly
    The aim is to convert several messages from Microsoft Outlook (2003 and/or 2007 versions) to .pdf files. Condition: One message should generate a corresponding single pdf file. If possible, pdf file should be named with date format YYYY-MM-DD (e.g. 2011-02-16.pdf). The current process, limited by softwares such as CutePDF, requires the conversion performed one message at a time. I'm looking for a solution that allows the conversion of several messages at once, but under the condition abovementioned (mainly: one message = one pdf file).

    Read the article

  • Loosely coupled implicit conversion

    - by ltjax
    Implicit conversion can be really useful when types are semantically equivalent. For example, imagine two libraries that implement a type identically, but in different namespaces. Or just a type that is mostly identical, except for some semantic-sugar here and there. Now you cannot pass one type into a function (in one of those libraries) that was designed to use the other, unless that function is a template. If it's not, you have to somehow convert one type into the other. This should be trivial (or otherwise the types are not so identical after-all!) but calling the conversion explicitly bloats your code with mostly meaningless function-calls. While such conversion functions might actually copy some values around, they essentially do nothing from a high-level "programmers" point-of-view. Implicit conversion constructors and operators could obviously help, but they introduce coupling, so that one of those types has to know about the other. Usually, at least when dealing with libraries, that is not the case, because the presence of one of those types makes the other one redundant. Also, you cannot always change libraries. Now I see two options on how to make implicit conversion work in user-code: The first would be to provide a proxy-type, that implements conversion-operators and conversion-constructors (and assignments) for all the involved types, and always use that. The second requires a minimal change to the libraries, but allows great flexibility: Add a conversion-constructor for each involved type that can be externally optionally enabled. For example, for a type A add a constructor: template <class T> A( const T& src, typename boost::enable_if<conversion_enabled<T,A>>::type* ignore=0 ) { *this = convert(src); } and a template template <class X, class Y> struct conversion_enabled : public boost::mpl::false_ {}; that disables the implicit conversion by default. Then to enable conversion between two types, specialize the template: template <> struct conversion_enabled<OtherA, A> : public boost::mpl::true_ {}; and implement a convert function that can be found through ADL. I would personally prefer to use the second variant, unless there are strong arguments against it. Now to the actual question(s): What's the preferred way to associate types for implicit conversion? Are my suggestions good ideas? Are there any downsides to either approach? Is allowing conversions like that dangerous? Should library implementers in-general supply the second method when it's likely that their type will be replicated in software they are most likely beeing used with (I'm thinking of 3d-rendering middle-ware here, where most of those packages implement a 3D vector).

    Read the article

  • C# .NET : Is using the .NET Image Conversion enough?

    - by contactmatt
    I've seen a lot of people try to code their own image conversion techniques. It often seems to be very complicated, and ends up using GDI+ funciton calls, and manipulating bits of the image. This has got me wondering if I am missing something in the simplicity of .NET's image conversion call when saving an image. Here's the code I have Bitmap tempBmp = new Bitmap("c:\temp\img.jpg"); Bitmap bmp = new Bitmap(tempBmp, 800, 600); bmp.Save(c:\temp\img.bmp, //extension depends on format ImageFormat.Bmp) //These are all the ImageFormats I allow conversion to within the program. Ignore the syntax for a second ;) ImageFormat.Gif) //or ImageFormat.Jpeg) //or ImageFormat.Png) //or ImageFormat.Tiff) //or ImageFormat.Wmf) //or ImageFormat.Bmp)//or ); This is all I'm doing in my image conversion. Just setting the location of where the image should be saved, and passing it an ImageFormat type. I've tested it the best I can, but I'm wondering if I am missing anything in this simple format conversion, or if this is suffice?

    Read the article

  • An Approach to Incremental Conversion

    - by Paula Speranza-Hadley
    It is common for Oracle Enterprise Taxation and Policy Management (ETPM) customers to implement in multiple phases.  This results in a need for incremental conversion, where part of the data in is production and they are now adding new data.  Some of the new data can be new persons, accounts and their children, but some may be new tax types for existing taxpayers.  This document addresses a methodology for adding incremental data into ETPM.  It does not address every possible data scenario, but offers a path to achieving incremental conversion without the need for code changes.    https://blogs.oracle.com/tax/resource/IncrementalConversion.pdf  

    Read the article

  • Google Analytics conversion tracking - referrals from payment provider

    - by martynas
    I have a question regarding conversion tracking using Google Analytics. My client uses an external payment service provider - SecureTrading. Problem: All website visitors who would like to make a purchase are taken to a payment form on https://securetrading.net and are redirected back after a successful payment. Google Analytics counts that as a referral and messes up conversion tracking stats. Question: What needs to be changed / added in the payment forms or Google Analytics settings so that the conversions would be assigned to the right traffic sources. Screenshot:

    Read the article

  • My events don't show up in the goal funnels or conversion funnels

    - by Amit Bens
    I have an event set up on a website and I'd like to track the effect this event has on conversion rate. The event seems to be working fine - I can see it on Top Events with all the labels, etc. But when going into Goal Flow and selecting 'Event Category' these events don't show up. I have this running for about a week. And I have made multiple checks to verify that I have events that triggered the conversion goal. Any clue about what I'm doing wrong?

    Read the article

  • Convert PPT to PNG via python

    - by uswaretech
    I want to convert PPT to png, or other image formats using Python. This question has been asked on SO, but essentially recommends running OpenOffice in headless X server, which was an absolute pain last time I used it. (Mostly due to hard to replicate bugs due to OO crashing.) Is there any other way, (Hopefully using Linux CLI utilities only, and pure Python above them?)

    Read the article

  • How to convert MS doc to pdf

    - by magh
    How to convert doc to pdf using java api. where document contains various formats such as tables in ms word. when converting to pdf using iText. where actual document looks different to converted pdf. please provide any api not an exe installed for converting . must be an open source

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >