text:
Q: jQuery allow me to Table filter Hi I am wondering how I use this plugin with my table, as I have my table layout differently to how they have theres.
I use the following table layout

            list

A

B

A

While they use

Name
   Score
   Date

Chris	1	1/2/2011

Micah	2	1/4/2011

Derek	3	1/6/2011

Derek	5	1/14/2011

Chris	2	1/10/2011

John	3	2/2/2011

The plugin is http://dotbotdesign.com/tutorials/tableFilter/
basically I need to be able to filter the my table. the way there plugin allows.
Just to add to the mystery it seems that there has to be a jquery error somewhere, but I cant see it, as when i do this all as html code it works fine.
    function listallleads(){

    var script = document.createElement('link');
    script.href = 'theme/style/manageleads.css';
    script.rel  = 'stylesheet';
    script.type = 'text/css';
    document.getElementsByTagName('head')[0].appendChild(script);

    if ($.browser.msie && $.browser.version == 8) {
        var script = document.createElement('link');
        script.href = 'theme/style/ie-manageleads.css';
        script.rel  = 'stylesheet';
        script.type = 'text/css';
        document.getElementsByTagName('head')[0].appendChild(script);
    }

    $.getJSON('system/classes/core.php?task=listmyleads&userid='+userid+'&usertype='+usertype+'&callback=?', function(dataleads) {

      $.each(dataleads,function(i, myleads){
        var businessname = "";
        if(myleads.Company == null || myleads.Company == "null" || myleads.Company == "")
        {
        businessname = myleads.TradingName;
        }
        else
        {
        businessname = myleads.Company;
        }

        if(usertype == 3)
        {
            if(myleads.AMStatus == 1)
            {
            leadstatus = "Confirmed";
            }
            else
            {
            leadstatus = "Not Confirmed";
            }

        }
        else
        {
            leadstatus = leadstatusselect(myleads.LeadStatus);
        }

        if(myleads.AMStatus == 1)
        {
            myleads.AMStatus = "one";
        }

        if(myleads.iNcardRecharged == 0)
        {
            myleads.iNcardRecharged = "No";
        }
        else if(myleads.iNcardRecharged == 1)
        {
            myleads.iNcardRecharged = "Yes";
        }

        var s = myleads.Phone;
        s = s.replace('(', '');
        s = s.replace(')', '');
        s = s.replace(/ /g, '');
        myleads.Phone = s;
        //alert(s);

        cssstats = "lead"+myleads.AMStatus;

            $("tbody").append('
'+
'           <input id="'+myleads.customer_id+'" type="checkbox">	'+
'           '+myleads.CreatedTime+'	'+
'           '+businessname+'	'+
'           '+myleads.FirstName+' '+myleads.LastName+'	'+
'           '+myleads.Phone+'	'+
'           '+myleads.Email+'	'+
'           '+myleads.stafffirstname+' '+myleads.stafflastname+'	'+
'           '+leadstatus+'	'+
'           '+myleads.iNcardRecharged+'	'+
'
');

      });
        qs.cache();
        $("table").tableFilter("table");
    });

    if(usertype == 3)
    {
    leadtype = "A/M Status";
    }
    else
    {
    leadtype = "Lead Status";
    }

    $("#todo_bg").hide();
    $("#menuarea").html('
Back

Manage Business Lead
'+
                        '
<button id="editlisting" class="blackbutton manage">Edit Listing</button><button id="sendemailout" class="blackbutton manage">Send Message</button> <button id="deletelead" class="blackbutton manage">Delete Lead</button>'+
                        '
<form action="#"><fieldset><input type="text" name="search" value="" id="searchleads" placeholder="Search" autofocus /></fieldset></form>
'+
                        '
'+
                        '

'+
'
'+
'
'+
'           <input type="checkbox" class="checkbox checkall" value="Yes">	'+
'           Created Time	'+
'           Company	'+
'           Lead Name	'+
'           Phone No.	'+
'           Email	'+
'           Lead Owner	'+
'           '+leadtype+'	'+
'
'+
'
'+
'

'+
'

');

    $('thead tr').append('Card Charged	');

    /*setTimeout(function(){
    var script = document.createElement('script');
    script.src = 'js/table.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);
    stripedTable();
    },2000);
    */
    var script = document.createElement('script');
    script.src = 'js/cornz.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);
    stripedTable();

    var qs = $('input#searchleads').quicksearch('table#manageleads tbody tr');

}

A: You can try with this jQuery plugin is called js-tables. That's support not only filter but also sorting.


text:
Q: Is there any way to make it -> snapshot.data[index].variable in flutter? In flutter if i wanted to print the values using FutureBuilder
I have to write this 3 line individually
snapshot.data[index].courseName ,
snapshot.data[index].coursePrice,
snapshot.data[index].aboutCourse
So, Is there any way to make a list like this -> fieldItem = ['courseName' , 'coursePrice' , 'aboutCourse'] and then pass fieldItems after the .data[index].{our varibles}
**snapshot.data[index].fieldItems**
varibles will be passed through the fieldItem.

Sorry for my bad english

A: body: FutureBuilder(
        future: _loadData(),
        builder: (BuildContext ctx, AsyncSnapshot<List> snapshot) {
          if(snapshot.hasData) {
            // You can make variable here
            // final _data = snapshot.data;
            return ListView.builder(
                    itemCount: snapshot.data!.length,
                    itemBuilder: (BuildContext context, index) {
                      // Or as in your case
                      final _data = snapshot.data![index];
                      return Card(
                        margin: const EdgeInsets.all(10),
                        // render list item
                        child: ListTile(
                          contentPadding: const EdgeInsets.all(10),
                          title: Text(_data['title']),
                          subtitle: Text(snapshot.data![index]['body']),
                      ),
                    ),
                    }
                  );
          } else {
            return const Center(child: CircularProgressIndicator());
          }
        }
      );

Refer 11th line, if it helps, upvote.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why can I not find google chrome with python webrowser? import webbrowser

Chrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'

webbrowser.get(Chrome).open("haveibeenpwned.com")

Whenever I try I get this "could not locate runnable browser"
P.S: I'm tryna learn python

A: You should register it first.
webbrowser.register('chrome', None,webbrowser.BackgroundBrowser(Chrome), 1)
webbrowser.get('chrome').open_new_tab("haveibeenpwned.com")

A: You should use UNIX-style path: common slashes instead of backslashes.
import webbrowser

chrome = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe'

webbrowser.get(chrome).open("haveibeenpwned.com")

A: Seems like the problem is the spaces in your path. You need to insert a final %s at the end of your path to make it work. No need to register the browser name first.
webbrowser.get(
    "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
).open("haveibeenpwned.com")

As seen here:
Python: generic webbrowser.get().open() for chrome.exe does not work


text:
Q: why is heroku build failing with terser I am totally new to heroku and set up my heroku account from steps in  a video from Brad Tersey's Udemy class.  I also had built the heroku deployment after the class... the heroku build process worked for a while... but now it seems to be broken and I am having a hard time figuring out why.
I should also note this works fine on my home computer... I can npm install and then npm run dev and everything loads and runs.
First, I ran this command:
heroku git:remote -a guarded-brook-39446

Then I ran this command:
git push heroku master

Here is the build log:
    D:\Code\Udemy\MERN\MERN>git push heroku master
    Enumerating objects: 809, done.
    Counting objects: 100% (809/809), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (685/685), done.
    Writing objects: 100% (765/765), 165.50 KiB | 1.38 MiB/s, done.
    Total 765 (delta 566), reused 102 (delta 79)
    remote: Compressing source files... done.
    remote: Building source:
    remote:
    remote: -----> Node.js app detected
    remote:
    remote: -----> Creating runtime environment
    remote:
    remote:        NPM_CONFIG_LOGLEVEL=error
    remote:        NODE_ENV=production
    remote:        NODE_MODULES_CACHE=false
    remote:        NODE_VERBOSE=false
    remote:
    remote: -----> Installing binaries
    remote:        engines.node (package.json):  8.11.4
    remote:        engines.npm (package.json):   5.6.0
    remote:
    remote:        Resolving node version 8.11.4...
    remote:        Downloading and installing node 8.11.4...
    remote:        npm 5.6.0 already installed with node
    remote:
    remote: -----> Restoring cache
    remote:        Caching has been disabled because NODE_MODULES_CACHE=false
    remote:
    remote: -----> Building dependencies
    remote:        Installing node modules (package.json + package-lock)
    remote:
    remote:        > nodemon@1.18.9 postinstall /tmp/build_f19e608b09c6e8b101acf02b50e8189b/node_modules/nodemon
    remote:        > node bin/postinstall || exit 0
    remote:
    remote:        Love nodemon? You can now support the project via the open collective:
    remote:         > https://opencollective.com/nodemon/donate
    remote:
    remote:        added 372 packages in 10.391s
    remote:        Running heroku-postbuild
    remote:
    remote:        > mern@1.0.0 heroku-postbuild /tmp/build_f19e608b09c6e8b101acf02b50e8189b
    remote:        > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
    remote:
    remote:        added 1941 packages in 41.504s
    remote:
    remote:        > client@0.1.0 build /tmp/build_f19e608b09c6e8b101acf02b50e8189b/client
    remote:        > react-scripts build
    remote:
    remote:        Creating an optimized production build...
    remote:        Failed to compile.
    remote:
    remote:        Failed to minify the bundle. Error: static/js/main.9856cdb3.chunk.js from Terser
    remote:        TypeError: Cannot read property 'minify' of undefined
    remote:            at compiler.run (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/react-scripts/scripts/build.js:169:23)
    remote:            at finalCallback (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compiler.js:210:39)
    remote:            at hooks.done.callAsync.err (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compiler.js:226:13)
    remote:            at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    remote:            at AsyncSeriesHook.lazyCompileHook (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/Hook.js:154:20)
    remote:            at onCompiled (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compiler.js:224:21)
    remote:            at hooks.afterCompile.callAsync.err (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compiler.js:553:14)
    remote:            at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    remote:            at AsyncSeriesHook.lazyCompileHook (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/Hook.js:154:20)
    remote:            at compilation.seal.err (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compiler.js:550:30)
    remote:            at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    remote:            at AsyncSeriesHook.lazyCompileHook (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/Hook.js:154:20)
    remote:            at hooks.optimizeAssets.callAsync.err (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compilation.js:1295:35)
    remote:            at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    remote:            at AsyncSeriesHook.lazyCompileHook (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/tapable/lib/Hook.js:154:20)
    remote:            at hooks.optimizeChunkAssets.callAsync.err (/tmp/build_f19e608b09c6e8b101acf02b50e8189b/client/node_modules/webpack/lib/Compilation.js:1286:32)
    remote:        Read more here: http: // bit.ly / CRA-build-minify
    remote:
    remote: npm ERR! code ELIFECYCLE
    remote: npm ERR! errno 1
    remote: npm ERR! client@0.1.0 build: `react-scripts build`
    remote: npm ERR! Exit status 1
    remote: npm ERR!
    remote: npm ERR! Failed at the client@0.1.0 build script.
    remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    remote:
    remote: npm ERR! A complete log of this run can be found in:
    remote: npm ERR!     /tmp/npmcache.dkOHV/_logs/2019-02-10T01_09_07_572Z-debug.log
    remote: npm ERR! code ELIFECYCLE
    remote: npm ERR! errno 1
    remote: npm ERR! mern@1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm
    run build --prefix client`
    remote: npm ERR! Exit status 1
    remote: npm ERR!
    remote: npm ERR! Failed at the mern@1.0.0 heroku-postbuild script.
    remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    remote:
    remote: npm ERR! A complete log of this run can be found in:
    remote: npm ERR!     /tmp/npmcache.dkOHV/_logs/2019-02-10T01_09_07_587Z-debug.log
    remote:
    remote: -----> Build failed
    remote:
    remote:        We're sorry this build is failing! You can troubleshoot common issues here:
    remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
    remote:
    remote:        If you're stuck, please submit a ticket so we can help:
    remote:        https://help.heroku.com/
    remote:
    remote:        Love,
    remote:        Heroku
    remote:
    remote:  !     Push rejected, failed to compile Node.js app.
    remote:
    remote:  !     Push failed
    remote: Verifying deploy...
    remote:
    remote: !       Push rejected to guarded-brook-39446.
    remote:
    To https://git.heroku.com/guarded-brook-39446.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/guarded-brook-39446.git'

My project consists of a server and a client.
Here is the server package.json file:
{
  "name": "mern",
  "version": "1.0.0",
  "description": "social network for developers",
  "main": "server.js",
  "engines": {
    "node": "8.11.4",
    "npm": "5.6.0"
  },
  "scripts": {
    "client-install": "npm install --prefix client",
    "start": "node server.js",
    "server": "nodemon server.js",
    "client": "npm start --prefix client",
    "dev": "concurrently \"npm run server\" \"npm run client\"",
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
  },
  "author": "Me",
  "license": "MIT",
  "dependencies": {
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.18.2",
    "concurrently": "^4.1.0",
    "dotenv": "^6.2.0",
    "express": "^4.16.3",
    "gravatar-url": "^2.0.0",
    "jsonwebtoken": "^8.2.0",
    "mongoose": "^5.0.12",
    "nodemailer": "^4.7.0",
    "passport": "^0.4.0",
    "passport-jwt": "^4.0.0",
    "randomstring": "^1.1.5",
    "validator": "^9.4.1"
  },
  "devDependencies": {
    "nodemon": "^1.18.6"
  }
}

Here is my client package.json file:
    {
      "name": "client",
      "version": "0.1.0",
      "private": true,
      "engines": {
        "node": "8.11.4",
        "npm": "5.6.0"
      },
      "dependencies": {
        "axios": "^0.18.0",
        "classnames": "^2.2.5",
        "jsonwebtoken": "^8.4.0",
        "moment": "^2.22.0",
        "react": "^16.3.1",
        "react-dom": "^16.3.1",
        "react-image-mapper": "0.0.9",
        "react-moment": "^0.8.4",
        "react-redux": "^5.0.7",
        "react-router-dom": "^4.2.2",
        "react-scripts": "^2.1.1",
        "reactstrap": "^7.1.0",
        "redux": "^3.7.2",
        "redux-thunk": "^2.2.0"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
      },
      "proxy": "http://localhost:5000",
      "eslintConfig": {
        "extends": "react-app"
      },
      "browserslist": [
        ">0.2%",
        "not dead",
        "not ie <= 11",
        "not op_mini all"
      ]
    }

A: so I did some scouring of the internet and found this post:
https://github.com/facebook/create-react-app/issues/6334 where erwanriou made the following comment:
ok i fix how to do it. We have to change the script just for this case:
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm install terser@3.14.1 --prefix client && npm run build --prefix client"

so I changed my heroku-postbuild to what he suggested and it built !
thanks erwanriou


text:
Q: macro for copy and paste into next empty row for columns B-S I have a running monthly report for accounting for our sales.
Each day, I get our sales for each branch in one report.  I have a Vlookup formula saved in cell E1 with a formula that will pull over the information from the report to another sheet depending on what I am working on. I can copy E1 and paste into each cell in a row with range of columns B-S and then i copy that row again and paste values so that it doesn't change my amounts. The next day, i repeat process on the next row so that it gives me a running monthly total per branch and then for the company as a whole.  My monthly chart always is around 23 rows.(rows 6-28 in excel)
I need a macro that will do the following:
on the 1st, i run the macro and it will copy my cell E1 and paste it into B6 - S6 row, then copy that row and paste values that row.
Then on the 2nd of the month, i run the macro and it repeats but on row B7-S7.
Then on the 3rd of the month, i run the macro and it repeats but on row B8-S8.
Is this possible?
This is what i have with just recording a macro.
Sub Charges()
'
'Charges Macro
'Run Formula for charges
'
' Keyboard Shortcut: Ctrl+Shift+C
'
    Range("E1").Select
    Selection.Copy
    Range("B8:S8").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
 End Sub

A: Perhaps this? You can transfer the values directly, obviating the need to copy and paste.
Read this on how to make code more efficient by avoiding Select/Activate.
Sub Charges()

Dim n As Long

n = WorksheetFunction.Max(6, Range("B" & Rows.Count).End(xlUp).Row + 1)

Range("B" & n & ":S" & n).Value = Range("E1").Value

End Sub

If you want to copy the formula and then overwrite with the value you can use this
Sub Charges()

Dim n As Long

n = WorksheetFunction.Max(6, Range("B" & Rows.Count).End(xlUp).Row + 1)

Range("E1").Copy Range("B" & n & ":S" & n)

Range("B" & n & ":S" & n).Value = Range("B" & n & ":S" & n).Value

End Sub


text:
Q: Combining conditional probabilities using an unconditional copula First: just a bit of background on copulas.
Suppose we have a pair of continuous random variables $Y_1, Y_2$ with distribution functions $F_1(y_1)=P(Y_1\leq y_1)$ and $F_2(y_2)=P(Y_2\leq y_2)$.
Let their joint distribution function $F(y_1, y_2) = P(Y_1\leq y_1, Y_2\leq y_2)$ be described by the copula $C$ with $F(y_1, y_2) = C(F_1(y_1), F_2(y_2))$.
The joint density is then given by
$$
\begin{align}
f(y_1, y_2)
&=\frac{\partial^2}{\partial y_1 \partial y_2}F(y_1, y_2)
\\
&=\underbrace{\left[\frac{\partial^2}{\partial u_1 \partial u_2}C(u_1, u_2)\right]_{u_1=F_1(y_1),\\ u_2=F_2(y_2)}}_{\equiv c(F_1(y_1), F_2(y_2))}\cdot f_1(y_1) f_2(y_2)\,,
\end{align}
$$
where $f_1,f_2$ are the marginal densities and $c$ is the copula density.
Now to the meat of the question. Let's introduce a third random variable $X$. Suppose we observe some $iid$ realizations of the vector $(X, Y_1)$ and of the vector $(X, Y_2)$ but crucially never the vector of all three, $(X, Y_1, Y_2)$.
Using these data, say we estimate some conditional densities, say $\hat f_1(y_1|x)$ and $\hat f_2(y_2|x)$. However, we have no direct information about the joint copula.
Suppose we want to estimate the joint conditional density $f(y_1, y_2|x)$. I would conjecture that the "best" we can do is something of the form
$$
\hat f(y_1, y_2|x) \propto c(F_1(y_1), F_2(y_2)) \hat f_1(y_1|x) \hat f_2(y_2|x)\,.
$$
This is of course an unnormalized density and does not in general have $\hat f_1(y_1|x)$ and $\hat f_2(y_2|x)$ as marginals. But it does feel like a "sensible" way of combining two conditional estimates given an unconditional copula.
Is there a more rigorous notion of "good" that this maximizes? Are there any estimators of this form in the existing literature?
Thanks in advance!


text:
Q: Future - Thread failed to stop I am using following code(outline):
ExecutorService executor = Executors.newFixedThreadPool(20);
List<Future<statusModel>> futures = new ArrayList<Future<statusModel>>();

for (Map.Entry<String, String> url : urls.entrySet())
    {
        Future<statusModel> future = executor.submit(mycallable);
        futures.add(future);
    }
for (Map.Entry<String, String> url : urls.entrySet())
    {
        try
            {
                status = (statusModel) futures.get(i).get(50, TimeUnit.MILLISECONDS);
                // do stuff with status
            }
        catch (InterruptedException | ExecutionException | TimeoutException e)
            {
                System.out.println("Error<checkServers>: Timeout OR "+e.getMessage());
            }
    }

executor.shutdownNow();
System.out.println("Shutdown: "+executor.isShutdown());

My console says: Shutdown: true
myCallable:
public statusModel call() throws Exception
{
    InputStream in = null;
    BufferedReader br = null;
    statusModel status = new statusModel();

    try
    {
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();

        status.setStatusCode(conn.getResponseCode());
        status.setUrl(urlStr);

        if(status.getStatusCode()/100 == 2) // Status = OK
        { // Read JSON response  }
            }
    catch (MalformedURLException e)
    {
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    finally
    {
        if(in != null)
            in.close();
        if(br != null)
            br.close();
    }

    return status;
}

Still sometimes when I run this block over and over again, I get this error:

Aug 20, 2013 9:35:44 AM org.apache.catalina.core.StandardWrapper unload
  INFO: Waiting for 1 instance(s) to be deallocated
  Aug 20, 2013 9:35:45 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/Server_Status] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
  Aug 20, 2013 9:35:45 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/Server_Status] appears to have started a thread named [pool-3-thread-6] but has failed to stop it. This is very likely to create a memory leak.

I have shutdown the 'executor' also checked the same. Still I am getting this error. Am I doing something wrong here?
Update:
I am using Future for the first time. If I need to post more to explain better please let me know.
Update:
I tried printing all future.isDone(). For some reason the futures that goes beyond the timeout are still returning isDone() = false - not getting cancelled by timout :(
Any help is appreciated. Thanks in Advance.

A: shutdownNow() kills all jobs that are still running which is probably the cause of the error message.  You probably want shutdown() which will not let any new jobs get submitted but let the ones that have been queued up to still execute.
Furthermore, you need to wait for the futures to complete by calling future.get()(which may block if the future isn't finished yet) to get the results.
for(Future<statusModel> future : futures){
  statusModel model = future.get();
  //do stuff with statusModel
}

EDIT: now that additional code has been posted, I have appended this to my answer:
I've rechecked the javadoc for future.get(long timeout, TimeUnit unit)and it does not say that if the timeout occurs then the future gets cancelled.  I've also checked by copy of Brian Goetz's Java Concurrency in Practice (which is a great book by the way; a must read) and on page 147 it recommends this:
try{
   future.get(timeout, unit);
}catch(TimeoutException e){
    //task will be cancelled below
}catch(ExecutionException e){
    //exception thrown in task; rethrow
    //... throw new MyWrappedException(e.getCause());
}finally{
    //Harmless if task already completed
    future.cancel(true); //interrupt if still running
}


text:
Q: ClickOnce Manifest Application in TFS build Does anyone know how to use code signing certificate for ClickOnce manifest applications in TFS Hosted Controller Build?
Scenario:
I am using Team Foundation Service as a code repository and source control. I have created a build definition using team explorer (Visual Studio 2012).
Build "Process" using Default Template configured to Any CPU|Release
The build is set to "Manual trigger" uses Hosted Build Controller.
TFS build is unsuccessful if my project use Code Signing and Code manifests.
In my solution, two projects having "ClickOnce manifests"
Local build dont have any issues with Code signing and ClickOnce manifests - because Code signing certificate available locally for the build.
But for the same build in TFS, i get the error "Unable to find manifest signing certificate in the certificate store."
(just one error blocking the build)
Question
How can I install the code signing certificate into "TFS Build Service Account" or "Build service user account"?
How can I make the code signing certificate to avail in the virtual build machine's certificate store?
Any alternative to get clean TFS build with Code signing and ClickOnce Manifests?
Have not find the solution yet :( anyone helpful here??

A: Well I have managed to Sign my ClickOnce manifest in TFS auto build. My certificate was password protected and build server was not able to access the certificate because of that reason. The certificate was not in my personal certificate store hence I had the trouble.
I have imported the certificate into my local machine's personal store and from there i have referenced it for signing the clickonce manifest. When you reference the certificate from the personal store, it will not ask for the password. Hence you can cheat the TFS build and that can now access your code signing certificate..

A: I have a possible alternative to get a clean build for you.
My company produces a product called ClickOnceMore (www.clickoncemore.net) which can be used to build your ClickOnce manifests rather than MSBuild. It's designed to be easily integrated into a continuous integration build using a command line interface.
To integrate into your build:
* Turn off clickonce in your visual studio solution
* Create a ClickOnceMore project
* To sign the manifests you just need to put the signing certificate in a known folder location and then reference it from the ClickOnceMore project
* Add a new build step in TFS to build the ClickOnceMore project
Hope that helps.


text:
Q: Stack build hangs on GHC-8.6.4/Cabal-2.4.1.0 on Windows My stack project build hangs on windows at the step related to Cabal.
See output below
C:\haskell\hrt\Comonad>stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.4

C:\haskell\hrt\Comonad>stack build
←[0mCabal-2.4.1.0: configure←[0m
←[0mCabal-2.4.1.0: build←[0m
Progress 0/5

I have to interrupt with Ctrl+C
I've tried to follow the Haskell Weekly Comonadic builders by Dmitrii Kovanikov and I've started by creating a new project
stack new Comonad
cd Comonad

then I've pasted the code sample into the Main
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards   #-}

module Main where

import Control.Comonad (Comonad (..), (=>>))
import Data.Semigroup (Any (..))
import Data.Text (Text)
import Text.Pretty.Simple (pPrint)

import Lib
-- see the gist above for the rest of the code
alwaysTravisB :: ProjectBuilder -> Project
alwaysTravisB builder = builder $ mempty { settingsTravis = Any True }

travisB :: ProjectBuilder -> Project
travisB builder =
  let project = extract builder
  in project { projectTravis = projectGitHub project }

main :: IO ()
main = do
    -- plain
    pPrint $ extract $ buildProject "minimal-project"
    pPrint $ extract $ buildProject "only-library" =>> hasLibraryB
    pPrint $ extract $ buildProject "library-github" =>> hasLibraryB =>> gitHubB

    -- dependent: 1 level
    pPrint $ extract $ buildProject "travis" =>> travisB
    pPrint $ extract $ buildProject "always-travis" =>> alwaysTravisB
    pPrint $ extract $ buildProject "github-travis" =>> gitHubB =>> travisB
    pPrint $ extract $ buildProject "travis-github" =>> travisB =>> gitHubB
    someFunc

and I've specified the dependencies in the package.yaml
dependencies:
- base >= 4.12.0.0
- comonad >= 5.0
- pretty-simple >= 2.2
- text

library:
  source-dirs: src

executables:
  Comonad-exe:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    dependencies:
    - Comonad

I can see that ghc.exe is working on a temp folder (C:\Users\MyHome\AppData\Local\Temp\stacknnnn) and keep the cpu busy, I'm aso wondering if it's a memory leak (1.7GB of working set)...

stack build --verbose
-- ... ...
←[90m2019-04-07 11:35:28.096702: ←[32m[debug] ←[0mEncoding C:\Users\MyHome\AppData\Local\Temp\stack6060\Cabal-2.4.1.0\.s
tack-work\dist\e626a42b\stack-config-cache←[90m
@(src/Stack\Build\Cache.hs:164:7)←[0m
←[90m2019-04-07 11:35:28.098702: ←[32m[debug] ←[0mFinished writing C:\Users\MyHome\AppData\Local\Temp\stack6060\Cabal-2.
4.1.0\.stack-work\dist\e626a42b\stack-config-cache←[90m
@(src/Stack\Build\Cache.hs:164:7)←[0m
←[90m2019-04-07 11:35:28.099702: ←[32m[debug] ←[0mEncoding C:\Users\MyHome\AppData\Local\Temp\stack6060\Cabal-2.4.1.0\.s
tack-work\dist\e626a42b\stack-cabal-mod←[90m
@(src/Stack\Build\Cache.hs:173:7)←[0m
←[90m2019-04-07 11:35:28.320715: ←[32m[debug] ←[0mFinished writing C:\Users\MyHome\AppData\Local\Temp\stack6060\Cabal-2.
4.1.0\.stack-work\dist\e626a42b\stack-cabal-mod←[90m
@(src/Stack\Build\Cache.hs:173:7)←[0m
←[90m2019-04-07 11:35:28.320715: ←[34m[info] ←[0mCabal-2.4.1.0: build←[90m
@(src/Stack\Build\Execute.hs:873:23)←[0m
←[90m2019-04-07 11:35:28.322715: ←[32m[debug] ←[0mRun process within C:\Users\MyHome\AppData\Local\Temp\stack6060\Cabal-
2.4.1.0\: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.4.exe --builddir=.stack-work\dist\e
626a42b build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"←[90m
@(src/Stack\Build\Execute.hs:1133:29)←[0m
Progress 0/5
-- hangs here

A: Try rerunning with --interleaved-output, which will show the output of each module being compiled by GHC (you may need to upgrade Stack first via stack upgrade). Cabal takes a long time to compile, it's probably just working through all the modules.


text:
Q: How to print a message and continue after trap'ing a signal in bash? I'd like to to do this in bash:
trap "echo Don\'t do that!" 2 3

which works just fine, except that I want the script to continue. How can I do that? If I leave the command as a blank string, the script continues, but does not print anything. Can I have both printing message and continuing?

A: With this script:
#!/bin/bash
trap 'echo "Whee!"' 3 2

echo "Setting up.."
sleep 5
echo "Done."

I get this output:
Setting up..
^CWhee!
Done.

..when I sent a ^C during the sleep command.  The interrupt is sent; bash traps it and continues, but the interrupt is properly handled by sleep.  Is this not what you want?


text:
Q: Does an url including the category name of a post have a real impact on seo I actually have the category name in my url like:
http://blog.com/en/category-name/blog-post-title/

But If one day I would change this category name,
My url will change for all the blog post in relation with this category, then I will loose all my social shares.
Is it better for me to delete the category-name and just tag my post with the category name ?
I will have:
http://blog.com/en/blog-post-title/

I ask because I care about SEO but I'm not sure if it's better for google and others to have key information in my url.
Thank you in advance

A: This likely goes without saying - but just in case - anything related to SEO is really opinion - so I'll try and stay to what I have actually seen effect rankings over the last 2 years with Google specifically.
The first part of your question - IF I go back and change the category of some of my blog posts - which then in turn changes my URL - then YES I would say that could hurt your SEO efforts - as previously mentioned Google may see the older pages that had been previoiusly crawled now as a 404 Error - Page not found - and if you get enough of those it could hurt your rankings.
And - in my opinion - you actually want to make sure that you pay MORE attention to optimizing the category name than you do the post name as Google still values [from what I have seen with my own and client sites] those keywords in URLs closer to the root domain than it does keywords found further down the url.  So YES I would argue with the more popular Wordpress permalink post stucture: yourdomain.com/category/post-name - that the category slug in the URL is MORE important than the post name.
Example #1:  www.YourDomain.com/running/how-to-lose-weight
Example #2   www.YourDomain.com/how-to-lose-weight/running
All things exactly the same with the content on the actual post - I would go with Example #1 if I was targeting the keyword "running" and #2 if I was targeting the keywords "how to lose weight".
IF you intend on changing something later down the road - then I would suggest that you plan on producing additional content and post new posts or pages - Google is placing a high degree of importance on NEW - ORIGINAL content producted on a regular basis - so in the Running/How to Lose Weight example above those could easily be two different unique posts - with unique content - just switching the post name and category name.
So much can go into the URL sturcture of a Wordpress post or page - and I feel like it is typically over looked - or maybe more accurately stated - not looked at enough.
A great place to see how Google views your keyword density [including urls] is Webmaster tools - look at Google Index -> Content Keywords.
Great example of keyword density getting all sideways - is with physician practices - they want to say target Plastic Surgery - yet the main content keyword on almost all physician sites is "Patient" just because naturally that shows up a LOT on physician practice sites.
Hope that helps some.

A: The category-name in URL is usually category slug. So, if you even change the category title, it will not effect the URL.
Slugs are unique and are there usually for this reason, so you can make minor amendments it the title without breaking anything.
Best practise will be to architecture the application so that you don't have to make major amendments to unique identifiers.
For the other part of your question, YES it is bad for SEO if any link which was previously crawled by the bots got down.


text:
Q: Warning - Initialization makes pointer from integer without a cast I found similar questions but I don't think they applied to my specific problem, so I'm sorry if they do!
I'm learning C as a first year CS student and trying to make a quiz in C, but I can't get anywhere because every time I try to compile to see if it's working I get the message "warning: initialization makes pointer from integer without a cast."
I've worked out all of the syntax errors (I think) but I just for the life of my can't figure this out. I've gone through all of my lecture slides but none of them cover this.
#include <stdio.h>
#include <scc110.h>

int player1score, player2score;
char* answer1, answer11, answer111, answer2, answer22, answer222;

int geography()
{
  printf ("The first category is geography. Note: Player 1 always goes first.\n");

  char* answer1 = AskForStringAndWait("Player 1: What is the capital of India?");
  if (strcmp(answer1,"New Delhi")==0)
    player1score++;

  char* answer2 = AskForStringAndWait("Player 2: What is the capital of Iran?");
  if (strcmp(answer2,"Tehran")==0)
    player2score++;

  char* answer11 = AskForStringAndWait("Player 1: Name a country that borders France that  isn't Germany, Italy or Spain.");
  if (strcmp(answer11,"Luzembourgh")==0 ||
      strcmp(answer11,"Switzerland")==0 ||
      strcmp(answer11,"Belgium")==0)
    player1score++;

  char* answer22 = AskForStringAndWait("Player 2: Name one of the main British Channel Islands.");
  if (strcmp(answer22,"Guernsey")==0 ||
      strcmp(answer22,"Jersey")==0)
    player2score++;
}

A: You forgot to declare AskForStringAndWait function.
In modern C (past-C99) that would be an error, since C99 does not allow calling undeclared functions.
In C89/90 it is not an error. When an undeclared function is called, it is assumed that it returns an int value. So, your
char* answer1 = AskForStringAndWait("Player 1: What is the capital of India?");

is interpreted as an attempt to initialize a char * pointer with an int value. Hence the warning.

A: You are taking an integral value and converting it to a pointer. What is the source code for AskForStringAndWait? I believe your function returns a char, but you are storing that result in a char pointer (char *). Also, you should take note that char answer11 and char * answer11 are not equivalent. Although they have the same name, one is a global variable, and the other is a local variable inside of a function.

A: char* answer1, answer11, answer111, answer2, answer22, answer222;

In this declaration answer1 is char* and the others are only char type
But as far as I think you have declared again the same global variables inside the
int geography() {}  function

So when you are trying to get the values of these pointers You might get warning or errors
So declare like this
char* answer1, *answer11, *answer111, *answer2, *answer22, *answer222;
And inside function don't use char * before answer1and so on
just use these variables
Also the problem with the return type of geography() which is int but you are putting into char*


text:
Q: SASS offset position mixin troubles I've been trying to make an offset positioning mixin for the past couple of hours. I've been struggling with lots of errors, I cant understand what is wrong.
Here is the latest version,
@function is-offset-prop-valid($value) {
    $values: auto initial inherit 0;

    @return (type-of($value) == number and not unitless($value))
          and (index($values, $value) != false);
}

@mixin position($position, $args) {
    $offsets: top right bottom left;

    @each $offset in $offsets {
        $i: index($args, $offset);
        @if $i == length($args) {
            @error "Empty offset values not allowed";
        } else {
            @if is-offset-prop-valid(nth($args, $i+1)) {
                #{$offset}: nth($args, $i+1);
            } else {
                @error "Set value #{nth($args, $i+1)} not a valid property for #{$offset}";
            }
        }
    }

    positon: $position;
}

Normally I would have the nth($args, $i + 1) set as variable, but for the sake of this example, I left it like that.
When I use the mixin
.abs {
  @include position(absolute, top 10px);
}

I get this error from the inner if statement:
Set value 10px not a valid property for top

A: I fixed your code and rewrited it a bit. Sassmeister demo.
At first, is-offset-prop-valid function is now more readable.
Secondly, mixin position does loop through arguments ($args), not through $offsets. And I added more argument checks (look at comments). And you need to write @ symbol before else: @else.
@function is-offset-prop-valid($value) {
  $values: auto initial inherit 0;

  $is-numder: type-of($value) == number;
  $is-unitless: unitless($value);
  $match-default-values: index($values, $value) != null;

  @return ($is-numder and not $is-unitless) or $match-default-values;
}

@mixin position($position, $args...) {
  $offsets: top right bottom left;

  @if length($args) == 0 {
    @error "Empty offset values not allowed.";
  }

  @each $arg in $args {
    // Check offset key-value pair
    @if length($arg) != 2 {
      @error "Invalid pair offset-name: offset-value.";
    }

    $offset: nth($arg, 1);
    $value:  nth($arg, 2);

    // Check offset name parameter
    @if index($offsets, $offset) == null {
      @error "Invalid offset name: `#{$offset}`.";
    }
    // Check offset value parameter
    @if not is-offset-prop-valid($value) {
      @error "Set value `#{$value}` not a valid property for `#{$offset}`.";
    }

    #{$offset}: $value;
  }

  position: $position;
}

.abs {
  @include position(absolute, top 10px, left 23px);
}

But it seems to me that a simple set position is much simpler and more understandable:
.abs {
  top: 10px;
  left: 23px;
  position: absolute;
}


text:
Q: Steam Mobile Authenticator not working? So due to steam requiring the mobile authenticator for trades I got it about a month ago. It's a pain but I don't trade often, just use it when I log in the steam. Recently I tried to use a Jackpot site and it said I hadn't used my authenticator for 7 days and the trade would be held for 72 hours. Which obviously doesn't work in a jackpot. However, I traded completely fine without a wait or anything a couple days ago, but the trade was through steam. Now all my trades are still held for 72 hours, in steam or out of steam. This has been frustrating me for the longest time! If anyone knows how to fix this I would love you!

A: There is no way to get around this limitation. After you wait 7 days, you will no longer have trade holds.
The most likely cause of the sudden trade hold is because of a disable and re-enable of the mobile authenticator or multiple failed attempts at entering the authentication code.

A: Have you tried to remove the authenticator and re-add it?

*

*Disable the authenticator (go to the Steam Guard menu and choose a different Steam Guard method)

*Log out of your account (go to the Log Out menu on iOS, or go to Settings / Log Out on the Android app).

Source


text:
Q: Haskell: Delimit a string by chosen sub-strings and whitespace Am still new to Haskell, so apologize if there is an obvious answer to this...

I would like to make a function that splits up the all following lists of strings i.e. [String]:
["int x = 1", "y := x + 123"]
["int   x=   1", "y:=   x+123"]
["int x=1", "y:=x+123"]

All into the same string of strings i.e. [[String]]:
[["int", "x", "=", "1"], ["y", ":=", "x", "+", "123"]]

You can use map words.lines for the first [String].
But I do not know any really neat ways to also take into account the others - where you would be using the various sub-strings "=", ":=", "+" etc. to break up the main string.

Thank you for taking the time to enlighten me on Haskell :-)

A: The Prelude comes with a little-known handy function called lex, which is a lexer for Haskell expressions.  These match the form you need.
lex :: String -> [(String,String)]

What a weird type though!  The list is there for interfacing with a standard type of parser, but I'm pretty sure lex always returns either 1 or 0 elements (0 indicating a parse failure).  The tuple is (token-lexed, rest-of-input), so lex only pulls off one token.  So a simple way to lex a whole string would be:
lexStr :: String -> [String]
lexStr "" = []
lexStr s =
    case lex s of
        [(tok,rest)] -> tok : lexStr rest
        []           -> error "Failed lex"

To appease the pedants, this code is in terrible form.  An explicit call to error instead of returning a reasonable error using Maybe, assuming lex only returns 1 or 0 elements, etc.  The code that does this reliably is about the same length, but is significantly more abstract, so I spared your beginner eyes.

A: I would take a look at parsec and build a simple grammar for parsing your strings.

A: how about using words .)
words :: String -> [String]
and words wont care for whitespaces..
words "Hello World"
= words "Hello     World"
= ["Hello", "World"]


text:
Q: How can i track which page called the current page to route back I have a Angular App which has pages that have grids and from the row the user can navigate to the detail page and once he is done, i have a back button on page to allow user to return to grid. In my case it became an issue which required me to keep track of the index of row clicked as well as the offset so un return user could return to that row on grid.
That all wored fine via this code
   this.state$
      .pipe(
       takeWhile(_ => this.alive),
       )
       .subscribe(state => {
       this.router.navigateByUrl('/Farm/FarmList', {state});
      });

Problem for me is that I now have the issue the my user ends up on the detail page and he did not come from the /Farm/FarmList route. So is there a simple way to get the path / Route from where a user came to this Page ?
When i use
this.location.back();

The navigation to the calling Page works as desired, but i lose my info on the index and the offset which is stored in the state variable.

A: I think you have different options:
1 - you can set selected row id or index in router params or query params and when you use the back button or navigate from other component you can point right to selected row with this.route.snapshot.params.rowIndex;
2- you can use a service provided in the module or root and save your state in a bahviorSubject or a state management libs like NGRX or Akita


text:
Q: Изменить цену при помощи JS Как при помощи JS правильно изменить любую цену на "123". Приведу пример строк:
422.50
12.01
1,244.00
$2,425.00
1,939.00

И на выходе, чтоб получилось:
123.00
123.00
123.00
$123.00
123.00

Цифры обернуты в тег. Но, как проверить внутри каждого элемента на странице наличие цифр и заменить их на "123"? Код для тестов:

let allElems = [...document.querySelectorAll('body *')];
allElems.forEach(item => {

});

422.50

12.01

1,244.00

  $2,425.00

$1,939.00

A:

const searchArea = document.querySelector('.test');

searchArea.innerHTML = searchArea.innerHTML.replace(/\d{1,3}(,\d\d\d)*.\d\d/g, '123.00');

Крылья, ноги, хвосты. Цена 422.50

не сыпь мне соль на рану, а сыпь её мне в суп.

12.01

1,101,244.00

  $2,425.00

$1,939.00


text:
Q: Completely exclude checkbox element from form? How can I completely exclude an input (specifically, a checkbox) from a form? Specifically, how to keep it from resetting when the form is reset. There are numerous answers for how to prevent it from being submitted with a form, however none seem to address the issue of form resets.
My problem is that I need to place a checkbox on my page for user control of an option, but it needs to be located in the middle of a bunch of form inputs. Since it is only a user option selection box, and not part of the form, however, I need it to be excluded from all form operations, such as resetting the form or submitting the form.

A: if you are working with modern browsers that support html5 you can use form attribute of
as mdn describes:
The form element that the input element is associated with (its form owner). The value of the attribute must be an id of a  element in the same document. If this attribute is not specified, this  element must be a descendant of a  element. This attribute enables you to place  elements anywhere within a document, not just as descendants of their form elements. An input can only be associated with one form.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input
so you can simple set form attribute to a dummy id which did not exist in the document
this can simple exclude the input from its containing form
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>html5 template .html</title>

    <form>
      <input type="checkbox" name="hello"/>aaa
      <input type="checkbox" name="hello"/>bbb
      <input type="checkbox" name="option" form="dummy"/>ccc
      <input type="submit"/>
      <input type="reset"/>
    </form>

in the code above. when you click reset. option is not reset
when you click submit option is not submit(see address after click submit, something like: ?hello=on&hello=on)

A: You might have to do this kind of form reset by using Javascript.
Here is the fiddle example
http://jsfiddle.net/8K7Bt/
Javascript
$(function() {
    $("form").on('reset', function() {
        var inputs = $(this).find(":checkbox");
        inputs.each(function() {
            $(this).data('value', $(this).is(':checked'));
        });
        this.reset();
        inputs.each(function() {
            $(this).attr('checked', $(this).data('value'));
        });
    });
});

HTML
<form>
    <input type="text" />

    <select>
        <option>1</option>
        <option>2</option>
        <option>3</option>
    </select>

    <input type="radio" name="radio" /> radio 1

    <input type="radio" name="radio" /> radio 2

    <input type="checkbox" name="checkbox" checked='checked' /> checkbox 1 (excluded from reset)

    <input type="checkbox" name="checkbox" /> checkbox 2 (excluded from reset)

    <input type="reset" value="reset me" />
</form>


text:
Q: What is the difference between a dacpac with extractAllTableData flag and a bacpac? I'd like to backup a database in SSMS and restore it to a different server on a VM. I've exported dbs to bacpacs but keep hitting roadblocks like users having windows authentication or errors validating elements.
I've recently noticed that a dacpac with the extraAllTableData set to true might accomplish a similar thing. I know that bacpacs are tailored for Azure Sql Servers but are there any other differences between the two?

A: DACPAC contains only schema information only.
BACPAC contains both schema and data. It also contains the security.
If you go with ExtractAllTableData option, in addition to schema, user data is also extracted. But, still permissions are not extracted.

/p:   ExtractAllTableData=(BOOLEAN)   Indicates whether data from all user
tables is extracted. If 'true', data from all user tables is
extracted, and you cannot specify individual user tables for
extracting data. If 'false', specify one or more user tables to
extract data from.


text:
Q: How may I be redirected to another app when i click a link on my app? I'm working on an app and in that I have added some activities which opens an WebView html file. And in that html file I have added iframe of google docs and I have added some url of another app in that Docs file. And if I click the url it's opening it in the same page and "web page not available" is coming. Those links should be redirected to another app, Please say a solution for it. And sorry if it was a silly question because I'm a way too fresher for android studio and codings.

A: you should read about Deep Linking for starters
here's the google documentation:
https://developer.android.com/training/app-links/deep-linking
for your own problem you will need to search for the Deep Linking URL for the App you want to redirect to and then put that URL instead of what you are using now, if the App you want to redirect to is also created by you and has not implemented Deep Linking then this is a feature that you MUST implement, i would suggest reading up about Dynamic Linking for easier implementation:
https://firebase.google.com/docs/dynamic-links


text:
Q: Ignite's off-heap storage's working and advantages over heap storage I understand off-heap storage helps in avoiding long GC pauses, but I want to know how java serializes objects while storing on heap and how ignite serializes while storing off-heap?, like GC is run to free up space, what happens when off-heap is used to free up space and how that compares with GC? How does off-heap fares against heap storage?
We are trying a POC to evaluate ignite and hazelcast, ignite offers off-heap storage, so want to understand the details of it to come to a conclusion..

A: Java doesn't serialize data which is stored on-heap. The whole idea of serialization is about taking away objects from heap to other medium, such as off-heap. So it's just stored.
Ignite implements fast serialization using Binary Objects, Externalizable and Binarylizable interfaces.
Ignite does not need to GC its off-heap since it explicitly keeps tracks of all key-value pairs. When something is deleted the memory is available for use immediately (GC is only really needed for graph systems, not key-value and neither SQL).
However, things might be somewhat different for recently introduced transactional SQL with its vacuum procedure.


text:
Q: Room.inMemoryDatabaseBuilder() not found in instrumented test I'm trying to create an instrumented test for Room DB I have in my app, but I keep getting this error:
java.lang.NoSuchMethodError: No static method inMemoryDatabaseBuilder(Landroid/content/Context;Ljava/lang/Class;)Landroid/arch/persistence/room/RoomDatabase$Builder; in class Landroid/arch/persistence/room/Room; or its super classes (declaration of 'android.arch.persistence.room.Room' appears in /data/app/com.example.android-nhsbta60PW8T0UpasgtR0B==/base.apk)
at com.example.android.FooDaoTest.<init>(FooDaoTest.kt:40)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:58)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:375)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2074)

This is my Gradle build configuration:
project:
buildscript {
    ext {
        kotlinVersion = '1.2.0'

        supportLibVersion = '26.1.0'
        archLibVersion = '1.0.0'

        ...

        // Test libs
        androidTestLibVersion = '1.0.1'
        espressoVersion = '3.0.1'
        powerMockVersion = '1.7.1'
    }

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

app:
android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'

    defaultConfig {
        applicationId "com.example.android"

        minSdkVersion 17
        targetSdkVersion 26

        versionCode 1
        versionName "0.1"

        ...

        multiDexEnabled true

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        debug {
            minifyEnabled true
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:multidex:1.0.2'

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"

    ...

    implementation "android.arch.lifecycle:extensions:$archLibVersion"
    implementation "android.arch.persistence.room:runtime:$archLibVersion"
    kapt "android.arch.lifecycle:compiler:$archLibVersion"
    kapt "android.arch.persistence.room:compiler:$archLibVersion"

    ...

    // Test libs

    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:2.8.47'
    testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
    testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
    testImplementation 'org.hamcrest:hamcrest-library:1.3'
    testImplementation "android.arch.core:core-testing:$archLibVersion"
    testImplementation "com.squareup.okhttp3:mockwebserver:3.9.1"

    androidTestImplementation "com.android.support.test:runner:$androidTestLibVersion"
    androidTestImplementation "com.android.support.test:rules:$androidTestLibVersion"
    androidTestImplementation("com.android.support.test.espresso:espresso-core:$espressoVersion", {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espressoVersion"
    androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espressoVersion"
    androidTestImplementation "com.android.support.test.espresso:espresso-idling-resource:$espressoVersion"
    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'

    androidTestUtil "com.android.support.test:orchestrator:$androidTestLibVersion"
}

And this is my instrumented test:
@RunWith(AndroidJUnit4::class)
class FooDaoTest {

    private lateinit var db: AppDatabase

    private lateinit var fooDao: FooDao

    @Before
    fun setUp() {
        db = Room.inMemoryDatabaseBuilder(InstrumentationRegistry.getContext(), AppDatabase::class.java).build()

        fooDao = db.fooDao()
    }

    @After
    fun closeDb() {
        // db.close()
    }

    @Test
    fun save() {
        ...
    }
}

I'm guessing the error has something to do with multidex, but I can't quite find why. Does anyone know why this is happening and how I can make this test work?

A: Seems like it was some build issue I was having, I'm posting what fixed it for me in case it helps others:
I tried cleaning the project from Android Studio a lot of times and the issue persisted, however, when I cleaned the project from the command line using:
./gradlew clean

and then run the test again it worked.
UPDATE:
After some more testing, I found out that the real issue was with my Proguard configuration. I am using Proguard in the debug builds, which removes all the non-used classes/methods (Room.inMemoryDatabaseBuilder() being one of them). Once I disabled Proguard for the debug builds and cleaned up the project as specified above it started working. So to wrap up, the solution is:

*

*Disable Proguard for the debug build (or add a test Proguard configuration to the debug build):

Option 1:
buildTypes {
//      debug {
//          minifyEnabled true
//          useProguard false
//          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//      }
        ...
}

Option 2:
buildTypes {
        debug {
            minifyEnabled true
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            testProguardFiles 'proguard-rules-test.pro'
        }
        ...
}

The contents of proguard-rules-test.pro will depend on what you need for your app.

*Clean the project from the command line:
./gradlew clean


text:
Q: is it possible to use azure managed disks with azure scale sets, as an OS disk is it possible to make virtual machine scale set using manged disk.
i am trying this in vmss vm profile but keep getting error
"virtualMachineProfile":{
    "storageProfile":{
        "imageReference":{
            "publisher":"Canonical",
            "offer":"UbuntuServer",
            "sku":"14.04.2-LTS",
            "version":"14.04.2-LTS"
        },
        "osDisk":{
            "osType":"Linux",
            "caching":"ReadWrite",
            "createOption":"FromImage",
            "name":"OSDisk",
            "managedDisk":{
                "storageAccountType":"Premium_LRS"
            }
        },
        "dataDisks": [{
            "lun":0,
            "managedDisk":{
                "id":
                "[resourceId('Microsoft.Compute/disks', 'testvm_OsDisk_1_bac5bcaf20ec4cafbb0f452d631fe68f')]"
            },
            "caching":"None",
            "createOption":"Attach"
        }]
    },
    message ": " Parameter 'osDisk.managedDisk.id' is not allowed.

A: Don't give your osdisk a name, e.g. for osdisk:
"storageProfile": {
    "osDisk": {
        "createOption": "FromImage",
        "caching": "ReadWrite"
    },
    "imageReference": "[variables('imageReference')]""
},

e.g. for data disks:
"dataDisks": [{
    "diskSizeGB": "[variables('sizeOfDiskInGB')]",
    "lun": 0,
    "createOption": "Empty"
}],

A: For now, we can't use managed disk to create Azure VM directly.
But we can create a managed image of managed vm or a snapshot via PowerShell, after that we can use this new image to create azure VM.
$vmName = "myVM"
$rgName = "myResourceGroup"
$location = "EastUS"
$imageName = "myImage"
Stop-AzureRmVM -ResourceGroupName $rgName -Name $vmName -Force
Set-AzureRmVm -ResourceGroupName $rgName -Name $vmName -Generalized
$vm = Get-AzureRmVM -Name $vmName -ResourceGroupName $rgName
$image = New-AzureRmImageConfig -Location $location -SourceVirtualMachineId $vm.ID
New-AzureRmImage -Image $image -ImageName $imageName -ResourceGroupName $rgName

More information about generalize vm and create image, please refer to this link.
By the way, the comment you added is right, we can use image in this way.


text:
Q: How to download code using TortoiseHg (Mercurial) I am trying to download the code  theworldsworststackoverflowclone. At first I have tried with Tortoise SVN but later get to know that hg command is not supported.
Now I downloaded Mrcurial and TortoiseHg 2.0.2 with Mercurial 1.8.1 - x64 Windows and installed on my system. I have also tweaked the proxy settings required.
But whenever I am trying to clone , then I am getting the following error:
Clone not found [Command returned Code 225]

A: It worked for me. I'm using TortoiseHg (1.1.5) and Mercurial (1.7)
My Steps:

*

*Right Click and select TortoiseHG

*Select Clone ...

*In the dialog that pops up I put Source Path: https://theworldsworststackoverflowclone.googlecode.com/hg/
and Dest Path: theworldsworststackoverflowclone


text:
Q: Change input value when i press  Attribute Ok guys already search for it but no results at all, and cant figured it out how to do this, so my problem is:
I have this form:
<form method="POST" action="search.php" name="form" id="form">
<input type="text" name="search" id="search" placeholder="Introduza a sua Localização">
<input type="submit" name="Submit" value="Pesquisar">
</form>

And what i would like to is when i press this:
City

The input value change to what i want  in this case "City" and then automatically submit the form.
I already made a research about this and theres nothing i could take, any help would be appreciated.
Cumps.
Guys thanks to your help now its working but someone tell me please what the problem in this code:
<?php if (mysql_num_rows($tournaments) !=0){
     do { ?>

<img src="images/tournaments/<?php echo $row_tournaments['logo']; ?>.png">

<?php echo $row_tournaments['description']; ?>

     <a href="tournaments.php?id_tournament=<?php echo $row_tournaments['id_tournament']; ?>">

Entrar no torneio

      <a href="games.php?id_game=<?php echo $row_tournaments['id_game']; ?>"><?php echo $row_tournaments['game']; ?>

 <?php echo $row_tournaments['date']; ?>

 <a href="tournaments.php?id_tournament=<?php echo $row_tournaments['id_tournament']; ?>#disqus_thread">Sem comentários

 <?php echo $row_tournaments['city']; ?>

<img src="images/<?php echo $row_tournaments['online']; ?>.png"> <?php echo $row_tournaments['online']; ?>

<?php } while ($row_tournaments = mysql_fetch_assoc($tournaments));
} else {
?>

Sem torneios

<?php
}
?>

Everything is looped fine but that part:

Its not looping it only shows the first record why is it?
Any help would be appreciated.

A: in your js file you can check if the value of the textbox is equal to the cityname you want. if it is then submit the form. Attach the function to your a tag
function SubmitRightCity(){
   if(document.getElementById('search').value == "citynamehere"){
        document.forms["form"].submit();
   }
}

in html
City

In the case where you want your a tag to give the input a value, you attach a function to your tag, once the link is clicked, then the function will give your input a value.
 City

in javascript file you will have


text:
Q: Drupal db_query_range SQL query I'm trying to get this working and the query executes but nothing comes back. I've tried everything I can think of, can you spot what I'm doing wrong?
$nido = $node->nid;
$result = db_query_range('
        SELECT i.nid, i.iid, a.fid, p.filename, p.filepath
        FROM {drup_image_attach} i
        LEFT JOIN {drup_image} a ON i.iid = a.nid
        LEFT JOIN {drup_files} p ON a.fid = p.fid
        WHERE i.nid = %d AND p.filename = "recipe_thumb"', $nido, 0, 10);
echo "Filepath = " . $result ->filepath. "
";
echo "Filepath = " . $result ->filename . "
";
echo "IID = " . $result ->iid. "
";
echo "NID = " . $result ->nid . "
";
}

EDIT - I sorted out a couple of bits, but the output is still empty!
EDIT - this is the working code:
$nodeid = $node->nid;
$get_image = db_query('
    SELECT p.filepath as imagefilename
    FROM {image_attach} i
    LEFT JOIN {image} a ON i.iid = a.nid
    LEFT JOIN {files} p ON a.fid = p.fid
    WHERE i.nid = %d AND p.filename = "recipe_thumb"', $nodeid);
$obj_image = db_fetch_object($get_image);
$imagefilename = $obj_image->imagefilename;

A: $result is a mysql(i) resource only. You first have to fetch the row/object.
$result = db_query_range(....);
$object = db_fetch_object($result);
print_r $object;

A: Assuming you have a range ob results not a single result this should work. You need to store the results in an array or process them in a different manner. for a single result see db_result()
$nodeid = $node->nid;

$get_image = db_query('
    SELECT p.filepath as imagefilename
    FROM {image_attach} i
    LEFT JOIN {image} a ON i.iid = a.nid
    LEFT JOIN {files} p ON a.fid = p.fid
    WHERE i.nid = %d AND p.filename = "recipe_thumb"', $nodeid);

while(($obj_image = db_fetch_object($obj_image)) == TRUE){
    $imagefilename[] = $obj_image->imagefilename;
}


text:
Q: Regex (PHP) - How to match as many times as possible with multiple lines String Block:
abc
de
xxx
a
bcd
e

How do I match abcde twice? The line break can happen in any places.
/a.*e/s  matches whole block once.

Regex Fiddle here.

A: use the greediness operator ?
a.*?e

instead of
a.*e

What you are using tries to give you maximum possible match, which is done in the first match of the whole string, that is why you are getting only one match.
i tried it on regexpal

A: Use str_replace to remove the breaks (\r\n).
$string= str_replace("\r\n","",$stringblock);

Then you can check if $string matches.

A: a\s*b\s*c\s*d\s*e

Can be done using this but not extendable.see demo.
https://regex101.com/r/pT4tM5/15


text:
Q: Auto height virtual list for Mobiles to display large list I have a requirement where I have to display large list of items that may have different heights and also items will be adding to end of list dynamically. Previously I have written my own virtual list and that performed very well in Desktop browsers, but I observed flickering in with that list in Safari browser as I was doing a lot many things on scroll. As safari adds effects while scrolling it was conflicting with native scroll effects. I have found an interesting way of inserting and removing nodes while scrolling here. But this is designed for lists that has fixed height elements, not for auto height elements(Even solution I have implemented) because  at the start we calculate the total height like below
 this.totalRows = config.totalRows || (config.items && config.items.length);

 var scroller = VirtualList.createScroller(itemHeight * this.totalRows);
 this.container = VirtualList.createContainer(width, height);
 this.container.appendChild(scroller);

And while scrolling we find scroll item as below
 var first = parseInt(scrollTop / itemHeight);

But, this is what scaring me because for auto height elements and I completely clueless on how can I calculate first item, and how to find total height of dummy scroller.
Anybody has implemented this kind of solution for mobiles before, and are there any alternatives to this approach or any plugins available?

A: Sounds like you should be able to do correct calculating by always run a loop through each elemnt to get every elements actual height. Auto height elements still has a height. Make sure to do some real testing and there are different ways to calculate height. I do it in jquery using outerHeight to make sure it calcualtes with padding. It would be easier if you shared some hardcoded html/js and point on a specific problem with the height.


text:
Q: Iptables --reject-with tcp-reset for non-TCP traffic Here I faced with a bit strange rule:
iptables -A INPUT -s 10.26.95.20 -j REJECT --reject-with tcp-reset

This rule matches all the protocols from specific network and rejects it with TCP RST packet.
How is this supposed to work with non-TCP packets? If other end (10.26.95.20) sends UDP packet it then receives TCP RST? This looks extremely strange..

A: Yeah, it makes no sense. IPTABLES also errors when I attempt to issue this on the command line (tested on CentoOS 8). It can only work if -p tcp is given which specifies that the rule is dealing with TCP traffic. Then it will work.


text:
Q: How can I access the new password created from Firebase's sendPasswordResetEmail() I'm working on an Android Studio project using Firebase. Currently I store several User fields in the database under their email address. (Users > Email Address > (five different fields)). One of these fields is the user's password.
In my Reset Password workflow, I have Firebase send the User a reset password email. After the user goes through the link in that email, they successfully change their password and can now log in with their new password. My question is how can I grab that new password, and update the Users > Email Address > password field in my database right away? Currently this field is holding the old password that doesn't have any use any longer.
I don't believe we will need this field for the project, but I want to keep it updated for now in case another member on my team needs it. Thank you

A: Do the same procedure as you would with a sign up form but retrieve the username object that is read and not allowed to be re-edited.
Then pass it through the object, validate it and write or overwrite it to the database.
Should you wish to keep their old password with the same username,  you can but it depends how complex you want this.


text:
Q: Why does animated view start from wrong position? I'm using auto layout to animate the elements in a stack view. I've set the leading and trailing constraints, both with a priority of 1000 (required). However, as you can see from the animated gif, the stack view is initially attached on the left but not on the right.
UIView.animate(withDuration: 0.125, delay: animationDelay, options: [.curveEaseOut],
               animations: {
                   someView.transform = CGAffineTransform.identity
                   someView.alpha = 1
                   someView.isHidden = false
               }, completion: nil)


text:
Q: Why setting flex display for a table column breaks the table structure? If the 2nd and 3rd column is set to be a flex element in a 3 columned table then the table structure breaks and the 3rd column slips below the 2nd loosing the table like structure. Why this happens?
table {
  width: 500px;
  background-color: red;
}

.first {
  width: 100px;
}

.second {
  display:flex;
  background-color:blue;
}

.third {
  display:flex;
  background-color: green;
}

    asdad
     asdasd
     asdads

I'd expect that I get 3 columns and I can put flex items in them.

A: Your changing the behavior of display:table-cell to display:flex, due to this 2 columns are merging into single. You can use below code snippet

asdad
asdasd

asdads

.second > div {display:flex; background-color:blue;}
.third  > div{display:flex;background-color: green;}

https://jsfiddle.net/ulric_469/jtxckL8p/3/


text:
Q: ¿Cómo hacer que una imagen/video ocupe el total de anchura y altura en todos los dispositivos en Wordpress? Mi duda es parecida a esta y esta otra y aún así intento aplicar los conceptos y no me da resultado.
Estoy intentando que al abrir un popup con un video este quede al 100% de la anchura máxima, para que se acople a todos los dispositivos, ya que en el móvil se ve mal proporcionado.
Siguiendo mi intuición y lo que he encontrado, solo debo agregar width="100%" height="100%" al video, pero al hacerlo solo se ve aplicado la anchura, mas no la altura.

¿Creo que tal vez debo modificar el código de la plantilla?, ya que no encuentro cuales son los elementos superiores al iframe, porque en la entrada de wordpress no aparece código que pueda modificar, solo deja agregar más desde un espacio en blanco, así https://ibb.co/zQnRSDQ
El plugin de wordpress que estoy utilizando para el popup no permite muchas opciones para modificar esto. Un colega me ha dicho que podría agregar un poco de CSS:
.paoc-popup-modal {
    width: 100%;
}
.paoc-popup-modal-cnt {
    width: 100%;
}

En la entrada del post en wordpress, sin embargo no tengo idea cómo hacerlo ni dónde colocarlo.
¿Debo modificar las plantillas del theme de Wordpress o con colocar algo de código en la entrada bastaría?
Gracias.

A: @Juan en el menu de wordpress en la parte de personalizar hay un apartado que dice css, ahi puedes agregar todo el apartado de estilos que requieras. Te recomiendo que intentes ponerle important a tus estilos ya que por lo general pueden estar chocando los estilo que ya tiene el plugin con los que estas intentando poner. Saludos

A: Los iframes por defecto no suelen ser responsive, por lo que agregar un width del 100% o un height del 100% no hará que ocupe ese espacio, sin embargo hay formas de hacerlo, prueba con lo siguiente.

.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.embed-container iframe {
    position: absolute;
    top:0;
    left: 0;
    width: 100%;
    height: 100%;
}

Esto lo que hace es dar un aspect radio al iframe, posicionándolo de forma absoluta al contenedor y se le da una altura de cero y un padding-bottom en porcentaje en función del aspect ratio.
Con esto deberías de poder darle un tamaño máximo al iframe junto con un height proporcional y dinámico.
Puedes agregar el css en Apariencia -> Personalizar -> Css Adicional


text:
Q: Remove class for elements within a group for Isotope filtering I'm attempting to remove the class 'is-checked' from all buttons in a group when a user clicks on the 'all' button. There are two groups of filter buttons I'm working with: categories and tags.
I've been able to create a function that removes the class 'is-checked' from all buttons across both groups, but I've not yet been able to isolate the function to each group, although I'm very close.
The final function will add the class 'is-checked' to the 'all' button and remove the class from any other buttons within that specific group. The function works, except for the problematic line below:
    $buttonGroup.find('.is-checked').removeClass('is-checked');

The code:
// class toggling for all buttons by group
    $('.button-group').each( function( i, buttonGroup ) {
        var $buttonGroup = $( buttonGroup );
        var $this = $(this);
        $buttonGroup.on( 'click', 'button', function() {
            if ( $this.hasClass('all') ) {
                $buttonGroup.find('.is-checked').removeClass('is-checked');
                $this.addClass('is-checked');
            }
            else {
                $buttonGroup.find('.all').removeClass('is-checked');
            }
        });
    });

As the title mentions, this is for use within the Isotope framework for a portfolio with combination filtering (hence the two distinct groups of filters).
Any ideas where I'm going wrong?

A: This is a problem with scope. The variable $buttongroup lives in the function that each calls, and not in the event handler for click. I would recommend solving it like this:
// When someone clicks a button in a button group.
$('.button-group button').click(function() {
    // Get the button that was clicked.
    $this = $(this);
    // Get the button group the button that was clicked is in.
    $buttonGroup = $this.parents('.button-group');
    // And now this is just a copy of your old code below.
    if ( $this.hasClass('all') ) {
        $buttonGroup.find('.is-checked').removeClass('is-checked');
        $this.addClass('is-checked');
    }
    else {
        $buttonGroup.find('.all').removeClass('is-checked');
    }
});

As you can see, the each is not needed with this approach. Instead, the button finds out what button group it is inside using parents().


text:
Q: AJAX request in Laravel 8 I am trying to send AJAX request. My Route code is like below.
Route::group( ['prefix' => 'prayer', 'as' => 'prayer.'], function () {
   Route::get( 'time/{date}/{month}', 'PrayerTimeController@show' );
   Route::resource( 'time', 'PrayerTimeController' );
});

My Controller code is like below
public function show($date,$month)
    {
        return $date;
    }

My jQuery code is like below.
    $('#prayer_date').change(function(e){
        var month = $('#prayer_month').val();
        var date = $(this).val();
        $.ajax({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            url : "{{ route('vendor.prayer.time.show') }}"
            data: {month:month, date:date},
            type : 'POST',
            dataType : 'json',
            success : function(result){
               console.log(result);
            }
        });
    });

But I am getting error local.ERROR: Missing required parameter for [Route: vendor.prayer.time.show] [URI: mosque-panel/prayer/time/{time}] [Missing parameter: time]..
How to send AJAX request in Laravel 8 ?


text:
Q: Change an image to text via CSS for printing? Lets say I have a header banner on a webpage I'm about to print.  Instead of wasting someone's ink printing the entire block of the image, is there a way via css to replace the image with text of H1 size?

A: You could put an h1 element and an image in the same place in the source, and have the image CSS display:none for print media, and have the h1 set to display:none for screen media.

A: Bryan, typically on things like logos I use image replacement for the graphic anyway so the logo itself is really in an H1 tag. Then in my print style sheet. I do something like this...
h1#logo a, h1#home-logo{
    text-indent: 0 !important;
    background-image: none !important;
    font-size: 1.2em !important;
    display: block !important;
    height: 1em !important;
    width: 100% !important;
    text-decoration: none !important;
    color: black !important;
}

Which removes the image replacement and shows the text. Make sure of course that you call this stylesheet separately using media="print".

A: I usually just add the following to my style sheet:
.nodisplay
{
    display: none;
}

@media print {
    * {
        background-color: white !important;
        background-image: none !important;
    }
    .noprint
    {
        display: none;
    }
}

And then assign the noprint class to elements which shouldn't be printed:

And for your example, something like the following should work:

Text Logo

A: Adding to Adam's solution: If your text is fixed ("head banner was there" not "ad for such and such was there"), you can use :before or :after pseudo-elements to insert text instead of having the text pre-inserted in the HTML.
I makes your HTML lighter if you are replacing many images with the same text.
I have to say that I dislike this CSS feature, but it is there if you want to use it.


text:
Q: Unable to locate package libjpeg-dev I am trying to install libjpeg-dev through the sudo apt-get install libjpeg-dev command on my Ubuntu machine, but keep getting the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libjpeg-dev

Some information about my machine:
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

Linux ip-172-31-33-222 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

/etc/apt/sources.list file:
deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty main
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty main

deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates main
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates main

deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty universe multiverse
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty universe multiverse
deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse

I also tried adding the following source, but it didnt help:
 deb-src http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse

Any ideas?
UPDATE(8/12/2015)
Output of apt-get update:
ubuntu:$ sudo apt-get update
Ign http://us-west-2.ec2.archive.ubuntu.com trusty InRelease
Ign http://us-west-2.ec2.archive.ubuntu.com trusty-updates InRelease
Get:1 http://us-west-2.ec2.archive.ubuntu.com trusty Release.gpg [933 B]
Get:2 http://us-west-2.ec2.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Get:3 http://us-west-2.ec2.archive.ubuntu.com trusty Release [58.5 kB]
Get:4 http://us-west-2.ec2.archive.ubuntu.com trusty-updates Release [63.5 kB]
Get:5 http://us-west-2.ec2.archive.ubuntu.com trusty/main Sources [1,064 kB]
Get:6 http://us-west-2.ec2.archive.ubuntu.com trusty/universe Sources [6,399 kB]
Ign http://archive.ubuntu.com trusty InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Get:7 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:8 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://ppa.launchpad.net trusty InRelease
Get:9 http://archive.ubuntu.com trusty Release [58.5 kB]
Get:10 http://security.ubuntu.com trusty-security Release [63.5 kB]
Get:11 http://us-west-2.ec2.archive.ubuntu.com trusty/multiverse Sources [174 kB]
Get:12 http://us-west-2.ec2.archive.ubuntu.com trusty/main amd64 Packages [1,350 kB]
Ign http://ppa.launchpad.net trusty InRelease
Get:13 http://us-west-2.ec2.archive.ubuntu.com trusty/universe amd64 Packages [5,859 kB]
Get:14 http://ppa.launchpad.net trusty Release.gpg [316 B]
Get:15 http://archive.ubuntu.com trusty/main Sources [1,064 kB]
Get:16 http://security.ubuntu.com trusty-security/main Sources [91.1 kB]
Get:17 http://ppa.launchpad.net trusty Release.gpg [316 B]
Get:18 http://security.ubuntu.com trusty-security/universe Sources [29.4 kB]
Get:19 http://ppa.launchpad.net trusty Release [15.1 kB]
Get:20 http://security.ubuntu.com trusty-security/multiverse Sources [2,330 B]
Get:21 http://security.ubuntu.com trusty-security/main amd64 Packages [326 kB]
Get:22 http://archive.ubuntu.com trusty/universe Sources [6,399 kB]
Get:23 http://us-west-2.ec2.archive.ubuntu.com trusty/multiverse amd64 Packages [132 kB]
Get:24 http://us-west-2.ec2.archive.ubuntu.com trusty/main Translation-en [762 kB]
Get:25 http://security.ubuntu.com trusty-security/universe amd64 Packages [113 kB]
Get:26 http://ppa.launchpad.net trusty Release [15.1 kB]
Get:27 http://us-west-2.ec2.archive.ubuntu.com trusty/multiverse Translation-en [102 kB]
Get:28 http://us-west-2.ec2.archive.ubuntu.com trusty/universe Translation-en [4,089 kB]
Get:29 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [3,686 B]
Get:30 http://ppa.launchpad.net trusty/main amd64 Packages [3,019 B]
Get:31 http://security.ubuntu.com trusty-security/main Translation-en [178 kB]
Get:32 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/main Sources [228 kB]
Get:33 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/universe Sources [132 kB]
Get:34 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/multiverse Sources [5,143 B]
Get:35 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/main amd64 Packages [599 kB]
Get:36 http://security.ubuntu.com trusty-security/multiverse Translation-en [1,679 B]
Get:37 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/universe amd64 Packages [302 kB]
Get:38 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [11.9 kB]
Get:39 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/main Translation-en [288 kB]
Get:40 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/multiverse Translation-en [6,148 B]
Get:41 http://us-west-2.ec2.archive.ubuntu.com trusty-updates/universe Translation-en [161 kB]
Get:42 http://ppa.launchpad.net trusty/main Translation-en [2,036 B]
Ign http://us-west-2.ec2.archive.ubuntu.com trusty/main Translation-en_US
Ign http://us-west-2.ec2.archive.ubuntu.com trusty/multiverse Translation-en_US
Ign http://us-west-2.ec2.archive.ubuntu.com trusty/universe Translation-en_US
Get:43 http://security.ubuntu.com trusty-security/universe Translation-en [66.3 kB]
Get:44 http://ppa.launchpad.net trusty/main amd64 Packages [705 B]
Get:45 http://ppa.launchpad.net trusty/main Translation-en [464 B]
Get:46 http://archive.ubuntu.com trusty/restricted Sources [5,433 B]
Get:47 http://archive.ubuntu.com trusty/multiverse Sources [174 kB]
Fetched 30.4 MB in 9s (3,333 kB/s)
Reading package lists... Done

A: Use the Ubuntu Main Server.
sudo sed -i.bak 's/us-west-2\.ec2\.//' /etc/apt/sources.list

The command removes us-west-2.ec2. in /etc/apt/sources.list and creates a backup in /etc/apt/sources.list.bak


text:
Q: In a list of tuples, find a match if a certain field is set I have a list of tuples that looks like this:
[
 (36, 1, 2908.8037109375, 1835.6429443359375, 17, 0),
 (36, 0, 184187.125, 148323.234375, 55, 3),
 (140, 0, 0.0, 0.0, 34, 1),
 (141, 0, 6.35533332824707, 5.926896095275879, 22, 2)
]

I'd like to iterate through the list, and if the second field in the tuple is '1', then I'd like to find anything that matches the first field, and return both tuples as a new tuple (or other data structure; doesn't have to be a tuple) within a list of matches.  So in this example, the output would be something like:
[(
 (36, 1, 2908.8037109375, 1835.6429443359375, 17, 0),
 (36, 0, 184187.125, 148323.234375, 55, 3)
)]

I'm at a bit of a loss where to start with this without getting into a very slow O(n^n) sort of situation.

A: lst=[
 (36, 1, 2908.8037109375, 1835.6429443359375, 17, 0),
 (36, 0, 184187.125, 148323.234375, 55, 3),
 (140, 0, 0.0, 0.0, 34, 1),
 (141, 0, 6.35533332824707, 5.926896095275879, 22, 2)
]

Here's a one line nested for loop list comprehension:
out=[y for x in lst if x[1]==1 for y in lst if y[0]==x[0]]
print(out)
[(36, 1, 2908.8037109375, 1835.6429443359375, 17, 0), (36, 0, 184187.125, 148323.234375, 55, 3)]

If you have a lot of tuples in lst then there would be faster ways of searching for the result than this.

A: Here's some code to process the list of tuples, not assuming that the list is properly sorted.

*

*first sort the list of tuples according to first value and second value compared to 1 (to issue a boolean), so tuples are "grouped" by first "column", and 1 occuring first in the list of tuples. Sort is not O(n**2), probably O(log(n)*n)

*then compose a generator expression using groupby to group tuples according to the first value (second value "1" still is first when grouped)

*finally filter out groups where 1 isn't present

Last steps are O(n). Here's the code:
from itertools import groupby

tuple_list = [
 (36, 0, 184187.125, 148323.234375, 55, 3),
 (140, 0, 0.0, 0.0, 34, 1),
 (141, 0, 6.35533332824707, 5.926896095275879, 22, 2),
 (36, 1, 2908.8037109375, 1835.6429443359375, 17, 0),
]

ones_first = (sorted(tuple_list,key=lambda r : (r[0],r[1]!=1)))
tuples = (tuple(x for x in y) for _,y in groupby(ones_first,key=lambda r : r[0]))

with_ones = tuple(filter(lambda r : r[0][1]==1,tuples))
print(with_ones)

result:
(((36, 1, 2908.8037109375, 1835.6429443359375, 17, 0), (36, 0, 184187.125, 148323.234375, 55, 3)),)


text:
Q: Huawei E303 USB modem not working in 14.04 I installed Ubuntu on my pen drive. I can connect using my android phone tethering, but when I wanted to use my Huawei Mobile 3G USB modem, it is not detected by Ubuntu but shows a CD ROM type of icon on launcher.
How to get the USB modem running?

A: You must "eject" the CD to make the modem to function.
You can eject it from terminal or disks or launcher.
It will then detected as modem.
You can find it network manager.


text:
Q: Transconductance of a device I would like to know what does it mean when someone says "that the transconductance of a FET or MOSFET is less compared to that of a bipolar junction transistor (BJT)".
I even heard someone saying that "This particular JFET has lots of transconductance (about 25mS at its Idss of 6-12mA)" What does this mean? And how does he know this? Is it given in the datasheet of every single JFET?
There is something related to transconductance in a datasheet which is the following:

I know that the Idss is the maximum current that a JFET can handle.
I also know that the transconductance of a device is useful to calculate the gain of a device, unless we use emitter degeneration.
For a BJT the transconductance is: \$g_m = \frac{I_c}{V_t}\$ where (\$V_t\$ is thermal voltage)
For a JFET the transconductance is: \$g_m = \frac{I_d}{V_{gs}}\$

A: The transconductance tells you how much the current changes when you increase/decrease the gate/base a very tiny bit. It is a small-signal parameter. So a \$g_m = 25mS\$ at a \$v_{GS} = 0V, v_{DS} = 10V\$ like in your graph will mean that if you increase \$v_{GS}\$ a very tiny bit by \$\Delta v_{GS}\$, that the drain current will also increase a bit by \$\Delta i_d \approx 25mS \cdot \Delta v_{GS}\$.
For BJT's, the transconductance gain can be approximated by
$$g_m \approx \frac{I_c}{n V_T}$$
With \$n\$ the emission coefficient, \$V_T\$ the thermal voltage.
This means that the transconductance is proportional to \$I_c\$, or
$$g_m \sim I_c$$
For MOSFET's (similar to JFET's) the situation is a bit different. The approximation of the transconductance gain is here:
$$g_m \approx \frac{2 I_d}{V_{GS} - V_{TH}}$$
In order to make \$g_m\$ go up, we can just decrease \$V_{GS}-V_{TH}\$, however: the current \$I_d\$ will also decrease when doing that. It turns out that this decrease is approximately:
$$I_d \sim (V_{GS}-V_{TH})^2$$
So you can write that the transconductance is proportional to
$$g_m \sim \sqrt{I_d}$$
or
$$g_m \sim \frac{1}{\sqrt{V_{GS}-V_{TH}}}$$
And this is a bit annoying. This dependency is much slower! So in order to get the same \$g_m\$ for a FET, you will need a lot of current (limited by power consumption and velocity saturation, where the formula doesn't apply anymore), or almost no \$V_{GS}-V_{TH}\$ voltage (where \$I_d\$ will usually reach impractically low levels \$\sim nA\$). There is one way of solving this, and that is making the FET gigantic, but that is usually impractical as well and it makes other parasitic effects worse.


text:
Q: How to add round tip on trim circle in SwiftUI I want make progress bar (circle) with big round tip, that will follow to progress. Can you please suggest me, Is there any standard way to do it? Or it requires additional circle and some calculation to understand position?
struct Loader: View {

    var percent: CGFloat = 0
    var colors: [Color] = [
        Color(red: 0.949, green: 0.9098, blue: 0.8706),
        Color(red: 0.9569, green: 0.5882, blue: 0.2196)
    ]

    var body: some View {
        ZStack{
            Circle()
                .fill(Color.white)
                .frame(width: 300, height: 300, alignment: .center)
                .overlay(
                    Circle()
                        .trim(from: 0, to: percent * 0.01)
                        .stroke(style: StrokeStyle(lineWidth: 22, lineCap: .butt, lineJoin: .miter, miterLimit: 10))
                        .fill(AngularGradient(gradient: .init(colors: colors), center: .center, startAngle: .zero, endAngle: .init(degrees: 360)))
                        .rotationEffect(.degrees(-90))
                ).animation(.spring(response: 1.0, dampingFraction: 1.0, blendDuration: 1.0))

            Text(String(format: "%.1f", percent) + " %").font(.system(size: 20)).fontWeight(.heavy)
        }
    }
}

What i want to make:

What i have done already:

A: You can change the type of stroke tip by changing the lineCap modifier of StrokeStyle like this:
   .trim(from: 0, to: 0.75)
   .stroke(Color.black, style: StrokeStyle(lineWidth: lineWidth, lineCap: .round))

A: Here's potential solution. I added an overlay on top of the Loader, I made it's height the full size of the big Circle, and then simply rotated the overlay with the completion. This way they animate at the same time.
import SwiftUI

struct CircleView: View {

    @State var percent: CGFloat = 0

    var body: some View {
        Loader(percent: $percent)
            .onAppear {
                DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
                    withAnimation(Animation.linear(duration: 1.0)) {
                        percent = 20
                    }
                }
                DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
                    withAnimation(Animation.linear(duration: 2.0)) {
                        percent = 55
                    }
                }
                DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) {
                    withAnimation(Animation.linear(duration: 4.0)) {
                        percent = 100
                    }
                }
            }
    }
}

struct CircleView_Previews: PreviewProvider {
    static var previews: some View {
        CircleView()
    }
}

struct Loader: View {

    @Binding var percent: CGFloat
    var colors: [Color] = [
        Color(red: 0.949, green: 0.9098, blue: 0.8706),
        Color(red: 0.9569, green: 0.5882, blue: 0.2196)
    ]

    let circleHeight: CGFloat = 300

    var body: some View {
        let pinHeight = circleHeight * 0.1
        let completion = percent * 0.01
        Circle()
            .trim(from: 0, to: completion)
            .stroke(style: StrokeStyle(lineWidth: 22, lineCap: .butt, lineJoin: .miter, miterLimit: 10))
            .fill(AngularGradient(gradient: .init(colors: colors), center: .center, startAngle: .zero, endAngle: .init(degrees: 360)))
            .rotationEffect(.degrees(-90))
            .frame(width: circleHeight, height: circleHeight)
            .overlay(
                Text(String(format: "%.1f", percent) + " %").font(.system(size: 20)).fontWeight(.heavy)
                    .animation(nil)
            )
            .overlay(
                Circle()
                    .frame(width: pinHeight, height: pinHeight)
                    .offset(y: -pinHeight / 2)
                    .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
                    .rotationEffect(Angle(degrees: 360 * Double(completion)))
            )
    }
}