w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
IS there any Huawei API (For Huawei e173 dongle)
I am afraid that there is no such api that I know of. You can make calls using the ATD command but the voice doesn't come through it, you must implement your own voice listener. If you are building your own such system I think this and this might help you.

Categories : C#

Huawei, logcat not showing the log for my app?
Try this: In Eclipse editor: Reset adb from windows-->devices and then try again ... please check your project is highlighted with green color (simply select your projrct name)

Categories : Android

Wammu configuration on Ubuntu 3G modem Huawei E1550
problem is your user and group didn't have permission to access you device. you must change permission for user and group. If wanna easy change user and group at /etc/init.d/gammu-smsd to root. user="root" group="root" bin="/usr/local/bin/gammu-smsd" configfile="/etc/gammu-smsdrc" pidfile="/var/run/gammu.pid" Have a nice day

Categories : Linux

Sevenzip extractFile(String file, Stream stream) method stream parameter. c#
Setup a FileStream that SevenZip can write out to: DirectoryInfo directoryInfo = new DirectoryInfo(ApplicationPath); FileInfo[] zipFile = directoryInfo.GetFiles("*.7z"); using (SevenZip.SevenZipExtractor zipExtractor = new SevenZip.SevenZipExtractor(zipFile[0].FullName)) { using (FileStream fs = new FileStream("", FileMode.Create)) //replace empty string with desired destination { zipExtractor.ExtractFile("ConfigurationStore.xml", fs); } }

Categories : C#

How to update an XML document by stream reading a file and simultaneously stream writing output
Use SAX parser instead of DOM. You can also use the StAX APIs (part of JDK package javax.xml.stream ). Further reading- http://docs.oracle.com/javase/tutorial/jaxp/sax/parsing.html http://download-llnw.oracle.com/javase/6/docs/api/index.html?javax/xml/stream/package-summary.html

Categories : Java

Dart is there any way to invoke onDone callback from stream.listen() where the stream is from StreamController
You need to call StreamController.close() new Stream.fromIterable(data) basically creates a StreamController, adds the elements of the iterable one at a time, and closes the controller when the iteration is complete. In your second code block you're doing this manually, but just not closing the controller. Here's the relevant docs: http://api.dartlang.org/docs/releases/latest/dart_async/StreamController.html#close

Categories : Dart

How to chain write stream, immediately with a read stream in Node.js 0.10?
request(url).pipe(fs.createWriteStream(filename)).pipe(writestream); is the same as this: var fileStream = fs.createWriteStream(filename); request(url).pipe(fileStream); fileStream.pipe(writestream); So the issue is that you are attempting to .pipe one WriteStream into another WriteStream.

Categories : Node Js

"Merging" a stream of streams to produce a stream of the latest values of each
This solution will work for one-item streams but unfortunately accumulates every item in an inner stream until it finishes. public static IObservable<IEnumerable<T>> MergeLatest<T>(this IObservable<IObservable<T>> source) { return Observable.Create<IEnumerable<T>>(obs => { var collection = new PerishableCollection<T>(); return source.Subscribe(duration => { var lifetime = new DisposableLifetime(); // essentially a CancellationToken duration .Subscribe( x => // on initial item { collection.Add(x, lifetime.Lifetime); obs.OnNext(collection.CurrentItems().Select(p => p.Value))

Categories : C#

Stream video from iPhone to web server - compress and stream step
Take a look at http://www.gdcl.co.uk/2013/02/20/iOS-Video-Encoding.html. This sample uses an AVAssetWriter to encode the video from the camera to H264 and then uses RTSP/RTP to stream the data to a player.

Categories : Iphone

Is there a generator that will turn a stream of text into a stream of lines?
After reading your edit, maybe you could modify the stream object which returns arbitrary amounts of text? For example, in the stream.next() method, there is some way the stream generates a string and yields it when .next() is called. Could you do something like: def next(self): if ' ' in self.remaining: terms = self.remaining.split(' ') to_yield, self.remaining = terms[0], ''.join(terms[1:]) yield to_yield else: to_yield = self.remaining + self.generate_arbitrary_string() while ' ' not in to_yield: to_yield += self.generate_arbitrary_string() to_yield, self.remaining = terms[0], ''.join(terms[1:]) yield to_yield This pseudocode assumes that the stream object generates some arbitrary string with generate

Categories : Python

scala iterator and stream example. stream fails on reuse
It fails because the sentences Iterator has been expended. One is not suppose to call an Iterator after a method on it has been called except for the next and hasNext methods. A simple example shows this: scala> val it = Iterator(1,2,3) it: Iterator[Int] = non-empty iterator scala> it.foreach(println(_)) 1 2 3 scala> it.foreach(println(_)) scala> In your case sentences has been expended on the first call and is empty on the second one giving a size of 0. Calling toStream on it does not change this. You get back an empty Stream. If you want to reuse sentences assign it to a list with val l = sentences.toList before calling count.

Categories : Scala

Copy all but the last 16 bytes of a stream? Early detection of end-of-stream?
Read between 1 and n bytes from the input stream.1 Append the bytes to a circular buffer.2 Write the first max(0, b - 16) bytes from the circular buffer to the output stream, where b is the number of bytes in the circular buffer. Remove the bytes that you just have written from the circular buffer. Go to step 1. 1This is what the Read method does – if you call int n = Read(buffer, 0, 500); it will read between 1 and 500 bytes into buffer and return the number of bytes read. If Read returns 0, you have reached the end of the stream. 2For maximum performance, you can read the bytes directly from the input stream into the circular buffer. This is a bit tricky, because you have to deal with the wraparound within the array underlying the buffer.

Categories : C#

Can a writeable stream be piped to either a readable or wirtable stream
Ad 1: Yes, a must be a readable stream, and b must be a writable one. But, streams are not neccessarily either / or, they also can be both: Readable and writeable at the same time. So, b and c are both, hence you can pipe into them, but also pipe from them. Technically they are so-called duplex streams. Ad 2: Should be answered by now ;-). Ad 3: Yes, you should definitely check out the stream-handbook by @substack (aka James Halliday). For buffers, see How to use buffers in Node.js by NodeJitsu.

Categories : Node Js

Balancing slow I/O in a fast stream read stream
I just ran into this problem last night, and in my hackathon induced sleep deprived state, here is how I solved it: I would increment a counter whenever I sent a job out to be processed, and decremented the counter when the operation completed. To keep the outbound traffic from overwhelming the other service, I would pause the stream when there was a certain number of pending outbound requests. The code is very similar to the following. var instream = fs.createReadStream('./combined.csv'); var outstream = new stream; var inProcess = 0; var paused = false; var rl = readline.createInterface(instream, outstream); rl.on('line', function(line) { inProcess++; if(inProcess > 100) { console.log('pausing input to clear queue'); rl.pause(); paused = true; }

Categories : Node Js

Stream processing errors with stream with embedded nulls
What you pass a C style string (char pointer) to the std::istringstream constructor it actually instantiates a std::string and passes that instead. This happens due to an implicit conversion. The conversion constructor of std::string interprets a null byte character in C style strings as an end of string terminator causing all characters after it to be ignored. To avoid this you can explicitly construct a std::string specifying the size of the data and pass it to std::istringstream char bin[] = {0x30, 0xb, 0x0, 0x6, 0x6, 0x2b, 0xc, 0x89, 0x36, 0x84, 0x13, 0xa, 0x1}; std::istringstream strm(std::string(bin, sizeof(bin) / sizeof(bin[0]))); Note: I don't know exactly what you are trying to accomplish but I recommend using std::vector instead of a raw character buffer if possible.

Categories : C++

NodeJS: What's the difference between a Duplex stream and a Transform stream?
The difference is just syntactic sugar. Transform streams are full duplex streams but rather than implementing _write and _read methods, you are asked to implement just the _transform method. You can read more about streams on the excellent substack's streams guide or from Isaacs's readable-stream repo.

Categories : Node Js

I want to stream video from my webserver, but I only want it to stream when there is a viewer
Try Page Visibility API. Supported Browsers : http://caniuse.com/#feat=pagevisibility

Categories : Javascript

RX: How to concat a Snapshot stream and an Update stream?
Whether you use a ReplaySubject or the Replay function really makes no difference. Replay uses a ReplaySubject under the hood. I'll also note that you are leaking subscriptions like mad, which can cause a resource leak. Also, you put no limit on the size of the replay buffer. If you watch the observable all day long, then that replay buffer will keep growing and growing. You should put a limit on it to prevent that. Here is an updated version of GetStream. In this version I take the simplistic approach of just limitting the Replay to the most recent 1 minute of data. This assumes that GetData will always complete and the observer will observe the results within that 1 minute. Your mileage may vary and you can probably improve upon this scheme. But at least this way when you have

Categories : C#

Network stream stuck on stream.Read(byte[] byte, int offset, int size)
Because it's a stream, and can be partial received. Are you sure you are always receiving packages with te size of 2048 bytes? int i = 0; int bytesNeeded = 200; int bytesReceived = 0; do { //read byte from client int bytesRead = stream.Read(receivedBytesRaw, bytesReceived, bytesNeeded-bytesReceived); bytesReceived += bytesRead; // merge byte array to another byte array } while (bytesReceived < bytesNeeded); I think you need a frame protocol, try create a protocol like, writing the size of the data that follows. example: (psuedo) void SendData(byte[] data) { // get the 4 bytes of a int value. byte[] dataLength = BitConverter.GetBytes(data.Lenght); // write the length to the stream. stream.Write(dataLengt

Categories : C#

Odd behaviour: copying more bufferSize with .NET Stream.CopyTo(Stream destination, int bufferSize)
I misunderstood the meaning of bufferSize in Stream.CopyTo(Stream destination, int bufferSize). I thought it was the total amount of bytes to be copied, not simply the buffer to be used while copying. There is no feature in the Stream object to copy only a specific number of bytes. I fixed the problem by replacing this.captureStream.CopyTo(captureSession.captureStream, chunkLength); with writer.Write(reader.ReadBytes(chunkLength));

Categories : C#

Set activity audio stream to android home audio stream
If you mean which volume it is that gets adjusted when you press the volume keys while at the home screen, then it's most likely the ring volume (i.e. STREAM_RING).

Categories : Java

Memory stream inside another using Memory Stream, can it cause memory leaks?
To actually dispose of the second MemoryStream properly, you need to nest your usings: using (MemoryStream mStream = new MemoryStream()) using (MemoryStream fileStream = new MemoryStream()) { … } Either way, though, if you need more memory and there are no references left to the MemoryStream, it’ll be reclaimed. Fitting everything in memory at once, on the other hand, is just a matter of actual memory versus file size…

Categories : C#

How to tell when the Stream is at it's end?
You can use the .DataAvailable property in the receiver to determine if there is still data available in the stream to be read, but the Length property itself is not implemented. Use do { ... myNetworkStream.Read(buffer, 0, someSizeToCopyEachLoop) } while(myNetworkStream.DataAvailable); If you really need the length of the stream you can copy its contents to a MemoryStream and read the .Length property of that: MemoryStream s = new MemoryStream(); myNetworkStream.CopyTo(s); int length = s.Length;

Categories : C#

Is it possible to use a stream more than once?
Generally, you can't reset an InputStream to get back to the start. There are, however the mark() / reset() methods, which make a stream remember the current position and you can rewind the stream to the marked position with reset(). Problem is, they are optional and may not be supported by the particular stream class in use. BufferedInputStream does support mark() / reset() (although within buffer limits). You can wrap your InputStream in a BufferedInputStream, immediately mark() and then run your detection code (but make sure it does not read ahead further than the buffer size, you can specify the buffer size in the BufferedInputStream constrcutor). Then call reset() and really read the stream. EDIT: If you use ByteArrayInputStream anyway, that one supports mark/reset over its entire l

Categories : Java

Stream in NodeJS
Most of Node's Stream classes aren't meant to be used directly, but as the base of a custom type: Note that stream.Duplex is an abstract class designed to be extended with an underlying implementation of the _read(size) and _write(chunk, encoding, callback) methods as you would with a Readable or Writable stream class. One notable exception is stream.PassThrough, which is a simple echo stream implementation. var PassThrough = require('stream').PassThrough; var stream = new PassThrough; Also note that ps will be a global, making it directly accessible in all other modules.

Categories : Javascript

How to end() a file stream
Try this structure: var file = fs.WriteStream('copy.csv'); fileSize = request.headers['content-length'], uploadedSize = 0; request.on('readable', function () { // Node.js 0.10 (Streams2 interface) var newData = this.read() || new Buffer(0); // Sometimes may come null file.write(newData); uploadedSize += newData.length; response.write(Math.round((uploadedSize / fileSize) * 100) + "%" + " uploaded " ); }); request.on('end', function () { response.write('Upload done!'); response.end(); file.end(); });

Categories : Javascript

Reading XML from Stream
The first time you create an XmlReader around the stream, it is at position 0. But the second time you create an XmlReader, the stream has already been partially read, so it is no longer at position 0, so the XmlReader can't read the XML document. Instead, you should create the XmlReader only once: using (XmlReader reader = XmlReader.Create(inputStream) { if (CorrectFileFormat(reader)) { DisplayLicenseInfo(reader); } else { StatusLabel.Text = "Selected file is not a LicensingDiag XML file"; } } If the file is small, you could also consider loading the entire XML document using XmlDocument or XDocument (Linq to XML)

Categories : C#

Stream audio in my app
Here's useful link: http://www.joeldare.com/wiki/play_an_mp3_audio_stream_in_phonegap Or see this solution: (SOLVED) Phonegap Media Streaming is not working on iOS

Categories : Javascript

C# Reading Stream
There are various options here, but one simple approach would be: using (var reader = File.OpenText("file.txt")) { for (int i = 0; i < 25; i++) { HandleLines(reader); } } ... private void HandleLines(TextReader reader) { for (int i = 0; i < 20; i++) { string line = reader.ReadLine(); if (line != null) // Handle the file ending early { // Process the line } } }

Categories : C#

how to use gpu::Stream in OpenCV?
By default all gpu module functions are synchronous, i.e. current CPU thread is blocked until operation finishes. gpu::Stream is a wrapper for cudaStream_t and allows to use asynchronous non-blocking call. You can also read "CUDA C Programming Guide" for detailed information about CUDA asynchronous concurrent execution. Most gpu module functions have additional gpu::Stream parameter. If you pass non-default stream the function call will be asynchronous, and the call will be added to stream command queue. Also gpu::Stream provides methos for asynchronous memory transfers between CPU<->GPU and GPU<->GPU. But CPU<->GPU asynchronous memory transfers works only with page-locked host memory. There is another class gpu::CudaMem that encapsulates such memory. Currently, you

Categories : C++

How can I stream MP3 with AudioTrackStreamer?
You're using the wrong stream for the data source. Replace [Begin/End]GetRequestStream with [Begin/End]GetResponse, in the completion handler call WebResponse.GetResponseStream to access the correct stream. Don't call NotifyComplete from OnBeginStreaming. Instead, call NotifyComplete when the track is played to the end. Before BeginGetResponse, you should set req.AllowReadStreamBuffering = false; otherwise your MP3s will download completely before playback. Update - my while() loop looks like this: while( true ) { if( cancel.IsCancellationRequested ) return; if( buffer.hasFreeSpace() ) { int cb = await this.downloadAsync().ConfigureAwait( false ); var buffWaiter = m_bufferAwaiter; if( 0 == cb ) { Exception ex = new Except

Categories : C#

How to get the RTMP & stream name from this URL?
Your above stream link is http://fw01.livem3u8.me.totiptv.com/live//7f2989e3f87e4efdb36bac56b64dca62.m3u8?bitrate=800 That is working fine right now in VLC player. But for me it was total hit and trail. What i did for this is I'm going to explain. Download URL Helper from www.urlhelper.com/download.htm (trail version will work fine) Install it and run it. Click Options >> Select and select your network adapter. Click OK. Then click Start at toolbar (It starts watching your network traffic). Run the page where stream is. In a moment URL helper will start showing you some URLs. On the bottom click "All" See here http://s22.postimg.org/9w61m07y9/Untitled.png Copy the URL that is NOT shown as mp3. If you are running only one stream there will be only one address shown multiple times. Copy t

Categories : Javascript

Stream drawing with Three.js
On the off-chance that this thread will get no more answers, the solution I've reverted to, is to use THREE.BufferGeometry instead of THREE.Geometry so that the GPU memory is used instead. Using this approach, approximately 300MB extra memory is used up by the GPU which is more preferable than the 1GB used up in RAM. Other inputs are very welcome however, as GPU performance takes a FPS hit in comparison to the other approach.

Categories : Javascript

using `?:` in the output stream
It's because the output operator << has higher precedence than the ternary operator ?:. So for the compiler it's the same as (std::cout << "a= " << (a)) ? "true " : "false "; You need to explicitly put the parentheses at the correct place: std::cout << "a= " << (a ? "true " : "false "); Or as a already is a bool you can use std::boolalpha to print it directly: std::cout << "a= " << std::boolalpha << a << ' ';

Categories : C++

nodejs gm using stream twice
try this, i dont think you need to use writeStreams in this case: gm(imagePath) .resize(640, 480) .autoOrient() .flip() .write(newImagePath, function(e) { if (e) throw e; gm(newImagePath) .resize(320, 240) .write(newImagePathSmall, function(e) { if (e) throw e; console.log('resized successfuly'); }); });

Categories : Node Js

Stream context in PHP - what is it?
A parameter of the context that modifies the properties of the stream. The options are specific to whatever wrapper the stream is using. Examples of these include files, all the different php:// URIs, the HTTP wrapper (like when you do file_get_contents('http://example.com') — it’s not the same thing as file_get_contents('some-file.txt')) Any stream! In this case, the stream context is passed to file_get_contents to tell it to send that authorization header and those options to the wrapper that allows file_get_contents to get contents from HTTP URLs. You can find a list of the HTTP context options on the PHP website.

Categories : PHP

split a stream in many
The only thing I can think of: def distribute[T](n: Int)(x: Stream[T]) = (0 until n).map { p => x.zipWithIndex.collect { case (e,i) if i % n == p => e } } It's kind of ugly because each of the sub-streams has to entirely traverse the main-stream. But I don't think you can mitigate that while preserving (apparent) immutability. Have you thought of dispatching individual tasks to actors and having a "task-distributer" that does exactly this?

Categories : Scala

Getting 401 from Twitter Stream API using C#
try include your query string to baseString: var baseFormat = "oauth_consumer_key={0}&oauth_nonce={1}&oauth_signature_method={2}" + "&oauth_timestamp={3}&oauth_token={4}&oauth_version={5}&track={6}"; var baseString = string.Format(baseFormat, oauth_consumer_key, oauth_nonce, oauth_signature_method, oauth_timestamp, oauth_token, oauth_version, Uri.EscapeDataString(valueToTrack) ); .... var postBody = "track=obama"; https://dev.twitter.com/docs/auth/creating-sig

Categories : C#

Is Stream Binded?
Yes, when you call str.Dispose, newStr is also disposed. This is because Stream, like all classes in .NET, are reference types. When you write Stream newstr = str, you are not creating a new Stream, you are simply creating a new reference to the same Stream. The correct way to write this would be: Stream str = new FileStream(somefile, FileMode.OpenOrCreate); int strLen = str.Length; str.Dispose(); byte[] b = new byte[strLen]; This will avoid any ObjectDisposedException's. Note that int is a value type, so when you write int strLen = str.Length you are creating a new copy of the value, and saving it in the variable strLen. So even after the Stream is disposed, you can use that value.

Categories : C#

innobackupex stream tar and run from php
It created a .tar.gz file, but when opening the file it only contains a backup-my.cnf..?! You must use the -i option for tar to extract or view the contents of a tar file created by Percona XtraBackup. This is documented, and a reminder is output at the end of the innobackupex process: . . . 130630 10:40:23 innobackupex: Connection to database server closed innobackupex: You must use -i (--ignore-zeros) option for extraction of the tar stream. 130630 10:40:23 innobackupex: completed OK! Omitting the -i option results in the behavior you saw: only the first file in the tar archive is visible. Then I tried to run the first working command from the webserver... No file is created... PHP already has access to the target directory The innobackupex process must have read pri

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.