小编Raj*_*mar的帖子

mBluetoothSocket.connect()打印一行

我一直试图找到一个解决方案,但不能.所以我在Android中开发POS应用程序,我需要使用蓝牙打印机打印销售/购买的收据.

打印,本身工作正常,但每当我调用mBluetoothSocket.connect()时,它会在打印件上打印出CONNECT"8869-XX-XXXXXX",这是我不想要的.我不想让连接长时间打开,我希望应用程序只在需要时才能连接.怎么做到这一点?任何帮助家伙.找到下面的代码.感谢提前.

package anil.com.andoirdbluetoothprint;


import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.Set;
import java.util.UUID;

import android.app.Activity;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;


public class MainActivity extends Activity implements Runnable {
    protected static final String TAG = "TAG";
    private static final int REQUEST_CONNECT_DEVICE = 1;
    private static final int REQUEST_ENABLE_BT = 2;
    Button mScan, mPrint, …
Run Code Online (Sandbox Code Playgroud)

printing android bluetooth

15
推荐指数
1
解决办法
207
查看次数

Bash脚本创建自定义缩略图

我需要一个bash脚本来将所有图像保存在指定的文件夹中;采取分辨率,如果分辨率低于最小值,则不执行任何操作,否则请创建中等拇指图像(200x150像素)。

我在Windows中使用Imagemagick。但是在Linux上,我不能使用相同的脚本,因此需要编写一个新脚本。

到目前为止,这就是我提出的。

#!/bin/bash
for files in /path/to/image/*
  do
       TESTFILE=`echo "$files" | sed 's/|/ /g' | xargs file -b | awk '{print $1}'`
       while read F
       CHECKSIZE=`file "$TESTFILE" -b | sed 's/ //g' | sed 's/,/ /g' | awk  '{print $2}' | sed 's/x/ /g' | awk '{print $1}'`
     if [ $CHECKSIZE -ge  200  ]; then
        convert -sample 200x150 "$F" "$F{_thumb}"
     fi
    done
  done
Run Code Online (Sandbox Code Playgroud)

但是,当我运行此脚本时,它没有给我缩略图也没有给我任何错误。我对这些脚本非常陌生。

更新:

我想出了这个脚本,谢谢大家。但是现在我需要一个帮助。现在我想将新图像存储在图像文件夹内的文件夹中。例如,/ home / image是所有文件所在的位置。我希望将拇指图像存储在/ home / image / thumbs中。我也想将文件重命名为filename_thumb.jpg …

linux shell imagemagick thumbnails

5
推荐指数
1
解决办法
4320
查看次数

在CodeIgniter中加载CSS,JS

我是CodeIgniter的新手.不知怎的,我设置了开发环境并准备好了.但是加载CSS,JS加入页面似乎更令人困惑.在移动之前,我搜索了很多,但base_url解决方案没有帮助.

部分观点:

<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet">
<link href='css/fullcalendar.css' rel='stylesheet'>
<link href='css/fullcalendar.print.css' rel='stylesheet'  media='print'>
<link href='css/opa-icons.css' rel='stylesheet'>
<link href='css/uploadify.css' rel='stylesheet'>
Run Code Online (Sandbox Code Playgroud)

控制器:

public function dashboard()
    {
        $this->load->helper('url');
        $this->load->view('templates/css_styles');
        $this->load->view('templates/top_bar');
        $this->load->view('templates/left_menu');
        $this->load->view('pages/dashboard');
        $this->load->view('templates/footer');
        $this->load->view('templates/js_end');
    }
public function index()
    {
        $this->load->helper(array('form'));
        $this->load->view('login');
    }
Run Code Online (Sandbox Code Playgroud)

route.php:

$route['default_controller'] = "welcome/dashboard";
$route['404_override'] = '';
$route['dashboard'] = 'welcome/dashboard';
Run Code Online (Sandbox Code Playgroud)

如果我将仪表板方法作为默认控制器,页面加载正常.但是,当我将其更改为欢迎时,这是一个登录表单并重定向到welcome/dashboard,该页面不会加载任何CSS.只是所有HTML文本.仪表板页面只是纯HTML,尚未编写PHP代码.

请帮我解决可能导致此问题的原因.

php codeigniter

4
推荐指数
1
解决办法
6069
查看次数