小编Lau*_*van的帖子

找不到满足需求张量流的版本

我安装了最新版本的Python (3.6.4 64-bit)和最新版本的PyCharm (2017.3.3 64-bit).然后我在PyCharm(Numpy,Pandas,...)中安装了一些模块,但是当我尝试安装Tensorflow时它没有安装,我收到了错误消息:

找不到满足要求tensorflow的版本(来自版本:)没有找到tensorflow的匹配分布

然后我尝试从命令提示符安装tensorflow,我得到了相同的错误消息.然而,我确实安装了tflearn.

我还安装了Python 2.7,但我又得到了相同的错误消息.我搜索了这个错误并尝试了一些建议给其他人的东西,但没有任何效果(包括安装Flask).

如何安装Tensorflow?谢谢.

python pip python-2.7 python-3.x tensorflow

114
推荐指数
15
解决办法
19万
查看次数

动态列表视图在滚动结束时添加"加载更多项目"

我有一个listview,它是由Json从sqlite数据库中获取数据.

我希望把它变成,在滚动结束,"负载更多的物品",而装载更多的物品,并将它们添加到适配器(例如每次10个项目)列表中出现的页脚动态列表视图.我在实现此功能时遇到问题.请帮帮我.谢谢.

public class AllProductsActivity extends Activity {

... defining variables...;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    new LoadAllProducts().execute();

}

class LoadAllProducts extends AsyncTask<String, String, String> {

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        ... progress dialog...
    }

    protected String doInBackground(String... args) {
        countryList = new ArrayList<Country>();
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", params);

        Log.d("All Products: ", json.toString());

        try {
            // Checking for SUCCESS TAG
            int success = json.getInt(TAG_SUCCESS);

            if (success == 1) {
                // …
Run Code Online (Sandbox Code Playgroud)

android listview dynamic-loading

49
推荐指数
3
解决办法
9万
查看次数

旋转器的JSON解析问题

我的所有微调器都是相互连接的,它们不是独立的,我想根据spinner1中的选择显示spinner2和spinner3中的选项(我的意思是基于用户在spinner1中选择的类别)

onCreate我将数据填充到Spinners中,但是在spinner2和spinner3中我得到的数据属于CategoryB,而它们只能填充CategoryA数据.

那我的错误在哪里?这是我的JSON解析代码:

               categoryArrayList = new ArrayList<Category>();
               cArrayList = new ArrayList<String>();

                ...................................

                // Array Level 1 --- START
            JSONArray jarray = jsono.getJSONArray("categories");

            for (int i = 0; i < jarray.length(); i++) {
                JSONObject object = jarray.getJSONObject(i);

                Category language = new Category();                     
                language.setName(object.getString("category_name"));
                Log.d("category_name::-", object.getString("category_name"));

                language.setTypeArrayList(typeArrayList);
                categoryArrayList.add(language);
                cArrayList.add(categoryArrayList.get(i).getName());

                // Array Level 1 --- END

                // Array Level 2 --- START

                JSONArray jsarray = object.getJSONArray("types");
                typeArrayList = new ArrayList<Type>();
                tArrayList = new ArrayList<String>();
                for (int j = 0; j < …
Run Code Online (Sandbox Code Playgroud)

android json spinner android-spinner

11
推荐指数
2
解决办法
327
查看次数

如何将导航抽屉添加到现有代码中?

我有一个应用程序,其中我有一个带有菜单按钮的导航面板,我想在其上应用导航抽屉,目前占用整个屏幕,但我想通过在其上应用导航抽屉将其限制为屏幕的3/4 ,但我从来没有碰到导航抽屉之前,所以不知道,任何帮助或指导将great.Also通过一些文件去了,糊涂了:(这里是我的代码:

这是导航面板的布局类:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:foo="http://schemas.android.com/apk/res/com.justin.a"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_texture"
    android:clickable="true" >

<RelativeLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="@dimen/nav_margin"
    android:layout_marginTop="@dimen/nav_margin"
    android:layout_marginRight="@dimen/nav_margin"
    android:layout_marginBottom="@dimen/nav_margin"
    android:background="#242424"
    >

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="@dimen/nav_padding"
        android:paddingTop="@dimen/nav_padding"
        android:paddingRight="@dimen/nav_padding"

        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="@android:drawable/divider_horizontal_bright"
            android:orientation="vertical"
            android:showDividers="middle"

             >


             <com.justin.a.utils.FontTextView
                android:id="@+id/nav_option_dashboard"
                style="@style/a.TextView.NavigationItem"
                android:layout_width="match_parent"
                android:layout_height="@dimen/button_ht"
                android:layout_marginBottom="1px"
                android:onClick="onDashboardClicked"
                android:text="@string/nav_option_dashboard"
                android:textSize="@dimen/navigation_panel_text"
                foo:customFont="cabin.medium.ttf"
                android:padding="@dimen/nav_option_padding"
                android:background="@drawable/nav_background_button"
                    />  
            <com.justin.a.utils.FontTextView
                android:id="@+id/nav_option_news"
                style="@style/a.TextView.NavigationItem"
                android:layout_width="match_parent"
                android:layout_height="@dimen/button_ht"
                foo:customFont="cabin.medium.ttf"
                android:textSize="@dimen/navigation_panel_text"
                android:layout_marginBottom="1px"
                android:onClick="onNewsClicked"
                android:text="@string/nav_option_news"
                android:padding="@dimen/nav_option_padding"
                android:background="@drawable/nav_background_button"

                 />

            <com.justin.a.utils.FontTextView
                android:id="@+id/nav_option_markets"
                style="@style/a.TextView.NavigationItem"
                android:layout_width="match_parent"
                android:layout_height="@dimen/button_ht"
                android:textSize="@dimen/navigation_panel_text"
                android:layout_marginBottom="1px"
                android:onClick="onMarketClicked"
                android:text="@string/nav_option_markets" 
                foo:customFont="cabin.medium.ttf"
                android:padding="@dimen/nav_option_padding"
                android:background="@drawable/nav_background_button"

                />

            <com.justin.a.utils.FontTextView
                android:id="@+id/nav_option_lists"
                style="@style/a.TextView.NavigationItem"
                android:layout_width="match_parent" …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-activity android-navigation

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

如何正确安装wxPython?

所以我在Python上查看不同的事情,比如闪存文本或计时器的代码,但是当我将它们复制到我的窗口时,会出现持续的语法错误.现在,也许你不打算直接复制它们,但我得到的一个错误是"没有名为wx的模块".我了解到我可以通过安装wxPython来获得该模块.问题是,我已经尝试了所有4个选项,但没有一个适合我.我下载哪一个,如何使用Windows进行设置?

谢谢

python windows wxpython download

8
推荐指数
4
解决办法
4万
查看次数

Android RecyclerView - 布局预览 - 如何删除复选框附近的“Item 0, Item 1,...”文本?

我有一个RecyclerView,其中每个列表行项目都有一个CheckBox. 在单独的列表行的布局预览中,Checkbox 显示正确,没有文本:

列表行布局预览 - 屏幕截图

但是,当我查看布局预览作为RecyclerView(使用tools:listitem = "@layout/application_list_content")的一部分时,我看到不需要的示例文本,如“项目 0”、“项目 1”、“项目 3”等:

RecyclerView 布局预览 - 截图

问题:有没有办法让 Android Studio 的布局预览不显示示例文本 - “Item X” - 而只是显示一个空字符串?

的代码RecyclerView是:

<android.support.v7.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/application_list"
    android:name="com.laurivan.android.ApplicationListFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginEnd="?listPreferredItemPaddingRight"
    android:layout_marginStart="?listPreferredItemPaddingLeft"
    app:layoutManager="LinearLayoutManager"
    tools:context="com.laurivan.android.ApplicationListActivity"
    tools:listitem="@layout/application_list_content"/>
Run Code Online (Sandbox Code Playgroud)

项目行有这样的内容:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/list_item_height_normal"
                android:orientation="horizontal"
    >

    <CheckBox
        android:id="@+id/app_checkBox"
        style="?android:attr/starStyle"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentEnd="true"
        android:layout_margin="0dp"
        android:checked="false"
        android:padding="0dp"
        tools:text=""
        />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android preview android-studio android-recyclerview

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

拒绝直接访问S3上的文件

我正在构建一个django/s3应用程序,具有以下行为:

  1. 用户登录
  2. 用户上传文档 - >文档转到S3(最终在数据库中使用UID名称和别名?)
  3. 用户可以下载该文档

我正在寻找一种方法来拒绝其他用户(或者更糟糕的是,没有记录)来查询和访问文件.我能找到的一个解决方案是:

  • 对于每个文件,该页面都包含指向处理脚本的链接
  • 单击链接时,视图会对其进行处理(检查用户是否经过身份验证,在S3中确定正确的文件)并重定向到该链接

这够了吗?有更优雅的解决方案吗?

django access-control amazon-s3

7
推荐指数
1
解决办法
1877
查看次数

notifyItemChanged()强制调用onBindViewHolder()吗?

当我打电话notifyItemChanged()给我时RecyclerView,相应的Views(在这种情况下,按钮)不会按预期更新.我打电话给他们的原因是数据已经改变,这会导致他们的背景颜色发生变化.这是否意味着notifyItemChanged()不会强制拨打电话onBindViewHolder()

我尝试使用notifyDataSetChanged(),并且会导致视图按我的意愿重新加载,所以我知道我的实现是正确的.(注意我不想使用notifyDataSetChanged(),因为这是低效的,我只用它作为一个健全性测试).

android android-recyclerview

6
推荐指数
1
解决办法
2220
查看次数

android构建工具默认在生成的apk中将v4限定符添加到可绘制文件夹

我已经困惑很长一段时间了.

在构建工具v21.0.0之前,打包的apk包含drawable文件夹结构,如下所示:

res/drawable-hdpi
res/drawable-ldpi
res/drawable-mdpi
res/drawable-hdpi
Run Code Online (Sandbox Code Playgroud)

但是,自v21.0.0以来发生了变化,unzip文件夹结构带有后缀:

res/drawable-hdpi-v4
res/drawable-ldpi-v4
res/drawable-mdpi-v4
res/drawable-hdpi-v4
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  1. 为什么默认情况下为可绘制文件夹添加了v4后缀?目前,应用程序通常基于更高版本的API构建.我觉得不需要添加v4限定符.
  2. 为什么从v21.0.0开始?我已经完成了几乎所有版本的构建工具,这只发生在v21.0.0之后.
  3. 未来还会有其他资格赛如v6,v9等吗?

非常感谢你提前.

android qualifiers build-tools aapt suffix

6
推荐指数
0
解决办法
1362
查看次数

将指令添加到角度2组件

我最近使用angular 2创建了一个简单的项目.当我尝试向app.component添加一个指令组件时,'directives'属性有一个红色下划线.谁有人告诉我这里有什么问题?

在此输入图像描述

angular2-components angular

6
推荐指数
1
解决办法
5845
查看次数