text:
Q: How does MySQL use collations with indexes? I'm wondering if MySQL takes collation into account when generating an index, or if the index is generated the same regardless of collation, the collation only being taken into account when later traversing that index.
For my purposes, I'd like to use the collation utf8_unicode_ci on a field.  I know this particular collation has a relatively high performance penalty, but it's still important to me to use it.
I have an index on that field which is being used to satisfy an ORDER BY clause, retrieving the rows in order quickly (avoiding a filesort).  However, I'm not sure whether using this collation is going to affect the speed of rows as they are read back from the index, or if the index stores data in an already-normalised state according to that collation, allowing for the performance penalty to be entirely in generating the index and not reading it back.

A: MySQL will use the collation of the column for the index.  So if you make a utf8_unicode_ci field, then the index will also be in utf8_unicode_ci order effectively.
Keep in mind that using the index will not always 100% bypass the performance impact, but for most practical purposes it will.
Many database systems aren't CPU bound, so I doubt you would notice the impact.

A: I believe that the btree structure will be different because it has to compare the column values differently.
Look at these two query plans:
mysql> explain select * from sometable where keycol = '3';
+----+-------------+-------+------+---------------+---------+---------+-------+------+--------------------------+
| id | select_type | table | type | possible_keys | key     | key_len | ref   | rows | Extra                    |
+----+-------------+-------+------+---------------+---------+---------+-------+------+--------------------------+
|  1 | SIMPLE      | pro   | ref  | PRIMARY       | PRIMARY | 66      | const |   34 | Using where; Using index |
+----+-------------+-------+------+---------------+---------+---------+-------+------+--------------------------+

mysql> explain select * from sometable where binary keycol = '3';
+----+-------------+-------+-------+---------------+---------+---------+------+-------+--------------------------+
| id | select_type | table | type  | possible_keys | key     | key_len | ref  | rows  | Extra                    |
+----+-------------+-------+-------+---------------+---------+---------+------+-------+--------------------------+
|  1 | SIMPLE      | pro   | index | NULL          | PRIMARY | 132     | NULL | 14417 | Using where; Using index |
+----+-------------+-------+-------+---------------+---------+---------+------+-------+--------------------------+

If we change the collation for the comparison, suddenly it isn't even able to seek the index anymore and has to scan every row. The actual values stored in the index will be the same regardless of collation, for instance, because it will still return the value in its original casing regardless of whether it's using a case sensitive or case insensitive collation.
So lookups against a case insensitive collation should be a little less efficient.
However, I doubt you'd ever be able to notice the difference; note that MySQL makes everything case insensitive by default, so the impact can't be that terrible.
UPDATE:
You can see a similar effect for order by operations:
mysql> explain select * from sometable order by keycol collate latin1_general_cs;
+----+-------------+-------+-------+---------------+---------+---------+------+-------+-----------------------------+
| id | select_type | table | type  | possible_keys | key     | key_len | ref  | rows  | Extra                       |
+----+-------------+-------+-------+---------------+---------+---------+------+-------+-----------------------------+
|  1 | SIMPLE      | pro   | index | NULL          | PRIMARY | 132     | NULL | 14417 | Using index; Using filesort |
+----+-------------+-------+-------+---------------+---------+---------+------+-------+-----------------------------+

mysql> explain select * from sometable order by keycol ;
+----+-------------+-------+-------+---------------+---------+---------+------+-------+-------------+
| id | select_type | table | type  | possible_keys | key     | key_len | ref  | rows  | Extra       |
+----+-------------+-------+-------+---------------+---------+---------+------+-------+-------------+
|  1 | SIMPLE      | pro   | index | NULL          | PRIMARY | 132     | NULL | 14417 | Using index |
+----+-------------+-------+-------+---------------+---------+---------+------+-------+-------------+

Note the extra 'filesort' stage required to execute the query. That means mysql is queuing up the result in a temporary buffer and sorting it itself using a quicksort in an extra stage, throwing out whatever the index order was. Using the original collation this step is uneccessary as mysql knows the order from index initially.


text:
Q: Android Studio Gives me : Type argument is not within its bounds: should be subtype of 'RecyclerView.ViewHolder!' class DashboardRecyclerAdapter : RecyclerView.Adapter<DashboardRecyclerAdapter.DashboardViewHolder>()
Error in the :- <DashboardRecyclerAdapter.DashboardViewHolder>
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.surajpatil.navigationdrawer1.R

class DashboardRecyclerAdapter : RecyclerView.Adapter<DashboardRecyclerAdapter.DashboardViewHolder>(){

    class DashboardViewHolder(view:View)
    {
        val textView: TextView = view.findViewById(R.id.txtRecyclerRowItem)

    }

    override fun onCreateViewHolder(parent: ViewGroup , viewType: Int): DashboardViewHolder {
        TODO("Not yet implemented")
    }

    override fun onBindViewHolder(holder: DashboardViewHolder , position: Int) {
        TODO("Not yet implemented")
    }

    override fun getItemCount(): Int {
        TODO("Not yet implemented")
    }
}

A: Your problem is that DashboardViewHolder does not inherit from RecyclerView.ViewHolder. Have a look at the docs for some examples. It should look like this
class DashboardViewHolder(view: View) : RecyclerView.ViewHolder(view) {
    val textView: TextView = view.findViewById(R.id.txtRecyclerRowItem)
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to Connect to Local SQL server I just started learning MySQL, when I was installing MySQL server and MySQL workbench I was configuring the server and accidentally I hit cancel, now when I try to create a connection to a local host it won't work.
how I can reconfigure it again?

A: First of all you need to check if Mysql is working go to console and type:
systemctl status mysql
It should be active, if not press:
systemctl start mysql
Then you need to go mysqlWorbench to Mysql connections, create one, leave hostname: 127.0.0.1 and the default port 3306 username root and just put the password, to put it you need to hit "Stored in Keychain", finally you need to press "Ok" and you will have a new connection created.


text:
Q: Конвертировать данные от tilda Работаю с вебхуком конструктора сайтов tilda . Получаю следующие данные:
b'name=clientName&payment=%7B%22sys%22%3A%22none%22%2C%22systranid%22%3A%220%22%2C%22orderid%22%3A%222069588462%22%2C%22products%22%3A%5B%22Slime+Box%3D4500%22%5D%2C%22amount%22%3A%224500%22%7D&formid=form229172915&formname=Cart'

Необходимо их конвертировать в формат utf-8 и сохранить в переменную для отправки post запросом.
Вместо сохранения данных в переменную было бы отлично сохранить их в словарь, если это возможно (например, {"name": "clientName", "payment": "")

A: from urllib.parse import unquote

a = b'name=clientName&payment=%7B%22sys%22%3A%22none%22%2C%22systranid%22%3A%220%22%2C%22orderid%22%3A%222069588462%22%2C%22products%22%3A%5B%22Slime+Box%3D4500%22%5D%2C%22amount%22%3A%224500%22%7D&formid=form229172915&formname=Cart'
res = dict(x.split("=") for x in a.decode("utf8").split("&"))
res = {k:unquote(v) for k,v in res.items()}
print(res)

получим:
{'name': 'clientName', 'payment': '{"sys":"none","systranid":"0","orderid":"2069588462","products":["Slime+Box=4500"],"amount":"4500"}', 'formid': 'form229172915', 'formname': 'Cart'}


text:
Q: How to copy objects while maintaining consistent references? I want to implement a checkpoint system for a game I am working on and for that I need to copy all mutable objects within a level in order to create an independent copy of the level. In a simplified example my classes look something like this:
public class GameObject
{
    ...
    private Level level;
    ...
}

public class Level
{
    ...
    private List<GameObject> gameObjects;
    ...
}

But there is a problem: When I want to duplicate a level and its objects the references become inconsistent. For example, I could deep-copy my Level-instance and deep-copy all gameObjects. But when I do that, the Level-reference in GameObject is no longer pointing at the "right" (new) level. In this case I could just call a method for each object and reset its level. But that would get increasingly complex with more and more types of objects involded, as objects might or might not have their own sets of objects they created and then those references have to be updated as well and so on.
Is there anything like a design-pattern for this kind of situation, or anything Java-specific that makes this problem much easier?
Edit
I just had an idea: How about creating some kind of wrapper class for each GameObject that looks like this:
public class GameObjectWrapper
{
    ...
    private long gameObjectID;
    private Level level;
    ...
}

This would be given as a reference to all objects which need references.
And each GameObject would get a unique id and level would have a map linking each id to an actual GameObject (something like GameObject Level.getObject(long id)). While this would probably work, I still feel like there must be a better solution.
Edit: Further clarification
It seems like I did not make my issue clear enough, so I will simplify and generalize it a bit more:
I got two example objects (objectA and objectB): objectA contains a reference to objectB and objectB contains a reference to objectA.
Something like this:
public class MyObject
{
   private MyObject partner;

   ...

   public MyObject shallowCopy()
   {
        return new MyObject(partner);
   }
}

I want to copy both. With shallow copy, I get two new objects: newObjectA and newObjectB. newObjectA's stored reference (which is supposed to point to newObjectB), however, still points to the original objectB and vice-versa.
MyObject objectA = new MyObject(), objectB = new MyObject();

objectA.setPartner(objectB);
objectB.setPartner(objectA);

MyObject newObjectA = objectA.copy(); //newObjectA's partner now is objectB (instead of newObjectB)
MyObject newObjectB = objectB.copy(); //newObjectB's partner now is objectA (instead of newObjectA)

Now, I could "just" run through all my objects and map their old objects to new objects, but that seems slow and too complicated a solution to me. What is the simplest and most efficient way to resolve this?
Note: I considered posting this to gamedev.stackexchange.com, but I found this to be more of a programming and design specific problem than a game development specific problem.

A: If you're only copying the Level object and want the references inside the list of it to point to the new copy, couldn't you just loop through them in the copy method.
Something like this:
class Level {

    List<GameObject> gameObjects;

    Level copy() {
        Level level = new Level();
        level.gameObjects = new ArrayList<>(gameObjects.size());
        for (GameObject gameObject : gameObjects) {
            level.gameObjects.add(gameObject.copyWithReference(level));
        }
        return level;
    }
}

class GameObject {

    Level level;

    GameObject copyWithReference(Level level) {
        GameObject gameObject = new GameObject();
        gameObject.level = level;
        return gameObject;
    }
}

Edit:
You could have a container for the gameObjects:
class GameObjectSet {

    Level level;
    List<GameObject> gameObjects;

    GameObjectSet copy(Level newLevel) {
        GameObjectSet gameObjectSet = new GameObjectSet();
        gameObjectSet.level = newLevel;
        // copy all gameObjects and make them point to new gameObjectSet
        return gameObjectSet;
    }
}

Now you would have a reference to a GameObjectSet in both in Level class and in GameObject class.

A: The classic solution to checkpointing is the Memento pattern.
That said, if you ever want to persist checkpoints, Java Serialization may be what you are looking for, as it retains object identities in addition to object states (within the same stream, that is). This would be something like:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
    oos.writeObject(level);
}

byte[] checkpoint = baos.getBytes();

try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(checkpoint)) {
    Level level = (Level) ois.readObject();
    assert level == level.getGameObjects().get(0).getLevel();
}


text:
Q: Meteor mongo: Untrusted code may only update documents by ID. [403] The following snippet gives me the error:
Households.update({
    _id: Meteor.user().profile.myHousehold,
    "shoppingList.name" : this.name},
    {"$set" : {
         "shoppingList.$.checked" : checked
    }
});

Wot? I am updating by id. As a workaround, I could of course simply replace the whole array shoppingList, but that would be brute force.

A: The proper pattern for using complex update/delete selectors with latency compensation is to use a Meteor method.
Shared code:
Meteor.methods({

  setHouseholdChecked: function(shoppingListName, checked) {

    check(this.userId, String);
    check(shoppingListName, String);
    check(checked, Boolean);

    Households.update({
      _id: Meteor.user().profile.myHousehold,
      "shoppingList.name" : shoppingListName
    }, {
      $set: {
        "shoppingList.$.checked" : checked
      }
    });

  }

});

Client code:
Meteor.call('setHouseholdChecked', this.name, checked);

A: For a client only solution you could rely on this trick :
var households = Houseolds.find({
  _id: Meteor.user().profile.myHousehold,
  "shoppingList.name" : this.name
});
households.forEach(function(houseold){
  Households.update(houseold._id, {
    $set: {
      "shoppingList.$.checked" : checked
    }
  });
});


text:
Q: Windows 10 batch file grief I have this batch file called open3.bat:
@echo off

echo C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe /A  Page=55 example.pdf

pause

It's supposed to open Acrobat, load example.pdf and display page 55.
I run it by either using shell (open3,1) from excel VBA function or by typing open3 in a cmd window. Either way it does the same thing...nothing! Note if I paste the command in a cmd window it works as it should. Any suggestions?

A: The echo command does what its name suggests — it produces echo:
C:\>echo Hello world!
Hello world!

If you want to launch a program, don't use the echo command and surround the path to the executable by quotes (because it contains spaces):
@echo off

"C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" /A  Page=55 example.pdf

pause

A: Thanks, But if I do that I get:

C:\Program is not recognized as an blah blah

So I did this...
Create a link to Acrobat, dropped the echo as you suggest and my batch file now looks like this:
@echo off

Acrobat.exe.lnk /A  Page=55 C:\Chris\CAPCO\Mis\01ReceivedDocuments\example.pdf

... and this works!
Thanks again.


text:
Q: How to create animation on image slider with info data in Angular I have prepared working image slider with additional data on pics but without animations . Below is code of my component:
html:

{{pageData[currentPictureIndex].getLabel()}}

      <mat-icon class="icon">{{detail.getIcon()}}</mat-icon>

{{detail.getLabel()}}

{{detail.getValue()}}

    <button (click)="previousPicture()" mat-button>
      <mat-icon>arrow_left</mat-icon>
    </button>

{{getCurrentNumberOfElement()}} / {{getNumberOfElements()}}

    <button (click)="nextPicture()" mat-button>
      <mat-icon>arrow_right</mat-icon>
    </button>

Scss:
@import 'src/styles.scss';
@import 'src/assets/variables/colors.scss';
@import 'src/assets/styles/shared.scss';

.slider-container {
  background-color: $primary-color-brighter;
  font-family: $project-font-family;
  padding: 1rem 5rem 0 5rem;
  position: relative;
  z-index: 0;

  img {
    height: 85vh;
    object-fit: cover;
    position: relative;
    width: 100%;
  }

  .gradient{
    background: rgba(0, 0, 0, 0) linear-gradient(
      to bottom, rgba(0, 0, 0, 0) 10%,
      rgba(0, 0, 0, .25) 40%,
      rgba(0, 0, 0, .5) 75%,
      rgba(0, 0, 0, .75) 100%) repeat scroll 0 0;
    height: 15rem;
    margin-top: -15.3rem;
    position: relative;
    width: 100%;
  }

  .information-box{
    position: relative;
    bottom: 8rem;
    margin-left: 6rem;
    margin-right: 6rem;
    color: $trinary-color;
    display: flex;

    .name{
      font-size: 2.25rem;
      font-weight: 400;
    }

    .divider{
      margin-top: -0.5rem;
      margin-left: 1rem;
      margin-right: 1rem;
      min-width: 1px;
      height: 6rem;
      background-color: $trinary-color;
    }

    .subsection{
      margin-top: 2rem;
      display: flex;

      .icon{
        $icon-size: 3.5rem;
        font-size: $icon-size;
        width: $icon-size;
        height: $icon-size;
      }

      .description{
        margin-left: 1rem;
        margin-right: 1rem;

        .label {
          margin-top: 0.25rem;
          font-weight: 600;
          font-size: 1rem;
        }

        .value{
          margin-top: -0.5rem;
          font-weight: 100;
          font-size: 0.9rem;
          display: flex;

          &-unit{
            font-size: 0.6rem;
            margin-top: -0.3rem;
          }
        }
      }
    }
  }

  .navigation{
    margin: 0;
    position: absolute;
    top: 45%;
    right: 1%;
    transform: translate(-100%,-50%);
    -ms-transform: translate(-100%, -50%);

    button{
      width: 5rem;
      height: 5rem;

      background: rgb(0, 0, 0,0.25);
      border: 1px solid $trinary-color;
      color: $trinary-color;
      border-radius: 5rem;
      font-size: 1.5rem;
      transition: 0.3s;

      &:focus,
      &:hover {
        background-color: rgb($secondary-color-darker, 0.25);
        border: 1px solid $secondary-color;
      }

      &:active {
        border: 1px solid $secondary-color;
      }

      mat-icon{
        $icon-size: 3rem;
        font-size: $icon-size;
        width: $icon-size;
        height: $icon-size;
        transition: transform 0.5s ease-in-out;
      }
    }

    .counter{
      margin-top: 0.25rem;
      margin-bottom: 0.25rem;
      width: 5rem;
      height: 5rem;

      background: rgb(0, 0, 0,0.25);
      border: 1px solid $trinary-color;
      color: $trinary-color;
      border-radius: 5rem;
      font-size: 1rem;

      p {
        margin: 0;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }
    }
  }

}

Ts:
import { Component, Input, OnInit } from '@angular/core';
import { PictureSliderSectionWithInfoModel } from './picture-slider-section-with-info-model';

@Component({
  selector: 'app-picture-slider-section-with-info',
  templateUrl: './picture-slider-section-with-info.component.html',
  styleUrls: ['./picture-slider-section-with-info.component.scss']
})
export class PictureSliderSectionWithInfoComponent implements OnInit {

  @Input() public pageData!: PictureSliderSectionWithInfoModel[];

  public currentPictureIndex = 0;

  constructor() { }

  ngOnInit(): void {
  }

  nextPicture(){
    let numberOfElements = this.pageData.length;

    if(this.currentPictureIndex >= numberOfElements - 1){
      this.currentPictureIndex = 0;
    } else {
      this.currentPictureIndex += 1;
    }
  }

  previousPicture(){
    if(this.currentPictureIndex <= 0){
      this.currentPictureIndex = this.pageData.length - 1;
    } else {
      this.currentPictureIndex -= 1;
    }
  }

  getNumberOfElements() :number {
    return this.pageData.length;
  }

  getCurrentNumberOfElement() :number {
    return this.currentPictureIndex + 1;
  }
}

I am not specialist in animations, so please tell me how to add the simplest animation to slide pics to the left or right with data informations on it despite on button click (left or right). If it will be helpful, im posting model of PictureSliderSectionWithInfoModel too:
export class PictureSliderSectionWithInfoModel {
  private imagePath: string;
  private label: string;
  private details: PictureSliderDetailSectionWithInfoModel[];

  constructor(
    imagePath: string,
    label: string,
    details: PictureSliderDetailSectionWithInfoModel[]
  ){
    this.imagePath = imagePath;
    this.label = label;
    this.details = details;
  }

  getImagePath(){
    return this.imagePath;
  }

  getLabel(){
    return this.label;
  }

  getDetails(){
    return this.details;
  }
}

export class PictureSliderDetailSectionWithInfoModel{
  private icon: string;
  private label: string;
  private value: string;

  constructor(
    icon: string,
    label: string,
    value: string
  ) {
    this.icon = icon;
    this.label = label;
    this.value = value;
  }

  getIcon(){
    return this.icon;
  }

  getLabel(){
    return this.label;
  }

  getValue(){
    return this.value;
  }
}


text:
Q: Why do I have both HTTPS and HTTP links on site, need them all secure! I am getting the security alert: "You are about to be directed to a connection that is not secure. the information you are sending to the current site might be transmitted to a non-secure site. Do you wish to continue?" when I try to login as a customer on my clients oscommerce website. I noticed the link in the status bar goes from a https prefix to a nonsecure http prefix. The site has a SSL certificate, so how do I ensure the entire store portion of the site directs to the secured site?

A: It is likely that some parts of the page, most often images or scripts, are loaded non-secure. You'll need to go through them in the browser's "view page source" view one by one and eliminate the reason (most often, a configuration setting pointing to http://).
Some external tools like Google Analytics that you may be embedding on your site can be included through https://, some don't. In that case, you may have to remove those tools from your secure site.
If you can't switch all the settings, try using relative paths

but the first thing is to identify the non-secure elements using the source code view of your browser.
An immediate redirection from a https:// page to a http:/ one would not result in a warning as you describe. Can you specify what's up with that?

A: Ensure that the following are included over https:

*

*css files

*js files

*embedded media (images, videos)

If you're confident none of your own stuff is included over http, check things like tracking pixels and other third-party gadgets.
Edit: Now that you've linked your page, I see that your <base> tag is the problem:
<base href="http://balancedecosolutions.com/products//catalog/">

Change to:
<base href="https://balancedecosolutions.com/products//catalog/">

A: Use Fiddler and browse your site, in the listing it should become evident what is using HTTP and HTTPS.

A: If the suggestion from Pekka doesn't suit your needs you can try using relative links based on the schema (http or https):
e.g.,
I am a 100% valid link!

The only problem with this technique is that it doesn't work with CSS files in all browsers; though it does work within Javascript and inline CSS. (I could be wrong here; anyone want to check?).
e.g., the following :
<link rel="stylesheet" href="/css/mycss.css" />

...
body{
    background-image:url(//static.example.com/background.png);
}
...

...might fail.
A simple Find/Replace on your source code could be easy.

A: It sounds to me like the HTML form you are submitting is hardcoded to post to a non-secure page.


text:
Q: Is it possible to append multiple objects via Java's ObjectOutputStream in a string format? My server communicates to the client by Strings, such as
in server,
String message = "I am new at this.";
send("Y" + message);

and in client,
if (messageReceived.startsWith("Y"){
System.out.println(messageThatServerSentWithoutTheY);
}

But suppose I have a HashTable allPotentialWords, and an Array wordlist I want to put through. How is it possible that
send("#" + wordlist + "~" +  allPotentialWords);

can be isolated, extracted, and used by
if (messageReceived.startsWith("#"){
...
}

in the Client by having its own variables which are, too, called wordlist and allPotentialWords? I get this is an "Object"OutputStream, but I just cannot think of a way to extract this. It's a string I'm looking at! Is the String that represents the Object itself stored somewhere in memory, which, when the string accessed, brings out the Object when it is properly cast-ed?
Thanks in advance!

A: Why? Just send the individual objects. That's what object streams are for, and that's what they're good at. Don't give yourself a parsing problem unnecessarily.


text:
Q: How to modiffy Highchart size with slide effect I have multiples charts on the same page in two columns, and I have a button to  slide right using jquery animate(), having the left column charts hiding the right columns charts.
My problem is :
Using the function chart.reflow() I can only resize the charts when animate has ended, it is not beautiful.
an other problem append when I reflow, i lose .brighten() property on pie charts (Only on pie charts)
A little example from my fiddle to describe my problem:
$('#resize').click(function(){
    $('#first').animate({
        width : '100%'
    }, 600);
    $('#second').animate({
        width : 'toggle',
        opacity : 'toggle'
    }, 600).queue(function(){
        $('#first').highcharts().reflow();
    });
});

http://jsfiddle.net/8t6ev/1/
Thanks for your help!

A: Looks like you need to use the step option of .animate()
    $('#resize').click(function(){
    $('#first').animate({
        width : '100%'
    },{
    duration: 600,
    step: function() {
      $('#first').highcharts().reflow();
    }
    });

    $('#second').animate({
        width : 'toggle',
        opacity : 'toggle'
    }, 600).queue(function(){
        $('#first').highcharts().reflow();
    });
});

Updated Fiddle


text:
Q: Tinymce shortcodes within shortcode contents I am using wp.mce.views.register to create a simple view for my shortcode  in the tinymce editor,
this works fine but i am looking for a way to have "nested" shortcodes
e.g.
[column_3]
    [info_box]

Some info here!

    [/info_box]
[/column_3]

and to have them rendered nicely.
This is simple enough frontend with do_shordcode($shortcode_content); but I havent been able to find an equivalent js/tinymce function.
Do anyone know how to do this if it is possible?


text:
Q: Sending additional params in JSON string to jqGrid I'm using PHP to generate JSON for JQGrid. I've added another property to the PHP object that I'm JSON encoding:
$sql_array = preg_split('/LIMIT/', $sql);
$pass_sql = $sql_array[0];
$response->sql = $pass_sql;
<~SNIP~>
echo json_encode($response);

This parses fine on the client side and populates the jqGrid with JSON like this:
{"page":"1","total":28,"records":"685","sql":"SELECT * FROM fires ORDER BY id desc ","rows":[{"id":"3065","cell":["Southern","Lost Fire","National Forests in Mississippi","492","100","0000-00-00",null,null,null,null,null,null,null,null,null,null,null,"3065","2011-03-03 00:00:00"]},{"id":"3064","cell":["Southern","PineTree","East Central Area Dispatch Office","420","80","2011-03-02",null,null,null,null,null,null,null,null,null,null,null,"3064","2011-03-03 00:00:00"]},{"id":"3063","cell":["Southern","LILAC ROAD","Georgia Forestry Commission","100","100","2011-03-01",null,null,null,null,null,null,null,null,null //etc

I need to pull that sql param text out of the JSON reply and hide it in a DIV for later. Is this possible?

A: The simplest way to send an additional information from the server to jqGrid is userdata (see this answer. If your JSON data will be like
{
    "page":"1",
    "total":28,
    "records":"685",
    "userdata":"SELECT * FROM fires ORDER BY id desc ",
    "rows":[
       ...
    ]
}

or
{
    "page":"1",
    "total":28,
    "records":"685",
    "userdata": {
        sql: "SELECT * FROM fires ORDER BY id desc "
    },
    "rows":[
       ...
    ]
}

The additional information will be saved inside of jqGrid and you can access of with $("#grid_id").jqGrid('getGridParam','userData').
Be careful in the case of userData. In the JSON data it must be userdata and in the getGridParam: 'userData'.


text:
Q: My Android Fragment code returns IllegalStateException, but only some times Occasionally IllegalStateException occurs in BottomNavigationView.
It's difficult to reproduce because it rarely happens.
Where is the mistake at my code?
Error always
fm.beginTransaction (). hide (active) .show (fragment1) .commit ();

It happens here
Fragment active = fragment1;

navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener()
{
    @Override
    public boolean onNavigationItemSelected(@NonNull MenuItem menuItem)
    {
        switch (menuItem.getItemId())
        {
            case R.id.timer:
                fm.beginTransaction().hide(active).show(fragment1).commit();    // Error location
                active = fragment1;
                break;

            case R.id.favorite:
                fm.beginTransaction().hide(active).commit();
                fm.beginTransaction().detach(fragment2).attach(fragment2).commit();
                fm.beginTransaction().show(fragment2).commit();

                active = fragment2;
                break;

            case R.id.calendar:
                fm.beginTransaction().hide(active).commit();
                fm.beginTransaction().detach(fragment3).attach(fragment3).commit();
                fm.beginTransaction().show(fragment3).commit();

                active = fragment3;

                break;
        }
        return true;

    }
});


text:
Q: Printing with two for loops I'm trying to print out X and Y coordinates from two separate arrays using two for loops. Each point is either decremented or incremented. The grid space is 500x500. I should basically end up with the output displaying a line of asterisks going either up or down. The arrays are populated correctly, and the X and Y coords are decremented or incremented correctly. I can't get it to work....
The populate board method fills the b1 array with the point's x member and the b2 array with the point's y member.
populateBoard(b1,b2,point);

    for (int i = 0; i < matrix.length; i++) {
        for (int j = 0; j < matrix.length; j++) {
            if(i == b2[i] && j == b1[j])
                System.out.print("*");
            else
                System.out.print(" ");
        }
        System.out.println();
    }

What is my logic error in the above code? Yet when I use this it works (only for one point obviously).
if(i == b2[0] && j == b1[0])

A: The logic in your above code is the assumption that in the i/j-th iteration of your double loop you'll be encountering a point whose x/y value happens to be exactly equal to i/j.
The working solution is as follows
private static void populateBoard(int[] xs, int[] ys, int w, int h)
{
    Set<Point> points = new HashSet<>();
    for(int i=0;i<xs.length;i++)
    {
        int x = xs[i];
        int y = ys[i];
        points.add(new Point(x,y));
    }
    for(int i=0;i<h;i++)
    {
        for(int j=0;j<w;j++)
        {
            Point p = new Point(j,i);
            if(points.contains(p))
                System.out.print("■");
            else
                System.out.print(".");
        }
        System.out.print("\n");
    }
}

When I run this code against a trivial example:
int[] xs = {1,4,1,4,1,2,3,4};
int[] ys = {1,1,3,3,4,4,4,4};

populateBoard(xs, ys, 6, 6);

it produces the following (correct) output:
......
.■..■.
......
.■..■.
.■■■■.
......

A: Try this.
boolean[][] temp = new boolean[matrix.length][matrix.length];
for (int i = 0; i < b1.length; ++i)
    temp[b2[i]][b1[i]] = true;
for (int i = 0; i < matrix.length; i++) {
    for (int j = 0; j < matrix.length; j++)
        System.out.print(temp[i][j] ? "*" : " ");
    System.out.println();
}


text:
Q: Sharepoint Search crawl not working Search Crawling is error out on my MOSS 2007 installation.
I get the following error for all the web apps I have following error in Crawl logs.
http://mysites.devserver
URL could not be resolved. The host may be unavailable, or the proxy settings are not configured correctly on the index server.
The Application Event log also has the following corresponding error
The start address http://mysites.devserver cannot be crawled.
Context: Application 'SSPMain', Catalog 'Portal_Content'
Details:
    The URL of the item could not be resolved. The repository might be unavailable, or the crawler proxy settings are not configured. To configure the crawler proxy settings, use the Proxy and Timeout page in search administration.   (0x80041221)
I'm using Windows 2008 server. I tried accessing the site using the above mentioned url and its available.  I did the registry setting for loop back  issue found here http://support.microsoft.com/kb/896861  still not luck.
Any Ideas?

A: I had the exact same problem, you need to increase the connection timeout in the farm search administration screen, I change this on my VM from 60 seconds to 120 seconds and im now crawling content successfully.

A: Try some basic network tests from the server doing the crawl.  You need to try the following:

*

*nslookup the fqdn and the hostname

*ping the ip address returned from above

*browse to the URL

This is just in case it is something simple - if you have a network issue with the crawl server then you won't get any further.
Check for any errors under Central Admin > Application Management > Check Services Enabled on this Farm - that should highlight any issues with SSPs etc.
Also check your server application logs, and Sharepoint ULS logs (Codeplex has a great Sharepoint Solution for this - LogViewer)
Also - can you specify a little more about your environment:

*

*how many servers on farm? roles?

*any network load balancing going on?

A: Check that the farm level search settings aren't set to use a proxy server, or if you need to use one, make sure the proxy server is correct.

A: This article might help to troubleshoot your issue..
http://kalashnikovtechnoblogs.blogspot.in/2012/02/troubleshooting-crawl-issues-for-ssl.html
Thanks,
Kalashnikov
http://kalashnikovtechnoblogs.blogspot.in
if it helps, Please dont forget to mark it as an answer. Thank you.

A: Or add your web app urls to server host files, that solved it for me.

A: Try telnet to the URL you are trying to crawl in your search service application. If it does not work. That is the issue.
IF you are able to telnet you will be able to crawl it.
Solution:
Work with DNS team to make sure you are able to access the URL from search service
OR put host entry in the host file of search server and point to WFE and in the WFE go to firewall and add the PORT for web application to allow inbound communication.

A: This is a tricky one as it depends on how your SP server was config. In my case, I have to do:

*

*Check if my Web Application was extended. If not, you have to extend the web application via AAE. Default is used by search.

*Then you have to set the registry key in:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa/MSV1_0 and create the entry BackConnectionHistNames. The SharePoint AAE sites should be added there.

*In case of need it, check the host file in etc.

*Then, start the crawl. It should be working fine after this.


text:
Q: Why are the vote count boxes different sizes for some posts in the search results? When performing a search on Stack Overflow, I noticed that some posts are displayed with large vote count boxes next to them, and some are displayed with small vote count boxes.
For example: https://stackoverflow.com/search?q=user%3A508666
I don't see why this is happening. What is the difference between the two posts?

A: Because some of them are questions and some of them are answers.
The questions display larger vote count boxes, because they have to display the total number of votes on the question itself, as well as the total number of answers that have been posted.
The answers only need to display the number of votes that the answer has received, so the box can be made smaller.


text:
Q: Work done by force applied for an instant We know ${\rm work} = \int F \cdot dl$ , where $dl$ is the displacement of point of application of force.
Suppose I apply an instant force of $100~\rm N$ on a body and then remove the force; after that the body moves a distance $d$. When the body is moving there is no external force (other than friction, $mg$, normal reaction force). So what is the work done by $100~\rm N$ force?
Is is zero? Because when the body moved distance $d$, the $100~\rm N$ force was not there.

A: $d=0$ in your example, because the work is zero and so the kinetic energy of the body is zero. A finite force applied for an instant doesn't do any work.

A: The work done by the force would be F*d, where d is the distance it travels WHILE the force is still being applied. The work done by the force provides the block some kinetic energy, i.e its velocity. Since the block is coming to a halt, friction or other drag forces must be acting on the body. The work done by these drag forces dissipates the kinetic energy of the block in form oh heat/sound and bring it to a halt.

A: Work done =  Force being applied on the body * displacement is travels while is the force is still present on the body.
Therefore , Force applied when removed after certain moment becomes 0 on the body. We won't consider the displacement it travels because that is not the distance it travelled while the force was present on the body.
Therefore , W = 0 but we can also say that work done would be wrong to calculate for such a moment which can be said as not defined.


text:
Q: Explain if any memory leak associated with oleaut32!APP_DATA::AllocCachedMem and ntdll!RtlAllocateHeap in windbg stack trace which appears repeatedly I am trying to identify memory leak in a process(C++ Application)
I am using Windbg tool to identify the memory leak.
0:000> !heap -stat -h 02e10000
 heap @ 02e10000
group-by: TOTSIZE max-display: 20
    size     #blocks     total     ( %) (percent of total busy bytes)
    40 95857 - 25615c0  (60.70)
    953130 1 - 953130  (15.14)
    2040 16a - 2d9a80  (4.63)
0:000> !heap -flt s 40   -> filtered by size 40, as this is consuming 60%.

Below are the 2 most repeated call stacks I am seeing  with !heap -p -a <usrptr>, with busy.

0:000> !heap -p -a 0ad77748
    address 0ad77748 found in
    _HEAP @ 2e10000
      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
        0ad77730 000b 0000  [00]   0ad77748    00040 - (busy)
        76f9d483 ntdll!RtlpCallInterceptRoutine+0x00000026
        76f56ad7 ntdll!RtlAllocateHeap+0x00045e87
        74a5b356 combase!CRetailMalloc_Alloc+0x00000016
        748d5174 oleaut32!APP_DATA::AllocCachedMem+0x0000005f
        748d52cb oleaut32!SysAllocStringLen+0x0000005f
        739ebe9c vbscript!rtReplace+0x0000005b
        739ebe47 vbscript!VbsReplace+0x0000013a
        739d54c7 vbscript!StaticEntryPoint::Call+0x0000002f
        739d388f vbscript!CScriptRuntime::RunNoEH+0x0000267f
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739d388f vbscript!CScriptRuntime::RunNoEH+0x0000267f
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739d388f vbscript!CScriptRuntime::RunNoEH+0x0000267f
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739d3634 vbscript!CScriptRuntime::RunNoEH+0x000023d6
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739d3634 vbscript!CScriptRuntime::RunNoEH+0x000023d6
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739d3634 vbscript!CScriptRuntime::RunNoEH+0x000023d6
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739d3634 vbscript!CScriptRuntime::RunNoEH+0x000023d6
        739d5dce vbscript!CScriptRuntime::Run+0x000000c3
        739d5ceb vbscript!CScriptEntryPoint::Call+0x0000010b
        739fd7cb vbscript!CSession::Execute+0x0000013d
        739f76b2 vbscript!NameTbl::InvokeEx+0x00000794
        73a22191 vbscript!LocalsNameTbl::Invoke+0x00000061

0:000> !heap -p -a 0ad76eb0
    address 0ad76eb0 found in
    _HEAP @ 2e10000
      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
        0ad76e98 000b 0000  [00]   0ad76eb0    00040 - (busy)
          unknown!printable
        76f9d483 ntdll!RtlpCallInterceptRoutine+0x00000026
        76f56ad7 ntdll!RtlAllocateHeap+0x00045e87
        6eb6fe25 webio!WapCreateSession+0x00000025
        6eb702de webio!WapCreateSessionHandle+0x0000008d
        6eb70215 webio!WebCreateSession+0x00000025
        72870e35 winhttp!WinHttpSendRequest+0x000005d5
        8fc1245 qNQCiscoCM!NQAxlConnection::sendRequest+0x00000255
        8fc150e qNQCiscoCM!NQAxlConnection::processRequest+0x0000004e
        8fc6982 qNQCiscoCM!NQAxlCommand::execute+0x00000062
        8fb6e2c qNQCiscoCM!NQAxlUtil::getSessionHandle+0x000000ac
        8fe3227 qNQCiscoCM!NQAxlSessionMgr::createNewSessionObj+0x00000077
        8fe1236 qNQCiscoCM!AXLDispatchInterface::Invoke+0x00000396
        8fd941d qNQCiscoCM!AXLCombinedDataPoint::Collect+0x0000012d
        8fb6959 qNQCiscoCM!DataRecorder::CollectDataPoints+0x00000209
        8ff16a1 qNQCiscoCM!DCCollector::CollectNow+0x00000051
        8fe8a27 qNQCiscoCM!DCCollectorList::CollectNow+0x00000087
        8fe4ebc qNQCiscoCM!DCController::CollectNow+0x000000ac
        390031 SQLite3!sqlite3_vtab_config+0x00018d41

With the first call stack I don't have any idea to proceed further. Can someone explain, what is oleaut32!APP_DATA::AllocCachedMem, and why I am seeing this call stack multiple times.
With the second call stack, I looked NQAxlConnection::sendRequest function, which had one allocation, and proper de-allocation as well.
Not sure, why I am seeing this call stack as well. Below is the code for sendRequest
DWORD
NQAxlConnection::sendRequest()
{
    USES_CONVERSION;

    CW2A soapMsgStrConverted(m_soapMsgStr.c_str());
    std::string axlRequest = soapMsgStrConverted.m_psz;
    if (axlRequest.length() <= 0 ) {
        throw std::runtime_error("Empty request");
    }

    unsigned char *buffer = NULL;

    // figure out request length and allocate a buffer
    int requestLen = (int)axlRequest.length();
    buffer = new unsigned char[requestLen + 1];

    if (buffer == NULL) {
        // memory error
        throw std::runtime_error("Out of memory");
    }
    else {
        memset(buffer, '\0', requestLen+1);
    }

    strncpy((char*)buffer, axlRequest.c_str(), requestLen);
    buffer[requestLen] = '\0';

    // Improve AXL throttling coverage and prevent erroneous events
    // implement retry looping to better handle AXL throttle errors
    int retryCount = 0;
    const static int MAXRETRYCOUNT = 2;
    bool applyAXLthrottle = false;

    do {
        try {
            // set the security options based on the SSL flag
            this->setSecurityOptions();

            DWORD dwBytesWritten = (DWORD)m_HTTPHeader.length() + (DWORD)requestLen;
            // Send the request
            if (this->isSimCallManager()) {
                this->LogPrintf(L"Sent following request to %s:%d \n %s \n %s \n",
                this->getServerAddress().c_str(),
                this->getHTTPPort(),
                this->getHTTPHeader().c_str(),  // contains base64 uid&pwd show dont log it
                this->getSoapMessage().c_str());

            }
            else {
                this->LogPrintf(L"Sent following request to %s:%d \n\n%s \n",
                                this->getServerAddress().c_str(),
                                this->getHTTPPort(),
                                //this->getHTTPHeader().c_str(),  // contains base64 uid&pwd show dont log it
                                this->getSoapMessage().c_str());
            }

            BOOL bReturn = WinHttpSendRequest(m_hRequest,                     //  HINTERNET hRequest,
                                            m_HTTPHeader.c_str(),           // LPCWSTR pwszHeaders,
                                            (DWORD)m_HTTPHeader.length(),   // DWORD dwHeadersLength,
                                            (LPVOID)buffer,                 // LPVOID lpOptional,
                                            (DWORD)axlRequest.length(),     // DWORD dwOptionalLength,
                                            dwBytesWritten,                 // DWORD dwTotalLength,
                                            0);                             // DWORD_PTR dwContext
            if (!bReturn) {
                DWORD dwErr = GetLastError();
                this->LogPrintf(L"Send request to %s failed - last error: %d",
                this->getServerAddress().c_str(), dwErr);

                throw dwErr;

            }

            // receive the response ...
            bReturn = WinHttpReceiveResponse(m_hRequest,   //  HINTERNET hRequest,
                                                NULL);   //  reserved
            if (!bReturn) {
                DWORD dwErr = GetLastError();
                this->LogPrintf(L"Receive response from %s failed - last error: %d",
                                this->getServerAddress().c_str(), dwErr);
                throw dwErr;

            }

            // retrieve the status oode from the reponse
            this->retrieveStatusCode();

        }
        catch (...) {
            delete [] buffer;
            buffer = NULL;
            throw;
        }

        this->LogPrintf(L"NQAxlConnection::sendRequest Response Status Code: %i", this->getStatusCode());

        applyAXLthrottle = false;

        if (this->getStatusCode() == 500) {
            DWORD statusCode = this->retrieveStatusCode();

            // we need to check fault code!
            // note - status >= 500 is returned if the request is invalid and
            // sometimes will have fault code in the response
            // so look for a fault code and also return it
            std::wstring response;
            this->getResponse(response);
            std::wstring faultCode;
            std::wstring faultString;
            std::wstring detailCode;
            if ( this->responseHasFault(response, faultCode, faultString, detailCode)) {
                this->LogPrintf(L"NQAxlConnection::sendRequest fault code of %s", faultCode.c_str());
                if (faultCode.find(L"RateControl") != std::wstring::npos) {
                    applyAXLthrottle = true;
                    this->LogPrintf(L"NQAxlConnection::sendRequest AXL throttle; waiting 60 seconds");
                    retryCount++;
                    this->LogPrintf(L"NQAxlConnection::sendRequest retryCount: %i of %i", retryCount, MAXRETRYCOUNT);
                    Sleep(61100);
                    this->LogPrintf(L"NQAxlConnection::sendRequest AXL throttle; wait complete");
                }
            }
        }
    } while (applyAXLthrottle && (retryCount < MAXRETRYCOUNT));

    // free up the buffer
    delete [] buffer;
    buffer = NULL;

    return this->getStatusCode();
}

Can someone explain if there is any leak with these 2 call stacks, which I need to take care.


text:
Q: module 'pandas._typing' has no attribute 'FilePathOrBuffer' When trying to import a darts atribute using the line
from darts import TimeSeries, concatenate

i get the error message
AttributeError: module 'pandas._typing' has no attribute 'FilePathOrBuffer'

Is there a fix for this?
Versions of what I'm using:

*

*pandas 1.5.2

*Windows 10 64-bit, ver 21H2

*Python 3.9.13

*darts ver 0.16.0

A: Like yourself, running Windows 10 64-bit, using a sufficiently up to date copy of Python 3.9 (I'm using 3.9.13), if I do the following:
virtualenv test_env
testenv\Scripts\activate
pip install pandas
pip install darts

This installs a large number of dependencies for darts and takes several minutes to complete, without errors or warnings.
The installed version of pandas after this is 1.5.2 and the installed version of darts is 0.22.0. (it's unclear why yours would be 0.16.0)
I can then run the following using Python:
from darts import TimeSeries, concatenate

And I get no error message. The error you're reporting cannot be reproduced using current and up to date versions of the packages you mentioned.
Why exactly do you have a reliance upon darts version 0.16.0 specifically?


text:
Q: Custom web filter for specific controllers Help me please, or show other ways to resolve this problem.
@RestController
@RequestMapping("/users")
public class UserController {

    @RequestMapping("/login")
    public String logIn() {
        return "";
    }

    @RequestMapping("/getUserData")
    @FilterThisRequest
    public String getUserData(@PathVariable Long userId) {
        return user;
    }
}

And I have AuthFilter extends GenericFilterBean which makes a certain logic. How can I make that the filter execute only before methods which have @FilterThisRequest? Or there are better practices to resolve this problem?

A: Check FilterRegistrationBean reference guide at https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-embedded-container-servlets-filters-listeners-beans.
Make FilterRegistrationBean available to Spring via a @Configuration class, the below example will ensure that authFilter runs only for /getUserData. Note that it is URL (and not method) based filtering.
@Autowired AuthFilter authfilter;
....
....
@Bean
public FilterRegistrationBean authFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean(authfilter);
    registration.addUrlPatterns("/web-app-name/getUserData/");
    return registration;
}

A: I would suggest you for the Interceptor.
@Configuration
public class Config extends WebMvcConfigurerAdapter {

@Autowired
RequestInterceptor requestInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(requestInterceptor).addPathPatterns("/getUserData","/user");
    }

}

Interceptor -
@Component
public class RequestInterceptor extends HandlerInterceptorAdapter {

@Override
public boolean preHandle(HttpServletRequest request,
        HttpServletResponse response, Object object) throws Exception {
}

You can override Interceptor's prehandle and postHandle according to your need.


text:
Q: Why the length of a collection schema doesn't change after deleting the data in mongodb collection using mongoose? I have a schema called "Project" and when I delete its data in my app.js the length of the schema stay same.
I delete it in the following route:
router.get("/myprojects/:id/remove", function(req, res){
Project.findByIdAndRemove(req.params.id, function(err){
    if(err){
        console.log(err);
        }else{
      res.redirect("/myprojects");
    }
});

});
but when i get the length of the Project in another page, even after deleting everything, the length doesn't change.
<%= user.projects.length %>

P.S. I have deleted the whole schema in Mongo but the length still shows the same number!!

A: Better you try like below
router.get("/myprojects/:id/remove", function (req, res) {
    let Project = require('./path/to/Project.js');
    Project.remove({ "_id": req.params.id }).exec(function (err, RemoveStatus) {
        if (err) {
            console.log(err);
        } else {
            console.log("Remove Status---->", RemoveStatus);
            res.redirect("/myprojects");
        }
    });
});

It have always worked for me.


text:
Q: How can i take the remain of a modulo in python? I am trying to make a simple explanation of a public and private key algorithm. The encryption part is working fine, however the decryption part is a bit off. I only want the 29 that's a remain of modulo(2^7,33). this is what I have so far:
p= 3
q= 11
n = p*q
z = (p-1)*(q-1)
e = 7
d = (z + 1)/e
a= divmod(d*e,z)

PublicKey = (e,n)
PrivateKey = (d,n)

#Encrypt
message = 2
c = divmod(2**e,n)
print c

#Decrypt
decryption = divmod((c**2),n)
print decryption

The error is:
    Traceback (most recent call last):
    File "C:/Python27/rsa2.py", line 17, in <module>
    decryption = divmod((c**2),n)
    TypeError: unsupported operand type(s) for ** or pow(): 'tuple' and 'int'

A: your problem is at the end , at this line:
decryption = divmod((c**2),n)

remove the () around c variable


text:
Q: How do I disable a Config Element in jMeter from the command line I have a .jmx file that reads data from a CSV and feeds it into a thread loop to run a series of tasks that seed a working data set for tests that'll run later.
During tests, I disabled the CSV and inserted variables to stand for the data that'd come from the CSV. Now I want to have the option to do run the same .jmx from the command-line, but with the CSV Data Set Config element disabled and providing variables equivalent to a single-line CSV, without losing the option of running the same .jmx pointing to a muli-line CSV.
Is there a way to do that or should I use two different .jmx files (generating one from the other is trivial using, say, sed)?

A: *

*Instead of having 2 different .jmx files it's more reasonable to have another CSV file with 1 line of variables and parameterise the "Filename" value of the CSV Data Set Config using __P() function having the default value of the "big" multiline CSV file.

*JMeter .jmx files are normal XML files so you can change testname="CSV Data Set Config" enabled="true" to testname="CSV Data Set Config" enabled="false" using whatever approach you like

*And last but not the least, you can run your JMeter test using Taurus tool as a wrapper which has Modifications for Existing Scripts feature so you can disable the CSV Data Set Config as simple as:
---
execution:
  scenario:
    script: /path/to/your/test.jmx
    modifications:
      disable:
        - CSV Data Set Config

More information: Navigating your First Steps Using Taurus


text:
Q: Serializing an object with Newtonsoft? I am trying to serialize an object with Newtonsoft Json converter like this:
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using Newtonsoft.Json;

 string json = new Newtonsoft.Json.JsonConvert.SerializeObject(new
            {
                jlpt = "5"
            });

but it gives me an error saying that

SerializeObject does not exist.

However, when I click to check the reference I see it.
Can anyone point me to what I am doing wrong?

A: Remove new instance creation of Newtonsoft.Json.JsonConvert, because SerializeObject is a static method you don't need create a instance of the Newtonsoft.Json.JsonConvert to use it
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new
            {
                jlpt = "5"
            });

also if you add using Newtonsoft.Json; to the program then you simply use like this
string json = JsonConvert.SerializeObject(new
            {
                jlpt = "5"
            });


text:
Q: Find the inverse laplace (if there is one) I need to find if $F(s)$ can be a laplace transform of a continuous exponential function:
$$F(s)=\frac{s^3}{s^3+2s^2+s+1}$$
any ideas?

A: As Ian suggests, because of the equal polynomial orders in the numerator and the denominator, the inverse implicates the Dirac delta function. So the answer is no, F(s) is not a transform of a continuous exponential function.


text:
Q: Kernel of the ring homomorphism $\phi\colon\mathbb{C}[x, y, z]\to\mathbb{C}[t]$ defined by $\phi(x) = t$, $\phi(y) = t^2$, $\phi(z) = t^3$
Describe the kernel of the ring homomorphism $\phi\colon \mathbb{C}[x, y, z]\to \mathbb{C}[t]$ defined by $\phi(x) = t$, $\phi(y) = t^2$, $\phi(z) = t^3$.

Some hints?
I know $\ker\phi = \{ a \in\mathbb{C}[x, y, z] \mid \phi(a) = 0\}$ is closed under addition and multiplication. Also, it is an ideal of $\mathbb{C}[x, y, z]$.
Using egreg hint, I came up with
$\ker \phi$ ={$ (x^2 -y)r_1 + (xy-z)r_2 + (x^3-z)r_3 | r_1,r_2, r_3 \in\mathbb{C}[x, y, z] $} ? I am not sure if this is right.

A: Using twice the division algorithm we get
$$ f(x,y,z)=(x^3-z)g(x,y,z) + (x^2-y)h(x,y) + r(x). $$
If $f\in\ker\phi$ then $\phi(f)=0$, that is, $f(t,t^2,t^3)=0$ and thus $r(t)=0$. Since $r=0$ we get $f\in(x^3-z,x^2-y)$, therefore $\ker\phi\subseteq(x^3-z,x^2-y)$. (The other inclusion is trivial.)


text:
Q: Python script to add a header to an email on an imap server I want to write a python small script to tag my emails in a way that does not depend on a mail client. My idea is to add a custom header X-TAG: ... to the email. Also I want to use this with popfile.
My mails are stored on an imap server. So I am looking for a script which would take a message uid, use imaplib to retrieve the message, convert it somehow to something the email lib understands, add the custom header (about the only thing I know how to do), and then use imaplib again to store it back to the imap server.
Does this work? And does anyone know of a script that does it?
(I have read the related question add a custom RFC822 header via IMAP?) but it refers to procmail which I don't use.
PS: I want to use the same approach to permanently decrypt emails later, hence the very general approach using python.


text:
Q: Can't figure out why the font for my logo isn't working I'm trying to figure out why the font for my logo isn't downloading for other people. The font is called Aerokids.
The code in my CSS works fine for the other font type I have on my site. It's just the logo that's not working, even though it's done the same way. Does anyone have any ideas what might be wrong? Here is a screenshot of the fonts I have in the subfolder for my site:

Here is the GitHub URL for the site I'm working on.
@font-face {
  font-family: 'Aerokids';
  src: url('fonts/Aerokids.otf');
  font-weight: normal;
  font-style: normal;

  font-family: 'odudo-semibold';
  src: url('../fonts/odudo-semi-bold.eot');
  src: url('../fonts/odudo-semi-bold.eot?#iefix') format('embedded-
  opentype'),
  url('../fonts/odudo-semi-bold.woff2') format('woff2'),
  url('../fonts/odudo-semi-bold.woff') format('woff'),
  url('../fonts/odudo-semi-bold.ttf') format('truetype'),
  url('../fonts/odudo-semi-bold.svg#youworkforthem') format('svg');
  font-weight: normal;
  font-style: normal;
}

.logo {
    font-family: 'Aerokids';
    font-weight: normal;
    color: #00E8FF;
    font-size: 2.5em;
    float: left;
    width: 30%;
    display: inline-block;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    margin: 0 auto;
}

A: You need to separate the two @font-face rules.
@font-face {
  font-family: 'Aerokids';
  src: url('fonts/Aerokids.otf');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'odudo-semibold';
  src: url('../fonts/odudo-semi-bold.eot');
  src: url('../fonts/odudo-semi-bold.eot?#iefix') format('embedded-
  opentype'),
  url('../fonts/odudo-semi-bold.woff2') format('woff2'),
  url('../fonts/odudo-semi-bold.woff') format('woff'),
  url('../fonts/odudo-semi-bold.ttf') format('truetype'),
  url('../fonts/odudo-semi-bold.svg#youworkforthem') format('svg');
  font-weight: normal;
  font-style: normal;
}


text:
Q: Show Navigation drawer in every activity - android studio I have a problem...I am developing an app in android studio.In the meantime,there is already a navigation drawer in it.But the problem is, it only appears in the home screen.When it goes to another screen, the navigation drawer is not shown. I am new to android studio but i know some of Java languages.Can anyone help me with providing anything that would help me make the navigation drawer show in all of slides and pages in my app.

A: from docs
Navigation Drawer

The navigation drawer is a panel that displays the app's main
  navigation options on the left edge of the screen. It is hidden most
  of the time, but is revealed when the user swipes a finger from the
  left edge of the screen or, while at the top level of the app, the
  user touches the app icon in the action bar.

for achieve what you asked you have to use Fragments

Fragment represents a behavior or a portion of user interface in an
  Activity. You can combine multiple fragments in a single activity to
  build a multi-pane UI and reuse a fragment in multiple activities. You
  can think of a fragment as a modular section of an activity, which has
  its own lifecycle, receives its own input events, and which you can
  add or remove while the activity is running (sort of like a "sub
  activity" that you can reuse in different activities).

see this examples for more details
1. Navigation Drawer - android hive
2. Navigation Drawer exp 2
3. Navigation Drawer exp 3
Refer this answer also
Answer

A: You have to add fragments in that activity where the navigation drawer exist. Whenver the user will click on the option in the navigation drawer the view should be changed by replacing with the required fragment.So by using the fragments user will stay on the same activity but just the views will be changed in that activity. you can refer to the fragments documentation provided by android developers. https://developer.android.com/guide/components/fragments.html


text:
Q: What am i missing with this formula can you help to expand it? Morning All,
Ive been working a on a spreadsheet and it came back with some requests to refine and simplify it, as such iv come up with a new solution but the below formula i cant for the life of me figure out why its bringing back the #Value Error.
=IF(L6="YES",K6+7,IF(L6,"-",""))

In a nut shell i want this formula to do the following,
IF L6 is Yes then calculate K6+7 If L6 is blank then leave it blank and dont calculate
Firstly am i on the right lines here and if so what on earth am i missing? Im still getting my excel knowledge up at the moment so bear with me.
Thanks in advance.

A: You are missing an = in the second IF formula:
=IF(L6="YES",K6+7,IF(L6="",""))

A: Your formula should look like this
=IF(L6="YES",K6+7,IF(isblank(L6),,"-"))

The value error was due to the fact a blank cell is considered as false by default but a cell with text cannot be converted to a boolean value.


text:
Q: Angular: control / override the index of NgFor I have this ngIf:

      {{ i+1 }}

...

the i is affected by the parent div with *ngFor for walk through the items.
My question is, how can I stop the increment of the i in some conditions? for example to tell the attached function if something is true to keep the i count as is?
Or just another idea how to control the increment of the i?

A: You can't change incrementation it's by default.  Although you can call function from controller and modify display value if you need.


text:
Q: Spock framework: how can I automatically reset object state after spec is completed I've got Spring service A which internally uses service B.
I want:

*

*Mock service B

*Set mocked version into service A

*Test service A behavior

*Set previous version of service B to service A (reset state)

The problem is last step - I can remember B at setup and set it in cleanup stages. But can I configure to do it automatically (something similar to @ConfineMetaClassChanges)

A: This isn't supported out-of-the-box, but it could be implemented as a JUnit rule or Spock extension. (@ConfineMetaClassChanges is a Spock extension.)


text:
Q: How to change Property of Selected View I need to make some changes in Label or StackLayout. I want after clicking on item, change textcolor or backgroundcolor for example. After i click at Bought in Context Menu, it gives me: Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
Here is XAML code:
<ContentPage.Content>
    <StackLayout>
        <ListView x:Name="productsList" ItemsSource="{Binding}" ItemSelected="OnItemSelected">
            <ListView.ItemTemplate>
                <DataTemplate >
                    <ViewCell>
                        <ViewCell.View>
                            <StackLayout Orientation="Horizontal">

                                <Label  x:Name="{Binding ProdListId}" Text="{Binding Name}" FontSize="Medium"/>

                            </StackLayout>
                        </ViewCell.View>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <Button Text="ADD" Clicked="AddProducts"/>
    </StackLayout>
</ContentPage.Content>

C#:
    protected override void OnAppearing()
    {
        productsList.ItemsSource = App.Database.GetProductListItems(ListID);
        base.OnAppearing();
    }

    private async void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
    {
        var action = await DisplayActionSheet("Choose action", "Cancel", null, "Delete", "Bought");
        switch (action)
        {
            case "Delete":
                Product selectedProduct = (Product)e.SelectedItem;
                App.Database.DeleteProductOfListItem(selectedProduct.ProdListId);
                // this.Navigation.PopAsync();
                OnAppearing();
                break;

            case "Bought":
                Product selectedProduct2 = (Product)e.SelectedItem;
                App.Database.UpdateProductActive(true, selectedProduct2.ProdListId);
             var lbl = this.FindByName<Label>(selectedProduct2.ProdListId.ToString());
                lbl.TextColor = Color.Green;
                break;

        }
    }


text:
Q: Haskell - response code of simpleHTTP method I've written the following Haskell code to download the CSV file (daliy prices) available on yahoo finance web site . In the last part of the code, there's a case statement. I would like to know when actually "rcode" contains the "Left" value. I've mentioned three cases, but all of them refer to "Right" values. I may be wrong. I'm referring to the HTTP response codes available on the following web site.
downloadCSVFile ::String-> IO (Bool,String)
downloadCSVFile company_code=do
                             let a="http://ichart.finance.yahoo.com/table.csv?s=" ++ company_code
                             let b=simpleHTTP $  getRequest a
                             src <- ( b >>= getResponseBody)
                             rcode <- fmap rspCode <$> b
                             case rcode of
                                     Right (2,_,_) -> return (True,src)
                                     Right (4,_,_) -> return  (False,"Invalid URL..")
                                     Right (5,_,_) -> return  (False, "Server Error")

https://support.google.com/webmasters/answer/40132?hl=en

A: The Result a type that gets threaded around is an alias for Either ConnError a.
You'll get a Left value if the HTTP client library had some actual problem when connecting to the server. If it successfully connected to the server and received a HTTP response code from the server, that will always be a Right value.
See the Network.HTTP documentation for more details.
To handle the error cases, do something like this:
case rcode of
    Left err      -> return (False, "Connection error: " ++ show err)
    Right (2,_,_) -> return (True,src)
    Right (4,_,_) -> return  (False,"Invalid URL..")
    Right (5,_,_) -> return  (False, "Server Error")
    Right code    -> return  (False, "Unexpected code: " ++ show code)

I also added a "catch-all" case in case you get an unexpected response from the server.


text:
Q: What pattern to use in paper-input to decimal number? I would like a pattern for decimal number in paper-input for following outpus:
 111.111,11 >>> true
 111,11 >>> true
 0,11 >>> true

I am using the following pattern:
"^([0-9]{1,3}\.)?[0-9]{1,3}\,[0-9]{2}$?"

in the code:
<paper-input type="number" pattern="^([0-9]{1,3}\.)?[0-9]{1,3}\,[0-9]{2}$?" auto-validate error-message="Não é um número válido!" label="Faturamento Anual" value="{{parametro.faturamentoAnual}}"><div prefix>R$</div></paper-input>

But when I type 0,11 and return false with the error-message.
Is there a different pattern to decimal number in paper-input that works?

A: The ? at the end of your regex doesn't make sense to me.
I tried it without the ? and it worked fine.
I also had to remove type=number to be able to enter anything at all.
A plain <input type="number"> doesn't allow , or . as well.


text:
Q: How to solve this integral using the method of residues? Using the method of residues, verify the following.
$$\int_0^{\pi} \frac{d \theta}{(3+2cos \theta)^2} = \frac{3 \pi \sqrt{5}}{25}$$
I tried doing this but can't get the correct answer, here is my attempt:
first I substituted $cos \theta = \frac{z+ \frac{1}{z}}{2}$ and $d \theta = \frac{dz}{iz}$ and got $\int_0^{\pi} \frac{dz}{iz(3+z+\frac{1}{z})^2}$
then I multiplied top and bottom my $iz$ so that the $i$ moves to the top and on the bottom I'll have $z^2$ so I can distribute it into the rest of it and get $-i \int_0^{\pi} \frac{zdz}{(3z+z^2+1)^2}$
the denominator has two zeroes at $-\frac{3}{2} \pm \sqrt{\frac{5}{4}}$, since the denominator is squared the function has poles here of order two.
The I used Cauchy's Residue theorem but first I needed to find the residue at $-\frac{3}{2} + \sqrt{\frac{5}{4}}$ because only this pole is inside the unit circle.
I found the residue using theorem 1 on pdf page 324/579 from this textbook
http://english-c.tongji.edu.cn/_SiteConf/files/2014/05/05/file_53676237d7159.pdf
After finding the residue using that formula and applying cauchy's residue theorem I do not get an answer close to $\frac{3 \pi \sqrt{5}}{25}$
I am not sure how to handle the fact that the integral is from $0$ to $\pi$ rather then from $0$ to $2\pi$, and I am not sure if I made any mistakes when finding the poles and residues.

A: By the substitution $\theta=2\varphi$ and the cosine duplication formula we have
$$ I = \int_{0}^{\pi}\frac{d\theta}{(3+2\cos\theta)^2} = 2\int_{0}^{\pi/2}\frac{d\varphi}{(1+4\cos^2\varphi)^2} \tag{1}$$
and by the substitution $\varphi=\arctan t$ the problem boils down to evaluating
$$ 2\int_{0}^{+\infty}\frac{(1+t^2)}{(5+t^2)^2}\,dt = \int_{-\infty}^{+\infty}\frac{(1+t^2)}{(5+t^2)^2}\,dt.\tag{2}$$
The meromorphic function $f(t)=\frac{(1+t^2)}{(5+t^2)^2}$ has a double pole at $t=\pm i\sqrt{5}$ and behaves like $\frac{1}{t^2}$ for $|t|\to +\infty$. By the residue theorem it follows that:
$$ I = 2\pi i\,\text{Res}(f(t),t=i\sqrt{5}) =2\pi i\lim_{t\to i\sqrt{5}}\frac{d}{dt}\frac{(1+t^2)}{(t+i\sqrt{5})^2}=\color{red}{\frac{3\pi}{5\sqrt{5}}}\tag{3}$$
as wanted, after a straightforward computation.

There also is a simple geometric approach. $\rho(\theta)=\frac{p}{1+\varepsilon\cos\theta}$ is the polar equation of an ellipse with respect to a focus. Since the area in polar coordinates is given by $\frac{1}{2}\int_{0}^{2\pi}\rho(\theta)^2\,d\theta$, $I$ just depends on the area of an ellipse ($\pi ab $) with a given eccentricity and a given semi-latus rectum. This proves the more general
$$ \int_{0}^{\pi}\frac{d\theta}{(u+v\cos\theta)^2} = \frac{\pi u}{\left(u^2-v^2\right)^{3/2}} \tag{4}$$
as soon as $0<v<u$.

A: Note
$$\int_0^{\pi} \frac{d \theta}{(3+2\cos \theta)^2} = \frac12\int_0^{2\pi} \frac{d \theta}{(3+2\cos \theta)^2}.$$
Let $z=e^{i\theta}$ and hence one has
\begin{eqnarray}
&&\int_0^{\pi} \frac{d \theta}{(3+2\cos \theta)^2}\\
&=&\frac12\int_0^{2\pi} \frac{d \theta}{(3+2\cos \theta)^2}\\
&=&\frac12\int_{|z|=1}\frac{1}{(3+z+z^{-1})^2}\frac{dz}{iz}\\
&=&\frac1{2i}\int_{|z|=1}\frac{z}{(z^2+3z+1)^2}dz\\
&=&\pi\text{Res}(f(z),z=\frac{1}{2}(-3+\sqrt5))\\
&=& \frac{3 \pi \sqrt{5}}{25}
\end{eqnarray}
where $f(z)=\frac{z}{(z^2+3z+1)^2}$ has only one pole $z=\frac{1}{2}(-3+\sqrt5)$ inside $|z|=1$.


text:
Q: Is there a way to formally describe the (complex) transformation $z\rightarrow\frac{1}{z}$ The transformation $z\rightarrow\frac{1}{z}$ does what I can only (over $\mathbb{C}\backslash\{0\}$ of course) describe as "turning space inside out" (then reflecting it in the real axis)
This doesn't seem like a very good way of explaining it, I can barely describe the idea of a plane being turned inside out if it has a tiny hole in the middle.
I'm sorry this is a bit of a null question, I can appreciate the transform but describing it as "turning space inside out" doesn't unambiguously convey what I mean.

A: *

*We can reflect a line around a point: $x\mapsto -x$.

*The same can be done multiplicatively on half-line $(0,\infty)$: namely, $x\mapsto 1/x$. This is harder to visualize, but still possible: one can draw the graph of $1/x$, for example.

*The transformation in 2 can be carried  out on every half-line emanating from the origin. This is the map $z\mapsto 1/\bar z$, a.k.a inversion in the unit circle.

*The map $z\mapsto 1/z$ is the inversion followed by reflection in the real axis.


text:
Q: Jquery all ajax calls not picking relative url - ASP.NET MVC

$(document).ready(function () {
    getDefaultPDF();
    loadPDF();
});

function loadPDF() {
    $('#reportsDiv').load("/Review/DisplayPdfPartial");
}

Our site is hosted under the Default website, within a folder. So the url should be
http://servername/foldername/Review/DisplayPdfPartial
but the following code tries to fetch
http://servername/Review/DisplayPdfPartial - doesn't add the foldername and fails obviously.
This doesn't happen on local, only when deployed under default website.
What am I missing?

A: As you have mentioned you are using Asp.Net MVC then in that case instead of specifying url's this way, a more efficient way is to use @Url.Action() helper method as shown :-
$(document).ready(function () {
    getDefaultPDF();
    loadPDF();
});

function loadPDF() {
    //$('#reportsDiv').load("/Review/DisplayPdfPartial");
    $('#reportsDiv').load('@Url.Action("DisplayPdfPartial","Review")');
}

A: You can use ResolveClientUrl

A fully qualified URL to the specified resource suitable for use on
  the browser.
Use the ResolveClientUrl method to return a URL string suitable for
  use by the client to access resources on the Web server, such as image
  files, links to additional pages, and so on

.


text:
Q: Java error: Could not find or load main class - Netbeans IDE So I was making a java program in Netbeans IDE 8.2 and when I tried to run it, I got this error:
Error: Could not find or load main class helloworld.HelloWorld
C:\Users\name\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 1 second)

(Assume that helloworld is my project name and HelloWorld is my class name)
Everything was fine before, and I can't think of what I did that would cause this error to happen. This is the first time this error has happened to me so I don't know what to do. The code doesn't seem to have any errors.
Other projects of mine seemed to also have the exact same problem even though I haven't opened or edited them in weeks prior to this error occurring.
I tried many other ways but none of them seems to do the trick. Including deleting the cache folder and setting the main class through the properties tab.
Here's a screenshot of my code with the error, my name is crossed out:

Even if I type my code directly in the main class, which is class6homework.java, the error still occurs but it says class6homework.class6homework instead of the one in the screenshot.
Any ideas on how I could fix this?
UPDATE: I got it to work by moving the folder that contains the project to my desktop, didn't know why it wouldn't work in my original location. Thanks for the help.

A: Perhaps you don't have the main method included. If that is not the problem, try right clicking your class in the project tree and look for an option that says "Set as main class" or something like that

A: Possible Fixes:
Fix 1

*

*Go to project properties (right click on the folder of your project in netbeans)

*On left tab where it shows the categories, click on the "Run" selection

*Then click on Browse to find the Main class you use on your project

Fix 2

*

*Go to C:\Users\name\AppData\Local\Netbeans

*delete the Cache folder.

*Rebuild and Run

Fix 3
Download most recent version of Netbeans
Fix 4
Download most recent version of JDK and configure Netbeans to use that


text:
Q: Does the PS4 Pro have any features that the PS5 doesn't? I've been considering getting a PS5 for a while now.  I currently have a PS4 Pro; if I end up getting a PS5, is there any reason to keep the PS4 Pro? Are there any features it includes which the PS5 doesn't?

A: There are a few games that Sony has marked  for various reasons as "Only Playable on PS4". These games show up in the PS5 library but are unplayable. (The most infamous of these is the P.T. demo).
If you don't have any of those, I'm unaware of any feature reasons to keep the PS4 Pro.

PS4-only games

*

*Afro Samurai 2 Revenge of Kuma Volume One

*Just Deal With It!

*Robinson: The Journey

*We Sing

*Hitman Go: Definitive Edition

*Shadwen

This list is subject to change and excludes demos, media, and non-game
applications.


text:
Q: Condescension is much appreciated [meaning] We have following dialog from the movie Inception (2010):

Arthur: Eames, I am impressed.
Eames: Your condescension, as always,
  is much appreciated, Arthur, thank you.

I can't get the point of what Eames said. Of course, I was trying to find condescension and appreciated in a dictionary.
So, there is the only one possible meaning for condescension. Now, I assume that appreciated means to recognize how good someone or something is and to value him, her, or it. But when I tried to couple these meanings I've found it perfectly nonsensical. Did Eames recognize that Arthur is good? ... Or what? What's that got to do with Artur telling Eames that he's impressed?

A: It's hard to be completely sure without more context, but I strongly suspect that Eames' answer is intended as sarcasm.
That means that meaning of the sentence as a whole is the exact opposite of the literal meaning of the words used - in this case, it would be something like "That comment was condescending, and I don't appreciate it."
'Condescension' carries fairly strong negative overtones - not just 'I think I'm better than you', but 'I think I'm better than you because you're stupid/incompetent/etc'. If Eames really did appreciate Arthur's behaviour, I would expect him to choose a different word to describe it; in this case, possibly 'Your praise is much appreciated.'
The use of that negative term, and the addition of the unnecessary phrases 'as always' and 'thank you' to the sentence, all point to the intended meaning being something more complex than just a straightforward 'I appreciate that'-type comment.
In addition, this general construction is a common response to percieved insults in English - especially to insults with a condescending tone. Sarcasm (and double-meanings in general) are often considered to be more sophisticated use of language than a straightforward say-what-you-mean response. Making a sarcastic response to a percieved insult is therefore both to show that the insult was recognised (and not appreciated) and also a signal that the speaker can use advanced language skills (and therefore an attempt to raise their own status in response to the condescension).

A:
Your condescension, as always, is much appreciated, Arthur, thank you.

appreciate means to recognize or be thankful for.
condescension means a patronizing behavior.
Regarding patronize, see patronize sense 2, "to be kind or helpful to, but in a haughty or snobbish way, as if dealing with an inferior".
So you could rewrite your example:

Your patronizing behavior, as always, is really recognized/understood, Arthur, thank you.

A: You have two somewhat conflicting answers already:

*

*Wichita Steve, understanding condescension in its original sense, says that Eames acknowledges Arthur's "courtesy" in praising an inferior.

*user3169, echoed by Toby Yuretich, understands condescension in its usual modern sense and says that Eames pointedly rebukes Arthur's "patronizing behavior".
I think both of these readings are true and pertinent.
Arthur and Eames have in fact the sort of friendly rivalry in which each regards himself as the other's superior in some respects but values the other's superiority in other respects. This relationship is sustained by adopting a teasing tone toward each other, in which genuine regard is disguised as apparent mockery.
So Eames' response actually operates on two levels. On the overt level, Eames' use of condescension subverts his appreciation and transforms it into irony: he dismisses  Arthur's compliment as patronizing. But on the covert level, both Arthur's "condescension" and Eames' rejection are part of the 'game' they play; in fact, both Arthur's compliment and Eames' appreciation are genuine.

A: http://en.wiktionary.org/wiki/condescension
voluntary descent from one's rank or dignity in intercourse with an inferior; courtesy toward inferiors.
Arthur considers himself the superior to Eames.  For Arthur to say to Eames that he is impressed is a great compliment.  Eames acknowledges the courtesy and he also expresses that he realizes Arthur does not normally give such compliments to the lower rank such as himself.
There may also be some sarcasm to Eames statement.  Eames can also be implying that he isn't so inferior as Arthur might think.


text:
Q: com.facebook.react.common.JavascriptException: Requiring unknown module "./locale/ID"., I just released an apk that was made using the native framework.
The application runs nominally but there are some errors in the features that make it forced to close.
I tried to debug the error of using an android studio logcat and I found this exception:
2019-03-12 16:08:36.163 28143-28185/? E/ReactNativeJS: Requiring unknown module "./locale/ID".
2019-03-12 16:08:36.172 28143-28185/? E/ReactNativeJS: Requiring unknown module "./locale/id".
2019-03-12 16:08:36.183 28143-28186/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.awesomeproject, PID: 28143
com.facebook.react.common.JavascriptException: Requiring unknown module "./locale/ID"., stack:
d@2:595
n@2:339
t@2:262
pt@914:16946
kt@914:17972
wt@914:17035
value@928:2775
f@41:42083
beginWork@41:45676
o@41:64674
a@41:65053
T@41:68561
y@41:67997
v@41:67834
batchedUpdates@41:72172
Ie@41:14848
ze@41:15343
receiveTouches@41:16180
value@18:3582
<unknown>@18:1067
value@18:3009
value@18:1039

    at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
    at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:754)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
    at android.os.Looper.loop(Looper.java:163)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
    at java.lang.Thread.run(Thread.java:760)

Are there any suggestions?

A: solved, I have imported import Moment from 'moment'; but I tried to change the Indonesian time zone, like this Moment.locale ('ID'); and I tried removing the code and releasing it again.


text:
Q: What is the best way to make the data as stationary & inverse transform in time series - Python I did the 1st differencing as the time series is not stationary.
When I do the invert transformation, some values are coming as negative as we get negative values due to diff(). Is there a way to sort it out and bring back the data in original format as close to the expected result.
This is my python code. Is there a way to fix the code or any alternate logic to make the data as stationary and forecasting the series?
count = 0

def invert_transformation(df_train, df_forecast):
    """Revert back the differencing to get the forecast to original scale."""
    df_fc = df_forecast.copy()
    columns = df_train.columns
    if count > 0:      # For 1st differencing
        print("Enter into invert transformation")
        for col in columns:
            df_fc[str(col)+'_f'] = df_train[col].iloc[-1] + df_fc[str(col)+'_f'].cumsum()
        print("df_fc: \n", df_fc)
        return df_fc

# Since the data is not stationary, I did the 1st difference
df_differenced = df_train.diff().dropna()
count = count + 1 #increase the count
count

....
....
model = VAR(df_differenced)
....
fc = model_fitted.forecast(y=forecast_input, steps=10)

df_forecast2 = pd.DataFrame(fc, index=df2.index[-nobs:], columns=df2.columns + '_f')

df_results = invert_transformation(df_train, df_forecast2)

value of df_results(TS is the index column) are:
TS       Field1_f        Field2_f
44:13.0  6.826511e+05    1.198614e+06
44:14.0  -8.620101e+05   4.694556e+05
..
..
44:22.0  -1.401620e+07   -2.092826e+06

Value of df_differenced are:
TS      Field1      Field2
43:34.0 187000.0    29000.0
43:35.0 175000.0    76722.0
43:36.0 -10000.0    31000.0
43:37.0 90000.0     42000.0
43:38.0 -130000.0   -42000.0
43:39.0 40000.0     -98444.0
..
..
44:11.0 -130000.0   40722.0
44:12.0 117000.0    -42444.0


text:
Q: User Login with Wrong Credintials in Flutter/Laravel API I develop Flutter app with Laravel backend when I test logon through Postman it works well and I receive tokens and when I give wrong username or password it gives me error.
Here is the Login function:
login(String email, String password) async{
var url = '$serverUrl/login';
final response = await http.post(url,
    headers: {
      'Accept':'application/json'
    },
    body: {
      "email":"$email",
      "password":"$password"
    }
);

status = response.body.contains('error');

var data = json.decode(response.body);
if(status){
  print('data : ${data["error"]}');
}else{
  print('data : ${data["token"]}');
  _save(data["token"]);
}
}

But when I build the Flutter app it allows Login with wrong usernames or password and navigate to Dashboard screen.
This is Login page code
    class LoginPageState extends State<LoginPage>{

  DataBaseHelper dataBaseHelper = new DataBaseHelper();

  String msgStatus;

  final TextEditingController _emailController = new TextEditingController();
  final TextEditingController _passwordController = new TextEditingController();

  _onPressed(){
    setState(() {
      if(_emailController.text.trim().toLowerCase().isNotEmpty &&
      _passwordController.text.trim().isNotEmpty){
        dataBaseHelper.login(_emailController.text.trim().toLowerCase(),
            _passwordController.text.trim()).whenComplete((){
          if(dataBaseHelper.status){
            _showDialog();
            msgStatus = 'Check email or password';
            debugPrint("${_emailController.text.trim().toLowerCase()}  ${_passwordController.text.trim()}" );
          }else{
            Navigator.pushReplacementNamed(context, '/dashboard');
        }
        });
      }
    });
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      title: 'login',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Login'),
        ),
        body: Container(),
      ),
    );
  }

  void _showDialog(){
    showDialog(
        context:context,
        builder : (BuildContext context){
          return AlertDialog(
            title: Text('Failed'),
            content: Text('Check your email or password'),
            actions: [
              RaisedButton(
                onPressed: (){
                  Navigator.of(context).pop();
                },
                child: Text('Close',
                ),
              ),
            ],
          );
        });
  }
}

Laravel side:
class APILoginController extends Controller
{
    //
    public function login(Request $request){
        $validator = Validator::make($request -> all(),[
            'email' => 'required|string|email|max:255',
            'password' =>'required'
        ]);
    if($validator->fails()){
        return response()->json($validator->errors());
    }

    $credentials = $request->only('email', 'password');
    try {
        if(! $token = JWTAuth::attempt($credentials)
        ){
            return response()->json(['error'=>'invalid username or password'], [401]);
        }
    } catch (JWTException $e) {
        //throw $th;
        return response()->json(['error'=>'could not create token'], [500]);
    }

    return response()->json(compact('token'));

}

}


text:
Q: NPM multiple install errors When I try to install npm the console gives the following errors & warnings:

npm WARN checkPermissions Missing write access to C:\Users\Aristophanes\node_modules\web3
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@1.9.0 requires a peer of eslint@>=1.6.0 <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jsx-a11y@5.1.1 requires a peer of eslint@^2.10.2 || ^3 || ^4 but none is installed. You must install peer dependencies yourself.
npm WARN firebase-functions@2.1.0 requires a peer of firebase-admin@~6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path C:\Users\Aristophanes\node_modules\web3
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\Aristophanes\node_modules\web3'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Aristophanes\AppData\Roaming\npm-cache\_logs\2018-11-02T23_13_12_948Z-debug.log

Does anyone know how I can fix this? Thank you.

A: Try removing the web3 folder in C:\Users\Aristophanes\node_modules\web3, as well as the node_modules folder in your project directory (if exists). Hope it will help you :)

A: There are 2 solutions for this.
**1. Reinstall npm with a Node version manager (recommended).**

This is the best way to avoid permissions issues. For more information, refer this link
(https://docs.npmjs.com/getting-started/installing-node#using-a-version-manager-to-install-nodejs-and-npm)
 You do not need to remove your current version of npm or Node.js before installing a Node version manager.
**2. Change npm's default directory manually.**

If you're not using windows you can use below steps.
To minimize the chance of permissions errors, you can configure npm to use a different directory. In this example, it will be a hidden directory on your home folder.

Back-up your computer before you start.

Make a directory for global installations:

mkdir ~/.npm-global
Configure npm to use the new directory path:

npm config set prefix '~/.npm-global'
Open or create a ~/.profile file and add this line:

export PATH=~/.npm-global/bin:$PATH
Back on the command line, update your system variables:

source ~/.profile
Test: Download a package globally without using sudo.
npm install -g jshint
Instead of steps 2-4, you can use the corresponding ENV variable (e.g. if you don't want to modify ~/.profile):
 NPM_CONFIG_PREFIX=~/.npm-global


text:
Q: IBAForms: how to create a IBATextFormField which is not editable? I am using IBAForms to collection user input, there is a case where some of the fields are editable and others are not, is there any immutable or disabled IBAFormField, or any other way to implement this?
Thanks!

A: you can use IBAReadonlyFormField


text:
Q: Layer appearing with a delay I have an iPhone game in which players can tweet their score.
I use TWTweetComposeViewController for this.
Since the Twitter sheet can take some time to load, I would like a "loading..." layer to show up after the player has clicked the tweet button, while waiting for the Twitter sheet to show up.
My problem is that the layer (named "colcol" in the code below) only shows up once the tweet sheet is ready! It's as if the layer waited for the tweet sheet to be ready to show up. Which is definitely not what I expect.
Any idea why ?
Thank you!
Here is the tweetScore function, called when the user touches a CCMenuItemImage:
- (void) tweetScore: (CCMenuItem *) menuItem {
    colcol=[CCLayerColor layerWithColor:ccc4(0,0, 0, 200) width:50 height:50];
    colcol.position=ccp(winSize.width/2-25,winSize.height/2-25);
    [self addChild:colcol z:15];

    if ([TWTweetComposeViewController canSendTweet])
    {
        TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init];
        [tweetSheet setInitialText:[NSString stringWithFormat:@"I scored %d!", playerScore]];

        tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result)  {

            [appDelegate.viewController dismissModalViewControllerAnimated:YES];
            switch (result) {
                case TWTweetComposeViewControllerResultCancelled:
                    [self removeChild:colcol cleanup:YES];
                    break;
                case TWTweetComposeViewControllerResultDone:
                    [[GCHelper sharedInstance] reportAchievementIdentifier:@"tweet_score" percentComplete:100.0];
                    [self removeChild:colcol cleanup:YES];
                    break;
                default:
                    [self removeChild:colcol cleanup:YES];
                    break;
            }
        };

        [appDelegate.viewController presentModalViewController:tweetSheet animated:YES];
    }
    else
    {
        // handle this case
    }

}

A: In general, screen updates in CoreAnimation, UIKit, and OS X are deferred until the end of the current pass through the run loop. You are adding the CALayer, then doing some time-consuming work (setting up the TWTweetComposeViewController), then returning so the run loop can finish -- so there's no time for a screen update to happen in between.
Try setting up the TWTweetComposeViewController in a separate pass through the run loop, using dispatch_async(dispatch_get_main_queue(), ^{ /* your code here */ }).


text:
Q: Ruby - Assigning variable only when result is not false To be specific, my problem arose when i was reading the source code of the has_secure_password and finally the authentication method.
def authenticate(unencrypted_password)
    BCrypt::Password.new(password_digest) == unencrypted_password && self
end

I want to have an instance variable that holds the user but only when the result of the authentication method returns the user and not false.
unless @user = user.authenticate(...)
  ...
end

Now i want to access the @user variable in methods called later. I tried to use the safe navigation operator but it only works if @user is nil and not false. Basically i dont want to check if @user is false when i call a method on the user. The method should not getting called when operate on a unauthenticated user. Is there a short way of writing such statements or do i need to check if @user is false every time?