text:
Q: Weird styling issues with nav bar and footer I've got two styling issues. You'll find the full fiddle here. Please note I'm not using any media queries.
1st issue:
Upon re-sizing the browser unlike the header when scrolling horizontally (left or right) my footer seems to wrap itself round its content and leave a massive gap to the right
For example please re-size the browser to a width of 624px and then try scrolling to the right .. you will see this gap to the right of the footer.
I've set the footer width to a 100% but yet its wrapping itself round. Could it be the
overflow: hidden;

property?
Any ideas as to why this is happening?
My desired outcome should be the footer appearing from one end of the browser to the other.
2nd issue:
Again this is to do with my browser resizing. Upon re-sizing the browser my navigation bar which is floated roght in the header seems to jump/move to the next line. I attempted several things as seen here but no luck.

A: width: 100% will size an element to the dimensions of its parent, unfortunately sizing a child to a particular dimension larger than a container won't automatically size the container to the same dimensions.
Basically the set-up you have is this:
body
  .maindiv (width: 1280px)
  footer   (width: 100%)

The footer is sized to the dimensions of the body, which, by default will be the width of the viewport. So this is why your footer is getting limited and not sizing to the size of .maindiv. There are three quick solutions to this.

*

*Size your footer to the same width as .maindiv i.e. width: 1280px

*Apply float: left to the body. This is a trick that forces the container element (i.e. the body) to wrap to its child elements dimensions. This should cause the body to take the same width as .maindiv automatically. There may be some unexpected side-effects of doing this however as floats can cause layout oddities.

*Or you could move your footer inside .maindiv, that way it will automatically size itself to the right dimensions.

With regard to your other issue Frank Provost has commented correctly about that, so following his advice should fix that issue.
Update
As Frank mentioned, increasing your header min-width until the problem goes away is the solution, you can do this by trial and error, or you can measure it. In order to get your header to stop misbehaving you'll need a min-width of around min-width: 770px;. Basically setting the minimum width will prevent the internal children from wrapping down to the next row, but this will only work if the minimum width is the same or larger than the total horizontal width that the children occupy.

Note: If you add extra items to your header you will have to recalculate this value. A quick and visual way to do this on a Mac OSX operating system (the one I'm using now) is to use the region snapshot feature. Using CMD + SHIFT + 4 you'll get a target cursor that will allow you to draw a measured region on the screen. This allows you to measure pixels, you don't actually have to take the screen shot by hitting ESC. I'm sure there are equivalents to this for other operating systems. If not you can just measure each individual child using the browser's inspector, and then sum the result.


text:
Q: How can I automatically forward system mail? I have a system job that fails and sensd me mail that I can read with the mail command. That means I still need to login to the mail server to get the emails and read them. The server supports sending mail to external clients, such as gmail. How can I set mail to automatically forward my mail to my gmail?
I am not the system administrator, and do not have root access on this system.

A: You can create a .forward file in your home directory, and the mail will be forwarded.
cd
echo "username@gmail.com" > .forward
chmod 644 .forward                 # change permission else it won't work

redpajama_set_name: RedPajamaStackExchange


text:
Q: What is the reason that moving iron instrument can measure both AC and DC but moving coil instrument can't? What is the reason that moving iron instrument could measure both AC and DC but moving coil instrument can't?
( moving coil can't respond quickly as the AC changes its direction so stays at zero - is the explanation i have listen till now )
 i tried to get my doubt clear but couldn't find what i was searching for

A: A moving coil meter uses a magnet and this naturally means that the needle moves clockwise for a positive current and anti-clockwise for negative current. The average effect (due to mechanism inertia) and an applied AC frequency of 50 or 60 Hz usually nothing i.e. zero perceptible movement.
A moving iron meter will attract an iron armature irrespective of the direction of the current hence, it will measure AC and usually will measure RMS AC quantities.


text:
Q: VBA: Where to add source formatting and column width? I am new in VBA and learning on my own. I was able to build a code that searches for a value (previously define as "Number") on all sheets and for those sheets that have the specific value in an specific cell it will copy a range from the sheet and then paste it in a new worksheet. It is worth saying that I did not use copy and paste (see code below). The code works just fine, but I would like the new sheet to keep the same formatting as the source. I have tried a couple of things, but the stuff that works means I have to use Copy/Paste type coding, which later in the code gives me problems since it changes the ActiveSheet. Other attempts do not work. In addition I would like to have a fix column width for the ranges that are paste into the new sheet.
A piece of the code in question is below. FYI = the variable Number is defined earlier in the code. Also, earlier in the code I create the new sheet.
My Questions:

*

*Foe the code below, is there a way to keep the formatting from the source, without having to use "copy" and "paste" type coding.

*To the code below, can I somehow fix the width of the columns where the new staff are going to be paste?
If you have a better, more elegant way to write the code, I would appreciate it.
For k = 1 To wscount - 1
    If Worksheets(k).Range("F2").Value = Number Then
        j = j + 1
        Worksheets(wscount + 1).Range(Cells(1, 1 + j), Cells(100, 1 + j)).Value = Worksheets(k).Range("F1:F100").Value
    End If
Next

A: You can assign property value of the source cell to target cell just like what you do with value property.
Option Explicit

Public Sub CopyValueAndFormat()
    For k = 1 To wscount - 1
        If Worksheets(k).Range("F2").Value = Number Then
            j = j + 1
            Worksheets(wscount + 1).Range(Cells(1, 1 + j), Cells(100, 1 + j)).Value = Worksheets(k).Range("F1:F100").Value

            'call setFormat method
            setFormat Worksheets(k).Range("F1:F100"), Worksheets(wscount + 1).Range(Cells(1, 1 + j), Cells(100, 1 + j))
        End If
    Next
End Sub

Private Sub setFormat(source As Range, target As Range)
    'set target format equal to source format
    With target
        .Value = source.Value
        .Interior.Color = source.Interior.Color
        .Font.FontStyle = source.Font.FontStyle
        'add others property to format

        'call AutoFit method to set column width
        .EntireColumn.AutoFit
    End With
End Sub


text:
Q: TSQL: Updating multiple columns not working?? (ASP.NET C#) I have this stored procedure
CREATE PROCEDURE spEditInfo
@username nvarchar(64),
@password nvarchar(64),
@firstname nvarchar(64),
@middlename nvarchar(64),
@lastname nvarchar(64),
@email nvarchar(64) AS
UPDATE Users
SET password=@password,
firstname=@firstname,
middlename=@middlename,
lastname=@lastname,
email=@email
WHERE username=@username;

Here is the problem, though. No matter what values I throw in as the remaining parameters, only password gets changed. Any ideas why?
Here is my calling code:
    SqlCommand cmd = new SqlCommand("spEditInfo", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add("username", SqlDbType.NVarChar, 64);
    cmd.Parameters.Add("password", SqlDbType.NVarChar, 64);
    cmd.Parameters.Add("firstname", SqlDbType.NVarChar, 64);
    cmd.Parameters.Add("middlename", SqlDbType.NVarChar, 64);
    cmd.Parameters.Add("lastname", SqlDbType.NVarChar, 64);
    cmd.Parameters.Add("email", SqlDbType.NVarChar, 64);
    cmd.Parameters["username"].Value = Username.Text;
    cmd.Parameters["password"].Value = Password.Text;
    cmd.Parameters["firstname"].Value = FirstName.Text;
    cmd.Parameters["middlename"].Value = MiddleName.Text;
    cmd.Parameters["lastname"].Value = LastName.Text;
    cmd.Parameters["email"].Value = Email.Text;

    conn.Open();
    cmd.ExecuteNonQuery();
    conn.Close();

EDIT: Ok, I admit I have been wasting time looking at the wrong end. I have the values for the controls initialized during page_load. It is overwriting all of the changes, except for password, which I don't show.
Any suggestions on how to improve this?? I want the committed data to show up on the form.
EDIT: Back to square 1. It seems the data is passed perfectly to the SP, because I have the SP now do a little logging of the params to a txt file outside. However, it seems that the values are not being updated when called by my ASP.NET page. This is peculiar, as with manual execution, the SP works, just not when called via my code.

A: Try
cmd.Parameters.AddWithValue("username", Username.Text);

Instead of using cmd.Parameters.Add this should work for you and make it a little cleaner. Hopefully this help's you out

A: I would run Profiler and see if the values you are expecting to see are really being sent to the proc.

A: You are forgetting the @ in the parameter name:
cmd.Parameters.Add("@username",

A: Honestly, I would suggest using something like the Enterprise Library and the Data Application Block if you can.  It really makes life easier.  My 2 cents.
-Shaun


text:
Q: Why does browser get Symbol.unscopables twice?

with(new Proxy({}, {
  has() { return true },
  get(obj, key, proxy) { return console.log(String(key)) } })
) {
  a--
}

Output in Chrome:
Symbol(Symbol.unscopables)
a
Symbol(Symbol.unscopables)

Output in Firefox:
Symbol(Symbol.unscopables)
Symbol(Symbol.unscopables)
a

As I understand, one getting is related to reading value and the other - to assigning.
It's logical that a-- should write to the same place where a was read from. No, it's not.
But getting value for Symbol.unscopables twice hints us, that it's possible to pass one object for reading and the other one for writing.
Is it really meant to work like that? What does specification say?
Actually, it almost works in Chrome and FF - it's possible to read from one obect and to write into the other one, but it leads to different results:
Update: Safari 10 reads it only once.

var a, b, flag = true

with (a = { x: 7 })
  with (b = { x: 4, get [Symbol.unscopables]() { return { x: flag=!flag } } })
    x++

                 // Chrome   FF       Safari   Edge
console.log(a)   // {x:5}    {x:7}    {x:7}    {x:5}
console.log(b)   // {x:4}    {x:8}    {x:5}    {x:4}

PS: Same question in Russian

A: Per spec, @@unscopables should be read only once for "x++", a far as I can tell.  See details in https://mail.mozilla.org/pipermail/es-discuss/2017-February/047725.html
So both Chrome and Firefox are buggy here.  Safari gets this right.
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1341061 and https://bugs.chromium.org/p/v8/issues/detail?id=5992


text:
Q: String interpolation with multiline indentation Given a multiline string:
body = "\
{
  {
    foo
  }
}"

I want a simple way to embed this into a larger string with indentation applying to each of its lines, so that I get a string such as this:
{
  {
    {
      {
        foo
      }
    }
    {
      {
        foo
      }
    }
  }
}

in which the substring body is supposed to be interpolated twice.
Doing this:
puts "\
{
  {
    #{body}
    #{body}
  }
}
"

produces:
{
  {
    {
  {
    foo
  }
}
    {
  {
    foo
  }
}
  }
}

which makes sense, but is not what I want. I can write the code to generate what I expected, but with much less nicer code.
Is there a nice way to keep the elegance of #{} string interpolation and gain the indentation?

A: It perfectly preserves the indentation. Your body has 2 spaces before the second opening curly. Why would you expect it to know that it's inside two already opened curlies and should magically add some indent?
You might use your own indenter, though:
 indent = ->(anything, level = 0, indenter = "  ") do
   anything.split($/).map.with_index do |line, idx|
     next line if idx.zero?
     line.prepend(indenter * level)
   end.join($/)
 end

 body = "\
 {
   {
     foo
   }
 }"

 puts "\
 {
   {
     #{indent.(body, 2)}
     #{indent.(body, 2)}
   }
 }"

#⇒ {
#    {
#      {
#        {
#          foo
#        }
#      }
#      {
#        {
#          foo
#        }
#      }
#    }
#  }

A: Not exactly what you wanted, but a nice compromise between readability and simplicity of implementation, assuming you use ActiveSupport:
body = "\
{
  {
    foo
  }
}"

puts "\
{
  {
#{body.indent(4)}
#{body.indent(4)}
  }
}
"


text:
Q: how to remember input data in the forms even after refresh page ,the page is in the form of link Code from playingcards-quote.php:
<?php

               <form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>

            <?php//echo $_SERVER['PHP_SELF'];?>
            <input type='hidden' name='submitted' id='submitted' value='1'/>
            <input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
            <input type ='hidden' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' />

            <?php echo $formproc->GetErrorMessage(); ?>
            <?php echo $validation_errors; ?>

                Plastic Coated Paper :

                <select name='paper' id='paper' value='<?php echo htmlentities($disp_paper) ?>' maxlength="50" onchange="chgSelect('coatedpaper');">
                                      <option selected value="0">Select Paper</option>
                                      <option>Black Centered 330</option>
                                      <option>Black Centered 320</option>
                                      <option>Black Centered 315</option>
                                      <option>Black Centered 305</option>
                                      <option>Black Centered 300</option>
                                      <option>Black Centered 280</option>
                                      <option>White Centered 330</option>
                                      <option>White Centered 320</option>
                                      <option>White Centered 315</option>
                                      <option>White Centered 305</option>
                                      <option>White Centered 300</option>
                                      <option>White Centered 280</option>
                                    </select>

            First Name*:

            <input type='text' name='name' id='name'  maxlength="50" />

            Email Id*:

            <input type='text' name='email' id='email' maxlength="50" />

            <input type='submit' name='Submit' value='Submit' />

    verification.php
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

        <title>Custom Playing Cards > Email Verification</title>

        <link href="css/style.css" type="text/css" rel="stylesheet" />

Custom Playing Cards > Email Verification

    <?php

            mysql_connect("localhost", "playingc_diwakar", "P@ssw0rd12345") or die(mysql_error()); // Connect to database server(localhost) with username and password.
    mysql_select_db("playingc_diwakar") or die(mysql_error()); // Select registrations database.

      if(isset($_POST['name']) && !empty($_POST['name']) AND isset($_POST['email']) && !empty($_POST['email'])){
        $name = mysql_escape_string($_POST['name']); // Turn our post into a local variable
        $email = mysql_escape_string($_POST['email']); // Turn our post into a local variable
        if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){
       $msg = 'The email you have entered is invalid, please try again.';
    }else{
        // Return Success - Valid Email
        $msg = 'Your account has been made,
 please verify it by clicking the activation link that has been send to your email.';
    }
    $hash = md5( rand(0,1000) );
    $password = rand(1000,5000);
    $result = mysql_query("INSERT INTO users (username, password, email, hash) VALUES(
    '". mysql_escape_string($name) ."',
    '". mysql_escape_string(md5($password)) ."',
    '". mysql_escape_string($email) ."',
    '". mysql_escape_string($hash) ."') ") or die(mysql_error());
    if (!$result) {
        die('Invalid query: ' . mysql_error());
    }
    $to      = $email; // Send email to our user
    $subject = 'Signup | Verification'; // Give the email a subject
    $message = '

    Thanks for signing up!
    Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below.

    ------------------------
    Username: '.$name.'
    Password: '.$password.'
    ------------------------

    Please click this link to activate your account:
    http://www.alltypesofplayingcards.com/diwakar/customplayingcards/playingcards-quote.php?email='.$email.'&hash='.$hash.'

    '; // Our message above including the link

    $headers = 'From:noreply@yourwebsite.com' . "\r\n"; // Set from headers
    mail($to, $subject, $message, $headers); // Send our email
    }

    ?>

Email Verfication

Please enter your name and email addres

            <?php
        if(isset($msg)){  // Check if $msg is not empty
            echo '
'.$msg.'
'; // Display our message and wrap it with a div with the class "statusmsg".
        }
    ?>

            <form action="" method="post">
                Name:
                <input type="text" name="name" value="" />
                Email:
                <input type="text" name="email" value="" />

                <input type="submit" class="submit_button" value="Sign up" />
            </form>

I have a form playingcards-quote.php in this i have some dropdown item ,name as input and email .i have entered "Black Centered 305" for dropdown and "name" as xyx for input text, when the user click the email input box a link display below the input email and when i click on the link a new tab open as verifcation.php there i enter email and name and submit it ,the link then goes to my gmail id and when i open my gmail account to open my link the page open but i m not abe to keep the data of "Black Centered 305" and "name"  after refresh page .
I have a form playingcards-quote.php in this i have some dropdown item ,name as input and email .i have entered "Black Centered 305" for dropdown and "name" as xyx for input text, when the user click the email input box a link display below the input email and when i click on the link a new tab open as verifcation.php there i enter email and name and submit it ,the link then goes to my gmail id and when i open my gmail account to open my link the page open but i m not abe to keep the data of "Black Centered 305" and "name"  after refresh page .

A: Store your $_POST data into the $_SESSION variable in any key which is you want.
Example: $_SESSION['contactusForm'] = $_POST;
And use variable directly where you want to print value like that:
<input type='text' name='name' id='name'  maxlength="50" value="<?php if(isset($_SESSION['contactusForm']['name'])) { echo $_SESSION['contactusForm']['name'];}?>"/>


text:
Q: Plugin design, having circular dependency issues I have an ecomm application in Project#1.
I have a payment gateway implementation in Project#2 that references Project#1.  It references interfaces so that the gateway is implemented to a contract.
Now I need to actually use the implementation from Project#2 in Project#1.
There is a circular dependency so it isnt' working as it is.
What shall I do? Should I break the interfaces into their own project?  That seems like the easiest approach.
The point is that if I need to create another implementation of a gateway, it can easily be incorporated into Project#1.

A: Putting interfaces in a separate library is often a good idea. It also ensures that you can vary and deploy concrete implementations independently of each other.
As a general rule of thumb, when I design, I start by putting the interfaces together with their consumers, and I then move them to a separate library if the need arises.
As far as I understand your description, you have consumers in each library, so moving them sounds like the correct approach.
If you find that these interfaces are sufficiently unrelated, you may even want to consider putting them in two different libraries.

A: Yes. You should put the interfaces that the plugins should implement (along with any potential common helper code) in a separate assembly.

A: Yes, break your interfaces into another project and reference that project from both.  This way, both are dependent upon an abstraction.

A: This is a dupe of your other question, but it at least has more detail.
If Project 2 is a plugin to Project 1, then Project 1 should not have any dependencies on Project 2, under any circumstances.  Period.
Load Project 2's assembly into Project 1 via reflection/MEF/etc.


text:
Q: Non-cryptography algorithms to protect the data I was able to find a few, but I was wondering, is there more algorithms that based on data encoding/modification instead of complete encryption of it. Examples that I found:

*

*Steganography. The method is based on hiding a message within a message;

*Tokenization. Data is mapped in the tokenization server to a random token that represents the real data outside of the server;

*Data perturbation. As far as I know it works mostly with databases. Adds noise to the sensitive records yet allows to read general and public fields, like sum of the records on a specific day.

Are there any other methods like this?

A: If your purpose is to publish this data there are other methods similars to data perturbation, its called Data Anonymization [source]:

Data masking—hiding data with altered values. You can create a mirror
  version of a database and apply modification techniques such as
  character shuffling, encryption, and word or character substitution.
  For example, you can replace a value character with a symbol such as
  "*" or "x". Data masking makes reverse engineering or detection
  impossible.
Pseudonymization—a data management and de-identification method that
  replaces private identifiers with fake identifiers or pseudonyms, for
  example replacing the identifier "John Smith" with "Mark Spencer".
  Pseudonymization preserves statistical accuracy and data integrity,
  allowing the modified data to be used for training, development,
  testing, and analytics while protecting data privacy.
Generalization—deliberately removes some of the data to make it less
  identifiable. Data can be modified into a set of ranges or a broad
  area with appropriate boundaries. You can remove the house number in
  an address, but make sure you don't remove the road name. The purpose
  is to eliminate some of the identifiers while retaining a measure of
  data accuracy.
Data swapping—also known as shuffling and permutation, a technique
  used to rearrange the dataset attribute values so they don't
  correspond with the original records. Swapping attributes (columns)
  that contain identifiers values such as date of birth, for example,
  may have more impact on anonymization than membership type values.
       Data perturbation—modifies the original dataset slightly by applying techniques that round numbers and add random noise. The range
  of values needs to be in proportion to the perturbation. A small base
  may lead to weak anonymization while a large base can reduce the
  utility of the dataset. For example, you can use a base of 5 for
  rounding values like age or house number because it's proportional to
  the original value. You can multiply a house number by 15 and the
  value may retain its credence. However, using higher bases like 15 can
  make the age values seem fake.
Synthetic data—algorithmically manufactured information that has no
  connection to real events. Synthetic data is used to create artificial
  datasets instead of altering the original dataset or using it as is
  and risking privacy and security. The process involves creating
  statistical models based on patterns found in the original dataset.
  You can use standard deviations, medians, linear regression or other
  statistical techniques to generate the synthetic data.

Is this what are you looking for?
EDIT: added link to the source and quotation.


text:
Q: PostgreSQL: PREPARED statement with ANY($1) I want to create a PREPARED STATEMENT where inputs are some integers whose count is not known.
The way I'm trying to do is
PREPARE prep_select_data AS SELECT ARRAY[$1, id], $1, * FROM tbl_data WHERE id = ANY($1);

The error I'm getting is:
ERROR:  op ANY/ALL (array) requires array on right side
LINE 1: ...ELECT ARRAY[$1, id], $1, * FROM tbl_data WHERE id = ANY($1);
                                                             ^

I'm not able to figure out the issue.
Please advise.
Regards,
Mayank

A: As error says you need to specify your $1 as array (of integers):
-- DEALLOCATE prep_select_data;
PREPARE prep_select_data (int[]) AS
SELECT
    $1 || ARRAY[id], $1, *
FROM
    tbl_data
WHERE
    id = ANY($1);

I changed ARRAY[$1, id] to $1 || ARRAY[id], so result looks like:
EXECUTE prep_select_data ('{1, 2}');
 ?column? | ?column? | id | value
----------+----------+----+-------
 {1,2,1}  | {1,2}    |  1 | aaa
 {1,2,2}  | {1,2}    |  2 | bbb

It's because (from doc):

multidimensional arrays must have
  matching extents for each dimension. A
  mismatch causes an error report.


text:
Q: "All tuners are currently busy" after boot - restarting mythbackend helps I did a fresh install of Mythbuntu 16.04 and 3 identical USB DVB-T tuners. After a reboot if I try to watch live TV, but I get this message:

All tuners  are currently busy

In addition to this message, my mythweb has all the headers in place but the Listings page has no content and says:

Warning at /usr/share/mythtv/mythweb/modules/_shared/tmpl/default/header.php, line 12:
  !!NoTrans: Cannot modify header information - headers already sent by (output started at /usr/share/mythtv/mythweb/modules/_shared/tmpl/default/header.php:152)!!

After a backend restart everything works.
This is possibly related to tuners not being ready before mythbackend starts up.
I did ask about this in mythtv support forum, but not sure why I get the mythweb problem.  The wiki leaves some questions open.
What would be a good solution for the problem?

A: After looking at a few ways to go the simplest workaround was to add  "ExecStartPre=/bin/sleep 15" line into my /lib/systemd/system/mythtv-backend.service file:
[Service]
User=mythtv
EnvironmentFile=-/etc/mythtv/additional.args
ExecStartPre=/bin/sleep 15
ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
StartLimitBurst=10
StartLimitInterval=10m
Restart=on-failure
RestartSec=1

Thanks to bill6502 at forum.mythtv.org!


text:
Q: Access to the path 'C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\Content.IE5' is denied I'm trying to execute via PowerShell Admin a azure cli command to publish:
 az artifacts universal publish --organization https://dev.azure.com/<ORG NAME> --feed <FEED NAME> --name <ARTIFACT NAME> --version 1.0.0 --description "Add description" --path .

and this is the error:
    az : Encountered an unexpected error.
At line:1 char:1
+ az artifacts universal publish --organization https://dev.azure.com/s ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Encountered an unexpected error.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

System.UnauthorizedAccessException: Access to the path
'C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\Content.IE5' is denied.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateRelativeDirectoryHandle(ReadOnlySpan`1
relativePath, String fullPath)
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   at Microsoft.VisualStudio.Services.BlobStore.Common.GlobFactory.Init(String sourceDirectory)
   at Microsoft.VisualStudio.Services.BlobStore.Common.GlobFactory.PerformGlobbing(String sourceDirectory)
   at Microsoft.VisualStudio.Services.BlobStore.Common.PrecomputedHashesGenerator.GetSegmentedPagesFromSource
Directory(String sourceDirectory, Boolean includeEmptyDirectories, ArtifactPublishOptions
artifactPublishOptions)+MoveNext()
   at Microsoft.VisualStudio.Services.Content.Common.TargetBlockExtensions.PostAllToUnboundedAndCompleteAsync
[T](ITargetBlock`1 targetBlock, IEnumerable`1 inputs, CancellationToken cancellationToken)
   at
Microsoft.VisualStudio.Services.BlobStore.Common.PrecomputedHashesGenerator.PaginateAndProcessFiles(String
sourceDirectory, Boolean chunkDedup, IEnumerable`1 pages, CancellationToken cancellationToken, Action`1
hashCompleteCallback)
   at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupManifestArtifactClient.PublishAsync(String
fullPath, ArtifactPublishOptions artifactPublishOptions, String manifestFileOutputPath, CancellationToken
cancellationToken)
   at Microsoft.VisualStudio.Services.Packaging.UPackClientShared.UPackSharedClient.PushWithoutCheckingForDup
licatePackageAsync(String projectNameOrId, String feedNameOrId, String packageName, String packageVersion,
String description, String sourceDirectory, Boolean honorIgnoreOptions, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Packaging.UPackClientShared.UPackSharedClient.PushAsync(String
projectNameOrId, String feedNameOrId, String packageName, String packageVersion, String description, String
sourceDirectory, Boolean honorIgnoreOptions, CancellationToken cancellationToken)
   at ArtifactTool.Commands.UPackPublishCommand.<>c__DisplayClass25_0.<<ExecuteAsync>b__0>d.MoveNext() in
D:\a\1\s\src\ArtifactTool\Commands\UPack\UPackPublishCommand.cs:line 59
--- End of stack trace from previous location where exception was thrown ---
   at ArtifactTool.Commands.UPack.UPackExceptionMapper.WithExceptionHandlingAsync(Func`1 act) in
D:\a\1\s\src\ArtifactTool\Commands\UPack\UPackExceptionMapper.cs:line 39
   at ArtifactTool.Commands.UPackPublishCommand.ExecuteAsync() in
D:\a\1\s\src\ArtifactTool\Commands\UPack\UPackPublishCommand.cs:line 63
   at ArtifactTool.Commands.CommandBase.OnExecuteAsync() in
D:\a\1\s\src\ArtifactTool\Commands\CommandBase.cs:line 105
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo
method, Object instance, Object[] arguments) in
C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 77
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext
context) in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 62
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b
__0>d.MoveNext() in
C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 25
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass126_0.<OnExecute>b__0()
in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 505
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) in
C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 611
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context)
in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 57
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext
context) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](IConsole console,
String[] args) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line
130
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](String[] args) in
C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 112

I can't seem get past to this. I've already tried to setProfileEnvironment to true from C:\Windows\System32\inetsrv\config\applicationHost.config but still error persist. Can you suggest something that I can try to setup in my local machine?
I'm following trying setup in Azure DevOps from this article https://medium.com/@ganeshsirsi/how-to-run-owasp-zap-security-tests-part-of-azure-devops-ci-cd-pipeline-484da8793a12
Thanks!

A: Note below points:

*

*Run this command in Admin mode.

*This extension requires CLI 2.2.0 or higher.

*Refer this doc for it's appropriate usage.


text:
Q: Which is the best way to redirect URL? Should we be using Response.Redirect or are there any other commands for redirecting? I'm new to Csharp ASP.NET and MVC. I'm trying to customize the login page and was trying to keep a condition which would  Check if the Login is Authenticated or not. If login is done then next time while the user enters           the url: localhost:portno/account/login  the url will be directed to localhost:portno/home/index. I used Respond.Redirect methon using
@model LearningMvc.Models.LoginViewModel

Full code is mentioned below:
    @model LearningMvc.Models.LoginViewModel

@{
    ViewBag.Title = "Log in";
}

@ViewBag.Title.

            @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
            {
                @Html.AntiForgeryToken()
                if (Request.IsAuthenticated)
                    {
                        Response.Redirect("~/home/index");
    }
                else {

Use a local account to log in.

                    @Html.ValidationSummary(true)

                        @Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" })

                            @Html.TextBoxFor(m => m.UserName, new { @class = "form-control" })
                            @Html.ValidationMessageFor(m => m.UserName)

                        @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })

                            @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Password)

                            @Html.CheckBoxFor(m => m.RememberMe)
                            @Html.LabelFor(m => m.RememberMe)

                        <input type="submit" value="Log in" class="btn btn-default" />

                    @Html.ActionLink("Register", "Register") if you don't have a local account.

            }
            }

            @Html.Partial("_ExternalLoginsListPartial", new { Action = "ExternalLogin", ReturnUrl = ViewBag.ReturnUrl })

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

My concern is with only the function
if (Request.IsAuthenticated)
                    {
                        Response.Redirect("~/home/index");
    }
                else {}

As I run the code in web browser I get an exception in Visual studio which is mentioned below:
    System.Web.HttpException was unhandled by user code
    HResult=-2147467259
    Message=Server cannot append header after HTTP headers have been sent.
    Source=System.Web
    ErrorCode=-2147467259
    WebEventCode=0
    StackTrace:
       at System.Web.HttpResponse.AppendHeader(String name, String value)
       at System.Web.HttpResponse.AddHeader(String name, String value)
       at System.Web.HttpResponseWrapper.AddHeader(String name, String value)
       at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.GetFormInputElement(HttpContextBase httpContext)
       at System.Web.Helpers.AntiForgery.GetHtml()
       at System.Web.Mvc.HtmlHelper.AntiForgeryToken()
       at ASP._Page_Views_Shared__LoginPartial_cshtml.Execute() in c:\Users\Sanjog Sigdel\Documents\Visual Studio 2013\Projects\LearningMvc\LearningMvc\Views\Shared\_LoginPartial.cshtml:line 6
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
       at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
       at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName)
       at ASP._Page_Views_Shared__Layout_cshtml.Execute() in c:\Users\Sanjog Sigdel\Documents\Visual Studio 2013\Projects\LearningMvc\LearningMvc\Views\Shared\_Layout.cshtml:line 28
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer)
       at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
       at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
       at System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, HelperResult content)
       at System.Web.WebPages.WebPageBase.Write(HelperResult result)
       at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
       at System.Web.WebPages.WebPageBase.PopContext()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
  InnerException:

The code works after I press continue in visual Studio.
What is creating that exception?

A: You should not be doing any non-presentation logic in your view!!  This should never be in a view:
if (Request.IsAuthenticated)
{
  Response.Redirect("~/home/index");
}

The problem exists because the view is executing and it's already sent headers about the response type (text/html in this case).
Instead your logic should be in the controller:
public ActionResult MyAction()
{
  /// ... code

  if (Request.IsAuthenticated)
  {
    return RedirectToAction("index", "home");
  }

  return View();
}


text:
Q: Modify table dynamically in dbSet I am using EF Core 3.0 and have a requirement to change table name dynamically for which I am thinking to create an extensiion method.
Exact requirement:
I have two tables 'Sample' & 'Sample_History' and I want to acheive somthing like this:
To get records from 'Sample' table: DbContext.Samples.ToList();
To get records from 'Sample_History' table: DbContext.Samples.AsHistory().ToList();
Here, i want to dynamically change name of table from 'Sample' to 'Sample_History' using extension method 'AsHistory'. The obvious way is to get the SQL and change it which i want to aviod. Is there some way I can change entity in dbSet itself?

A: If i understand your requirement correct then you can try this:
public static class DbSetExtensions
{
    public static DbSet<SampleHistory> AsHistory(this DbSet<Sample> sample)
    {
        return sample.GetService<DatabaseContext>().SampleHistory;
    }
}

And for make your extension method generic:
public static class DbSetExtensions
{
    public static DbSet<T> ToDbSet<T>(DbSet<Sample> dbSet) where T : class
    {
        return dbSet.GetService<DatabaseContext>().Set<T>();
    }
}


text:
Q: Scrolling in Android Studio with laptop touchpad sometimes doesn't work I've had this issue for a while now, with absolutely no mention of it anywhere.
The problem is that, most of the times, I can't scroll through my editor using the two finger gesture (I'm using Windows 10).
Also, sometimes, it can scroll but with the zooming pinch. (Weird, huh?)
Further info:
OS: Windows 10 x64
Laptop: Lenovo Z50
Android Studio Version: 2.3.3
P.S: When I connect an external mouse, it works just fine. And this problem only exists inside Android Studio

A: I faced the same issue with my lenovo laptop, all I did was minimized all open application and refreshd window you can say the desktop where you see your wallpaper(Right click on window(HomeScreen)) and click refresh) in my case I used Fn+F5 and it solved my issue.

A: It sounds strange, but true. I was facing issue in Android studio arctic fox patch 3. Whenever I opened Excel in my laptop, if I scroll in studio, it was scrolling in Excel. Just check if you have opened any applications which involves scrolling(it my case the culprit was Office Excel).


text:
Q: Visual Basic If Then error I have a VB project that I am attempting to use some VBA code that locates duplicate rows based on the first column of an excel sheet, and creates a flag of "1", however the VBA code when used in VB gives the error:
InvalidCastException was unhandled
Overload resolution failed because no Public '<>' can be called with these arguments:
    'Public Shared Operator <>(a As String, b As String) As Boolean':
        Argument matching parameter 'a' cannot convert from '__ComObject' to 'String'.
Public Sub btnRun_Click(sender As System.Object, e As System.EventArgs) Handles btnRun.Click

    Dim xlApp As Excel.Application
    Dim xlWorkBook1 As Excel.Workbook ' Interactions
    Dim xlWorkBooks As Excel.Workbooks
    Dim MainSheet1 As Excel.Worksheet

    xlApp = New Excel.Application
    xlWorkBooks = xlApp.Workbooks
    xlWorkBook1 = xlWorkBooks.Open(File1_name)
    xlApp.Visible = False

    MainSheet1 = xlWorkBook1.Sheets(1)
    MainSheet1.Activate()

    Dim InteractionRows As Long = MainSheet1.UsedRange.Rows.Count ' Total number of rows in the Interaction worksheet
    Dim Duplicate_Found_Index As Long ' Stores all match index values for duplicate interactions
    Dim Duplicate_ID As Long ' Defining the first column to loop through and match duplicate interactions

    ' **** Duplicate Interaction ****
    ' Flag Creation
    For Duplicate_ID = 1 To (InteractionRows)
        If MainSheet1.Cells(Duplicate_ID, 1) <> "" Then 'checking if the cell is having any item, skipping if it is blank.
            Duplicate_Found_Index = xlApp.WorksheetFunction.Match(MainSheet1.Cells(Duplicate_ID, 1), MainSheet1.Range("A1:A" & InteractionRows), 0) 'getting match index number for the value of the cell.
            If Duplicate_ID <> Duplicate_Found_Index Then 'if the match index is not equals to current row number, then it is a duplicate value
                MainSheet1.Cells(Duplicate_ID, 34) = "1" ' Print the flag "1" in the 34th column if duplicate found
            Else
                MainSheet1.Cells(Duplicate_ID, 34) = "0" ' Print the flag "0" in the 34th column if no duplicate
            End If
        End If
    Next
End Sub

Any assistance would be greatly appreciating in understanding why this error is occuring

A: The call MainSheet1.Cells(Duplicate_ID, 1) gives Nothing (null) when cell is blank. So instead of matching it with a string, check it for null value.
If MainSheet1.Cells(Duplicate_ID, 1) IsNot Nothing Then

End If

A: Use IsNot instead for <>
            If Duplicate_ID IsNot Duplicate_Found_Index Then 'if the match index is not equals to current row number, then it is a duplicate value
                MainSheet1.Cells(Duplicate_ID, 34) = "1"
            Else
                MainSheet1.Cells(Duplicate_ID, 34) = "0"
            End If


text:
Q: Get the other column on the same row Here is my MySQL Table:
DB name: dbname Table name: tbname
column1    |   column2
Info 1     |   Other 1
Info 2     |   Other 2

What I'm trying to get is: In PHP I have the value Info 1 as $info, I want to search in the DB to get Other 1 on the same row, and add it to variable $other.
How do I do that? Thanks in advance.

A: First you need to create connection like
$con = mysqli_connect($hostname,$user,$password,$database);

Then do
$selectquery="SELECT column2 FROM tbname WHERE column1 = '$info'";
$query = mysqli_query($con,$selectquery) or die(mysqli_error());
$result=mysqli_fetch_array($query);


text:
Q: Examples on why not to use divide and conquer I know divide and conquer is a good approach to solve problems with large input size n, but according to Neapolitan's algorithms text book, there are some situations in which we should avoid divide and conquer approach:
"1. An instance of size n is divided into two or more instances each almost of size n.
2.  An instance of size n is divided into almost n instances of size n/c , where c is a constant "[Foundation of algorithms - Neapolitan ].
Besides Fibonacci algorithm, Can anyone please give me an example for each of these situation?
Thank you.


text:
Q: Jump to Eclipse editor short key Currently I'm in Help view. What is short key to jump editor view? CTRL+E shows list of open files and I can select and get into it. But I would like to jum to editor that is currently visible, but not active.
Eclipse version - Mars

A: There is a command Activate Editor, which is not bound to any key. However, you can specify a key binding to the command and use it.
Open your Preferences dialog and select General > Keys on the left tree, or hit Ctrl+Shift+L twice. Find Activate Editor in the right pane. You can use filter to find it fast. Then specify the key binding in the below.


text:
Q: How do Rorge and Biter end up with the Brave Companions? I don't see how Rorge and Biter were recruited in Brave Companions company.
At first, they were with Yoren's crew, heading to the Wall. They were attacked by Amory Lorch and escaped from their cage with an axe Arya gave them.
Were they captured by Amory Lorch or did they hide from the attackers ? Amory Lorch looked decided too kill evreybody of Yoren's crew.
Later, we see them with the Brave Companions. I don't think Amory would have sell them or given them to Vargo Hoat because Amory and Vargo disliked each other.

A: They joined Amory Lorch after Arya saved them from the fire however it is not clear how they joined the Manticore's men. We only see them from Arya's POV and Arya did not see them since the time she saved them from fire surrounding their cage till she saw them again in Harrenhal, wearing Lannister uniforms.
From Arya's POV in ACOK:

Then she saw the three near the end of the column.
Rorge had donned a black halfhelm with a broad iron nasal that made it
  hard to see that he did not have a nose. Biter rode ponderously beside
  him on a destrier that looked ready to collapse under his weight.
  Halfhealed burns covered his body, making him even more hideous than
  before.
But Jaqen H'ghar still smiled. His garb was still ragged and filthy,
  but he had found time to wash and brush his hair. It streamed down
  across his shoulders, red and white and shiny, and Arya heard the
  girls giggling to each other in admiration.
I should have let the fire have them.

Later, Brave Companions brought some northern captives to Harrenhal. Arya forced Jaqen to help her free them. Jaqen brought them along.
The Weasel Soup incident is:

 The Brave companions switched sides and joined the Starks. That
 resulted in occupation of Harrenhal by Roose Bolton and death of Amory
 Lorch, Lannister appointed commander of Harrenhal. Arya, Jaqen, Rorge and biter helped by freeing the Northmen, unaware that this was the plan of Brave companions all along.

So They helped Jaqen and Arya in the Weasel Soup incident:

Then she heard the ugly sound of Rorge's voice. "Cook," he shouted.
  "We'll take your bloody broth." Arya let go of the spoon in dismay. I
  never told him to bring them. Rorge wore his iron helmet, with the
  nasal that half hid his missing nose. Jaqen and Biter followed him
  into the kitchen.
"The bloody broth isn't bloody ready yet," the cook said. "It needs to
  simmer. We only now put in the onions and-"
"Shut your hole, or I'll shove a spit up your ass and we'll baste you
  for a turn or two. I said broth and I said now."

Later, They apparently joined the Brave companions after the Weasel Soup incident. They told so to Ser Robbet Glover after the incident:

"This of the soup, that was clever," the man Glover was saying. "I did
  not expect that. Was it Lord Hoat's idea?"
Rorge began to laugh. He laughed so hard that snot flew out the hole
  where his nose had been. Biter sat on top of one of the dead men,
  holding a limp hand as he gnawed at the fingers. Bones cracked between
  his teeth.
"Who are you men?" A crease appeared between Robett Glover's brows.
  "You were not with Hoat when he came to Lord Bolton's encampment.
  Are you of the Brave Companions?"
Rorge wiped the snot off his chin with the back of his hand. "We are now."
"This man has the honor to be Jaqen H'ghar, once of the Free City of
  Lorath. This man's discourteous companions are named Rorge and Biter.
  A lord will know which is Biter." He waved a hand toward Arya. "And
  here-"
"I'm Weasel," she blurted, before he could tell who she really was.

Then Jaqen left for good and the two criminals appear to have been associated with the Qohorik mercenaries known as the Brave companions from that point onwards:

 Until the eventual re-capture of Harrenhal by Gregor Clegane and
 desertion of the Brave companions in different bands, trying to find a
 passage across the narrow sea. The two criminals took to terrorizing
 the peasants in Riverlands.


text:
Q: Use linearisation of a certain function to approximate $\sqrt[3]{30}$ Background
Find the linearisation of the function
$$f(x)=\sqrt[3]{{{x^2}}}$$
at
$$a = 27.$$
Then, use the linearisation to find
$$\sqrt[3]{30}$$
My work so far
Applying the formula
$${f\left( x \right) \approx L\left( x \right) }={ f\left( a \right) + f^\prime\left( a \right)\left( {x – a} \right),}$$
where
$${f\left( a \right) = f\left( {27} \right) }={ \sqrt[3]{{{{27}^2}}} }={ 9.}$$
Then, the derivative using the power rule:
$${f^\prime\left( x \right) = \left( {\sqrt[3]{{{x^2}}}} \right)^\prime }={ \left( {{x^{\frac{2}{3}}}} \right)^\prime }={ \frac{2}{3}{x^{\frac{2}{3} – 1}} }={ \frac{2}{3}{x^{ – \frac{1}{3}}} }={ \frac{2}{{3\sqrt[3]{x}}}.}$$
then
$${f^\prime\left( a \right) = f^\prime\left( {27} \right) }={ \frac{2}{{3\sqrt[3]{{27}}}} }={ \frac{2}{9}.}$$
Substitute this in the equation for $L(x)$:
$${L\left( x \right) = 9 + \frac{2}{9}\left( {x – 27} \right) }={ 9 + \frac{2}{9}x – 6 }={ \frac{2}{9}x + 3.}$$
Then, to use this linearisation to find
$$\sqrt[3]{30}$$
I perform the following $\Delta x = x – a = 30 – 27 = 3$ as the condition is $x =30$ and the staring point is $a=27$
As the the derivative of this particular function is given by $f\left( x \right) = \sqrt[\large 3\normalsize]{x}$
$${f'\left( x \right) = {\left( {\sqrt[\large 3\normalsize]{x}} \right)^\prime } } = {{\left( {{x^{\large\frac{1}{3}\normalsize}}} \right)^\prime } } = {\frac{1}{3}{x^{ – \large\frac{2}{3}\normalsize}} } = {\frac{1}{{3\sqrt[\large 3\normalsize]{{{x^2}}}}},}$$
and its value at point $a$ is equal to
$${f'\left( {a} \right) = \frac{1}{{3\sqrt[\large 3\normalsize]{{{{27}^2}}}}} } = {\frac{1}{{3 \cdot {3^2}}} = \frac{1}{{27}}.}$$
Thus, getting the solution
$${f\left( x \right) \approx f\left( {a} \right) + f'\left( {a} \right)\Delta x,\;\;}\Rightarrow {\sqrt[\large 3\normalsize]{{30}} \approx \sqrt[\large 3\normalsize]{{27}} + \frac{1}{{27}} \cdot 3 } = {3 + \frac{1}{9} } = {\frac{{28}}{9} \approx 3,111.}$$
Is my process correct so far? Or, did I go wrong in the second part? Also, as $a=27$ is from the original linearisation, this would be brought into the linearisation approximation for $\sqrt[3]{30}$?

A: Just to show you something a little bit different, we can do this with the binomial theorem.
$(a+b)^k = a^k + k a^{k-1}b + \frac {k(k-1)}{2} a^{k-2}b^2 + \cdots$
You learned this in algebra / pre-calculus with integers.  It actually works for all real numbers.
$(27 + 3)^\frac 13 = 27^\frac 13  + \frac 13 (27^{-\frac 23})(3) - \frac 19 (27^{-\frac 53})(3^2)+\cdots$
$3 + \frac 19 - \frac 1{3^5}+ \cdots$
The first 2 terms would be all that you would use for a linear approximation, but  for additional precision you can extend.

A: The second part of your analysis is correct. The function that you want to approximate is $f(x)=\sqrt[3]{{x}}$ at $a=27$, not $g(x)=\sqrt[3]{{x^2}}$. So
$${f'(x) = {\left( {\sqrt[\large 3\normalsize]{x}} \right)^\prime } } = {{\left( {{x^{\large\frac{1}{3}\normalsize}}} \right)^\prime } } = {\frac{1}{3}{x^{ – \large\frac{2}{3}\normalsize}} } = {\frac{1}{{3\sqrt[\large 3\normalsize]{{{x^2}}}}},}$$
and its value at point $a$ equals
$${f'(a) = \frac{1}{{3\sqrt[\large 3\normalsize]{{{{27}^2}}}}} } = {\frac{1}{{3 \cdot {3^2}}} = \frac{1}{{27}}.}$$
Therefore since $f(a)=\sqrt[3]{27}=3$,
$$f(x)\approx L\left( x \right) ={ f\left( a \right) + f^\prime\left( a \right)\left( {x – a} \right)}=3+\frac{1}{27}\left(x-27\right).$$
Hence, the estimate for $\sqrt[3]{30}$ is
$$f(30)\approx3+\frac{1}{27}\left(30-27\right)=3+\frac{1}{9}=3.\overline{1}.$$
The actual value of $\sqrt[3]{30}$ (up to the fifth decimal place) is $3.10723$, so the linear approximation at $a=27$ does quite well.

A: There is something wrong : your definition of $f$ is not consistant : sometimes you use $f(x)=\sqrt[3]{x^2}$ and other times $f(x)=\sqrt[3]{x}$... You should only use the second one I think. Get that right and you got the good idea !


text:
Q: Select to get data in mysql My table structure
id     name

1      bhagi
1      user
1      amit
1      sumit
2      bhagi
2      chinmay
2      sumit
3      rashmi
3      RBS
4      sumit
4      amit
4      bhagi
4      rashmi
4      RBS

I want result
id     name     result

1      bhagi    1/4(position of bhagi for id 1(1) / no of time that id is present(4))
1      user     2/4
1      amit     3/4
2      bhagi    1/3
2      chinmay  2/3
3      rashmi   1/2
4      sumit    1/5
4      amit     2/5
4      bhagi    3/5
4      rashmi   4/5

My requirement is to get the result column
Example: for Id 1
There a re 4 id present bhagi,user,amit and sumit
for bhagi the result would be 1/4(because position of bhagi is 1 in the db and no of id 1 present is 4)
similarly for others
and i want to ignore when result is 1.
i tried but don't know to to calculate the denominator part. means the no of times the id is present.
[EDIT]
I have tried
 select id,
   name,
   IF(@LAST=(@LAST:=id), @CURROW := @CURROW + 1, @CURROW:=1) AS ROW_NUMBER
 FROM FEEDBACK_STORE
 JOIN (SELECT @CURROW := 0, @LAST:=0) R

its giving result
id    name   row_number

1     bhagi    1
1     user     2
1     amit     3
1     sumit    4
2     bhagi    1
2     chinmay  2
2     sumit    3
3     rashmi   1
3     RBS      2
4     sumit    1
4     amit     2
4     bhagi    3
4     rashmi   4
4     RBS      5

i need the denominator part only the count of id eg: for id 1-4 , for id 2-3,for id 3-2,for id 4-5
[/EDIT]
Please help
Thanks in advance

A: You could use a subquery to calculate the number of rows with the same id and a smaller or equal name:
select  t1.id
,       t1.name
,       concat(
        (
        select  count(*)
        from    Table1 t2
        where   t1.id = t2.id
                and t2.name <= t1.name
        ), '/', total.cnt)
from    Table1 t1
join    (
        select   id
        ,        count(*) as cnt
        from     Table1
        group by
                 id
        ) as total
on      t1.id = total.id
order by
        t1.id
,       t1.name

Live example at SQL Fiddle.
Or, with the faster but dirtier variable trickery:
select  t1.id
,       t1.name
,       concat(
            if(@last=(@last:=t1.id), @cur:=@cur+1, @cur:=1),
            '/',
            total.cnt)
from    Table1 t1
join    (
        select @cur := 0, @last:=0
        ) r
join    (
        select   id
        ,        count(*) as cnt
        from     Table1
        group by
                 id
        ) as total
on      t1.id = total.id

Also at SQL Fiddle.


text:
Q: SQL/C# - Apply a function to columns within a SQL query Is there a way to parse a given SQL SELECT query and wrap each column with a function call e.g. dbo.Foo(column_name) prior to running the SQL query?
We have looked into using a regular expression type 'replace' on the column names, however, we cannot seem to account for all the ways in which a SQL query can be written.
An example of the SQL query would be;
SELECT
    [ColumnA]
  , [ColumnB]
  , [ColumnC] AS [Column C]
  , CAST([ColumnD] AS VARCHAR(11)) AS [Bar]
  , DATEPART([yyyy], GETDATE()) - DATEPART([yyyy], [ColumnD]) AS [Diff]
  , [ColumnE]
FROM [MyTable]
WHERE LEN([ColumnE]) > 0
ORDER BY
    [ColumnA]
  , DATEPART([yyyy], [ColumnD]) - DATEPART([yyyy], GETDATE());

The result we require would be;
SELECT
    [dbo].[Foo]([ColumnA])
  , [dbo].[Foo]([ColumnB])
  , [dbo].[Foo]([ColumnC]) AS [Column C]
  , CAST([dbo].[Foo]([ColumnD]) AS VARCHAR(11)) AS [Bar]
  , DATEPART([yyyy], GETDATE()) - DATEPART([yyyy], [dbo].[Foo]([ColumnD])) AS [Diff]
  , [dbo].[Foo]([ColumnE])
FROM [MyTable]
WHERE LEN([dbo].[Foo]([ColumnE])) > 0
ORDER BY
    [dbo].[Foo]([ColumnA])
  , DATEPART([yyyy], [dbo].[Foo]([ColumnD])) - DATEPART([yyyy], GETDATE());

Any or all of the above columns might need the function called on them (including columns used in the WHERE and ORDER BY) which is why we require a query wide solution.
We have many pre-written queries like the above which need to be updated, which is why a manual update will be difficult.
The above example shows that some result columns might be calculated and some have simply been renamed. Most are also made up with joins and some contain case statements which I have left out for the purpose of this example.
Another scenario which would need to be accounted for is table name aliasing e.g. SELECT t1.ColumnA, t2.ColumnF etc.
Either a SQL or C# solution for solving this problem would be ideal.

A: Instead of replacing each occurrence of every column, you can replace the statement...
FROM MyTable

...with a subselect that includes all existing columns with the function call:
FROM (
    SELECT dbo.Foo(ColumnA) AS ColumnA, dbo.Foo(ColumnB) AS ColumnB,
        dbo.Foo(ColumnC) AS ColumnC --etc.
    FROM MyTable
) AS MyTable

The rest of the query can remain unchanged. In case of table aliasing, you simply replace AS Table1 with AS t1.
Another option you should consider is to create views in your database that would be essentially the subselect. Combined with a naming convention, you can easily replace the occurrences in your FROM (and JOIN) statements with the view name:
FROM MyTable_Foo AS t1

If you want to replace all queries that you'll ever use, consider renaming the tables and creating views that are named like the old tables.

On a more general note: You should reconsider your approach to the underlying problem, since what you are doing here takes away much of the power of SQL. The worst thing here is that once you call the function on all columns, you will not be able to use the indices on those columns, which could mean a serious hit on DB performance.


text:
Q: Express and Jade, passing in variables I'm trying to install this captcha plugin and this is what I have so far (straight from their code, just kind of tweaked up to my style)
Here is captcha and steps I'm following: https://github.com/mirhampt/node-recaptcha
In my router.js file:
app.get('/account/verification/:token/', require('./views/account/verification/index').verifyHuman);
In my /views/account/verification/index.js file:
exports.verifyHuman = function(req, res, next){
  var Recaptcha = require('recaptcha').Recaptcha;
  var recaptchaKeys = req.app.config.recaptchaKeys;
  var recaptcha = new Recaptcha(recaptchaKeys.publicKey, recaptchaKeys.privateKey);

  console.log(recaptcha.toHTML()); //this returns a script tag with an iframe and stuff in it

  res.render('account/verification/captcha', {
      layout: false,
      locals: {
          recaptcha_form: recaptcha.toHTML()
      }
  });
};

and then my /views/account/verification/captcha.jade file:
      div#captcha
  script(type='text/template', id='tmpl-captcha-verification')
    form#captcha-verification
      #{recaptcha_form}

      button.btn.btn-primary.btn-captcha-verification(type='button') Check Captcha

I can't get it do display the captcha script. It comes up as undefined but in a strange way. This is what appears in my console:
<script type="text/template" id="tmpl-captcha-verification"><form id="captcha-verification"><undefined></undefined><button type="button" class="btn btn-primary btn-captcha-verification">Check Captcha</button></form></script>

I can even try and do #{layout}, and I get this in the console:
<script type="text/template" id="tmpl-captcha-verification"><form id="captcha-verification"><false></false><button type="button" class="btn btn-primary btn-captcha-verification">Check Captcha</button></form></script>

It's like jade is trying to format it, but one of the main issues is that it's undefined, when the variable in my /views/account/verification/index.js file that I console.log isn't.
Also, note that if I do != recaptcha_form, it just shows the form in the html as it would if this != recaptcha_form code wasn't even there.
I've searched around other questions for this answer and am still pretty confused. Any help would be greatly appreciated. Thanks


text:
Q: Keyboard shortcut to exit matlab command prompt? I've been using the command-line matlab interface (matlab --nodesktop) a lot lately.
When I want to jump out of matlab and back to my bash shell, my instinct is to do Ctrl+D. I guess the bash and python shortcuts conditioned me to automatically do Ctrl+D. Problem is, matlab wants me to type exit instead of hitting Ctrl+D.
Is there a way to convince matlab to let me exit the command line interface by doing Ctrl+D?

A: I have just checked and it is indeed possible to exit matlab with a hotkey.
The default setting is Ctrl+Q but of course you can change this as described on the Mathworks blog.
Setting it is most easily done without -nodesktop, but the hotkeys do work in nodesktop mode.


text:
Q: convolving a gaussian mask on an image, without using built-in functions I want to apply canny edge detection to an image without using the cvcanny function, so a part of the required steps is to apply the gaussian mask for which i have 2 masks for x and y direction. Now the problem is that whenever i try the convolution of the mask onto my image, the execution breaks due to "access violation".
Why does this happen and how can i overcome this?
//DECLARATIONS..
double maskx[3][3];
double masky[3][3];
double convx[1000][1000]={0};
double convy[1000][1000]={0};
double M[1000][1000]={0};  //magnitude
double slope[1000][1000];

int gaussian_mask()
{
int MaskRadius=SIGMA*3;
double eq1;
double exp=2.71828183;

for(int p=-MaskRadius; p<=MaskRadius; p++)
{
for(int q=-MaskRadius; q<=MaskRadius; q++)
{
    eq1=-1*(p*p + q*q)/(2*SIGMA);
    maskx[p+MaskRadius][q+MaskRadius]=-1*q*(pow(exp,eq1));
    masky[p+MaskRadius][q+MaskRadius]=-1*p*(pow(exp,eq1));
}
}

return MaskRadius;
}

IplImage* convolve(IplImage *im)
{
int MaskRadius=gaussian_mask();
int row=im->width;
int col=im->height;
printf("row: %d, col= %d",row,col);

//-----------------------------------------------------------------------------------//

IplImage *pix=cvCreateImage(cvGetSize(im), im->depth, 1);      //converting 3 channel   to 1 channel
cvSetImageCOI(im,1);
cvCopy(im,pix);
cout<<endl<<"No. of channels = "<<pix->nChannels;
//-----------------------------------------------------------------------------------------------//

for(int i=MaskRadius; i<=row-MaskRadius; i++)             //convolving the image
{
uchar* ptr1 = (uchar*) (pix->imageData + i * pix->widthStep);
uchar* ptr0 = (uchar*) (pix->imageData + (i-1) * pix->widthStep);
uchar* ptr2 = (uchar*) (pix->imageData + (i+1) * pix->widthStep);
for(int j=MaskRadius; j<=col-MaskRadius; j++)
 {
     cout<<endl<<i<<" , "<<j;
     convx[i][j]=(double)ptr1[j-1]*maskx[1][0]+ptr1[j]*maskx[1][1]+ptr1[j+1]*maskx[1][2] + (ptr2[j-1]*maskx[0][0]+ptr2[j]*maskx[0][1]+ptr2[j+1]*maskx[0] + ptr0[j-1]*maskx[2][0]+ptr0[j]*maskx[2][1]+ptr0[j+1]*maskx[2][2]);

     convy[i][j]=(double)ptr1[j-1]*masky[1][0]+ptr1[j]*masky[1][1]+ptr1[j+1]*masky[1][2] + (ptr2[j-1]*masky[0][0]+ptr2[j]*masky[0][1]+ptr2[j+1]*masky[0] + ptr0[j-1]*masky[2][0]+ptr0[j]*masky[2][1]+ptr0[j+1]*masky[2][2]);

    double eq2=pow(convx[i][j],2)+pow(convy[i][j],2);
    M[i][j]=(double)sqrt(eq2);
}
}

A: The access violation can happen when you are creating the mask, when you are converting the image, or when you are doing the convolution. You can start by commenting out all code and then uncommenting it from top, while observing which line/block gives you the error. Also use the debugger of the IDE to see the values of indexes, and check for those going out of range.


text:
Q: how to separate a column value into multiple columns, in rule mining I have below data frame where I want to separate my rule column into separate columns.
Data :
          rules    support  confidence  lift count
5   {32,39,6} => {65}   0.00055 1.00    22.3    12
6   {39,6,65} => {32}   0.00055 0.86    23.4    12
9   {14,16,26} => {4}   0.00051 0.79    8.9     11
13  {16,20,4} => {26}   0.00069 0.71    8.0     15
16  {16,26,33} => {4}   0.00055 0.67    7.6     12
1   {53} => {31}        0.00087 0.66    89.6    19

Expected output :
lhs          rhs
{32,39,6}   {65}
{39,6,65}   {32}
{14,16,26}  {4}

I have tried the below code
rules = sapply(assoc_rules$rules,function(x){
    x = gsub("[\\{\\}]", "", regmatches(x, gregexpr("\\{.*\\}", x))[[1]])
    x = gsub("=>",",",x)
    x = str_replace_all(x," ","")
    return( x )
})


text:
Q: For C++, what is the rule of feasibility of defining a function in another function? I already know that a function object can be defined in another function's body. While I try to define a simple function in main function, error occurs.
int main(){
    void f(){}
    return 0;
}

Could a function be defined in another function?
Could a class and some of its member functions defined separately in another function or another class body? (bold words edit)
Is there a rule to follow?
edit:Thank you very much! But I misswrote class body as function, i.e the bold words, and now it is corrected. Could you tell more?
edit2:By the second question I should have writen:could a member function of a class defined in a function named F while the class declaration is also in the function F,and whatif F is a class defination? Just like these two:
//F is a function
int F(){
    class A{
        int f();
    };
    int A::f(){}
}

// F is a class
class F(){
    class A{
        int f();
    };
    int A::f(){}
}

A:
Could a function be defined in another function?

Not directly. There's no particular reason why not; the language simply doesn't allow it. You can declare a function inside another; but you can only define it in the surrounding namespace.
You can define named lambda variables, and local classes containing member functions.
int main() {
    auto l = []{std::cout << "lambda\n";};
    struct s {static void f() {std::cout << "member\n";}};

    l();
    s::f();
}

Could a class and some of its member functions defined seperaterly in another function or another function?

Class members can only be defined inside the class or (for non-local classes) in a namespace. Unless the class is local, you can't define any member inside another function; if it is local, members can only be defined inside the class.

A: Any function shall be defined in a namespace region outside any other function but may be declared in any function block scope.
For example
#include <iostream>

void f( int ) { std::cout << "f( int )" << std::endl; }
void f( short ) { std::cout << "f( short )" << std::endl; }

int main()
{
   void f( int );

   f( 1 );

   {
      void f( short );

      f( 2 );
   }
}

As for classes then a class can be defined inside a function. In this case it shall not have static member functions and all non-static member functions shall be defined inside the class. For example
#include <iostream>

int main()
{
   struct Multiply
   {
      constexpr unsigned int operator ()( unsigned int x, unsigned int y ) const
      {
         return ( y == 0 ? 0 : x + operator ()( x, --y ) );
      }
   };

   std::cout << Multiply()( 10, 10 ) << std::endl;
}

If a class is defined in some name space scope then its member functions can be defined separatly.
For example
#include <iostream>

struct Divide
{
    constexpr unsigned int operator ()( unsigned int x, unsigned int y ) const;
};

constexpr unsigned int Divide::operator ()( unsigned int x, unsigned int y ) const
{
    return ( x < y ? 0 : 1 + operator ()( x - y, y ) );
}

int main()
{
   std::cout << Divide()( 100, 10 ) << std::endl;
}

As for lambda expressions they are not functions. In fact they are anonymous local classes with defined operator function.

A:
Could a function be defined in another function?

No.  You can declare a function anywhere, but you cannot define (that is, implement) a function inside another function (the exception being lambda functions).

Could a class and some of its member functions defined separately in another function or another function?

I'm not sure what you are asking here because the sentence is not complete.  If you are asking if you can define a class inside a function:  yes, you can, but its usefulness would be limited since it would only be defined inside the function.

A: C++11 introduced lambda expression to build a callable object in a function and capture variables. To define a member function in certain place, you'll probably define a lambda member in the class and assign a lambda to it.


text:
Q: Persist AWS Cognito User with Amplify I've been following the Serverless Stack tutorial and can get a positive response with calling Auth.signIn(username, passsword)
The current workflow we have is that the user will need to reset their password as accounts will be handed out.
The .changePassword function takes 3 arguments; user, oldPassword, newPassword
I can't for the life of me figure out what it's looking for for the user. When I set the object returned from .signIn() I get the following error:

Local storage is missing an ID Token, Please authenticate

Obviously I wouldn't use this flow for production, but I'm trying to figure out what Auth is looking for.
Auth.signIn(this.state.emailAddress, this.state.password)
  .then(user => {
    this.setState({ isLoading: false, user });
  }).then(async () => {
    Auth.changePassword(this.state.user, 'P@ssw0rd!', 'NewP@ssw0rd!');
  }).catch(err => {
    this.setState({ isLoading: false, errorMessage: err.message })
});

I do see an ID token in the Storage property from the object returned from .signIn. For clarification: I probably shouldn't have placed it in the chaining. I'm not really doing above in practice. When I save the response from Signin and pass it to the changePassword I get the localstorage error. I'm wondering if there is a config issue setting up Amplify that normally would place this info in localStorage.

A: Auth.changePassword takes in a CognitoUser as it's first argument, something which should be returned from Auth.signIn.
The issue here, is your promise chaining, and using this.setState() and reading it back before it's actually been set:
Auth.signIn(this.state.emailAddress, this.state.password)
  .then(user => {
    // Triggers a setstate here:
    this.setState({ isLoading: false, user });
  }).then(async () => {
    // this.state.user is not defined at this point
    Auth.changePassword(this.state.user, 'P@ssw0rd!', 'NewP@ssw0rd!');
  }).catch(err => {
    this.setState({ isLoading: false, errorMessage: err.message })
});

From the React docs:

setState() does not always immediately update the component. It may batch or defer the update until later. This makes reading this.state right after calling setState() a potential pitfall. Instead, use componentDidUpdate or a setState callback (setState(updater, callback)), either of which are guaranteed to fire after the update has been applied. If you need to set the state based on the previous state, read about the updater argument below.

The easiest way to fix this, is to return the user in the first .then callback, to pass it to the second:
Auth.signIn(this.state.emailAddress, this.state.password)
  .then(user => {
    // Triggers a setstate here:
    this.setState({ isLoading: false, user });
    return user;
  }).then((user) => {
    // this.state.user is not defined at this point
    Auth.changePassword(user, 'P@ssw0rd!', 'NewP@ssw0rd!');
  }).catch(err => {
    this.setState({ isLoading: false, errorMessage: err.message })
});

Personally, I think it would look a lot nicer entirely in async/await:
try {
    const user = await Auth.signIn(this.state.emailAddress, this.state.password);

    this.setState({ isLoading: false, user });

    await Auth.changePassword(user, 'P@ssw0rd!', 'NewP@ssw0rd!');
} catch (err) {
    this.setState({ isLoading: false, errorMessage: err.message })
}


text:
Q: Is there a way to get the API from a URL ("repository")? I'm wondering how can i get a repository API , i explain a summary , im using "Dspace connector" from Omeka S and im trying to get all the comunities from a Repository , https://74.208.251.39/ , but Dspace Connector is asking me for an endpoint , an API from the site , i know that is fact from the server , but is it in a file or is a part of some code or how can i get that api ?

A: DSpace has different APIs, but the Omeka manual specifies, it is looking for the standard Rest API. You should ask the operator of the DSpace repository you want to connect to, if they have the Rest API deployed and to what endpoint it is deployed to. The DSpace operator might also have restricted access to the API.
There is a section on the DSpace Rest API in the DSpace manual. If you are yourself the DSpace operator, you'll learn there how to deploy the Rest API.

A: The repository admin shared me this image below [ Dspace Rest API ] , that it supposes that there is the endpoint , but when i use " rest " it shows me the same , Communities and collections are empty , so should i use all the specific instructions for the Endpoint? like Get / communities? , btw i tried just with " /communities " o /items"  but the same resultsDspace Rest API1


text:
Q: How do I stop Nhibernate log4net conflicting with existing log4net? I'm very new to this so I apologise if my question isn't well structured or just in the wrong place, etc. I've had a good look for solutions to this and tried a number of different approaches but haven't found anything that works so....
I have a solution that makes use of Nhibernate, and consequently must use log4net V1.2.10.0, which comes in the log4net/2.0/ folder. However my solution also links to a number of other solutions, to which I have very limited access. These make use of the same log4net V.1.2.10.0 but in folder: log4net/1.2/
When I run my solution I get this error.
{"Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=e27b8fa57f63a98d' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference. (Exception from HRESULT:
0x80131040)":"log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=e27b8fa57f63a98d"}

I have tried to amend the solutions that it is calling, however each time I amend one I get the error within that solution as soon as it tries to use another solution, so I have to amend another and so on. There are simply too many solutions to amend and too many interdepencies with other solutions that I have absolutely no control over for me to be able to change them all so that they use log4net/2.0.
I have found another question ( Referencing 2 different versions of log4net in the same solution ) which I think is basically the same problem, and they amend the app.config with a binding, however I can't seem to get this right, as I'm still getting the same error. The binding I've included in my app.config is this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="log4net" publicKeyToken="e27b8fa57f63a98d" />
    <codeBase version="1.2.10.0" href="2.0\log4net.dll" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821"/>
    <codeBase version="1.2.10.0" href="1.2\log4net.dll" />
  </dependentAssembly>
 </assemblyBinding>
</runtime>

I'm not sure what the answer to the other question means when it says "You create 2 folder in your project one for each version of log4net. You place each log4net.dll in its corresponding folder by adding an the file to the solution (not with add reference). You can set the copy to output directory property to copy always so that it is automatically copied to the output folder when you build." And would I need to do this to every solution that my solution references?
Ideally I want to be able to make an amendment to my solution which simply means that it doesn't care what log4net any of the solutions are using but they can still pass log messages between each other. I assume this is possible, so any help would be hugely appreciated. Either that or how do I turn off nHibernate's logger so that it doesn't care what log4net I'm using so I can just continue to use the log4net/1.2 that all the other solutions are using. I've tried all sorts of things to turn it off but it still seems to end up trying to find the log4net/2.0.

A: You're lucky in that you've got the same DLL in two different places, which makes your problem easier to solve.  You could simply take a back up and then delete one of the references of the DLL (the \1.2\ version?) and then resolve any broken references in your solution - that should get you to a point that you can compile.
Have you tried NuGet too?  You could add a reference to Log4Net and then add a reference to Nhibernate, which would see that you've already satisfied it's dependency requirement and would not need to download another reference to NHibernate.
I'd recommend the learning curve of using NuGet because it is a powerful tool that should make your life much easier in the long run.
Update
Please see my comment about providing your current folder structure to help - incase you can do that; the following should get you started.
To try and do this using just direct file references you may need to move your DLL's around into a better structure.  Inside your solution (not project) create the following folder structure under solution items.
\ExternalReferences
    \Log4Net\
    \NHibernate\
Move a single copy of the log4net DLL inside the log 4 net folder (and delete the other instance) and then move all the NHibernate DLL's you are using (minus Log4Net) in the NHibernate directory.  Remove the bindings inside your app.config and then go through each project updating the references to point to the version inside the external references.
The actual location of the files isn't that important, you just need your code to reference a single instance of the DLL and then when it builds they all get copied into the bind folder.  You're just running into problems because you have two instances - whilst you are editing your code, etc. NHibernate isn't actually too bothered where Log4Net is; it just has a dependency on it that must be forfilled when it runs.
Update 2
New Version of Log4Net on NuGet that breaks backward compatibility - see the referenced blog post for more info.  There is now a 1.2.11.0 version of Log4Net that contains a different strong name to 1.2.10.0, making things just that little harder!


text:
Q: How to only pick out cells that are not empty within a range? `
Function ln(sheet)
    ' this function locates the last names in a sheet
    ' and returns the range that they are contained in

    Dim sr As Range     ' search range
    Dim rc As Range     ' reference cell
    Dim nc As Range     ' name cell
    Dim nr As Range     ' name range
    Dim r As Range
    Dim objXl

    Set objXl = CreateObject("Excel.Application")

    If sheet = "main" Then
        Set sr = Sheet1.Range("A1:AZ80")
        Set rc = sr.Find(what:="1")
        Set nc = rc.Offset(0, 1)
        Set r = Application.Union(nc, nc.Offset(70, 0))
        Set nr = Worksheets("Sheet1").r.Cells.SpecialCells(xlCellTypeConstants).Count

`
The function above is trying to find a specific cell within a column, where the first last name can be found. After finding the last name, the script is trying to create a range that will encompass all of the last names in that column, excluding any empty cells - hence the 'Count' in the last line.
I have tried to fix the script a few times, but I can't get past the error "Run-Time Error 9: Subscript out of range". The last line is highlighted, and I get the error message in the title. Please help, and I would appreciate any additional advice on how to make the script more efficient.
I tried googling around and reading through other people's scripts.

A: The answer:
To remove the error: Set nr = r.SpecialCells(xlCellTypeConstants)
Thank you user3598756


text:
Q: Will ssis script component output be sorted? I am adding rows in sequence in a script component. The sequence is such that I am parsing values from an input string then adding them to the output. This way all values from a particular input string are added before those from the next input string ( or so I assume).
Is this assumption incorrect?
I ask because I need to use the pivot transform (needs data sorted) after the script component and for performance reasons I would rather not add a sort between them.
So when I pivot on the original input string's identifier, will my pivot results be correct?

A: I needed a similar solution. Short answer is yes but this may depend on how you write your script task. Using the Input0Buffer buffer and calling  .NextRow  and then after what ever logic / processing you do,  send the row to the one of your outputbuffers using AddRow. The operation becomes a synchronous row by row operation.


text:
Q: How does one prove $ZF\vDash MC\Rightarrow AC$? This is somewhat adressed to Andreas Blass, whose papers I have read, in particular I make reference to an old paper of his »Existence of Basis implies the Axiom of Choice« (84). Anyone who happens to be informed may nevertheless feel free to enlighten me.

One works within $ZF$. Assume $MC$, that is, for all $X$ there exists $f:\mathcal{P}(X)\to\mathcal{P}(X)$, so that for all $A\in\mathcal{P}(X)\setminus\{\emptyset\}$ it holds $\emptyset\neq f(A)\subseteq A$ and $f(A)$ finite. To show is $AC$.
Due to $MC$ it holds
Proposition 0. Let $X$ be a set. There is a choice function $\mathcal{P}(X)\to X$ $\Longleftarrow$ $X$ is linear-orderable.
Proof. Consider a l.o. $\preceq$ on $X$. Set $m:\mathcal{P}(X)\to\mathcal{P}(X)$ a multi-choice function. Then $c:\mathcal{P}(X)\setminus\{\emptyset\}\to X$ defined by $c(A)=\min_{\preceq}m(A)$ is well-defined and a choice function. $\blacksquare$
Since one is working within $ZF$ it also holds:
Proposition 1. Let $X$ be a set. There is a choice function $\mathcal{P}(X)\to X$ $\Longleftrightarrow$ $X$ is well-orderable. $\dashv$
Corollary. $X$ has choice $\Longrightarrow$ $X$ has a w.o. $\Longrightarrow$ $X$ has a l.o. $\Longrightarrow$ $X$ has choice. $\dashv$
It is thus necessary and sufficient to show, every set is linear-orderable. Again, since one is working within $ZF$, it is necessary and sufficient to just consider the sets $V_{\alpha}$ for $\alpha\in NO$ (the ordinal numbers).
An argument per induction seems to suggest itself. For the successor stages, one simply builds out of a well-order $\preceq$ on $V_{\alpha-1}$ a linear order (the lexical order, $\preceq_{lex}$) on $V_{\alpha}=\mathcal{P}(V_{\alpha-1})\equiv_{SET}{}^{V_{\alpha-1}}2$.
The argument encounters difficulty for limit-ordinals, since one cannot "choose" a well-order for all the stages below it (except when the ordinal satisfies $cf(\alpha)<\alpha$). Consider simply $\alpha=\omega_{1}$, how would one construct a linear-order on $V_{\omega_{1}}$?

I should note: all authors I have read up until now each hold that $ZF\vDash MC\Rightarrow AC$.

Final Remark. I see now how to handle with successor stages in Frunobulax' argument.
Thm. Assuming $ZF+MC$ every $V_{\alpha}$ is well-orderable.
Proof. Consider $\alpha\in NO$ any ordinal. Thanks to $MC$ there exists $m:\mathcal{P}(V_{\alpha})\to\mathcal{P}(V_{\alpha})$ a multi-choice function. This shall henceforth remain fixed.
As already mention it holds
Claim. for $X\subseteq V_{\alpha}$ and an LO $\preceq$ on $X$, using just $m$ and $\preceq$ one can canonically construct a choice function $\mathcal{P}(X)\to X$ (via. $c:A\mapsto \min_{\preceq}(m(A))$ for $A\neq\emptyset$) and out of this in turn canonically construct a WO of $X$ (utilising the recursion $x_{\gamma}:=c(X\setminus\{x_{\xi}:\xi<\gamma\})$ for $\gamma\in NO$ for as long as $X\supsetneq\{x_{\xi}:\xi<\gamma\}$). This canonically-definable well-order shall be denoted $\preceq^{m}$. $\dashv$
Construction of a WO of $V_{\alpha}$. One constructs recursively an increasing chain $(\preceq_{\beta})_{\beta\leq\alpha}$ of WO-s of the $V_{\beta}$:

*

*$\preceq_{0}:=\emptyset$.

*Limit stages: $\preceq_{\beta}:=\bigcup_{\xi<\beta}\preceq_{\xi}$.

*Successor stages: one linearly orders $R_{\beta}:=V_{\beta}\setminus V_{\beta-1}\subseteq \mathcal{P}(V_{\beta-1})\equiv{}^{V_{\beta-1}}2$ via the lexical-ordering $(\preceq_{beta-1})_{lex}$. Note that $R_{\beta}\subseteq V_{\alpha}$. Set $\preceq^{\ast}:=(\preceq_{beta-1})_{lex}^{m}$ a well-order. The well-orders are then patched together by placing everything in $R_{\beta}$ after $V_{\beta-1}$, to obtain a well-order of $V_{\beta-1}\sqcup R_{\beta}=V_{\beta}$.

This recursion is well-define and in particular $\preceq_{\alpha}$ witnesses the well-orderability of $V_{\alpha}$. $\blacksquare$

A: If that's OK with you, it's easy to show that $\textbf{MC}$ implies
the antichain principle which is known to be equivalent to the axiom
of choice:
Let $X$ be a set partially ordered by $R$, i.e. $R$ is reflexive, antisymmetric and transitive.  Let $f$ be a function
which assigns to each non-empty subset $A$ of $X$ a finite non-empty
subset $f(A)$ of $A$.  For each such $A$ the set
of $R$-minimal elements of $f(A)$ is finite,
non-empty and an $R$-antichain.  We'll call it $A'$.
Now, inductively, define $C_\alpha$ to be the set of all elements of
$X$ which are $R$-incomparable with all elements of $B_\beta$ for all
$\beta<\alpha$ and let $B_\alpha$ be $C_\alpha'$ (or $\emptyset$ if
$C_\alpha$ is empty).
The union of all $B_\alpha$ is a maximal $R$-antichain.

A: Here's a modified version of a proof by Rubin which builds on what you
already have above:
We claim that $\textbf{MC}$ implies that all $\mathbf{V}_\alpha$ can
be well-ordered.
So, let $\alpha$ be some fixed arbitrary ordinal.  Let $\lambda$ be
the smallest ordinal which can't be mapped one-to-one into
$\mathbf{V}_\alpha$ (i.e. the Hartogs number of $\mathbf{V}_\alpha$).
$\lambda$ is well-ordered by $\in$, so we can define a linear order
$\preccurlyeq$ on ${\cal P}(\lambda)$ by $x
\preccurlyeq y$ iff $x=y$ or $x\neq y$ and $\min(x\bigtriangleup
y)\in x$ (where $\bigtriangleup$ is the symmetric difference).
As you've shown above, due to $\textbf{MC}$ we'll find a choice
function for ${\cal P}(\lambda)$ which in turn implies that this set
can be well-ordered.  We fix one well-ordering
of ${\cal P}(\lambda)$ for the rest of the proof.
Now let $R_\beta$ be the set of all $x\in{\mathbf V}_\alpha$ with rank
$\beta$.
If we can show, that all $R_\beta$ for $\beta<\alpha$ can be
well-ordered, then it is obvious how we can combine these
well-orderings to get one for ${\mathbf V}_\alpha$.  So, we'll
inductively define well-orderings $\preccurlyeq_\beta$ of $R_\beta$:
Pick $\beta<\alpha$ and assume that for $\gamma<\beta$ a well-ordering
$\preccurlyeq_\gamma$ of $R_\gamma$ has already been defined.  Using
these, we can define an "obvious" well-ordering $<_\beta$ of ${\mathbf
  V}_\beta$ (being the disjoint union of the $R_\gamma$ for
$\gamma<\beta$).
There's a unique ordinal $\delta_\beta$ such that
$(\mathbf{V}_\beta,<_\beta)$ is isomorphic to $(\delta_\beta,\in)$ and
correspondingly there's a unique isomorphism $g_\beta$ from
$(\delta_\beta,\in)$ onto $(\mathbf{V}_\beta,<_\beta)$.  As $g_\beta$
is also an injection from $\delta_\beta$ into $\mathbf{V}_\alpha$, we
must have $\delta_\beta<\lambda$.
Now, for an element $x$ of $R_\beta$ we have $x\subseteq{\mathbf
  V}_\beta$ and thus $g_\beta^{-1}[x] \subseteq \delta_\beta \subseteq
\lambda$.  Thus, $g_\beta$ (or rather its inverse) gives us a natural
way of "projecting" a part of the above-mentioned well-ordering of ${\cal P}(\lambda)$
to $R_\beta$ which finishes our proof.
The important thing to note here is that we didn't make a choice at
each $\beta<\alpha$ stage.  The only choice made was right at the
beginning when we fixed a well-ordering of ${\cal P}(\lambda)$.


text:
Q: Is there a way in process builder to check if a date is set and if so, if it is greater than something? I am trying to implement some form of attribution, where there are two cases:

*

*Date has not been set (i.e. this is the first opportunity)

*Date has been set (i.e. this is not the first opportunity)

Now I want to build the condition in the process builder in such a way that it works if 1 is met (i.e. date is empty), but also that it works if two (i.e. date is not empty) is met.
I used a custom logic alá (1 OR 2) and was hoping that if one evaluated to TRUE it would not check 2, but apparently that is not the case and the flow bugs out. Does anybody have an idea how to go about this?

A: If both conditions are related to same field, then there is no sence to add them at all as any Opportunity will fit the "1 OR 2" criteria. You can use "No criteria—just execute the actions!" option instead:

A: Let me know what the actions you need to check on both conditions.
is there any action you are going to take if your date is empty, or you just mentioned to avoid flow bug.
if only in second case you want your actions will run then you can use the condition like this:


text:
Q: Automatically refresh fields Is there a way in ng-admin to refresh values (content of the fields) without refreshing the entire page?
For example, if there was a REST API that returns a value that changes over time (e.g. amount of requests in a queue). How could I create an ng-admin page and let the "queue length" field update every 5 seconds?

A: ng-admin doesn't have such a feature.
You have to write your own page by overwriting the router.
See Adding Custom Pages on the documentation.