text:
Q: I get 'Variable x inaccessible here due to optimization' I get 'Variable ForAllUsers inaccessible here due to optimization' even if the build configuration is set to 'Debug' and the Optimization is False. So, I cannot debug my program.
Why do I get this?
Which build is ran when I press the Run button?
How can I see

procedure Test(ForAllUsers: boolean);
VAR
   FName, Path1, Path2: string;
   RootKey: HKEY;
begin
 Result:= FALSE;
 TRY
  if ForAllUsers
  then
    begin
     RootKey:= HKEY_CLASSES_ROOT;
     Path1:= '';
     Path2:= '';
    end
  else
    begin
     RootKey:= HKEY_CURRENT_USER;           <----- Break point here
     Path1:= '\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\';
     Path2:= '\Software\Classes\';
    end;

...
end;

Update:
Only minutes since I posted this question, and it was already voted twice up and starred two times. Seems this is a pretty common issue.

A: Let's see the difference with and without optimization in code:
procedure test;
var
  x,y,z: integer;
begin
  x:= 1;   //x is stored in register EAX.
  Inc(x);
  y:= x;   //this is a no-op because it's just a rename.
//After this point x is no longer used.
//Here you will get `Variable x inaccessible here due to optimization`
  z:= 0;   //z is never used
  if (y = 1) then Inc(z);  //because Delphi knows this code will never execute
end;

Here's the assembly code with optimization:
Project5.dpr.12: x:= 1;   //x is stored in register EAX.
004085E8 B801000000       mov eax,$00000001
Project5.dpr.13: Inc(x);
004085ED 40               inc eax
Project5.dpr.18: if (y = 1) then Inc(z);
004085EE 48               dec eax  //test to see if eax=1, triggers `jz` if true.
                                   //Delphi put it in to facilitate the `if`, but
                                   //is not smart enough to eliminate it :-)
Project5.dpr.19: end;
004085EF C3               ret

And here's the code without optimization:
Project5.dpr.11: begin    //note that Delphi doesn't use registers, but the stack
                          //to keep variables.
004085E8 55               push ebp
004085E9 8BEC             mov ebp,esp      //init the stack frame.
004085EB 83C4F4           add esp,-$0c
Project5.dpr.12: x:= 1;   //x is stored near the top of the stack.
004085EE C745FC01000000   mov [ebp-$04],$00000001
Project5.dpr.13: Inc(x);
004085F5 FF45FC           inc dword ptr [ebp-$04]
Project5.dpr.14: y:= x;   //y sits on the stack frame.
004085F8 8B45FC           mov eax,[ebp-$04]
004085FB 8945F8           mov [ebp-$08],eax
Project5.dpr.17: z:= 0;    //z is also in the stack frame.
004085FE 33C0             xor eax,eax
00408600 8945F4           mov [ebp-$0c],eax
Project5.dpr.18: if (y = 1) then Inc(z);
00408603 837DF801         cmp dword ptr [ebp-$08],$01
00408607 7503             jnz $0040860c
00408609 FF45F4           inc dword ptr [ebp-$0c]
Project5.dpr.19: end;     //all vars stay in scope.
0040860C 8BE5             mov esp,ebp  //until the stack frame is dismantled.
0040860E 5D               pop ebp
0040860F C3               ret

So your situation should never occur with optimization off, but...
You can set optimization on/off in the source code too:
{$Optimization on/off}  or
{$O+/-}

If that line is in front of your routine it will override the global setting.
http://docwiki.embarcadero.com/RADStudio/en/Optimization_%28Delphi%29

A: The code you posted does not compile as-is, so I can't be 100% I didn't kill the reproduction case by my personal modificications to make it run... but I cannot reproduce your particular problem. Anyone else who can?
Sure, the debugger/evaluator complains when optimization is on, but the problem definitely disappears with optimization off and a rebuild. Are you sure you did a proper rebuild?
I kinda disagree with Davids' statement that "we all suffer from this from time to time". Aside from known and predictable border cases (variables being out of scope with the breakpoint on end) I actually never run into this problem. As long as I prevent my coworkers from checking the dproj into version control with optimization on, that is.

A: We all suffer from this from time to time.  What I sometimes do is add some spurious code at the point at which I need to debug the variable that references the variable but does nothing.  For example:
if x>0 then x := x*1;

Or if it is a boolean then:
if b then b := not not b;

Something along these lines is usually enough to get the compiler to write out code that keeps the variable alive so that the debugger can inspect it. Make sure you put the code right at the bottom of the routine! And make sure that you remember to remove it before checking the code in.


text:
Q: create a solution file (.sln) in visual studio 2012 I created my own project using VS Professional 2012, but I couldn't find my Project.sln Solution File!? Is there any solution that I can get it within my solution explorer?
Any help would be much appreciated..

A: You're not supposed to see the actual solution file in Solution Explorer. Click on your solution name (ie. Solution: 'ConsoleApplication1' (1 project)) in the Solution Explorer and your Properties tab should give you the path of the *.sln file.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Probability that $z$ is EVEN satisfying the equation $x + y + z = 10$ is Question

Three randomly chosen non negative integers $x, y  \text{  and  } z$ are found to satisfy the equation $x + y + z = 10$. Then the probability that $z$ is even, is"?

My Approach
Calculating Sample space -:
Number of possible solution for $x + y + z = 10$
$$=\binom{10+3-1}{10}=12 \times 3=66$$
Possible outcome for $z$ to be even =$6(0,2,4,6,8,10)$
Hence the required probability$$=\frac{6}{66}=\frac{1}{11}$$
But the answer is $\frac{6}{11}$
Am I missing something?

A: Presumably the intended problem is:

*
If $(x,y,z)$ is randomly chosen from the set of nonnegative integer triples $(x,y,z)$ satisfying $$x+y+z=10$$
what is the probability that $z$ is even?

Using that interpretation . . .

Suppose $x+y+z=10$, and $z$ is even.

Write $z=2c$.

Note that $x,y$ are either both even, or both odd.

If $x,y$ are both even, write $x=2a,\,y=2b$, and count the solutions to
$$2a+2b+2c=10$$
or equivalently,
$$a+b+c=5$$
If $x,y$ are both odd, write $x=2a+1,\,y=2b+1$, and count the solutions to
$$(2a+1)+(2b+1)+2c=10$$
or equivalently,
$$a+b+c=4$$

Then just sum  those counts, and divide by $66$.

A: You are missing the fact that a single even value of $z$ represents several different soluitons, not one.
With $z$ equal to 10, there is only one possible solution (0+0+10).
With $z$ equal to 8, there are 3 possible solutions (0+2+8, 1+1+8, 2+0+8).
With $z$ equal to 6, there are 5 possible solutions.
With $z$ equal to 4, there are 7 possible solutions.
With $z$ equal to 2, there are 9 possible solutions.
With $z$ equal to 0, there are 11 possible solutions.
In total you have 36 solutions with $z$ being even and 66 solutions in total. So the probability is 36/66 or 6/11.

A: $x$ and $y$ need to have the same parity, so that we can predict that the probability will be close to $\frac12$.
For a given $z$, there are $11-z$ combinations of $x,y$, which are all of the same parity or of the opposite parity.
Hence
$$p=\frac{11+9+7+5+3+1}{11+9+7+5+3+1+10+8+6+4+2}=\frac{36}{66}.$$

Using summation formulas,
$$p=\frac{\left(\dfrac{12}2\right)^2}{\dfrac{11\cdot12}2}$$

A: Since $x$, $y$, and $z$ are distinct, the number of possible solutions here is $11+10+9+...+1=66$, corresponding to $z=0$, $z=1$, etc.  (Your binomial coefficient is correct, but your reader will likely not be sure the reasoning for it, so if you are asking whether your statement is complete, you might want to add a justification for it.) The number of cases where $z$ is even is then $11+9+7+5+3+1=36$, so yes, $z$ is even in $6/11$ of the possible cases.  (Again your count is correct, but the reader may be unsure about the reasoning.)
On the other hand, "randomly chosen nonnegative integer" is ambiguous since there is no (proper) uniform distribution on the set of nonnegative integers. You might want to work out an alternate solution where the unconditional distribution is proper, something like $Prob(n)=\frac{1}{2^{n+1}}$. The answer then will still be $6/11$ since each case will have $1/2^{13}$ as its unconditional probability.  If you really want to have fun, you could use other improper distributions besides uniform. For example, you could try the Jeffreys prior for the Poisson.  I'm guessing that will give you something close to $6/11$ but not exactly the same.

A: Using computer power:
sage: allCases = len( [ S for S in cartesian_product( [ [0..10], [0..10], [0..10] ] ) if sum(S) == 10 ] )
sage: goodCases = len( [ S for S in cartesian_product( [ [0..10], [0..10], [0..10] ] ) if sum(S) == 10 and S[2] % 2 == 0 ] )
sage: allCases
66
sage: goodCases
36

A: This is in fact a composition problem. We want to find all compositions of $x$ and $y$ such that $z$ takes values in $0,2,4,6,8,10$.
Then we count All 2-Compositions of $0,2,4,6,8,10$, that is how can we add 2 numbers to get these values.
Let $C(n,k,a,b)$ be all k-compositions of n using the numbers from a to b.
We want:
$\sum_{i \in (0,2,4,6,8,10)} C(i,2,0,i)$ = 1+3+5+7+9+11=36.
We know $C(n,k,0,n)=$ $\sum_{i=2}^{10} [{i-1 \choose 1}+2]+1=66$ since we need 2 extra to account for 0 and 1 at the end to account for $x=0$ and $y=0$.
So we get $\frac {36}{66}$ as required.


text:
Q: glusterfs client mount point fails with 'Client quorum is not met' Assume a basic replica 3 arbiter 1 configuration, glusterfs-server 4.0.2 and glusterfs-client 4.0.2.
glusterfs-client is installed on Ubuntu 18.04.
In order to verify that write / read ops are permitted when one storage node is down as stated in the docs, an unexpected result occurs. After killing gluster processes on one of the non-arbiter nodes (using pkill ^gluster*) the client mount point fails with 'Client quorum is not met.' (see glusterfs-client log file).
Gluster volume info:
Volume Name: brick01
Type: Replicate
Volume ID: 2310c6f4-f83d-4691-97a7-cbebc01b3cf7
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x (2 + 1) = 3
Transport-type: tcp
Bricks:
Brick1: proxmoxVE-1:/mnt/gluster/bricks/brick01
Brick2: proxmoxVE-2:/mnt/gluster/bricks/brick01
Brick3: arbiter01:/mnt/gluster/bricks/brick01 (arbiter)

The volume is created by the following command
gluster volume create brick01 replica 3 arbiter 1
proxmoxVE-1:/mnt/gluster/bricks/brick01
proxmoxVE-2:/mnt/gluster/bricks/brick01
arbiter01:/mnt/gluster/bricks/brick01

As stated per the docs, file ops should be allowed in cases when one brick is down (if arbiter is ok with that), then why do I get 'Client quorum is not met' on the client side?
After a significant time spent reading the official docs about glusterfs, I couldn't find explanation as to why this is happening, and also filed a bug report on Red Hat Bugzilla.
Any help on the topic will be very much appreciated!

A: gluster volume heal brick01 enablе resolved the issue.
This eventually added the re-configured option cluster.self-heal-daemon: enable to the volume. It seems that by default arbiter brick fails to heal (sync) simultaneously when any file operation occurs and blames the other brick that is still up.


text:
Q: Can't retrieve values from post variables that have a space in their name I have a simple form which is designed to allow a user to enter numeric values and then sent them to a page which calculates the result.
The problem I'm having is that post variables that includes a space in their name don't seem to be recognised.
The form is created like so:
<?php
$minerals = mysqli_query($con, "SELECT * FROM items");
?>

  Product:
  Quanitity:
  Buyback Price:

Minerals

<?php
while($row = mysqli_fetch_array($minerals)) {
  echo "
";
  echo "" . $row['name'] . "	";
  echo "" . "Amount: <input type='text' value='0' name='" . $row['name'] . "'>" . "	";
  echo "" . $row['price'] . "	";
  echo "
";
  if($row['name'] == "Morphite") {
    break;
  }
}
echo "
";
?>

And I'm trying to retrieve the post data like so:
echo '
';
    echo '
Product	Value
';
while($item = mysqli_fetch_array($items)) {
    echo '
';
    echo '';
    echo $item['name'];
    echo '	';
    echo '';
    echo $_POST[$item['name']];
    echo '	';
    echo '
';

}
    echo '
Total
';
    echo '
';

But any 'name' in the database that contains a space causes nothing to be displayed on the other end.

A: Since you can never be sure what is written in the database (invalid characters for html etc) you should encode this value before using it as inputs name-attribute. So try maybe htmlspecialchars or strip off the spaces and non-printable and invalid characters. Also if you have a primary key (integer) in your database you could use this to identify the record instead of the name.

A: Try replacing

  echo $_POST[$item['name']];

with

  echo $_POST["{$item['name']}"];


text:
Q: Bluetooth in Java Mobile: Handling connections that go out of range I am trying to implement a server-client connection over the spp.
After initializing the server, I start a thread that first listens for clients and then receives data from them. It looks like that:
public final void run() {
    while (alive) {
        try {
            /*
             * Await client connection
             */
            System.out.println("Awaiting client connection...");
            client = server.acceptAndOpen();

            /*
             * Start receiving data
             */
            int read;
            byte[] buffer = new byte[128];
            DataInputStream receive = client.openDataInputStream();
            try {
                while ((read = receive.read(buffer)) > 0) {
                    System.out.println("[Recieved]: "
                            + new String(buffer, 0, read));

                    if (!alive) {
                        return;
                    }
                }
            } finally {
                System.out.println("Closing connection...");
                receive.close();
            }
        } catch (IOException e){
            e.printStackTrace();
        }
    }
}

It's working fine for I am able to receive messages. What's troubling me is how would the thread eventually die when a device goes out of range?
Firstly, the call to receive.read(buffer) blocks so that the thread waits until it receives any data. If the device goes out of range, it would never proceed onward to check if meanwhile it has been interrupted.
Secondly, it would never close the connection, i.e. the server would not accept the device once it goes back in range.

A: When the remote device goes out of range, after the link supervision timeout expires, the local stack should close the connection.  Depending on the JSR-82 implementation, receive.read(buffer) will return -1 or will throw an IOException.  You can simulate this by turning off the remote device or moving it out of range.


text:
Q: How to set alarm or push notification I am trying to make a reminder application on Android. I have taken data from the user and saved in a database. How do I trigger an alarm or push notification on  user entered date?

A: To create push notification, you have to register on console API. but I can't post link , because of low reputation and get your own key. Personally I used this tutorial to create and handle push notification.
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
but I can't understand why do you need it to alarm user.
To implement alarm after some elapsed time, you can create Service:
http://developer.android.com/reference/android/app/Service.html
There you can create your own alarm or use one of the standard. Sorry, I can't provide code example, because your question is too general.

A: Insert the information into the Calendar application with the appropriate settings and you will get an alarm when the event occurs.


text:
Q: Change style of dynamically created elements in react I am pretty new to React and I have a requirement where I need to generate multiple div's and on button click I need to display those div's. Here is the code
    export default class Test extends React.Component {
    constructor() {
        super();
        this.state = {
            dynaDiv: {}
        };
        this.onChangeFunc = this.onChangeFunc.bind(this);
        this.buildDynamicDivs = this.buildDynamicDivs.bind(this);
    }
    onChangeFunc(inputName) {
        const testId = "test"+(Math.floor(Math.random() * Math.floor(10)));
        console.log(testId);
        console.log(this.state.dynaDiv[testId].display);
        this.setState((prevState) => {
            console.log(prevState.dynaDiv[testId]);
            return({
                ...prevState,
                dynaDiv: {
                    ...prevState.dynaDiv,
                    [testId]: {
                        ...prevState.dynaDiv[testId],
                        display: prevState.dynaDiv[testId].display == "none"?"":"none"
                    }
                }
            });
        });
    }
    buildDynamicDivs() {
        let divs = [];
        for(let i=0; i<10; i++) {
            const dydiv = "test"+i;
            this.state.dynaDiv[dydiv] = {display: "none"}
            divs.push(
Test div{i}
);
        }
        return divs;
    }
    render() {
        return(

                <button onClick={() => this.onChangeFunc("username")}>Toggle</button>
                <button onClick={() => console.log("State: ", this.state)}>State</button>
                { this.buildDynamicDivs() }

        );
    }
}

So when user click on Toggle, a randomly generated number between 1-9 should display/hide based upon it's previous state ( if previously displayed then hide else show).


text:
Q: How do I make a now playing bar like in media player apps in iOS with XCode? I am making a media player app. I have UITableViewControllers that are embedded in Navigation Controller. I would like to somehow make a view that would overlay potentially multiple (2?) of these tableviewcontrollers (one that shows the user's playlists, and the next would show the tracks in the playlist), but only at the bottom, like a now playing bar in (e.g.) Spotify's iOS app (as in the left bottom side of this

or as in this

I have tried to drag a Container View into my Navigation controller (in which my TableViewCell is embedded), but it won't let me drop it there.
It looks like I can drag the Container View into my TableView, but then how would it remain there when i navigate between tableviews?
Trying to follow @Rintaro's suggestion, but I'm a little new to XCode. How did you do this? So I made a single view application, i added a container view to the first VC, it's imm drawing it somewhere else in the storyboard, but i can't figure out how to tell that view that it's a navigation controller. also, as soon as i add a second container to the first VC and tried to size it, the first container disappears! It is still listed in the hierarchy on the left, and still has an arrow pointing out of it, but the view controller that was added and was being pointed to is also invisible?!

UPDATE: This works very well, but it has a problem with orientation changes. how can i make this work in both orientations? (I hypothesize that it currently positions the "nowplaying view" off screen when the orientation changes).

A: Basically, view hierarchy like that is constructed like this:

Using two "Container View" in initial view controller, one for Navigation Controller, one for "Now Playing Bar" view controller.
ADDED:
"Main Container View Controller" would be your own UIViewController subclass. It will have responsibility to show/hide "Now Playing Bar".

Workaround for Interface Builder strange behaviors.
You can set Auto Layout constraints like following. Maybe you might want to select the view from the left menu.
Note that, you should uncheck Constrain to margins check box.
Container View for Navigation Controller:

Container View for Now Playing Bar Controller:

And then, Update Frames from the menu:

A: If you are manually placing any buttons with absolute coordinates, make sure that you update the coordinates of them when the rotation is changed.

A: Obviously you need to create a custom UIView class, where you will show this menu. And when you will create it, add it to your view just like here:
float y = ROOTVC.view.frame.size.height - 49;
[self setFrame:CGRectMake(0, y, 320, 49)];
[ROOTVC.view addSubview:self];
[ROOTVC.view bringSubviewToFront:self];

A: I would simply add a nowPlayingView to the appDelegate.window and adjust either:

*

*The window.rootController.view frame to avoid overlapping the nowPlayingView.

*If window.rootController.view is a UIScrollView, adjust its contentInset.bottom to avoid overlapping the nowPlayingView. You can also use transparency/translucency with this solution.

*Add a dummy toolbar to the controller that will get covered by the nowPlayingView.
If your window.rootController is a UINavigationController, then you have to probably do the above fore each controller you push. The nowPlayingView will stay unchanged on top.


text:
Q: How to detect the form is blank or not by jQuery I've multiple forms in my page. Some form/fields are required(class name requiredForm) and some are not. There is a link at the last named "Next".By default "Next" is in gray background(deactivate color background). I want when people fill only the required fields/forms, the background of "Next" will be changed to Orange. If they don't fill up requirement fields/forms, the "Next" link will be as it is.Basically, there is a form including about 9-10 radio button and a form including about 14-15 checkboxs. I don't need people check/click all of this. I need if people click/or select just one, disable(grey) link turn to orange. So, it may be more flexible if I check, if the required form is blank, grey link is as it is. If the required form is not blank, grey button will turn to orange. I'm trying to write the function. But, I don't know jQuery well. That's why, I can't understand how jQuery understand when people fill up the form or not.
Here is the sample code How the form is exist in my page:

   <form class="myForm requiredForm">
       <input type="radio" id="lb1" name="radio" />
       <input type="radio" id="lb2" name="radio2" />
       <input type="radio" id="lb2" name="radio3" />
   </form>

many Texts

   <form class="myForm">
       <input type="text" id="name" name="name" />
       <input type="text" id="email" name="email" />
   </form>"

   <form class="myForm requiredForm">
       <input type="checkbox" />
       <input type="checkbox" />
       <input type="checkbox" />

Next

CSS:
.next {
   background: #fa9a37;   // orange link color
   color: #fff;
}
.deactive {
   background: #fafafa;  // grey link color
   color: #333;
}

jQuery:
$(document).ready(function() {

   $('.deactive').addClass('.next');  // if people fill up the required forms
   $('.deactive').removeClass('.next');  // if people don't fill up the required forms
}

A: One of the solutions is to listen to changes on the input elements:
$('input').change(function() {
    var conditions = checkForConditions(); // this is where you check if the mandatory inputs are filled in
    if (conditions)
        $('.deactive').addClass('next');
    else
        $('.deactive').removeClass('next');
});

I've created a small example based on toggling here: http://jsfiddle.net/5c44z/
You had two major errors:

*

*.addClass('.next') should be .addClass('next') - no dot needed since we know it's a class

*in your CSS, the next class is defined before the deactive class so the deactive rules would always override the next rules... you can fix this either by changing order or by toggling classes (so you can't have both of them at the same time)

And the condition check function could be something like this, assuming you put a class mandatory to each mandatory field:
function checkForConditions() {
    var ret = true;
    $('.mandatory').each(function() {
        if ( !$(this).val() ) {
            ret = false;
        }
    });
    return ret;
}

Here's an example with that (the first input field is mandatory): http://jsfiddle.net/5c44z/1/

A: You can just put all of it under just one form tag, give the required fields a class, say required and then
  var allDone = true;
  $(".myForm input.required").each(function() {
     if($(this).val() === "") {
        allDone = false;
        return false;
     }
  });
  if (allDone)
    $('.deactive').addClass('next');
  else
    $('.deactive').removeClass('next');

A: please add a required class to all field that are required.
and try this code

   <form class="myForm requiredForm">
       <input type="radio"  class="required" id="lb1" name="radio" />
       <input type="radio"   class="required" class="required"  id="lb2" name="radio2" />
       <input type="radio"  class="required" id="lb2" name="radio3" />
   </form>

many Texts

   <form class="myForm">
       <input type="text"  class="required" id="name" name="name" />
       <input type="text"  class="required" id="email" name="email" />
   </form>

   <form class="myForm requiredForm">
       <input  class="required" type="checkbox" />
       <input  class="required" type="checkbox" />
       <input  class="required" type="checkbox" />

Next

/* define variable to each, at lease one selected element like checkbox and radio button */
    var is_radio_checked = false;
    var is_checkbox_checked = false;
    var is_other_required_field = true;
$('.required').each(function(){
   var type = $(this).attr('type');
   if( (type == 'radio') && !is_radio_checked){
     is_radio_checked = $(this).is(':checked');
   } else if((type == 'checkbox') && !is_checkbox_checked){
     is_checkbox_checked = $(this).is(':checked');
   } else if( (type == 'text') && is_other_required_field){
     var txt_val = $(this).val();
     if(txt_val == ""){
       is_other_required_field = false;
     }
   }
});

if(is_radio_checked && is_checkbox_checked && is_other_required_field){
  $("#next_link").removeClass('deactive').addClass('next');
}

please have a look on image


text:
Q: Correct word order in sentences below
A layer of gold with thickness of 200 nm which is produced by big mine company was coated onto table.

Gold layer has thickness of 200 nm and also it is Produced by very big mine company. I couldn't decided if word order is correct or not . Can this sentence be understood easily if the relative clauses is used after '' thickness of 200 nm.

Doors of cabinet that are painted white will be repaired.

I think relative clauses modifes "doors" in this sentence . But it is away from the "doors".

A frame in the shape of circle hanged on the wall suddenly broke.

And I think what is hanged on the wall is frame not circle. Please correct me if I am wrong.

A: The placement of multiple modifiers is a difficult issue of style. In general, your sentences will be clearer and more idiomatic if you keep modifiers as close as possible to the word modified. This often leads to substantial rewording.
For your first sentence, it would be far better to say

The table was layered, 200 nm. thick, in gold from a very big mining company.

or

Gold from a very big mining company was layered, 200 nm. thick, on the table.

One wonders whether the description of who produced the gold is even relevant.
Your second sentence if strictly construed does modify "doors, but might be misunderstood. It does mean

Cabinets with white painted doors will be repaired

but no one will be surprised if it is interpreted as

White painted cabinets with doors will be repaired.

Notice that all ambiguity can be removed by using adjectives that immediately precede the noun being modified.
Your third sentence will indeed be understood as meaning that the frame hung on the wall broke because a circle is an ideal concept that can neither break nor be hung on a wall. It is a type of construction commonly heard in speech. In formal writing, I'd recommend as more immediately comprehensible

The circular frame that was hung on the wall broke.


text:
Q: Convert date string to NSDate I've this string: "2016-10-08 00:20:00.000000". And I need it as an NSDate  (Date for swift 3) object.
I've tried with the following:
let formatterJsonDate = DateFormatter()
formatterJsonDate.dateFormat = "yyy-MM-dd hh:mm:ss"

print(formatterJsonDate.date(from: "2016-10-08 00:20:00.000000"))

I always return nil value. What's wrong? I guess it's something about the date format.

A: Your date format and your time string should be same. In your case it should be like,
 let formatterJsonDate = DateFormatter()
 formatterJsonDate.dateFormat = "yyy-MM-dd HH:mm:ss"

 print(formatterJsonDate.date(from: "2016-10-08 00:20:00"))

Or change dateformatter like,
  "yyyy-MM-dd HH:mm:ss.SSSSSS"

And hh should be capital for 24 - hour format!!!! like HH!

A: If you want use nano seconds your code must be :
let formatterJsonDate = DateFormatter()
formatterJsonDate.dateFormat = "yyy-MM-dd hh:mm:ss.SSSS"
if let myDate = formatterJsonDate.date(from: "2016-10-08 00:20:00.000000")  {
    print(myDate)
} else {
    print ("Invalid Date")
}


text:
Q: Syntax error on token "setRedirectStrategy", = expected after this token I am getting following error:-
 Syntax error on token "setRedirectStrategy", = expected after this token
What does this means?? And how can i resolve it.
<%@ page language="java" import="org.apache.http.client.methods.HttpUriRequest,org.apache.http.client.methods.HttpGet,org.apache.http.protocol.HttpContext,org.apache.http.impl.client.DefaultHttpClient,org.apache.http.HttpResponse,org.apache.http.HttpRequest,java.io.OutputStream,java.net.HttpURLConnection,java.net.URL,java.util.Collection,org.apache.commons.httpclient.Credentials,org.apache.commons.httpclient.auth.AuthenticationException,org.apache.commons.httpclient.auth.MalformedChallengeException,org.apache.commons.httpclient.params.DefaultHttpParams,org.apache.commons.httpclient.params.HttpParams,org.apache.commons.httpclient.auth.AuthScheme,org.apache.commons.httpclient.auth.AuthPolicy,org.apache.commons.httpclient.HttpClient,org.apache.commons.httpclient.UsernamePasswordCredentials,org.apache.commons.httpclient.auth.AuthScope,org.apache.commons.httpclient.methods.GetMethod,org.w3c.dom.*,javax.xml.parsers.DocumentBuilder,javax.xml.parsers.DocumentBuilderFactory,java.net.*,java.io.*" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%
String a_Url = request.getParameter( "url" ) ;

URL url = new URL (a_Url);
String encoding = new String(
         org.apache.commons.codec.binary.Base64.encodeBase64
            (org.apache.commons.codec.binary.StringUtils.getBytesUtf8("test:test"))
          );

HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setDoOutput(true);
connection.setRequestProperty  ("Authorization", "Basic " + encoding);
InputStream content = (InputStream)connection.getInputStream();
BufferedReader in   =
    new BufferedReader (new InputStreamReader (content));
String line;
while ((line = in.readLine()) != null) {
   out.println(line);
}

%>
<%!

HttpClient client = new HttpClient();
client.setRedirectStrategy(new DefaultRedirectStrategy() {
            public boolean isRedirected(HttpRequest hr, HttpResponse hr1, HttpContext hc) {
                if (hr1.getStatusLine().getStatusCode() == 302) {
                    return true;
                }
                return false;
            }

         public HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context) {
                HttpGet get = null;
                try {

                    String newLocation = "" + response.getFirstHeader("Location");
                    newLocation = newLocation.substring(newLocation.indexOf("Location:")+10);
                    get = new HttpGet(newLocation);

                } catch (Exception ex) {
                    System.out.println(ex.getLocalizedMessage());
                }
                return get;
            }
        });

%>


text:
Q: The page cannot be displayed because an internal server error has occurred. - MVC to show 404 custom page I am trying to do a custom 404 page.
I added an ErrorController as follows
public class ErrorController : Controller
{
    public ViewResult PageNotFound()
    {
        Response.StatusCode = 404;
        return View();
    }
}

Added a View folder Error in the following hierarchy:
Views > Error > PageNotFound.cshtml - which has my custom 404 message.
In web.config file in the <system.web> tag:
<customErrors mode="On" redirectMode="ResponseRewrite">
  <error statusCode="404" redirect="~Views/Error/PageNotFound"/>
</customErrors>

A: I think the slash is missing after ~
<customErrors mode="On" redirectMode="ResponseRewrite">
  <error statusCode="404" redirect="~/Views/Error/PageNotFound"/>
</customErrors>

A: I think you should be redirecting to the controller action instead of the VIEW
<customErrors mode="On" redirectMode="ResponseRewrite">
  <error statusCode="404" redirect="~/Error/PageNotFound"/>
</customErrors>


text:
Q: Group of Order $5$ Let $G$ be a group of order $5$ with elements $a, b, c, d, 1$ where $1$ is the identity element. This is the definition of the group.

We all know that this can't be a group because any group of order $5$ is abelian but according to my definition this group is not abelian. But my question is why can't this be a group when it satisfies all the criteria mentioned in the definition of a group.
I wish to find a reason for its ability of not being a group just from the definition of group. For example one can say that the diagonal elements are $1$, which means we have subgroups of order $2$, which is not possible for a group of order $5$. But this is not what I am seeking. Please explain me using nothing more than just the four criteria of the definition of group.

A: You see that it's an operational system, has a neutral element, and is invertible straight from the table, so the only thing left to check is associativity.
Here, we have
$(aa)c = 1c = c \neq b = ad = a(ac)$.
(The good news is that, if an operational system isn't associative, it usually doesn't take too long to find a counterexample.)

A: $$(a\cdot b)\cdot b= c\cdot b= d \neq a=a\cdot 1=a\cdot (b\cdot b)$$

A: It's not associative: The least exciting of the properties you have to check.
$(ca)d = bd = c$, but
$c(ad) = cb = d$

A: $$(ab)d=a \neq d= a(bd)$$
Associativity fails.


text:
Q: Why do you not get burned when you move your finger (quickly) over a candle flame? When we move a finger quickly over/through a candle flame, why doesn't it get burned?
http://en.wikipedia.org/wiki/Fire

A: What happens when you place your finger in a flame is that energy is transferred from a hot gas to the mass of your finger. This transfer of energy takes time.
I guess this transfer is primarily through thermal conduction but the arguments probably apply for radiated energy too.
The time it takes to transfer a given amount of energy into a given volume of matter is, I think, a property we call the thermal conductivity of the material. But I suspect that's just a recognition that a transfer of energy doesn't happen instantaneously. the rate at which energy is transferred also depends on a property we describe as the initial temperature difference between, in this case, the hot gas and the finger.
The effect of this energy on the temperature of that volume of matter is what we call the thermal capacity of the substance. For example, you have to add 4200 Joules of energy to a kilogram of water to raise it's temperature by 1 Kelvin (1 C).
Once the finger's temperature rises above a certain limit, it will cause a chemical process that changes the chemical structure of the matter in your finger and breaks down it's structure - i.e. burning.
This is also why your kettle takes several minutes to boil a litre of water. The water has to be held over the heating element for sufficient time for enough energy to be conducted from the heating element into the water to raise it's temperature enough that there begins a phase-change from liquid to gas.
To char 1cc of finger takes a certain amount of energy, a fast moving finger doesn't leave the finger inside hot gas long enough for that amount of energy to be transferred.


text:
Q: Take Multiple values from the php file using AJAX I have a Jquery AJAX function which sends values to PHP file and the date from the PHP file is appended to the div content.
$( document ).ready(function() {

var valueSelected = $( "#sort_id option:selected" ).val();

var arr = Array();
var arr = <?php echo json_encode($details); ?>;
var details = JSON.stringify(arr);

var wash = <?php echo  json_encode($_GET['wash']); ?>;

var params = Array();
var params = <?php echo json_encode($params); ?>;
var params = JSON.stringify(params);

    $.ajax({
        type: 'post',
        url: 'sort.php',
        data: {
                data : details,
                wash : wash,
                params :params},
                error : function(data){console.warn(xhr.responseText)},
        success: function (data) {
          $('#content').html(data).fadeIn("slow");

            var jsonText = httpObject.responseText;
            var jsonObject= eval('('+jsonText+')');
            var count_array=jsonObject.count_array;
            var count_array=jsonObject.count_sorted_array;

          jQuery("label[for='private_count']").html(count_array);
          jQuery("label[for='sorted_count']").html(count_sorted_array);

        }
      });

Now, I need to take some computed value from the PHP script and use it in the PHP file which is calling this AJAX function.
If I give the datatype:"JSON" in the above code, it is not displaying the results in the content div.
My PHP file contains the following code to be taken into jquery variable along with the content to be displayed in content division.
$count_array = sizeof($sorted_array);
$data = array(
    'count_array' => $count_array,
    'count_sorted_array' => $count_sorted_array,
);
echo json_encode($data);

A: You can create an array at PHP level where you put the HTML in a cell within it indexed by html and keep the other data:
$data = array(
    'html' => '<p>....</p>',
    'count_array' => $count_array,
    'count_sorted_array' => $count_sorted_array,
);

Then make the AJAX as datatype:"JSON" and catch the html with data.html in order to put it in the content div


text:
Q: Python: strange issue where conditionally removing elements from a list (I see that this question is a duplicate. Sorry everybody, I wasn't sure of the wording so I couldn't find the other question)
I define the following list of strings:
x=["foo_a","foo_a_b","foo"]

then I do the following:
for i in x:
    if (("a" not in i) or ("b" in i)):
        x.remove(i)

and I get
In [92]: x
Out[92]: ['foo_a', 'foo']

I would expect the element "foo" to be removed too, because it doesn't contain "a" and so it doesn't verify the first condition.
What am I missing?

A: You are modifying the list you are iterating on. Iterate over a copy of x:
x=["foo_a","foo_a_b","foo"]
for i in list(x):
    if (("a" not in i) or ("b" in i)):
        x.remove(i)

Or even better, avoid using a for loop and create a new list with a list comprehension and assign it to x
x = ["foo_a","foo_a_b","foo"]
x = [item for item in x if not (("a" not in i) or ("b" in i))]


text:
Q: CPP extension and multiline literals in Haskell Is it possible to use CPP extension on Haskell code which contains multiline string literals? Are there other conditional compilation techniques for Haskell?
For example, let's take this code:
-- If the next line is uncommented, the program does not compile.
-- {-# LANGUAGE CPP #-}

msg = "Hello\
  \ Wor\
  \ld!"

main = putStrLn msg

If I uncomment {-# LANGUAGE CPP #-}, then GHC refutes this code with a lexical error:
[1 of 1] Compiling Main             ( cpp-multiline.hs, cpp-multiline.o )

cpp-multiline.hs:4:17:
    lexical error in string/character literal at character 'o'

Using GHC 6.12.1, cpphs is available.
I confirm that using cpphs.compat wrapper and -pgmP cpphs.compat option helps, but I'd like to have a solution which does not depend on custom shell scripts. -pgmP cpphs does not work.
P.S. I need to use different code for GHC < 6.12 and GHC >= 6.12, is it possible without preprocessor?
UPD. In addition to the accepted answer of Ganesh, I also found that another workaround is to put all conditional declarations in a separate module with {-# LANGUAGE CPP #-} and thus avoid CPP in the modules with multiline strings.

A: cpphs now has a --cpp option itself, which I think makes the compat script unnecessary: see the cpphs 1.3 entry at http://haskell.org/cpphs/
I think you'd need to pass -optP --cpp to GHC (as well as -pgmP cpphs) to enable this behaviour.

A: It seems the GHC user manual addresses this: Section 4.10.3.1 reads

A small word of warning: -cpp is not friendly to "string gaps".. In other words, strings such as the following:

strmod = "\
\ p \
\ "

don't work with -cpp; /usr/bin/cpp elides the backslash-newline pairs.
However, it appears that if you add a space at the end of the line, then cpp (at least GNU cpp and possibly other cpps) leaves the backslash-space pairs alone and the string gap works as expected.


text:
Q: secureChannel.unwrap function return 6982(Security status not satisfied) I want using secure messaging in my applet by org.globalplatform package. I have a library in C# which implements some of globalplatform commands. I can open secure channel to card in CLR, MAC and ENC mode and i can load and install applet on card in mentioned mode.
Also i open secure channel in my applet successfuly and external authentication response 9000. like this:
case INS_INIT_UPDATE:
case INS_External_AUTHENTICATION:
      SDInstruction(apdu);
      break;

and
private void SDInstruction(APDU apdu)
    {
        byte[] buf = apdu.getBuffer();
        byte cla = buf[ISO7816.OFFSET_CLA];
        byte ins = buf[ISO7816.OFFSET_INS];

    apdu.setIncomingAndReceive();
        if(ins == INS_INIT_UPDATE)
            secureChannel = GPSystem.getSecureChannel();

        short len = secureChannel.processSecurity(apdu);

        apdu.setOutgoing();
    apdu.setOutgoingLength(len);
        apdu.sendBytes(ISO7816.OFFSET_CDATA, (short) len);
    }

but when i want unwrap command apdu "which wraped by global platform c# library" in my applet , cardManager return 6982(Security Status not satisfid).unwraping code:
byte[] buf = apdu.getBuffer();
if (secureChannel.getSecurityLevel() < (SecureChannel.AUTHENTICATED))
                ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);

        short len = secureChannel.unwrap(buf, (short) 0, (short) buf.length);

trace of secure channel apdu:
Command APDU >> Class=00 Ins=A4 P1=04 P2=00 P3=09 Data=A00000030800001000
Response APDU << SW=611A
Command APDU >> Class=00 Ins=C0 P1=00 P2=00 P3=1A
Response APDU << SW=9000 Data=61174F06000010000100790D4F0BA00000030800001000010009
Command APDU >> Class=80 Ins=50 P1=00 P2=00 P3=08 Data=0101010101010101
Response APDU << SW=611C
Command APDU >> Class=00 Ins=C0 P1=00 P2=00 P3=1C
Response APDU << SW=9000 Data=4D0022840106A783224FFF01AF258B0267752E248D07854961DA9851
Command APDU >> Class=84 Ins=82 P1=01 P2=00 P3=10 Data=F6E5BC84DE83E5242E8B6C9CA0ECB741
Response APDU << SW=9000
Command APDU >> Class=04 Ins=20 P1=00 P2=80 P3=0E Data=3131313131315F34DCF6BE7EDD3A
Response APDU << SW=6982
Wrapping apdu command faild.

Anyone can help me?
Thank you very much,
Mohsen.

A: I think your unwrapping command specifies a wrong length.
try:
short len = secureChannel.unwrap(buf, (short) 0, (short)(ISO7816.OFFSET_CDATA + apdu.getIncomingLength()));


text:
Q: How can I get this text with the ID? Hello I have this code in HTML :
2019-04-29 00:00

And I would like to get 2019-04-29 00:00 using jquery I tried this :
var start = $('#t_startdate');

But when I try to show the variable start with :
alert(start);

I get undefined
Could you help me please ?
Thank you !

A: try:
var start = jQuery('#t_startdate').text();

A: Use .text() method for accessing the text of the .
like:
t_startdate = $('#t_startdate').text();
alert(t_startdate);

You can see this for clarification

A: You can get it like below:
$('#t_startdate').textContent

A: you have to wait because ur document is not ready! He said its undefined because its not loaded...
use:
       $(document).ready(function(){
           var start = jQuery('#t_startdate').text();
           alert(start);
       });


text:
Q: CSS :first-child pseudo-element Why is my code not working as intended? background-color of the first article must be green. How I can do it without classes or id? P.S. I'm sorry but my post needs more text. I'm sorry but my post needs more text.
    <!DOCTYPE html>

        <meta charset="utf-8">
        <title>stack</title>

        <link rel="stylesheet" href="css/style_new.css">

This is H1 header

                    Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet
                    Lorem ipsum dolor sit amet Lorem ipsum dolor sit

                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

CSS code:
     section article:first-child {
    background-color: green;
}

    section article:last-child {
        background-color: red;
    }

A: Actually first child of section tag is h1 not article. So use below code instead,
section article:first-of-type {
  background-color: green;
}

A: article is not the first-child of section - its h1
the first/last child selector does only target if article is the first or last child of its container.
possible css:
section article{
  background-color:green;
}
section article + article{
  background-color:transparent;
}
section article:last-child {
  background-color: red;
}

see http://jsfiddle.net/rn4wgho2/

A:  ![enter image description here][1]

h1 required to remove the plug out of the section
This is H1 header

                Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet
                Lorem ipsum dolor sit amet Lorem ipsum dolor sit

                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,


text:
Q: Posição de um cavalo no jogo de xadrez Estou aprendendo C.
Meu professor da faculdade pediu para fazer um programa que leia a posição de um cavalo no jogo de xadrez e imprima TODAS as possibilidades de movimento.
Eu estou quebrando a cabeça pra saber como eu vou saber a letra e o número que o usuário pediu?

A: // criar o tabuleiro
char tabuleiro[8][8];

// Pede ao usuário informar a posição da peça que deseja mover
printf("Digite a linha onde esta sua peca: ");
scanf("%d", &linAtual);
printf("Digite a coluna onde esta sua peca: ");
scanf("%d", &colAtual);

// Pede ao usuário informar para onde deseja que a peça vá
printf("Digite a linha desejada: ");
scanf("%d", &linDes);
printf("Digite a colun desejada: ");
scanf("%d", &colDes);

// Você pode usar essas informações do usuário pra localizar e mover a peça
char peca = tabuleiro [colAtual][linAtual];
tabuleiro [colAtual][linAtual] = " ";
tabuleiro [colDes][linDes]= peca;

Então cara vc vai ter que pensar em como diferenciar as peças(dá pra ter uma ideia pelo código acima) e também vai ter que definir as regras de movimentação (muito if e  else) boa sorte.

A: Eu fiz um algorítmo relacionado à torre do xadrez. A saída mostra o mapa de movimentos que ela pode realizar.
#include <stdio.h>

int main(){

    int linha = 0, coluna = 0;
    int i, j;

    printf("Movimentos de uma Torre no xadrez!\n");

    printf("Digite a linha em que a Torre se encontra: ");
    scanf("%d", &linha);

    printf("Digite a coluna em que a Torre se encontra: ");
    scanf("%d", &coluna);

    printf("    1 2 3 4 5 6 7 8\n   -----------------");

    for (i = 1; i <= 8; i++){

        if (i != linha){

            if (coluna == 1){

                printf("\n%d | x - - - - - - -", i);
            }

            if (coluna == 2){

                printf("\n%d | - x - - - - - -", i);
            }
            if (coluna == 3){

                printf("\n%d | - - x - - - - -", i);
            }

            if (coluna == 4){

                printf("\n%d | - - - x - - - -", i);
            }

            if (coluna == 5){

                printf("\n%d | - - - - x - - -", i);
            }

            if (coluna == 6){

                printf("\n%d | - - - - - x - -", i);
            }
            if (coluna == 7){

                printf("\n%d | - - - - - - x -", i);
            }

            if (coluna == 8){

                printf("\n%d | - - - - - - - x", i);
            }

        }

        else if (i == linha){

        printf("\n%d | x x x x x x x x", i);

        }

    }

    return 0;

}


text:
Q: HttpWebRequest or WebClient - Remove the Connection header when POSTing data - C# I am building an application with C# and one of the requirements is that the headers have to contain very specific data. I have been working with the WebClient and HttpWebRequest classes in C# but both do not have the option to explicitly remove the Connection header. This is what I have tried:
WebClient
client.Headers.Remove("Connection");
client.Headers.Add("Connection", null); // if only...

HttpWebRequest
request.Connection = null;
request.Connection = "";

Some of what I have read is that you can only have this header set to Keep-Alive or Close. I need it to not even be on the web request.
All other required headers are adding just fine. It is this one that is causing a head ache. I'm beginning to believe that removing the Connection header is not possible. Is there any language where it is possible if this is the case?
Much appreciation for the time you guys take to look at this!
Thank you!

A: I'm not quite sure how to remove that specific header, but you could try using the HttpClient class instead of HttpWebRequest or WebClient.
HttpClient class
This class is more up-to-date way of executing HTTP requests in C#


text:
Q: How do modular functions of level $N>1$ transform under the full modular group? Let $f$ be a modular function of level $N>1$ and let $\gamma\in SL_2(\mathbf Z)$. Write $$f(\gamma\tau)=j(\gamma,\tau)f(\tau).$$
First question
What can we say in general about the factor $j(\gamma,\tau)$? In other words, how does the function $f$ transform under the full modular group $SL_2(\mathbf Z)$? Is there some reference on this? What about the case when $f$ is a root of some Hauptmodul?
Background
I will provide some examples to illustrate the problem. Set $\mu_n=e^{2\pi i /n}$ and $$\alpha=\begin{pmatrix}a&b\\c&d\end{pmatrix}\in SL_2(\mathbf Z).$$
Let $j$ be the modular invariant and $\gamma_2(\tau)=\sqrt[3]{j(\tau)}$. We have the formula $$\gamma_2(\alpha\tau)=\mu_3^{a^2cd+ac-cd-ab}=\gamma_2(\tau)$$
and $\gamma_2$ is a modular function of level $3$. Similarly, if $\gamma_3(\tau)=\sqrt[2]{j(\tau)-1728}$ then
$$\gamma_2(\alpha\tau)=\mu_{2}^{ac+bd+bc}\gamma_2(\tau).$$
Thus $\gamma_3$ is a modular function of level $2$. (Note that we consider these roots of $j$ because $j(e^{2\pi i/3})=0$ with multiplicity $3$ and $j(i)-1728=0$ with multiplicity $2$.)
Next let $$\mathfrak f=\mu_{48}^{-1}\frac{\eta\left( \frac{\tau+1}{2}\right)}{\eta\left( \tau\right)}.$$
Here $\eta$ is the Dedekind eta function. We have
$$\mathfrak f(\alpha\tau)^3=\mu_{16}^{2ad+2cd-ac-bd-2d^2}\mathfrak f(\tau)^3.$$
There are also formulas for $\mathfrak f$ and related functions. Observe that the function $\mathfrak f^{24}$ is a Hauptmodul for the subgroup of $SL_2(\mathbf Z)$ generated by the matrices $$\begin{pmatrix}1&2\\0&1\end{pmatrix},\begin{pmatrix}0&-1\\1&0\end{pmatrix}.$$
Second question
How can we investigate the corresponding maps
$$\begin{pmatrix}a&b\\c&d\end{pmatrix}\longmapsto\mu_{16}^{2ad+2cd-ac-bd-2d^2},$$
$$\begin{pmatrix}a&b\\c&d\end{pmatrix}\longmapsto\mu_3^{a^2cd+ac-cd-ab},$$
in a systematic manner? Is there some reference?
More background
The functions $\gamma_2,\gamma_3$ and $\mathfrak f$ are considered by Weber in his Lehrbuch der Algebra. Weber uses them to generate certain class fields. This was subsequently used by Heegner to determine all imaginary quadratic fields of class number one.

A: In general, there is little that one can say about the function $j(\gamma,\tau)$ in the formula $f(\gamma \tau) = j(\gamma,\tau) f(\tau)$, and in general, it is not easy to take a modular function of level $N > 1$ and know for sure how it transforms under every matrix in ${\rm SL}_{2}(\mathbb{Z})$. What one normally does however (and you can see this in Shimura's book that Paul Garrett mentions in his comment) is you can take a finite-dimensional vector space $V$ of modular functions with the property that for any $f \in V$, $f(\gamma \tau)$ is once again in $V$.
One such example, discussed in Shimura's book, is to take all nonzero vectors $\vec{v} = \begin{bmatrix} a & b \end{bmatrix}$ with entries in $\mathbb{Z}/N\mathbb{Z}$ and look at the functions $f_{\vec{v}}(\tau) = \frac{E_{4}(\tau) E_{6}(\tau)}{\Delta(\tau)} \wp_{\langle 1,z \rangle}\left(\frac{az+b}{N}\right)$. This set of functions has the property that $f_{\vec{v}}(\gamma \tau) = f_{\vec{v} \gamma}(\tau)$.
This kind of object (essentially a vector space of functions together with an action of ${\rm SL}_{2}(\mathbb{Z})$) goes by the name of a vector-valued modular form, and have been studied quite a bit.
For your second question, the maps that you describe of the form
$$
  \left(\begin{bmatrix} a & b \\ c & d \end{bmatrix}\right) \mapsto \mu_{16}^{2ad + 2cd - ac - bd - 2d^{2}}
$$
are $1$-cocycles of ${\rm SL}_{2}(\mathbb{Z})$ with values in $\mathbb{C}^{\times}$, and they are parametrized by group cohomology. Sometimes these also go by the name "multiplier systems". There's also a lot written about these. One place you might start lookin is the paper here.


text:
Q: Difference between element(...) and element(...).getWebElement() in Protractor
*

*Why we need element(...).getWebElement() over element(...) when both works exactly the same

*Why two APIs for the same functionality

A: Protractor is a convenient wrapper around WebDriverJS - javascript selenium bindings.

*

*element(...) would result into an ElementFinder instance introduced in Protractor

*element(...).getWebElement() would result into a WebElement instance from WebDriverJS. Basically, this gives you access to the pure "bare-metal" WebElement.

The most common use-case for using getWebElement() is when you need to pass an ElementFinder as a script argument - currently you have to call getWebElement() for this to work:
var elm = element(by.id("myid"));
browser.executeScript("arguments[0].click()", elm.getWebElement());

There is an open feature-request to be able to pass ElementFinder directly:
browser.executeScript("arguments[0].click()", elm);  // not gonna work as of now


text:
Q: What format does this SQL need to be in for Oracle to accept it? I tried all of the following, in turn:
1) // as it was in the legacy code
ocmd.CommandText = "SELECT TRUNC(SYSDATE,''DD'') "VALUE" FROM DUAL";

2) // adding a @
ocmd.CommandText = @"SELECT TRUNC(SYSDATE,''DD'') "VALUE" FROM DUAL";

3) // try single quotes
ocmd.CommandText = "SELECT TRUNC(SYSDATE,''DD'') 'VALUE' FROM DUAL";

4) // try two single quotes, like DD
ocmd.CommandText = "SELECT TRUNC(SYSDATE,''DD'') ''VALUE'' FROM DUAL";

5) // try the @
ocmd.CommandText = @"SELECT TRUNC(SYSDATE,''DD'') ''VALUE'' FROM DUAL";

1 and 2 gave me the compile-time error: "; expected" (on the "VALUE")
3, 4, and 5 gave me, "Message=ORA-00907: missing right parenthesis"

A: The following query will work in Oracle: (sqlfiddle)
SELECT TRUNC(SYSDATE, 'DD') "VALUE" FROM DUAL

However to write a double-quote inside a regular string literal in C# you need to escape it with a backslash:
ocmd.CommandText = "SELECT TRUNC(SYSDATE, 'DD') \"VALUE\" FROM DUAL";

If you would rather use a verbatim string literal for whatever reason, then you need to escape a double-quote with another double-quote:
ocmd.CommandText = @"SELECT TRUNC(SYSDATE, 'DD') ""VALUE"" FROM DUAL";

Note: As Vash pointed out in a comment, the double-quotes surrounding VALUE aren't actually necessary for Oracle to parse the query correctly.


text:
Q: AMP - Consent categories I have a lot of demands from client who would like to use amp and the consent form. But all of them would like to keep the behaviour we offer on our web product which is being able to consent to only part of the data usage.
For example allowing to collect data for analytics purpose but not for personalised ads. Or sometimes even going down to the vendor level in each categories.
From the tests I've done until now, I can display details, but I understood that we can only have 1 Consent instance and that you can only accept/refuse/dismiss it.
Thus I can't have granularity this way.
My main job is not web dev, so I might have missed something obvious somewhere :)
Is there a way to allow a user to consent to only part of the data collection ?
Also keeping in mind that we have to be able to have access to what was authorised so we can use it in our custom amp-analytics component.
Thanks a lot.

A: This is currently not supported by amp-consent. The AMP team is working on expanding the functionality to include a per-purpose, per-vendor collection of consent in support of the IAB's Transparency and Consent Framework. If you are interested in this work, please join the discussion on this Github issue (or subscribe to notified once it's implemented).


text:
Q: Removing textual lines from top or that include specific char or string from multiple text files I have lyrics text files in the same directory, from which I would like to remove several lines according to these rules:
A. remove all line that include square brackets [ ]
B. remove the three non-empty lines from the top.
C. remove two non-empty lines from the bottom.
For an example, maybe a command line such as this be fixed to do (A) for multiple files?
type *.txt | findstr /v LYRICS | findstr /v "[" | findstr /v "]" >*.txt

Gilbert

A: Major Edit - I tested and debugged my code. There were many bugs.
I think this should get you close. But I'm still not sure I understand your non-empty condition.
This code will modify all .TXT files in the current directory. For each file, it should delete the 1st 3 lines, the last 2 lines, and any lines that contains [ or ]. Any line that starts with : in the 1st position will have leading : stripped.
@echo off
for %%F in (*.txt) do (
  for /f %%N in ('find /c /v "" ^<"%%F"') do set bottom1=%%N
  set /a bottom2=bottom1-1
  (
    for /f "tokens=1* delims=:" %%A in (
      'findstr /n "^" "%%F" ^| findstr /vr /c:"\[" /c:"\]" /c:"^1:" /c:"^2:" /c:"^3:" /c:"^%%bottom1%%:" /c:"^%%bottom2%%:"'
    ) do echo(%%B
  )>"%%~nF.mod"
  rem del "%%F"
  rem ren "%%~nF.mod" "%%~nxF"
)

As written, the original file will be preserved and the modified version will have the same name but with a .mod extension.
If you are comfortable with the results, you can remove the rem from the front of the last 2 lines, and then your original files will be overwritten with the modified version. Make sure you only run the script once if you make this change!
The first FIND gets the count of the number of lines, so we know which lines to remove from the bottom based on line number.
The interesting bit is the big long command in the 2nd FOR loop. The first FINDSTR prefixes each line with the line number. These results are then piped to a second FINDSTR that removes the appropriate lines based on my understanding of your requirements.
It uses regular expressions. For example, "^1:" is a regex that looks for "1:" at the beginning of a line.
The double percents are used for bottom1 and bottom2 so that we can access the current values without using delayed expansion. Within the parent batch %%bottom1%% becomes %bottom1%, which is passed on to the FINDSTR command. FOR /F IN() clause commands are executed within their own CMD session, so it is able to properly expand the current value of %bottom1%.
Since the /v option is used, FINDSTR preserves all lines that do NOT match any of the regex search strings. You were on the right track in this regard. It is just more efficient to do all the filtering with one FINDSTR.
The FOR /F options are set to break each line into two tokens, breaking at the 1st : in each line. Only the 2nd token is printed. That is how the line number prefix is stripped out of the output.


text:
Q: Spring mvc Autowiring fails TrackerRepoImpl.java
    @Repository("TrackerRepo")
    public class TrackerRepoImpl implements TrackerRepo { //repository interface implementation

        @Autowired
        private SessionFactory sessionFactory;

        @Override
        public Session getCurrentSession() {
            return sessionFactory.getCurrentSession();
        }

        @Override
        public void save(Event event) {
            getCurrentSession().save(event);
        }
    }

TrackerServiceImpl.java
    @Service("TrackerService")
    public class TrackerServiceImpl implements TrackerService { //service interface implementation

        @Autowired
        private TrackerRepo repo;

        @Override
        @Transactional
        public void save(Event event) {
            repo.save(event);
        }

    }

RootConfig.java
    @Configuration
    @EnableTransactionManagement
    @ComponentScan(basePackages={"com.tracker"},excludeFilters={@Filter(type=FilterType.ANNOTATION,value=EnableWebMvc.class)})
    public class RootConfig {

        @Bean  //session factory bean
        public LocalSessionFactoryBean factoryBean(DataSource dataSource)
        {
            LocalSessionFactoryBean bean=new LocalSessionFactoryBean();
            bean.setDataSource(dataSource);
            Properties properties=new Properties();
            properties.setProperty("dialect", "org.hibernate.dialect.MySQLDialect");
            bean.setHibernateProperties(properties);
            bean.setPackagesToScan("com.tracker");
            return bean;
        }

        @Bean  //datbase details
        public DataSource dataSource()
        {
            DriverManagerDataSource dataSource=new DriverManagerDataSource();
            dataSource.setDriverClassName("com.mysql.jdbc.Driver");
            dataSource.setUrl("jdbc:mysql://localhost/tracker");
            dataSource.setUsername("root");
            dataSource.setPassword("root");

            return dataSource;
        }
       @Bean
       @Autowired
       public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
          HibernateTransactionManager txManager = new HibernateTransactionManager();
          txManager.setSessionFactory(sessionFactory);

          return txManager;
       }

        @Bean
        public BeanPostProcessor persistenceTranslation() {
        return new PersistenceExceptionTranslationPostProcessor();
        }
    }

errors:
Jun 29, 2015 1:33:10 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/tracker] threw exception [Request processing failed; nested exception is org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread] with root cause
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
    at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:134)
    at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014)
    at com.tracker.web.dao.TrackerRepoImpl.getCurrentSession(TrackerRepoImpl.java:22)
    at com.tracker.web.dao.TrackerRepoImpl.save(TrackerRepoImpl.java:27)
    at com.tracker.web.service.TrackerServiceImpl.save(TrackerServiceImpl.java:22)
    at com.tracker.web.controllers.MainController.submitPlannedPage(MainController.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)


text:
Q: Should I encapsulate collection also in a setter? Should I replace a simple setter
public void setCategories(Set<String> categories)
{
    this.categories = categories;
}

with something like this:
public void setCategories(Collection<String> categories)
{
    this.categories.clear();
    if (categories != null)
    {
        this.categories.addAll(categories);
    }
}

so object's attribute categories won't be further modifiable through passed parameter reference as it could be:
Set<String> categories = new TreeSet<String>();
categories.add("cityguide");
categories.add("other");
Document document = new Document("http://unique-address.com");
document.setCategories(categories);
System.out.println(categories); //outputs [cityguide, other]
System.out.println(document.getCategories()); //outputs [cityguide, other]
document.setCategories(categories);
categories.add("traveling");
System.out.println(categories); //outputs [cityguide, other, traveling]
System.out.println(document.getCategories()); //outputs [cityguide, other, traveling]

A: yes, yes you should
another option is also making a new set for the field in the setter but your solution is better as it avoid the (unnecessary) allocation
or remove and add each category in a loop
public void setCategories(Collection<String> categories)
{
    for(String cat:this.category.toArray(new String[0])){//using toArray to avoid ConcurrentModificationException
        removeCategory(cat);
    }
    if (categories != null)
    {
        for(String cat:categories){
            addCategory(cat);
        }
    }
}

so you won't have to duplicate any triggers for removing and/or or adding a category

A: So , all you want to do  is just add a string collection to the Document  's categories .
I will  just create the following methods to do it :
public void addCategory(String categories){
             this.categories.add(categories);
}

public void addCategory(Collection<String> categories){
         this.categories.addAll(categories);
}

So ,if I want the Document  's categories set won't be further modified through passed parameter reference , I will use the addCategory() .
If I want the Document  's categories  can be further modified  through passed parameter reference , I can still use the original setCategories()


text:
Q: Is Android M not allowing hard links? I have an Android app with some C code that uses the link(2) system call to create a hard link to an existing file.  When I execute the app on Android 5.0.2, this part of the app works.  When I execute the exact same app on an Android-M device the link() system call returns -1 "permission denied".
I notice in my log getting messages like this:
09-02 17:10:34.222  5291  5291 W ona.crackerjack: type=1400 audit(0.0:59): avc: denied { link } for name="fixed28" dev="mmcblk0p28" ino=82829 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=lnk_file permissive=0

This message appears nearby my app's log message that link() returned -1 "permission denied", sometimes earlier, sometimes later.
Is creating a hard link considered unsecure?  I notice the "scontext=u:r:untrusted_app".  Is there a way to make the app trusted and if so, would that let the link() system call work?

A: Apparently there are new SELinux rules, which forbid making hard links (or maybe accessing the folder or file).
Normal users cannot alter SELinux rules and even with root permissions this is not straightforward.
More on SELinux: https://source.android.com/devices/tech/security/selinux/

A: It looks like this is "by design".
At https://code.google.com/p/android-developer-preview/issues/detail?id=3150 , a member of the project explains that:

Hard linking files is blocked and an attempt to call link() on a file will return
  EACCES.


text:
Q: Sessions not storing while using them in view function django I want to store the username value in my browser sessions when i call the login function from view . I have tried the request.session syntax but it is not working and not storing the username in my sessions. I have confirmed that by going to the developer tools console.
VIEW FUNCTION
def login_submit(request):
    if request.method == 'POST':
        username = request.POST.get('username')
        password = request.POST.get('password')
        form = AppUserForm(request.POST)
        # form['my_field'].value()
        if AppUser.objects.filter(username=username, password=password).exists():

            request.session['username'] = username //I WANT TO SET THE SESSION HERE

            return HttpResponseRedirect('/')
        else:
            return login(request)

A: By default Django-Sessions are stored in the Database (If other session engine is not provided). From the Docs:

By default, Django stores sessions in your database (using the model django.contrib.sessions.models.Session). It is used to store data for one session. So if you close the Window/Tab, the session will expire.

So if you want to check user's session data, you can query the django.contrib.sessions.models.Session model.
This is the example of stored data in the model:
{
'_state': <django.db.models.base.ModelState object at 0x7f41e2908cf8>,
'session_key': 'dmi7gfanckowzpikyihlt2a8696tuaka',
 'session_data': 'MDNkYTBlYzMxYTMyZWQ4YzMwZTk0ZY4EjTFmNjA5YWRjMTdiMTA1Nzp7Il9hdXRoX3VzZXJfaWQiOiIyIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI3NmQ5Y2I3ZTliNGIzYWExNDc2NmM1OTUxZDBlOWNmZmIxNTUyOGEzIn0=',
 'expire_date': datetime.datetime(2020, 2, 10, 17, 20, 29, 768812,
 tzinfo=<UTC>)
}

I have called the instance.__dict__ to get the data as dictionary.
The Session Storage you are referring is JavaScript's Window.sessionStorage.
You can create Session Storage by: (snippet from Mozilla Docs)
// Save data to sessionStorage
sessionStorage.setItem('key', 'value');

// Get saved data from sessionStorage
let data = sessionStorage.getItem('key');

// Remove saved data from sessionStorage
sessionStorage.removeItem('key');

// Remove all saved data from sessionStorage
sessionStorage.clear();

Mozilla Docs on sessionStorage.


text:
Q: android studio can't download complete android.support.v7.widget I ought to use AppCompatTevtView, which is in the package android.support.v7.widget
But after adding compile 'com.android.support:appcompat-v7:21.0.0' to gradle and sync, I get only part of the package which doesn't include the AppCompatTextView.class.
What should I do?

A: AppCompatTextView was initially released with AppCompat v22.1. So you will need to update the version that you are syncing with gradle. I believe the latest version is 23.4.0.


text:
Q: Tkinter -How to get a LABEL to respond to a certain function that has been CALLED by a BUTTON I am currently using Tkinter for a GUI. I am working on a LOGIC GATES program where I ask the user for two inputs (1 or 0). I have created 5 functions (orF, andF, nandF, norF, xorF) and used the GRID method to position my widgets.
I tried getting the label which I have called "al", to present the result once a BUTTON (OR, AND, NAND, NOR, XOR) has been clicked.
The "al" widget isn't responding to the functions and some of my labels have been cut off.
How can I create a program that enable the user to click on a button in order for the result (1 or 0) to be presented onto another label?
Here's the code:
from tkinter import *

root = Tk()
root.title("Logic Gates Calculator")

Title = Label(root, text ="Using machine to calculate the correct LOGIC Gate
from inputs",
              fg = "blue",
              bg = "#00ffff",
              font = "Calibri 22 bold italic")

Title.grid(row=0, column=0)

al = Label(root, text ="The result",
           fg = "white",
           bg = "blue",
           font = "Helvetica 22 bold")

al.grid(row=0, column=1)

first_il = Label(root, text ="Enter your first input: ",
                 fg = "white",
                 bg = "dark blue",
                 font = "Calibri 18 bold italic")

first_il.grid(row=2, column=0)

first_ie = Entry(root)
first_ie.grid(row=2, column=1)

second_il = Label(root, text ="Enter your second input: ",
                 fg = "white",
                 bg = "dark blue",
                 font = "Calibri 18 bold italic")

second_il.grid(row=3, column=0)

second_ie = Entry(root)
second_ie.grid(row=3, column=1)

def orF():
    input1 = first_ie.get()
    input2 = second_ie.get()

    if (input1 == "1" and input2 == "0") or (input2 == "1" and input1 ==
    "0"):
        al = Label(root, text ="1")

    if (input1 == "1" and input2 == "1"):
        al = Label(root, text ="1")

    if (input1 == "0" and input2 == "0"):
        al = Label(root, text ="0")

    else:
        al = Label(root, text ="Invalid input")

def andF():
    input1 = first_ie.get()
    input2 = second_ie.get()

    if (input1 == "1" and input2 == "0") or (input2 == "1" and input1 == "0"):
        al = Label(root, text ="0")

    if (input1 == "1" and input2 == "1"):
        al = Label(root, text ="1")

    if (input1 == "0" and input2 == "0"):
        al = Label(root, text ="0")

    else:
        al = Label(root, text ="Invalid input")

def norF():
    input1 = first_ie.get()
    input2 = second_ie.get()

    if (input1 == "1" and input2 == "0") or (input2 == "1" and input1 == "0"):
        al = Label(root, text ="0")

    if (input1 == "1" and input2 == "1"):
        al = Label(root, text ="0")

    if (input1 == "0" and input2 == "0"):
        al = Label(root, text ="1")

    else:
        al = Label(root, text ="Invalid input")

def nandF():
    input1 = first_ie.get()
    input2 = second_ie.get()

    if (input1 == "1" and input2 == "0") or (input2 == "1" and input1 == "0"):
        al = Label(root, text ="1")

    if (input1 == "1" and input2 == "1"):
        al = Label(root, text ="0")

    if (input1 == "0" and input2 == "0"):
        al = Label(root, text ="1")

    else:
        al = Label(root, text ="Invalid input")

def xorF():
    input1 = first_ie.get()
    input2 = second_ie.get()

    if (input1 == "1" and input2 == "0") or (input2 == "1" and input1 == "0"):
        al = Label(root, text ="1")

    if (input1 == "1" and input2 == "1"):
        al = Label(root, text ="0")

    if (input1 == "0" and input2 == "0"):
        al = Label(root, text ="0")

    else:
        al = Label(root, text ="Invalid input")

or_button = Button(root, text ="Click for OR",
                    fg = "blue",
                    bg = "yellow",
                    font = "Calibri 20 bold italic",
                    command = orF)

or_button.grid(row =1, column =1)

and_button = Button(root, text ="Click for AND",
                    fg = "blue",
                    bg = "red",
                    font = "Calibri 20 bold italic",
                    command = andF)

and_button.grid(row =1, column =2)

nor_button = Button(root, text ="Click for NOR",
                    fg = "blue",
                    bg = "green",
                    font = "Calibri 20 bold italic",
                    command = norF)

nor_button.grid(row =1, column =3)

nand_button = Button(root, text ="Click for NAND",
                    fg = "blue",
                    bg = "orange",
                    font = "Calibri 20 bold italic",
                    command = nandF)

nand_button.grid(row =1, column =4)

xor_button = Button(root, text ="Click for XOR",
                    fg = "blue",
                    bg = "Magenta",
                    font = "Calibri 20 bold italic",
                    command = xorF)

xor_button.grid(row =1, column =5)

root.mainloop()


text:
Q: Background of ElevatedButton is not modified I am using ButtonBar and ElevatedButton but I am not able to change the button background. It stayed grey. below is the code:
class GuestFlowBottomBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Container(
        margin: new EdgeInsets.only(left: 10.0, right: 10.0),
        child: new ButtonBar(
          alignment: MainAxisAlignment.center,
          children: <Widget>[
            new ElevatedButton(
                child: new Text('Create an Account',
                    style: TextStyle(color: Colors.orange)),
                onPressed: null,
                style: ElevatedButton.styleFrom(
                    primary: Colors.white,
                    side: BorderSide(width: 2.0, color: Colors.orange),
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(20.0)))),
            new ElevatedButton(
                child: new Text('Already an Account?',
                    style: TextStyle(color: Colors.black)),
                onPressed: null,
                style: ElevatedButton.styleFrom(
                    primary: Colors.black,
                    side: BorderSide(width: 2.0, color: Colors.black),
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(20.0)))),
          ],
        ),
      ),
    );
  }
}

I am forcing it using primary: Colors.black, but it remains grey as the picture below shows:

Any idea ?

A: You have given onPressed a null value. Try:
ElevatedButton(
  child: new Text('Create an Account',
      style: TextStyle(color: Colors.orange)),
  onPressed: (){},
  style: ElevatedButton.styleFrom(
      primary: Colors.black,
      side: BorderSide(width: 2.0, color: Colors.orange),
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(20.0)))),

A: You might forget to write onPressed. but If It's intended, this is an another way to controll All states with your buttons.
class GuestFlowBottomBar extends StatelessWidget {

  Color getColor(Set<MaterialState> states) {
      const Set<MaterialState> interactiveStates = <MaterialState>{
        MaterialState.pressed,
        MaterialState.hovered,
        MaterialState.focused,
      };
      if (states.any(interactiveStates.contains)) {
        return Colors.blue;
      }
      return Colors.red;
    }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Container(
        margin: new EdgeInsets.only(left: 10.0, right: 10.0),
        child: new ButtonBar(
          alignment: MainAxisAlignment.center,
          children: <Widget>[
            new ElevatedButton(
                child: new Text('Create an Account',
                    style: TextStyle(color: Colors.orange)),
                onPressed: null,
                style: ElevatedButton.styleFrom(
                    side: BorderSide(width: 2.0, color: Colors.orange),
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(20.0)))),
            new ElevatedButton(
                child: new Text('Already an Account?',
                    style: TextStyle(color: Colors.black)),
                onPressed: null,
                style: ElevatedButton.styleFrom(
                    side: BorderSide(width: 2.0, color: Colors.black),
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(20.0))).copyWith(
                  backgroundColor: MaterialStateProperty.resolveWith(getColor)
                )
            ),
          ],
        ),
      ),
    );
  }
}