edit

editing image by using input file type

China☆狼群 提交于 2019-12-06 09:19:23
I made a simple editing for to edit data in mysql, everything works fine except when I want to edit an input file type image it doesn't work, it doesn't give an error message it just doesn't edit anything and when I remove the input file type image it works. and by editing an image I mean entering a new image the will replace the old image. here is my code: <?php require("db.php"); $id = $_REQUEST['theId']; $result = mysql_query("SELECT * FROM table WHERE id = '$id'"); $test = mysql_fetch_array($result); $name = $test['Name'] ; $email = $test['Email'] ; $image = $test['Image'] ; if (isset($

Manipulating a JSON file with jq

风格不统一 提交于 2019-12-06 05:50:25
I’m using jq to manipulate a JSON file. I need to run a single command that searches an array, finds an object that has a key that equals “someData”, and then delete a key that is in the object, for example, delete a “maxHeight” key from the object where key equals “someData”. Here is an example JSON file, I would like to search the ‘tracks’ array and find the object where label =“cucumber_ChineseLong_v2.gff3” and then remove the ‘maxHeight: “200px” ‘ from that object. Is this even possible to run in a single command using jq? Update : My desired output would be the original JSON file with

Mainframe commands for DS - move columns in ISPF Edit

喜欢而已 提交于 2019-12-06 04:20:25
how can we move the data in middle of PS file to left side in Mainframe? any shortcut command for this? I have a Data set with data at column 13 and it has to be moved to column 11, Any short key to move it. Want to align rest of the rows in DS as 1st column BROWSE OSMDEV.ITALY3.DATA Command ===> ----+----1----+----2----+----3----+----4----+- 758 200510 4323T 758 2005 10 4323N 758 2005 10 51149 758 2005 10 51154 758 2005 10 6758E 758 2005 13 34437 758 2005 13 34441 758 2005 13 53445 Use the ISPF 'BNDS' line command command and set the bounds (via the '<' and '>' characters) to column 11 and

Laravel edit existing pdf

大兔子大兔子 提交于 2019-12-06 03:42:11
I don't know how to edit an existing pdf file with Laravel. I have found many plugin for create PDF but no one help me in my problem. Can anyone know how to do it? This is what I have tried so far $pdf->AddPage(); $source = $pdf->setSourceFile(asset("assets/images/coupon/source/coupon.pdf")); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx, 10, 10, 90); $pdf->SetXY(40, 0); // Doesn't work $pdf->Write(0, 'This is just a simple text'); // Doesn't work $pdf->Output(); // Doesn't work There is no built-in way for Laravel to edit PDFs . You can of course use external libs, such as FPDF

Visual block edit in vim

喜欢而已 提交于 2019-12-06 01:45:33
问题 I have refer to this post to use block editing in vim. But when I key I or c after the block select, vim enters the normal edit mode just as if I pressed a i . I also found, when block is selected, I can use the x key to delete chars in the block. Before press I : After press I : How can I block input chars? the +visualextra have enabled from below version info. > $ vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 > 2014 19:39:47) Included patches: 1-52 Modified by > pkg-vim

Qt Mac (Re)move “Special Characters…” action in Edit menu

青春壹個敷衍的年華 提交于 2019-12-05 19:49:49
I am developing an application in Qt that rebuilds its menus very often. However, when we call clear(), and re-add the actions that we want in the menu, "Special Characters..." appears to remain in the menu. Is there any way to remove, or move this action to the bottom of the QMenu? Here is the code that rebuilds the menu: void MainWindow::initMenus(Tab* tab) { menuBar()->clear(); menuFile->clear(); menuEdit->clear(); menuSettings->clear(); menuHelp->clear(); ui_toolBar->clear(); menuBar()->addMenu(menuFile); menuBar()->addMenu(menuEdit); menuFile->addAction(actionNew); menuFile->addAction

How can I tell if I'm in beforeSave from an edit or a create? CakePHP

♀尐吖头ヾ 提交于 2019-12-05 18:50:01
问题 I have a model where I need to do some processing before saving (or in certain cases with an edit) but not usually when simply editing. In fact, if I do the processing on most edits, the resulting field will be wrong. Right now, I am working in the beforeSave callback of the model. How can I tell if I came from the edit or add? Frank Luke 回答1: function beforeSave() { if (!$this->id && !isset($this->data[$this->alias][$this->primaryKey])) { // insert } else { // edit } return true; } 回答2: This

How do I replace the bootstrap step in the package randomForest r

╄→尐↘猪︶ㄣ 提交于 2019-12-05 16:53:13
First some background info, which is probably more interesting on stats.stackexchange: In my data analysis I try to compare the performance of different machine learning methods on time series data (regression, not classification). So for example I have trained a Boosting trained model and compare this with a Random Forest trained model (R package randomForest). I use time series data where the explanatory variables are lagged values of other data and the dependent variable. For some reason the Random Forest severely underperforms. One of the problems I could think of is that the Random Forest

How to use XML namespaces with xmlstarlet XPaths?

我只是一个虾纸丫 提交于 2019-12-05 16:05:56
at the moment I am struggeling editing a XML file. When I write the command xml ed -u "/project/version" -v "2.7.13-NEW-SNAPSHOT" pom.xml > ./pom_new.xml it writes the new xml file, but when I open the file nothings changed in it. Heres a part of the given xml, i want to edit: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.groupID.test</groupId>

Symfony2 simple file upload edit without entity

人走茶凉 提交于 2019-12-05 12:08:20
Please help me out here because I can't belive my eyes. I refuse to use some 3rd party plugin for file uploads, and refuse to creat a separate entity for a file/document. I just want simple file upload that I would do in Zend/Laravel and so on. I have a invoice table with the last collumb name "attachment", I want to store here its sanitized name (eg: 123421_filename.jpg ), the addition form and upload went well. code here: //AddAction $file=$form['attachment']->getData(); $fileName=$file->getClientOriginalName(); $sanitizedFilename=rand(1, 99999).'_'.$fileName; $dir='files/'.$userId.'/';