Tag Archives: WWW

Why is it?

By wisecracker

Hi all…

I am an amateur coder, (and it probably shows ;o), and find that the Internet ether is a wonderful thing.

I very rarely ask for help for any coding on any platform and will try and solve a problem by approaching it with a bit of lateral thinking.

I will search the WWW and forums like this for ideas to help me…

Why is it that people still ask the same type of questions and never try and solve it for themselves, especially if these people are supposedly professionals…

the odds are that the problem these people are facing has/have already been solved almost to their needs and with a little perseverance with experimenting they would solve things for themselves.

LBNL, if they HAVE solved a problem why not give yhose solutions to sites like this for the greater good?

Maybe it is just me…

Bazza…

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Did Raimi's Oz Kill Wicked?

Some have wondered whether or not Sam Raimi’s upcoming The Wizard of Oz prequel, Oz the Great and Powerful, will effectively make the long-awaited cinematic adaptation of the Broadway hit Wicked irrelevant, for now.

The musical, which was in turn adapted from the novel of the same name, tells the life story of Oz’s iconic Wicked Witch of the West. In addition to the origins of the trickster Wizard, Raimi’s film also reveals (a version of) how the WWW came to be. So is there room for more than one version of her tale on the big screen? The answer is likely yes, particularly considering the massive popularity of the Wicked musical. It is unclear how much time will need to pass between the two films, though.

Continue reading…

…read more
Source: FULL ARTICLE at IGN Movies

Simple awk match for multiple lines

By pxalpine

Is there a simple way to use awk to match multiple lines?? Somehow using n isn’t working for me. Ultimately I’m trying to insert “WWW” 3 lines above “eee”.

input

Code:

aaa
bbb
ccc
ddd
eee
fff


output

Code:

aaa
bbb
WWW
ccc
ddd
eee
fff


Using:

Code:

awk '{a[NR]=$0;}/eee/{a[NR-3]="wwwn" a[NR-3];}END{for(i=1;i<=NR;i++)print a[i];}' file


This works, but how do I match “eee n fff” ??

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Python, Platform Independent, Pure Audio Sinewave Generator…

By wisecracker

IKHz_SW_OSX.py

A DEMO mono _pure_ sinewave generator using standard text mode Python 2.6.7 to at least 2.7.3.

This code is EASILY modifyable to Python version 3.x.x…

This DEMO kids level 1KHz generator is mainly for a MacBook Pro, (13 inch in my case), OSX 10.7.5 and above. See below…

It is a simple piece of testgear for the young amateur electronics enthusiast and uses pyaudio fully installed for it to work.

PyAudio pointer can be obtained from inside the comments in the code…

Macbook Pro hardware earphone plug modifications pointer inside the code too…

(I am not sure if the moderators will delete those lines from the code so search the WWW instead if they are…)

This was primarily for a MacBook Pro 13 inch, but works on at least 2 Linux flavours and Windows Vista 32 bit…

The sinewave generated is near excellent…

Enjoy finding simple solutions to often very difficult problems… Bazza, G0LCU…

(This was uploaded elsewhere and has had a lot of hits.)

Issued as GPL3…

Code:

# 1KHz_SW_OSX.py
#
# A mono _pure_ sinewave generator using STANDARD text mode Python 2.6.7 to at least 2.7.3.
# This DEMO kids level 1KHz generator is mainly for a MacBook Pro, (13 inch in my case), OSX 10.7.5 and above.
# It is another simple piece of testgear for the young amateur electronics enthusiast and
# uses pyaudio fully installed for it to work. Enjoy... ;o)
# PyAudio can be obtained from here:- http://people.csail.mit.edu/hubert/pyaudio/
#
# It also works on Windows Vista, 32 bit, on various machines with Python 2.6.x to 2.7.3.
# It also works on Debian 6.0.0 using Python 2.6.6 on an HP dv2036ea notebook.
# It also works on "Ubuntu 12.04, Python 2.7, Dell built-in soundcard", with many thanks to Hubert Pham, author
# of pyaudio itself, for testing...
#
# The hardware modifictions can be found here:-
# http://code.activestate.com/recipes/578282-for-macbook_pro-heads-only-simple-lf-audio-oscillo/?in=lang-python
#
# Ensure the sound is enabled and the volume is turned up. Use the volume control to vary the amplitude...
#
# Copy the file to a folder/drawer/directory of your choice as "1KHz_SW_OSX.py" without the quotes.
#
# Start the Python interpreter from a Terminal/CLI window.
#
# To run the sinewave generator, (depending upon the platform), just use at the ">>>" prompt:-
#
# >>> execfile("/full/path/to/1KHz_SW_OSX.py")
#
# And away you go...
#
# This code is issued as GPL3...
#
# Connect an oscilloscope to the earphone socket(s) to see the sinewave waveform(s) being generated.
#
# $VER: 1KHz_SW_OSX.py_Version_0.00.10_(C)2012_B.Walker_G0LCU.

# The only import required...
import pyaudio

# Initialise the only _variable_ in use...
n=0

# Set up a basic user screen...
# This assumes the minimum default 80x24 Terminal window size...
print("nnnnnnnnnnnnnnnnnnnnnnnnn$VER: 1KHz_SW_OSX.py_Version_0.00.10_(C)2012_B.Walker_G0LCU.n")
print("A DEMO kids level, platform independent, 1KHz _pure_ sinewave generator.nnnnnnnnnnnnnnnnnn")

# Open the stream required, mono mode only...
stream=pyaudio.PyAudio().open(format=pyaudio.paInt8,channels=1,rate=16000,output=True)

# Now generate the 1KHz signal at the speakers/headphone output for about 10 seconds...
# Sine wave, to 8 bit depth only...
for n in range(0,10000,1): stream.write("x00x30x5ax76x7fx76x5ax30x00xd0xa6x8ax80x8axa6xd0")

# Close the open _channel(s)_...
stream.close()
pyaudio.PyAudio().terminate()

# End of 1KHz_SW_OSX.py program...
# Enjoy finding simple solutions to often very difficult problems... ;o)


Source: FULL ARTICLE at The UNIX and Linux Forums