Showing posts with label and. Show all posts
Showing posts with label and. Show all posts

How to determine how many cameras are connected to a computer and connect to and use ptz cameras

How to determine how many cameras are connected to a computer and connect to and use ptz cameras:

I figure this is a nice easy first post. This is some code I struggled with finding a couple years ago on automatically determining how many cameras are connected to a computer via directshow (this code is also useful in a ptz application as I will show right after). I use OpenCV to capture from the camera and the directshow library to use the ptz camera functions. I also used the vector and stringstream library for my own ease (#include<vector> #include<sstream>)

The DisplayError function is a generic wrapper for you to fill in, whether you use printf or a messagebox.

int getDeviceCount() {
  try {
    ICreateDevEnum *pDevEnum = NULL;
    IEnumMoniker *pEnum = NULL;
    int deviceCounter = 0;
    HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, reinterpret_cast<void**>(&pDevEnum));
    if (SUCCEEDED(hr)) {
      // Create an enumerator for the video capture category.
      hr = pDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnum, 0);
      if (hr == S_OK) {
        IMoniker *pMoniker = NULL;
        while (pEnum->Next(1, &pMoniker, NULL) == S_OK) {
          IPropertyBag *pPropBag;
          hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)(&pPropBag));
          if (FAILED(hr)) {
            pMoniker->Release();
            continue; // Skip this one, maybe the next one will work.
          }
          pPropBag->Release();
          pPropBag = NULL;
          pMoniker->Release();
          pMoniker = NULL;
          deviceCounter++;
        }
        pEnum->Release();
        pEnum = NULL;
      }
      pDevEnum->Release();
      pDevEnum = NULL;
    }
    return deviceCounter;
  } catch(Exception & e) {
    DisplayError(e.ToString());
  } catch(...) {
    DisplayError("Error Caught Counting # of Devices");
  }
  return 0;
}


This can easily be modified to connect to x number of ptz cameras with a quick ptz class

Here is our ptz class:

class ptz {
public:
  struct controlVals {
  public:
    long min, max, step, def, flags;
  };
  IBaseFilter *filter;
  IAMCameraControl *camControl;

  bool valid, validMove;
  CvCapture *capture;
  bool Initialize() {
    camControl = NULL;
    controlVals panInfo = {0}, tiltInfo = {0};
    HRESULT hr = filter->QueryInterface(IID_IAMCameraControl, (void **)&camControl);
    if(hr != S_OK)
      return false;
    else
      return true;
  }

  void ptz(int instance) {

    threadNum = instance;
    // sets up a continuous capture point through the msvc driver
    capture = cvCaptureFromCAM(threadNum);
    if (!capture)
      valid = false;
    else
      valid = true;

  }
  void Destroy() {
    if(camControl) {
      camControl->Release();
      camControl = NULL;
    }
    if (filter) {
      filter->Release();
      filter = NULL;
    }
  }
};


And here is the modified getDeviceCount code which now connects to all the cameras and gets the ptz information using direct show:

int getDeviceCount(vector<ptz> &cameras) {
  try {
    ICreateDevEnum *pDevEnum = NULL;
    IEnumMoniker *pEnum = NULL;
    int deviceCounter = 0;

    HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, reinterpret_cast<void**>(&pDevEnum));
    if (SUCCEEDED(hr)) {
      // Create an enumerator for the video capture category.
      hr = pDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnum, 0);
      if (hr == S_OK) {
        IMoniker *pMoniker = NULL;
        do {
          if (pEnum->Next(1, &pMoniker, NULL) == S_OK) {
            IPropertyBag *pPropBag;
            hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)(&pPropBag));
            if (FAILED(hr)) {
              pMoniker->Release();
              continue; // Skip this one, maybe the next one will work.
            }
            if (SUCCEEDED(hr)) {
              ptz tmp = ptz(deviceCounter);
              HRESULT hr2 = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (void**) & (tmp.filter));
              if (tmp.valid)
                tmp.validMove = tmp.Initialize();
            }
            pPropBag->Release();
            pPropBag = NULL;
            pMoniker->Release();
            pMoniker = NULL;
            deviceCounter++;
          } else {
            ptz tmp = ptz(deviceCounter);
            cameras.push_back(tmp);
            deviceCounter++;
            break;
          }
        }
        while (cameras[deviceCounter -1].valid);
        pEnum->Release();
        pEnum = NULL;
      }
      pDevEnum->Release();
      pDevEnum = NULL;
    }
    return deviceCounter;
  } catch(Exception & e) {
    DisplayError(e.ToString());
  } catch(...) {
    DisplayError("Error Caught Counting # of Devices");
  }
  return 0;
}


Notice now how we have integrated OpenCV into our ptz class. Now as we find cameras we can capture the camera information using OpenCV and then use directshow to grab the information used for ptz. To move the camera we can use  a pan and a tilt function like the following:

HRESULT MechanicalPan(IAMCameraControl *pCameraControl, long value) {
  HRESULT hr = 0;
  try {
    long flags = KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE | KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
    hr = pCameraControl->Set(CameraControl_Pan, value, flags);
    if (hr == 0x800700AA)
      Sleep(1);
    else if (hr != S_OK && hr != 0x80070490) {
      stringstream tmp;
      tmp << "ERROR: Unable to set CameraControl_Pan property value to " << value << ". (Error " << std::hex << hr << ")";
      throw Exception(tmp.str().c_str());
    }
    // Note that we need to wait until the movement is complete, otherwise the next request will
    // fail with hr == 0x800700AA == HRESULT_FROM_WIN32(ERROR_BUSY).
  } catch(Exception & e) {
    DisplayError(e.ToString());
  } catch(...) {
    DisplayError("Error Caught panning camera");
  }
  return hr;
}
// ----------------------------------------------------------------------------
HRESULT MechanicalTilt(IAMCameraControl *pCameraControl, long value) {
  HRESULT hr = 0;
  try {
    long flags = KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE | KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
    hr = pCameraControl->Set(CameraControl_Tilt, value, flags);
    if (hr == 0x800700AA)
      Sleep(1);
    else if (hr != S_OK && hr != 0x80070490) {
      stringstream tmp;
      tmp << "ERROR: Unable to set CameraControl_Tilt property value to " << value << ". (Error " << std::hex << hr << ")";
      throw Exception(tmp.str().c_str());
    }
    // Note that we need to wait until the movement is complete, otherwise the next request will
    // fail with hr == 0x800700AA == HRESULT_FROM_WIN32(ERROR_BUSY).
  } catch(Exception & e) {
    DisplayError(e.ToString());
  } catch(...) {
    DisplayError("Error Caught tilting camera");
  }
  return hr;
}




Consider donating to further my tinkering.


Places you can find me
Read More..

NIPS 2015 and Machine Learning Research at Google



This week, Montreal hosts the 29th Annual Conference on Neural Information Processing Systems (NIPS 2015), a machine learning and computational neuroscience conference that includes invited talks, demonstrations and oral and poster presentations of some of the latest in machine learning research. Google will have a strong presence at NIPS 2015, with over 140 Googlers attending in order to contribute to and learn from the broader academic research community by presenting technical talks and posters, in addition to hosting workshops and tutorials.

Research at Google is at the forefront of innovation in Machine Intelligence, actively exploring virtually all aspects of machine learning including classical algorithms as well as cutting-edge techniques such as deep learning. Focusing on both theory as well as application, much of our work on language understanding, speech, translation, visual processing, ranking, and prediction relies on Machine Intelligence. In all of those tasks and many others, we gather large volumes of direct or indirect evidence of relationships of interest, and develop learning approaches to understand and generalize.

If you are attending NIPS 2015, we hope you’ll stop by our booth and chat with our researchers about the projects and opportunities at Google that go into solving interesting problems for billions of people. You can also learn more about our research being presented at NIPS 2015 in the list below (Googlers highlighted in blue).

Google is a Platinum Sponsor of NIPS 2015.

PROGRAM ORGANIZERS
General Chairs
Corinna Cortes, Neil D. Lawrence
Program Committee includes:
Samy Bengio, Gal Chechik, Ian Goodfellow, Shakir Mohamed, Ilya Sutskever

ORAL SESSIONS
Learning Theory and Algorithms for Forecasting Non-stationary Time Series
Vitaly Kuznetsov, Mehryar Mohri

SPOTLIGHT SESSIONS
Distributed Submodular Cover: Succinctly Summarizing Massive Data
Baharan Mirzasoleiman, Amin Karbasi, Ashwinkumar Badanidiyuru, Andreas Krause

Spatial Transformer Networks
Max Jaderberg, Karen Simonyan, Andrew Zisserman, Koray Kavukcuoglu

Pointer Networks
Oriol Vinyals, Meire Fortunato, Navdeep Jaitly

Structured Transforms for Small-Footprint Deep Learning
Vikas Sindhwani, Tara Sainath, Sanjiv Kumar

Spherical Random Features for Polynomial Kernels
Jeffrey Pennington, Felix Yu, Sanjiv Kumar

POSTERS
Learning to Transduce with Unbounded Memory
Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, Phil Blunsom

Deep Knowledge Tracing
Chris Piech, Jonathan Bassen, Jonathan Huang, Surya Ganguli, Mehran Sahami, Leonidas Guibas, Jascha Sohl-Dickstein

Hidden Technical Debt in Machine Learning Systems
D Sculley, Gary Holt, Daniel Golovin, Eugene Davydov, Todd Phillips, Dietmar Ebner, Vinay Chaudhary, Michael Young, Jean-Francois Crespo, Dan Dennison

Grammar as a Foreign Language
Oriol Vinyals, Lukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, Geoffrey Hinton

Stochastic Variational Information Maximisation
Shakir Mohamed, Danilo Rezende

Embedding Inference for Structured Multilabel Prediction
Farzaneh Mirzazadeh, Siamak Ravanbakhsh, Bing Xu, Nan Ding, Dale Schuurmans

On the Convergence of Stochastic Gradient MCMC Algorithms with High-Order Integrators
Changyou Chen, Nan Ding, Lawrence Carin

Spectral Norm Regularization of Orthonormal Representations for Graph Transduction
Rakesh Shivanna, Bibaswan Chatterjee, Raman Sankaran, Chiranjib Bhattacharyya, Francis Bach

Differentially Private Learning of Structured Discrete Distributions
Ilias Diakonikolas, Moritz Hardt, Ludwig Schmidt

Nearly Optimal Private LASSO
Kunal Talwar, Li Zhang, Abhradeep Thakurta

Learning Continuous Control Policies by Stochastic Value Gradients
Nicolas Heess, Greg Wayne, David Silver, Timothy Lillicrap, Tom Erez, Yuval Tassa

Gradient Estimation Using Stochastic Computation Graphs
John Schulman, Nicolas Heess, Theophane Weber, Pieter Abbeel

Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, Noam Shazeer

Teaching Machines to Read and Comprehend
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, Phil Blunsom

Bayesian dark knowledge
Anoop Korattikara, Vivek Rathod, Kevin Murphy, Max Welling

Generalization in Adaptive Data Analysis and Holdout Reuse
Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold, Aaron Roth

Semi-supervised Sequence Learning
Andrew Dai, Quoc Le

Natural Neural Networks
Guillaume Desjardins, Karen Simonyan, Razvan Pascanu, Koray Kavukcuoglu

Revenue Optimization against Strategic Buyers
Andres Munoz Medina, Mehryar Mohri


WORKSHOPS
Feature Extraction: Modern Questions and Challenges
Workshop Chairs include: Dmitry Storcheus, Afshin Rostamizadeh, Sanjiv Kumar
Program Committee includes: Jeffery Pennington, Vikas Sindhwani

NIPS Time Series Workshop
Invited Speakers include: Mehryar Mohri
Panelists include: Corinna Cortes

Nonparametric Methods for Large Scale Representation Learning
Invited Speakers include: Amr Ahmed

Machine Learning for Spoken Language Understanding and Interaction
Invited Speakers include: Larry Heck

Adaptive Data Analysis
Organizers include: Moritz Hardt

Deep Reinforcement Learning
Organizers include : David Silver
Invited Speakers include: Sergey Levine

Advances in Approximate Bayesian Inference
Organizers include : Shakir Mohamed
Panelists include: Danilo Rezende

Cognitive Computation: Integrating Neural and Symbolic Approaches
Invited Speakers include: Ramanathan V. Guha, Geoffrey Hinton, Greg Wayne

Transfer and Multi-Task Learning: Trends and New Perspectives
Invited Speakers include: Mehryar Mohri
Poster presentations include: Andres Munoz Medina

Learning and privacy with incomplete data and weak supervision
Organizers include : Felix Yu
Program Committee includes: Alexander Blocker, Krzysztof Choromanski, Sanjiv Kumar
Speakers include: Nando de Freitas

Black Box Learning and Inference
Organizers include : Ali Eslami
Keynotes include: Geoff Hinton

Quantum Machine Learning
Invited Speakers include: Hartmut Neven

Bayesian Nonparametrics: The Next Generation
Invited Speakers include: Amr Ahmed

Bayesian Optimization: Scalability and Flexibility
Organizers include: Nando de Freitas

Reasoning, Attention, Memory (RAM)
Invited speakers include: Alex Graves, Ilya Sutskever

Extreme Classification 2015: Multi-class and Multi-label Learning in Extremely Large Label Spaces
Panelists include: Mehryar Mohri, Samy Bengio
Invited speakers include: Samy Bengio

Machine Learning Systems
Invited speakers include: Jeff Dean


SYMPOSIA
Brains, Mind and Machines
Invited Speakers include: Geoffrey Hinton, Demis Hassabis

Deep Learning Symposium
Program Committee Members include: Samy Bengio, Phil Blunsom, Nando De Freitas, Ilya Sutskever, Andrew Zisserman
Invited Speakers include: Max Jaderberg, Sergey Ioffe, Alexander Graves

Algorithms Among Us: The Societal Impacts of Machine Learning
Panelists include: Shane Legg


TUTORIALS
NIPS 2015 Deep Learning Tutorial
Geoffrey E. Hinton, Yoshua Bengio, Yann LeCun

Large-Scale Distributed Systems for Training Neural Networks
Jeff Dean, Oriol Vinyals
Read More..

Academics and the Little Box Challenge




Think shrink! Min it to win it! Smaller is baller! Thats what the Little Box Challenge is all about: developing a high power density inverter. It’s a competition presented by Google and the Institute of Electrical and Electronics Engineers Power Electronics Society (IEEE PELS) -- not only a grand engineering challenge, but your chance to make a big impact on the future of renewables and electricity.

With the rise of solar photovoltaic panels, electric vehicles (EV) and large format batteries, we’ve seen a resurgence in the over-a-century-long feud between Thomas Edison’s direct current (DC) and Nikola Tesla’s alternating current (AC). The electric grid and most higher power household and commercial devices use AC; batteries, photovoltaics, and electric vehicles work in DC. So the power electronics that convert between the two -- rectifiers (AC->DC), and inverters (DC->AC) -- are also gaining increased prominence, as well as the DC/DC and AC/AC converters that switch between different voltages or frequencies.

While different flavors of these devices have been around for well over a century, some of them are starting to show their age and limitations versus newer technologies. For example, conventional string inverters have power densities around 0.5-3 Watts/Inch3, and microinverters around 5 Watts/Inch3 -- but lithium ion batteries can now get 4-10 Watt Hours/Inch3. So for a 1-2 hour battery pack, your inverter could end up being bigger than your battery -- a lot to carry around.

Some recent advances may change what’s possible in power electronics. For example, Wide-bandgap (WBG) semiconductors -- such as gallium-nitride (GaN) and silicon-carbide (SiC) -- not only enable higher power densities than conventional silicon-based devices do, but can also convert between DC and AC at higher temperatures, using higher switching frequencies, and with greater efficiency.

But even WBG materials and other new technologies for power electronics run into limits on the power density of inverters. Photovoltaic power and batteries suffer when they see oscillations on their power output and thus require some form of energy storage -- electrolytic capacitors store that energy and bridge the power differential between the DC input and the AC output, but that makes the devices much larger. Household and consumer devices also need to add filters to prevent electromagnetic interference, so that’s even more bulk.

When it comes to shrinking these devices, inverters may have the most potential. And because inverters are so common in household applications, we hope The Little Box Challenge may lead to improvements not only in power density, but also in reliability, efficiency, safety, and cost. Furthermore, it is our hope that some of these advances can also improve the other types of power electronics listed above. If these devices can be made very small, reliable and inexpensive, we could see all kinds of useful applications to the electric grid, consumer devices and beyond, maybe including some we have yet to imagine.

To recognize the role academics have played in pushing the forefront of new technologies, Google has taken a couple of special steps to help them participate:

  • Research at Google will provide unrestricted gifts to to academics pursuing the prize. This funding can be used for research equipment and to support students. Visit the Little Box Challenge awards for academics page for more info -- proposals are due September 30, 2014.
  • Academics often have trouble getting the latest technology from device manufacturers to tinker on. So Google has reached out to a number of WBG manufacturers who’ve put up dedicated pages detailing their devices. Check out the Little Box Challenge site to get started.

We hope you’ll consider entering, and please tell your colleagues, professors, students and dreamers -- you can print and post these posters on your campus to spread the word.
Read More..

Enable DMA in Windows XP Vista and Windows 7 to speed up the system

Direct memory access (DMA) is a feature of modern computers and microprocessors that allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit.
DMA is used for transferring data between the local memory and the main memory. Computers that have DMA channels can transfer data to and from devices with much less CPU overhead than computers without a DMA channel.

This is especially useful in real-time computing applications where not stalling behind concurrent operations is critical. Another and related application area is various forms of stream processing where it is essential to have data processing and transfer in parallel, in order to achieve sufficient throughput.
Now, know how to Enable Direct Memory Access (DMA) in order to speed up your system.

You must be logged on as an administrator to perform these steps.

Direct memory access (DMA) is usually turned on by default for devices such as hard disks and CD or DVD drives that support DMA. However, you might need to turn on DMA manually if the device was improperly installed or if a system error occurred. Perform the following steps to do this.

First Open Device Manager.
  • Right-click on My Computer, select Properties
  • Select the Hardware tab
  • Click the Device Manager button
For Windows XP
  1. Double-click IDE/ATAPI controllers
  2. Double-click on the Primary IDE Channel
  3. Click on the Advanced Settings tab (as shown in figure) The tab may or may not be available for each option. It is only available in Primary and Secondary Channels.
  4. Set the Transfer Mode to "DMA if Available" both for Device 1 and 0
  5. Click OK
  6. Perform the same operation for other items in the list, if applicable.
For Windows Vista and Windows 7
  1. In the left pane, click the plus sign next to IDE ATA/ATAPI controllers to expand it.
  2. For each icon that has the word Channel as part of its label, right-click the icon, and then click Properties.
  3. Click the Advanced Settings tab, and then, under Device Properties, select the Enable DMA check box.
  4. Click OK.
Read More..

Four years of Schema org Recent Progress and Looking Forward



In 2011, we announced schema.org, a new initiative from Google, Bing and Yahoo! to create and support a common vocabulary for structured data markup on web pages. Since that time, schema.org has been a resource for webmasters looking to add markup to their pages so that search engines can use that data to index content better and surface it in new experiences like rich snippets, GMail, and the Google App.

Schema.org, which provides a growing vocabulary for describing various kinds of entity in terms of properties and relationships, has become increasingly important as the Web transitions to a multi-device, mobile-oriented world. We are now seeing schema.org being used on many millions of Web sites, defining data types and properties common across applications, platforms and products, in order to enhance the user experience by delivering the most relevant information they need, when they need it.
Schema.org in Google Rich Snippets
Schema.org in Google Knowledge Graph panels
Schema.org in Recipe carousels
In Schema.org: Evolution of Structured Data on the Web, an overview article published this week on ACM, we report some key schema.org adoption metrics from a sample of 10 billion pages from a combination of the Google index and Web Data Commons. In this sample, 31.3% of pages have schema.org markup, up from 22% one year ago. Structured data markup is now a core part of the modern web.

The schema.org group at W3C is now amongst the largest active W3C communities, serving as a hub for diverse groups exploring schemas covering diverse topics such as sports, healthcare, e-commerce, food packaging, bibliography and digital archive management. Other companies, also make use of the same data to build different applications, and as new use cases arise further schemas are integrated via community discussion at W3C. Each of these topics in turn have subtle inter-relationships - for example schemas for food packaging, for flight reservations, for recipes and for restaurant menus, each have different approaches to describing food restrictions and allergies. Rather than try to force a common unified approach across these domains, schema.orgs evolution is pragmatic, driven by the combination of available Web data, and the likelihood of mainstream consuming applications.

Schema.org is also finding new kinds of uses. One exciting line of work is the use of schema.org marked up pages as training corpus for machine learning. John Foley, Michael Bendersky and Vanja Josifovski used schema.org data to build a system that can learn to recognize events that may be geographically local to a particular user. Other researchers are looking at using schema.org pages with similar markup, but in different languages, to automatically create parallel corpora for machine translation.

Four years after its launch, Schema.org is entering its next phase, with more of the vocabulary development taking place in a more distributed fashion, as extensions. As schema.org adoption has grown, a number groups with more specialized vocabularies have expressed interest in extending schema.org with their terms. Examples of this include real estate, product, finance, medical and bibliographic information. A number of extensions, for topics ranging from automobiles to product details, are already underway. In such a model, schema.org itself is just the core, providing a unifying vocabulary and congregation forum as necessary.
Read More..

How to hack BIOS password in Desktop and Laptop

Bios password Hack
The following steps to hack BIOS password work absolutely fine for a Desktop and are the easiest of all.
Steps:
  • Shut down the computer and take out all the plugs connected to electricity.
  • Open up the CPU cabinet and locate the CMOS battery on the motherboard (it will be a silver circular battery just like a button cell).
  • Remove the battery and keep it out for some 2-3 minutes as this will flush out the CMOS memory which stores the BIOS password and all other configurations.
  • Now place the battery back and start the computer normally.

Steps for Laptop:
  • Open up the BIOS at the time of booting.
  • There are some backdoor passwords which the manufacturing company had set that will be accepted by the BIOS. You will just need to know the make of your BIOS.Try out the passwords from these lists.
List of Award BIOS backdoor passwords:
  • BIOSTAR, AWARD_SW, AWARD SW, AWARD PW, CONDO, LKWPETER, J262, 01322222
  • List of AMI BIOS backdoor passwords:
  • AMI, AAAMMMIII, BIOS, PASSWORD, A.M.I., CONDO
  • List of PHOENIX BIOS backdoor passwords:
  • phoenix, PHOENIX, CMOS, BIOS
you can also try this utility CmosPwd 4.8

Note: Read Disclaimer before use.
Read More..

Google voice search faster and more accurate



Back in 2012, we announced that Google voice search had taken a new turn by adopting Deep Neural Networks (DNNs) as the core technology used to model the sounds of a language. These replaced the 30-year old standard in the industry: the Gaussian Mixture Model (GMM). DNNs were better able to assess which sound a user is producing at every instant in time, and with this they delivered greatly increased speech recognition accuracy.

Today, we’re happy to announce we built even better neural network acoustic models using Connectionist Temporal Classification (CTC) and sequence discriminative training techniques. These models are a special extension of recurrent neural networks (RNNs) that are more accurate, especially in noisy environments, and they are blazingly fast!

In a traditional speech recognizer, the waveform spoken by a user is split into small consecutive slices or “frames” of 10 milliseconds of audio. Each frame is analyzed for its frequency content, and the resulting feature vector is passed through an acoustic model such as a DNN that outputs a probability distribution over all the phonemes (sounds) in the model. A Hidden Markov Model (HMM) helps to impose some temporal structure on this sequence of probability distributions. This is then combined with other knowledge sources such as a Pronunciation Model that links sequences of sounds to valid words in the target language and a Language Model that expresses how likely given word sequences are in that language. The recognizer then reconciles all this information to determine the sentence the user is speaking. If the user speaks the word “museum” for example - /m j u z i @ m/ in phonetic notation - it may be hard to tell where the /j/ sound ends and where the /u/ starts, but in truth the recognizer doesn’t care where exactly that transition happens: All it cares about is that these sounds were spoken.

Our improved acoustic models rely on Recurrent Neural Networks (RNN). RNNs have feedback loops in their topology, allowing them to model temporal dependencies: when the user speaks /u/ in the previous example, their articulatory apparatus is coming from a /j/ sound and from an /m/ sound before. Try saying it out loud - “museum” - it flows very naturally in one breath, and RNNs can capture that. The type of RNN used here is a Long Short-Term Memory (LSTM) RNN which, through memory cells and a sophisticated gating mechanism, memorizes information better than other RNNs. Adopting such models already improved the quality of our recognizer significantly.

The next step was to train the models to recognize phonemes in an utterance without requiring them to make a prediction for each time instant. With Connectionist Temporal Classification, the models are trained to output a sequence of “spikes” that reveals the sequence of sounds in the waveform. They can do this in any way as long as the sequence is correct.

The tricky part though was how to make this happen in real-time. After many iterations, we managed to train streaming, unidirectional, models that consume the incoming audio in larger chunks than conventional models, but do actual computations less often. With this, we drastically reduced computations and made the recognizer much faster. We also added artificial noise and reverberation to the training data, making the recognizer more robust to ambient noise. You can watch a model learning a sentence here.

We now had a faster and more accurate acoustic model and were excited to launch it on real voice traffic. However, we had to solve another problem - the model was delaying its phoneme predictions by about 300 milliseconds: it had just learned it could make better predictions by listening further ahead in the speech signal! This was smart, but it would mean extra latency for our users, which was not acceptable. We solved this problem by training the model to output phoneme predictions much closer to the ground-truth timing of the speech.
The CTC recognizer outputs spikes as it identifies various phonetic units (in various colors) in the input speech signal. The x-axis shows the acoustic input timing for phonemes and y-axis shows the posterior probabilities as predicted by the neural network. The dotted line shows where the model chooses not to output a phoneme.
We are happy to announce that our new acoustic models are now used for voice searches and commands in the Google app (on Android and iOS), and for dictation on Android devices. In addition to requiring much lower computational resources, the new models are more accurate, robust to noise, and faster to respond to voice search queries - so give it a try, and happy (voice) searching!
Read More..

Using the Raspberry Pi as a Web Server Media Server and Torrent Box

So youve set your Raspberry Pi up.
If not you might want to check out this page first.
So now you want to set your Raspberry Pi up as a media/web/everything else server.

Before any of these, make sure your raspberry pi ip address is static. You can set this by opening up a terminal and typing in:
sudo nano /etc/network/interfaces

(Feel free to use gedit or vim or whatever you want. I like vim)
You should now be looking at a file. Change the line:
iface eth0 inet dhcp
To:
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.254

where the gateway is your router and the address is the ip address you want. Save the file and reboot (sudo reboot) and now your ip should be static.

Luckily, SSH is already enabled on the Raspbian image so we wont go into that. However, if you want to SSH externally, you should install something like SSHGuard for protection and then in your router config redirect port 22 traffic to your Raspberry Pi.


Section 1: Webserver

Installing apache is easy. Just open a terminal and type:
sudo apt-get install apache2

This will set up a webserver for you with the files at /var/www being your web directory. Modify those files how you feel like and if you want to make it publicly accessible then configure your router to forward port 80 to your raspberry pis ip address.

Section 2: VNC

This is an optional thing since you can port X over SSH. But if you want vnc. All you have to do is open up a terminal and type:
sudo apt-get install tightvncserver

When it is finished installing it should ask for a password. If it doesnt or you need to change it. Just type vncpasswd to reset it.
Then type tightvncserver and a new instance will start. You can kill it by typing tightvncserver -kill :1

To use this externally, you will have to open up port 5801 (for the first instance, 5802 for the second, etc.)

Section 3: Media Server

Start off by mounting all of your external HDDs. If you have a Raid array that is great, if not, I have a handy little hack for you.
edit fstab by opening up a terminal and typing:
sudo nano /etc/fstab
Add each hard drive to the file, mine looks like this:
/dev/sda1 /media/Kingsley ntfs-3g defaults 0 0
/dev/sdb1 /media/HarvardMulligan ntfs-3g defaults 0 0
/dev/sdc1 /media/Moloch ntfs-3g defaults 0 0

(Make sure the folders in /media exist and their permissions are set properly with chmod, otherwise this wont work)

You really should set up a RAID array or something, but lets say you like to live by the seat of your pants and dont care if one of your HDDs fail and you want to access them all at the same time in one convenient directory. To do this you can use mhddfs. Install it by typing:
sudo apt-get install mhddfs

When its done installing, open fstab back up and after the lines with your HDD, type in something like what is shown below:
mhddfs#/media/Kingsley,/media/HarvardMulligan,/media/Moloch /media/ALLOFIT fuse defaults,allow_other 0 0

So my final fstab file has this at the bottom:
/dev/sda1 /media/Kingsley ntfs-3g defaults 0 0
/dev/sdb1 /media/HarvardMulligan ntfs-3g defaults 0 0
/dev/sdc1 /media/Moloch ntfs-3g defaults 0 0
mhddfs#/media/Kingsley,/media/HarvardMulligan,/media/Moloch /media/ALLOFIT fuse defaults,allow_other 0 0





where mhddfs mounts all of the drives to /media/ALLOFIT (which I previously created and set permissions for) and I can write to that and mhddfs will figure out where to put it for me.
Now just sudo reboot

Interesting tidbit: You can use sshfs (their is a Windows version call win-sshfs) to access these drives securely through ssh. This way you dont have to worry about Samba and you can access these files graphically using the internet.

Section 4: Torrent Box

So now you want to be able to torrent (lets assume completely legally) things directly to your server/external HDDs.
Simply install transmission by opening up a terminal and typing
sudo apt-get install transmission-daemon

Now we need to edit some settings, stop the daemon and open up the settings file by typing:
sudo service transmission-daemon stop
and
sudo nano /etc/transmission-daemon/settings.json

You will need to change a couple of settings.
Change your download directory to where you want your downloads, I use my external HDDs:  "download-dir": "/media/ALLOFIT",
Now to set up some security. Change the following text requires the ""s but numbers and true/false dont:
"rpc-authentication-required": true,
"rpc-enabled": true,
"rpc-password": "YourPasswordHere",
"rpc-port": 6669,
"rpc-username": "YourUserNameHere",

You can change the port to anything but its probably a good idea to change it from the default to avoid brute force script kiddies.
Now start the daemon back up by typing
sudo service transmission-daemon start

Now open up a webbrowser on any computer in your network and type in your raspberry pis ip address followed by :port. Ex: 192.168.1.10:6691
If you want to access this externally, just forward the port you chose to your raspberry pi ip address in your router config.

Now you are done.

To use transmission to its fullest potential and automatically download media:
http://stevenhickson.blogspot.com/2013/03/automatically-downloading-torrents-with.html


Check out my other Raspberry Pi Fixes/How tos:
http://stevenhickson.blogspot.com/2012/08/setting-up-omxplayer-gui-on-raspberry-pi.html
http://stevenhickson.blogspot.com/2012/10/fixing-raspberry-pi-crashes.html

Consider donating to further my tinkering.


Places you can find me
Read More..

From the Mouse to the Smartphone and Beyond

Its that time of the year again, as the nights draw in the free public Gibbons Lectures in Auckland take place. The first lecture is this Thursday the 30th at 6:00pm for a 6:30pm start. Every year the lecture series has a theme and this year its human computer interaction. The first lecture is by Professor Mark Apperley and titled From the Mouse to the Smartphone and Beyond: tracing the development of human-computer interaction. Click the lecture link for full venue details and if you cant attend the lecture will be streamed live and after the event.

from The Universal Machine http://universal-machine.blogspot.com/

IFTTT

Put the internet to work for you.

Delete or edit this Recipe

Read More..

Moore’s Law Part 3 Possible extrapolations over the next 15 years and impact



This is the third entry of a series focused on Moore’s Law and its implications moving forward, edited from a White paper on Moore’s Law, written by Google University Relations Manager Michel Benard. This series quotes major sources about Moore’s Law and explores how they believe Moore’s Law will likely continue over the course of the next several years. We will also explore if there are fields other than digital electronics that either have an emerging Moores Law situation, or promises for such a Law that would drive their future performance.

--

More Moore
We examine data from the ITRS 2012 Overall Roadmap Technology Characteristics (ORTC 2012), and select notable interpolations; The chart below shows chip size trends up to the year 2026 along with the “Average Moore’s Law” line. Additionally, in the ORTC 2011 tables we find data on 3D chip layer increases (up to 128 layers), including costs. Finally, the ORTC 2011 index sheet estimates that the DRAM cost per bit at production will be ~0.002 microcents per bit by ~2025. From these sources we draw three More Moore (MM) extrapolations, that by the year 2025:

  • 4Tb Flash multi-level cell (MLC) memory will be in production
  • There will be ~100 billion transistors per microprocessing unit (MPU)
  • 1TB RAM Memory will cost less than $100


More than Moore
It should be emphasized that “More than Moore” (MtM) technologies do not constitute an alternative or even a competitor to the digital trend as described by Moore’s Law. In fact, it is the heterogeneous integration of digital and non-digital functionalities into compact systems that will be the key driver for a wide variety of application fields. Whereas MM may be viewed as the brain of an intelligent compact system, MtM refers to its capabilities to interact with the outside world and the users.

As such, functional diversification may be regarded as a complement of digital signal and data processing in a product. This includes the interaction with the outside world through sensors and actuators and the subsystem for powering the product, implying analog and mixed signal processing, the incorporation of passive and/or high-voltage components, micro-mechanical devices enabling biological functionalities, and more. While MtM looks very promising for a variety of diversification topics, the ITRS study does not give figures from which “solid” extrapolations can be made. However, we can make safe/not so safe bets going towards 2025, and examine what these extrapolations mean in terms of the user.

Today we have a 1TB hard disk drives (HDD) for $100, but the access speed to data on the disk does not allow to take full advantage of this data in a fully interactive, or even practical, way. More importantly, the size and construction of HDD does not allow for their incorporation into mobile devices, Solid state drives (SSD), in comparison, have similar data transfer rates (~1Gb/s), latencies typically 100 times less than HDD, and have a significantly smaller form factor with no moving parts. The promise of offering several TB of flash memory, cost effectively by 2025, in a device carried along during the day (e.g. smartphone, watch, clothing, etc.) represents a paradigm shift with regard of today’s situation; it will empower the user by moving him/her from an environment where local data needs to be refreshed frequently (as with augmented reality applications) to a new environment where full contextual data will be available locally and refreshed only when critically needed.

If data is pre-loaded in the order of magnitude of TBs, one will be able to get a complete contextual data set loaded before an action or a movement, and the device will dispatch its local intelligence to the user during the progress of the action, regardless of network availability or performance. This opens up the possibility of combining local 3D models and remote inputs, allowing applications like 3D conferencing to become available. The development and use of 3D avatars could even facilitate many social interaction models. To benefit from such applications the use of personal devices such as Google Glass may become pervasive, allowing users to navigate 3D scenes and environments naturally, as well as facilitating 3D conferencing and their “social” interactions.

The opportunities for more discourse on the impact and future of Moore’s Law on CS and other disciplines are abundant, and can be continued with your comments on the Research at Google Google+ page. Please join, and share your thoughts.
Read More..

Google Award Program stimulates Journalism and CS collaboration



Last fall, Google invited academic researchers to participate in a Computational Journalism awards program focused on the intersection of Computer Science and Journalism. We solicited proposals for original research projects relevant to today’s fast evolving news industry.

As technology continues to shape and be shaped by the media landscape, applicants were asked to rethink traditional models and roles in the ecosystem, and reimagine the lifecycle of the news story in the online world. We encouraged them to develop innovative tools and open source software that could benefit readers and be game-changers for reporters and publishers. Each award includes funding of $60,000 in cash and $20,000 in computing credits on Google’s Cloud Platform.

We congratulate the recipients of these awards, whose projects are described below, and look forward to the results of their research. Stay tuned for updates on their progress.

Larry Birnbaum, Professor of Electrical Engineering and Computer Science, and Journalism, Northwestern University
Project: Thematic Characterization of News Stories
This project aims to develop computational methods for identifying abstract themes or "angles" in news stories, e.g., seeing a story as an instance of "pulling yourself up by your bootstraps," or as a "David vs. Goliath" story. In collaboration with journalism and computer science students, we will develop applications utilizing these methods in the creation, distribution, and consumption of news content.

Irfan Essa, Professor, Georgia Institute of Technology
Project: Tracing Reuse in Political Language
Our goal in this project is to research, and then develop a data-mining tool that allows an online researcher to find and trace language reuse. By language reuse, we specifically mean: Can we find if in a current text some language was used that can be traced back to some other text or script. The technical innovation in this project is aimed at (1) identifying linguistic reuse in documents as well as other forms of material, which can be converted to text, and therefore includes political speeches and videos. Another innovation will be in (2) how linguistic reuse can be traced through the web and online social networks.

Susan McGregor, Assistant Director, Tow Center for Digital Journalism, Columbia Journalism School
Project: InfoScribe
InfoScribe is a collaborative web platform that lets citizens participate in investigative journalism projects by digitizing select data from scanned document sets uploaded by journalists. One of InfoScribes primary research goals is to explore how community participation in journalistic activities can help improve their accuracy, transparency and impact. Additionally, InfoScribe seeks to build and expand upon understandings of how computer vision and statistical inference can be most efficiently combined with human effort in the completion of complex tasks.

Paul Resnick, Professor, University of Michigan School of Information
Project: RumorLens
RumorLens is a tool that will aid journalists in finding posts that spread or correct a particular rumor on Twitter, by exploring the size of the audiences that those posts have reached. In the collection phase, the user provides one or a few exemplar tweets and then manually classifies a few hundred others as spreading the rumor, correcting it, or labeling it as unrelated. This enables automatic retrieval and classification of remaining tweets, which are then presented in an interactive visualization that shows audience sizes.

Ryan Thornburg, Associate Professor, School of Journalism and Mass Communication, University of North Carolina at Chapel Hill
Project: Public Records Dashboard for Small Newsrooms
Building off our Knight News Challenge effort to bring data-driven journalism to readers of rural newspaper websites, we are developing an internal newsroom tool that will alert reporters and editors to potential story tips found in public data. Our project aims to lower the cost of finding in public data sets stories that shine light in dark places, hold powerful people accountable, and explain our increasingly complex and interconnected world. (Public facing site for the data acquisition element of the project at http://open-nc.org)
Read More..

Cool HD Holiday and Blue Winter Nature Wallpaper Download

winter house scenearywinter lake wallpaperwinter valley



winter wallpaperblue winter wallpaperwinter desktop wallpaper



winter desktop wallpapercool winter beachwinter holiday wallpaper



winter island for holidayblue holiday wallpaperisland holiday wallpaper



cool beach wallpaperholiday wallpapercool holiday seashore



blue sky holiday wallpaperspain holiday poolwinter ice



cool blue sea wallpaperWinter wallpaperwinter snow house
Read More..

PPT on CDMA technology and components

This post includes a PPT on CDMA technology.

PPT on CDMA technology and components
Some points in the ppt file are listed below:

Upon completion of this course, you will have an understanding of the following concepts:
  • CDMA and other access technologies
  • CDMA coding, forward, and reverse channels
  • Vocoding, multiplexing, and power control
  • Components that comprise a CDMA system
  • CDMA messaging and call flow

Why CDMA?
  • CDMA is the technology of choice for both 800 MHz Cellular and 1900 MHz PCS service providers
  • CDMA satisfies CTIA Users’ Performance Requirements
  • CDMA provides high capacity (many times the capacity of AMPS)
  • CDMA provides privacy through its coding scheme

Click to download the PPT file:

Submitted by: Kaushal Gupta
Read More..

Safely Eject USB device and prevent malfunctioning

Safely Eject USB device and prevent malfunctioning
Many a times we face a problem while ejecting any USB device. The system displays "Device cannot be removed...bla..bla.." or sometimes the USB device doesnt get detected and the icon is not displayed on the system tray. Even there is no icon in Device Manager Window. Such this happen very often. At these times this software comes handy.

USB Safely Remove :
  • This helps in safely removing the USB device so that next time if you connect it, it doesnot come up with any problem.
  • It ensures the safety of data you are copying from or to the USB device.
  • The software gives full contol over the USB device.
  • USB device can be stopped with a single click.

Download

You can also read this post to solve your problem.
Fix the Problem Ejecting USB Mass Storage Device error.
Read More..

Voicecommand Update and Fix for Google Speech v2 0

Sorry it took so long for this. Googles deprecation of the Speech v1.0 api came at the worst possible time for me as it was right before I started driving across the country.

I didnt get to fix it yesterday when I got into San Francisco either because I ended up going to Maker Faire and then hung out at a bar with all the Hackaday people. I met the guy who invented sudo and figured out I have the same watch as Mike Szczys.

Anyways, Ive fixed voicecommand to work again and I fixed a couple of small bugs, including one in the install script which didnt copy the voicecommand config properly.

To get the fix, just run the update script (or reinstall if you are having config file issues).
I detailed how to update here:
http://stevenhickson.blogspot.com/2013/06/installing-and-updating-piauisuite-and.html

Heres a picture from Maker Faire for your trouble!



Consider donating to further my tinkering since I do all this and help people out for free.



Places you can find me
Read More..

Trick to Speed Up Windows 7 and Vista Boot Up

Speed Up Windows 7 and Vista Boot Up
There are many ways to decrease booting time and speed up start, such as using third party programs such as Startup Manager to manage programs running automatically. Windows 7 and Windows Vista users running dual-core, quad-core or other multi-core or multi-processors computer can try the following trick to make Windows boots faster.
  • Press Win + R to open “Run” dialog window
  • Type MSConfig into the text box after “Open”.
  • Go to Boot tab.
  • For dual-boot or multi-boot system, make sure that the operating system to make the change is selected.
  • Click on Advanced options button.Speed Up Windows 7 and Vista Boot Up
  • Tick the check box for Number of processors, and then select the maximum number count of CPU core processors value from the drop down list.
  • Click OK twice to exit System Configuration.
  • Restart computer.
Once enabled, Windows operating system will use all available (or selected number of) processor cores to run the boot up algorithms, and this potentially make the startup speedier and faster, with less waiting time on black screen and logon screen. User with single core computer unlikely to find the trick useful though.
Read More..

Collection of SQL queries with Answer and Output Set 3

Here is a collection or a list of 38 SQL Queries with Answers as well as output. You can write your answer at the text box below each query any time you can see the table structure by clicking on Table Structure. And check your Answer by clicking on Answer. You can test your Skill in SQL. You can also go for an online Quiz in SQL in one of my previous posts: Click here for Quiz. More queries will be added to this post within few days, visit again!!!

Happy learning!!!
Carry on....
You can also share your queries in this site. Use this Link to share your part with the visitors like you.

SQL Query collection: Set1 Set2 Set3 Set 4


Below is the Table Structure using which you have to form the queries:


1) Who is the highest paid C programmer?

Table Structure

Answer
SELECT * FROM PROGRAMMER
WHERE SALARY=(SELECT MAX(SALARY)
FROM PROGRAMMER
WHERE PROF1 LIKE C OR PROF2 LIKE C)




2) Who is the highest paid female cobol programmer?

Table Structure

Answer
SELECT * FROM PROGRAMMER
WHERE SALARY=(SELECT MAX(SALARY)
FROM PROGRAMMER
WHERE (PROF1 LIKE COBOL OR PROF2 LIKE COBOL))
AND SEX LIKE F




3) Display the name of the HIGEST paid programmer for EACH language (prof1)

Table Structure

Answer
SELECT DISTINCT NAME, SALARY, PROF1
FROM PROGRAMMER
WHERE (SALARY,PROF1) IN (SELECT MAX(SALARY),PROF1
FROM PROGRAMMER
GROUP BY PROF1)




4) Who is the LEAST experienced programmer?

Table Structure

Answer
SELECT FLOOR((SYSDATE-DOJ)/365) EXP,NAME
FROM PROGRAMMER
WHERE FLOOR((SYSDATE-DOJ)/365) = (SELECT MIN(FLOOR((SYSDATE-DOJ)/365))
FROM PROGRAMMER)





5) Who is the MOST experienced programmer?

Table Structure

Answer
SELECT FLOOR((SYSDATE-DOJ)/365) EXP,NAME,PROF1,PROF2
FROM PROGRAMMER
WHERE FLOOR((SYSDATE-DOJ)/365) = (SELECT MAX(FLOOR((SYSDATE-DOJ)/365))
FROM PROGRAMMER)
AND (PROF1 LIKE COBOL OR PROF2 LIKE COBOL)




6) Which language is known by ONLY ONE programmer?

Table Structure

Answer
SELECT PROF1
FROM PROGRAMMER
GROUP BY PROF1
HAVING PROF1 NOT IN
(SELECT PROF2 FROM PROGRAMMER)
AND COUNT(PROF1)=1
UNION
SELECT PROF2
FROM PROGRAMMER
GROUP BY PROF2
HAVING PROF2 NOT IN
(SELECT PROF1 FROM PROGRAMMER)
AND COUNT(PROF2)=1;




7) Who is the YONGEST programmer knowing DBASE?

Table Structure

Answer
SELECT FLOOR((SYSDATE-DOB)/365) AGE, NAME, PROF1, PROF2
FROM PROGRAMMER
WHERE FLOOR((SYSDATE-DOB)/365) = (SELECT MIN(FLOOR((SYSDATE-DOB)/365))
FROM PROGRAMMER
WHERE PROF1 LIKE DBASE OR PROF2 LIKE DBASE)



8) Which institute has MOST NUMBER of students?

Table Structure

Answer
SELECT SPLACE
FROM STUDIES
GROUP BY SPLACE
HAVING COUNT(SPLACE)= (SELECT MAX(COUNT(SPLACE))
FROM STUDIES GROUP BY SPLACE)





9) Who is the above programmer?

Table Structure

Answer
SELECT NAME
FROM PROGRAMMER
WHERE PROF1 IN (SELECT PROF1
FROM PROGRAMMER
GROUP BY PROF1
HAVING PROF1 NOT IN (SELECT PROF2 FROM PROGRAMMER)
AND COUNT(PROF1)=1
UNION
SELECT PROF2
FROM PROGRAMMER
GROUP BY PROF2
HAVING PROF2 NOT IN (SELECT PROF1 FROM PROGRAMMER)
AND COUNT(PROF2)=1))
UNION
SELECT NAME
FROM PROGRAMMER
WHERE PROF2 IN (SELECT PROF1
FROM PROGRAMMER
GROUP BY PROF1
HAVING PROF1 NOT IN (SELECT PROF2 FROM PROGRAMMER)
AND COUNT(PROF1)=1
UNION
SELECT PROF2
FROM PROGRAMMER
GROUP BY PROF2
HAVING PROF2 NOT IN (SELECT PROF1 FROM PROGRAMMER)
AND COUNT(PROF2)=1))




10) Which female programmer earns MORE than 3000/- but DOES NOT know C, C++, Oracle or Dbase?

Table Structure

Answer
SELECT * FROM PROGRAMMER
WHERE SEX LIKE F
AND SALARY >3000
AND (PROF1 NOT IN(C,C++,ORACLE,DBASE)
OR PROF2 NOT IN(C,C++,ORACLE,DBASE))




11) Which is the COSTLIEST course?

Table Structure

Answer
SELECT COURSE
FROM STUDIES
WHERE CCOST = (SELECT MAX(CCOST) FROM STUDIES)




12) Which course has been done by MOST of the students?

Table Structure

Answer
SELECT COURSE
FROM STUDIES
GROUP BY COURSE
HAVING COUNT(COURSE)= (SELECT MAX(COUNT(COURSE))
FROM STUDIES
GROUP BY COURSE)




13) Display name of the institute and course Which has below AVERAGE course fee?

Table Structure

Answer
SELECT SPLACE,COURSE
FROM STUDIES
WHERE CCOST < (SELECT AVG(CCOST) FROM STUDIES)





14) Which institute conducts COSTLIEST course?

Table Structure

Answer
SELECT SPLACE
FROM STUDIES
WHERE CCOST = (SELECT MAX(CCOST) FROM STUDIES)



15) Which course has below AVERAGE number of students?

Table Structure

Answer
SELECT COURSE
FROM STUDIES
HAVING COUNT(NAME)<(SELECT AVG(COUNT(NAME))
FROM STUDIES
GROUP BY COURSE)
GROUP BY COURSE;




16) Which institute conducts the above course?

Table Structure

Answer
SELECT SPLACE
FROM STUDIES
WHERE COURSE IN (SELECT COURSE
FROM STUDIES
HAVING COUNT(NAME) < (SELECT AVG(COUNT(NAME))
FROM STUDIES
GROUP BY COURSE)
GROUP BY COURSE);




17) Display names of the course WHOSE fees are within 1000(+ or -) of the AVERAGE fee.

Table Structure

Answer
SELECT COURSE
FROM STUDIES
WHERE CCOST < (SELECT AVG(CCOST)+1000 FROM STUDIES)
AND CCOST > (SELECT AVG(CCOST)-1000 FROM STUDIES)




18) Which package has the HIGEST development cost?

Table Structure

Answer
SELECT TITLE,DCOST
FROM SOFTWARE
WHERE DCOST = (SELECT MAX(DCOST) FROM SOFTWARE)




19) Which package has the LOWEST selling cost?

Table Structure

Answer
SELECT TITLE,SCOST
FROM SOFTWARE
WHERE SCOST = (SELECT MIN(SCOST) FROM SOFTWARE)




20) Who developed the package, which has sold the LEAST number of copies?

Table Structure

Answer
SELECT NAME,SOLD
FROM SOFTWARE
WHERE SOLD = (SELECT MIN(SOLD) FROM SOFTWARE)




21) Which language was used to develop the package WHICH has the HIGEST sales amount?

Table Structure

Answer
SELECT DEV_IN,SCOST
FROM SOFTWARE
WHERE SCOST = (SELECT MAX(SCOST) FROM SOFTWARE)




22) How many copies of the package that has the LEAST DIFFRENCE between development and selling cost were sold?

Table Structure

Answer
SELECT SOLD,TITLE
FROM SOFTWARE
WHERE TITLE = (SELECT TITLE
FROM SOFTWARE
WHERE (DCOST-SCOST)=(SELECT MIN(DCOST-SCOST) FROM SOFTWARE))




23) Which is the COSTLIEAST package developed in PASCAL?

Table Structure

Answer
SELECT TITLE
FROM SOFTWARE
WHERE DCOST = (SELECT MAX(DCOST)
FROM SOFTWARE
WHERE DEV_IN LIKE PASCAL)





24) Which language was used to develop the MOST NUMBER of package?

Table Structure

Answer
SELECT DEV_IN FROM SOFTWARE
GROUP BY DEV_IN
HAVING MAX(DEV_IN) = (SELECT MAX(DEV_IN) FROM SOFTWARE)




25) Which programmer has developed the HIGEST NUMBER of package?

Table Structure

Answer
SELECT NAME FROM SOFTWARE
GROUP BY NAME
HAVING MAX(NAME) = (SELECT MAX(NAME) FROM SOFTWARE)




26) Who is the author of the COSTLIEST package?

Table Structure

Answer
SELECT NAME,DCOST
FROM SOFTWARE
WHERE DCOST = (SELECT MAX(DCOST) FROM SOFTWARE)




27) Display names of packages WHICH have been sold LESS THAN the AVERAGE number of copies?

Table Structure

Answer
SELECT TITLE
FROM SOFTWARE
WHERE SOLD < (SELECT AVG(SOLD) FROM SOFTWARE)




28) Who are the female programmers earning MORE than the HIGEST paid male programmers?

Table Structure

Answer
SELECT NAME
FROM PROGRAMMER
WHERE SEX LIKE F
AND SALARY > (SELECT(MAX(SALARY))
FROM PROGRAMMER
WHERE SEX LIKE M)




29) Which language has been stated as prof1 by MOST of the programmers?

Table Structure

Answer
SELECT PROF1
FROM PROGRAMMER
GROUP BY PROF1
HAVING PROF1 = (SELECT MAX(PROF1)
FROM PROGRAMMER)




30) Who are the authors of packages, WHICH have recovered MORE THAN double the development cost?

Table Structure

Answer
SELECT NAME distinct
FROM SOFTWARE
WHERE SOLD*SCOST > 2*DCOST




31) Display programmer names and CHEAPEST package developed by them in EACH language?

Table Structure

Answer
SELECT NAME,TITLE
FROM SOFTWARE
WHERE DCOST IN (SELECT MIN(DCOST)
FROM SOFTWARE
GROUP BY DEV_IN)




32) Who is the YOUNGEST male programmer born in 1965?

Table Structure

Answer
SELECT NAME
FROM PROGRAMMER
WHERE DOB=(SELECT (MAX(DOB))
FROM PROGRAMMER
WHERE TO_CHAR(DOB,YYYY) LIKE 1965)




33) Display language used by EACH programmer to develop the HIGEST selling and LOWEST selling package.

Table Structure

Answer
SELECT NAME, DEV_IN
FROM SOFTWARE
WHERE SOLD IN (SELECT MAX(SOLD)
FROM SOFTWARE
GROUP BY NAME)
UNION
SELECT NAME, DEV_IN
FROM SOFTWARE
WHERE SOLD IN (SELECT MIN(SOLD)
FROM SOFTWARE
GROUP BY NAME)




34) Who is the OLDEST female programmer WHO joined in 1992

Table Structure

Answer
SELECT NAME
FROM PROGRAMMER
WHERE DOJ=(SELECT (MIN(DOJ))
FROM PROGRAMMER
WHERE TO_CHAR(DOJ,YYYY) LIKE 1992)




35) In WHICH year where the MOST NUMBER of programmer born?

Table Structure

Answer
SELECT DISTINCT TO_CHAR(DOB,YYYY)
FROM PROGRAMMER
WHERE TO_CHAR(DOJ,YYYY) = (SELECT MIN(TO_CHAR(DOJ,YYYY))
FROM PROGRAMMER)




36) In WHICH month did MOST NUMBRER of programmer join?

Table Structure

Answer
SELECT DISTINCT TO_CHAR(DOJ,MONTH)
FROM PROGRAMMER
WHERE TO_CHAR(DOJ,MON) = (SELECT MIN(TO_CHAR(DOJ,MON))
FROM PROGRAMMER)




37) In WHICH language are MOST of the programmers proficient?

Table Structure

Answer
SELECT PROF1
FROM PROGRAMMER
GROUP BY PROF1
HAVING COUNT(PROF1)=(SELECT MAX(COUNT(PROF1))
FROM PROGRAMMER
GROUP BY PROF1)
OR COUNT(PROF2)=(SELECT MAX(COUNT(PROF2))
FROM PROGRAMMER
GROUP BY PROF2)
UNION
SELECT PROF2
FROM PROGRAMMER
GROUP BY PROF2
HAVING COUNT(PROF1)=(SELECT MAX(COUNT(PROF1))
FROM PROGRAMMER
GROUP BY PROF1)
OR COUNT(PROF2)=(SELECT MAX(COUNT(PROF2))
FROM PROGRAMMER
GROUP BY PROF2)




38) Who are the male programmers earning BELOW the AVERAGE salary of female programmers?

Table Structure

Answer
SELECT NAME
FROM PROGRAMMER
WHERE SEX LIKE M
AND SALARY < (SELECT(AVG(SALARY))
FROM PROGRAMMER
WHERE SEX LIKE F)


SQL Query collection: Set1 Set2 Set3 Set 4
Read More..