Search Results

Search found 151 results on 7 pages for 'unlink'.

Page 4/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • need export query rather than creating file for mysqldump without triggers.. See description

    - by OM The Eternity
    I have code as $db_name = "db"; $outputfile = "/somewhere"; $new_db_name = 'newdb'; $cmd = 'mysqldump --skip-triggers %s > %s 2>&1'; $cmd = sprintf($cmd, escapeshellarg($db_name), escapeshellcmd($output_file)); exec($cmd, $output, $ret); if ($ret !=0 ) { //log error message in $output } Then to import: $cmd = 'mysql --database=%s < %s 2>&1'; $cmd = sprintf($cmd, escapeshellarg($new_db_name), escapeshellcmd($output_file)); exec($cmd, $output, $ret); //etc. unlink($outputfile); Bow here what should i do to get the export query, rather than creating a file everytime?

    Read the article

  • Two Button Columns on a GridView Control

    - by Bob Avallone
    I have a grid view will two different button columns. I want to perform a different action depending on what button the user presses. How in the SelectedIndexChanged event do I determine what colmun was pressed. This is the code I use to generate the columns. grdAttachments.Columns.Clear(); ButtonField bfSelect = new ButtonField(); bfSelect.HeaderText = "View"; bfSelect.ButtonType = ButtonType.Link; bfSelect.CommandName = "Select"; bfSelect.Text = "View"; ButtonField bfLink = new ButtonField(); bfLink.HeaderText = "Link/Unlink"; bfLink.ButtonType = ButtonType.Link; bfLink.CommandName = "Select"; bfLink.Text = "Link"; grdAttachments.Columns.Add(bfSelect); grdAttachments.Columns.Add(bfLink);

    Read the article

  • TinyMce plugin, how to copy 'Link' functionality.

    - by Tom
    I'm creating a new plugin for TinyMce. However I cannot find any examples to see some of the functionality I've seen in other plugins. I've read their source code but I cannot find where it is done: When you click on an 'A' element, the link/unlink buttons in the taskbar become enabled. When you right click on an 'A' element, then click on the "Insert/edit link" icon that is shown in the popup menu, the "Insert/edit link" window is setup (has all the attributes for that particular link) prefilled. Could you suggest somewhere where I could learn how to do this? A file and line number is fine. Thanks in advance.

    Read the article

  • Using jQuery, CKEditor, AJAX in ASP.NET MVC 2

    - by Ray Linder
    After banging my head for days on a “A potentially dangerous Request.Form value was detected" issue when post (ajax-ing) a form in ASP.NET MVC 2 on .NET 4.0 framework using jQuery and CKEditor, I found that when you use the following: Code Snippet $.ajax({     url: '/TheArea/Root/Add',     type: 'POST',     data: $("#form0Add").serialize(),     dataType: 'json',     //contentType: 'application/json; charset=utf-8',     beforeSend: function ()     {         pageNotify("NotifyMsgContentDiv", "MsgDefaultDiv", '<img src="/Content/images/content/icons/busy.gif" /> Adding post, please wait...', 300, "", true);         $("#btnAddSubmit").val("Please wait...").addClass("button-disabled").attr("disabled", "disabled");     },     success: function (data)     {         $("#btnAddSubmit").val("Add New Post").removeClass("button-disabled").removeAttr('disabled');         redirectToUrl("/Exhibitions");     },     error: function ()     {         pageNotify("NotifyMsgContentDiv", "MsgErrorDiv", '<img src="/Content/images/content/icons/cross.png" /> Could not add post. Please try again or contact your web administrator.', 6000, "normal");         $("#btnAddSubmit").val("Add New Post").removeClass("button-disabled").removeAttr('disabled');     } }); Notice the following: Code Snippet data: $("#form0Add").serialize(), You may run into the “A potentially dangerous Request.Form value was detected" issue with this. One of the requirements was NOT to disable ValidateRequest (ValidateRequest=”false”). For this project (and any other project) I felt it wasn’t necessary to disable ValidateRequest. Note: I’ve search for alternatives for the posting issue and everyone and their mothers continually suggested to disable ValidateRequest. That bothers me – a LOT. So, disabling ValidateRequest is totally out of the question (and always will be).  So I thought to modify how the “data: “ gets serialized. the ajax data fix was simple, add a .html(). YES!!! IT WORKS!!! No more “potentially dangerous” issue, ajax form posts (and does it beautifully)! So if you’re using jQuery to $.ajax() a form with CKEditor, remember to do: Code Snippet data: $("#form0Add").serialize().html(), or bad things will happen. Also, don’t forget to set Code Snippet config.htmlEncodeOutput = true; for the CKEditor config.js file (or equivalent). Example: Code Snippet CKEDITOR.editorConfig = function( config ) {     // Define changes to default configuration here. For example:     // config.language = 'fr';     config.uiColor = '#ccddff';     config.width = 640;     config.ignoreEmptyParagraph = true;     config.resize_enabled = false;     config.skin = 'kama';     config.enterMode = CKEDITOR.ENTER_BR;       config.toolbar = 'MyToolbar';     config.toolbar_MyToolbar =     [         ['Bold', 'Italic', 'Underline'],         ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'Font', 'FontSize', 'TextColor', 'BGColor'],         ['BulletedList', 'NumberedList', '-', 'Outdent', 'Indent'],         '/',         ['Scayt', '-', 'Cut', 'Copy', 'Paste', 'Find'],         ['Undo', 'Redo'],         ['Link', 'Unlink', 'Anchor', 'Image', 'Flash', 'HorizontalRule'],         ['Table'],         ['Preview', 'Source']     ];     config.htmlEncodeOutput = true; }; Happy coding!!! Tags: jQuery ASP.NET MVC 2 ASP.NET 4.0 AJAX

    Read the article

  • Is it appropriate to try to control the order of finalization?

    - by Strilanc
    I'm writing a class which is roughly analogous to a CancellationToken, except it has a third state for "never going to be cancelled". At the moment I'm trying to decide what to do if the 'source' of the token is garbage collected without ever being set. It seems that, intuitively, the source should transition the associated token to the 'never cancelled' state when it is about to be collected. However, this could trigger callbacks who were only kept alive by their linkage from the token. That means what those callbacks reference might now in the process of finalization. Calling them would be bad. In order to "fix" this, I wrote this class: public sealed class GCRoot { private static readonly GCRoot MainRoot = new GCRoot(); private GCRoot _next; private GCRoot _prev; private object _value; private GCRoot() { this._next = this._prev = this; } private GCRoot(GCRoot prev, object value) { this._value = value; this._prev = prev; this._next = prev._next; _prev._next = this; _next._prev = this; } public static GCRoot Root(object value) { return new GCRoot(MainRoot, value); } public void Unroot() { lock (MainRoot) { _next._prev = _prev; _prev._next = _next; this._next = this._prev = this; } } } intending to use it like this: Source() { ... _root = GCRoot.Root(callbacks); } void TransitionToNeverCancelled() { _root.Unlink(); ... } ~Source() { TransitionToNeverCancelled(); } but now I'm troubled. This seems to open the possibility for memory leaks, without actually fixing all cases of sources in limbo. Like, if a source is closed over in one of its own callbacks, then it is rooted by the callback root and so can never be collected. Presumably I should just let my sources be collected without a peep. Or maybe not? Is it ever appropriate to try to control the order of finalization, or is it a giant warning sign?

    Read the article

  • Gluster bricks are offline and errors in logs

    - by Roman Newaza
    I have substituted all the IP addresses with hostnames and renamed configs (IP to hostname) in /var/lib/glusterd by my shell script. After that I restarted Gluster Daemon and the volume. Then I checked if all the peers are connected: root@GlusterNode1a:~# gluster peer status Number of Peers: 3 Hostname: gluster-1b Uuid: 47f469e2-907a-4518-b6a4-f44878761fd2 State: Peer in Cluster (Connected) Hostname: gluster-2b Uuid: dc3a3ff7-9e30-44ac-9d15-00f9dab4d8b9 State: Peer in Cluster (Connected) Hostname: gluster-2a Uuid: 72405811-15a0-456b-86bb-1589058ff89b State: Peer in Cluster (Connected) I could see mounted volumes size change on all the nodes when I execute df command, so new data is coming. But recently I noticed error messages in app log: copy(/storage/152627/dat): failed to open stream: Structure needs cleaning readfile(/storage/1438227/dat): failed to open stream: Input/output error unlink(/storage/189457/23/dat): No such file or directory Finally, I have found out some bricks are offline: root@GlusterNode1a:~# gluster volume status Status of volume: storage Gluster process Port Online Pid ------------------------------------------------------------------------------ Brick gluster-1a:/storage/1a 24009 Y 1326 Brick gluster-1b:/storage/1b 24009 N N/A Brick gluster-2a:/storage/2a 24009 N N/A Brick gluster-2b:/storage/2b 24009 N N/A Brick gluster-1a:/storage/3a 24011 Y 1332 Brick gluster-1b:/storage/3b 24011 N N/A Brick gluster-2a:/storage/4a 24011 N N/A Brick gluster-2b:/storage/4b 24011 N N/A NFS Server on localhost 38467 Y 24670 Self-heal Daemon on localhost N/A Y 24676 NFS Server on gluster-2b 38467 Y 4339 Self-heal Daemon on gluster-2b N/A Y 4345 NFS Server on gluster-2a 38467 Y 1392 Self-heal Daemon on gluster-2a N/A Y 1402 NFS Server on gluster-1b 38467 Y 2435 Self-heal Daemon on gluster-1b N/A Y 2441 What can I do about that? I need to fix it. Note: CPU and Network usage of all the four nodes are about the same.

    Read the article

  • Permission / owner issue with pushing to git when editing directly from repo?

    - by Susan
    I have a web interface for deploying scripts from our repo at Github to our live server. The web interface just triggers a bash script with some git commands. If I make changes locally, push to repo, then run the bash script to pull from repo to live it works fine. However, if I make changes directly in the repo (via Github's web interface), I'm running into fast-forward / lock issues. These are the steps I'm taking: Make a change on a file at Github repo Run a bash script (as apache) via web from live server that attempts a git push / pull. Get these problems: PUSH To [email protected]:name/name.git ! [rejected] master - master (non-fast-forward) error: failed to push some refs to '[email protected]:name/name.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. PULL From github.com:name/name branch master - FETCH_HEAD error: unable to unlink old 'includes/footer.inc' (Permission denied) Updating 8f6d922..d1eba9d Updating 8f6d922..d1eba9d SSH in as root, attempt a push / pull and it works fine. Ideas on why would this method not work from apache?

    Read the article

  • How do I increase the buffer size for domain sockets in OS X 10.6

    - by Chas. Owens
    In Linux I have no problem dumping tons of data into a domain socket, but the same code on OS X 10.6.2 blows up after about 65 records. The socket reader code looks like #!/usr/bin/perl use strict; use warnings; use IO::Socket; unlink "foo"; my $sock = IO::Socket::UNIX->new ( Local => 'foo', Type => SOCK_DGRAM, Timeout => 600, ) or die "Could not create socket: $!\n"; while (<$sock>) { chomp; print "[$_]\n"; } And the client code looks like #!/usr/bin/perl use strict; use warnings; use IO::Socket; my $sock = IO::Socket::UNIX->new ( Peer => 'foo', Type => SOCK_DGRAM, Timeout => 600, ) or die "Could not create socket: $!\n"; for my $i (1 .. 1_000_000) { print $sock "$i\n" or die $!; } close $sock; The error message I get is No buffer space available at write.pl line 15.. It seems fairly obvious that there is a difference in the buffer size between Linux and OS X, but I don't know how to set it OS X (or what the possible negative side effects might be).

    Read the article

  • Using a named pipe to simulate a serial port on a VMware virtual machine (linux host and client)

    - by Dave M
    Trying to write a python program to create a simulated data stream and feed it, through a named pipe, to a VMware virtual machine. The host is running Ubuntu 11.10 and VMware player 5.0.0. The Vm is running Ubuntu netbook 10.04. I am able to get the pipe working on the local machine but I am not able to get the pipe to pass data through the virtual serial port to the programs running on the virtual machine. #!/usr/bin/python import os # # Create a named pipe that will be used as the serial port on a VMware virtual machine SerialPipe = '/tmp/gpsd2NMEA' try: os.unlink(SerialPipe) except: pass os.mkfifo(SerialPipe) # # Open the named pipe NMEApipe = os.open(SerialPipe, os.O_RDWR|os.O_NONBLOCK) # # Write a string to the named pipe NMEAtime = "235959" os.write(NMEApipe, str( '%s\n' % NMEAtime )) Test to see if the python program is working on the host machine (displays 235959 if data is passing through the pipe) $ cat /tmp/gpsd2NMEA 235959 Serial port as defined in the VMware .vmx file: serial0.present = "TRUE" serial0.startConnected = "TRUE" serial0.fileType = "pipe" serial0.fileName = "/tmp/gpsd2NMEA" serial0.pipe.endPoint = "client" serial0.autodetect = "FALSE" serial0.tryNoRxLoss = "TRUE" serial0.yieldOnMsrRead = "TRUE" Test to see if the serial port in the VM is receiving data $ cat /dev/ttyS0 or $ minicom -D /dev/ttyS0 or $ stty -F /dev/ttyS0 cs8 -parenb -cstopb 115200 $ echo < /dev/ttyS0 None of these display any data from the python program.

    Read the article

  • How do I increase the buffer size for domain sockets in OS X 10.6

    - by Chas. Owens
    In Linux I have no problem dumping tons of data into a domain socket, but the same code on OS X 10.6.2 blows up after about 65 records. The socket reader code looks like #!/usr/bin/perl use strict; use warnings; use IO::Socket; unlink "foo"; my $sock = IO::Socket::UNIX->new ( Local => 'foo', Type => SOCK_DGRAM, Timeout => 600, ) or die "Could not create socket: $!\n"; while (<$sock>) { chomp; print "[$_]\n"; } And the client code looks like #!/usr/bin/perl use strict; use warnings; use IO::Socket; my $sock = IO::Socket::UNIX->new ( Peer => 'foo', Type => SOCK_DGRAM, Timeout => 600, ) or die "Could not create socket: $!\n"; for my $i (1 .. 1_000_000) { print $sock "$i\n" or die $!; } close $sock; The error message I get is No buffer space available at write.pl line 15.. It seems fairly obvious that there is a difference in the buffer size between Linux and OS X, but I don't know how to set it OS X (or what the possible negative side effects might be).

    Read the article

  • Pivot table not refreshing sort order

    - by William Anthony
    I have Pivot Table that get its data source from another sheet, same workbook. I want the sort order of data is same as the data source order, I choose "Sort in data source order" in Pivot Table option. The problem is, when I change the data order on data source worksheet, then I refresh the Pivot Table, the sort order didn't change. I googled that the Pivot Table should be unlink first then re-link again in order to work properly, so I tried the following: The original data source has named range: origdata. The fake data source has names range: dummydata I changed manually data source to dummydata then changed back to origdata. The sort order did change as expected. Now I want to make the operation automated, so I'm using this code in Worksheet.activate event. Note that, PT is PivotTable instance. ... PT.SourceData = "dummydata" PT.RefreshTable PT.SourceData = "origdata" PT.RefreshTable ... Change data source from VBA didn't change the sort order just like I did with manual method. Why is that? Am I missing something? Maybe there are some routine called when I changed the data source manually via toolbar button? Thanks in advance for your help.

    Read the article

  • Is there a limit setting a php_admin_value in php-fpm?

    - by PeeHaa
    I am trying to set a large value in the configuration of a pool in php-fpm, but at some point it just doesn't start anymore. php_admin_value[disable_functions] = dl,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source,pcntl_exec,include,include_once,require,require_once,posix_mkfifo,posix_getlogin,posix_ttyname,getenv,get_current_use,proc_get_status,get_cfg_va,disk_free_space,disk_total_space,diskfreespace,getcwd,getlastmo,getmygid,getmyinode,getmypid,getmyuid,ini_set,mail,proc_nice,proc_terminate,proc_close,pfsockopen,fsockopen,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,fopen,tmpfile,bzopen,gzopen,chgrp,chmod,chown,copy,file_put_contents,lchgrp,lchown,link,mkdi,move_uploaded_file,rename,rmdi,symlink,tempnam,touch,unlink,iptcembed,ftp_get,ftp_nb_get,file_exists,file_get_contents,file,fileatime,filectime,filegroup,fileinode,filemtime,fileowne,fileperms,filesize,filetype,glob,is_di,is_executable,is_file,is_link,is_readable,is_uploaded_file,is_writable,is_writeable,linkinfo,lstat,parse_ini_file,pathinfo,readfile,readlink,realpath,stat,gzfile,create_function When trying to restart php-fpm it fails with the following message: Stopping php-fpm: [ OK ] Starting php-fpm: [20-Oct-2013 22:31:52] ERROR: [/etc/php-fpm.d/codepad.conf:235] value is NULL for a ZEND_INI_PARSER_ENTRY [20-Oct-2013 22:31:52] ERROR: Unable to include /etc/php-fpm.d/codepad.conf from /etc/php-fpm.conf at line 235 [20-Oct-2013 22:31:52] ERROR: failed to load configuration file '/etc/php-fpm.conf' [20-Oct-2013 22:31:52] ERROR: FPM initialization failed [FAILED] When I remove the last disabled function (create_function) it start again. I also tried with other functions, but this gives the same error so it's not related to the create_function function. The string currently is just over 1KB in size so it looks like I have hit a limit here? Is my assumption correct? Is there a way to overcome this limit? I also tried to add another php_admin_value[disable_functions] underneath it (hoping it would be appended), but that didn't work (it just used the first one).

    Read the article

  • Audit file removal (auditctl)

    - by user1513039
    For some reason, some script or program is removing a pid file for the service on the linux server (centos5.4 / 2.6.18-308.4.1.el5xen). I suspect a faulty cron script, but manual investigation did not lead me to it. And i still want to track it down. Have been using auditctl rule: auditctl -w /var/run/some_service.pid -p w Which helped me to see something, but not quite exactly what i wanted: type=PATH msg=audit(11/12/2013 09:07:43.199:432577) : item=1 name=/var/run/some_service.pid inode=12419227 dev=fd:00 mode=file,644 ouid=root ogid=root rdev=00:00 type=SYSCALL msg=audit(11/12/2013 09:07:43.199:432577) : arch=x86_64 syscall=unlink success=yes exit=0 a0=7fff7dd46dd0 a1=1 a2=2 a3=127feb90 items=2 ppid=3454 pid=6227 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=38138 comm=rm exe=/bin/rm key=(null) Problem here is that i see ppid of the script that removed the file, but at the analysis time the (p)pids are already invalid as probably scripts/programs have been shutdown. Imagine a cron script deleting the file. So i need some way to expand/add audit rule(s) to be able to trace the parents of the /bin/rm at the time of removal. I have been thinking to add some rule to monitor all process creation, something like: auditctl -a task,always But this happen to be very resource intensive. So i need help or advice how to combine these rules, or how to expand any of the rules to help track the script/program. Thanks.

    Read the article

  • Converting .docx to pdf (or .doc to pdf, or .doc to odt, etc.) with libreoffice on a webserver on the fly using php

    - by robertphyatt
    Ok, so I needed to convert .docx files to .pdf files on the fly, but none of the free php libraries that were available let me do it on my server (a webservice was not good enough). Basically either I needed to pay for a library (and have it maybe suck) or just deal with the free ones that didn't convert the formatting well enough. Not good enough! I found that LibreOffice (OpenOffice's successor) allows command line conversion using the LibreOffice conversion engine (which DID preserve the formatting like I wanted and generally worked great). I loaded the latest version of Ubuntu (http://www.ubuntu.com/download/ubuntu/download) onto my Virtual Box (https://www.virtualbox.org/wiki/Downloads) on my computer and found that I was able to easily convert files using the commandline like this: libreoffice --headless -convert-to pdf fileToConvert.docx -outdir output/path/for/pdf I thought: sweet...but I don't have admin rights on my host's web server. I tried to use a "portable" version of LibreOffice that I obtained from http://portablelinuxapps.org/ but I was unable to get it to work on my host's webserver, because my host's webserver didn't have all the dependencies (Dependency Hell! http://en.wikipedia.org/wiki/Dependency_hell) I was at a loss of how to make it work, until I ran across a cool project made by a Ph.D. student (Philip J. Guo) at Stanford called CDE: http://www.stanford.edu/~pgbovine/cde.html I will let you look at his explanations of how it works (I followed what he did in http://www.youtube.com/watch?feature=player_embedded&v=6XdwHo1BWwY, starting at about 32:00 as well as the directions on his site), but in short, it allows one to avoid dependency hell by copying all the files used when you run certain commands, recreating the linux environment where the command worked. I was able to use this to run LibreOffice without having to resort to someone's portable version of it, and it worked just like it did when I did it on Ubuntu with the command above, with a tweak: I needed to run the wrapper of LibreOffice the CDE generated. So, below is my PHP code that calls it. In this code snippet, the filename to be copied is passed in as $_POST["filename"]. I copy the file to the same spot where I originally converted the file, convert it, copy it back and then delete all the files (so that it doesn't start growing exponentially). I did it this way because I wasn't able to make it work otherwise on the webserver. If there is a linux + webserver ninja out there that can figure out how to make it work without doing this, I would be interested to know what you did. Please post a comment or something if you did that. <?php //first copy the file to the magic place where we can convert it to a pdf on the fly copy($time.$_POST["filename"], "../LibreOffice/cde-package/cde-root/home/robert/Desktop/".$_POST["filename"]); //change to that directory chdir('../LibreOffice/cde-package/cde-root/home/robert'); //the magic command that does the conversion $myCommand = "./libreoffice.cde --headless -convert-to pdf Desktop/".$_POST["filename"]." -outdir Desktop/"; exec ($myCommand); //copy the file back copy("Desktop/".str_replace(".docx", ".pdf", $_POST["filename"]), "../../../../../documents/".str_replace(".docx", ".pdf", $_POST["filename"])); //delete all the files out of the magic place where we can convert it to a pdf on the fly $files1 = scandir('Desktop'); //my files that I generated all happened to start with a number. $pattern = '/^[0-9]/'; foreach ($files1 as $value) { preg_match($pattern, $value, $matches); if(count($matches) ?> 0) { unlink("Desktop/".$value); } } //changing the header to the location of the file makes it work well on androids header( 'Location: '.str_replace(".docx", ".pdf", $_POST["filename"]) ); ?> And here is the tar.gz file I generated I generated with CDE. To duplicate what I did exactly, put the tar.gz file in a folder somewhere. I will call that folder the "root". Make a new folder called "documents" in the "root" folder. Unpack the tar.gz and run the php script above from the "documents" folder. Success! I made a truly portable version of LibreOffice that can convert files on the fly on a webserver using 100% free, open source software!

    Read the article

  • Unable to determine the URL to the Xap file

    - by Matthew Glace
    I started developing a Silverlight (SL) 4 application hosted in an ASP.NET site using Visual Studio 2010. Now I want to change it so that the SL application runs out of browser as if I had not chosen to host it in a web site when I created the SL project. First, I went to the properties of the web application and removed the SL project from the “Silverlight Applications” tab. Then, I went to the properties of the SL project and made sure the “Out-of-browser Application” option was chosen on the “Debug” tab with the SL project selected in the drop list. Finally, I made sure that the SL project was set as the “StartUp” project for the solution. The solution builds successfully however when I try to run I get the following message in an error dialog: Unable to determine the URL to the Xap file from web [web project name]. I'm assuming this is happening because the SL project is trying to copy the Xap file to the ClientBin folder of the web site. Obviously, the SL and web projects are still linked in some way despite my attempt to unlink the two. I have examined each project file in notepad to find any reference between them with no luck. What’s more frustrating is that I can achieve my desired result by creating a new SL application and un-checking the “Host the Silverlight application in a new or existing Web site in the solution” option. I know I could start my project over from scratch to solve this problem however I’m really curious as to what is causing this error. A Google search yielded no results.

    Read the article

  • CKEditor inside jQuery Dialog, how do I build it?

    - by Ben Dauphinee
    So, I'm working with CKEditor and jQuery, trying to build a pop-out editor. Below is what I have coded so far, and I can't seem to get it working the way I want it to. Basically, click the 'Edit' link, dialog box pops up, with the content to edit loaded into the CKEditor. Also, not required, but helpful if you can suggest how to do it. I can't seem to find out how to make the save button work in CKEditor (though I think the form will do it). Thanks in advance for any help. $(document).ready(function(){ var config = new Array(); config.height = "350px"; config.resize_enabled = false; config.tabSpaces = 4; config.toolbarCanCollapse = false; config.width = "700px"; config.toolbar_Full = [["Save","-","Cut","Copy","Paste","-","Undo","Redo","-","Bold","Italic", "-", "NumberedList","BulletedList","-","Link","Unlink","-","Image","Table"]]; $("a.opener").click(function(){ var editid = $(this).attr("href"); var editwin = \'<form><div id="header"><input type="text"></div><div id="content"><textarea id="content"></textarea></div></form>\'; var $dialog = $("<div>"+editwin+"</div>").dialog({ autoOpen: false, title: "Editor", height: 360, width: 710, buttons: { "Ok": function(){ var data = $(this).val(); } } }); //$(this).dialog("close"); $.getJSON("ajax/" + editid, function(data){ alert("datagrab"); $dialog.("textarea#content").html(data.content).ckeditor(config); alert("winset"); $dialog.dialog("open"); }); return false; }); });

    Read the article

  • jquery load and tinymce gives me a "g.win.document is null" on subsequent loads

    - by Patrice Peyre
    So... very excited as first post on stackoverflow I have this page, clicking a button will call editIEPProgram(). editIEPProgram counts how many specific divs exists, adds another div, loads it with html from '/content/mentoring/iep_program.php' and then calls $("textarea.tinymce").tinymce to add a rich text editor to the newly added text boxes. It finally adds a tab which handles the new stuff and bob is your uncle. It ALMOST works. Clicking the button the first adds everything and everything woks, on the second and subsequent click, everything is added but the tinymce fails to initiate (I guess) and gives me "g.win.document is null". I have been on it for some time now and losing all my sanity. please, help.me. function editIEPProgram(){ var index = $("div[id^=iep_program]").size(); var target_div = "iep_program_"+index; $("#program_container") .append( $("<div></div>") .attr("id", target_div) .addClass("no_overflow_control") ); $("#"+target_div).load ( "/content/mentoring/iep_program.php", {index:index}, function() { $("textarea.tinymce").tinymce({ script_url: "/scripts/tiny_mce.js",height:"60", theme:"advanced",skin:"o2k7",skin_variant : "silver", plugins : "spellchecker,advlist,preview,pagebreak,style,layer,save,advhr,advimage,advlink,searchreplace,paste,noneditable,visualchars,nonbreaking,xhtmlxtras", theme_advanced_buttons1 : "spellchecker,|,bold,italic,underline,strikethrough,|,formatselect,|,forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,image,cleanup,preview", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", content_css : "/css/main.css" }); }); $("#tab_container") .tabs("add", "#"+target_div,"New program") .tabs("select", $("#tab_container").tabs("length")-1); }

    Read the article

  • TinyMCE Not Defined Error

    - by Tim
    I am trying to add TinyMCE to page but I am getting these errors: Error: tinyMCE is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/langs/en.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js Line: 1 Error: tinymce is not defined Source File: https://my.secure.site/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js Line: 1 Here is the code I have in header: <script type="text/javascript" src="https://my.secure.site/jquery/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="https://my.secure.site/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> $(document).ready(function() { tinyMCE.init({ mode: "textareas", script_url: "https://my.secure.site/tinymce/jscripts/tiny_mce/tiny_mce.js", theme: "advanced", plugins: "pagebreak,style,advimage,advlink,iespell,preview,media,paste", theme_advanced_buttons1: "help,newdocument,|,bold,italic,underline,strikethrough,|,link,unlink,anchor,image", theme_advanced_buttons2: "fontsizeselect,hr,removeformat,charmap,visualaid,sub,sup", theme_advanced_buttons3: "cut,copy,paste,|,undo,redo,|,cleanup,code,preview", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_statusbar_location: "bottom", theme_advanced_resizing: false, editor_selector: "tinymce", width: "398px", force_p_newlines: false, force_br_newlines: true }); }); </script> And this is my textarea that I'm expecting TinyMCE to use: <textarea id="post1msg" class="tinymce" rows="4" cols="40"><?=$r->post->message?></textarea> Please does anyone have any idea why it's not working?

    Read the article

  • move_uploaded_file() error

    - by James R.
    I have a website on free hosting - 000webhost.com and it allows you to upload images. However, when I try to upload an image, I get these errors: Warning: move_uploaded_file(images/SmallSmileyFace.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/a6621074/public_html/m/write.php on line 76 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpcmW3mo' to 'images/SmallSmileyFace.jpg' in /home/a6621074/public_html/m/write.php on line 76 This is the code: if (!empty($_FILES['fileImage']['name'])) { // check image type and size if ((($imagetype == 'image/gif') || ($imagetype == 'image/jpeg') || ($imagetype == 'image/pjpeg') || ($imagetype == 'image/png')) && ($imagesize > 0) && ($imagesize <= 32768)) { if ($_FILES['fileImage']['error'] == 0) { //move file $target = 'images/' . $image; if (move_uploaded_file($_FILES['fileImage']['tmp_name'], $target)) { $query = "INSERT INTO reviews (post_date, food_name, location, cafeteria, review, image, rating, user_id) VALUES (NOW(), '$foodname', '$location', '$cafeteria', '$review', '$image', $rate, $id)"; mysqli_query($dbc, $query); //confirm success echo '<p>Thank you for your submission!</p>'; } else { echo '<p class="errmsg">There was a problem uploading your image.</p>'; } } @unlink($_FILES['fileImage']['tmp_name']); } else { echo '<p class="errmsg">The screen shot must be a GIF, JPEG, or PNG image file no greater than 32KB in size.</p>'; } } Any ideas?

    Read the article

  • How to replace openSSL calls with C# code?

    - by fonix232
    Hey there again! Today I ran into a problem when I was making a new theme creator for chrome. As you may know, Chrome uses a "new" file format, called CRX, to manage it's plugins and themes. It is a basic zip file, but a bit modified: "Cr24" + derkey + signature + zipFile And here comes the problem. There are only two CRX creators, written in Ruby or Python. I don't know neither language too much (had some basic experience in Python though, but mostly with PyS60), so I would like to ask you to help me convert this python app to a C# code that doesn't depend on external programs. Also, here is the source of crxmake.py: #!/usr/bin/python # Cribbed from http://github.com/Constellation/crxmake/blob/master/lib/crxmake.rb # and http://src.chromium.org/viewvc/chrome/trunk/src/chrome/tools/extensions/chromium_extension.py?revision=14872&content-type=text/plain&pathrev=14872 # from: http://grack.com/blog/2009/11/09/packing-chrome-extensions-in-python/ import sys from array import * from subprocess import * import os import tempfile def main(argv): arg0,dir,key,output = argv # zip up the directory input = dir + ".zip" if not os.path.exists(input): os.system("cd %(dir)s; zip -r ../%(input)s . -x '.svn/*'" % locals()) else: print "'%s' already exists using it" % input # Sign the zip file with the private key in PEM format signature = Popen(["openssl", "sha1", "-sign", key, input], stdout=PIPE).stdout.read(); # Convert the PEM key to DER (and extract the public form) for inclusion in the CRX header derkey = Popen(["openssl", "rsa", "-pubout", "-inform", "PEM", "-outform", "DER", "-in", key], stdout=PIPE).stdout.read(); out=open(output, "wb"); out.write("Cr24") # Extension file magic number header = array("l"); header.append(2); # Version 2 header.append(len(derkey)); header.append(len(signature)); header.tofile(out); out.write(derkey) out.write(signature) out.write(open(input).read()) os.unlink(input) print "Done." if __name__ == '__main__': main(sys.argv) Please could you help me?

    Read the article

  • Javascript error when integrating django-tinymce and django-filebrowser

    - by jwesonga
    I've set up django-filebrowser in my app without any bugs, I already had django-tinymce set up and it loads the editor in the admin forms. I now want to use django-filebrowser with django-tinymce, but I keep getting a weird javascript error when I click on "Image URL" in the Image popup: r is undefined the error is js/tiny_mce/tiny_mce.js My settings.py file has the following configuration: TINYMCE_JS_URL=MEDIA_URL + 'js/tiny_mce/tiny_mce.js' TINYMCE_DEFAULT_CONFIG = { 'mode': "textareas", 'theme': "advanced", 'language': "en", 'skin': "o2k7", 'dialog_type': "modal", 'object_resizing': True, 'cleanup_on_startup': True, 'forced_root_block': "p", 'remove_trailing_nbsp': True, 'theme_advanced_toolbar_location': "top", 'theme_advanced_toolbar_align': "left", 'theme_advanced_statusbar_location': "none", 'theme_advanced_buttons1': "formatselect,styleselect,bold,italic,underline,bullist,numlist,undo,redo,link,unlink,image,code,template,visualchars,fullscreen,pasteword,media,search,replace,charmap", 'theme_advanced_buttons2': "", 'theme_advanced_buttons3': "", 'theme_advanced_path': False, 'theme_advanced_blockformats': "p,h2,h3,h4,div,code,pre", 'width': '700', 'height': '300', 'plugins': "advimage,advlink,fullscreen,visualchars,paste,media,template,searchreplace", 'advimage_update_dimensions_onchange': True, 'file_browser_callback': "CustomFileBrowser", 'relative_urls': False, 'valid_elements' : "" + "-p," + "a[href|target=_blank|class]," + "-strong/-b," + "-em/-i," + "-u," + "-ol," + "-ul," + "-li," + "br," + "img[class|src|alt=|width|height]," + "-h2,-h3,-h4," + "-pre," + "-code," + "-div", 'extended_valid_elements': "" + "a[name|class|href|target|title|onclick]," + "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]," + "br[clearfix]," + "-p[class<clearfix?summary?code]," + "h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," + "ul[class<clearfix],ol[class<clearfix]," + "div[class]," } TINYMCE_FILEBROWSER = False TINYMCE_COMPRESSOR = False i've tried switching back to older versions of tinyMCE Javascript but nothing seems to work. Would appreciate some help

    Read the article

  • TinyMCE + jQuery + custom plugin = tinymce is undefined?

    - by user368691
    The problem occurs when I try to create small plugin to allow me toggle on and off WYSIWYG on all textareas in the website. //$('form.default textarea').each(function(){ // console.log( $('<a href="#">Enable WYSIWYG editor</a>').insertAfter('form.default textarea').prev('textarea.wysiwyg').tinymce().hide() ); //}); The full (a bit simplified) code looks like this: $('textarea.wysiwyg').tinymce({ skin : 'cirkuit', theme : 'advanced', plugins : 'pagebreak,style,layer,advlink,inlinepopups,contextmenu,paste,directionality,noneditable,nonbreaking,xhtmlxtras,template', // Theme options theme_advanced_buttons1 : 'formatselect,fontsizeselect,forecolor,|,bold,italic,strikethrough,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,image,|,code,paste,pastetext,pasteword,removeformat,|,backcolor,|,underline,justifyfull,sup,|,outdent,indent,|,hr,charmap,|,undo,redo', theme_advanced_buttons2 : '', theme_advanced_buttons3 : '', theme_advanced_toolbar_location : 'top', theme_advanced_toolbar_align : 'left', theme_advanced_statusbar_location: 'bottom', theme_advanced_resizing : true, theme_advanced_resize_horizontal : false, height : 500, theme_advanced_resizing_min_height : 500, document_base_url : 'http://static.<?=$settings['system_host']?>/' }); $('textarea.wysiwyg').each(function() { $(this).tinymce().hide(); }); What is the error? FireBug says that tinymce() in undefined; this message occurs in each() loop. Thus, tinymce() is actually initialized. I am really lost towards, what could be causing this.

    Read the article

  • GD PHP Base64 Picture (png) error

    - by hogofwar
    This is part of my code: $con = mysql_connect("localhost","username","passs"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database", $con); if(mysql_num_rows(mysql_query("SELECT name FROM xbox_user WHERE name = '$user'"))){ // Code inside if block if userid is already there $result = mysql_query("SELECT name FROM xbox_user WHERE name = '$user'"); while($row = mysql_fetch_array($result)) { if ($row['date'] > $row['date']+100){ $src = imagecreatefrompng($result['XboxInfo']['TileUrl']); $base64= base64_encode(file_get_contents($result['XboxInfo']['TileUrl'])); $date = date("Ymd"); mysql_query("UPDATE xbox_user SET date = '$date' SET avatar = '$base64' WHERE name = '$user'"); }else{ $encode = $row['avatar']; //echo $encode; $rand = rand(1, 1337); file_put_contents('/tmp/'.$rand.'.png', base64_decode($row['avatar'])); //ERROR LINE $src = imagecreatefrompng('/tmp/'.$rand.'.png'); unlink('/tmp/'.$rand.'.png'); } } }else{ $src = imagecreatefrompng($result['XboxInfo']['TileUrl']); $base64= base64_encode(file_get_contents($result['XboxInfo']['TileUrl'])); $date = date("Ymd"); mysql_query("INSERT INTO xbox_user (name, avatar, date) VALUES ('$user', '$base64', '$date')"); } It comes up with multiple errors but I feel this one should be addressed first as the other could just be caused by the first error: Warning: imagecreatefrompng() [function.imagecreatefrompng]: '/tmp/628.png' is not a valid PNG file in /home/nah/public_html/experiment/xbox/draw3.php on line 60 It also does create an entry in my mysql DB

    Read the article

  • Cannot spawn an erlang supervisor from the shell.

    - by drfloob
    I've implemented a gen_server and supervisor: test_server and test_sup. I want to test them from the shell/CLI. I've written their start_link functions such that their names are registered locally. I've found that I can spawn the test_server from the command line just fine, but a spawned test_sup does nothing whatsoever. Why is this? For example, I can spawn a test_server by executing: 1> spawn(test_server, start_link, []). <0.39.0> 2> registered(). [...,test_server,...] I can interact with the server, and everything appears fine. However, if I try to do the same thing with test_sup, no new names/Pids are registered, and it looks like my test_server was not spawned at all. I'd assume I coded an error in my supervisor, but this method of starting my supervisor works perfectly fine: 1> {ok, Pid}= test_sup:start_link([]). {ok, <0.39.0>} 2> unlink(Pid). true 3> registered(). [...,test_server,test_sup,...] Why is it that I can spawn a gen_server but not a supervisor?

    Read the article

  • php $_FILES error code returning an unexpected error

    - by EmmyS
    I have some code that allows users to upload multiple files at once. It was never getting to a specific point after the upload, so I put in an echo to test for the value of the error code, and it's returning a value that I'm not sure I understand. Here's the code: $tmpTarget = PCBUG_UPLOADPATH; foreach ($_FILES["attachments"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["attachments"]["tmp_name"][$key]; $name = str_replace(" ", "_", $_FILES["attachments"]["name"][$key]); move_uploaded_file($tmp_name, "$tmpTarget/$name"); @unlink($_FILES["attachments"]["tmp_name"][$key]); } else { $errorFlag = true; echo "error = $error"; exit; } } The code that creates the attachments field looks like this: for($i=1; $i<=$max_no_img; $i++){ echo "<input type=file name='attachments[]' class='bginput'><br />"; } where $max_no_img is a variable set further up in the code, and PCBUG_UPLOAD path is a constant defined in an included file. Here's what's confusing: after I submit my form, I go and look in my uploads directory, and the files I've selected through the form are there - they uploaded correctly. However, the code is jumping into the else clause and $error is returning 4, which the php manual indicates means that no file was uploaded. Any ideas? The files very clearly are getting where they're supposed to. Is there some other definition of "uploaded" that isn't happening?

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >