1. For Safaricom 3G Modem - Huawei E173
This is the relevant (just enough) config. of course u will need core sms-box sms-user among others
group = smsc
smsc = at
modemtype = auto
device = /dev/ttyUSB0
#my-number = +254722456789
#speed = 57600
sms-center = +254722500029
#connect-allow-ip = "127.0.0.1"
port = 10000
group = modems
id = "Huawei"
name = "HUAWEI E173"
no-pin = true
init-string = "AT+CNMI=1,1,0,1,0"
need-sleep = true
sendline-sleep = 1000
detect-string = "huawei"
2. Connecting/Testing to SMPP Simulator (SMPPSim)
#SMSC
group = smsc
smsc = smpp
smsc-id = SMPPSim
denied-smsc-id = saf_modem
host = localhost
port = 2775
smsc-username = smppclient1
smsc-password = password
system-type = "VMA"
interface-version = "33"
#SMS SERVICE
group = sms-service
keyword = smpp_echo
accepted-smsc = SMPPSim
get-url = "http://localhost:9090/bizypalace/echo?keyword=echo&smsbody=%s&smsc_id=%i"
faked-sender = "BISON"
#USER
group = sendsms-user
username = smppclient1
password = password
forced-smsc = SMPPSim
Experiences of an OpenSource developer.. "Everyday trying to get closer to the metal".
Friday, October 28, 2011
Friday, July 15, 2011
MapReduce powering Cloud Computing
Hello Nerd-migos !!!!
The cloud is here... r u (still) waiting for the rain !!!!
Forget the buzzword and the business hype, the cloud is real (hehe).
U need to (first) appreciate Virtual Machines/Computing (at least in theory - for non-nerds), Qemu, VMware, Xen, Virtual Box, ....
Now for fellow Nerd-migos.. we need to acquint with some of the following stuff
MapReduce:
"MapReduce is a patented software framework introduced by Google in 2004 to support distributed computing on large data sets on clusters of computers.[2]
The framework is inspired by the map and reduce functions commonly used in functional programming,[3] although their purpose in the MapReduce framework is not the same as their original forms.[4]
MapReduce libraries have been written in C++, C#, Erlang, Java, OCaml, Perl, Python, PHP, Ruby, F#, R and other programming languages." - Wikipedia
Notable (IMHO) implementation of this paradigm (apart from google itself) are
A
Hadoop
The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using a simple programming model. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. Rather than rely on hardware to deliver high-avaiability, the library itself is designed to detect and handle failures at the application layer, so delivering a highly-availabile service on top of a cluster of computers, each of which may be prone to failures.
B
OpenStack (+ Cloudera) is the (leading - IMHO) OpenSource Cloud attempt !!!!!
What synergy.. Apache's Hadoop powers RackSpace's OpenStack which is leveraged by Cloudera's ingenuity..
And by the way, did u know that Amazons' Elastic Cloud is a fork of Hadoop ????????
The cloud is here... r u (still) waiting for the rain !!!!
Forget the buzzword and the business hype, the cloud is real (hehe).
U need to (first) appreciate Virtual Machines/Computing (at least in theory - for non-nerds), Qemu, VMware, Xen, Virtual Box, ....
Now for fellow Nerd-migos.. we need to acquint with some of the following stuff
MapReduce:
"MapReduce is a patented software framework introduced by Google in 2004 to support distributed computing on large data sets on clusters of computers.[2]
The framework is inspired by the map and reduce functions commonly used in functional programming,[3] although their purpose in the MapReduce framework is not the same as their original forms.[4]
MapReduce libraries have been written in C++, C#, Erlang, Java, OCaml, Perl, Python, PHP, Ruby, F#, R and other programming languages." - Wikipedia
Notable (IMHO) implementation of this paradigm (apart from google itself) are
A
Hadoop
The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using a simple programming model. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. Rather than rely on hardware to deliver high-avaiability, the library itself is designed to detect and handle failures at the application layer, so delivering a highly-availabile service on top of a cluster of computers, each of which may be prone to failures.
B
OpenStack (+ Cloudera) is the (leading - IMHO) OpenSource Cloud attempt !!!!!
What synergy.. Apache's Hadoop powers RackSpace's OpenStack which is leveraged by Cloudera's ingenuity..
And by the way, did u know that Amazons' Elastic Cloud is a fork of Hadoop ????????
Wednesday, May 11, 2011
VBoxHeadless - VM without GUI
Fellow Geeks,
I have been doing some interesting stuff of late and thought i should share some...
I probably should start with the simplest....
To run a VirtualBox Virtual Machine without GUI on the Host (This is default in CentOS' and Fedora's Virtual Machine Manager) for whatever reason u may use any of the following commands...
VBoxManage startvm "VM name" --type headless
or
VBoxHeadless --startvm
Typical scenario in production/server environments where no one needs to access the GUI of a Virtual Machine from the Server/Host itself.
Instead we access the VMs using VNC or SSH
I have been doing some interesting stuff of late and thought i should share some...
I probably should start with the simplest....
To run a VirtualBox Virtual Machine without GUI on the Host (This is default in CentOS' and Fedora's Virtual Machine Manager) for whatever reason u may use any of the following commands...
VBoxManage startvm "VM name" --type headless
or
VBoxHeadless --startvm
Typical scenario in production/server environments where no one needs to access the GUI of a Virtual Machine from the Server/Host itself.
Instead we access the VMs using VNC or SSH
Monday, April 18, 2011
Impossible Objects
"An impossible object (also known as an impossible figure or an undecidable figure) is a type of optical illusion consisting of a two-dimensional figure which is instantly and subconsciously interpreted by the visual system as representing a projection of a three-dimensional object although it is not actually possible for such an object to exist (at least not in the form interpreted by the visual system)." - Wikipedia
Impossible Fence
Is this even possible ? [its the shadows doing the trick]
Two gentlement literally Going NOWHERE (and comming from NOWHERE)
Source: Ricardo Baigorria
What a world of impossibility....what about the other guys in the swimming pool ?
Great work with drawing...
This is easy
Yet Another impossible fence
Impossible Fence
Is this even possible ? [its the shadows doing the trick]
Two gentlement literally Going NOWHERE (and comming from NOWHERE)
Source: Ricardo Baigorria
What a world of impossibility....what about the other guys in the swimming pool ?
Great work with drawing...
This is easy
Yet Another impossible fence
Optical slash Visual illusions
The two circles seem to move when the viewer's head is moving forwards and backwards while looking at the black dot.
The horizontal lines are parallel, even if they seem otherwise.
Can u see black (not white) dots at the intersections?
The two orange circles are the same size.
Duck or Rabbit ?
This is a flower vase (or is it a two-silhouette profile?)
Are they spinning or not ?
The horizontal lines are parallel, even if they seem otherwise.
Can u see black (not white) dots at the intersections?
The two orange circles are the same size.
Duck or Rabbit ?
This is a flower vase (or is it a two-silhouette profile?)
Are they spinning or not ?
Thursday, April 7, 2011
Windows Embarassing itself
I have used Windows but never became a fun of that OS.
If the GUI can embarass itself that much what about the things u dont see ?
And dont forget u will never get any where close to its Source Code...
ATM asking for Windows Activation
Micro$oft Windows not trusting Internet Explorer
Error Messages that tell it all
The logical conclusion
If the GUI can embarass itself that much what about the things u dont see ?
And dont forget u will never get any where close to its Source Code...
ATM asking for Windows Activation
Micro$oft Windows not trusting Internet Explorer
Error Messages that tell it all
The logical conclusion
Windows Sucks
1.
This is Linux land. In silent nights you can hear the Windows machines rebooting.
2.
The box said "Windows 98 or better" - so I installed Linux
3.
Macs are for those who don't want to know why their computer works.
Linux is for those who want to know why their computer works.
DOS is for those who want to know why their computer doesn't work.
Windows is for those who don't want to know why their computer doesn't work.
4.
# Mouse not present - click twice to continue...
# Who the fuck is General Failure ? And why is he reading my harddisk ?
10.
# McAfee-Question: Is Windows a virus ?
No, Windows is not a virus. Here's what viruses do:
1. They replicate quickly - okay, Windows does that.
2. Viruses use up valuable system resources, slowing down the system as they do so - okay, Windows does that.
3. Viruses will, from time to time, trash your hard disk - okay, Windows does that too.
4. Viruses are usually carried, unknown to the user, along with valuable programs and systems. Sigh... Windows does that, too.
5. Viruses will occasionally make the user suspect their system is too slow (see 2.) and the user will buy new hardware. Yup, that's with Windows, too.
Until now it seems Windows is a virus but there are fundamental differences:
Viruses are well supported by their authors, are running on most systems, their program code is fast, compact and efficient and they tend to become more sophisticated as they mature.
So Windows is not a virus. It's a bug.
This is Linux land. In silent nights you can hear the Windows machines rebooting.
2.
The box said "Windows 98 or better" - so I installed Linux
3.
Macs are for those who don't want to know why their computer works.
Linux is for those who want to know why their computer works.
DOS is for those who want to know why their computer doesn't work.
Windows is for those who don't want to know why their computer doesn't work.
4.
# Mouse not present - click twice to continue...
# Who the fuck is General Failure ? And why is he reading my harddisk ?
10.
# McAfee-Question: Is Windows a virus ?
No, Windows is not a virus. Here's what viruses do:
1. They replicate quickly - okay, Windows does that.
2. Viruses use up valuable system resources, slowing down the system as they do so - okay, Windows does that.
3. Viruses will, from time to time, trash your hard disk - okay, Windows does that too.
4. Viruses are usually carried, unknown to the user, along with valuable programs and systems. Sigh... Windows does that, too.
5. Viruses will occasionally make the user suspect their system is too slow (see 2.) and the user will buy new hardware. Yup, that's with Windows, too.
Until now it seems Windows is a virus but there are fundamental differences:
Viruses are well supported by their authors, are running on most systems, their program code is fast, compact and efficient and they tend to become more sophisticated as they mature.
So Windows is not a virus. It's a bug.
Various Math + Software
1. What is set theory?
When there are five people in the room and seven are leaving, two will have to enter the room, so that it becomes empty.
2. Why did the chicken cross the road?
Chickens at rest tend to stay at rest. Chickens in motion tend to cross the road.
3. Werner Heisenberg, Kurt Godel and Noam Chomsky walk into a bar.
Heisenberg looks around the bar and says, "Because there are three of us and because this is a bar, it must be a joke. But the question remains, is it funny or not?"
And Godel thinks for a moment and says, "Well, because we're inside the joke, we can't tell whether it's funny. We'd have to be outside looking at it."
And Chomsky looks at both of them and says, "Of course it's funny. You're just telling it wrong."
5.
# In C we had to code our own bugs. In C++ we can inherit them.
# C gives you enough rope to hang yourself. C++ also gives you the tree object to tie it to.
# Unix is user friendly. It's just very particular about who it's friends are.
4. Real software engineers...
* Real software engineers don't write applications programs, they implement algorithms.
* Real software engineers don't debug programs, they verify correctness.
* Real software engineers like C's structured constructs, but they are suspicious of it because they have heard that it lets you get "close to the machine."
* Real software engineers work from 9 to 5, because that is the way the job is described in the formal spec. Working late would feel like using an undocumented external procedure.
When there are five people in the room and seven are leaving, two will have to enter the room, so that it becomes empty.
2. Why did the chicken cross the road?
Chickens at rest tend to stay at rest. Chickens in motion tend to cross the road.
3. Werner Heisenberg, Kurt Godel and Noam Chomsky walk into a bar.
Heisenberg looks around the bar and says, "Because there are three of us and because this is a bar, it must be a joke. But the question remains, is it funny or not?"
And Godel thinks for a moment and says, "Well, because we're inside the joke, we can't tell whether it's funny. We'd have to be outside looking at it."
And Chomsky looks at both of them and says, "Of course it's funny. You're just telling it wrong."
5.
# In C we had to code our own bugs. In C++ we can inherit them.
# C gives you enough rope to hang yourself. C++ also gives you the tree object to tie it to.
# Unix is user friendly. It's just very particular about who it's friends are.
4. Real software engineers...
* Real software engineers don't write applications programs, they implement algorithms.
* Real software engineers don't debug programs, they verify correctness.
* Real software engineers like C's structured constructs, but they are suspicious of it because they have heard that it lets you get "close to the machine."
* Real software engineers work from 9 to 5, because that is the way the job is described in the formal spec. Working late would feel like using an undocumented external procedure.
You Might Be a Physicist if...
You Might Be a Physicist if...
*
the water in your kettle is boiling at 373 Kelvin.
*
you know that the speed of light is 299,792.5 km/sec.
*
you know the direction the water swirls when you flush.
*
you've already calculated how much you earn per second.
*
you are sure that differential equations are a very useful tool.
*
you are at an air show and know how fast the skydivers are falling.
*
you know the size of the elctron, but don't know your own shirt size.
*
when you break a vase you blame the second law of thermodynamics.
*
you try to explain entropy to strangers at your table during casual dinner conversation.
*
you avoid stirring your coffee because you don't want to increase the entropy of the universe.
*
your three year old son asks why the sky is blue and you try to explain atmospheric absorption theory.
*
you're at a wine tasting event and find yourself paying more attention to the cork screws than the Chardonnay.
*
you carry on a one-hour debate over the expected results of an experiment that actually takes five minutes to run.
*
the water in your kettle is boiling at 373 Kelvin.
*
you know that the speed of light is 299,792.5 km/sec.
*
you know the direction the water swirls when you flush.
*
you've already calculated how much you earn per second.
*
you are sure that differential equations are a very useful tool.
*
you are at an air show and know how fast the skydivers are falling.
*
you know the size of the elctron, but don't know your own shirt size.
*
when you break a vase you blame the second law of thermodynamics.
*
you try to explain entropy to strangers at your table during casual dinner conversation.
*
you avoid stirring your coffee because you don't want to increase the entropy of the universe.
*
your three year old son asks why the sky is blue and you try to explain atmospheric absorption theory.
*
you're at a wine tasting event and find yourself paying more attention to the cork screws than the Chardonnay.
*
you carry on a one-hour debate over the expected results of an experiment that actually takes five minutes to run.
Physics Product Safety Campain
Manufacturers Should Provide consumers with all of the following labels:
WARNING: Due to its heavy mass, this product warps the space surrounding it. No health hazards are yet known to be associated with effect.
NOTE: This product may actually be nine-dimensional but, if this is the case, functionality is not affected by the extra six dimensions.
HEALTH WARNING: This product (and every product of the Manufacturer) emits low-level nuclear radiation.
NOTE: A subatomic "glue" holds the fundamental constituents of this product together. Since the exact nature of this glue is not yet fully understood, its adhesive power cannot be guaranteed. To date, no known malfunction of the product has resulted from glue failure.
DISCLAIMER: Manufacturer is not responsible for loss should this product disappear into a wormhole.
LIMITED WARRANTY: Despite the efforts of the Manufacturer, the chaos in this package has increased since being shipped. If such chaos has rendered the product defective, Buyer shall not hold Manufacturer responsible. Claims in this regard should be aimed directly at the Shipper.
NOTE: Despite its appearance, this product is more than 99.99% empty space.
READ THIS BEFORE OPENING: According to quantum theory, this product may collapse into another state if directly observed.
HANDLE WITH CARE: This product contains countless, minute, electrically charged particles moving at extremely high speeds.
EXTREME CAUTION: This product has an energy-equivalent that, if exploded, could destroy a small town. Under no circumstance shall a User perform a mass-energy transformation on any of the contents in this package. In case of misuse, liability shall rest entirely with the User.
GUARANTEED RETURN CLAUSE: Because of the uncertainty principle, we have shipped this product with a limited speed notice. However, if shippers have disregarded our notice, we cannot guarantee that all the contents are in the box. If you discover missing components, please call the 1-800 number on the instruction sheet.
IMPORTANT: This product is composed of 100% matter: It is the responsibility of the User to make sure that it does not come in contact with antimatter. Under no circumstances will the Manufacturer be liable for User mishandling in this regard.
QUALITY STANDARD: The electrons, protons and neutrons are guaranteed to be of same quality as those used in other products of the Manufacturer.
DISAPPEARANCE EXCLUSION: Due to quantum tunneling, there is an extremely tiny chance that this product may suddenly disappear at any time (and reappear elsewhere). The Manufacturer will not be responsible for such mysterious disappearances.
AS REQUIRED BY LAW, we must inform you that any use of this product increases the amount of disorder in the universe. As of the date shipped, Congress has not passed any bills assigning a tax on disorder pollution.
USE LIMITATION: This product cannot be guaranteed to function normally near a black hole.
WARNING: Due to its heavy mass, this product warps the space surrounding it. No health hazards are yet known to be associated with effect.
NOTE: This product may actually be nine-dimensional but, if this is the case, functionality is not affected by the extra six dimensions.
HEALTH WARNING: This product (and every product of the Manufacturer) emits low-level nuclear radiation.
NOTE: A subatomic "glue" holds the fundamental constituents of this product together. Since the exact nature of this glue is not yet fully understood, its adhesive power cannot be guaranteed. To date, no known malfunction of the product has resulted from glue failure.
DISCLAIMER: Manufacturer is not responsible for loss should this product disappear into a wormhole.
LIMITED WARRANTY: Despite the efforts of the Manufacturer, the chaos in this package has increased since being shipped. If such chaos has rendered the product defective, Buyer shall not hold Manufacturer responsible. Claims in this regard should be aimed directly at the Shipper.
NOTE: Despite its appearance, this product is more than 99.99% empty space.
READ THIS BEFORE OPENING: According to quantum theory, this product may collapse into another state if directly observed.
HANDLE WITH CARE: This product contains countless, minute, electrically charged particles moving at extremely high speeds.
EXTREME CAUTION: This product has an energy-equivalent that, if exploded, could destroy a small town. Under no circumstance shall a User perform a mass-energy transformation on any of the contents in this package. In case of misuse, liability shall rest entirely with the User.
GUARANTEED RETURN CLAUSE: Because of the uncertainty principle, we have shipped this product with a limited speed notice. However, if shippers have disregarded our notice, we cannot guarantee that all the contents are in the box. If you discover missing components, please call the 1-800 number on the instruction sheet.
IMPORTANT: This product is composed of 100% matter: It is the responsibility of the User to make sure that it does not come in contact with antimatter. Under no circumstances will the Manufacturer be liable for User mishandling in this regard.
QUALITY STANDARD: The electrons, protons and neutrons are guaranteed to be of same quality as those used in other products of the Manufacturer.
DISAPPEARANCE EXCLUSION: Due to quantum tunneling, there is an extremely tiny chance that this product may suddenly disappear at any time (and reappear elsewhere). The Manufacturer will not be responsible for such mysterious disappearances.
AS REQUIRED BY LAW, we must inform you that any use of this product increases the amount of disorder in the universe. As of the date shipped, Congress has not passed any bills assigning a tax on disorder pollution.
USE LIMITATION: This product cannot be guaranteed to function normally near a black hole.
Wednesday, March 16, 2011
Batch Convert Multimedia Files Using FFMPEG
I will show u how to batch convert multimedia files using a bash script.
The following script will get all .mp4 files from the current directory, convert them to .wav and save them in a folder called wav(still in the current directory). Of course u can modify this file to suit your specific conversion needs.
Save the following script as mp4_to_wav.sh and make it executable (chmod +x mp4_to_wav.sh):
#===================================
#the directory wav must be present in the current directory
for f in *.mp4;
do
ffmpeg -i "$f" "wav/${f%.mp4}.wav";
done
#====================================
Now i can accept ur coffee
The following script will get all .mp4 files from the current directory, convert them to .wav and save them in a folder called wav(still in the current directory). Of course u can modify this file to suit your specific conversion needs.
Save the following script as mp4_to_wav.sh and make it executable (chmod +x mp4_to_wav.sh):
#===================================
#the directory wav must be present in the current directory
for f in *.mp4;
do
ffmpeg -i "$f" "wav/${f%.mp4}.wav";
done
#====================================
Now i can accept ur coffee
Friday, February 25, 2011
Programmatically accessing Managed Beans
Happy New Year
The traditional (best) way of accessing using managed beans is via the EL in JSF based webapps.
There are instances where u need to access a Managed Bean programaticaly (may be to avoid cyclic references in faces-config.xml thus causing deadlocks).
After so much agony I learnt how to do it and i thought of sharing it with u
FacesContext context = FacesContext.getCurrentInstance();
SessionBean bean1 = (SessionBean) context.getApplication().evaluateExpressionGet(context, "#{session}", SessionBean.class);
Of course SessionBean must already have bn declared as managed bean session in faces-config.xml
=======================================================
Artificial Intelligence is no match for Human Stupidity
The traditional (best) way of accessing using managed beans is via the EL in JSF based webapps.
There are instances where u need to access a Managed Bean programaticaly (may be to avoid cyclic references in faces-config.xml thus causing deadlocks).
After so much agony I learnt how to do it and i thought of sharing it with u
FacesContext context = FacesContext.getCurrentInstance();
SessionBean bean1 = (SessionBean) context.getApplication().evaluateExpressionGet(context, "#{session}", SessionBean.class);
Of course SessionBean must already have bn declared as managed bean session in faces-config.xml
=======================================================
Artificial Intelligence is no match for Human Stupidity
OpenICE Web Framework
OpenICE - Alpha
Allow me to introduce all of you to my New Web Application Development Framework based on JSF 2.0 and powered by ICE Faces.
In OpenICE developers need not care about Managed Beans and custom POJOs since the Framework Has Robust Managed Beans which update their status and that of the application from an external XML.
The application developer will need to design, develop and manage the underlying Database (Model) and use the markup (XML) for OpenICE applications to create UI/UX elements.
In the MVC OpenICE takes care of the Control and lets the user worry about WHAT to store (Model) and WHERE to show it (View) thus cutting down development time drastically.
Footprint:
Glassfish v3
JSF 2.0
ICE Faces 2.0 using 1.8 Components
Allow me to introduce all of you to my New Web Application Development Framework based on JSF 2.0 and powered by ICE Faces.
In OpenICE developers need not care about Managed Beans and custom POJOs since the Framework Has Robust Managed Beans which update their status and that of the application from an external XML.
The application developer will need to design, develop and manage the underlying Database (Model) and use the markup (XML) for OpenICE applications to create UI/UX elements.
In the MVC OpenICE takes care of the Control and lets the user worry about WHAT to store (Model) and WHERE to show it (View) thus cutting down development time drastically.
Footprint:
Glassfish v3
JSF 2.0
ICE Faces 2.0 using 1.8 Components
Monday, January 24, 2011
FFMPEG - Multimedia Tool
FFmpeg is a free software/open source project that produces libraries and programs for handling multimedia data. It ships with Fedora Linux so I naturally took a dive and have never turned back.....
I normaly use it to convert multimedia files from one format to another. Being a command line tool u expect faster execution.
For example
Convert from MP4 to AVI
To See Supported File Formats
#ffmpeg -formats
You will get output similar to this
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration:
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 20 2009 15:52:49, gcc: 4.3.2 20081105 (Red Hat 4.3.2-7)
File formats:
E 3g2 3GP2 format
E 3gp 3GP format
DEA wmav1 Windows Media Audio 1
DEA wmav2 Windows Media Audio 2
DEVSD wmv1 Windows Media Video 7
DEVSD wmv2 Windows Media Video 8
D V wmv3 Windows Media Video 9
DES dvbsub DVB subtitles
DES dvdsub DVD subtitles
DEV D dvvideo DV (Digital Video)
D V dxa Feeble Files/ScummVM DXA
D V D eacmv Electronic Arts CMV video
D V D eatgq Electronic Arts TGQ video
D V eatgv Electronic Arts TGV video
D V D eatqi Electronic Arts TQI Video
D V D escape124 Escape 124
.........To mention but a few
I normaly use it to convert multimedia files from one format to another. Being a command line tool u expect faster execution.
For example
Convert from MP4 to AVI
#ffmpeg -i inputfile.mp4 outfile.avi
To See Supported File Formats
#ffmpeg -formats
You will get output similar to this
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration:
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 20 2009 15:52:49, gcc: 4.3.2 20081105 (Red Hat 4.3.2-7)
File formats:
E 3g2 3GP2 format
E 3gp 3GP format
DEA wmav1 Windows Media Audio 1
DEA wmav2 Windows Media Audio 2
DEVSD wmv1 Windows Media Video 7
DEVSD wmv2 Windows Media Video 8
D V wmv3 Windows Media Video 9
DES dvbsub DVB subtitles
DES dvdsub DVD subtitles
DEV D dvvideo DV (Digital Video)
D V dxa Feeble Files/ScummVM DXA
D V D eacmv Electronic Arts CMV video
D V D eatgq Electronic Arts TGQ video
D V eatgv Electronic Arts TGV video
D V D eatqi Electronic Arts TQI Video
D V D escape124 Escape 124
.........To mention but a few
XOR in Oracle
I had a situation where an XOR implementation was needed in a SELECT query. Since Oracle 10g doesnt have this operator predefined i did some gymnastics and ended up with this solution.
I decided to share this (among others) since human knowledge belongs to mankind
1. XOR in oracle
Example 1 - chars only
Eg we want to display results where ismale='1' XOR iscitizen='1' (ie either but not both)
Solution
SELECT ismale, iscitizen, (ismale + iscitizen) as xor
FROM tablename
WHERE ismale + iscitizen = 1;
NB: oracle will add(mathematical) chars as it would integers
Example 2 - varchars
Eg we want to display results where gender='male' XOR countryid='KE' (ie either but not both)
Solution
SELECT gender, countryid, (decode(gender,'male','1','0') + decode(countryid,'KE','1','0')) as xor
FROM tablename
WHERE (decode(gender,'male','1','0') + decode(countryid,'KE','1','0')) = 1;
NB: oracle will add chars as it would integers
I decided to share this (among others) since human knowledge belongs to mankind
1. XOR in oracle
Example 1 - chars only
Eg we want to display results where ismale='1' XOR iscitizen='1' (ie either but not both)
Solution
SELECT ismale, iscitizen, (ismale + iscitizen) as xor
FROM tablename
WHERE ismale + iscitizen = 1;
NB: oracle will add(mathematical) chars as it would integers
Example 2 - varchars
Eg we want to display results where gender='male' XOR countryid='KE' (ie either but not both)
Solution
SELECT gender, countryid, (decode(gender,'male','1','0') + decode(countryid,'KE','1','0')) as xor
FROM tablename
WHERE (decode(gender,'male','1','0') + decode(countryid,'KE','1','0')) = 1;
NB: oracle will add chars as it would integers
Subscribe to:
Posts (Atom)