Sponsored Content
Full Discussion: A little bit of XMAS fun...
The Lounge What is on Your Mind? A little bit of XMAS fun... Post 302988397 by wisecracker on Sunday 25th of December 2016 05:40:38 PM
Old 12-25-2016
Hi bakunin...

You devil... ;o)

Absolutely correct, I expected the mathematicians to get it...

EDIT:
None of the people I know even attempted it. I knew it was beyond their understanding but these same people attempt the ultra-easy ones, and, often get them wrong as they don't know about operator order..

Last edited by wisecracker; 12-25-2016 at 06:54 PM.. Reason: See above.
 

4 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. UNIX for Advanced & Expert Users

migrating unix mp-ras 32 bit to linux suse 64 bit

Hi. I need to migrate the whole unix environment from a Unix mp-ras 32 bit to a Linux Suse 64 bit. 1) can i use cpio to copy the data? 2) can i just copy the users from unix to linux or do i have to create them by hand 3) are there any other concerns i should worry about? thanx (1 Reply)
Discussion started by: mrodrig
1 Replies

3. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

4. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
QSemaphore(3qt) 														   QSemaphore(3qt)

NAME
QSemaphore - Robust integer semaphore SYNOPSIS
All the functions in this class are thread-safe when Qt is built with thread support.</p> #include <qsemaphore.h> Public Members QSemaphore ( int maxcount ) virtual ~QSemaphore () int available () const int total () const int operator++ ( int ) int operator-- ( int ) int operator+= ( int n ) int operator-= ( int n ) bool tryAccess ( int n ) DESCRIPTION
The QSemaphore class provides a robust integer semaphore. A QSemaphore can be used to serialize thread execution, in a similar way to a QMutex. A semaphore differs from a mutex, in that a semaphore can be accessed by more than one thread at a time. For example, suppose we have an application that stores data in a large tree structure. The application creates 10 threads (commonly called a thread pool) to perform searches on the tree. When the application searches the tree for some piece of data, it uses one thread per base node to do the searching. A semaphore could be used to make sure that two threads don't try to search the same branch of the tree at the same time. A non-computing example of a semaphore would be dining at a restuarant. A semaphore is initialized to have a maximum count equal to the number of chairs in the restuarant. As people arrive, they want a seat. As seats are filled, the semaphore is accessed, once per person. As people leave, the access is released, allowing more people to enter. If a party of 10 people want to be seated, but there are only 9 seats, those 10 people will wait, but a party of 4 people would be seated (taking the available seats to 5, making the party of 10 people wait longer). When a semaphore is created it is given a number which is the maximum number of concurrent accesses it will permit. Accesses to the sempahore are gained using operator++() or operator+=(), and released with operator--() or operator-=(). The number of accesses allowed is retrieved with available(), and the total number with total(). Note that the incrementing functions will block if there aren't enough available accesses. Use tryAccess() if you want to acquire accesses without blocking. See also Environment Classes and Threading. MEMBER FUNCTION DOCUMENTATION
QSemaphore::QSemaphore ( int maxcount ) Creates a new semaphore. The semaphore can be concurrently accessed at most maxcount times. QSemaphore::~QSemaphore () [virtual] Destroys the semaphore. Warning: If you destroy a semaphore that has accesses in use the resultant behavior is undefined. int QSemaphore::available () const Returns the number of accesses currently available to the semaphore. int QSemaphore::operator++ ( int ) Postfix ++ operator. Try to get access to the semaphore. If available() == 0, this call will block until it can get access, i.e. until available() > 0. int QSemaphore::operator+= ( int n ) Try to get access to the semaphore. If available() < n, this call will block until it can get all the accesses it wants, i.e. until available() >= n. int QSemaphore::operator-- ( int ) Postfix -- operator. Release access of the semaphore. This wakes all threads waiting for access to the semaphore. int QSemaphore::operator-= ( int n ) Release n accesses to the semaphore. int QSemaphore::total () const Returns the total number of accesses to the semaphore. bool QSemaphore::tryAccess ( int n ) Try to get access to the semaphore. If available() < n, this function will return FALSE immediately. If available() >= n, this function will take n accesses and return TRUE. This function does not block. SEE ALSO
http://doc.trolltech.com/qsemaphore.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qsemaphore.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QSemaphore(3qt)
All times are GMT -4. The time now is 03:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy