peek

peek at input buffer, and flush extra characters in C

If I want to receive a one character input in C, how would I check to see if extra characters were sent, and if so, how would I clear that? Is there a function which acts like getc(stdin), but which doesn't prompt the user to enter a character, so I can just put while(getc(stdin)!=EOF);? Or a function to peek at the next character in th...

.NET: is there a "HasNext" method for an IEnumerator ?

With Java Iterators, I have used the hasNext method to determine whether an iteration has more elements (without consuming an element) -- thus, hasNext is like a "Peek" method. My question: is there anything like a "hasNext" or "Peek" method with C#'s generic IEnumerators? ...

Removing Message from Queue only if user does some operation

We are having MVC application which reads data from MSMQ. We are trying to find out a way to read message from queue and remove it from queue only if user has done a successful operation on the queue. The message should remain in the queue until user completes the processing, the message should not be available to anyone else until the u...

Thumbnail Toolbar Button

Hi everybody Today I have another specific question about a new feature in windows 7 called the thumbnail toolbar or the Aero Peek Toolbar if some might like to call it that way. I have been able to create a new set of toolbar buttons for my application each button with its unique icon and behavior But I haven't been able to add functio...

StreamReader, C#, peek

Hello, I have a StreamReader that once in a while check if it has more to read from a simple text file. It uses peek property. The problem is that when I am using peek the position is changed, althougth not suppose to. FileStream m_fsReader = new FileStream( m_strDataFileName, FileMode.Op...

Peeking in a heap in python

Hi all. What is the official way of peeking in a python heap as created by the heapq libs? Right now I have def heappeak(heap): smallest = heappop(heap) heappush(heap, smallest) return smallest which is arguably, not very nice. Can I always assume that heap[0] is the top of the heap and use that? Or would that assume too much o...

java BlockingQueue does not have a blocking peek?

I have a blocking queue of objects. I want to write a thread that blocks till there is a object on the queue. Similar to the functionality provided by BlockingQueue.take(). However, since I do not know if I will be able to process the object successfully, I want to just peek() and not remove the object. I want to remove the object only...

C equivalent to fstream's peek

Hi, I know in C++, you're able to peek at the next character by using: in.peek();. How would I go about this when trying to "peek" at the next character of a file in C? ...

Windows7 taskbar thumbnail without showing a window

Hi, Is it possible to "mark" my program as active in the windows7 taskbar without actually showing a window and even provide a thumbnail picture? I worte a small program which displays the system battery as a deskband. Now in windows7 I'd like to display the battery in the thumbnail picture, and make the deskband optional. ...

C#: Implementing NetworkStream.Peek?

Currently, there isn't a NetworkStream.Peek method in C#. What is the best way of implementing such a method which functions just like NetworkStream.ReadByte except that the returned byte is not actually removed from the Stream? ...

Is there any way to "peek" at a file while it's uploading through HTTP onto a Windows box?

I need to add a file upload function to an ASP.NET website and would like to be able to read a small portion of the file on the server while it's still uploading. A peek or preview type function so I can determine contents and give some feedback to the user while it is still uploading (we're talking about large files here). Is there an...

How do I subscribe to a MSMQ queue but only "peek" the message in .Net?

We have a MSMQ Queue setup that receives messages and is processed by an application. We'd like to have another process subscribe to the Queue and just read the message and log it's contents. I have this in place already, the problem is it's constantly peeking the queue. CPU on the server when this is running is around 40%. The mqsvc.e...

Help: ZX81 'BASIC' Peek function...

I need a way to find if the character ('<') has hit a wall (Black pixel Graphic) -On a ZX81 game. I'm been looking at another game... which uses code if peek(peek 16398 +256*peek 16399) = code "blackpixel graphic" then ... Which seems to work for them... Is this correct code? I'm not really knowledgable with addresses and getting m...

Help: ZX81 ‘BASIC’ Peek function…

I want to find the code of a character printed... This is the code: 10 Print AT 2,2; "T" 20 Let C=Peek(Peek 16398+256*Peek 16399) 30 Print Peek(C) It should just print the Code value of T I could later use: 40 Print Peek (Code C) Or something. But the 10-30 bit doesnt work. It always returns '0' -With different letters too: G,T...

Peeking an MSMQ Outgoing Queue with JScript

I created a script to monitor a set of queues, and, while it works perfectly with Remote Private Queues, it doesn't work with Outgoing Queues. I made an experiment by removing everything but the essential from the script, and I created the following test script: var info = new ActiveXObject("MSMQ.MSMQQueueInfo"); info.FormatName = /*<Qu...

Return value of ifstream.peek() when it reaches the end of the file

I was looking at this article on Cplusplus.com, http://www.cplusplus.com/reference/iostream/istream/peek/ I'm still not sure what peek() returns if it reaches the end of the file. In my code, a part of the program is supposed to run as long as this statement is true (sourcefile.peek() != EOF) where sourcefile is my ifstream. Howeve...