text:
Q: React - pass state to Route I have a simple React+Hooks webapp, I have a route1 that renders componentA.
On ComponentA, I can render the proper jsx for that component or redirect to Route2, if a condition is meet.
On the route2, I need to get some of the states from componentA that route1 renders.
ComponentA.jsx
return (
        <Fragment>
            {!call ?
                (

                        //some jsx

                )
                :
                (
                    <Redirect to={{pathname: '/route2', state: { meeting, name }}}/>
                )}
        </Fragment>
);

App.js
const App = () => {

    return(
        <AuthProvider>
            <Router history={history}>
                <Switch>
                    <Route exact path="/route1" component={ComponentA} />
                    <Route exact path="/route2" component={ComponentB} />
                </Switch>
            </Router>
        </AuthProvider>
    );
};

I was trying to get the state props.location.state on ComponentB.jsx, but it's always undefined. Is there a way to pass those parameters to a route or do I need to use Context to solve that?

A: Your code should work, however props.location.state will be undefined unless you specifically set it via programmatic navigation. If you reload the page for instance, or navigate via URL, or navigate without setting it, it will not be there. You have to account for that in the component, and you should avoid putting any data in there that needs to be available regardless of how the route is reached. You'll usually be better off storing any shared state in a shared parent, in this case App.
Here's a working example. It uses BrowserRouter as I cannot get the npm history package with createBrowserHistory to load properly in a snippet, but it's essentially the same as creating history that way and feeding it to your regular Router:

const { useState } = React;
const { BrowserRouter, Switch, Route, Redirect } = window.ReactRouterDOM;

function App() {
  return (
    <BrowserRouter>
      <Switch>
        <Route exact path="/route1" component={ComponentA} />
        <Route exact path="/route2" component={ComponentB} />
        <Redirect to="/route1" />
      </Switch>
    </BrowserRouter>
  );
};

function ComponentA() {
  const [redirect, set] = useState(false);
  const string = "state preserved";

  return redirect ? (
    <Redirect to={{ pathname: "/route2", state: { string } }} />
  ) : (
    <button onClick={() => set(true)}>Redirect with state</button>
  );
}

function ComponentB(props) {
  return (

{props.location.state ? props.location.state.string : "no state"}

  );
}

ReactDOM.render(<App />, document.getElementById('root'))


text:
Q: GCM to a group of users This is my case:
I have a database with 10k ID client to notify, most of these are not valid, I just have 4 valids ID Client to notify by push notification.
Why I am doing that?
I want to be sure I can handle that size of IDs.
How I am notify them?
Well, I am using  this format:
https://gcm-http.googleapis.com/gcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA

{ "data": {
    "score": "5x1",
    "time": "15:10"
  },
  "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1..."
}

So I have to add all the keys, when I am attaching all the keys (10k) I am having troubles I think gcm will not allow me to send that size of ids.
So I want to know from your perspective which is the best way to notify a hudge group of users.
I have been thinking in handling the keys in a kind of chunks for example with 200 keys each push notification.
I have been reviewing in push GCM with a group but I don't have clear this. I have seen the documentation:
https://developers.google.com/cloud-messaging/notifications
And there is a part:
The maximum number of members allowed for a notification_key is 20.

It means I have to create a group but I just will be able to notify 20 user maximun?
There is a way to create a group and put on it 10k (or more) users and just send message to a group? and then GCM service will notify all them.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Check if record has been modified, if not dirty I have a form, that when closed and dirty, saves the record and refreshes the page from where it was called.
The problem I have is that some of the fields in the form commit the edits when a combo is changed, or after update etc. As other fields are calculated on their values.
The problem I have is that if I change a value in a combo box and the changes are committed, at the time of closing, the form is no longer dirty.
Is there a way to check if the or IS or WAS dirty since opened? The only way I can think to do it is something like;
if me.dirty = true or NewTimeStamp <> OldTimeStamp then


text:
Q: What to do about harassment? This morning I happened to disagree with some newbie user on the best way to resolve a question. He suggested that it is absolutely the best way to directly access a static field in another class; where I told him that this would be bad practice; and that a good design would avoid using fields directly, and static fields even more.
In the end, the newbie-questioner accepted the answer by that other newbie.
Now to my question: checking my reputation right now, I see that I got like 20 "-2" downvotes on some different recent answers. And you know, not only one downvote, but two. And surprise: that question/answer from those two newbies ... vanished too.
My gut feeling is something like: I upset some sock puppet and his master; and now he is pulling the big "revenge" trigger by downvoting stuff of mine.
Long story short: can I do something about that? If so, what could I do about it?
I don't think that this is a duplicate of How should I handle possible revenge downvotes?, as it talks about getting single downvotes as revenge. Mine is about downvotes in plural. Even plurals!


text:
Q: How to verify fingerprint which is captured in mobile with Desktop captured fingerprint using SecuZen SDK How to verify fingerprint which is captured in mobile with Desktop captured fingerprint using SecuZen SDK?. I can verify the fingers which both captured (using SecuZen Mobile SDK) in Mobile, but this fingers are not verifying With Desktop SDK (SecuZen) Please help me on this, If anyone knows .
Thanks


text:
Q: $R[X]$ noetherian with $R$ non noetherian Let $R$ be a ring. If $R[X]$ is noetherian, is R necessarily noetherian ?
I think that the answer is no, but could you show me the easiest example to understand ?

A: Recall that if a commutative ring $A$ is Noetherian and $I$ is an ideal in $A$, then $A/I$ is also Noetherian. In this problem, take $A=R[X]$ and $I=(X)$.


text:
Q: Using same form for different scenario in windows form I am having a VS solution where there are several projects. For example, one of them is titled 'Management' and another is titled 'Runtime'
If I set Management as default project and run it, an application called Scout opens. If I set Runtime as default project and run it, an application called PM opens.
There is a requirement to use a login form and my requirement is, same login form must be used for both projects and I must create login form under a new project called Data where it is available for use by both the other projects (runtime and management)
My doubt is, while running the program, I need to find out which project is running as default and then load the login form with some dynamically updated controls (for example, if Runtime proj is executed first, the login form should have a label "Welcome to Runtime") and if Management proj is getting executed first, the login form should have a label "Welcome to Management"
How do I achieve this?

A: I think reusing a Form is possible.
First, create your login form like this.
(Maybe you should create it in a DLL in order to reuse it in different projects.)
    public partial class LoginForm : Form
{
    //This constructor should only be called by the Designer.
    public LoginForm()
    {
        InitializeComponent();
    }

    public LoginForm(string title) : this()
    {
        TitleLabel.Text = title;
    }
    public Tuple<string, string> Login()
    {
        if (this.ShowDialog() == System.Windows.Forms.DialogResult.OK)
        {
            return new Tuple<string, string>(Username.Text, Password.Text);
        }
        else
        {
            return default(Tuple<string, string>);
        }
    }

    private void OKButton_Click(object sender, EventArgs e)
    {
        this.DialogResult = System.Windows.Forms.DialogResult.OK;
    }

    private void CancelButton_Click(object sender, EventArgs e)
    {
        this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    }
}

Then use it in different scenarios:
var details = new LoginForm("Title here").Login();
if (details.Item1 == "username" && details.Item2 == "Password")
{
    //logged in.
}


text:
Q: Finding value +1 within a group I have a large dataframe that I have grouped by Date. Within each date group, I'd like to keep the rows for rooms that are next door to one another, i.e. Room.num = any Room.num in group +/- 1
 Date        Room.num
1 2019.08.21  1
2 2019.08.21  2
3 2020.07.18  6
4 2020.07.18  1
5 2020.07.18  3

I want to end up with just
  Date        Room.num
1 2019.08.21  1
2 2019.08.21  2

*

*I have tried

df %>%
   group_by(Date)
   filter(Room.num=1)

which gives me
Date        Room.num
1 2019.08.21  1
4 2020.07.18  1

*I have also tried

df %>%
   group_by(Date)
   filter(any(Room.num=1))

This gives me
  Date        Room.num
1 2019.08.21  1
2 2019.08.21  2
3 2020.07.18  6
4 2020.07.18  1
5 2020.07.18  3

i.e. any group with a Room.num=1

*But I am not able to do what I want keep rows whichhave a room number that is +/- 1 of any other Room.num in that Date group

df %>%
   group_by(Date)
   filter(Room.num==any(Room.num)+1)

I get
Date        Room.num
2 2019.08.21  2

The second Room.num is always = 1

A: I think you can do this in tidyverse
df <- read.table(header = T, text = 'Date Room.num
1 2019.08.21 1
2 2019.08.21 2
3 2020.07.18 6
4 2020.07.18 1
5 2020.07.18 3
')

library(tidyverse)
df  %>%
  group_by(Date) %>%
  filter(map_lgl(Room.num, ~ .x %in% c(Room.num -1, Room.num +1))) %>%
  ungroup()
#> # A tibble: 2 x 2
#>   Date       Room.num
#>   <chr>         <int>
#> 1 2019.08.21        1
#> 2 2019.08.21        2

If you, however, want to avoid purrr::map_lgl use this similar baseR function like this
df  %>%
  group_by(Date) %>%
  filter(unlist(Map(\(.x) .x %in% c(Room.num -1, Room.num +1), Room.num))) %>%
  ungroup()

A: Try this solution:
#Just creating your dataset
df <- data.frame(Date = c(as.Date('2019-08-21'), as.Date('2019-08-21'),
                          as.Date('2020-07-18'), as.Date('2020-07-18'),
                          as.Date('2020-07-18')),
                 Room.num = c(1,2,6,1,3))

df %>%
  group_by(Date) %>%
  filter(any(abs(diff(Room.num)) == 1))


text:
Q: Dojo lang.mixin for loop only writing last item to object I am using dojo lang.mixin to write items to an object but it seems to only write the last key:value to the object. Which makes me think lang.mixin just writes one key:value at a time. Is there a way to keep appending key:values to the object?
for (var i = 0; i < selection.length; ++i) {
   lang.mixin(myObj, {
     selection[i].Type: selection[i].Name //always gives me last index in loop
   })
}

A: While adding properties to object the properties needs to be unique.
lang.mixin is used to update the target object with source object. If the property "name" matches with the source, then the property is updated else the property is added to the target. The nested objects will not be mixed. For example:
var a = {
    name:"John",
    account : { type : "student", email : "a@xyz.com" }
};
var b = {
    Age: "18 yrs",
    account: { phone : "66589956" }
};
lang.mixin(a, b); // here the type and email will be lost for account property

In your case, if you consider the selection[i].Type is "type" then your code will behave something like below
for (var i = 0; i < selection.length; ++i) {
    lang.mixin(myObj, {
        "type" : selection[i].Name
    });
}

So the same property will be updated on each cycle of the loop, unless the selection[i].Type value is different.

require(["dojo/_base/lang"], function(lang){
  var selection = [ { Type:"A", Name:"Letter A" },
                    { Type:"B", Name:"Letter B" },
                    { Type:"C", Name:"Letter C" },
                    { Type:"D", Name:"Letter D" }
                   ];

  var myObj = {};
  for (var i = 0; i < selection.length; ++i) {
     var tmp = {};
     tmp[selection[i].Type] = selection[i].Name;
     lang.mixin(myObj, tmp);
  }
  console.log(myObj);
});
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js"></script>


text:
Q: Error : Your PHP installation appears to be missing the MySQL extension which is required by WordPress I'm new to wordpress. After uploading the website i'm facing this error. The site worked well for a while and then this happened. Upon entering the URL this text appears "Your PHP installation appears to be missing the MySQL extension which is required by WordPress".
Went to php.ini but couldnt find what to uncomment. Please advise in the best way possible.
Server - Xampp

A: The error you got Your PHP installation appears to be missing the MySQL extension which is required by WordPress is because you're server is not having the MySQL Extension which is required for Wordpress to run
If you are using Windows Based Operating System then you should enable the mysql extension in your xampp
i.e., You should uncomment the following lines in your php.ini
extension=php_mysql.dll

Or If you use Linux based Operating System then you should install mysql from the Terminal by
sudo apt-get install php5-mysql

and then uncomment the following line in you php.ini
extension=mysql.so

Note :

*

*What ever the Operating System you use, You should restart / stop and start your Xampp Server after uncommenting the php.ini file

*If you're working online then you should contact your host provider to enable the MySQL Extension for your Account.

A: In Windows, you need to setup your php.ini like this:

*

*uncomment the line extension=php_mysqli.dll

*find the "extension_dir" parameter and set the path to ext directory of your php installation, like this:
extension_dir = "c:/php56/ext"

A: This answer is specific to those who use HostGator for their WordPress site, but the premise is still the same as for which files to manipulate, steps 1-3 will just be different for you to get to the correct files with your specific Host.
Here is how I fixed this error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0

*

*Get access to Hosting Platform (HostGator for my site)

*Launch cPanel

*File Manager

*Double Click public_html

*Right Click .htaccess

*

*Copy, give name '/public_html/.htaccess.bak' , creating a backup

*Right Click .htaccess

*

*Edit, go in and at the bottom the following code will have your current PHP handler:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php74" package as the default "PHP" programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

*

*Scroll up, either right above the previous handler or at the top, you may have an old PHP handler:

# Use PHP70 as default
AddHandler application/x-httpd-php70 .php
<IfModule mod_suphp.c>
    suPHP_ConfigPath /opt/php70/lib
</IfModule>

*

*Comment out this code, to inactivate the old handler:

# Use PHP70 as default
#AddHandler application/x-httpd-php70 .php
#<IfModule mod_suphp.c>
#    suPHP_ConfigPath /opt/php70/lib
#</IfModule>

*

*Save those changes (We added in hashtags at the start of each line to comment the code out)

*If the site still is not functional, We must make the same exact changes to the .htaccess file that is one level outside of the public_html directory.

*

*Perform the same steps as before on this .htaccess file, creating a backup and commenting out the old handler.

*This more global file may only have the old handler, so the file may just look like this:

# Use PHP70 as default
AddHandler application/x-httpd-php70 .php
<IfModule mod_suphp.c>
       suPHP_ConfigPath /opt/php70/lib
</IfModule>

*

*If that is the case, go back and copy the code from the new handler that we just made active in the '/public_html/.htaccess' file

*Also comment out the old handler once again.

This should fix the issue once you save those changes.

A: Login to your c panel
Got to PHP Configuration
Select your current PHP Version ( You can know this from phpinfo)
Click update

A: In the folder where you have installed the php, try to find the "php.ini". Now you should have delete the " ; " from this rows.
 ; extension=mysqli
 ; extension=pdo_mysql

A: At first create a PHP file on your PHP server then put the simple code here and run for check your php server informations
<?php phpinfo(); ?>

Check your PHP version and install PHP MySQL extension
sudo apt-get install phpX.X-mysqli
sudo apt-get install php8.1-mysqli
sudo apt-get install php7.4-mysqli

When it is done, simply restart your server.
For nginx server
valet restart

For apache server
sudo systemctl restart apache2

Or restart your computer.

A: To solve this problem is to config this Wordpress file wp-config-sample.php form your Wordpress folder on your machine which looks like this C:\xampp\htdocs\wordpress\wp-config-sample.php

Then you save it as wp-config.php reload your browser every thing should work well.


text:
Q: Cannot add Foreign Key constraint 1215 I got the following error: Cannot add foreign key constraint (1215)
I am using MySQL workbench export tool "Forward Engineer" to obtain the code.
This is my code:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `mydb` ;

CREATE TABLE IF NOT EXISTS `mydb`.`serie` (
  `serieid` INT NOT NULL,
  `name` VARCHAR(30) NOT NULL,
  PRIMARY KEY (`serieid`))
ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS `mydb`.`season` (
  `serieid` INT NOT NULL,
  `seasonid` INT NOT NULL,
  `name` VARCHAR(45) NOT NULL,
  `description` TEXT NULL,
  PRIMARY KEY (`serieid`, `seasonid`),
  CONSTRAINT `fk_season_serie`
    FOREIGN KEY (`serieid`)
    REFERENCES `mydb`.`serie` (`serieid`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS `mydb`.`episode` (
  `serieid` INT NOT NULL,
  `seasonid` INT NOT NULL,
  `episodeid` INT NOT NULL,
  `title` VARCHAR(100) NOT NULL,
  `description` TEXT NULL,
  PRIMARY KEY (`serieid`, `seasonid`, `episodeid`),
  INDEX `fk_episode_season1_idx` (`seasonid` ASC),
  CONSTRAINT `fk_episode_serie1`
    FOREIGN KEY (`serieid`)
    REFERENCES `mydb`.`serie` (`serieid`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_episode_season1`
    FOREIGN KEY (`seasonid`)
    REFERENCES `mydb`.`season` (`seasonid`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

I don't know what the problem is, everything seems fine to me. Any help?
Created using MySQL Workbench.
Thanks

A: CREATE TABLE IF NOT EXISTS `mydb`.`episode` (
. . .
FOREIGN KEY (`seasonid`)
REFERENCES `mydb`.`season` (`seasonid`)

This foreign key is referencing a column that is not the left-most column in the season table's key.


text:
Q: Use case for mysql users depending on host What is the use case for having different passwords for the same username but different hosts on mariadb/mysql?
Is there a way to synchronized the password for the same username for different hosts?

A: Yes, just make 'user'@'%', except that it doesn't match 'localhost', so still have to make that one explicitly.


text:
Q: How to Redirect .NET Web Site to WordPress Site Seamlessly using Single Sign-On I'm working on a .NET web site that authenticates via usernames/passwords stored in a database. We have a separate site running on WordPress for documentation and FAQs. It needs to be protected from unauthorized users as well, but we want a single-sign-on solution. A link on the main site will take them to the WordPress site without the need to login again or to have separate username/logins for the WordPress site. What's the best way to achieve this?

A: Nicu, the author of Simple-JWT-Login, fixed the issue, so now that plug-in is compatible with Force Login. I receive a valid token and can redirect from our web site to our FAQ site even though the FAQ site is locked down with Force Login. Nico was responsive when I posted the problem. I highly recommend his plug-in. Easy to use and configure.


text:
Q: How to deal with big files containing lots of coordinates with OpenLayers v2.13? I have on OpenStreetMaps map with a vector layer containing all USA's states shapes.
These coordinates are stored in a MongoDB database, and when the user wants to display the map, my server (running under Node.js) computes a GeoJSON file with these coordinates and sends it to the client.
The problem I have is that this file can be very big (~20 Mo) because these shapes are very detailed so there are a lot of coordinates, even for one state.
Even when gzipped the file remains big (~3-5 Mo). I can't send such a big file, for bandwidth and Javascript memory considerations.
So I'm looking for a scenario that would allow me to send all these coordinates with a reasonable bandwidth and browser memory usage.
Any suggestions?
Thanks


text:
Q: Datatable search backspace trigger didnot work i am using data table  in modal.when i search then a close button open X (by clicking this button,input search text will be cleared). It works properly
the problem is that  when i click the close button,it hold the tbody view when i search.if click backspace in keyboard then it shows data initially.but i don't want to use keyboard.what i want is when i empty the search box,it will automatically shows the data initially.
i try to use backspace trigger n datatable draw but nothing worked...please help me .
when search

after clear the search box

my code for search empty using close button
$('div.dataTables_filter input').addClass('clearable');

  function tog(v){
    return v?'addClass':'removeClass';
  }
  $(document).on('div.dataTables_filter input', '.clearable', function(){

    $(this)[tog(this.value)]('x');

  }).on('mousemove', '.x', function( e ){

    $(this)[tog(this.offsetWidth-18 < e.clientX-this.getBoundingClientRect().left)]('onX');

  }).on('touchstart click', '.onX', function( ev ){

    ev.preventDefault();
  $(this).removeClass('x onX').val('').change();
  **//i try to add here backspace trigger code**

  });

A: datatable declare:
 var rtable = $('#table1').DataTable();

// ------CLEARABLE INPUT Code---------------------------------------
 $('div.dataTables_filter input').addClass('clearable');

  function tog(v){
    return v?'addClass':'removeClass';
  }
  $(document).on('div.dataTables_filter input', '.clearable', function(){

    $(this)[tog(this.value)]('x');

  }).on('mousemove', '.x', function( e ){

    $(this)[tog(this.offsetWidth-18 < e.clientX-this.getBoundingClientRect().left)]('onX');

  }).on('touchstart click change', '.onX', function( ev ){

    var temp =  $(this).removeClass('x onX').val('');

      console.log(temp.length);

      if(temp.length == 1){

          rtable
              .search( '' )
              .columns().search( '' )
              .draw();

        ptable.search('')
      .columns().search( '' )
      .draw();

      }

  });

in upper code i add  change that means on('touchstart click change'  instead of on('touchstart click'
var temp =  $(this).removeClass('x onX').val('');
      console.log(temp.length);

      if(temp.length == 1){

          rtable
              .search( '' )
              .columns().search( '' )
              .draw();

        ptable.search('')
      .columns().search( '' )
      .draw();

And for them who want to clear input in search.
css code
 .clearable{
          background: #fff url(data:image/gif;base64,R0lGODlhBwAHAIAAAP///5KSkiH5BAAAAAAALAAAAAAHAAcAAAIMTICmsGrIXnLxuDMLADs=) no-repeat right -10px center;
          border: 1px solid #999;
          padding: 3px 18px 3px 4px; /* Use the same right padding (18) in jQ! */
          border-radius: 3px;
          transition: background 0.4s;
        }
    .clearable.x  { background-position: right 5px center; }
    .clearable.onX{ cursor: pointer; }
    .clearable::-ms-clear {display: none; width:0; height:0;}


text:
Q: How to remove the hidden lines in a plot_wireframe via matplotlib? Does the matplotlib in python 2.x support hidden line removal?
How can I implement it myself?
This is a further question of another post solved here:
How to obtain 3D colored surface via Python?

A: I'm assuming that by "hidden" you mean lines that are behind surface patches in the view, e.g., behind "hills" in the plot.
Use plot_surface instead of plot_wireframe:

I used
plot_wireframe(X, Y, Z, rstride=10, cstride=10)

to create the first and
plot_surface(X, Y, Z, rstride=10, cstride=10, color="white", shade=False, edgecolor="blue")

to create the second plot.
If you want to combine this with colormapping the edges, you'll have to use some internals. If you use the cmap argument to colormap the surface faces, the source code for Poly3DCollection.do_3d_projection eventually calls to_rgba(self._A) to calculate face colors. Remap this to edge colors, and you're good to go:
surf = ax.plot_surface(X, Y, Z, rstride=2, cstride=2, shade=False, cmap="jet", linewidth=1)
surf.set_edgecolors(surf.to_rgba(surf._A))
surf.set_facecolors("white")

produces this plot:

(You might have to call set_edgecolors/set_facecolors again after the first render pass as do_3d_projection might override the values; I ran this in interactive mode and have not checked.)


text:
Q: Play Live Video Stream On Website I'am trying to make a website that only has a video player in it.
I currently have a softrware that streams video in HLS through a url, if i open the url in iphone with some HLS Player i can see the video.
What I'am trying to do is to publish the stream in all browsers(or some of them) with some video player
I'v tried jwplayer, but it doesnt stream my site, i tried jplayer but it doesnt do live streamin.
I basicly need a plyer that i can give it the url for example: http://someurl.com/Streaming/Live
and it will play the video.
Any help would be good.
Thanks.

A: You can't play HLS in website..
You must need format like RTMP or RTSP to play in website...
Try Wowza they provide the all formats for websites, mobiles etc.


text:
Q: Run Enterprise Application Client outside Netbeans I have followed the tutorial on this webpage: https://netbeans.org/kb/docs/javaee/entappclient.html
I want to run the enterprise application client outside of Netbeans.  Note that an Enterprise application client is different to a web client i.e. it is an application client.
I have tried executing the following commands:
set classpath=C:\GenieDevelopment\NetBeansProjects\RemoteInterface\EJBRemote\dist\EJBRmote.jar
cd C:\Program Files\glassfish-4.0\glassfish\bin
Appclient -client C:\NetBeansProjects\RemoteInterface\ClientTest\dist\ClientTest.jar
The error I get is:
Oct 04, 2016 7:59:32 PM org.glassfish.apf.impl.DefaultErrorHandler error
SEVERE: Class [ Ltest/TestEJBRemote; ] not found. Error while loading [ class cl
ienttest.Main ]
Exception in thread "main" java.lang.NoClassDefFoundError: test/TestEJBRemote
        at clienttest.Main.main(Main.java:24)
Caused by: java.lang.ClassNotFoundException: test.TestEJBRemote
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.glassfish.appclient.client.acc.ACCClassLoader.findClass(ACCClassL
oader.java:237)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more

What is the problem? The remote interface is in the classpath.

A: The classpath doesn't consider JAR files inside directories that you list. It'll use JAR files explicitly given in the classpath, and .class files in the directories you list; but not JAR files in the directories. If you want to get it to include JAR files in a directory, you'll need to use wildcards:
java -cp "EntAppClient.jar;C:\jardirectory\*" ...

That will include all files within that directory, and if those files are JARs, it'll pick them all up.
If you want to be able to build applications and then deploy and run them outside of your IDE, I strongly recommend using Maven to control your dependencies and allow you to build a fat JAR containing all the dependencies in one place. You'll save yourself a lot of headaches later on.

A: You need to run J2EE apps inside a webserver such as tomcat or glassfish or even Google AppEngine.  Usually you generate .WAR file that you upload to the web server.  In the case of tomcat you open http://localhost:8080/manager/html and then upload the .war file and then http://localhost:8080/myapp will show you your webapp.


text:
Q: What happens to properties after the final mission? What happens if I

 Kill Trevor or Michael in the final mission?

Will someone else inherit their property and cars or will it all be lost?

A: no-one gets anything
the money from the final mission is split if you

 kill trevor, but not by killing michael, as his family gets the money.

but cars properties all that, no-one else gets that.


text:
Q: Handle response in React with Axios In my company I am developing a React application starting from the project base used by the company.
In the app we manage the user login by calling an API that responds with an access_token, and it work well.
The access_token must therefore be saved on the browser's local storage.
I then configured the API and I make the authentication API request, and it answers me correctly with the authentication token, but it is not saved on the browser's local storage.
Do you have any suggestions or advice? Did I do something wrong or do I need to change the basic template of the project?
MyCode:

*

*auth.js

import api from "../api/axios";
import jwt_decode from "jwt-decode";
// Set all future requests to use the token.
const setToken = () => {
  const token = localStorage.getItem("token");
  if (token) {
    api.interceptors.request.use(
      async (config) => {
        config.headers = {
          Authorization: `Bearer ${token}`,
          "Content-Type": "application/json",
          useCredentials: true,
        };
        return config;
      },
      (error) => {
        Promise.reject(error);
      }
    );
  }
};

// Get new Token by API CALL.
const tokenAPICALL = async (user, pass) => {
  if (user && pass) {
    const { data } = await api.post(
      `/login`,
      {
        email: user,
        password: pass,
      },
      {
        method: 'POST',
        headers: {
          "Content-Type": "application/json; charset=UTF-8",
        },
      }
    ).then((response) => {
       console.log(response);
    }, (error) => {
      console.log(error);
    });

    const jwt_Token_decoded = jwt_decode(data.data.access_token);

    const expiryDate = jwt_Token_decoded.exp;
    if (jwt_Token_decoded.exp * 1000 > Date.now()) {
      localStorage.setItem("token", data.data.access_token);
      localStorage.setItem("token_exp", expiryDate);
    } else {
      console.log("failed token");
    }
    return data.data.access_token;
  }
  return null;
};

// Check the Token stored in Cookies.
const getToken = async (user, pass) => {
  const storedJwt = localStorage.getItem("token");
  const expiration = localStorage.getItem("token_exp");
  if (expiration && storedJwt) {
    if (expiration * 1000 > Date.now()) {
      console.log("Keep Token");
      setToken();
    } else {
      console.log("Expired Token");
      return await tokenAPICALL(user, pass);
    }
  } else {
    // No token recorder in session, Get new token
    console.log("No Token");
    return await tokenAPICALL(user, pass);
  }
};

export default getToken;

*

*EDIT: (More code to clarify)
LoginForm.js

import React, { useState } from "react";
import Avatar from '@material-ui/core/Avatar';
import Button from '@material-ui/core/Button';
import CssBaseline from '@material-ui/core/CssBaseline';
import TextField from '@material-ui/core/TextField';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
import Link from '@material-ui/core/Link';
import Grid from '@material-ui/core/Grid';
import Box from '@material-ui/core/Box';
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';
import Container from '@material-ui/core/Container';
import history from './../../history';
import getToken from "../../auth/auth";

function Copyright() {
  return (
    <Typography variant="body2" color="textSecondary" align="center">
      {'Copyright © '}
      <Link color="inherit" href="https://material-ui.com/">
        Your Website
      </Link>{' '}
      {new Date().getFullYear()}
      {'.'}
    </Typography>
  );
}

const useStyles = makeStyles((theme) => ({
  paper: {
    marginTop: theme.spacing(8),
    display: 'flex',
    flexDirection: 'column',
    alignItems: 'center',
  },
  avatar: {
    margin: theme.spacing(1),
    backgroundColor: theme.palette.secondary.main,
  },
  form: {
    width: '100%', // Fix IE 11 issue.
    marginTop: theme.spacing(1),
  },
  submit: {
    margin: theme.spacing(3, 0, 2),
  },
}));

export default function LoginPage() {
    const classes = useStyles();
    const [alertState, setAlertstate] = useState({
        open: false,
        vertical: "bottom",
        horizontal: "center",
        severity: "success",
        message: "",
    });
    const { vertical, horizontal, open, severity, message } = alertState;
    const [loginObj, setLoginObj] = useState({ username: "", password: "" });

    const handleSubmit = async (e) => {
        try {
            localStorage.clear();
            var jwtres = await getToken(loginObj.username, loginObj.password);

            if (jwtres) {
                setAlertstate({
                    open: true,
                    vertical: "bottom",
                    horizontal: "center",
                    message: "Login Successfully.",
                    severity: "success",
                });
                history.push("/dashboard");
            } else {
                setAlertstate({
                    open: true,
                    vertical: "bottom",
                    horizontal: "center",
                    message: "Login failed. Please try again.",
                    severity: "error",
                });
            }
        } catch (e) {
            setAlertstate({
                open: true,
                vertical: "bottom",
                horizontal: "center",
                message: "Invalid Data. Please try again.",
                severity: "error",
            });
        }
    };

  return (
    <Container component="main" maxWidth="xs">
      <CssBaseline />
      <div className={classes.paper}>
        <Avatar className={classes.avatar}>
          <LockOutlinedIcon />
        </Avatar>
        <Typography component="h1" variant="h5">
          Sign in
        </Typography>
        <form className={classes.form} noValidate>
          <TextField
            variant="outlined"
            margin="normal"
            required
            fullWidth
            id="email"
            label="Email Address"
            name="email"
            autoComplete="email"
            onChange={(e) => {
                setLoginObj({ ...loginObj, username: e.target.value });
            }}
            autoFocus
          />
          <TextField
            variant="outlined"
            margin="normal"
            required
            fullWidth
            name="password"
            label="Password"
            type="password"
            id="password"
            onChange={(e) => {
                setLoginObj({ ...loginObj, password: e.target.value });
            }}
            autoComplete="current-password"
          />
          <FormControlLabel
            control={<Checkbox value="remember" color="primary" />}
            label="Remember me"
          />
          <Button
            type="button"
            fullWidth
            variant="contained"
            color="primary"
            onClick={handleSubmit}
            className={classes.submit}
          >
            Sign In
          </Button>
          <Grid container>
            <Grid item xs>
              <Link href="#" variant="body2">
                Forgot password?
              </Link>
            </Grid>
            <Grid item>
              <Link href="/signup" variant="body2">
                {"Don't have an account? Sign Up"}
              </Link>
            </Grid>
          </Grid>
        </form>
      </div>
      <Box mt={8}>
        <Copyright />
      </Box>
    </Container>
  );
}

axios.js

import axios from 'axios';
import history from "../history";
const apiUrl = 'https://mysite/api/auth'; //your api base url
const proxyurl = "https://myproxy.io/fetch/"; //proxy for local testing, remove this in production version
function getHeader() {
    const token = localStorage.getItem("token");
    const expiration = localStorage.getItem("token_exp");
    if (expiration * 1000 < Date.now()) {
        history.push("/");
        return {
            "Content-Type": "application/json",
        };
    }
    if (token) {
        return {
            Authorization: `Bearer ${token}`,
            "Content-Type": "application/json",
            useCredentials: true,
        };
    } else {
        return {
            "Content-Type": "application/json",
        };
    }
}
const api = axios.create({
    baseURL: apiUrl,
    headers: getHeader(),
})

export default api;

A: You are mixing up async/await with promise handlers, use any one of them or remove the promise handlers (then, catch) from post call and it should work,
In current situation you won't be receiving data object, that's why you are facing this issue.

A: it is because in the tokenAPICALL you are consuming your api call promise with both await and .then() in that case your response will be logged to the console but then destructuring (const {data} = ...) won't work.
try this:

    const {data} = await api.post(
      `/login`,
      {
        email: user,
        password: pass,
      },
      {
        method: 'POST',
        headers: {
          "Content-Type": "application/json; charset=UTF-8",
        },
      }
    )


text:
Q: StaleElementReferenceError: stale element reference: element is not attached to the page document I have created a function in one of the protractor pages. On clicking the function takes me to the another page for which i have used require keyword.
this.naviagteToSwaggerOrReadme = function(str) {

  this.endpointDropdown.click();
  browser.sleep(2000);
  //element(by.partialLinkText('swagger/index.html')).click();
  element(
     by.className('popover ng-scope ng-isolate-scope bottom fade in')
  )
  .all(by.tagName('a')).then(function(obj) {

    console.log('Number of elements with the a tag in the parent element is ' + obj.length);

    for (let i = 0; i < obj.length; i++) {
      obj[i].getText().then(function(text) {
        console.log('The text on the link  is ' + text);
        var linkText = text;

        if (linkText.toLowerCase().indexOf(str) !== -1) {
          obj[i].click();
        } else {
          obj[i + 1].click();
        }
      })
    }

  });

  browser.sleep(5000);
  return require('./Swagger.js');
};

I am invoking the same function .
swagger = appsPageOne.naviagteToSwaggerOrReadme('swagger');
        swagger.getSwaggerTitle().then(function(title){
            console.log('This is the title '+title);
        })

But I am getting the error as :
 Message:
    Failed: stale element reference: element is not attached to the page document
      (Session info: chrome=74.0.3729.6)
      (Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.15063 x86_64)
  Stack:
    StaleElementReferenceError: stale element reference: element is not attached to the page document

A: *

*Read text of all found links via element.all().getText()

*Find out the index of matched link by comparing link's text with parameter: str

*Search all links again and click the matched one via element.all().get(index)

*Put return require('./Swagger.js'); inside then(), otherwise return statement executed prior to clicking on matched link.

Changed code as following:
this.naviagteToSwaggerOrReadme = function(str) {

  this.endpointDropdown.click();
  browser.sleep(2000);

  let links = element.all(
     by.css('.popover.ng-scope.ng-isolate-scope.bottom.fade.in a')
  )

  return links.getText().then(function(txts) {

    let size = txts.length;

    console.log('Number of elements with the a tag in the parent element is ' + size);

    let index = txts.findIndex(function(txt){
      return txt.toLowerCase().includes(str);
    });

    if(index === -1) {
      index = size - 1;
    }

    links.get(index).click();
    browser.sleep(5000);

    return require('./Swagger.js');
  });

};

naviagteToSwaggerOrReadme() return a promise, thus you need to consume the returned swagger in then()
appsPageOne.naviagteToSwaggerOrReadme('swagger').then(function(swagger){
  swagger.getSwaggerTitle().then(function(title){
      console.log('This is the title '+title);
  });
});


text:
Q: Does Angular need a web server to run? So would Angular work if I give browser a url of a local file? By this I mean I have read that Angular allows mock up data to be used so that RESTFul apis need not be wired up.  I can think of a use case where a UX designer need only look at the cosmetics and need not hook up to a web server.  I can think of other use cases as well.
So would Angular work is I give browser a url of a local file like C:\temp\index.html and the js files are either at c:\temp or say c:\temp\js.
So actually, I tried it, here is all in one application file (I know it should be separated)

My Note

<textarea ng-model="message" cols="40" rows="10"></textarea>

<button ng-click="save()">Save</button>
<button ng-click="clear()">Clear</button>

Number of characters left:

The results are, it works in Chrome and Firefox no problems, IE blocks content initially but one can allow it run.

A: Yes you can run a local file, but if you need data off a server, the browser should block it, depending on what version and type of browser you are running.
Here is the official Angularjs Tutorial explanation under the PhoneCat Tutorial App: Running the Development Web Server

While Angular applications are purely client-side code, and it is possible to open them in a web browser directly from the file system,
  it is better to serve them from an HTTP web server. In particular, for
  security reasons, most modern browsers will not allow JavaScript to
  make server requests if the page is loaded directly from the file
  system.

A: If you need to just display data using an expression like {{mymessage}} inside a div, you don't need a web server.
But if you need to load template html files uing ngview, you need a web server- otherwise it will complain with following error.

Request cannot load file. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

If laoding templates is needed for learning angularjs routing, I found a web server exe easy to use - HFS.  So far it meets my requirements for learning AngularJS.
References

*

*HFS:Introduction

*HTTP File Server

A: You cannot just access an angular application by the filepath on the local machine because you will get cross origin domain errors.
The solution is to install http-server (which requires node.js to be installed). This allows you to create a http-server local to your machine and will allow you to access the Angular application as if it were hosted online for development and test purposes.

A: So, the way I've done this is to create a temp service and just load that instead of from a url/file.
Example:
//tempUser.js
angular.module("app").constant("tempUser", {
    firstname : "Joe",
    lastname : "Smith"
});

//userService.js
angular.module("app").factory("userService", function ($q, tempUser) {
    return {
        load : load
    };

    function load(id) {
        //TODO: finish impl
        return $q.when(tempUser);
    }
});

This way the controller can still work as if you were loading from a web service.
angular.module("app").controller("UserDetailCtrl", function (userService) {
    userService.load().then(function (user) {
        $scope.user = user;
    });
});

A: As others have said, it's best to serve properly as http. However, there are other workarounds.
Some editors, like Brackets (click on the lightning bolt in the top right corner while in a file), can serve the code to your browser properly. For others there might be plugins that do it.

Update: My suggestion below worked well enough for AngularJS 1, but just FYI is insufficient for Angular 2. Also see Disable same origin policy in Chrome

Further, if you're on Chrome you can run it with flags, which means you add some stuff at behind the .exe part of the path on a short cut; options if you will. Specifically you'd want:
--allow-file-access-from-files --allow-file-access --allow-cross-origin-auth-prompt

That makes it not throw errors when trying to access files from various origins. There was a plugin for that once, but I couldn't get it to work. Note there's security reaosns why this isn't the default, so maybe don't put it on your main short cut that you use all the time for surfing... - Use at own risk.


text:
Q: PowerShell copy random files I am trying to copy 7 random .txt files to a different location, but sub-folders get copied instead of the .txt files.
Here is my script:
$d = @(gci G:\Users\Public\Test) | resolve-path |  get-random -count 2
$d | gci | get-random -count 7
Copy-Item $d  -destination G:\Users\Public\Videos

What do I need to change?

A: One possible solution might be to use the PSIsContainer attribute to filter out folders.
I tried the following...
$d = gci "C:\Work\a\*.txt" | Where {$_.psIsContainer -eq $false}| resolve-path  |  get-random -count 7
Copy-Item $d  -destination C:\Work\b

The where clause filtered out anything that was not a "container" and ignored the test folders I had set up. If you need .txt files specifically then use the wildcard included in the path as above.
Also, if you were to add -recurse then it would presumably search in all sub folders of your original search location and still filter out any "folders" for copying. Though I haven't tested this very thoroughly.
$d = gci "C:\Work\a\*.txt" -recurse | Where {$_.psIsContainer -eq $false}| resolve-path  |  get-random -count 7


text:
Q: Editing default translations files I have edited some translations in my multi language e-commerce site.
In particular, I want to change some words in the English version site. In the homepage there is a menu which contains word BAG: I want to translate BAG to SHOPPING BAG.
Translations files are contained in two folders:

*

*app\locale\en_US : where there are lot of translations files with different names.

*app\design\frontend\enterprise\tName\locale\en_US : where there are only two csv files: translate.csv and alp.csv.

I edited every translations file adding in the csv file the string

"Bag","Shopping bag"

But this editing is not shown in the fronted site.
What files should I change to achieve my goal ? Why can't I see any changes ?

A: Firstly I would check to see your locale settings for the store. You can check this under System -> Configuration -> General -> General, then the Locale Options -> Locale field.
Assuming you are using "United States" as your locale for your store I would clear the translations and block caches as any changes you make to those translate.csv files won't appear until the cache is cleared.
If at this point they are not appearing I would check that your theme is not using a different theme for translations under System -> Configuration -> General-> Design, then Themes -> Translations field.
Another possibility could be that their maybe inline (database) translations. This would have higher priority over module (app/locale) or theme translations (package/theme/locale/) files as Magento gives inline translations the highest priority.
You can turn on inline translations by going to System -> Configuration -> Advanced -> Developer, then setting Translate Inline -> "Enable for frontend" to "Yes" and clearing the Magento cache and then viewing your Magento store (shouldn't be done on live unless you add your IP to Developer Restrictions on the same configuration page) you should see red dotted line around the text you can edit and when you hover you should see a book icon which you can click to edit and then save the text.
You can read more about translations on how they work here - http://blog.belvg.com/magento-certified-developer-exam-internationalization.html

A: To change any category Name Translation
You have to go for Manage Categories => choose your store => choose category what you want to change => Change Category Name =>save


text:
Q: Executing JS function from webpage in iOS I'm making an iOS app that gets content from a website. This website allows to vote for content through a JS script that is called when a link is clicked in the web page.
I would like to implement voting in my app without having to show the webpage to the user and asking im to click on vote.
I know it is possible to execute a javascript function of a UIWebView using
[myWebView stringByEvaluatingJavaScriptFromString:@"myJSFunction()"]

But loading a UIWebView is a bit long, specially since it's just to vote (should be fast), isn't there an easier way to just call for the JS function without requiring user interarction (except taping the vote button in the app, of course)
Thanks !

A: On iOS that function is the only way to execute a JS function.
Are you talking about using a native UI to enter some vote info, but processing the info gets done by the JS?
It depends upon what the JS is doing i.e. if its interacting with the dom etc., but you may not necessarily have to wait for the UIWebView to have finished downloading/loading/rendering the web page before you can call stringByEvaluatingJavaScriptFromString. The JS maybe ready to use immediatly in which case you can call stringByEvaluatingJavaScriptFromString before waiting for webViewDidFinishLoad gets called?


text:
Q: The charge of an electron is a constant. In any case? Since Millikan it is obvious that the charge of the electron can be measured as a result of the force exerted by an external electric field. What we get in detail is the charge from the excess of electrons in a water or oil droplet.
I wonder why we are so convinced that a free electron does not lose part of its charge on its way to the nucleus, on its way to a bound electron.
I am fully aware that the direct measurement of charge reduction is impossible, isn't it? Take it, if you want, as a subquestion.
The implication that electrons partially lose their charge has some consequences that fall into the realm of observable physics.

*

*applied to the electron, the proton must exhibit the same behaviour A free proton has the charge +1. The proton that is bound in the nucleus does not. This makes the strong force obsolete or worth considering.

*an electron without kinetic energy, captured by an ion, loses energy on the way to a bound electron. Where does the energy come from? From the electric field of the electron, which weakens.

My question: What are the inconsistencies of a hypothesis of the charge loss of a bound electron?
And please just this once, for some of you, stay away from the impulsive reaction that this is not mainstream physics. Physics is a living science, not a collection of truth theories.

Edit after Johns answer

The energy levels of the hydrogen atom are calculated for a constant negative charge on the electron and constant positive charge on the proton. If the charges were to decrease (keeping the total charge zero) the energy levels would differ from those calculated (and observed).

To do so, the approach is that the charge has a potential energy value from infinity to the point it is away from the nucleus? With the one hand we apply energy and with the other we take energy away by the emission of photons.
Full aware what I was doing, I wrote in the question that even an electron in rest, near the nucleus, will "fall" to it with the release of EM radiation. This couldn't be the claimed potential energy from infinity nor kinetic energy. It is taken from the electron itself, its mass or/and its field.
Maybe that is semantic. But the consequence lays in the need or not-need of the strong force. It lays in the understanding, why the electron-proton interaction is stable at the end and quantized for stimulated states. And why the particle-antiparticle annihilation happens.

Edit after sinteticos comment

the photon has no charge, so emitting or absorbing a photon do not change the charge

@sintetico, yes, the photon does not has charge. But the e and the p have, and they have opposite charges. Furthermore, they have (measured, really real) magnetic fields.
The photon, in turn, has a swelling electric and magnetic field component. How this does not mach the robbery of some field strength from e and p to the energy quant?

One more addition to Johns profound answer

In quantum field theory the object that we call the electron is strictly defined only in the limiting case where is isolated from all other particles. In this case it is represented by a Fock state of the field and this state has the charge −. However a bound electron is not a Fock state. In fact we don't have a simple description of this state but we can approximate it as a sum of Fock states and it is these extra states in the sum that represent the virtual particles.

What the reduced electric charge idea claims is the not-need of virtual photons. It changes the claimed sum of Fock states for the not simple descriptionable states by a simpler model. Let the model be not right, but it is worth to calculate it first, and then throw it away. For the beginning, what are the inconsistencies and - again and again - not the implications to the existing theories?

A: The energy levels of the hydrogen atom are calculated for a constant negative charge on the electron and constant positive charge on the proton. If the charges were to decrease (keeping the total charge zero) the energy levels would differ from those calculated (and observed).
More generally, assuming that you accept quantum field theory as a good description of fundamental particles, the charge is a property of the quantum field. The reason electrons all have the same charge is because they are excitations of the same quantum field. There is no mechanism in quantum field theory for the charge of an electron to change depending on whether it is bound into an atom or not.
There is a sense in which it could be argued that the charge in a hydrogen atom does change, and it is along the lines of the mechanism you suggest, though it is not simply that an electron charge changes as it approaches the proton. In quantum field theory the object that we call the electron is strictly defined only in the limiting case where is isolated from all other particles. In this case it is represented by a Fock state of the field and this state has the charge $-e$. However a bound electron is not a Fock state. In fact we don't have a simple description of this state but we can approximate it as a sum of Fock states and it is these extra states in the sum that represent the virtual particles.
The point of this is that in the atom there will be virtual electron positron pairs present, and if we are adding the modulus of the charges these will change the total. This is a very small effect in a hydrogen atom because the binding energy is tiny compared to the rest mass of the electron and positron, but it does mean the average number of electrons differs from one by a tiny amount. That means the total amount of negative charge present differs from $-e$ by a tiny amount (the net charge remains unchanged due to the positive charge of the virtual positrons).
But does this mean the charge of the electron changes as it is bound into a hydrogen atom? I think this is largely semantic, though my answer would be no since strictly speaking the object bound into the hydrogen atom is slightly different from a free electron.

A: There are many experimental proofs since the Milican oil drop. Electron trajectories are measured with great accuracy in electron ( and positron) beams. The accuracy depends on the charge of the electron which does not change no matter how many kilometers the colliders are.
It would come out as an apparent nonconservation of energy in the results.
The LEP experiments which established the standard model would have completely different results, too.


text:
Q: How can I specify a different style for (a difficult to describe concretely) part of a line? I'm in the following situation: Using TikZ, I have drawn a curve which is fairly simply described:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        node[pos=0,anchor=west]{-1}
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        node[pos=1,anchor=west]{0}
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
        node[pos=1,anchor=west]{1};
\end{tikzpicture}
\end{document}

However, now I'd like to specify a different style for part of this curve; It happens that the part of this curve I'd like to do something special with is not easily described explicitly. In this particular case, I'd like to apply the style [(-),thick,red] to some arbitrary segment of the curve. I'm looking for an efficient and simple way to do just that.
I was hoping that there might be an option to do something along the lines of \draw[only between 0.2 and 0.8] "curve description", but I'm not aware of any such possibilities.
For extra concreteness, here is a (Paint-made) picture of something like what I'm looking for:

A: You could try something like this (I don't know if one can combine both decorations in own style):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations}
\usetikzlibrary{decorations.markings,}

\begin{document}
\begin{tikzpicture}
\draw[postaction={decorate,
                  decoration={markings,
                              mark= at position  5cm with {\arrow[red,thick]{Bar};},
                              mark= at position -2cm with {\arrow[red,thick]{Bar};}}}]
  (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        node[pos=0,anchor=west]{-1}
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        node[pos=1,anchor=west]{0}
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
        node[pos=1,anchor=west]{1};

\path[postaction={decorate,solid,red,draw,thick,
                  decoration={curveto,
                               pre=moveto,pre length=5cm,
                               post=moveto,post length=2cm},
                  }
     ]
  (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
    ;

 \end{tikzpicture}

\end{document}

A: I have shamelessly stolen a considerable part of Ulrike Fischer's answer to illustrate how to specify the ends of the markings using fractions of the path. The basic trick is to multiply fractions by \pgfdecorationpathlength (for decorations) or \pgfmetadecorationpathlength for (meta-decorations) to obtain a length.
In this case I have scaled the fractions first so they fit the range -1 to 1 which matches the node markings. In addition, I have tied everything up in a (not very versatile) style so everything can be done in a single path:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations.markings}
\tikzset{mark path between/.style args={#1 and #2}{
  postaction={%
   decorate,
   decoration={markings,
     mark=at position  (#1/2+.5)*\pgfdecoratedpathlength with
       {\arrow[red,thick]{Bar};},
     mark=at position (#2/2+.5)*\pgfdecoratedpathlength with
       {\arrow[red,thick]{Bar};}}},
  postaction={decorate,
    solid, red, draw, thick,
    decoration={curveto,
      pre=moveto,pre length=(#1/2+.5)*\pgfmetadecoratedpathlength,
      post=moveto,post length=((-#2)/2+.5)*\pgfmetadecoratedpathlength}}
}}
\begin{document}
\begin{tikzpicture}
\draw [mark path between=-0.25 and 0.5]
  (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
    node[pos=0,anchor=west]{-1}
      .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
    node[pos=1,anchor=west]{0}
      .. controls (1,3.25) and (-1,3.25) .. (-1,3)
      .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
    node[pos=1,anchor=west]{1};
 \end{tikzpicture}
\end{document}

A: Specifically for the arrows, you can use the decorations.markings library with, if desired, arrows.meta for enhanced tip options.
These can be added as single markings or in stepwise fashion. You can measure in absolute units (e.g. 5mm) or as a fraction of path length (e.g. 0.5) and from the start of the path (e.g. 0.6) or from the end (e.g. -0.4). However, they must be added in the order in which they will occur on the path i.e. in the order which they would intuitively be drawn if you walked the path from start to end to add them.
This example illustrates some of the available options:
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{decorations.markings,arrows.meta}
\begin{document}
\begin{tikzpicture}
  \draw [
    postaction=decorate,
    decoration={
      markings,
      mark=at position .1 with {\arrow[red]{<}},
      mark=at position .2 with {\arrow[red]{>}},
      mark=between positions .5 and .7 step .025 with {\arrowreversed[blue]{Stealth[]}},
    }
  ] (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        node[pos=0,anchor=west]{-1}
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        node[pos=1,anchor=west]{0}
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
        node[pos=1,anchor=west]{1};
\end{tikzpicture}
\end{document}

You can apply whatever options you wish to the arrow tips e.g. thick.
If you wish, you can also add something to simulate the line, although I think the plotting solution is probably preferable. For example:

\begin{tikzpicture}
  \draw [
    postaction={decorate},
    decoration={
      markings,
      mark=at position .1 with {\arrowreversed[red,thick,xshift=-5pt]{Triangle[length=5pt]}},
      mark=between positions .1 and .2 step .4pt with {\draw [fill,red] circle (.4pt);},
      mark=at position .2 with {\arrow[red,thick,xshift=5pt]{Triangle[length=5pt]}},
      mark=at position .275 with {\arrow[green,thick,xshift=2.5pt]{<}},
      mark=between positions .275 and .375 step .4pt with {\draw [fill,green] circle (.4pt);},
      mark=at position .375 with {\arrow[green,thick,xshift=1pt]{>}},
      mark=between positions .5 and .7 step .025 with {\arrowreversed[blue,thick]{Stealth[]}},
    }
  ] (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        node[pos=0,anchor=west]{-1}
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        node[pos=1,anchor=west]{0}
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
        node[pos=1,anchor=west]{1};
\end{tikzpicture}

A: If you place enough coordinates along the original line, you can reproduce it accurately.
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\newcommand{\somelist}{}% reserve global name
\begin{document}
\begin{tikzpicture}
\draw (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        foreach \i in {0,1,...,10} {coordinate[pos={.4+.03*\i}] (P\i)}
        node[pos=0,anchor=west]{-1}
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        node[pos=1,anchor=west]{0}
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
        node[pos=1,anchor=west]{1};
\xdef\somelist{(P0)}
\foreach \i in {1,...,10} {\xdef\somelist{\somelist (P\i)}}
\draw[<->,red] plot[smooth] coordinates{\somelist};
\end{tikzpicture}
\end{document}

A: For comparison, here is a Metapost solution. One can simplify the user interface by defining macros, but I haven't done that.
\starttext
\startMPpage[offset=2mm]
  path p,q;
  numeric n, m[];

  p :=  (1,1.5) .. controls (1,2.25) and (-1,2.25) .. (-1,2)
        .. controls (-1,1.75) and (1,1.75) .. (1,2.5)
        .. controls (1,3.25) and (-1,3.25) .. (-1,3)
        .. controls (-1,2.75) and (1,2.75) .. (1,3.5)
    ;
  q := (0,-0.1) -- (0,0.1);

  p := p scaled 1cm;
  q := q scaled 1cm;

  n = length(p); % Total "time" of the path
  m[1] := 0.2*n; % Value of 0.2 fraction of time
  m[2] := 0.8*n; % Value of 0.8 fraction of time

  % Draw the path in three segments
  draw subpath (0, m[1]) of p ;
  draw subpath (m[1], m[2]) of p withcolor red;
  draw subpath (m[2], n) of p;

  % Draw the decoration
  draw (q rotated (angle direction m[1] of p)) shifted (point m[1] of p)
       withcolor red;
  draw (q rotated (angle direction m[2] of p)) shifted (point m[2] of p)
       withcolor red;

\stopMPpage
\stoptext

which gives


text:
Q: Magento2 Forbidden You don't have permission to access / on this server I think i messed up the whole permissions for my website and now when i try to acces it i get this message:

Forbidden You don't have permission to access / on this server.

Some folder have the permision 0000 and in ftp they appear with flcmdpe instead of rwxr-xr-x
Does any of you know how can i set my permissions back to normal so i can see the website again, please? Thanks!

A: you can refer http://devdocs.magento.com/
The important things:
The owner of the Magento file system: Must have full control (read/write/execute) of all files and directories.
Must not be the web server user; it should be a different user.
The web server user must have write access to the following files and directories: var app/etc pub (and probably new in 2.2.1:) generated
In addition, the web server's group must own the Magento file system so that the Magento user (who is in the group) can share access to files with the web server user. (This includes files created by the Magento Admin or other web-based utilities.)
We recommend setting the permissions as follows:
All directories have 770 permissions.

770 permissions give full control (that is, read/write/execute) to the owner and to the group and no permissions to anyone else.

All files have 660 permissions.

660 permissions mean the owner and the group can read and write but other    users have no permissions.

You should set as bellow recommended
    cd <your Magento install dir>

    find . -type f -exec chmod 644 {} \;                        // 644 permission for files

    find . -type d -exec chmod 755 {} \;                        // 755 permission for directory

    find ./var -type d -exec chmod 777 {} \;                // 777 permission for var folder

    find ./pub/media -type d -exec chmod 777 {} \;

    find ./pub/static -type d -exec chmod 777 {} \;

    chmod 777 ./app/etc

    chmod 644 ./app/etc/*.xml

    chown -R :<web server group> .

    chmod u+x bin/magento

I hope this will help you.

A: Follow these permission guide from magento
https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html

A: its a good practice to have folders with 755 and files with 644 permission.
and sensitive files should be 700.
You need to use chmod 755 instead of 750 on directories. Using 750 equates to users having read, write, and execute, groups having read and execute, and finally, world (i.e your visitors) having absolutely zero access, thus they will be forbidden from accessing and/or viewing the contents.


text:
Q: How do i cast a string type to a class type ? here is the ERROR MESSAGE:- Unable to cast object of type 'System.String' to type 'query' How do i cast a sting type to another type?
i have tried different options but when i run the application it throws an error message
//first code
       public static Xxl.Query QueryBySize(string SizeNo)
        {
            Query result = new Query();
            result.SizeInfo.SizeCode = "Xxl";
            Xxl.Query result1 = new Xxl.Query()
            {
                SIZE = SizeNo
            };

            JsonSerializerOptions options = new JsonSerializerOptions
            {
                IgnoreNullValues = true
            };
            string str = JsonSerializer.Serialize<Xxl.Query>(result1, options);
            Console.WriteLine("Retrieved Details: " + str);
            byte[] bytes = Encoding.UTF8.GetBytes(str);
            result.Data.Content = Convert.ToBase64String(bytes);
            Xxl.Query xxl = (Xxl.Query)QueryRequest(result );

            return xxl;
        }
//second code from another file Name:  Xxl.cs

   public class Query
    {
        [JsonPropertyName("itemName")]
        public ItemName ItemName { get; set; }

        [JsonPropertyName("result")]
        public string Result { get; set; }

        public Query()
        {
            ItemName = new ItemName();
        }
    }

How do i go about it?

A:
How do i cast a sting type to another type?

You don't.  Because a string and a Query are fundamentally different things.  But you can construct a Query using a string for its one string property.  For example:
new Query { Result = someString }

This is something you already do on the third line of your method.  (Though apparently with a different Query?)  Just repeat that same logic any time you want to build a Query using a string.


text:
Q: MPCHART YAxis are showing incorrect labels
My MPCHART of the YAxis labels are not fitting according to arraylist i provided and doesn't allign with the stacked horizontal bar chart?

shift Labels are not showing and not aligning with the horizontal stacked  bar chart

    chart.getDescription().setEnabled(false);
    chart.setNoDataText("No data available here !");
    chart.setMaxVisibleValueCount(40);
    chart.setPinchZoom(false);
    chart.setDoubleTapToZoomEnabled(false);

    chart.setDrawGridBackground(false);
    chart.setDrawBarShadow(false);

    chart.setDrawValueAboveBar(false);
    chart.setHighlightFullBarEnabled(false);

    // change the position of the y-labels
    chart.getAxisLeft().setEnabled(false);
    YAxis rightAxis = chart.getAxisRight();
    rightAxis.setEnabled(true);
    rightAxis.setDrawGridLines(false);
    rightAxis.setTypeface(Utils.setFont(SingleEquipmentDashboard.this));
    rightAxis.setLabelCount(arrayListHour.size());
    rightAxis.setGranularity(1f);

getFromTime contains utc time which is converted to float time

    if (data.getCurrentShiftDowntimes().size() > 0) {
        float temp = Utils.getShiftChartTime("", data.getCurrentShiftDowntimes().get(0).getFromTime());
        if (temp > 0) {
            rightAxis.calculate(temp, chart.getYMax() + temp);
            chart.setVisibleYRangeMaximum(temp, YAxis.AxisDependency.RIGHT);
        }
    }

The MAIN problem is there that the values are not formatted to the right position

    rightAxis.setValueFormatter(new ValueFormatter() {
        @Override
        public String getFormattedValue(float value) {
            if (value <= -1) {
                /*Display positive Hours number in Previous date chart*/
                value = 24 + value;
            }
            if (value >= 24) {
                value = value - 24;
            }

            return String.format("%02d", (int) value);
        }
    });
    chart.getXAxis().setEnabled(false);
    Legend l = chart.getLegend();
    l.setEnabled(false);
    chart.invalidate();

A:
You can Use set value formatted as Below

rightAxis.setValueFormatter(new IndexAxisValueFormatter(youraArrayListAsLabels));


text:
Q: group correlate items in python list of lists I have a list of lists of the following form:
list = [ [['item1'], ['property1','property2','property3']], [['item2'],['property1', 'property4']], ..., [['itemN'],['property5']]]

I want to construct another list of lists with all the above items grouped together with those they share at least one property with. E.g.:
new_list = [['item1','item2'], .., ['itemN']]

Note that items should be grouped together even if they share properties indirectly. If e.g. item1 has a common property with item2 that has a common property with item3 and item1 does not share any properties with item3 they should be still all grouped together.
My try has been with an added boolean to the original list (so that I do not re-iterate if not needed) and with the function below:
list = [ [['item1'], ['property1','property2','property3'], True], [['item2'],['property1', 'property4'], True], [['itemN'],['property5'], True]]

def group_correlates(list):
    result = []
    for i, entry in enumerate(list):
        correlates = []
        items = entry[0]
        properties = entry[1]
        if entry[2]: # if not already grouped (True)
            correlates.append(items)
        for j, other_entry in enumerate(list):
            flag = other_entry[2]
            if not i == j:
                if flag:
                    other_properties = other_entry[1]
                    other_items = other_entry[0]
                    for property in properties:
                        if property in other_properties:
                            other_entry[2] = False # do not visit again
                            correlates.append(other_items)
                            result.append(correlates)
    return result

but I get this:
[[['item1'], ['item2']], [['item1']]]

An even if I could do it this way, I am sure there is a much more elegant way to accomplish the same

A: Why not using a dict then using groupby from itertools module ?
This is an example of how you can do it:
from itertools import groupby

data = [[['item1'], ['property1','property2','property3']], [['item2'],['property1', 'property4']], [['itemN'],['property5']]]

aa = {}
for k, v in data:
    for j in v:
        try:
            aa[j] += k
        except KeyError:
            aa[j] = k

new_list = [k for k,_ in groupby(sorted(aa.values()), lambda x: x)]
print(new_list)

Or, you can use defaultdict from collections module:
from collections import defaultdict
from itertools import groupby

data = [[['item1'], ['property1','property2','property3']], [['item2'],['property1', 'property4']], [['itemN'],['property5']]]

bb = defaultdict(None)

for k, v in data:
    for j in v:
        bb[j] = k

new_list = [k for k,_ in groupby(sorted(bb.values()), lambda x: x)]
print(new_list)

Both will output:
[['item1', 'item2'], ['item2'], ['itemN']]

A: First convert your list to a dictionary as mentioned.
list1 = [ [['item1'], ['property1','property2','property3']],
          [['item2'], ['property1', 'property4']],
          [['item3'], ['property5', 'property6']]
        ]

dict1 = {item[0][0]: item[1] for item in list1}

Then:
new_list = []

for key in dict1:
    target = dict1[key]
    for k, v in dict1.items():
        if k != key and len(set(target).intersection(set(v))) != 0:
            new_list.append([key, k])
    new_list = [sorted(i) for i in new_list] # sort sublists
    new_list = [list(t) for t in set(map(tuple, new_list))] # remove dupes

flat = [item for sublist in new_list for item in sublist] # flatten list
unique = list(set(dict1.keys()).difference(set(flat)))
new_list.append(unique) # add unique keys

new_list
Out[76]: [['item1', 'item2'], ['item3']]

A: "Bipartite" is mainly nomenclature.  The main point is that you're finding sub-graphs that are connected.
Put all of your nested lists into an "open" list ... you need to process everything in this list.  When it's empty, you're done.
Start a new list of sub-graphs -- this is the "list of lists" you mentioned.
Initialize an item list and a properties list to empty lists.
Pick an item and put it into a sub-graph list.  Now, alternate between properties and items until nothing gets added:

*

*For each new item you just added (only that initial one the first time), add (to the properties list) all properties of that item.  Keep a list of which properties are new to the properties list.

*Delete those items (and their properties) from your "open" list.

*For each property just added, add (to the items list) each item that has that property.  Keep a list of the items just added.

*Repeat steps 1-3 until nothing new is added.

At this point, the items list and properties list described a closed sub-graph.  Add the pair to your master list of sub-graphs.
Go back, reset your items and properties lists to empty lists, and start with a new initial item.  Continue this until you've exhausted all items.  The "open" list is now empty; all items and properties are now represented in the sub-graphs list.


text:
Q: How to differentiate between a user as an authentication object and a user as an application object? I need some advice regarding the architecture of an application with some social media functions.
Up ahead, I've searched the internet, but haven't found any helpful. Maybe there are some good examples somewhere in the literature on software architecture, and if so, I would be very happy to hear about them.
The goal is to have an application that has one single entity for users with an associated repository. However, there are two fundamentally different scenarios in which a user is requested from the repository:

*

*The security component of the application must fetch the user as authentication data object during the authentication process. In this case, only email (and or username) and password and roles are required.

*An application component requests users as data objects for the purpose of further user information like favorite books, hobbies or cake recipes. In this case, for example, it is not necessary to pass around passwords and other sensitive data.

So my idea would be to implement two different DTOs, an AuthUserDto for the authentication process and a standard UserDto for everything else. This would logically also imply to implement two Services, an AuthUserService and a normal UserService. And to follow the rules of software architecture I know, we would implement two corresponding service interfaces.
And last but not least, the application should also get a UserContextService. To stay true to the naming convention I have used so far, this context service should be called AuthUserContextService, since it is responsible for authentication issues like getCurrentUser() or setCurrentUser().
So in the end the application structure would look something like this:
Application.java
│
├───dto
│   │
│   ├───mapper
│   │       RoleMapper.java
│   │       UserMapper.java
│   │
│   └───model
│           AuthUserDto.java
│           RoleDto.java
│           UserDto.java
│
├───entity
│       Role.java
│       User.java
│
├───repository
│       RoleRepository.java
│       UserRepository.java
│
├───service
│   │   DefaultAuthUserContextService.java
│   │   DefaultAuthUserService.java
│   │   DefaultUserService.java
│   │
│   └───interfaces
│           AuthUserContextService.java
│           AuthUserService.java
│           UserService.java

*

*When the security component requests a user from the DefaultAuthUserService, an AuthUserDto is delivered.

*When the security component wants to get or set a user with the help of the DefaultAuthUserContextService, we're dealing with an AuthUserDto.

*When a social media component requests a user from the DefaultUserService, a UserDto is delivered.

What I am asking now:
Is this approach ok, is there a best practice guide for this or is there a completely different and better way to handle the user entity in a usecase specific way?
Many thanks for any help, links and hints to accomplish a decent base architecture.

A: This solution looks good to me overall.
There are still some challenging parts left:

*

*ACLs/roles: make sure you separate Authentication and Authorization, and store authentication credentials (login/email/password) in a dedicated table. It'll make your life way easier if you decide to add login with social networks in the future (you'll add a new authentication table and update the authentication code. The authorization code will stay the same). Authentication vs Authorization.

*Sessions: when your users logged in using username/email/password, you'll have to "remember" them by storing some "session" token in their cookies. There are many libraries and solutions for this problem. My favourite approach is using JSON Web Tokens. If used wisely, they can improve app performance significantly and reduce session management pain (especially when you have multiple backends/databases in different regions).

*Storing passwords: simple yet complicated part. The best practice is to store them using a strong hashing algorithm designed for it (like Bcrypt or Argon2id). Each password should have an individual salt. PHP has a special function which takes care of everything, Java should have something similar.

It's all I remember for now. :) Feel free to ping me in comments if you need more details about anything :)
PS the article for Authentication vs. Authorization is quite long, I'll copy the main idea here:

The best way to illustrate the differences between the two terms is with a simple example. Let's say you decide to go and visit a friend's home. On arrival, you knock on the door, and your friend opens it. She recognizes you (authentication) and greets you. As your friend has authenticated you, she is now comfortable letting you into her home. However, based on your relationship, there are certain things you can do and others you cannot (authorization). For example, you may enter the kitchen area, but you cannot go into her private office. In other words, you have the authorization to enter the kitchen, but access to her private office is prohibited.


text: Q: If $\bigwedge^n V=0$, what can we say about the dimension of the vector space $V$ over an algebraically closed field $\mathbb{k}$? The question is this: if the wedge product $\bigwedge^n V=0$, what can we say about the dimension of the vector space $V$? Because $\bigwedge^n V=0$ for all $n>d$, where $\dim V=d<\infty$; but in the first case I don't know what to say. Thanks for your help!


text:
Q: How to get 4x4 matrix from integrating column vector and its transpose? This is from Finite Element Methods. Part of potential energy approach. Can someone show me how to come to this symetric matrix:
$$ [K]=EI/L^3\begin{bmatrix}
12&6L&-12&6L\\
&4L^2&-6L&2L^2\\
& & 12&-6L\\
&&&4L^2
\end{bmatrix} $$
EI - constant
Using this equation:
$$ [K]=EI\int_0^L {[B]^T [B]}dx $$
Given:
$[B]=  \begin{bmatrix}
    \frac{12x-6L}{L^3} & \frac{6xL-4L^2}{L^3} & \frac{-12x+6L}{L^3} & \frac{6xL-2L^2}{L^3}\\
    \end{bmatrix}$

I don't understand how I can have a 4x4 matrix when multiplying vector and its transpose gives me a scalar.
Here is what I have so far:
$$[B]^T[B]=\frac{144x^2-144xL+36L}{L^6}+\frac{36x^2L^2-48xL^3+16L^4}{L^6}+\frac{144x^2-144xl+36L}{L^6}+\frac{36x^2L^2-24xL^3+4L^4}{L^6}=$$
$$=\frac{1}{L^6}(288x^2+24x^2L^2-288xL-72xL^3+72xL^3+72L+20L^4)$$
$$ EI\int_0^L {[B]^T [B]}dx =$$
$$=\frac{EI}{L^6}(96x^3+24x^3L^2-144x^2L-36x^2L^3+72xL+20xL^4)_0^L=$$
$$=EI(\frac{-48}{L^3}+\frac{8}{L}+\frac{72}{L^4})$$
And I got scalar. Not a 4x4 matrix.
Thank you in advance!

A: As is written, $[B]$ is a row vector. Then $[B]^T$ is a column vector. So, $[B]^T[B]$ is of the form
$$\pmatrix{b_1\\ b_2\\ \vdots\\ b_n}\pmatrix{b_1&b_2&\dots&b_n}=\pmatrix{{b_1}^2&b_1b_2&\dots\\ \vdots & \ddots \\ b_nb_1&\dots & {b_n}^2}$$


text:
Q: When the tensile force is equal to the weight of the body I have met a lot of problems where the tensile force is different from $mg$, while in this one problem in the solutions it is written only that the tensile force is equal to mg. So if someone has time to explain to me when the tensile force is equal to $mg$, I would be grateful.

edit: I forgot to add that the mass m2 is moving upwards by the tensile force caused by m3.

A: In simple word the tensile force is equal to weight of body only if the string has negligible weight, means it's light and moreover it should be continuous if these two conditions met then tensile force is equal to mg

A: For any body whatsoever in 2 Dimensions, all three of the following equations must hold true:
$$\Sigma F_x = ma_x$$
$$\Sigma F_y = ma_y$$
$$\Sigma M_z = I \alpha_z$$
Or in other words, "Sum of the x-direction forces on the body equals the mass times acceleration in the x direction"...."Sum of the y-direction forces on the body equals the mass times acceleration in the y direction"...."Sum of the z-direction moments on the body (around a particular point chosen) equals the moment of intertia times angular acceleration in the z direction."
For your example, you can ignore the moments equation.* Your task now is to draw a free body diagram for each of the 3 blocks in isolation, and write out the $F_x$ and $F_y$ equations.  This will be the set of equations you use to find all your unknowns.
This should be your general approach to any rigid body mechanics problem.  Rules like "Tension = mg" are not always true. The above equations are.
*Footnote: Block 2 does have a moment because the frictional force is not acting through the center of mass of the block, but the implicit assumption in the problem is that this is not enough to flip it over or cause any noticeable effect.


text:
Q: ngCordova sqlite plugin database write error on Android I've got a project using Cordova (ionic framework) with ngCordova and the cordovaSQLite plugin.  The plugin is installed, js has been added to the html, WRITE_EXTERNAL_STORAGE permission added to androidmanifest, and the following two lines in my config.xml
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="AndroidExtraFilesystems" value="sdcard,cache" />

However, when I run the example code:
$cordovaSQLite.openDB({name: "wt.db"});
$cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS people (id integer primary key, firstname text, lastname text)");

I get the error E/cutils(1910): Failed to mkdirat(/storage/usbdisk0/Android): Read-only file system
I checked on my Android device (S3 running AOKP), and I have an empty /storage/usbdisk0 but no Android folder in there, and even with superuser I can't create it. I also have /storage/sdcard0 and /storage/sdcard1 and /storage/emulated (with 0 and legacy inside linked to the internal sd card).
I'm assuming the problem is that the default directory the plugin uses to store databases is wrong for my phone, but that means it could be wrong for anyone's phone.
If my assumption is correct, how do I get the plugin to put the database in the right place?

A: I just read what my config.xml preferences (which I had copied and pasted from some documentation) actually said.  The problem was <preference name="AndroidPersistentFileLocation" value="Compatibility" /> which was causing the file to be created in the wrong place.
If I replace both preference lines with <preference name="AndroidPersistentFileLocation" value="internal" />, I no longer even need to ask for the WRITE_EXTERNAL_STORAGE permission and it works fine.


text:
Q: sed remove multiple characters surrounded by digits I have a file with following contents:
EMAIL|TESTNUMBER|DATE

somemail@address.com|123456789|2011-02-08T16:36:02Z

How do I remove capital letters T between the date and time and Z at the end of the line using sed?
Thanks!

A: If the format is fixed and each line always matches T\d\d:\d\d:\d\dZ, then you could try the simple:

$ sed 's/T\(..:..:..\)Z$/ \1/'

(Untested)

A: Cat it through:
sed 's/\([0-9]+\)T\([0-9]+\)/\1\2//' | sed 's/Z$//'

Edit
Oh my! I've just realized (thanks @Fredrik) that for a long time I wasted processes! Shame on me! Now I'm Church of The One Process convert. Here is the blessed version of the above abominated oneliner:
sed 's/\([0-9]+\)T\([0-9]+\)/\1\2//; s/Z$//'  the_file.txt

A: Perhaps there's a fancier way, but the following script works for me:
s/\(....-..-..\)T\(.*\)/\1 \2/

s/Z$//

Example...in-bound file:
somemail@address.com|123456789|2011-02-08A16:36:02X
somemail@address.com|123456789|2011-02-08T16:36:02Z
somemail@address.com|123456789|2011-02-08B16:36:02Y

Output:
D:\>sed -f sedscr testfile

somemail@address.com|123456789|2011-02-08A16:36:02X
somemail@address.com|123456789|2011-02-08 16:36:02
somemail@address.com|123456789|2011-02-08B16:36:02Y


text:
Q: find and replace using sed in unix
Possible Duplicate:
Use slashes in sed replace

I need to find the following string /a/b/c and replace it with /r/s/t
It is a string and not a folder
/sam/pam/nancy   -->  /tim/cook/iphone
I am in the directory and just need to update multiple files having this line.

A: Use sed to change the files in-place. For example:
sed -i 's|/a/b/c|/r/s/t|g' *.txt

A: perl -pi -e 's/\/a\/b\/c/\/r\/s\/t/g' file_name


text:
Q: Cloudscrape - Cloudflare bypass isn't working I'm trying to scrape some contents from a website that has cloudflare v2 page (with captcha) with the cloudscrape library in python but also using a paid captcha resolve service like anticaptcha I can't bypass that page and scrape the next one. I'm also using ipv6 rotating proxies that are best in market. If I open the page from an incognito page with these proxies on my pc I got no problems, cloudflare is bypassed. Here is the code I am using
def worker(q, p, proxy):
while True:
try:
scraper = cloudscraper.create_scraper(
    interpreter='nodejs',
    captcha={
        'provider': 'anticaptcha',
        'api_key': 'ANTICAPTCHA_KEY',
        'no_proxy': 'true'
    }
)

req = requests.Session()
ip, port, user, passwd = p.get(timeout=1)
i = 0

headers = {
    'sec-ch-ua': 'Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': 'Windows',
        'Upgrade-Insecure-Requests': '1',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',

    }
    response = scraper.get("https://LINK_with_cloudflare/", headers=headers, proxies=proxy)
    print(response.text)
    except queue.Empty:
    break

I tried to adapt the code for every situation but i really don't know how to solve. Here's the output I got:

Error: Detected a Cloudflare version 2 Captcha challenge, This feature
is not available in the opensource (free) version.


text:
Q: VBA Class : Collection.item member is a collection . How to retrieve sub collection item elements I have this template data
Header of file ((string1, string2...)
group1 header (string1, string2...)
group1/line1 (string1, string2...)
group1/line2 (string1, string2...)
group2 header (string1, string2...)
group2/line1 (string1, string2...)
group2/line2 (string1, string2...)
Note : The datas belonging to group header and group line are different type even if they are on the same 'coloumn' (raw data comes from text file)
I create my main class (populate collection) and data class (populate item : cData_Nomination), everything works individualy BUT I need to create :
-1 file collection (I have multiples files) which store
-- fields (file header) and
-- x sub collection (groups) wich store
--- fields (group header)
--- x sub collection which store
---- fields (line data)
In the folowing code on line 170 .oDpo is the group collection every data are store on a collection with property Let (....).
Everything seem to be store !
Public Function NomCreate(m_sFilepath As String, m_objDataList() As String, m_clDpo As Collection) As cData_Nomination

10        On Error GoTo Err_Handler
          Dim Functions As New cFunctions
          Dim objResult As cData_Nomination
          Dim objDate() As String

      'Note : Init Var(s) /Object(s)
      '----------------------------

20        Set objResult = New cData_Nomination

30        With objResult
40            .FileName = Functions.String_NZ(m_sFilepath)
50            .DataSource = Functions.String_NZ(m_objDataList(1))
60            .DelRes = Functions.String_NZ(m_objDataList(2))
70            .DateTime = Functions.Date_NZ(m_objDataList(4) & " " & m_objDataList(5) & ":00")
80            objDate = Split(Replace(m_objDataList(6), " - ", "-"), "-")
90            .DateTimeRange_Start = Functions.Date_NZ(objDate(0))
100           .DateTimeRange_End = Functions.Date_NZ(objDate(1))
110           .Sender = Functions.String_NZ(m_objDataList(7))
120           .Receiver = Functions.String_NZ(m_objDataList(8))
130           .GasPointName = Functions.String_NZ(m_objDataList(9))
140           .GasPointNameExternal = Functions.String_NZ(m_objDataList(10))
150           .Description = Functions.String_NZ(m_objDataList(11))
160           .DataType = Functions.String_NZ(m_objDataList(12))
170           .oDpo = Dpo
180       End With

Err_Exit:
          'Note : Return Function value
190       Set NomCreate = objResult
          'Note : Delete object
200       Set objResult = Nothing
          'Note : Exit
210       Exit Function

Err_Handler:
          'Note : Exit Function
220       GoTo Err_Exit

When I try to read data i got a problem I can't access to the collection .oDo via property Get (see the following code)
'property belonging to class cData_Nomination
Public Property Let oDpo(ByVal oCollection As Collection)
    Dim m_oDpo As New Collection
    Set m_oDpo = oCollection
End Property

How can I pass collection to an existing item collection (I might have been wrong) and How can i retrieve my sub collection items from the main collection ?
I hope it's clear ...
Thanks in advance

A: Class cNum (Extract of parent)
Private m_sFileName As String
Private oDpo As Collection

Private Sub Class_Initialize()
  Set oDpo = New Collection
End Sub

Public Property Get FileName() As String
    FileName = m_sFileName
End Property

Public Property Let FileName(ByVal sFileName As String)
    m_sFileName = sFileName
End Property

Public Property Get Dpo() As Collection
    Set Dpo = oDpo
End Property

Public Property Set DpoAdd(DpoCollection As Collection)
    Dim DpoItem
    For Each DpoItem In DpoCollection
        oDpo.Add DpoItem
    Next
End Property

Class cDop (Child of parent)
Private m_sDelivery As String
Private oQty As Collection

Private Sub Class_Initialize()
  Set oQty = New Collection
End Sub

Public Property Get Delivery() As String
    Delivery = m_sDelivery
End Property

Public Property Let Delivery(ByVal sDelivery As String)
    m_sDelivery = sDelivery
End Property

Public Property Get Qty() As Collection
    Set Qty = oQty
End Property

Public Property Set QtyAdd(QtyCollection As Collection)
    Dim QtyItem
    For Each QtyItem In QtyCollection
        oQty.Add QtyItem
    Next
End Property

Class cQty (Sub Child)
Private m_sStatus As String

Public Property Get Status() As String
    Status = m_sStatus
End Property

Public Property Let Status(ByVal sStatus As String)
    m_sStatus = sStatus
End Property

Regular Module
Sub myModule()

    Dim i As Long
    Dim j As Long
    Dim k As Long
    Dim cNum As cNum
    Dim cDpo As cDpo
    Dim cQty As cQty
    Dim oNum As Collection
    Dim oDpo As Collection
    Dim oQty As Collection

    Set oNum = New Collection
    For i = 1 To 3
        Set cNum = New cNum
        cNum.FileName = "File " & i

        Set oDpo = New Collection
        For j = 1 To 3
            Set cDpo = New cDpo
            cDpo.Qty = "Qty" & i & j
            cDpo.Delivery = "Delivery " & i & j

            Set oQty = New Collection

            For k = 1 To 3
                Set cQty = New cQty
                cQty.Statut = "OK_" & i & "-" & j & "-" & k
                oQty.Add cQty
            Next k

            Set cDpo.QtyAdd = oQty

            oDpo.Add cDpo

        Next j

        Set cNum.DpoAdd = oDpo
        oNum.Add cNum

    Next i

    'Set oDpo = Nothing
    '

    For Each cNum In oNum
        Debug.Print ""
        Debug.Print "---------FILE ----------------"
        Debug.Print ""
        Debug.Print "-[NUM] " & cNum.FileName & " | " & cNum.Info
        Set oDpo = cNum.Dpo
        For Each cDpo In oDpo
            Debug.Print "--[DPO] " & cDpo.Counterpart & " | " & cDpo.Delivery

            Set oQty = cDpo.Qty
            For Each cQty In oQty
                Debug.Print "---[QTY] " & cQty.Quantity & " | " & cQty.Statut
            Next
        Next

    Next

End Sub


text:
Q: Dropdown menu in Bootstrap <!DOCTYPE html>

<title>Dropdown</title>
<link rel="stylesheet" href="css/bootstrap.css">

<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Article</button>

Technology

Technology 2

Technology 3

this code is not working properly on my Browser(firefox),the dropdown-list is not apearing when I click the button.. Please help

A: Please try this.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

  <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Article
  </button>

Technology 1

Technology 2

Technology 3

A: When using Bootstrap, always make sure that head section contains:

*

*jquery script

*bootstrap javascript

*bootstrap css file

This has to be the order, otherwise it won't work.
D Sai Krishna's code (especially first three rows) is how it is supposed to be. I always find it better to use external link to .js and .css files than to use local files. To conclude, in head section paste external links (these one's are current as of this writing):
    1.    //This will initialize jQuery and enable it to work properly//

    2.    //This will implement Javascript whenever Bootstrap is being used (if applicable). //

    3. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">   //This will enable Bootstrap styles to be applied to your HTML//

For reference, visit W3schools.com/bootstrap where you can find how to implement above mentioned lines and where. You will also find current external links of bootstrap .js and .css