通过浏览器来获取代码中的trace

项目最终是要运行于浏览器中的,而有些很奇怪的问题是放到浏览器后运行才出现,而一开始并没有使用任何的第三方调试库,所以只能另外想办法。

有一篇文章:TRACE FROM THE BROWSER, USING STANDARD TRACE()

大概的步骤是这样:

1、卸载当前浏览器的Flash插件。Adobe Flash Player Uninstallers.

2、安装最新的Flash Debug Player。Adobe Flash Debug Players

3、安装后在浏览器中打开任意一个Flash点右键应该可以看到Debug版本的一些特征,比如显示重坐区域。

4、在以下位置创新一个"mm.cfg"的文件:

  • OSX
    MacHD:Library:Application Support:Macromedia:mm.cfg
  • Windows Vista
    C:\Users\username\mm.cfg
  • Windows XP
    C:\Documents and Settings\username\mm.cfg
  • Windows 2000
    C:\mm.cfg
  • Linux
    home/username/mm.cfg

5、在"mm.cfg"这个文件中加入以下属性:

  • ErrorReportingEnable=0
  • TraceOutputFileEnable=1
  • MaxWarnings=0

6、最后当你运行了一个具有trace输出的Flash之后,会在以下位置找到一个flashlog.txt文件:

  • OSX
    MacHD:Users:username:Library:Preferences:Macromedia:Flash Player:Logs:flashlog.txt
  • Windows Vista
    C:\Users\username\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt
  • Windows XP and 2000
    C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt
  • Linux
    home/username/.macromedia/Flash_Player/Logs/flashlog.txt

7、flashlog.txt就是上一次浏览器中运行的所以log了。

转载于:https://www.cnblogs.com/yili16438/archive/2011/05/22/2053733.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将MongoDb的x和y数据可视化到web页面,可以使用Python的Flask框架和Plotly库。下面是一个简单的示例代码: 1. 安装必要的库 ``` pip install pymongo flask plotly ``` 2. 创建Flask应用 ```python from flask import Flask, render_template from pymongo import MongoClient import plotly import plotly.graph_objs as go app = Flask(__name__) # 连接MongoDB数据库 client = MongoClient('mongodb://localhost:27017/') db = client['test'] # 选择数据库 collection = db['data'] # 选择集合 @app.route('/') def index(): # 从MongoDB获取数据 x = [] y = [] for data in collection.find(): x.append(data['x']) y.append(data['y']) # 创建Plotly图表 trace = go.Scatter( x=x, y=y, mode='markers' ) data = [trace] layout = go.Layout(title='MongoDB数据可视化') fig = go.Figure(data=data, layout=layout) # 将图表转换为HTML代码 plot_div = plotly.offline.plot(fig, output_type='div') # 渲染模板并将图表嵌入到页面 return render_template('index.html', plot_div=plot_div) if __name__ == '__main__': app.run(debug=True) ``` 3. 创建模板文件 在项目根目录下创建一个名为`templates`的文件夹,然后在其创建一个名为`index.html`的模板文件,代码如下: ```html <!DOCTYPE html> <html> <head> <title>MongoDB数据可视化</title> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <body> {{ plot_div|safe }} </body> </html> ``` 4. 运行应用 在终端执行以下命令启动应用: ``` python app.py ``` 然后在浏览器访问http://localhost:5000/,就可以看到MongoDB的x和y数据被可视化了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值