问:
Why cant i change a instance?
I have the following class:

```<code>public class Finance {
    private User user;

    private ArrayList<account> account;
    private ArrayList<Categorie> categorie;
    private ArrayList<salary> salary;

    private static final Finance instance=new GestaoFinancas();
    public static Finance getFinance() {
        return instance;
    }

    private Finance() {
        user=new User();
        account=new ArrayList<>();
        categorie=new ArrayList<>();
        salary=new ArrayList<>();

        categorie.add(new Categoria("Food"));
        categorie.add(new Categoria("Sleep"));
        categorie.add(new Categoria("Fun"));
    }

    public void setUser(User user) {
        this.user = user;
    }
}
</code>```

And im trying to add a new user to it:

```<code>import pt.finance.modelo.Finance;
...
User user = new User( jTextField1.getText(), jTextField2.getText(), jTextField3.getText());
        getFinance().setUser(user);//here is the problem
</code>```

My question is how can i give a new user, plus should i write Finance.getFinance or getFinance? Everytime i attempt to give Finance a new user i get the following error:

```<code>Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at pt.ipleiria.estg.es1.financaspessoais.vista.DadosUtilizador.jButton2ActionPerformed(DadosUtilizador.java:127)
at pt.ipleiria.estg.es1.financaspessoais.vista.DadosUtilizador.access$200(DadosUtilizador.java:14)
at pt.ipleiria.estg.es1.financaspessoais.vista.DadosUtilizador$3.actionPerformed(DadosUtilizador.java:72)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
at java.awt.Dialog.show(Dialog.java:1084)
at java.awt.Component.show(Component.java:1671)
at java.awt.Component.setVisible(Component.java:1623)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1005)
at pt.ipleiria.estg.es1.financaspessoais.vista.FinancasPessoais.btnAlterarUtilizadorActionPerformed(FinancasPessoais.java:174)
at pt.ipleiria.estg.es1.financaspessoais.vista.FinancasPessoais.access$000(FinancasPessoais.java:13)
at pt.ipleiria.estg.es1.financaspessoais.vista.FinancasPessoais$1.actionPerformed(FinancasPessoais.java:51)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.UnsupportedOperationException: Not supported yet.
    at pt.ipleiria.estg.es1.financaspessoais.modelo.Utilizador.<init>(Utilizador.java:21)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<init>(GestaoFinancas.java:26)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<clinit>(GestaoFinancas.java:20)
</code>```

答:
```<code>Caused by: java.lang.UnsupportedOperationException: Not supported yet.
    at pt.ipleiria.estg.es1.financaspessoais.modelo.Utilizador.<init>(Utilizador.java:21)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<init>(GestaoFinancas.java:26)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<clinit>(GestaoFinancas.java:20)
</code>```

That's your problem.  On line 21 of your Utilizador class there's a problem (probably deliberately throwing UnsupportedOperationException to show that it hasn't been fully implemented yet).  So you're failing to instantiate Utilizador.  You should either look there and figure it out, or post that code too.

Title: Why cant i change a instance?

Body:
I have the following class:

public class Finance {
    private User user;

    private ArrayList<account> account;
    private ArrayList<Categorie> categorie;
    private ArrayList<salary> salary;

    private static final Finance instance=new GestaoFinancas();
    public static Finance getFinance() {
        return instance;
    }

    private Finance() {
        user=new User();
        account=new ArrayList<>();
        categorie=new ArrayList<>();
        salary=new ArrayList<>();

        categorie.add(new Categoria("Food"));
        categorie.add(new Categoria("Sleep"));
        categorie.add(new Categoria("Fun"));
    }

    public void setUser(User user) {
        this.user = user;
    }
}

And im trying to add a new user to it:

import pt.finance.modelo.Finance;
...
User user = new User( jTextField1.getText(), jTextField2.getText(), jTextField3.getText());
        getFinance().setUser(user);//here is the problem

My question is how can i give a new user, plus should i write Finance.getFinance or getFinance? Everytime i attempt to give Finance a new user i get the following error:

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at pt.ipleiria.estg.es1.financaspessoais.vista.DadosUtilizador.jButton2ActionPerformed(DadosUtilizador.java:127)
at pt.ipleiria.estg.es1.financaspessoais.vista.DadosUtilizador.access$200(DadosUtilizador.java:14)
at pt.ipleiria.estg.es1.financaspessoais.vista.DadosUtilizador$3.actionPerformed(DadosUtilizador.java:72)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
at java.awt.Dialog.show(Dialog.java:1084)
at java.awt.Component.show(Component.java:1671)
at java.awt.Component.setVisible(Component.java:1623)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1005)
at pt.ipleiria.estg.es1.financaspessoais.vista.FinancasPessoais.btnAlterarUtilizadorActionPerformed(FinancasPessoais.java:174)
at pt.ipleiria.estg.es1.financaspessoais.vista.FinancasPessoais.access$000(FinancasPessoais.java:13)
at pt.ipleiria.estg.es1.financaspessoais.vista.FinancasPessoais$1.actionPerformed(FinancasPessoais.java:51)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.UnsupportedOperationException: Not supported yet.
    at pt.ipleiria.estg.es1.financaspessoais.modelo.Utilizador.<init>(Utilizador.java:21)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<init>(GestaoFinancas.java:26)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<clinit>(GestaoFinancas.java:20)

Body:
Caused by: java.lang.UnsupportedOperationException: Not supported yet.
    at pt.ipleiria.estg.es1.financaspessoais.modelo.Utilizador.<init>(Utilizador.java:21)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<init>(GestaoFinancas.java:26)
    at pt.ipleiria.estg.es1.financaspessoais.modelo.GestaoFinancas.<clinit>(GestaoFinancas.java:20)

That's your problem.  On line 21 of your Utilizador class there's a problem (probably deliberately throwing UnsupportedOperationException to show that it hasn't been fully implemented yet).  So you're failing to instantiate Utilizador.  You should either look there and figure it out, or post that code too.


来源: stackexchange

问:
Xcode 8: Your account does not have sufficient permissions to modify containers
I'm getting this error with code signing with Xcode 8:

Your account does not have sufficient permissions to modify containers

What does it want from me?

答: I faced this issue in XCODE Version 8.3.3 (8E3004b). To resolve this go to project settings. In capabilities tab -> iCloud -> containers. Verify whether valid iCloud containers are selected and you have permission to access these containers. This should resolve the issue.</p>

ContentLicense: CC BY-SA 3.0


问:
Show active plugins in Sublime Text and disable them
I just installed sublime text 2 and was overwhelmed by the php plugins that I installed ALL of them. Now auto-complete is crazy, a million unnecessary suggestions and I dont remember which plugin does what or which ones I installed. Is there a way to see all active plugins for a particular file so I can disable some?</p>

答: There's no need to remove packages as packages can be simply disabled by using Package Control: Disable Package option in the Command Palette.

ContentLicense: CC BY-SA 4.0


问:
std::stable_sort: How to choose memory-optimised algorithm over time-optimised algorithm?
I wish to make use of std::stable_sort. The complexity of the algorithm is stated as

O(N·log^2(N)), where N = std::distance(first, last) applications of cmp. If additional memory is available, then the complexity is O(N·log(N)). http://en.cppreference.com/w/cpp/algorithm/stable_sort

In my application, memory is critical, therefore, I would prefer std::stable_sort to use the memory-optimised O(N·log^2(N))
algorithm, rather than the time-optimised O(N·log(N)) algorithm.
I understand that the time-optimised version will only be chosen if it is safe
to do so (memory available). However, I aim to benchmark my application, and therefore, as memory is critical, want to benchmark the algorithm when memory consumption is lowest. As my system currently has enough memory to allocate
the buffer, it will automatically chose the O(N·log^2(N)) version of std::stable_sort. I would therefore like to assert to std::stable_sort to
take the memory-optimised version. Is this possible?

The execution policy appears
to be a parameter that can modify the algorithm, however, it appears
to only alter the extent of parallelism.
http://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t

Although choosing either
the parallel or sequential version may actually be choosing the O(N·log(N)) or
O(N·log^2(N)) versions respectively, this is not stated anywhere on the webpage.

I wonder if anyone has any experience in asserting this choice. If so
would they be able to provide any advice?

答:
You can look into your headers and see which function gets called if the extra buffer isn't available. For me on gcc it is

```<code>    std::__inplace_stable_sort(__first, __last, __comp);
</code>```

This is of course not standards compliant. The __inplace_stable_sort is a helper function and is not intended to be used directly.

The call by std::stable_sort to this function is a result of the following code

```<code>typedef _Temporary_buffer<_RandomAccessIterator, _ValueType> _TmpBuf;
  _TmpBuf __buf(__first, __last);

  if (__buf.begin() == 0)
std::__inplace_stable_sort(__first, __last, __comp);
  else
std::__stable_sort_adaptive(__first, __last, __buf.begin(),
                _DistanceType(__buf.size()), __comp);
</code>```

Body:
You can look into your headers and see which function gets called if the extra buffer isn't available. For me on gcc it is

    std::__inplace_stable_sort(__first, __last, __comp);

This is of course not standards compliant. The __inplace_stable_sort is a helper function and is not intended to be used directly.

The call by std::stable_sort to this function is a result of the following code

typedef _Temporary_buffer<_RandomAccessIterator, _ValueType> _TmpBuf;
  _TmpBuf __buf(__first, __last);

  if (__buf.begin() == 0)
std::__inplace_stable_sort(__first, __last, __comp);
  else
std::__stable_sort_adaptive(__first, __last, __buf.begin(),
                _DistanceType(__buf.size()), __comp);


问:
How to easily insert values to tables which have different amount of attributes?
I am making a 3-layered architecture database application with C# Windows Form application and an Excel file. Problem is, I have three tables and they have different amount of attributes. I want to user chooses which table he/she want to insert and update.

The basic solution is making three different forms to add values to each table, because for different amount of inputs I need different amount of textboxes. But it's too troublesome and amateurish, I think.

Can you give me some advise to do this easily?

答:
Simpler method will be a big table with all the fields. Allow null on the ones you will allow user to skip.
OR

Create a table with bare minimum fields a user must enter. Create other tables and connect them using a foreign key constraint. On the front end, allow the users to leave fields empty. You should be done.


问:
Why isn't the pattern in this code exhaustive?
```<code>splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith f [] = []
splitWith f list = pre : (splitWith f suf)
    where (pre, suf) = break f list
</code>```

<p>This function should split a list according to a predicate. But I get an infinite recursion. </p>

答:
break is defined as:

break :: (a -> Bool) -> [a] -> ([a], [a])

break, applied to a predicate p and a list xs, returns a tuple
  where first element is longest prefix (possibly empty) of xs of
  elements that do not satisfy p and second element is the remainder
  of the list:

```<code>break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])
</code>```

So once you have done the first break, all the remaining breaks will simply split the list into an empty list and the original list. As a result, there is no progress in the pattern so to speak. Unless all the elements do not satisfy the predicate, you will keep iterating over a list where the first element satisifies the predicate, and never get rid of it.

What you probably want is to interleave the break with the span:

```<code>splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith f [] = []
splitWith f list = pre1 : pre2 : (splitWith f suf2)
    where (pre1, suf1) = break f list
          (pre2, suf2) = span f suf1
</code>```

This will split the given list interleaved in a list of elements where the predicate is not satisfied, and a list where it is satisfied.

In case you do not want the latter, you can simply dropWhile these:

```<code>splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith f [] = []
splitWith f list = pre : (splitWith f $ dropWhile f suf)
    where (pre1, suf) = break f list
</code>```

Body:
splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith f [] = []
splitWith f list = pre : (splitWith f suf)
    where (pre, suf) = break f list

This function should split a list according to a predicate. But I get an infinite recursion.

Body:
break is defined as:

break :: (a -> Bool) -> [a] -> ([a], [a])

break, applied to a predicate p and a list xs, returns a tuple
  where first element is longest prefix (possibly empty) of xs of
  elements that do not satisfy p and second element is the remainder
  of the list:

break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])

So once you have done the first break, all the remaining breaks will simply split the list into an empty list and the original list. As a result, there is no progress in the pattern so to speak. Unless all the elements do not satisfy the predicate, you will keep iterating over a list where the first element satisifies the predicate, and never get rid of it.

What you probably want is to interleave the break with the span:

splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith f [] = []
splitWith f list = pre1 : pre2 : (splitWith f suf2)
    where (pre1, suf1) = break f list
          (pre2, suf2) = span f suf1

This will split the given list interleaved in a list of elements where the predicate is not satisfied, and a list where it is satisfied.

In case you do not want the latter, you can simply dropWhile these:

splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith f [] = []
splitWith f list = pre : (splitWith f $ dropWhile f suf)
    where (pre1, suf) = break f list


问:
Cron Job PHP script execution time report
My question is simple: I want to know how long a PHP script is taking to execute. On top of this, I am executing it via cron. Now, I could do something via the PHP code itself to get the execution time start/end, however I wondered if there was something via the cron command that I could add to get that emailed to me, in milliseconds?

Currently I am using:

```<code>/usr/bin/php -q httpsdocs/folder/script.php > /dev/null 2>&1
</code>```

Which runs my script and stops all errors/output getting emailed to me. Can I change the above to get the execution time emailed to me somehow?

Thanks

答:
You can use time command like this:

```<code>/usr/bin/time /usr/bin/php -q httpsdocs/folder/script.php > /var/log/crontiming
</code>```

ContentLicense: CC BY-SA 2.5

Body:
My question is simple: I want to know how long a PHP script is taking to execute. On top of this, I am executing it via cron. Now, I could do something via the PHP code itself to get the execution time start/end, however I wondered if there was something via the cron command that I could add to get that emailed to me, in milliseconds?

Currently I am using:

/usr/bin/php -q httpsdocs/folder/script.php > /dev/null 2>&1

Which runs my script and stops all errors/output getting emailed to me. Can I change the above to get the execution time emailed to me somehow?

Thanks

Body:
You can use time command like this:

/usr/bin/time /usr/bin/php -q httpsdocs/folder/script.php > /var/log/crontiming


问:
C++ Solving Diamond Inheritance Without Virtual Inheritance
I have the following diamond class structure that does not compile:

```<code>class Base{
  int a;
public:
  virtual void doSomething();
};

class NotMineToTouch : public Base {};

class MyParentClass : public Base {};

class EvilDiamond : public NotMineToTouch, public MyParentClass {};

// I need these methods (that I cannot necessarily edit) to work for an EvilDiamond
void processBase (Base* b) { b->doSomething; /*...*/} // Cannot edit

void processParent (MyParentClass* p) { p->doSomething; /*...*/} // Can edit

void processNotMine (NotMineToTouch* n) { n->doSomething; /*...*/} // Cannot edit
</code>```

I know the normal solution is to inherit virtually from Base; however, I am not allowed to change NotMineToTouch (or Base).  Is there another solution?  I am allowed to change MyParentClass and EvilDiamond at my pleasure; however, EvilDiamond must inherit from MyParentClass and NotMineToTouch, and MyParentClass must inherit from Base and may not inherit from EvilDiamond.

答:
You don't have diamond as you don't use virtual inheritance.

you have some "Y" inheritance currently (EvilDiamond has 2 Base).

Without changing your classes, you may add overloads to instruct compiler what to do:

```<code>void processBase (EvilDiamond* evil) {
    processBase(static_cast<NotMineToTouch*>(evil)); // Use NotMineToTouch::Base
    processBase(static_cast<MyParentClass*>(evil));  // Use MyParentClass::Base
}
</code>```

Body:
I have the following diamond class structure that does not compile:

class Base{
  int a;
public:
  virtual void doSomething();
};

class NotMineToTouch : public Base {};

class MyParentClass : public Base {};

class EvilDiamond : public NotMineToTouch, public MyParentClass {};

// I need these methods (that I cannot necessarily edit) to work for an EvilDiamond
void processBase (Base* b) { b->doSomething; /*...*/} // Cannot edit

void processParent (MyParentClass* p) { p->doSomething; /*...*/} // Can edit

void processNotMine (NotMineToTouch* n) { n->doSomething; /*...*/} // Cannot edit

I know the normal solution is to inherit virtually from Base; however, I am not allowed to change NotMineToTouch (or Base).  Is there another solution?  I am allowed to change MyParentClass and EvilDiamond at my pleasure; however, EvilDiamond must inherit from MyParentClass and NotMineToTouch, and MyParentClass must inherit from Base and may not inherit from EvilDiamond.

Body:
You don't have diamond as you don't use virtual inheritance.

you have some "Y" inheritance currently (EvilDiamond has 2 Base).

Without changing your classes, you may add overloads to instruct compiler what to do:

void processBase (EvilDiamond* evil) {
    processBase(static_cast<NotMineToTouch*>(evil)); // Use NotMineToTouch::Base
    processBase(static_cast<MyParentClass*>(evil));  // Use MyParentClass::Base
}


问:
Accessing file data after download in Chrome...?
I'm writing an extension that would ideally read files after they are downloaded (through the normal download process). Is that possible? I can get the filename through chrome.downloads operations, but I can't find ways of reading the actual bytes. I don't need to write or move them, just read.</p>

答:
I struggled with the exact same problem and finally found an easy workaround to read the content of downloaded files from a Chrome extension.

You just need to add a permission to file://*in your manifest file and once you have your file's path in the system (with chrome.downloads.search in the filename property), make a GET XMLHttpRequest to the url file://{filepath}.


问:
Google AutoCompleteService returns place with ID not known to PlacesService
I'm having problems with PlacesService.getDetails by "place id" for a result from AutoCompleteService.getPlacePredictions which returns these ids.

Here's my code (also at this JSFiddle):

function initService() {
  var placesService = new google.maps.places.PlacesService(window.document.createElement('div'));
  var autocompleteService = new google.maps.places.AutocompleteService();

  var showAddress = function(input) {
    autocompleteService.getPlacePredictions({ input }, displayTopSuggestion);
  }

  var displayTopSuggestion = function(predictions) {
    var placeId = predictions[0].place_id;
    placesService.getDetails({
      placeId: placeId
    }, function(place, status) {
      console.log(placeId + ": " + status);
    });
  }

  showAddress('401 Park Drive, Boston, MA');
  showAddress('120 Wall Street, New York, NY');
}
```

<p>This displays "OK" for the first one (cool) and "NOT FOUND" for the second one (confusing):</p>

<pre class="lang-none prettyprint-override"><code>ChIJdd3kdPR544kRllG3JcXaViQ: OK
ChIJq7N18T1awokRXtu1sjDO7Jw: NOT_FOUND
</code>```

That is, the PlacesService doesn't know the placeId returned in the results from the AutocompleteService.

Does anyone know what is going on here?

答: This seems like it may have been a manifestation of a transient issue in the Maps APIs: https://issuetracker.google.com/issues/63069427</p>

Body:
I'm having problems with PlacesService.getDetails by "place id" for a result from AutoCompleteService.getPlacePredictions which returns these ids.

Here's my code (also at this JSFiddle):

function initService() {
  var placesService = new google.maps.places.PlacesService(window.document.createElement('div'));
  var autocompleteService = new google.maps.places.AutocompleteService();

  var showAddress = function(input) {
    autocompleteService.getPlacePredictions({ input }, displayTopSuggestion);
  }

  var displayTopSuggestion = function(predictions) {
    var placeId = predictions[0].place_id;
    placesService.getDetails({
      placeId: placeId
    }, function(place, status) {
      console.log(placeId + ": " + status);
    });
  }

  showAddress('401 Park Drive, Boston, MA');
  showAddress('120 Wall Street, New York, NY');
}

This displays "OK" for the first one (cool) and "NOT FOUND" for the second one (confusing):

ChIJdd3kdPR544kRllG3JcXaViQ: OK
ChIJq7N18T1awokRXtu1sjDO7Jw: NOT_FOUND

That is, the PlacesService doesn't know the placeId returned in the results from the AutocompleteService.

Does anyone know what is going on here?


问:
T-sql :get SUM of Columns
I have a table that looks something like the following :

```<code>          W1  W2 w3
Gold      10    2    3
Silver     3    1    1
</code>```

but i need a result :

```<code>          W1  W2  w3
Gold      10  12  15
Silver     3  4  5
</code>```

Is there any way i can get that result?

My sql query :

```<code>SELECT
   week1=[1],week2=[2],week3=[3]
FROM
(
    SELECT
    [week]=DATEPART(ISO_WEEK,ta.enddate),ta.id
    FROM
    table1 ta where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
) src
PIVOT
(
    SUM(id) FOR week IN (
        [1],[2],[3])
) piv
</code>```

答:
Calculate the running total before pivoting the data

```<code>SELECT element,
       week1=[1],week2=[2],week3=[3]
FROM
(
SELECT [week] = DATEPART(ISO_WEEK,ta.enddate),
       price = sum(ta.price)Over(Partition by element Order by enddate),
       element
FROM table1 ta
where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
) src
PIVOT
(
 SUM(price) FOR week IN ( [1],[2],[3])
) piv
</code>```

for older versions

```<code>SELECT element,
       week1=[1],week2=[2],week3=[3]
FROM
(
SELECT [week] = DATEPART(ISO_WEEK,ta.enddate),
       cs.price,
       element
FROM table1 ta
cross apply(select sum(price) from table1 tb
            where ta.element = tb.element and ta.enddate >= tb.enddate ) cs (price)
where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
) src
PIVOT
(
 SUM(price) FOR week IN ( [1],[2],[3])
) piv
</code>```

Title: T-sql :get SUM of Columns

Body:
I have a table that looks something like the following :

          W1  W2 w3
Gold      10    2    3
Silver     3    1    1

but i need a result :

          W1  W2  w3
Gold      10  12  15
Silver     3  4  5

Is there any way i can get that result?

My sql query :

SELECT
   week1=[1],week2=[2],week3=[3]
FROM
(
    SELECT
    [week]=DATEPART(ISO_WEEK,ta.enddate),ta.id
    FROM
    table1 ta where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
) src
PIVOT
(
    SUM(id) FOR week IN (
        [1],[2],[3])
) piv

Body:
Calculate the running total before pivoting the data

SELECT element,
       week1=[1],week2=[2],week3=[3]
FROM
(
SELECT [week] = DATEPART(ISO_WEEK,ta.enddate),
       price = sum(ta.price)Over(Partition by element Order by enddate),
       element
FROM table1 ta
where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
) src
PIVOT
(
 SUM(price) FOR week IN ( [1],[2],[3])
) piv

for older versions

SELECT element,
       week1=[1],week2=[2],week3=[3]
FROM
(
SELECT [week] = DATEPART(ISO_WEEK,ta.enddate),
       cs.price,
       element
FROM table1 ta
cross apply(select sum(price) from table1 tb
            where ta.element = tb.element and ta.enddate >= tb.enddate ) cs (price)
where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
) src
PIVOT
(
 SUM(price) FOR week IN ( [1],[2],[3])
) piv


问:
Swift generics subclass behaviour in Array
So I walk against this problem.

I have a BaseModel with some variables inside and a few normal "final" Models that inherit from the BaseModel.

If I have an array with class BaseModel with inside a few final models, and then loop trough those models and sent them to a function that uses generics. And check the class of the generics I get back they are from class BaseModel instead of the final class model that I need. How can I retrieve in a dynamic way the class of the final model. And of course I could cast them, but I would love to find a better solution.

See example in the playground I made:

```<code>import UIKit

class BaseModel {

    var id: Int

    init(id: Int) {
        self.id = id
    }
}

final class PersonModel: BaseModel {

    var firstName: String
    var surname: String

    init(id: Int, firstName: String, surname:String) {

        self.firstName = firstName
        self.surname = surname

        super.init(id: id)
    }
}

func genericsTest<C: BaseModel>(with object: C) {
    print("Class type: \(C.self)")
}

var person0 = PersonModel(id: 0, firstName: "John", surname: "Doe")

genericsTest(with: person0)
// This prints: "Class type: PersonModel"

var person1 = PersonModel(id: 1, firstName: "John1", surname: "Doe")
var person2 = PersonModel(id: 2, firstName: "John2", surname: "Doe")
var person3 = PersonModel(id: 3, firstName: "John3", surname: "Doe")

var personArray: [BaseModel] = [person0, person1, person2, person3]

for person in personArray {
    print("Class type in for loop: \(person.self)")
    // This prints: "Class type in for loop: __lldb_expr_195.PersonModel"
    genericsTest(with: person)
    // This prints: "Class type: BaseModel"
}
</code>```

So in the for loop if I print the object.self I get the class I expect but in the function with generics do the same call I get the base class.

Edit 1:

So if it would be possible to make Generic C the type of the final model I would be able to create thing like:

```<code>func genericsTest<C: BaseModel>(with type: C.Type, and object: C) {
    let test = KeyPath<C, Int>
}
</code>```

Just as example

答:
Have a look at this
Question

You define a array of type 'BaseModel' so in your for loop it basically is saying

```<code>for let person: BaseModel in personArray
</code>```

Making person of type BaseModel

In the function:

```<code>func genericsTest<C: BaseModel>(with object: C) {
    print("Class type: \(C.self)")
}
</code>```

You are using the type, in contrary in this code:

```<code>print("Class type in for loop: \(model.self)")
</code>```

You are using the object. If you change the C to object you will get the same result.

Do remember if you going to use this in you project to determine what type of object this is. You need to seriously go back to your drawing board. Because this is not OOP!

Body:
So I walk against this problem.

I have a BaseModel with some variables inside and a few normal "final" Models that inherit from the BaseModel.

If I have an array with class BaseModel with inside a few final models, and then loop trough those models and sent them to a function that uses generics. And check the class of the generics I get back they are from class BaseModel instead of the final class model that I need. How can I retrieve in a dynamic way the class of the final model. And of course I could cast them, but I would love to find a better solution.

See example in the playground I made:

import UIKit

class BaseModel {

    var id: Int

    init(id: Int) {
        self.id = id
    }
}

final class PersonModel: BaseModel {

    var firstName: String
    var surname: String

    init(id: Int, firstName: String, surname:String) {

        self.firstName = firstName
        self.surname = surname

        super.init(id: id)
    }
}

func genericsTest<C: BaseModel>(with object: C) {
    print("Class type: \(C.self)")
}

var person0 = PersonModel(id: 0, firstName: "John", surname: "Doe")

genericsTest(with: person0)
// This prints: "Class type: PersonModel"

var person1 = PersonModel(id: 1, firstName: "John1", surname: "Doe")
var person2 = PersonModel(id: 2, firstName: "John2", surname: "Doe")
var person3 = PersonModel(id: 3, firstName: "John3", surname: "Doe")

var personArray: [BaseModel] = [person0, person1, person2, person3]

for person in personArray {
    print("Class type in for loop: \(person.self)")
    // This prints: "Class type in for loop: __lldb_expr_195.PersonModel"
    genericsTest(with: person)
    // This prints: "Class type: BaseModel"
}

So in the for loop if I print the object.self I get the class I expect but in the function with generics do the same call I get the base class.

Edit 1:

So if it would be possible to make Generic C the type of the final model I would be able to create thing like:

func genericsTest<C: BaseModel>(with type: C.Type, and object: C) {
    let test = KeyPath<C, Int>
}

Just as example

Body:
Have a look at this
Question

You define a array of type 'BaseModel' so in your for loop it basically is saying

for let person: BaseModel in personArray

Making person of type BaseModel

In the function:

func genericsTest<C: BaseModel>(with object: C) {
    print("Class type: \(C.self)")
}

You are using the type, in contrary in this code:

print("Class type in for loop: \(model.self)")

You are using the object. If you change the C to object you will get the same result.

Do remember if you going to use this in you project to determine what type of object this is. You need to seriously go back to your drawing board. Because this is not OOP!


问:
How to do math operation on imported csv data?
I have read in a csv file ('Air.csv') and have performed some operations to get rid of the header (not important). Then, I used dB_a.append(row[1]) to put this column of the csv data into an array which I could later plot.

This data is dB data, and I want to convert this to power using the simple equation P = 10^(dB/10) for every value. I am new to Python, so I don't quite understand how operations within arrays, lists, etc. works. I think there is something I need to do to iterate over that full data set, which was my attempt at a for loop, but I am still receiving errors. Any suggestions?

Thank you!

```<code>frequency_a=[]
dB_a=[]

a = csv.reader(open('Air.csv'))

for row in itertools.islice(a, 18, 219):
       frequency_a.append(row[0])
       dB_a.append(row[1])
       #print(frequency_a)
       print(dB_a)

for item in dB_a:
    power_a = 10**(dB_a/10)
    print(power_a)
</code>```

答:
To build on the answer @ed Jaras posted.

power_a = [10*(db/10) for db in dB_a]
is not correct, since this divides by 10, and then multiplies by the same.

It should be:
power_a = [10**(db/10) for db in dB_a]

Credits still go to @Ed Jaras though

Note:
If you're wondering what this [something for something in a list] is, it is a list comprehension. They are amazingly elegant constructs that python allows.

What is basically means is [..Add this element to the result.. for ..my element.. in ..a list..].

You can even add conditionals to them if you want.

If you want to read more about them, I suggest checking out:
http://www.secnetix.de/olli/Python/list_comprehensions.hawk

Addition:
@k-schneider: You are probably doing numerical operations (dividing, power, etc. ) on a string, this is because when importing a csv, it is possible for fields to be imported as a string.
To make sure that you are working with integers, you can cast db to a string by doing:
str(db)

Body:
I have read in a csv file ('Air.csv') and have performed some operations to get rid of the header (not important). Then, I used dB_a.append(row[1]) to put this column of the csv data into an array which I could later plot.

This data is dB data, and I want to convert this to power using the simple equation P = 10^(dB/10) for every value. I am new to Python, so I don't quite understand how operations within arrays, lists, etc. works. I think there is something I need to do to iterate over that full data set, which was my attempt at a for loop, but I am still receiving errors. Any suggestions?

Thank you!

frequency_a=[]
dB_a=[]

a = csv.reader(open('Air.csv'))

for row in itertools.islice(a, 18, 219):
       frequency_a.append(row[0])
       dB_a.append(row[1])
       #print(frequency_a)
       print(dB_a)

for item in dB_a:
    power_a = 10**(dB_a/10)
    print(power_a)


问:
converting a tuple consisting of floats and text to one single string
I'm trying to convert a tuple consisting of 2 floats and 3 parts of text to one string so I can use it in file.write() because it is not accepting tuples.

```<code>testr = 'you went' ,speed ,'mph and stopped in' ,stop ,'meters'
test = open('testresults.txt' ,'w')
test.write(testr)
test.close()
</code>```

whenever I try to run the program it gives me this

```<code>    test.write(testr)
TypeError: must be str, not tuple
</code>```

答:
Unlike the other answers, this will take your proposed tuple:

```<code>testr = 'you went' ,speed ,'mph and stopped in' ,stop ,'meters'
test = open('testresults.txt' ,'w')
test.write(" ".join(str(i)for i in testr))
test.close()
</code>```

As only the third line is different from your code, here goes the explanation:

first str(i)for i in testr:

the inline for-loop is known in python as a list comprhension. It just iterates over your testr tuple, returning the values one by one. str(i) is a typecast, it tries to convert i into a string. This is necessary as in your tuple some entries are String-type and some variables are some type of number, likely Float or Integer. See str(), float() and int() for further reading.

Then " ".join(...):

This is a function of the string type that takes a list or tuple of strings and, as the name sugests, joins it together seperated by the substring it acts upon, the part in front of the dot(" "). This to me always felt a little weird, or inside-out perhaps, but it is a very usefull function nonetheless!

I hope this helps!

Body:
I'm trying to convert a tuple consisting of 2 floats and 3 parts of text to one string so I can use it in file.write() because it is not accepting tuples.

testr = 'you went' ,speed ,'mph and stopped in' ,stop ,'meters'
test = open('testresults.txt' ,'w')
test.write(testr)
test.close()

whenever I try to run the program it gives me this

    test.write(testr)
TypeError: must be str, not tuple

Body:
Unlike the other answers, this will take your proposed tuple:

testr = 'you went' ,speed ,'mph and stopped in' ,stop ,'meters'
test = open('testresults.txt' ,'w')
test.write(" ".join(str(i)for i in testr))
test.close()

As only the third line is different from your code, here goes the explanation:

first str(i)for i in testr:

the inline for-loop is known in python as a list comprhension. It just iterates over your testr tuple, returning the values one by one. str(i) is a typecast, it tries to convert i into a string. This is necessary as in your tuple some entries are String-type and some variables are some type of number, likely Float or Integer. See str(), float() and int() for further reading.

Then " ".join(...):

This is a function of the string type that takes a list or tuple of strings and, as the name sugests, joins it together seperated by the substring it acts upon, the part in front of the dot(" "). This to me always felt a little weird, or inside-out perhaps, but it is a very usefull function nonetheless!

I hope this helps!


问:
Issue with creating shaped div at 100% width
I am trying to create diagonal div, at the bottom of another div. It should look like this: http://storage8.static.itmages.com/i/17/0706/h_1499339517_4995911_421bf6ae42.png.

I have problem when I adding 100vw value to my border-left, because horizontal scrollbar appears on my website. I also tried use Jquery to find the width of the body. It works but when I resize my browser, border width does not change. Any suggestions how to fix it?

     var actualInnerWidth = $(".background-gradient").prop("clientWidth");
$('.background-gradient').css({
   'border-top':'50px solid red',
   'border-left': actualInnerWidth + 'px solid transparent'
}); ```
<pre class="snippet-code-css lang-css prettyprint-override"><code>    .banner {
   min-height: 50vh;
   margin: 0;
   padding:0;
   background-color: red;
 }
.background-gradient {
   width:100%;
   height:50px;
   background-color:yellow;
 }</code>```

```

Here is jsfiddle: https://jsfiddle.net/b49mmm9a/1/

答:
Try This i think you find this

.box {
  background-color: skyblue;
  margin-top: 40px;
  padding: 1% 20px;
  /* Added a percentage value for top/bottom
            padding to keep
            the wrapper inside of the parent */
  -webkit-transform: skewY(-5deg);
  -moz-transform: skewY(-5deg);
  -ms-transform: skewY(-5deg);
  -o-transform: skewY(-5deg);
  transform: skewY(-5deg);
}

.box>.wrapper {
  -webkit-transform: skewY(5deg);
  -moz-transform: skewY(5deg);
  -ms-transform: skewY(5deg);
  -o-transform: skewY(5deg);
  transform: skewY(5deg);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="box">
  <div class="wrapper">
    <h1>This is a heading</h1>
    <p>This is a sub-heading</p>
    <p>

      How do I draw a Diagonal div?
      </a>
    </p>
  </div>
</div></code>```

http://jsbin.com/daruruhola/edit?html,css,js,output

Body:
I am trying to create diagonal div, at the bottom of another div. It should look like this: http://storage8.static.itmages.com/i/17/0706/h_1499339517_4995911_421bf6ae42.png.

I have problem when I adding 100vw value to my border-left, because horizontal scrollbar appears on my website. I also tried use Jquery to find the width of the body. It works but when I resize my browser, border width does not change. Any suggestions how to fix it?

     var actualInnerWidth = $(".background-gradient").prop("clientWidth");
$('.background-gradient').css({
   'border-top':'50px solid red',
   'border-left': actualInnerWidth + 'px solid transparent'
});

    .banner {
   min-height: 50vh;
   margin: 0;
   padding:0;
   background-color: red;
 }
.background-gradient {
   width:100%;
   height:50px;
   background-color:yellow;
 }

Here is jsfiddle: https://jsfiddle.net/b49mmm9a/1/

Body:
Try This i think you find this

.box {
  background-color: skyblue;
  margin-top: 40px;
  padding: 1% 20px;
  /* Added a percentage value for top/bottom
            padding to keep
            the wrapper inside of the parent */
  -webkit-transform: skewY(-5deg);
  -moz-transform: skewY(-5deg);
  -ms-transform: skewY(-5deg);
  -o-transform: skewY(-5deg);
  transform: skewY(-5deg);
}

.box>.wrapper {
  -webkit-transform: skewY(5deg);
  -moz-transform: skewY(5deg);
  -ms-transform: skewY(5deg);
  -o-transform: skewY(5deg);
  transform: skewY(5deg);
}

<div class="box">
  <div class="wrapper">
    <h1>This is a heading</h1>
    <p>This is a sub-heading</p>
    <p>

      How do I draw a Diagonal div?
      </a>
    </p>
  </div>
</div>

http://jsbin.com/daruruhola/edit?html,css,js,output


问:
How do I convert Unicode escape sequences to text in PHP?
I have this Unicode sequence: \u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059. How do I convert it into text?

```<code>$unicode = '\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059';
</code>```

I tried:

```<code>echo $utf8-decode(unicode);
</code>```

and I tried:

```<code>echo mb_convert_encoding($unicode , 'US-ASCII', 'UTF-8');
</code>```

and I tried:

```<code>echo htmlentities($unicode , ENT_COMPAT, "UTF-8");
</code>```

but none of these functions convert the sequence into the corresponding Japanese text.

答:
PHP 7+

As of PHP 7, you can use the Unicode codepoint escape syntax to do this.

echo "\u{304a}\u{306f}\u{3088}\u{3046}\u{3054}\u{3056}\u{3044}\u{307e}\u{3059}"; outputs おはようございます.

Body:
I have this Unicode sequence: \u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059. How do I convert it into text?

$unicode = '\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059';

I tried:

echo $utf8-decode(unicode);

and I tried:

echo mb_convert_encoding($unicode , 'US-ASCII', 'UTF-8');

and I tried:

echo htmlentities($unicode , ENT_COMPAT, "UTF-8");

but none of these functions convert the sequence into the corresponding Japanese text.


问:
Haxe for loop only uses last item
After some hours doing some testing I figured out that my map contains the correct values, but the loop that I am using only seems to be using the last added value in this map. Am I missing something obvious here?

The function that adds items to the map: (controls is the map variable)

```<code>public static function CreateThumbstick(mActorType:ActorType, mLocation:Int, mDirectionLock:Int)
    {
        var controllerName = "Thumbstick"+mLocation;
        if(!controls.exists(controllerName)){

            createRecycledActor(mActorType, 0, 0, Script.FRONT);
            var lastActor = getLastCreatedActor();
            var myPosition = GetPosition(controllerName, lastActor);
            lastActor.setX(myPosition.x);
            lastActor.setY(myPosition.y);
            var myPos = new Vector2(lastActor.getXCenter(), lastActor.getYCenter());
            var controlUnit = new ControlUnit(lastActor, myPos, -1);
            controls.set(controllerName, controlUnit);

            trace("added key: " + controllerName +" with value: "+ lastActor);
        } else {
            trace("!!WARNING!! Control unit already exists in this position. Command ignored!");
        }
    }
</code>```

Upon creating 3 thumbsticks, the log states the following:

```<code>added key: Thumbstick1 with value: [Actor 1,Thumbstick]
added key: Thumbstick2 with value: [Actor 2,Thumbstick]
added key: Thumbstick3 with value: [Actor 3,Thumbstick]
</code>```

When the screen is touched, it should loop through each item in my map, but it is using the last added item 3 times to check the distance with, rather then all 3 items once. Here is the Listener that is being called when the screen is touched:

```<code>addMultiTouchStartListener(function(event:TouchEvent, list:Array<Dynamic>):Void
        {
            for (unit in controls){
                trace(lastDebugLine + "checking distance to " + unit.GetActor());
                if(GetDistance(unit.GetCenter(), touch.GetPosition()) < 64){
                    break;
                }
            }
        });
// used "touch.GetPosition()" instead of actuall code for easy reading. This is not causing any problems!
</code>```

Upon touching the screen, the log states the following:

```<code>checking distance to [Actor 3,Thumbstick]
checking distance to [Actor 3,Thumbstick]
checking distance to [Actor 3,Thumbstick]
</code>```

I am quite new to the Haxe language, so my guess is that I am missing something obvious, even after I have followed the Haxe API very closely. This is the example used from the Haxe API page:

```<code>var map4 = ["M"=>"Monday", "T"=>"Tuesday"];
for (value in map4) {
    trace(value); // Monday \n Tuesday
}
</code>```

All explanations are welcome!

Added ControlUnit class:

```<code>import com.stencyl.models.Actor;

class ControlUnit
{
    static var actor;
    static var center;
    static var touchID;

    public function new(mActor:Actor, mPosition:Vector2, mTouchID:Int)
    {
        actor = mActor;
        center = mPosition;
        touchID = mTouchID;
    }

    public function GetActor():Actor{
        return(actor);
    }

    public function GetCenter():Vector2{
        return(center);
    }

    public function GetTouchID():Int{
        return(touchID);
    }
}
</code>```

答: Isn't that because all of your keys map to the same value? Try mapping them to different values and test it.</p>

Title: Haxe for loop only uses last item

Body:
After some hours doing some testing I figured out that my map contains the correct values, but the loop that I am using only seems to be using the last added value in this map. Am I missing something obvious here?

The function that adds items to the map: (controls is the map variable)

public static function CreateThumbstick(mActorType:ActorType, mLocation:Int, mDirectionLock:Int)
    {
        var controllerName = "Thumbstick"+mLocation;
        if(!controls.exists(controllerName)){

            createRecycledActor(mActorType, 0, 0, Script.FRONT);
            var lastActor = getLastCreatedActor();
            var myPosition = GetPosition(controllerName, lastActor);
            lastActor.setX(myPosition.x);
            lastActor.setY(myPosition.y);
            var myPos = new Vector2(lastActor.getXCenter(), lastActor.getYCenter());
            var controlUnit = new ControlUnit(lastActor, myPos, -1);
            controls.set(controllerName, controlUnit);

            trace("added key: " + controllerName +" with value: "+ lastActor);
        } else {
            trace("!!WARNING!! Control unit already exists in this position. Command ignored!");
        }
    }

Upon creating 3 thumbsticks, the log states the following:

added key: Thumbstick1 with value: [Actor 1,Thumbstick]
added key: Thumbstick2 with value: [Actor 2,Thumbstick]
added key: Thumbstick3 with value: [Actor 3,Thumbstick]

When the screen is touched, it should loop through each item in my map, but it is using the last added item 3 times to check the distance with, rather then all 3 items once. Here is the Listener that is being called when the screen is touched:

addMultiTouchStartListener(function(event:TouchEvent, list:Array<Dynamic>):Void
        {
            for (unit in controls){
                trace(lastDebugLine + "checking distance to " + unit.GetActor());
                if(GetDistance(unit.GetCenter(), touch.GetPosition()) < 64){
                    break;
                }
            }
        });
// used "touch.GetPosition()" instead of actuall code for easy reading. This is not causing any problems!

Upon touching the screen, the log states the following:

checking distance to [Actor 3,Thumbstick]
checking distance to [Actor 3,Thumbstick]
checking distance to [Actor 3,Thumbstick]

I am quite new to the Haxe language, so my guess is that I am missing something obvious, even after I have followed the Haxe API very closely. This is the example used from the Haxe API page:

var map4 = ["M"=>"Monday", "T"=>"Tuesday"];
for (value in map4) {
    trace(value); // Monday \n Tuesday
}

All explanations are welcome!

Added ControlUnit class:

import com.stencyl.models.Actor;

class ControlUnit
{
    static var actor;
    static var center;
    static var touchID;

    public function new(mActor:Actor, mPosition:Vector2, mTouchID:Int)
    {
        actor = mActor;
        center = mPosition;
        touchID = mTouchID;
    }

    public function GetActor():Actor{
        return(actor);
    }

    public function GetCenter():Vector2{
        return(center);
    }

    public function GetTouchID():Int{
        return(touchID);
    }
}


问:
Update Query is being skipped in if statement vb.net
I don't now why the method is being skipped in the if statement Can anybody help me with this problem?

here's the update sql query

```<code>    Public Sub Edituser()
   conn()
   dbconn.Open()
    sql = "UPDATE player SET First Name=@1 Last Name=@2, Gender=@3, Date of Birth=@4, Civil Status=@5, Nationality=@6, Address=@7, Status=@8 WHERE ID = " + TextBox8.Text + ""
    Try
        dbcomm = New MySqlCommand(sql, dbconn)
        dbcomm.Parameters.Add(New MySqlParameter("@1", TextBox1.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@2", TextBox2.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@3", TextBox9.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@4", TextBox3.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@5", TextBox4.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@6", TextBox5.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@7", TextBox6.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@8", TextBox7.Text))
        dbread = dbcomm.ExecuteReader()
        dbread.Close()
        MsgBox("Successfully updated!")
    Catch ex As Exception
    Finally
        dbconn.Close()
    End Try
End Sub
</code>```

and here's the if statement

```<code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Or TextBox7.Text = "" Or TextBox9.Text = "" Then
        MsgBox("Please complete all the fields")
    Else
        Dim result As Integer = MessageBox.Show("Are you sure you want to Edit the information?", "Update", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
        If result = DialogResult.OK Then

            Edituser()

            MsgBox(" Player information Updated!")
            Me.Close()
            Player.Show()
        End If

    End If
End Sub
</code>```

Thanks in advance.

答:
Your UPDATE statement is syntactically wrong as it's missing , and proper quoting for column names as pointed below

```<code>sql = "UPDATE player SET `First Name`=@1, `Last Name`=@2, Gender=@3, `Date of Birth`=@4,
</code>```

Body:
I don't now why the method is being skipped in the if statement Can anybody help me with this problem?

here's the update sql query

    Public Sub Edituser()
   conn()
   dbconn.Open()
    sql = "UPDATE player SET First Name=@1 Last Name=@2, Gender=@3, Date of Birth=@4, Civil Status=@5, Nationality=@6, Address=@7, Status=@8 WHERE ID = " + TextBox8.Text + ""
    Try
        dbcomm = New MySqlCommand(sql, dbconn)
        dbcomm.Parameters.Add(New MySqlParameter("@1", TextBox1.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@2", TextBox2.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@3", TextBox9.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@4", TextBox3.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@5", TextBox4.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@6", TextBox5.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@7", TextBox6.Text))
        dbcomm.Parameters.Add(New MySqlParameter("@8", TextBox7.Text))
        dbread = dbcomm.ExecuteReader()
        dbread.Close()
        MsgBox("Successfully updated!")
    Catch ex As Exception
    Finally
        dbconn.Close()
    End Try
End Sub

and here's the if statement

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Or TextBox7.Text = "" Or TextBox9.Text = "" Then
        MsgBox("Please complete all the fields")
    Else
        Dim result As Integer = MessageBox.Show("Are you sure you want to Edit the information?", "Update", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
        If result = DialogResult.OK Then

            Edituser()

            MsgBox(" Player information Updated!")
            Me.Close()
            Player.Show()
        End If

    End If
End Sub

Thanks in advance.

Body:
Your UPDATE statement is syntactically wrong as it's missing , and proper quoting for column names as pointed below

sql = "UPDATE player SET `First Name`=@1, `Last Name`=@2, Gender=@3, `Date of Birth`=@4,


问:
how can i write as one query to get count in mysql

I want to get the today count of users and yesterday's users count for that i want to write only one query how can i do that..?

these are my queries I want only one query:

```<code>SELECT COUNT(*) FROM visitors group by visited_date ORDER by visited_date DESC limit 1,1 as todayCount

SELECT COUNT(*) FROM visitors group by visited_date ORDER by visited_date DESC limit 1,0 as yesterdayCount
</code>```

My expected results or only 2 columns

```<code>todayCount yesterdayCount
     2          4
</code>```

答:
If you know the current and previous date, then you can do:

```<code>SELECT SUM(visited_date = CURDATE()) as today,
       SUM(visited_date = CURDATE() - interval 1 day) as yesterday
FROM visitors
WHERE visited_date >= CURDATE() - interval 1 day;
</code>```

If you don't know the two days, then you can do something similar, getting the latest date in the data:

```<code>SELECT SUM(v.visited_date = m.max_vd) as today,
       SUM(v.visited_date < m.max_vd) as yesterday
FROM visitors v CROSS JOIN
     (SELECT MAX(v2.visited_date) as max_vd FROM visitors v2) as m
WHERE v.visited_date >= m.max_vd - interval 1 day
</code>```

Body:
I want to get the today count of users and yesterday's users count for that i want to write only one query how can i do that..?

these are my queries I want only one query:

SELECT COUNT(*) FROM visitors group by visited_date ORDER by visited_date DESC limit 1,1 as todayCount

SELECT COUNT(*) FROM visitors group by visited_date ORDER by visited_date DESC limit 1,0 as yesterdayCount

My expected results or only 2 columns

todayCount yesterdayCount
     2          4

Body:
If you know the current and previous date, then you can do:

SELECT SUM(visited_date = CURDATE()) as today,
       SUM(visited_date = CURDATE() - interval 1 day) as yesterday
FROM visitors
WHERE visited_date >= CURDATE() - interval 1 day;

If you don't know the two days, then you can do something similar, getting the latest date in the data:

SELECT SUM(v.visited_date = m.max_vd) as today,
       SUM(v.visited_date < m.max_vd) as yesterday
FROM visitors v CROSS JOIN
     (SELECT MAX(v2.visited_date) as max_vd FROM visitors v2) as m
WHERE v.visited_date >= m.max_vd - interval 1 day


问:
Why the hover on the title it's not showing?
The hover I've added to the title it's not showing.
I tried to add hover only to the .div class and later on add hover to the  on the #titulo id.
This is the layout that I'm trying to copy for practice Layout .

P.D Sorry for my english.

@import "normalize.css";

/****************************
            GENERAL
 ****************************/

body {
  font-family: sans-serif;
  background-color: rgb(246, 245, 241);
  max-width: 100%;
  width: 800px;
  margin: 0 auto;
}

.div a {
  color: rgb(185, 56, 78);
}

#titulo:hover {
  color: #B9384E;
}

.div a:hover {
  background-color: #B9384E;
  color: white;
  text-decoration: none;
}

/****************************
            HEADING
 ****************************/

header {
  font-family: 'Oswald', sans-serif;
}

h1 {
  font-weight: bold;
  font-size: 3em;
}

h1,
h2 {
  padding: 0;
  margin: 0.15em;
}

#titulo a {
  color: black;
  text-decoration: none;
}

h3 {
  color: rgb(185, 56, 78);
  font-size: 1.5em;
  padding-top: 30px;
}

h3,
h4 {
  margin: 3px;
}

h2 span {
  text-decoration: line-through;
}

/****************************
            NAVIGATION
 ****************************/

.selected {
  background-color: rgb(185, 56, 78);
  border-bottom-left-radius: 5px;
  border-top-left-radius: 5px;
}

nav {
  text-align: left;
  background-color: black;
  color: #fff;
  font-size: 1.25em;
  border-radius: 5px;
}

nav ul {
  list-style: none;
  padding-left: 0;
}

nav li {
  display: inline-block;
  padding: 10px 25px 10px 25px;
}

nav li a {
  color: white;
  text-decoration: none;
}

nav li:hover {
  background-color: rgb(185, 56, 78);
}

/****************************
            DIV
 ****************************/

#primary-content,
#secondary-content,
#info {
  background-color: white;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  border-radius: 20px;
  max-height: 100%;
}

#primary-content img {
  border: 2px solid rgb(246, 245, 241);
  margin: 30px 20px 30px 70px;
}

#primary-content,
#secondary-content,
#pollassociales,
#info {
  margin-bottom: 30px;
}

#blogroll {
  width: 75%;
  float: left;
}

#social {
  float: right;
  width: 25%;
}

#info {
  clear: both;
}

#parrafo {
  float: left;
  clear: both;
  width: 50%;
  padding-left: 10px;
}

#primary-content {
  padding-left: 10px;
}

#primary-content p {
  font-size: 0.9em;
}

/****************************
        UNORDERED LIST
****************************/

#columnas {
  -webkit-column-count: 3;
  -moz-column-count: 3;
  column-count: 3;
  padding: 0;
}

#pollassociales h5 {
  width: 14.7%;
}

#pollassociales li {
  font-size: 0.8em;
  width: 85.3%;
  padding: 10px 5% 10px 0;
  list-style: none;
}

/****************************
            FOOTER
 ****************************/

footer p {
  float: right;
}

/****************************
        PAGE:HOME
 ****************************/

/****************************
            COLORS
 ****************************/```
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <title>Smashing HTML5!</title>
  <link rel="stylesheet" href="css/main.css" type="text/css" />
  <link href="https://fonts.googleapis.com/css?family=Oswald:400,700" rel="stylesheet">
</head>

<body id="index" class="home">
  <header>
    <div id="titulo">
      <h1>
        Smashing HTML5!
      </h1>
      <h2>
        HTML5 in the year <span>2022</span> 2009
      </h2>
    </div>
    <nav>
      <ul>
        <li class="selected">home</li>
        <li>portfolio</li>
        <li>blog</li>
        <li>contact</li>
      </ul>
    </nav>
  </header>
  <div class="div" id="primary-content">
    <div id="parrafo">
      <h3>Featured Article</h3>
      <h4>HTML5 in Smashing Magazine</h4>
      <p>Discover how to use Graceful Degradation and Progressive Enhancement techniques to achieve an outstanding, cross-browser HTML5 and CSS3 website today!</p>
    </div>
    <div id="imagen">
      <img src="img/sm-logo.gif">
    </div>

  </div>
  <div class="div" id="secondary-content">
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By Enrique Ramírez</p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By Enrique Ramírez</p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By Enrique Ramírez</p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
  </div>
  <div id="pollassociales" class="div">
    <div id="blogroll">
      <h5>blogroll</h5>
      <ul id="columnas">
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
      </ul>
    </div>
    <div id="social">
      <h5>social</h5>
      <ul>
        <li>delicious</li>
        <li>digg</li>
        <li>facebook</li>
        <li>last.fm</li>
        <li>rss</li>
        <li>twitter</li>
      </ul>
    </div>
  </div>
  <div class="div" id="info">
    <h4>Smashing Magazine</h4>
    <p>Amazing Magazine</p>
    <img src="img/avatar.gif">
    <p>Smashing Magazine is a website and blog that offers resources and advice to web developers and web designers. It was founded by Sven Lennartz and Vitaly Friedman.</p>
  </div>
  <footer class="div">
    <p>2005-2009 Smashing Magazine.</p>
  </footer>
</body>

</html></code>```

答:
The color is not showing because it gets overwritten by:

```<code>#titulo a {
    color: black;
    text-decoration: none;
}
</code>```

I added the snippet below to the bottom of the css, because it is at the bottom it will overwrite the previous css rules.

```<code>#titulo:hover a {
  color: #B9384E;
}
</code>```

@import "normalize.css";

/****************************
            GENERAL
 ****************************/

body {
  font-family: sans-serif;
  background-color: rgb(246, 245, 241);
  max-width: 100%;
  width: 800px;
  margin: 0 auto;
}

.div a {
  color: rgb(185, 56, 78);
}

.div a:hover {
  background-color: #B9384E;
  color: white;
  text-decoration: none;
}

/****************************
            HEADING
 ****************************/

header {
  font-family: 'Oswald', sans-serif;
}

h1 {
  font-weight: bold;
  font-size: 3em;
}

h1,
h2 {
  padding: 0;
  margin: 0.15em;
}

#titulo a {
  color: black;
  text-decoration: none;
}

h3 {
  color: rgb(185, 56, 78);
  font-size: 1.5em;
  padding-top: 30px;
}

h3,
h4 {
  margin: 3px;
}

h2 span {
  text-decoration: line-through;
}

/****************************
            NAVIGATION
 ****************************/

.selected {
  background-color: rgb(185, 56, 78);
  border-bottom-left-radius: 5px;
  border-top-left-radius: 5px;
}

nav {
  text-align: left;
  background-color: black;
  color: #fff;
  font-size: 1.25em;
  border-radius: 5px;
}

nav ul {
  list-style: none;
  padding-left: 0;
}

nav li {
  display: inline-block;
  padding: 10px 25px 10px 25px;
}

nav li a {
  color: white;
  text-decoration: none;
}

nav li:hover {
  background-color: rgb(185, 56, 78);
}

/****************************
            DIV
 ****************************/

#primary-content,
#secondary-content,
#info {
  background-color: white;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  border-radius: 20px;
  max-height: 100%;
}

#primary-content img {
  border: 2px solid rgb(246, 245, 241);
  margin: 30px 20px 30px 70px;
}

#primary-content,
#secondary-content,
#pollassociales,
#info {
  margin-bottom: 30px;
}

#blogroll {
  width: 75%;
  float: left;
}

#social {
  float: right;
  width: 25%;
}

#info {
  clear: both;
}

#parrafo {
  float: left;
  clear: both;
  width: 50%;
  padding-left: 10px;
}

#primary-content {
  padding-left: 10px;
}

#primary-content p {
  font-size: 0.9em;
}

/****************************
        UNORDERED LIST
****************************/

#columnas {
  -webkit-column-count: 3;
  -moz-column-count: 3;
  column-count: 3;
  padding: 0;
}

#pollassociales h5 {
  width: 14.7%;
}

#pollassociales li {
  font-size: 0.8em;
  width: 85.3%;
  padding: 10px 5% 10px 0;
  list-style: none;
}

/****************************
            FOOTER
 ****************************/

footer p {
  float: right;
}

/****************************
        PAGE:HOME
 ****************************/

/****************************
            COLORS
 ****************************/

#titulo:hover a {
  color: #B9384E;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <title>Smashing HTML5!</title>
  <link rel="stylesheet" href="css/main.css" type="text/css" />
  <link href="https://fonts.googleapis.com/css?family=Oswald:400,700" rel="stylesheet">
</head>

<body id="index" class="home">
  <header>
    <div id="titulo">
      <h1>
        Smashing HTML5!
      </h1>
      <h2>
        HTML5 in the year <span>2022</span> 2009
      </h2>
    </div>
    <nav>
      <ul>
        <li class="selected">home</li>
        <li>portfolio</li>
        <li>blog</li>
        <li>contact</li>
      </ul>
    </nav>
  </header>
  <div class="div" id="primary-content">
    <div id="parrafo">
      <h3>Featured Article</h3>
      <h4>HTML5 in Smashing Magazine</h4>
      <p>Discover how to use Graceful Degradation and Progressive Enhancement techniques to achieve an outstanding, cross-browser HTML5 and CSS3 website today!</p>
    </div>
    <div id="imagen">
      <img src="img/sm-logo.gif">
    </div>

  </div>
  <div class="div" id="secondary-content">
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By Enrique Ramírez</p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By Enrique Ramírez</p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By Enrique Ramírez</p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
  </div>
  <div id="pollassociales" class="div">
    <div id="blogroll">
      <h5>blogroll</h5>
      <ul id="columnas">
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
      </ul>
    </div>
    <div id="social">
      <h5>social</h5>
      <ul>
        <li>delicious</li>
        <li>digg</li>
        <li>facebook</li>
        <li>last.fm</li>
        <li>rss</li>
        <li>twitter</li>
      </ul>
    </div>
  </div>
  <div class="div" id="info">
    <h4>Smashing Magazine</h4>
    <p>Amazing Magazine</p>
    <img src="img/avatar.gif">
    <p>Smashing Magazine is a website and blog that offers resources and advice to web developers and web designers. It was founded by Sven Lennartz and Vitaly Friedman.</p>
  </div>
  <footer class="div">
    <p>2005-2009 Smashing Magazine.</p>
  </footer>
</body>

</html></code>```

Body:
The hover I've added to the title it's not showing.
I tried to add hover only to the .div class and later on add hover to the  on the #titulo id.
This is the layout that I'm trying to copy for practice Layout .

P.D Sorry for my english.

@import "normalize.css";

/****************************
            GENERAL
 ****************************/

body {
  font-family: sans-serif;
  background-color: rgb(246, 245, 241);
  max-width: 100%;
  width: 800px;
  margin: 0 auto;
}

.div a {
  color: rgb(185, 56, 78);
}

#titulo:hover {
  color: #B9384E;
}

.div a:hover {
  background-color: #B9384E;
  color: white;
  text-decoration: none;
}

/****************************
            HEADING
 ****************************/

header {
  font-family: 'Oswald', sans-serif;
}

h1 {
  font-weight: bold;
  font-size: 3em;
}

h1,
h2 {
  padding: 0;
  margin: 0.15em;
}

#titulo a {
  color: black;
  text-decoration: none;
}

h3 {
  color: rgb(185, 56, 78);
  font-size: 1.5em;
  padding-top: 30px;
}

h3,
h4 {
  margin: 3px;
}

h2 span {
  text-decoration: line-through;
}

/****************************
            NAVIGATION
 ****************************/

.selected {
  background-color: rgb(185, 56, 78);
  border-bottom-left-radius: 5px;
  border-top-left-radius: 5px;
}

nav {
  text-align: left;
  background-color: black;
  color: #fff;
  font-size: 1.25em;
  border-radius: 5px;
}

nav ul {
  list-style: none;
  padding-left: 0;
}

nav li {
  display: inline-block;
  padding: 10px 25px 10px 25px;
}

nav li a {
  color: white;
  text-decoration: none;
}

nav li:hover {
  background-color: rgb(185, 56, 78);
}

/****************************
            DIV
 ****************************/

#primary-content,
#secondary-content,
#info {
  background-color: white;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  border-radius: 20px;
  max-height: 100%;
}

#primary-content img {
  border: 2px solid rgb(246, 245, 241);
  margin: 30px 20px 30px 70px;
}

#primary-content,
#secondary-content,
#pollassociales,
#info {
  margin-bottom: 30px;
}

#blogroll {
  width: 75%;
  float: left;
}

#social {
  float: right;
  width: 25%;
}

#info {
  clear: both;
}

#parrafo {
  float: left;
  clear: both;
  width: 50%;
  padding-left: 10px;
}

#primary-content {
  padding-left: 10px;
}

#primary-content p {
  font-size: 0.9em;
}

/****************************
        UNORDERED LIST
****************************/

#columnas {
  -webkit-column-count: 3;
  -moz-column-count: 3;
  column-count: 3;
  padding: 0;
}

#pollassociales h5 {
  width: 14.7%;
}

#pollassociales li {
  font-size: 0.8em;
  width: 85.3%;
  padding: 10px 5% 10px 0;
  list-style: none;
}

/****************************
            FOOTER
 ****************************/

footer p {
  float: right;
}

/****************************
        PAGE:HOME
 ****************************/

/****************************
            COLORS
 ****************************/

<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>Smashing HTML5!</title>
  <link rel="stylesheet" href="css/main.css" type="text/css" />
  <link href="https://fonts.googleapis.com/css?family=Oswald:400,700" rel="stylesheet">

        Smashing HTML5!

        HTML5 in the year 2022 2009

home

portfolio

blog

contact

Featured Article

HTML5 in Smashing Magazine

Discover how to use Graceful Degradation and Progressive Enhancement techniques to achieve an outstanding, cross-browser HTML5 and CSS3 website today!

        <time datetime="2005/10/10">10th October 2005</time>

By Enrique Ramírez

This be the title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.

        <time datetime="2005/10/10">10th October 2005</time>

By Enrique Ramírez

This be the title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.

        <time datetime="2005/10/10">10th October 2005</time>

By Enrique Ramírez

This be the title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.

blogroll

HTML5 Doctor

W3C

HTML5 Doctor

W3C

HTML5 Doctor

W3C

HTML5 Spec (working draft)

Wordpress

HTML5 Spec (working draft)

Wordpress

HTML5 Spec (working draft)

Wordpress

Smashing Magazine

Wikipedia

Smashing Magazine

Wikipedia

Smashing Magazine

Wikipedia

social

delicious

digg

facebook

last.fm

rss

twitter

Smashing Magazine

Amazing Magazine

Smashing Magazine is a website and blog that offers resources and advice to web developers and web designers. It was founded by Sven Lennartz and Vitaly Friedman.

2005-2009 Smashing Magazine.

Body:
The color is not showing because it gets overwritten by:

#titulo a {
    color: black;
    text-decoration: none;
}

I added the snippet below to the bottom of the css, because it is at the bottom it will overwrite the previous css rules.

#titulo:hover a {
  color: #B9384E;
}

@import "normalize.css";

/****************************
            GENERAL
 ****************************/

body {
  font-family: sans-serif;
  background-color: rgb(246, 245, 241);
  max-width: 100%;
  width: 800px;
  margin: 0 auto;
}

.div a {
  color: rgb(185, 56, 78);
}

.div a:hover {
  background-color: #B9384E;
  color: white;
  text-decoration: none;
}

/****************************
            HEADING
 ****************************/

header {
  font-family: 'Oswald', sans-serif;
}

h1 {
  font-weight: bold;
  font-size: 3em;
}

h1,
h2 {
  padding: 0;
  margin: 0.15em;
}

#titulo a {
  color: black;
  text-decoration: none;
}

h3 {
  color: rgb(185, 56, 78);
  font-size: 1.5em;
  padding-top: 30px;
}

h3,
h4 {
  margin: 3px;
}

h2 span {
  text-decoration: line-through;
}

/****************************
            NAVIGATION
 ****************************/

.selected {
  background-color: rgb(185, 56, 78);
  border-bottom-left-radius: 5px;
  border-top-left-radius: 5px;
}

nav {
  text-align: left;
  background-color: black;
  color: #fff;
  font-size: 1.25em;
  border-radius: 5px;
}

nav ul {
  list-style: none;
  padding-left: 0;
}

nav li {
  display: inline-block;
  padding: 10px 25px 10px 25px;
}

nav li a {
  color: white;
  text-decoration: none;
}

nav li:hover {
  background-color: rgb(185, 56, 78);
}

/****************************
            DIV
 ****************************/

#primary-content,
#secondary-content,
#info {
  background-color: white;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  border-radius: 20px;
  max-height: 100%;
}

#primary-content img {
  border: 2px solid rgb(246, 245, 241);
  margin: 30px 20px 30px 70px;
}

#primary-content,
#secondary-content,
#pollassociales,
#info {
  margin-bottom: 30px;
}

#blogroll {
  width: 75%;
  float: left;
}

#social {
  float: right;
  width: 25%;
}

#info {
  clear: both;
}

#parrafo {
  float: left;
  clear: both;
  width: 50%;
  padding-left: 10px;
}

#primary-content {
  padding-left: 10px;
}

#primary-content p {
  font-size: 0.9em;
}

/****************************
        UNORDERED LIST
****************************/

#columnas {
  -webkit-column-count: 3;
  -moz-column-count: 3;
  column-count: 3;
  padding: 0;
}

#pollassociales h5 {
  width: 14.7%;
}

#pollassociales li {
  font-size: 0.8em;
  width: 85.3%;
  padding: 10px 5% 10px 0;
  list-style: none;
}

/****************************
            FOOTER
 ****************************/

footer p {
  float: right;
}

/****************************
        PAGE:HOME
 ****************************/

/****************************
            COLORS
 ****************************/

#titulo:hover a {
  color: #B9384E;
}

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <title>Smashing HTML5!</title>
  <link rel="stylesheet" href="css/main.css" type="text/css" />
  <link href="https://fonts.googleapis.com/css?family=Oswald:400,700" rel="stylesheet">
</head>

<body id="index" class="home">
  <header>
    <div id="titulo">
      <h1>
        <a href="index.html">Smashing HTML5!</a>
      </h1>
      <h2>
        <a href="index.html">HTML5 in the year <span>2022</span> 2009</a>
      </h2>
    </div>
    <nav>
      <ul>
        <li class="selected"><a href="index.html">home</a></li>
        <li><a href="#">portfolio</a></li>
        <li><a href="#">blog</a></li>
        <li><a href="#">contact</a></li>
      </ul>
    </nav>
  </header>
  <div class="div" id="primary-content">
    <div id="parrafo">
      <h3>Featured Article</h3>
      <h4>HTML5 in Smashing Magazine</h4>
      <p>Discover how to use Graceful Degradation and Progressive Enhancement techniques to achieve an outstanding, cross-browser <a href="https://www.w3.org/html/wg/drafts/html/master/Overview.html" target="_blank">HTML5</a> and <a href="https://www.w3.org/TR/css3-roadmap/"
          target="_blank">CSS3</a> website today!</p>
    </div>
    <div id="imagen">
      <img src="img/sm-logo.gif">
    </div>

  </div>
  <div class="div" id="secondary-content">
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By <a href="index.html">Enrique Ramírez</a></p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo <a href="index.html">non sapien</a> dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By <a href="index.html">Enrique Ramírez</a></p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo <a href="index.html">non sapien</a> dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
    <section>
      <div class="left-column">
        <time datetime="2005/10/10">10th October 2005</time>
        <p>By <a href="index.html">Enrique Ramírez</a></p>
      </div>
      <div class="right-column">
        <h5>This be the title</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo <a href="index.html">non sapien</a> dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
      </div>
    </section>
  </div>
  <div id="pollassociales" class="div">
    <div id="blogroll">
      <h5>blogroll</h5>
      <ul id="columnas">
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Doctor</li>
        <li>W3C</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>HTML5 Spec (working draft)</li>
        <li>Wordpress</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
        <li>Smashing Magazine</li>
        <li>Wikipedia</li>
      </ul>
    </div>
    <div id="social">
      <h5>social</h5>
      <ul>
        <li>delicious</li>
        <li>digg</li>
        <li>facebook</li>
        <li>last.fm</li>
        <li>rss</li>
        <li>twitter</li>
      </ul>
    </div>
  </div>
  <div class="div" id="info">
    <h4>Smashing Magazine</h4>
    <p>Amazing Magazine</p>
    <img src="img/avatar.gif">
    <p>Smashing Magazine is a website and blog that offers resources and advice to web developers and web designers. It was founded by Sven Lennartz and Vitaly Friedman.</p>
  </div>
  <footer class="div">
    <p>2005-2009 <a href="https://www.smashingmagazine.com">Smashing Magazine</a>.</p>
  </footer>
</body>

</html>


问:
Show hidden values in chrome
I was wondering if there is a way to show the values for the key variable?
There isn't a check for the answers, and I cannot for the life of me find out the answer. Please help:

<form method="post" action="/webwork2//Section13.3/5/"
  enctype="multipart/form-data" id="problemMainForm" name="problemMainForm" onsubmit="submitAction()">
  <input type="hidden" name="user" value="name" id="hidden_user" />
  <input type="hidden" name="effectiveUser" value="name" id="hidden_effectiveUser" />
  <input type="hidden" name="key" value="ZHaiEU4qkcpMc1m2kBaYrMvbOo5TktAY" id="hidden_key" />
</form>```

答:
console.log(document.getElementById('hidden_key').value);
console.log(document.getElementsByName('key')[0].value);```
<pre class="snippet-code-html lang-html prettyprint-override"><code><form method="post" action="/webwork2//Section13.3/5/"
  enctype="multipart/form-data" id="problemMainForm" name="problemMainForm" onsubmit="submitAction()">
  <input type="hidden" name="user" value="name" id="hidden_user" />
  <input type="hidden" name="effectiveUser" value="name" id="hidden_effectiveUser" />
  <input type="hidden" name="key" value="ZHaiEU4qkcpMc1m2kBaYrMvbOo5TktAY" id="hidden_key" />
</form></code>```

Title: Show hidden values in chrome

Body:
console.log(document.getElementById('hidden_key').value);
console.log(document.getElementsByName('key')[0].value);

<form method="post" action="/webwork2//Section13.3/5/"
  enctype="multipart/form-data" id="problemMainForm" name="problemMainForm" onsubmit="submitAction()">
  <input type="hidden" name="user" value="name" id="hidden_user" />
  <input type="hidden" name="effectiveUser" value="name" id="hidden_effectiveUser" />
  <input type="hidden" name="key" value="ZHaiEU4qkcpMc1m2kBaYrMvbOo5TktAY" id="hidden_key" />
</form>


问:
List items don't align the same
Hope you guys and girls can help me out here.
I want all the list items align the same at the left side (see image for example)

Example what I want is here

And this is my code

.feature-stack {
  margin: 100px 0 0 0;
  border: solid 3px;
}

.features ul.features-stack {
  margin-top: 50px;
}

.features ul.features-stack ul {}

.features ul.features-stack li:last-child {
  padding-bottom: 0px;
  border-bottom: none;
}

.feature-content ul li {
  list-style-type: none;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><ul class="features-stack">

  <li class="feature-item">
    <div class="feature-content">
      <h5>Polyethene</h5>
      <li>Test Test</li>
      <li>Test Test</li>
      <li>Test Test</li>
      <li>Test Test</li>
    </div>
  </li>

  <li class="feature-item">
    <div class="feature-content">
      <h5>Other virgin plastic</h5>
      <li>Test Test</li>
      <li>Test Test</li>
      <li>Test Test</li>
      <li>Test Test</li>
    </div>
  </li>

  <li class="feature-item">
    <div class="feature-content">
      <h5>Polypropylene</h5>
      <li>Test Test</li>
      <li>Test Test</li>
      <li>Test Test</li>
      <li>Test Test</li>
    </div>
  </li>

</ul></code>```

So I want them to align the same and that the circles are gone.
Hope I have given you guys enough information, otherwise let me know so I can give you more information.

Thanks

答:
You can add below css to your style sheet:

```<code> ul {
    list-style: none;
}

.Heading {
    font-size: 20px;
    font-weight: bold;
}
</code>```

And in your HTML just replace heading tag(H5) with list tag(li). Please find below the code:

```<code><ul class="features-stack">

                        <li class="feature-item">
                            <div class="feature-content">
                                <li class="Heading">Polyethene</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                            </div>
                        </li>
                <br/>
                        <li class="feature-item">
                            <div class="feature-content">
                                <li class="Heading">Other virgin plastic</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                            </div>
                        </li>
                   <br/>
                        <li class="feature-item">
                            <div class="feature-content">
                                <li class="Heading">Polypropylene</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                            </div>
                        </li>

                    </ul>
</code>```

I have tested the above code and its working fine.

Title: List items don't align the same

Body:
Hope you guys and girls can help me out here.
I want all the list items align the same at the left side (see image for example)

Example what I want is here

And this is my code

.feature-stack {
  margin: 100px 0 0 0;
  border: solid 3px;
}

.features ul.features-stack {
  margin-top: 50px;
}

.features ul.features-stack ul {}

.features ul.features-stack li:last-child {
  padding-bottom: 0px;
  border-bottom: none;
}

.feature-content ul li {
  list-style-type: none;
}

Polyethene

Test Test

Test Test

Test Test

Test Test

Other virgin plastic

Test Test

Test Test

Test Test

Test Test

Polypropylene

Test Test

Test Test

Test Test

Test Test

So I want them to align the same and that the circles are gone.
Hope I have given you guys enough information, otherwise let me know so I can give you more information.

Thanks

Body:
You can add below css to your style sheet:

 ul {
    list-style: none;
}

.Heading {
    font-size: 20px;
    font-weight: bold;
}

And in your HTML just replace heading tag(H5) with list tag(li). Please find below the code:

<ul class="features-stack">

                        <li class="feature-item">
                            <div class="feature-content">
                                <li class="Heading">Polyethene</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                            </div>
                        </li>
                <br/>
                        <li class="feature-item">
                            <div class="feature-content">
                                <li class="Heading">Other virgin plastic</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                            </div>
                        </li>
                   <br/>
                        <li class="feature-item">
                            <div class="feature-content">
                                <li class="Heading">Polypropylene</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                                    <li>Test Test</li>
                            </div>
                        </li>

                    </ul>

I have tested the above code and its working fine.


问:
How to add an html entity with Reflex.Dom?
As it should be text "© is rendered escaped. How then should I render the © html entity unescaped with Reflex.Dom?

答: Yes, just use text "copyright ©". No need to use HTML codes :)