Search Results

Search found 37183 results on 1488 pages for 'string conversion'.

Page 153/1488 | < Previous Page | 149 150 151 152 153 154 155 156 157 158 159 160  | Next Page >

  • How do I use "Into" LINQ expression in VB.NET?

    - by SLC
    I'm converting from C# this LINQ expression. However, it does not seem to work. C# return (from w in fishSticks group w by w.FishQty into g orderby g.Key descending select g).First().First(); VB Return (From w In fishSticks Group w By w.FishQty Into g() Order By g.Key Descending Select g).First().First() Visual Studio turns g into g() itself and then gives me this error: Definition of method 'g' is not accessible in this context. Any ideas?

    Read the article

  • How to convert Xml files to Text Files 2

    - by John
    Hi all, I have around 8000 xml files that needs to be converted into text files. The text file must contain title, description and keywords of the xml file without the tags and removing other elements and attributes as well. In other words, i need to create 8000 text files containing the title,description and keywords of the xml file. I need codings for this to be done systematically. Any help would be greatly appreciated. Thanks in advance. Hey all thank you all so so much with your replies. Here's a sample of what my xml looks like: <?xml version="1.0"?> <metadata> <identifier>43productionsNightatthegraveyard</identifier> <title>Night at the graveyard</title> <collection>opensource_movies</collection> <mediatype>movies</mediatype> <resource>movies</resource> <upload_application appid="ccPublisher" version="2.2.1"/> <uploader>[email protected]</uploader> <description>una noche en el cementerio (terror)</description> <license>http://creativecommons.org/licenses/by-nc/3.0/</license> <title>Night at the graveyard</title> <format>Video</format> <adder>[email protected]</adder> <licenseurl>http://creativecommons.org/licenses/by-nc/3.0/</licenseurl> <year>2007</year> <keywords>Night,at,the,graveyard,43,productions</keywords> <holder>43 productions</holder> <publicdate>2007-04-11 19:52:28</publicdate> </metadata> And this would be the output: una noche en el cementerio (terror) Night at the graveyard Night,at,the,graveyard,43,productions This need to be saved with the same name but in text format. Thanks all so much if any more suggestions would be much appreciated.

    Read the article

  • Problems with video conversions through the web (local host)

    - by ron-d
    Hello, I get the following errors when I attempt video format conversions called from the local host: “An invalid media type was specified” for M4V to WMV conversions. “One or more arguments are invalid” for MP4 to WMV conversions. Here are the details of the problems: I’ve written a dll in C# that accepts videos in the formats AVI, WMV, M4V and MP4 and performs the following actions: Creates a copy of the input video in WMV format . Creates a WAV file of the input video audio portion. Creates a JPG image from a frame of the input video. I attached the dll to an ASP.NET web project that performs the dll actions. When tested through the developer studio, the actions are performed as intended for all formats. When I place the web project in place to be read when the local host is called through the web browser, the following behavior takes place: WMV format: All actions performed as intended. AVI format: Creates WMV file – OK Creates JPG image – OK Creates empty WAV file – problem. M4V format: Creates empty WAV file – problem. Does not create WMV file -problem Does not create JPG file –problem Throws me the error “An invalid media type was specified” MP4 format: Creates empty WAV file – problem. Does not create WMV file -problem Does not create JPG file –problem Throws me the error “One or more arguments are invalid” When I check their security property, all the files have the same permission access parameters (when I check their security property. Can anyone guide me as to how to solve these problems when the web project is called from the local host? Thank you.

    Read the article

  • Implementing "View as HTML" for Word and PDF documents on an intranet

    - by Manne
    I am looking for a way to implement "View as HTML" (as seen in e.g. GMail) for Microsoft Office and Adobe PDF documents stored in an intranet. Can anyone recommend approaches for this? The intranet consists of multiple .NET sites, so I would prefer a .NET library (one that doesn't launch MS Word on the server) for this capability, but any kind of arrangement is welcome.

    Read the article

  • Compatible types and structures in C

    - by Oli Charlesworth
    I have the following code: int main(void) { struct { int x; } a, b; struct { int x; } c; struct { int x; } *p; b = a; /* OK */ c = a; /* Doesn't work */ p = &a; /* Doesn't work */ return 0; } which fails to compile under GCC (3.4.6), with the following error: test.c:8: error: incompatible types in assignment test.c:9: warning: assignment from incompatible pointer type Now, from what I understand (admittedly from the C99 standard), is that a and c should be compatible types, as they fulfill all the criteria in section 6.2.7, paragraph 1. I've tried compiling with std=c99, to no avail. Presumably my interpretation of the standard is wrong?

    Read the article

  • Convert this VB code to C#?

    - by Róisín Kerr Lautman
    I was wondering if anyone would be able to help me convert the below code to c#? From what I have read it seems to be similar however I am not sure if my 'case' statements are still able to be used? Public Class Form1 Dim dteStart As Date Dim dteFinish As Date Dim span As TimeSpan Public Sub KeyDown(ByVal Sender As System.Object, ByVal e As _ System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.Q Label1.BackColor = Color.Green dteStart = Now() Case Keys.W Label2.BackColor = Color.Green Case Keys.E Label3.BackColor = Color.Green Case Keys.R Label4.BackColor = Color.Green dteFinish = Now() span = dteFinish.Subtract(dteStart) Label5.Text = span.ToString End Select End Sub Public Sub KeyUp(ByVal Sender As System.Object, ByVal e As _ System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp Select Case e.KeyCode Case Keys.Q Label1.BackColor = Color.Red Case Keys.W Label2.BackColor = Color.Red Case Keys.E Label3.BackColor = Color.Red Case Keys.R Label4.BackColor = Color.Red End Select End Sub End Class

    Read the article

  • Eclipse Encoding MacRoman -> UTF8

    - by wishi_
    Hi! I recently created a project, organized it and well... I used my Mac with Eclipse running. Somehow it stored everything in MacRoman. The project has to be UTF8. Is there any easy way to handle the conversions?

    Read the article

  • C# Multidimensional Array Definition

    - by Blaenk
    Can someone help me convert this to C#. I've already spent more time than I would have liked trying to do it myself and it's preventing me from actually getting any work done. I guess it seems like C# has a limitation regarding how one can define arrays. I think somewhere inside I have to keep doing new int[] but I'm not sure exactly where. You don't have to convert the whole thing, just enough so I can understand how to do it. I would really appreciate it. I would like to use integers instead of characters, by the way. Thanks again // Pieces definition char mArray [7][4][5][5] = { // Square { { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 1, 0}, {0, 0, 1, 1, 0}, {0, 0, 0, 0, 0} }, { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 1, 0}, {0, 0, 1, 1, 0}, {0, 0, 0, 0, 0} }, { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 1, 0}, {0, 0, 1, 1, 0}, {0, 0, 0, 0, 0} }, { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 1, 0}, {0, 0, 1, 1, 0}, {0, 0, 0, 0, 0} } }, // and so on and so forth, for 6 more };

    Read the article

  • How to convert Xml files to Text Files

    - by John
    Hi all, I have around 8000 xml files that needs to be converted into text files. The text file must contain title, description and keywords of the xml file without the tags and removing other elements and attributes as well. In other words, i need to create 8000 text files containing the title,description and keywords of the xml file. I need codings for this to be done systematically. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • How can I make the output from tapply() into a data.frame

    - by James Thompson
    I have a data.frame in R that looks like this: score rms template aln_id description 1 -261.410 4.951 2f22A.pdb 2F22A_1 S_00001_0000002_0 2 -231.987 21.813 1wb9A.pdb 1WB9A_4 S_00002_0000002_0 3 -263.722 4.903 2f22A.pdb 2F22A_3 S_00003_0000002_0 4 -269.681 17.732 1wbbA.pdb 1WBBA_6 S_00004_0000002_0 5 -258.621 19.098 1rxqA.pdb 1RXQA_3 S_00005_0000002_0 6 -246.805 6.889 1rxqA.pdb 1RXQA_15 S_00006_0000002_0 7 -281.300 16.262 1wbdA.pdb 1WBDA_11 S_00007_0000002_0 8 -271.666 4.193 2f22A.pdb 2F22A_2 S_00008_0000002_0 9 -277.964 13.066 1wb9A.pdb 1WB9A_5 S_00009_0000002_0 10 -261.024 17.153 1yy9A.pdb 1YY9A_2 S_00001_0000003_0 I can calculate summary statistics on the data.frame like this: > tapply( d$score, d$template, mean ) 1rxqA.pdb 1wb9A.pdb 1wbbA.pdb 1wbdA.pdb 1yy9A.pdb 2f22A.pdb -252.7130 -254.9755 -269.6810 -281.3000 -261.0240 -265.5993 Is there an easy way that I coerce this output back into a data.frame? I'd like for it to have these two columns: d$template mean I love tapply, but right now I'm cutting and pasting the results from tapply into a text file and hacking it up a bit to get the summary statistics that I want with appropriate names. This feels very wrong, and I'd like to do something better!

    Read the article

  • C++ Converting image to integer array

    - by jonathanasdf
    How would I go about converting the pixels in an image (.png file) to an integer array, where each pixel is converted to its ARGB integer equivalent? I would like to do this without using external libraries. Not a 2D integer array by the way, a 1D one (where access is through array[row*width+col]). Thanks.

    Read the article

  • "Invalid use of Null" when using Str() with a Null Recordset field, but Str(Null) works fine

    - by Mike Spross
    I'm banging my head against the wall on this one. I was looking at some old database reporting code written in VB6 and case across this line (the code is moving data from a "source" database into a reporting database): rsTarget!VehYear = Trim(Str(rsSource!VehYear)) When rsSource!VehYear is Null, the above line generates an "Invalid use of Null" run-time error. If I break on the above line and type the following in the Immediate pane: ?rsSource!VehYear It outputs Null. Fine, that makes sense. Next, I try to reproduce the error: ?Str(rsSource!VehYear) I get an "Invalid use of Null" error. However, if I type the following into the Immediate window: ?Str(Null) I don't get an error. It simply outputs Null. If I repeat the same experiment with Trim() instead of Str(), everything works fine. ?Trim(rsSource!VehYear) returns Null, as does ?Trim(Null). No run-time errors. So, my question is, how can Str(rsSource!VehYear) possibly throw an "Invalid use of Null" error when Str(Null) does not, when I know that rsSource!VehYear is equal to Null?

    Read the article

  • Why `is_base_of` works with private inheritance?

    - by Alexey Malistov
    Why the following code works? typedef char (&yes)[1]; typedef char (&no)[2]; template <typename B, typename D> struct Host { operator B*() const; operator D*(); }; template <typename B, typename D> struct is_base_of { template <typename T> static yes check(D*, T); static no check(B*, int); static const bool value = sizeof(check(Host<B,D>(), int())) == sizeof(yes); }; //Test sample class B {}; class D : private B {}; //Exspression is true. int test[is_base_of<B,D>::value && !is_base_of<D,B>::value]; Note that B is private base. Note that operator B*() is const. How does this work? Why this works? Why static yes check(D*, T); is better than static yes check(B*, int); ?

    Read the article

  • Desktop VB.NET <> C# converter

    - by Sphynx
    I've been using the Developer Fusion's tool for converting code snippets, and now I'm looking for a quality tool to convert entire projects between those languages, with minimum errors. Is there any good one available?

    Read the article

  • Implimenting Zend MVC for my existing site-first step?

    - by Joel
    Hi guys, OK-newbie question here. I'll try not to bombard SO with lots of questions-and hopefully this first one will show me the method I'll need to follow for subsequent conversions. I have a web-based calendar system that I developed, but it was coded for me procedurally (using PHP). I'm now working on learning OO and wanting to integrate this site into my localhost Zend Framework and slowly start converting parts to OO and the Zend Framework MVC process in particular. As I've said before, I understand that this will be a slow process, and when I'm done, I still probably won't have anything as OO friendly as if I had rewritten it from scratch, but I'd like to use this as a learning experience. So, I have dropped the whole site into my localhose/zend/Public folder, and everything is showing up great and linking to the database, etc. My question is-what would be the easiest first component to switch over to the MVC model? This site has a bit of everything-forms, login, authentication, some jQuery, etc. Can anyone point to a tutorial that would address what I'm trying to do? If indeed, a form would be one of the simpler things to switch, can someone walk me through those changes? Another idea is changing over all the header info, etc? Thanks for any pointers on where to start! EDIT: Also, I understand that SO is mainly for specific coding questions-I'm happy to share specific code, once I have an idea about which section to tackle first...

    Read the article

  • Convert this code from C++ to C#

    - by Alhariri
    please any one convert this code from c++ to c# beacuse i dont know how to read from file in c++ please help me int DoEnDe(int c) { SDES S(key); int i,n; n=10; //Number of Rounds unsigned char ch; FILE *fp; FILE *ft; fp=fopen(tfname,"w"); ft=fopen(sfname,"r"); if (fp==NULL) { printf("\nTarget File not opened SORRY"); getch(); fclose(fp); return(0); } if (ft==NULL) { printf("\nSource File not opened SORRY"); getch(); fclose(ft); return(0); } while (fread(&ch,1,1,ft)==1) { S.OUTPUT=ch; for (i=0;i<n;i++) { if (c==1) S.DES_Encryption(S.OUTPUT); if (c==2) S.DES_Decryption(S.OUTPUT); } fwrite(&S.OUTPUT,1,1,fp); } printf("\nCompleted!!!!!"); getch(); fclose(fp); fclose(ft); return(1); }

    Read the article

  • How to convert a MooTools 'Scroll to Top' Script to jQuery

    - by Vikram
    Hello friends I have the following script in my Template: window.addEvent('domready', function () { var a = $('totop'); if (a) { var b = new Fx.Scroll(window); a.setStyle('outline', 'none').addEvent('click', function (e) { new Event(e).stop(); b.toTop() }) } }); I wanted this in jQuery as I don't want to load 2 libraries just for this bit of script. I am actually very new to programming and still in the learning stage. Hence looking forward for some help on this issue. Kindly Help.

    Read the article

  • how to convert video from one format to another using php

    - by Meena
    hi i want to include the vedio download option in my webpage. I am using ffmpeg, but it seems to work very slow. Is there is any other way to do this or how to spead up the ffmpeg. i am using this code to get the frames from the vedio. to convert the vedio $call="ffmpeg -i ".$_SESSION['video_to_convert']." -vcodec libvpx -r 30 -b ".$quality." -acodec libvorbis -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$type." -y 2> log/".$name.".txt"; $convert = (popen("start /b ".$call, "r")); pclose($convert); to get the frame from the vedio exec("ffmpeg -vframes 1 -ss ".$time_in_seconds." -i $converted_vids video_images.jpg -y 2>); but this code does not generate any error its loading continously.

    Read the article

< Previous Page | 149 150 151 152 153 154 155 156 157 158 159 160  | Next Page >