tisdag 18 september 2012

TinyMCE in JEditable


$.fn.tinymce = function(options){
   return this.each(function(){
      tinyMCE.execCommand("mceAddControl", true, this.id);
   });
}
function initMCE(){
   tinyMCE.init({
        mode : "textarea",
        theme : "advanced",
        ... // YOUR CUSTOMIZATION
      });
}

initMCE();

$.editable.addInputType('mce', {
   element : function(settings, original) {
      var textarea = $('<textarea id="'+$(original).attr("id")+'_mce"/>');
      if (settings.rows) {
         textarea.attr('rows', settings.rows);
      } else {
         textarea.height(settings.height);
      }
      if (settings.cols) {
         textarea.attr('cols', settings.cols);
      } else {
         textarea.width(settings.width);
      }
      $(this).append(textarea);
         return(textarea);
      },
   plugin : function(settings, original) {
      tinyMCE.execCommand("mceAddControl", true, $(original).attr("id")+'_mce');
      },
   submit : function(settings, original) {
      tinyMCE.triggerSave();
      tinyMCE.execCommand("mceRemoveControl", true, $(original).attr("id")+'_mce');
      },
   reset : function(settings, original) {
      tinyMCE.execCommand("mceRemoveControl", true, $(original).attr("id")+'_mce');
      original.reset(this);
   }
});
 
In your JEditable initiation make it of type mce. So:


    $(".edit").editable('ajax/save.php?editnotetext', {
        type
: 'mce',
       
... // etc
   
});
 





http://stackoverflow.com/a/5969896/517457

söndag 2 september 2012

Sound fix for SKYPE in UBUNTU

http://ubuntuforums.org/showpost.php?p=11086836&postcount=12 

Re: skype can only see pulseaudio, but not alsa devices

there's an easier way to make skype (i'm using 2.2.0.35) not use pulseaudio - there's no need to uninstall or disable pulse:

create an executable file
/usr/bin/skype-wrapper
with the following content:
PULSE_SERVER=127.0.0.1 /usr/bin/skype &

don't forget to also change the desktop file so that the new script will be called when choosing skype from the start menu:
edit file /usr/share/applications/skype.desktop
and change
Exec=skype
to
Exec=skype-wrapper

explanation:
PULSE_SERVER is a way to tell skype to use a pulse instance on a machine other than the local.
invalid values (e.g. empty string) make skype interrupt the startup and quit - so we give the local adress which is valid but obviously pulse runs at user level so it's not reachable via network, even not on the local machine.
skype tries to use pulse but cannot reach/connect to it and falls back to alsa.
the result on ubuntu natty is that pulse continues to work unmodified and skype can be configured to use whatever you want to



HOWEVER
the real problem - at least in my case - wasn't skype. the strange distortion came from somewhere below and was noticeable also in some other programs.
the real solution for my case was not to disable pulseaudio but to fix it: edit file /etc/pulse/default.pa
and change
load-module module-udev-detect
to
load-module module-udev-detect tsched=0

see http://pulseaudio.org/wiki/BrokenSoundDrivers

Last edited by thomas.horner; July 26th, 2011 at 03:11 AM..

måndag 27 augusti 2012

Android fixing R error in Android project in Eclipse

I've just spent half an hour trying to fathom how to get back my auto-generated R.java that magically disappeared at some point.

The usual ways of resolving issues such as clean build, restarting IDE, and wiping the screen clean with a damp cloth didn't work.

Googling around did reveal a lot of similar complaints and revived a stark deja vu feeling. The hilarious thing is that once the R guy is gone, a good chunk of your code goes red thus adding to the insult.

Rather than continuing the discovery of all the conceivable strains of the issue found in the wild, I decided to leverage the tried-and-true approach of staring at the code. Having done so for a while I spotted a few red guys under res folder. They were a leftover of my current redesign work that I was about to delete before things went awry. Sure enough, as soon as I hit Del on them the darn R thing automagically reappeared.

The moral of the story is there's just so much magic Google can do for us. Bad resources (e.g. layouts with errors) are not treated gracefully by Google Android Eclipse plugin and can deceive it into deleting R.java with no sound reason.
Posted by
Labels: android

semester på fårö

Längst ner...


www.sudersand.se/galleri/

Apache load balancing module

Apache loadbalancing module




http://wiki.magnolia-cms.com/display/WIKI/Guide+-+How+to+configure+an+apache+load+balancer