Stumbled across this Quick Look plugin the other day while learning Objective-C, and while it previewed and code colored my .h and .m files, it was a bit disappointing that it didn’t work on .as files.
So not quite as simple as adding .as to the info.plist—what I’ve done is add public.archive.applesingle to the list of UTI types. This is a bit of a hack, because Adobe doesn’t export a profile UTI with .as files. So if they do start doing that someday, this may cause problems, but in the meantime, it’s the simplest way to get quicklook working for .as files.
Have to find the correct version of that logo to add to flash, but don’t want to load them all in the unbelievably slow preview app, or bother loading up Illustrator only to find out the designer sent you a photoshop eps without vector data? Sorry I’m venting a bit, but this plugin really saves me time—and it’s free. EPS Quicklook Plugin
There’s actually a whole bunch of other plugins that are helpful too (beware: the zip one is pretty slow though). List of Quick Look Plugins for Leopard
I don’t know where the capitalization came from, but it’s such a simple API for anyone who’s happy with AS3 (is there anyone who isn’t?) that FIVe3D worth the challenging finger-work. I made this demo in about 3 hours total, it draws bitmaps, and adds them to Sprite3Ds, and mimicks what we’ve been working on for 2 months in Papervision3D (I’ll definitly have a link to that when its fully launched).
For a great many simpler 3D applications, I think FIVe3D is the way-to-go, but Papervision3D still does have an edge in speed (when properly optimized that is) if dealing with more then 20 or so planes.
One quirk of FIVe3D that I initially didn’t get, was that the order of my addChild statements determines what shows up on top of what, not the Z value of the sprite, so included with this source is a handy depth sorter loop, that will work with any 53D setup.
Also modified it a little so that height and width could be stored in the sprite3D class, i know bad me, but until i get my head around Mathieu’s version of Matrix3D. That ugly blinking plane on the right side is actually a series of bitmapDatas, that are playing back (like cached animation) that I learned from John Grden a few weeks ago. I’m working on my own version of a class to automatically create bmp animations from a timeline swf, unless his goes open source…
Finally had an excuse to make some connected springs, ala the Visual Thesaurus. This was the last of the tests before realizing that the project would be simpler.
Double-click a dot to add a child dot, or click and drag any dot to move it.
Sorry it has been so long since my last post. I doubt anyone is reading this anyways. In this article i’m going to attempt to show you what you need to know in order to upload a file (music in this case) into your rails application and safely tuck it away on amazons simple storage solution. I realize this is a very specific application. However, it took me two days to get this working properly so I figured i’d share what I did in order to get this working. I’m assuming you are using rails 2.1 (but that may not be required) and have already created your application. if not you can create and application by issuing the typical rails application_nam command
If you are just planning to upload file to S3 and do not need to manipulate them else do anything to them before they end up on the server. Then I suggest you just use the plugin.
No simple way to manipulate the file or extract data from it before sending to S3
So now that we are going to perform this operation manually there are a few things you will need for this example. You will need to install the mp3info gem as root at command prompt. gem install mp3info gem install aws-s3
Say yes to any dependencies once those two gems successfully install you will have to restart your webserver and they will be ready to use in your application
I’m going to skip over a lot here because I don’t know how you want to configure your application however the steps are pretty simple create some scaffold. Make an upload form.
and then save the data. I’m only going to show you the model code. I believe everything is self explanatory from there. I will be happy to field any questions if anyone cares to ask. Enought chit chat show me the code
require"ftools"require"aws/s3"require"mp3info"class Song <ActiveRecord::BaseincludeAWS::S3
belongs_to :user
has_one :song_metadata
before_validation :set_all_meta_data
after_save :write_file
after_destroy :delete_file
before_create :connect_to_amazon
validates_inclusion_of :mime_type, :in=>%w( audio/mpeg audio/mpg ), :message=>"The file you uploaded is not an mp3"
validates_inclusion_of :file_size, :in=>300.kilobytes..20.megabytes, :message=>"must be between 300k and 20mb"
attr_accessor :id3tagsdef song=(file_data)@file_data = file_data
enddef write_file
buckets = Service.buckets
bucketexists=false
buckets.eachdo |bucket|
if bucket.name == AppConfig.ec2["bucket"]
bucketexists=trueendendif !bucketexists
Bucket.create(AppConfig.ec2["bucket"])end@file_data.rewindif !S3Object.exists? get_file_url, AppConfig.ec2["bucket"]
createsong_meta
S3Object.store(get_file_url, @file_data.read, AppConfig.ec2["bucket"],:access =>:public_read)endenddef createsong_meta
m = SongMetadata.newself.song_metadata = m
if id3tags.title
m.title = id3tags.titleelse
m.title = "No song name set"endif id3tags.artist
m.artist = id3tags.artistelse
m.artist = "No artist name set"endif id3tags.album
m.album = id3tags.albumelse
m.album = "No album name set"end
m.year = id3tags.year
m.track_number= id3tags.tracknum
m.save!
enddef get_song
self.connect_to_amazon
S3Object.value mp3_url, AppConfig.ec2["bucket"]enddef delete_file
self.connect_to_amazon
S3Object.delete mp3_url, AppConfig.ec2["bucket"]enddef set_all_meta_data
if@file_data!=""&&@file_data@file_data.rewindself.mime_type = @file_data.content_typeifself.mime_type == "audio/mpg" || self.mime_type=="audio/mpeg"
tmplocal = "#{RAILS_ROOT}/tmp/musicfiles"
tmpname = "#{Time.now}-#{@file_data.original_filename}"File.makedirs(tmplocal)File.open("#{tmplocal}/#{tmpname}", "w"){ |file| file.write(@file_data.read)}
mymp3 = Mp3Info.open("#{tmplocal}/#{tmpname}")self.id3tags = mymp3.tagself.bitrate = mymp3.bitrateself.samplerate = mymp3.samplerateself.samplerate = mymp3.samplerateself.mpeg_version= mymp3.mpeg_versionself.layer = mymp3.layerself.length = mymp3.lengthself.file_size = @file_data.size
mymp3.closeFile.delete("#{tmplocal}/#{tmpname}")self.mp3_url = get_file_url
endendenddef get_file_url
"#{user_id}/xrays/#{id}/song/#{@file_data.original_filename}"enddef connect_to_amazon
Base.establish_connection!(:access_key_id=> AppConfig.ec2["access_key"], :secret_access_key=> AppConfig.ec2["secret_key"])endend
That is really the meat and potatoes. It is all hanging out in the model nicely tucked away. getting the data out of S3 is simple and is left as an exercise for the reader. Obviously you need to insert your own access_key and secret key. I’m not making any assumptions about the configuration of your application and thus this is entirely us to you the reader as well. Hope this helps someone..
So we’ve been developing in Flex 3 for the last 3 months now, and I’m wondering why I didn’t switch earlier… Anyway a small annoyance that bothered me for the first couple weeks was the inability to double click any files that needed to be edited outside of Flex. It just throws this weird error:
Unable to open external editor…
(com.adobe.flexbuilder.ui.osx_3.0.194161) Sort of more about the error here…
With a little research it seems that this is a problem with the System Editor settings with Eclipse itself (which Flex Builder is based, for the noobs like I me).
So taking a bit of a shot in the dark I looked through com.adobe.flexbuilder.ui.osx_3.0.194161, and it didn’t seem to have anything other then commands to open system editable? files. So just deleted the package from the plugins folder (actually i moved it to a plugins-disabled folder in the main Flex directory), and holy crap it worked!
So far I and my co-developer Sean, and our intern Derek haven’t come across any other errors, or changes in performance, just the unfettered ability to double-click FLAs and watch them load in Flash.
Give it a try and lemme know if your results vary. Though I suppose you should be doing so at your own risk…
This was part of a Rock’em Sock’em Robot game& 8212;for an internal sales project no less! At any rate the budget was good, but the timeline was a little tight, and I was still getting my head around AS3 and the new Flash 9 features.
So I had this idea:
I’m working with a bunch of designer’s who are really good with illustrator, and keyframe animating, but don’t have the time to animate all the movements (each head, body, upper arm x2 lower arm x2, legs, hands, feet… well you get the idea). So I needed a way to reduce the number of animations that the designers would be needed for, but also not create too many Tweeners or other hard coded animation solutions. I really needed bones, but those don’t seem to be arriving for a while, so the next best thing was automatically animated elbows (and knees). Fortunately for me the illustrator I was working with designed the robot’s arms and legs with even length upper and lower lengths so I could do some trig and get this:
Right now it’s limited to even length bones, but my little brother with the physics and math degrees, says he has a better equation, so as soon as I have time I’ll update the classes. A public SVN repository is in the works too, stay tuned.
During a day of red5 programming, in the hopes to get a true streaming solution for my flash projects I stumbled upon this little gem. I’ll post about my experiences with red5 at a later time. However, for now I think you should check out this excerpt from the rsyslogd man pages. We are using rsyslog in the hopes that we can log all the red5 events to a centralized server for easier reporting. Check back for updates on that. As always if you like this article please digg it and or leave a comment so we don’t feel like we are talking to ourselves…. Enjoy
At least the suggest violence as a last ditch effort. Hilarious open source world keep it up…
For an example site where I used this technique please refer to www.howcuteismypet.com you’ll notice that when you click on best / worst or most recent it is highlighted with a black underline. This type of highlighting seems trivial. However to do it in rails in a nice elegant way is not obvious. So without further a do, I present my method. This method dis-involves the controller which makes for a cleaner more centralized place for managing your highlighted navigation.
The primary thing required is a method for creating navigation items. I choose to put my method / helper. in the app/helpers/application_helper.rb that way it will be available to all all of my views. The method I chose to use is
def nav_selected_no_span(hash_name, selectedkey )
result =""
hash_name.eachdo |item|
if(item[0].to_s== selectedkey)
result +="<li class="selected"+item[0].to_s.gsub("", "_").downcase+" selected">"+link_to(item[0].to_s,item[1].to_s)+"</li>"else
result +="<li class=""+item[0].to_s.gsub("","_").downcase+" ns">"+link_to(item[0].to_s,item[1].to_s)+"</li>"endendreturn result
end
This function is fairly, simple what it allows you to do in your view is, make an unorded list of your navigation items. You would use this method most likely in your app/views/layout/application.rb. An example of the navigation from howcuteismypet.com is:
<ul><%= nav_selected_no_span([["Vote On Pets",home_path],["Best / Worst",best_worst_path],["Most Recent",most_recent_path]], params[:location])%></ul>
The important thing to notice is the params[:location] the function above says that if params[:location] matches one of the names like “Vote On Pets” then highlight that item. Pretty simple. Then in your css you can define the rules that make something selected. Now you may be wondering where params[:location] is set. And you would be correct to wonder that. That parameter is actually set in your routes file believe it or not. As an example i’ll show you the route for “Vote On Pets”. located in config/routes.rb your could do something like this.
The location parameter is sent to the helper and the correct items is selected. So I hope this helps you in your efforts to stay dry and much more organized.
Questions and comments are very welcome on this blog. We like to know we are not talking to ourselves, so if you would like further explanation please feel free to post a comment.
So a reader asked how to implement our accordion script using XML to populate it, and I think the results aren’t half bad. I’m not sure what he meant by a cervical shaped accordion though… Circular maybe? hopefully?