text:
Q: UWP AdaptiveTrigger minWindowWidth background not changing I'm learning UWP and having the below code not working:
<Page
    x:Class="LearningUWP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:LearningUWP"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup>
                    <VisualState>
                        <VisualState.StateTriggers>
                            <AdaptiveTrigger MinWindowWidth="500" />
                        </VisualState.StateTriggers>

                        <VisualState.Setters>
                            <Setter Target="myStackPanel.Background" Value="Red" />
                        </VisualState.Setters>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <StackPanel x:Name="myStackPanel" Background="Blue" >
                <TextBlock Text="myTextBlock" />
            </StackPanel>
        </Grid>
    </Grid>
</Page>

I'm expecting the background turns to red when the window width > 500. However, it doesn't work when expanding it. How to fix it?

A: First move it to the top Grid.
Second, you probably want to add the Setter for MinWindowWidth="0"


text:
Q: reading web.xml init-params from client gwt I have a gwt appengine app that I am building. It has a web.xml file with some init-params in it. On the client side I am using a java class with an 'onLoad()' method. This is a plain 'EntryPoint'. I would like to read those init-params from the web.xml file when the page is loading. I know I can read them from the server side using getServletConfig().getInitParameter("string") but what I want to do is to read that init-param from the client side. Is there a simple way? Everything I read tells about doing this from a Servlet. Any help would be appretiated.

A: You can fetch those values from Server ( servlet ) by either GWT-RPC or GWT JSON
GWT JSON Turorial - https://developers.google.com/web-toolkit/doc/latest/tutorial/JSON
GWT RPC Tutorial - https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC
You can find tutorial examples in the sample folder of the GWT zip files.
Note : Both approaches have pros and cons and you can decide on their feasibility based on you application scope.
GWT-RPC is widely used if it is complete end to end java on client and server.
GWT-JSON is used more often when fetching data from non java server.

A: You are client side and you want information which are server side, so you need to use a technology to do so ,the servlet is the one that will allow you to collect information and send back the result to you client which will be processing it asynchrously.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Avoid parentheses around optional header material in theorem environment for ams style? This is a follow-up question on Avoid parentheses around optional header material in theorem environment.
I want to do exactly the same (remove the parenthesis around the theorem optional header in a theorem, in beamer), but for ams style theorems. I am indeed using ams style theorems, not the numbered ones, i.e. I use \setbeamertemplate{theorems}[ams style], not \setbeamertemplate{theorems}[numbered] as in the other post. How should I adjust the code there?
A naive change of \defbeamertemplate{theorem begin}{numbered} to \defbeamertemplate{theorem begin}{ams style} ran into the error: LaTeX Error: Command \beamer@@tmpop@theorem begin@ams style already defined.
Here is the code that works for [numbered], and that I would like to adapt for [ams style]:
\documentclass{beamer}

\makeatletter
\expandafter\let\csname beamer@@tmpop@theorem begin@numbered\endcsname\relax
\defbeamertemplate{theorem begin}{numbered}
{%
  \begin{\inserttheoremblockenv}
    {%
      \inserttheoremname
      \inserttheoremnumber
      \ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition\fi% (\inserttheoremaddition)
    }%
}
\makeatother

\setbeamertemplate{theorems}[numbered]
\newtheorem{MyHypo}{Hypothesis}

\begin{document}

\begin{frame}
\begin{MyHypo}[insert text]
  This is my hypothesis
\end{MyHypo}
\end{frame}

\end{document}

A: \defbeamertemplate{theorem begin}{ams style} is defined in beamerbaseauxtemplates.sty,  ll. 771. To remove the parenthesis:
\documentclass{beamer}

\setbeamertemplate{theorems}[ams style]
\newtheorem{MyHypo}{Hypothesis}

\makeatletter
\setbeamertemplate{theorem begin}
{%
  \begin{\inserttheoremblockenv}
    {%
      \inserttheoremheadfont
      \inserttheoremname
      \inserttheoremnumber
      \ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition\fi%
      \inserttheorempunctuation
    }%
}
\makeatother

\begin{document}

\begin{frame}
\begin{MyHypo}[insert text]
  This is my hypothesis
\end{MyHypo}
\end{frame}

\end{document}


text:
Q: Facebook Conversion API - not receiving events I am implementing Facebook Conversion API on server to capture sales done via a shopping cart on a different site. I call FB API from PHP code using cURL. Here is my payload:
[
   {
          "event_name":"Purchase",
          "event_time":1621701565,
          "event_id":1621701565,
          "action_source":"website",
          "event_source_url":"https://www.example.com",
          "user_data":{
             "em":"f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a",
             "fn":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25",
             "ln":"9e7cd9cb5a63a3591e16f4d835f32a1c4a84ab66e39ae27aa448c03b66bf63e7",
             "client_user_agent":"Chrome",
             "client_ip_address":"1.2.3.4"
          },
          "custom_data":{
             "currency":"USD",
             "value":"20.00",
             "content_ids":"PQ001"
          }
    }
]

When I submit it, I am getting back this response:
{"events_received":1,"messages":[],"fbtrace_id":"A9n8IBhVwl5gZTB4CCvSG7q"}

However, I do not see the event when I look at my pixel in the Event Manager. I tried using the test_event_code parameter - same story. Did anyone encounter such problem? It looks like everything was submitted OK, but where are the events?

A: I had the exact same issue when using a dummy user agent value and IP address. It turns out that the user data in your payload needs to contain "real" data.
In your example, the problem may be the Chrome value in your client_user_agent field.
Try using a real client_user_agent value (like the one below).
This payload works for me:
{
  "data": [
    {
      "event_name": "TestEvent",
      "event_time": 1627574182,
      "action_source": "email",
      "user_data": {
        "em": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a",
        "client_ip_address": "254.254.254.254",
        "client_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
      }
    }
  ],
  "test_event_code": "TEST43514"
}

Note: you'll need to update the test_event_code and event_time fields (because the Conversions API only accepts events sent in the last 7 days)
Credit to Matěj's answer on the Facebook Developers Community forums for providing a working example payload and the insight that Facebook mysteriously ignores test requests with dummy data


text:
Q: Variable image height based on content height Do you have any ideas about how I can use Tailwind CSS to make the image from the left div have a variable height, based on the content from the right div?

This is what I have now:

      {categories.map(category => (
      {category}
      ))}

{title}

      There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text.

{createdAt}

A: OK. that answear would be very short:-)  You have to add only h-auto in this line:

working example
https://play.tailwindcss.com/GdVJp8k9zA


text:
Q: Can a harmonic function on a topological cylinder have critical points? Let $M$ be an oriented closed smooth manifold, and let $C=M\times[0,1]$, the cylinder over $M$. Let $g$ be an arbitrary Riemannian metric on $C$ (in particular, $g$ may look nothing like a product metric). Let $f:C\to\mathbb{R}$ be the unique $g$-harmonic function satisfying $$f|_{M\times\{i\}}=i,\quad i=0,1.$$
Question: Is it necessarily true that $f$ has no critical points?
I believe that in the simplest case $M=S^1$ the answer is positive. This is related to classification of annuli and can be shown by arguments regarding holomorphic maps between Riemann surfaces. See this question and the accepted answer therein (by Mohan Ramachandran) for more details.
Also, the answer is clearly positive for any $M$, provided that $g$ is the product metric of some Riemannian metrics on $M$ and $[0,1]$. Hence, this should continue to hold for metrics that are "close" to a product metric as well. It thus seems natural to ask how close to a product metric a Riemannian metric needs to be (and what that even means) in order for the answer to remain "yes".
Any reference or insight are appreciated.

A: If $M$ has dimension at least $2$ the harmonic function $f$ can have critical points. This can be quickly deduced from Calabi's characterisation of harmonic $1$-forms.
Example. Suppose $M=S^2$. Then it is not hard to construct a Morse function $f$ on $M\times [0,1]$ satisfying the following properties
1) $f(M,\varepsilon)=\varepsilon$, $f(M,1-\varepsilon)=1-\varepsilon$ for any small positive $\varepsilon$.
2) $f$ has exactly two critical points $x_1,\,x_2$ in $M\times (0,1)$, $x_1$ is of index $1$ and $x_2$ is of index $2$.
3) All level sets $f=c$ are connected. These are spheres for $c\notin [f(x_1),f(x_2)]$ and tori for $c\in (f(x_1),f(x_2))$.
Now, for such a function $f$ its differential $df$ is a $1$-form that is well defined on $S^2\times S^1$, where we identify two boundaries of $S^2\times [0,1]$ by the obvious map.
Finally, using Calabi's theorem characterising $1$-forms that are harmonic for some metric, we can find a metric on $S^2\times S^1$, for which $df$ is harmonic. QED
Here is the formulation of Calabi's theorem
Theorem. Let $M$ be a closed smooth manifold. A closed $1$-form on $M$ having Morse-type zeros is intrinsically harmonic if and only if it is transitive.
Remarks. i) Calabi's theorem can be found, for example in Section 9 of Farber's book,
Topology of closed $1$-forms.
The original paper of Calabi is called: "An intrinsic characterisation of harmonic 1 forms", it's here: https://www.jstor.org/stable/j.ctt13x10qw
ii) A $1$-form on $M$ is called intrinsically harmonic if there is a metric for which it is harmonic.
iii) The transitivity of $df$ on $S^2\times S^1$ follows immediately  from Property 3) of $f$.
iv) A $1$-form $\alpha$ on $M$ is called transitive if for any point $p\in M$ with $\alpha(p)\ne 0$ there is a loop $S^1\to M$ passing through $p$, so that the restriction of  $\alpha$ to the loop never vanishes on it.


text:
Q: Finding "Pairs" in Excel I'm trying to make a time-tracking excel spread-sheet. The current data headers I have look like this:

*

*Timestamp | Name | Task | TaskUniqueID | Start / Stop ?
So basically the user just needs to scan the task unique ID, which automatically lists what task it is (so say all my QR codes are TASKA-UniqueID or TASKB-UniqueID). Then the user selects whether they started or stopped.
I want excelt o automatically find the UniqueID that matches (so each unique ID should have a start and a stop row) and then calculate the time difference between these entries. Is that possible with excel or am I going to have to dive into VBA?
So an example of a couple of rows (Note, normally they wouldnt be back-to-back):
06/11/2019 08:38:41 John Smith  Power Box - PWR PWR-051 Start
06/11/2019 08:58:38 John Smith  Power Box - PWR PWR-051 Stop

Where the Unique id is "PWR-051", which auto-fills the "Task" as "Power box - PWR"
My question is if it is possible in excel to find "pairs" of values and calculate their difference, something like a VLOOKUP, where you lookup the START and the STOP time and then take their respective timestamp and subtract them

A: Idea : extract the date from start, then extract the date from stop, then find the difference.
Assuming Timestamp is column A, TaskUniqueID is column D, and Start / Stop is column E. Put the interested Task in G1 and TaskUniqueID in H1, then this in G2 :
=INDEX(A:A,MATCH(1,INDEX((G1=C:C)*(H1=D:D)*("Start"=E:E),0,1),0))

also this in G3 :
=index(A:A,match(1,index((G1=C:C)*(H1=D:D)*("Stop"=E:E),0,1),0))

lastly in G4 :
=G3-G2

reference


text:
Q: Bing Custom Event - Click Button I keep finding this place while searching for answers to javascript so I just made an account here.
I'm a noob. I don't know much about coding. Hardly anything.
I'm usually really good with reading tutorials and watching videos instead of asking questions on forums, but I've come across something I can't figure out.
I'm using Bing and I want to be able to track button clicks on my website using their javascript tag. I have installed the basic javascript in my inside the , but I don't understand anything of their custom events.
This is what Bing says:
"JavaScript UET Tag
If you have JavaScript UET Tag, you will need to add the following custom event JavaScript to the UET tag tracking code:
<script>
window.uetq = window.uetq || [];
window.uetq.push
({ 'ec':'Event category', 'ea':'Event action', 'el':'Event label', 'ev':'Event value' });
</script>"

Okay... and that's basically all I get from Bing. No examples of how to add a simple button, so I don't know what to do.
There's this too:
"Step 1: Reporting custom events using UET: There are 4 parameters that advertisers can report when logging custom events.
Event category: The category of the event you want to track. For example, 'video
Event action: The type of user interaction you want to track. For example, 'play' or 'pause'
Event label: The name of the element that caused the action. For example, 'trailer' or 'behindthescenes'
Event value: A numerical value associated with that event. For example, the length of the video played
The event value can be any value from 0 to 9999999 with 3 decimal fields."
On my website I have a button that I've located in the code.
It goes like this:
<button id="surveyAgree" class="stepButton yesBtn" href="<?php echo $agreeLink;?>">I AGREE!</button>

I want clicks on that button to be a custom event, but I have no clue how to make that happen. Can a kind soul in this place reveal the secrets to making this happen?
Thanks for listening.
Jon


text:
Q: How to capture form input with react-redux I've read a few stackoverflow answers to this question and the answers I've seen either require the use of another module (react form) or seem hacky and over complicated.
The goal of the code below is to simply capture the input of the form as e.target.value and log the information to the console. The problem is e.target.value returns undefined and I do not know why, nor do I know the recommended way to capture form input using react-redux. I want to know the recommended way to do this without the use of a third party module.
import React, { Component } from 'react';
import { connect } from 'react-redux';

class Form extends Component {
    constructor(props){
        super(props)

        this.state = {
            data: ""
        }

        this.handleChange = this.handleChange.bind(this)
    }

    handleChange(e){
        this.setState({
            data: e.target.value
        })
    }

    render() {
        return (
        <div>

            <form onSubmit={this.props.togglePlayAction}>
            <input type="text" value = {this.state.data} onChange={this.handleChange}/>
            <input type="submit"/>
            </form>
        </div>
        );
    }
}

const mapDispatchToProps = (dispatch) => {
    return {
        togglePlayAction:(e)=>{
            e.preventDefault()
            console.log(e.target);        // form is output
            console.log(e.target.value); // undefined

        }
    }
}

export default connect(mapDispatchToProps)(Form);


text:
Q: Cohomology of union of quadric surfaces in $\mathbb{C}P^3$ It is known that a degree 4 elliptic curve $E\subset \mathbb{C}P^3$ is the complete intersection of two irreducible quadric surfaces $E=Q_1 \cap Q_2.$ Can one compute the (co)homology groups (over $\mathbb{Q}$ coefficients) of the union of these quadric surfaces $H^*(Q_1 \cup Q_2)?$ E.g. by looking at the Mayer–Vietoris sequence, one can get that $H^0=\mathbb{Q},H^1=0,H^4=\mathbb{Q}^2,$ but two results
$$H^2=\mathbb{Q}^6, H^3=\mathbb{Q}$$ and $$H^2=\mathbb{Q}^5, H^3=0$$
both fit in it (at least algebraically). Is there a way to find out which one is correct?


text:
Q: iOS swift facebook login button is not showing up if i don't use classForCoder I am trying to integrate Facebook single sign on to one of my iOS application. I have followed the instructions from Facebook and when i try to run the application i am getting the following error
Unknown class FBSDKLoginButton in Interface Builder file.

After searching on web, i found that adding the following code will resolve the issue.
FBSDKLoginButton.classForCoder()

My question is, what is the significant of this code? What does this perform behind the scene?

A: From Apple's Foundation Framework Reference:
classForCoder is a property Overridden by subclasses to substitute a class other than its own during coding. (read-only)
This method is invoked by NSCoder. NSObject's implementation returns the receiver's class. The private subclasses of a class cluster substitute the name of their public superclass when being archived.
Declaration:
var classForCoder: AnyClass { get }


text:
Q: define variable inputs with - parameter for unix My question is pretty straight forward but it seems like I can't seem to be able to find an answer with google :(
How do I specify parameters for a function with - parameter for a function I wrote.
For example I wrote this .sh file for bash but it will take 5-6 inputs so it is likely that a user might mess up the order. so how can I make the function run like:
function -m abc@yahoo.com -d dataset.csv -f filter ...
instead of having to write all the parameters in right order for $1, $2, etc.
Thanks

A: Try using getopts(). I think the reason you had trouble was your search terms. You needed stuff like options, switches, and arguments rather than parameters and functions.
Here is a quick and dirty example.
while getopts "h?vf:" opt; do
    case "$opt" in
        h|\?)
            show_help
            exit 0
            ;;
        v)  verbose=1
            ;;
        f)  output_file=$OPTARG
            ;;
    esac
done

source


text:
Q: magento attribute frontend property per product I need to set a attribute property, like "Used in Product Listing", per product, not globally, for all the products.
Is there a way to implement this kind of functionality?

A: Get attribute collection ...
$attributes = Mage::getModel('eav/config')
    ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
    ->getAttributeCollection()
    ->addSetInfo();
foreach ($attributes as $attribute)
{
    if ($attribute->getData('used_in_product_listing') == 1)
    {
        echo "{$attribute->getFrontendLabel()}:\n";

        echo "\n";
    }
}


text:
Q: How to read page source code using urllib2? I am trying to read the page source code of web pages hosted by a Content Management System (CMS).
To view the web pages via browser, I type in the URL, input my username and password (to authenticate to the domain (intranet)). When I right-click the webpage > View source code, I get all the page content within  tags. The page contains many h1, h2, p and table tags.
I want to run a script to get the page source code. When I execute the below code, I don't get the complete page source code (within the  tags).
import urllib
import urllib2
import webbrowser

testlink = 'mylinkwithinCMS'

auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password(realm='PDQ Application',uri='mydomain', user='myusername', passwd='mypassword')
opener = urllib2.build_opener(auth_handler)
urllib2.install_opener(opener)
response = urllib2.urlopen(testlink)

with open('output.txt', 'w') as f:
    f.write(response.read())

I get only a single line of code which looks like this:
<body><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","licenseKey":"0f4bf752fg","applicationID":"135707588","transactionName":"ZwZaYBQFXktSVhBZDl5MbUYPS1NXQVBAgFIFkNdFA==","queueTime":0,"applicationTime":270,"atts":"S0FZFlwfTUU=","errorBeacon":"bam.nr-data.net","agent":""}</script></body>


text:
Q: What is the difference between c++ and g++ on Mac OS X (CommandLineTools)? I see that c++ and g++ are mostly the same. Can they be used interchangably? When they will be different?
$ c++ --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ which c++
/Library/Developer/CommandLineTools/usr/bin/c++
$ which g++
/Library/Developer/CommandLineTools/usr/bin/g++

A: On MacOS, c++ is a symbolic link to the clang++ binary. In your case both c++ and g++ are the same Clang compiler for C++ (i.e. the LLVM compiler is being masqueraded as the GNU g++ compiler).
If you HAD installed the GCC compiler for C++ (more commonly known as g++), the differences between c++ and g++ would have been the differences between clang and gcc compilers. For example see this question or this compiler support table.


text:
Q: I can't connect WiFi with Ubuntu 16.04 Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01) I can not connect WFi with Ubuntu 16.04 Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
alexey@alexey-Compaq-615:~$ lspci -knn | grep Net -A2
06:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
    Subsystem: Hewlett-Packard Company BCM4312 802.11b/g LP-PHY [103c:1508]
    Kernel driver in use: b43-pci-bridge

alexey@alexey-Compaq-615:~$ lspci -vnn -d 14e4:
06:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
    Subsystem: Hewlett-Packard Company BCM4312 802.11b/g LP-PHY [103c:1508]
    Physical Slot: 1-1
    Flags: bus master, fast devsel, latency 0, IRQ 17
    Memory at 92000000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: b43-pci-bridge
    Kernel modules: ssb

Can somebody give me advice.
Thanks in advance
Best regards Alex


text:
Q: Graph Theory: Prove Ramsey Number R(3, 4)=9 Most of the proofs I've seen prove this by showing that R(3, 4)≤9 and at the same time ≥9. The former one is natural and easy to understand. To prove R(3, 4)≥9, a lot of proofs construct a graph with 8 vertices which contains no K4 and whose complement contains no K3. The counterexample is often like this
the counterexample
As far as I know, R(m, n)=R(n, m), so if I want to show that R(3, 4)≥9, the graph I construct should not contain any monochromatic K3 or K4. Go back to the counterexample. Though there is no blue K4 and red K3, it can be easily found that there are blue K3s in the first graph. Is the counterexample wrong? Or is there any problem with my understanding about Ramsey Number? Thanks a lot for the help.

A: The counterexample is correct. Note it's not the graph itself not containing $K_n$ and $K_m$:
If we say $R(n,m) = k$, then this means every graph $G$ with $k$ vertices, either $G$ contains a $K_n$ or the complement $G'$ contains a $K_m$. If we want to show $R(n,m) > k$, then we show that there exists some graph $G$ with $k$ vertices that fails that condition, namely $G$ does not contain $K_n$ and $G'$ does not contain $K_m$. We just need to find one such example.
Since in the counterexample you found, the 8-vertex graph $G$ (blue) has no $K_4$ and its complement $G'$ (red) contains no $K_3$, we see that $R(4,3)>8$. Now it is true that $R(4,3)=R(3,4)$: To show $R(3,4)>8$ as well, notice the graph $G'$ (red) has no $K_3$ and its complement $G''=G$ (blue) has no $K_4$.


text:
Q: Displaying Custom Attributes in Documentum - Webtop I am following an article that explains how to use the ICustomAttributeDataHandler class.
I am creating a custom column for the inbox screen, but the problem is that the value I set for my custom attribute is not being reflected on the screen.
As a test I am changing the task name to "whoKnows". But this code is not effecting what is output on the screen:
ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");

(I am able to print debug lines from my custom class when the inbox is viewed, so I know my code is being run.)
Someone on the comments of that article wrote:

the user must call the
  "setCustomAttributesInQuery() method
  on the dataprovider passing in a
  string array of the custom attributes

...what does that meen? Could this be my problem?
thanks.

A: To be honest, I have already used Webtop, but just as an user. I found a post in the dm developer discussion group that can be useful, though:

For creating a custom column in the
  doclist you dont need to go through
  this complex procedures. You can use
  custom attribute datahandlers for
  this.

*

*First in your object list component xml file add your custom column
  definition in the "columns" tag. You
  can even add static columns instead of
  the documentum attributes.

*Now create a class which implements the ICustomAttributeDataHandler.

*Implement the default the methods getRequiredAttributes and the getData
  function.

*In getRequiredAttributes add attributes of the object that you are
  looking for.

*In your getdata method retrieve each row and then based on the
  attribute that you see, just set the
  value that you want to. 6) Finally
  define your class in the app.xml file

  There is a section in WDK developement
  guide regarding
  ICustomAttribuetDataHandlers. Look for
  the topic named "Adding custom
  attributes to a datagrid".

I'm not sure if this is the final solution, but I hope it helps!

A: To answer you question about setCustomAttributesInQuery()
every datagrid in WDK is backed by an underlying data provider.  You can get this proivder by using the following code.
Datagrid datagrid = (Datagrid)getControl("doclist_grid",com.documentum.web.form.control.databound.Datagrid.class);
DataProvider dp = datagrid.getDataProvider();

Once you've done that, you can call
dp.setCustomAttributesInQuery(myArr);

I'm not actually sure if this is part of the solution to your problem, but you could try this and see where it gets you.

A: You have to configure the inbox component.
if using classic view, go to inboxlist component and add your custom attribute.
<column>
    <attribute>CustomAttributeName</attribute>
    <label>Custom Attribute Label</label>
    <visible>true</visible>
</column>

Your custom attribute has to be in a custom type that is a sub type of dmi_queue_item, because inboxlist shows only dmi_queue_item objects.
Hope this helps,
Regards,
Tejas.

A: This may be a non-issue, but based on your code, I can't tell if you're doing this:
ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");

or this:
ICustomAttributeRecordSet rs;
rs.setCustomAttributeValue(i, "taskName", "whoKnows");

You should be calling the setCustomAttributeValue method on the rs object instance, not on the interface.


text:
Q: Windows Phone/XNA detecting BEGINNING of touch I want to make buttons change color upon a touch in windows Phone, but the only available gesture is GestureType.Tap which is called after a tap is complete, so the color changes after the user touches the button. How do I make a touch detected as soon as it is touched?
        while (TouchPanel.IsGestureAvailable)
        {

            GestureSample gs = TouchPanel.ReadGesture();
            switch (gs.GestureType)
            {
               //this is called AFTER the tap
               case GestureType.Tap:
                    if (Restart.tapped(gs.Position))
                        Restart.selectDrawColor = Color.OrangeRed;
                    else
                        Restart.selectDrawColor = Color.White;

                    if (uploadScore.tapped(gs.Position))
                        uploadScore.selectDrawColor = Color.OrangeRed;
                    else
                        uploadScore.selectDrawColor = Color.White;

                    if (MainMenu.tapped(gs.Position))
                        MainMenu.selectDrawColor = Color.OrangeRed;
                    else
                        MainMenu.selectDrawColor = Color.White;
                    break;
            }

        }

A: Touching the screen is not considered a gesture, so ReadGesture will not return it. You will need to call TouchPanel.GetState() and look for any TouchLocation objects that have a State of Pressed.
// using System.Linq;

TouchLocation[] newTouchLocations = TouchPanel.GetState()
    .Where(loc => loc.State == TouchLocationState.Pressed)
    .ToList();

According to the documentation, TouchLocationState.Pressed signifies:

This touch location position is new.


text:
Q: Recovering a RAID5 with 2 disks out of the array I don't want to approach this in a trial-and-error manner as I know this is the best thing to do if I want to loose my data.
I have a server with 4*2TB disks in RAID5 (yes I know it's not wise) on a Ubuntu 14.04.
Most of my data is in /home on RAID 5 and / is on RAID1.
I booted the server in rescue mode, but I can't figure out :

*

*if the problem is soft or hardware,

*if there's a way to remount the raid to recover these data.

I had a carefull read of Recovering a failed software RAID (raid.wiki.kernel.org), but as I'm not really confident about my diagnosis, I'd like to have some mindful judgement about what's going on and how to proceed if there's anything to do…
The only thins I tried was to mount my mds devices that weren't mounted, that worked for md2 mount /dev/md2 /mnt/, but I couldn't mount neither md0 nor md3 as I'm told /dev/md3: can't read superblock.
So far, this is what I checked :
EDIT parted -l
root@rescue:/mnt# parted -l
Model: ATA ST2000DM001-1CH1 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name     Flags
 1      20.5kB  1049kB  1029kB                  primary  bios_grub
 2      2097kB  10.5GB  10.5GB  ext4            primary  raid
 3      10.5GB  2000GB  1989GB                  primary  raid
 4      2000GB  2000GB  536MB   linux-swap(v1)  primary

Model: ATA ST2000DM001-1CH1 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name     Flags
 1      20.5kB  1049kB  1029kB                  primary  bios_grub
 2      2097kB  10.5GB  10.5GB  ext4            primary  raid
 3      10.5GB  2000GB  1989GB                  primary  raid
 4      2000GB  2000GB  536MB   linux-swap(v1)  primary

Error: /dev/sdc: unrecognised disk label
Model: ATA ST2000DM001-1CH1 (scsi)
Disk /dev/sdc: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:

Model: ATA ST2000DM001-1CH1 (scsi)
Disk /dev/sdd: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name     Flags
 1      20.5kB  1049kB  1029kB                  primary  bios_grub
 2      2097kB  10.5GB  10.5GB  ext4            primary  raid
 3      10.5GB  2000GB  1989GB                  primary  raid
 4      2000GB  2000GB  536MB   linux-swap(v1)  primary

Model: Linux Software RAID Array (md)
Disk /dev/md2: 10.5GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  10.5GB  10.5GB  ext4

Error: /dev/md127: unrecognised disk label
Model: Linux Software RAID Array (md)
Disk /dev/md127: 10.5GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:

smartctl
root@rescue:~# smartctl -a -d ata /dev/sdc
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.10.23-xxxx-std-ipv6-64-rescue] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

Smartctl: Device Read Identity Failed: Input/output error

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

root@rescue:~# smartctl -a -d ata /dev/sdd
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.10.23-xxxx-std-ipv6-64-rescue] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.14 (AF)
Device Model:     ST2000DM001-1CH164
Serial Number:    W1E1KX59
LU WWN Device Id: 5 000c50 05c821593
Firmware Version: CC43
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Tue Dec 30 16:04:49 2014 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
          was never started.
          Auto Offline Data Collection: Disabled.
Self-test execution status:      ( 121) The previous self-test completed having
          the read element of the test failed.
Total time to complete Offline
data collection:        (  584) seconds.
Offline data collection
capabilities:            (0x73) SMART execute Offline immediate.
          Auto Offline data collection on/off support.
          Suspend Offline collection upon new
          command.
          No Offline surface scan supported.
          Self-test supported.
          Conveyance Self-test supported.
          Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
          power-saving mode.
          Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
          General Purpose Logging supported.
Short self-test routine
recommended polling time:    (   1) minutes.
Extended self-test routine
recommended polling time:    ( 230) minutes.
Conveyance self-test routine
recommended polling time:    (   2) minutes.
SCT capabilities:          (0x3085) SCT Status supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   111   099   006    Pre-fail  Always       -       120551532
  3 Spin_Up_Time            0x0003   095   095   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       32
  5 Reallocated_Sector_Ct   0x0033   097   097   036    Pre-fail  Always       -       4008
  7 Seek_Error_Rate         0x000f   077   060   030    Pre-fail  Always       -       4351310995
  9 Power_On_Hours          0x0032   079   079   000    Old_age   Always       -       18725
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       32
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   089   089   000    Old_age   Always       -       11
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0 0 0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   068   056   045    Old_age   Always       -       32 (Min/Max 26/35)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       31
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       46
194 Temperature_Celsius     0x0022   032   044   000    Old_age   Always       -       32 (0 16 0 0)
197 Current_Pending_Sector  0x0012   082   082   000    Old_age   Always       -       3056
198 Offline_Uncorrectable   0x0010   082   082   000    Old_age   Offline      -       3056
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       18708h+109m+27.415s
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       24242600022
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       112149279703

SMART Error Log Version: 1
ATA Error Count: 11 (device log contains only the most recent five errors)
  CR = Command Register [HEX]
  FR = Features Register [HEX]
  SC = Sector Count Register [HEX]
  SN = Sector Number Register [HEX]
  CL = Cylinder Low Register [HEX]
  CH = Cylinder High Register [HEX]
  DH = Device/Head Register [HEX]
  DC = Device Command Register [HEX]
  ER = Error register [HEX]
  ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 11 occurred at disk power-on lifetime: 18520 hours (771 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      09:32:13.900  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      09:32:13.898  SET FEATURES [Reserved for Serial ATA]
  27 00 00 00 00 00 e0 00      09:32:13.898  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      09:32:13.898  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      09:32:13.898  SET FEATURES [Set transfer mode]

Error 10 occurred at disk power-on lifetime: 18520 hours (771 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      09:32:10.764  READ FPDMA QUEUED
  60 00 08 ff ff ff 4f 00      09:32:10.763  READ FPDMA QUEUED
  60 00 38 ff ff ff 4f 00      09:32:10.763  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      09:32:10.763  SET FEATURES [Reserved for Serial ATA]
  27 00 00 00 00 00 e0 00      09:32:10.763  READ NATIVE MAX ADDRESS EXT

Error 9 occurred at disk power-on lifetime: 18520 hours (771 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 38 ff ff ff 4f 00      09:32:09.084  READ FPDMA QUEUED
  61 00 08 00 88 38 41 00      09:32:07.445  WRITE FPDMA QUEUED
  60 00 08 ff ff ff 4f 00      09:32:07.416  READ FPDMA QUEUED
  60 00 08 ff ff ff 4f 00      09:32:07.416  READ FPDMA QUEUED
  60 00 08 ff ff ff 4f 00      09:32:07.416  READ FPDMA QUEUED

Error 8 occurred at disk power-on lifetime: 18520 hours (771 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: WP at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  61 00 40 ff ff ff 4f 00      09:32:04.118  WRITE FPDMA QUEUED
  61 00 08 70 88 38 41 00      09:32:04.117  WRITE FPDMA QUEUED
  61 00 40 ff ff ff 4f 00      09:32:04.117  WRITE FPDMA QUEUED
  60 00 40 ff ff ff 4f 00      09:32:04.117  READ FPDMA QUEUED
  60 00 08 ff ff ff 4f 00      09:32:04.117  READ FPDMA QUEUED

Error 7 occurred at disk power-on lifetime: 17319 hours (721 days + 15 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 50 a9 59 02  Error: UNC at LBA = 0x0259a950 = 39430480

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 00 00 aa 59 42 00      01:31:02.054  READ FPDMA QUEUED
  60 00 00 00 a6 59 42 00      01:31:02.054  READ FPDMA QUEUED
  60 00 00 00 92 36 42 00      01:30:55.032  READ FPDMA QUEUED
  60 00 00 00 86 36 42 00      01:30:51.600  READ FPDMA QUEUED
  60 00 00 00 82 36 42 00      01:30:51.593  READ FPDMA QUEUED

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       90%     18706         3848494344
# 2  Short offline       Completed without error       00%      3481         -
# 3  Short offline       Completed without error       00%      3472         -
# 4  Short offline       Completed without error       00%      3472         -
# 5  Short offline       Completed without error       00%        13         -
# 6  Short offline       Completed without error       00%         5         -
# 7  Short offline       Completed without error       00%         5         -
# 8  Short offline       Completed without error       00%         0         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

ls /dev
ls /dev
MAKEDEV      md0              ptya0  ptyc5  ptyea  ptyqf  ptyt4  ptyv9  ptyxe  ram11   sg1     tty34  ttyS1  ttyc2  ttye7  ttyqc  ttyt1  ttyv6  ttyxb  urandom
aer_inject   md127            ptya1  ptyc6  ptyeb  ptyr0  ptyt5  ptyva  ptyxf  ram12   sg2     tty35  ttyS2  ttyc3  ttye8  ttyqd  ttyt2  ttyv7  ttyxc  vcs
autofs       md2              ptya2  ptyc7  ptyec  ptyr1  ptyt6  ptyvb  ptyy0  ram13   sg3     tty36  ttyS3  ttyc4  ttye9  ttyqe  ttyt3  ttyv8  ttyxd  vcs1
block        md3              ptya3  ptyc8  ptyed  ptyr2  ptyt7  ptyvc  ptyy1  ram14   shm     tty37  ttya0  ttyc5  ttyea  ttyqf  ttyt4  ttyv9  ttyxe  vcs2
[…]

cat /proc/mdstat
cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md127 : active raid1 sdc2[2]
      10238912 blocks [4/1] [__U_]

md2 : active raid1 sdd2[3] sda2[0] sdb2[1]
      10238912 blocks [4/3] [UU_U]

mdadm --detail
root@rescue:~# mdadm --detail /dev/md2
/dev/md2:
        Version : 0.90
  Creation Time : Tue Sep  2 16:46:34 2014
     Raid Level : raid1
     Array Size : 10238912 (9.76 GiB 10.48 GB)
  Used Dev Size : 10238912 (9.76 GiB 10.48 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Sat Dec 27 17:31:03 2014
          State : clean, degraded
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

           UUID : 5a33c710:006f668d:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
         Events : 0.503145

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
       2       0        0        2      removed
       3       8       50        3      active sync   /dev/sdd2

root@rescue:~# mdadm --detail /dev/md127
/dev/md127:
        Version : 0.90
  Creation Time : Tue Sep  2 16:46:34 2014
     Raid Level : raid1
     Array Size : 10238912 (9.76 GiB 10.48 GB)
  Used Dev Size : 10238912 (9.76 GiB 10.48 GB)
   Raid Devices : 4
  Total Devices : 1
Preferred Minor : 127
    Persistence : Superblock is persistent

    Update Time : Sat Dec 27 17:31:16 2014
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       0        0        1      removed
       2       8       34        2      active sync   /dev/sdc2
       3       0        0        3      removed

And at last mdadm --examine sd*
root@rescue:~# mdadm --examine /dev/sd*
/dev/sda:
   MBR Magic : aa55
Partition[0] :   3907029167 sectors at            1 (type ee)
mdadm: No md superblock detected on /dev/sda1.
/dev/sda2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 5a33c710:006f668d:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
  Creation Time : Tue Sep  2 16:46:34 2014
     Raid Level : raid1
  Used Dev Size : 10238912 (9.76 GiB 10.48 GB)
     Array Size : 10238912 (9.76 GiB 10.48 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 2

    Update Time : Sat Dec 27 18:20:56 2014
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0
       Checksum : 78eed7b8 - correct
         Events : 503147

      Number   Major   Minor   RaidDevice State
this     0       8        2        0      active sync   /dev/sda2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2
   2     2       0        0        2      faulty removed
   3     3       8       50        3      active sync   /dev/sdd2
/dev/sda3:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 4a417350:7192f812:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
  Creation Time : Tue Sep  2 16:46:35 2014
     Raid Level : raid5
  Used Dev Size : 1942745600 (1852.75 GiB 1989.37 GB)
     Array Size : 5828236800 (5558.24 GiB 5968.11 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 3

    Update Time : Mon Dec 22 10:33:05 2014
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 2
  Spare Devices : 0
       Checksum : 4d44c428 - correct
         Events : 109608

         Layout : left-symmetric
     Chunk Size : 512K

      Number   Major   Minor   RaidDevice State
this     0       8        3        0      active sync   /dev/sda3

   0     0       8        3        0      active sync   /dev/sda3
   1     1       8       19        1      active sync   /dev/sdb3
   2     2       0        0        2      faulty removed
   3     3       0        0        3      faulty removed
mdadm: No md superblock detected on /dev/sda4.
/dev/sdb:
   MBR Magic : aa55
Partition[0] :   3907029167 sectors at            1 (type ee)
mdadm: No md superblock detected on /dev/sdb1.
/dev/sdb2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 5a33c710:006f668d:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
  Creation Time : Tue Sep  2 16:46:34 2014
     Raid Level : raid1
  Used Dev Size : 10238912 (9.76 GiB 10.48 GB)
     Array Size : 10238912 (9.76 GiB 10.48 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 2

    Update Time : Sat Dec 27 18:20:56 2014
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0
       Checksum : 78eed7ca - correct
         Events : 503147

      Number   Major   Minor   RaidDevice State
this     1       8       18        1      active sync   /dev/sdb2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2
   2     2       0        0        2      faulty removed
   3     3       8       50        3      active sync   /dev/sdd2
/dev/sdb3:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 4a417350:7192f812:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
  Creation Time : Tue Sep  2 16:46:35 2014
     Raid Level : raid5
  Used Dev Size : 1942745600 (1852.75 GiB 1989.37 GB)
     Array Size : 5828236800 (5558.24 GiB 5968.11 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 3

    Update Time : Mon Dec 22 10:33:05 2014
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 2
  Spare Devices : 0
       Checksum : 4d44c43a - correct
         Events : 109608

         Layout : left-symmetric
     Chunk Size : 512K

      Number   Major   Minor   RaidDevice State
this     1       8       19        1      active sync   /dev/sdb3

   0     0       8        3        0      active sync   /dev/sda3
   1     1       8       19        1      active sync   /dev/sdb3
   2     2       0        0        2      faulty removed
   3     3       0        0        3      faulty removed
mdadm: No md superblock detected on /dev/sdb4.
mdadm: No md superblock detected on /dev/sdc.
mdadm: No md superblock detected on /dev/sdc1.
mdadm: No md superblock detected on /dev/sdc2.
mdadm: No md superblock detected on /dev/sdc3.
mdadm: No md superblock detected on /dev/sdc4.
/dev/sdd:
   MBR Magic : aa55
Partition[0] :   3907029167 sectors at            1 (type ee)
mdadm: No md superblock detected on /dev/sdd1.
/dev/sdd2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 5a33c710:006f668d:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
  Creation Time : Tue Sep  2 16:46:34 2014
     Raid Level : raid1
  Used Dev Size : 10238912 (9.76 GiB 10.48 GB)
     Array Size : 10238912 (9.76 GiB 10.48 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 2

    Update Time : Sat Dec 27 18:20:56 2014
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0
       Checksum : 78eed7ee - correct
         Events : 503147

      Number   Major   Minor   RaidDevice State
this     3       8       50        3      active sync   /dev/sdd2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2
   2     2       0        0        2      faulty removed
   3     3       8       50        3      active sync   /dev/sdd2
/dev/sdd3:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 4a417350:7192f812:a4d2adc2:26fd5302 (local to host rescue.ovh.net)
  Creation Time : Tue Sep  2 16:46:35 2014
     Raid Level : raid5
  Used Dev Size : 1942745600 (1852.75 GiB 1989.37 GB)
     Array Size : 5828236800 (5558.24 GiB 5968.11 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 3

    Update Time : Mon Dec 22 01:55:55 2014
          State : active
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0
       Checksum : 4d429eeb - correct
         Events : 109599

         Layout : left-symmetric
     Chunk Size : 512K

      Number   Major   Minor   RaidDevice State
this     3       8       51        3      active sync   /dev/sdd3

   0     0       8        3        0      active sync   /dev/sda3
   1     1       8       19        1      active sync   /dev/sdb3
   2     2       0        0        2      faulty removed
   3     3       8       51        3      active sync   /dev/sdd3
mdadm: No md superblock detected on /dev/sdd4.

EDIT
In a last attempt, I unmounted /dev/md2 and stopped it with mdadm.
Then I was able to assemble /dev/md3:
mdadm --assemble --force /dev/md3 /dev/sd[abd]3
mdadm: forcing event count in /dev/sdd3(3) from 109599 upto 109608
mdadm: clearing FAULTY flag for device 2 in /dev/md3 for /dev/sdd3
mdadm: Marking array /dev/md3 as 'clean'
mdadm: /dev/md3 has been started with 3 drives (out of 4).

Syslog at the time:
md/raid:md3: device sda3 operational as raid disk 0
md/raid:md3: device sdd3 operational as raid disk 3
md/raid:md3: device sdb3 operational as raid disk 1
md/raid:md3: allocated 4338kB
md/raid:md3: raid level 5 active with 3 out of 4 devices, algorithm 2
RAID conf printout:
 --- level:5 rd:4 wd:3
 disk 0, o:1, dev:sda3
 disk 1, o:1, dev:sdb3
 disk 3, o:1, dev:sdd3
md3: detected capacity change from 0 to 5968114483200
 md3: unknown partition table

And the RAID seemed OK:
root@rescue:/mnt# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md3 : active raid5 sda3[0] sdd3[3] sdb3[1]
      5828236800 blocks level 5, 512k chunk, algorithm 2 [4/3] [UU_U]
[…]

But I couldn't mount it:
root@rescue:/mnt# mount /dev/md3 /mnt/home
mount: wrong fs type, bad option, bad superblock on /dev/md3,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

While doing that, many errors appeared in the syslog:
ata4.00: exception Emask 0x0 SAct 0xfe SErr 0x0 action 0x0
ata4.00: irq_stat 0x40000008
ata4.00: failed command: READ FPDMA QUEUED
ata4.00: cmd 60/18:08:18:34:63/00:00:e5:00:00/40 tag 1 ncq 12288 in
         res 41/40:18:18:34:63/00:00:e5:00:00/00 Emask 0x409 (media error) <F>
ata4.00: status: { DRDY ERR }
ata4.00: error: { UNC }
ata4.00: configured for UDMA/133
sd 3:0:0:0: [sdd] Unhandled sense code
sd 3:0:0:0: [sdd]
Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 3:0:0:0: [sdd]
Sense Key : Medium Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
        72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
        e5 63 34 18
sd 3:0:0:0: [sdd]
Add. Sense: Unrecovered read error - auto reallocate failed
sd 3:0:0:0: [sdd] CDB:
Read(10): 28 00 e5 63 34 18 00 00 18 00
blk_update_request: 46 callbacks suppressed
end_request: I/O error, dev sdd, sector 3848483864
md/raid:md3: read error not correctable (sector 3828001816 on sdd3).
md/raid:md3: Disk failure on sdd3, disabling device.

I tried to correct them with hdparmbut there are too many of them and each time a bunch of new one appears.
Obviously, as mentionned in the syslog md/raid:md3: Disk failure on sdd3, disabling device. at the same time I tried to mount md3, the array's state changed to FAILED.
It seems that I have lost this battle…

A: If I understand things right your /dev/md3 is raid5 and should consist of /dev/sda3, /dev/sdb3, /dev/sdc3 (which no longer exist) and /dev/sdd3.
So what do you get from mdadm --detail /dev/md3?
Why does /dev/sdc still seem to have a broken partition table?
Maybe it would be possible to restore your data even though the partitions from /dev/sdc are still missing, but I would try the following rescue operation:
1) Use some live CD to boot, do not mount any partitions or raid disks.
2) Make raw image copies of all disks, yes you will need more than 8 TB of free space somewhere, maybe on some network drive. If your disks are physically OK you can use dd to make the copies. If some disk is physically broken, you might have to use some ddrescue program instead.
3) Make working raw image copies of the original raw image copies, yes you will need another 8 TB of free space for that.
4) Use a virtual machine like qemu or virtualbox. Start by booting the virtual machine with some good live CD suitable for data rescue. Systemrescuecd might be a good choice.
5) From within the virtual machine, using your working raw disk image copies, try to fix your working raw disk image copies. One place to start might be to add a partition table to the working raw disk image copy of /dev/sdc. The partition table of /dev/sdc should probably look the same as the partition table of /dev/sdd.
6) When you think that you have fixed the problem, boot your virtual machine from your working disk image copies.
7) Once your virtual machine has proven that your disk image files have been fixed, copy the fixed images back to your physical disks. If some physical disk is broken you might want to replace it first.
If you at some stage find that your attempts to fix the broken raid only have made things worse, overwrite your working raw disk images with the original raw disk images and restart.


text:
Q: Local Positioning system using ARM i have a part in my graduation project where i need to direct some robot towards another point using local positioning system
now i dont know much about it but here is what i figured out so far
its basically dependent on the fact that you have an RSSI which is the signal strength and u calculate the distance from your current point to a fixed point , using 3 "fixed points" ( called beacons in bluetooth ) you can get the x,y,z co-ordinates(3 equations 3 unknowns, the 3 plans should intersect in a single point) of the robot at the moment
i also got to know that you can use 2 types of things for this job :-
a wifi module and a bluetooth module as you can get an RSSI from both modules
i should also use a BLE bluetooth module which is better however this is not really a possibility since these modules aren't sold in my country and i would have to pay a fortune for them when converted to my currency since cost is part of my project
i dont know if there are more types of modules that can be used for this but if there is please enlighten me
but my question is this :
can i use any kind of bluetooth module ? HC-05 for example is the one i am working with at the moment , however do i have to use a special something for this application ?
and also which is more accurate the wifi or bluetooth and how accurate are they ?
how can i increase the accuracy of the measurements ?
thanks in advance

A: This is very unlikely to work well.
The RSSI measured by a Bluetooth receiver will be affected by distance, but it will also be affected significantly by other factors, such as:

*

*Random noise and atmospheric conditions.

*Interference from 2.4 GHz devices in the vicinity.

*Non-uniform antenna radiation patterns.

*Physical objects between the transmitting and receiving antennas.

Even if these factors are (somehow!) mitigated, the precision of RSSI readings will not be very high -- the RSSI reading is mainly intended as an indicator of signal quality for users, after all. Even BLE devices can only make a very rough estimate of distance; the Bluetooth proximity profile is only intended to detect whether a device is nearby or not.

A: How flexible are you with your hardware options? As others have pointed out RSSI is terrible for positioning, you'll be lucky to get better than 5-10 m accuracy on an RSSI only system.
As pjc50 indicated there are a number of optical systems. If you want to stick with radio then there are some other options that I've seen used:

*

*Time of flight, the same principal as GPS uses. Bluetooth and wifi are a bit useless for this but other radios like the DWM1000 module from decawave combined with a little bit of software can do it fairly accurately. That should get you down under the 1 m error assuming you have line of sight to the beacons. If you are carefully with the system design and do some averaging those parts can get you closer to 30 cm accuracy.

*Map the room. RSSI has issues with other noise sources and internal reflections within the building. You cant do much about other noise since it changes all the time but reflections are fairly constant. If you can map out the signal strengths at every point in the test area then you can compare what you see to the map, a couple of small movements will often then allow you to get a fairly high likelihood of knowing your location. Still not hugely accurate but better than RSSI alone. Until someone moves any large metal objects at which point you're screwed.

*Go low tech. Sound moves painfully slowly. Make each beacon a radio and ultrasound transmitter. Each beacon sends out simultaneous radio and ultrasound pulses, you measure the time difference between seeing the two and you have a very good idea of your range. It's short range and has a slow update rate due to the time it takes sound to get anywhere but allows you do use a time of flight system without having to try to make time measurements accurate to fractions of a nanosecond. Windspeed and temperature changes will impact the accuracy but indoors those are normally less of an issue.

*900 MHz RFID. Those tags cost pennies and have a range of up to 20 m. If you put a unique ID into each tag and then place them in a grid on the ceiling then walking around with an RFID reader you can calculate your location be which tags you can see and their signal strengths. It is an RSSI based system so the accuracy isn't great but you normally have a direct path, the signals are too weak to bounce around much and it's in a quieter RF band so it's not terrible. You can get this sort of system down to about 1-2 m accuracy. But RFID tags are a lot cheaper than wi-fi base stations and don't require power.
After that you get into multi-sensor systems, often something similar to one of the above or an optical system combined with an IMU. The IMU gives good high resolution short term movement measurements but will drift over time, the radio or visual systems give lower accuracy but don't drift. If you combine the two you can in theory get very good results. However the implementation of that sort of system can get very complex.

A: Indoor positioning is a bit of a nightmare. Most recently the VR companies have been looking at it. There are basically three approaches that are popular, all of which are optical:
1) SLAM. Ordinary camera, ordinary lighting, lots of computation. If you can see the target, you can work towards it, and maybe avoid furniture too.
2) Optical tracking against a set of beacons. This is the approach used by Wiimotes - the sensor bar is two IR beacons and the wiimote is a simple IR camera.
3) Lighthouse. Very clever, patented up to its eyeballs.
RSSI is far too variable to give high-resolution tracking. This company claims an accuracy of 5-15m; basically enough to say which room a user is in but not where they are.


text:
Q: JSF custom converter not always used I've got a custom converter that extends DateTimeConverter, which I've registered for the java.util.Date class in my faces-config.xml. Essentially all that the new converter is doing is adding a more descriptive message and passing it to the current context so that it can be displayed in the appropriate jspf.
For one date field on the screen I'm testing, everything works fine; for the other two, my getAsObject() method is never called. However, I've added an h:messages tag for debugging and the other two date fields are throwing conversion errors, so they're still attempting conversion somewhere.
There's no difference I can find between the three fields; they all use the same styleclasses, and each is backed by a java.util.Date. I think what's happening is that the second two are using the default converter, but I'm not sure why. The fields are all dynamically created so I cannot add a tag in the jsp, but I did try explicitly setting the converter in my utility class where the component is created, but had the same issue.
Any ideas what I should look for? I feel like it's something small and obvious, but I'm not seeing it.
EDIT :
There's really not that much going on with the parts I can easily copy+paste. In the jsp, there's a dataTable (the on that works) :
<h:dataTable id="myTableID" binding="#{myBackingbean.myTable}" value="#{myBackingbean.myInfoArray}"
    rowClasses="#{myBackingbean.myRowClasses}" columnClasses="field-first,field-last" var="varDetails" border="0" cellpadding="2" cellspacing="0"
    headerClass="sub-heading ui-widget-header" width="98%">
</h:dataTable>

Where myTable is an HtmlDataTable and myInfoArray is a linked list of one of our classes.
The other two :
<h:dataTable id="myTableID2" binding="#{myBackingbean.myTable2}" value="#myBackingbean.myInfoArray2}"
    rowClasses="#{myBackingbean.myRowClasses2}" columnClasses="field-first,field-last" var="varDetails2" border="0" cellpadding="2" cellspacing="0"
    headerClass="sub-heading" styleClass="" width="100%">
</h:dataTable>

In my utility class :
HtmlInputText dateInput = new HtmlInputText();
dateInput.setId("dynamic_Date");
ValueBinding binding_value_3_3 = getApplication().createValueBinding("#{XXXXXXXX.dtValue}");
dateInput.setValueBinding("value", binding_value_3_3);
ValueBinding bindingCol_3_4 = getApplication().createValueBinding("#{XXXXXXXX.date}");
dateInput.setValueBinding("rendered", bindingCol_3_4);
ValueBinding bindingCol_date = getApplication().createValueBinding("#{XXXXXXXX.disabled}");
dateInput.setValueBinding("disabled", bindingCol_date);

HtmlInputText dateTimeInput = new HtmlInputText();
dateTimeInput.setId("dynamic_DateTime");
ValueBinding binding_value_11_3 = getApplication().createValueBinding("#{XXXXXXXX.strValue}");
dateTimeInput.setValueBinding("value", binding_value_11_3);
ValueBinding bindingCol_11_4 = getApplication().createValueBinding("#{XXXXXXXX.dateTime}");
dateTimeInput.setValueBinding("rendered", bindingCol_11_4);
ValueBinding bindingCol_dateTimeInput = getApplication().createValueBinding("#{XXXXXXXX.disabled}");
dateTimeInput.setValueBinding("disabled", bindingCol_dateTimeInput);

column1.getChildren().add(dateInput);
column1.getChildren().add(dateTimeInput);

Where XXXXXXXX is either varDetails or varDetails2.

A: I'm not sure what the issue was; I ended up just creating a new project, which cleared it up.


text:
Q: how to nest jsx code in js, which nested in jsx? what's wrong with this code?
          {(canEditFile && !err) &&
            ( isSaving ?
              <button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
                <i className={'fa fa-spin fa-spinner'}/></button> :
              <IconButton
                text={gettext('Save')}
                id={'saveButton'}
                icon={'fa fa-save'}
                // button imported in this file does not have functionalities of
                // disabled, isActive as button imported in markdowneditor has
                //disabled={isContentChanged}
                //isActive={!isContentChanged}
                onClick={this.props.onSaveChangedContent}
              />
            )
          }

WebpackError at /
            ModuleError in
Line 105:  Parsing error: Unexpected token, expected ,
103 |              :
  104 |

105 |               text={gettext('Save')}
        |               ^
    106 |               id={'saveButton'}


text:
Q: Есть ли в js аналог статических переменных в функциях, как в php? Есть ли аналог такого кода в js?
function doStuff() {
  static $cache = null;
  echo $cache;
  if ($cache === null) {
     $cache = '%heavy database stuff or something%';
  }

  // code using $cache
}
doStuff() //prints null
doStuff() //prints '%heavy database stuff or something%'

Для примера
в первый раз doStuff() выводит null, а во второй '%heavy database stuff or something%'
Какие есть варианты?
Как то можно было схитрить с анонимными функциями, но забыл

A: Мне кажется Вы ищете замыкание:

var doStuff = (function (){
  var cache = null;
  return function() {
    console.log(cache)
    if (cache === null)
      cache = '%heavy database stuff or something%';
  }
})();

doStuff();
doStuff();

A: Поле самой функции:

function doStuff() {
  console.log(doStuff.cache);

  if (doStuff.cache === null) {
     doStuff.cache = '%heavy database stuff or something%';
  }
}

doStuff.cache = null;

doStuff() //prints null
doStuff() //prints '%heavy database stuff or something%'

Кстати, я бы обошёлся undefinedом:

function doStuff() {
  console.log(doStuff.cache);

  if (doStuff.cache == null) {
     doStuff.cache = '%heavy database stuff or something%';
  }
}

doStuff() //prints undefined
doStuff() //prints '%heavy database stuff or something%'

A: Можно так еще
{
    let cache = null ;
    function doStuff(){
        console.log(cache)
        if (cache === null){
           cache = '%heavy database stuff or something%';
        }
    }
}

doStuff() ; //prints null
doStuff() ; //prints '%heavy database stuff or something%'


text:
Q: Missing dialogue options when talking to Sofus the Bull in "The Play's the Thing" I am currently in Novigrad, doing the quest "The Play's The Thing". I am stuck at the part of "Head to the docks and hire ushers for the play". I have already met Sofus The Bull, who, from my understanding, is who I need to talk to in order to organize the fight to prove my worth so they will work for me and keep peace at the play.
Though after I challenged the man his next line was "Made up your mind, ready to take part in the next fight of the century" but then the next line from the Sofus The Bull is: "Unless you have found your, Uh, Ushers, For, Uh... Whatsit." and then Geralt's only response is "Lemme think about it." which then ends the dialogue.
I cannot move along in this quest without getting the ushers and I have looked online for help but it seems no one else has ever run into the same problem. I have also tried different times of day but it seems to have no effect. Is there something or someone else I have to see before I fight this man?

A: This happened to me, and here's how I solved it.
The option to proceed doesnt actually appear unless you have approx. 240 crowns. If you don't have the coin, the option simply will not appear. All you will get is "Lemme think about it".
Just sell a few items to gain the extra coin, and an addtional option to proceed will be there.


text:
Q: AWS API Gateway removing newlines from body My body mapping is defined as:
{
    "csv": "$input.body",
    "p1": false,
    "p2": "p3",
    "p3": "p4"
}

Invoking the function with
curl 'https://xxxxx.execute-api.us-west-2.amazonaws.com/prod/xxx?p3=aaa&p4=bbb' \
-XPOST -H "Content-Type: application/csv"  -d @input.csv

Where input.csv contains
l1c1,l1c2
l2c1,l2c2
l3c1,l3c2

Will end up with calling my lambda function with
{
    "csv": "l1c1,l1c2l2c1,l2c2l3c1,l3c2",
    "p1": false,
    "p2": "p3",
    "p3": "p4"
}

Is there a way NOT to remove the newlines from the body? $input.body should evaluate to the "RAW PAYLOAD" according to the docs here http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#d0e9653
Also tried using $util.escapeJavaScript($input.body), but it does not make any difference at all.
Decoding $util.base64Encode($input.body) also has the newlines stripped...
Thanks,

A: Turns out --data or -d sends the data as www-form-urlencoded, thus strips out new lines. --data-binary is the correct way to send the file in my case.

A: From curl's man page:

Posting data from a file named 'foobar' would thus be done with --data @foobar. When --data is told to read from a file like that, carriage returns and newlines will be stripped out.

See also: How to send line break with curl?


text:
Q: Excel error 1004, Highlight adjecent cells gray when yes I'm trying to put a macro where I select Yes in a row, the next cells are grayed out. So I have got couple of yes columns, but for the life of me can't figure/fix out the error

Error
   Runtime Error 1004
   Application-defined or object-defied error

Code
Private Sub Worksheet_Change(ByVal Target As Range)

If ActiveCell.Column = 5 Then

    Set r = Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 7))

    If Target.Value = "Yes" Or Target.Value = "YES" Then
        r.Interior.Color = RGB(192, 192, 192)
    Else
        r.Interior.Color = xlNone
    End If
End If

 If ActiveCell.Column = 7 Then

    Set s = Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 3))

    If Target.Value = "Yes" Or Target.Value = "YES" Then
        s.Interior.Color = RGB(192, 192, 192)
    Else
        s.Interior.Color = xlNone
    End If
 End If
End Sub

A: ActiveCell is not the cell that changed.  Target is.  You need to replace all of the references to ActiveCell to Target and adjust the offsets accordingly.

A: Changing ActiveCell to Target is a good start. You should also compensate for more than a single target cell in case a block of values is pasted into a range overlapping columns E and/or G.
Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Union(Columns(5), Columns(7))) Is Nothing Then
        On Error GoTo Fìn
        Application.EnableEvents = False
        Dim o As Range, t As Range
        For Each t In Intersect(Target, Union(Columns(5), Columns(7)))
            Select Case t.Column
                Case 5
                    Set o = t.Offset(0, 1).Resize(1, 7)
                Case 7
                    Set o = t.Offset(0, 1).Resize(1, 3)
            End Select
            If LCase(t.Value) = "yes" Then
                o.Interior.Color = RGB(192, 192, 192)
            Else
                o.Interior.Pattern = xlNone
            End If
        Next t
    End If

Fìn:
    Set o = Nothing
    Application.EnableEvents = True

End Sub

I've only set the range of the cells to receive the fill color first. Note that there does seem to be a crossover logic issue where if E5 receives a Yes and G5 receives a No then only K5:L5 will be grey. I made the comparison to yes non-case-sensitive.
Errors are covered by a safe exit.

A: Found the issue though, it was using conditional highlighting so that's what was conflicting with the macro


text:
Q: How to undo/revert "npm audit fix" As the title says. I have run npm audit fix in cmd. Now I can't run npm run build as it gives me errors. How to undo npm audit fix? Is there such command?
After running npm audit fix I get this errors:
D:\SUBLIME\REACT>npm run build

> uploadpublish@1.0.0 build D:\SUBLIME\REACT
> webpack --mode production

D:\SUBLIME\REACT\node_modules\webpack-cli\bin\config-yargs.js:136
                                describe: optionsSchema.definitions.output.properties.path.description
                                                                           ^

TypeError: Cannot read property 'properties' of undefined
    at module.exports (D:\SUBLIME\REACT\node_modules\webpack-cli\bin\config-yargs.js:13
    at D:\SUBLIME\REACT\node_modules\webpack-cli\bin\webpack.js:59:27
    at Object.<anonymous> (D:\SUBLIME\REACT\node_modules\webpack-cli\bin\webpack.js:514
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uploadpublish@1.0.0 build: `webpack --mode production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uploadpublish@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\VERYNICE\AppData\Roaming\npm-cache\_logs\2020-06-10T14_43_53_493Z-debug.log

A: I had a slightly different problem. I ran npm audit fix --force while developing my app, and my project failed to compile when I tried to run npm start. I saw the previous answer, and found more information about npm auditin this article on Overreacted.
I ran git status to make sure the changes to package.json and package-lock.json were not yet staged for commit. Then, I ran git restore package-lock.json and git restore package.json. Then, I ran npm install again, and the app was able to compile.

A: I manually copied my package.json and package.lock.json from my previous commit, then I did an 'npm install' and rebuilt my React native app. It worked perfectly!

A: Unfortunately, an undo function does not exist in npm, so keeping the previous state of the package.json file and, if present, the package-lock.json and the npm-shrinkwrap.json (these files are optionally) to restore it via npm install (or short: npm i) is the way to go.
Normally, in a situation like yours, you would simply revert all changes to package.json and package-lock.json with a version control system like git. Of course, you can do this manually, too, if you have saved the previous version of these files somewhere. A present npm-shrinkwrap.json file is not affected by an npm update and therefor must not be restored.
Afterwards you can install the old version of your project's dependencies with npm i.
Keep in mind, that the package-lock.json takes precedence over package.json and the package.json file uses Semantic Versioning (semver). And the npm-shrinkwrap.json file takes precedence over both files. There are even some more subtle differences, but I think this goes too far for this answer.
For more details, you can refer to these docs:

*

*npm install

*package.json

*package-lock.json

*npm-shrinkwrap.json
So I hope you have a backup or a previous git commit somewhere. Otherwise you could try to resolve the error by trying to read the error message and use an older version of the package which throws this error (webpack in you case). Also the dependencies of this package could be the reason for the problem. But take your time, if you decide to go this way. Good luck! :)

A: I also had a similar kind of problem. while I developing my app I ran the command "npm audit fix --force". It upgraded all my dependencies and could not run my app.
What I did was in the below to fix the problem

*

*first I deleted both package.json and package-lock.json

*then also deleted node_modules folder.

*then restore the previous version of package.json, package-lock.josn and node_modules folder. (to restore process you can use a version controller like Git)

thats worked well with my issue.


text:
Q: docker-compose: django, development server not listening? I have been following along this simple tutorial about setting up a simple django/postgres project with docker compose.
I have made some minor modifications to the docker-compose.yml file which now looks like this:
version: '2'
services:
  db:
    image: postgres
  web:
    build: .
    command: bash -c "python manage.py migrate && python manage.py makemigrations && python manage.py runserver 9000"
    volumes:
      - .:/code
    ports:
      - "9000:9000"
    depends_on:
      - db

However when hitting 127.0.0.1:9000 on my browser I get

This site can't be reached

Here is the terminal output:
Starting wdocker_db_1
Starting wdocker_web_1
Attaching to wdocker_db_1, wdocker_web_1
db_1   | LOG:  database system was shut down at 2016-04-27 13:09:55 UTC
db_1   | LOG:  MultiXact member wraparound protections are now enabled
db_1   | LOG:  database system is ready to accept connections
db_1   | LOG:  autovacuum launcher started
web_1  | Operations to perform:
web_1  |   Apply all migrations: sessions, contenttypes, admin, auth
web_1  | Running migrations:
web_1  |   No migrations to apply.
web_1  | No changes detected

and here is the sudo netstat -tulpn | grep 9000 output
tcp6       0      0 :::9000                 :::*                    LISTEN      15022/docker-proxy

A: you need to listen django on 0.0.0.0:9000 like this :
command: bash -c "python manage.py migrate && python manage.py makemigrations && python manage.py runserver 0.0.0.0:9000"


text:
Q: Passing data from components in Angular 2 My objective is when the user clicks a message displayed on /messages, it redirects them to /message with the messages displayed information. Please direct me in the right direction if I'm doing something wrong.
This is my error:
Unhandled Promise rejection: Template parse errors:
Can't bind to 'messages' since it isn't a known property of 'message'. ("ge-header">{{user.name}}

    <message [ERROR ->][messages]="message"></message>
    Inbox:

   "): MessagesComponent@3:13
'message' is not a known element:
1. If 'message' is an Angular component, then verify that it is part of this module.
2. If 'message' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("class="page-header">{{user.name}}

    [ERROR ->]<message [messages]="message"></message>
    Inbox: <ul class="list-group" style="list-style-type: no"): MessagesComponent@3:4 ; Zone: <root> ; Task: Promise.then ; Value:

Messages Component:
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';

@Component({
  selector: 'app-messages',
  templateUrl: './messages.component.html',
  styleUrls: ['./messages.component.css']
})
export class MessagesComponent implements OnInit {
  messages: Object;
  username: String;
  user: Object;
  messageID: String;
  public UserList: Object;
  public RecpList: Object;

  constructor(private authService: AuthService,
    private router: Router
    ) { }

  ngOnInit() {
    this.authService.getProfile().subscribe(profile => {
      this.user = profile.user;
      this.username = profile.user.username;
    },
    err => {
      console.log(err);
      return false;
    });

    this.authService.getMessages(this.username).subscribe(list => {
        this.UserList = list.UserList;
        this.RecpList = list.RecpList;
    },
    err => {
      console.log(err);
      return false;
    });
  }

  onMessageClick(messageID){
    this.authService.getMessage(this.user, messageID).subscribe(list => {
      console.log(list);
      this.router.navigate(['/message', ]);
    });

  }
}

Messages html:

{{user.name}}

    <message [messages]="message"></message>
    Inbox:

{{message.createdBy}} {{message.subject}} {{message.dateCreated}}

    Sent:

{{message.recipients}} {{message.subject}} {{message.dateCreated}}

New Message

Message Component:
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';

@Component({
  selector: 'app-message',
  templateUrl: './message.component.html',
  styleUrls: ['./message.component.css'],
  inputs: ['messages']
})
export class MessageComponent implements OnInit {
messages: Object;
user: Object;
createdBy: String;
recipients: String;
subject: String;
message: String;
previousMessage: String;
nextMessage: String;

  constructor(private authService: AuthService,
    private router: Router) { }

  ngOnInit() {
    this.authService.getProfile().subscribe(profile => {
      this.user = profile.user;
    },
    err => {
      console.log(err);
      return false;
    });
  }

}

Message html:

{{messages.subject}}

This is my component structure

A: So it looks like a couple of things:

*

*You need to include the id or message in here this.router.navigate(['/message', ]); which is looks like you may have missed adding it in there

*You need to specify the path in your router like this { path: 'message/:id', component: MessageComponent }

*You can retrieve what is passed in by getting it from the params using something like this:
this.message = this.route.params.subscribe(params => {
   this.id = params['id'];
});


text:
Q: Where should I place JavaFX constants used for GUI measurements, according to best practices? Edit: I've seen this thread: What is the best way to implement constants in Java? already. They seem to be focusing on whether you should be using an interface with constants. I want to know where I should be placing my constants if they aren't being used by the entire class.

If I'm designing a GUI made with the Shape package (javafx.scene.shape.[whatever]), how should I go about placing my constant variables used to size them?
Class-scope
I was taught that constants should always be at the top of the class, which would give me something like this:
public class Foo extends Group{
    private final double WIDTH = 100;
    private final double HEIGHT = 100;
    private final double PADDING = 10;
    ...
}

Granted, I would probably put my public variables, if any, over those. I'd probably also put the non-constant privates as well.
However, this means I have these small blobs of constants at the top of my functions. I have two problems with this:

1 - They are often ignored
Robert C. Martin talks about how sometimes programmers will comment in "noisy" comments. These comments are so useless that they are ignored by the reader eventually. I feel like this also applies to blobs of constants used for measurements and positions.

2 - They aren't being used by most functions
Quoting Mr. Martin, this time:

Classes should have a small number of instance variables. Each of the methods of a class should manipulate one or more of those variables. In general the more variables a method manipulates the more cohesive that method is to its class. A class in which each variable is used by each method is maximally cohesive.

He later says that, of course, it's pretty hard to reach "maximal cohesion", and that's okay as long as the class is as cohesive as possible.
But wouldn't constants used for measurements break this cohesion if they were instanced by the class itself instead of by its functions?

Function-scope
Instead of instancing them with the class, should I just have them be function variables like this:
public class foo {
    private void initGUI() {
        final double WIDTH = 100;
        final double HEIGHT = 100;
        final double PADDING = 10;
        ...
    }
}

Doing it like this goes against what I was taught, however (but my teachers have been proven wrong in the past on some things).

Some people have told me to make a "Measurements" class and put all my constants there as plubic static variables. However I'm against that, as that would mean I'm dependent on that class every time I wanted to add a measurement and that I would have a class full of unrelated variables.

So, what's the best practice (or standard) to follow when handling constants used for measurements in JavaFX?

A: Constant class structure is among best practices
Keep your naming convention readable enough so that you won't require separate constant classes.
Always try to implement Keep It Simple Stupid and Don't Repeat Yourself
Related thread
What is the best way to implement constants in Java?

A: In my opinion, everything is about maintenance and readability. To find out if something is beneficial or not I used to ask myself the following questions :

*

*Does this change will increase the readability and why?

*Am I going to make any further changes in the future or someone else? If so what should I do to make those changes easier?

Adding too many unnecessary constants will increase the size of the class and it will be more of a 'noise'.  Now in your example above about the GUI constants, my opinion is more like 50-50. I like to do that also with my GUI constants but only if my class is small. Thus If the class body is big I used to remove the constants and to create a default constructor initializing them inside as constants and not as global variables, the only reason I do that is to increase readability because someone can easily fold the constructor's code and the noise disappeared.
Lastly, I believe the most important thing is what's it's better for you and your team. Even if you used to initialize them as global variables or something else when you work as a team you tend to adapt to the team's programing style choices and not to the "optimal" as you should.


text:
Q: NoReverseMatch where trying pass javascript varaible to url tag My urls look like:
url(r'^box_detail/', BoxJson.as_view(), name='box_details'),
url(
    r'^box_detail/(?P<box_id>\d+)/',
    BOXJson.as_view(), name='box_details'
)

and in js when i'm trying this:
var id = 5;
"{% url 'box_details' id %}"

I get
Reverse for 'box_details' with arguments '('',)' and keyword arguments '{}' not found. 2 pattern(s) tried: ['api/box_detail/(?P<box_id>\\d+)/', 'api/box_detail/']

I must use this:
"{% url 'box_details' %}" + id

but this looks not good, is there any option to do this?
Django 1.10.3


text:
Q: How to calculate dependent random variables without a contingency table I have 2 random variables X and Y and I know the following about them:
E(X) = 50 and Var(X) = 16
Furthermore Y is defined as:
Y = 0,5 X + 20
I am looking for the correlation between X and Y.
Corr(X,Y) = Cov(X,Y) / [Var(X)^(1/2) * Var(Y)^(1/2)]
I already figured out that E(Y) = E(0,5X + 20) = 20 + 25 = 45
and I also know that the covariance is Cov(X,Y) = E(XY) - E(X)E(Y)
Now, here is the question: How can I get E(XY)?
I know that you can calculate it when you have a contingency table. However, the excercise does not give any information about acutal values of X and Y. Moreover, I know that if the variables are independent you can calculate E(XY) by multiplying X and Y's means. But I think Y must depend upon X because it actually contains it.
Thanks for your help! :)

Solution:
$$\mathsf{Corr(X,aX+b)}=\frac{\mathsf{Cov(X,aX+b)}}{\sqrt{\mathsf{Var}X}\sqrt{\mathsf{Var}(aX+b)}}=\frac{a\mathsf{Cov}(X,X)}{\sqrt{\mathsf{Var}X}\sqrt{a^{2}\mathsf{Var}X}}=\frac{a}{|a|}\in\{-1,1\}$$
to make the solution easier to understand I will add the following rules that lead to this result:
Var(aX + b) = a^2 Var(X)
and
Cov(a1X + b1, a2Y + b^2) = a1 a2 Cov(X,Y)
finally,
Cov(X,X) = Var(X)

A: Shortcut (so not really an answer, but too much for a comment):
If $\mathsf{Var}(X)>0$ and $a\neq0$ then:
$$\mathsf{Corr(X,aX+b)}=\frac{\mathsf{Cov(X,aX+b)}}{\sqrt{\mathsf{Var}X}\sqrt{\mathsf{Var}(aX+b)}}=\frac{a\mathsf{Cov}(X,X)}{\sqrt{\mathsf{Var}X}\sqrt{a^{2}\mathsf{Var}X}}=\frac{a}{|a|}\in\{-1,1\}$$
In words: if $X$ is not degenerated with $\mathsf EX^2<\infty$ and $a\neq0$ then the correlation between $X$ and $Y=aX+b$ will be $1$ if $a>0$ and will be $-1$ if $a<0$.


text:
Q: Configuring WCF service for reading messages from windows server service bus I am trying to configure WCF SVC with the following configuration. Its not fetching the messages from the window server service bus topic/subscrition.
when i host and configure the same dynamically through code, it works .
<bindings>
      <customBinding>
        <binding name="messagingBinding">
          <textMessageEncoding  messageVersion="None"  writeEncoding="utf-8" />
          <netMessagingTransport/>
        </binding>
      </customBinding>

    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior name="securityBehavior">
          <transportClientEndpointBehavior>
            <tokenProvider>
              <windowsAuthentication domain="****" password="*****" userName="****">
                <stsUris>
                  <stsUri value="https://{machine/domain}:9355/SampleNamespace" />
                </stsUris>

              </windowsAuthentication>
            </tokenProvider>
          </transportClientEndpointBehavior>

        </behavior>
      </endpointBehaviors>
<services>

      <service name="Myservice.IntegrationService">
        <endpoint name="AccountingEndPoint"
                   listenUri="sb://{machine/domain}:9355/SampleNamespace/accounting/subscriptions/sub"
                   address="sb://{machine/domain}:9355/SampleNamespace/accounting"
                   binding="customBinding"
                   bindingConfiguration="messagingBinding"
                   contract="Myservice.IAccounting"
                   behaviorConfiguration="securityBehavior" />
      </service>
    </services>

[ServiceContract]
    public interface IAccounting
    {
        [OperationContract(IsOneWay = true, Action = "*"), ReceiveContextEnabled(ManualControl = true)]
        void AccountingReader(Message message);
    }


text:
Q: It's safe to ignore tabs and newlines when defining a macro? I've written several LaTeX environments to format a "use case flow" sequence for a college project. Being a computer programmer, I find quite annoying to not be able to use newlines and indentation (like C/Java code) to format the LaTeX code and make it more readable, as I know I must be aware of the "spurious spaces" problem. I know I can make safe newlines using %, but it's still quite weird.
Then, I remembered that each character read by TeX has assigned a 'catcode' that governs its behavior, and there's a catcode for characters that must be ignored (9). So, I had the idea of changing temporally the catcodes for newlines and tabs (that will be used for code formatting) and ignore them while the macros are being defined. For example, this code:
% UCSubFlow counter definition, etc
\newenvironment{subflow}[1]{%
\subparagraph{Subflow \arabic{UCSubFlow}: #1}%
\stepcounter{UCSubFlow}%
\begin{enumerate}%
}{%
\end{enumerate}%
}

becomes the, IMO, more pleasing to read:
% Ignore tabs and newlines
\catcode9=9
\catcode13=9

% UCSubFlow counter definition, etc
\newenvironment{subflow}[1]{
    \subparagraph{Subflow \arabic{UCSubFlow}: #1}
    \stepcounter{UCSubFlow}
    \begin{enumerate}
}{
    \end{enumerate}
}
% More macro definitions...

% Return tabs and newlines back to normal
\catcode9=10
\catcode13=5

The spacing at the start of the line are tabs, not spaces (they are still used). I'm assuming that:

*

*Most of the time, macros don't use <tab>s in its definition

*Most of the time, macros don't have large paragraphs of text. If I want to start a paragraph in my macro, it's better to use \par

*Macros always can be written in one line (very long ones, but one line anyway)

I've used it in my document and it seems to be all OK. The environment works as expected and it doesn't seems to have broken anything. Granted, my environment is quite simple (an special list). My question is: is this 'hack' safe in general when it comes to macro writing, of there is some hidden danger? (specially if I use other packages' macros inside my macro)

A: First of all, your intend can be realized simple by setting \endlinechar=-1. You needn't to set catcode for ^^M because \endlinechar-1 causes that this character isn't inserted. You needn't to set catcode for ^^I (tab) because spaces and tabs have catcode 10 and they are simply ignored at the beginning of each line.
But this setting is dangerous. Of course, this can't be put it in normal text of document, because after:
 Hello
 world!

we get Helloworld! as the result. And the usage of this setting only during macro reading? Imagine the definition:
\def\a{Hello
       world!}

then the same problem as above occurs. And the problem can be more hidden, for example:
\def\b{\ifnum\something=0
            123%
        \else
            456%
        \fi
}

Now, if the space is present at the end of each line then we have if(somenthing=0) 123 else 456 fi but if the space isn't present here then we have if(something=0123) else 456 fi and this is completely different behavior of such macro.


text:
Q: Keycloak sharing attribute ownership we're building a centralized identity management SAAS where users can store attributes and share them with third party customers.
We've decided to use Keycloak and I've created 2 realms (users & customers).
The user can add attributes to themselves (which they own), but we also want to allow customers to add custom attributes to a user (which the customer would be the main owner of).
In order for the user to be able to share the attribute with another customer, both the user and the customer who owns the attribute need to allow access.
The customer should be able to select the custom attribute as client scope while creating a new client if the customer who owns the attribute has allowed access.
I'm not sure which approach is best to solve this use case and would love some input.
Possible solutions:

*

*The customer would "tag" the attribute as public, private or which other customers to allow access to the attribute, either by adding another attribute with the same name but with _access postfix or storing access rights in a separate database (outside of Keycloak).

*Creating a realm / customer which "inherit" user attributes from the users realm (instead of having a customers realm).
Not sure if it's possible to "inherit" users from other realms?
Also, it would only solve the private and public access cases.

*Allow customers to request access to another customers custom attribute by adding a role or something to the customer that want access when the customer that owns the attribute has accepted the request.

Any other possible solutions?
Also, would you extend Keycloak with this functionality or build separate microservices that talk to Keycloak through the API with a custom UI for customers?


text:
Q: Starting many unrelated jobs in parallel on Grid Engine? I often want to start a set of entirely unrelated ("embarrassingly" parallel) jobs on a Grid Engine cluster, for load-balancing purposes.
What I do at the moment, I generate one Bash script for each job and then submit each of them separately, all controlled by a Perl-script that I wrote.
If I just put all jobs into one file, one line one job, then Grid Engine will execute the jobs sequentially which is besides the point.
Is there any way how I can have just one file, and tell Grid Engine that it should execute each line/job in parallel?
Basically I want something like Grid Engine Array Jobs. But the problem with array jobs is, they only work if the changing element between each job is a number, or an index in an array, and also if this number/index is evenly spaced. But I am talking about jobs that are completely unrelated and do not share a pattern.

A: You submit an array job using a moderately powerful interpreter to convert the $SGE_TASK_ID into whatever you want:
#$ -t 1-3
#$ -S /bin/bash
case $SGE_TASK_ID in
1)echo "I'm a teapot short and stout";;
2)cat /etc/passwd;;
3)touch ~/job3run;;
esac