Refactor My Code - I Wish I’d Thought of It!

Written by Chris on August 15, 2008 – 9:03 pm -

refactormycode.com is a fledgling website setup as a project by French Canadian  Ruby Developer Marc-André Cournoyer and basically it's like a coding forum without the usual forum junk, style and obfuscation of content (forums for me are always a pain to use because of the tiers of information you have to go through).

It's a great looking website covering all the current major programming languages (at least when thinking of the web) and the idea behind it, though simple, seems to work really well.

Basically, you have some code that works, but you want to make it better, more efficient, or just tidier. So, you post your code sample and other people suggest changes. It's kind of like yahoo answers for developers or the comments foot of the PHP manual.

The code to be refactored, so far in the PHP section at least, has been of a reasonable standard i.e. that of at least intermediate developers, which is great as these services can tend to get flooded by newbies who don't know their $i++ from their ++$i :p and rapidly lose interest for me.

So far there are only a few PHP samples on there to comment on but I think, as the site begins to grow, there will be a wealth of well developed and critiqued code that serves as good examples or directly useable functionality.

So far I can't really fault it, other than making the "Best" link clearer by calling it "Best Refactorors"  or something similar, and providing some closed, or accepted answer(s) type functionality to stop a thread getting out of hand (it could be that this exists already but I just haven't seen it yet). Maybe even an option to download each refactoring as a plain text file could be useful.

So, to round up, as you can probably tell, I love this site and you can see my standing in the community in the foot of this page! Keep up the great work Marc and I hope your site develops in the way it deserves and gets the recognition it should!



Popularity: 96% [?]

Sphere: Related Content


Tags: , , , , , , , , ,
Posted in Flash, JavaScript, PHP, Web Development | 1 Comment »

JW Media Player - A Godsend For Flash Streaming

Written by Chris on November 18, 2007 – 9:25 pm -

So, you want or need to stream multimedia content from your website; you don't have time or money to figure out or pay someone to figure out how to do what you need; and you need it to look reasonably pro.

Where do you go?

Well I'll tell you: You go here: http://www.jeroenwijering.com and download JW Media Player

 It's a fantastic, versatile free piece of software you can just plug into any website and use to start streaming content right away!

The best thing however, is that it works really well alongside the Red 5 streaming flash server via the oflaDemo app, and as such completes the package of a free streaming flash solution that looks good and performs well.

Just remember, when following the examples of how to get it to work with at least true streams (i.e. not progressive downloads) give the mediaplayer.swf an absolute url ;)

If anybody needs help getting this to work with Red 5 feel free to drop me an email or leave a comment and I'll help you out :)



Popularity: 31% [?]

Sphere: Related Content


Tags: , , , , , , , , ,
Posted in Flash, JavaScript, Red5, Streaming | 9 Comments »

Making Flash Sites Easy

Written by Chris on September 21, 2007 – 2:11 pm -

OK, so a lot of people probably already know about this nifty little javascript but I didn't so I thought I'd give a quick mention.

I was talking with a friend of mine earlier today about flash sites and what happens when a search engine bot tries to index them - presumably they can't access the content of the flash movies directly and as such content gets missed,  right?

 Well, though this is probably true the SWFObject (http://blog.deconcept.com/swfobject/) javascript gets around this very neatly by rewriting <div> tags to show flash content if the plugin exits or just offing up a html alternative if you don't have flash or even javascript installed (or turned on).

This neat solution means that any search engine bot that can't deal with flash fully can very easily get relevant information from the page for its indexes, and also any visitor using a non-flash browser or who doesn't have the flash plugin installed can still view the site to a usable extent.

Nice work, and thanks to Jon for pointing it out!

You can visit Jon's sites here:

http://www.welshpanoramas.com/

http://www.nosstazenith.co.uk/



Popularity: 10% [?]

Sphere: Related Content


Tags: , , ,
Posted in Flash, JavaScript | 2 Comments »

Installing Red5 Open Source Flash Media Server On CentOS 4.2

Written by Chris on September 19, 2007 – 11:41 pm -

After having no end of issues with the proprietary flash media server 2 from Adobe I decided to give installing the Red5 open source version a go instead.

I have to say I was fairly impressed with just how easy it was to get running without having to do any of the faffing around that was required to get FMS2 running.

Here is the process in a nutshell:

  1. Download and install the Java Development Kit (jdk) from here (I used the rpm version of JDK 6 Update 2): http://java.sun.com/javase/downloads/index.jsp
  2. Download and extract Apache ant from here: http://archive.apache.org/dist/ant/binaries/apache-ant-1.6.5-bin.tar.gz
  3. Copy the extracted apache-ant-1.6.5 folder to /usr/local/ant
  4. Setup the environment variables to include the path for java and ant by typing the following at the shell prompt:PATH=$PATH:$HOME/bin:/usr/local/ant/bin
    export PATHThen also remember to add this to  /etc/profile so the settings don't get lost the next time you login
  5. Download and extract the Red5 server from here: http://osflash.org/red5
     
  6. cd to the Red5 directory you just extracted and type the following at the shell prompt to allow java to retrieve the files it needs from the net and compile and run the server as a background process (the module retrieval is automatic and only has to be done once):ant server & 
  7. Then that's it it's running. In my case I needed to kill the ant/java processes running the server after the java modules were initially retrieved and the server built for the first time, but the second time it was fine even though it did take about 30 seconds to fully startup - this may just be a glitch on my system as I have a lot of other stuff also going on.
  8. The final step is to test it. This can be done by moving the contents of the webapps/root/demos/ folder from the extracted Red5 directory to a webserver somewhere (I don't think it hast to be the same machine) and then viewing the list of demos in the index.html file.I started off by using the port tester to make sure the demo apps could actually connect to the server on the ports they were meant to (basically rtmp port 1935) and then moved onto testing the video streaming app and then tried a proper live broadcast through the server using the simpleBroadcaster app to two friends who were logged on using the simple subscriber app. All worked well especially as far as the video was concerned though the audio was a little crackly on my live broadcast - this could just be the quality of home connections however.The only last not is just a simple reminder that when running the test apps you'll need to specify the server they need to connect to - the apps are setup to access rtmp://localhost/[APP_NAME] but if you're not running these apps as a local user you will need to change localhost to the name or ip of the server Red5 is installed on :)

So far I'm quite happy with Red5 as a free (very important) alternative to FMS2, but should you be looking for a commercial product as this is not quite up your street (that is a cheaper than FMS2) then take a look at this instead: http://www.wowzamedia.com/index.html

Wowza only requires java to run and is like a very polished commercial version of the Red5 server (it was actually through installing Wowza that I worked out what to do with the web apps for Red5 - having had no previous experience in flash streaming other than literally installing FMS2) which has a very reasonable price tag in comparison to the cost of FMS2

Just before I go I just need to mention the map below - Red5 ask you to add yourself to their user map if you're using the software so I have - you can find me in Brighton, England :)

gyo Installing Red5 Open Source Flash Media Server On CentOS 4.2s Installing Red5 Open Source Flash Media Server On CentOS 4.2p Installing Red5 Open Source Flash Media Server On CentOS 4.2h Installing Red5 Open Source Flash Media Server On CentOS 4.2

Popularity: 40% [?]

Sphere: Related Content


Tags: , , , , , , , , , , ,
Posted in CentOS, Flash, Linux, Red5, Streaming | 6 Comments »
RSS