Search Results

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

Page 11/107 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Implicit conversion while using += operator?

    - by bdhar
    Conside the following code: int main() { signed char a = 10; a += a; // Line 5 a = a + a; return 0; } I am getting this warning at Line 5: d:\codes\operator cast\operator cast\test.cpp(5) : warning C4244: '+=' : conversion from 'int' to 'signed char', possible loss of data Does this mean that += operator makes an implicit cast of the right hand operator to int? P.S: I am using Visual studio 2005

    Read the article

  • 'Invalid conversion from some_type** to const some_type**'

    - by petersohn
    I've got a function that requires const some_type** as an argument (some_type is a struct, and the function needs a pointer to an array of this type). I declared a local variable of type some_type*, and initialized it. Then I call the function as f(&some_array), and the compiler (gcc) says: error: invalid conversion from ‘some_type**’ to ‘const some_type**’ What's the problem here? Why can't I convert a variable to const?

    Read the article

  • UIRemoveNotificationType invalid conversion

    - by Daniel Wood
    Hi, I'm trying to use this fairly standard line of code in my app: [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; But am receiving the follow error: error: invalid conversion from 'int' to 'UIRemoteNotificationType' It works if I only use one of the notification types but fails every time if I try and use more than one. Any ideas what I'm doing wrong?

    Read the article

  • Implicit conversion causes stack overflow

    - by user44242
    The following code snippet worked perfectly, then after some code changes in different files, I've started getting stack overflows resulting from recursive invocation of the implicit conversion. Has this ever happened to anyone, and if so what's the fix. implicit def comparable2ordered[A <: Comparable[_]](x: A): Ordered[A] = new Ordered[A] with Proxy { val self = x def compare(y: A): Int = { self.compareTo(y) } }

    Read the article

  • How do I convert PDF to HTML programmatically?

    - by SoaperGEM
    Are there any classes, COM objects, command line utilities, or anything else that I can make an API for that can convert a PDF to an HTML document? Obviously the conversion might be a little rough since PDFs can contain a lot more than HTML can describe. I found a utility called pdftohtml on Source Forge, but quite honestly it does a horrible job with the conversion. I don't care if the software is free or commercial, but is there anything out there at all that I can incorporate with my own software to do this sort of conversion at least decently? I know Google's developed their own method of doing this, since you can click "View as HTML" on a PDF attached to an email through Gmail, but I was hoping there was something out available to the public. Remember, PDF to HTML. I'm NOT worried about HTML to PDF.

    Read the article

  • What is the fastest and best way to convert an rmvb video to mp4/mkv without losing any quality?

    - by Eric Leung
    the file will be played in a popbox3d. my old method was to convert the video using vidcoder (an offshoot of handbrake) using normal settings, but i've recently confirmed that this significantly reduces video and audio quality. i bumped up the conversion quality to 'high profile' and this produced a higher quality video but raised the conversion time to about twice the video length (95 minutes to convert a 45 minute video) on a core2duo laptop. this is less than ideal when a large number of videos need to be converted. i have tried a direct remuxing using mkv toolnix but this produced a video that refused to display video on the popbox3d, which is consistent with the reported: [quote=other old thread] it is possible to put RealMedia A/V in MKV container (used MKVtoolnix) - however, it is awkward to play later. RV40 is only suspected to be based on H.264 - simplify, is not consistent with MPEG-4 AVC specification. [/quote] i have read that ... [quote=from old thread] Under normal circumstances, [ffmpeg] should convert the video to .video.mp4 and the audio to (.wav then to) .audio.mp4, then mux the video and audio into a new .mp4 file and delete the temporary video-only and audio-only files.[/quote] and i am currently attempting to discover how this is done. help? PS: i download a lot of series from asia and for some strange reason, rmvb is a really popular format over there. sometimes, it's the only format that's available. unfortunately, it's a format that is incompatible with the popbox3d, so i have to convert the files before i can watch them on my tv.

    Read the article

  • How can I avoid a few seconds of blank video when using -vcodec copy?

    - by arlomedia
    I'm processing user-uploaded videos on a CentOS web server with ffmpeg. I need to convert each video to a standard size and format, then extract a 30-second sample clip from each video. I want to use the "-vcodec copy" flag in the extraction command to avoid encoding a second time. This command works for my initial conversion: ffmpeg -i uploaded.mov -f mp4 -vcodec libx264 -vpre medium -acodec libfaac -r 15 -b 360k -ab 48k -ar 22050 -s 480x320 formatted.mp4 And this sometimes works for the extraction: ffmpeg -i formatted.mp4 -vcodec copy -acodec copy -ss 0 -t 30 formatted_sample.mp4 However, when I run the extraction command on some videos, the extracted sample clip starts with several seconds of blank video. The audio starts right away but the video doesn't start for 3-6 seconds. To demonstrate the problem, I've uploaded two video clips and run the above commands on them. I created the first clip in Final Cut Express and encoded it with Handbrake before uploading to the web server: 1a) uploaded clip 1b) converted with first command 1c) extracted with second command, missing first six seconds By comparison, this second clip comes from Apple's website and does not show the problem: 2a) uploaded clip 2b) converted with first command 2c) extracted with second command, no problem Can anyone see what's different about the two source clips? And if so, is there anything I can do in my conversion command so that when the extraction command runs, the clip is set up to avoid the missing video? By the way, I initially had the problem with ffmpeg 0.6.1 installed from yum, but I upgraded to the latest git version and the problem remains.

    Read the article

  • Best way to map/join two autogenerated enums

    - by tomlip
    What is the best C++ (not C++11) way of joining two enums from autogenerated class similar to one presented below: namespace A { namespace B { ... class CarInfo { enum State { // basically same enums defined in different classes Running, Stopped, Broken } } class BikeInfo { enum State { // basically same enums defined in different classes Running, Stopped, Broken } } } } What is needed is unified enum State for both classes that is seen to outside world alongside with safe type conversion. The best and probably most straightforward way I came up with is to create external enum: enum State { Running, Stopped, Broken } together with conversion functions State stateEnumConv(A::B::CarInfo::State aState); State stateEnumConv(A::B::BikeInfo::State aState); A::B::CarInfo::State stateEnumConv(State aState); A::B::BikeInfo::State stateEnumConv(State aState); Direction into right approach is needed. Gosh coming from C I hate those long namespaces everywhere an I wish it could be only A::B level like in presented example. Four conversion functions seem redundant note that CarInfo::State and BikeInfo::State has same enum "members".

    Read the article

  • Fastest way to convert a binary file to SQLite database

    - by chown
    I've some binary files and I'm looking for a way to convert each of those files to a SQLite database. I've already tried C# but the performance is too slow. I'm seeking an advice on how and what programming language should be the best to perform this kind of conversion. Though I prefer any Object Oriented Language more (like C#, Java etc), I'm open for any programming language that boosts up the conversion. I don't need a GUI frontend for the conversion, running the script/program from console is okay. Thanks in advance

    Read the article

  • Android: Conversion to Dalvik format failed: Unable to execute dex: null

    - by Adam Haile
    I'm trying to use the SmugFig SmugMug API on Android. It was designed for J2SE I would imagine, so I'm not sure it will even work on Android, but I figured it was worth trying as opposed to trying to create my own API. When I load the project though, I get the following error: Conversion to Dalvik format failed: Unable to execute dex: null It doesn't say what package it fails on, just "Android Packaging Problem", but it did not do this before I added SmugFig and it's dependency JARS to the build path. Where should I look? Or does this mainly me that it just won't work with those libraries?

    Read the article

  • OpenGL Colorspace Conversion

    - by Steven Behnke
    Does anyone know how to create a texture with a YUV colorspace so that we can get hardware based YUV to RGB colorspace conversion without having to use a fragment shader? I'm using an NVidia 9400 and I don't see an obvious GL extension that seems to do the trick. I've found examples how to use a fragment shader, but the project I'm working on currently only supports OpenGL 1.1 and I don't have time to convert it to 2.0 and perform all the regression testing necessary. This is also targeting Linux. On other platforms I've been using a MESA extension but it doesn't function on the Nvidia card.

    Read the article

  • Error using traits class.: "expected constructor destructor or type conversion before '&' token"

    - by Mark
    I have a traits class that's used for printing out different character types: template <typename T> class traits { public: static std::basic_ostream<T>& tout; }; template<> std::ostream& traits<char>::tout = std::cout; template<> std::wostream& traits<unsigned short>::tout = std::wcout; gcc (g++) version 3.4.5 (yes somewhat old) is throwing an error: "expected constructor destructor or type conversion before '&' token" And I'm wondering if there's a good way to resolve this. (it's also angry about _O_WTEXT so if anyone's got some insight into that, I'd also appreciate it)

    Read the article

  • NHibernate CreateSQLQuery data conversion from bit to boolean error

    - by RemotecUk
    Hi, Im being a bit lazy in NHibernate and using Session.CreateSqlQuery(...) instead of doing the whole thing with Lambda's. Anyway what struct me is that there seems to be a problem converting some of the types returned from (in this case the MySQL) DB into native .Net tyes. The query in question looks like this.... IList<Client> allocatableClients = Session.CreateSQLQuery( "select clients.id as Id, clients.name as Name, clients.customercode as CustomerCode, clients.superclient as SuperClient, clients.clienttypeid as ClientType " + ... ... .SetResultTransformer(new NHibernate.Transform.AliasToBeanResultTransformer(typeof(Client))).List<Client>(); The type in the database of SuperClient is a bit(1) and in the Client object the type is a bool. The error received is: System.ArgumentException: Object of type 'System.UInt64' cannot be converted to type 'System.Boolean'. It seems strange that this conversion cannot be completed. Would be greatful for any ideas. Thanks.

    Read the article

  • Scala type conversion error, need help!

    - by Mansoor Ashraf
    Hello I am getting a weird error when trying to use a Java map in Scala. This is the snippet of code val value:Double = map.get(name) if (value eq null) map.put(name, time) else map.put(name, value + time) the map is defined as val map=new ConcurrentHashMap[String,Double] and this is the error I am getting error: type mismatch; found : Double required: ?{val eq: ?} Note that implicit conversions are not applicable because they are ambiguous: both method double2Double in object Predef of type (Double)java.lang.Double and method doubleWrapper in object Predef of type (Double)scala.runtime.RichDouble are possible conversion functions from Double to ?{val eq: ?} if (value eq null) map.put(name, time) I am new to Scala so I am having a hard time parsing the stacktrace. Any help would be appreciated

    Read the article

  • Javascript string to Date conversion - simple?

    - by Mark White
    Hi all, Yesterday I managed to solve this, then lost a day's work due to the death of a HD. Now I cannot remember what I did to fix it, but I know it can be done. Input: string date in the format 'm/d/yy', eg '12/25/10', or '4/1/10' (1st April) Output - Date object I'm working with date.js and date.format.js so have Date.fromString() and Date.format() avaiable. But trying multiple combinations is not giving me what I need. IF the date were 'mm/dd/yy' then it's simple. But I'm using jquery.datepicker.js which outputs in 'm/d/yy' and I don't want to change this much I know this conversion can be done. After a 22 hour day... I need help. Thanks. Mark...

    Read the article

  • C# Linq Entity Conversion Error on Nonexistent Value?

    - by Ryan
    While trying to query some data using the Linq Entity Framework I'm receiving the following exception: {"Conversion failed when converting the varchar value '3208,7' to data type int."} The thing that is confusing is that this value does not even exist in the view I am querying from. It does exist in the table the view is based on, however. The query I'm running is the following: return context.vb_audit_department .Where(x => x.department_id == department_id && x.version_id == version_id) .GroupBy(x => new { x.action_date, x.change_type, x.user_ntid, x.label }) .Select(x => new { action_date = x.Key.action_date, change_type = x.Key.change_type, user_ntid = x.Key.user_ntid, label = x.Key.label, count = x.Count(), items = x }) .OrderByDescending(x => x.action_date) .Skip(startRowIndex) .Take(maximumRows) .ToList(); Can somebody explain why LINQ queries the underlying table instead of the actual view, and if there is any way around this behavior?

    Read the article

  • conversion of a varchar to a smalldatetime results in an out-of-range value

    - by michael
    The code: strSql = "insert into table2 (transactiondate) values ('" & transactiondate & "')" seems to be giving me the runtime error: The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value In the code, strSql is a String object and transactiondate is a Date object. In the SQL database however, transactiondate is a smalldatetime object. I've tried changing the smalldatetime to a datetime (in the database) and I've tried transactiondate.toString() but with no success. How can this be fixed? Note: I know about the dangers of inline SQL. I am looking for a quick fix solution here and not a discussion about SQL injection.

    Read the article

  • Hex to Decimal conversion in C

    - by darkie15
    Hi All, Here is my code which is doing the conversion from hex to decimal. The hex values are stored in a unsigned char array: int liIndex ; long hexToDec ; unsigned char length[4]; for (liIndex = 0; liIndex < 4 ; liIndex++) { length[liIndex]= (unsigned char) *content; printf("\n Hex value is %.2x", length[liIndex]); content++; } hexToDec = strtol(length, NULL, 16); Each array element contains 1 byte of information and I have read 4 bytes. When I execute it, here is the output that I get : Hex value is 00 Hex value is 00 Hex value is 00 Hex value is 01 Chunk length is 0 Can any one please help me understand the error here. Th decimal value should have come out as 1 instead of 0. Regards, darkie

    Read the article

  • Entity framework error: The conversion of a datetime2 data type to a datetime data

    - by EdenMachine
    I know there are a ton of posts about this issue but none of them seem to solve my problem. Here's the scenario: I have a CreateDate DateTime column in my MS SQL Server database User table that is non-nullable and is automatically set using GetDate() method in "Default Value or Binding" setting. I am able to create a User just fine with the standard EF Insert but when I try to update the user, I get this error: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. What is the trick to not having the EF worry about the CreateDate column for updates? I have the StoreGenerationPattern = Identity but that isn't helping. Here are the EF properties for my Entity Property: http://screencast.com/t/8ndQRn9N And here is my Update method: http://screencast.com/t/UXIzhkhR

    Read the article

  • Loop to LINQ Conversion -

    - by Pino
    Ok I have the following, set-up and working great. These lines of code should do a conversion from DAL Entity (Subsonic) to a ViewModel. IList<ProductOptionModel> OptionsRetData = new List<ProductOptionModel>(); foreach (var CurProductOption in this.ProductOptions) { OptionsRetData.Add(CurProductOption.ToDataModel()); } returnData.Options = OptionsRetData.AsEnumerable(); I'd like to convert this to a LINQ single line statment and came up with the following. returnData.Options = this.ProductOptions.Select(o => o.ToDataModel()); and am recieving the following error. Server Error in '/' Application. Sequence contains no matching element So why does the first statment work but not the LINQ and, what steps can I take to resolve it.

    Read the article

  • Invalid conversion from int to int** C++

    - by user69514
    Not sure why I'm getting this error. I have the following: int* arr = new int[25]; int* foo(){ int* i; cout << "Enter an integer:"; cin >> *i; return i; } void test(int** myInt){ *myInt = foo(); } This call here is where I get the error: test(arr[0]); //here i get invalid conversion from int to int**

    Read the article

  • UTF-8 to ISO-8859-1 mapping / lossless conversion libraries in Java

    - by Pawel Krupinski
    I need to perform a conversion of characters from UTF-8 to ISO-8859-1 in Java without losing for example all of the UTF-8 specific punctuation. Ideally would like these to be converted to equivalents in ISO (e.g. there are probably 5 different single quotes in UTF-8 and would like them all converted to ISO single quote character). String.getBytes("ISO-8859-1") just won't do the trick in this case as it will lose the UTF-8-specific chars. Do you know of any ready mappings or libraries in Java that would map UTF-8 specific characters to ISO?

    Read the article

  • Qt - invalid conversion to child class

    - by David Davidson
    I'm drawing polygons using the Graphics View framework. I added a polygon to the scene with this: QGraphicsPolygonItem *poly = scene->addPolygon(QPolygonF(vector_of_QPointF)); poly->setPos(some_point); But I need to implement some custom behaviour like selection, mouse over indicator, and other similar stuff on the graphics item. So I declared a class that inherits QGraphicsPolygonItem: #include <QGraphicsPolygonItem> class GridHex : public QGraphicsPolygonItem { public: GridHex(QGraphicsItem* parent = 0); }; GridHex::GridHex(QGraphicsItem* parent) : QGraphicsPolygonItem(parent) { } Not doing much with that class so far, as you can see. But shouldn't replacing QGraphicsPolygonItem with my GridHex class? This is throwing a " invalid conversion from 'QGraphicsPolygonItem*' to 'GridHex*' " error: GridHex* poly = scene->addPolygon(QPolygonF(vector_of_QPointF)); What am I doing wrong?

    Read the article

  • A follow up on type coercion in C++, as it may be construed by type conversion

    - by David
    This is a follow up to my previous question. Consider that I write a function with the following prototype: int a_function(Foo val); Where foo is believed to be a type defined unsigned int. This is unfortunately not verifiable for lack of documentation. So, someone comes along and uses a_function, but calls it with an unsigned int as an argument. Here the story takes a turn. Foo turns out to actually be a class, which can take an unsigned int as a single argument of unsigned int in an explicit constructor. Is it a standard and reliable behavior for the compiler to render the function call by doing a type conversion on the argument. I.e. is the compiler supposed to recognize the mismatch and insert the constructor? Or should I get a compile time error reporting the type mismatch.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >