0

Reencode videos for Blackberry 8100

Linux, Ubuntu

After much searching/trying stuff I have found a way to successfully re-encode videos that can play on my Blackberry Pearl.


mencoder -vf expand=:::::4/3,scale=240:180 "[entervideohere]" -o "[enteroutputhere]" -of avi -ovc lavc -oac mp3lame -lavcopts vcodec=mpeg4:vbitrate=230:acodec=mp3:abitrate=64

Obviously you need to have mencoder installed

I am not completely sure what other dependencies there are, since I tried installing so many different tools....but I THINK you need the following:  lame, ffmpeg .

 

0

Updates to cf_scriptalizer and InstantSpot.com

For those of you interested, I have made another slight update to my custom tag cf_scriptalizer. After implementing the custom tag on all of the InstantSpot.com user sites I noticed that I mistakenly left in code to rewrite the config file every time a new file combination was passed.

Now, it works as designed. Every unique combination of Javascript files is managed on its own, that way we don't have to have one generic combined/minified file.



The latest version of the tag can be downloaded here.

0

Updates to Scriptalizer.com

This morning I made a change to Scriptalizer.com to accept more known MIME types. So if anybody was trying it and getting the 0KB result, please try it again.

For those interested, a JavaScript file's MIME will look different based off of where it originates (browser sending it).

Here are the ones I know about:
  • text/ecmascript
  • application/ecmascript
  • text/jscript
  • application/x-js
  • application/javascript
  • application/x-javascript
  • text/javascript
  • application/octet-stream

0

Combine and compress your javascript files: Scriptalizer.com

ColdFusion, Internet, Web Development, Javascript

After creating a custom tag and minifier component (using YUICompressor) I decided it would be a pretty neat service to offer to everybody.  Last night I scrounged up a website and called it Scriptalizer.com

If you want to test what cf_scriptalizer does to your javascript before you actually use the tag, you can try out the generated script provided by Scriptalizer.com.

 

NOTE: All source files uploaded is immediately deleted once generated.

 

0

Problem: WAY too many javascript files. Solution: cf_scriptalizer

ColdFusion, Internet, Web Development, Javascript

We all know JQuery is awesome right? That should be common knowledge by now. But, if you have ever created an app that makes use of several of the fantastic plugins available for JQuery, then you are going to end up with multiple tags for JQuery alone...not to mention any of your own external javascript files.

So, why is this a problem?

First of all, there is a little bit of bloat going on in this scenario. One could easily end up with over 200Kb of javascript in an assortment of these files. The other thing to consider is that the browser can only make so many concurrent connections to the web server (each external javascript file is one connection by the way) so add all of these files, a bunch of images, a couple .css files and we are making that user wait longer than really necessary.

Lets reduce the number of browser - to - server connections.

That seems easy enough. Instead of multiple external script calls:

<script type="text/javascript" src="/js/jquery/jquery.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.form.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.jqModal.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.history_remote.pack.js"></script>

We could combine them all into one big javascript file and reference it:

<script type="text/javascript" src="/js/myBigScript.js"></script>

Well what happens when you want to make a change to one of the source js files? Or you need to change the order of how the files are included? Or maybe the javascript files needed vary based off of where you are in your app and you don't want to include ALL of the files every time? Thats where I think I can help...

I have just recently (as in today) finished up a custom tag to do just that. For lack of a better name I called it <cf_scriptalizer> Here is an example use of the custom tag.

<cf_scriptalizer 
	filePrefix="myscript"
		
	scriptalizerDirectory="/js" 
	
	scriptFileList="
		/js/jquery/jqModal.js,
		/js/jquery/jquery.js,
		/js/jquery/jquery.MultiFile.js,
		/js/jquery/jquery.blockUI.js,
		/js/jquery/jquery.corner.js,
		/js/jquery/jquery.form.js,
		/js/jquery/jquery.history_remote.pack.js,
		/js/jquery/jquery-dom.js
		"

	reload="true"
	>

  • filePrefix (optional): prefix of the generated javascript file. "scriptalizer" by default
  • scriptalizerDirectory: relative path to the desired output location
  • scriptFileList: list of js files in the order you would include them
  • reload (optional) - scriptalizer will inspect each js file for changes made since last access

More about reload: When/if you pass reload=true, <cf_scriptalizer> will inspect each of the source javascript files and if a change is detected, regenerate the combined javascript file.

 

Now that we have reduced the number of connections for external javascript files down to just one for this request, what can we do about reducing the size.

<cf_scriptalizer> takes an additional optional attribute of "minifierObject" as seen in the example below:

<cfset minifier = CreateObject("component","com.cfyuiminifier.cfYUIMinifier").init(path="/com/cfyuiminifier")/>

<cf_scriptalizer 
	filePrefix="myscript"
	scriptalizerDirectory="/js" 
	scriptFileList="
		/js/jquery/jqModal.js,
		/js/jquery/jquery.js,
		/js/jquery/jquery.MultiFile.js,
		/js/jquery/jquery.blockUI.js,
		/js/jquery/jquery.corner.js,
		/js/jquery/jquery.form.js,
		/js/jquery/jquery.history_remote.pack.js,
		/js/jquery/jquery-dom.js
		"
	minifierObject = #minifier#	
	reload="true"
	>

As you can see, I am passing in the object "minifier" that contains the method minify() that accepts a string of all of the comibined javascript and returns a string of the minified javascript.

This additional component was abstracted from the custom tag itself just in case the user has some issue with YUICompressor or wants to implement his/her own solution to compress/clean/minify/etc the source javascript.

In this example, the combined jquery files resulted in a 123.1 KB javascript file (pre-minification). But, once cfyuiminifier.minify() was run on the source, we ended up with a combined javascript file that was only 79.7 KB!

CAVEATS:

I have not yet run this on any live sites.

This is brand new code from my scribble pad, so please be aware you may encounter some bugs!

This was developed on my Linux machine and haven't tested it anywhere outside of this environment.

DOWNLOADS:

 

If anybody has any specific requests for features, or would like to contribute please let me know. I wrote this in an attempt solve a specfic need for some applications I have been working on, and ended up with something I thought might be beneficial to others. Please report back with any successes (or failures) with this tool...I am very interested in hearing about your experience(s).

 

0

Reading is fundamental: AJ's Summer Reading List

Miscellaneous
Recently, while I was reading and enjoying Atlas Shrugged (by Ayn Rand), I came across a list of books somebody suggested everybody read. Unfortunately I have forgotten where I saw it... But, I took his list, massaged it a little, and came up with my own.

Here is a list of the next 10 books coming up from my list:

Title Author
The Great Gatsby F. Scott Fitzgerald
The Prince Niccolo Machiavelli
Slaughter-house Five Kurt Vonnegut
1984 George Orwell
The Republic of Plato: Second Edition Plato
The Brotherrs Karamazov Fyodor Dostoevsky
The Catcher in the Rye J.D. Salinger
The Wealth Of Nations Adam Smith
For Whom the Bell Tolls Ernest Hemingway
The Picture of Dorian Gray Oscar Wilde

tags:
Books

Search