Q: Insert to all cells when records are more than one PHP here is my big program!

note: all codes are in one page.

freinds, all thing is ok but problem is in 'while' line and when i have more than one record.

here we connect to database and fetch information about users that got service of another users.

<form name="form2" method="post" action="" accept-charset='UTF-8'>
<?php
$id=$fgmembersite->UserID();
echo "$id"; ?>

<?php
$db_host = 'localhost';
$db_name= 'site';
$db_table= 'action';
$db_user = 'root';
$db_pass = '';

$con = mysql_connect($db_host,$db_user,$db_pass) or die("خطا در اتصال به پايگاه داده");
$selected=mysql_select_db($db_name, $con) or die("خطا در انتخاب پايگاه داده");
mysql_query("SET CHARACTER SET  utf8");

$dbresult=mysql_query("SELECT tablesite.name,
                          tablesite.family,
                          tablesite.username,
                          tablesite.phone_number,
                          tablesite.email,
                          action.service_provider_comment,
                          action.price,
                          action.date,
                          job_list.job_name,
                          relationofaction.ind
                   FROM  $db_table
                   INNER JOIN job_list
                   on job_list.job_id=action.job_id
                   INNER JOIN relationofaction
                   on relationofaction.ind=action.ind
                   INNER JOIN tablesite
                   on tablesite.id_user=action.service_provider_id AND action.customer_id='$id'",$con);

here prints all times that current user got service of another user. it may be 0 or n.
problem is here. when services are more that 1 and when i am trying to insert informations to table, first choose of vote and explain inserts to all cells.
each button must send information to a seprated field not all fileds!

                   while($amch=mysql_fetch_assoc($dbresult))
{?>
<?php
echo'
';
echo "نام خدمت دهنده: "."&nbsp&nbsp&nbsp".$amch["name"]." ".$amch["family"]."&nbsp&nbsp&nbsp"."شماره تماس: ".$amch["phone_number"]."&nbsp&nbsp&nbsp"."ایمیل: ".$amch["email"].'
'.

"شغل انجام شده: ".$amch["job_name"].'
'
."تاریخ انجام عملیات: ".$amch["date"].'
'
."هزینه ی کار: ".$amch["price"]." تومان".'
'
.$amch["service_provider_comment"].'
';

   echo'اگر توضیحاتی برای ارائه در این باره دارید، ارائه دهید
';
   echo'<textarea name="explain" id="explain" cols="" rows="" style="width:300 ;height:300"></textarea>'.'
';

echo'امتیاز این عملیات را ثبت نمایید:
';
echo '<select name="vote">';
echo '<option value="عالی">عالی</option>';
echo '<option value="عالی">خوب</option>';
echo '<option value="عالی">متوسط</option>';
echo '<option value="عالی">بد</option>';
echo '</select>';
echo'
';
echo '<input type="submit" name="submit" value="ارسال نظر شما"/>';

echo'
';
echo'
';
echo'
';

}

?>

here we say if user clicked on button, send informations to table. once again i say all thing for one record is ok, problem when occure that we have more than one record and i now problem is in 'while' but i do not know how fix this problem.

<?php
if(isset($_POST['submit']))
{

$db_host = 'localhost';
$db_name= 'site';
$db_table= 'action';
$db_user = 'root';
$db_pass = '';

$con = mysql_connect($db_host,$db_user,$db_pass) or die("خطا در اتصال به پايگاه داده");

mysql_query("SET NAMES 'utf8'", $con);
mysql_query("SET CHARACTER SET 'utf8'", $con);
mysql_query("SET character_set_connection = 'utf8'", $con);

$selected=mysql_select_db($db_name, $con) or die("خطا در انتخاب پايگاه داده");
$ins ="UPDATE $db_table
SET
customer_comment='" . mysql_escape_string($_POST['explain']) . "',
vote='" . mysql_escape_string($_POST['vote']) . "'
WHERE ind=ind";
$saved=mysql_query($ins );
mysql_close($con);

echo '';
echo '';
}
?>

this is a forms of a person that have 3 forms

and here is my table after sending

as you see we have repetetive records but where customer_id=37 there is not a problem because that user hasve just a record.
tables:

tablesite:

1   id_user     int(11)
2   name    varchar(128)    utf8mb4_persian_ci
3   family  varchar(128)    utf8mb4_persian_ci
4   email   varchar(64)     utf8mb4_persian_ci
5   phone_number    varchar(16)     utf8mb4_persian_ci
6   username    varchar(16)     utf8mb4_persian_ci
7   password    varchar(32)     utf8mb4_persian_ci
8   confirmcode     varchar(32)     utf8mb4_persian_ci

relation

1   user_name   varchar(255)    utf8mb4_persian_ci
2   job_id  int(255)
3   comments    varchar(255)
4   user_id     int(255)

RelationOfaction

1   service_provider_id     int(20)
2   customer_id     int(20)
3   ind     int(20)

action

1   job_id  int(11)
2   service_provider_id     int(10)
3   customer_id     int(10)
4   date    date
5   price   int(255)
6   vote    varchar(255)    utf8mb4_persian_ci
7   service_provider_comment    varchar(255)    utf8mb4_persian_ci
8   customer_comment    varchar(255)
9   ind     int(10)

A: I would advise wrapping each portion in its own form:
<?php
$id = $fgmembersite->UserID();
echo "$id";
$db_host = 'localhost';
$db_name= 'site';
$db_table= 'action';
$db_user = 'root';
$db_pass = '';

$con = mysql_connect($db_host,$db_user,$db_pass) or die("خطا در اتصال به پايگاه داده");
$selected=mysql_select_db($db_name, $con) or die("خطا در انتخاب پايگاه داده");
mysql_query("SET CHARACTER SET  utf8");

$dbresult=mysql_query("SELECT tablesite.name,
    tablesite.family,
    tablesite.username,
    tablesite.phone_number,
    tablesite.email,
    action.service_provider_comment,
    action.price,
    action.date,
    job_list.job_name,
    relationofaction.ind
    FROM $db_table
    INNER JOIN job_list
    ON job_list.job_id=action.job_id
    INNER JOIN relationofaction
    ON relationofaction.ind=action.ind
    INNER JOIN tablesite
    ON tablesite.id_user=action.service_provider_id
    AND action.customer_id='$id'", $con);
$i = 1;
while($amch=mysql_fetch_assoc($dbresult)){
    echo "<form id='form_$i' method='post' action='{$_SERVER['PHP_SELF']}' accept-charset='UTF-8'>\r\n";
    echo '
';
    echo "نام خدمت دهنده: "."&nbsp&nbsp&nbsp".$amch["name"]." ".$amch["family"]."&nbsp&nbsp&nbsp"."شماره تماس: ".$amch["phone_number"]."&nbsp&nbsp&nbsp"."ایمیل: ".$amch["email"].'
'
    ."شغل انجام شده: ".$amch["job_name"].'
'
    ."تاریخ انجام عملیات: ".$amch["date"].'
'
    ."هزینه ی کار: ".$amch["price"]." تومان".'
'
    .$amch["service_provider_comment"].'
';
    echo 'اگر توضیحاتی برای ارائه در این باره دارید، ارائه دهید
';
    echo '<textarea name="explain" id="explain" cols="" rows="" style="width:300 ;height:300"></textarea>'.'
';
    echo 'امتیاز این عملیات را ثبت نمایید:
';
    echo '<select name="vote">';
    echo '    <option value="عالی">عالی</option>';
    echo '    <option value="عالی">خوب</option>';
    echo '    <option value="عالی">متوسط</option>';
    echo '    <option value="عالی">بد</option>';
    echo '</select>';
    echo '
';
    echo '<input type="submit" name="submit" value="ارسال نظر شما"/>';
    echo '
';
    echo '
';
    echo '
';
    echo "</form>\r\n";
    $i++;
}
?>

You will find a number of little fixes in this code. This will result in a number of forms, each with a unique ID, posting to the same place.

A: With respect to @Twisty answer, I would like to come with my final solution to your submission problem.
First of all we need to define which raw to be updated, therefore you need to tell your update statement which ind to be updated.
To do that we need to pass ind in out submission form to out update statement, we added a hidden input field and pass out ind value like this.
<input type="hidden" name="ind" value="' . $amch["ind"] . '">;

Next we need to fetch the value and update our data by adding following:
($_POST['ind'])

So the final solution will look like this:
echo '</select>';
echo '<input type="hidden" name="ind" value="' . $amch["ind"] . '">'; //new line
echo '
';
echo '<input type="submit" name="submit" value="ارسال نظر شما"/>';
echo '
';
echo '
';

and in your update statement:
$ins = "UPDATE $db_table
        SET
        customer_comment='" . mysql_escape_string($_POST['explain']) . "',
        vote='" . mysql_escape_string($_POST['vote']) . "'
        WHERE ind=".($_POST['ind']); // to define the ind value

And wala, it works.
NOTE:
Just be a ware of, I used the updated code of @Twisty and the final solution on it.


Q: Symfony, How to pass a variable to the path? I need to pass the var 'busqueda' for the path, if instead of using the var I put text if it works, but to shove the variable tells me there.
JavaScript code in twig.
var busqueda = document.getElementById('search_keywords').value;

xmlhttp.open("GET","{{path('searchCorreos', {'page': thisPage, 'search': busqueda } )}}",true);
xmlhttp.send();

A: Since it's a GET request, this should work:
var busqueda = document.getElementById('search_keywords').value;

xmlhttp.open("GET","{{ path('searchCorreos', {'page': thisPage}) }}&search=" + busqueda,true);
xmlhttp.send();

A: If you run into this problem more often (needing to append javascript variables to symfony generated paths/urls) you can make use of the FOSJsRoutingBundle: https://github.com/FriendsOfSymfony/FOSJsRoutingBundle
This allows you to do the following in your javascript source:
var busqueda = document.getElementById('search_keywords').value;
var path = Routing.generate('searchCorreos', { page: 'thisPage', search: busqueda });

xmlhttp.open("GET", path, true);
xmlhttp.send();


Q: Casting DataRow value into float I'm working with DataRow and I want to divide every value in the row with a number(taken from a cell from the same row). I've been searching ways to convert the values into float, like from this thread, but casting gives me "Specified cast is not valid" error.
List<DataTable> tblsol = new List<DataTable>();
DataTable now = tblsol.Last();

while (true)
        {
            DataRow fb = now.Rows[v];
            DataRow fb2 = now.Rows[w];
            float akun = (float)fb[fb.Table.Columns.Count - 1] /
            (float)fb[u];
            if (akun > (float)fb2[fb2.Table.Columns.Count - 1] /
            (float)fb2[u])
            {
                if (w == now.Rows.Count - 1) { v = w; break; }
                else { v++; w++; }
            }
            else
            {
                if (w == now.Rows.Count - 1) { break; }
                else { w++; }

            }
        }

        DataRow bk = now.Rows[v];

        float angkun = Convert.ToSingle(bk[u]);
        for (int dc = 1; dc < now.Columns.Count;dc++)
        {
            bk[dc] = Convert.ToSingle(bk[dc]) / angkun;
        }

I used 2 methods to convert the value into float (using Convert.toSingle and casting), but both ways gave me error. Is there anything else I can do? Or maybe is there something wrong in my code?
p.s. tblSol is not empty and all variables are already declared.

A: try float.Parse, but you need to convert the datarow to dynamic/string type for it to be compatible:
var test = (dynamic)fb[fb.Table.Columns.Count - 1];
float boat = float.Parse(test);

Or something similar using float.Parse

A: You can try after converting it to String like this,
float akun = float.Parse(fb[fb.Table.Columns.Count - 1].ToString()) /
        float.Parse(fb[u].ToString());

A: As noted in my comment, try casting the relevant columns to Decimal first. It is one of the explicitly supported DataTypes when accessing data from columns of DataRow instances; the valid types are listed in the MSDN DataColumn Reference page


Q: What is the scope of a namespace alias in C++? Does a C++ namespace alias defined inside a function definition have a block, function, file, or other scope (duration of validity)?

A: It's a block duration of validity. E.g If you define a namespace alias as below, the namespace alias abc would be invalid outside   {...} block.

 {
    namespace abc = xyz;
    abc::test t;  //valid
 }
  abc::test t;  //invalid

A: The scope is the declarative region in which the alias is defined.

A: It would have the scope of the block in which it was defined - likely to be the same as function scope unless you declare the alias inside a block within a function.

A: I'm fairly certain that a namespace alias only has scope within the block it's created in, like most other sorts of identifiers. I can't check for sure at the moment, but this page doesn't seem to go against it.

A: As far as I know, it's in the scope it's declared. So, if you alias in a method, then it's valid in that method, but not in another.

A: Take a look at http://en.wikibooks.org/wiki/C++_Programming/Scope/Namespaces

A: It is valid for the duration of the scope in which it is introduced.
Take a look at http://en.cppreference.com/w/cpp/language/namespace_alias, I trust the explanation of cppreference, it's much more standard.


Q: Find position of a node using xpath using attributes How can I get the position of a node based on a certain attribute value?  The following post shows how to do this with elements:
Find position of a node using xpath
So if we change the example xml in the post mentioned above to:
<a>
    <b val="zyx" />
    <b val="wvu" />
    <b val="tsr" />
    <b val="qpo" />
</a>

How would I get the position of a/b[@val = 'tsr']?

A: Should be almost exactly the same:
count(a/b[@val='tsr']/preceding-sibling::*)+1

Example usage...
XSLT 1.0
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <xsl:value-of select="count(a/b[@val='tsr']/preceding-sibling::*)+1"/>
  </xsl:template>

</xsl:stylesheet>

Output:
3


Q: get_the_terms issue on foreach loop I want to show taxonomy name in post. I use foreach loop but it does not show any thing to me.
here is my code.
<?php

    global $post;
        $foo_home_url = site_url();

        $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

        if(strpos($url, 'foo_cat')){
            $foo_bc_cat = get_the_terms( $post->ID , FOO_POST_TAXONOMY );
    ?>

<a href="<?php echo $foo_home_url; ?>">Home

    <?php
                    foreach($foo_bc_cat as $foo_tax_cat){
    ?>

<a href="<?php echo get_term_link($foo_tax_cat->slug, FOO_POST_TAXONOMY) ?>"><?php echo $foo_tax_cat->name ?>

    <?php
                    }
    ?>

    <?php
        }
    ?>

Any idea.

A: use this code
<?php
global $post;
    $foo_home_url = site_url();

    $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

    if(strpos($url, 'foo_cat')){
        $foo_bc_name = get_queried_object()->name;
?>

<a href="<?php echo $foo_home_url; ?>">Home

<a href="<?php echo get_term_link($foo_tax_cat->slug, FOO_POST_TAXONOMY) ?>"><?php echo $foo_bc_name; ?>

<?php
    }
?>

instead of this code
<?php

    global $post;
        $foo_home_url = site_url();

        $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

        if(strpos($url, 'foo_cat')){
            $foo_bc_cat = get_the_terms( $post->ID , FOO_POST_TAXONOMY );
    ?>

<a href="<?php echo $foo_home_url; ?>">Home

    <?php
                    foreach($foo_bc_cat as $foo_tax_cat){
    ?>

<a href="<?php echo get_term_link($foo_tax_cat->slug, FOO_POST_TAXONOMY) ?>"><?php echo $foo_tax_cat->name ?>

    <?php
                    }
    ?>

    <?php
        }
    ?>


Q: Expo thows error that I need to run pod install I get an error message when trying to " import Realm from "realm" "
The error message:

Error: Missing Realm constructor. Did you run "pod install"? Please
see
https://realm.io/docs/react-native/latest/#missing-realm-constructor
for troubleshooting

Running on Android 13 SDK (latest from Android Studio) through the command "expo start". I get the error, but I cant fix it since im not on Mac, and it also shouldnt require pods, since Im also running it on Android and not iOS. (iOS throws the same error).
The error message also refers to a non-existing website which is very helpful :) Thank you MongoDB team...
Expo SDK v. 44.0.0
realm v. 10.17.0 (latest?)
My goal is to make an offline-first database application and its not going so well...


Q: Images (inside divs) stacking instead of being inline I'm trying to place a series of images on my website, and I want them to flow side by side and automatically wrap to the width of the container div. I made a separate div for each image, because I also need text to stay with each image. However, my image divs are stacking (as if there were a hard return between each one, though there isn't), rather than flowing.
I've been searching for the answer, and everything I've read says that the default positioning for a div is static, which means flow will be automatic.  But... it's not seeming to work.
Here's my HTML:

Everything Changed

 A reflection on life's contingencies.

Forever Amen

 A wedding song, written for my brother and his wife.

Friends With You

 Warm, caring friendships often happen without trying.

And here's my CSS:
#contentArea {
    margin-top: 5px;
    margin-left: 45px;
    margin-right; 45px;
    overflow: auto;
    width: 540px;
    height: 590px;
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    font-family:Cambria, "Avenir Black", Futura, "Gill Sans", sans-serif;
    font-size: 0.8em;
}
#frame1 {
    background-image:url(images/frame1thumb.png);
    width:250px;
    height:217px;
}
#f1title {
    width:140px;
    height:188px;
    margin-left:55px;
    margin-right:auto;
    margin-top:70px;
    font-size:14px;
    text-align:center;
    overflow:auto;
    position:absolute;
}

(And so on for the other frames. There's styling for frame 2, 3, and so on, and the only thing that changes is the width and positioning of the text inside the frame.)
I tried typing position:static; into my CSS, under the #frame1 and it doesn't affect anything.
Thanks!

A: Okay, well first of all, here is a link to a working fiddle: jsfiddle
What you need to do is, to give every element, you want to float a float: left;
I would also give every #frame a position: relative; so that the #title's can position themselves according to their parent element.
As @Antony also pointed out, you made a syntax error with margin-right; 45px;, the first semicolon should be a regular colon!

A: I would first rethink your structure a bit. Here's how I would do it. You can use the link element itself for the thumbnail wrapper - and I would suggest you define the importance of the headings etc with heading tags. Search engines read sites like newspapers. If you don't declare importance, they wont know how to structure your site. I wouldn't use underline tag or italic tag because they are deprecated and I wouldn't use br linebreak because it's unnecessary and it's not really a line break. You can declare that in your .css file.
jsfiddle HERE
The magic is basically the float: left; but this will set you up with a more solid foundation. You see, for example - if you decided that you didn't want italics anymore - you would have to go remove all of those tags from the html. This way you only declare it in one place. Further more, styles that all of the blocks share need not be repeated. All blocks are the same I'm imagining. Mabybe they have different background-images.. but the rest is the same. Think modular.
HTML

Song Title

Tag line etc I'm guessing

Song Title

Tag line etc I'm guessing

CSS
/* moves padding inside the box -
   start your project off right */
* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

.content {
    padding: 1em;
}

.link-wrapper {
    position: relative;
    display: block;
    float: left;
    width:250px;
    height:217px;
    text-align: center;
    margin-right: 1em;
    text-decoration: none;
}

.link-wrapper h2 { /* heiarchy of text importance is how SEO works */
    font-weight: normal;
    text-decoration: underline;
    padding-top: 1em;

}

.link-wrapper h3 { /* heiarchy of text importance is how SEO works */
    font-weight: normal;
    font-style: italic;
}

/* to differentiate + unique classes for thumbnails */

.one {
    background-image:url(http://placehold.it/250x217/ff0066);
}

.two {
    background-image:url(http://placehold.it/250x217/99edee);
}

I hope this helps. -nouveau


Q: How to configure filebeat to read log files from multiple linux servers I need to know how to configure filebeat to read log files from multiple linux servers. I tried this for multiple windows computers and it works fine. Following is the used paths to access multiple log files from multiple windows computers in the network.
paths:
 - \\192.168.8.101\path\to\log\log.log
 - \\192.168.8.102\path\to\log\log.log
 - \\192.168.8.103\path\to\log\log.log

I want to do the same for multiple linux hosts. What is the recommended way to do that?


Q: Reading the default namespace through Roslyn API Is there a way to read the default namespace setting from the IProject interface or any other Roslyn interface? I know that I can parse the project's file but I think this should be possible using Roslyn API but I cannot find how to do that. Thanks in advance for information.

A: Unfortunately, Roslyn does not expose a way to do that at the moment, but I agree that it is something we will probably need eventually.

A: The library Microsoft.Build.Evaluation, which is, I believe, the successor of Roslyn does have this feature, but it is not easy to find.
I use the code below to obtain the default namespace.
My tests have shown that it matches the RootNamespace, stored in the .csproj file.
        private string GetDefaultNamespace(Microsoft.Build.Evaluation.Project p)
    {
        string rtnVal = "UNKNOWN_NAMESPACE";

        foreach (ProjectItemDefinition def in p.ItemDefinitions.Values)
        {
            if (def.ItemType == "ProjectReference")
            {
                foreach(ProjectProperty prop in def.Project.AllEvaluatedProperties){
                    if(prop.Name == "RootNamespace"){
                        rtnVal = prop.EvaluatedValue;
                    }
                }
            }
        }

        return rtnVal;
    }


Q: Change ganache Owner Account in WEB3J from account[0] to account[1]or account[2] I'm looking for a way to change owner of the smart contracts in java web3j as we do in web3 javascript using from:
 getMetaskAccountID: function () {
        web3 = new Web3(App.web3Provider);

        // Retrieving accounts
        web3.eth.getAccounts(function(err, res) {
            if (err) {
                console.log('Error:',err);
                return;
            }

            App.metamaskAccountID = res[0];
            if (res.length > 1){
            document.getElementById("divType").innerText = "Ganache Address"
            console.log("Using Ganache");
            App.FirstID = res[1];
            document.getElementById("account1").value = App.account1;
            App.secondID = res[2];
            document.getElementById("account2").value = App.account2;
          }else{
            document.getElementById("divType").innerText = "Using MetaMask Address"
            App.account1 = document.getElementById("account1").value;
            App.account2 = document.getElementById("account2").value;
          }

        })
    }

//using account for transaction in javascript
await contract.function(param1, param2, {from: account1});
await contract.function(param1, param2, {from: account2});

I can't find any solution regarding this for java web3j to change account for transaction.
contract.function(param1, param2).sendAsync();

It uses default account[0] for all the transactions. I want to change the owner for various transctions.
Would be nice to get a suitable answer for web3j to change account, thanks.


Q: SQL How to find which customer has rented the most films? I'm struggling with a question that said Which customer has rented the
most films?
I am doing this using the Seikila sample database in MySQL. I have something that joins my tables together and attempts to give me a count but I know its wrong just looking at the actual data in the rental table.
my code is as below
SELECT r.rental_id, cust.customer_id, count(*) as Total_Rentals
FROM rental as r
INNER JOIN customer AS cust on r.customer_id = cust.customer_id
GROUP BY cust.customer_id;

but it tells me for example customer 1 has rented 32 movies, which I know is wrong. what am I doing wrong?
since I was asked for clarification, the database I am using is:
https://dev.mysql.com/doc/sakila/en/
And I am trying to find which customer has rented the most films, I am not entirely sure what my script is actually returning.

A: Remove the column rental_id from the select list and sort the result by count(*) descending to return the top 1 row:
SELECT cust.customer_id, cust.name, count(*) as Total_Rentals
FROM rental as r
INNER JOIN customer AS cust on r.customer_id = cust.customer_id
GROUP BY cust.customer_id, cust.name
ORDER BY Total_Rentals DESC LIMIT 1

But if you only need the customer's id then there is no need for  a join:
SELECT customer_id, count(*) as Total_Rentals
FROM rental
GROUP BY customer_id
ORDER BY Total_Rentals DESC LIMIT 1

A: You need to join customer and rental, group by customer id (without rental id) and count it:
SELECT cust.customer_id, count(*) as Total_Rentals
FROM rental as r
INNER JOIN customer AS cust on r.customer_id = cust.customer_id
GROUP BY cust.customer_id;

So this code should work. If it doesn't work, that probably means that you have duplicates or other nonconventional issues.


Q: CSS: Overlay two images perfectly on all screen sizes I have two images. One is a picture that has rounded edges, the other is a picture of a round frame. I want to place the frame over the picture so that it looks like it is a single image.
I am struggling with the CSS to do this because on different screen sizes, it does not remain constant.
Here is my HTML:

My CSS:
div.image   {position: relative;}

img#profile {width: 250px;
            border-radius: 50%}

img#frame   {width: 250px;
            position: absolute;
            z-index: 100;}

I want the result to look like this (the blue is the picture #profile and the orange is the frame #frame:

In addition, this needs to stay this way regardless of the screen size so using left values does not really work.
With the above markup, the images are doing this:

How do I solve this?

A: You didn't provide any pictures. So, I used css styles. You can remove the background color and add your pic urls.
div.image {
    position: relative;
}
img#profile {
    width: 250px;
    height: 250px;
    background: blue;
    border-radius: 50%;
    z-index: 100;
    left: 10px;
    top: 10px;
    position: absolute;
}
img#frame {
    width: 270px;
    height: 270px;
    background: tomato;
    border-radius: 50%;
    z-index: -1;
}

JSFIDDLE

A: You need to fix it yourself whenever you change the size.
div.image {
position: fixed;
margin: 100px;
}
img#profile {
width: 250px;
height: 250px;
background: skyblue;
border-radius: 100%;
z-index: 100;
position: absolute;

}
img#frame {
width: 270px;
height: 270px;
background: orange;
border-radius: 100%;
z-index: -1;
position: absolute;
top:-10px;
left:-10px;
}


Q: How can we fliter data from header's TextInput on onChangeText in react native? I have custom header which has TextInput for searching in StackNavigator.How can i get result on onChangeText of TextInput on particular class,
  here is demo:
const StackNavigator = createStackNavigator({
 TABS: {
    screen: TabNav,
    navigationOptions: ({ navigation }) => {
      return {
        header:
          <View style={{ backgroundColor: '#025281', flexDirection:
         'row', alignItems: 'center', height: 60 }}>
            <TouchableOpacity
              style={{ paddingLeft: 5 }}>
              <Image source={require(back_arrowimg)} style={{
                width: 25, height: 25, resizeMode: 'contain' }}/>
            </TouchableOpacity>
    <TextInput
              style={{ color: 'white', paddingLeft: 15, }}
              type='text'
              placeholder={headerTitle}
              onChangeText={this.loadUsers}
            />
          </View>,
      }
    }   },

  [ConstFile.SCREEN_TITLES.WELCOME_SEARCH]: {
    screen: WELCOMESEARCH,
    navigationOptions: {
      header: null
    }   }, } )

A: from navigationOption you can not do anything to other screen,
so what you can do is, move your header code into another file and use it as component in TabNav
something like this,
let say Header.js
<View style={{ backgroundColor: '#025281', flexDirection:
         'row', alignItems: 'center', height: 60 }}>
    <TouchableOpacity
              style={{ paddingLeft: 5 }}>
          <Image source={require(back_arrowimg)} style={{
                width: 25, height: 25, resizeMode: 'contain' }}/>
    </TouchableOpacity>
    <TextInput
              style={{ color: 'white', paddingLeft: 15, }}
              type='text'
              placeholder={headerTitle}
              onChangeText={this.props.loadUsers} // see this change
            />
</View>

and in your TabNav.js use header as component,
<Header
  loadUsers={(...your params)=>{
    //do your necessary stuffs to display data in this file
  }) />


Q: How to make a  as a new row using external css? I am new to stack overflow and I'm trying to make a mobile webpage from the existing desktop version webpage someone else created. Basically, I have to use same webpage for both mobile and desktop. For this specific page with table, I am trying to change the pattern of table for mobile using external style sheet.I had attached the html skeleton and css with this post. Initially, there is only one row with two  s.  I want to bring ".td2" to new  in next line. I tried a basic table in which I was able to bring down all  converted to tr worked but in this case, second  containing a table is making me hard. I tried all the way I could. I will be helpful if someone help me.

tr{
    display:table;
    width:100%;
}
.lfttbl .td1, .td2{
    display:table-row;
    border-bottom: solid 1px #2b9ed5 !important;
}

 hihi hii

A: There are a lot of bugs in your code:

*

*
 not closed!

*Using tables for layout.

*More worse: Using nested tables.

Going ahead with your layout, I was able to make these corrections to make it work in CSS.

tr{
    display:table;
    width:100%;
}
.lfttbl .td1, .td2{
    display:table-row;
    border-bottom: solid 1px #2b9ed5 !important;
}

.td1 {
  display: block;
  background: #f00;
}

 hihi hii

A: You must close your
hihi hi and use display: block; on the td.
Check this:

tr{
    display:table;
    width:100%;
}
.lfttbl .td1, .td2{
    display:block;
    border-bottom: solid 1px #2b9ed5 !important;
}

 hihi hii

Lorem ipsum

A: So, here is what I was struggling on. After several trials and errors, I came to know it works in desktop version now but not in mobile devices. I had attached my code and css on which I was working (Initially "edit" and "delete" were in different td). Now I don't know why its not working on mobo device. I know I can't use if else statement in css (either for desktop or for mobile).

#shipIMtd, #shipIMrighttd1, #shipIMrighttd2{display:block;}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0;">
    <link href="mno.css" rel="stylesheet" type="text/css" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META Name="Robots" Content="noindex">

           Addresses

<input id="shipIMtitlebtn" type="button"  value="+ Add">

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.

    <form name="editship" action="abc.asp" method="post" />
     <input type="hidden" name="shipID" value="shpid">
     <input id="shipIMeditbtn" type="submit" value="Edit">

    </form>

    <form name="deleteship" action="xyz.asp" method="post">
     <input type="hidden" name="shipID" value="shpid" />
     <input type="hidden" name="asktype" value="firstask">
     <input id="shipIMdelbtn" type="submit" value="Delete">
    </form>

.


Q: SQL Server : Join from multiple table references Forgive me for adding yet another JOIN question, but I've been stumped all day and haven't been able to find a good answer for this.
I'm trying to join 4 tables, such that they look like below:
QuarterID    ReviewID    SaleID    PotentialID
    1           1           1          1
    1           2           2         null
    1           3         null         2
    1           4         null        null

The relevant info from the tables is below
Sale:
  QuarterID
  ReviewID
  IsArchived

Potential:
  QuarterID
  ReviewID
  IsArchived

Quarter:
  ID

Review:
  ID

We can have multiple Sales and Potentials associated with one Quarter-Review pairing, but only one Sale and one Potential will have IsArchived = 0 for the given Quarter-Review pairing.
SELECT
    quarter.id    AS QID,
    review.id     AS RID,
    Sales.id      AS SID,
    Potentials.id AS PID
FROM
    dbo.quarter
JOIN
    (SELECT *
     FROM dbo.sale
     WHERE isarchived = 0) AS Sales ON Sales.quarterid = quarter.id
JOIN
    (SELECT *
     FROM dbo.potential
     WHERE isarchived = 0) AS Potentials ON Potentials.quarterid = quarter.id
JOIN
    dbo.review ON dbo.review.id = Sales.reviewid
               AND dbo.review.id = Potentials.reviewid
ORDER BY
    quarter.id, rid

Using the above (there are some unnecessary columns, I know), I've managed to get the joins so that they get the 1st condition (where its all the Sales and Potentials that are in the same Quarter and Review combination, but I also want to see if there is a Quarter/Review combo with only a Sale and no Potential, if there is a Q/R combo with only a Potential and no Sale, and just every Quarter and Review combo, since there are only a few Q/R combos that have both a Sale and Potential, with almost all of the Q/R combos only having a Sale or Potential.
I guess overall the difficulty comes from needing to get the join from two intermediate tables. I can join Quarter, Sale, and Review easily, but having the Potential table joining on the same fields (ReviewID, QuarterID) as Sale is making me only get the AND, and I can't figure out an OR. I've been throwing around ORs for hours trying to get the right sequence without any luck. Help?
--Edit to include sample data--
Quarter
  ID
  1
  2

Review
  ID     (Other fields, not relevant to join)
  1
  2
  3
  4
  5

Sale
  ID    ReviewID    QuarterID    isArchived (Other fields, not relevant)
  1        1           1            0
  2        2           1            1
  3        2           1            0
  4        1           2            0
  5        5           1            0
  6        5           2            0

Potential
  ID    ReviewID    QuarterID    isArchived (Other fields, not relevant)
  1        1           1            0
  2        3           1            0
  3        4           2            1
  4        4           2            0
  5        5           2            0

Joining the above sample data, I would expect the output to look like:
QuarterID    ReviewID    SaleID    PotentialID
    1           1          1           1
    1           2          3          null
    1           3         null         2
    1           4         null        null
    1           5          5          null
    2           1          4          null
    2           2         null        null
    2           3         null        null
    2           4         null         4
    2           5          6           5

But the problem I am having is I am only returning the rows like the first and last row, where there is both a Sale and Potential for a given Quarter/Review combo, and not the ones where one or many may be null.

A: Not sure if I understood your question correctly (some sample data will help) but I think you mean that you need all the combinations of Quarter and Review and then any related Sale and Potential data for each combination of Quarter and Review. If that is what you need, then try the below query:
SELECT [Quarter].ID AS QID, Review.ID AS RID, Sales.ID AS SID, Potentials.ID AS PID FROM [Quarter]
CROSS JOIN [Review]
LEFT JOIN (SELECT * FROM Sale WHERE IsArchived = 0) Sales ON [Quarter].ID = Sales.QuarterID AND [Review].ID = Sales.ReviewID
LEFT JOIN (SELECT * FROM Potential WHERE IsArchived = 0) Potentials ON [Quarter].ID = Potentials.QuarterID AND [Review].ID = Potentials.ReviewID


Q: Finding the points of contact between two convex polygons Okay, so I am trying to create a simple 2d polygon physics engine for the experience. Here is what I already know (plus sources for those who want to find out:
-How to determine if polygons are intersecting using the SAT method (http://elancev.name/oliver/2D%20polygon.htm)
-How to find the normal of the collision by finding the minimum translation axis
-How to respond to a collision via implulse
(http://chrishecker.com/Rigid_Body_Dynamics#articles)
There is one thing however that keeps eluding me. That is, how to find the points of contact between two intersecting polygons. I was going to upload a simple picture to help illustrate what I mean, but it seems like I am not able to do that yet.
Specifically what I would like help on is:
-Determining which sides and/or points are colliding
-This includes when the polygons are intersecting
-Getting a vector location of each contact point
I would really appreciate anything on this because I have been searching for a good while with no luck.
Thanks.

A: After doing some more digging I found what I was looking for. I found a rather well written example (in C#) of a technique called polygon clipping. This method finds the contact points in world coordinates. It goes through all the steps and code implementation for multiple different situations.
Here is the url: http://www.codezealot.org/archives/394


Q: -libraryjars has no effect on resulting apk, proguard
using the tools dex2jar and Java Decompiler I examined two versions of an apk file that was built in eclipse with proguard enabled.  One version of the apk was made with this command as part of proguard-project.txt file
  -libraryjars /libs/GraphView-3.1.1.jar

and in the other verson of the apk has this line commented out
looking at the resulting apk files after conversion from apk to jar and viewing them. both of the apk files are obfuscated however they are exactly the same.  so the -libraryjars command is having no effect at all?   why is the obfuscated code exactly the same in both cases?
in comparison I make two versions of apk files with other modifications and they result in different looking files.  for example I added this line to the proguard-project.txt file
  -keep class com.example.proguardwithgson.MainActivity$TestObject { *; }

and it changed the resulting code for the apk, the TestObject inner class is no longer obfuscated and is clearly readable.
if the -keep command is working, then why does the -libraryjars command not do anything?

A: The Android build process already specifies all the necessary -injars/-libraryjars/-outjars options for you. You should never specify them in your configuration file; you'd only get lots of warnings about duplicate classes.
You can find an explanation of their purpose in the ProGuard manual > Introduction.


Q: Can an SKSpriteNode Object be Searched by Name I am creating a game using Apple's SpriteKit, and I am wondering what is the most efficient way to find an SKSpriteNode object after creating it.
In one method I initialize a sprite node and assign a name to it:
SKSpriteNode* playerBody = [SKSpriteNode spriteNodeWithImageNamed:@"playerBody.png"];
playerBody.name = @"player";

Later on inside the touchesBegan:withEvent: method I want to find the previously defined sprite node again and store it so I can run actions on it. First I attempted to do this:
SKSpriteNode* body = [self childNodeWithName:@"player"];

However, I have realized that childNodeWithName: is only available in the SKNode class, not SKSpriteNode. So this does not work. What I am thinking now is that I can create an SKNode object and place my SKSpriteNode inside of it. This way I can search for the SKNode using the above method. This seems a bit convoluted, however. Is there a better way?

A: SKSpriteNode inherits from SKNode. You can use childNodeWithName.
SKSpriteNode *someSprite = [SKSpriteNode node];

[someSprite childNodeWithName:@"someChildOfSprite"];

Code for comment below asking how to cast SKNode as an SKSpriteNode:
SKSpriteNode *theChildYouWant = (SKSpriteNode*)[someSprite childNodeWithName:@"someChildOfSprite"];


Q: Python tuple duplication with * This works just fine and straight-forward:
>>> ('a',) * 3
    ('a', 'a', 'a')

But I was experimenting with tuple a little and came across this:
>>> 'a', * ('b', 'c')
    ('a', 'b', 'c')

>>> ('a',) * ('b', 'c')
    Traceback (most recent call last):
      File "<pyshell#2>", line 1, in <module>
        ('a',) * ('b', 'c')
    TypeError: can't multiply sequence by non-int of type 'tuple'

Can anybody explain how did the * make the tuple concatenate in the line 'a', * ('b', 'c')?

A: In this expression
'a', * ('b', 'c')

You have two primary things going on

*

*'a', creates a tuple with a single element 'a'

** ('b', 'c') uses extended iterable unpacking (PEP 3132)

So the result of #2 is used to continue the tuple definition from #1. To show a more intuitive example this is the same idea
>>> 'a', *range(5)
('a', 0, 1, 2, 3, 4)


Q: Error in google map loading I got this crash when Try to start any map activity ..
this is my gradle dependencies:
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:design:23.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.code.gson:gson:2.7'

compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.onesignal:OneSignal:3.4.1'

compile 'com.wang.avi:library:1.0.3'
compile 'com.nineoldandroids:library:2.4.0'

}

this is logcat
11-05 10:00:19.603 10285-10285/com.wneet.white E/AndroidRuntime: FATAL EXCEPTION: main
                                                                 Process: com.wneet.white, PID: 10285
                                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wneet.white/com.wneet.white.LoadingFirst}: java.lang.NullPointerException
                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)
                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2578)
                                                                     at android.app.ActivityThread.access$900(ActivityThread.java:170)
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:146)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5727)
                                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
                                                                     at dalvik.system.NativeStart.main(Native Method)
                                                                  Caused by: java.lang.NullPointerException
                                                                     at com.wneet.white.LoadingFirst.onCreate(LoadingFirst.java:88)
                                                                     at android.app.Activity.performCreate(Activity.java:5581)
                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2483)
                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2578)
                                                                     at android.app.ActivityThread.access$900(ActivityThread.java:170)
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:146)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5727)
                                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
                                                                     at dalvik.system.NativeStart.main(Native Method)

thanx in advance.

A: Please check and make sure that you were able to set up your project with a compatible Google Play services SDK as discussed in Setting Up Google Play Services. If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.
Solutions given in this blog post and GitHub post might also give you possible workaround and might help.


Q: Is there an async-safe way to get the current thread ID in Linux? Is there any way to get the current thread ID from a signal handler in Linux? The getpid() method does what I want, but it is not clear if it is async-safe. man 7 signal provides a list of POSIX methods which are async safe, but this tells us nothing about non-POSIX methods such as getpid(). Presumably some of the many non-POSIX methods Linux has added are async safe, but I can't find the list.
There is also this answer which claims that all direct (not multiplexed) syscalls are async safe, but provides no evidence.
The goal is to build some kind of async-safe thread local storage, since __thread is not safe in the general case.
It doesn't have to be the "Linux thread ID" - any consistent thread ID would be fine. For example pthread_self would be great, but there is nothing claiming that is async safe. If we examine the implementation of that method in glibc Linux, it defers to the THREAD_SELF macro, which looks like:
# define THREAD_SELF \
({ struct pthread *__self;                                                  \
  asm ("movl %%gs:%c1,%0" : "=r" (__self)                                  \
          : "i" (offsetof (struct pthread, header.self)));                    \
  __self;})

It seems to be that this should be async-safe, if the thread in question was created under a regime that populates the gs resgister (perhaps all threads in Linux are, I'm not sure). Still looking at that header makes me pretty scared...

A: As mentioned in Async-signal-safe access to __thread variables from dlopen()ed libraries? you provided (emphasis is mine):

The __thread variables generally fit the bill (at least on Linux/x86),
  when the variable is in the main executable, or in a directly-linked DSO.
But when the DSO is dlopen()ed (and does not use initial-exec TLS model),
  the first access to TLS variable from a given thread triggers a call to
  malloc...

In other words, it only requires one access to that thread specific variable to bring it to life and make it available in signal handlers. E.g.:

*

*Block the signals you are interested in in the parent thread before creating a child thread.

*Unblock those interesting signals in the parent thread after the call to pthread_create.

*In the child thread initialize your __thread variable and unblock those interesting signals.

I normally store the write end of a unix pipe in that tread-specific variable and the signal handler writes the signal number into that pipe. The read end of the pipe is registered with select/epoll in that same thread, so that I can handle signals outside of the signal context. E.g.:
__thread int signal_pipe; // initialized at thread start

extern "C" void signal_handler(int signo, siginfo_t*, void*)
{
    unsigned char signo_byte = static_cast<unsigned>(signo); // truncate
    ::write(signal_pipe, &signo_byte, 1); // standard unix self pipe trick
}


Q: How Get xml content from xml Ip api and display it on webpage? I am using XML api of http://ip-api.com/docs/api:xml on my webpage to get information about a visiter visiting my website.
following is the successful xml document returned from their api :
<country>United Kingdom</country>
<countryCode>UK</countryCode>
<region>Bristol</region>
<ip>xx.xx.xx.x</ip>
<ISP>VodafoneM</ISP>

I want to show content of this xml document on my webpage using javascript, I know it can easily be done using a server side language like PHP, My php version is old and it's returning error for parsing an xml document. So I am looking for a client side solution.
Here is what I have tried so far :
<script>
xmlDoc=loadXMLDoc("http://ip-api.com/xml/xx.xx.xx.x");
x=xmlDoc.getElementsByTagName("country")[0]y=x.childNodes[0];
document.write(y.nodeValue);
</script>

It doesn't work, I am getiing a blank page.
How can I display the content of xml file on my webpage?
Please help me, I have been trying to solve this since morn

A: I have adapted your code as follows:
    //txt = loadXMLDoc("http://ip-api.com/xml/xx.xx.xx.x");
    var txt = '<country>United Kingdom</country><countryCode>UK</countryCode><region>Bristol</region><ip>xx.xx.xx.x</ip><ISP>VodafoneM</ISP>';
    txt = '<query>' + txt + '</query>';

    // Info: http://www.w3schools.com/xml/xml_parser.asp
    if (window.DOMParser) {
        parser = new DOMParser();
        xmlDoc = parser.parseFromString(txt, "text/xml");
    }
    else // Internet Explorer
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = false;
        xmlDoc.loadXML(txt);
    }

    var x = xmlDoc.getElementsByTagName("country")[0];
    var y = x.childNodes[0];
    //document.write(y.nodeValue);
    document.getElementById("content").innerHTML = y.nodeValue;

Please check the result in jsfiddle.


Q: Trigger to enforce M-M relationship Suppose I have following schema :
DEPARTMENT (DepartmentName, BudgetCode, OfficeNumber, Phone)
EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Phone, Email)

The problem am facing is how to design a system of triggers to enforce the M-M relationship.Assuming that departments with only one employee can be deleted. Also I need to assign the last employee in a department to Human Resources.
I have no idea to enforce M-M relationship through trigger. Please help

A: Many-to-many conditions should not be enforced using a trigger. Many-to-many conditions are enforced by creating a junction table containing the keys in question, which are then foreign-keyed back to the respective parent tables.
If your intention is to allow many employees to be in a department, and to allow an employee to be a member of many departments, the junction table in question would look something like:
CREATE TABLE EMPLOYEES_DEPARTMENTS
  (DEPARTMENTNAME  VARCHAR2(99)
     CONSTRAINT EMPLOYEES_DEPARTMENTS_FK1
       REFERENCES DEPARTMENT.DEPARTMENTNAME,
   EMPLOYEENUMBER  NUMBER
     CONSTRAINT EMPLOYEES_DEPARTMENTS_FK2
       REFERENCES EMPLOYEE.EMPLOYEENUMBER);

This presumes that DEPARTMENT.DEPARTMENTNAME and EMPLOYEE.EMPLOYEENUMBER are either primary or unique keys on their respective tables. Get rid of the column EMPLOYEE.DEPARTMENT as it's no longer needed. Now by creating rows in the EMPLOYEES_DEPARTMENTS table you can relate multiple employees with a department, and you can relate a single employee with multiple departments.
The business logic requiring that only departments with one or fewer employees can be deleted should not be enforced in a trigger. Business logic should be performed by application code, NEVER by triggers. Putting business logic in triggers is a gatèw̢ay to unending debugging sessions. M̫̣̗̝̫͙a̳͕̮d̖̤̳̙̤n̳̻̖e͍̺̲̼̱̠͉ss̭̩̟ lies this way. Do not give in. Do not surrender. ̬̦B҉usi͢n̴es̡s logic ̶in triggers opens deep wounds in the fabric of the world, through which unholy beings of indeterminate form will cross the barrier between the spheres, carryi͞n̨g o̡f͠f t͢h̶e ̕screaming͡ souĺs o͜f͜ ̢th͜e̴ ̕dev́e̡lope͜r͝s to an et͞er͜n̸it̶y ́of͢ pain̶ ąn̨d͢ ̨to͟r̨ment͟. Do not, as I have said, put b́u͜siness͞ ̸log̛i͘ç ̵in͢ ͞trigge͠rs͞.̡ Be firm. Resist.You must resist. T̷he ̢Tem͟p͞t̶ati͝o̶n҉s͘ ̢m͘a̶y ́śing hymns̷ ́o͢f̴ ̸un͘hol̵y r̶ev͢ęla͠t̡ion̴ ͢buţ ́yo͠u̵ mus͝t ͝n͜͟o҉t̶͡ ̷l̸̛͟͢ì̧̢̨̕s̵̨̨͢t̵̀͞e̶͠n̶̴̵̢̕. Only by standing firmly in the door between the worlds and blocking out the hideous radiance cast off by bú̧s̷i̶̢n̵̕e̵ş͝s ́l̴ó̢g̛͟i̕c i͞n̕ t̵͜r͢͝i̸̢̛ģ͟ge̸̶͟r̶s͢͜, which perverts the very form of the world ąnd̴̀͝ ç͞a̧͞l̶l͟͜s̕͘͢ Z̶̴̤̬͈̤̬̲̳͇ͯ̊ͮ͐̒̆͂͠Â̮̘̗̻̞̬̱̆́̊̓͛́̚ͅL̛̦͕̤͎̮̦̄̌G̷͖̙̬͛̇ͬ̍͒̐̅O̡̳͖͎̯̯͍ͫ̽ͬ͒͂̀ i͜҉nt͝ǫ̴ ̸b̷͞è͢ì̕n̴g,̛̀͘ ̴c҉á̴͡ń ̀͠youŕ̨ ̧̨a̸p̡͡pl̷͠ic͞a̢t̡i͡҉ǫn̴ ̸s̶͜u̶͢ŗv̛í̴v́ȩ.͘͘ Resist. R͢͝e͢͟s̸͜ì̢̢s͠ţ̀. T̶̀h̨̀e̶r̀e͢͞ ̶i̶̡͢s̴ ͞͞n̵͝o̡ ́ẁ҉̴a̡y̕҉ ̶b́u̵̶̕t͜ ̨s͘͢t͘͠į͟l͘l̷̴ ̴͜͜ỳò͜u҉̨ ̨mus̸͞t̸̛͜ ̧rȩ̴s̢͢i͘͡st̸.̛̀͜ Your very śo͡u̧̧͘ļ͟͡ is compromised by p͝u͘͝t̢͜t͠i̸ņ̸̶g͟͡ ̵̶̛b̴҉u̶̡̨͜͞s̷̵̕͜͢i͝҉̕͢ǹe̡͞ś̸ş̕͜͡҉ ̴̨ĺ̵̡͟͜o̶̕g͠i͢͠c̕͝ ̕͞i̧͟͡n̡͘͟ ̶̕͞t̡͟҉̕r̸̢̧͡͞i̴̵̡͜g̵̴͟͝ģ̴̴̵ę̷̷͢r̢̢ś̸̨̨͜. T̀͜͢o̷͜ny̕ ͟͡T̨h̶̷̕e ̢͟P̛o̴̶n͡y shall rise from his dark stable and d͞ę̡v̶̢ó͟u̸̸r̴ ̷t͞h̀e̛ ̨͜s̷o̧͝u҉l̀ ͟͡o͢f̵͢ ̛t͢h̶̛e̢̢ ̡̀vi͜͞r̢̀g̶i̢n͞, and yet y͢ơú͝ m̷̧us͡t̡͠ ̛s̷̨t̸̨i̴̸l̶̡l ͝ǹot̵ ͞p̧u̵t̨ ͜b̀̕u̕s̨í̵ņ̀͠ȩs̵͟s ́͞l̛҉o̸g̨i̴͟c ͘͘i͘nt̛o͡ ͘͘͞t̶͞r̀̀i̕ǵ̛g̵̨͞e̸͠҉r̵͟ś! It is too much to bear, we cannot stand! Not even the children of light may put business logic into their triggers, for b̴̸̡̨u̧͜͝ş̶i̷̸̢̛҉ń̸́͟e̡s̷̵̡s̕͟ ̴҉͞l̷̡ǫ̷̶͡g҉̨̛į̸͘͠c̕͢ ̸̶̧͢͢i̸̡̛͘n͢͡ ̀͢͝t̷̷̛́ŗì̴̴̢g̶̷ǵ͠ȩ̀́r̸̵̢̕͜s̵͞ is the very es̵s̕͡ę̢n͞c̨e̢͟ ̴o̶̢͜f ͟d́ar͟͞͠k̡͞n̢̡es̵̛͡s̀̀͡ and dev͘ou͝͡r̨̡̀s͢͝ ҉͝t҉h̴e̡͘ l̫̬i̤͚ͅg̞̲͕̠͇̤̦̹h̩̙̘̭̰͎͉̮̳t͙̤̘̙! Yea, yea, the blank-faced ones rì͢s̨͘e from the f͟͢o̵͜͝n̶t̨ ̵of̸̡͠ ͝fl͟͞a̵̷҉me̶̵͢ and ca͝s͜t́ down the p̹̤̳̰r̮̦̥̥̞̫͑͂ͤ͑ͮ͒̑ï̄̌ͬͨe̦̗͔ͥͣ̆̾̂s̬̭̮̮̜ͭt̻̲̍sͫͣ̿ ̐͗̈ͤ͂ͦ̅f̭͚̪̻̣̩ͮ̒ṟͨ͌ͮ̅̓ỏ̝͓̝̣̟̼m̳͇̱̝͔͒ ͒ͫͧ͂̓̈̈́t̲̔̅̎͐h̺͈͍ͣͧ̿ē̪̼̪̻͉̪̙̐̽̎̉i̠͎̗͕̗̣̬̐̎͛r͓̫͌ͅ ̼a͑̈ͯͦ̍l̪͉͖̥͚̤͌ͨ͊ͦͤ̔t̫͎̹ͯa̼̻͍̳̟̤̬̓ͪ̀r̭͖̓ͬ̉̉ͤ͊ṡ̐ͪ̊̋̄̅! A̵̵̛v͝é͜ŕt̶ ̶y̸͝͠o̶u̧͘r̡ ̧e͞y҉e̕͝s,̀ ͡t̛h̛o̢͞ug̸̢h̵͟ ̡y̷o͢҉͢u̧͡ ̕͡c҉̵̶an͠n҉o̧͢t!̸̨͘ ͡H̵e̸͢͡ ̧̕c̶ơm̷̢̢e̶͞ś͢!̨́ ̷H̕ȩ ̵c̨̡͟o̴҉m̷͢es͠!̷͘͞ P̱̼̯̟͈h̝̳̞̖͚'͉̙͉̰̲̺n̪̦͕̗͜g͔̹̟̰̰̻̩l̬͈̹̥͕͖ͅụ̻̺̤̤̬̳i̸̯̬̝̻̣͚̫ ̰̹̞̞m͟g̷̝͓͉̤l̩͇̙͕w̪̦̰͔'̮̟̱̀n̢̜a̦f̘̫̤̘̬͓̞h̠͍͖̯ͅ ̩̠͓̯̘̫C̟̘̗̘͘ṭ͍͕ͅh̤ͅu̼̦̘̥ͅl҉̦hu̠̤̤̘͚ ̘̕R̶̟'̠͔̞̻͇l̩̺̗̻͖͓̕ͅy̛̖ȩ͉̭̖ẖ̡̥̼͈̖ w̟̫̮͇͔͞ͅg͈̘̱̻a̰͟h̘͙͖͢'̮̲̯͞n̤̜͍̯̳a͓͓̲̲g̱̻͈ĺ͍ ̷̣̞̲͖͍̲̺f̲ͅh͇͕̪̘͟t͔͈̙a͓͢g҉̳̜̲͚n͓͚͎̱̠̜!
Don't ask me how I know.
Best of luck.


Q: Remove server from react-boilerplate How should one do to remove server folder from react-boilerplate? Question is also asked here by another person https://github.com/react-boilerplate/react-boilerplate/issues/2110.

A: Removing just server folder will not work because the webpack dev configuration is utilising it for hot reload as well as your npm start command starts express server from this folder.
If you want to remove server folder completely and still want the application to be working as it was like hot reloading etc, follow the below steps. We will require webpack dev server in that case:

*

*Remove ./server folder manually.

*Install webpack-dev-server and react-hot-loader as dev dependencies.

*In  your ./internals/webpack/webpack.dev.babel.js, do the following modifications:

*

*Change entry to this:
entry: [
      require.resolve('react-app-polyfill/ie11'),
      'react-hot-loader/patch',
      `webpack-dev-server/client?http://localhost:3000/`,
      'webpack/hot/only-dev-server',
      path.join(process.cwd(), 'app/app.js'), // Start with js/app.js
],

*Add publicPath in output:
output: {
    filename: '[name].js',
    chunkFilename: '[name].chunk.js',
    publicPath: `http://localhost:3000/`,
},

*Add webpack dev server config property in the same file:
devServer: {
   port: 3000,
   publicPath: `http://localhost:3000/`,
   compress: true,
   noInfo: false,
   stats: 'errors-only',
   inline: true,
   lazy: false,
   hot: true,
   open: true,
   overlay: true,
   headers: { 'Access-Control-Allow-Origin': '*' },
   contentBase: path.join(__dirname, '..', '..', 'app', 'build'),
   watchOptions: {
       aggregateTimeout: 300,
       ignored: /node_modules/,
       poll: 100,
   },
   historyApiFallback: {
       verbose: true,
       disableDotRule: false,
   },
},

*In ./internals/webpack/webpack.base.babel.js, add the line:
devServer: options.devServer,

And finally, modify your start script in package.json as below:
"start": "cross-env NODE_ENV=development node --trace-warnings ./node_modules/webpack-dev-server/bin/webpack-dev-server --color --config internals/webpack/webpack.dev.babel.js",

And you are good to go!!

A: Just remove with rm -rf ./server if you feel harassed :)


Q: Case Statement Block Level Declaration Space in C# Is there a reason I am missing that a block within a case statement isn't considered a block level declaration space?
I keep getting an error (variable has already been declared) when I try
case x:
  var someVariable = 42;
break;
case y:
   var someVariable = 40;
break;

but I can do
case x:
   try{var someVariable = 42;}catch{}
break;
case y:
    try{var someVariable = 40;}catch{}
break;

If C# allowed fall through statements, that would make sense, but it doesn't, and I can't think of a scenario where you can declare a variable in a case statement and use it outside of that block.

A: You could also do:
case x:
  {var someVariable = 42;}
break;
case y:
   {var someVariable = 40;}
break;

Essentially the braces create the lexical scope, so without the braces, someVariable is loaded into the symbol table twice. I believe this choice is likely made simply to avoid confusion, and possibly to avoid adding complexity to the building of the symbol table.

A: UPDATE: This question was used as the inspiration for this blog post; see it for further details.
http://ericlippert.com/2009/08/13/four-switch-oddities/
Thanks for the interesting question.

There are a number of confusions and mis-statements in the various other answers, none of which actually explain why this is illegal. I shall attempt to be definitive.
First off, to be strictly correct, "scope" is the wrong word to use to describe the problem. Coincidentally, I wrote a blog post last week about this exact mis-use of "scope"; that will be published after my series on iterator blocks, which will run throughout July.
The correct term to use is "declaration space".  A declaration space is a region of code in which no two different things may be declared to have the same name.  The scenario described here is symptomatic of the fact that a switch section does not define a declaration space, though a switch block does.  Since the OP's two declarations are in the same declaration space and have the same name, they are illegal.
(Yes, the switch block also defines a scope but that fact is not relevant to the question because the question is about the legality of a declaration, not the semantics of an identifier lookup.)
A reasonable question is "why is this not legal?"  A reasonable answer is "well, why should it be"?  You can have it one of two ways.  Either this is legal:
switch(y)
{
case 1:  int x = 123; ... break;
case 2:  int x = 456; ... break;
}

or this is legal:
switch(y)
{
case 1:  int x = 123; ... break;
case 2:  x = 456; ... break;
}

but you can't have it both ways. The designers of C# chose the second way as seeming to be the more natural way to do it.
This decision was made on July 7th, 1999, just shy of ten years ago. The comments in the notes from that day are extremely brief, simply stating "A switch-case does not create its own declaration space" and then giving some sample code that shows what works and what does not.
To find out more about what was in the designers minds on this particular day, I'd have to bug a lot of people about what they were thinking ten years ago -- and bug them about what is ultimately a trivial issue; I'm not going to do that.
In short, there is no particularly compelling reason to choose one way or the other; both have merits. The language design team chose one way because they had to pick one; the one they picked seems reasonable to me.

A: Because cases aren't blocks, there are no curly braces denoting the scope. Cases are, for lack of a better word, like labels.
You're better off declaring the variable outside the switch() statement and using it thereafter. Of course, in that scenario, you won't be able to use the var keyword, because the compiler won't know what type to initialize.

A: Ah - you don't have fall through, but you can use goto to jump to another labelled case block.  Therefore the blocks have to be within the same scope.

A: As of C# 8.0 you can now do this with switch expressions

you use the switch expression to evaluate a single expression from a list of candidate expressions based on a pattern match with an input expression

var someVariable = caseSwitch switch {
    case x => 42,
    case y => 40,
    _ => throw new Exception("This is how to declare default")
};

A: You could just declare the variable outside the scope of the switch statement.
var someVariable;

switch();
case x:
someVariable = 42;
break;
case y:
someVariable = 40;
break;


Q: String [] to char Array using java I have a weird situation, am working on a Data base project that only gives me a string [] s = ["A","B","C","D"] and I wanted to change from string array to Char Array since it's a char but i dunno what function to use to convert the entire array to char with one line of code.
char ch = [ 'A', 'B', 'C'] --> this is what am looking to get
My plan B  is to loop the entire string and convert to char one by one. but am avoiding that one.
any help I will highly appreciate

A: this might help you.
Would be better if we could use Stream<char>, but, this does not work, so, we need to use the wrapper class.
Since you want the first index, you can use 0.
String.charAt(index) returns a char primitive, so, it will use less memory than a String.substring(...) that returns a new String.
    final String[] array = {"A", "B", "C", "D"};
    final Character [] char_array = Arrays.stream(array)
            .map(s -> s.charAt(0))
            .toArray(Character[]::new);

    for(char a: char_array) {
        System.out.println(a);
    }

A: You can use streams, this will return a char [] array.
 Arrays.stream(S).map(s -> s.substring(0,1)).collect(Collectors.joining()).toCharArray();

Full code
String [] S = { "A", "B", "C"} ;

      char [] ch =Arrays.stream(S).map(s -> s.substring(0,1))
.collect(Collectors.joining()).toCharArray();

       for(int i=0;i<ch.length;i++){
           System.out.println(ch[i]);
       }

For better use, I suggest making a method that implements this stream and returns a char []
public char [] convertToChar(String [] yourArray){

       return Arrays.stream(youArray).map(s -> s.substring(0,1)).collect(Collectors.joining()).toCharArray();
    }


Q: AWS NEXRAD and pyart grid_from_radars Can someone take a look at this code and help me debug?
import numpy as np
import pyart

 radar_data=[]
 RADAR_FILE = r'C:\Sourcecode\NEXRAD\KTLX20150506_235157_V06.gz'

 radar = pyart.io.read_nexrad_archive(RADAR_FILE)

 radar.fields['reflectivity']['data'][:, -10:] = np.ma.masked

gatefilter = pyart.filters.GateFilter(radar)
gatefilter.exclude_transition()
gatefilter.exclude_masked('reflectivity')

 grid = pyart.map.grid_from_radars(
(radar,), gatefilters=(gatefilter, ),
grid_shape=(1, 9720, 1832),
grid_limits=((2000, 2000), (-123000.0, 123000.0), (-123000.0, 123000.0)),
fields=['reflectivity'])

It fails to make the grid with the error:  "numpy.core._exceptions.MemoryError: Unable to allocate array with shape (9720, 1832) and data type float64"
I think my grid_shape is off somehow...  THanks

A: Solved.  Installed 32-bit Python by mistake, should be 64-bit for this.


Q: reading config file in python with ConfigParser I have used configparser to read configurations in my python written program . I am reading file from s3 for now , but my requirement is to configurations defined in the program itself rather than from any other external source .
code written is below:
config = configparser.ConfigParser()
config.readfp(open(s3:path\config))

config file format :
config.ini
[section1]
var1=Y
var2=Y
var3=['col1','col2']

I am reading above file that is located in s3 , but instead of reading from s3 I want to read from program in itself . what needs to be done in order to achieve this ?
above code is written in pyspark program , I am passing config file with spark submit command but to read config file i need to provide path and this is not desirable .
spark submit in aws emr :
'Args': ['spark-submit','--deploy-mode', 'cluster','--master', 'yarn','--executor-memory', conf['emr_step_executor_memory'],'--executor-cores',  conf['emr_step_executor_cores'],'--conf','spark.yarn.submit.waitAppCompletion=true','--conf','spark.rpc.message.maxSize=1024',f'{s3_path}/file1.py',  '--py-files',f'{s3_path}/file2.py',f'{s3_path}/file3.py',f'{s3_path}/file4.py','--files', f'{s3_path}/config ]

because of config.readfp(open(s3:path\config)) line i need to provide s3 path , that is not desirable options are either pass config file from spark submit and make available to every other python files those are reading configs or read configuration inside of program itself .

A: you can do something like this:
parser = configparser.ConfigParser()
parser.read_dict({'section1': {'key1': 'value1',
                                'key2': 'value2',
                                'key3': 'value3'},
                   'section2': {'keyA': 'valueA',
                                'keyB': 'valueB',
                                'keyC': 'valueC'},
                   'section3': {'foo': 'x',
                                'bar': 'y',
                                'baz': 'z'}})

Check this for detailed info as well as some other alternative way to achieve this.
Sample retrieval
parser["section1"]["key1"]
'value1'


Q: Reporting shadow prices from SimplexSolver I'm using the SimplexSolver class directly to solve a linear program, with AddRow, AddVariable and SetCoefficient. This works quite well.
We need to come up with shadow prices now, and I don't see any way to access either the shadow prices or the simplex matrix.
If I set SimpleSolverParams.GetSensitivityReport to true, casting the return of SimplexSolver.GetReport to ILinearSolverSensitivityReport may be the key here. Checking it out.

A: It looks like ILinearSolverSensitivityReport.GetDualValue returns the shadow price.
Hopefully this saves someone else a merry chase through dotPeek. :-)


Q: Display NSDates in terms of week Scenario:
I have an expense tracking iOS Application and I am storing expenses from a expense detail view controller into a table view (with fetched results controller) that shows the list of expenses along with the category and amount and date. I do have a date attribute in my entity "Money" which is a parent entity for either an expense or an income.
Question:
What I want is to basically categorize my expenses for a given week, a month, or year and display it as the section header title for example : (Oct 1- Oct 7, 2012) and it shows expenses amount and related stuff according to that particular week. Two buttons are provided in that view, if I would press the right button, it will increment the week by a week (Oct 1- Oct 7, 2012 now shows Oct8 - Oct 15, 2012) and similarly the left button would decrement the week by a week.
How would I accomplish that? I am trying the following code - doesn't work.
- (void)weekCalculation
{
   NSDate *today = [NSDate date];  // present date (current date)

   NSCalendar* calendar = [NSCalendar currentCalendar];
   NSDateComponents* comps = [calendar components:NSYearForWeekOfYearCalendarUnit |NSYearCalendarUnit|NSMonthCalendarUnit|NSWeekCalendarUnit|NSWeekdayCalendarUnit fromDate:today];

   [comps setWeekday:1]; // 1: Sunday
   firstDateOfTheWeek = [[calendar dateFromComponents:comps] retain];
   [comps setWeekday:7]; // 7: Saturday
   lastDateOfTheWeek = [[calendar dateFromComponents:comps] retain];

   NSLog(@" first date of week =%@", firstDateOfTheWeek);
   NSLog(@" last date of week =%@", lastDateOfTheWeek);

   firstDateOfWeek = [dateFormatter stringFromDate:firstDateOfTheWeek];
   lastDateOfWeek = [dateFormatter stringFromDate:lastDateOfTheWeek];

}

Code for incrementing date -
- (IBAction)showNextDates:(id)sender
{
   int addDaysCount = 7;

   NSDateComponents *dateComponents = [[[NSDateComponents alloc] init] autorelease];
   [dateComponents setDay:addDaysCount];

   NSDate *newDate1 = [[NSCalendar currentCalendar]
                    dateByAddingComponents:dateComponents
                    toDate:firstDateOfTheWeek options:0];

   NSDate *newDate2 = [[NSCalendar currentCalendar]
                    dateByAddingComponents:dateComponents
                    toDate:lastDateOfTheWeek options:0];

   NSLog(@" new dates =%@ %@", newDate1, newDate2);

}

Suppose the week shows like this (Nov4, 2012 - Nov10, 2012) and I press the increment button, I see in the console, date changes to Nov11,2012 and Nov.17, 2012 which is right but if I press the increment button again, it shows the same date again (Nov 11, 2012 and Nov.17, 2012).
Please help me out here.

A: Declare currentDate as an @property in your class. And try this.
@property(nonatomic, retain) NSDate *currentDate;

Initially set
self.currentDate = [NSDate date];

before calling this method.
- (void)weekCalculation
{
   NSCalendar* calendar = [NSCalendar currentCalendar];
   NSDateComponents* comps = [calendar components:NSYearForWeekOfYearCalendarUnit |NSYearCalendarUnit|NSMonthCalendarUnit|NSWeekCalendarUnit|NSWeekdayCalendarUnit fromDate:self.currentDate];

   [comps setWeekday:1]; // 1: Sunday
   firstDateOfTheWeek = [[calendar dateFromComponents:comps] retain];
   [comps setWeekday:7]; // 7: Saturday
   lastDateOfTheWeek = [[calendar dateFromComponents:comps] retain];

   NSLog(@" first date of week =%@", firstDateOfTheWeek);
   NSLog(@" last date of week =%@", lastDateOfTheWeek);

   firstDateOfWeek = [dateFormatter stringFromDate:firstDateOfTheWeek];
   lastDateOfWeek = [dateFormatter stringFromDate:lastDateOfTheWeek];

}

Once the view is loaded self.currentDate value should be updated from showNextDates. Make sure it is not getting reset anywhere else.
- (IBAction)showNextDates:(id)sender
{
   int addDaysCount = 7;

   NSDateComponents *dateComponents = [[[NSDateComponents alloc] init] autorelease];
   [dateComponents setDay:addDaysCount];

   NSDate *newDate1 = [[NSCalendar currentCalendar]
                    dateByAddingComponents:dateComponents
                    toDate:firstDateOfTheWeek options:0];

   NSDate *newDate2 = [[NSCalendar currentCalendar]
                    dateByAddingComponents:dateComponents
                    toDate:lastDateOfTheWeek options:0];

   NSLog(@" new dates =%@ %@", newDate1, newDate2);

   self.currentDate = newDate1;

}

A: I had needed similar thing in one of my old projects and achieved it via the code below. It sets this weeks date to an NSDate variable and adds/removes 7 days from day component in each button click. Here is the code:
NSCalendar *calendar = [NSCalendar currentCalendar];
[calendar setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
NSDate *date = [NSDate date];
NSDateComponents *components = [calendar components:(NSYearCalendarUnit|NSWeekdayCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit)  fromDate:date ];
//
[components setDay:([components day] - ([components weekday] )+2)];
self.currentDate = [calendar dateFromComponents:components];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"dd.MM.yyyy HH:mm:ss";
self.datelabel.text = [formatter stringFromDate:self.currentDate];

The code above calculates this week start and sets it to currentDate variable. I Have two UIButtons with UIActions named prevClick and nextClick which calls the method that sets the next or previous weekstart:
- (IBAction)prevClick:(id)sender {
[self addRemoveWeek:NO];

}
-(void)addRemoveWeek:(BOOL)add{
NSCalendar *calendar = [NSCalendar currentCalendar];
[calendar setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
NSDateComponents *components = [calendar components:(NSYearCalendarUnit|NSWeekdayCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit)  fromDate:self.currentDate ];
components.day = add?components.day+7:components.day-7;
self.currentDate = [calendar dateFromComponents:components];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"dd.MM.yyyy HH:mm:ss";
self.datelabel.text = [formatter stringFromDate:self.currentDate];

}
- (IBAction)nextClk:(id)sender {
[self addRemoveWeek: YES];

}


Q: Getting a linechart entry label MPAndroidChart I have a line chart with entries that the user can click on via line chart.setOnChartValueSelectedListener. Is there a way that I can programmatically get the label of whichever entry is clicked? Or is there some other way of achieving this in my code?
private void chartAreaClickResponse(LineChart lineChart) {
    lineChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
        @Override
        public void onValueSelected(Entry e, Highlight h) {
          //get the label of the entry here

        }

        @Override
        public void onNothingSelected() {

        }
    });
}

A: I figured it out, in case anyone needs to know this in the future.Simply add the following line under "onValueSelected":
    @Override
    public void onValueSelected(Entry e, Highlight h) {
      String label = dataSets.get(h.getDataSetIndex()).getLabel(); //add this
    }

In this case, dataSets is the "ILineDataSet" used to populate the line chart


Q: equivalent of __FUNCTION__ of C lanauage in Java For debug purpose, I want to print out current executing function name in Java. If it were C, I would just do printf("%s \n" ,__FUNCITON__).

A: new Exception().getStackTrace()[0].getMethodName();

A: I'd use one of the logging frameworks (logback with slf4j is probably the best one at the moment, but log4j should suffice), then you can specify a layout that will print the method name logback layout documentation here


Q: Google Script - get data from Gmail into Sheet I have been looking around here on SO and on Google, but I cannot find anything that is working.
So when I am running my code below, I am getting the result on the image.
I want to extract data from the newest/most recent thread in mails that have a specific label.
However, in my Gmail, I only have the 3 mails under "Action"-label that I have highlighted in bold.
The other mails have been deleted, hence, they are in trash, but do still have the "Action" label.
I want to only show the mails that I have "Action"-label on - meaning that I only want the newest thread time/date, subject line as well as the ID, so I can create a link to that mail.

function myFunction() {

  var ss = SpreadsheetApp.getActiveSheet();

  var query = "label:action -label:trash -label:action-done -from:me";

  var threads = GmailApp.search(query);

    for (var i = 0; i < threads.length; i++)
    {
      var messages = threads[i].getMessages();

      for (var j = 0; j < messages.length; j++)
      {
        var mId = messages[j].getId()
        var from = messages[j].getFrom();
        var cc = messages[j].getCc();
        var time = messages[j].getDate()
        var sub = messages[j].getSubject();

        ss.appendRow([from, cc, time, sub, 'https://mail.google.com/mail/u/0/#inbox/'+mId])
      }
    }
  }
}

A: So I managed to solve it, by finding the max index in the array.
I have commented the code, so it can help others. Thanks, all.
function myFunction() {
  // Use sheet
  var ss = SpreadsheetApp.getActiveSheet();
  // Gmail query
  var query = "label:support -label:trash -label:support-done -from:me";
  // Search in Gmail, bind to array
  var threads = GmailApp.search(query);
  // Loop through query results
  for (var i = 0; i < threads.length; i++)
  {
    // Get messages in thread, add to array
    var messages = threads[i].getMessages();

    // Used to find max index in array
    var max = messages[0];
    var maxIndex = 0;

    // Loop through array to find maxIndexD = most recent mail
    for (var j = 0; j < messages.length; j++) {
      if (messages[j] > max) {
        maxIndex = j;
        max = messages[j];
      }
    }
    // Find data
    var mId = messages[maxIndex].getId() // ID used to create mail link
    var from = messages[maxIndex].getFrom();
    var cc = messages[maxIndex].getCc();
    var time = threads[i].getLastMessageDate()
    var sub = messages[maxIndex].getSubject();
    // Write data to sheet
    ss.appendRow([from, cc, time, sub, 'https://mail.google.com/mail/u/0/#inbox/'+mId])
  }
}

A: What do you mean by recent?
How about adding newer_than:3d to the search?
You can test the search in your own Gmail account and when it's doing what you want then just paste it into the query.


Q: How to create gifs with images in Python Are there any APIs or libraries I can use to create a .gif out of .jpgs and .pngs? I'm looking for one that will work with Python 3.

A: Try googling, there are a lot of answers for this question. Here are the top three when I looked
Programmatically generate video or animated GIF in Python?
Generating an animated GIF in Python
https://sukhbinder.wordpress.com/2014/03/19/gif-animation-in-python-in-3-steps/

A: Here is something that I wrote a while ago.  I couldn't find anything better when I wrote this in the last six months.  Hopefully this can get you started.  It uses ImageMagick found here!
import os, sys
import glob
dataDir = 'directory of image files' #must contain only image files
#change directory gif directory
os.chdir(dataDir)

#Create txt file for gif command
fileList = glob.glob('*') #star grabs everything, can change to *.png for only png files
fileList.sort()
#writes txt file
file = open('blob_fileList.txt', 'w')
for item in fileList:
    file.write("%s\n" % item)

file.close()

#verifies correct convert command is being used, then converts gif and png to new gif
os.system('SETLOCAL EnableDelayedExpansion')
os.system('SET IMCONV="C:\Program Files\ImageMagick-6.9.1-Q16\Convert"')
# The following line is where you can set delay of images (100)
os.system('%IMCONV% -delay 100 @fileList.txt theblob.gif')

New convert call
For whatever reason (I didn't look at differences), I no longer needed the set local and set command lines in the code.  I needed it before because the convert command was not being used even with path set.  When you use the new 7.. release of image magick.  See new line of code to replace last three lines.  Be sure to check box that ask to download legacy commands e.g convert when installing.  Everything was converted to a single magick command, but I didnt want to relearn the new conventions.
os.system('convert -delay 50 @fileList.txt animated.gif')


Q: Is it possible to connect Dialogflow (Api.ai) with Slack so that humans can monitor and possibly even intervene or add to the conversation via Slack? I know Dialogflow (Api.ai) can be a bot in Slack.  But what about monitoring the conversation and possibly manually intervene in the conversation?  If possible, what would be the general direction to implement this?

A: So Slack has Open APIs for interacting with the Slack App. Here
Since you want to monitor the conversations so Events APIs and Conversations APIs would help you to notify as well as capture the conversations.

conversations.history will help you to fetch the messages within public or private channels.
Since you want to intervene in the conversation then I suggest using chatbot, which will provide a suitable way to intervene and respond to some particular events. Bot Users

A: Dialogflow has an sample on how to do this: https://github.com/dialogflow/agent-human-handoff-nodejs
You'll have to build you own front end for the human to override the response and call the Dialogflow query API to integrate:
Slack <--> Front end w/human override <--> Dialogflow's query API <--> Dialogflow Agent

A: Yes, it's possible. Just login to DialogFlow with your Google credentials, then on the left sidebar you can see the Integrations Tab. Click on it. You will find a bunch of different integrations for line, telegram, Twilio, kik, Viber, Skype and a lot more.
Click on Slack. It will ask you for some details for connecting with endpoints such as client ID, token, client secret. You can get it from the Slack API. You can also check the Slack API integration link here. After everything is properly set up, click the "Test in Slack" button in the DialogFlow Slack integration.


Q: Get recent nth set of data from tables with Group in SQL I have got a table like this

Here as you can see there are different groups of data for different dates.
(When we ignore the time part in the datetime there, we have groups of dates)
So what I need is to take most recent from every group and from that result I need to get the recent nth set.
For example if I pass 2, it should return
LogId     etime
--------------------
19         2021-07-16
--------------------------

Same way if we pass the parameter 3 it should return
LogId     etime
--------------------
18         2021-07-15
--------------------------

I did some query which I really believe its not the best way and it looks little twisty..
create table MYTABLE(logid int,etime datetime)
insert into MYTABLE (logid,etime) values
(15,'2021-07-12 01:32:00 PM'),
(16,'2021-07-15 01:32:00 PM'),
(17,'2021-07-15 04:32:00 PM'),
(18,'2021-07-15 07:32:00 PM'),
(19,'2021-07-16 11:32:00 AM'),
(20,'2021-07-16 08:10:00 AM'),
(21,'2021-07-17 11:20:00 PM')

select logid,etime from (
select *,ROW_NUMBER() over (order by etime desc) serial from (
select logid,dense_rank() over(partition by cast(etime as date) order by etime desc) drnk,Cast(etime as date) etime from @table
)tbl where drnk=1 )tbl2 where serial=3

Could you please share some optimal way
Here is the fiddle
SQLFiddle

A: Seems like OFFSET and FETCH would be more succinct here:
DECLARE @N int = 2,
        @Date date = '20210716';

SELECT LogID, etime
FROM dbo.MYTABLE
WHERE etime >= @Date
  AND eTime < DATEADD(DAY, 1, @Date)
ORDER BY etime ASC
OFFSET @N-1 ROWS FETCH NEXT 1 ROWS ONLY;

A: Imo the way you're doing it now is a really good way and you could stick with it.  Again imo: the nested SELECT are not as nice as common table expressions.  I would rewrite and parameterize the code something like this
declare @param              int=3;

with
dr_cte(logid, etime_dt, drnk) as (
    select logid, Cast(etime as date),
           dense_rank() over(partition by cast(etime as date) order by etime desc)
    from #MYTABLE),
serial_cte(logid, etime_dt, drnk, serial) as (
    select *, row_number() over (order by etime_dt desc)
    from dr_cte
    where drnk=1)
select *
from serial_cte
where serial=@param;

[EDIT] It could be made a tiny bit more concise (or maybe it's the same?) by using TOP 1 WITH TIES in the dr_cte.  Then the WHERE condition in the second CTE could be removed.  Afaik this code is equivalent
declare @param              int=2;

with
dr_cte(logid, etime_dt) as (
    select top 1 with ties logid, Cast(etime as date)
    from #MYTABLE
    order by row_number() over(partition by cast(etime as date) order by etime desc)),
serial_cte(logid, etime_dt, serial) as (
    select *, row_number() over (order by etime_dt desc)
    from dr_cte)
select *
from serial_cte
where serial=@param;

[Edit 2] It could also be done by OFFSET paging.
declare @param              int=3;

with
dr_cte(logid, etime_dt) as (
    select top 1 with ties logid, Cast(etime as date)
    from #MYTABLE
    order by row_number() over(partition by cast(etime as date) order by etime desc))
select *
from dr_cte
order by etime_dt desc
offset @param-1 rows fetch next 1 rows only;


Q: Huawei Mobile Services SDK violation Device and Network Abuse policy
Your app contains content that doesn’t comply with the Device and
Network Abuse policy. We found your app is using a non-compliant
version of Huawei Mobile Services SDK which contains code to download
or install applications from unknown sources outside of Google Play.

I am using Huawei Mobile Services SDK for Auto Eraser.

List of used dependency

implementation 'com.huawei.hms:ml-computer-vision-segmentation:3.0.0.301'
implementation 'com.huawei.hms:ml-computer-vision-image-segmentation-body-model:2.0.2.300'

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
        maven {url 'http://developer.huawei.com/repo/'}
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.2'

        //Auto eraser
        classpath 'com.huawei.agconnect:agcp:1.3.1.300'
    }
}

Added below meta data in manifest.xml

<meta-data
    android:name="com.huawei.hms.ml.DEPENDENCY"
    android:value="imgseg" />

A: If you have dependencies that can be replaced with Google compatible equivalent dependencies then this could be a possible solution to manage both in one code base.
Using app flavours I was able to separate my GMS and HMS dependencies. In your app level build.gradle file you can create product flavour like so
android {
    flavorDimensions "platforms"
    ...
    productFlavors {
        gms {
            dimension "platforms"
        }
        hms {
            dimension "platforms"
        }
    }
    ...
}

More on product flavors here.
And then you can specify if a dependency should be part of the flavour by prefixing it to the keyword implementation under dependencies.
dependencies {
    ...
    gmsImplementation 'com.google.android.gms:play-services-maps:18.0.2'
    hmsImplementation 'com.huawei.hms:maps:5.0.0.300'
    ...
}

I then went a bit further by wrapping the usage of each dependency in a class that is available in both flavours but the implementation differs based on the dependency's requirements.
com.example.maps.MapImpl under src>hms>java
and
com.example.maps.MapImpl under src>gms>java

So I am free to use the wrapper class anywhere without worrying about the dependency mismatch.
The HMS dependency is no longer part of the GMS build variant so I would be able to upload that to the Google playstore.

A: I solved it by doing similar to what @Daniel has suggested to avoid such worries in the future:

*

*Create different product flavors in your app level Gradle file:

android {
    ...

    flavorDimensions 'buildFlavor'

    productFlavors {
        dev {
            dimension 'buildFlavor'
        }

        production {
            dimension 'buildFlavor'
        }

        huawei {
            dimension 'buildFlavor'
        }
    }
}

*Restrict the Huawei related dependencies so they're only available for Huawei product flavor:

    huaweiImplementation "com.huawei.hms:iap:3.0.3.300"
    huaweiImplementation "com.huawei.hms:game:3.0.3.300"
    huaweiImplementation "com.huawei.hms:hwid:5.0.1.301"
    huaweiImplementation "com.huawei.hms:push:5.0.0.300"
    huaweiImplementation "com.huawei.hms:hianalytics:5.0.3.300"
    huaweiImplementation "com.huawei.hms:location:5.0.0.301"

*Since dev and production flavors are not going to have Huawei dependencies now, you may get build errors for the Huawei related classes that you use in your app.

For that I create dummy classes with the same packages tree as Huawei, for instance:
app > src > dev > java > com > huawei > hms > analytics > HiAnalytics.kt
class HiAnalytics {

    companion object {

        @JvmStatic
        fun getInstance(context: Context): HiAnalyticsInstance {
            return HiAnalyticsInstance()
        }
    }
}

*This solves the Cannot resolve symbol error when trying to import Huawei classes in your main, dev, or production flavors and you can import those classes anywhere:

import com.huawei.hms.analytics.HiAnalytics

Now if you change the build variant to dev, you should have access to the dummy classes in your app. If you change it to huawei, you should be able to access the classes from Huawei dependencies.

A: Update:
Note:
If you have confirmed that the latest SDK version is used, before submitting a release to Google, please check the apks in all Testing track on Google Play Console(including Open testing, Closed testing, Internal testing). Ensure that the APKs on all tracks(including paused track) have updated to the latest HMS Core SDK.

HMS Core SDKs have undergone some version updates recently. To further improve user experience, update the HMS Core SDK integrated into your app to the latest version.

HMS Core SDK
Version
Link

Keyring
com.huawei.hms:keyring-credential:6.4.0.302
Link

Location Kit
com.huawei.hms:location:6.4.0.300
Link

Nearby Service
com.huawei.hms:nearby:6.4.0.300
Link

Contact Shield
com.huawei.hms:contactshield:6.4.0.300
Link

Video Kit
com.huawei.hms:videokit-player:1.0.12.300
Link

Wireless kit
com.huawei.hms:wireless:6.4.0.202
Link

FIDO
com.huawei.hms:fido-fido2:6.3.0.304com.huawei.hms:fido-bioauthn:6.3.0.304com.huawei.hms:fido-bioauthn-androidx:6.3.0.304
Link

Panorama Kit
com.huawei.hms:panorama:5.0.2.308
Link

Push Kit
com.huawei.hms:push:6.5.0.300
Link

Account Kit
com.huawei.hms:hwid:6.4.0.301
Link

Identity Kit
com.huawei.hms:identity:6.4.0.301
Link

Safety Detect
com.huawei.hms:safetydetect:6.4.0.301
Link

Health Kit
com.huawei.hms:health:6.5.0.300
Link

In-App Purchases
com.huawei.hms:iap:6.4.0.301
Link

ML Kit
com.huawei.hms:ml-computer-vision-ocr:3.6.0.300com.huawei.hms:ml-computer-vision-cloud:3.5.0.301com.huawei.hms:ml-computer-card-icr-cn:3.5.0.300com.huawei.hms:ml-computer-card-icr-vn:3.5.0.300com.huawei.hms:ml-computer-card-bcr:3.5.0.300com.huawei.hms:ml-computer-vision-formrecognition:3.5.0.302com.huawei.hms:ml-computer-translate:3.6.0.312com.huawei.hms:ml-computer-language-detection:3.6.0.312com.huawei.hms:ml-computer-voice-asr:3.5.0.301com.huawei.hms:ml-computer-voice-tts:3.6.0.300com.huawei.hms:ml-computer-voice-aft:3.5.0.300com.huawei.hms:ml-computer-voice-realtimetranscription:3.5.0.303com.huawei.hms:ml-speech-semantics-sounddect-sdk:3.5.0.302com.huawei.hms:ml-computer-vision-classification:3.5.0.302com.huawei.hms:ml-computer-vision-object:3.5.0.307com.huawei.hms:ml-computer-vision-segmentation:3.5.0.303com.huawei.hms:ml-computer-vision-imagesuperresolution:3.5.0.301com.huawei.hms:ml-computer-vision-documentskew:3.5.0.301com.huawei.hms:ml-computer-vision-textimagesuperresolution:3.5.0.300com.huawei.hms:ml-computer-vision-scenedetection:3.6.0.300com.huawei.hms:ml-computer-vision-face:3.5.0.302com.huawei.hms:ml-computer-vision-skeleton:3.5.0.300com.huawei.hms:ml-computer-vision-livenessdetection:3.6.0.300com.huawei.hms:ml-computer-vision-interactive-livenessdetection:3.6.0.301com.huawei.hms:ml-computer-vision-handkeypoint:3.5.0.301com.huawei.hms:ml-computer-vision-faceverify:3.6.0.301com.huawei.hms:ml-nlp-textembedding:3.5.0.300com.huawei.hms:ml-computer-ner:3.5.0.301com.huawei.hms:ml-computer-model-executor:3.5.0.301
Link

Analytics Kit
com.huawei.hms:hianalytics:6.5.0.300
Link

Dynamic Tag Manager
com.huawei.hms:dtm-api:6.5.0.300
Link

Site Kit
com.huawei.hms:site:6.4.0.304
Link

HEM Kit
com.huawei.hms:hemsdk:1.0.4.303
Link

Map Kit
com.huawei.hms:maps:6.5.0.301
Link

Wallet Kit
com.huawei.hms:wallet:4.0.5.300
Link

Awareness Kit
com.huawei.hms:awareness:3.1.0.302
Link

Crash
com.huawei.agconnect:agconnect-crash:1.7.0.300
Link

APM
com.huawei.agconnect:agconnect-apms:1.5.2.310
Link

Ads Kit
com.huawei.hms:ads-prime:3.4.55.300
Link

Paid Apps
com.huawei.hms:drm:2.5.8.301
Link

Base
com.huawei.hms:base:6.4.0.303

Required versions for cross-platform app development:

Platform
Plugin Name
Version
Link

React Native
react-native-hms-analytics
6.3.2-301
Link

react-native-hms-iap
6.4.0-301
Link

react-native-hms-location
6.4.0-300
Link

react-native-hms-map
6.3.1-304
Link

react-native-hms-push
6.3.0-304
Link

react-native-hms-site
6.4.0-300
Link

react-native-hms-nearby
6.2.0-301
Link

react-native-hms-account
6.4.0-301
Link

react-native-hms-ads
13.4.54-300
Link

react-native-hms-adsprime
13.4.54-300
Link

react-native-hms-availability
6.4.0-303
Link

Cordova(Ionic-CordovaIonic-Capacitor)
cordova-plugin-hms-analyticsionic-native-hms-analytics
6.3.2-301
Link

cordova-plugin-hms-locationionic-native-hms-location
6.4.0-300
Link

cordova-plugin-hms-nearbyionic-native-hms-nearby
6.2.0-301
Link

cordova-plugin-hms-accountionic-native-hms-account
6.4.0-301
Link

cordova-plugin-hms-pushionic-native-hms-push
6.3.0-304
Link

cordova-plugin-hms-siteionic-native-hms-site
6.4.0-300
Link

cordova-plugin-hms-iapionic-native-hms-iap
6.4.0-301
Link

cordova-plugin-hms-availabilityionic-native-hms-availability
6.4.0-303
Link

cordova-plugin-hms-adsionic-native-hms-ads
13.4.54-300
Link

cordova-plugin-hms-adsprimeionic-native-hms-adsprime
13.4.54-300
Link

cordova-plugin-hms-mapionic-native-hms-map
6.0.1-305
Link

cordova-plugin-hms-mlionic-native-hms-ml
2.0.5-303
Link

Flutter
huawei_safetydetect
6.4.0+301
Link

huawei_iap
6.2.0+301
Link

huawei_health
6.3.0+302
Link

huawei_fido
6.3.0+304
Link

huawei_push
6.3.0+304
Link

huawei_account
6.4.0+301
Link

huawei_ads
13.4.55+300
Link

huawei_analytics
6.5.0+300
Link

huawei_map
6.5.0+301
Link

huawei_hmsavailability
6.4.0+303
Link

huawei_location
6.0.0+303
Link

huawei_adsprime
13.4.55+300
Link

huawei_ml
3.2.0+301
Link

huawei_site
6.0.1+304
Link

Xamarin
Huawei.Hms.Hianalytics
6.4.1.302
Link

Huawei.Hms.Location
6.4.0.300
Link

Huawei.Hms.Nearby
6.2.0.301
Link

Huawei.Hms.Push
6.3.0.304
Link

Huawei.Hms.Site
6.4.0.300
Link

Huawei.Hms.Fido
6.3.0.304
Link

Huawei.Hms.Iap
6.4.0.301
Link

Huawei.Hms.Hwid
6.4.0.301
Link

Huawei.Hms.Ads-prime
3.4.54.302
Link

Huawei.Hms.Ads
3.4.54.302
Link

Huawei.Hms.Maps
6.5.0.301
Link

If you have any further questions or encounter any issues integrating any of these kits, please feel free to contact us.

Region
Email

Europe
developereu@huawei.com

Asia Pacific
developerapac@huawei.com

Latin America
developerla@huawei.com

Middle East & Africa
developermea@huawei.com

Russia
developer_ru@huawei.com

A: UPDATE 06/04/2022
Huawei released a new version of their SDK : 3.4.0.300
3.4.0.300 (2022-03-04)
New Features

*

*Real-time translation: Added Afrikaans to the list of languages
supported. (Note that this language is available only in Asia,
Africa, and Latin America.)

Modified Features

*

*Deleted the capability of prompting users to install HMS Core (APK).

*Modified the SDK privacy and security statement. Updated the SDK

*versions of all subservices.

For me, since I've migrated to Google ML Kit, I will wait till August, then I will switch back to Huawei ML Kit to make sure Google will not remove or suspend my apps.

Old answer :
I used to love the HMS ML kit, but because of this issue, I'm aware that Google will one day completely suspend my apps because I'm using HMS services, and even if Huawei fixes the issue, we'll have to wait 120 days to find out if we're safe.
In my case, I'm using the HMS Segmentation ML Kit. I've just switched to Google Selfie Segmentation ML. I will wait till 120 days have passed and see if the issue is still persisting for other developers. If not, I will switch back to the HMS Kit.

A: The solution to the problem is to update the dependencies like in this link.
With this update, the ability to prompt users to install HMS Core (APK) has been removed.
https://developer.huawei.com/consumer/en/doc/development/hmscore-common-Guides/hmssdk-kit-0000001050042513#section20948233203517

A: I just use hms push when upload to huawei.
i fixed by commenting hms services in  build.gradle and app/build.gradle when to upload to playstore.
Then, I uncomment if upload to huawei.
//apply plugin: "com.huawei.agconnect"

apply plugin: 'com.google.gms.google-services'

//implementation 'com.huawei.hms:push:5.3.0.304'.


Q: Show another button when using "commitEditingStyle" in a UITableView datasource I want to show an "Edit" button below the default "Delete" button that shows up with a swipe gesture on a cell when you implement "commitEditingStyle" on the table's datasource.
Is this possible by only implementing "commitEditingStyle" or will i have to implement my own way of showing the buttons on the cells? And if it is, how would i handle the commit?

A: Yes you have to implement your own way of showing buttons on UITableViewCells by customizing the UITableViewCells.
As far as your requirement is concerned, I dont think its a good idea to show the "edit" button below the "delete" button, as accommodating both buttons vertically one-by-one may disappoint the user to make desired touch actions.
I mean to say, user may want to touch edit, but due to successive placing of custom edit/delete buttons, delete button may get clicked which is dangerous & not acceptable too. Of course,it will cause user to take proper care every-time making any of the edits.