Search Results

Search found 42627 results on 1706 pages for 'type conversion'.

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

  • Image Conversion from Bitmap to Icon doesn't seem to work

    - by contactmatt
    I have a simple function that takes a bitmap, and converts the bitmap to an ICON format. Below is the function. (I placed literal values in place of the variables) Bitmap tempBmp = new Bitmap(@"C:\temp\mypicture.jpeg"); Bitmap bmp = new Bitmap(tempBmp, 16, 16); bmp.Save("@C:\temp\mypicture2.ico", ImageFormat.Icon) It doesn't seem to be converting correctly...or so I think. After the image is converted, some browsers do not reconigze the image as a true "ICON" , and even Visual Studio 2008 doesn't reconigze the image as an icon after its converted to an Icon format. For example, I was going to set the Icon property for my Win32 form app with the Icon i just converted. I open the dialouge box and select the icon I just converted and get the following error. -- "Argument 'picture' must be a picture that can be used as a Icon." I've browsed the web and come across complicated code where people take the time to manually convert the bitmap to different formats, but I would think the above code should work, and that the .NET framework would take care of this conversion.

    Read the article

  • Visual Studio Conversion Suite

    - by KingPop
    I have this as my conversion program for the "Length", how can I do it the simpliest way instead of keeping the if, elseif, else too much, i do not have much experience and trying to improve my programming skills on visual studio 2008. Basically, I get annoyed with the formulas because I don't know if it is right, I use google but doesn't help because i don't know how to get it right when the program converts from type to type. Public Class Form2 Dim Metres As Integer Dim Centimetres As Integer Dim Inches As Integer Dim Feet As Integer Dim Total As Integer Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ErrorMsg.Hide() End Sub Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click Metres = 1 Centimetres = 0.01 Inches = 0.0254 Feet = 0.3048 txtTo.Text = 0 If txtFrom.Text <> "" Then If IsNumeric(txtFrom.Text) And IsNumeric(txtTo.Text) Then If cbFrom.Text = "Metres" And cbTo.Text = "Centimetres" Then Total = txtFrom.Text * Metres txtTo.Text = Total ElseIf cbFrom.Text = "Metres" And cbTo.Text = "Inches" Then Total = txtFrom.Text * 100 txtTo.Text = Total ElseIf cbFrom.Text = "Metres" And cbTo.Text = "Feet" Then ElseIf cbFrom.Text = "Centimetres" And cbTo.Text = "Metres" Then ElseIf cbFrom.Text = "Centimetres" And cbTo.Text = "Inches" Then ElseIf cbFrom.Text = "Centimetres" And cbTo.Text = "Feet" Then ElseIf cbFrom.Text = "Inches" And cbTo.Text = "Metres" Then ElseIf cbFrom.Text = "Inches" And cbTo.Text = "Centimetres" Then ElseIf cbFrom.Text = "Inches" And cbTo.Text = "Feet" Then ElseIf cbFrom.Text = "Feet" And cbTo.Text = "Metres" Then ElseIf cbFrom.Text = "Feet" And cbTo.Text = "Centimetres" Then ElseIf cbFrom.Text = "Feet" And cbTo.Text = "Inches" Then End If End If End If End Sub End Class This is the source for what I have done at the moment.

    Read the article

  • Reference-type conversion operators: asking for trouble?

    - by Ben
    When I compile the following code using g++ class A {}; void foo(A&) {} int main() { foo(A()); return 0; } I get the following error messages: > g++ test.cpp -o test test.cpp: In function ‘int main()’: test.cpp:10: error: invalid initialization of non-const reference of type ‘A&’ from a temporary of type ‘A’ test.cpp:6: error: in passing argument 1 of ‘void foo(A&)’ After some reflection, these errors make plenty of sense to me. A() is just a temporary value, not an assignable location on the stack, so it wouldn't seem to have an address. If it doesn't have an address, then I can't hold a reference to it. Okay, fine. But wait! If I add the following conversion operator to the class A class A { public: operator A&() { return *this; } }; then all is well! My question is whether this even remotely safe. What exactly does this point to when A() is constructed as a temporary value? I am given some confidence by the fact that void foo(const A&) {} can accept temporary values according to g++ and all other compilers I've used. The const keyword can always be cast away, so it would surprise me if there were any actual semantic differences between a const A& parameter and an A& parameter. So I guess that's another way of asking my question: why is a const reference to a temporary value considered safe by the compiler whereas a non-const reference is not?

    Read the article

  • C# Type conversion between two similar Datatable objects

    - by Ali
    I have .NET project with sync framework and two separate Datasets for MS SQL and Compact SQL. in my base class I have a generic DataTable object. in my derived classed I assign Typed DataTable to the generic object based on whether the application is operating online or offline: example: if (online) _dataTable = new MSSQLDataSet.Customer; else _dataTable = new CompactSQLDataSet.Customer; Now every where in my code i have to check and do a cast based on the current network mode like this: public void changeCustomerID(int ID) { if (online) (MSSQLDataSet.CustomerDataTable)_dataTable)[i].CustomerID = value; else (CompactMSSQLDataSet.CustomerDataTable)_dataTable)[i].CustomerID = value; } but I don't think this is very efficient and I believe it can be done in a smarter way to only use one line of code by dynamically getting the Type of _dataTable on the run time. my problem is at the design time, in order to acess datatable porperties such as "CustomerID" it has to be casted to either MSSQLDataSet.CustomerDataTable or CompactMSSQLDataSet.CustomerDataTable. Is there a way to have a function or a operator to convert the _datatable to its runtime type but still be able to use it's design time properties which are the same between the two types? something like: ((aType)_dataTable)[i].CustomerID = value; //or GetRuntimeType(_dataTable)[i].CustomerID = value;

    Read the article

  • Describe the Damas-Milner type inference in a way that a CS101 student can understand

    - by user128807
    Hindley-Milner is a type system that is the basis of the type systems of many well known functional programming languages. Damas-Milner is an algorithm that infers (deduces?) types in a Hindley-Milner type system. Wikipedia gives a description of the algorithm which, as far as I can tell, amounts to a single word: "unification." Is that all there is to it? If so, that means that the interesting part is the type system itself not the type inference system. If Damas-Milner is more than unification, I would like a description of Damas-Milner that includes a simple example and, ideally, some code. Also, this algorithm is often said to do type inference. Is it really an inference system? I thought it was only deducing the types. Related questions: What is Hindley Miller? Type inference to unification problem

    Read the article

  • Custom field not showing in Custom Content Type

    - by BeraCim
    Hi all: I created a custom column in a custom content type in a Sharepoint Web manually (e.g. /MySite/MyWeb). I now want to programmatically copy this content type across to another web (e.g. /MySite/MyWeb2). However, upon looping through the custom content type in code, I could only find 2 fields: Content Type and Title (expected: Title and custom column). The custom column was missing. I'm very sure that the content type and field are added at the web level. The custom content type is inherited from Item. When I loop through the web's fields, I can see the custom column, and that was copied to the new web. It is only within the content type that the custom column is not showing up. Any ideas why this is happening? Thanks.

    Read the article

  • Haskell type classes and type families (cont'd)

    - by Giuseppe Maggiore
    I need some help in figuring a compiler error which is really driving me nuts... I have the following type class: infixl 7 --> class Selectable a s b where type Res a s b :: * (-->) :: (CNum n) => (Reference s a) -> (n,(a->b),(a->b->a)) -> Res a s b which I instance twice. First time goes like a charm: instance Selectable a s b where type Res a s b = Reference s b (-->) (Reference get set) (_,read,write) = (Reference (\s -> let (v,s') = get s in (read v,s')) (\s -> \x -> let (v,s') = get s v' = write v x (_,s'') = set s' v' in (x,s''))) since the type checker infers (-->) :: Reference s a -> (n,a->b,a->b->a) -> Reference s b and this signature matches with the class signature for (--) since Res a s b = Reference s b Now I add a second instance and everything breaks: instance (Recursive a, Rec a ~ reca) => Selectable a s (Method reca b c) where type Res a s (Method reca b c) = b -> Reference s c (-->) (Reference get set) (_,read,write) = \(x :: b) -> from_constant( Constant(\(s :: s)-> let (v,s') = get s :: (a,s) m = read v ry = m x :: Reference (reca) c (y,v') = getter ry (cons v) :: (c,reca) v'' = elim v' (_,s'') = set s' v'' in (y,s''))) :: Reference s c the compiler complains that Couldn't match expected type `Res a s (Method reca b c)' against inferred type `b -> Reference s c' The lambda expression `\ (x :: b) -> ...' has one argument, which does not match its type In the expression: \ (x :: b) -> from_constant (Constant (\ (s :: s) -> let ... in ...)) :: Reference s c In the definition of `-->': --> (Reference get set) (_, read, write) = \ (x :: b) -> from_constant (Constant (\ (s :: s) -> ...)) :: Reference s c reading carefully the compiler is telling me that it has inferred the type of (--) thusly: (-->) :: Reference s a -> (n,a->(Method reca b c),a->(Method reca b c)->a) -> (b -> Reference s c) which is correct since Res a s (Method reca b c) = b -> Reference s c but why can't it match the two definitions? Sorry for not offering a more succint and standalone example, but in this case I cannot figure how to do it...

    Read the article

  • Plan your SharePoint 2010 Content Type Hub carefully

    - by Wayne
    Currently setting up a new environment on SharePoint 2010 (which was made available for download yesterday if anyone missed that :-). One of the new features of SharePoint 2010 is to set up a Content Type Hub (which is a part of the Metadata Service Application), which is a hub for all Content Types that other Site Collections can subscribe to. That is you only need to manage your content types in one location. Setting up the Content Type Hub is not that difficult but you must make it very careful to avoid a lot of work and troubleshooting. Here is a short tutorial with a few tips and tricks to make it easy for you to get started. Determine location of Content Type Hub First of all you need to decide in which Site Collection to place your Content Type Hub; in the root site collection or a specific one. I think using a specific Site Collection that only acts as a Content Type Hub is the best way, there are no best practice as of now. So I create a new Site Collection, at for instance http://server/sites/CTH/. The top-level site of this site collection should be for instance a Team Site. You cannot use Blank Site by default, which would have been the best option IMHO, since that site does not have the Taxonomy feature stapled upon it (check the TaxonomyFeatureStapler feature for which site templates that can be used). Configure Managed Metadata Service Application Next you need to create your Managed Metadata Service Application or configure the existing one, Central Administration > Application Management > Manage Service Applications. Select the Managed Metadata service application and click Properties if you already have created it. In the bottom of the dialog window when you are creating the service application or when you are editing the properties is a section to fill in the Content Type Hub. In this text box fill in the URL of the Content Type Hub. It is essential that you have decided where your Content Type Hub will reside, since once this is set you cannot change it. The only way to change it is to rebuild the whole managed metadata service application! Also make sure that you enter the URL correctly. I did copy and paste the URL once and got the /default.aspx in the URL which funked the whole service up. Make sure that you only use the URL to the Site Collection of the hub. Now you have to set up so that other Site Collections can consume the content types from the hub. This is done by selecting the connection for the managed metadata service application and clicking properties. A new dialog window opens and there you need to click the Consumes content types from the Content Type Gallery at nnnn. Now you are free to syndicate your Content Types from the Hub. Publish Content Types To publish a Content Type from the hub you need to go to Site Settings > Content Types and select the content type that you would like to publish. Then select Manage publishing for this content type. This takes you to a page from where you can Publish, Unpublish or Republish the content type. Once the content type is published it can take up to an hour for the subscribing Site Collections to get it. This is controlled by the Content Type Subscriber job that is scheduled to run once an hour. To speed up your publishing just go to Central Administration > Monitoring > Review Job Definitions > Content Type Subscriber and click Run now and you content type is very soon available for use. Published Content Type status You can check the status of the content type publishing in your destination site collections by selecting Site Settings > Content Type Publishing. From here you can force a refresh of all subscribed content types, see which ones that are subscribed and finally check the publishing error log. This error log is very useful for detecting errors during the publishing. For instance if you use any features such as ratings, metadata, document ids in your content type hub and your destination site collection does not have those features available this will be reported here.

    Read the article

  • Perl coding to PHP coding conversion

    - by Haskella
    Hi, I am trying to convert some Perl into PHP using this guideline: http://www.cs.wcupa.edu/~rkline/perl2php/#basedir Basically I know next to nothing about these two languages. Please give me some simple English explanation of what each line does, I'll be more than happy. Thanks for reading :D Perl CGI program: #!/usr/bin/perl -T use strict; use warnings; use CGI (); my %fruit_codes = ( apple => '2321.html', banana => '1234.html', coconut => '8889.html', ); my $c = CGI->new; my $fruit_parameter = $c->param('fruit_name'); my $iframe_document; if (defined $fruit_parameter and exists $fruit_codes{$fruit_parameter}) { $iframe_document = $fruit_codes{$fruit_parameter}; } else { $iframe_document = 'sorry-no-such-fruit.html'; } $c->header('application/xhtml+xml'); print <<"END_OF_HTML"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Fruits</title> </head> <body> <form action="fruits.cgi"> <fieldset> <label for="fruit">Name of the fruit:</label> <input id="fruit" name="fruit_name" type="text" /> <input type="submit" /> </fieldset> </form> <iframe src="$iframe_document"> <a href="$iframe_document">resulting fruit</a> </iframe> </body> </html> END_OF_HTML 1;

    Read the article

  • Can a single argument constructor with a default value be subject to implicit type conversion

    - by Richard
    I understand the use of the explicit keyword to avoid the implicit type conversions that can occur with a single argument constructor, or with a constructor that has multiple arguments of which only the first does not have a default value. However, I was wondering, does a single argument constructor with a default value behave the same as one without a default value when it comes to implicit conversions?

    Read the article

  • C# enum to string auto-conversion?

    - by dcompiled
    Is it possible to have the compiler automatically convert my Enum values to strings so I can avoid explicitly calling the ToString method every time. Here's an example of what I'd like to do: enum Rank { A, B, C } Rank myRank = Rank.A; string myString = Rank.A; // Error: Cannot implicitly convert type 'Rank' to 'string' string myString2 = Rank.A.ToString(); // OK: but is extra work

    Read the article

  • How to convert an MKV to AVI with minimal loss

    - by OSX NINJA
    To convert an MKV to AVI, I do two things. The first thing I do is this: ffmpeg -i filename.mkv -vcodec copy -acodec copy output.avi or this: ffmpeg -i filename.mkv -sameq -acodec copy output.avi Either of these will convert the MKV to an AVI, but the problem is that the video does not play smoothly for some reason. That's fine though, because if I do one more thing it gets fixed: ffmpeg -i output.avi -vcodec mpeg4 -b 4000k -acodec mp2 -ab 320k converted.avi After I do this then the file plays without problem. I had success doing it this way for one file, but then I tried it on another file, and there is a slight, but noticeable loss in video quality. This is the output I get when doing the second step: FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers built on Dec 29 2010 18:02:10 with gcc 4.2.1 (Apple Inc. build 5664) configuration: libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.11. 0 / 0.11. 0 Seems stream 0 codec frame rate differs from container frame rate: 359.00 (359/1) -> 29.92 (359/12) Input #0, avi, from 'output.avi': Metadata: ISFT : Lavf52.64.2 Duration: 00:04:17.21, start: 0.000000, bitrate: 3074 kb/s Stream #0.0: Video: mpeg4, yuv420p, 704x480 [PAR 229:189 DAR 5038:2835], 29.92 fps, 29.92 tbr, 29.92 tbn, 359 tbc Stream #0.1: Audio: vorbis, 48000 Hz, stereo, s16 Output #0, avi, to 'converted.avi': Metadata: ISFT : Lavf52.64.2 Stream #0.0: Video: mpeg4, yuv420p, 704x480 [PAR 229:189 DAR 5038:2835], q=2-31, 4000 kb/s, 29.92 tbn, 29.92 tbc Stream #0.1: Audio: mp2, 48000 Hz, stereo, s16, 320 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 I just used arbitrarily large settings on the second step and it worked nicely before but not in this case. What settings should I use?

    Read the article

  • I need to convert a bunch of *pngs to *.mpg in linux/CENTOS. How can I do this?

    - by Manchine
    Title says it all, and I am not too familiar with LINUX, but I can get by if I get some help. I am looking for a way(s) where I can do the above, or in lieu of that, download a program that will do this for me. Very simply, I have a bunch of *.png 's that I would like to convert into a movie, (mpg, mpeg, mpeg2, whatever). I have tried googling for any such softwares but I am getting some dubious websites and even more dubious programs. Thanks in advance!

    Read the article

  • Creating C# Type from full name

    - by Adi Barda
    I'm trying to get a Type object from type full name i'm doing the folowing: Assembly asm = Assembly.GetEntryAssembly(); string toNativeTypeName="any type full name"; Type t = asm.GetType(toNativeTypeName); I get null, why? the assembly is my executable (.net executable) and the type name is: System.Xml.XmlNode

    Read the article

  • Xuggler errors as soon as you import git

    - by user3241507
    I downloaded the Git straight into Eclipse for Xuggler (Here is the git). But as soon as it loads, there are so many errors I don't know what to do. Most of the errors are "cannot be resolved" type errors. Description Resource Path Location Type The import org.junit cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 22 Java Problem The import junit cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 28 Java Problem TestCase cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 30 Java Problem The import org.slf4j cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 23 Java Problem The import org.slf4j cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 24 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 94 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 97 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 102 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 103 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 86 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 89 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 90 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 93 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com /xuggle/ferry line 114 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 120 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 125 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 126 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 106 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 107 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 110 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 111 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 53 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 49 Java Problem Ignore cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 57 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 56 Java Problem Before cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 37 Java Problem LoggerFactory cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 32 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 44 Java Problem The method getName() is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 40 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 81 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 75 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 85 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 82 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 64 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 61 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 72 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 69 Java Problem NameAwareTestClassRunner cannot be resolved BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 44 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 167 Java Problem The method debug(String, int, String) in the type Logger is not applicable for the arguments (String, int) AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 166 Java Problem The method fail(String) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 163 Java Problem After cannot be resolved to a type BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 47 Java Problem NameAwareTestClassRunner cannot be resolved to a type BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 35 Java Problem The method debug(String, int, String) in the type Logger is not applicable for the arguments (String) AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 162 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 135 Java Problem Before cannot be resolved to a type BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 41 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 131 Java Problem LoggerFactory cannot be resolved BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 38 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 130 Java Problem The import org.junit cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 22 Java Problem The import org.slf4j cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 23 Java Problem The import org.slf4j cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test /src/com/xuggle/xuggler line 24 Java Problem The import junit cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 31 Java Problem TestCase cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 33 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 35 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 82 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 80 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 89 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 84 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 94 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 93 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 99 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 96 Java Problem Before cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 37 Java Problem LoggerFactory cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 35 Java Problem The method getName() is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 40 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 40 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 60 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 43 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 67 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 62 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 157 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 161 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 154 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 155 Java Problem The method assertEquals(int, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 172 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 173 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 168 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 171 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 124 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 129 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 117 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 119 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 145 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 150 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 141 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 143 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 216 Java Problem The method assertEquals(IBuffer.Type, IBuffer.Type) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 212 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 208 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 204 Java Problem The method assertEquals(IBuffer.Type, IBuffer.Type) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 218 Java Problem The method assertEquals(int, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 187 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 186 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 183 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 176 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 197 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 192 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 191 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 188 Java Problem For a school project, I would like to build a simple live video stream program (final year in high school) like skype, except not as complicated. Can anyone help me solve these errors? or Is there another platform I can use that would be better/easier?

    Read the article

  • Using string constants in implicit conversion

    - by kornelijepetak
    Consider the following code: public class TextType { public TextType(String text) { underlyingString = text; } public static implicit operator String(TextType text) { return text.underlyingString; } private String underlyingString; } TextType text = new TextType("Something"); String str = text; // This is OK. But I want to be able do the following, if possible. TextType textFromStringConstant = "SomeOtherText"; I can't extend the String class with the TextType implicit operator overload, but is there any way to assign a literal string to another class (which is handled by a method or something)? String is a reference type so when they developed C# they obviously had to use some way to get a string literal to the class. I just hope it's not hardcoded into the language.

    Read the article

  • Generic function to handle DataType Conversion

    - by Tommo1977
    I have the following function in C#, that I want to pass a MySQL DataReader value/object. If the value of the object passed is a DBNull I need to handle it and return a Null value of that data type e.g null int. Otherwise I want to convert the returned value like Convert.ToInt32(value) or similar. public static T ConvertFromDB<T>(object value) { return value == DBNull.Value ? default(T) : (T)value; } Can anyone offer any help on this ?

    Read the article

  • VB to C# conversion incongruency with lambdas

    - by Jason
    I have a bit of code that I have been tasked with converting to C# from VB. A snippet of mine seems like it cannot be converted from one to the other, and if so, I just don't know how to do it and am getting a little frustrated. Here's some background: OrderForm is an abstract class, inherited by Invoice (and also PurchaseOrder). The following VB snippet works correctly: Dim Invs As List(Of OrderForm) = GetForms(theOrder.OrderID) .... Dim inv As Invoice = Invs.Find( Function(someInv As Invoice) thePO.SubPONumber = someInv.SubInvoiceNumber) In C#, the best I came to converting this is: List<OrderForm> Invs = GetForms(theOrder.OrderID); .... Invoice inv = Invs.Find( (Invoice someInv) => thePO.SubPONumber == someInv.SubInvoiceNumber); However, I get the following error when I do this: Cannot convert lambda expression to delegate type 'System.Predicate' because the parameter types do not match the delegate parameter types Is there any way to fix this without restructuring my whole codebase?

    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

  • Java conditional operator ?: result type

    - by Wangnick
    I'm a bit puzzled about the conditional operator. Consider the following two lines: Float f1 = false? 1.0f: null; Float f2 = false? 1.0f: false? 1.0f: null; Why does f1 become null and the second statement throws a NullPointerException? Langspec-3.0 para 15.25 sais: Otherwise, the second and third operands are of types S1 and S2 respectively. Let T1 be the type that results from applying boxing conversion to S1, and let T2 be the type that results from applying boxing conversion to S2. The type of the conditional expression is the result of applying capture conversion (§5.1.10) to lub(T1, T2) (§15.12.2.7). So for false?1.0f:null T1 is Float and T2 is the null type. But what is the result of lub(T1,T2)? This para 15.12.2.7 is just a bit too much ... BTW, I'm using 1.6.0_18 on Windows. PS: I know that Float f2 = false? (Float) 1.0f: false? (Float) 1.0f: null; doesn't throw NPE.

    Read the article

  • C# To VB.Net Conversion - array of class objects with initialisation

    - by mattryan
    can someone help me pls, im new to vb.net and im trying to work through the nhibernate firstsolkution sample (written in c#) and im struggling to convert this one bit. ive tried numerous convertors; telerik, developerfusion and a several others but none of the code produced will compile and i cant see the why... private readonly Product[] _products = new[] { new Product {Name = "Melon", Category = "Fruits"}, new Product {Name = "Pear", Category = "Fruits"}, new Product {Name = "Milk", Category = "Beverages"}, new Product {Name = "Coca Cola", Category = "Beverages"}, new Product {Name = "Pepsi Cola", Category = "Beverages"}, }; developer fusion gives Private ReadOnly _products As Product() = New () {New Product(), New Product(), New Product(), New Product(), New Product()} telerik gives Private ReadOnly _products As Product() = New () {New Product() With { _ .Name = "Melon", _ .Category = "Fruits" _ }, New Product() With { _ .Name = "Pear", _ .Category = "Fruits" _ }, New Product() With { _ .Name = "Milk", _ .Category = "Beverages" _ }, Nw Product() With { _ .Name = "Coca Cola", _ .Category = "Beverages" _ }, New Product() With { _ .Name = "Pepsi Cola", _ .Category = "Beverages" _ }} which seems the most useful except it complains about a type expected here "New () {..." ive tried various things just cant figure it out... what am i missing? am i just being dumb? or isnt there and equivilent? Cheers all

    Read the article

  • Programmtically choosing image conversion format to JPEG or PNG for Silverlight display

    - by Otaku
    I have a project where I need to convert a large number of image types to be displayable in a Silverlight app - TIFF, GIF, WMF, EMF, BMP, DIB, etc. I can do these conversions on the server before hydrating the Silverlight app. However, I'm not sure when I should choose to convert to which format, either JPG or PNG. Is there some kind of standard out there like TIFF should always be a JPEG and GIF should always be a PNG. Or, if a BMP is 24 bit, it should be converted to a JPEG - any lower and it can be a PNG. Or everything is a PNG and why? What I usually see or see in response to this type of question is "Well, if the picture is a photograph, go with JPEG" or "If it has straight lines, PNG is better." Unfortunately, I won't have the luxury of viewing any of the image files at all and would like just a standard way to do this via code, even if that is a zillion if/then statements. Are there any standards or best practices around this subject? P.S. Please don't move to close this subject - it actually has no duplicate on SO because I'm not looking for subjectivity.

    Read the article

  • Converting string to a simple type

    - by zespri
    .Net framework contains a great class named Convert that allows conversion between simple types, DateTime type and String type. Also the class support conversion of the types implementing IConvertible interface. The class has been implemented in the very first version of .Net framework. There were a few things in the first .Net framework that were not done quite right. For example .Parse methods on simple types would throw an exception if the string couldn't be parsed and there would be no way to check if exception is going to be thrown in advance. A future version of .Net Framework removed this deficiency by introducing the TryParse method that resolved this problem. The Convert class dates back to time of the old Parse method, so the ChangeType method on this class in implemented old style - if conversion can't be performed an exception is thrown. Take a look at the following code: public static T ConvertString<T>(string s, T @default) { try { return (T)Convert.ChangeType(s, typeof(T), CultureInfo.InvariantCulture); } catch (Exception) { return @default; } } This code basically does what I want. However I would pretty much like to avoid the ugly try/catch here. I'm sure, that similar to TryParse, there is a modern method of rewriting this code without the catch-all. Could you suggest one?

    Read the article

  • 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

  • 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

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