问:
How to design custom keypad in android?
I have designed a custom keypad as shown below  but its keys are blurred how to make it look nice

below is the java code in which keyboard view in inflated

```<code>@Override
    public View onCreateInputView() {
        kv = (KeyboardView)getLayoutInflater().inflate(R.layout.keyboard, null);
        keyboard = new Keyboard(this, R.xml.qwerty);
       // keyboard_sym = new Keyboard(this, R.xml.symbol);
        kv.setKeyboard(keyboard);

        kv.setOnKeyboardActionListener(this);
        Log.e(TAG,"Started");
        return kv;
    }
</code>```

Below is xml file code

```<code><Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
    android:keyWidth="10%p"
    android:horizontalGap="8dp"
    android:verticalGap="5dp"

    android:keyHeight="40dp"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    >
    <Row>
        <Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"  />
        <Key android:codes="50" android:keyLabel="2"/>
        <Key android:codes="51" android:keyLabel="3"/>
        <Key android:codes="52" android:keyLabel="4"/>
        <Key android:codes="53" android:keyLabel="5"/>
        <Key android:codes="54" android:keyLabel="6"/>
        <Key android:codes="55" android:keyLabel="7"/>
        <Key android:codes="56" android:keyLabel="8"/>
        <Key android:codes="57" android:keyLabel="9"/>
        <Key android:codes="48" android:keyLabel="0" android:keyEdgeFlags="right"/>
    </Row>
    <Row>
        <Key android:codes="113" android:keyLabel="q" android:keyEdgeFlags="left"/>
        <Key android:codes="119" android:keyLabel="w"/>
        <Key android:codes="101" android:keyLabel="e"/>
        <Key android:codes="114" android:keyLabel="r"/>
        <Key android:codes="116" android:keyLabel="t"/>
        <Key android:codes="121" android:keyLabel="y"/>
        <Key android:codes="117" android:keyLabel="u"/>
        <Key android:codes="105" android:keyLabel="i"/>
        <Key android:codes="111" android:keyLabel="o"/>
        <Key android:codes="112" android:keyLabel="p" android:keyEdgeFlags="right"/>
    </Row>
    <Row>
        <Key android:codes="97" android:keyLabel="a" android:keyEdgeFlags="left"/>
        <Key android:codes="115" android:keyLabel="s"/>
        <Key android:codes="100" android:keyLabel="d"/>
        <Key android:codes="102" android:keyLabel="f"/>
        <Key android:codes="103" android:keyLabel="g"/>
        <Key android:codes="104" android:keyLabel="h"/>
        <Key android:codes="106" android:keyLabel="j"/>
        <Key android:codes="107" android:keyLabel="k"/>
        <Key android:codes="108" android:keyLabel="l" android:keyEdgeFlags="right"/>

    </Row>
    <Row>
        <Key android:codes="-1" android:keyEdgeFlags="left"  android:keyWidth="15%p" android:keyIcon="@drawable/arrow"/>
        <Key android:codes="122" android:keyLabel="z"/>
        <Key android:codes="120" android:keyLabel="x"/>
        <Key android:codes="99" android:keyLabel="c"/>
        <Key android:codes="118" android:keyLabel="v"/>
        <Key android:codes="98" android:keyLabel="b"/>
        <Key android:codes="110" android:keyLabel="n"/>
        <Key android:codes="109" android:keyLabel="m"/>
        <Key android:codes="-5"  android:keyIcon="@drawable/backspace" android:keyWidth="15%p" android:isRepeatable="true" android:keyEdgeFlags="right"/>

    </Row>
    <Row android:rowEdgeFlags="bottom">
        <Key  android:codes="1000" android:keyLabel="Sys" android:keyWidth="20%p"  android:keyEdgeFlags="left"/>
        <Key android:codes="47" android:keyLabel="/" android:keyWidth="10%p" />
        <Key android:codes="32" android:keyLabel="SPACE" android:keyWidth="40%p" android:isRepeatable="true"/>
        <Key android:codes="46" android:keyLabel="." android:keyWidth="10%p" android:isRepeatable="true"/>
        <Key android:codes="-4"  android:keyIcon="@drawable/downleft" android:keyWidth="15%p" android:keyEdgeFlags="right"/>
    </Row>
</Keyboard>
</code>```

How to change the color of key so it  not look blurred ?

答: The keys of a keyboard are grouped as rows. It's good practice to limit the number of keys on a row to a maximum of ten, with each key having a width equal to 10% of the keyboard. The height of the keys  can be adjusted, but values less than 48dp are not recommended. Change KeyHeight and check once.</p>

Title: How to design custom keypad in android?

Body:
I have designed a custom keypad as shown below  but its keys are blurred how to make it look nice

below is the java code in which keyboard view in inflated

@Override
    public View onCreateInputView() {
        kv = (KeyboardView)getLayoutInflater().inflate(R.layout.keyboard, null);
        keyboard = new Keyboard(this, R.xml.qwerty);
       // keyboard_sym = new Keyboard(this, R.xml.symbol);
        kv.setKeyboard(keyboard);

        kv.setOnKeyboardActionListener(this);
        Log.e(TAG,"Started");
        return kv;
    }

Below is xml file code

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
    android:keyWidth="10%p"
    android:horizontalGap="8dp"
    android:verticalGap="5dp"

    android:keyHeight="40dp"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    >
    <Row>
        <Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"  />
        <Key android:codes="50" android:keyLabel="2"/>
        <Key android:codes="51" android:keyLabel="3"/>
        <Key android:codes="52" android:keyLabel="4"/>
        <Key android:codes="53" android:keyLabel="5"/>
        <Key android:codes="54" android:keyLabel="6"/>
        <Key android:codes="55" android:keyLabel="7"/>
        <Key android:codes="56" android:keyLabel="8"/>
        <Key android:codes="57" android:keyLabel="9"/>
        <Key android:codes="48" android:keyLabel="0" android:keyEdgeFlags="right"/>
    </Row>
    <Row>
        <Key android:codes="113" android:keyLabel="q" android:keyEdgeFlags="left"/>
        <Key android:codes="119" android:keyLabel="w"/>
        <Key android:codes="101" android:keyLabel="e"/>
        <Key android:codes="114" android:keyLabel="r"/>
        <Key android:codes="116" android:keyLabel="t"/>
        <Key android:codes="121" android:keyLabel="y"/>
        <Key android:codes="117" android:keyLabel="u"/>
        <Key android:codes="105" android:keyLabel="i"/>
        <Key android:codes="111" android:keyLabel="o"/>
        <Key android:codes="112" android:keyLabel="p" android:keyEdgeFlags="right"/>
    </Row>
    <Row>
        <Key android:codes="97" android:keyLabel="a" android:keyEdgeFlags="left"/>
        <Key android:codes="115" android:keyLabel="s"/>
        <Key android:codes="100" android:keyLabel="d"/>
        <Key android:codes="102" android:keyLabel="f"/>
        <Key android:codes="103" android:keyLabel="g"/>
        <Key android:codes="104" android:keyLabel="h"/>
        <Key android:codes="106" android:keyLabel="j"/>
        <Key android:codes="107" android:keyLabel="k"/>
        <Key android:codes="108" android:keyLabel="l" android:keyEdgeFlags="right"/>

    </Row>
    <Row>
        <Key android:codes="-1" android:keyEdgeFlags="left"  android:keyWidth="15%p" android:keyIcon="@drawable/arrow"/>
        <Key android:codes="122" android:keyLabel="z"/>
        <Key android:codes="120" android:keyLabel="x"/>
        <Key android:codes="99" android:keyLabel="c"/>
        <Key android:codes="118" android:keyLabel="v"/>
        <Key android:codes="98" android:keyLabel="b"/>
        <Key android:codes="110" android:keyLabel="n"/>
        <Key android:codes="109" android:keyLabel="m"/>
        <Key android:codes="-5"  android:keyIcon="@drawable/backspace" android:keyWidth="15%p" android:isRepeatable="true" android:keyEdgeFlags="right"/>

    </Row>
    <Row android:rowEdgeFlags="bottom">
        <Key  android:codes="1000" android:keyLabel="Sys" android:keyWidth="20%p"  android:keyEdgeFlags="left"/>
        <Key android:codes="47" android:keyLabel="/" android:keyWidth="10%p" />
        <Key android:codes="32" android:keyLabel="SPACE" android:keyWidth="40%p" android:isRepeatable="true"/>
        <Key android:codes="46" android:keyLabel="." android:keyWidth="10%p" android:isRepeatable="true"/>
        <Key android:codes="-4"  android:keyIcon="@drawable/downleft" android:keyWidth="15%p" android:keyEdgeFlags="right"/>
    </Row>
</Keyboard>

How to change the color of key so it  not look blurred ?


来源: stackexchange

问:
Split a large json file into multiple smaller files
I have a large JSON file, about 5 million records and a file size of about 32GB, that I need to get loaded into our Snowflake Data Warehouse. I need to get this file broken up into chunks of about 200k records (about 1.25GB) per file. I'd like to do this in either Node.JS or Python for deployment to an AWS Lambda function, unfortunately I haven't coded in either, yet. I have C# and a lot of SQL experience, and learning both node and python are on my to do list, so why not dive right in, right!?

My first question is "Which language would better serve this function? Python, or Node.JS?"

I know I don't want to read this entire JSON file into memory (or even the output smaller file). I need to be able to "stream" it in and out into the new file based on a record count (200k), properly close up the json objects, and continue into a new file for another 200k, and so on. I know Node can do this, but if Python can also do this, I feel like it would be easier to quickly start using for other ETL stuff I'll be doing soon.

My second question is "Based on your recommendation above, can you also recommend what modules I should require/import to help me get started? Primarily as it relates to not pulling the entire json file into memory? Maybe some tips, tricks, or 'How would you do it's? And if you're feeling really generous, some code example to help push me into the deep end on this?

I can't include a sample of the JSON data, as it contains personal information. But I can provide the JSON schema ...

```<code>{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "items": {
    "properties": {
      "activities": {
        "properties": {
          "activity_id": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "frontlineorg_id": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "import_id": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "is_source": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "address": {
        "properties": {
          "city": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "congress_dist_name": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "congress_dist_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "congress_end_yr": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "congress_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "congress_start_yr": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "county": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "formatted": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "latitude": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "longitude": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "number": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "observes_dst": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "post_directional": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "pre_directional": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "school_district": {
            "items": {
              "properties": {
                "school_dist_name": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_dist_type": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_grade_high": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_grade_low": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_lea_code": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "secondary_number": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "secondary_unit": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "state": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state_house_dist_name": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state_house_dist_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "state_senate_dist_name": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state_senate_dist_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "street": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suffix": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "timezone": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "utc_offset": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "zip": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "age": {
        "type": "integer"
      },
      "anniversary": {
        "properties": {
          "date": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "baptism": {
        "properties": {
          "church_id": {
            "type": "null"
          },
          "date": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "birth_dd": {
        "type": "integer"
      },
      "birth_mm": {
        "type": "integer"
      },
      "birth_yyyy": {
        "type": "integer"
      },
      "church_attendance": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "cohabiting": {
        "properties": {
          "confidence": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dating": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "divorced": {
        "properties": {
          "bool": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood_considering": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "education": {
        "properties": {
          "est_level": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "email": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "is_work_school": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "engaged": {
        "properties": {
          "insert_datetime_utc": {
            "type": "null"
          },
          "likelihood": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "est_income": {
        "properties": {
          "est_level": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ethnicity": {
        "type": "string"
      },
      "first_name": {
        "type": "string"
      },
      "formatted_birthdate": {
        "type": "string"
      },
      "gender": {
        "type": "string"
      },
      "head_of_household": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "home_church": {
        "properties": {
          "church_id": {
            "type": "null"
          },
          "group_participant": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "is_coaching": {
            "type": "null"
          },
          "is_giving": {
            "type": "null"
          },
          "is_serving": {
            "type": "null"
          },
          "membership_date": {
            "type": "null"
          },
          "regular_attendee": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "hub_poid": {
        "type": "integer"
      },
      "insert_datetime_utc": {
        "type": "string"
      },
      "ip_address": {
        "properties": {
          "insert_datetime_utc": {
            "type": "null"
          },
          "string": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "last_name": {
        "type": "string"
      },
      "marriage_segment": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "married": {
        "properties": {
          "bool": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "middle_name": {
        "type": "string"
      },
      "miscellaneous": {
        "properties": {
          "attribute": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "value": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "name_suffix": {
        "type": "null"
      },
      "name_title": {
        "type": "null"
      },
      "newlywed": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "parent": {
        "properties": {
          "bool": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood_expecting": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "person_id": {
        "type": "integer"
      },
      "phone": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "property_rights": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "psychographic_cluster": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "religion": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "religious_segment": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "separated": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "significant_other": {
        "properties": {
          "first_name": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "last_name": {
            "type": "null"
          },
          "middle_name": {
            "type": "null"
          },
          "name_suffix": {
            "type": "null"
          },
          "name_title": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "suppressed_datetime_utc": {
        "type": "string"
      },
      "target_group": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "type": "object"
  },
  "type": "array"
}
</code>```

答:
Use this code in linux command prompt

```<code>split -b 53750k <your-file>
cat xa* > <your-file>
</code>```

Refer to this link:
https://askubuntu.com/questions/28847/text-editor-to-edit-large-4-3-gb-plain-text-file

ContentLicense: CC BY-SA 4.0

Body:
I have a large JSON file, about 5 million records and a file size of about 32GB, that I need to get loaded into our Snowflake Data Warehouse. I need to get this file broken up into chunks of about 200k records (about 1.25GB) per file. I'd like to do this in either Node.JS or Python for deployment to an AWS Lambda function, unfortunately I haven't coded in either, yet. I have C# and a lot of SQL experience, and learning both node and python are on my to do list, so why not dive right in, right!?

My first question is "Which language would better serve this function? Python, or Node.JS?"

I know I don't want to read this entire JSON file into memory (or even the output smaller file). I need to be able to "stream" it in and out into the new file based on a record count (200k), properly close up the json objects, and continue into a new file for another 200k, and so on. I know Node can do this, but if Python can also do this, I feel like it would be easier to quickly start using for other ETL stuff I'll be doing soon.

My second question is "Based on your recommendation above, can you also recommend what modules I should require/import to help me get started? Primarily as it relates to not pulling the entire json file into memory? Maybe some tips, tricks, or 'How would you do it's? And if you're feeling really generous, some code example to help push me into the deep end on this?

I can't include a sample of the JSON data, as it contains personal information. But I can provide the JSON schema ...

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "items": {
    "properties": {
      "activities": {
        "properties": {
          "activity_id": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "frontlineorg_id": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "import_id": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "is_source": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "address": {
        "properties": {
          "city": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "congress_dist_name": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "congress_dist_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "congress_end_yr": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "congress_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "congress_start_yr": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "county": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "formatted": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "latitude": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "longitude": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "number": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "observes_dst": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "post_directional": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "pre_directional": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "school_district": {
            "items": {
              "properties": {
                "school_dist_name": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_dist_type": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_grade_high": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_grade_low": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "school_lea_code": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "secondary_number": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "secondary_unit": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "state": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state_house_dist_name": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state_house_dist_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "state_senate_dist_name": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state_senate_dist_number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "street": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suffix": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "timezone": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "utc_offset": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "zip": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "age": {
        "type": "integer"
      },
      "anniversary": {
        "properties": {
          "date": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "baptism": {
        "properties": {
          "church_id": {
            "type": "null"
          },
          "date": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "birth_dd": {
        "type": "integer"
      },
      "birth_mm": {
        "type": "integer"
      },
      "birth_yyyy": {
        "type": "integer"
      },
      "church_attendance": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "cohabiting": {
        "properties": {
          "confidence": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dating": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "divorced": {
        "properties": {
          "bool": {
            "items": {
              "type": "null"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood_considering": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "education": {
        "properties": {
          "est_level": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "email": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "is_work_school": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "engaged": {
        "properties": {
          "insert_datetime_utc": {
            "type": "null"
          },
          "likelihood": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "est_income": {
        "properties": {
          "est_level": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ethnicity": {
        "type": "string"
      },
      "first_name": {
        "type": "string"
      },
      "formatted_birthdate": {
        "type": "string"
      },
      "gender": {
        "type": "string"
      },
      "head_of_household": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "home_church": {
        "properties": {
          "church_id": {
            "type": "null"
          },
          "group_participant": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "is_coaching": {
            "type": "null"
          },
          "is_giving": {
            "type": "null"
          },
          "is_serving": {
            "type": "null"
          },
          "membership_date": {
            "type": "null"
          },
          "regular_attendee": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "hub_poid": {
        "type": "integer"
      },
      "insert_datetime_utc": {
        "type": "string"
      },
      "ip_address": {
        "properties": {
          "insert_datetime_utc": {
            "type": "null"
          },
          "string": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "last_name": {
        "type": "string"
      },
      "marriage_segment": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "married": {
        "properties": {
          "bool": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "middle_name": {
        "type": "string"
      },
      "miscellaneous": {
        "properties": {
          "attribute": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "value": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "name_suffix": {
        "type": "null"
      },
      "name_title": {
        "type": "null"
      },
      "newlywed": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "parent": {
        "properties": {
          "bool": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "likelihood_expecting": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "person_id": {
        "type": "integer"
      },
      "phone": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "number": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "property_rights": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "psychographic_cluster": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "religion": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "religious_segment": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "separated": {
        "properties": {
          "bool": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "significant_other": {
        "properties": {
          "first_name": {
            "type": "null"
          },
          "insert_datetime_utc": {
            "type": "null"
          },
          "last_name": {
            "type": "null"
          },
          "middle_name": {
            "type": "null"
          },
          "name_suffix": {
            "type": "null"
          },
          "name_title": {
            "type": "null"
          },
          "suppressed_datetime_utc": {
            "type": "null"
          }
        },
        "type": "object"
      },
      "suppressed_datetime_utc": {
        "type": "string"
      },
      "target_group": {
        "properties": {
          "insert_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "string": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suppressed_datetime_utc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "type": "object"
  },
  "type": "array"
}

Body:
Use this code in linux command prompt

split -b 53750k <your-file>
cat xa* > <your-file>

Refer to this link:
https://askubuntu.com/questions/28847/text-editor-to-edit-large-4-3-gb-plain-text-file

ContentLicense: CC BY-SA 3.0


问:
Data scraping text without css path R
Hello I am writting to you because I am breaking my head to find a way and scrap data out of a webpage("https://nabtu.org/about-nabtu/official-directory/building-trades-local-councils-overview/").
I am doing this for practice and just to learn how to scrap data.I am trying to scrap out the contact data of the above mentioned webpage(Office,Fax,email) but I am unable to do it since there is no certain css path I can get with  Selectorgadget.I am using R and the scrip I am using is kind of like this.

```<code>library(rvest)
page_name <-read_html("page html")

page_name %>%
html_node("selector gadget node") %>%
html_text()
</code>```

I scraped all the other data I just cant scrap this contact information.
Any help will be appreciated because my head is gonna blow.Thanks in advance.

答:
I don't see where the problem is. Each contact block has a .council-list list class. Using that, you can extract the contact information seperately. Afterwards, use some string/regex operations to extract the exact fields.

```<code>library(rvest)
page_name <- read_html('https://nabtu.org/about-nabtu/official-directory/building-trades-local-councils-overview/')
contact_strings = page_name %>%
  html_nodes('.council-list') %>%
  html_text()

# Filter out strings that don't contain contact information
contact_strings = grep(x = contact_strings, 'Email|Fax|office', ignore.case = T, value = T)

# Extract infomration
library(stringr)
library(magrittr)
office = str_extract(contact_strings, 'Office:[^[:alpha:]]*')
fax = str_extract(contact_strings, 'Fax:[^[:alpha:]]*')
email = str_extract(contact_strings, 'Email: [^ ]*')
</code>```

Title: Data scraping text without css path R

Body:
Hello I am writting to you because I am breaking my head to find a way and scrap data out of a webpage("https://nabtu.org/about-nabtu/official-directory/building-trades-local-councils-overview/").
I am doing this for practice and just to learn how to scrap data.I am trying to scrap out the contact data of the above mentioned webpage(Office,Fax,email) but I am unable to do it since there is no certain css path I can get with  Selectorgadget.I am using R and the scrip I am using is kind of like this.

library(rvest)
page_name <-read_html("page html")

page_name %>%
html_node("selector gadget node") %>%
html_text()

I scraped all the other data I just cant scrap this contact information.
Any help will be appreciated because my head is gonna blow.Thanks in advance.

Body:
I don't see where the problem is. Each contact block has a .council-list list class. Using that, you can extract the contact information seperately. Afterwards, use some string/regex operations to extract the exact fields.

library(rvest)
page_name <- read_html('https://nabtu.org/about-nabtu/official-directory/building-trades-local-councils-overview/')
contact_strings = page_name %>%
  html_nodes('.council-list') %>%
  html_text()

# Filter out strings that don't contain contact information
contact_strings = grep(x = contact_strings, 'Email|Fax|office', ignore.case = T, value = T)

# Extract infomration
library(stringr)
library(magrittr)
office = str_extract(contact_strings, 'Office:[^[:alpha:]]*')
fax = str_extract(contact_strings, 'Fax:[^[:alpha:]]*')
email = str_extract(contact_strings, 'Email: [^ ]*')


问:
Exporting g++ compilation error messages from TMB library to a text file
I'm trying to compile a model with gcc (c++) in R (using the TMB package). The errors are so numerous that in Rstudio, I can't even scroll up to see the beginning of them. Therefore, I would like to print everything in the console (messages, errors and warnings) to a text file. This way I could also compare different model outputs (or specifically, their fails).

I tried the following things:

```<code>fileConn<-file("Fail.txt")
writeLines(compile("Mymodel.cpp"), fileConn)
close(fileConn)
</code>```

=> Gives me an empty file (which I more or less expected)

```<code>zz <- file("Fail.txt", open = "wt")
sink(zz, type = "message")
compile("Mymodel.cpp")
sink()
</code>```

=> only prints the final error

What did I overlook?

答:
This is an old question but I found a simple solution to get a logfile output for TMB::compile, which I have not found anywhere else.

As stated  above, sink() does not capture system command output; it only captures R output.
However, any argument not listed in the function compile from library TMB are passed as Makeconf variables. Thus, you only have to pass a classical output command with the path to the targeted logfile in a string format:

```<code>TMB::compile(file = "Mymodel.cpp", "&> /tmp/logfile.log")
</code>```

Body:
I'm trying to compile a model with gcc (c++) in R (using the TMB package). The errors are so numerous that in Rstudio, I can't even scroll up to see the beginning of them. Therefore, I would like to print everything in the console (messages, errors and warnings) to a text file. This way I could also compare different model outputs (or specifically, their fails).

I tried the following things:

fileConn<-file("Fail.txt")
writeLines(compile("Mymodel.cpp"), fileConn)
close(fileConn)

=> Gives me an empty file (which I more or less expected)

zz <- file("Fail.txt", open = "wt")
sink(zz, type = "message")
compile("Mymodel.cpp")
sink()

=> only prints the final error

What did I overlook?

Body:
This is an old question but I found a simple solution to get a logfile output for TMB::compile, which I have not found anywhere else.

As stated  above, sink() does not capture system command output; it only captures R output.
However, any argument not listed in the function compile from library TMB are passed as Makeconf variables. Thus, you only have to pass a classical output command with the path to the targeted logfile in a string format:

TMB::compile(file = "Mymodel.cpp", "&> /tmp/logfile.log")


问:
datetime format conversion from mm-dd-yyyy to yyyy-mm-dd in c#
I am using asp net core with entity framework. I have a datetimepicker which i am using as calendar. I have customize its format using jquery like this.

```<code>  $('.datepicker').datetimepicker({
        format: 'yyyy-mm-dd'
    });
</code>```

This shows the date forma to user.
and then converting it to C# datetime I am saving it in database in same format.Every thing is correct till now.
Now on my next visit this page has to be pre-filled if data is there. This time on the textbox of calendar it is showing some thing like 0007/02/19  where as the date that i entered is 1993/07/02 and the date that is saved in database is 7/2/1993. I tried using

```<code>            String DateString = Convert.ToString(ProfileDetails.DateOfBirth);
            IFormatProvider culture = new CultureInfo("en-US");

            DateTime dateVal = DateTime.ParseExact(DateString, "MM/dd/YYYY", CultureInfo.InvariantCulture);
            DateTime date = Convert.ToDateTime(dateVal);
            user.DateOfBirth = dateVal;
</code>```

this but was getting error string is not in valid datetime format. In my modal I have defined date as datetime. I am not getting the solution. Can any one gives me the correct way to complete that.

答:
Cuz you are using MM/dd/YYYY instead MM/dd/yyyy

Working code:

```<code>String DateString = Convert.ToString("07/02/1993");
IFormatProvider culture = new CultureInfo("en-US");
DateTime dateVal = DateTime.ParseExact(DateString, "MM/dd/yyyy", CultureInfo.InvariantCulture);
</code>```

Body:
I am using asp net core with entity framework. I have a datetimepicker which i am using as calendar. I have customize its format using jquery like this.

  $('.datepicker').datetimepicker({
        format: 'yyyy-mm-dd'
    });

This shows the date forma to user.
and then converting it to C# datetime I am saving it in database in same format.Every thing is correct till now.
Now on my next visit this page has to be pre-filled if data is there. This time on the textbox of calendar it is showing some thing like 0007/02/19  where as the date that i entered is 1993/07/02 and the date that is saved in database is 7/2/1993. I tried using

            String DateString = Convert.ToString(ProfileDetails.DateOfBirth);
            IFormatProvider culture = new CultureInfo("en-US");

            DateTime dateVal = DateTime.ParseExact(DateString, "MM/dd/YYYY", CultureInfo.InvariantCulture);
            DateTime date = Convert.ToDateTime(dateVal);
            user.DateOfBirth = dateVal;

this but was getting error string is not in valid datetime format. In my modal I have defined date as datetime. I am not getting the solution. Can any one gives me the correct way to complete that.

Body:
Cuz you are using MM/dd/YYYY instead MM/dd/yyyy

Working code:

String DateString = Convert.ToString("07/02/1993");
IFormatProvider culture = new CultureInfo("en-US");
DateTime dateVal = DateTime.ParseExact(DateString, "MM/dd/yyyy", CultureInfo.InvariantCulture);


问:
Binding Web Application, Site Collection, Sites and Library data to a Sharepoint 2007 dropdown list in a web part
A. I'd like to know the best way to retrieve the web applications, site collections, sites and libraries of a SharePoint 2007 install (on a farm) and display each of those data in a dropdown list of their own a web part.

B. What type of web part should be used

C. What object model or database/tables do I get those pieces of information from

For example:

"Web Applications" Dropdownlist1

"Site Collections" Dropdownlist2

"Sites" Dropdownlist3

"Libraries" in a scrollable Textarea

答:
If you want to display each type of data in each drop down list in each own Web part. You can make some connected Web parts.

For example:

1- The Web application list Web part

You can get the data from SPWebService.WebApplications. The selected Web application should be used as the filter for the Site collection list Web part.

2- The Site collection list Web part.

You can get the data from SPWebApplication.Sites. The selected Site should be used as the filter for the Web list Web part. Ensure to dispose the SPSite object after using it.

3- Web list Web part.

You can get the data from SPSite.AllWebs. Ensure to dispose the SPWeb object after using it.

ContentLicense: CC BY-SA 2.5


问:
Python cx_Freeze Import Error "No module named humanize"
```<code>    C:\WINDOWS\system32>py C:\Users\Lenovo\Desktop\RPGTxtGame\setup.py build
running build
running build_exe
Traceback (most recent call last):
  File "C:\Users\Lenovo\Desktop\RPGTxtGame\setup.py", line 5, in <module>
    cx_Freeze.setup( name = "downloads", version = "1.0", options = {"build_exe": {"packages": ["errno", "os", "re", "stat", "subprocess","collections", "pprint","shutil", "humanize","pycallgraph"], "include_files": []}}, executables = exe )
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\dist.py", line 349, in setup
    distutils.core.setup(**attrs)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\dist.py", line 219, in run
    freezer.Freeze()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\freezer.py", line 621, in Freeze
    self.finder = self._GetModuleFinder()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\freezer.py", line 340, in _GetModuleFinder
    finder.IncludePackage(name)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 653, in IncludePackage
    module = self._ImportModule(name, deferredImports)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 350, in _ImportModule
    raise ImportError("No module named %r" % name)
ImportError: No module named 'humanize'
</code>```

Hi, I tried to create an executable from my python project. cx_Freeze is givinig this error though

I also tried the pyinstaller but that one is not compatible with python 3.6

My setup.py script is

```<code>import cx_Freeze

exe = [cx_Freeze.Executable("main.py")]

cx_Freeze.setup( name = "downloads", version = "1.0", options = {"build_exe": {"packages": ["errno", "os", "re", "stat", "subprocess","collections", "pprint","shutil", "humanize","pycallgraph"], "include_files": []}}, executables = exe )
</code>```

Could you help me?

答:
Here is how I would do it.

```<code>from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["errno", "os", "re", "stat", "subprocess","collections", "pprint","shutil", "humanize","pycallgraph"]}

setup( name = "downloads",
       version = "1.0",
       options = {"build_exe": build_exe_options},
       description = "Your description here.",
       executables = [Executable("main.py")])
</code>```

As a side note depending on your environment you shouldn't need to explicitly include things like "os", "re", "shutil" or any other standard library modules as cx_Freeze should be able to find and import those automatically.

Also make sure your "humanize" package is imported in your "main.py" script.

Body:
    C:\WINDOWS\system32>py C:\Users\Lenovo\Desktop\RPGTxtGame\setup.py build
running build
running build_exe
Traceback (most recent call last):
  File "C:\Users\Lenovo\Desktop\RPGTxtGame\setup.py", line 5, in <module>
    cx_Freeze.setup( name = "downloads", version = "1.0", options = {"build_exe": {"packages": ["errno", "os", "re", "stat", "subprocess","collections", "pprint","shutil", "humanize","pycallgraph"], "include_files": []}}, executables = exe )
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\dist.py", line 349, in setup
    distutils.core.setup(**attrs)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\dist.py", line 219, in run
    freezer.Freeze()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\freezer.py", line 621, in Freeze
    self.finder = self._GetModuleFinder()
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\freezer.py", line 340, in _GetModuleFinder
    finder.IncludePackage(name)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 653, in IncludePackage
    module = self._ImportModule(name, deferredImports)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 350, in _ImportModule
    raise ImportError("No module named %r" % name)
ImportError: No module named 'humanize'

Hi, I tried to create an executable from my python project. cx_Freeze is givinig this error though

I also tried the pyinstaller but that one is not compatible with python 3.6

My setup.py script is

import cx_Freeze

exe = [cx_Freeze.Executable("main.py")]

cx_Freeze.setup( name = "downloads", version = "1.0", options = {"build_exe": {"packages": ["errno", "os", "re", "stat", "subprocess","collections", "pprint","shutil", "humanize","pycallgraph"], "include_files": []}}, executables = exe )

Could you help me?

Body:
Here is how I would do it.

from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["errno", "os", "re", "stat", "subprocess","collections", "pprint","shutil", "humanize","pycallgraph"]}

setup( name = "downloads",
       version = "1.0",
       options = {"build_exe": build_exe_options},
       description = "Your description here.",
       executables = [Executable("main.py")])

As a side note depending on your environment you shouldn't need to explicitly include things like "os", "re", "shutil" or any other standard library modules as cx_Freeze should be able to find and import those automatically.

Also make sure your "humanize" package is imported in your "main.py" script.


问:
How to use api.ai speech recognition in my service
As I was learning how to use api.ai, I created a service that accepts text and replies with some text. But I observed that I can use my voice, and it will recognize what I say, see the microphone in the iamge:
Now I want to use this feature in my service. I mean instead of taking text from the user, I want to take an audio file and api.ai recognizes speech in that file and sends response to the user accordingly.
If anyone could help, I will be grateful.

答:
I developed an application using action AI and it's working fine. I referred the below sample application for development. [https://github.com/api-ai/apiai-android-client][1]

let me know if you have any query after referring this code.


问:
Adding column while importing to Access
Situation:
I am iterating through an Outlook-Mailbox and downloading all attachments into specific folders. Then I am iterating through the folders and import the CSV-Files into Access.

Problem:
I have the Outlook.MailItem.receiveTime property and the sender's name, which I have got from the File Title. I want to add those two pieces of information to each row of each CSV-File.

Question:
Is there a possibility to add those two columns on import or do I have to open each file and iterate through the content to add them?

Little side question:
Would it be possible to import the files directly from Outlook, meaning, without heaving to save them?

Software and languages I use:
    -Access 2013
    -Outlook 2013
    -VBA
    -SQL
    Little side Information: I am triggering all of this from an Access Form.

答:
You can loop through all CSV files and import each to a table.

```<code>Private Sub Command0_Click()

    Const strPath As String = "C:\your_path_here\" 'Directory Path
    Dim strFile As String 'Filename
    Dim strFileList() As String 'File  Array
    Dim intFile As Integer 'File Number

     'Loop through the folder & build file list
    strFile = Dir(strPath & "*.csv")
    While strFile <> ""
         'add files to the list
        intFile = intFile + 1
        ReDim Preserve strFileList(1 To intFile)
        strFileList(intFile) = strFile
        strFile = Dir()
    Wend
     'see if any files were found
    If intFile = 0 Then
        MsgBox "No files found"
        Exit Sub
    End If
     'cycle through the list of files &  import to Access
     'creating a new table called MyTable
    For intFile = 1 To UBound(strFileList)
        DoCmd.TransferText acImportDelimi, , _
        "Test", strPath & strFileList(intFile)
         'Check out the TransferSpreadsheet options in the Access
         'Visual Basic Help file for a full description & list of
         'optional settings
    Next
    MsgBox UBound(strFileList) & " Files were Imported"
End Sub
</code>```

If you want to download attachment from Outlook, try this.

```<code>Private Sub GetAttachments()

    Dim ns As Namespace
    Dim Inbox As Outlook.MAPIFolder
    Dim Item As Object
    Dim Atmt As Outlook.Attachment
    Dim FileName As String

    Set ns = GetNamespace("MAPI")
    Set Inbox = ns.Folders("MailboxName").Folders("Inbox")

    If Inbox.Items.Count = 0 Then
        MsgBox "There are no messages in the Inbox.", vbInformation, _
                "Nothing Found"
        Exit Sub
    End If

    For Each Item In Inbox.Items
        For Each Atmt In Item.Attachments
            If Atmt.Type = 1 And InStr(Atmt, "xlsx") > 0 Then
                FileName = "C:\attachments\" & Atmt.FileName
                Atmt.SaveAsFile FileName
            End If
        Next Atmt
    Next Item

End Sub
</code>```

Set a reference to MS Outlook and remember, the "MailboxName" is your email address.

Title: Adding column while importing to Access

Body:
You can loop through all CSV files and import each to a table.

Private Sub Command0_Click()

    Const strPath As String = "C:\your_path_here\" 'Directory Path
    Dim strFile As String 'Filename
    Dim strFileList() As String 'File  Array
    Dim intFile As Integer 'File Number

     'Loop through the folder & build file list
    strFile = Dir(strPath & "*.csv")
    While strFile <> ""
         'add files to the list
        intFile = intFile + 1
        ReDim Preserve strFileList(1 To intFile)
        strFileList(intFile) = strFile
        strFile = Dir()
    Wend
     'see if any files were found
    If intFile = 0 Then
        MsgBox "No files found"
        Exit Sub
    End If
     'cycle through the list of files &  import to Access
     'creating a new table called MyTable
    For intFile = 1 To UBound(strFileList)
        DoCmd.TransferText acImportDelimi, , _
        "Test", strPath & strFileList(intFile)
         'Check out the TransferSpreadsheet options in the Access
         'Visual Basic Help file for a full description & list of
         'optional settings
    Next
    MsgBox UBound(strFileList) & " Files were Imported"
End Sub

If you want to download attachment from Outlook, try this.

Private Sub GetAttachments()

    Dim ns As Namespace
    Dim Inbox As Outlook.MAPIFolder
    Dim Item As Object
    Dim Atmt As Outlook.Attachment
    Dim FileName As String

    Set ns = GetNamespace("MAPI")
    Set Inbox = ns.Folders("MailboxName").Folders("Inbox")

    If Inbox.Items.Count = 0 Then
        MsgBox "There are no messages in the Inbox.", vbInformation, _
                "Nothing Found"
        Exit Sub
    End If

    For Each Item In Inbox.Items
        For Each Atmt In Item.Attachments
            If Atmt.Type = 1 And InStr(Atmt, "xlsx") > 0 Then
                FileName = "C:\attachments\" & Atmt.FileName
                Atmt.SaveAsFile FileName
            End If
        Next Atmt
    Next Item

End Sub

Set a reference to MS Outlook and remember, the "MailboxName" is your email address.


问:
How can we manipulate std class in php?
Is it possible to add elements to stdclasses like we do for arrays?

```<code>Array (
  [0] => item 1
  [1] => item 2
)

Stdclass (
  [0] => item 1
  [1] => item 2
)
</code>```

Is it generally harder to manipulate objects as compared to arrays? Since we have lots of array functions to make use of etc.

答:
Yes, but not numerically indexed.

```<code>  $a = new stdclass();
  $a->foo = 'item 1';
  $a->bar = 'item 2';
  $a->goobar = array('item1', 'item2');
  var_dump($a);
</code>```

If you want more complex scenarios, look at ArrayAccess and ArrayObject.

Title: How can we manipulate std class in php?

Body:
Is it possible to add elements to stdclasses like we do for arrays?

Array (
  [0] => item 1
  [1] => item 2
)

Stdclass (
  [0] => item 1
  [1] => item 2
)

Is it generally harder to manipulate objects as compared to arrays? Since we have lots of array functions to make use of etc.

Body:
Yes, but not numerically indexed.

  $a = new stdclass();
  $a->foo = 'item 1';
  $a->bar = 'item 2';
  $a->goobar = array('item1', 'item2');
  var_dump($a);

If you want more complex scenarios, look at ArrayAccess and ArrayObject.


问:
Assigning dtype value using array.dtype = <data type> in NumPy arrays gives ambiguous results
I am new to programming and numpy... While reading tutorials and experimenting on jupyter-notebook... I thought of converting dtype of a numpy array as follows:

```<code>import numpy as np
c = np.random.rand(4)*10
print c
#Output1: [ 0.12757225  5.48992242  7.63139022  2.92746857]
c.dtype = int
print c
#Output2: [4593764294844833304 4617867121563982285 4620278199966380988 4613774491979221856]
</code>```

I know the proper way of changing is:

```<code>c = c.astype(int)
</code>```

But I want to the reason behind those ambiguous numbers in Output2. What are they and what do they signify?

答:
Floats and integers (numpy.float64s and numpy.int64s) are represented differently in memory. The value 42 stored in these different types corresponds to a different bit pattern in memory.

When you're reassigning the dtype attribute of an array, you keep the underlying data unchanged, and you're telling numpy to interpret that pattern of bits in a new way. Since the interpretation now doesn't match the original definition of the data, you end up with gibberish (meaningless numbers).

On the other hand, converting your array via .astype()  will actually convert the data in memory:

```<code>>>> import numpy as np
>>> arr = np.random.rand(3)
>>> arr.dtype
dtype('float64')
>>> arr
array([ 0.7258989 ,  0.56473195,  0.20885672])
>>> arr.data
<memory at 0x7f10d7061288>
>>> arr.dtype = np.int64
>>> arr.data
<memory at 0x7f10d7061348>
>>> arr
array([4604713535589390862, 4603261872765946451, 4596692876638008676])
</code>```

Proper conversion:

```<code>>>> arr = np.random.rand(3)*10
>>> arr
array([ 3.59591191,  1.21786042,  6.42272461])
>>> arr.astype(np.int64)
array([3, 1, 6])
</code>```

As you can see, using astype will meaningfully convert the original values of the array, in this case it will truncate to the integer part, and return a new array with corresponding values and dtype.

Note that assigning a new dtype doesn't trigger any checks, so you can do very weird stuff with your array. In the above example, 64 bits of floats were reinterpreted as 64 bits of integers. But you can also change the bit size:

```<code>>>> arr = np.random.rand(3)
>>> arr.shape
(3,)
>>> arr.dtype
dtype('float64')
>>> arr.dtype = np.float32
>>> arr.shape
(6,)
>>> arr
array([  4.00690371e+35,   1.87285304e+00,   8.62005305e+13,
         1.33751166e+00,   7.17894062e+30,   1.81315207e+00], dtype=float32)
</code>```

By telling numpy that your data occupies half the space than originally, numpy will deduce that your array has twice as many elements! Clearly not what you should ever want to do.

Another example: consider the 8-bit unsigned integer 255==2**8-1: it corresponds to 11111111 in binary. Now, try to reinterpret two of these numbers as a single 16-bit unsigned integer:

```<code>>>> arr = np.array([255,255],dtype=np.uint8)
>>> arr.dtype = np.uint16
>>> arr
array([65535], dtype=uint16)
</code>```

As you can see, the result is the single number 65535. If that doesn't ring a bell, it's exactly 2**16-1, with 16 ones in its binary pattern. The two full-one patterns were reinterpreted as a single 16-bit number, and the result changed accordingly. The reason you often see weirder numbers is that reinterpreting floats as ints as vice versa will lead to a much stronger mangling of the data, due to how floating-point numbers are represented in memory.

As hpaulj noted, you can directly perform this reinterpretation of the data by constructing a new view of the array with a modified dtype. This is probably more useful than having to reassign the dtype of a given array, but then again changing the dtype is only useful in fairly rare, very specific use cases.

Body:
I am new to programming and numpy... While reading tutorials and experimenting on jupyter-notebook... I thought of converting dtype of a numpy array as follows:

import numpy as np
c = np.random.rand(4)*10
print c
#Output1: [ 0.12757225  5.48992242  7.63139022  2.92746857]
c.dtype = int
print c
#Output2: [4593764294844833304 4617867121563982285 4620278199966380988 4613774491979221856]

I know the proper way of changing is:

c = c.astype(int)

But I want to the reason behind those ambiguous numbers in Output2. What are they and what do they signify?

Body:
Floats and integers (numpy.float64s and numpy.int64s) are represented differently in memory. The value 42 stored in these different types corresponds to a different bit pattern in memory.

When you're reassigning the dtype attribute of an array, you keep the underlying data unchanged, and you're telling numpy to interpret that pattern of bits in a new way. Since the interpretation now doesn't match the original definition of the data, you end up with gibberish (meaningless numbers).

On the other hand, converting your array via .astype()  will actually convert the data in memory:

>>> import numpy as np
>>> arr = np.random.rand(3)
>>> arr.dtype
dtype('float64')
>>> arr
array([ 0.7258989 ,  0.56473195,  0.20885672])
>>> arr.data
<memory at 0x7f10d7061288>
>>> arr.dtype = np.int64
>>> arr.data
<memory at 0x7f10d7061348>
>>> arr
array([4604713535589390862, 4603261872765946451, 4596692876638008676])

Proper conversion:

>>> arr = np.random.rand(3)*10
>>> arr
array([ 3.59591191,  1.21786042,  6.42272461])
>>> arr.astype(np.int64)
array([3, 1, 6])

As you can see, using astype will meaningfully convert the original values of the array, in this case it will truncate to the integer part, and return a new array with corresponding values and dtype.

Note that assigning a new dtype doesn't trigger any checks, so you can do very weird stuff with your array. In the above example, 64 bits of floats were reinterpreted as 64 bits of integers. But you can also change the bit size:

>>> arr = np.random.rand(3)
>>> arr.shape
(3,)
>>> arr.dtype
dtype('float64')
>>> arr.dtype = np.float32
>>> arr.shape
(6,)
>>> arr
array([  4.00690371e+35,   1.87285304e+00,   8.62005305e+13,
         1.33751166e+00,   7.17894062e+30,   1.81315207e+00], dtype=float32)

By telling numpy that your data occupies half the space than originally, numpy will deduce that your array has twice as many elements! Clearly not what you should ever want to do.

Another example: consider the 8-bit unsigned integer 255==2**8-1: it corresponds to 11111111 in binary. Now, try to reinterpret two of these numbers as a single 16-bit unsigned integer:

>>> arr = np.array([255,255],dtype=np.uint8)
>>> arr.dtype = np.uint16
>>> arr
array([65535], dtype=uint16)

As you can see, the result is the single number 65535. If that doesn't ring a bell, it's exactly 2**16-1, with 16 ones in its binary pattern. The two full-one patterns were reinterpreted as a single 16-bit number, and the result changed accordingly. The reason you often see weirder numbers is that reinterpreting floats as ints as vice versa will lead to a much stronger mangling of the data, due to how floating-point numbers are represented in memory.

As hpaulj noted, you can directly perform this reinterpretation of the data by constructing a new view of the array with a modified dtype. This is probably more useful than having to reassign the dtype of a given array, but then again changing the dtype is only useful in fairly rare, very specific use cases.


问:
Using XSS to execute PHP Code
INTRO

I was reading a report on hackerone.com and someone submitted an XSS bug, which uses Wordpress stream function, to Uber. First he displayed a simple alert box, but later he displayed custom php code, phpinfo();, which gets executed.

Question

I can not comprehend how someone could use XSS to execute php, I thought that was impossible. Or is it just a special case because the stream function is able to overwrite some php scripts? If so, is the BeEF framework / XSS-Shell one of the most powerful things of XSS or could one accomplish more in normal cases (like, XSS on a forum or something).

THE POC

See this hackerone report.

OUTRO

Could someone please explain this to me? Thanks!

答: The attack stores javascript as unauthenticated user. Later, this javascript is loaded when an administrator clicks a certain tab of the stream plugin, thus, the injected code gets executed with administrator rights. Wordpress has some code editing functions (e.g. theme- and plugin editor) which allow editing of php files on the server. This can be done by the injected javascript, leaving you with a compromised server and injected php-code.</p>

Title: Using XSS to execute PHP Code


问:
Apache Ignite query / index
I have a particular question about indexing with Apache Ignite.

My need is to query the Cache without "knowing" the schema. Because I have no java class definition at some moments, so no annotation available. But Apache Ignite seems to need annotation to recognize fields.

Is there a way to define queryable fields at runtime?

I ask it because I'm building an technology agnostic application and I plug specialized class at runtime. Another problem for me is to extend classes for Apache Ignite and define fake fields just to make "the field" (assuming it's not the original field...) viewable from Apache Ignite.

Did someone had the same "problem"?

Original class Command :

```<code>public class Command {
    private String commandName;

    public void setCommandName(String commandName) {
        this.commandName = commandName;
    }
    public String getCommandName(){
        return this.commandName;
    }
}
</code>```

Extended Command class for Ignite SQL uses :

```<code>public class IgniteCommand extends Command{
    @QuerySqlField (name="name", index = true)
    private String _commandName;

    @Override
    public void setCommandName(String commandName) {
        super.setCommandName(commandName);
        this._commandName = getCommandName();
    }
}
</code>```

This above code works fine for me.

答:
You can configure query entities at runtime but before cache started. See Spring XML configuration example in docs [1]. You can do the same programmatically.

You also can create indexes dynamically using DDL. See [2].

[1] https://apacheignite.readme.io/docs/indexes#queryentity-based-configuration
[2] https://apacheignite.readme.io/docs/distributed-ddl#section-create-index

Title: Apache Ignite query / index

Body:
I have a particular question about indexing with Apache Ignite.

My need is to query the Cache without "knowing" the schema. Because I have no java class definition at some moments, so no annotation available. But Apache Ignite seems to need annotation to recognize fields.

Is there a way to define queryable fields at runtime?

I ask it because I'm building an technology agnostic application and I plug specialized class at runtime. Another problem for me is to extend classes for Apache Ignite and define fake fields just to make "the field" (assuming it's not the original field...) viewable from Apache Ignite.

Did someone had the same "problem"?

Original class Command :

public class Command {
    private String commandName;

    public void setCommandName(String commandName) {
        this.commandName = commandName;
    }
    public String getCommandName(){
        return this.commandName;
    }
}

Extended Command class for Ignite SQL uses :

public class IgniteCommand extends Command{
    @QuerySqlField (name="name", index = true)
    private String _commandName;

    @Override
    public void setCommandName(String commandName) {
        super.setCommandName(commandName);
        this._commandName = getCommandName();
    }
}

This above code works fine for me.


问:
how to hide scrollbar in gecko webbrowser control
I am in need of disabling the scrollbar which appears in the application. Using the default web browser there is a option called ScrollBarsEnabled which you can set true of false allowing the scrollbar to be hidden or not while scrolling.

Sadly i dont think Gecko has this feature seeing as its not listed!

I came across a similar post which had my issue but all that does is change the css which then causes my page to become not scroll-able.

Thread: how to hide scrollbar in gecko webbrowser control in c#

Does anyone to this date, have any idea how to hide/disable that scroll bar?

答:
A different workaround could be to move the margin a little bit, as described here </p>

```<code>#content browser {
 margin-right: -14px !important;
 overflow-y: scroll;
 overflow-x: hidden;
}
</code>```

Body:
A different workaround could be to move the margin a little bit, as described here

#content browser {
 margin-right: -14px !important;
 overflow-y: scroll;
 overflow-x: hidden;
}


问:
Android - Firebase authentication giving error
I am developing an android application with Firebase and I want to use the email/password authentication that Firebase provides.

But I keep getting following error:

```<code>W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
</code>```

I have searched around, but I can't fix the problem.

答:
In app/build.gradle include these new dependencies:

```<code>    compile 'com.google.firebase:firebase-auth:11.0.0'
    compile 'com.google.firebase:firebase-core:11.0.0'
</code>```

and check in SDK tools Google Play Service and Google Repository asking for update, if yes then Update to latest version

Body:
I am developing an android application with Firebase and I want to use the email/password authentication that Firebase provides.

But I keep getting following error:

W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.

I have searched around, but I can't fix the problem.

Body:
In app/build.gradle include these new dependencies:

    compile 'com.google.firebase:firebase-auth:11.0.0'
    compile 'com.google.firebase:firebase-core:11.0.0'

and check in SDK tools Google Play Service and Google Repository asking for update, if yes then Update to latest version


问:
Design of convolution kernel CUDA
I am trying to design a convolution kernel code for CUDA. It will take relatively small pictures (typically for my application a 19 * 19 image)

In my research , i found most notably this paper :  https://www.evl.uic.edu/sjames/cs525/final.html

I understand the concept of it, but I wonder, for small images, does using
a block by pixel of the original image, and using the threads of that block as the pixels to fetch , then do a block wide reduction, fast enough ? I made a basic implementation that makes global memory access coalescent, so, is it a good design for small pictures ? Or should I follow the "traditional" method ?

答: It all depends upon your eventual application for your program. If you intend to only convolute a few "relatively small pictures", as you mention, then a naive approach should be sufficient. In fact, a serial approach may even be faster due to memory transfer overhead between the CPU and GPU if you're not processing much data. I would recommend first writing the kernel which accesses global memory, as you mention, and if you will be working with a larger dataset in the future, it would make sense to attempt the "traditional" approach as well, and compare runtimes.</p>

Title: Design of convolution kernel CUDA


问:
Why do we do a POST to confirm deletion in asp.net MVC?
The following is a note from Professional ASP.NET MVC 2 by Scott Hanselman ++

You might ask — why did we go through
  the effort of creating a <form> within
  our Delete Confi rmation screen? Why
  not just use a standard hyperlink to
  link to an action method that does the
  actual delete operation? The reason is
  because we want to be careful to guard
  against Web-crawlers and search
  engines discovering our URLs and
  inadvertently causing data to be
  deleted when they follow the links.
  HTTP-GET-based URLs are considered
  safe for them to access/crawl, and
  they are supposed to not follow
  HTTP-POST ones. A good rule is to make
  sure that you always put destructive
  or data-modifying operations behind
  HTTP-POST requests.

If web-crawlers and search engine have no access to the page containing deletion button, is it safe to use a standard hyperlink to link to an action method doing the actual delete operation?

答: Yes, it's safe if a search engine can't reach it. But make sure to include some sort of confirmation or undo function. Links are easy to mis-click.</p>


问:
Angular 4: How to include Bootstrap?
I'm a backend developer and I'm just playing around with Angular4. So I did this installation tutorial: https://www.youtube.com/watch?v=cdlbFEsAGXo.

Given this, how can I add bootstrap to the app so I could use the class "container-fluid" or "col-md-6" and stuff like that?

答:
In order to configure/integrate/use Bootstrap in angular, first we need to install
  Bootstrap package using npm.

Install package

```<code>$ npm install bootstrap@4.0.0-alpha.6 --save   // for specific version
or
$ npm install bootstrap --save   // for latest version
</code>```

Note: --save command will save the dependency in our angular app inside package.json file.

Now that we have the package installed with above step, now we can tell Angular CLI
  that it needs to load these styles by using any of the below options or both:

option 1) Adding into the file src/styles.css

we can add the dependencies as shown below:

```<code>@import "~bootstrap/dist/css/bootstrap.min.css";
</code>```

Option 2) Adding into angular-cli.json or angular.json

We can add the style css files into angular-cli.json or angular.json file which is at
  root folder of our angular app as shown below:

```<code>"styles": [
   "../node_modules/bootstrap/dist/css/bootstrap.min.css",
   "styles.css"
]
</code>```

Title: Angular 4: How to include Bootstrap?

Body:
In order to configure/integrate/use Bootstrap in angular, first we need to install
  Bootstrap package using npm.

Install package

$ npm install bootstrap@4.0.0-alpha.6 --save   // for specific version
or
$ npm install bootstrap --save   // for latest version

Note: --save command will save the dependency in our angular app inside package.json file.

Now that we have the package installed with above step, now we can tell Angular CLI
  that it needs to load these styles by using any of the below options or both:

option 1) Adding into the file src/styles.css

we can add the dependencies as shown below:

@import "~bootstrap/dist/css/bootstrap.min.css";

Option 2) Adding into angular-cli.json or angular.json

We can add the style css files into angular-cli.json or angular.json file which is at
  root folder of our angular app as shown below:

"styles": [
   "../node_modules/bootstrap/dist/css/bootstrap.min.css",
   "styles.css"
]