Rails flash notice via ajax

Here is an example that I got working, thanks to Rich Peck’s answer. I needed to use flash.now to make sure the flash notice didn’t persist. AJAX trigger in the view: <%= link_to “Email report”, users_path, remote: true %> Controller: # app/controllers/users_controller class UsersController < ApplicationController def index # do some things here respond_to do … Read more

What algorithms could I use for audio volume level? [closed]

human perception in general is logarithmic, also when it comes to things as luminosity, etc. … this enables us to register small changes to small “input signals” of our environement, or to put it another way: to always percieve a change of a perceivable physical quantity in relation to its value … thus, you should … Read more

Adobe AIR to execute program

With AIR 2.0 you now can: if(NativeProcess.isSupported) { var file:File = File.desktopDirectory; file = file.resolvePath(“StyleLookupold.exe”); var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo(); nativeProcessStartupInfo.executable = file; var process:NativeProcess = new NativeProcess(); process.start(nativeProcessStartupInfo); } You also need to add this to your descriptor file. <supportedProfiles>extendedDesktop</supportedProfiles>

konami code in flex

A state machine is fun to write, but in this case I’d go with a signature pattern. Depending on where you want to put the handler (on the stage of the component), here’s some code that should work, though you can probably tighten it (and of course customize it to your specific need): // up-up-down-down-left-right-left-right-B-A … Read more

How can I determine a user’s locale within the browser?

The proper way is to look at the HTTP Accept-Language header sent to the server. This contains the ordered, weighted list of languages the user has configured their browser to prefer. Unfortunately this header is not available for reading inside JavaScript; all you get is navigator.language, which tells you what localised version of the web … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)