问:
Angular reusable add and edit component
What is the cleaner solution to handle add/edit objects.

Option 1

Component for Add

Component for Edit

Option 2

resusable component ObjectForm

Two components AddObject and EditObject. Both reuse ObjectForm

reusable component uses IsNew boolean to check if object input is not null.

Any other Options ?

答:
I think it's good to avoid if statement especially for this use case.

For me it's a kind of option 2:

Use case 1: create a new item :

CreateItemComponent extends ItemForm

Use case 2: update an item:

EditItemComponent extends ItemForm

EditItemComponent has @Input() item

In your ItemForm, you have methods which are common to CreateItemComponent and EditItemComponent.

And in each component you have specific methods for the component.

Maybe, it's not necessary to have a flag isNew. The objects will be very similar the first (create) doesn't have default values and the edited object has the values of the item which is editing.

But finally, they have same properties. If you have an ID you can use a UUID to simulate this during the creation.

For further

I do another layer for the actions of my form. I have:

CreateItemComponent -> ItemActions -> ItemForm

EditItemComponent -> ItemActions -> ItemForm

Here I decoupled the actions (because they are identical) and I don't have duplicate code in Create and Edit component

Title: Angular reusable add and edit component


来源: stackexchange

问:
ExecJS::RuntimeError running the Getting Started with Rails blog on cygwin (windows7)
I am trying to run the Getting Started with Rails blog on cygwin (windows7). I get the following error message:

ExecJS:: RuntimeError in Welcome#index

```<code>module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\tmp\execjs20130903-50672-1vn7gqc.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

  (in /usr/lib/ruby/gems/1.9.1/gems/turbolinks-1.3.0/lib/assets/javascripts   /turbolinks.js.coffee)
</code>```

node is installed.

This is after

```<code>$rails generate controller welcome index
$rails s
</code>```

I am running Rails 4.0 on cygwin
Any ideas why this might be happening?

Thanks

umbregachoong

答:
don't do anything just go to application/assets/javascript/application.js and remove

'//'

from

//=require turbolinks

to

=require turbolinks

that will basically uncomment the line from the file
This step made my work done when i faced similar error in Default rails server going through RAILS Tutorial. I am using Windows 10 PC and this solved my case

ContentLicense: CC BY-SA 3.0

Body:
I am trying to run the Getting Started with Rails blog on cygwin (windows7). I get the following error message:

ExecJS:: RuntimeError in Welcome#index

module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\tmp\execjs20130903-50672-1vn7gqc.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

  (in /usr/lib/ruby/gems/1.9.1/gems/turbolinks-1.3.0/lib/assets/javascripts   /turbolinks.js.coffee)

node is installed.

This is after

$rails generate controller welcome index
$rails s

I am running Rails 4.0 on cygwin
Any ideas why this might be happening?

Thanks

umbregachoong


问:
Hiding a div if a value is under 1
I want the application to behave this way so that when I click on "Show Order" if any of the values are 0 or blank, I don't want div id item * x be shown:

var divs = document.getElementsByTagName('div');

var toggle = function() {
  for (var i = 0, l = divs.length; i < l; i++) {
    if (divs[i].getAttribute('class') == 'problem')
      if (divs[i].style.display == 'none') divs[i].style.display = '';
      else divs[i].style.display = 'none';
    var x = document.getElementById("mySelect").value;
    var y = document.getElementById("item1").value;
    if (x < 1) {
      y.style.display === "none"
    } else {
      document.getElementById("demo").innerHTML = x;
    }
    var x = document.getElementById("mySelect1").value;
    document.getElementById("demo1").innerHTML = x;
    var x = document.getElementById("mySelect2").value;
    document.getElementById("demo2").innerHTML = x;
  }
}

document.getElementById('Toggle').onclick = toggle;```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="problem">
  <div class="row">
    <div class="col-3">
      <form>
        <input type="number" id="mySelect" name="mySelect" autocomplete="off" style="width: 3em;"> Sausage
        <br>
      </form>
    </div>
    <div class="col-3">
      <form>
        <input type="number" id="mySelect1" name="mySelect1" autocomplete="off" style="width: 3em;"> Pancake
        <br>
      </form>
    </div>
    <div class="col-2">
      <form>
        <input type="number" id="mySelect2" name="mySelect2" autocomplete="off" style="width: 3em;"> Milk
      </form>
    </div>
    <div class="col-4">
    </div>
  </div>

  <div class="row">
    <div class="col-12">
      <p>
        <button type="button" class="button" id="Toggle" onclick="myFunction()">Show Order</button>
      </p>
    </div>
  </div>

</div>

<div class="row">
  <div class="col-12">
    <div style="display:none;" class="problem">Please show this to the cashier.</div>

    <div style="display:none;" class="problem">
      <h2>Hello, they ordered:</h2>
    </div>
    <div id="item1" style="display:none;" class="problem">
      <h2><span style="font-size: xx-large; color: green;" id="demo"></span>x Sausage(s)</h2>
    </div>
    <div id="item2" style="display:none;" class="problem">
      <h2><span style="font-size: xx-large; color: green;" id="demo1"></span>x Pancake(s)</h2>
    </div>
    <div id="item3" style="display:none;" class="problem">
      <h2><span style="font-size: xx-large; color: green;" id="demo2"></span>x Cup of Milk(s)</h2>
    </div>
    <div style="display:none;" class="problem">
      <h2>Thank you</h2>
    </div>

    <div style="display:none;" class="problem">Please refresh your browser to restart your order</div>
  </div>
</div></code>```

I have added my full code from JSFiddle here.

答:
You can loop through all the divs with class="problem" and check their input's values. If there's nothing, then don't show it. If it isn't empty, show it.

You can achieve this with var allDivs = querySelectorAll('.problem input'); to get the inputs in the divs (since we know they have class="problem"), and then loop through that and use an if to check allDivs[i].value.

I didn't want to give the code directly, so hopefully this helps answer your question!

Title: Hiding a div if a value is under 1

Body:
I want the application to behave this way so that when I click on "Show Order" if any of the values are 0 or blank, I don't want div id item * x be shown:

var divs = document.getElementsByTagName('div');

var toggle = function() {
  for (var i = 0, l = divs.length; i < l; i++) {
    if (divs[i].getAttribute('class') == 'problem')
      if (divs[i].style.display == 'none') divs[i].style.display = '';
      else divs[i].style.display = 'none';
    var x = document.getElementById("mySelect").value;
    var y = document.getElementById("item1").value;
    if (x < 1) {
      y.style.display === "none"
    } else {
      document.getElementById("demo").innerHTML = x;
    }
    var x = document.getElementById("mySelect1").value;
    document.getElementById("demo1").innerHTML = x;
    var x = document.getElementById("mySelect2").value;
    document.getElementById("demo2").innerHTML = x;
  }
}

document.getElementById('Toggle').onclick = toggle;

      <form>
        <input type="number" id="mySelect" name="mySelect" autocomplete="off" style="width: 3em;"> Sausage

      </form>

      <form>
        <input type="number" id="mySelect1" name="mySelect1" autocomplete="off" style="width: 3em;"> Pancake

      </form>

      <form>
        <input type="number" id="mySelect2" name="mySelect2" autocomplete="off" style="width: 3em;"> Milk
      </form>

        <button type="button" class="button" id="Toggle" onclick="myFunction()">Show Order</button>

Please show this to the cashier.

Hello, they ordered:

x Sausage(s)

x Pancake(s)

x Cup of Milk(s)

Thank you

Please refresh your browser to restart your order

I have added my full code from JSFiddle here.


问:
System call open C can't print file content if the file is not opened as sudo
So I create a new file:

```<code> fd = open("tester.txt", O_CREAT | O_RDWR);
</code>```

then using the system call write I add some info to it. But when I try to read the info from the file, it can't be made. Using the terminal I found out, that the only way to open the file is to use sudo and the content is successfully written. However, my program can't be root. So, how do I open the file, write some content to it and without closing the C program output the file.

答:
whenever you are using O_CREAT flag in open() system call, you should explicitly provide the permission. man page of open() says

```<code>int open(const char *pathname, int flags, mode_t mode);
</code>```

mode specifies the permissions to use in case a new file is cre‐ated.  This argument must be supplied when O_CREAT is  specified in  flags;  if  O_CREAT  is not specified, then mode is ignored.

So modify above line as

```<code>  fd = open("tester.txt", O_CREAT | O_RDWR, 0664 );
</code>```

I hope it will clear your doubts.

Body:
So I create a new file:

 fd = open("tester.txt", O_CREAT | O_RDWR);

then using the system call write I add some info to it. But when I try to read the info from the file, it can't be made. Using the terminal I found out, that the only way to open the file is to use sudo and the content is successfully written. However, my program can't be root. So, how do I open the file, write some content to it and without closing the C program output the file.

Body:
whenever you are using O_CREAT flag in open() system call, you should explicitly provide the permission. man page of open() says

int open(const char *pathname, int flags, mode_t mode);

mode specifies the permissions to use in case a new file is cre‐ated.  This argument must be supplied when O_CREAT is  specified in  flags;  if  O_CREAT  is not specified, then mode is ignored.

So modify above line as

  fd = open("tester.txt", O_CREAT | O_RDWR, 0664 );

I hope it will clear your doubts.


问:
Converters on child bindings in a MultiBinding
Suppose I have this MultiBinding:

```<code><MultiBinding Converter="{StaticResource FooBarConverter}>
  <Binding Path="Foo" Converter="{StaticResource FooConverter}" />
  <Binding Path="Bar" Converter="{StaticResource BarConverter}" />
</MultiBinding>
</code>```

This doesn't seem to work: the values array passed to FooBarConverter contains DependencyProperty.UnsetValue for each value (two, in this case). Removing the converters on the child bindings (FooConverter and BarConverter) gives me the actual values. By the way: those converters are properly invoked, it just looks like their result is discarded.

Is this intended behavior? I want to bind 2 properties by I need to convert at least one of them before throwing them into the MultiValueConverter...

答:
If WPF was prior to 4.0 then it is a known and fixed bug that have workaround.

Here located a sample implementation of the workaround for poor man that are forced to work with elder versions.

To say shortly, old wpf versions are trying to convert values from multibinding child bindings that have converters directly into type of target dependency property. Workaround is to create hidden label, move multibinding or its child binding converter to label.content as it expects object and then bind desired property to it.

ContentLicense: CC BY-SA 2.5

Body:
Suppose I have this MultiBinding:

<MultiBinding Converter="{StaticResource FooBarConverter}>
  <Binding Path="Foo" Converter="{StaticResource FooConverter}" />
  <Binding Path="Bar" Converter="{StaticResource BarConverter}" />
</MultiBinding>

This doesn't seem to work: the values array passed to FooBarConverter contains DependencyProperty.UnsetValue for each value (two, in this case). Removing the converters on the child bindings (FooConverter and BarConverter) gives me the actual values. By the way: those converters are properly invoked, it just looks like their result is discarded.

Is this intended behavior? I want to bind 2 properties by I need to convert at least one of them before throwing them into the MultiValueConverter...


问:
Add custom content for a specific product on WooCommerce single product pages
In Woocommerce, How can I add a custom content for a specific product on single product pages?

Here is an explicit screen shot:

答: Just Edit the product to add the content. and that content will show on its detail page.</p>


问:
Is it possible to horizontally align individual characters with letter-spacing in CSS?
Given a CSS rule of letter-spacing: 16px;, I notice that the characters are left-aligned within their "box", and make the cursor jump ahead to the far right, as if I added an extra space after the character.

Is it possible to use letter-spacing, but having the characters horizontally aligned within their new extended boundaries?

答:
It's not possible. The reason is, this will act as a padding / margin but not like a position. But yeah, if you want something like that, you can use inline-flex and use order to reorder.

p {display: inline-flex;}
p span {padding: 3px;}
p span.second {order: 1;}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><p>
  <span class="first">first</span>
  <span class="second">second</span>
  <span class="third">third</span>
</p></code>```

This is just a POC. Please feel free to take it from here.

Body:
It's not possible. The reason is, this will act as a padding / margin but not like a position. But yeah, if you want something like that, you can use inline-flex and use order to reorder.

p {display: inline-flex;}
p span {padding: 3px;}
p span.second {order: 1;}

<p>
  <span class="first">first</span>
  <span class="second">second</span>
  <span class="third">third</span>
</p>

This is just a POC. Please feel free to take it from here.


问:
How can I find integers in a range which are sums of max. 4 perfect square numbers in Python?
I have this mathematical, Python problem, where I have to find all numbers in a range which are the sum of maximum 4 square numbers. I can't think about a working algorithm, with my basic knowledge. Can you help me out with the algorithm, or an idea of where to start? I'm not asking for the code. Thanks in advance!</p>

答:
Check this link out.

This wikipedia page will solve your problem!

Basically, all whole numbers can be represented as a sum of 4 perfect squares.


问:
Odoo search multiple names uses OR operator
Whenever I use search on a particular name, press enter, followed by a new name. Odoo automatically interprets this as a OR operator. When I actually want is a AND operator.

Any ideas how I can adjust this in de code (JavaScript or Python?)

Thanks

答:
See module below, this will change the default OR behavior to AND when pressing the SHIFT key

https://www.odoo.com/apps/modules/8.0/web_search_with_and/


答:
According to this Lagrange theorem, you can return the whole positive range because

every natural number can be represented as the sum of four integer
  squares.

It means that the algorithm can be written as:

```<code>def my_algorithm(integer_range):
    return [i for i in integer_range if i >= 0]
</code>```

Title: How can I find integers in a range which are sums of max. 4 perfect square numbers in Python?

Body: I have this mathematical, Python problem, where I have to find all numbers in a range which are the sum of maximum 4 square numbers. I can't think about a working algorithm, with my basic knowledge. Can you help me out with the algorithm, or an idea of where to start? I'm not asking for the code. Thanks in advance!

Body:
According to this Lagrange theorem, you can return the whole positive range because

every natural number can be represented as the sum of four integer
  squares.

It means that the algorithm can be written as:

def my_algorithm(integer_range):
    return [i for i in integer_range if i >= 0]


问:
Get the Top Four Value from data table . Then swap on condition
using this command i can get TOP four values but some of the values are duplicate . so then wanted to swap based on serial number of table . using this bellow command to get the top four values now i want to swap any logic.

```<code>INPUT
         SN Set name  columname
          1  100 Randy 25
          2  100 many  22
          3  100 sanny 22
          4  100 nanny 35
Output
        SN Set name  columname
        2  100 many  22
        3  100 sanny 22
        1  100 Randy 25
        4  100 nanny 35

select top 4 * from filename where Set=100 order by columname DESC
</code>```

Sort it based on column name then swap it based on serial number.

答:
Wrap your query returning the wanted 4 rows up in a derived table, then do the opposite ORDER BY to get the wanted order:

```<code>select *
from
(
    select top 4 * from filename where Set=100 order by columname DESC
) dt
order by columname ASC
</code>```

Body:
using this command i can get TOP four values but some of the values are duplicate . so then wanted to swap based on serial number of table . using this bellow command to get the top four values now i want to swap any logic.

INPUT
         SN Set name  columname
          1  100 Randy 25
          2  100 many  22
          3  100 sanny 22
          4  100 nanny 35
Output
        SN Set name  columname
        2  100 many  22
        3  100 sanny 22
        1  100 Randy 25
        4  100 nanny 35

select top 4 * from filename where Set=100 order by columname DESC

Sort it based on column name then swap it based on serial number.

Body:
Wrap your query returning the wanted 4 rows up in a derived table, then do the opposite ORDER BY to get the wanted order:

select *
from
(
    select top 4 * from filename where Set=100 order by columname DESC
) dt
order by columname ASC


问:
Creating two dynamoDB tables in serverless.yml
I'm try to add 2 tables to serverless.yml to link with DynamoDB.

A part of my code in serverless.yml:

```<code>...
 resources:
      Resources:
        ItemsTable:
          Type: "AWS::DynamoDB::Table"
          Properties:
            TableName: "InvoiceConfig"
            AttributeDefinitions:
            - AttributeName: "providerName"
              AttributeType: "S"
            KeySchema:
            - AttributeName: "providerName"
              KeyType: "HASH"
            ProvisionedThroughput:
              ReadCapacityUnits: 2
              WriteCapacityUnits: 2
            TableName: "DifferentTermsPages"
            AttributeDefinitions:
            - AttributeName: "id"
              AttributeType: "S"
            - AttributeName: "providerName"
              AttributeType: "S"
            - AttributeName: "productType"
              AttributeType: "S"
            - AttributeName: "language"
              AttributeType: "S"
            - AttributeName: "terms"
              AttributeType: "L"
            KeySchema:
            - AttributeName: "id"
              KeyType: "HASH"
            - AttributeName: "providerName"
              KeyType: "HASH"
            - AttributeName: "productType"
              KeyType: "HASH"
            - AttributeName: "language"
              KeyType: "HASH"
            - AttributeName: "terms"
              KeyType: "HASH"
            ProvisionedThroughput:
              ReadCapacityUnits: 10
              WriteCapacityUnits: 10
</code>```

Is that correct??

My tables are:

```<code>InvoiceConfig: with columns: providerName (String)
DifferentTermsPages: id (String), providerName (String), productType (String), language (String), terms (list)
</code>```

Do I need more changes in serverles.yml? what is the meaning of the expressions "ReadCapacityUnits" and "WriteCapacityUnits"?

答:
There should be some separation between two resources (i.e. two DynamoDB tables).

Note:-

You can define only key attributes while creating the DynamoDB table. In other words, you don't need to define all other non-key attributes.

Try this:-

```<code>Resources:
ItemsTable:
  Type: "AWS::DynamoDB::Table"
  Properties:
    TableName: "InvoiceConfig"
    AttributeDefinitions:
    - AttributeName: "providerName"
      AttributeType: "S"
    KeySchema:
    - AttributeName: "providerName"
      KeyType: "HASH"
    ProvisionedThroughput:
      ReadCapacityUnits: 2
      WriteCapacityUnits: 2
DifferentTermsPages:
  Type: "AWS::DynamoDB::Table"
  Properties:
    TableName: "DifferentTermsPages"
    AttributeDefinitions:
    - AttributeName: "id"
      AttributeType: "S"
    KeySchema:
    - AttributeName: "id"
      KeyType: "HASH"
    ProvisionedThroughput:
      ReadCapacityUnits: 10
      WriteCapacityUnits: 10
</code>```

Read and Write capacity units:-

You specify throughput capacity in terms of read capacity units and
  write capacity units:

One read capacity unit represents one strongly consistent read per
  second, or two eventually consistent reads per second, for an item up
  to 4 KB in size. If you need to read an item that is larger than 4 KB,
  DynamoDB will need to consume additional read capacity units. The
  total number of read capacity units required depends on the item size,
  and whether you want an eventually consistent or strongly consistent
  read. One write capacity unit represents one write per second for an
  item up to 1 KB in size. If you need to write an item that is larger
  than 1 KB, DynamoDB will need to consume additional write capacity
  units. The total number of write capacity units required depends on
  the item size.

Read and write capacity units

Body:
I'm try to add 2 tables to serverless.yml to link with DynamoDB.

A part of my code in serverless.yml:

...
 resources:
      Resources:
        ItemsTable:
          Type: "AWS::DynamoDB::Table"
          Properties:
            TableName: "InvoiceConfig"
            AttributeDefinitions:
            - AttributeName: "providerName"
              AttributeType: "S"
            KeySchema:
            - AttributeName: "providerName"
              KeyType: "HASH"
            ProvisionedThroughput:
              ReadCapacityUnits: 2
              WriteCapacityUnits: 2
            TableName: "DifferentTermsPages"
            AttributeDefinitions:
            - AttributeName: "id"
              AttributeType: "S"
            - AttributeName: "providerName"
              AttributeType: "S"
            - AttributeName: "productType"
              AttributeType: "S"
            - AttributeName: "language"
              AttributeType: "S"
            - AttributeName: "terms"
              AttributeType: "L"
            KeySchema:
            - AttributeName: "id"
              KeyType: "HASH"
            - AttributeName: "providerName"
              KeyType: "HASH"
            - AttributeName: "productType"
              KeyType: "HASH"
            - AttributeName: "language"
              KeyType: "HASH"
            - AttributeName: "terms"
              KeyType: "HASH"
            ProvisionedThroughput:
              ReadCapacityUnits: 10
              WriteCapacityUnits: 10

Is that correct??

My tables are:

InvoiceConfig: with columns: providerName (String)
DifferentTermsPages: id (String), providerName (String), productType (String), language (String), terms (list)

Do I need more changes in serverles.yml? what is the meaning of the expressions "ReadCapacityUnits" and "WriteCapacityUnits"?

Body:
There should be some separation between two resources (i.e. two DynamoDB tables).

Note:-

You can define only key attributes while creating the DynamoDB table. In other words, you don't need to define all other non-key attributes.

Try this:-

Resources:
ItemsTable:
  Type: "AWS::DynamoDB::Table"
  Properties:
    TableName: "InvoiceConfig"
    AttributeDefinitions:
    - AttributeName: "providerName"
      AttributeType: "S"
    KeySchema:
    - AttributeName: "providerName"
      KeyType: "HASH"
    ProvisionedThroughput:
      ReadCapacityUnits: 2
      WriteCapacityUnits: 2
DifferentTermsPages:
  Type: "AWS::DynamoDB::Table"
  Properties:
    TableName: "DifferentTermsPages"
    AttributeDefinitions:
    - AttributeName: "id"
      AttributeType: "S"
    KeySchema:
    - AttributeName: "id"
      KeyType: "HASH"
    ProvisionedThroughput:
      ReadCapacityUnits: 10
      WriteCapacityUnits: 10

Read and Write capacity units:-

You specify throughput capacity in terms of read capacity units and
  write capacity units:

One read capacity unit represents one strongly consistent read per
  second, or two eventually consistent reads per second, for an item up
  to 4 KB in size. If you need to read an item that is larger than 4 KB,
  DynamoDB will need to consume additional read capacity units. The
  total number of read capacity units required depends on the item size,
  and whether you want an eventually consistent or strongly consistent
  read. One write capacity unit represents one write per second for an
  item up to 1 KB in size. If you need to write an item that is larger
  than 1 KB, DynamoDB will need to consume additional write capacity
  units. The total number of write capacity units required depends on
  the item size.

Read and write capacity units


问:
iPad app crash on launch : Help me analyze this crash log
Some user's of our iPad application are reporting a crash on launch of the application. Though I have the same device (and the same OS version 4.2.1) I am unable to replicate the crash on my device. I managed to get this crash log from ITC but unsure if this is related to the crash on launch issue.

Please help me analyze this crash log. Thanks in advance.

```<code>Incident Identifier: 0D92B20E-8859-4DB4-9DE0-70222FACBAEB
Hardware Model: iPad1,1
Process: MyiPadApp [479]
Path: /var/mobile/Applications/3BA6269C-7616-41ED-A1BF-1D23CA81CFA1/MyiPadApp.app/MyiPadApp
Identifier: MyiPadApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2011-01-13 18:40:44.967 +0100
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x782e6d6f
Crashed Thread: 0

Thread 0 Crashed:
0 libobjc.A.dylib 0x34a80466 objc_msgSend + 18
1 UIKit 0x3424847e -[UIViewController unloadViewForced:]
2 UIKit 0x342483ca -[UIViewController unloadViewIfReloadable]
3 UIKit 0x342e1dde -[UIViewController purgeMemoryForReason:]
4 UIKit 0x342e1dfe -[UIViewController didReceiveMemoryWarning]
5 MyiPadApp 0x00002886 -[MajorIndicesController didReceiveMemoryWarning] + 22
6 UIKit 0x342e1e14 -[UIViewController _didReceiveMemoryWarning:]
7 Foundation 0x3117561c _nsnote_callback
8 CoreFoundation 0x3580111c __CFXNotificationPost_old
9 CoreFoundation 0x35800dbc _CFXNotificationPostNotification
10 Foundation 0x31164d1c -[NSNotificationCenter postNotificationName:object:userInfo:]
11 Foundation 0x3116e23a -[NSNotificationCenter postNotificationName:object:]
12 UIKit 0x342aada2 -[UIApplication _performMemoryWarning]
13 UIKit 0x342ab9c4 -[UIApplication _receivedMemoryNotification]
14 UIKit 0x342a8770 _memoryStatusChanged
15 CoreFoundation 0x358310c6 __CFNotificationCenterDarwinCallBack
16 CoreFoundation 0x35817be0 __CFMachPortPerform
17 CoreFoundation 0x3580f6f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
18 CoreFoundation 0x3580f6bc __CFRunLoopDoSource1
19 CoreFoundation 0x35801f76 __CFRunLoopRun
20 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
21 CoreFoundation 0x35801b88 CFRunLoopRunInMode
22 GraphicsServices 0x320c84a4 GSEventRunModal
23 GraphicsServices 0x320c8550 GSEventRun
24 UIKit 0x341dc322 -[UIApplication _run]
25 UIKit 0x341d9e8c UIApplicationMain
26 MyiPadApp 0x0000218a main + 42
27 MyiPadApp 0x00002154 start + 32

Thread 1:
0 libSystem.B.dylib 0x30d30974 kevent + 24
1 libSystem.B.dylib 0x30dda704 _dispatch_mgr_invoke
2 libSystem.B.dylib 0x30dda174 _dispatch_queue_invoke
3 libSystem.B.dylib 0x30dd9b98 _dispatch_worker_thread2
4 libSystem.B.dylib 0x30d7e24a _pthread_wqthread
5 libSystem.B.dylib 0x30d76970 start_wqthread + 0

Thread 2:
0 libSystem.B.dylib 0x30d04268 mach_msg_trap + 20
1 libSystem.B.dylib 0x30d06354 mach_msg
2 CoreFoundation 0x35802648 __CFRunLoopServiceMachPort
3 CoreFoundation 0x35801ed2 __CFRunLoopRun
4 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
5 CoreFoundation 0x35801b88 CFRunLoopRunInMode
6 WebCore 0x34bf6124 RunWebThread
7 libSystem.B.dylib 0x30d7d886 _pthread_start
8 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 3:
0 libSystem.B.dylib 0x30d04268 mach_msg_trap + 20
1 libSystem.B.dylib 0x30d06354 mach_msg
2 CoreFoundation 0x35802648 __CFRunLoopServiceMachPort
3 CoreFoundation 0x35801ed2 __CFRunLoopRun
4 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
5 CoreFoundation 0x35811efe CFRunLoopRun
6 MyiPadApp 0x00017c84 +[ASIHTTPRequest runRequests] + 120
7 Foundation 0x3116c192 -[NSThread main]
8 Foundation 0x31165242 __NSThread__main__
9 libSystem.B.dylib 0x30d7d886 _pthread_start
10 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 4:
0 libSystem.B.dylib 0x30d04268 mach_msg_trap + 20
1 libSystem.B.dylib 0x30d06354 mach_msg
2 CoreFoundation 0x35802648 __CFRunLoopServiceMachPort
3 CoreFoundation 0x35801ed2 __CFRunLoopRun
4 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
5 CoreFoundation 0x35801b88 CFRunLoopRunInMode
6 Foundation 0x3118e5f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
7 Foundation 0x3116c192 -[NSThread main]
8 Foundation 0x31165242 __NSThread__main__
9 libSystem.B.dylib 0x30d7d886 _pthread_start
10 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 5:
0 libSystem.B.dylib 0x30d2868c select$DARWIN_EXTSN + 20
1 CoreFoundation 0x35839662 __CFSocketManager
2 libSystem.B.dylib 0x30d7d886 _pthread_start
3 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 6:
0 libSystem.B.dylib 0x30d7e9e0 __workq_kernreturn + 8
1 libSystem.B.dylib 0x30d7e364 _pthread_wqthread
2 libSystem.B.dylib 0x30d76970 start_wqthread + 0

Thread 7:
0 libSystem.B.dylib 0x30d7e9e0 __workq_kernreturn + 8
1 libSystem.B.dylib 0x30d7e364 _pthread_wqthread
2 libSystem.B.dylib 0x30d76970 start_wqthread + 0

Thread 0 crashed with ARM Thread State:
r0: 0x00198930 r1: 0x344b6ce1 r2: 0x001bec59 r3: 0x000000a0
r4: 0x0019a3f2 r5: 0x782e6d6f r6: 0x344bec7c r7: 0x2fdfea54
r8: 0x00000000 r9: 0x001fc098 r10: 0x00000003 r11: 0x00000029
ip: 0x3e3cf960 sp: 0x2fdfea3c lr: 0x00002999 pc: 0x34a80466
cpsr: 0x200f0030

Binary Images:
0x1000 - 0x36fff +MyiPadApp armv7 <ddf465b3fdd191b2fcb6cfb0e5be2d68> /var/mobile/Applications/3BA6269C-7616-41ED-A1BF-1D23CA81CFA1/MyiPadApp.app/MyiPadApp
0xf6000 - 0xf7fff dns.so armv7 <fcefecb2d5e095ba88127eec3af57ec0> /usr/lib/info/dns.so
0x2fe00000 - 0x2fe27fff dyld armv7 <06e6959cebb4a72e66c833e26ae64d26> /usr/lib/dyld
0x3001f000 - 0x30026fff libbz2.1.0.dylib armv7 <2989ea7a5cad2cfe91bd632b041d0ff4> /usr/lib/libbz2.1.0.dylib
0x30054000 - 0x3016afff libicucore.A.dylib armv7 <e7fbb2ac586567e574dc33d7bb5c4dc9> /usr/lib/libicucore.A.dylib
0x302b7000 - 0x30366fff WebKit armv7 <644a1c6120578f896bed7121307aa2af> /System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x303fc000 - 0x3051cfff CoreGraphics armv7 <2d7b40a7baca915ce78b1dd9a0d6433b> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x3056b000 - 0x3056bfff vecLib armv7 <e53d234e808c77d286161095f92c58cf> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x30641000 - 0x30700fff CFNetwork armv7 <02fe0e30e54fffdcbbbd02e8cb812c3a> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x3076f000 - 0x307c4fff libvDSP.dylib armv7 <9365fc6cae1bff737257e74faf3b1f26> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x307e6000 - 0x307e8fff libgcc_s.1.dylib armv7 <e66758bcda6da5d7f9b54fa5c4de6da2> /usr/lib/libgcc_s.1.dylib
0x30821000 - 0x30853fff AppSupport armv7 <47c8055ac99f187174ca373b702ffa68> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x30854000 - 0x30854fff Accelerate armv7 <29dd5f17440bbb6e8e42e11b6fceda9a> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x3091c000 - 0x30931fff libresolv.9.dylib armv7 <ea156820997ae9a2baf664d0f79f18d7> /usr/lib/libresolv.9.dylib
0x30b44000 - 0x30b46fff IOMobileFramebuffer armv7 <1040629f37795146c9dcac8ab1a868fc> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer
0x30c45000 - 0x30c74fff SystemConfiguration armv7 <3f982c11b5526fc39a92d585c60d8a90> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x30d03000 - 0x30e14fff libSystem.B.dylib armv7 <138a43ab528bb428651e6aa7a2a7293c> /usr/lib/libSystem.B.dylib
0x30e37000 - 0x30f1ffff libGLProgrammability.dylib armv7 <1f478a71783cd7eb4ae9ef6f2dcea803> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x30f20000 - 0x30f2bfff libz.1.dylib armv7 <fabaddbcbc8c02bab0261df9d78e0e25> /usr/lib/libz.1.dylib
0x31066000 - 0x31114fff QuartzCore armv7 <83a8e5f0033369e437069c1e758fed83> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x31161000 - 0x31280fff Foundation armv7 <81d36041f04318cb51db5aafed9ce504> /System/Library/Frameworks/Foundation.framework/Foundation
0x31307000 - 0x31347fff CoreAudio armv7 <f32e03ee4c68f0db23f05afc9a3cc94c> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x318b5000 - 0x318d5fff PrintKit armv7 <02a9c6f4173a0673c4637a3b570345cd> /System/Library/PrivateFrameworks/PrintKit.framework/PrintKit
0x31bd9000 - 0x31c02fff MobileCoreServices armv7 <54484a513761868149405df7fc29b5c0> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x31c6d000 - 0x31d16fff libxml2.2.dylib armv7 <b3d82f80a777cb1434052ea2d232e3df> /usr/lib/libxml2.2.dylib
0x31d29000 - 0x31d2cfff IOSurface armv7 <deff02882166bf16d0765d68f0542cc8> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
0x31d2d000 - 0x31d2ffff MobileInstallation armv7 <8e6b0d9f642be06729ffdaaee97053b0> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
0x31d46000 - 0x31d4dfff AggregateDictionary armv7 <71372c95d4af7af787d0682a939e40ac> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
0x31e09000 - 0x31e4bfff CoreTelephony armv7 <96d3af505b9f2887e62c7e99c157733e> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x31e4c000 - 0x31f6cfff libmecabra.dylib armv7 <b2293b8acb00a14bace7520a63f39439> /usr/lib/libmecabra.dylib
0x320c4000 - 0x320d0fff GraphicsServices armv7 <0099670dccd99466653956bf918d667a> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x32100000 - 0x33a79fff TextInput armv7 <557601a7d93124fd5860606f294e900a> /System/Library/PrivateFrameworks/TextInput.framework/TextInput
0x33ae9000 - 0x33aebfff libAccessibility.dylib armv7 <3f0b58ea13d30f0cdb73f6ffe6d4e75c> /usr/lib/libAccessibility.dylib
0x33b49000 - 0x33c82fff AudioToolbox armv7 <657b327f2ceee9f22f9474f2f9bddbe6> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x33d2c000 - 0x33d2ffff libGFXShared.dylib armv7 <3a385ed495379116abbe50bc8cd5a612> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x33d30000 - 0x33d31fff CoreSurface armv7 <f7caaf43609cfe0e475dfe83790edb4d> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x33d61000 - 0x33d7afff libRIP.A.dylib armv7 <ee16b5cee12a8947c8e511ed51ae7fef> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x340dc000 - 0x34112fff CoreText armv7 <b9b5c21b2d2a28abc47842c78c026ddf> /System/Library/Frameworks/CoreText.framework/CoreText
0x3415c000 - 0x3418ffff AddressBook armv7 <7c87e0175c8649d6832419da8a1cfac1> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x341a5000 - 0x34526fff UIKit armv7 <de1cbd3219a74e4d41b30428f428e223> /System/Library/Frameworks/UIKit.framework/UIKit
0x34527000 - 0x345bafff ImageIO armv7 <5b5a294d4250eff866fdbf891b1e8b34> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x34632000 - 0x34636fff AssetsLibraryServices armv7 <e861a330d14702f148ca5133dcbe954c> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x34775000 - 0x34822fff JavaScriptCore armv7 <3f2df600942dc72aad312b3cc98ec479> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x34852000 - 0x3485bfff CoreVideo armv7 <2092d5deb6b234e04678b7c1878ccd81> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x3492e000 - 0x3493afff SpringBoardServices armv7 <137b75e19b2450c234dec88d538798ff> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x3493d000 - 0x34987fff libstdc++.6.dylib armv7 <53a6e7239c3908fa8c2915b65ff3b056> /usr/lib/libstdc++.6.dylib
0x34a7d000 - 0x34b3efff libobjc.A.dylib armv7 <aaf5671a35f9ac20d5846703dafaf4c6> /usr/lib/libobjc.A.dylib
0x34b3f000 - 0x35127fff WebCore armv7 <d6bd9cf88ee82ab6b0e33e0ae1190772> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x3520f000 - 0x352fcfff libiconv.2.dylib armv7 <c72b45f471df092dbd849081f7a3ef53> /usr/lib/libiconv.2.dylib
0x353e7000 - 0x353ecfff MobileKeyBag armv7 <cec3f3271fc267c32c169ed03e312d63> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
0x3549d000 - 0x354d5fff libCGFreetype.A.dylib armv7 <374bd566263e8929c10d50d6a6a48a46> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x35553000 - 0x35560fff OpenGLES armv7 <a12565ffb5bb42e3019f1957cd4951d0> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x355b6000 - 0x355bcfff liblockdown.dylib armv7 <5bbd9b3f5cfece328f80c403a8805ce9> /usr/lib/liblockdown.dylib
0x356d2000 - 0x357d9fff CoreData armv7 <29b1ab7d339e42a6ff6923e54cf43e7b> /System/Library/Frameworks/CoreData.framework/CoreData
0x357da000 - 0x358c0fff CoreFoundation armv7 <01441e01f5141a50ee723362e59ca400> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x35992000 - 0x3599ffff libbsm.0.dylib armv7 <0f4e595e6eb2170aceb729f32b5de8c2> /usr/lib/libbsm.0.dylib
0x35b60000 - 0x35babfff libBLAS.dylib armv7 <251c5ac7380802a16e30d827c027c637> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x35bac000 - 0x35e46fff libLAPACK.dylib armv7 <2e77d87e96af938aacf0a6008e6fb89d> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x3601b000 - 0x3603afff Bom armv7 <0f5fd6057bad5e1677869500d636821f> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x3603d000 - 0x360acfff ProofReader armv7 <d2e62a8ab7e1460c7f6de8913c703e6d> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x3612f000 - 0x36137fff libkxld.dylib armv7 <854e82fe66feef01e54c7c8a209851ac> /usr/lib/system/libkxld.dylib
0x36138000 - 0x3616ffff Security armv7 <cd28e102950634ae7167ddee9c686d36> /System/Library/Frameworks/Security.framework/Security
0x36170000 - 0x361bdfff libsqlite3.dylib armv7 <55038e5c1d4d0dbdd94295e8cad7a9a4> /usr/lib/libsqlite3.dylib
0x361be000 - 0x361f8fff IOKit armv7 <eb932cc42d60e55d9a4d0691bcc3d9ad> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x3623f000 - 0x3627efff libGLImage.dylib armv7 <a7c117c92607a512823d307b8fdd0151> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
</code>```

答:
Looks like your app is receiving a memory warning as soon as it starts up.  When you receive a memory warning, you're suppose to unload as much stuff from memory as you can, e.g. stuff you can reload from elsewhere (database, storage, etc).

Does your app pre-load a bunch of stuff when it starts up?

Also, you could have a memory leak which is only present under certain circumstances (e.g. the user has loaded the app before, done something and then that kicks off something when it starts up in the future).  You could ask your users if they ever managed to load the app at all.

Have you tried running the static analyser on your code? (CMD-Shift-A)

And have you tried running your app under Instruments to watch for memory leaks?

Body:
Some user's of our iPad application are reporting a crash on launch of the application. Though I have the same device (and the same OS version 4.2.1) I am unable to replicate the crash on my device. I managed to get this crash log from ITC but unsure if this is related to the crash on launch issue.

Please help me analyze this crash log. Thanks in advance.

Incident Identifier: 0D92B20E-8859-4DB4-9DE0-70222FACBAEB
Hardware Model: iPad1,1
Process: MyiPadApp [479]
Path: /var/mobile/Applications/3BA6269C-7616-41ED-A1BF-1D23CA81CFA1/MyiPadApp.app/MyiPadApp
Identifier: MyiPadApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2011-01-13 18:40:44.967 +0100
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x782e6d6f
Crashed Thread: 0

Thread 0 Crashed:
0 libobjc.A.dylib 0x34a80466 objc_msgSend + 18
1 UIKit 0x3424847e -[UIViewController unloadViewForced:]
2 UIKit 0x342483ca -[UIViewController unloadViewIfReloadable]
3 UIKit 0x342e1dde -[UIViewController purgeMemoryForReason:]
4 UIKit 0x342e1dfe -[UIViewController didReceiveMemoryWarning]
5 MyiPadApp 0x00002886 -[MajorIndicesController didReceiveMemoryWarning] + 22
6 UIKit 0x342e1e14 -[UIViewController _didReceiveMemoryWarning:]
7 Foundation 0x3117561c _nsnote_callback
8 CoreFoundation 0x3580111c __CFXNotificationPost_old
9 CoreFoundation 0x35800dbc _CFXNotificationPostNotification
10 Foundation 0x31164d1c -[NSNotificationCenter postNotificationName:object:userInfo:]
11 Foundation 0x3116e23a -[NSNotificationCenter postNotificationName:object:]
12 UIKit 0x342aada2 -[UIApplication _performMemoryWarning]
13 UIKit 0x342ab9c4 -[UIApplication _receivedMemoryNotification]
14 UIKit 0x342a8770 _memoryStatusChanged
15 CoreFoundation 0x358310c6 __CFNotificationCenterDarwinCallBack
16 CoreFoundation 0x35817be0 __CFMachPortPerform
17 CoreFoundation 0x3580f6f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
18 CoreFoundation 0x3580f6bc __CFRunLoopDoSource1
19 CoreFoundation 0x35801f76 __CFRunLoopRun
20 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
21 CoreFoundation 0x35801b88 CFRunLoopRunInMode
22 GraphicsServices 0x320c84a4 GSEventRunModal
23 GraphicsServices 0x320c8550 GSEventRun
24 UIKit 0x341dc322 -[UIApplication _run]
25 UIKit 0x341d9e8c UIApplicationMain
26 MyiPadApp 0x0000218a main + 42
27 MyiPadApp 0x00002154 start + 32

Thread 1:
0 libSystem.B.dylib 0x30d30974 kevent + 24
1 libSystem.B.dylib 0x30dda704 _dispatch_mgr_invoke
2 libSystem.B.dylib 0x30dda174 _dispatch_queue_invoke
3 libSystem.B.dylib 0x30dd9b98 _dispatch_worker_thread2
4 libSystem.B.dylib 0x30d7e24a _pthread_wqthread
5 libSystem.B.dylib 0x30d76970 start_wqthread + 0

Thread 2:
0 libSystem.B.dylib 0x30d04268 mach_msg_trap + 20
1 libSystem.B.dylib 0x30d06354 mach_msg
2 CoreFoundation 0x35802648 __CFRunLoopServiceMachPort
3 CoreFoundation 0x35801ed2 __CFRunLoopRun
4 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
5 CoreFoundation 0x35801b88 CFRunLoopRunInMode
6 WebCore 0x34bf6124 RunWebThread
7 libSystem.B.dylib 0x30d7d886 _pthread_start
8 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 3:
0 libSystem.B.dylib 0x30d04268 mach_msg_trap + 20
1 libSystem.B.dylib 0x30d06354 mach_msg
2 CoreFoundation 0x35802648 __CFRunLoopServiceMachPort
3 CoreFoundation 0x35801ed2 __CFRunLoopRun
4 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
5 CoreFoundation 0x35811efe CFRunLoopRun
6 MyiPadApp 0x00017c84 +[ASIHTTPRequest runRequests] + 120
7 Foundation 0x3116c192 -[NSThread main]
8 Foundation 0x31165242 __NSThread__main__
9 libSystem.B.dylib 0x30d7d886 _pthread_start
10 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 4:
0 libSystem.B.dylib 0x30d04268 mach_msg_trap + 20
1 libSystem.B.dylib 0x30d06354 mach_msg
2 CoreFoundation 0x35802648 __CFRunLoopServiceMachPort
3 CoreFoundation 0x35801ed2 __CFRunLoopRun
4 CoreFoundation 0x35801c80 CFRunLoopRunSpecific
5 CoreFoundation 0x35801b88 CFRunLoopRunInMode
6 Foundation 0x3118e5f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
7 Foundation 0x3116c192 -[NSThread main]
8 Foundation 0x31165242 __NSThread__main__
9 libSystem.B.dylib 0x30d7d886 _pthread_start
10 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 5:
0 libSystem.B.dylib 0x30d2868c select$DARWIN_EXTSN + 20
1 CoreFoundation 0x35839662 __CFSocketManager
2 libSystem.B.dylib 0x30d7d886 _pthread_start
3 libSystem.B.dylib 0x30d72a88 thread_start + 0

Thread 6:
0 libSystem.B.dylib 0x30d7e9e0 __workq_kernreturn + 8
1 libSystem.B.dylib 0x30d7e364 _pthread_wqthread
2 libSystem.B.dylib 0x30d76970 start_wqthread + 0

Thread 7:
0 libSystem.B.dylib 0x30d7e9e0 __workq_kernreturn + 8
1 libSystem.B.dylib 0x30d7e364 _pthread_wqthread
2 libSystem.B.dylib 0x30d76970 start_wqthread + 0

Thread 0 crashed with ARM Thread State:
r0: 0x00198930 r1: 0x344b6ce1 r2: 0x001bec59 r3: 0x000000a0
r4: 0x0019a3f2 r5: 0x782e6d6f r6: 0x344bec7c r7: 0x2fdfea54
r8: 0x00000000 r9: 0x001fc098 r10: 0x00000003 r11: 0x00000029
ip: 0x3e3cf960 sp: 0x2fdfea3c lr: 0x00002999 pc: 0x34a80466
cpsr: 0x200f0030

Binary Images:
0x1000 - 0x36fff +MyiPadApp armv7 <ddf465b3fdd191b2fcb6cfb0e5be2d68> /var/mobile/Applications/3BA6269C-7616-41ED-A1BF-1D23CA81CFA1/MyiPadApp.app/MyiPadApp
0xf6000 - 0xf7fff dns.so armv7 <fcefecb2d5e095ba88127eec3af57ec0> /usr/lib/info/dns.so
0x2fe00000 - 0x2fe27fff dyld armv7 <06e6959cebb4a72e66c833e26ae64d26> /usr/lib/dyld
0x3001f000 - 0x30026fff libbz2.1.0.dylib armv7 <2989ea7a5cad2cfe91bd632b041d0ff4> /usr/lib/libbz2.1.0.dylib
0x30054000 - 0x3016afff libicucore.A.dylib armv7 <e7fbb2ac586567e574dc33d7bb5c4dc9> /usr/lib/libicucore.A.dylib
0x302b7000 - 0x30366fff WebKit armv7 <644a1c6120578f896bed7121307aa2af> /System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x303fc000 - 0x3051cfff CoreGraphics armv7 <2d7b40a7baca915ce78b1dd9a0d6433b> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x3056b000 - 0x3056bfff vecLib armv7 <e53d234e808c77d286161095f92c58cf> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x30641000 - 0x30700fff CFNetwork armv7 <02fe0e30e54fffdcbbbd02e8cb812c3a> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x3076f000 - 0x307c4fff libvDSP.dylib armv7 <9365fc6cae1bff737257e74faf3b1f26> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x307e6000 - 0x307e8fff libgcc_s.1.dylib armv7 <e66758bcda6da5d7f9b54fa5c4de6da2> /usr/lib/libgcc_s.1.dylib
0x30821000 - 0x30853fff AppSupport armv7 <47c8055ac99f187174ca373b702ffa68> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x30854000 - 0x30854fff Accelerate armv7 <29dd5f17440bbb6e8e42e11b6fceda9a> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x3091c000 - 0x30931fff libresolv.9.dylib armv7 <ea156820997ae9a2baf664d0f79f18d7> /usr/lib/libresolv.9.dylib
0x30b44000 - 0x30b46fff IOMobileFramebuffer armv7 <1040629f37795146c9dcac8ab1a868fc> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer
0x30c45000 - 0x30c74fff SystemConfiguration armv7 <3f982c11b5526fc39a92d585c60d8a90> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x30d03000 - 0x30e14fff libSystem.B.dylib armv7 <138a43ab528bb428651e6aa7a2a7293c> /usr/lib/libSystem.B.dylib
0x30e37000 - 0x30f1ffff libGLProgrammability.dylib armv7 <1f478a71783cd7eb4ae9ef6f2dcea803> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x30f20000 - 0x30f2bfff libz.1.dylib armv7 <fabaddbcbc8c02bab0261df9d78e0e25> /usr/lib/libz.1.dylib
0x31066000 - 0x31114fff QuartzCore armv7 <83a8e5f0033369e437069c1e758fed83> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x31161000 - 0x31280fff Foundation armv7 <81d36041f04318cb51db5aafed9ce504> /System/Library/Frameworks/Foundation.framework/Foundation
0x31307000 - 0x31347fff CoreAudio armv7 <f32e03ee4c68f0db23f05afc9a3cc94c> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x318b5000 - 0x318d5fff PrintKit armv7 <02a9c6f4173a0673c4637a3b570345cd> /System/Library/PrivateFrameworks/PrintKit.framework/PrintKit
0x31bd9000 - 0x31c02fff MobileCoreServices armv7 <54484a513761868149405df7fc29b5c0> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x31c6d000 - 0x31d16fff libxml2.2.dylib armv7 <b3d82f80a777cb1434052ea2d232e3df> /usr/lib/libxml2.2.dylib
0x31d29000 - 0x31d2cfff IOSurface armv7 <deff02882166bf16d0765d68f0542cc8> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
0x31d2d000 - 0x31d2ffff MobileInstallation armv7 <8e6b0d9f642be06729ffdaaee97053b0> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
0x31d46000 - 0x31d4dfff AggregateDictionary armv7 <71372c95d4af7af787d0682a939e40ac> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
0x31e09000 - 0x31e4bfff CoreTelephony armv7 <96d3af505b9f2887e62c7e99c157733e> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x31e4c000 - 0x31f6cfff libmecabra.dylib armv7 <b2293b8acb00a14bace7520a63f39439> /usr/lib/libmecabra.dylib
0x320c4000 - 0x320d0fff GraphicsServices armv7 <0099670dccd99466653956bf918d667a> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x32100000 - 0x33a79fff TextInput armv7 <557601a7d93124fd5860606f294e900a> /System/Library/PrivateFrameworks/TextInput.framework/TextInput
0x33ae9000 - 0x33aebfff libAccessibility.dylib armv7 <3f0b58ea13d30f0cdb73f6ffe6d4e75c> /usr/lib/libAccessibility.dylib
0x33b49000 - 0x33c82fff AudioToolbox armv7 <657b327f2ceee9f22f9474f2f9bddbe6> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x33d2c000 - 0x33d2ffff libGFXShared.dylib armv7 <3a385ed495379116abbe50bc8cd5a612> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x33d30000 - 0x33d31fff CoreSurface armv7 <f7caaf43609cfe0e475dfe83790edb4d> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x33d61000 - 0x33d7afff libRIP.A.dylib armv7 <ee16b5cee12a8947c8e511ed51ae7fef> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x340dc000 - 0x34112fff CoreText armv7 <b9b5c21b2d2a28abc47842c78c026ddf> /System/Library/Frameworks/CoreText.framework/CoreText
0x3415c000 - 0x3418ffff AddressBook armv7 <7c87e0175c8649d6832419da8a1cfac1> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x341a5000 - 0x34526fff UIKit armv7 <de1cbd3219a74e4d41b30428f428e223> /System/Library/Frameworks/UIKit.framework/UIKit
0x34527000 - 0x345bafff ImageIO armv7 <5b5a294d4250eff866fdbf891b1e8b34> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x34632000 - 0x34636fff AssetsLibraryServices armv7 <e861a330d14702f148ca5133dcbe954c> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x34775000 - 0x34822fff JavaScriptCore armv7 <3f2df600942dc72aad312b3cc98ec479> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x34852000 - 0x3485bfff CoreVideo armv7 <2092d5deb6b234e04678b7c1878ccd81> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x3492e000 - 0x3493afff SpringBoardServices armv7 <137b75e19b2450c234dec88d538798ff> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x3493d000 - 0x34987fff libstdc++.6.dylib armv7 <53a6e7239c3908fa8c2915b65ff3b056> /usr/lib/libstdc++.6.dylib
0x34a7d000 - 0x34b3efff libobjc.A.dylib armv7 <aaf5671a35f9ac20d5846703dafaf4c6> /usr/lib/libobjc.A.dylib
0x34b3f000 - 0x35127fff WebCore armv7 <d6bd9cf88ee82ab6b0e33e0ae1190772> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x3520f000 - 0x352fcfff libiconv.2.dylib armv7 <c72b45f471df092dbd849081f7a3ef53> /usr/lib/libiconv.2.dylib
0x353e7000 - 0x353ecfff MobileKeyBag armv7 <cec3f3271fc267c32c169ed03e312d63> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
0x3549d000 - 0x354d5fff libCGFreetype.A.dylib armv7 <374bd566263e8929c10d50d6a6a48a46> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x35553000 - 0x35560fff OpenGLES armv7 <a12565ffb5bb42e3019f1957cd4951d0> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x355b6000 - 0x355bcfff liblockdown.dylib armv7 <5bbd9b3f5cfece328f80c403a8805ce9> /usr/lib/liblockdown.dylib
0x356d2000 - 0x357d9fff CoreData armv7 <29b1ab7d339e42a6ff6923e54cf43e7b> /System/Library/Frameworks/CoreData.framework/CoreData
0x357da000 - 0x358c0fff CoreFoundation armv7 <01441e01f5141a50ee723362e59ca400> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x35992000 - 0x3599ffff libbsm.0.dylib armv7 <0f4e595e6eb2170aceb729f32b5de8c2> /usr/lib/libbsm.0.dylib
0x35b60000 - 0x35babfff libBLAS.dylib armv7 <251c5ac7380802a16e30d827c027c637> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x35bac000 - 0x35e46fff libLAPACK.dylib armv7 <2e77d87e96af938aacf0a6008e6fb89d> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x3601b000 - 0x3603afff Bom armv7 <0f5fd6057bad5e1677869500d636821f> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x3603d000 - 0x360acfff ProofReader armv7 <d2e62a8ab7e1460c7f6de8913c703e6d> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x3612f000 - 0x36137fff libkxld.dylib armv7 <854e82fe66feef01e54c7c8a209851ac> /usr/lib/system/libkxld.dylib
0x36138000 - 0x3616ffff Security armv7 <cd28e102950634ae7167ddee9c686d36> /System/Library/Frameworks/Security.framework/Security
0x36170000 - 0x361bdfff libsqlite3.dylib armv7 <55038e5c1d4d0dbdd94295e8cad7a9a4> /usr/lib/libsqlite3.dylib
0x361be000 - 0x361f8fff IOKit armv7 <eb932cc42d60e55d9a4d0691bcc3d9ad> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x3623f000 - 0x3627efff libGLImage.dylib armv7 <a7c117c92607a512823d307b8fdd0151> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib


问:
Amazon C# request.FeedContent.Position = 0 error "Cannot Access a Closed File"
I am trying to get the SubmitFeed working using the C# dll and a flatfile (not xml).  The language is C/AL for a Microsoft ERP system called Dynamics NAV.  Here is my code:

```<code>config := config.MarketplaceWebServiceConfig();

config.ServiceURL := 'https://mws.amazonservices.com';

service := service.MarketplaceWebServiceClient(MyAccessKey,MySecretKey,'NAV','1.0',config);

request := request.SubmitFeedRequest();

request.Merchant := 'mymerchant';

request.Marketplace := 'MyMarketPlaceID';

request.FeedContent := SystemIOFile.Open('C:\Test\Jason.txt',FileMode.Open,FileAccess.Read);

request.ContentMD5 := service.CalculateContentMD5(request.FeedContent);

request.FeedContent.Position := 0;

request.FeedType := '_POST_INVENTORY_AVAILABILITY_DATA_';

response := service.SubmitFeed(request);
</code>```

The request.FeedContentPosition := 0 line is where the error is that says "Cannot Access a Closed File"

I have submissioncount and submissionresult totally working, I just can't get submitfeed to work.

I have followed other C# examples and they seem to be the same, anyone have thoughts?

答:
Figured this out.  This line is what closes the file:

```<code>request.ContentMD5 := service.CalculateContentMD5(request.FeedContent);
</code>```

I believe this is a bug in C/AL (NAV) as I can write similar code in c# and it
totally works.

My work around is to create a 2nd instance of the request and just grab the MD5 value from the first request.  Something like this works:

```<code>request := request.SubmitFeedRequest();
request.Merchant := "Merchant No.";
request.FeedContent := SystemIOFIle.Open('C:\Test\Jason.txt',FileMode.Open,FileAccess.Read);
MD5Value := WSClient.CalculateContentMD5(request.FeedContent);
CLEAR(SystemIOFIle);
CLEAR(request);
request2 := request2.SubmitFeedRequest();
request2.Merchant := "Merchant No.";
request2.FeedContent := SystemIOFIle.Open('C:\Test\Jason.txt',FileMode.Open,FileAccess.Read);

request2.ContentMD5 := MD5Value;
request2.FeedContent.Position := 0;
request2.FeedType := '_POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA_';
response := service.SubmitFeed(request2);
</code>```

Body:
I am trying to get the SubmitFeed working using the C# dll and a flatfile (not xml).  The language is C/AL for a Microsoft ERP system called Dynamics NAV.  Here is my code:

config := config.MarketplaceWebServiceConfig();

config.ServiceURL := 'https://mws.amazonservices.com';

service := service.MarketplaceWebServiceClient(MyAccessKey,MySecretKey,'NAV','1.0',config);

request := request.SubmitFeedRequest();

request.Merchant := 'mymerchant';

request.Marketplace := 'MyMarketPlaceID';

request.FeedContent := SystemIOFile.Open('C:\Test\Jason.txt',FileMode.Open,FileAccess.Read);

request.ContentMD5 := service.CalculateContentMD5(request.FeedContent);

request.FeedContent.Position := 0;

request.FeedType := '_POST_INVENTORY_AVAILABILITY_DATA_';

response := service.SubmitFeed(request);

The request.FeedContentPosition := 0 line is where the error is that says "Cannot Access a Closed File"

I have submissioncount and submissionresult totally working, I just can't get submitfeed to work.

I have followed other C# examples and they seem to be the same, anyone have thoughts?

Body:
Figured this out.  This line is what closes the file:

request.ContentMD5 := service.CalculateContentMD5(request.FeedContent);

I believe this is a bug in C/AL (NAV) as I can write similar code in c# and it
totally works.

My work around is to create a 2nd instance of the request and just grab the MD5 value from the first request.  Something like this works:

request := request.SubmitFeedRequest();
request.Merchant := "Merchant No.";
request.FeedContent := SystemIOFIle.Open('C:\Test\Jason.txt',FileMode.Open,FileAccess.Read);
MD5Value := WSClient.CalculateContentMD5(request.FeedContent);
CLEAR(SystemIOFIle);
CLEAR(request);
request2 := request2.SubmitFeedRequest();
request2.Merchant := "Merchant No.";
request2.FeedContent := SystemIOFIle.Open('C:\Test\Jason.txt',FileMode.Open,FileAccess.Read);

request2.ContentMD5 := MD5Value;
request2.FeedContent.Position := 0;
request2.FeedType := '_POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA_';
response := service.SubmitFeed(request2);


问:
V7 Preference Custom layout with dynamic height?
I'm working on create a few custom preferences for a settings screen i'm building.  The Layout's are fairly straight forward, two text views and an image view.  I want the textviews to wrap and the preference view to grow based on the contents inside. Ignore the constraints for now I want this set up with a constraint layout but originally I thought I might have been doing something wrong there so went to a basic relative layout while I troubleshoot.

I've set up a couple different basic layouts but it seems like there might be a max height that can't easily be overridden?

```<code><RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
    android:id="@+id/motivatingTitleTextView"
    android:layout_width="wrap_content"
    app:layout_constraintWidth_default="wrap"
    android:layout_height="wrap_content"
    android:text="@string/add_motivating_photo_title"
    android:layout_marginTop="10dp"
    android:layout_marginBottom="10dp"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"/>

<TextView
    android:id="@+id/motivatingMessageTextView"
    android:layout_below="@id/motivatingTitleTextView"
    android:layout_marginBottom="10dp"
    android:layout_width="wrap_content"
    app:layout_constraintWidth_default="wrap"
    android:layout_height="wrap_content"
    android:text="@string/add_motivating_photo_message"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@id/motivatingTitleTextView"
    app:layout_constraintBottom_toBottomOf="parent"/>
 </RelativeLayout>
</code>```

Here is the settings xml

```<code><android.support.v7.preference.PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">

<android.support.v7.preference.PreferenceCategory
    android:title="Notifications and Access">

    <android.support.v7.preference.SwitchPreferenceCompat
        android:key="allowPushNotifications"
        android:title="Notifications"
        android:defaultValue="true" />
</android.support.v7.preference.PreferenceCategory>

<android.support.v7.preference.PreferenceCategory
    android:title="Personalization">

    <com.company.Settings.AddMotivatingPhotoPreference/>
</android.support.v7.preference.PreferenceCategory>
</code>```

Finally The Preference Fragment
public class SettingsFragment extends PreferenceFragmentCompat
{

```<code>public SettingsFragment()
{
    // Required empty public constructor
}

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
{
    addPreferencesFromResource(R.xml.settings);
}
}
</code>```

EDIT:

So I found out if I use a layout tag inside a default Preference object it lays out correctly.  I can make this work, but I would prefer to be able to create my own custom classes so that I can separate additional logic into them.  Has anyone done that before or have an example?  I feel like I must just be missing something simple...

```<code><android.support.v7.preference.Preference
        android:layout="@layout/preference_add_motivating_photo"/>
</code>```

答: Not sure why I didn't think of this at the time but the answer is to create a custom preference like above and then use the layout property in the xml for my layout.  Simple enough.</p>

Body:
I'm working on create a few custom preferences for a settings screen i'm building.  The Layout's are fairly straight forward, two text views and an image view.  I want the textviews to wrap and the preference view to grow based on the contents inside. Ignore the constraints for now I want this set up with a constraint layout but originally I thought I might have been doing something wrong there so went to a basic relative layout while I troubleshoot.

I've set up a couple different basic layouts but it seems like there might be a max height that can't easily be overridden?

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
    android:id="@+id/motivatingTitleTextView"
    android:layout_width="wrap_content"
    app:layout_constraintWidth_default="wrap"
    android:layout_height="wrap_content"
    android:text="@string/add_motivating_photo_title"
    android:layout_marginTop="10dp"
    android:layout_marginBottom="10dp"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"/>

<TextView
    android:id="@+id/motivatingMessageTextView"
    android:layout_below="@id/motivatingTitleTextView"
    android:layout_marginBottom="10dp"
    android:layout_width="wrap_content"
    app:layout_constraintWidth_default="wrap"
    android:layout_height="wrap_content"
    android:text="@string/add_motivating_photo_message"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@id/motivatingTitleTextView"
    app:layout_constraintBottom_toBottomOf="parent"/>
 </RelativeLayout>

Here is the settings xml

<android.support.v7.preference.PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">

<android.support.v7.preference.PreferenceCategory
    android:title="Notifications and Access">

    <android.support.v7.preference.SwitchPreferenceCompat
        android:key="allowPushNotifications"
        android:title="Notifications"
        android:defaultValue="true" />
</android.support.v7.preference.PreferenceCategory>

<android.support.v7.preference.PreferenceCategory
    android:title="Personalization">

    <com.company.Settings.AddMotivatingPhotoPreference/>
</android.support.v7.preference.PreferenceCategory>

Finally The Preference Fragment
public class SettingsFragment extends PreferenceFragmentCompat
{

public SettingsFragment()
{
    // Required empty public constructor
}

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
{
    addPreferencesFromResource(R.xml.settings);
}
}

EDIT:

So I found out if I use a layout tag inside a default Preference object it lays out correctly.  I can make this work, but I would prefer to be able to create my own custom classes so that I can separate additional logic into them.  Has anyone done that before or have an example?  I feel like I must just be missing something simple...

<android.support.v7.preference.Preference
        android:layout="@layout/preference_add_motivating_photo"/>


问:
Firefox 57: How to get a new tab be a blank page?
Firefox did an update on itself. I have now found the checkbox to stop that. But the latest version (57) has a not-so-charming feature. When I open a new tab, I get some wierd page like an ad for facebook and a bunch of other crud. I've tried two add-ons to make new tabs be a blank page, neither works. How can one open a new tab and get a blank page?</p>

答: New tab page, options button at upper right corner. Customize display.</p>


问:
retrieve data from database and insert those values to another table in database c#
I'm getting error in connection open like "The connection is already opened". It is telling to close the opened connection of while loop(reading data from table). But any way the data's have to inserted to data base while reading. How to solve?</p>

```<code>private bool iscompanyExist(string comname)
{
    string query = "select * from Ageingrpt where Companyname='" + comname + "' group by Companyname having sum(current)>0 or sum('a1-30')>0 or sum('a31-60')>0 or sum('a61-90')>0 or sum('a90g')>0 ;";
    MySqlCommand cmd = new MySqlCommand(query, cnn);
    MySqlDataReader reader1;
    cnn.Open();
    reader1 = cmd.ExecuteReader();
    if (reader1.HasRows)
    {
        cnn.Close();
        return true;
    }
    else
    {
        cnn.Close();
        return false;
    }
}

private void Ageingcalc()
{
    string duedate = null;
    string compname = null, outstanding = null;
    //90<
    string query = "select c.address1,sum(p.OutstandingAmt) from invoice i,payment p,customer c where p.invoiceNo=i.invoiceNo and i.cid=c.cid and p.OutstandingAmt>0 and i.dueDate<'" + DateTime.Now + "'   group by c.address1 ;";
    MySqlCommand cmd = new MySqlCommand(query, cnn);
    MySqlDataReader reader;
    cnn.Open(); //open1
    reader = cmd.ExecuteReader();
    while (reader.Read())
    {
        compname = reader[0].ToString();
        outstanding = reader[1].ToString();
        if (iscompanyExist(compname) == true)
        {
            cnn.Open();
            query = "update Ageingrpt set a90g='" + outstanding + "';";
            cmd = new MySqlCommand(query, cnn);
            MySqlDataReader reader2 = cmd.ExecuteReader(); // query will be executed and data saved to the db
            cnn.Close();
        }
        else
        {
            cnn.Open();
            query = "insert into Ageingrpt  values('" + compname + "',0,0,0,0,'" + outstanding + "',0); ";
            cmd = new MySqlCommand(query, cnn);
            cmd.ExecuteReader(); // query will be executed and data saved to the db
            cnn.Close();
        }
    }

    cnn.Close();
}
</code>```

答:
```<code>    private void Ageingcalc()
            {
                string duedate = null;
                string compname = null, outstanding = null;

                //90<
                string query = "select c.address1,sum(p.OutstandingAmt) from invoice i,payment p,customer c where p.invoiceNo=i.invoiceNo and i.cid=c.cid and p.OutstandingAmt>0 and i.dueDate<'" + DateTime.Now + "'   group by c.address1 ;";
                MySqlCommand cmd = new MySqlCommand(query, cnn);
                MySqlDataReader reader;
                cnn.Open();         //open1
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    compname = reader[0].ToString();
                    outstanding = reader[1].ToString();
                    if (iscompanyExist(compname) == true)
                    {
                        query = "update Ageingrpt set a90g='" + outstanding + "';";
                        cmd = new MySqlCommand(query, cnn);
                        MySqlDataReader reader2 = cmd.ExecuteReader(); // query will be executed and data saved to the db
                        cnn.Close();
                    }
                    else
                    {
                        query = "insert into Ageingrpt  values('" + compname + "',0,0,0,0,'" + outstanding + "',0); ";
                        cmd = new MySqlCommand(query, cnn);
                        cmd.ExecuteReader(); // query will be executed and data saved to the db
                        cnn.Close();
                    }

                }
                cnn.Close();
            }

once connection is open and need to close it..we should not open again..
</code>```

Body:
I'm getting error in connection open like "The connection is already opened". It is telling to close the opened connection of while loop(reading data from table). But any way the data's have to inserted to data base while reading. How to solve?

private bool iscompanyExist(string comname)
{
    string query = "select * from Ageingrpt where Companyname='" + comname + "' group by Companyname having sum(current)>0 or sum('a1-30')>0 or sum('a31-60')>0 or sum('a61-90')>0 or sum('a90g')>0 ;";
    MySqlCommand cmd = new MySqlCommand(query, cnn);
    MySqlDataReader reader1;
    cnn.Open();
    reader1 = cmd.ExecuteReader();
    if (reader1.HasRows)
    {
        cnn.Close();
        return true;
    }
    else
    {
        cnn.Close();
        return false;
    }
}

private void Ageingcalc()
{
    string duedate = null;
    string compname = null, outstanding = null;
    //90<
    string query = "select c.address1,sum(p.OutstandingAmt) from invoice i,payment p,customer c where p.invoiceNo=i.invoiceNo and i.cid=c.cid and p.OutstandingAmt>0 and i.dueDate<'" + DateTime.Now + "'   group by c.address1 ;";
    MySqlCommand cmd = new MySqlCommand(query, cnn);
    MySqlDataReader reader;
    cnn.Open(); //open1
    reader = cmd.ExecuteReader();
    while (reader.Read())
    {
        compname = reader[0].ToString();
        outstanding = reader[1].ToString();
        if (iscompanyExist(compname) == true)
        {
            cnn.Open();
            query = "update Ageingrpt set a90g='" + outstanding + "';";
            cmd = new MySqlCommand(query, cnn);
            MySqlDataReader reader2 = cmd.ExecuteReader(); // query will be executed and data saved to the db
            cnn.Close();
        }
        else
        {
            cnn.Open();
            query = "insert into Ageingrpt  values('" + compname + "',0,0,0,0,'" + outstanding + "',0); ";
            cmd = new MySqlCommand(query, cnn);
            cmd.ExecuteReader(); // query will be executed and data saved to the db
            cnn.Close();
        }
    }

    cnn.Close();
}


答:
Here you are :

```<code>`https://jsfiddle.net/1znqk6us/1/`
</code>```

I've removed onlick event on button because you don't use this, and for loop.

Title: Hiding a div if a value is under 1

Body:
Here you are :

`https://jsfiddle.net/1znqk6us/1/`

I've removed onlick event on button because you don't use this, and for loop.


问:
REST to return content after POST on Java service
New users are created with the POST method, and after this the database will attach it an unique ID, which is necessary to create a token.

The only way to create a token, is after the process of user creation. I query it from the database and now it should have ID on it, but I can't figure how to do that.

Is there any way to retrieve the entity from database right after creating it?

If looked at this similar question, but couldn't find an answer: Is it ok by REST to return content after POST?

```<code>@POST
    @Consumes({MediaType.APPLICATION_JSON})
    public Response create(@QueryParam("email") String email, @QueryParam("username") String userName, @QueryParam("password") String password) {
        if (TextUtil.isEmpty(userName) || TextUtil.isEmpty(password) || TextUtil.isEmpty(email)) {
            return Response.status(Response.Status.BAD_REQUEST).build();
        } else {
            User newUser = new User();
            newUser.setEmail(email);
            newUser.setUsername(userName);
            newUser.setPass(password);
            super.create(newUser); //ths line create user in database
            String id = newUser.getUid() + ""; //the newUser has no id yet so it is null but I want this id from database
            return Response.status(Response.Status.OK).entity("id: " + id).build();
        }
    }
</code>```

Create super.method

```<code>public void create(T entity) {
        getEntityManager().persist(entity);
    }
</code>```

I generate REST api using this tutorial
https://netbeans.org/kb/docs/websvc/rest.html

答:
I my comments I show how to sync EntityManager. Maybe you should write a better create method:

```<code>public <T> T create(T t) throws Exception {

        try {
            entityManager.persist(t);
            entityManager.flush();
        } catch (Exception e) {
            throw e;
        } finally {
            entityManager.clear();
        }

        return t;
    }
</code>```

And then

```<code>newUser = super.create(newUser);
</code>```

Body:
New users are created with the POST method, and after this the database will attach it an unique ID, which is necessary to create a token.

The only way to create a token, is after the process of user creation. I query it from the database and now it should have ID on it, but I can't figure how to do that.

Is there any way to retrieve the entity from database right after creating it?

If looked at this similar question, but couldn't find an answer: Is it ok by REST to return content after POST?

@POST
    @Consumes({MediaType.APPLICATION_JSON})
    public Response create(@QueryParam("email") String email, @QueryParam("username") String userName, @QueryParam("password") String password) {
        if (TextUtil.isEmpty(userName) || TextUtil.isEmpty(password) || TextUtil.isEmpty(email)) {
            return Response.status(Response.Status.BAD_REQUEST).build();
        } else {
            User newUser = new User();
            newUser.setEmail(email);
            newUser.setUsername(userName);
            newUser.setPass(password);
            super.create(newUser); //ths line create user in database
            String id = newUser.getUid() + ""; //the newUser has no id yet so it is null but I want this id from database
            return Response.status(Response.Status.OK).entity("id: " + id).build();
        }
    }

Create super.method

public void create(T entity) {
        getEntityManager().persist(entity);
    }

I generate REST api using this tutorial
https://netbeans.org/kb/docs/websvc/rest.html

Body:
I my comments I show how to sync EntityManager. Maybe you should write a better create method:

public <T> T create(T t) throws Exception {

        try {
            entityManager.persist(t);
            entityManager.flush();
        } catch (Exception e) {
            throw e;
        } finally {
            entityManager.clear();
        }

        return t;
    }

And then

newUser = super.create(newUser);


问:
Changing Vuetify's Button Width And Padding
Buttons are large and going over the card width

This should be easy, but I'm having a bit of tough time customizing the buttons inside the cards. I want to remove all the padding, so that the black border nicely encompasses the icon without any extra space in the left/right-hand sides. I've tried adding custom css and !important and directly overriding the div.btn__content, but those don't work. Any ideas to do this as simply as possible?

Reproduction Link

答:
The issue is the min-width of the .btn class. Setting that to 0 will allow the button to be smaller than 88px. You should also just set the padding of the .btn__content to 0.

```<code>div.btn__content {
  padding: 0;
}

div.card__actions .btn {
  min-width: 0;
}
</code>```

Here's an updated codepen.

Body:
The issue is the min-width of the .btn class. Setting that to 0 will allow the button to be smaller than 88px. You should also just set the padding of the .btn__content to 0.

div.btn__content {
  padding: 0;
}

div.card__actions .btn {
  min-width: 0;
}

Here's an updated codepen.


答:
You need to change min-width of .btn class and set padding-left: 16px of .btn-content.

Here is an example:
https://codepen.io/anon/pen/zPEyLB

Title: Changing Vuetify's Button Width And Padding

Body:
Buttons are large and going over the card width

This should be easy, but I'm having a bit of tough time customizing the buttons inside the cards. I want to remove all the padding, so that the black border nicely encompasses the icon without any extra space in the left/right-hand sides. I've tried adding custom css and !important and directly overriding the div.btn__content, but those don't work. Any ideas to do this as simply as possible?

Reproduction Link


问:
Understanding go tool compile and link commands
I understand that there are three steps involved in converting a high level language code to machine language or executable code namely - compiling, assembling, and linking.

As per go docs go tool compile does the following -
It then writes a single object file named for the basename of the first source file with a .o suffix

So, the final object file must contain the machine language code (after compiling and assembling are run) of each file. If I pass go tool compile -S on the go file, it shows assembly language go generates.

After this when I run go tool link on the object file, it must link all required object files (if multiple) and then generate final machine language code (based on GOOS and GOARCH). It generates a file a.out

Have few basic questions here -

How do I know which variables and when are they going to be allocated memory in stack and heap? Does it matter if I generate executable for one machine and run on another with different architecture?

My test program

```<code>package main

func f(a *int, b *int) *int {

    var c = (*a + *b);
    var d = c;
    return &d;
}

func main() {
    var a = 2;
    var b = 6;

    f(&a,&b);
}
</code>```

Result of go tool compile -m -l test.go

```<code>test.go:6: moved to heap: d
test.go:7: &d escapes to heap
test.go:3: f a does not escape
test.go:3: f b does not escape
test.go:14: main &a does not escape
test.go:14: main &b does not escape
</code>```

答:
In which step is the memory getting allocated?

It depends, some during linking, some during compiling, most during runtime (And some during loading).

How do I know which variables and when are they going to be allocated memory in stack and heap?

Ad hoc you do not know at all. The compiler decides this. If the compiler can prove that a variable does not escape it might keep it on the stack. Google for "golang escape analysis". There is a flag -m which makes the compiler output his decisions if you are interested in it.

Does it matter if I generate executable for one machine and run on another with different architecture?

No, but simply because this does not work at all: Executables are tied to architecture and won't run on a different one.

It seems you are mixing up compilation/linking and memory allocation. The later is pretty different from the former two. (Technically your linked program may contain memory and during loading it might get even more, but this is highly technical and architecture specific and really nothing to be concerned of).

Body:
I understand that there are three steps involved in converting a high level language code to machine language or executable code namely - compiling, assembling, and linking.

As per go docs go tool compile does the following -
It then writes a single object file named for the basename of the first source file with a .o suffix

So, the final object file must contain the machine language code (after compiling and assembling are run) of each file. If I pass go tool compile -S on the go file, it shows assembly language go generates.

After this when I run go tool link on the object file, it must link all required object files (if multiple) and then generate final machine language code (based on GOOS and GOARCH). It generates a file a.out

Have few basic questions here -

How do I know which variables and when are they going to be allocated memory in stack and heap? Does it matter if I generate executable for one machine and run on another with different architecture?

My test program

package main

func f(a *int, b *int) *int {

    var c = (*a + *b);
    var d = c;
    return &d;
}

func main() {
    var a = 2;
    var b = 6;

    f(&a,&b);
}

Result of go tool compile -m -l test.go

test.go:6: moved to heap: d
test.go:7: &d escapes to heap
test.go:3: f a does not escape
test.go:3: f b does not escape
test.go:14: main &a does not escape
test.go:14: main &b does not escape

ContentLicense: CC BY-SA 4.0


问:
can we join two rdd with two keys using join function in pyspark?
Like for instance :

rdd1 = [('magnus', 'nordea', 13000), ('Erik', 'nordea', 13000), ('Ola', 'nordea', 19000), ('rohit', 'nordea', 23030)]
rdd2 = [('magnus', 'jpmc', 14000), ('Erik', 'jpmc', 2100), ('Ola', 'jpmc', 18400), ('rohit', 'jpmc', 25000)]

rdd1.join(rdd2).collect() gives me :
[('Ola', ('nordea', 'jpmc')), ('Erik', ('nordea', 'jpmc')), ('rohit', ('nordea', 'jpmc')), ('magnus', ('nordea', 'jpmc'))]
```

<p>The above rdd loses its amount value :(</p>

<p>Required output :</p>

<pre class="lang-python prettyprint-override"><code>[(('Ola','nordea'),13000),
 (('Ola','jpmc'),14000),
 (('Erik','nordea'),13000),
 (('Erik','jpmc'),2100),
 (('rohit','nordea'),23030),
 (('rohit','jpmc'),25000),
 (('magnus','nordea'),13000),
 (('magnus', 'jpmc'),14000)]
</code>```

Any suggestions on it or what function I should refer to?

Body:
Like for instance :

rdd1 = [('magnus', 'nordea', 13000), ('Erik', 'nordea', 13000), ('Ola', 'nordea', 19000), ('rohit', 'nordea', 23030)]
rdd2 = [('magnus', 'jpmc', 14000), ('Erik', 'jpmc', 2100), ('Ola', 'jpmc', 18400), ('rohit', 'jpmc', 25000)]

rdd1.join(rdd2).collect() gives me :
[('Ola', ('nordea', 'jpmc')), ('Erik', ('nordea', 'jpmc')), ('rohit', ('nordea', 'jpmc')), ('magnus', ('nordea', 'jpmc'))]

The above rdd loses its amount value :(

Required output :

[(('Ola','nordea'),13000),
 (('Ola','jpmc'),14000),
 (('Erik','nordea'),13000),
 (('Erik','jpmc'),2100),
 (('rohit','nordea'),23030),
 (('rohit','jpmc'),25000),
 (('magnus','nordea'),13000),
 (('magnus', 'jpmc'),14000)]

Any suggestions on it or what function I should refer to?

Body:
spark.version
#  u'2.2.0'

rdd1 = sc.parallelize([('magnus', 'nordea', 13000), ('Erik', 'nordea', 13000), ('Ola', 'nordea', 19000), ('rohit', 'nordea', 23030)])
rdd2 = sc.parallelize([('magnus', 'jpmc', 14000), ('Erik', 'jpmc', 2100), ('Ola', 'jpmc', 18400), ('rohit', 'jpmc', 25000)])

rdd1.union(rdd2).map(lambda x: ((x[0], x[1]), x[2])).collect()

Result:

[(('magnus', 'nordea'), 13000),
 (('Erik', 'nordea'), 13000),
 (('Ola', 'nordea'), 19000),
 (('rohit', 'nordea'), 23030),
 (('magnus', 'jpmc'), 14000),
 (('Erik', 'jpmc'), 2100),
 (('Ola', 'jpmc'), 18400),
 (('rohit', 'jpmc'), 25000)]


问:
SQLSTATE[42S02]: Base table or view not found Error with laravel curl
I have written two laravel apps. FirstApp and CryptoApp ( name of apps respectively )

In which I send encrypted text to a function called ( Decrypt ) in CryptoApp that is supposed to return decrypted text

In FirstApp i am sending a curl POST request with the encrypted text to CryptoApp

cURL post code: inside FirstApp

```<code>private function DecryptApi($data)
{

    $ch = curl_init();                    // initiate curl
    $url = "http://crypto.dev/Decrypt"; // where you want to post data
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_POST, true);  // tell curl you want to post something
    curl_setopt($ch, CURLOPT_POSTFIELDS, "data=".$data); // define what you want to post
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
    $output = curl_exec ($ch); // execute

    curl_close ($ch); // close curl handle

    return $output; // show output

}
</code>```

The Route : Route::post('/Decrypt','CryptoController@Decrypt');

The Function :

```<code>public function Decrypt(Request $request)
{
    $crypt =  Crypto::find(1);

    return openssl_decrypt($request['data'],"AES-256-CBC",$crypt->secretKey,0,$crypt->iv);

}
</code>```

the Error i am getting is  : "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel_firstapp.crypto' doesn't exist (SQL: select * from crypto where crypto.id = 1 limit 1)"

this error has confused me because i know that FirstApp does not have a table named 'crypto' but CryptoApp does, why is laravel not returning the text i want ?

答:
make sure you have table in your laravel_firstapp database. Run migration if any.

also if your table name is not crypto u can use protected $table = 'your table' in your model

Body:
I have written two laravel apps. FirstApp and CryptoApp ( name of apps respectively )

In which I send encrypted text to a function called ( Decrypt ) in CryptoApp that is supposed to return decrypted text

In FirstApp i am sending a curl POST request with the encrypted text to CryptoApp

cURL post code: inside FirstApp

private function DecryptApi($data)
{

    $ch = curl_init();                    // initiate curl
    $url = "http://crypto.dev/Decrypt"; // where you want to post data
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_POST, true);  // tell curl you want to post something
    curl_setopt($ch, CURLOPT_POSTFIELDS, "data=".$data); // define what you want to post
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
    $output = curl_exec ($ch); // execute

    curl_close ($ch); // close curl handle

    return $output; // show output

}

The Route : Route::post('/Decrypt','CryptoController@Decrypt');

The Function :

public function Decrypt(Request $request)
{
    $crypt =  Crypto::find(1);

    return openssl_decrypt($request['data'],"AES-256-CBC",$crypt->secretKey,0,$crypt->iv);

}

the Error i am getting is  : "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel_firstapp.crypto' doesn't exist (SQL: select * from crypto where crypto.id = 1 limit 1)"

this error has confused me because i know that FirstApp does not have a table named 'crypto' but CryptoApp does, why is laravel not returning the text i want ?


问:
How to switch to f3 in the figure (Selenium + Python)
How to switch to f3?

How to know the current frame?

None of the commands below works:

```<code>driver.switch_to.frame('f3')
driver.switch_to.frame(driver.find_element_by_xpath("//frameset[@name='viewfrm']"))
driver.switch_to.frame(driver.find_element_by_xpath("//frameset[@name='f3']"))
</code>```

答:
Try to wait until required frame appears:

```<code>from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it("f3"))
</code>```

After driver.switch_to_default_content() you can handle in the same way frames "menu" and "toogle"

Body:
How to switch to f3?

How to know the current frame?

None of the commands below works:

driver.switch_to.frame('f3')
driver.switch_to.frame(driver.find_element_by_xpath("//frameset[@name='viewfrm']"))
driver.switch_to.frame(driver.find_element_by_xpath("//frameset[@name='f3']"))

Body:
Try to wait until required frame appears:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it("f3"))

After driver.switch_to_default_content() you can handle in the same way frames "menu" and "toogle"


问:
Celery raises ValueError: not enough values to unpack
Trying to run simple example with Celery and receiving an exception. RabbitMQ started in a Docker, also tried to start it locally. Celery works on a local Windows host

```<code>from celery import Celery

app = Celery('tasks', broker='amqp://192.168.99.100:32774')

@app.task()
def hello():
    print('hello')

if __name__ == '__main__':
    hello.delay()
</code>```

Excerpt of my error text:

```<code>[2017-08-18 00:01:08,632: ERROR/MainProcess] Task handler raised error: ValueError('not enough values to unpack (expected 3, got 0)',)
Traceback (most recent call last):
    File "c:\users\user\celenv\lib\site-packages\billiard\pool.py", line 358, in workloop
        result = (True, prepare_result(fun(*args, **kwargs)))
    File "c:\users\user\celenv\lib\site-packages\celery\app\trace.py", line 525, in _fast_trace_task
        tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)
</code>```

答:
Celery 4.0+ does not officially support Windows yet. But it still works on Windows for some development/test purposes.

Use eventlet instead as below:

```<code>pip install eventlet
celery -A <module> worker -l info -P eventlet
</code>```

It works for me on Windows 10 + celery 4.1 + python 3.

===== update 2018-11 =====

Eventlet has an issue on subprocess.CalledProcessError:

https://github.com/celery/celery/issues/4063

https://github.com/eventlet/eventlet/issues/357

https://github.com/eventlet/eventlet/issues/413

So try gevent instead.

```<code>pip install gevent
celery -A <module> worker -l info -P gevent
</code>```

This works for me on Windows 10 + celery 4.2 + python 3.6

Body:
Trying to run simple example with Celery and receiving an exception. RabbitMQ started in a Docker, also tried to start it locally. Celery works on a local Windows host

from celery import Celery

app = Celery('tasks', broker='amqp://192.168.99.100:32774')

@app.task()
def hello():
    print('hello')

if __name__ == '__main__':
    hello.delay()

Excerpt of my error text:

[2017-08-18 00:01:08,632: ERROR/MainProcess] Task handler raised error: ValueError('not enough values to unpack (expected 3, got 0)',)
Traceback (most recent call last):
    File "c:\users\user\celenv\lib\site-packages\billiard\pool.py", line 358, in workloop
        result = (True, prepare_result(fun(*args, **kwargs)))
    File "c:\users\user\celenv\lib\site-packages\celery\app\trace.py", line 525, in _fast_trace_task
        tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)

Body:
Celery 4.0+ does not officially support Windows yet. But it still works on Windows for some development/test purposes.

Use eventlet instead as below:

pip install eventlet
celery -A <module> worker -l info -P eventlet

It works for me on Windows 10 + celery 4.1 + python 3.

===== update 2018-11 =====

Eventlet has an issue on subprocess.CalledProcessError:

https://github.com/celery/celery/issues/4063

https://github.com/eventlet/eventlet/issues/357

https://github.com/eventlet/eventlet/issues/413

So try gevent instead.

pip install gevent
celery -A <module> worker -l info -P gevent

This works for me on Windows 10 + celery 4.2 + python 3.6


Title: SVG <use> element not visible in Chrome

Body:
I have an SVG element that is embedded into my HTML page that works perfectly on Firefox but does not work on Chrome.

I'm using a mask to cover a video background while the SVG element has a transparent fill (using CSS class on use element) to show video background through it.

I believe I identified the problem to be with the <use> tag because when I inspect it in Chrome, the use element has some dimensions but is not matching the SVG viewbox's size: <svg viewBox="0 0 1000 300" class="svg-inverted-mask"> that it lives in. In Firefox, the size of use element matches the viewbox and renders correctly.

Code:

    <svg viewBox="0 0 1000 300" class="svg-defs">

      <symbol id="s-text2">
        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="30%" y="-25%" width="700" height="800" viewBox="0 0 1000 800">
            <defs>
              <rect id="a" x="50%" y="50%" width="612" height="792"/>
            </defs>
            <clipPath id="b">
              <use href="#a" overflow="visible"/>
            </clipPath>
            <path clip-path="url(#b)" d="M468.896,118.65l-80.667,254.289H145.563l-24.334-62.667h188 c0,0,26.167,0.167,33.311-18.676l15.356-50.99c20.333-62.333,22.67-67.217-34-67.667c-15.121-0.12-30.689,0.122-39.254,0.072 c-17.878-0.105-22.246,0.139-20.368-10.094l10.712-34.979c0,0,1.285-9.287,17.66-9.287"/>
            <path clip-path="url(#b)" d="M275.563,267.9c28.667,0,28.013-1.13,35.833-28.5c8-28,9.457-29.082-12-29.5 c-10.548-0.205-26.166,0-26.166,0c-51.959,0-64.834,1.5-58.222-24.03c2.682-10.354,6.587-25.693,12.221-45.637 c4.024-14.247,8.103-29.353,11.369-38.006C250.481,70.74,271.842,75.708,343.23,75.9c92.334,0.249,139.333,0,139.333,0l20.333-62 h-314l-41.553,149.031c0,0-2.537,10.65-6.408-0.212L87.896,13.9h-69l89.667,254H275.563"/>
        </svg>
      </symbol>

      <mask id="m-text2" maskunits="userSpaceOnUse" maskcontentunits="userSpaceOnUse">
        <rect width="100%" height="100%" class="mask__shape">
        </rect>
        <use href="#s-text2" class="mask__text"></use>
      </mask>
   </svg>

   <video class="video" src="/css/fractal3.mp4" autoplay loop></video>

   <svg viewBox="0 0 1000 300" class="svg-inverted-mask">
    <rect width="100%" height="100%" mask="url(#m-text2)" class="shape--fill" />
      <use href="#s-text2" class="text--transparent"></use>
    </svg>

Body:
Getting rid of the unnecessary clipPaths seems to help.

They look like the sort of clips that Illustrator adds to reproduce its way of rendering strokes.  But since your symbol doesn't have an stroking, they are safe to remove.

<div class="wrap heightwrap wow fadeInDown" data-wow-delay="0.4s">
    <svg viewBox="0 0 1000 300" class="svg-defs">
    <!-- Symbol with Logo -->
      <symbol id="s-text2">
        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="30%" y="-25%" width="700" height="800" viewBox="0 0 1000 800">
            <path d="M468.896,118.65l-80.667,254.289H145.563l-24.334-62.667h188 c0,0,26.167,0.167,33.311-18.676l15.356-50.99c20.333-62.333,22.67-67.217-34-67.667c-15.121-0.12-30.689,0.122-39.254,0.072 c-17.878-0.105-22.246,0.139-20.368-10.094l10.712-34.979c0,0,1.285-9.287,17.66-9.287"/>
            <path d="M275.563,267.9c28.667,0,28.013-1.13,35.833-28.5c8-28,9.457-29.082-12-29.5 c-10.548-0.205-26.166,0-26.166,0c-51.959,0-64.834,1.5-58.222-24.03c2.682-10.354,6.587-25.693,12.221-45.637 c4.024-14.247,8.103-29.353,11.369-38.006C250.481,70.74,271.842,75.708,343.23,75.9c92.334,0.249,139.333,0,139.333,0l20.333-62 h-314l-41.553,149.031c0,0-2.537,10.65-6.408-0.212L87.896,13.9h-69l89.667,254H275.563"/>
        </svg>
      </symbol>
    <!-- Mask with text -->
      <mask id="m-text2" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse">
        <rect width="100%" height="100%" class="mask__shape">
        </rect>
        <use href="#s-text2" class="mask__text"></use>
      </mask>
   </svg>

   <div class="box-with-text">
   <!-- Container for video -->
   <div class="text-fill">
   <video class="video" src="/css/fractal3.mp4" autoplay loop></video>
  </div>
  <!-- Visible SVG -->
   <svg viewBox="0 0 1000 300" class="svg-inverted-mask">
    <rect width="100%" height="100%" mask="url(#m-text2)" class="shape--fill" />
      <use href="#s-text2" class="text--transparent"></use>
    </svg>
   </div>
</div>