Search Results

Search found 5340 results on 214 pages for 'transport stream'.

Page 18/214 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • relational databases and multicast messages

    - by xRobot
    I have read that relational databases are a terrible way to do multicast messages like twitter. So twitter saves every tweet only one times and then retrieve its in every stream ? or saves every tweet in every users's stream ? I want to know why relational database ( like mysql or postgresql ) doesn't good for twitter-like application.

    Read the article

  • How to download file into string with progress callback?

    - by Kaminari
    I would like to use the WebClient (or there is another better option?) but there is a problem. I understand that opening up the stream takes some time and this can not be avoided. However, reading it takes a strangely much more amount of time compared to read it entirely immediately. Is there a best way to do this? I mean two ways, to string and to file. Progress is my own delegate and it's working good. FIFTH UPDATE: Finally, I managed to do it. In the meantime I checked out some solutions what made me realize that the problem lies elsewhere. I've tested custom WebResponse and WebRequest objects, library libCURL.NET and even Sockets. The difference in time was gzip compression. Compressed stream lenght was simply half the normal stream lenght and thus download time was less than 3 seconds with the browser. I put some code if someone will want to know how i solved this: (some headers are not needed) public static string DownloadString(string URL) { WebClient client = new WebClient(); client.Headers["User-Agent"] = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1045 Safari/532.5"; client.Headers["Accept"] = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; client.Headers["Accept-Encoding"] = "gzip,deflate,sdch"; client.Headers["Accept-Charset"] = "ISO-8859-2,utf-8;q=0.7,*;q=0.3"; Stream inputStream = client.OpenRead(new Uri(URL)); MemoryStream memoryStream = new MemoryStream(); const int size = 32 * 4096; byte[] buffer = new byte[size]; if (client.ResponseHeaders["Content-Encoding"] == "gzip") { inputStream = new GZipStream(inputStream, CompressionMode.Decompress); } int count = 0; do { count = inputStream.Read(buffer, 0, size); if (count > 0) { memoryStream.Write(buffer, 0, count); } } while (count > 0); string result = Encoding.Default.GetString(memoryStream.ToArray()); memoryStream.Close(); inputStream.Close(); return result; } I think that asyncro functions will be almost the same. But i will simply use another thread to fire this function. I dont need percise progress indication.

    Read the article

  • c++ std::ostringstream vs std::string::append

    - by NickSoft
    In all examples that use some kind of buffering I see they use stream instead of string. How is std::ostringstream and << operator different than using string.append. Which one is faster and which one uses less resourses (memory). One difference I know is that you can output different types into output stream (like integer) rather than the limited types that string::append accepts. Here is an example: std::ostringstream os; os << "Content-Type: " << contentType << ";charset=" << charset << "\r\n"; std::string header = os.str(); vs std::string header("Content-Type: "); header.append(contentType); header.append(";charset="); header.append(charset); header.append("\r\n"); Obviously using stream is shorter, but I think append returns reference to the string so it can be written like this: std::string header("Content-Type: "); header.append(contentType) .append(";charset=") .append(charset) .append("\r\n"); And with output stream you can do: std::string content; ... os << "Content-Length: " << content.length() << "\r\n"; But what about memory usage and speed? Especially when used in a big loop. Update: To be more clear the question is: Which one should I use and why? Is there situations when one is preferred or the other? For performance and memory ... well I think benchmark is the only way since every implementation could be different. Update 2: Well I don't get clear idea what should I use from the answers which means that any of them will do the job, plus vector. Cubbi did nice benchmark with the addition of Dietmar Kühl that the biggest difference is construction of those objects. If you are looking for an answer you should check that too. I'll wait a bit more for other answers (look previous update) and if I don't get one I think I'll accept Tolga's answer because his suggestion to use vector is already done before which means vector should be less resource hungry.

    Read the article

  • I cannot fetch appointments immediately via EWS on exchange server

    - by DappleHou
    I developed a transport agent for exchange server. In this agent, I code to invoke EWS to get appointments. I cannot get appointments immediately by the code. wait for a while, then go to get appointments again. This time, its OK. Why not immediately? Here is my code. To solve it, I have to get appointments repeatedly till find appointments. do{ webServiceData.FindItemsResults<webServiceData.Appointment> results = folder.FindAppointments(view); Thread.sleep(100); }while(results.Items.Count==0); Note that the code is inside transport agent. Is there any other solutions?

    Read the article

  • Deserialization error using Runtime Serialization with the Binary Formatter

    - by Lily
    When I am deserializing a hierarchy I get the following error The input stream is not a valid binary format. The starting contents (in bytes) are The input stream is not a valid binary format. The starting contents (in bytes) are: 20-01-20-20-20-FF-FF-FF-FF-01-20-20-20-20-20-20-20 ..." Any help please? Extra info: public void Serialize(ISyntacticNode person) { Stream stream = File.Open(fileName, FileMode.OpenOrCreate); try { BinaryFormatter binary = new BinaryFormatter(); pList.Add(person); binary.Serialize(stream, pList); stream.Close(); } catch { stream.Close(); } } public List<ISyntacticNode> Deserialize() { Stream stream = File.Open(fileName, FileMode.OpenOrCreate); BinaryFormatter binary = new BinaryFormatter(); try { pList = (List<ISyntacticNode>)binary.Deserialize(stream); binary.Serialize(stream, pList); stream.Close(); } catch { pList = new List<ISyntacticNode>(); binary.Serialize(stream, pList); stream.Close(); } return pList; } I am Serializing a hierarchy which is of type Proxem.Antelope.Parsing.ISyntacticNode Now I have gotten this error System.Runtime.Serialization.SerializationException: Binary stream '116' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization. i'm using a different instance. How may I avoid this error please

    Read the article

  • [C#] WebClient - Upload data, get stream

    - by Barguast
    I have a situation where I want to asynchronously write a series of bytes with WebClient (in much the same way as UploadDataAsync) and get a readable response stream (in the same way as OpenReadAsync). You seem to be able to do the two individually, but not both of them together. Is there a way? Thanks!

    Read the article

  • Using libvlc to save capture card stream.

    - by beta
    Could anyone give an example of opening a stream such as a capture card and saving it to a file? There is very little documentation of vlc's api for sout and streaming. Beyond that, is there a programmatic way get a list of Capture Devices under windows? If there isn't, linux is an option. Thanks.

    Read the article

  • Server to stream RTSP to android

    - by dar
    Can Flash Media Server 3.5 serve a video rtsp stream to android? Or do we need to use Wowza or red5 with Android rtsp clients? Are there any other rtsp servers to consider when the client is going to be running on android?

    Read the article

  • capture webcam stream and send it over network using DirectShow.net

    - by SR Dusad
    Hi all, I m working on a video conference project in vs2010 with c#. I m able to capture the snaps from web cam in picture box with the help of Directshownet samples available on SouceForge.But i can't find any proper solution for capturing the audio/video stream directly from web cam using Directshownet. If anybody know about this problem's solution, pls give me ur advise . Waitng for ur response ...

    Read the article

  • Using Server.CreateObject("ADODB.Stream") in IE7

    - by Daud
    I have a asp.net 1.1 application that uses the following code to write out a file in the response: Dim objStream As Object objStream = Server.CreateObject("ADODB.Stream") objStream.open() objStream.type = 1 objStream.loadfromfile(localfile) Response.BinaryWrite(objStream.read) This code is called by a pop up window that displays this file or gives a open/save dialog in Internet explorer. The problem is, that it seems to work fine in IE6 but in IE7 the pop up opens and then closes without displaying the file. Any one know whats wrong?

    Read the article

  • getAudioInputStream can not convert [stereo, 4 bytes/frame] stream to [mono, 2 bytes/frame]

    - by brian_d
    Hello. I am using javasound and have an AudioInputStream of format PCM_SIGNED 8000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian Using AudioSystem.getAudioInputStream(target_format, original_stream) produces an 'IllegalArgumentException: Unsupported Conversion' when the target_format is PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian Is it possible to convert this stream manually after every read() call? And if yes, how? In general, how can you compare two formats and tell if a conversion is possible?

    Read the article

  • Using memorystream and DotNetZip in MVC gives "Cannot access a closed Stream"

    - by Frode Lillerud
    I'm trying to create a zipfile in a MVC method using the DotNetZip components. Here is my code: public FileResult DownloadImagefilesAsZip() { using (var memoryStream = new MemoryStream()) { using (var zip = new ZipFile()) { zip.AddDirectory(Server.MapPath("/Images/")); zip.Save(memoryStream); return File(memoryStream, "gzip", "images.zip"); } } } When I run it I get a "Cannot access a closed Stream" error, and I'm not sure why.

    Read the article

  • how to convert unicode to printable string in QT stream

    - by user63898
    I'm writing a stream to a file and stdout, but I'm getting some kind of encoding like this: \u05ea\u05e7\u05dc\u05d9\u05d8 \u05e9\u05e1\u05d9\u05de\u05dc \u05e9\u05d9\u05e0\u05d5\u05d9 \u05d1\u05e1\u05d2\u05e0\u05d5\u05df \u05dc\u05d3\u05e2\u05ea\u05d9 \u05d0\u05dd \u05d0\u05e0\u05d9 \u05d6\u05d5\u05db\u05e8 \u05e0\u05db\u05d5\u05df How can I convert this to a printable string?

    Read the article

  • How do you stream text to an IRC Channel

    - by Matt
    Hi, does anyone know how you go about streaming text to a IRC server? I have a game server, and i'd like to stream the chat to IRC. I can get the chat as a string within a C# program.. Anyone know how to do this? Or a good resource to look at? Cheers

    Read the article

  • Protocol error in TDS stream

    - by jasonline
    What are the possible causes of this type of error - "[Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream"? And how can this be fixed? My application runs in C++ calling stored procedures implemented in SQL Server. There's this one SP (containing select and update statements) that causes this problem, after which all succeeding queries will return that the cursor is in an invalid state. I've checked the SP but I don't see any possible problem.

    Read the article

  • Stream writing lags my GUI

    - by blez
    I have a thread that dequeues data from a queue and write it to another application's STDIN. I'm using Stream, but with .Write and even .BeginWrite, when I send 1mb chunks to the second app, my GUI gets laggy for ~1sec. Why?

    Read the article

  • how to write MPEG4 video files from stream in vc++ directshow

    - by maxy
    hai all... Am writing simple application for capturing video from camera and save in .WMV files using vc++ Directshow.i done this task.bt i need to write file as MPEG4 file type. can anyone help me. CAMERA---->SAMPLEGRABBER---->getting streams from sample graaper.. i get stream from camera like this. kndly help me thanks

    Read the article

  • How to stream your images/files with VLC?

    - by Ole Jak
    So I know there are lot of wrapers of libVLC.dll . But I just do not know what one is ready to do what I need... What I need is simple... in my C# programm I create some bitmap (once or twice per second)... I now want to stream bitmaps live as video (in some format VLC can to offer me) to some http:localhost:port/ using VLC... How to do that?

    Read the article

  • read Number from text file using CPP stream

    - by Yongwei Xing
    Hi all I have a text file like below 2 1 2 5 10 13 11 12 14 2 0 1 2 99 2 200 2 1 5 5 1 2 3 4 5 1 0 0 0 I want to read file line by line, and read the umbers from each line. I know how to use the stream to read a fixed field line, but what about the non-fixed line? Best Regards,

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >