首页 文章 精选 留言 我的

精选列表

搜索[Excel导入],共10008篇文章
优秀的个人博客,低调大师

利用Sqoop将MySQL数据导入Hive中

参考 http://www.cnblogs.com/iPeng0564/p/3215055.html http://www.tuicool.com/articles/j2yayyj http://blog.csdn.net/jxlhc09/article/details/16856873 1.list databases sqoop list-databases --connect jdbc:mysql://192.168.2.1:3306/ --username sqoop --password sqoop 2.用sqoop创建hive表 sqoop create-hive-table --connect jdbc:mysql://xx:3306/test?characterEncoding=UTF-8 --table employee --username root -password 'xx' --hive-database db_hive_edu 3.import数据 #sqoop import --connect jdbc:mysql://xx:3306/test?characterEncoding=UTF-8 --table employee --username root -password 'xx' --fields-terminated-by ',' --hive-import --hive-database db_hive_edu -m 1 --fields-terminated-by ',' 导致数据变成null sqoop import --connect jdbc:mysql://xx:3306/test?characterEncoding=UTF-8 --username root -password 'xx' --table employee --hive-import --hive-database db_hive_edu -m 1 截图 如果需要实时同步,不再手动,参考 利用Flume将MySQL表数据准实时抽取到HDFS - wzy0623的专栏 - 博客频道 - CSDN.NET 这才是最正确的解决方案 本文转自 liqius 51CTO博客,原文链接:http://blog.51cto.com/szgb17/1941914,如需转载请自行联系原作者

优秀的个人博客,低调大师

导入开源的文件云存储平台-Seafile

1 理论基础 1.1 简介 Seafile 是一个开源的文件云存储平台,更注重于隐私保护和对团队文件协作的支持。 Seafile 通过“资料库”来分类管理文件,每个资料库可单独同步,用户可加密资料库, 且密码不会保存在服务器端,所以即使是服务器管理员也无权访问你的文件。 Seafile 允许用户创建“群组”,在群组内同步文件、创建维基、发起讨论等,方便团队内协同工作 1.2 软件许可协议 Seafile 及其桌面、移动客户端遵循 GPLv3。 Seahub(Seafile 服务器的 web 端)遵循 Apache License。 1.3 部署的要求 要求安装以下组件: python 2.7 (从 Seafile 5.1 开始,python 版本最低要求为2.7) python-setuptools python-imaging python-mysqldb python-ldap python-urllib3 python-memcache (或者 python-memcached) 1.4 Seafile的系统架构 如上图所示,Seafile 包含以下系统组件: Seahub - 网站界面,供用户管理自己在服务器上的数据和账户信息。Seafile服务器通过"gunicorn"(一个轻量级的Python HTTP服务器)来提供网站支持。Seahub作为gunicorn的一个应用程序来运行。 Seafile server (seaf-server) - 数据服务进程, 处理原始文件的上传/下载/同步。 Ccnet server (ccnet-server) - 内部 RPC 服务进程,连接多个组件。 Controller - 监控 ccnet 和 seafile 进程,必要时会重启进程。 注: 所有 Seafile 服务都可以配置在 Nginx/Apache 后面,由 Nginx/Apache 提供标准的 http(s) 访问。 当用户通过 seahub 访问数据时,seahub 通过 ccnet 提供的内部 RPC 来从 seafile server 获取数据。 2 实践部分 2.1 环境信息 2.1.1 主机信息 hostname=seafile.cmdschool.org ip address=10.168.0.53 os type=CentOS Linux release 7.2 2.1.2 域名解析 配置dns解析或配置host解析,host解析配置如下(客户端和服务端): 1 vim /etc/hosts 加入如下内容: 1 10.168.0.53seafile.cmdschool.org 2.1.3 关闭selinux 1 2 setenforce0 sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 2.2 yum源和安装包 2.2.1 更新系统 1 yumupdate 2.2.2 数据库的安装 1 yum install -ymariadb-servermariadb-develmariadb 2.2.3 安装脚本运行环境 1 yum install -ypython-setuptoolspython-imagingpython-ldapMySQL-pythonpython-memcachedpython-urllib3 2.2.4 安装nginx 1 2 yum install -yhttp: //nginx .org /packages/centos/7/noarch/RPMS/nginx-release-centos-7-0 .el7.ngx.noarch.rpm yum install -ynginx 2.2.5 其他配置工具 1 yum install -ynet-toolsvimwgettree 2.4.6 下载安装包 1 2 cd ~ wgethttps: //bintray .com /artifact/download/seafile-org/seafile/seafile-server_5 .1.3_x86-64. tar .gz 2.3 配置数据库 2.3.1 启动数据库并配置数据库开机默认启动 1 2 systemctlstartmariadb systemctl enable mariadb 2.3.2 初始化数据库 1 mysql_secure_installation 向导如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [...] Setrootpassword?[Y /n ]y Newpassword: Re-enternewpassword: Passwordupdatedsuccessfully! Reloadingprivilegetables.. ...Success! [...] Removeanonymous users ?[Y /n ]y ...Success! [...] Disallowrootloginremotely?[Y /n ]n ...skipping. [...] Remove test databaseandaccesstoit?[Y /n ]y -Dropping test database... ...Success! -Removingprivilegeson test database... ...Success! [...] Reloadprivilegetablesnow?[Y /n ]y ...Success! [...] 2.4 安装主程序 2.4.1建立目录结构 1 2 mkdir /home/cmdschool .org cp seafile-server_5.1.3_x86-64. tar .gz /home/cmdschool .org 2.4.2 解压并备份安装包 1 2 3 4 cd /home/cmdschool .org tar -xfseafile-server_5.1.3_x86-64. tar .gz mkdir installed mv seafile-server_5.1.3_x86-64. tar .gzinstalled/ 检查目录 1 2 cd /home/cmdschool .org tree-L2 显示如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 . ├──installed │└──seafile-server_5.1.3_x86-64. tar .gz └──seafile-server-5.1.3 ├──check_init_admin.py ├──reset-admin.sh ├──runtime ├──seaf- fsck .sh ├──seaf-fuse.sh ├──seaf-gc.sh ├──seafile ├──seafile.sh ├──seahub ├──seahub.sh ├──setup-seafile-mysql.py ├──setup-seafile-mysql.sh ├──setup-seafile.sh └──upgrade 6directories,11files 2.4.3 运行安装向导 1 2 cd seafile-server-5.1.3 . /setup-seafile-mysql .sh 显示如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 Checkingpythononthismachine... Checkingpythonmodule:setuptools...Done. Checkingpythonmodule:python-imaging...Done. Checkingpythonmodule:python-mysqldb...Done. ----------------------------------------------------------------- ThisscriptwillguideyoutosetupyourseafileserverusingMySQL. Makesureyouhave read seafileservermanualat https: //github .com /haiwen/seafile/wiki PressENTERto continue ----------------------------------------------------------------- Whatisthenameoftheserver?Itwillbedisplayedontheclient. 3-15lettersordigits [servername]seafile Whatistheipordomainoftheserver? Forexample:www.mycompany.com,192.168.1.101 [Thisserver'sipordomain]seafile.cmdschool.org Where do youwanttoputyourseafiledata? Pleaseuseavolumewithenough free space [default "/home/cmdschool.org/seafile-data" ] Whichport do youwanttouse for theseafilefileserver? [default "8082" ] ------------------------------------------------------- Pleasechooseawaytoinitializeseafiledatabases: ------------------------------------------------------- [1]Createnewccnet /seafile/seahub databases [2]Useexistingccnet /seafile/seahub databases [1or2]1 Whatisthehostofmysqlserver? [default "localhost" ] Whatistheportofmysqlserver? [default "3306" ] Whatisthepasswordofthemysqlrootuser? [rootpassword] verifyingpasswordofuserroot... done Enterthename for mysqluserofseafile.Itwouldbecreated if notexists. [default "root" ]seafile Enterthepassword for mysqluser "seafile" : [password for seafile] verifyingpasswordofuserseafile... done Enterthedatabasename for ccnet-server: [default "ccnet-db" ] Enterthedatabasename for seafile-server: [default "seafile-db" ] Enterthedatabasename for seahub: [default "seahub-db" ] --------------------------------- Thisisyourconfiguration --------------------------------- servername:seafile serverip /domain :seafile.cmdschool.org seafiledata dir : /home/cmdschool .org /seafile-data fileserverport:8082 database:createnew ccnetdatabase:ccnet-db seafiledatabase:seafile-db seahubdatabase:seahub-db databaseuser:seafile --------------------------------- PressENTERto continue ,orCtrl-Ctoabort --------------------------------- Generatingccnetconfiguration... done Successlycreateconfiguration dir /home/cmdschool .org /ccnet . Generatingseafileconfiguration... Done. done Generatingseahubconfiguration... ---------------------------------------- Nowcreatingseahubdatabasetables... ---------------------------------------- creatingseafile-server-latestsymboliclink... done ----------------------------------------------------------------- Yourseafileserverconfigurationhasbeenfinishedsuccessfully. ----------------------------------------------------------------- runseafileserver:. /seafile .sh{start|stop|restart} runseahubserver:. /seahub .sh{start<port>|stop|restart<port>} ----------------------------------------------------------------- Ifyouarebehindafirewall,remembertoallowinput /output ofthesetcpports: ----------------------------------------------------------------- portofseafilefileserver:8082 portofseahub:8000 Whenproblemsoccur,Referto https: //github .com /haiwen/seafile/wiki for information. 2.4.4 确认安装 1 2 cd /home/cmdschool .org tree-L2 显示如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 . ├──ccnet │├──mykey.peer │└──seafile.ini ├──conf │├──ccnet.conf │├──seafdav.conf │├──seafile.conf │└──seahub_settings.py ├──installed │└──seafile-server_5.1.3_x86-64. tar .gz ├──seafile-data │└──library-template ├──seafile-server-5.1.3 │├──check_init_admin.py │├──reset-admin.sh │├──runtime │├──seaf- fsck .sh │├──seaf-fuse.sh │├──seaf-gc.sh │├──seafile │├──seafile.sh │├──seahub │├──seahub.sh │├──setup-seafile-mysql.py │├──setup-seafile-mysql.sh │├──setup-seafile.sh │└──upgrade ├──seafile-server-latest->seafile-server-5.1.3 └──seahub-data └──avatars 13directories,17files 2.4.5 启动Seafile 1 /home/cmdschool .org /seafile-server-5 .1.3 /seafile .shstart 显示如下: 1 2 3 4 5 [06 /19/16 13:23:55].. /common/session .c(132):usingconfig file /home/cmdschool .org /conf/ccnet .conf Startingseafileserver,pleasewait... Seafileserverstarted Done. 2.4.6 启动Seahub 1 /home/cmdschool .org /seafile-server-5 .1.3 /seahub .shstart 向导如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LC_ALLisnot set in ENV, set toen_US.UTF-8 Startingseahubatport8000... ---------------------------------------- It 'sthefirsttimeyoustarttheseafileserver.Nowlet' screatetheadminaccount ---------------------------------------- Whatistheemail for theadminaccount? [adminemail]will@cmdschool.org Whatisthepassword for theadminaccount? [adminpassword] Enterthepasswordagain: [adminpasswordagain] ---------------------------------------- Successfullycreatedseafileadmin ---------------------------------------- Seahubisstarted Done. 2.4.7 配置防护墙 1 2 3 4 firewall-cmd--permanent--add-port=8000 /tcp firewall-cmd--permanent--add-port=8082 /tcp firewall-cmd--reload firewall-cmd--list-all 2.4.8 浏览器测试 1 http: //seafile .cmdschool.org:8000 2.5 配置nginx的http代理 注:以下配置基于2.4章节 2.5.1 配置虚拟服务 1 vim /etc/nginx/conf .d /seafile .com 输入如下内容: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 erver{ listen80; server_nameseafile.cmdschool.org; proxy_set_headerX-Forwarded-For$remote_addr; location/{ fastcgi_pass127.0.0.1:8000; fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name; fastcgi_paramPATH_INFO$fastcgi_script_name; fastcgi_paramSERVER_PROTOCOL$server_protocol; fastcgi_paramQUERY_STRING$query_string; fastcgi_paramREQUEST_METHOD$request_method; fastcgi_paramCONTENT_TYPE$content_type; fastcgi_paramCONTENT_LENGTH$content_length; fastcgi_paramSERVER_ADDR$server_addr; fastcgi_paramSERVER_PORT$server_port; fastcgi_paramSERVER_NAME$server_name; fastcgi_paramREMOTE_ADDR$remote_addr; access_log /var/log/nginx/seahub .access.log; error_log /var/log/nginx/seahub .error.log; } location /seafhttp { rewrite^ /seafhttp (.*)$$1 break ; proxy_passhttp: //127 .0.0.1:8082; client_max_body_size0; proxy_connect_timeout36000s; proxy_read_timeout36000s; } location /media { root /home/cmdschool .org /seafile-server-latest/seahub ; } } 2.5.2 修改SERVICE_URL和FILE_SERVER_ROOT 界面中单击“系统管理”->“设置”修改如下参数为: 1 2 SERVICE_URL:http: //seafile .cmdschool.org FILE_SERVER_ROOT:http: //seafile .cmdschool.org /seafhttp 2.5.3 配置启动脚本 1 vim /home/cmdschool .org /seafile-server-5 .1.3 /seafiled .sh 修改启动参数如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 #!/bin/sh #请将user改为你的Linux用户名 user=seafile #请将script_dir改为你的Seafile文件安装路径 seafile_dir= /home/cmdschool .org script_path=${seafile_dir} /seafile-server-latest seafile_init_log=${seafile_dir} /logs/seafile .init.log seahub_init_log=${seafile_dir} /logs/seahub .init.log #若使用Nginx/Apache,请将其设置为true,否者为false fastcgi= true #fastcgi端口,默认为8000. fastcgi_port=8000 case "$1" in start) sudo -u${user}${script_path} /seafile .shstart>>${seafile_init_log} if [$fastcgi= true ]; then sudo -u${user}${script_path} /seahub .shstart-fastcgi${fastcgi_port}>>${seahub_init_log} else sudo -u${user}${script_path} /seahub .shstart>>${seahub_init_log} fi ;; restart) sudo -u${user}${script_path} /seafile .shrestart>>${seafile_init_log} if [$fastcgi= true ]; then sudo -u${user}${script_path} /seahub .shrestart-fastcgi${fastcgi_port}>>${seahub_init_log} else sudo -u${user}${script_path} /seahub .shrestart>>${seahub_init_log} fi ;; stop) sudo -u${user}${script_path} /seafile .sh$1>>${seafile_init_log} sudo -u${user}${script_path} /seahub .sh$1>>${seahub_init_log} ;; *) echo "Usage:/etc/init.d/seafile-server{start|stop|restart}" exit 1 ;; esac 2.5.4 添加执行用户和配置目录权限 1 2 3 useradd seafile-s /sbin/nologin -d /home/cmdschool .org/ chown -Rseafile:seafile /home/cmdschool .org/ chown -Rseafile:seafile /tmp/seahub_cache/ 2.5.5 配置启动服务 1 vim /lib/systemd/system/seafile .service 输入如下内容: 1 2 3 4 5 6 7 8 9 10 11 12 13 [Unit] Description=seafile After=mariadb.service [Service] Type=forking ExecStart= /home/cmdschool .org /seafile-server-5 .1.3 /seafiled .shstart ExecReload= /home/cmdschool .org /seafile-server-5 .1.3 /seafiled .shrestart ExecStop= /home/cmdschool .org /seafile-server-5 .1.3 /seafiled .shstop PrivateTmp= true [Install] WantedBy=multi-user.target 2.5.6 修改sudo 1 visudo 注释掉如下行: 1 Defaultsrequiretty 注:不修改可能使用systemctl命令启动服务时会出错 2.5.7 停止管理员身份运行的主程序 1 2 /home/cmdschool .org /seafile-server-5 .1.3 /seafile .shstop /home/cmdschool .org /seafile-server-5 .1.3 /seahub .shstop 2.5.8 测试服务并配置开机启动 1 2 3 4 5 systemctlstartseafile.service systemctlrestartseafile.service systemctlstopseafile.service systemctlstartseafile.service systemctl enable seafile.service 2.5.9 启动服务并配置开机启动 1 2 systemctlrestartnginx systemctl enable nginx 2.5.10 配置防火墙 1 2 3 4 5 firewall-cmd--permanent--remove-port=8000 /tcp firewall-cmd--permanent--remove-port=8082 /tcp firewall-cmd--permanent--add-servicehttp firewall-cmd--reload firewall-cmd--list-all 2.5.11 浏览器测试 1 http: //seafile .cmdschool.org 2.6 配置nginx的https代理 注:以下配置基于2.5章节 2.6.1 生成私钥 1 opensslgenrsa-outprivkey.pem2048 生成如下私钥: 1 privkey.pem 2.6.2 生成公钥 1 opensslreq-new-x509-keyprivkey.pem-outcacert.pem-days1095 向导如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Youareabouttobeaskedtoenterinformationthatwillbeincorporated intoyourcertificaterequest. WhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraDN. Therearequiteafewfieldsbutyoucanleavesomeblank Forsomefieldstherewillbeadefaultvalue, Ifyouenter '.' ,thefieldwillbeleftblank. ----- CountryName(2lettercode)[XX]:CN StateorProvinceName(fullname)[]:GD LocalityName(eg,city)[DefaultCity]:DG OrganizationName(eg,company)[DefaultCompanyLtd]:cmdschool.org OrganizationalUnitName(eg,section)[]:it CommonName(eg,yournameoryourserver's hostname )[]:seafile.cmdschool.org EmailAddress[]:will@cmdschool.org 2.6.3 复制公钥和私钥到指定路径 1 cp cacert.pemprivkey.pem /etc/ssl/ 2.6.4 修改配置文件 1 vim /etc/nginx/conf .d /seafile .conf 修改配置文件如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 server{ listen80; server_nameseafile.cmdschool.org; rewrite^https: // $http_host$request_uri?permanent; #强制将http重定向到https } server{ listen443; sslon; ssl_certificate /etc/ssl/cacert .pem; #cacert.pem文件路径 ssl_certificate_key /etc/ssl/privkey .pem; #privkey.pem文件路径 server_nameseafile.cmdschool.org; proxy_set_headerX-Forwarded-For$remote_addr; location/{ fastcgi_pass127.0.0.1:8000; fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name; fastcgi_paramPATH_INFO$fastcgi_script_name; fastcgi_paramSERVER_PROTOCOL$server_protocol; fastcgi_paramQUERY_STRING$query_string; fastcgi_paramREQUEST_METHOD$request_method; fastcgi_paramCONTENT_TYPE$content_type; fastcgi_paramCONTENT_LENGTH$content_length; fastcgi_paramSERVER_ADDR$server_addr; fastcgi_paramSERVER_PORT$server_port; fastcgi_paramSERVER_NAME$server_name; fastcgi_paramHTTPSon; fastcgi_paramHTTP_SCHEMEhttps; access_log /var/log/nginx/seahub .access.log; error_log /var/log/nginx/seahub .error.log; } location /seafhttp { rewrite^ /seafhttp (.*)$$1 break ; proxy_passhttp: //127 .0.0.1:8082; client_max_body_size0; proxy_connect_timeout36000s; proxy_read_timeout36000s; } location /media { root /home/cmdschool .org /seafile-server-latest/seahub ; } } 2.6.5 修改SERVICE_URL和FILE_SERVER_ROOT 界面中单击“系统管理”->“设置”修改如下参数为: 1 2 SERVICE_URL:https: //seafile .cmdschool.org FILE_SERVER_ROOT:https: //seafile .cmdschool.org /seafhttp 2.6.7 重新启动服务 1 systemctlrestartseafile.service 2.6.8 配置防火墙 1 2 3 4 firewall-cmd--permanent--remove-servicehttp firewall-cmd--permanent--add-servicehttps firewall-cmd--reload firewall-cmd--list-all 2.6.9 浏览器测试 https://seafile.cmdschool.org 注:登录帐号和密码(详见2.4.6章节的配置向导生成) 本文转自 tanzhenchao 51CTO博客,原文链接:http://blog.51cto.com/cmdschool/1790806,如需转载请自行联系原作者

优秀的个人博客,低调大师

牛逼的OSQL----大数据导入

汇总篇:http://www.cnblogs.com/dunitian/p/4822808.html#tsql 上一篇:01.SQLServer性能优化之----强大的文件组----分盘存储http://www.cnblogs.com/dunitian/p/5276431.html 在执行SQL脚本的时候要是出现了这些情况我咋办呢? 步入正轨 应用场景:服务器升级,比如原来是2003的系统,现在换成2008或者2012,那么数据库升级了不止一个档次,咋办?分离附加,备份还原都有点悬了,那么就导出脚本呗(一般都是导出两份,一份是架构,一份是数据) 【应用场景二:类似于阿里云这些别人的服务器(说句傻叉的话,用户数据都不在你的手上你这公司基本上也就差不多了)】 演示一下数据导出的场景: 那么问题来了~~发生了这些错误肿么办?我们的sql脚本好几个G了,正常途径都没用啊??? 这里呢得引入一下OSQL,先看看帮助文档:osql -? 执行命令: osql -E -i C:\Users\DNT\Desktop\BigValues.sql-E 表示使用 Windows 身份验证 -i 表示执行输入文件里面的sql脚本 然后就这样慢慢的执行了,你直接挂服务器就好了,然后你就可以继续coding了(*^__^*) 02.SQLServer性能优化之---存储优化系列http://www.cnblogs.com/dunitian/p/6041745.html 本文转自毒逆天博客园博客,原文链接:http://www.cnblogs.com/dunitian/p/5276449.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android Studio 导入的项目编码错误问题

错误提示: Error:(4, 35) 閿欒: 缂栫爜UTF-8鐨勪笉鍙槧灏勫瓧绗? 解决方法: 1). 2). 的下面添加下面的一行语句: android{compileOptions.encoding="GBK"} 没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的自由、好奇、充满创造力的想法被现实的框架所束缚,让创造力自由成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。 本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/7349915.html ,如需转载请自行联系原作者

优秀的个人博客,低调大师

VS源码文件导入Android工程 中文乱码

场景说明 目前Android版本的项目采用了jni的方式,实现大量的功能。一般情况下,在VS中开发完成功能,然后拷贝源码文件到Android工程中,添加源码文件,重新编译。编译出来的Android程序在运行中,会出现中文乱码。 解决过程: 1)查看到添加的源码文件是UTF-8编码 右击单个工程文件,选择Properties->Resource->Text file encoding->GBK/UTF-8 2)查看到已有的工程中的源码文件是GBK编码 3)强制将源码文件设置为GBK编码,所有的中文全部是乱码, 即使手动重新将中文乱码修改过来,编译运行程序还是乱码 解决方案: 先将Android目录中的源码文件设置为GBK编码,然后用VS打开已有的源码文件Ctrl+A,Ctrl+C进行全部拷贝,粘贴到Android的工程文件中。拷贝代码的过程中不会拷贝文件的编码格式,从而解决了问题 另外一种解决方案: 在VS中,打开需要转码的源码文件,点击文件,打开高级保存选项, 显示当前编码是UTF-8,在编码的下拉框中,选择简体中文(GB2312),点击确定, 这个时候拷贝的源码文件,添加到Android工程就不会出现中文乱码的情况 英文VS版本:file/advanced save options/unicode utf8 本文转自fengyuzaitu 51CTO博客,原文链接http://blog.51cto.com/fengyuzaitu/1675211:,如需转载请自行联系原作者

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册