小编use*_*081的帖子

是否可以在没有root的情况下在CentOS上安装g ++?

我有一台带有CentOS 5.8的核心i7机器,我将其用于SSH并用于运行模拟.不幸的是它只有gcc版本4.1.2.这似乎比我在使用Microsoft Visual Express c ++ 2010的慢速笔记本电脑上进行优化编译时产生的程序慢得多.我尝试了各种g ++优化标志,但它们没有多大帮助,所以我认为我需要升级gcc.

我在机器上没有root,所以看起来我必须在我的主目录中安装它.这是否可行,如果有,是否需要做出具体指示?

谢谢

linux gcc g++ centos root

8
推荐指数
1
解决办法
4803
查看次数

Python3.5 Asyncio - 防止任务异常转储到标准输出?

我的程序有一个基于文本的界面(asciimatics 模块),它使用 asyncio 和 discord.py 模块,偶尔当我的 wifi 适配器出现故障时,我会收到如下异常:

Task exception was never retrieved
future: <Task finished coro=<WebSocketCommonProtocol.run() done, defined at /home/mike/.local/lib/python3.5/site-packages/websockets/protocol.py:428> exception=ConnectionResetError(104, 'Connection reset by peer')>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "/home/mike/.local/lib/python3.5/site-packages/websockets/protocol.py", line 434, in run
    msg = yield from self.read_message()
  File "/home/mike/.local/lib/python3.5/site-packages/websockets/protocol.py", line 456, in read_message
    frame = yield from self.read_data_frame(max_size=self.max_size)
  File "/home/mike/.local/lib/python3.5/site-packages/websockets/protocol.py", line 511, in read_data_frame
    frame = yield from self.read_frame(max_size)
  File "/home/mike/.local/lib/python3.5/site-packages/websockets/protocol.py", line 546, in read_frame
    self.reader.readexactly, …
Run Code Online (Sandbox Code Playgroud)

python python-3.x python-asyncio discord.py

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

使用 imageview (Android) 滚动宽图像

我一直在尝试让大图像(10345x1280 像素)适合我的 android 屏幕(横向模式)基本上我希望 1280px 尺寸适合屏幕的高度,我希望较长的尺寸可以从左侧滚动到右边。

我一直在使用各种方法,但由于滚动不起作用或图像没有正确缩放,我真的没有太多运气。现在我正在尝试在滚动视图中使用图像视图,主要问题是在滚动视图中嵌入图像视图会弄乱图像的缩放比例。附加的照片显示了将 imageview 嵌入滚动视图之前和之后的比较。

第一张图片是我试图通过滚动实现的理想效果,所以如果有人知道最好的方法是什么,我真的很感激。

谢谢

http://i.imgur.com/OWkPNqp.png http://i.imgur.com/YGIdEY1.png

编辑:我对 xml 代码做了一些调整,我还调整了我的图像的高度为 400(所以它现在是 3233x400)。图片现在更适合屏幕,但仍然不完美,它向上/向下滚动但不是我需要的左右滚动......在所有设备类型上?

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#0099cc"
    tools:context=".FullscreenActivity"
    android:nestedScrollingEnabled="true">

    <!-- The primary full-screen view. This can be replaced with whatever view
         is needed to present your content, e.g. VideoView, SurfaceView,
         TextureView, etc. -->
    <TextView android:id="@+id/fullscreen_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:keepScreenOn="true"
        android:textColor="#33b5e5"
        android:textStyle="bold"
        android:textSize="50sp"
        android:gravity="center"
        android:text="@string/dummy_content" />

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="0dp" >

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="0dp"
            tools:context=".HelpActivity"
            android:layout_gravity="center">

            <ImageView
                android:id="@+id/imageHelp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="centerCrop" …
Run Code Online (Sandbox Code Playgroud)

android scrollview imageview android-activity

3
推荐指数
1
解决办法
8379
查看次数