How do I recover when tSQLt faketable does not reset table mapping?

Question: faketable function did not reassign to normal.  All my tables I used faketable on now contain the content of the values I used in the insert of the unit test.  It was many tables and it has left my database useless.  Please help address this problem or at least its cause.  This makes me very nervous about using this in our CI deployment process and maybe more importantly in our local development efforts.
Answer: This only handles putting tables back into place (because that's the problem the OP and I both had) but monkeying with the line that drops the table will probably get it working with other object types.
DECLARE @cmd nvarchar(MAX) = '';

WITH x AS (
    SELECT TOP 10000
           PL.Id                                            AS Id
          ,PARSENAME(PL.OriginalName,1)                     AS OriginalName
          ,ISNULL(SO.name,'')                               AS name
          ,QUOTENAME(SCHEMA_NAME(ISNULL(SO.schema_id,1)))   AS SchemaName
          ,ISNULL(SEP.major_id,-1)                          AS major_id
      FROM tSQLt.Private_RenamedObjectLog PL
      LEFT JOIN sys.objects SO
        ON ObjectId = object_id
      LEFT JOIN sys.extended_properties SEP
        ON SEP.major_id = SO.object_id
       AND SEP.name = 'tSQLt.FakeTable_OrgTableName'
     ORDER BY SO.create_date DESC
)
SELECT @cmd = @cmd
       + CASE WHEN x.name = '' OR OriginalName = x.name
              THEN N'DELETE tSQLt.Private_RenamedObjectLog WHERE Id = ' + CAST(x.Id AS nvarchar) + N';'
              ELSE N'DROP '
                 + N'TABLE'   --Replace this with a CASE statement to deal with other object types
                 + N' ' + SchemaName + '.' + QUOTENAME(x.OriginalName) + '; '
                 + NCHAR(13) + NCHAR(10) + N'EXEC sp_rename ''' + SchemaName + N'.'
                                         + QUOTENAME(x.name) + N''',''' + OriginalName + N''';'
                 + NCHAR(13) + NCHAR(10) + N'IF OBJECT_ID('''+SchemaName + N'.' + QUOTENAME(x.name)+N''') IS NULL'
                 + NCHAR(13) + NCHAR(10) + N'BEGIN'
                 + CASE WHEN x.major_id != -1
                        THEN NCHAR(13) + NCHAR(10) + N'    EXEC sp_dropextendedproperty ''tSQLt.FakeTable_OrgTableName'',''SCHEMA'','''
                           + PARSENAME(SchemaName,1) + N''',''TABLE'',''' + OriginalName + N''';'
                        ELSE ''
                   END
                 + NCHAR(13) + NCHAR(10) + N'    DELETE tSQLt.Private_RenamedObjectLog WHERE Id = ' + CAST(x.Id AS nvarchar) + N';'
                 + NCHAR(13) + NCHAR(10) + N'END'
         END
       + NCHAR(13) + NCHAR(10)
       + NCHAR(13) + NCHAR(10)
  FROM x;

--/*   <-Remove leading dashes to execute
PRINT @cmd;
--*/EXEC (@cmd);

Comment: Thanks bielawski! I used the output of your script to restore a couple of table renames that were inadvertently committed. Since you print the output and commented out the EXEC, I was able to examine it first, which was great, and run it inside its own transaction for each one of them. I then tested the renamed tables before committing. This saved us the trouble of restoring a database and setting it up again for testing. Thanks!
Answer: It is possible one of your tests or your code, left the transaction in a state where it could not be rolled back. This would typically result in seeing one or more tests with an "Error" (instead of "Success" or "Failure") in the results.
In these cases, the FakeTable operation is not rolled back, and the tables are left in their faked state.
Under the covers, FakeTable renames the table and creates a new copy of it. When the rename happens, the operation is logged in the tSQLt.Private_RenamedObjectLog.
For example, you can use the following code to reproduce an error that tSQLt cannot gracefully rollback from:
EXEC tSQLt.NewTestClass 'SOF_Example'
GO

CREATE TABLE SOF_Example.MyTable (i INT);
GO

INSERT INTO SOF_Example.MyTable (i) VALUES (5);
GO

CREATE PROCEDURE SOF_Example.[test fake a table]
AS
BEGIN
    EXEC tSQLt.FakeTable 'SOF_Example.MyTable';

    INSERT INTO SOF_Example.MyTable (i) VALUES (12);

    COMMIT;
END;
GO

EXEC tSQLt.Run 'SOF_Example';

You can use this code to look into the renamed table log:
SELECT OriginalName, SCHEMA_NAME(schema_id) + '.' + name AS [Name of Renamed Table], create_date
FROM tSQLt.Private_RenamedObjectLog
JOIN sys.objects ON ObjectId = object_id;

If you've re-executed the tests many times, you may have many entries in the log for each faked table. You can use the create_date to help determine which one contains the original data.
Now, with all that said: It is best to not write and execute test cases in a database where you must preserve the data. The best approach is to use a database that contains no user data (only the essential configuration data at most). You should be developing and unit testing out of a blank database. Populated databases should be used for other forms of testing, such as integration, usability, performance, etc.
Comment: Sql Server allows a procedure to close a transaction that it did not open. So if the procedure under test executes a commit on the transaction that tSQLt opened, the tSQLt framework looses any ability to undue those actions.

In general it is a bad idea to use transactions within procedures. If you have to, look at this first: http://sqlity.net/en/585/how-to-rollback-in-procedures/

So, not a bug in the "tool", but rather something we have to live with because we are using SQL Server.
Comment: Given the problem is known, has such serious consequences, is predictably going to occur to most users, and logging the renames is possible; why doesn't the tool include a procedure that can recover things? That is: read the rename log and perform the renames in reverse on the user's behalf.
Comment: still seems like a bug in the tool to me.
Answer: I had the same problem with tSQLt, and was able to restore everything using the contents of the table tSQLt.Private_RenamedObjectLog
This table is maintained by the tSQLt framework, and proved to contain the names of the original tables which had been faked, and the SQL ObjectIDs of the temporary (i.e. fake) tables. Using the following query produced the list of the faked tables, and the names that they had been temporarily renamed to (random names produced by tSQLt such as tSQLt_tempobject_3815e077fea84c7c):
SELECT
  ObjectId, OriginalName,
  OBJECT_SCHEMA_NAME(ObjectId) AS SchemaName,
  OBJECT_NAME(ObjectId) AS TemporaryName
FROM
  tSQLt.Private_RenamedObjectLog

Refreshing the object explorer in SSMS showed that tables with these random names did indeed exist, and they did indeed contain my original data (whew!!).
I then did the following:

Tried a ROLLBACK TRANSACTION just in case that sorted it out. It didn't.
BACKED UP THE DATABASE (even though it was messed up)
Dropped the fake tables (i.e. the ones with the original names, not the temporary names)
Renamed the tables (with temporary names) back to their original names, using this for each table:
EXEC sp_rename 'schema.tempname', 'originalname'
Cleared the table tSQLt.Private_RenamedObjectLog after I knew my tables were back, using
DELETE FROM tSQLt.Private_RenamedObjectLog

It would be easy to make a procedure to produce a restore script automatically! Maybe there is one already in tSQLt - anyone know about that?
Answer: I'm aware I've answered this question before! Hopefully this answer is more useful. Also that the question is old. No one else has addressed faking functions, or procedures with SpyProcedure.
Yes, this problem is easily caused by running the code of a tSQLt test outside of a transaction. tSQLt runs every test in a transaction so all faking etc. gets rolled back at the end of the test. tSQLt renames tables etc. in order to fake them, and this usually gets rolled back. Running SpyProcedure also creates a log table, which can clash when you try and run SpyProcedure again. So if you don't run the test in a transaction, these changes don't get rolled back. Fortunately, tSQLt contains all the information needed to restore everything.
First try a ROLLBACK TRANSACTION in case that sorts it out. If not, check if your original tables etc are recorded in tSQLt's table for faked/renamed stuff:
SELECT ObjectId, OriginalName,
  OBJECT_SCHEMA_NAME(ObjectId) AS SchemaName, OBJECT_NAME(ObjectId) AS TemporaryName
FROM tSQLt.Private_RenamedObjectLog

If any records are returned, there's a good chance things can be restored. But please back up your database first!
Now we generate SQL code to delete the faked objects (after testing the original still exists) and rename the originals back to their real names. As far as I know, tSQLt can fake tables, views and functions, as well as procedures using SpyProcedure, so this should work in almost all situations. Log tables created by SpyProcedure are also deleted:
DECLARE @SQL_work NVARCHAR(MAX) = '';
DECLARE @template NVARCHAR(MAX) =
'IF OBJECT_ID(''%s.%s'') IS NOT NULL BEGIN -- check original still exists
  DROP %s %s.%s   -- deleted faked object
  EXEC sp_rename ''%s.%s'', ''%s''
END
';
SELECT
  @SQL_work = @SQL_work +
    FORMATMESSAGE (CAST (@template AS NVARCHAR (MAX)),
      QUOTENAME(OBJECT_SCHEMA_NAME(r.ObjectId)), OBJECT_NAME(ObjectId),
      CASE WHEN type IN ('U', 'V') THEN 'TABLE'
           WHEN type IN ('FN','FS','TF','IF','FT') THEN 'FUNCTION'
           WHEN type = 'P' THEN 'PROCEDURE'
      END,
      QUOTENAME(OBJECT_SCHEMA_NAME(r.ObjectId)), OriginalName,
      QUOTENAME(OBJECT_SCHEMA_NAME(r.ObjectId)), OBJECT_NAME(ObjectId),
      PARSENAME (OriginalName, 1)
    ) +
    CASE WHEN type = 'P'
         THEN FORMATMESSAGE ('DROP TABLE %s.%s_SpyProcedureLog
',              QUOTENAME(OBJECT_SCHEMA_NAME(r.ObjectId)),
                PARSENAME (OriginalName, 1)
              )
         ELSE ''
    END +CHAR(13)+CHAR(10)
FROM
  tSQLt.Private_RenamedObjectLog AS r
JOIN
  sys.objects AS o ON r.ObjectId = o.object_id
PRINT @SQL_work
PRINT 'DELETE FROM tSQLt.Private_RenamedObjectLog'

The above generates and prints code to set things back. I recommend executing the generated script cautiously i.e. execute the parts one by one, and only execute the last DELETE statement if everything else worked.
I'd be very interested to know if this worked for you, or if any problems were encountered so that the code can be improved.
Answer: Note that every tSQLt test is simply a stored procedure. They can be executed with a simple EXEC. Failing to use tSQLt.Run may execute the test procedure without creating a transaction. That means the effect of FakeTable, among others, is not rolled back on test completion. Since the operation of transactions in SQL Server is a central tenet to tSQLt functionality some care should be taken.
In our organization we supply a test procedure template that all developers are expected to utilize. The first thing the template does is check to see if the code is running inside a transaction. If it is not it aborts with an appropriate message. That will not solve every transaction-related problem but it assures the test is not running naked.


Geodesic of a massive particle in Schwarzschild metric

Question: what happens to particle in unstable circular orbit in schwarzschild metic when it is pushed outwards? Does its geodesic change into an ellipse with around stable radius corresponding to its angular momentum or does it fly off to infinity?
Answer: In Schwarzschild metric (static and spherically symmetric black hole) a geodesic for a massive particle is described by:
$E = \frac{1}{2} (dr/d\tau)^2 + V_{effective}(r)$
where:
$E = (\epsilon^2 - 1)/2$ fictitious energy
$\epsilon$ energy per particle unit rest mass
$r$ radial coordinate
$\tau$ proper time
$V_{effective}(r) = -M/r + l^2/(2 r^2) - Ml^2/r^3$
$c = G = 1$ natural units
$M$ black hole mass
$l$ orbital angular momentum per particle unit rest mass
The effective potential has a maximum and a minimum if $l/M \gt \sqrt{12}$. That gives two circular orbits, of which the one closer to the horizon is unstable.
If so, we may have:
$\sqrt{12} \lt l/M \lt 4$, fictitious energy $E$ negative
$l/M = 4$, fictitious energy $E$ zero
$l/M \gt 4$, fictitious energy $E$ positive
If a particle on the unstable circular orbit is pushed outwards, depending on the sign of the fictitious energy $E$ we have:
$E$ negative: it will trace a bound precessing orbit as a negative $E$ will cause the radial velocity $dr/d\tau$ to stop.
$E$ zero: it will fly off to infinity as a zero $E$ will cause the radial velocity $dr/d\tau$ to stop only at infinity.
$E$ positive: it will fly off to infinity as a positive $E$ will not allow for the radial velocity $dr/d\tau$ to stop.
Note: In any case the bound orbits are not ellipses, because they are subject to precession.


Middle of mobius band is a circle

Question: We define the Möbius band $M$ as the space $I \times I$ when identifying $(0,t)\sim (1,1-t)$ through $\rho: I \times I \to M$. We wish to prove $S=\rho(I \times \{ \frac{1}{2}\})$ is a circle. The solution was to define a function
$f:I \times \left\{\frac12\right\} \to S^1$ by
$f\left(t,\frac12\right)=(\cos(2\pi t), \sin(2 \pi t))$ and note it is continuous and closed (since it's from a $T_2$ space to a Compact space). How does it help? I assume we try to get a homeomorphism $S \to S^1$ somehow.
Comment: Use the [universal property of quotient maps](http://en.wikipedia.org/wiki/Quotient_space_%28topology%29#Properties).
Comment: Continuous, closed and *bijective* means it's a homeomorphism. Do you see why it's bijective?
Comment: By the way. $f$ is closed because it is a map from a **compact** to a **T$_2$** space, not the other way.
Comment: $f(0)=f(1)$, hence not 1-1. How do we move from talking about $f$ and $I×\frac{1}{2}$ to the space really want, S?
Comment: I don't get it. The arrows don't match, and why do we only need to prove the new map is continuous?
Answer: Use the universal property of quotient maps. Please have a look at the following diagram:

Here $p$ is the quotient map to the Möbius band and $q$ is the restriction of $p$ on the middle line. Now there are two ways to topologize the set $p\left(I\times\left\{\frac12\right\}\right)$: We can regard it as a subspace of $M$, or we give it the final topology with respect to $q$ which means we see at as a quotient of $I\times\left\{\frac12\right\}$. There are cases where these topologies are different, and we see that they are equal iff $q$ is a quotient map. There are criteria which enable us to decide if this is the case. For example, if $A$ is a closed and saturated subspace of $X$, then the restriction of a quotient map to $A$ is again a quotient map. As $I\times\left\{\frac12\right\}$ is indeed closed in $I×I$ and saturated with respect to $p$, we conclude that $q$ is a quotient map.
Now $f$ as you defined it was continuous, surjective, and was compatible with the relation (meaning that $f(x)=f(y)$ whenever $q(x)=q(y)$). By the universal property of quotient maps it thus factors as $\tilde f\circ q$, where $\tilde f$ is uniquely determined and surjective.
Recall what we need for $\tilde f$ to be injective and open.

Middle of mobius band is a circle


Multiple responses from one AJAX request

Question: Not really looking for code examples here, just concepts.
I have three sections on a page now that are being updated via three separate AJAX calls to PHP scripts, which return JSON. What would be the easiest way to condense these three calls into one larger call and receive the responses back on the client in JSON? How would I separate the responses on the client so I can manipulate the response data based on what information is sent back?
Answer: I like Cris' method, but think I can provide a little improvement.  As you already have 3 seperate entities, to reduce the need for recoding everything, you could do something along the lines of combining you PHP into one file via include 'page.php' and sending an object back via JSON with properties named for what each of them do (lets say "names", "dates", and "fuzzyThings").  Your client code to send the request would then simply have all the arguments your 3 functions sent individually being sent in one request.  The returned JSON would then look something like this (put your objects/arrays/whatever in the commented areas):
{
    "names" : {/*stuff needed for names goes in here*/},
    "dates" : {/*stuff needed for dates goes in here*/},
    "fuzzyThings" : {/*all fuzzy things goes in here*/}
}

Once you get this to the client side, as I assume each may already have a function (or set of functions) to deal with it's return data, you should be able to call them in this manner:
function handler(retText) {
    var returnedObject = eval(retText);

    doStuffWithNames(returnedObject.names);
    doStuffWithDates(returnedObject.dates);
    playWithFuzzyThings(returnedObject.fuzzyThings);
}

Also, on the PHP end you can make a unified PHP page (without recoding anything hopefully) via:
<?php
    echo '{';
        echo '"names":{';
        include 'names.php';
        echo '},';

        echo '"dates":{';
        include 'dates.php';
        echo '},';

        echo '"fuzzyThings":{';
        include 'fuzzyThings.php';
        echo '}';
    echo '}';
?>

Note: You may need to edit the 3 php pages so that they will check the $_POST correctly and without interfering with the functionality of the other pages if you have not already, I prefer the method of if(isset($_POST['whatever'])) { ... } to check that everything was sent correctly, this way, you can include as many as you want, and if there is nothing to do with a php file (i.e. you are not using that section on that page), then it will return a blank property, and you simply will not use it (basically making it a "one-size-fits-all" type of thing).
Hope it works for ya!
Comment: I like your improvement, I didn't think about it your way.  Well done mate.
Answer: You can format your JSON like this:
"user" : [ {
    "name" : "Harry",
    "hobby" : "Skating"
}, {
    "name" : "Dave",
    "hobby" : "Scuba Diving"
} ],
"news" : [ {
    "date" : "3/13/05",
    "title" : "Blah",
    "postedby" : "Mike",
} ]

And now in your AJAX response:
var data = eval('('+ xhr.responseText +')'); // Ajax response
var user = data.user[0].name; // Harry
var user2 = data.user[1].name; // Dave
var title = data.news[0].title;

You can use a for loop to traverse the data. In the example above you should now see how you can use PHP to format your JSON with multiple categories (user, news, ect.) and return back everything with only one call. If you would like a more elaborate example please refer to this article as well as  this.
Answer: I think you have to make a JSON format according to those 3 sections on the page, ID them so that after response you can populate them to those sections.
Answer: I personally like the json method but if you're new to json or don't feel comfortable working with it for any reasons there's a jQuery plugin designed specifically for this purpose called jQuery Taconite Plugin
In Rails community there's a third way called RJS which is not that much hot nowadays and feels a little obsolete but still has its own fans. I'm curious if anybody has ported RJS to PHP or not?
Answer: this is workimg for me
php code:
//for test
$categoryName = "category";
$idcategory = "1";

 $json = "{'productcategory':[{'categoryname':'".$categoryName."','idcategory':'".$idcategory."'}]}";
 echo $json;

javascript:
var str = xmlhttp.responseText.trim();
var json = JSON.stringify(eval("(" + str + ")"));
var obj = JSON.parse(json);
alert(obj.productcategory[0].idcategory);
alert(obj.productcategory[0].categoryname);


Schema-less data in a database?

Question: I'm wondering if there's any database technology where its structure or schema does not need to be defined upfront? For example it may start off with just one column or row and the user will keep adding more columns and rows to the table on the fly, when they see it necessary.
Comment: That's commonly known as "NoSQL"
Answer: If you write your queries properly and avoid SELECT * then any relational database will allow the addition of further columns or tables without requiring adjustment to the application.  You do, of course, have to declare each column to the DBMS before referencing it in SQL.
I find the claim that NoSQL is "schema-less" to be slightly misleading.  Applications using NoSQL persistance do, indeed, have a schema.  The difference is that the schema is held in application code and it is the responsibility of every programmer who touches the code throughout the application's life to enforce that schema.  With relational databases the data structure is declared to the service and it then takes the responsibility for enforcing those rules for ever after.  The real flexibility of NoSQL is that two rows within the same "bucket" (the definition of which various depending on your DBMS) can have different structure.
Comment: The key point here is that, in a relational database, the schema is coded as metadata and stored in the system tables.  This makes the data self describing.  Data that is not self describing has to be managed by the applications that use it.
Answer: There are two current methods of doing this that are very popular.

JSON SQL:2016,
With SQL 2016 we have a standardized schema-less type, JSON. Most databases implement it, and many have a binary form of it too (like PostgreSQL, and MySQL). If this form is available you should use it. It has better typing than EAV, and is more easily indexed. It can further support hierarchies, is easier to query, and is ready for use in JSON apis and REST protocols.
CREATE TABLE foo ( foo_id int, name text, other_data jsonb );
INSERT INTO foo VALUES ( 5, 'foo', '{"json_key":5,"foo":"baz"}' );

SELECT *
FROM foo
WHERE other_data @> '{"foo": "baz"}';

EAV - Entity Attribute Value with this method you create a table that represents key-value relationships,
CREATE TABLE entity ( entity_id, name text );
CREATE TABLE eav ( entity_id int, attribute text, value text );

You can further using a linking table with that,
CREATE TABLE entity ( entity_id PRIMARY KEY, name text );
CREATE TABLE eav ( eav_id int PRIMARY KEY, attribute text, value text );
CREATE TABLE eav_entity (
  eav_id int REFERENCES eav,
  entity_id REFERENCES entity
);

The idea here is that attribute (keys) and values are in their own table. This has the downside that the attributes must all share the same type. While the values must also share the same type, their type does not have to be the same as the attributes.
Answer: There is a data architecture called EAV that can be used when the structure of the data is yet to be defined.  The user inputs every value as the third element of a triple, called (Entity, Attribute, Value).  New entities or attributes can be included as needed.
This structure is completely dynamic, but it's also almost completely out of control.  The trouble comes when the owners of the data want the same kinds of results that are cheap and easy with a structured database.  I'm talking about reports, extracts, and other common standard outputs.  This are often very difficult and expensive to achieve with EAV.

Schema-less data in a database?


why EDA industry has moved on from vhdl to verilog/system verilog?

Question: And is there a chance of re-emergence of VHDL in commercial VLSI/EDA professions as an in demand skill?
Comment: I think you are talking about US and all. In European countries, I think VHDL is still more popular. And in defence/avionics sector in my country, VHDL is preferred.
Comment: It has? Damn, this mountain of work before me must be imaginary.
Comment: @lousycoder systemverilog is useful mostly for verification engineers. Linkedin is an elaborate social network and the things you're shown are prefiltered by what it thinks is relevant to you. You're probably looking specifically at entry-level jobs or verification engineer jobs. Generally, you'll find that people will be surprised if you tell them information on social media is unbiased. That's the opposite of true.
Comment: @DonFusili If this is not so, then why there are more jobs visible on platforms like LinkedIn with tags like Systemverilog than VHDL?
Comment: @mmmm yes, my observation was only for entry level jobs. I think verification jobs are more visible.
Answer: Simply put: it hasn't, not for the implementation at least.
sv has become more popular as the verification framework, and conversely as the top-level integration language, because it's easier to use UVM in sv. Also, VHDL is a horrible verification language.
That doesn't mean that large parts of the actual designs are not still written in VHDL, most digital designs I've worked on in the last few years have been 50-50 verilog and VHDL. Pretty much the same as I've seen in the last few decades. FPGA projects tend to lean more towards VHDL, ASICs more towards verilog, but the differences are small in my experience.
So the increase in demand for SystemVerilog you see is (almost) purely for verification, not design and implementation.
Comment: A lot of verification IS still done in VHDL; there are toolkits like OSVVM and UVVM to make the job easier.
Comment: @user_1818839 Yeah, I know, and they all suck badly enough at their core tasks that they don't even deserve a mention.
Comment: @DonFusili   Then I guess you never learned and/or tried OSVVM.   In the 2022 Wilson Verification Survey, in FPGA 56% of the market uses VHDL for _verification_.   Also in FPGA 28% of the market uses OSVVM (that is half of the community doing verification in VHDL).


Very few views on my question?

Question: My question (How can I have Desmos trace a point's path) has been getting very few views, despite being up for a while. Is there something in it that's turning people away?
Answer: We have a small number of questions and contributors around desmos (ref. https://webapps.stackexchange.com/tags/desmos/topusers) by the other hand the question description is very brief which might cause getting a low score on search engines.
To help your question to get more views:

besides the link, add a screenshot / animated gif
show what you tried
add a brief description of your sear efforts (whenever be possible add links to similar questions) as is suggested in How to ask a good question
contribute to desmos questions / answers posted by others
after a week or so, consider to offer a bounty

Reference

What should I do if no one answers my question?
Comment: Understood. I thought there were a decent number of Desmos posts, my bad.

Very few views on my question?


Document control

Question: I'm looking for a way to allow a group of users to upload documents which are then locked so only a small group of users (i.e.management) can make changes. The files need to be uploaded with Metadata and i've not find a way to do it purely with access permissions.
any suggestions or ideas?
Comment: Have a look into Workflows; they should allow you to define what happens when with documents...
Comment: I'll have a look at that in more depth but at the moment I don't get the options to use the 'change item permissions' action in SPD even using 2010 work flows.
Answer: I don't have the required reputation to comment. My answer:
With SharePoint Designer Workflows, you have the option of using Impersonation Step. Use Impersonation Step to modify the permission at the document level. Create a group which will contain the users from management. Using Impersonation, remove all the permissions associated to the document and add only the newly created group.

Document control


Is this a load bearing wall? Please help

Question: I have a commercial space I am working on and would like to open up the wall between two rooms its a single story building, flat roof, concrete flooring. one room is 400 sq ft and the other is 600sq ft. I just want to open it up to the exterior wall one one side and where the thermostat sits on the other just before the hallway entrance. I have removed most of the drywall seen in the picture so you can get a good idea of all the studs i'll be removing. It seems there use to be two windows in this wall but then was just converted into a wall with a center opening. There is an 18inch beam under the joists running across the whole building to both exterior walls. Thanks in advance for the help!
Comment: Hello, and welcome to Stack Exchange. You're going to have to talk to a structural engineer about this; we can't provide answers to questions that, if wrong, could collapse your building.
Comment: Talk to a structural engineer, it is most definitely load bearing (2x6's under a supporting beam). As an aside if you would like more ceiling space, this will give you the chance to get a pocketed steel beam and remove the current wood beam.
Answer: I would definitely assume the wall is supporting that beam. Get a structural engineer's advice to be sure, and to find out what your options might be. Solutions often exist, but may not be DIYable... and this is emphatically not something you want to risk getting wrong.
For comparison: My contractor was able to open a 15-foot-wide passageway through a central loadbearing wall, but we needed to install a heavy (4x12?) Parallam beam to absorb the load, strong columns at each end to transfer the load downward, and at the non-foundation end a steel C-beam was sistered to an existing joist to transfer load to foundation and main beam.
Comment: Thanks for the input, this is my first DIY... Just thought I would get some input on here before I had to pay someone to come help me out. I was guessing I'd have to have columns to help the support that beam but was hoping it would be easier than that.


Android SDK FingerPaint example

Question: I hava a simple question about Android FingerPaint example: here
(Websited is updated, my question is regarding old version as explained below)
On of the first things it does is
setContentView(new MyView(this));
In MyView constructor: (website is updated but when I loaded my Sample from my SDK it was this way, my question is about this code)
    public MyView(Context c) {
        super(c);
        mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
        mCanvas = new Canvas(mBitmap);
        mPath = new Path();
        mBitmapPaint = new Paint(Paint.DITHER_FLAG);
    }

This basically makes bitmap of 320 x 480, but when I run this code on my tablet or high-res phone, I noticed that it would scale the bitmap, making the paint object appropriately bigger.
I'd like to have the same effects, but in my own container, myFrameLayout. But when I apply the same MyView to a FrameLayout from my main.xml (omitting findViewById and all),
    setContentView(R.layout.main);
    mV = new MyView(this);
    ((ViewGroup) myFrameLayout).addView(mV);

It actually only uses 320 x 480 area of my whole FrameLayout, so it draws fine, but only preserves(when I lift my finger) drawing on a small piece(320 x 480) on the upper-left of myFrameLayout.
How can I make MyView scale and fill the entire size of myFrameLayout using 320 x 480 bitmap as in the SDK example?
(I know I can change 320 x 480 bitmap to appropriate resolution to fill it all, but that's not what I want.)
It's my first time asking question, so please let me know if question is not clear.
Answer: your would scale your bitmap creating. use display of displaymetrics for requesting screen width and height and take this values to bitmap creating

Android SDK FingerPaint example


Civilization IV: How to play multiplayer with Mac and Windows?

Question: How can I set up a multiplayer game of Civ IV with one Mac OSX player and one Windows player? Both players are running Civ through Steam. The Windows player is running Windows 7.
Answer: When you install through Steam it appears that the default Mac OSX version of Civ IV and the Windows version of Civ IV are different.
This is the fastest way I have found of setting up a game:

On the Windows machine, find 'Civ IV' in Steam and right-click
Click on the Betas tab
Under 'Select the beta you would like to opt in to', click on the drop-down menu and select Original Release – UNSUPPORTED
Let Civ update, and launch when finished
Now when you launch the game, both players should have the Multiplayer -> Direct IP Connection option. Use this to have one player host a game and the other player connect.

See also the 2k announcement about installing pre-Steamworks Civ IV here.
It may be possible to also get both players running the same version by purchasing the Civilization: Beyond the Sword expansion pack for both players, but I haven't confirmed this.


What Command or Commands need to Run When I create a Plugin in Magento 2?

Question: I created a Plugin form Magento, I need to know what commands need to run.
Answer: To enable module run below command:
php bin/magento module:enable Vendor_Module

Then run:
php bin/magento setup:upgrade

If you have dependency injections in your module then run:
php bin/magento setup:di:compile

If you have any js, css or template(html) etc then run:
php bin/magento setup:static-content:deploy (-f if not in production mode)

Comment: If you are in developer mode, there is no need to run setup:di:compile setup:static-content:deploy
Answer: If you have created a plugin then you need to run following commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

once you run the setup:upgrade then you can check weather your module is enabled or not.
static-content:deploy will deploy your static view files.
Hope this help.
Answer: php bin/magento module:enable VendorName_ModuleName
php bin/magento setup:upgrade

Assuming that the module code is already present in your file structure, either in the app/code directory or the vendor directory, you should only need to run the commands shown above.
Answer: Move the Plugin folder to app/code path and run the following commands
Enables specified module
   php bin\magento module:enable VendorName_ModuleName

Upgrades the Magento application, DBdata, and schema
   php bin\magento setup:upgrade

To check whether plugin installed or not, check app/etc/config.php file .
the value should be 1 for that module.


Are the ten commandments a reflection of the character of God?

Question: Which denominations would teach, either directly or indirectly, that the ten commandments are a reflection of God's character? And how would such a claim be asserted?
Comment: When you say 'character' of God do you mean the 'righteousness' of God ? I ask this because Paul makes it clear that _only the gospel_ reveals the righteousness of God, Romans 1:17. Up-voted +1.
Comment: @curiousdannii Are you, thus, suggesting that God, himself, 'acts' according to ten commandments ?
Comment: this questions seems hugely open ended. `directly or indirectly` sounds opinion based.
Comment: Why wouldn't they be a reflection of God's character?? God doesn't act out of character!
Comment: @curiousdannii - "why wouldn't they be a reflection of God's character? God doesn't.." etc.  Good point.  I mean "are they a perfect reflection of his character?"  If we had just the 10 commandments we would have a very good understanding of what God is like.
Comment: @AndrewShanks Ah, yes that's a more debated question. To what extent can the Decalogue be equated with the "Moral Law", etc.
Answer: I know that Seventh Day Adventists have taught that the Law is a reflection of God's character for over 100 years (I myself have taught it for more than 30 years as an Adventist pastor) and more recently, I believe some groups coming out of the Worldwide Church of God may also teach this.
I just read The Law: A Reflection of God's Character by Isaac Khalil on his website.
Comment: +1.. thanks. And for the linked article.
Comment: Welcome to Christianity.SE! and thank you for your contribution. When you get a chance, please take the [tour] to understand how the site works and [how it is different than others](https://christianity.meta.stackexchange.com/a/1809/50259). I would also recommend reading the [Help Center's](https://christianity.stackexchange.com/help) sections on asking and answering questions.
Answer: There are many denominations under the umbrella of Reformed Protestantism, and many of them see the ten commandments as a reflection of the character of God. They are mainly those who espouse "Covenant Theology". I'm not going to try to list them all. This answer is just to give one example of one group, as to how they reason on this matter.
Basically, they quote from the Bible to say that the Law [the Mosaic Law that includes the ten commandments] is perfect. That's because God is perfect, and his Law is perfect. Next, as the Bible says, it is designed to convince sinners that they cannot keep God's perfect Law - only discovered by trying to keep it and inevitably failing. This should drive them to Christ who, alone, perfectly kept the Law on our behalf, they claim, so that repentant sinners might be saved. As Christ is the exact representation of God's very Being, then the character of Christ is the character of God, and shines forth in Christ's perfect Law-keeping.
Here are some quotes from one of their books that show how they assert some of these claims:

"In its broad sense, the Mosaic covenant is an administration of the
covenant of grace... The Israelites in no way earned their eternal
salvation but received it as a gift through Christ. In its narrow
sense, however, the Mosaic covenant is a covenant of law...
Our tendency is to think that we can obey, that we can become holy by
our own efforts. We do this in two primary ways. First, we attempt to
dilute God's righteousness by lowering his standard of holiness and
assuming that God values our works. Or second, we are prone to assume
that we are not that sinful, that if we really try and get a little
help our obedience will make us holy. The destination, however, is the
same for both avenues, the destruction of the biblical doctrine of
salvation. Hence, God gave humanity the Mosaic covenant to help with
this serious problem...
The Mosaic covenant is God's law covenant with Israel, wherein he
graciously leads them to Christ by showing them the perfect
righteousness that only Christ could fulfill to redeem sinners."
Sacred Bond - Covenant Theology Explored, Michael G. Brown and Zach Keele, pp104-105 & 108, Reformed Fellowship Inc., second edition 2017

It is this idea of perfect obedience that is at the back of the view that the ten commandments so perfectly reflect the character of God, that God in Christ had to perfectly keep the entire Law for the plan of salvation to succeed:

"God's justice requires that heaven be earned by perfect obedience to
his law. This is what Christ came to do as our covenantal
representative. He obeyed the law in our stead so that by faith we can
become the righteousness of God in him (2 Cor. 5:21). Christ earned
the glory of heaven for his people, which we receive as a gift through
faith. ...[Christ] is the One who fulfilled Sinai's command, 'Do this and live' (Lev. 18:5)." (Ibid. p.118 & 120)

This raises many questions, but none that you ask. Pressing on, here is a quote from Dutch Reformed theologian Herman Witsius, who wrote:

"The scriptures represent the Father, in the economy of our salvation,
as demanding the obedience of the Son even unto death; and upon
condition of that obedience, promising him in his turn that name which
is above every name." (As quoted in Ibid., p.37)
"As Louis Berkhof explains [the covenant of redemption]: ...it was for
Christ a covenant of works rather than a covenant of grace. For him
the law of the original covenant applied, namely, that eternal life
could only be obtained by meeting the demands of the law. As the last
Adam, Christ obtains eternal life for sinners in reward for faithful
obedience, and not at all as an unmerited gift of grace." (Ibid.,
p.40)

This shows the assertion that God put Christ under obligation to perfectly keep his perfect Law. If to see Christ is to see the Father (and Jesus said it is), then it can be seen how this Reformed theology teaches that even God has to keep his own Law. It is, in effect, saying that God's character is so bound up with his Law, that the plan of salvation depended on Christ keeping it. As the first quote showed, God's perfect righteousness and holiness is integral to the Law and to the plan of salvation, which also shows his grace to sinners (but not shown to Christ.) Now, this takes us back to Eden and the two trees in the garden - obedience, to what? To Law? Is that how God lives? By keeping his perfect Law? If so, then that makes God subject to Law and, therefore, inferior to it, so that in no way reflects the true character of God!
God is what is right. Righteousness is what God is. All else must accommodate to the rightness that he is. But to say that God himself must be subject to a Law that tells him what is right, and that he has to know both that, and what is wrong, and to choose to do right (by keeping that Law), denies the character of God, that he is righteous in his Being. He was righteous and holy in his Being before he gave the Law to Israel. He didn't give it for himself as well! The Word of God gave the Law at Sinai, mediated through angels, and so the Word as flesh, (Jesus) was never going to break his own Law!
Back to your question. In summary, Reformed (Covenantal) theology (which claims to be neither legalistic nor antinomian [without law, against law],) would agree with Reformed theologian Michael Eaton's definition of God's glory is, "The radiation of God's character" (Hosea, p145 Christian Focus). That's why he dwells in unapproachable light. But his character is what he IS, not what he is subject to, for God is not subject to anything or anyone. He abides by who he is, being true to his Being, his character. Therefore, whence arises this claim that the ten commandments reflect God's character? It seems to be born out of a desire to keep Christians bound to them, yet if Christ perfectly kept them for us, why do we need to keep them ourselves? Where do we really see God's character? In a legal enactment made for sinners, or having "Christ in us, the hope of glory"? And if we have Christ in us, by faith and grace, then we will see the astounding character of God in this text:

"Now the end of the commandment is charity [love] out of a pure heart,
and of a good conscience, and of faith unfeigned... We know that the
law is good, if a man use it lawfully; knowing this, that the law is
not made for a righteous man..." (1 Timothy 1:5-9 K.J.)

The Law was not made for Jesus Christ. But antinomianism also means, "The unlawful abuse of law", hence the seriousness of any theology that attempts to lead us back to the Law by saying that our keeping of the ten commandments will somehow show us the character of God; that keeping these laws is so important that even Jesus Christ was obliged to keep them. The character of God shines forth from his very Being, not from tablets of stone.
Edit having just seen the OPs comment, "If we had just the 10 commandments we would have a very good understanding of what God is like". But "what God is like" is not the same as fully grasping his character. We would not know the grace of God only later revealed as to how he would save sinners from his righteous judgment of their sins. The Law only showed how impossible it was for sinners to keep his Law. It is predominantly a list of negatives showing what God judges. It took the coming of Christ to fully show the character of God, as Christ alone reveals the Father to us.
Comment: Excellent and thorough. Much as I would have expressed myself, had I eventually got round to doing it. Up-voted +1.
Answer: Of course!
It is easy to demonstrate that God Himself follows His own laws and commandments.

Thou shalt have no other gods before me - God is clearly not conceited; He does not tolerate subversion against heaven and cannot look upon sin with allowance.
Thou shalt not make unto thee any graven image - God is clearly not wrapped up in idolatry or any obsessive pursuit. He doesn't waste time watching football, TV, abusing substances, or any of the numberless other forms of idolatry, whether popular or unpopular among us.
Thou shalt not take the name of the Lord thy God in vain. Obviously He does not take His own name in vain, because He is true to His own perfect integrity and virtue. He cannot lie.
Remember the Sabbath day, to keep it holy. Labor six days. God Himself labors six days and rests every seventh, as proven by the Creation account in Genesis. The Earth itself is about to enter its Sabbath period of rest when the Millennium begins as the seventh of its seven thousand years of temporal existence. This is a law that God continues to abide.
Honor thy father and thy mother - No one can miss the fact that the highest priority of the Son of God is to honor and worship His Father.
Thou shalt not steal. When did God ever steal from, or defraud anyone? Never. Property rights are among His highest eternal priorities.
Thou shalt not commit adultery. Both God the Father and His Son Jesus Christ are the epitome of chastity and fidelity.
Thou shalt not kill. God never murdered anyone. He is the God of life, and He is the originator of life and proliferation of it. He never delights in destruction. Destruction is the way of the adversary. God created and gave us our lives in the first place, and will raise us up at the last day.
Thou shalt not bear false witness - God cannot lie.
Thou shalt not covet - The Son of God refused Satan's temptation when He was offered all things. This was a very real temptation but the Lord never sold us out. He is eternally opposed to covetousness and instead gives all His powers into the work of undying generosity. He went about doing good, and still does.
Answer: Read the context. God has just rescued the Israelites from 430 years of captivity in Egypt and now is going to make a people for Himself as he promised Abraham previously. These were not a holy people yet and knew nothing of Godly behavior. The 10 Commandments (Israel listed them differently) were there as a guide for them as well as all the other laws. Yes they are small part of the character of God but that's not the point. Only God in the person of Jesus could fulfill those laws. He then became the sacrifice for all those that believe(trust) in Him (John 3:16). Israel had to be trained. Our training is Scripture. Following the 10 commandments would make you a better person and certainly improve your character but they cannot save you. Don't get Israel mixed up with Christianity. We are under Grace now. Trust in Jesus and the Holy Spirit will reside in you. He will give you Godly character as you obey Him.
Comment: Welcome to the site, Larry, and for your answer. To help it conform better to the requirement of this site, it would be good if you could quote a few external sources that back up what (otherwise) would look like your personal opinion.  This is a good start, though!
Comment: If the ten commandments is 'part of God's character' then why , O why ? was Adam banished from Eden when he chose to partake of the knowledge of good and evil ?


Disqus moderation page not working in WordPress admin section

Question: If I login to my Admin section and click Comments on the left, the Disqus moderation page does not load. On further inspection this is because it's trying to load the page over http:// and my blog is loaded via https:// so it is being stopped. Everything else loads via https:// but I don't know how/where to change this page to do so. Link to my site if you need it.
Comment: What is "disqus moderation page"? :) Have you tried contacting its developers about the issue?
Comment: When logged in to the WP admin if you click Comments on the left it's the replacement page that Disqus provides to replace the standard one. Yes I've contacted them but no response yet, thought I'd ask here to see if anyone else has had the same issue.
Answer: I had a response from Disqus Support regarding this issue:

Hi Scott,
To clarify, the Disqus moderation panel in Wordpress is not intended
  to be used with https. If you would like to use the moderation panel
  in https you'll need to go to the Disqus moderation panel directly at:
  https://scotthelme.disqus.com/admin/moderate/#/approved
If you have any trouble or other questions, please let us know.
Qarly
Disqus Product Support


ubuntu 13.10 can't detect windows 7 and NTFS partition

Question: I have already windows -7  installed on my PC. and I want to install ubuntu 13.10 alongside windows-7 . but while installing ubuntu, it doen't give me option to install ubuntu alongside windows and also can't detect windows and partition too...
what I can do now ???
sry for my poor english....
Answer: Is your drive partitioned correctly?
If not here's the solution that may help you:
Method 1 (with Gparted):

Boot into Ubuntu liveCD and click 'Try Ubuntu'
Then go to the GParted application
Shrink the Windows volume, for an example see below (or click here):

After that create a partition for Linux with EXT2, EXT3 or EXT4 partition (I recommend EXT4)
*Then reboot (restart) , and you will see the installation option, 'Install Ubuntu'.

Method 2 (using Ubuntu LiveCD):

When Ubuntu installation shows the option 'Something Else' click it
Then click 'Advanced Partition Tool' and shrink Windows volume
Create one partition with EXT2 / EXT3 / EXT4 partition in the free space.
After that you will see the button install now enabled, click it.
Answer: follow these steps ::

+In windows right click  "my computer" > manage > disk management
+shrink some unused free space for ubuntu (Based on your usage)
+insert ubuntu CD / USB drive
+Restart
+Boot from CD/USB by pressing F12
+Select Ubuntu in boot options
+Click "Try Ubuntu"
+After it opens , Click on Install Ubuntu
+select language > turn on internet for updates(recommended) > plugin to power source
+Here if it don't show the option "alongside windows" , click "Something Else"
+Now you have to make three partitions as follows ,

1. root for all user installed packages (mount to '/' with ext4 filesystem)
2. Home for all user download files and media (mount to '/home' with ext4)
3. Swap memory, probably half of your RAM size is enough (mount to swap)
(For all three choosing primary or logical is doesn't matter, Ubuntu don't care)
You are done now

+Click Next > Set Date and Time settings
+Sit and Relax until it finishes the installation
+Restart when it is done
+Now , If windows don't show up in the boot :
+In ubuntu , goto terminal and install boot-repair using,

~/sudo add-apt-repository -y ppa:yannubuntu/boot-repair
~/sudo apt-get update
~/sudo apt-get install -y boot-repair && boot-repair

+In boot-repair click advanced options > other options
+make sure Repair windows boot files option is checked
+click apply
+Restart
You will have grub menu with both ubuntu and windows during booting

<< If ubuntu don't show up in the boot :
click F12 , and select ubuntu from the boot options displayed
then install the boot-repair from the same process above. >>
Hope this helps, Thank You!
Comment: Thankx bro ....but it showing me entire disk empty where as i have 4 partition....ubuntu not detecting partition
Answer: I came across the same issue and am currently working to fix it. I found that you can have no more than 4 primary partitions on any given drive. If your drive has 4 partitions already, make sure that when you attempt to partition the drive as shown above that you select logical for each one, or if you can make one primary, try to make a single EXT4 /boot primary partition that has just 500MB of space (1/2GB). Make sure the /home partition is th largest as it will hold all your files and data. the / partition, or 'root' partition, need not be larger than 6000MB (6GB) as the root is designed to fit on a 5.7GB DVD. Again, assure that all but the /boot partition are set as logical instead of primary.
Comment: I don't think this is because of the primary partition limit. The installer still would show the options and then report an error during partitioning.


Employer asking IT interviewee about his/her social life. Reasons and good answers?

Question: What might be the reasons for an employer to ask an interviewee about the status of his social life. Especially when the interviewee is applying for an IT job, more specifically a programmer of a sort? So the question is, what are good ways to answer to that kind of question?
Comment: What was the exact question?  I think we need to know that before we can recommend an answer.
Comment: Your question, as stated by you as of this moment, is way too broad, and I'd ordinarily vote to close. The only reason that I am not voting to immediately close is that you say that an interviewer asked you the question. I'll wait and see how others react to the question the interviewer asked you. I believe that the only way to react effectively to it is for you to narrow the scope of their question by you asking the interviewer what is the concern behind their question.
Comment: They are asking you what's the status of your social life? That's a really vague question. You need to ask for a clarification next time they ask. Are they trying to determine whether you are a sociable individual? That what you might not have time available to work for them after hours or weekends? I'd say to them "I want to answer your question but I'd like to know what your concern behind your question is, so that my answer is on target".
Answer: Your social or private life might be of interest for a lot of reasons. Recruiters try to estimate some of your abilities and future behavior based on certain criteria. Some of it may not even be legal in different countries and I do not think this is a good question to ask, but I have heard recruiters talk about it. It's their job, I will only repeat what they said. Again, it's not my personal opinion:

If you have a wife and kids, you have a stable base and you will be loyal, easy to handle and not very jumpy
If you have a long-distance relationship, it does not take a genius to know that it's a 50% chance that the future employee will move to his or her partner, quitting the job. As an employer, you cannot compete with "love".
If you engage in certain kinds of sport, you risk injuries and will statistically be more often away from work on sick leave
If you are newly weds, you may get children soon and depending on how you handle it, you will be taking days, months or maybe even years off.
People may talk about various things freely: their marriage status, their religion, sexual orientation or whatever else it is the recruiter wants to know but is no allowed to ask.
Comment: So, to summarize, the question is fishing for information that they aren't legally (in the US at least) allowed to ask for directly. There are very good reasons why companies aren't allowed to ask for and why a candidate shouldn't volunteer that information.
Comment: Yes. And as I said, I do not like it, nor do I personally ask such questions. But it's reality out there.
Comment: I wasn't criticizing, just summarizing. It is a reality and a trap that candidates should be careful to avoid.
Comment: In any case, your advice is good, I appreciate for making the time to give an explanations.
Answer: Usually your personal life is non of your employers business and you can answer as generally as you wish without giving much detail.
There are many reasons to ask these questions, but typically it's because the company wants to have a strong social bond between the people, engage in social interactions such as picnics, Friday beer-fests etc. And most other times - the interviewer is just inexperienced and bad at taking interviews.
It's totally understandable if you feel that your privacy is being invaded with such questions, but you also don't want to spoil the relationship between you and the employer, so just give an answer that you would be comfortable with:

"I tend to spend free time with my family"
"I enjoy riding a bike in good weather"
"I like spending time with my friends every now and then"

These good non-answers that are usual and general enough.
As a personal advice - make sure to tell if you're not comfortable in sharing too much of your personal data to the employer. People are afraid to not get a job, not get a promotion etc., but then, think if that kind of company is good for you? You'll be spending there 6-9h almost every day, that's most of your time, so make sure that the company you join is not making you want to quit every day.
On the other hand, let's think if you're actually do want to spend time with your colleagues - most of the IT people like computer games, drinking together, playing board-games is very common. It may be a great way to find a group to play MTG or DnD with or talk about micro-controllers.
In the end, treat this question like any other interview question and if uncomfortable - try to steer the conversation into talking about your skill and experience over your looks, hobbies etc.
Comment: I must say, that is a really good and broad answer. I will accept it, thank you very much.
Answer: There is one legitimate question that might be interpreted as "asking about social life" but is actually on-topic for an IT interview: asking if you code (or play with hardware such as Raspberry Pi) for fun. Interviewers are often strongly attracted to candidates who code for fun, play with hardware, attend user group meetings, and in general do activities related to their work whenever they can, on their own time.
With this in mind, a question like "What do you do for fun?" might not be an invitation to discuss salsa dancing, hot yoga, or 17th century war re-enactments, but a prompt to talk about your personal github repo.
Since the question doesn't include a direct quote I can't know if this was the actual intent of the interviewer. However, it wouldn't hurt to pretend it was, whether it was or not. If you are one of those nerdy-geeky-hobby people (like me) then an answer like:

I love keeping up with the latest releases even if they're just not ready to use in a work environment. I have a server rack at home running about 25 vms and I'll install those CTPs and other pre-releases the day they come out. I love to see what I'll be working with in a year or two when it's stable enough for real use. I've done some play projects with Arduino too and I'll talk your ear off about those over a coffee any time.

can serve everyone's purposes just fine. Alternatively, if you don't do that kind of stuff after work, try:

I love building software and solving customer's problems and I really throw myself into it at work 100%. I know some people do the same sort of thing evenings and weekends but for me I do better recharging myself with entirely different activities that aren't work-related at all. Monday mornings I'm dying to get back to whatever I was working on when I left Friday.

In the quite rare case where an interviewer is nervy enough to push further and ask specifically what those activities are, you need to insert a Real. Long. Pause. into the conversation. Not a "holy crap I need to think fast and make something up" pause but an eyes-locked, did-you-really-just-ask-me-that-you-didn't-did-you pause. Then try:

I look forward to joining this team and chitchatting about my weekend just like everybody else. Even though my hobbies are entirely harmless and normal, I'm pretty sure we're not supposed to discuss them in the interview, right?
Answer: As far as reasons there are two major concerns: Liability and Team Fit.
Anything from dangerous behaviors to social obligations that may interfere with your job performance and/or availability. Part of this overlaps with Team Fit.
There are plenty of instances where people indicate an employee was technically strong but didn't get along with the team. Sometimes it's personality deficiencies (argumentative, unwilling to accept criticism, defensive, aggressive, etc.) or you just don't fit in. Your interests may not be in line with those of most of the company/team. They may like to go out after hours and find that those who they presume do not to fit.
It takes a lot of effort for management to make sure the company/team is accepting of people who are not like them, so they take the easy way out and just look for people that are just like them. It's sad that they are unwilling to adapt and in many locations risk discrimination in hiring. Very difficult to catch.
How to answer?
If you really want the job, you better do your homework and find out what people are like at this company. Check for LinkedIn and Facebook. Do your own recon and sit in their parking lot to see when people leave. It's a little creepy/stalking, but you may even follow them to the local pub and see how they behave.
I think you should be yourself and look for companies that are willing to accept you the way you are. Much less stressful. I think you'll be happier in the long run, but that's easy to say if there are other opportunities.
Answer: This the sort of question I think it's fair to ask back "Why do you want to know?" -  provided of course you don't take a defensive tone (or what they might think is a defensive or litigious tone) and provided you've built up some rapport with the interviewer by this point. And chances are you will have done: this feels more like a closing-the-deal question rather than an early-stage-filter question, so they're likely positive about you at this point. If you don't want to jump straight back at them then maybe volunteer a little information first, ask why they want to know, and then fill in any gaps in your first answer tailored to their reasons.
In my case they were trying to gauge how comfortable I'd be working on client sites in other cities, away from home for weeks at a time.


Why large volume of selling done at the beginning and end of day?

Question: Why large volumes of selling done at the beginning and end of day? Is there data available which can say who made these selling?
Comment: Possibly because mutual funds &c do their buying & selling at the end of the day?  That is, if I want to withdraw some money from my account, and I log in and enter the trade right now (OK, this time tomorrow since markets are closed today), the trade in my account won't actually be executed until the the markets close, and the company will have to total all such trades and buy or sell to cover them at the start of business the next day.
Answer: There is a lot of stock specific as well as market  and international news  reported after our markets close as well as before the open the next day.  At the open, traders react to that news.


Point Interpolation in ArcGIS

Question: I have a set of data points in a CSV format. I want to create a contour map using the data points so I used IDW Interpolation in ArcGIS. But, when I checked the maximum value of the output raster, it was different from the maximum value of data points. Did I miss something when I used the IDW Interpolation or should I use another interpolation method (Krigging, natural value, etc)?
Answer: A spline interpolation will compel your surface to pass through the sample points.
See here,  and here for some information on different interpolation methods.
Since these interpolation methods are 'making up' data between your points the best interpolation method may depend upon the distribution of your points and the type of land you are trying to interpolate (tide flats or canyons?).  Of course, you would not know which surface was 'better' unless you had some control data and did a further analysis.  Search GIS SE for root square mean error if you want to try to determine the best interpolation surface from your points.
Comment: Hi, Thank You very much for the information. I have read the website and I thought the spline method would be the right choice. But, after I tried to use it, there are some problems that I want to ask: 1. It still didn't give the maximum value 2. It gave a negative value (I know it was due to the method using derivatives). Is there any correlation between the number of data points to the output? my data has roughly 250,000 points btw.

Point Interpolation in ArcGIS


Should you wrap chicken in foil when you steam it?

Question: If so, should you wrap the chicken completely in foil, or leave the bottom open so the steam can get in?
Answer: Don't wrap the chicken in foil.  Instead you can use a steamer basket inserted in a pot with the lid on (making sure your liquid does not touch the chicken) and steam it that way.
If you don't have a steamer basket and what you are trying to do is replace one, instead of wrapping the chicken roll that foil into balls or strips and use it to elevate the chicken above the cooking liquid in your pot.
If you wrap in foil, the chicken will be cooking via the heat transfer from the foil rather than from the steam.
Comment: Yeah, I figured foil would just get in the way of cooking rather than aiding it — a friend mentioned the foil thing, so I thought I'd check. Cheers!
Answer: You can add all sorts of seasoning to the chicken while steaming it if you wrap it up nicely. This is the reason for using tin foil. :)


How to Reset Full-Screen Terminal.app Preferences to Factory Defaults

Question: On an iMac running Mac OS X version 10.7.5 I have accidentally resized Terminal.app to full-screen (272 x 76) and am unable to resize Terminal.app to a smaller size.  How do I resize Terminal.app to the factory default size or a size where I can use the mouse to resize Terminal.app?
Answer: You have (at least) wo possibilities:
1)
You could click on the zoom button to revert the zoom effect (the green circle in the upper left corner in the image below:

2) You can enter smaller values for the window size under "Preferences":


Should I wait until after my doctoral disputation to apply for a job in the industry?

Question: I will submit my Ph.D. thesis in September and hopefully have my disputation in January. I studied computer science and my current research fund would be finished by April, and I'm thinking about joining the industry as a data scientist or something similar.
Although I prefer to find a job as soon as possible, I wonder if it's better to wait for my disputation and apply for jobs while holding the doctorate title, or should I apply as soon as I submit my thesis?
Of course if one reads my CV carefully would come to the conclusion that I'd receive my degree in a few months, but I Wonder how much is the immediate gain of that title in the first impression they get from my applications especially when they want quickly shortlist candidates.
Answer: Applying and interviewing can take months before you are given an offer.
In my case I started applying 9 months before defending my thesis, and had interviews going on for a certain position for months: the first over the phone one was in April and I ended up doing the face to face interview in September, two days after my defense.
Other PhD students of my same year even found a job one year before defending the thesis, and started working while finishing it.
Just make clear what is your expected availability date when you apply.
Answer: You can start applying for open positions right away, just make sure that you have your CV updated properly at proper time. In other words, one should not need to be looking hard to find whether you are about to obtain the degree or already holding it. Make it clear upfront.
If nothing else, you'll gain experience. All the best.
Comment: @Bob It should be good. If you use a header for your CV, you can also mention it there, otherwise OK. Also, this should be in your bio, starting of the CV so that no one has to waste time till they reach the educational qualification part.
Comment: In my education background part in my CV I mention that i'm expected to receive my degree in xx.2021. is it good enough? Should I somehow add it to the header part or somewhere else?!
Answer: Yes you should apply, there is no benefit to waiting after just as long as the job search doesn't affect your usual work. Remember that companies hire all year around depending on their need, and if companies want to hire you they'll be fine waiting for four months for you to start, and you'll gain a lot of experience to what the job market is like right now around you. Job searching also takes a long time so the earlier you start the better. Also just to add on if you're worried about completing the degree before applying, I think its the norm for students to look for jobs before completing their degree during their penultimate and final year.


What is the difference between ARM Cortex M7 and Cortex A53, and their possible applications?

Question: What is the difference between ARM Cortex M7 Cortex A53 (or A17)? Why one will choose one over the other? To what kind of applications does each of those is targeted for? Which one will be more suited (and why?) for wireless communications and video?
Answer: The Cortex M series all fit into the microcontroller family, that is they are specifically optimised for smaller, specific, time-sensitive applications. Because they have a more specific job, they typically don't have as much memory.
The Cortex A series are more of a general-purpose embedded type core, that you would find in a smartphone or a tablet or other SOC's. They typically favor higher performance and functions that are more suitable for running an OS such as Android.
Note that both of these are just families of processor cores, they aren't the actual processor bundles including memory and device interfaces. You didn't really provide much information about what you're looking for, but if I had to pick a hardware platform for rich multimedia and streaming, it would be an SOC that had the A-series core in it for performance reasons.
Comment: The A series is definitely overkill for that, and if all you're doing is streaming video, the M7 might also be as well. If you want to save yourself as much hassle as possible, get board like the M4-based [STM32F4-Discovery](http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419#) which is about $15, and has a whole lot of support for it already. Google any module/part number plus "Stm32F4" to see for yourself
Comment: What I'm interested is having a tiny board, with an mcu on it that is connected to a camera module like the ov2640 and buffers video over wifi.
Answer: Generally those are the names of two completely different microcontroller architectures, where Cortex-A is rather microprocessor than microcontroller. Specifically Cortex-M7 is the new Cortex-M architecture designed for the purpose of Industry 4.0 standard and Internet of Things. Whether microcontroller or microprocessor is a very general question and depends of whether you are building an embedded system or portable computer such as smart phone, tablet or digital camera. Both of them are suited for wireless communication and video and I will advice you before you choose one of them to test each of them on an evaluation board. For example Firefly RK3288 for A17 and STM32F746G-DISCO for M7 will do the trick.


Permissions for Start/Stop Services on Windows (2008R2)

Question: On a Windows Server (2008R2 or before), where can I find the permissions (allow/deny) who can actually start/stop services? Not to change the credentials which should be used by the service - just start/stop.
Answer: I don't believe there is any good GUI to do this on the local system, but maybe something has been added since I last looked.
I know SetACL can be used to modify the access control list of a service.  Here is an example from the documentation about how to grant the ability to start/stop the Windows Time service domain1\group1.  SetACL is pretty easy to use.
SetACL.exe -on "\\server1\W32Time" -ot srv -actn ace
           -ace "n:domain1\group1;p:start_stop"

You can set the permissions with the built-in sc as well, but the syntax is far more cryptic.  The the options are sc sdset and sc sdshow.
The other option is to set the permissions through a policy.
Also see this question: How to set Windows Services permissions from Powershell?
Comment: Service permissions can only be set from group policies or from tools like SetACL or the service configuration tool sc.exe.
Comment: SetACL Studio, the graphical permissions management tool built upon SetACL, is only weeks away. Actually a beta might be available next week. SetACL Studio sets/lists permissions on services just like SetACL does.
Comment: SetACL seems to be great. However, I wonder, where is this permissions set natively. There should be a way to review the ACL for services with nativ Windows tools?
Comment: I managed this via a domain group policy object.  One thing to note, if the service is an installed piece of software, I had to install the GPMC Windows feature on the target server and create the policy on the server so it listed the correct services in 'Windows Settings > Security Settings > System Services' as my PC did not have the definition of these services.
Answer: You can natively set permissions on services by editing the SDDL strings using SC.exe. There are several articles online that go through the details. Although using that method works, it's very tedious, error-prone and can be different depending on the OS. I haven't used SetACL Studio, but it looks pretty comprehensive based on their site.
If need to delegate rights to services on multiple machines and could possibly have more complex scenarios, I would recommend using System Frontier. You can configure permissions centrally, that can apply to one or more servers automatically without having to touch each individual server. Everything is based on role based access control (RBAC). Full disclosure: I own the company that makes System Frontier.


How can code in a JavaScript file get the file's URL?

Question: I need to dynamically load a CSS stylesheet into a page that's on a different domain. How can I get the complete URL of the JS file to use in the href attribute of the stylesheet?
For instance, here is the structure:
http://bla.com/js/script.js
http://bla.com/css/style.css
I want to dynamically load the stylesheet into a page http://boo.net/index.html. The problem is, I don't know the bla.com bit in advance, just the fact that the stylesheet is in ../css/ relative to the JS file.
The script is, of course, included on index.html. jQuery's fine too.
Answer: Add an ID to the script tag:

And in http://bla.com/js/script.js:
var myScript = document.getElementById('myscript');
var myScriptSrc = myScript.getAttribute('src');
alert(myScriptSrc); // included for debugging

You should be able to manipulate the value of myScriptSrc to obtain the path to any other content on bla.com.
I think this sample is what James Black meant in his answer.
Lastly, to everyone suggesting the use of document.location, please keep in mind that if you want read-only access to the current page address, you should be using document.URL or window.location. If you want to set the page address, you should always use window.location.href. Although window.location = 'location'; works, it has always bothered me to see a String being assigned to a Location. I'm not sure why since JavaScript allows all sorts of other implicit type conversions.

mozilla reference: document.location was originally a read-only property, although Gecko browsers allow you to assign to it as well. For cross-browser safety, use window.location instead. To retrieve just the URL as a string, the read-only document.URL property can be used.
Sun reference: Do not use location as a property of the document object; use the document.URL property instead. The document.location property, which is a synonym for document.URL, is deprecated.
Comment: Nice. Minor aside: [officially, HTML4 does not allow an id in `
Answer: Even easier than using an id is to just leave the markup alone and use document.currentScript. The link to MDN mentions under the Notes section, a small quirk requiring the JavaScript to execute synchronously, and I'm about to explain how to avoid this pitfall.

It's important to note that this will not reference the

JavaScript in http://bla.com/js/script.js:
var myScript = document.currentScript,
    mySrc = myScript.getAttribute('src');

console.log(mySrc); // "http://bla.com/js/script.js"

$(function () {
    // your other code here, assuming you use jQuery
    // ...
});

If you don't want the variable to be exposed to the global scope, you can also do this:
(function () {
    var myScript = document.currentScript,
        mySrc = myScript.getAttribute('src');

    console.log(mySrc); // "http://bla.com/js/script.js"

    $(function () {
        // your other code here
        // ...
    });
}()); // self-executing anonymous function

Basically the point is to make sure and access document.currentScript during synchronous execution of the script, otherwise it will not reference what you expect it to.
Comment: Not supported in IE 11.
Answer: With Jquery, you could do something like:
$('script[src$="my_script.js"]').attr('src').replace('my_script.js','');
// outputs something like: "/static/js/"

Comment: Very useful when there's no id on the script tag and it's a partner's code where you can't have a DOM id added.
Answer: var JS_SELF_URL = (function() {
    var script_tags = document.getElementsByTagName('script');
    return script_tags[script_tags.length-1].src;
})();

As the browser parses  tags, it also downloads and executes them. Therefore when your JS file is executed it is currently the last  tag parsed.
Comment: Avoid this when using `async` keyword.
Answer: You could look in the script tag for the javascript location, and by using document.location you could probably determine the relative addressing, in order to determine where the css file may be.
Answer: Stack property of error objects can provide URL information.
try
{
  throw new Error();
}
catch(exc)
{
  console.log(exc.stack);
}

Unfortunately, Webkit doesn't (but Chromium does) support stack property. There are a few browsers supporting this feature: http://220.127.116.11/reference/html/api/Error.html#Error.stack
Instead of stack, Webkit provides  sourceURL property, here is the exampe usage:
try
{
  throw new Error();
}
catch(exc)
{
  console.log(exc.sourceURL);
}

Answer: You can read document.location, but you could also just use relative URLs
Comment: As far as I know, document.location returns the URI of the current document, not the JS file inside which the code is executing.


I have 3 up votes on my answer but the total shows as 22 why?

Question: I just answered some question and got 3 upvotes on it.
It should sum up to 30 but why is it 22?
Comment: Looks like you hit the rep cap for the day.
Answer: You have reached the repuation cap - 200 a day from upvotes only.
See How does "Reputation" work? for details.
Comment: So is it that if I have 200 reputaion per day I can't go above that? After 200 each time there is a upvote do I get +2?
Comment: After 200 (from upvotes), you don't get **any** more. The 2 is probably because you lost 2 rep earlier in the day (just looked - due to a downvote).
Comment: Oh I was not knowing this . But still if answers are accepted I get +15?
Comment: @Gopi - yes. Please read the link I posted for all the details.
Comment: Sorry for bothering I am being a bit lazy :) Anyways thanks for the info.


get audio current freqency for each 0.1 second of audio file with ffmpeg sox or opus into file.txt

Question: I am trying to get audio freqency statistic from call record in file.opus for each 0,1 second, have try ffmpeg (spectrum) ffprobe ,
for example
sox  '.$file.' −n rate 6k spectrogram −z 62 -w Hamming -o aaaaaa/test10.png stat -freq 2>aaaaaa/test10.txt
return spectrum
all of them return values but no freqency found any other library ? Or what I am doing wrong I now it retrun spectrum but I need concrete freqency of human voice it is possible with ffmpeg or ffprobe or sox ? I am working in php but running shel comands any help will be aprisiatied. What should be my next step? I am lost I have no idea how could get freqency from this numbers or "it is possible " ??? What is the first step comand in sox etc.
Comment: I have not found documantation to get freqency of voice and I am new in ffmpeg and sox
Answer: So , I am have I think "not nice" solution, for beginner in audio good article witch help me FFT for beginner then study documentation for SOX stats use following code to get

Rough Freqency

$z = 0;
$timeFrom = 0;
$freqencies = array();
$fftPoints = 4098/2;
//sox could give only 2048 freqencies spectrum
$file = 'myMp3Test.mp3';// 10 seconds
$interval = 1/8;//1/8 second
//best results I got with this interval smaller gives as well zeros
//80 because 10 seconds interval 1/8 = 80 measurments
while($z <= 80){

    $outputexec = '';

    exec('sox  '.$file.' −n trim '.$timeFrom.' '.$interval.' rate 1024 stat -freq  2>&1', $outputexec);

    $timeFrom = $timeFrom + $interval;

    $resultLength = (count($outputexec)-12) ;
  // - 12 means extra 12 rows in result with stats
    $cycles = $resultLength / $fftPoints ;

  $x = 1;
    while($x<=$cycles){

        $buffer = array();
        $till = $fftPoints*$x;

        $i = $till - $fftPoints;

        while($i < $till){
            $prA = explode("  ",$outputexec[$i]);
            if(isset($prA[1])){ $buffer[] = $prA[1]; }
            $i = $i + 1;
        }

        $maxValue = max($buffer);

        $j = ($till>$fftPoints)? $till - $fftPoints: 0;

        while($j < $till){
            $prB = explode("  ",$outputexec[$j]);
            if(isset($prB[1])){
                if($prB[1] == $maxValue) {
                     $freqencies[] = $prB[0];
                    break;
                }
            }
            $j = $j + 1;
        }

        $x = $x + 1;
    }
    $z = $z+1;
}

//result is in freqencies arrray

Mean volume

exec('ffmpeg -i "'.$file.'" -filter:a volumedetect  -f null /dev/null 2>&1', $outputrmsA );
foreach($outputrmsA as $vysledok){
    if(preg_match("/mean_volume/", $vysledok)){
        $vprenos = explode('mean_volume: ',$vysledok);
        $mean_volume = (trim(str_replace(" ", "",(str_replace(" dB", "",$vprenos[1])))));
    }
}
var_dump($mean_volume);

Spectrum,png
exec('sox  '.$file.' −n rate 4096 spectrogram −z 60 -w Hamming -o aaaaaa/ORG.png');

I am kindly open for corrrections or better answers, thx for any advice
I had test it on my personal mp3 and it was with 0,005 tolerance OK
Comment: Looking for better resolution of freqencies 4098 and less time interval then 1/8


Differences between имя, имён and имена?

Question: Could you please answer with samples which are clear and easy to comprehend for a beginner.
Answer: These are all forms of the same word, "имя" (name).
Имя -- nominative case singular. Пример: "Моё имя -- Исмаил".
Имена -- nom. case plural, пример: "Назовите ваши имена!"
Имён -- genitive case plural, пример: "Никто не знает их имён".
Comment: "существительное" is a reduced form of the full term "имя существительное". Translated literally it might go something like "the name of an existing thing".
Comment: "имена существительные"  (or, in singular, "имя существительное") is a fixed term, which means "nouns" (respectively, "noun"). Similarly, the term "имя прилагательное" means "adjective".
Comment: thank you for fast reply, I try to read a book in Russian about grammar, in book written "-имена существительные- в имненительном падеже", translator says "nouns" for "имена существительные" but there are two words there, that made me confused and I searched about meanings of these two words and than I'm totally confused and it leaded me here. I know it should be one another question but could you please translate it exactly word by word in a way which makes little bit sense.
Comment: you really do it good by giving nominated forms of words and it helps me a lot, because there are also many cases in my native language. But i didn't quite get your comments well, the problem is uncle google says существительное is the word noun in English and имя is the the word noun in English too, so it's like "noun noun" which doesn't make sense, so there should be a difference, I know it's a term just like "имя прилагательное" in your example, gosh maybe I should stop paying that much attention about these details, but for learning deeply it's needed..
Comment: thanks a lot for your concern and help, it's more clear now.
Comment: @Ismail Yilmaz имя существительное = substantive noun, имя прилагательное = adjective noun.


What was the weight of the beams of the mishkan?

Question: What was the weight of the beams of the mishkan? We are given the dimensions of the beams (10 amos) and we find that Chazal say Moshe stood them up by a miracle. Obviously they were very heavy. What would be the approximate weight of each of these beams?
Comment: This is probably a math question more than a Judaism question
Comment: It depends what kind of tree "shittim" refers to,
Answer: As I agree with @robev, I came across an interesting article called "THE CONSTRUCTION OF THE TABERNACLE" written by Ephraim M. Epstein. In this article, Epstein writes (The Monist Vol. 21, No. 4 (OCTOBER, 1911), pp. 567-623):

Nor can we rely on the sockets mentioned in the specification, for they weighed only a talent each of silver (see Ex. xxxviii. 27), being 93 3/4 pounds, and even though there were two sockets for each board, this amount of metal would not be a sufficient base to secure a board of 16 feet 8 inches high and 2/2 feet broad to stand upright against the gust of a desert wind

Epstein seems to refer to Shemos 38:27 where it writes:

The 100 talents of silver were for casting the sockets of the sanctuary and the sockets for the curtain, 100 sockets to the 100 talents, a talent a socket.

The Penei Moshe on Yerushalmi Sanhedrin 9a seems to explain that the "Talent" in the time of Moshe Rabbeinu was double of the weight of the talent in the time of the Romans, see here
Reference list:
Epstein, E. M. (1911). THE CONSTRUCTION OF THE TABERNACLE. The Monist, 21(4), 567–623. http://www.jstor.org/stable/27900348


What is physical interpretation gives integration?

Question: It is my understanding that the integration is the inverse process of differentiation and its meaning is a fine sum (in fact, so is its symbol) but what physical interpretation do we get from this? At least, speaking of position, velocity and acceleration.
Comment: http://en.wikipedia.org/wiki/Antiderivative
Comment: Ummmm... The Fundamental Theorem of the Calculus?
Comment: @Wolphramjonny : no Jonny, let's not complicate the explanation with antiderivative and other things. I am trying here to keep simple. So I think that it's better for the moment. The OP asks for intuitive meanings.
Answer: Integration has different meanings. First of all is was developed for the need of calculating surface, see the achievements in the ancient world, Greece, China, http://en.wikipedia.org/wiki/Integral#Pre-calculus_integration.
So, if you draw a curve  in the $x, y$ plane, then $\int_a^b f(x) dx$ is the area under the curve between the verticals $x = a$ and $x = b$, see picture.

But the integral $\frac {1}{|b-a|}\int_a^b f(x) dx$ has also another meaning: mediation, i.e. the mean value of $f(x)$ in the interval $[a, b]$.
Calculi of mean values of different quantities are done this way, for instance if you want to know the mean value of a quantity X with continuous values, given that the value X=x appears with probability $p(x) dx$, then $<X> = \int x p(x) dx$, where the integral is carried over all the values that X can take.
On the other hand, the derivative $y = df/dx|_{x = c}$ has the meaning of the direction of the tangent to the curve $y=f(x)$ in the point $x = c$. If, for instance, you are given the position of a car on a road as a function of time, $r = f(t)$, then its velocity at some time $t_1$ is $v = [df/dt]_{t = t_1}$.
Comment: @CristianRodríguez (continuation) In physics we need sometimes to mediate a function like $f(x_1, x_2, ... x_n)$ over a generalized volume $V$ in the $n$-dimensional space occupied by the variables $x_1, x_2, ... x_n$. If so, the mean value is $(1/V) \ \int dx_1 \int dx_2 ...\int dx_n \ f(x_1, x_2, ... x_n)$.
Comment: @CristianRodríguez You also ask if the derivative tells us how changes a variable with respect to another one? Yes, it's a bit complicated but we can do this. The space of a comment is not sufficient to me, so please see my additional answer.
Comment: okay, this is how important mathematics of the integral, its relationship with the derivative and the area between curves, but not only speak of this integral, also spoke of the vector integral multiple integrals, and to be more specific, if the derivative tells me how to change a variable relative to each other (eg position in time) what about the integral? physically!
Comment: @CristianRodríguez : it's a bit difficult to understand what you ask, because of the English. I can only guess. The generalization from single integral to multiple integral is immediate. Integrating the space beneath a surface you get the volume. Imagine that my upper figure is not in two dimensions, $x$ and $y$, but in three, $x, y, z$, and instead of the curve $y = f(x)$, you have a surface, $z = f(x, y)$. Then, the integral $\int f(x, y)\ dx \ dy$ gives you the volume under that surface.
Comment: Excuse my English, I'm Hispanic and I have never taken proper English courses, I think you're the person who has approached what I look mean ...

  Thanks to all by striving to understand and explain to me.
Comment: @CristianRodríguez : do you speak French?
Comment: nope, I'm Colombian though my name is French, I speak Spanish... LOL
Answer: So, you ask "if the derivative tells me how to change a variable relative to each other (e.g. position in time) what about the integral? physically!"
For intuitiveness I will refer to the function $v(t)$, the velocity of a car. For simplicity, let's assume that the road is straight. Then we have $dv(t)/dt = a(t)$, the acceleration. However, the integral
(1) $\frac {1}{t_2 - t_1} \int_{t_1}^{t_2} v(t) dt$
will give us the distance travelled by the car between the times $t_1$ and $t_2$, divided by $t_2 - t_1$, i.e. the mean velocity between these times.
So, integration doesn't serve only for calculating areas, volumes, etc. it is also used for averaging.
Now, you will maybe want to know how do get along the average in (1) and the velocity itself. Then assume that $t_1$ and $t_2$ are very close, i.e. $t_2 = t_1 + dt$ where $dt$ is very small. Then (1) becomes
(2) $\frac {1}{dt} \int_{t_1}^{t_1 +dt} v(t) dt = \frac {1}{dt} v(t) dt = v(t)$
If the domain over which we average is very small, we get the function itself.
Comment: This does not look very different from your other answer, so why is it a 2nd answer? Why not just add equation (2) to your first answer? Note also that `$$\int v(t)\,dt\tag{1}$$` will give you a right-adjusted label.
Comment: @KyleKanos : no, first of all his text of the question was hardly understandable. I answered it. But he asked for some clarifications that look as a new question. The lack of clarity of the language in his question leaves much space to interpretation of what he asked.
Comment: @KyleKanos: since you are here, can you tell me how to mark a matrix? I didn't know, I wanted to edit some matrix and whatever I could do was to edit each line of it separately. But, how to edit the undulated parentheses between which all the matrix is enclosed? I had the same problem with marking a column vector. How to put a parenthesis over three rows?
Comment: For Latex/MathJax matrices: `$$\left(\begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array}\right)$$`. That will get you a 2x2. For higher dimensions, use the same number of `c`'s as dimensions, `&` separates the columns and `\\` gives a new row.
Answer: An intuitive understanding of integration can be obtained by considering the example of two graphs(functions) : one a plot of distance($d$) covered at any given point in time (let's call this variable $t$) by an object, and on another graph we have a plot of the velocity of the object against time. You give me a time (argument to the function) and I can give you a distance and a velocity (the output $y$). However, we can see that the distance covered and velocity have a relationship. The distance covered will depend on the velocity of the object. So what would happen if instead of giving you the graph for distance and velocity, I only provided the graph (or function) for velocity? This is where integration comes into play. Let's say this object was moving at a speed of $10~\text{m/s}$ in $1~\text{second}$ the object will have covered $10~\text{meters}$, at $2~\text{seconds}$ the object covers $20~\text{meters}$, so on and so forth. This is an example of a constant slope (line). So if I were to ask you what the distance covered by this object at time ($t$), from time = $0$. What you would do is add the velocity of the object to that given time. Lets say I asked what the distance covered was at $t = 5~\text{seconds}$. It is logical that in order to find the distance you add the velocity over time. Which at a velocity of $10~\text{m/s}$ in $5~\text{seconds}$ the object would cover a distance of $50~\text{meters}$. However, as you have probably seen, graphs (functions) are rarely linear. An object will seldom have a constant speed. In the objects trajectory it will probably speed up and slow down. So if I asked for the distance the concept of integration still holds however instead of now taking the object's constant velocity and multiplying by how much time has progressed, you must add up all the little pieces or changes in the object's velocity in order to obtain the distance covered in a given time.
Comment: Can you break up the wall of text a little?


Geth vs Parity Transaction propagation (1 / sqrt(n))

Question: Is there a reason that geth propagates new txs to all peers but parity only propagates txs to 1/sqrt(n) (on average) peers? I see a comment in geth to the effect of //FIXME include this again: peers = peers[:int(math.Sqrt(float64(len(peers))))] (https://github.com/ethereum/go-ethereum/commit/8fe01b4bfa28ad5a1fdde7f9837e8f982843389a) but it seems that that was put in 3 years ago
Answer: This would answer your question: https://github.com/ethereum/aleth/issues/5277
Namely:

Propagating to all peers would lead to O(nm) messages being sent, where n is the number of nodes and m the number of peers per node - this devolves to O(n^2) in a fully connected network.
If we propagate to sqrt(m) peers, then in a fully connected network we send O(n * sqrt(n)) messages, which grows much slower.

There's a "diminishing returns" argument for propagating to all nodes; i.e. it takes computational effort but doesn't significantly improve global transaction throughput beyond the initial sqrt(len(peers)). This probably comes from some network/graph theory research.
Comment: Oh, and to answer your question about the difference between Geth and Parity: there are obviously trade-offs between efficiency and accuracy; e.g.

> the reason transactions are propagated to all peers is to avoid gaps
if we start propagating transactions to sqrt peers, we'll fill up every txpool with nonce gaps, causing transactions to be dumped

So different implementations come to different conclusions about such things.