- Goto your Applications directory where Dia.app exists (mine was located at: /Applications)
- Right click the icon and click on Show Package Contents
- Goto the directory Dia.app/Contents/Resources/bin
- Edit the file dia, in your favourite text editor.
- After line 39, add the line: export DISPLAY=:0
- Save and exit.
- Close XQuartz if its running.
- Now Dia should come up.
- If it does not come up, try restarting your computer.
Technical Blog
Wednesday, October 29, 2014
Dia Diagram Mac OSX Yosemite Fix
Friday, November 19, 2010
jQuery Ajax script for multipart/form-data POST method
//When the DOM is ready
$(document).ready(function(){
//When the submit button is clicked
$('form').submit(function(event) {
strPath =$('form').attr('action')
//Check if the action attribute is set
if(strPath){
//This is to prevent the default submit behaviour of button
event.preventDefault()
//Get content from form as multipart
strContent = $.getMultipartData('#'+this.id);
//Do ajax call for posting to server
$.ajax({
type:'POST',
url:'',
contentType: 'multipart/form-data; boundary='+strContent[0],
data: strContent[1],
success: function(msg){
alert("data is:"+msg)
}
})
}else{
alert('Please fix action attribute in form');
}
});
});
$.getMultipartData = function(frmName){
//Start multipart formatting
var initBoundary= $.randomString();
var strBoundary = "--" + initBoundary;
var strMultipartBody = "";
var strCRLF = "\\r\\n";
//Create multipart for each element of the form
jQuery.each($(frmName).serializeArray(),function(){
strMultipartBody +=
strBoundary
+ strCRLF
+ "Content-Disposition: form-data; name=\\"" + $(this).attr('name') + "\\""
+ strCRLF
+ strCRLF
+ $(this).val()
+strCRLF;
});
//End the body by delimiting it
strMultipartBody += strBoundary + "--" + strCRLF;
//Return boundary without -- and the multipart content
return [initBoundary,strMultipartBody];
};
$.randomString = function() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 8;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
return randomstring;
};