小编Ric*_*nop的帖子

CSS - 只有水平溢出?

是否有可能只在CSS 2.1中实现水平溢出?

overflow: auto;
Run Code Online (Sandbox Code Playgroud)

将导致块元素同时具有水平和垂直滚动条.我想要一个块元素(比方说<div>),它只显示水平滚动条.我怎么做?

html css xhtml overflow

26
推荐指数
3
解决办法
5万
查看次数

从字符串中删除变音符号

可能吗?这是我的输入字符串:

? š ? ? ž ý á í é ? Á Ž Ý
Run Code Online (Sandbox Code Playgroud)

这是我想要的输出:

l s c t z y a i e C A Z Y
Run Code Online (Sandbox Code Playgroud)

php diacritics

25
推荐指数
5
解决办法
3万
查看次数

如何集中jquery ui按钮?

将此添加到CSS不起作用:

.ui-dialog-buttonpane { text-align: center; } 
Run Code Online (Sandbox Code Playgroud)

按钮仍然在右侧.

我该怎么办?

jquery jquery-ui

25
推荐指数
1
解决办法
3万
查看次数

使用libjpeg写入内存缓冲区而不是文件?

我发现这个函数使用libjpeg写入文件:

int write_jpeg_file( char *filename )
{
    struct jpeg_compress_struct cinfo;
    struct jpeg_error_mgr jerr;

    /* this is a pointer to one row of image data */
    JSAMPROW row_pointer[1];
    FILE *outfile = fopen( filename, "wb" );

    if ( !outfile )
    {
        printf("Error opening output jpeg file %s\n!", filename );
        return -1;
    }
    cinfo.err = jpeg_std_error( &jerr );
    jpeg_create_compress(&cinfo);
    jpeg_stdio_dest(&cinfo, outfile);

    /* Setting the parameters of the output file here */
    cinfo.image_width = width;  
    cinfo.image_height = height;
    cinfo.input_components = bytes_per_pixel;
    cinfo.in_color_space = color_space; …
Run Code Online (Sandbox Code Playgroud)

c c++ libjpeg

24
推荐指数
2
解决办法
2万
查看次数

Emacs选项卡不起作用

我在我的FreeBSD 8.2盒子上安装了Emacs.一切正常,但我不能使用标签.当我使用emacs和命中标签编辑文件时,没有任何反应.

可能是什么导致了这个?

emacs freebsd

24
推荐指数
1
解决办法
2万
查看次数

轮询数据库架构

民意调查的最佳数据库架构是什么?一对多的关系对此有利吗?我正在考虑有两张桌子:

poll_questions
    int id
    varchar body
    datetime created_at
    datetime updated_at

poll_answers
    int id
    varchar body
    int votes default 0
    int question_id (foreign key to poll_questions.id)
    datetime created_at
    datetime updated_at
Run Code Online (Sandbox Code Playgroud)

然后还会有第三个表来跟踪谁投票给答案,这样用户只能投票一次:

poll_voting_history
    int id
    int question_id (foreign key to poll_questions.id)
    int answer_id (foreign key to poll_answers.id)
    int user_id (foreign key to the id in the users table)
    datetime created_at
    datetime updated_at
Run Code Online (Sandbox Code Playgroud)

你的想法是什么?我在想它吗?

mysql database-schema

23
推荐指数
2
解决办法
7937
查看次数

PHPExcel用完了256,512和1024MB的RAM

我不明白.XSLX表大约3MB,甚至1024MB的RAM还不足以让PHPExcel将其加载到内存中?

我可能在这里做了一些可怕的错误:

function ReadXlsxTableIntoArray($theFilePath)
{
    require_once('PHPExcel/Classes/PHPExcel.php');
    $inputFileType = 'Excel2007';
    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    $objReader->setReadDataOnly(true);
    $objPHPExcel = $objReader->load($theFilePath);
    $rowIterator = $objPHPExcel->getActiveSheet()->getRowIterator();
    $arrayData = $arrayOriginalColumnNames = $arrayColumnNames = array();
    foreach($rowIterator as $row){
        $cellIterator = $row->getCellIterator();
        $cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set
        if(1 == $row->getRowIndex ()) {
            foreach ($cellIterator as $cell) {
                $value = $cell->getCalculatedValue();
                $arrayOriginalColumnNames[] = $value;
                // let's remove the diacritique
                $value = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $value);
                // and white spaces
                $valueExploded = explode(' ', $value);
                $value = …
Run Code Online (Sandbox Code Playgroud)

php phpexcel

23
推荐指数
3
解决办法
5万
查看次数

jQuery width()和height()为img元素返回0

所以我创建一个新的图像元素,一旦我从AJAX调用响应像这样的图像元数据:

var loadedImageContainter = $('<div class="loaded-image-container"></div>');
var image = $('<img src="' + file.url + '" alt="">');
loadedImageContainter.append(image);
$('.loading-image').replaceWith(loadedImageContainter);
var width = image.width();
var height = image.height();
console.log(width);
console.log(height);
Run Code Online (Sandbox Code Playgroud)

但是width()和height()函数返回0,尽管图像大小为30 x 30 px并且它在页面上正确显示.我需要获得它的尺寸才能绝对定位图像.

javascript jquery

23
推荐指数
2
解决办法
5万
查看次数

PHP xls,xlsx,ppt,pptx标头

这是我的代码,我试图在一种文档类型上发送正确的标题.我找到了pdf,doc和docx的标题,但我仍然需要知道Excel和Powerpoint文件的正确标题.

任何帮助赞赏.

    $document = urldecode($_GET['document']);
    $extension = end(explode('.', $document));
    $mimeType = '';
    switch ($extension) {
        case 'pdf':
            $mimeType = 'pdf';
            break;
        case 'doc':
            $mimeType = 'msword';
            break;
        case 'docx':
            $mimeType = 'msword';
            break;
        case 'xls':
            $mimeType = '';
            break;
        case 'xlsx':
            $mimeType = '';
            break;
        case 'ppt':
            $mimeType = '';
            break;
        case 'pptx':
            $mimeType = '';
            break;
    }       
    header('Content-type: application/' . $mimeType);
Run Code Online (Sandbox Code Playgroud)

php ms-office

22
推荐指数
2
解决办法
5万
查看次数

PHP DOM用新元素替换元素

我有一个带有HTML标记的DOM对象.我正在尝试替换所有嵌入式标签,如下所示:

<embed allowfullscreen="true" height="200" src="path/to/video/1.flv" width="320"></embed>
Run Code Online (Sandbox Code Playgroud)

使用这样的标签:

<a 
href="path/to/video/1.flv" 
style="display:block;width:320px;height:200px;" 
id="player">
</a>
Run Code Online (Sandbox Code Playgroud)

我很难解决这个问题,我不想为此使用正则表达式.你能救我吗?

编辑:

这是我到目前为止:

         // DOM initialized above, not important
            foreach ($dom->getElementsByTagName('embed') as $e) {
                $path = $e->getAttribute('src');
          $width = $e->getAttribute('width') . 'px';
          $height = $e->getAttribute('height') . 'px';
          $a = $dom->createElement('a', '');
          $a->setAttribute('href', $path);
          $a->setAttribute('style', "display:block;width:$width;height:$height;");
          $a->setAttribute('id', 'player');
          $dom->replaceChild($e, $a); // this line doesn't work
      }
Run Code Online (Sandbox Code Playgroud)

php dom

21
推荐指数
1
解决办法
2万
查看次数