<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Alternating Highlights</title>
<script src="../s/jquery-1.2.6.pack.js" type="text/javascript">
</script>
<style type="text/css">
.r0 {background-color:White;color:Black}
.r1 {background-color:#f5f5f5;color:Black}
.hl {background-color:Yellow;color:red;cursor: hand}
</style>
</head>
<body>
<p>
jQuery alternating highlight example.
</p>
<table id="test" border="1" rules="none" cellspacing="0"
style="border: solid 2px navy">
<tr class="r0">
<td>some data</td>
<td>some data</td>
</tr>
<tr class="r1">
<td>some other data</td>
<td>some other data</td>
</tr>
<tr class="r0">
<td>some data</td>
<td>some data</td>
</tr>
<tr class="r1">
<td>some other data</td>
<td>some other data</td>
</tr>
<tr class="r0">
<td>some data</td>
<td>some data</td>
</tr>
<tr class="r1">
<td>some other data</td>
<td>some other data</td>
</tr>
<tr class="r0">
<td>some data</td>
<td>some data</td>
</tr>
<tr class="r1">
<td>some other data</td>
<td>some other data</td>
</tr>
</table>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#test").find("tr[@class='r0']").each(
function()
{
$(this).hover(function() {
$(this).addClass("hl");
},function(){
$(this).removeClass("hl");
$(this).addClass("r0");
});
});
$("#test").find("tr[@class='r1']").each(
function()
{
$(this).hover(function() {
$(this).addClass("hl");
},function(){
$(this).removeClass("hl");
$(this).addClass("r1");
});
});
});
</script>
</body>
</html>
A Southwestern adventurer striking out into the badlands of the Midwest for fun, profit, and for a wife who wouldn't move back to the Southwest :)
Friday, July 18, 2008
jQuery Alternating Row Highlighter Example
Again, another simple use of jQuery to highlight rows in a table, but this example keeps the different classes for alternating table rows intact. Again, I'm still learing, I bet there is some kind of xpath test for values that can cut down the size of the javascript.
Wednesday, July 16, 2008
jQuery Attribute-Based Form Validation Example
Ok, this code is rough, and I'm sure this has been done before, but while playing around with jQuery I thought it might be interesting to try out some form validation by just adding an additional attribute to the input type, then having jQuery search through all the form elements, and then based on that added attribute, test the form values for correctness. Below is a really crude example that demos this technique. It works, I'm not sure if some xhtml validators will squak because of the extra attribute. Anyway, something to play with. One jQuery plugin, one error object (not in this demo) with an array of error strings, and wallah!, form validation. This example will get you thinking.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script src="jquery-1.2.6.pack.js" type="text/javascript"></script>
<style type="text/css">
.red {border-color:Red;background-color:Yellow}
</style>
</head>
<body>
<form name="myform">
<table>
<tr>
<td>Required Numeric1</td>
<td>
<input type="text" id="num1" name="NumericField" v="RN" maxlength="3" />
</td>
</tr>
<tr>
<td>Required Numeric2</td>
<td>
<input type="text" id="num2" name="NumericField2" v="RN" maxlength="3" />
</td>
</tr>
<tr>
<td>Required Numeric3</td>
<td>
<input type="text" id="num3" name="NumericField3" v="RN" maxlength="3" />
</td>
</tr>
<tr>
<td>Numeric4</td>
<td>
<input type="text" id="num4" name="NumericField4" v="N" maxlength="10" />
</td>
</tr>
</table>
<input type="button" value="Validate" onclick="return vF('myform');" />
</form>
<script language="javascript" type="text/javascript">
var bR = false;
$(document).ready(function() {
bR=true;
});
function vF(f)
{
try
{
var sErr = "";
var fid = "";
if(bR==false)return;
$("form").find("input[@v='RN']").each(
function()
{
if (isNaN(this.value) this.value=="")
{
sErr+= "* Required numeric value for " + this.name + ".\n";
this.value = "";
fid = (fid == "" ? this.id : fid);
$("#"+this.id).addClass("red");
}
else {$("#"+this.id).removeClass("red");}
});
$("form").find("input[@v='N']").each(
function()
{
if (isNaN(this.value))
{
sErr+= "* Numeric value required for " + this.name + ".\n";
this.value = "";
fid = (fid == "" ? this.id : fid);
$("#"+this.id).addClass("red");
}
else {$("#"+this.id).removeClass("red");}
});
if(sErr != "")
{
sErr = "Please Correct the following issues-\n" + sErr;
alert(sErr);
$("#" + fid).focus();
return false;
}
return true;
}
catch(err)
{
alert(err);
}
}
</script>
</body>
</html>
Monday, July 14, 2008
Jquery Check All
Another tutorial example, others have posted more elegant solutions, but here is my example.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<script src="../s/jquery-1.2.6.pack.js" type="text/javascript"></script>
</head>
<body>
<p>
check all/none example.
</p>
<p id="test">
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<input type="checkbox" /><br />
<br />
<input type="button" value="Check All" onclick="CA(1);" />
<input type="button" value="Check None" onclick="CA(0);" />
</p>
</body>
<script language="javascript" type="text/javascript">
function CA(w){
$("#test").find("input[@type$='checkbox']").each(function() {
this.checked = (w == 0) ? false : true;
});
}
</script>
</html>
Design Pattern Links
I was in a holding pattern today, so I did a little reading on design patterns. Here are a few links I found that are worth reading.
http://www.developer.com/design/article.php/1502691
http://www.go4expert.com/forums/showthread.php?t=5127
And, for fun, I guess now everything is a pattern. I guess in the truest sense this is correct, but maybe calling everything a pattern is overkill.
http://www.welie.com/patterns/
http://www.developer.com/design/article.php/1502691
http://www.go4expert.com/forums/showthread.php?t=5127
And, for fun, I guess now everything is a pattern. I guess in the truest sense this is correct, but maybe calling everything a pattern is overkill.
http://www.welie.com/patterns/
Jquery Basic Example: Highlighting Table Rows
This is pulled pretty much directly from the second tutorial on Jquery's site. With big data grids sometimes adding a row highlighter allows users to keep track of where they reading in the table. I've been doing this type of stuff with javascript for a long time, but JQuery just made this technique uber simple. Here is an example. Note, some of the code might slide under the right side bar, just copy and past the whole code block and it will get the covered code if you are interested. Also you will need to adjust the link at the top to where your jquery code resides. Now the code-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script src="../s/jquery-1.2.6.pack.js" type="text/javascript"></script>
<style type="text/css">
.hl {color:red; background-color:yellow}
</style>
</head>
<body>
<p>
Low Cost Table Row Hover Event
</p>
<table id="test" cellpadding="2" cellspacing="0" border="0"
bgcolor="#f5f5f5">
<tr><td>stuff</td><td>stuff</td></tr>
<tr><td>stuff</td><td>stuff</td></tr>
<tr><td>stuff</td><td>stuff</td></tr>
<tr><td>stuff</td><td>stuff</td></tr>
<tr><td>stuff</td><td>stuff</td></tr>
<tr><td>stuff</td><td>stuff</td></tr>
<tr><td>stuff</td><td>stuff</td></tr>
</table>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#test tr").hover(function() {
$(this).addClass("hl");
},function(){
$(this).removeClass("hl");
});
});
</script>
</body>
</html>
JQuery 1.2.6 Intellisense
Some bright folks have cobbled together a Jquery file (1.2.6 release) that Visual Studio 2008 can parse, allowing for intellisense for Jquery in Visual Studio. Pretty cool.
Download and read onward here-
http://www.mustafaozcan.net/en/post/2008/06/15/JQuery-1-2-6-Intellisense-for-Visual-Studio-2008.aspx
Download and read onward here-
http://www.mustafaozcan.net/en/post/2008/06/15/JQuery-1-2-6-Intellisense-for-Visual-Studio-2008.aspx
Saturday, July 12, 2008
Nebraska Town Wants to Make Illegal Aliens...Illegal?
Wednesday, July 09, 2008
Google's New Virtual World
Check out Google's "Lively" virtual world.
http://www.lively.com/html/landing.html
Read a synopsis here-
[Update 11/20/08]
Looks like Google's Lively was short lived. The plug will be pulled soon.
Tuesday, July 08, 2008
Saturday, July 05, 2008
Islam Rising: School Infiltration
Here is an interesting article from WND about how Islamist, with the help of liberal allies, are infultrating Western schools.
http://www.wnd.com/index.php?fa=PAGE.view&pageId=68785
http://www.wnd.com/index.php?fa=PAGE.view&pageId=68785
Thursday, July 03, 2008
OO Class Keywords and What They Do
Ok, I come from a scripting web background, and even to this day some OOP stuff I either forget or have never officially "learned." I found a good link talking about the various forms of classes in OOP, might be useful.
http://www.functionx.com/csharp2/classes2/abstraction.htm
http://www.functionx.com/csharp2/classes2/abstraction.htm
Picture of the Week: Chinese Troops on Segways
Chinese anti-terrorist troops on Segway's. Click the photo to read more.
Tuesday, July 01, 2008
Bad @ss, TCP/IP from a Web Browser in JavaScript
Welcome to the world of "Comet" servers. What is a Comet server? A Comet server is a server that supports communicating via TCP and other protocols directly to and from a web server from a web browser using client side Javascript. Typically you could enable doing this by using a Java applet or a Flash object, but javascript I guess has matured enough to the point where this can be done, in theory, without the use of external plugins.
Read on [HERE] for more info about Comet servers.
Below is a great comet server called Orbital that is open source, plays well with both IIS and Apache, and is easy to use. Read about it here-
http://cometdaily.com/2008/07/01/sockets-in-the-browser/
Here is just a taste of how easy it is to use (allegedly, I haven't installed it yet)-
var conn = new TCPSocket(hostname, port)
conn.onopen = function() { alert('connection opened!') }
conn.onread = function(data) { alert('RECEIVE: ' + data) }
conn.onclose = function(data) { alert('connection closed!') }
conn.send('Hello World');
Wow. Chat. MMO's. Ditching bloated complex web services as a means of communication. If Orbital works as advertised, I see whole new worlds opening up.
Orbital's website is here-
http://orbited.org/
I found this post on Ajaxian, an excellent blog well worth an RSS subscription-
http://ajaxian.com/archives/tcpsocket-sockets-in-the-browser
Read on [HERE] for more info about Comet servers.
Below is a great comet server called Orbital that is open source, plays well with both IIS and Apache, and is easy to use. Read about it here-
http://cometdaily.com/2008/07/01/sockets-in-the-browser/
Here is just a taste of how easy it is to use (allegedly, I haven't installed it yet)-
var conn = new TCPSocket(hostname, port)
conn.onopen = function() { alert('connection opened!') }
conn.onread = function(data) { alert('RECEIVE: ' + data) }
conn.onclose = function(data) { alert('connection closed!') }
conn.send('Hello World');
Wow. Chat. MMO's. Ditching bloated complex web services as a means of communication. If Orbital works as advertised, I see whole new worlds opening up.
Orbital's website is here-
http://orbited.org/
I found this post on Ajaxian, an excellent blog well worth an RSS subscription-
http://ajaxian.com/archives/tcpsocket-sockets-in-the-browser
Thursday, June 26, 2008
Another Reason to Establish a Buffer Zone With Mexico
Another example of Mexican violence spilling up into the South West.
http://kfyi.com/pages/local_news.html?feed=118695&article=3875223
Of course it is to policitally uncorrect to do much about the border with Mexico. I disagree. Time to start actually having a border.
http://kfyi.com/pages/local_news.html?feed=118695&article=3875223
Of course it is to policitally uncorrect to do much about the border with Mexico. I disagree. Time to start actually having a border.
Wednesday, June 25, 2008
UFO's Over England
The below link is to a report of a multiple witness sighting that includes some video. The video could be a hoax, and as usual doesn't really reveal much. But the sighting fits the classic "lights with no sound" UFO type sighting.
http://www.thesun.co.uk/sol/homepage/news/article1336870.ece
Looks like the Isles could be having a minor flap. There was a sighting and a picture by some Welsh police last week as well.
http://www.thesun.co.uk/sol/homepage/news/article1336870.ece
Looks like the Isles could be having a minor flap. There was a sighting and a picture by some Welsh police last week as well.
Monday, June 23, 2008
Interesting Apps to Checkout
I'm in between projects at work, so I have a little time to kill. I've been doing a quick scan of all my stared RSS articles on Google reader (which is a great RSS app by the way) and I came across this list of useful applications for learning (both freeware and payware).
http://c4lpt.co.uk/recommended/top100.html
Out of this list, I found the following apps notable.
http://www.ustream.tv/ - a free web streaming service
http://www.teachertube.com/ - a site that host youtube type videos for learning.
http://www.mindmeister.com/ - a collaborate mind mapping site
classtools.net - a Flash game creator site for educational purposes
http://c4lpt.co.uk/recommended/top100.html
Out of this list, I found the following apps notable.
http://www.ustream.tv/ - a free web streaming service
http://www.teachertube.com/ - a site that host youtube type videos for learning.
http://www.mindmeister.com/ - a collaborate mind mapping site
classtools.net - a Flash game creator site for educational purposes
Friday, June 20, 2008
Useful Regex Link
I found a site that has several thousand regex examples today, might be of use.
http://regexlib.com/
All my other stuff is on hold right now, as I'm studying Windows Communication Foundation for an upcomming project at work.
http://regexlib.com/
All my other stuff is on hold right now, as I'm studying Windows Communication Foundation for an upcomming project at work.
Tuesday, June 17, 2008
Perot Charts
Remember Ross Perot? That funny looking guy who ran for president back in 88 that whipped out all those bad-@ss charts?
Well, he is back, and so are his charts. Check 'em out here-
http://perotcharts.com/
Well, he is back, and so are his charts. Check 'em out here-
http://perotcharts.com/
Sunday, June 15, 2008
Movie Review: The Happening
I saw the movie "The Happening" this weekend. Let's just say this, big disappointment. Some people in the theater actually booed at the end of the movie. I liked some of M. Night Shyamalan(or whatever his name is)'s other movies (Sixth Sense, Signs, and Unbreakable). This movie pretty much blew chunks compared to those. Save your money.
Normally I wouldn't go out of my way to pan something, but this movie is such a politically correct themed piece of C grade story telling that I feal obligated to do my best to get people to pass this movie by. Too bad, as M. Night Shyamalan has produced some otherwise enjoyable movies. Maybe he should get away from the Hollywood crowd for a while.
Interesting though, usually he plays camo roles in his movies. I didn't see him in this one, maybe it is his way of saying "I was roped into this."
Anyway, see something else.
Normally I wouldn't go out of my way to pan something, but this movie is such a politically correct themed piece of C grade story telling that I feal obligated to do my best to get people to pass this movie by. Too bad, as M. Night Shyamalan has produced some otherwise enjoyable movies. Maybe he should get away from the Hollywood crowd for a while.
Interesting though, usually he plays camo roles in his movies. I didn't see him in this one, maybe it is his way of saying "I was roped into this."
Anyway, see something else.
Wednesday, June 11, 2008
Why America Is Great
Here is an article that shows why America is greater, and different, from the rest of the world. We might be in a decline, but our freedom of speech and freedom of religion really set us apart from the rest of the world, which is starting to back peddle on these freedoms. It is too bad that many liberals can't stand freedom of expression and beat the war drums for us to become more like Utopian (in their eyes) Europe.
Read on, ignore the author's subtle bias against freedom.
http://www.iht.com/articles/2008/06/11/america/hate.php
Read on, ignore the author's subtle bias against freedom.
http://www.iht.com/articles/2008/06/11/america/hate.php
Monday, June 09, 2008
Roll Your Own Postback Event
I found out how to cause javascript to trigger a server side event by trying to make something happen with the Telerik control suite (http://www.telerik.com/). This might be of interest to some of you, and I believe if your updated control is wrapped in an ajax update panel a full post back may not even take place (at least with Telerik's controls the below technique seemed to work as an ajax enabled partial post back.
Experiment for yourself.
Javascript
And in your in your page code...
Experiment for yourself.
Javascript
<script type="text/javascript">
function myfunction(param)
{
__doPostBack("<%= myControl.ClientID %>", "myargs");
}
</script>
And in your in your page code...
protected override void RaisePostBackEvent ( IPostBackEventHandler source, string eventArgument )
{
base.RaisePostBackEvent ( source, eventArgument );
if ( source == this.myControl && eventArgument.IndexOf ( "myargs" ) != -1 )
{
// Do whatever here
}
}
Wednesday, June 04, 2008
The One vs. The Collective (Developing from Scratch vs Using a Portal)
So my wife is starting a guild in Age of Conan. So I'm jazzed about creating the guild website. So, in my usual way, I just jump right into things. This is a great way to learn, but experience has finally taught me that this isn't the best way to get things done. So I decide to take a peak at existing guilds, and kind of do a feature comparison of what they have and get some ideas of what I should include.
In the process, I found some great looking guild sites with lots of features. I noticed a few of them where using SMF, tinyportal, and joomla. Just for the heck of it I downloaded SMF from here-
http://www.simplemachines.org/
So far I haven't delved into PHP development (but I respect PHP a lot and toy with messing with LAMP every so often. Anyway, I was pleasantly surprised to get a base install of the SMF forum up in about 10 minutes on my Host's Windows 2003 Server. Hats off to the developers who made SMF, great job.
But then I started looking at how to extend SMF and make it more portal like. I went to these spots for starters-
http://www.tinyportal.net/
http://joomla.org/
Everything looked very doable, but I started to realize I would need to dive into PHP a little bit to pull off what I wanted to accomplish. Plus I was a little worried about not having the full functionality SMF + others available to me because I'm running IIS. Plus the box is managed by my hosting provider, and I was worried about having to need admin rights on the box, so regardless of if all these concerns where legit or not, I decided to take a peak at some .Net based portals.
I checked out rainbow portal here-
http://www.rainbowportal.org/
It looked good, but then I seem to remember that my hosting solution might offer built in support for .Net nuke. So I did some research, and wa-la, dotnetnuke is awesome! I watched a quick video and I was sold. So the guild will go dotnetnuke.
http://www.dotnetnuke.com/
In a way I'm sad. I think the open source - LAMP crowd have made some great free portal software. But for now my tie to M$ and my hosting provider being windows based, plus their built in support for dotnetnuke pushed me that way.
But back to my original concept. It seems like the internet and its various technologies have been out long enough now so that we are starting to see various frameworks and projects gel together. These projects are actively developed by a lot of bright people. I think I'm finally starting to get that unless you are developing an application for a very specific need, you are cheating yourself and your customers if you don't take advantage of portals that have been built, used, modified, and expanded on by hundreds of smart people like you or me. So, from now on my first step in development is to check out what others have done, what tech they used, and how and if I can use what they have done before specking out something myself.
I know many of you probably shaking your heads...you have been doing this for years (part of the due diligence cycle). I'm slow, but I think I get it now. And not just because of my portal search. All the various javascript frameworks and such have also brought me to this conclusion.
Oh well, better late then never.
[Update...Sigh]
Well, dotnetnuke might be all that, if you can get the thing running. I used by web host's "automated install" option. It did something, but there are errors all over the place. Plus there is ZERO documentation on my web host's site, or if there is it is in such an obscure location that I can't find it...sigh.
So I download the dotnetnuke starter pack. Something installed, but nothing new shows up in either vs 2005 pro or visual studio 2008 visual studio expess.
Let's contrast that to SMF...which I got up and running in 10 minutes.
Who knows, I might be doing something wrong, something is f'ed up with the latest dotnetnuke installation, I don't know. I'll give it another shot tomorrow and spend about an hour more on it, if that doesn't work dotnetnuke is fired and I'll look for something else.
It has to freaken work.
In the process, I found some great looking guild sites with lots of features. I noticed a few of them where using SMF, tinyportal, and joomla. Just for the heck of it I downloaded SMF from here-
http://www.simplemachines.org/
So far I haven't delved into PHP development (but I respect PHP a lot and toy with messing with LAMP every so often. Anyway, I was pleasantly surprised to get a base install of the SMF forum up in about 10 minutes on my Host's Windows 2003 Server. Hats off to the developers who made SMF, great job.
But then I started looking at how to extend SMF and make it more portal like. I went to these spots for starters-
http://www.tinyportal.net/
http://joomla.org/
Everything looked very doable, but I started to realize I would need to dive into PHP a little bit to pull off what I wanted to accomplish. Plus I was a little worried about not having the full functionality SMF + others available to me because I'm running IIS. Plus the box is managed by my hosting provider, and I was worried about having to need admin rights on the box, so regardless of if all these concerns where legit or not, I decided to take a peak at some .Net based portals.
I checked out rainbow portal here-
http://www.rainbowportal.org/
It looked good, but then I seem to remember that my hosting solution might offer built in support for .Net nuke. So I did some research, and wa-la, dotnetnuke is awesome! I watched a quick video and I was sold. So the guild will go dotnetnuke.
http://www.dotnetnuke.com/
In a way I'm sad. I think the open source - LAMP crowd have made some great free portal software. But for now my tie to M$ and my hosting provider being windows based, plus their built in support for dotnetnuke pushed me that way.
But back to my original concept. It seems like the internet and its various technologies have been out long enough now so that we are starting to see various frameworks and projects gel together. These projects are actively developed by a lot of bright people. I think I'm finally starting to get that unless you are developing an application for a very specific need, you are cheating yourself and your customers if you don't take advantage of portals that have been built, used, modified, and expanded on by hundreds of smart people like you or me. So, from now on my first step in development is to check out what others have done, what tech they used, and how and if I can use what they have done before specking out something myself.
I know many of you probably shaking your heads...you have been doing this for years (part of the due diligence cycle). I'm slow, but I think I get it now. And not just because of my portal search. All the various javascript frameworks and such have also brought me to this conclusion.
Oh well, better late then never.
[Update...Sigh]
Well, dotnetnuke might be all that, if you can get the thing running. I used by web host's "automated install" option. It did something, but there are errors all over the place. Plus there is ZERO documentation on my web host's site, or if there is it is in such an obscure location that I can't find it...sigh.
So I download the dotnetnuke starter pack. Something installed, but nothing new shows up in either vs 2005 pro or visual studio 2008 visual studio expess.
Let's contrast that to SMF...which I got up and running in 10 minutes.
Who knows, I might be doing something wrong, something is f'ed up with the latest dotnetnuke installation, I don't know. I'll give it another shot tomorrow and spend about an hour more on it, if that doesn't work dotnetnuke is fired and I'll look for something else.
It has to freaken work.
Tuesday, June 03, 2008
Javascript Sound: Options
Essentially you can't do sound with Javascript yet, but you can call a Flash Object with javascript methods.
In the past I've used Sound Manager 2.
http://www.schillmania.com/projects/soundmanager2/
To be honest, Sound Manager has always been a buggy head ache to me. I've got it to work as a streaming MP3 player before, and once it works it works, but once again I battled Sound Manager today and I decided to look for something new.
That is when I found "Mandy". Mandy uses Jquery to look for events to trigger a sound, and then through some creative DOM manipulation Mandy adds a flash object to your page and plays the sound. I got Mandy to work in one try, as opposed to about 45 minutes with messing with Sound Manager and not getting it to work.
So you might want to give "Mandy" a try.
http://www.blog.mediaprojekte.de/webdevelopment/add-sound-effects-to-html-with-javascript-and-flash/
In the past I've used Sound Manager 2.
http://www.schillmania.com/projects/soundmanager2/
To be honest, Sound Manager has always been a buggy head ache to me. I've got it to work as a streaming MP3 player before, and once it works it works, but once again I battled Sound Manager today and I decided to look for something new.
That is when I found "Mandy". Mandy uses Jquery to look for events to trigger a sound, and then through some creative DOM manipulation Mandy adds a flash object to your page and plays the sound. I got Mandy to work in one try, as opposed to about 45 minutes with messing with Sound Manager and not getting it to work.
So you might want to give "Mandy" a try.
http://www.blog.mediaprojekte.de/webdevelopment/add-sound-effects-to-html-with-javascript-and-flash/
Monday, June 02, 2008
Basic Asp.Net Javascript Invocation of a Web Service
Here is a Hello World example of a client side event calling a web service. The code will underlap the side bar, just copy and paste to get the full code.
A simple webform...
The actual Web Service (SimpleWebService.asmx)
Have fun.
A simple webform...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ServiceCallBackExample._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
//http://omensblog.blogspot.com/2007/07/aspnet-ajax-web-service-calls-from.html
//http://www.asp.net/learn/ajax-videos/video-79.aspx
//http://www.davidhayden.com/blog/dave/archive/2007/11/07/CallingWebServicesUsingClientSideASPNETAJAXServerSideValidation.aspx
function Button1_onclick() {
ret = ServiceCallBackExample.SimpleService.SayHello(document.getElementById('Text1').value, OnComplete, OnTimeOut, OnError);
return(true);
}
function OnComplete(arg) {
alert(arg);
}
function OnTimeOut(arg) {
alert("TimeOut encountered when calling Say Hello.");
}
function OnError(arg) {
alert("Error encountered when calling Say Hello.");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/SimpleService.asmx" />
</Services>
</asp:ScriptManager>
<br />
<div>
<input id="Text1" type="text" /><br />
<br />
<input id="Button1" style="width: 158px" type="button" value="button" language="javascript"
onclick="return Button1_onclick()" /> </div>
</form>
</body>
</html>
The actual Web Service (SimpleWebService.asmx)
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
namespace ServiceCallBackExample
{
/// <summary>
/// Summary description for SimpleService
/// </summary>
[WebService ( Namespace = "http://tempuri.org/" )]
[WebServiceBinding ( ConformsTo = WsiProfiles.BasicProfile1_1 )]
[ToolboxItem ( false )]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class SimpleService : System.Web.Services.WebService
{
public SimpleService ()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string SayHello ( String Name )
{
return "Hello : " + Name;
}
}
}
Have fun.
Acrobat.com
ZDNet reported that Adobe launched an "Office killer" web based app called Acrobat.com. Might be worth a peak.
Saturday, May 31, 2008
New Tribe Found, Put in a Zoo
I'm all for gradual introduction of the tribe into our global world of ours, but isolating them so they can be "studied" and "protected" seems to me a bit like putting these people in a zoo.
Read more here-
http://news.bbc.co.uk/2/hi/americas/7426794.stm
[Update] - Guess the whole thing was a hoax. I got my all uppity over nothing :(
http://www.guardian.co.uk/world/2008/jun/21/amazon?gusrc=rss&feed=worldnews
Friday, May 30, 2008
Great Marketing Article with Societal Implications
I read the grokdotcom from time to time it is a great resource for marketing information. The following is an interesting post about "You" and the failure of the Web 2.0 hype (though not quiet framed that way in the article). What is interesting to me is the concept of information irrelevance, which is just another term for infocyde...hiding critical information by burying it. Though the article is targeted at marketeers, poli-sci geeks and wanna be philosophers like myself might find the article of interest.
Take a look here-
http://www.grokdotcom.com/2008/05/30/marketing-to-yourself/
Take a look here-
http://www.grokdotcom.com/2008/05/30/marketing-to-yourself/
More War B.S. Marine Busted for Handing Out Coin with Christian Verse On It
Some marines where handing out coins with a Bible verse on the coin to Iraqis. Some Iraqi elders got hot and bothered because Americans might influence Iraqi minds against Islam. A marine was busted and is in trouble, and our own president apologized to the Iraqis. Why are we over there again? To help prop up an Islamic dictatorship? If this is how the war is being waged, let's bring the troops home. We don't even know what we are fighting for.
Koodos to the marine for standing up for Jesus Christ and his country.
Thursday, May 29, 2008
Pretty Good Article About Partial Page Post And Ajax
I use the Telerik Ajax controls, which though are now based on MS AJAX under the hood still have their own client side enhanced API. But I don't have the Telerik Rad Controls at home, so I was researching how to do things the MS way when I stumbled upon the following article, which might be of some use to you.
http://aspnet.4guysfromrolla.com/articles/052808-1.aspx
http://aspnet.4guysfromrolla.com/articles/052808-1.aspx
Sunday, May 25, 2008
Age Of Conan: First Impressions
So I started playing Age of Conan with my wife (yes, she is a gamer...eat your heart out). So far I'm having a blast. If you are a hard core gamer I would recommend picking up the Age of Conan, but be warned, you need a pretty beefy box to run it on. My laptop, which is a dual core proc with a 256 meg dedicated graphics card gets only about 6-22 fps on the LOW settings in Conan. The game is still playable, but I wouldn't attempt playing it with anything less then a gaming rig that is a year or two old. I'm running a 12th level Priest of Mitra on the Shadowbane shard called Lotharum. If you play say hi. I'm still poking around the city running minor quest. I figure I'll play 2 or 3 nights a week, so I don't expect to rise through the ranks all that quickly.
Tuesday, May 20, 2008
Telerik RadComboBox Auto Complete Example
Ok, I found a few blog post and some documentation from Telerik on how to create a web service to populate a RadComboBox. None of the examples where complete, so here is a very basic example to get you going.
First, in design mode drag a RadScriptManager to your page. Switch to design mode, and click on the smart tag. Add the whatever it is called to your web config. Then drag a RadComboBox to your page. Then add the the Javascript so you have something that looks like below. Some of the code is obscured by the right side bar, just select the code and copy paste into a text viewer and it should all be there. I need to find sometime to either find a new blogging platform or widen out my blog a bit.
Ok, half way done. Now create the webservice. I called mine GetProducts. In order for it to work you have to use the RadComboItemData object as well as Generic list. Here is a sample webservice.
This came from a sample project that I was working on called Telerik_Error, thus the weird namespace reference. You can ignore that. Also not that in the javascript you can add additional variables to the context object, like I did with the variable test. Hope this code helps. The next step would be to include data. You should be able to pull in a datatable from a database and loop through it add items once you get the base webservice up and running.
First, in design mode drag a RadScriptManager to your page. Switch to design mode, and click on the smart tag. Add the whatever it is called to your web config. Then drag a RadComboBox to your page. Then add the the Javascript so you have something that looks like below. Some of the code is obscured by the right side bar, just select the code and copy paste into a text viewer and it should all be there. I need to find sometime to either find a new blogging platform or widen out my blog a bit.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Telerik_Error._Default" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<script type="text/javascript">
function OnClientItemsRequesting(sender, eventArgs)
{
var context = eventArgs.get_context();
context["FilterString"] = eventArgs.get_text();
context["test"] = "2";
}
</script>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
<telerik:RadComboBox runat="server" ID="RadComboBox1" Width="300px"
EnableLoadOnDemand="true"
OnClientItemsRequesting="OnClientItemsRequesting">
<WebServiceSettings Method="GetProducts" Path="Test.asmx" />
</telerik:RadComboBox>
</div>
</form>
</body>
</html>
Ok, half way done. Now create the webservice. I called mine GetProducts. In order for it to work you have to use the RadComboItemData object as well as Generic list. Here is a sample webservice.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Telerik.Web.UI;
using System.Collections.Generic;
namespace Telerik_Error
{
/// <summary>
/// Summary description for Test
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// To allow this Web Service to be called from script,
//using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class Test : System.Web.Services.WebService
{
[WebMethod(EnableSession=true)]
public RadComboBoxItemData[] GetProducts(object context)
{
IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;
List<RadComboBoxItemData> result = new List<RadComboBoxItemData>();
for (int i = 0; i <= 5; i++)
{
RadComboBoxItemData itemData = new RadComboBoxItemData();
itemData.Text = contextDictionary["test"].ToString() +
contextDictionary["FilterString"].ToString() + i.ToString();
itemData.Value = "value" + i;
result.Add(itemData);
}
return result.ToArray();
}
}
}
This came from a sample project that I was working on called Telerik_Error, thus the weird namespace reference. You can ignore that. Also not that in the javascript you can add additional variables to the context object, like I did with the variable test. Hope this code helps. The next step would be to include data. You should be able to pull in a datatable from a database and loop through it add items once you get the base webservice up and running.
Sunday, May 18, 2008
Localization in Classic ASP
I found a great blog post about performing localization (language translation) in Classic ASP.
Check it out here-
http://networkprogramming.spaces.live.com/blog/cns!D79966C0BAAE2C7D!379.entry
Check it out here-
http://networkprogramming.spaces.live.com/blog/cns!D79966C0BAAE2C7D!379.entry
Dude in Switzerland Pulls a Da Vinci
http://www.news.com/2300-11397_3-6239730-1.html?tag=ne.gall.pg
ASP.Net Connecting to An Access 2007 DB
I was fooling around at home and decided to use an Access 2007 DB in a small project. After checking out a few blogs, none of which had the solution completely correct, I got this working. Hopefully this will be useful to someone.
On your ASP.Net aspx page, here is a sample data source. Note, you want to use the SqlDataSource, not the access one. Weird huh?
default ConnectionStrings line with the following-
That should get you started.
Also, if you don't have Access 2007 installed on your server, you will need the new Access ODB driver-
http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
Is all this worth the extra effort then just downsaving your .accdb to an .mdf? From what I see probably not, but here is the info. Not sure which way I will go with things yet for my little project.
Sources:
http://www.connectionstrings.com/
http://weblogs.asp.net/steveschofield/archive/2008/05/03/iis-7-0-access-2007-and-asp-net-2-0.aspx
On your ASP.Net aspx page, here is a sample data source. Note, you want to use the SqlDataSource, not the access one. Weird huh?
<asp:SqlDataSource ID="MyDS" runat="server"In your web.config file, add the following connection string. If you haven't added on replace your
ConnectionString="<%$ ConnectionStrings:myConn %>"
ProviderName="<%$ ConnectionStrings:myConn.ProviderName %>"
SelectCommand="select * from mytable"></asp:SqlDataSource>
<add name="myConn"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=|DataDirectory\myDB.accdb;
Persist Security Info=False;"
providerName="System.Data.OleDb" />
That should get you started.
Also, if you don't have Access 2007 installed on your server, you will need the new Access ODB driver-
http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
Is all this worth the extra effort then just downsaving your .accdb to an .mdf? From what I see probably not, but here is the info. Not sure which way I will go with things yet for my little project.
Sources:
http://www.connectionstrings.com/
http://weblogs.asp.net/steveschofield/archive/2008/05/03/iis-7-0-access-2007-and-asp-net-2-0.aspx
Subscribe to:
Posts (Atom)