syntaxhighlighter

掌握 Linux 调试技术

眉间皱痕 提交于 2020-04-09 06:08:34
摘自: https://www.ibm.com/developerworks/cn/linux/sdk/l-debug/ 摘自 https://www.ibm.com/developerworks/cn/linux/sdk/l-debug/#artrelatedtopics 本文讨论了四种调试 Linux 程序的情况。在第 1 种情况中,我们使用了两个有内存分配问题的样本程序,使用 MEMWATCH 和 Yet Another Malloc Debugger(YAMD)工具来调试它们。在第 2 种情况中,我们使用了 Linux 中的 strace 实用程序,它能够跟踪系统调用和信号,从而找出程序发生错误的地方。在第 3 种情况中,我们使用 Linux 内核的 Oops 功能来解决程序的段错误,并向您展示如何设置内核源代码级调试器(kernel source level debugger,kgdb),以使用 GNU 调试器(GNU debugger,gdb)来解决相同的问题;kgdb 程序是使用串行连接的 Linux 内核远程 gdb。在第 4 种情况中,我们使用 Linux 上提供的魔术键控顺序(magic key sequence)来显示引发挂起问题的组件的信息。 常见调试方法 当您的程序中包含错误时,很可能在代码中某处有一个条件,您认为它为真(true),但实际上是假

WPF 输入框正则效验

孤街浪徒 提交于 2020-04-09 01:12:34
原文: WPF 输入框正则效验 1. if (!TelphoneHelper2.IsTelphone(mobile) { MessageBox.Show("请录入正确的手机号!", "提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } 2.TelphoneHelper2.cs ? 1 2 3 4 5 6 7 8 9 10 public class TelphoneHelper2 { public static bool IsTelphone( string tel) { String strExp = @"[0-9][0-9][0-9]{9}" ; Regex r = new Regex(strExp); Match m = r.Match(tel); return m.Success; } }    来源: oschina 链接: https://my.oschina.net/u/4274700/blog/3225211

Sqlserver 报错“参数数据类型 ntext/text 对于 replace 函数的参数 1 无效”的解决方案及原理分析扩展

女生的网名这么多〃 提交于 2020-04-08 18:33:21
原因: 在数据查询中replace函数无法对表table中text/ntext类型的字段colname进行了字符串操作。 解决方法: 将text当作varchar(实际内容长度低于8000字节时)或把ntext当作nvarchar(实际内容长度低于4000字节时)。 但是当text字段内容长度超过8000或ntext字段内容长度超过4000字节时多出的字节会被截断而忽略掉。 这时我们可以使用max类型来解决这个问题。 原报错代码: 1 update tablename set colname= replace (colname, 'oldtext' , 'newtext' );  修改后可执行代码: 1 update tablename set colname= replace ( Cast (colname as varchar (8000)), 'oldtext' , 'newtext' ); 1 update tablename set colname= replace ( Cast (colname as nvarchar(4000)), 'oldtext' , 'newtext' ); 来源: oschina 链接: https://my.oschina.net/u/4418764/blog/3224973

RaspberryPi(树莓派)如何安装 MariaDB / MySQL 数据库

时光毁灭记忆、已成空白 提交于 2020-04-07 12:25:00
安装的过程比较简单。 但是这里有一个地方需要注意,如果你希望是能够通过网络访问你安装的数据库的话。 在你设置好用户名和密码,以及访问权限后,你可能发现你还是访问不了。 这是因为你的安装服务器只绑定了能够本地访问,你需要修改配置,让你的服务器能够支持远程访问。 具体的方法,请参考 RaspberryPi(树莓派)安装 MariaDB 数据库没有办法远程访问 页面中的文章。 更新系统 通过运行命令: sudo apt-get update 来对你需要安装的系统进行更新,根据网络的情况可能需要的时间也不相同。 我们更新后系统的输出内容为: root@raspberrypi:~# sudo apt-get update Hit:1 http://archive.raspberrypi.org/debian buster InRelease Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB] Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB] Fetched 13.0 MB in 19s (694 kB/s) Reading package lists... Done root

RaspberryPi(树莓派)如何安装 MariaDB / MySQL 数据库

自闭症网瘾萝莉.ら 提交于 2020-04-07 09:53:11
安装的过程比较简单。 但是这里有一个地方需要注意,如果你希望是能够通过网络访问你安装的数据库的话。 在你设置好用户名和密码,以及访问权限后,你可能发现你还是访问不了。 这是因为你的安装服务器只绑定了能够本地访问,你需要修改配置,让你的服务器能够支持远程访问。 具体的方法,请参考 RaspberryPi(树莓派)安装 MariaDB 数据库没有办法远程访问 页面中的文章。 更新系统 通过运行命令: sudo apt-get update 来对你需要安装的系统进行更新,根据网络的情况可能需要的时间也不相同。 我们更新后系统的输出内容为: root@raspberrypi:~# sudo apt-get update Hit:1 http://archive.raspberrypi.org/debian buster InRelease Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB] Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB] Fetched 13.0 MB in 19s (694 kB/s) Reading package lists... Done root

Syntax highlighter 3.0 not working on blogspot

烈酒焚心 提交于 2019-12-24 04:51:20
问题 Syntax highlighter 3.0 is not working on my blog. I use the newest version right from the website. The issues are: If I write #include in my code, I get at the end of it. There's no text wrapping. The blog's link is http://snacksforyourmind.blogspot.com. I also checked out options but they give nothing but bloggerMode which I already enabled. All the issues are visible in the second code from top of the page. Does anybody have some idea how to fix it? 回答1: Depending on your template, the

How can I show code (specifically C++) in an HTML page?

本秂侑毒 提交于 2019-12-20 12:15:12
问题 How can I show code in a website using HTML? Basically, I have a C++ program that I'd like to share on my website and I want to show it in the page. Is there anyway to show a C++ code in HTML other than using HTML text? 回答1: There are various syntax highlighters out there. Google Code Prettify is a pretty good one. (Good enough for Stack Overflow to use, anyway.) 回答2: HTML includes a tag called <code>, which is meant for the purpose you describe. The spec even includes an example class name

Eclipse syntax highlighting on extensionless files?

风格不统一 提交于 2019-12-19 10:17:59
问题 I have a perl CGI script that needs to have a specific extensionless filename to run correctly from the software that uses it. I'm using Eclipse 3.7.0 on Ubuntu 11.04 Linux as my IDE, and it's not highlighting syntax on the file nor using the limited autocomplete features (like adding a second closing tag for things like quotes and various brackets). Right click> properties on the file reveals that the OS seems to know it's a perl script, but Eclipse evidently does not. Can I somehow tell

Automatic line break in js SyntaxHighlighter

南楼画角 提交于 2019-12-18 12:55:17
问题 Im using the js SyntaxHighlighter 3.0.83 from http://alexgorbatchev.com/SyntaxHighlighter/ I've been googling the entire world now it seem but cant really find how to enable line breaks. Instad i get a horizontal scrollbar, which is good sometimes but not in my scenario. In example Anyone out there who know the way around this? 回答1: I don't actually use SyntaxHighlight, but it seems to be possible to attach an white-space: pre-wrap CSS style to the <pre> or <script> tag that SyntaxHighlight

How to I set the max height of a SyntaxHighlighter code block both website-wide and for a single block of code?

余生颓废 提交于 2019-12-13 17:32:45
问题 I'd like to both locally and globally set the max height of SyntaxHighlighter code blocks. Here's an example of a global implementation that sort of works: Once you get SyntaxHighlighter implemented and working per these instructions here, just before </head> in your Blogger template, add: <style type="text/css"> .syntaxhighlighter { height: 1024px; overflow-y: auto !important; overflow-x: auto !important;} </style> (Source). This will limit code size to 1024 vertical pixels, then add a