Qt5.5.1移植到freescale imx6
一、环境
HOST:ubuntu12.04-LTS
Embedded:freescale imx6 linux-3.0.35
CROSS_COMPILE:freescale提供的gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-
二、下载源码
http://mirrors.ustc.edu.cn/qtproject/archive/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.gz
三、解压
unzip qt-everywhere-opensource-src-5.5.1.tar.gz
cd qt-everywhere-opensource-src-5.5.1
四、指定arm架构、交叉编译器、包含的文件系统头文件、部分编译参数
vi qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf
以下为全部内容,其他平台qtbase/mkspecs/devices/下要是没有单独提供,可以使用qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,需根据自己平台做相应修改。
- #
- # qmake configuration for the Freescale iMX6 boards (single, dual and quad)
- #
- #export CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-
- MAKEFILE_GENERATOR = UNIX #宏定义,代码中有判断
- CONFIG += incremental
- QMAKE_INCREMENTAL_STYLE = sublib
- QT_QPA_DEFAULT_PLATFORM = linuxfb #eglfs #显示使用linuxfb或eglfs
- IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 #处理器架构
- IMX6_CFLAGS_RELEASE = -O2 $$IMX6_CFLAGS
- QMAKE_CFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
- QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
- QMAKE_CFLAGS += $$IMX6_CFLAGS
- QMAKE_CXXFLAGS += $$IMX6_CFLAGS
- include(../common/linux_device_pre.conf)
- include(../../common/linux.conf)
- include(../../common/gcc-base-unix.conf)
- include(../../common/g++-unix.conf)
- # modifications to g++.conf
- QMAKE_CC = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc
- QMAKE_CXX = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-g++
- QMAKE_LINK = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-g++
- QMAKE_LINK_SHLIB = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-g++
- # modifications to linux.conf
- QMAKE_AR = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-ar cqs
- QMAKE_OBJCOPY = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-objcopy
- QMAKE_STRIP = /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-strip
- QMAKE_INCDIR += /imx_disk/gq/qt/rootfs/usr/include
- QMAKE_LIBDIR += /imx_disk/gq/qt/rootfs/usr/lib
- QMAKE_INCDIR += /imx_disk/gq/qt/rootfs/usr/include/dbus-1.0
- QMAKE_INCDIR += /imx_disk/gq/qt/rootfs/usr/lib/dbus-1.0/include
- QMAKE_LIBDIR += /imx_disk/gq/qt/rootfs/usr/lib
- QMAKE_INCDIR_OPENGL_ES2 = /imx_disk/gq/qt/rootfs/usr/include
- QMAKE_LIBDIR_OPENGL_ES2 = /imx_disk/gq/qt/rootfs/usr/lib
- QMAKE_INCDIR_EGL = /imx_disk/gq/qt/rootfs/usr/include
- QMAKE_LIBDIR_EGL = /imx_disk/gq/qt/rootfs/usr/lib
- QMAKE_LIBS_OPENGL_ES1 += -lGLESv1_CM -lEGL -lGAL
- QMAKE_LIBS_OPENGL_ES1CL += -lGLES_CL -lEGL -lGAL
- QMAKE_LIBS_EGL += -lEGL
- QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
- QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
- QMAKE_LIBS += -ljpeg -ldbus-1 -lrt -lpthread #编译选项
- #DISTRO_OPTS += hard-float #浮点运算使用软件不使用硬件
- # Preferred eglfs backend
- EGLFS_DEVICE_INTEGRATION = eglfs_viv
- include(../common/linux_arm_device_post.conf)
- load(qt_config)
五、根据自己实际需求配置QT
- #!/bin/sh
- ./configure \
- -v -opensource -confirm-license -no-pch -no-xcb -no-openssl -no-opengl -opengl es2 \
- -dbus \
- -qt-zlib \
- -no-sse2 \
- -no-iconv \
- -tslib \
- -release \
- -make libs -device imx6 \
- -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- \
- -sysroot /imx_disk/gq/qt/ -no-gcc-sysroot \
- -prefix /qt5.5.1 \
- -make examples -nomake tools -nomake tests
配置结果如下:
- Build options:
- Configuration .......... accessibility alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus eglfs_viv enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap neon nis no-pkg-config opengl opengles2 openvg pcre png posix_fallocate qpa qpa reduce_exports release rpath shared small-config system-jpeg tslib zlib
- Build parts ............ libs examples
- Mode ................... release
- Using sanitizer(s)...... none
- Using C++11 ............ yes
- Using gold linker....... no
- Using new DTAGS ........ yes
- Using PCH .............. no
- Target compiler supports:
- Neon ................. yes
- Qt modules and options:
- Qt D-Bus ............... yes (loading dbus-1 at runtime)
- Qt Concurrent .......... yes
- Qt GUI ................. yes
- Qt Widgets ............. yes
- Large File ............. yes
- QML debugging .......... yes
- Use system proxies ..... no
- Support enabled for:
- Accessibility .......... yes
- ALSA ................... yes
- CUPS ................... no
- Evdev .................. yes
- FontConfig ............. no
- FreeType ............... yes (bundled copy)
- Glib ................... no
- GStreamer .............. no
- GTK theme .............. no
- HarfBuzz ............... yes (bundled copy)
- Iconv .................. no
- ICU .................... no
- Image formats:
- GIF .................. yes (plugin, using bundled copy)
- JPEG ................. yes (plugin, using system library)
- PNG .................. yes (in QtGui, using bundled copy)
- journald ............... no
- libinput................ no
- mtdev .................. no
- Networking:
- getaddrinfo .......... yes
- getifaddrs ........... yes
- IPv6 ifname .......... yes
- libproxy.............. no
- OpenSSL .............. no
- NIS .................... yes
- OpenGL / OpenVG:
- EGL .................. no
- OpenGL ............... yes (OpenGL ES 2.0+)
- OpenVG ............... yes-auto
- PCRE ................... yes (bundled copy)
- pkg-config ............. no
- PulseAudio ............. no
- QPA backends:
- DirectFB ............. no
- EGLFS ................ no
- EGLFS i.MX6....... . yes
- EGLFS KMS .......... no
- EGLFS Mali ......... no
- EGLFS Raspberry Pi . no
- EGLFS X11 .......... no
- LinuxFB .............. yes
- XCB .................. no
- Session management ..... yes
- SQL drivers:
- DB2 .................. no
- InterBase ............ no
- MySQL ................ no
- OCI .................. no
- ODBC ................. no
- PostgreSQL ........... no
- SQLite 2 ............. no
- SQLite ............... yes (plugin, using bundled copy)
- TDS .................. no
- tslib .................. yes
- udev ................... no
- xkbcommon-x11........... no
- xkbcommon-evdev......... no
- zlib ................... yes (bundled copy)
六、编译安装
1、make
2、make install
七、copy到开发板设置环境变量
1、将qt5.5.1打包拷贝到文件系统/usr/local/下,其中包含了qt5的examples,可以删除。
2、添加QT系统环境变量
vi /etc/profile添加
#for QT
export QT_ROOT=/usr/local/qt5.5.1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib:$QT_ROOT/lib
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_FONTDIR=$QT_ROOT/lib/fonts
export QT_QPA_GENERIC_PLUGINS=evdevtouch:/dev/input/event0
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin
export QML2_IMPORT_PATH=$QT_ROOT/qml
#export QT_QPA_GENERIC_PLUGINS=tslib:$TSLIB_TSDEVICE//如果触摸使用TSlib支持则修改为该句。
#export QT_QPA_EGLFS_FB=/dev/fb1
注:QT触摸屏支持可以不使用tslib。
3、tslib移植及支持请看http://blog.csdn.net/xishuang_gongzi/article/details/49422879
八、运行例子
注:图懒得截了,从别人处拷贝的。
examples/touch/pinchzoom/pinchzoom
examples/svg/embedded/fluidlauncher/fluidlauncher
九、编译及运行问题记录
1、编译错误:opengles2.cpp:37:25: fatal error: GLES2/gl2.h:
No such file or directory
vi qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf
解决:
QMAKE_INCDIR_OPENGL_ES2 = /imx_disk/gq/qt/rootfs/usr/include
QMAKE_LIBDIR_OPENGL_ES2 = /imx_disk/gq/qt/rootfs/usr/lib
2、编译错误:In function `png_reset_crc': png.c: undefined reference to `z_crc32'等,qtbase/src/3rdparty/libpng编译时出现大量z_开头的zlib库函数找不到定义。
解决:
./configure 后添加编译-qt-zlib
qt为了防止自己的zlib库与系统的zlib库冲突。Since Qt Core must export these symbols, define Z_PREFIX to avoid clashes system zlib */
3、编译错误:
运行时出现错误提示
QIconvCodec::convertToUnicode: using Latin-1 for conversion,iconv_open
failed
QIconvCodec::convertFromUnicode: using Latin-1 for conversion,iconv_open failed
解决:
./configure 后添加编译 -no-iconv
4、编译错误qtwebkit/lib/libQt5WebKit.so:
undefined reference to `jpeg_input_complete'
解决:
./configure 后添加编译-qt-libjpeg
5、编译错误:arm-fsl-linux-gnueabi/bin/ld: warning: libjpeg.so.62,
needed by /.....qtwebkit/lib/libQt5WebKit.so, not found (try using -rpath or -rpath-link)
解决:
vi qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf添加
QMAKE_LIBS += -ljpeg
http://blog.sina.com.cn/s/blog_616fb0880100xrjj.html
6、编译错误:
qibusplatforminputcontext.cpp: In member function 'virtual void QIBusPlatformInputContext::reset()':
qibusplatforminputcontext.cpp:117:17: error: 'class QIBusInputContextProxy' has no member named 'Reset'
qibusplatforminputcontext.cpp: In member function 'virtual void QIBusPlatformInputContext::commit()':
qibusplatforminputcontext.cpp:140:17: error: 'class QIBusInputContextProxy' has no member named 'Reset'
解决:
qt编译./configuer 后加上-dbus
7、配置错误:
The Qt D-Bus module cannot be enabled because libdbus-1 version 1.2 was not found.
解决:
参考:找到-prefix目录下的lib文件下的pkgconfig文件夹,打开dbus-1.pc
vi qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf
QMAKE_INCDIR += /imx_disk/gq/qt/rootfs/usr/include/dbus-1.0
QMAKE_INCDIR += /imx_disk/gq/qt/rootfs/usr/lib/dbus-1.0/include
QMAKE_LIBDIR += /imx_disk/gq/qt/rootfs/usr/lib
若rootfs中没有dbus库,则需要移植dbus1.2版本copy到文件系统,添加参数如下
QMAKE_INCDIR += /imx_disk/gq/qt/dbus/dbusinstall_1.2.30/include/dbus-1.0
QMAKE_INCDIR += /imx_disk/gq/qt/dbus/dbusinstall_1.2.30/lib/dbus-1.0/include
QMAKE_LIBDIR += /imx_disk/gq/qt/dbus/dbusinstall_1.2.30/lib
其中dbusinstall_1.2.30是交叉编译dbus1.2后的安装目录。
编译dbus前需要先交叉编译dbus的依赖库expat-2.1.0
Cannot find libdbus-1 in your system to resolve symbol 'dbus_get_local_machine_id'.
Aborted
qt编译./configuer 后加上-dbus
9、编译错误:
/imx_disk/gq/qt/dbus/dbusinstall_1.2.30/lib/libdbus-1.a(dbus-sysdeps-pthread.o):
In function `_dbus_pthread_condvar_wait_timeout':
/imx_disk/gq/qt/dbus/dbus-1.2.30/dbus/dbus-sysdeps-pthread.c:273: undefined reference to `clock_gettime'
/imx_disk/gq/qt/dbus/dbusinstall_1.2.30/lib/libdbus-1.a(dbus-sysdeps-pthread.o): In function `_dbus_pthread_condvar_new':
/imx_disk/gq/qt/dbus/dbus-1.2.30/dbus/dbus-sysdeps-pthread.c:206: undefined reference to `pthread_condattr_setclock'
/imx_disk/gq/qt/dbus/dbusinstall_1.2.30/lib/libdbus-1.a(dbus-sysdeps-pthread.o): In function `check_monotonic_clock':
/imx_disk/gq/qt/dbus/dbus-1.2.30/dbus/dbus-sysdeps-pthread.c:353: undefined reference to `clock_getres'
/imx_disk/gq/qt/dbus/dbusinstall_1.2.30/lib/libdbus-1.a(dbus-sysdeps-unix.o): In function `_dbus_get_current_time':
/imx_disk/gq/qt/dbus/dbus-1.2.30/dbus/dbus-sysdeps-unix.c:2071: undefined reference to `clock_gettime'
解决:
vi qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf
QMAKE_LIBS += -lrt
10、编译错误:
qsgvivantevideonode.cpp: In static member function
'static const QMap<QVideoFrame::PixelFormat, unsigned int>& QSGVivanteVideoNode::getVid eoFormat2GLFormatMap()':
qsgvivantevideonode.cpp:64:77: error: 'GL_VIV_I420' was not declared in this scope
解决:方式两种,选一种,我们选第二种
①、
vi ./qtmultimedia/src/plugins/videonode/imx6/qsgvivantevideonode.cpp
const QMap<QVideoFrame::PixelFormat, GLenum>& QSGVivanteVideoNode::getVideoFormat2GLFormatMap()
{
if (static_VideoFormat2GLFormatMap.isEmpty()) {
// static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_YUV420P, GL_VIV_I420);
//this video format needs to be commented because it will have support with kernel 3.10 but not with actual one
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_YV12, GL_VIV_YV12);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_NV12, GL_VIV_NV12);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_NV21, GL_VIV_NV21);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_UYVY, GL_VIV_UYVY);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_YUYV, GL_VIV_YUY2);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_RGB32, GL_BGRA_EXT);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_ARGB32, GL_BGRA_EXT);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_BGR32, GL_RGBA);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_BGRA32, GL_RGBA);
static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_RGB565, GL_RGB565);
}
return static_VideoFormat2GLFormatMap;
}
②
vi rootfs/usr/include/GLES2/gl2ext.h
/* GL_VIV_direct_texture */
#ifndef GL_VIV_direct_texture
#define GL_VIV_YV12 0x8FC0
#define GL_VIV_NV12 0x8FC1
#define GL_VIV_YUY2 0x8FC2
#define GL_VIV_UYVY 0x8FC3
#define GL_VIV_NV21 0x8FC4
#define GL_VIV_I420 0x8FC5
//新增
#endif
值来自于这个patch https://lists.yoctoproject.org/pipermail/meta-freescale/2014-June/008709.html
11、编译错误:
ssl/qsslcontext_openssl.cpp:444:52: error: 'SSL_SESSION'
has no member named 'tlsext_tick_lifetime_hint'
解决:
configure编译时添加-no-openssl,即不编译openssl
12、运行错误:
./examples/quick/demos/samegame/samegame
qrc:///demos/samegame/samegame.qml:41:1: module "QtQuick" is not installed
qrc:///demos/samegame/samegame.qml:42:1: module "QtQuick.Particles" is not installed
qrc:///demos/samegame/samegame.qml:41:1: module "QtQuick" is not installed
qrc:///demos/samegame/samegame.qml:42:1: module "QtQuick.Particles" is not installed
解决:
在环境里添加:export QML2_IMPORT_PATH=$QT_ROOT/qml,就能解决qrc:///main.qml:1
module "QtQuick" is not installed这样类似的问题,
$QT_ROOT/qml是你编译安装后会有个文件夹的。
13、运行错误:./examples/quick/demos/samegame/samegame
This plugin does not support createPlatformOpenGLContext!
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile
0)
Aborted
回答:
The problem is likely that you are using qt quick 2, which requires OpenGL. OpenGL does not support the frame buffer used for the small display.
14、编译错误:
../WTF/wtf/unicode/wchar/UnicodeWchar.h: In function 'bool WTF::Unicode::isAlphanumeric(UChar)':
../WTF/wtf/unicode/wchar/UnicodeWchar.h:136:58: error:
'iswalnum' was not declared in this scope
../WTF/wtf/unicode/wchar/UnicodeWchar.h: In function 'bool WTF::Unicode::isDigit(UChar)':
../WTF/wtf/unicode/wchar/UnicodeWchar.h:137:51: error: 'iswdigit' was not declared in this scope
../WTF/wtf/unicode/wchar/UnicodeWchar.h: In function 'bool WTF::Unicode::isLetter(UChar)':
解决:
vi ./qtwebkit/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
#ifndef Android
/*add by gq start*/
#include <wctype.h>
typedef unsigned short int UChar;
/*add by gq end*/
//# include <wchar.h>
// typedef wchar_t UChar;
#else
typedef unsigned short int UChar;
#endif
15、编译错误:cc1plus: error: unrecognized command line option
'-fuse-ld=gold'
解决:
这是Qt的一个bug:https://bugs.webkit.org/show_bug.cgi?id=89312
在装有gold linker的系统里,编译脚本会加入-fuse-ld=gold选项,但这个选项gcc是不支持的。解决办法是移除该选项,
vi qtbase/configure
CFG_USE_GOLD_LINKER=no
16、编译错误3、arm-fsl-linux-gnueabi/bin/ld: error: arch.o
uses VFP register arguments, arch does not
解决:
vi./qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf
#DISTRO_OPTS += hard-float
屏蔽掉该句后
g++编译器就被设置成-mfloat-abi=softfp,不使用hard,即浮点运算使用软件不使用硬件。
17、运行错误:
root@freescale /opt$ ./examples/svg/embedded/fluidlauncher/fluidlauncher
process 2622: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/usr/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted
解决:
dbus-uuidgen > /usr/var/lib/dbus/machine-id
Qt5.5.1移植到freescale imx6的更多相关文章
- 超详细Qt5.9.5移植攻略
本文就来介绍下如何将Qt5.9.5移植到ARM开发板上. 以imx6开发板为例,使用Ubuntu14.04虚拟机作为移植环境. 准备工作 1.主机环境:Ubuntu14.04: 开发板:启扬IAC-I ...
- Qt5.4.1移植到arm——Linuxfb篇
Qt5与Qt4对比有很大的改变,其最大的特性在于模块化,并且很明显的是不再见到Qt4用到的qws,Qt5新增了QPA系统,基于QPA使得Qt5移 植到一个新平台非常简单而又具有极强的底层扩展能力:同时 ...
- qt-5.6.0 移植之qt文件系统的建立
经过差不多两个星期的奋斗,终于在板子里面跑起来了qt 程序,虽然现在还没有把触摸屏驱动加上去,但是我相信已经不远了!!!!! 在前两篇的随笔里面 , 已经编译好了最纯净的文件系统以及交叉编译完成了qt ...
- qt-5.6.0 移植之qt源码编译
其实这只是给自己看的一个configure选项笔记,没有太多的东西. 首先: 下载qt5.6的源码: 地址: http://download.qt.io/archive/qt/5.6/ 下载完解压: ...
- Qt5.7.0移植到4412
搞了几天,终于把Qt5.7移植到4412上,下面是一些自己移植过程中的记录,希望能帮到其他人. 一.需要下载的文件, 下载qt5.7源码qt-everywhere-opensource-src-5.7 ...
- flash_header.S ( freescale imx6 board)
/* * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. * * This program is free software; you ca ...
- qt-5.6.0 移植之tslib 配置及编译
tslib 是qt启动时的一个触屏校正检验程序. 它的配置以及编译比较简单. 第一步, 下载tslib源码包: http://download.csdn.net/detail/MKNDG/329156 ...
- Tensorflowlite移植ARM平台iMX6
一.LINUX环境下操作: 1.安装交叉编译SDK (仅针对该型号:i.MX6,不同芯片需要对应的交叉编译SDK) 编译方法参考:手动编译用于i.MX6系列的交叉编译SDK 2.下载Tensorflo ...
- qt-5.6.0 移植之实现板子与ubuntu主机通过网络进行文件传输
经过一上午的调试以及同事的帮助,终于实现板子与主机的文件传输. 第一步关闭所有的防火墙 在 Windows 里面是在控制面板->安全->Windows 防火墙->自定义设置 在ubu ...
随机推荐
- 【BZOJ】2016: [Usaco2010]Chocolate Eating(二分)
http://www.lydsy.com/JudgeOnline/problem.php?id=2016 这些最大最小显然是二分. 但是二分细节挺多的...这里注意二分的区间,可以累计所有的可能,然后 ...
- 时间戳(Unix时间)
/// <summary> /// 时间戳与DateTime互转 /// </summary> public class UnixOfTimeHelper { /// < ...
- html5 webwork
在Web开发的时候经常会遇到浏览器不响应事件进入假死状态,甚至弹出“脚本运行时间过长“的提示框,如果出现这种情况说明你的脚本已经失控了. 一个浏览器至少存在三个线程:js引擎线程(处理js).GUI渲 ...
- Entity Framework基础
http://blog.csdn.net/hurtlingsnail/article/details/53113934
- Android无线测试之—KEYCODE键值对应大全
KEYCODE列表电话键键名 描述 键值 KEYCODE_CALL 拨号键5 KEYCODE_ENDCALL 挂机键6 KEYCODE_HOME 按键Home3 KEYCODE_ME ...
- JZOJ.5258【NOIP2017模拟8.11】友好数对
Description
- 两个表join 连接,去掉重复的数据
-------distinct 去重复查询 select * from accounts acc join (select distinct accid from roles) r on r.acc ...
- 【BZOJ4567】[Scoi2016]背单词 Trie树+贪心
[BZOJ4567][Scoi2016]背单词 Description Lweb 面对如山的英语单词,陷入了深深的沉思,“我怎么样才能快点学完,然后去玩三国杀呢?”.这时候睿智 的凤老师从远处飘来,他 ...
- iOS 状态栏更改为白色
如果觉得在iOS 7启动期间状态栏黑色不合你意,以下方法可改变Status bar style成白色 在工程的plist添加 Status bar style,改变style值 默认是Gray sty ...
- Centos6.5 DNS配置
服务器端:192.168.186.130 1.安装 # yum -y install bind* 2.主要配置文件 [root@localhost named]# vim /etc/named.con ...