text:
Q: Remotely check file size and get report This script tries to:

*

*get an input from a txt file, which is a list of computer names,

*check if a log file on a computer from the list is bigger than 1000 bytes,

*create a txt report with the names of those computers where the log file is more than 1000 bytes,

*create another txt report with the names of the computers where the file is less than 1000 bytes.
However, something goes wrong. Any help could be nice.
@echo off
for /f "tokens=*" %%I in (computernames.txt)do call :checksz %%I
goto :eof

:checksz
setlocal
set file="\\%1\c$\data\info.log"
set min=1000

FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA

if %size% GTQ %min% (
echo. %1 >>logsizemin.txt
) ELSE (
echo. %1>>logsizemax.txt
)

Hello everyone,
thanks for your valuable support. I congratulate whith those who conceived and built this site is really well done and useful.
I made some modifications to the script that you have kindly suggested to incorporate other features, but something is not working as I would like .. as you can view I use editv32 in order to hide password in my batch, the principle is the same but as you can see after checking the size of the log, "maxlongsize.txt" is used in order to take the names of the PCs on which do the next activity. I wish that the activities were performed sequentially on all PCs in the file "logsizemax.txt" with only one authentication at the beginning. I noticed that, for some reason sometimes the file "logsizemin.txt" is not created but i don't understand why. The maximum would be to put in another file such as "computer unreachable" those PCs that are not reached on the network but I have absolutely no idea how implement it. I hope I have sufficiently explained. Sorry for bad English! I think you understand my intention :). Following the batch
@setlocal
@echo off
editv32 -p "Enter username:" USR
editv32 -m -p "Enter password:" PWD
for /f "tokens=1" %%I in (computernames.txt) do call :checksz %%I
endlocal
goto :eof

:checksz
setlocal
set file="\\%1\c$\data\data.log"
set min=1000
type NUL>logsizemax.txt
type NUL>logsizemin.txt
if not exist %file% goto :eof
FOR /F "usebackq delims=" %%A IN ('%file%') DO set size=%%~zA

if %size% GEQ %min% ( echo %1>>logsizemax.txt ) ELSE ( echo %1>>logsizemin.txt )
endlocal

@setlocal
for /f "tokens=1" %%I in (logsizemax.txt) do call :sw %%I
endlocal
goto :eof

:sw
echo.
echo *****************************************
echo *          VBS & Deploy script      *
echo *****************************************

echo.
echo Run VBS and deploy script .....

psexec \\%1 -u %USR% -p %PWD% cscript "\\rep\Reg.vbs"
psexec \\%1 -u %USR% -p %PWD% cmd /c "\\rep\deploy.cmd"

echo.
echo **************************
echo *        EXE Run         *
echo **************************

echo.
echo Running exe .....

psexec -u %USR% -p %PWD% \\%1 "c:\Program Files\test.exe"

echo.
echo ***********************************
echo *    Exe application launched     *
echo ***********************************
echo.
goto END

:END
exit

A: Changes: GTG->GEQ, don't surround variable with quotes twice, remove leading space from echo, and a little clean up.
@setlocal
@echo off
for /f "tokens=1" %%I in (computernames.txt) do call :checksz %%I
endlocal
goto :eof

:checksz
setlocal
set file=\\%1\c$\data\info.log
set min=1000

if not exist %file% endlocal && goto :eof
FOR /F "usebackq delims=" %%A IN ('%file%') DO set size=%%~zA

if %size% GEQ %min% ( echo %1>>logsizemin.txt ) ELSE ( echo %1>>logsizemax.txt )
endlocal
goto :eof

edit: updated per comments from PA and Andriy M - endlocal if the file doesn't exist, and remove \ update note.

A: You can avoid using environment variables and using the second FOR alltogether. Try this simpler version of your bat, with a more generic :checksz routine.
@echo off
for /f "tokens=*" %%a in (computernames.txt) do (
  call :checksz "\\%%a\c$\data\info.log" 1000 "%%a"
)
goto :eof

:checksz
if %~z1 GTR %2 (
echo %~3 >> logsizemin.txt
) ELSE (
echo %~3 >> logsizemax.txt
)
goto :eof

see HELP CALL for more information.


text:
Q: Get XML value by attribute name
Possible Duplicates:
Attribute Value Selection in SimpleXML
SimpleXML: Selecting Elements Which Have A Certain Attribute Value

I'm parsing an XML document and looking for a specific ID.  The ID value is provided  in the ArticleId element under attribute "pii".  Raw XML:
<ArticleIdList>
    <ArticleId IdType="pubmed">12676398</ArticleId>
    <ArticleId IdType="pii">S0020729202004460</ArticleId>
</ArticleIdList>

Here is the entire document for reference: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=12676398&retmode=xml&rettype=abstract
Using simplexml_load_file(), I'm iterating through the document to obtain values.  Here's how I'm getting to the ArticleId element:
$xml_PubmedArticle->PubmedData->ArticleIdList->ArticleId;

The problem is that attributes in ArticleId are random in order.  Some ArticleId elements contain a "pii" value in the second element (as below), other records have a different attribute ("doi") in the second element.
SimpleXMLElement Object
(
    [ArticleId] => Array
        (
            [0] => 12676398
            [1] => S0020729202004460
        )
)

Variation:
SimpleXMLElement Object
(
    [ArticleId] => Array
        (
            [0] => 1234
            [1] => ABC123
            [2] => S002012345678
        )
)

I'm looking for the "S0002..." ID, which is identified in raw XML by attribute "pii".
How should I check/obtain a value based on a specific attribute?

A: A couple ways:
foreach ($xml_PubmedArticle->PubmedData->ArticleIdList->ArticleId as $id) {
   foreach ($id->attributes() as $name => $value) {
      if ($value == 'pii') {
         //FOUND!
      }
   }
}

..or much simple xpath
$xml_PubmedArticle->xpath('PubmedData/ArticleIdList/ArticleId[@IdType="pii"]');

More specific xpaths are faster.
Also note that the first option will only iterate over the first ArticleIdList where as the XPath will return an array of all the items it finds.

A: You can access a specific element by an attribute's value using xpath:
echo $xml_PubmedArticle->xpath('//ArticleIdList/ArticleId[@IdType="pii"]')[0];

See also Basic SimpleXML Usage in the manual.
A related question is: simplexml, returning multiple items with the same tag

redpajama_set_name: RedPajamaStackExchange


text:
Q: Array of objects to form-data format Javascript Im trying to deal with the next problem - convert array of objects to form-data format
const obj = [{ name: 'Sergio' , age: 16 } , { name: 'Ivan' , age: 24 }]

What is the best decision to handle this problem? Ive already tried cycle, but still give me incorrect answer


text:
Q: Regex help, subset based on nth occurance from the end of string An example vector:
string <- "Junk1_Junk2_Junk3__ID1_Junk4_Junk5.pdf"

I am trying to subset ID1 by counting _ (underscores) from the right; so subset between the second and 3rd underscore from the right.
expected output: ID1
My attempt was to try to use the double __,
but this is not going to work, because not all my string list has it.
Attempt: (_){2}([^_]+)
Side note, I am trying to get comfortable with regex; please recommend a resource to build and test.
Any assistance is appreciated.

A: You can use
library(stringr)
stringr::str_extract(string, "[^_]+(?=(?:_[^_]*){2}$)")

Or, same approach with base R:
## Base R:
sub(".*?([^_]+)(?:_[^_]*){2}$", "\\1", string)

See the regex demo and the R demo online.
Details:

*

*[^_]+ - one or more chars other than _

*(?=(?:_[^_]*){2}$) - a positive lookahead that requires two sequences of _ and then zero or more repetitons of any char other than _ till the end of string

*.*?([^_]+)(?:_[^_]*){2}$ matches

*

*.*? - any zero or more chars, as few as  possible

*([^_]+) - Capturing group 1 (\1 in the replacement pattern refers to this captured string): one or more chars other than _

*(?:_[^_]*){2} - two sequences of _ and then zero or more repetitons of any char other than _

*$ - end of string.

A: sub(".*_([^_]+)(_[^_]+){2}", "\\1", string)
[1] "ID1"

A: I thought about doing this in pure Regex, but I think I would actually simplify this problem in R. I'm going to use some very simple regex and two R commands instead of 1.
str_extract(string,"[^_]+_[^_]+_[^_]+$") %>%
  str_remove("_[^_]+_[^_]+$")

Here I'm finding a combo of not-underscores [^_]+ and underscores _.
For ease of Regex I'm extracting the whole string. Then I remove the excess.
Alternatively, we can use a bit more complex Regex with the lookahead method.
str_extract(string,"[^_]+(?=_[^_]+_[^_]+$)")

I think the lookahead code is a bit more advanced to read for many coders that don't use Regex a lot.


text:
Q: operand should contain 1 columns SELECT topic_id
FROM phpbb_topics AS t
WHERE t.topic_id IN (
    SELECT p.topic_id, COUNT(p.post_id) AS total_posts
    FROM phpbb_posts AS p
    WHERE p.poster_id = 61640
    GROUP BY p.topic_id
    HAVING t.topic_replies_real = total_posts - 1
);

That query gets me the following error:
Error Code: 1241. Operand should contain 1 column(s)
Any ideas?

A: You shouldn't include COUNT(p.post_id) AS total_posts in SELECT list in your subquery.
Just
SELECT topic_id
FROM phpbb_topics AS t
WHERE t.topic_id IN (
    SELECT p.topic_id --, COUNT(p.post_id) AS total_posts
    FROM phpbb_posts AS p
    WHERE p.poster_id = 61640
    GROUP BY p.topic_id
    HAVING t.topic_replies_real = COUNT(p.post_id) - 1
);


text:
Q: Visual C# - Missing partial modifier I get an error saying "Missing partial modifier on declaration of type 'projectName.Main'; another partial declaration of this type exists.
From what i can read about this error, its because i have classes with same name. It does work if i modify the main class to public partial class Main : Form but i want to know why it gives me this error. I need to initializeComponent within Main(), tried creating a method start() and then calling main.Start() in a load event, but then the form loads blank.
namespace projectName
{
    public class Main : Form
    {
        public Main() // Method: Starts the main form
        {
            InitializeComponent();
        }

        public void Main_Load(object sender, EventArgs e)
        // On load of main class, handle events and arguments
        {
            Main main = new Main();
            main.getCurrentDomain();
        }

        public void getCurrentDomain() // Method: Get current domain
        {
            Domain domain = Domain.GetCurrentDomain();
        }
    } // Ends the main class
}

A: Assuming this is a Windows Forms app, the problem is that the Visual Studio WinForms designer has created another file (e.g. Main.designer.cs) with:
public partial class Main : Form

to contain designer-generated code.
Your partial class source is effectively merged with that - but it can only happen when both source files declare that the class is partial. Otherwise, you're just trying to declare two classes with the same name in the same namespace, which is prohibited by C#.

A: There is another file with the name .designer.cs. This file contains the partial definition of class and that is where your InitializeComponent function is defined. You need to add partial modifier to your class.


text:
Q: Adding persistence to react redux immutable web app I am trying to add persistence to my redux stores, I am using Immutable.js within my webapp. I have seen the following libraries: https://github.com/rt2zz/redux-persist and https://github.com/rt2zz/redux-persist-immutable I am wondering exactly how to create the persister and the store in context of my application, please see the following config-store.js:
import rootReducer from '../reducers'
import {
  createStore,
  compose,
  applyMiddleware
} from 'redux'
import thunk from 'redux-thunk'

export default (initialState) => {
  return createStore(
    rootReducer,
    initialState,
    compose(
      applyMiddleware(thunk),
      window.devToolsExtension ? window.devToolsExtension() : f => f
    )
  );
};

and my index.js:
import React from 'react';
import {render} from 'react-dom';
import './index.css';
import App from './App';
import {Provider} from 'react-redux';
import configureStore from './store/configure-store';
import registerServiceWorker from './registerServiceWorker';

const store = configureStore();

render(
   <Provider store={store}>
     <App />
   </Provider>,
  document.getElementById('root')
)
registerServiceWorker();

A: Load the persiting state from local storage.
if (localStorage.getItem("state")) {
  var serializedState = localStorage.getItem("state");
  /* upload changes to server here */
  preloadedState = JSON.parse(serializedState);
}

Save store changes to local storage.
store.subscribe(() => {
  var serializedState = JSON.stringify(store.getState());
  localStorage.setItem("state", serializedState);
});


text:
Q: Evaluate $\lim\limits_{x \to +\infty}\left[\sqrt[4]{x^4+x^3+x^2+x+1}-\sqrt[3]{x^3+x^2+x+1}\cdot \frac{\ln(x+e^x)}{x}\right].$ Problem
Evaluate
$$\lim_{x \to +\infty}\left[\sqrt[4]{x^4+x^3+x^2+x+1}-\sqrt[3]{x^3+x^2+x+1}\cdot \frac{\ln(x+e^x)}{x}\right].$$
Solution
Substitute $x$ for $\dfrac{1}{t}$,namely,$x=\dfrac{1}{t}$. Then
\begin{align*}
&\lim_{x \to +\infty}\left[\sqrt[4]{x^4+x^3+x^2+x+1}-\sqrt[3]{x^3+x^2+x+1}\cdot \frac{\ln(x+e^x)}{x}\right]\\
=&\lim_{t \to 0+}\left[\frac{\sqrt[4]{1+t+t^2+t^3+t^4}}{t}-\frac{\sqrt[3]{1+t+t^2+t^3}}{t}\cdot t\ln \left(\frac{1}{t}+e^{\frac{1}{t}}\right)\right].
\end{align*}
On one hand,according to Taylor's formula, we may have
$$\sqrt[4]{1+t+t^2+t^3+t^4}=1+\frac{1}{4}t+o(t);$$
$$\sqrt[3]{1+t+t^2+t^3}=1+\frac{1}{3}t+o(t).$$
On the other hand,notice $$\lim_{t \to 0+} t\ln \left(\frac{1}{t}+e^{\frac{1}{t}}\right)=1,$$
then we may denote
$$t\ln \left(\frac{1}{t}+e^{\frac{1}{t}}\right)=1+\alpha(t),$$
where $\alpha(t) \to 0(t \to 0+)$.
Futher, we have
$$\lim_{t \to 0+}\frac{\alpha(t)}{t}=\lim_{t \to 0+}\left[\ln \left(\frac{1}{t}+e^{\frac{1}{t}}\right)-\frac{1}{t}\right]=0,$$
thus, we may denote
$$t\ln \left(\frac{1}{t}+e^{\frac{1}{t}}\right)=1+\alpha(t)=1+o(t).$$
Therefore
\begin{align*}
&\lim_{t \to 0+}\left[\frac{\sqrt[4]{1+t+t^2+t^3+t^4}}{t}-\frac{\sqrt[3]{1+t+t^2+t^3}}{t}\cdot t\ln \left(\frac{1}{t}+e^{\frac{1}{t}}\right)\right]\\
=&\lim_{t \to 0+}\left[\frac{1+\frac{1}{4}t+o(t)}{t}-\frac{1+\frac{1}{3}t+o(t)}{t}\cdot (1+o(t))\right]\\
=&\lim_{t \to 0+}\left[-\frac{1}{12}+\frac{o(t)}{t}+\frac{o(t)}{3}+\frac{o(t^2)}{t}\right]\\
=&-\frac{1}{12}.
\end{align*}
Please correct me if I am wrong. Hope to see other solutions.

A: Your approach is fine. But you don't need to deal with higher order terms, just handling till $o(t) $ is sufficient.
Here is another solution. If the expression under limit is $a-bc$ then we can write it as $a-b+b(1-c)$. As you show $a-b\to-1/12$ and further $$1-c=-\frac{\log(1+xe^{-x})}{x}$$ and $b/x\to 1$ so that limit of $b(1-c) $ is same as that of $x(1-c)$ and clearly it is $0$. Thus the answer is $-1/12$.
The limit of $a-b$ can be handled by using your substitution $x=1/t$ and then adding subtracting $1/t$ to get $(a-1/t)-(b-1/t)$. Using the standard limit $$\lim_{z\to k} \frac{z^n-k^n} {z-k} =nk^{n-1}$$ we can see that $a-1/t\to 1/4$ and $b-1/t\to 1/3$.


text:
Q: Are there any big controversies in contemporary mathematical research? Are there any big controversies in contemporary mathematical research?
Other domains contain big controversial research topics (for example string theory in physics).
The specific nature of mathematics however, makes me suspect that there isn't much room for any serious disagreement, or at least less room in comparison..?
Is this intuition right, or completely ignorant and absurd?
--- This is not a question about mathematics per se, but more a question about the people doing it. I hope the question is still appropriate in this stackexchange. ----

A: Yes. There is a controversy in symplectic geometry/symplectic topology about whether some proofs are complete as they have been presented. Also there is some controversy about whether Mochizuki has actually solved ABC conjecture or not because IUTT is too tough to verify right now.
Edit: After a long wait I have decided to edit this answer. It appears that IUT is false, although this isn't conclusively confirmed (and might not ever be). The fields medalist Scholze has raised some big questions that Mochizuki inadequately (in my opinion) addressed.
Edit 2: There was also controversy about who was the first to prove the prime number theorem, although Selberg was given the credit in the end. See here.

A: Maybe "controversy" isn't the word, but like the Gallic village, the constructivism continues alive and defying the mainstream mathematics.
The entry Constructive Mathematics of the Stanford Encyclopedia of Philosophy is very interesting. In the bibliography you can find examples of recent constructivist research.

A: I want to address the question/comments with this answer, which contains some links/quotes and at the end I put in my two cents.
Mathematician Doron Zeilberger:
"For most people, the computer is only a tool, like a vacuum cleaner. For me, it's like a colleague. Traditional mathematics is based on the notion of rigorous formal proof, and I think this is going to be obsolete, I think since computers are so powerful, they open up new vistas, and the old agenda of proving everything so rigorously is not as exciting as it was before."
See In Mathematics, Mistakes Aren't What They Used To Be
Vladimir Voevodsky who won the Fields Medal in mathematics is also interested in computers:
"The world of mathematics is becoming very large, the complexity of mathematics is becoming very high, and there is a danger of an accumulation of mistakes," Voevodsky said. Proofs rely on other proofs; if one contains a flaw, all others that rely on it will share the error.
See Will Computers Redefine the Roots of Math?
When a legendary mathematician found a mistake in his own work, he embarked on a computer-aided quest to eliminate human error. To succeed, he has to rewrite the century-old rules underlying all of mathematics.
This video is also interesting,
What if Current Foundations of Mathematics are Inconsistent?
Vladimir Voevodsky
My two cents:
Five years ago few researchers thought that robotics/AI would be able to play the game of Go or Poker at world class levels. The progress that has been made in both games has been awesome, and AI may very soon dominate these two very different types of games. It is reasonable to expect increasing interplay between theoretical computer science and pure mathematics.
So, what is the big controversy? Well, if I am allowed to hold an opinion, perhaps that the dividing line between computers and pure mathematics has not really blurred at all over the past forty or so years.


text:
Q: Json to Json Help I have this format to Read a Json and get the values on it:
public class Assets {
    public String accountNumber {get;set;}
    public Integer deposit {get;set;}
    public String description {get;set;}
    public String id {get;set;}
    public Integer interestRate  {get;set;}
    public String lastUpdated {get;set;}
    public List<String> owners {get;set;} //required
    public String recordType {get;set;}
    public String supplier {get;set;}
    public String type {get;set;} //required
    public String typeOfAccount {get;set;}
    public String typeOrigValue {get;set;}
    public Double value {get;set;}

    public Assets(JSONParser parser) {

        while (parser.nextToken() != System.JSONToken.END_OBJECT) {
            if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) {
                String text = parser.getText();
                if (parser.nextToken() != System.JSONToken.VALUE_NULL) {
                    if (text == 'Type') {
                        type = parser.getText();
                    } else if (text == 'ID') {
                        id = parser.getText();
                    } else if (text == 'Owners') {
                        owners = arrayOfString(parser);
                    } else if (text == 'Value') {
                        value = Double.valueOf(parser.getText());
                    } else if (text == 'Description') {
                        description = parser.getText();
                    } else if (text == 'AccountNumber') {
                        accountNumber = parser.getText();
                    } else if (text == 'Supplier') {
                        supplier = parser.getText();
                    } else if (text == 'LastUpdated') {
                        lastUpdated = parser.getText();
                    } else if (text == 'RecordType') {
                        recordType = parser.getText();
                    } else if (text == 'TypeOfAccount') {
                        typeOfAccount = parser.getText();
                    } else if (text == 'TypeOrigValue') {
                        typeOrigValue = parser.getText();
                    } else if (text == 'InterestRate') {
                        interestRate = Integer.valueOf(parser.getText());
                    } else if (text == 'Deposit') {
                        deposit = Integer.valueOf(parser.getText());
                    } else {
                        System.debug(LoggingLevel.WARN, 'Assets consuming unrecognized property: '+text);
                        consumeObject(parser);
                    }
                }
            }
        }
    }
}

Know i want to put this values on a Class that gone to create a New Json someone can help me?
public class Tenas{
    public String Type {get;set;}
    public String Owners;
    public List<Cenas> Cenas= new List<Cenas>() ;
    public List<Menas> Menas= new List<Menas>();
    public string Supplier;

}
Class Assets already fetch the values of Json and i want yo put the values on Tenas class that will create a new JSON.

A: First, I would highly recommend avoiding using the parser. Instead use JSON.serialize and JSON.deserialize.
There are a number of questions on this site that talk about how to serialize and deserialize JSON. For instance this one.
In your case it would look like this:
public class Assets {
    public String accountNumber {get;set;}
    public Integer deposit {get;set;}
    public String description {get;set;}
    public String id {get;set;}
    public Integer interestRate  {get;set;}
    public String lastUpdated {get;set;}
    public List<String> owners {get;set;} //required
    public String recordType {get;set;}
    public String supplier {get;set;}
    public String type {get;set;} //required
    public String typeOfAccount {get;set;}
    public String typeOrigValue {get;set;}
    public Double value {get;set;}
}

Then you would do:
Http http = new Http();
HttpResponse response = http.send(request);
Assets assets = (Assets)JSON.deserialize(response.getBody(), assets.class);

Then to send out are request using the same class
Tenas tenas = new Tenas();

//... Do some work to fill up the tenas object

HttpRequest request = new HttpRequest();
request.setBody(JSON.serialize(tenas));
Http http = new Http();
http.send(request);


text:
Q: Convert String to Location in Kotlin I'm working on an Android app in Kotlin in which I want to save a 'Location' object to SQLite and then recover it later.  I can convert a 'Location' object to a 'String' by simply calling 'toString()' on the 'Location' object like this:
var loc:Location
var str:String

... Code to init loc ...

str = loc.toString

After which the String has a value such as:
str = Location[gps 37.328528,-121.897877 hAcc=8 et=+1d15h4m55s443ms alt=-6.62762451171875 vel=0.36 bear=264.9 vAcc=17 sAcc=3 bAcc=97 {Bundle[mParcelledData.dataSize=96]}]

How do I then convert the resulting String back to a Location object
Update #1
This is my attempt to use Gson as per the suggestion by @DivijGupta
    constructor(i_productName: String, i_date:String, i_location:Location?)
    {
        var parcel:Parcel?=Parcel.obtain()
        var locStr:String = ""

        var longitude:Double

        if(i_location!=null) {
            logEntryAction = i_productName
            logEntryDate = i_date

            longitude = i_location.longitude
            locStr = Gson().toJson(i_location)   <-----  Gson
        }
        else
        {
            longitude = 0.0
        }
        logEntryLongitude = longitude

A: You can use Gson library for the same.
Add the dependency
implementation 'com.google.code.gson:gson:2.8.6'

Convert the object to a string
val jsonString = Gson().toJson(loc)

Now to get the object from string
val location = Gson().fromJson(jsonString, Location::class.java)


text:
Q: Unexpected output printed in python while subtracting 2 numbers I discovered this unusual behavior while running a python code.
Code:
print(4.1-2.5)

Output:
1.5999999999999996

Why is the output incorrect, whereas it should have been 1.6?


text:
Q: Global installation with npm doesn't work after Mac OS X Mavericks update After upgrading to OS X 10.9 Mavericks, node wasn't found anymore in bash. I think I installed it with brew a while ago.
I decided to use the installer from node.js website. It went fine and both node and npm became available in bash. However, installing packages globally doesn't work.
The npm -g bin outputs following path /usr/local/bin.
However, after running npm install -g karma and invoking ls -la /usr/local/bin I can't see a symlink to the path where karma executable resides.
Running npm -g root returns /usr/local/lib/node_modules and after the installation I can see that karma module is there.
Not sure what I else I could check. Thanks!

A: I had the same problem due to not accepting the xcode license after upgrading to Mavericks.  I was able to accept the new xcode license by running the following:

sudo xcodebuild -license

However, npm still was not working because symlink was not created, but trying to reinstall said npm was already there.  I went ahead and:

brew remove npm

and then reinstalled with:

brew install npm

and I am back working again.  Not a big fan of the reinstall, but I think the need to accept the xcode license left things in a hung state.

A: I had the same problem - npm did not work after upgrading to mavericks.  I tried all the above steps, but was still stuck.  Specifically, when I tried to re-install node,
I got the error:
Warning: The post-install step did not complete successfully
You can try again using brew postinstall node
But running brew postinstall node responded:
Error: Permission denied - /usr/local/lib/node_modules/npm/AUTHORS
I tried removing all the node modules previously installed
sudo rm -rf /usr/local/lib/node_modules/
and then uninstalling and reinstalling node
and that finally got both node and npm working as before.

A: I found that the root cause of all of my npm install issues was the missing Xcode license agreement.
After the Maverick update, XCode upgraded as well and if you don't launch XCode, the license agreement will be missing.
Once I accepted the agreement, installs were successful.

A: The problem seems to have occured because I tried to install packages that were previously on my system. The symlinks weren't created, probably because of that. Once I removed the packages and re-installed them (or tried to install packages I haven't had), they were added to /usr/local/bin as symlinks.

A: I had the same problem. After a maverick upgrade npm was not working, yet node itself was. I was not using the latest version as our team prefers to use 0.8.10.
In any case nvm, the node.js version manager, was still working. In this case I just reinstalled:
$ nvm install 0.8.21
######################################################################## 100.0%
Now using node v0.8.21
$ npm
Usage: npm <command>

where <command> is one of:
add-user, adduser, apihelp, author, bin, bugs, c, cache,
completion, config, ddp, dedupe, deprecate, docs, edit,
explore, faq, find, find-dupes, get, help, help-search,
home, i, info, init, install, isntall, issues, la, link,
list, ll, ln, login, ls, outdated, owner, pack, prefix,
prune, publish, r, rb, rebuild, remove, restart, rm, root,
run-script, s, se, search, set, show, shrinkwrap, star,
stars, start, stop, submodule, tag, test, tst, un,
uninstall, unlink, unpublish, unstar, up, update, version,
view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm faq          commonly asked questions
npm help <term>  search for help on <term>
npm help npm     involved overview

In the case where nvm was not working you might need to reinstall that, as well- ymmv

A: I am not sure if my answer was too late or not.  I found myself in a difference situation than you.  Hope that my experience an hour ago helps you.
my npm version (npm -v) is 1.4.28.  First, I installed node.js on a computer with an administrator account.  Then I created a user with administrator rights.  When I tried to check the version of npm running, I failed to do so.
I searched the web and came across with this text.  The original poster asked to check the path settings.  I did not have node.js and npm installed with homebrew, another software that made me headache two months ago.  I checked that I can run node.  It is because node is located at /usr/local/bin, where all users have rights to execute programs.  But for npm, it is in fact a link to ../lib/node_modules/npm/bin.  However, the /usr/local/lib folder is not accessible by other users' but the administrator's account only.
I "sudo -i" and granted "chmod a+x ../lib" to it.  Surprisingly, all folders' within have the correct execution right.  I suspected that is some sorts of bug.  I exited sudo and tried "npm -v" again.  Succeed.
Hope that helps.

A: In case the other solutions posted here do not work for you either, you may try out the approach suggested on this GitHub page. With a complete re-installation according to the insturctions on the page, I finally got npm (and an application, vs-mda-remote to be precise) working.
EDIT: This happened after updating from Mavericks to Yosemite.


text:
Q: SwiftUI - rounded textField I have a textField:
TextField("Message...", text: $chatViewModel.composedMessage)
          .frame(height: 30)
          .padding(10)
          .background(RoundedRectangle(cornerRadius: 20))
          .foregroundColor(Color(red: 237/255, green: 237/255, blue: 237/255))

It creates the rounded corner with the correct foregroundColor but the text color is also the same as the foregroundColor.
So if I change this:
.foregroundColor(Color(red: 237/255, green: 237/255, blue: 237/255))

to
.foregroundColor(Color.black)

It changes the textfield background colour but also the text color, so I can never see what im actually typing in the textField.

A: 2022, SwiftUI 2.0
TextField("File Name", text: $fileName)
    .textFieldStyle(RoundedBorderTextFieldStyle())

A: Add file color for RoundedRectangle.
.background(RoundedRectangle(cornerRadius: 20).fill(Color(red: 237/255, green: 237/255, blue: 237/255))) // Here!!
.foregroundColor(.black)

A: TextField("Email", text: $email)
            .textFieldStyle(.plain)
            .frame(height: 40)
            .clipShape(Capsule())
            .padding()
            .overlay(RoundedRectangle(cornerRadius:10.0).strokeBorder(Color.gray, style: StrokeStyle(lineWidth: 1.0)))
                        .padding()


text:
Q: How to set a breakpoint in function body in R-studio? I have an R script which calls a function written by me. However, when I execute the script, the program doesn't stop at the debug point in the function body.
The only time debug points work is when they are set in the main script file. I am using R-studio IDE, however any general solution would also be appreciated.

A: If you work on multiple files, you have to source R files with
debugSource("C:/Users/...")

instead of
source("C:/Users/...")

from your main script

A: I 'd like to add one important point to the @rmuc8 answer.

*

*Set the breakpoint in your function as the official guide says: https://support.rstudio.com/.... It will appear a empty or filled red circle.

*In your main script that call that function, write above the function's invocation.

debugSource("C:/Users/...")

*DO NOT RUN pressing CTRL+ALT+R. Run selecting and CTRL+R. Otherwise it will not stop on the breakpoint.


text:
Q: Group by with priority of column value over other row in mysql I have a database table like below.

Here I am using group by on parent_sku column. Here is my query and its result.

SELECT
  domain,
  parent,
  parent_name,
  parent_sku,
  SUM(qty)        AS sales,
  SUM(gross)      AS revenue,
  SUM(net)        AS net_revenue,
  SUM(refund_qty) AS returns,
  created_at
FROM report_byproducts_name
GROUP BY parent_sku
ORDER BY sales DESC
LIMIT 50

But I want to give priority for the domain name. Like if I give priority to themusthaves domain then it should give the result as domain = themusthaves and parent = 450212 with the same group by.
Currently, I am always getting domain=tmhde and parent=325227
Expected Result

Note: Please ignore created_at column
Any suggestions will be appreciated
Thanks
Here I am adding SQL Fiddle

A: I think you need to aggregate a few more columns then join back to your table to get the relevant non aggregate columns something like
   select domain,
         parent,
         parent_name,parent_sku,
         sumsales,sumrevenue,sumnet_revenue,sumreturns
from report_byproducts_name
Join
(
SELECT
  max(parent) maxparent,
  parent_sku aggsparent_sku,
  SUM(sales)        AS sumsales,
  SUM(revenue)      AS sumrevenue,
  SUM(net_revenue)  AS sumnet_revenue,
  SUM(returns) AS sumreturns
FROM report_byproducts_name
GROUP BY parent_sku
) aggs on aggs.maxparent = parent and aggs.aggsparent_sku = parent_sku;

+--------------+--------+--------------------------------+------------+----------+-------------------+-------------------+------------+
| domain       | parent | parent_name                    | parent_sku | sumsales | sumrevenue        | sumnet_revenue    | sumreturns |
+--------------+--------+--------------------------------+------------+----------+-------------------+-------------------+------------+
| themusthaves | 450212 | Pailletten Damaged Jeans Grijs | 311        |      350 | 13692.89013671875 | 11360.31005859375 |          1 |
+--------------+--------+--------------------------------+------------+----------+-------------------+-------------------+------------+
1 row in set (0.00 sec)

Can I suggest you change float fields to decimal(10,2).

A: You can achieve this by creating temp table. Here is what you can do:
WITH temp AS
(
SELECT
  parent_sku,
  SUM(qty)        AS sales,
  SUM(gross)      AS revenue,
  SUM(net)        AS net_revenue,
  SUM(refund_qty) AS returns,
  created_at
FROM report_byproducts_name
GROUP BY parent_sku
)
SELECT * FROM report_byproducts_name
WHERE parent_sku IN (SELECT parent_sku FROM temp) AND domain = 'themusthaves'

You can give priority in Where clause.

A: Thanks for the support. I can get the expected results using the subquery like below. I don't know the way is correct or not but I am posting my answer here through which I can get expected results. Through I will wait for the better suggestions to get expected results.
SELECT
  (SELECT domain FROM report_byproducts_name WHERE domain='themusthaves' AND parent_sku=rbn.parent_sku) as domain,
  (SELECT parent FROM report_byproducts_name WHERE domain='themusthaves' AND parent_sku=rbn.parent_sku) as parent,
  parent_name,
  parent_sku,
  SUM(sales) as sales,
  SUM(revenue) as revenue,
  SUM(net_revenue) as net_revenue,
  SUM(returns) as returns,
  created_at
FROM report_byproducts_name rbn
GROUP by parent_sku
ORDER BY sales DESC
LIMIT 50

Here is SQL Fiddle for the expected results


text:
Q: Displaying all records before 90 days I am trying to display a list of donors who are available to donate blood. For this I'm calculating if their last donation date is before 90 days or not. Here is my query:
select *
from donar, donation
    donar.id=donation.donar_id
    and sex='female'
    and datediff(curdate(),donation_date) > 120

The problem is it displays donor's name perfectly but if a donor gave blood now it still shows his name in list beacuse he has a previous entry before 90 days. How can I solve this?

A: You're missing a where in your example. Give this a shot... you need to look at the query from another angle... Based on your comments below, here is a simple way to get the males and females by different day limits.  You could probably do this without the UNION in  a single statement, but I think the union keeps the logic of the different days for men and women.
 SELECT * from donor
   LEFT JOIN donation ON donor.id=donation.donor_id
        AND donation.donation_date > NOW() - INTERVAL 120 day
 WHERE donation.donation_id IS NULL
      AND donor.sex='female'

 UNION

 SELECT * from donor
   LEFT JOIN donation ON donor.id=donation.donor_id
        AND donation.donation_date > NOW() - INTERVAL 90 day
 WHERE donation.donation_id IS NULL
      AND donor.sex='male'

Basically this query says "Give me all the people in the donar table, include info on those with donations withing 90 days, then only show those without donation details (AKA people who haven't donated in 90 days).

A: select * from donar
       left join donation
                 on ( donar.id=donation.donar_id )
       where (
               ( sex='female' and datediff(curdate(),donation_date) > 120)
               or
               ( sex='male' and datediff(curdate(),donation_date) > 90)
             )
             or donation.id is null;


text:
Q: Linq list of string match any inside string Ok, so given the array:
string[] keywordlist = new string[] { "match", "found" };

This returns the error "The data types text and text are incompatible in the equal to operator":
 List<StaticPage> matches = cdc.StaticPages.Where(x=>keywordlist.Contains(x.BodyCopy)).ToList();

And this does not give an error but returns 0 results although there are several rows that should meet the condition, and I don't see why I would need to send the table to a list (at least never had the need to do it before):
List<StaticPage> matches = cdc.StaticPages.ToList().Where(x=>keywordlist.Contains(x.BodyCopy)).ToList();

So whats wrong? I just want to return any rows in witch --> any <-- of the words in the array is found in the "BodyCopy" field.

A: Your line
List<StaticPage> matches = cdc.StaticPages.Where(x=>keywordlist.Contains(x.BodyCopy)).ToList();

means that you are looking such pages that have BodyCopy equals to one of keywords. Instead of that, you need the following line:
var matches = cdc.StaticPages.Where(
    x => keywordlist.Any(keyword => x.BodyCopy.Contains(keyword))
).ToList();

It means that your are looking such pages the have one of keyword inside their content.
A full snippet:
class StaticPage
{
    public string BodyCopy;
}
static void Main()
{
    string[] keywordlist = { "match", "found" };
    var cdc = new
    {
        StaticPages = new List<StaticPage>
            {
                new StaticPage {BodyCopy = "text match text"},
                new StaticPage {BodyCopy = "text text"},
                new StaticPage {BodyCopy = "text found text"}
            }
    };
    var matches = cdc.StaticPages.Where(
        x => keywordlist.Any(keyword => x.BodyCopy.Contains(keyword))
    ).ToList();
    foreach (var staticPage in matches)
        Console.WriteLine(staticPage.BodyCopy);
}

Output:
text match text
text found text


text:
Q: Ethers.js Error: invalid json response with provider.getEtherPrice() function I´m trying to obtain the Ether Price using ether.js.
I tried to do call the function
const etherProvider = new ethers.providers.EtherscanProvider('homestead', 'ETHERSCANAPIKEY');
etherProvider.getEtherPrice().then(data => {
   console.log(data);
}).catch(err => console.log(err));

And gives me this err:
Error: invalid json response
    at XMLHttpRequest.o.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (ethers.min.js:1)
    at XMLHttpRequest.wrapFn (zone-evergreen.js:1191)
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:39680)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:465)
    at invokeTask (zone-evergreen.js:1603)
    at XMLHttpRequest.globalZoneAwareCallback (zone-evergreen.js:1629)
I also tried to call directly the api of etherscan:
this.http.get('https://api.etherscan.io/api?module=stats&action=ethprice&apikey=APIKEY')
.subscribe(data => console.log(data));

And its returning null
Typescript 3.7.5
Angular 8.3.23
Node 12.16.1
Ionic 5.4.15


text:
Q: product of topological spaces I was just wondering, if $X$ is a topological space and $A$ is a closed subset of the topological space $Y,$ where $f$ is the function mapping $f:X\rightarrow Y$, then is the product $X\times A$ also a closed subset of $X\times Y?$ (Note $Y$ here is compact and Hausdorff)
Quite frankly, in the notes it says it is closed but I do not know why it is the case, can anyone help me explain why it is the case?

A: Your question should be: is $X \times f(A) $ close subset of $X \times Y $? And the answer is no, $f$ has to be continuous and open or close mapping.


text:
Q: Can there be a comma between the adverb and the noun of the last member of a series? I saw a practice SAT question on Khan Academy:

Certified Executive Chef Hilary DeMane has prepared confections for celebrities, governors, and even Ronald Reagan.

The correct answer is filled in and in boldface. While I find this correct answer most natural, I wonder when it is permissible to add a comma between the adverb and the noun of the last member of the series. I understand that the following is incorrect:

... governors, and even, Ronald Reagan.

But this, with a comma between the adverb "importantly" and "interest rates", seems natural to me:

Factors that affect bond prices include inflation, credit ratings, and most importantly, interest rates.

Or is the above not correct either? Should there be a comma before between "and" and "most importantly" as well in order to make it grammatical?

Factors that affect bond prices include inflation, credit ratings, and, most importantly, interest rates.

Thanks!

A: What you're talking about is adding parenthetical nonessential information as denoted by a pair of commas.
It's also something that's quite acceptable.
However, you do need to make sure that there are two commas used.

... governors, and even, Ronald Reagan.

In this example, the usage is wrong because there is no initial comma. It should be rephrased:

 . . . governors, and, even, Ronald Reagan.

Here, even is nonessential and could be removed from the sentence without affecting it:

 . . . governors, and Ronald Reagan.

So, even needs to have a comma both before it and after it. (Or be used without any commas at all.)
Using only a single comma for this purpose is ungrammatical.

Your last example does this well and is quite correct:

Factors that affect bond prices include inflation, credit ratings, and, most importantly, interest rates.

All you need to do is ask yourself if you could remove the word or words between the two commas (along with those two commas) and have the sentence remain grammatical.

A: The first is a case of an Oxford comma used for emphasizing the end clause.  It's not one of a parenthetical as in the other.
HTH.


text:
Q: Can we make our own web server to host a websites and respond to HTTP requests? A web server responds to an HTTP request and sends the client a set of HTML, CSS, and JS files.
After we build a website or a web application, we usually have to host it on a well-known web server like IIS or Apache to make it accessible all around the world (on the internet).
Can't we just make our own web server so that it can responds to all incoming HTTP requests that the client sends to our computer without having to use IIS?

A: As wazz and Lex says, you could build your own server to listen the special port and handle the request based on your requirement, but it contains performance and security issue.
If you still want to build it by yourself. I suggest you could refer to some existing server like KestrelHttpServer.


text:
Q: Android Log.d Print Line Number I catch the following code in a try/catch statement:
            catch (Exception e){
            Log.d("MyTag", "exception ->: "+e.toString());
        }

It prints:
MyTag: exception ->: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference

How can I make it print the line number along with the error message because I am finding it difficult to locate this null object reference string within my code?

A: The simplest solution is to rewrite your Log statement as:
Log.d("MyTag", "Exception while doing ...", e);

(where you replace the "..." with a few words about what the try block was trying to do)
This will print a complete stack trace, along with your two strings, to LogCat.
The vast majority of Android developers go this route and should go this route.
If, for some reason, you really want to just get the line number, e.getStackTrace()[0].getLineNumber() should have that information. However, in many cases, that will not be a line number in your Java file, but a line number in some other Java file where the exception occurred. This is why printing the stack trace is a better option, as you get more files and line numbers.

A: Use the method with the Throwable at the end:
catch (Exception e){
            Log.d("MyTag", "exception ->:", e);
}

Log Api


text:
Q: File does not begin with '%pdf' im using fpdf to convert a php output into a pdf file. i tried to copy out a sample code of theirs to see how it looks. but when i run my program, i get this error:
File does not begin with '%PDF-'.
Local\EWH-4080-27

i googled some solutions but none worked. something i also noticed was that the last number(27) was increasing by 2 every time i ran my program and encounter the error. the sample code i copied is this:
<?php
require('protected/extensions/fpdf/fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

im also working on yii. im wondering of this problem has something to do with my code or my adobe reader or something.


text:
Q: How to index versioned column of HBase table in Solr I am using HBase as big data store for real-time access of individual record(s) and Solr for searching data stored in HBase.
I want to add versions to a column of HBase table so that it can also hold previous values. For example, I set parameter VERSIONS => 5 for column cust_info:address so as to keep last five addresses of customer.
I have created an equivalent field in schema.xml file of Solr collection as shown,
<field name="address" type="text_general" indexed="true" stored="true" multiValued="true"/>

When I search for a record in Solr, it shows only latest updated value of address. I want to do searching in all five addresses of customers.
How can I index and store this multi-version column of table in corresponding Solr field?

A: I have found an alternative stratey for doing same thing with HBase and solr. Instead of adding versions to a column cust_info:address, add multiple columns in Hbase as required. Since HBase is schema-free, you can add as many columns as you want in a column-family. Add columns cust_info:addr1, cust_info:addr2, cust_info:addr3, cust_info:addr4, cust_info:addr5 to insert five addresses if they exist.
In Solr, create a dynamic field in schema.xml file, as shown
<dynamicField name="addr*" type="text_general" indexed="true" stored="true"/>

Now there will be five fields in Solr document as addr1, addr2, addr3, addr4, addr4, addr5. You can search in all these fields.
OR
If you don't want to create multiple address fields like addr1, addr2,... you can do it with copyField as following:

*

*Create a multiValued field, e.g, address

*Create a dynamic field addr* that will match all fields beginning
with addr

*Create a copyField that will copy all fields matching with addr*
to address field

E.g.
<field name="address" type="text_general" indexed="true" stored="true" multiValued="true"/>

<dynamicField name="addr*" type="text_general" indexed="false" stored="false"/>

<copyField source="addr*" dest="address"/>

This way makes querying much easier than previous one because you have to search only in single field address.


text:
Q: How can I run a node.js script as multiple scripts? no impact on each other I've a node.js application that get some bot telegram token and run them as a bot.
I use telegraf module.
But when a bot receive too many request or throw an error and then crashed, this happen for the others bot.
What can i do to solve this problem.
I want the bots to be separate from each other.
A way is Copying my code and run the bots as multi script separately.
But i have many bot so it's impossible.
Here is my code to run the bots:
const Telegraf = require('telegraf');
var {Robots} = require('./model/models/robots');

var botsList = [];
setInterval(() => {
    Robots.find({bot_type: 'group manager'}).then((res) => {
        if(res.length > 0){
            var tokens = [];
            for(var i = 0 ; i < res.length ; i++){
                var newToken = res[i].token;
                tokens.push(newToken);
            }

            var bot = [];

            tokens.map(token => {
                if(!botsList.includes(token)){
                    botsList.push(token);
                    var botUserId = token.split(':')[0];

                    bot[botUserId] = new Telegraf(token);

                    module.exports = {
                        bot
                    };

                    const Commands = require('./controller/commands/commands.js');

                    bot[botUserId].on('text', (ctx) => {
                        Commands.executeCommand(bot[botUserId], ctx);
                    });

                    bot[botUserId].startPolling();
                }
            });
        }
    }).catch(console.log);
}, 5000);

A: If you just want the error in one broker to not affect the script as whole, you can just handle the error using process.uncaughtException handler for the script.
process.on('uncaughtException', console.log);

If you want to go a step further and create child process for each bot to run in. Use child_process module provided by Node.
const fork = require('child_process').fork;

fork('./bot.js', token);

Here, the bot.js can have all the bot related code.
Hope this helps!


text:
Q: Is it possible to create this flowchart in Latex? Is it possible to create the following flowchart in Latex?

Can you provide an code example?Thanks in advance.

A: A starting point using TikZ and its positioning library:

The code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[
  mynode/.style={
    draw,
    rounded corners,
    font=\sffamily,
    text width=1.5cm,
    align=center
  },
  ar/.style={
  ->,
  >=latex,
  }
]
\node[mynode] (c1) {data};
\node[mynode,below=of c1] (c2) {data};
\node[mynode,below=of c2] (c3) {data};
\node[mynode,below=of c3] (c4) {data};
\coordinate[below=20pt of c4] (aux);

\node[mynode,left=of c2] (l1) {data};
\node[mynode,below=of l1] (l2) {data};

\node[mynode,right=of c2] (r1) {data};
\node[mynode,right=of r1] (rr1) {data};

\foreach \Valor in {1,2,3}
{
  \draw[ar] (c\Valor) -- (c\the\numexpr\Valor+1\relax);
}
\draw[ar] (c4.south) -- ++(0,-8pt) -| ([xshift=-6pt]r1.south);
\draw[ar] ([xshift=-6pt]c1.south) -- ++(0,-15pt) -| (l1);
\draw[ar] ([xshift=6pt]c1.south) -- ++(0,-15pt) -| (r1);
\draw[ar] ([xshift=6pt]l1.south) -- ([xshift=6pt]l1.south|-l2.north);
\draw[ar]
  ([xshift=-6pt]l1.south) --
  ++(0,-15pt) --
  ++(-25pt,0) |-
  (aux) -|
  ([xshift=6pt]r1.south);
\draw[ar] (r1) -- (rr1);
\end{tikzpicture}

\end{document}


text:
Q: Cakephp setaction rendering issue on 2.0.6 Cakephp Pagination rendering issue. I am using cakephp 2.0.6. When i try to render a page from other action its fine. But when i try to go to next page the problem starts
I have the following function
   public function admin_index()
   {
       //Function listing
   }

The same function needed for all type of users(support,employee etc).
So I used the setAction method as follows
public function support_index()
   {
        $this->setAction('admin_index');
        $this->render('admin_index');
   }

And my Pagination code is as follows :
    echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));

    echo $this->Paginator->numbers(array('separator' => ''));

    echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));

But when I try to go next page the URL as follows
http://www.example.com/support/users/admin_index/page:2
http://www.example.com/employee/users/admin_index/page:2

But the following output needs to come :
http://www.example.com/support/users/index/page:2
http://www.example.com/employee/users/index/page:2

The Problem is  $this->setAction('admin_index'); i think.. any one helps appreciated

A: I made the changes in the following file lib/Cake/Controller/Controller.php
The changes made in setAction method it works well now. especially the problem is in 2.0.6
public function setAction($action) {
    $this->request->params['action'] = $action; //Commented this Line
    $this->view = $action; //Commented this Line

    $this->request->action = $action; // Added this Line
    $args = func_get_args();
    unset($args[0]);
    return call_user_func_array(array(&$this, $action), $args);

}

A: setAction
Internally redirects one action to another. Does not perform another HTTP request unlike Controller::redirect();
Redirection is a different terminology, actually when it redirect to another action then it will become that action automatically that's why paginate will does not change the url.
Instead of using setAction you can use following code:
public function admin_index()
{
    $this->set('data',$this->__paginatedata());

}

function __paginatedata(){
    $this->paginate = array('limit'=>5);
    $this->Model->recursive = 0;
    return $this->paginate();
}

public function support_index()
{
    $this->set('data',$this->__paginatedata());
    $this->render('admin_index');
}


text:
Q: LibreOffice/OpenOffice Calc not letting to write phones I input phones from keyboard as:
+9 (999) 999-99-99

After each cell edit the program shows a message that it detected an error in a formula:

LibreOffice Calc found an error in the formula entered. Do you want to
  accept the correction proposed below?
=+9 *(999)

It makes me make an additional click on each cell edit. Both LibreOffice and OpenOffice behave exactly the same.
How do I disable this behavior?


text:
Q: Eigenvalue multiplicities Find the geometric and algebraic multiplicities for each eigenvalue.
    A=
Okay, so after doing calculations' , I find that the eigenvalues come out to be: 2, 1, and -1.
Great! But I am wondering what should I do next? I can't find a good example of this in my textbook.
Thanks

A: The algebraic multiplicity of an eigenvalue is its multiplicity as a root of the characteristic polynomial.
Since the eigenvalues are unique, the algebraic multiplicity for each eigenvalue is one.
What does it also mean for the geometric multiplicity (since the eigenvalues are unique)?
The geometric multiplicity of an eigenvalue never exceeds its algebraic multiplicity.
What eigenspace is spanned by the eigenvalue when solving $[A− \lambda I]v_i=0$? That is, the geometric multiplicity is the dimension of the nullspace of $A– \lambda I$.
Said differently, how many linearly independent eigenvectors can you find for each eigenvalue?
In this problem, the geometric multiplicity for each eigenvalue is one.
See Multiplicities, go through the $4x4$ matrix example there which has two repeated eigenvalues.


text:
Q: ¿Cómo guardar datos en un array empezando en el último indice utilizado en la iteracion previa de un for? Quiero guardar los datos de arrayNumeros en pedazoArrayNumeros, pero a cachos, es decir, que en la primera iteracion del while, me guarde los 1ºs cuatro elementos, en la segunda los siguientes 4,etc.
y la cuestion es que por mas que intento, o me dan excepciones o me guarda en todas las iteraciones los primeros 4 elementos.
¿Cómo podría solucionar este problema para recorrer todo el array e ir guardando pedazos en cada iteracion?
    int[] arrayNumeros = {1, 2, 3, 3, 2, 4, 2, 3, 4, 5, 3, 2, 1, 2, 3, 4, 6, 3, 6, 6, 4, 3, 2, 2, 3, 4, 4,};
    Arrays.sort(arrayNumeros);
    int[] pedazoArrayNumeros = new int[4];
    int casos = 3;

    while (casos > 0) {
        casos--;
        for (int i = 0; i < arrayNumeros.length; i++) {
            int aux=0;
            for (int j = 0; j < pedazoArrayNumeros.length; j++) {
                pedazoArrayNumeros[aux] = arrayNumeros[j];
                ++aux;
            }

        }
        System.out.println(Arrays.toString(pedazoArrayNumeros));
    }

A: int[] arrayNumeros = {1, 2, 3, 3, 2, 4, 2, 3, 4, 5, 3, 2, 1, 2, 3, 4, 6, 3, 6, 6, 4, 3, 2, 2, 3, 4, 4,};
Arrays.sort(arrayNumeros);
int[] pedazoArrayNumeros = new int[4];
int aux=0;
while(aux<arrayNumeros.length){
        for(int i=0;i<pedazoArrayNumeros.length;i++){
            if(aux==arrayNumeros.length)
                //Si se llega al final de array se sale y conserva el valor anterior (En este caso por eso hay dos veces 5)
                break;
            else
                pedazoArrayNumeros[i]=arrayNumeros[aux];
            aux++;
        }

        System.out.println(Arrays.toString(pedazoArrayNumeros));
    }

La excepción te salta por que el tamaño de tu array no es multiplo del tamaño del pedazo ArrayNumeros, para eso es el if y los ultimos campos del array son los mismos que los anteriores. Ya que es un array de una dimension no en cada vuelta del bucle estas sobrescribiendo el anterior y no se guarda el valor. Para guardarlo usa un array de 2 dimensiones.

A: No estoy seguro de haberte entendido, pero yo lo haría de la siguiente manera, utilizaría List en lugar de arrays Java, sería algo como:
int[] arrayNumeros = {1, 2, 3, 3, 2, 4, 2, 3, 4, 5, 3, 2, 1, 2, 3, 4, 6, 3, 6, 6, 4, 3, 2, 2, 3, 4, 4,};
Arrays.sort(arrayNumeros);

List<List<Integer>> cachos = new ArrayList<>();
int  LIMITE_CACHOS = 3;

for (int i = 0; i < arrayNumeros.length && cachos.size() < LIMITE_CACHOS;) {

    List<Integer> pedazo = new ArrayList<>();
    for (int j = 0; j < 4 && i < arrayNumeros.length; j++) {
        pedazo.add(arrayNumeros[i++]);
    }
    cachos.add(pedazo);

}
System.out.println(cachos);

Con este código si pones un limite de cachos mayor del número existente, te genera una lista igual con todos los elementos y el último cacho con el número de elementos restante, el cual puede ser menor de 4.


text:
Q: UITableView not reloading data or calling cellForRowAtIndexPath I am having a serious issue with UITableView's reloadData method. I have a UIViewController class, WiGiMainViewController that has a UITableView and NSMuttableArray in it. I am currently issuing network calls in the AppDelegate, and posting notifications to the WiGiMainViewController once the data has been downloaded. In my selector method for the notification, reloadWigiList, I am passing an NSArray containing the the recently downloaded items. I then initialize the WiGiMainViewController's NSMuttableArray with the passed in array and proceed to call reloadData() on my UITableView object. I can see from NSLog statements that the numberOfRowsInSection is fired on reload but not the cellForRowAtIndexPath, therefore causing the UI NOT to reload the UITableView with the newly downloaded items. I have verified that the reloadData method is being called on the main thread and that the datasource delegate are set in IB and programatically in the viewDidLoad method of WiGiMainViewController. Any ideas why my UITableView, wigiLists isn't reloading the data, in particular, not calling the cellForRowAtIndexPath method?
 @interface WiGiMainViewController :     UIViewController<FBRequestDelegate,UITableViewDelegate, UITableViewDataSource> {

 //setup UI
 UITableView *wigiLists;

 WiGiAppDelegate *myAppDelegate;
 NSMutableArray *itemsList;

}
 @property (nonatomic, retain) WiGiAppDelegate *myAppDelegate;
 @property (nonatomic, retain) IBOutlet UITableView *wigiLists;
 @property (nonatomic, retain) NSMutableArray *itemsList;

-(void) reloadWigiList: (NSNotification*) notification;
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView;
 -(NSInteger) tableView: (UITableView*) tableView numberOfRowsInSection:(NSInteger) section;
 -(UITableViewCell *) tableView: (UITableView*)tableView cellForRowAtIndexPath:   (NSIndexPath *)indexPath;

@end

 @implementation WiGiMainViewController

 @synthesize headerLabel = _headerLabel, userNameLabel = _userNameLabel, facebookPicture = _facebookPicture,
 myAppDelegate, wigiLists, itemsList;

- (void)viewDidLoad {
 NSLog(@"In viewDidLoad");
 [[NSNotificationCenter defaultCenter] addObserver:self   selector:@selector(reloadWigiList:) name:@"wigiItemUpdate" object:nil];

 // get appdelicate
 self.myAppDelegate = (WiGiAppDelegate*) [[UIApplication sharedApplication] delegate];
 self.itemsList = [[NSMutableArray alloc] init];
 //setup tableview
  self.wigiLists = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
      self.wigiLists.delegate = self;
 self.wigiLists.dataSource = self;
 //set up view
 [self.headerLabel setText:self.myAppDelegate.HEADER_TEXT];
 //check if user is logged in
 if (self.myAppDelegate.isLoggedIn) {
      //user is logged in
      NSLog(@"HERE");
      //get facebook information to populate view
      [self retrieveFacebookInfoForUser];
      //[self.myAppDelegate retrieveWigiItems];
 }else {
      //user is not logged in
      NSLog(@"user not logged in");
      //show login modal
 }
 //[self.wigiLists reloadData];
 [super viewDidLoad];
}

 -(void) reloadWigiList: (NSNotification *) notification {
 if ([NSThread isMainThread]) {
      NSLog(@"main thread");
 }else{
      NSLog(@"METHOD NOT CALLED ON MAIN THREAD!");
 }
 NSLog(@"notification recieved:%@", notification.userInfo);

 NSLog(@"in reloadwigilists:%@", wigiLists );
 NSLog(@"list size:%@", self.itemsList);
 NSLog(@"delegate:%@",self.wigiLists.delegate);
 NSLog(@"datasource:%@",self.wigiLists.dataSource);
 //populate previously empty itemsList
 [self.itemsList setArray:notification.userInfo];
 NSLog(@"list size:%@", self.itemsList);
 [self.wigiLists reloadData];

}

 /////////////////////////////////////
 // UITableViewDelegate protocols
 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
 //NSLog(@"numberofsections: %@", [self.itemsList count]);
 return 1;
}

 -(NSInteger) tableView: (UITableView *)tableView numberOfRowsInSection:(NSInteger) section {
 NSLog(@"7t87giuiu%@",self.itemsList);
 NSLog(@"numberofrows: %i", [self.itemsList count]);

      return [self.itemsList count];

 //return 6;

 }

A: Wow! after 3 days of banging my head against this problem, it was something ridiculously simple. In my ViewDidLoad method of WiGiMainViewController, i was initializing my tableview:
self.wigiLists = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];

Because I had linked the tableView I created in IB to my instance wigiLists, alloc'ing and initializing in the ViewDidLoad overwrote my link to the tableView created in IB and currently being displayed. Getting rid of this line fixed everything.


text:
Q: Error Converting MySQL Query to SQL Server Trying to convert below query into SQL, query works fine on MySQL. Problem seems to be the GROUP BY area. Even when I use just 1 GROUP BY field I get same error. Using query in InformaticaCloud.
ERROR

"the FROM Config_21Cent WHERE resp_ind = 'Insurance' GROUP BY
  resp_Ind;;] is empty in JDBC connection:
  [jdbc:informatica:sqlserver://cbo-aps-inrpt03:1433;DatabaseName=SalesForce]."

    SELECT sum(Cast(Resp_Ins_Open_dol AS decimal(10,2))) as baltotal,
           carrier_code,
           carrier_name,
           carrier_grouping,
           collector_name,
           dataset_loaded,
           docnum,
           envoy_payer_id,
           loc,
           market,
           master_payor_grouping,
           plan_class,
           plan_name,
           resp_ins,
           resp_ind,
           resp_payor_grouping,
           Resp_Plan_Type,
           rspphone,
           state
      FROM Config_21Cent
     WHERE resp_ind = 'Insurance'
  GROUP BY
  (resp_ins + resp_payor_grouping +
  carrier_code + state + Collector_Name);

A: Your entire query isn't going to work.  The group by statement contains a single expression, the summation of a bunch of fields.  The select statement contains zillions of columns without aggregates.  Perhaps you intend for something like this:
select resp_ins,  resp_payor_grouping,  carrier_code,  state,  Collector_Name,
       sum(Cast(Resp_Ins_Open_dol AS decimal(10,2))) as baltotal
from Config_21Cent
WHERE resp_ind = 'Insurance'
GROUP BY resp_ins,  resp_payor_grouping,  carrier_code,  state,  Collector_Name;

THis will work in both databases.

A: The columns in SELECT statement must be a subset (not proper subset but subset) of columns in 'GROUP BY' statement. There is no such restriction on aggregates in SELECT statement though. There could be any number of aggregates; aggregates even on columns not in GROUP BY statement can be included.


text:
Q: ColdFusion - SQL execution time varies by Application I'm running 2 separate sites/Applications under a single install of ColdFusion.
The execution time of SQL statements is different depending on the site they are run in.
If, for example, I run the following SQL Server command:
DBCC USEROPTIONS

Site 1 consistently executes in 0 or 1 ms:

Site 2 consistently executes in around 20 ms:

Both sites are using the same CF datasource set up in the CFIDE admin.
What else could account for the variation I am seeing?
Thanks,
Stu

A: OK - I think I've found the reason for this.
In the Site 1 example another DB query had run before my test query.
In the Site 2 example the test query was the first to run.
Presumably the extra ms are just DB connection setup overhead.
Mystery solved. Not the smoking gun I was looking for.


text:
Q: numpy array in numpy array evaluation to true when it shouldn't? Does any one have any idea why the below is evaluating to True?
board[y_new:y_new + self.size, x_new:x_new + self.size]

array([[[ 75,   0, 130],
        [ 75,   0, 130],
        [ 75,   0, 130]],
       [[ 75,   0, 130],
        [ 75,   0, 130],
        [ 75,   0, 130]],
       [[ 75,   0, 130],
        [ 75,   0, 130],
        [ 75,   0, 130]]], dtype=uint8)

Above is my array.
When I check if a value is in the array col = np.array([255,   0,  64]) like this...
col in board[y_new:y_new + self.size, x_new:x_new + self.size]

I get
True
Its early in the morning and I still need my coffee but this makes NO sense to me right now.


text:
Q: Android display image from sdcard using AQuery or Picasso message="file:///storage/sdcard0/My Folder/images/Camera_1415795981117.jpg"// image is available at this location

Picasso.with(context).load(  message+"")
                        .into(holder.iv_message_image);

have also tried
message="storage/sdcard0/Fresh IM/images/Camera_1415795981117.jpg";

also tried
message="file://storage/sdcard0/My Folder/images/Camera_1415795981117.jpg";

and also tried with AQuery
aQuery.id(holder.iv_message_image).image(message)
                 .progress(R.id.pb_loading);

both picasso and AQuery  load images from url properly but not from local Please help!
Using Picasso-2.2.0 jar
Thanks in Advance,
Pragna

A: For your solution this will help. To display image from  SDcard you need to convert it to URI first.
 Uri uri = Uri.fromFile(new File(message));
 Picasso.with(context).load(uri)
        .into(holder.iv_message_image);

Must check your image path message is not wrong.

A: The following code would be very helpful and make sure that you are loading file when you want to load an image from SD card.
Picasso.with(context).load(new File(path)).into(imageView);


text:
Q: server side pagination in Angular 5 I need to implement server side pagination that is from api I am getting page number and page limit , I need to display series of button below the table and on click of that button api call will happen with respective button number.Suppose I click button number 2 then i need to display page number 2 data in table.for this I am using angular 5. I tried ngx-pagination but it didn't work for me.My json is like this :
[
  {
    "pagecount": [
      {
        "record_count": "69",
        "pagenumber": "0",
        "pagelimit": "5"
      }
    ]
  },
  {
    "completed": [
      {
        "queueid": "297885",
        "cust_name": "MR DEWESH SHANKER",
        "veh_number": "KA03 MW7878",
        "payment_status": "Paid",
        "queue_total": "7104",
        "rating": "5.0"
      },
      {
        "queueid": "298162",
        "cust_name": "Pratham Motors Stockyard",
        "veh_number": "CH14 0527",
        "payment_status": "Paid",
        "queue_total": "0",
        "rating": "5.0"
      },
      {
        "queueid": "298163",
        "cust_name": "MS PALLAVI R DHOTRAGAVI\t",
        "veh_number": "KA51 MK4228",
        "payment_status": "Paid",
        "queue_total": "2131",
        "rating": "5.0"
      },
      {
        "queueid": "298196",
        "cust_name": "Pratham Motors Stockyard",
        "veh_number": "CH15 9983",
        "payment_status": "Paid",
        "queue_total": "0",
        "rating": "5.0"
      }
    ]
  }
]

How can i achieve this . Anyone Please ?

A: There are number of pagination component available for Angular, some of them which I used are -

*

*https://www.primefaces.org/primeng/#/paginator

*https://www.npmjs.com/package/angular2-bootstrap-pagination
You can use

*

*https://www.primefaces.org/primeng/#/datatable/paginator
as well depending on your requirements.

A: Have you tried angular data-table? The configuration is similar to the classic data-table.Looks promising.
https://l-lin.github.io/angular-datatables/#/getting-started


text:
Q: What does *(long *) and *(int*) mean? Could you explain what the next two lines do?
// Line 1
*(long *)add1= *(long *)add2;
// Line 2
*(int *)add1 = *(int *)add2;

Edit 1. I add the complete block of code of the function I test.
PS It is only a part of the skript. [original Skript]
It is a custom memcpy function to copy block of memory from A to B.

    (2)
    while(word_left > 0){
        *(char *)temp++ = *(char *)src++;
        word_left --;
    }

    return (void *)dest;
}

Mr Vlag was so kind and explained what the lines in the part(1) mean.
My question is regarding to the part(2). This part should solve a problem if the memory address overlaps.
Why do we use char here? Why can we not use long or int?

A: In the both records const6ructions ( long * ) and ( int * ) mean casting pointers correspondingly to pointer types long * and int *. Then these pointers are dereferenced *( long * )addr2 and *( int * )addr2 to get access to pointed objects values of which are assigned to other objects that are obtained also through casting and dereferencing pointers.
To make it more clear consider a demonstrative program.
#include <stdio.h>

int main(void)
{
    int x = 10;
    int y = 0;

    printf( "x = %d, y = %d\n", x, y );

    void *p1 = &x;
    void *p2 = &y;

    *( int * )p2 = *( int * )p1;

    printf( "x = %d, y = %d\n", x, y );

    return 0;
}

The program output is
x = 10, y = 0
x = 10, y = 10

In this program for example the pointer p1 of the type void * due to the casting ( int * )p1 is interpreted as a pointer of the type int * that points to an object of the type int (in this case it points to the object x). Now dereferencing this pointer *( int * )p1 you get a direct access to the pointed object x.
You may not just write for example
y = *p1;

because you may not dereference a void pointer because the type void is an incomplete type. So the compiler will not know how to interpret the pointed memory.

A: The C standard function memcpy is sometimes implemented in a similar manner like this. This function has no requirement that the addresses passed by the application are aligned.
A naive version could just run a for loop using char byte type and copy everything byte by byte. Then we don't have to worry about alignment, but such code will be slow since it isn't taking advantage of the CPU data width.
More efficient code will do the copying on the largest data size that the CPU can handle in a single instruction, such as for example 32 or 64 bits. This is supposedly what this code is supposed to do. If we do that, we still have to take care of potential misalignment in the start and trailing bytes in the end of the segment to be copied. That part has to be copied byte by byte, similar to the code at the end of your function.
This is the first place where we notice that the code you posted is severely broken - it doesn't handle initial misalignment.
Worse yet, it assumes that int cpu_size = sizeof(char *); gives the CPU data width size which is just plain wrong - the size of a pointer corresponds to the address bus width which is not the same thing as the maximum data register width on a whole lot of existing systems.
Another problem/bug is that temp += cpu_size; isn't valid C code but a non-standard gcc extension. We can't do pointer arithmetic on void pointers.
Cosmetic bugs are the casts between void* and void*. Obviously we don't need to cast between the same types. Every object pointer in C can in fact get implicitly converted to a void* without casts, given that qualifiers (const etc) match.
And finally, we can't run code such as this on a standard C compiler, because de-referencing some unknown data with a value access of long or int is very likely undefined behavior and a strict aliasing violation. What is the strict aliasing rule? The actual memcpy function as part of the standard lib isn't written in standard C and can't get compiled as it. (It is quite likely written in assembler and often inlined in the calling code.)
So what you should do with this code here is to delete it and forget that you ever saw it, because there's nothing to learn from it. The person who wrote it didn't know what they were doing. With the "Yoda conditions" obfuscation it looks like code from the 1980s - if so, then I'd recommend to avoid studying really old code like that.


text:
Q: Mac OSX: how to know if app automatically launched at session startup/login? The users of my app can choose if they want (or not) launch my app at their session startup.
To do this, I use LSSharedFileListRef as described here : How do you make your App open at login?
What I want now is to know if my app has been launched automatically at session startup or via a click on the icon in the dock. Indeed, I have to do different actions in these two cases.
I have got the feeling that it is not possible to use the parameters of the notification in the following delegate method to do this:
- (void)applicationDidFinishLaunching:(NSNotification *)notification

I have seen the following posts but they do not help:
How can I know how my app was launched on Mac OS? => NO ANSWER except some links to other posts which do not help more...
Know if the user launched an app => I don't see how to set/get the "Y" parameter defined in this post
Mac OS X: open application at login, without showing the main window => deals with the fact to hide or not the main window at startup ; what I want is more general: how to know how the app has been launched?
Anybody can help me ?
Thanks !

A: If application is set to run at startup, it will run (why not?). So you can save the application start time somewhere.
And on the later run (for instance, user quit your application and run again) check if there is this parameter, and if it is later than system boot time, than application this time is not run automatically.
You can check the system boot time via [NSProcessInfo systemUptime]

A: I'd check Parent Process ID. If it equals 1 it means it was launched by launchd at start up time.
struct kinfo_proc info;
size_t length = sizeof(struct kinfo_proc);
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
if (sysctl(mib, 4, &info, &length, NULL, 0) < 0)
    return OPProcessValueUnknown;
if (length == 0)
    return OPProcessValueUnknown;

 //info.kp_eproc.e_ppid is what you need

A: If you can't get @bioffe's answer to work, here it is again with a little more:
From: http://www.objectpark.net/parentpid.html
#include <sys/sysctl.h>

#define OPProcessValueUnknown UINT_MAX

//Returns the parent process id for the given process id (pid).
int OPParentIDForProcessID(int pid)
{
    struct kinfo_proc info;
    size_t length = sizeof(struct kinfo_proc);
    int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
    if (sysctl(mib, 4, &info, &length, NULL, 0) < 0)
        return OPProcessValueUnknown;
    if (length == 0)
        return OPProcessValueUnknown;
    return info.kp_eproc.e_ppid;
}

A: Open a Terminal window, type last | grep '^reboot' | awk 'END { print $3" "$4" "$5" "$6 }' to get the reboot time and match the time of the specific application launch, as @AnoopVaidya pointed out.


text:
Q: calling angular2 component function from sigma.js bind events I have a simple function in my angular2 component as follows:
onSelectNode(label: String) {
console.log(label)
// do something based on label
  }

and have created a basic sigma.js graph in angular2 as follows:
var s = new sigma({
  graph: sigmaJson,
  container: 'network-graph',
  settings: {
    defaultNodeColor: '#ec5148'
  }
});

My graph is getting rendered successfully. Now I want to call the function onSelectNode when one of the node is clicked. So, I have used the bind functionality as follows:
s.bind('clickNode', nodeClick)

The function nodeClick is defined as follows:
nodeClick(event) {
this.selectedLabel = event.data.node.label
console.log(this.selectedLabel)   // this prints correctly
this.onSelectNode(this.selectedLabel)  // getting error here

}
But I am not able to call the component function from within the nodeClick function. I am getting the following error in javascript console:
ERROR TypeError: this.onSelectNode is not a function

Can anybody point out what I am doing wrong?

A: Found the solution. The problem was using the wrong this scope variable as pointed in first comment here.
Ended up make the following change in the code and it worked:

*

*Save the current this context in a separate variable before the callback function.
var self = this;

*Modified the code as follows:
s.bind('clickNode', function (e) {
  console.log(e.type, e.data.node.label, e.data.captor);
  self.selectedLabel = e.data.node.label;
  self.OnSelectNode(self.selectedLabel);
});


text:
Q: In Spring WebFlow, how can I resume a flow? Using version 2.2.1 of Spring Webflow, I am trying to resume a flow execution in the middle of the flow.
For instance, if I have 4 steps; A,B,C,D. A user could start the flow (Step A) and after certain steps (Step C), he gets distracted and abandon the page. When that user returns to the flow, I would like the flow to resume execution starting where the user left (Step C). How would I achieve that?

A: For those curious on how I did this in the end. I mapped the FlowUrlHandler to my implementation and overrode the createFlowExecutionUrl(String flowId, String flowExecutionKey, HttpServletRequest request)method.
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
    <property name="flowExecutor" ref="flowExecutor" />
    <property name="flowUrlHandler">
       <bean class="path.to.my.implementation"/>
    </property>
  </bean>

A: This will happen automatically, assuming the user's session has not timed out.  SWF stores flow state in HTTP session by default.  You should be able to navigate away from your flow (by typing in a different URL), and then come back to it (either using the back button or by typing the URL in directly, as long as you include the correct flow execution key).


text:
Q: HTML/CSS Moving element somewhere else I have a feeling my question has a simple answer but I'm having a difficult time wording it without finding a relevant answer.  I wish to move a button, using CSS, below another button but cannot place that element below it in HTML.  Below is a simplified version of the code I'm working with to illustrate my problem:
<form class="form1">

   <button class="button1"></button>
</form>
<form class="form2">
   <button class="button2"></button>
</form>

"form1" must stay above "form2" but I wish to move "button1" below "button2".  Can this be done with CSS?  If it helps, I am using Bootstrap 4.
Edit: Thank you for the responses!  I should have been more clear and I have updated my code above which I hope helps.  There are some other input elements within "form1" that need to appear above "form2".  Of course, as-is, this is the case.  However, I wish to move not form1 below form2, but only button1 below button2.  All the other elements within form1 I wish to stay above form2.

A: You can use flexbox with the order property to change their display order visually without touching the HTML structure:

.wrapper {
  display: flex;
  flex-direction: column;
}

.form2 {
  order: -1;
}

  <form class="form1">
     <button class="button1">Button 1</button>
  </form>
  <form class="form2">
     <button class="button2">Button 2</button>
  </form>
  <form class="form3">
     <button class="button3">Button 3</button>
  </form>

A: You can make a solution using bootstrap 4, which you have already use.
I have used Bootstrap 4 Grid order classes for this solution.
<!DOCTYPE html>

        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet">

                    <form class="form1 ">
                        <button class="button1">Button 1</button>
                    </form>

                    <form class="form2 ">
                    <button class="button2">Button 2</button>
                    </form>

A: flexbox can change the visual order of any elements using the order property.
CSS
.wrap {
  display: flex;
  flex-direction: column;
}
.wrap div {
  padding: 1em;
}
#first {
  background: #64703b;
  order: 2
}
#last {
  background: #ee0000;
  order: 1
}

HTML

<form class="form1" ID="first">
   <button class="button1">button1</button>
</form>
<form class="form2" ID="last">
   <button class="button2">button2</button>
</form>

A: You can also achieve this by using the CSS position:

div {position: relative}
.form1 {position: absolute;margin-top: 22px;}
.form2 {position: absolute}

  <form class="form1">
   <button class="button1">button1</button>
</form>
<form class="form2">
   <button class="button2">button2</button>
</form>


text:
Q: Update HTML UI with JSON I have a custom HTML UI for my Shiny app. The UI relies on some JSON data. I wrote an R script to create the JSON file which seems to work perfectly. I made test.json to help lay out the rest of the UI. When a user clicks a button in the UI, I want to run the script to create a new JSON file, from which the data to be displayed in the app will be created. The script to create the JSON and the HTML/JavaScript/CSS for the UI all work perfectly fine when not in the Shiny app. I've verified the button is registering the click in the Shiny app, but it's not rerunning the script and updating the displayed UI as it should.
This is the app.R file I have:
ui = htmlTemplate(
  "www/index.html",
  styleInfo = includeCSS("www/style.css"),
  button = actionButton("btn", "Click me!"),
  scriptInfo = includeScript("www/index.js")
)

server = function(input, output, session){
  observeEvent(input$btn, {
    message("Clicked\n")
    function_to_change_json_here()
  })
}

Here's the index.html file used in the app's call to htmlTemplate(). It's in the www/ subdirectory of the folder containing app.R.
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Page Title</title>
    {{styleInfo}}

Some Content

 2019

bar

            {{button}}

Here's www/style.css:
.team{
    color: red;
}

.logo{
    height: 50px;
}

And lastly, www/index.js:
var jsonObj = {
            "r1": [
                {
                    "team_name": "Bulldogs",
                    "team_seed": 1,
                    "logo_link": "https://images-na.ssl-images-amazon.com/images/I/61eSjtcXNVL._SX355_.jpg"
                }
            ],
            "r2": [
                {
                    "team_name": "Wildcats",
                    "team_seed": 16,
                    "logo_link": "https://i0.wp.com/www.stickertalk.com/wp-content/uploads/2015/11/833__68393.1440207109.1280.1280.jpg?fit=1280%2C1000&ssl=1"
                }
      ]
        };

        document.getElementById("r1-seed-1-name").innerHTML = jsonObj.r1[0].team_name;
        document.getElementById("r1-seed-1-logo").src = jsonObj.r1[0].logo_link;
        document.getElementById("r1-seed-1-seed").innerHTML = jsonObj.r1[0].team_seed;

        document.getElementById("r1-seed-16-name").innerHTML = jsonObj.r2[0].team_name;
        document.getElementById("r1-seed-16-logo").src = jsonObj.r2[0].logo_link;
        document.getElementById("r1-seed-16-seed").innerHTML = jsonObj.r2[0].team_seed;

The HTML, CSS, and JavaScript components work perfectly. The function_to_change_json_here() I wrote in R also works perfectly fine on its own, but the changed JSON doesn't display in the UI after the button is clicked or even after using session$reload(). I'm sure the button registers the click as "Clicked" is still messaged in the R console. I've also had function_to_change_json_here() rewrite the entire www/index.js file that then gets called, but nothing in the UI changes.


text:
Q: python/ruby regex for domain in text I have text as result i need to find all domains on this text, domains with subdomain and without with https and without;
opt-i.mydomain.com 'www-oud.mydomain.com'
https\\u003a\\u002f\\u002fapi.noddos.com\\u002fabout\\u002fen-us\\u002fsignin\\u002f"
<script type="text/javascript">
       (function(){
  var baseUrl = 'https\x3A\x2F\x2Fhubspot.mydomain.com';
  var baseUrl = 'https\x3A\x2F\x2Fhub-spot.mydomain.com';
</script>
#=========================================================
define("modules/constants/env", [], function() {
    return {"BATCH_THUMB_ENDPOINTS": [], "LIVE_TRANSCODE_SERVER": "showbox-tr.dropbox.com", "STATIC_CONTENT_HOST": "cfl.dropboxstatic.com", "NOTES_WEBSERVER": "paper.dropbox.com", "REDIRECT_SAFE_ORIGINS": ["www.dropbox.com", "dropbox.com", "api.dropboxapi.com", "api.dropbox.com", "linux.dropbox.com", "photos.dropbox.com", "carousel.dropbox.com", "client-web.dropbox.com", "services.pp.dropbox.com", "www.dropbox.com", "docsend.com", "paper.dropbox.com", "notes.dropbox.com", "test.composer.dropbox.com", "showcase.dropbox.com", "collections.dropbox.com", "embedded.hellosign.com", "help.dropbox.com", "help-stg.dropbox.com", "experience.dropbox.com", "learn.dropbox.com", "learn-stage.dropbox.com", "app.hellosign.com", "replay.dropbox.com"], "PROF_SHARING_WEBSERVER": "showcase.dropbox.com", "FUNCAPTCHA_SERVER": "dropboxcaptcha.com", "__esModule": true};
});
#========================================================
https://mydomain.co/path/2
https://api.mydomain.co/path/2
https://api-v1.mydomain.co/path/2
https://superdomain.com:443
https://api.superdomain.com:443
https\\u003a\\u002f\\u002fapi.noddos.com\\u002fabout\\u002fen-us\\u002fsignin\\u002f"
https\\u003a\\u002f\\u002fnoddos.com\\u002fabout\\u002fen-us\\u002fsignin\\u002f"
root.I13N_config.location = "https:\u002F\u002Flocation.com\u002Faccount\u002Fchallenge\u002Frecaptcha
root.I13N_config.location = "https:\u002F\u002Fapi.location.com\u002Faccount\u002Fchallenge\u002Frecaptcha
&scope=openid%20profile%20https%3A%2F%2Fapi.domain2.com%2Fv2%2FOfficeHome.All&response_mode=form_post&nonce
&scope=openid%20profile%20https%3A%2F%2Fdomain2.com%2Fv2%2FOfficeHome.All&response_mode=form_post&nonce

https%3a%2f%2fwww.anotherdomain.com%2fv2%2
i try this regex but its not capture all i need.
re.compile(
        r'''((?<=x2[fF]|02[fF]|%2[fF])|(?<=//))(\w\.|\w[A-Za-z0-9-]{0,61}\w\.){1,3}[A-Za-z]{2,6}|(?<=["'])(\w\.|\w[A-Za-z0-9-]{0,61}\w\.){1,3}[A-Za-z]{2,6}(?=["'])''',
        re.VERBOSE)

captured result by regex:
{'showbox-tr.dropbox.com', 'api.dropbox.com', 'api-v1.mydomain.co', 'www-oud.mydomain.com', 'cfl.dropboxstatic.com', 'hub-spot.mydomain.com', 'paper.dropbox.com', 'superdomain.com', 'api.superdomain.com', 'linux.dropbox.com', 'embedded.hellosign.com', 'api.location.com', 'api.dropboxapi.com', 'www.dropbox.com', 'location.com', 'api.domain2.com', 'dropbox.com', 'api.noddos.com', 'dropboxcaptcha.com', 'learn-stage.dropbox.com', 'test.composer.dropbox.com', 'help-stg.dropbox.com', 'replay.dropbox.com', 'domain2.com', 'hubspot.mydomain.com', 'learn.dropbox.com', 'help.dropbox.com', 'collections.dropbox.com', 'app.hellosign.com', 'api.mydomain.co', 'noddos.com', 'docsend.com', 'mydomain.co', 'notes.dropbox.com', 'photos.dropbox.com', 'client-web.dropbox.com', 'services.pp.dropbox.com', 'OfficeHome.All', 'showcase.dropbox.com', 'carousel.dropbox.com', 'experience.dropbox.com'}

expected results so in general its not capture "opt-i.mydomain.com":
{'opt-i.mydomain.com', 'hubspot.mydomain.com', 'embedded.hellosign.com', 'carousel.dropbox.com', 'api.dropboxapi.com', 'experience.dropbox.com', 'linux.dropbox.com', 'api.superdomain.com', 'noddos.com', 'showcase.dropbox.com', 'app.hellosign.com', 'www-oud.mydomain.com', 'showbox-tr.dropbox.com', 'help-stg.dropbox.com', 'api.domain2.com', 'notes.dropbox.com', 'paper.dropbox.com', 'services.pp.dropbox.com', 'collections.dropbox.com', 'learn.dropbox.com', 'location.com', 'api.location.com', 'docsend.com', 'api.dropbox.com', 'replay.dropbox.com', 'mydomain.co', 'hub-spot.mydomain.com', 'www.dropbox.com', 'learn-stage.dropbox.com', 'domain2.com', 'help.dropbox.com', 'api.mydomain.co', 'api-v1.mydomain.co', 'superdomain.com', 'dropboxcaptcha.com', 'api.noddos.com', 'dropbox.com', 'test.composer.dropbox.com', 'cfl.dropboxstatic.com', 'client-web.dropbox.com', 'opt-i.mydomain.com', 'photos.dropbox.com'}

i also test this regex it match all domains better than previus but problem is with doamin`s that has unicode example:
"https\\u003a\\u002f\\u002fapi.noddos.com" will capture "u002fapi.noddos.com" but we need "api.noddos.com"

re.compile(
        r'''
        ([a-z0-9][a-z0-9\-]{0,61}[a-z0-9]\.)+[a-z0-9][a-z0-9\-]*[a-z0-9]
        ''', re.VERBOSE)

A: import re
regex = r"(?:[a-z0-9][a-z0-9\-]{0,61}[a-z0-9]\.)+[a-z0-9][a-z0-9\-]*[a-z0-9]"
data = """opt-i.mydomain.com 'www-oud.mydomain.com'
https\\u003a\\u002f\\u002fapi.noddos.com\\u002fabout\\u002fen-us\\u002fsignin\\u002f"
<script type="text/javascript">
       (function(){
  var baseUrl = 'https\x3A\x2F\x2Fhubspot.mydomain.com';
  var baseUrl = 'https\x3A\x2F\x2Fhub-spot.mydomain.com';
</script>
#=========================================================
define("modules/constants/env", [], function() {
    return {"BATCH_THUMB_ENDPOINTS": [], "LIVE_TRANSCODE_SERVER": "showbox-tr.dropbox.com", "STATIC_CONTENT_HOST": "cfl.dropboxstatic.com", "NOTES_WEBSERVER": "paper.dropbox.com", "REDIRECT_SAFE_ORIGINS": ["www.dropbox.com", "dropbox.com", "api.dropboxapi.com", "api.dropbox.com", "linux.dropbox.com", "photos.dropbox.com", "carousel.dropbox.com", "client-web.dropbox.com", "services.pp.dropbox.com", "www.dropbox.com", "docsend.com", "paper.dropbox.com", "notes.dropbox.com", "test.composer.dropbox.com", "showcase.dropbox.com", "collections.dropbox.com", "embedded.hellosign.com", "help.dropbox.com", "help-stg.dropbox.com", "experience.dropbox.com", "learn.dropbox.com", "learn-stage.dropbox.com", "app.hellosign.com", "replay.dropbox.com"], "PROF_SHARING_WEBSERVER": "showcase.dropbox.com", "FUNCAPTCHA_SERVER": "dropboxcaptcha.com", "__esModule": true};
});
#========================================================
https://mydomain.co/path/2
https://api.mydomain.co/path/2
https://api-v1.mydomain.co/path/2
https://superdomain.com:443
https://api.superdomain.com:443
https\\u003a\\u002f\\u002fapi.noddos.com\\u002fabout\\u002fen-us\\u002fsignin\\u002f"
https\\u003a\\u002f\\u002fnoddos.com\\u002fabout\\u002fen-us\\u002fsignin\\u002f"
root.I13N_config.location = "https:\u002F\u002Flocation.com\u002Faccount\u002Fchallenge\u002Frecaptcha
root.I13N_config.location = "https:\u002F\u002Fapi.location.com\u002Faccount\u002Fchallenge\u002Frecaptcha
&scope=openid%20profile%20https%3A%2F%2Fapi.domain2.com%2Fv2%2FOfficeHome.All&response_mode=form_post&nonce
&scope=openid%20profile%20https%3A%2F%2Fdomain2.com%2Fv2%2FOfficeHome.All&response_mode=form_post&nonce"""

data = re.sub(r"u[0-9a-z]{4}", "", data)

matches = re.findall(regex, data)

#output matches:
['opt-i.mydomain.com', 'www-oud.mydomain.com', 'api.noddos.com', 'ht.mydomain.com', 'hub-spot.mydomain.com', 'showbox-tr.dropbox.com', 'cfl.dropboxstatic.com', 'paper.dropbox.com', 'www.dropbox.com', 'dropbox.com', 'api.dropboxapi.com', 'api.dropbox.com', 'linux.dropbox.com', 'photos.dropbox.com', 'carousel.dropbox.com', 'client-web.dropbox.com', 'services.pp.dropbox.com', 'www.dropbox.com', 'docsend.com', 'paper.dropbox.com', 'notes.dropbox.com', 'test.composer.dropbox.com', 'showcase.dropbox.com', 'collections.dropbox.com', 'embedded.hellosign.com', 'help.dropbox.com', 'help-stg.dropbox.com', 'experience.dropbox.com', 'learn.dropbox.com', 'learn-stage.dropbox.com', 'app.hellosign.com', 'replay.dropbox.com', 'showcase.dropbox.com', 'dropboxcaptcha.com', 'mydomain.co', 'api.mydomain.co', 'api-v1.mydomain.co', 'somain.com', 'api.somain.com', 'api.noddos.com', 'noddos.com', 'config.location', 'location.com', 'config.location', 'api.location.com', 'api.domain2.com', 'domain2.com']


text:
Q: Showing last cookie value on Relogin (i.e. Again login after logout) in Asp.net MVC with Razor I am working on Asp.net MVC with Razor view engine with C#. I have a login form and on login I create a Cookie for userid, and on logout I remove this cookie evrything works fine yet. but the problem starts when I Login again it still shows the value of Previous Login's userid.
The code of creating cookie is
HttpCookie newCookie = new HttpCookie(cookieId, cookieValue);
newCookie.Expires = DateTime.Today.AddDays(30);
HttpContext.Current.Response.Cookies.Add(newCookie);

And to remove cookie
if (HttpContext.Current.Request.Cookies[cookieId] != null)
{
    HttpContext.Current.Response.Cookies[cookieId].Value = null;
}

I have remove the cookie on login if there exist but still it is not working , please help me......

A: You can remove your cookie like below,
if ( Request.Cookies["MyCookie"] != null )
{
    var c = new HttpCookie( "MyCookie" );
    c.Expires = DateTime.Now.AddDays( -1 );
    Response.Cookies.Add( c );
}


text:
Q: If we have that $X < \infty$, why doesn't it imply $X$ is bounded? Suppose that $X$ is some sequence or random variable, etc. I am trying to understand why if $X < \infty$, then that doesn't necessarily mean it has a bound, i.e., there doesn't exist some value $M$ whereby $X \leq M$ for all possible realizations of $X$. Does anyone have an intuition why? Thanks

A: Assuming it is not a special ad-hoc notaion, but that it means "$X(\omega)<\infty$ for all $\omega$":
For instance $X:\Bbb R\to\Bbb R$, $X(\omega)=\omega$.

A: Say $X$ successively takes the values $1,2,3, ...$. Then $X$ is unbounded, even though each value it takes is finite.


text:
Q: The best word to describe "not easy to fall" Based on my research, I have several options (all of them come with problem).

*

*Stable (I don't want to have 'resist to change' meaning)

*Firm (I don't want to have 'resist to change' & 'standing still' meaning)

*Steady (I don't want to have 'standing still' meaning)

I want to describe something that moves, but not easy to fall/stop by outside stimulus.

A: Perhaps a two-word phrase that aptly modifies "stability" and captures the concept succinctly i.e., DYNAMIC STABILITY

Q: What is the definition of dynamic stability in human movement? We say a state is stable, what then is dynamic stability?
A: Equilibrium means moving without acceleration. Balance is the control of equilibrium. Stability is the resistance to perturbation.
dynamic stability
Link to article: Assessing the stability of human locomotion: a review of current measures

A: Infallible is metaphorical, but it may suit the purpose.

A: Stable is indeed an appropriate word for something that won't fall over.  However, if you want to convey a stronger sense of motion, you could say

*

*self-stabilizing

*self-balancing

*self-righting

For example, self-stabilizing unicycles, self-balancing scooters, and self-righting cups exist.

A: Steady is just fine, as it doesn't necessarily imply standing still. Something can move steadily.

A: The best I can think of is resilient
From Merriam-Webster:

a :  capable of withstanding shock without permanent deformation or
  rupture
b :  tending to recover from or adjust easily to misfortune or change

It is a word with very positive connotations, being used to describe a return to good health:
"The local economy is remarkably resilient."


text:
Q: CSC : error CS2001: Source file '.NETPortable,Version=v4.5,Profile=Profile78.AssemblyAttributes.cs' could not be found When start build on my Bamboo server ,I am getting following error:

Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn
  CSC : error CS2001: Source file 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp.NETPortable,Version=v4.5,Profile=Profile78.AssemblyAttributes.cs' could not be found. [E:\bamboo-agent-home\xml-data\build-dir\Domain\Domain.csproj]
  Done Building Project "E:\bamboo-agent-home\xml-data\build-dir\Business\Business.csproj" (default targets) -- FAILED.

Unable to understand this error. On Local this works perfect even on command line - MSBuildcommand.

A: It looks like your build service is running as a system account (e.g. local system, network service, etc.) which leads to undesired behaviour in msbuild.
You should create a dedicated service user and configure the service to run as this user or ensure that the service user has sufficient rights to modify the system profile directory (which I don't recommend).
You can follow Atlassian's guide on how to run the windows service as a local user.