text:
Q: here-map initialization giving MISSING_LIBRARIES under onEngineInitializationCompleted(Error error) Here is the code for here-map initialization.
        if (m_mapFragment != null) {
        /* Initialize the SupportMapFragment, results will be given via the called back. */
            m_mapFragment.init(new OnEngineInitListener() {
                @Override
                public void onEngineInitializationCompleted(Error error) {

                    if (error == Error.NONE) {
                        m_map = m_mapFragment.getMap();
                        isMapReady = true;
                        posManager = PositioningManager.getInstance();

                        // Register positioning listener
                        posManager.addListener(
                                new WeakReference<PositioningManager.OnPositionChangedListener>(positionListener));
                        if (posManager != null) {
                            posManager.start(
                                    PositioningManager.LocationMethod.GPS_NETWORK);
                        }
                    /*
                     * Get the NavigationManager instance.It is responsible for providing voice
                     * and visual instructions while driving and walking
                     */
                        m_navigationManager = NavigationManager.getInstance();

                        final VoiceCatalog voiceCatalog = VoiceCatalog.getInstance();
                        voiceCatalog.downloadCatalog(new VoiceCatalog.OnDownloadDoneListener() {

                            @Override
                            public void onDownloadDone(VoiceCatalog.Error error) {
                                if (error == VoiceCatalog.Error.NONE) {
                                    // Get the list of voice packages from the voice catalog list
                                    List<VoicePackage> voicePackages = voiceCatalog.getCatalogList();
                                    // select
                                    for (VoicePackage vPackage : voicePackages) {
                                        if (vPackage.getMarcCode().compareToIgnoreCase("eng") == 0) {
                                            if (vPackage.isTts()) {
                                                vid = vPackage.getId();
                                                    voiceCatalog.downloadVoice(vid, new VoiceCatalog.OnDownloadDoneListener() {
                                                        @Override
                                                        public void onDownloadDone(VoiceCatalog.Error error) {
                                                            if (error == VoiceCatalog.Error.NONE) {
                                                                // set the voice skin for use by navigation manager
                                                                VoiceGuidanceOptions voiceGuidanceOptions =
                                                                        m_navigationManager.getVoiceGuidanceOptions();
                                                                voiceGuidanceOptions.setVoiceSkin(voiceCatalog.getLocalVoiceSkin(vid));
                                                            }
                                                        }
                                                    });
                                                    break;
                                            }
                                        }
                                    }
                                }
                            }
                        });

                    } else {
                        Toast.makeText(SpeedMediatorActivity.this,
                                "ERROR: Cannot initialize Map with error " + error,
                                Toast.LENGTH_LONG).show();
                    }
                }
            });
        }

I'm getting in Error object->>

Native libraries missing: gnustl_shared, gnustl_shared, gnustl_shared. Please refer to the user guide for details about proper project setup.
  Can someone help me out.

A: did u follow the tutorial of the here maps engine? Like did u import the libraries correctly? I think the problem lies with the importing of the library

*

*Did u add in the manifest

*Did u extract and then unzip the content into the android app libraries?

*Did u missed out any steps?


text:
Q: No luck trying to make two XBees communicate in API mode with arduino XBee library. I have been trying to make two XBees communicate for a long time. I have checked everything and at last I come here for some help from the experts or who have already stumbled upon the same problem as mine. I am using series 2 XBees.
I am using this library.
It's a pretty basic circuit.
The coordinator has a button and the router has LED. When I press button on coordinator, I send two bytes as payload to the router. The router checks if packet was received. If it was, it checks if the correct byte is received. If so, it turns on the LED. But, no matter what I do, I am not able to turn on the LED. I appreciate your help.
The code for the coordinator (sender):
#include <XBee.h>

// create the XBee object
XBee xbee = XBee();

uint8_t payload[] = { 0, 0 };

// SH + SL Address of receiving XBee
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x408698be);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();

int pin5 = 0;

void setup() {
  Serial.begin(9600);
  xbee.setSerial(Serial);
}

void loop() {
  payload[0] = 0x34;
  payload[1] = 0x76;

  if (digitalRead(7) == HIGH){
    xbee.send(zbTx);
    delay(1000);
  }
}

And the code for router (receiver) is:
#include <XBee.h>

XBee xbee = XBee();
XBeeResponse response = XBeeResponse();
// create reusable response objects for responses we expect to handle
ZBRxResponse rx = ZBRxResponse();
ModemStatusResponse msr = ModemStatusResponse();

void setup() {
  // start serial
  Serial.begin(9600);
  xbee.begin(Serial);
}

// continuously reads packets, looking for ZB Receive or Modem Status
void loop() {
    xbee.readPacket();
    if (xbee.getResponse().isAvailable()) {
      // got something
      if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) {
        // got a zb rx packet
        // now fill our zb rx class
        xbee.getResponse().getZBRxResponse(rx);
        // I check both bytes (or)
        if (rx.getData(0) == 0x34 || rx.getData(0) == 0x76 ) {
          digitalWrite(8, HIGH);
        }
      }
   }
}

A: I fixed the problem. If you look at the code, you'll notice that I had not specified pinmode of the input and output pins.
The fix is to include the following lines in the router and coordinator code, respectively:

*

*The line below is missing in router code:
pinMode(8,  OUTPUT);

*And the line below is missing in coordinator code:
pinMode(7,  INPUT);

redpajama_set_name: RedPajamaStackExchange


text:
Q: Javascript instance variable didn't get rendered in React class component when calling setState A react class component is mounted to html root node. It has two react element h1 tag in its body.  One h1 element is directly render inside the render method. Another h1 is decleared in React component class and passed into Render function as a variable.
import React, { Component } from "react";

export default class Test extends Component {
  state = {
    count: 0,
  };

  current_count = (
current count is {this.state.count}
);

  render() {
    return (
      <>
        {this.current_count}

current count is {this.state.count}

        <button
          onClick={() => {
            this.setState({ count: this.state.count + 1 });
          }}
        >
          click me
        </button>
      </>
    );
  }
}

When I clicked the button, it should increase the count, only the react element h1 inside the render function will updated with it's state content.
The following photo is shown the second h1 tag showing count is 4 when I clicked the button 4 times.

A: Your current_count is a property that gets created in the constructor, before mount, and only then. Your current code is like
export default class Test extends Component {
  constructor() {
    this.state = {
      count: 0,
    };
    this.current_count = (
current count is {this.state.count}
);
  }

And the constructor only runs once.
You'll need some other method to update it. The best way would be to only generate the JSX on render - perhaps have a function instead that returns the
.

class Test extends React.Component {
  state = {
    count: 0,
  };

  getCurrentCount() {
    return (

current count is {this.state.count}

    );
  }

  render() {
    return (
      <React.Fragment>
        {this.getCurrentCount()}

current count is {this.state.count}

        <button
          onClick={() => {
            this.setState({ count: this.state.count + 1 });
          }}
        >
          click me
        </button>
      </React.Fragment>
    );
  }
}

ReactDOM.createRoot(document.querySelector('.react')).render(<Test />);


text:
Q: STL algorithm function templates The program has to finds an element in a sorted array and implement this function template:
bool find(T *p, T value, int &index=null)

I have completed a part, but when I try to do the Null part all my number goes to zeros. Also I do not know how to implement the index. Can someone help me please.
int main()
{
    vector<int> numbers;
    vector<int>::iterator iter;

    for (int x = 0; x < 15; x++)
        numbers.push_back(x);

    cout << "The numbers in the vector are:\n";
    for (iter = numbers.begin(); iter != numbers.end(); iter++)
        cout << *iter << " ";
    cout << endl << endl;

    iter = find(numbers.begin(), numbers.end(), 5);
    cout << *iter << endl;

A: The prototype is
bool find(T *p, T value, int &index=null).

the function call is
iter = find(numbers.begin(), numbers.end(), 5);

Conceptually, do these match? Does end() return a value? Is 5 an index?


text:
Q: Change Page Size Using dropdownlist in mvc I have searching sorting and paging demo in mvc, demo is working good, I specified default page size 5, what changes should i make to change page size dynamically using dropdownlist? portion of code :-
Controller Action:-
  public ActionResult Index(string searchBy,string search,int? Page,string sortBy)
    {

        ViewBag.SortNameParameter = string.IsNullOrEmpty(sortBy) ? "Name desc" : "";
        ViewBag.SortGenderParameter = sortBy == "Gender" ? "Gender desc" : "Gender";

        var employees = db.Employees.AsQueryable();

        if(searchBy == "Gender")
        {
           employees =  employees.Where(x => x.EmpGender == search || search == null);
        }
        else
        {
            employees = employees.Where(x => x.EmpName.StartsWith(search) || search == null);
        }

        switch(sortBy)
        {
            case "Name desc":
                    employees = employees.OrderByDescending(x=>x.EmpName);
                    break;

            case "Gender desc":
                    employees = employees.OrderByDescending(x=>x.EmpGender);
                    break;

            //case "Gender ":
            //employees = employees.OrderByDescending(x=>x.EmpGender);
            //break;

            default:
            employees = employees.OrderByDescending(x=>x.EmpName);
            break;

        }

        return View(employees.ToPagedList(Page ?? 1, 5));

    }

and I added pagedlistpager at end in view as below:-
@Html.PagedListPager(Model, Page => Url.Action("Index", new  { Page, searchBy = Request.QueryString["searchBy"], search = Request.QueryString["search"], sortBy = Request["sortBy"] }),
new PagedListRenderOptions() { Display = PagedListDisplayMode.IfNeeded, DisplayPageCountAndCurrentLocation = true, DisplayItemSliceAndTotal = true })

A: Hi Its pretty simple just send the page size as dd value in the dd change event with jquery. And finally in the controller action method subsititue that incoming parameter to the  ToPagedList() method.
For ex:
public ActionResult Index(string searchBy,string search,int? Page,string sortBy,int ddpagesize)
    {

        ViewBag.SortNameParameter = string.IsNullOrEmpty(sortBy) ? "Name desc" : "";
        ViewBag.SortGenderParameter = sortBy == "Gender" ? "Gender desc" : "Gender";

        var employees = db.Employees.AsQueryable();

        if(searchBy == "Gender")
        {
           employees =  employees.Where(x => x.EmpGender == search || search == null);
        }
        else
        {
            employees = employees.Where(x => x.EmpName.StartsWith(search) || search == null);
        }

        switch(sortBy)
        {
            case "Name desc":
                    employees = employees.OrderByDescending(x=>x.EmpName);
                    break;

            case "Gender desc":
                    employees = employees.OrderByDescending(x=>x.EmpGender);
                    break;

            //case "Gender ":
            //employees = employees.OrderByDescending(x=>x.EmpGender);
            //break;

            default:
            employees = employees.OrderByDescending(x=>x.EmpName);
            break;

        }

        return View(employees.ToPagedList(Page ?? 1, ddpagesize));

    }

For dropdownchange event this article will be helpful:http://www.c-sharpcorner.com/blogs/drop-down-list-selected-index-changed-event-in-mvc
Thanks
Karthik


text:
Q: Clean object oriented code I'm trying to be a better developer and I always ask myself If there is a better way to do the things. Is not the first time that I have to deal with this problem so I decided to ask what you think about it.
Let's say I have to implement a class that represent a product.
class Product
  def initialize (name, net_price)
    @name = name
    @net_price = net_price
    @gross_price = nil
  end

  def set_gross_price
    @gross_price = heavy_gross_price_calculation
  end

  def export
    @gross_price.nil? && set_gross_price
    return product.to_hash
  end

  def heavy_gross_price_calculation
    #  This function calculate the gross price but let's say that this is
    #  pretty onerous operation that involves maybe also an external API
    #  request
  end
end

Let's say that the work flow for this class is create a product, calculate the gross price and export it for future use.
Is it correct to not call the set_gross_price method in the initialize?
The fact is that when you export a product the gross price have to be calculated but I don't think that the correct choise is to force the developer to call set_gross_price before export but also i'm not sure about the first line of the export method beacause the set should concern about set the gross price and not check if it is null.
Do you have some better way to implement this?
Thanks

A: I see several approaches:

*

*Make Product a stupid object which just holds the information about a Product, calculate the price externally

*Make gross_price a method which memoizes the result of the calculation

Stupid Object
class Product
  def initialize(name, net_price, gross_price)
    @name ...
    ...
  end
end

class GrossPriceCalculator
  def initialize()

  end

  def call(net_price)
    # complicate operation goes here
    # ...
  end
end

Memoization
class Product
  def initialize(name, net_price)
    @name = name
    @net_price = net_price
  end

  def gross_price
    @gross_price ||= calculate_gross_price
  end

  private

  def calculate_gross_price
    # here is the complicate operation..
    #
  end
end

I prefer first solution. It does not trigger a potentially expensive call hidden by some completely different operation (like export)

A: Completely agree that if the heavy computation is only needed for the export, then you shouldn't do it in the initialize (as a concrete case, think of writing unit tests; why should all the tests pay the price of a heavy computation when it is needed for a single method?).
One way to avoid things like @gross_price.nil? && set_gross_price is to do a one-time assignment if the variable is empty by using ||= (see e.g. What does ||= (or-equals) mean in Ruby?). At the same time, by using attribute accessors you can abstract yourself form when that computation is performed, and lazy compute that on the getter:
class Product

  attr_reader :name, :net_price

  def initialize (name, net_price)
    @name = name
    @net_price = net_price
    @gross_price = nil
  end

  def gross_price
    @gross_price ||= heavy_gross_price_calculation
  end

  def export
    return to_hash
  end

  def heavy_gross_price_calculation
    puts "heavy calculation"
    1000
  end

  def to_hash
    Hash[instance_variables.map do |var_name|
      # Remove the "@"
      name = var_name.to_s[1..-1]
      [name, send(name)]
    end]
  end

end

I'm giving here a possible to_hash implementation, but of course you can use a different one, as long as it uses the accessors and not the inst vars directly.
Then in a console you can do (see that "heavy calculation" is printed only once, the first time export is called):
2.2.3 :001 > p = Product.new('X', 100)
 => #<Product:0x0000000104e128 @name="X", @net_price=100, @gross_price=nil>
2.2.3 :002 > p.export
heavy calculation
 => {"name"=>"X", "net_price"=>100, "gross_price"=>1000}
2.2.3 :003 > p.export
 => {"name"=>"X", "net_price"=>100, "gross_price"=>1000}
2.2.3 :004 >

One advantage of this is that any other method besides export that needs gross_price can also get it, with all the benefits export already has and the computation only needs to be done once.

A:
I'm trying to be a better developer ...

You're on the right track.
You have detected the scent of SRP. Your Product is doing at least 2 things:

*

*Being a product with name and price

*Exporting

*Calculating gross prices

I think if you create 1 or 2 more classes the smell will go away.
You may want to read POODR. And write specs.


text:
Q: Cursor not visible in EditText in HTC devices In my application, I am using cursor color for EditText.
It is working in Samsung devices but in HTC One it's not showing. If I give textCursorDrawable element as null it's showing default text color as cursor color, but I need cursor color in red.
I am not able to get where is the exactly problem.
Please can any one help me.
Here is my EditText in XML code:
<EditText
    android:id="@+id/username_edit"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_weight="90"
    android:background="@null"
    android:ems="10"
    android:hint="user name"

    android:maxLength="60"
    android:paddingLeft="5dp"
    android:singleLine="true"
    android:textColor="@color/black"
    android:textCursorDrawable="@color/appheader_color"
    android:textSize="@dimen/TextSize_medium" >

</EditText>

A: Try adding
android:textCursorDrawable="@null"

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textCursorDrawable="@drawable/color_cursor"
    />

in drawable you can set your own color
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="1dp" />
    <solid android:color="#FFFFFF"  /> //#FFFFFF will be replaced by your color code
</shape>

A: Try this. It may help you.
Create drawalble xml: cursor_color
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="3dp" />
    <solid android:color="#FF0000"  />
</shape>

In Edittext :
<EditText
                    android:id="@+id/username_edit"
                    android:layout_width="wrap_content"
                    android:layout_height="fill_parent"
                    android:layout_weight="90"
                    android:background="@null"
                    android:ems="10"
                    android:hint="user name"

                    android:maxLength="60"
                    android:paddingLeft="5dp"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textCursorDrawable="@drawable/cursor_color"
                    android:textSize="@dimen/TextSize_medium" >

                </EditText>


text:
Q: Can I insert my data-context in the text suggestions bar? Suggestions bar: http://i.msdn.microsoft.com/dynimg/IC530993.png
I'd like to know if there's a way to put my data in this bar programmatically.

A: I think you can't add words to the Predictive Text bar in the Windows Phone.
What you can do is use the autocomplete feature:
http://developer.nokia.com/Community/Wiki/How_to_use_Auto_Complete_Box_in_Windows_Phone
And don't forget to add the scope of the keyboard
   <TextBox>
    <TextBox.InputScope>
     <InputScope>
       <InputScopeName NameValue="Text" />
     </InputScope>
    </TextBox.InputScope>
  </TextBox>

There are multiple Input Scopes
<TextBox Name="myTextBox" InputScope="Text"/>

There are ways to enumerate this as this post points out
var inputScopes = new List<string>();

FieldInfo[] array = typeof(InputScopeNameValue).GetFields(
        BindingFlags.Public | BindingFlags.Static);
foreach (FieldInfo fi in array)
{
    inputScopes.Add(fi.Name);
}

this.DataContext = inputScopes;

*

*AddressCity

*AddressCountryName

*AddressCountryShortName

*AddressStateOrProvince

*AddressStreet

*AlphanumericFullWidth

*AlphanumericHalfWidth

*ApplicationEnd

*Bopomofo

*Chat

*CurrencyAmount

*CurrencyAmountAndSymbol

*CurrencyChinese

*Date

*DateDay

*DateDayName

*DateMonth

*DateMonthName

*DateYear

*Default

*Digits

*EmailNameOrAddress

*EmailSmtpAddress

*EmailUserName

*EnumString

*FileName

*FullFilePath

*Hanja

*Hiragana

*KatakanaFullWidth

*KatakanaHalfWidth

*LogOnName

*Maps

*NameOrPhoneNumber

*Number

*NumberFullWidth

*OneChar

*Password

*PersonalFullName

*PersonalGivenName

*PersonalMiddleName

*PersonalNamePrefix

*PersonalNameSuffix

*PersonalSurname

*PhraseList

*PostalAddress

*PostalCode

*Private

*RegularExpression

*Search

*Srgs

*TelephoneAreaCode

*TelephoneCountryCode

*TelephoneLocalNumber

*TelephoneNumber

*Text

*Time

*TimeHour

*TimeMinorSec

*Url

*Xml

*Yomi


text:
Q: Assigning function to element of a vector R I am trying to assign a function to every row of a vector. However it does not work properly. I tried many things as using parse, eval, etc but i do no find my mistake. I think for you it should not be too complicated. Here's the code
quartale <- c("2014", "2015")
test <- c("arnaud", "elio", "pascal", "david", "senior")

for(i in 1:5){
  assign(paste("meldungen.", quartale[1], "[",i, "]", sep=""),nchar(test[i]))
}

Thus, I would like finally to have a vector
meldungen.arnaud = 6,4,6,5,6

A: Try this:
nam <- paste("meldungen.", quartale[1], sep="")
assign(nam, nchar(test))

> meldungen.2014
[1] 6 4 6 5 6

Not really sure what are you looking for but there is some advice:
This code:
for (i in 1:5){ assign((paste0("meldungen.", test[i])), nchar(test[i]))}

gives you
> meldungen.arnaud
[1] 6

respectively
> meldungen.elio
[1] 4

This code gives you what you described in your post:
> assign((paste0("meldungen.", test[1])), nchar(test))
> meldungen.arnaud
[1] 6 4 6 5 6

Hope this helps


text:
Q: Docker compose for java backend and python frontend application I have simple spring boot java backend application which get element from the list (endpoint /get/{id}) and add element to the list (endpoint /add/{product}):
@RestController
public class DemoController {

    List<String> products = Arrays.asList("test");

    @PostMapping(path="/add/{product}")
    public int addProduct(@PathVariable final String product){
        products.add(product);
        return products.size()-1;
    }

    @GetMapping(path="/get/{id}")
    public String getValue(@PathVariable final int id){
        return products.get(id);
    }
}

I created Dockerfile for this like:
FROM openjdk:11

# copy the packaged jar file into our docker image
COPY target/demo-0.0.1-SNAPSHOT.jar /demo.jar

EXPOSE 8080/tcp

# set the startup command to execute the jar
CMD ["java", "-jar", "/demo.jar"]

Now I can build image (docker build -t java_backend .) and run application (docker run --rm -p 8080:8080 java_backend).
Thus, under localhost:8080/get/0 I got "test", under localhost:8080/add/something I can add element. Everything is fine.
As frontend I have simple python application like:
from flask import Flask, request
import requests as r
import os
app = Flask(__name__)

@app.route("/")
def renderProduct():
    return """

                    <title>""" + os.environ["title"] + """</title>

                <form id="1" method="POST">
                    <input name="getID"/>

                    <input name="addID">
                    <input type="submit">
                </form>

                """

@app.route("/", methods=["POST"])
def queryAndRender():
    builded = ""
    if request.form["getID"] is not None:
        resp = r.get("http://localhost:8080/get/" + request.form["getID"])
        builded = builded + "PRODUCT:" + resp.text + "
"

    if request.form["addID"] is not None:
        resp = r.get("http://localhost:8080/add/" + request.form["addID"])
        builded = builded + "ADDED ID:" + resp.text + "
"

    builded = builded + """

                                <title>""" + os.environ["title"] + """</title>

                            <form id="1" method="POST">
                                <input name="getID"/>

                                <input name="addID">
                                <input type="submit">
                            </form>

                            """

    return builded;

if __name__ == "__main__":
    app.run()

And Dockerfile:
ARG version=3.8.5-alpine3.11
FROM python:${version}

ENV title="Hello world"
ENV test testspacja
ENV FLASK_APP=/main.py

RUN pip install Flask==1.1.2
RUN pip install requests==2.22.0

COPY main.py /
RUN sed -i 's/localhost:8080/backend/g' /main.py

EXPOSE 80/tcp

ENTRYPOINT ["flask", "run"]
CMD ["-h", "0.0.0.0", "-p", "80"]

At the end I created docker-compose.yml file to run both of them:
version: '3.3'
services:
        backend:
                image: java_backend
                ports:
                         - "8080:8080"

        frontend:
                image: frontend
                ports:
                        - "8081:80"

Now I try to start docker-compose up --build backend frontend.
Frontend and backend are working independent, hence if I try put localhost:8080/get/0 I am getting "test", If I go to localhost:8081 I see my frontend. But if I put some values in textboxes and click submit then I got 500 Internal Server Error. So services are not connected. Could you please tell me why?

A: I think you are accidentally erasing the backend port. Try replacing
RUN sed -i 's/localhost:8080/backend/g' /main.py

with
RUN sed -i 's/localhost:8080/backend:8080/g' /main.py

A: I have one additional question for this. Let's suppose that I would like start frontend from container but backend only from the my local IDE (IntelliJ).
Of course line RUN sed -i 's/localhost:8080/backend/g' /main.py is commented so frontent is calling endpoints under http://localhost:8080.
In this case frontend is under http://localhost:8081 and backend under http://localhost:8080 (two endpoints - /get/{id} and /add/{product}). But why frontend which is running in container doesn't "see" my backend?


text:
Q: Magento 2 custom theme development css multistore - without locale folders As a seasoned Magento 1 developer, which is of no use what-so-ever here, I am attempting to work on creating a custom Magento 2 theme for a new multi-store site. What a perpendicular learning curve this is turning out to be.
The initial data migration into M2 is a 4-store/language set up.
I have created a theme folder (shown below -css files marked * are all files tested). The theme appears in the admin, and is selected for the different stores, the correct logo appears. However, the frontend source keeps looking for css files inside locale specific folders and the actual CSS files do not exist.
e.g.
http://mag2.local/pub/static/frontend/[company]/[themename]/en_GB/css/abc.css
I end up with completely css-less front end pages.
Q1.  Does all the CSS need to be generated in locale-based folder? Can there not be a general all-store CSS? It is the same design for all stores.
Q2. I have tried adding CSS into local subfolders such as css/en_GB/abc.css but that doesn't work either.
I have used Grunt to do the CSS processing but that always requires a locale too, and have tried client side processing (set in the admin).
I have looked at a ton of online guides to this, including the the official Mag one and they all "just work" or do things slightly differently.  In true Magento style - they seem to make the "simple things" exceedingly complicated. I have been doing web dev for nearly 20 years and now I can't even change the sodding font colour!
I do
bin/magento cache:clean

and
rm -rf var/view_preprocessed/; rm -rf pub/static/; rm -rf var/cache/

between changes.
Please help...
Theme directory structure (inside  /app/design/frontend/)
[company]
 - [themename]
    - etc/
        view.xml
    - Magento_Theme
       - layout
           default.xml
    - media
    - web
      - css
        - source
          _extend.less *
          _theme.less *
          styles-abc.less *
        abc.css *
        styles-l.css *
      - fonts
      - images
      - js
    composer.jsn
    registration.php
    theme.xml

theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>My new theme</title>
    <parent>Magento/blank</parent>
</theme>

registration.php
<?php

use \Magento\Framework\Component\ComponentRegistrar;
    ComponentRegistrar::register(ComponentRegistrar::THEME,'frontend/[company]/[themename]', __DIR__);

composer.json
{
    "name": "[company]/[themename]",
    "description": "My new Theme",
    "config": {
        "sort-packages": true
    },
    "require": {
        "php": "~7.1.3||~7.2.0",
        "magento/framework": "102.0.*",
        "magento/theme-frontend-blank": "100.3.*"
    },
    "type": "magento2-theme",
    "autoload": {
        "files": [
            "registration.php"
        ]
    },
    "version": "0.0.1"
}

Magento_Theme/layout/default.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="logo">
                <arguments>
                    <argument name="logo_file" xsi:type="string">images/companylogo.png</argument>
                    <argument name="logo_img_width" xsi:type="number">338</argument>
                    <argument name="logo_img_height" xsi:type="number">54</argument>
                </arguments>
            </referenceBlock>
        </body>
        <head>
            <css src="css/abc.css" />
            <css src="css/styles-abc.css" />
        </head>
    </page>

I have also tried specifying the css inside a default_head_blocks.xml file, e.g.
<?xml version="1.0"?>
<default xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/styles-abc.css" />
        <css src="css/styles-m.css" media="screen and (min-width: 768px)"/>
        <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
        <css src="css/_extend.css" media="screen and (min-width: 768px)"/>
        <css src="css/print.css" media="print"/>
    </head>
</default>

A: You can extend the css by following way,
Create a new file on following path, web\css\source\_extend.less
@import '_custom.less';

Note: here "_custom.less" is the custom file that you have created.


text:
Q: Peculiar behaviour in the implementation of "Filling" I was working with mathematica and I need to use "Filling", however I notice that it doesn't work when you have "small" numbers, for example if I make the following:
Plot[Evaluate[{x + 1, x + 2}], {x, -1*10^-15,1*10^-15},PlotRange -> All, Filling -> {1 -> {2}}]

The "Filling" doesn't appears.
Question
There is some way to make that the "Filling" appear?
Extra
Since this question appear in a physical context, I know that I can change units  in order to make "x" a  larger number.(Actually I do this.)

A: There are two perspectives in the question
a) PlotRange -> All
b) Filling -> {1 -> {2}}
to a)
It is necessary to put in both intervals explicitly into the options of PlotRange:
PlotRange -> {{-1.*10^-15, 1.*10^-15}, {-1.0, 2.1}}

will present the desired result.
to b)
This appears to me as taken from the example for Filling Fill between curves 1 and 2.
I agree this example works for me too. I am using 12.0.
And I get
Plot[{x + 1, x + 2}, {x, 0, 2 Pi}, Filling -> {1 -> {2}}]

This even can not be narrowed in the interval!!! And the built-in Evaluation does not change anything.
The cause can be in the invalid options since with Filling -> {1 -> 2} the plot became as expected:
Plot[Evaluate[{x + 1, x + 2}], {x, -1.*10^-15, 1.*10^-15},
 Filling -> {1 -> 2},
 PlotRange -> {{-1.*10^-15, 1.*10^-15}, {-1.0, 2.1}}]

Mind the example is listed under the section Filling Limits in the Mathematica documentation for Filling.
The curly brackets are suggested for the use with style options or if there are more curves or sections of the interval with separate fillings in the section Details.
Most probable the reason stems from the granularity of the option in the example. Plot in Mathematica uses an interval division algorithm to represent curve smoothly. This algorithm works brilliantly for example trigonometric functions but fails if the given interval is to narrow and the first derivative of the function to be displayed is to small.
In the given case both are about the same interval length and magnitude of the first derivative of the linear function over the interval for interpolation. Since the interpolation is already exact Mathematica does not further refine the representation and the filling algorithm fails. This process is shown in the documentation for  Plot in the section Details and Options.
Since the example is given without commending this is transferred into the knowledge of the Mathematica user. So the question is to be dealt with respect, but very basic knowledge.
This question make $MachinePrecision as the interval length and change rate of the function.
$MachinePrecision

15.9546
The limit is different on each machine:
$MinMachineNumber

2.22507*10^-308
for example on mine.
So setting MaxRecursion bigger than 15 fails in this case. This option limits the efforts of refine the curvature to appear smooth to the human eye.
The option Mesh show the efforts already in the seemingly failed example:
Plot[{SetPrecision[x + 1., MachinePrecision],
  SetPrecision[x + 2., MachinePrecision]}, {x,
  SetPrecision[-1.000*10^-15, MachinePrecision],
  SetPrecision[1.000*10^-15, MachinePrecision]},
 Filling -> {1 -> {2}}, Mesh -> All]

Some variation that works is
ListPlot[{Table[x + 1, {x, -1*10^-15, 1*10^-15, 2*10^-16}],
  Table[x + 2, {x, -1*10^-15, 1*10^-15, 2*10^-16}]}, Joined -> True,
 Filling -> {1 -> {2}}, Axes -> True,
 DataRange -> {-1*10^-15, 1*10^-15}]

ListPlot[{Table[x + 1, {x, -1*10^-15, 1*10^-15, 2*10^-16}],
  Table[x + 2, {x, -1*10^-15, 1*10^-15, 2*10^-16}]}, Joined -> True,
 Filling -> {1 -> {2}}, Axes -> True]

ListPlot[{Table[{x, x + 1}, {x, -1*10^-15, 1*10^-15, 2*10^-16}],
  Table[{x, x + 2}, {x, -1*10^-15, 1*10^-15, 2*10^-16}]},
 Filling -> {1 -> {2}}]

ListPlot[{Table[{x, x + 1}, {x, -1*10^-15, 1*10^-15, 2*10^-16}],
  Table[{x, x + 2}, {x, -1*10^-15, 1*10^-15, 2*10^-16}]},
 Joined -> True, Filling -> {1 -> {2}}]

Design own plot primitives to workaround or accept what is possible.
gg = Graphics[{Opacity[0.3], LightGray,
   Rectangle[{-10^-15, 1}, {10^-15, 2}]}, Axes -> True,
  AspectRatio -> 1/3,
  PlotRange -> {{-1.*10^-15, 1.*10^-15}, {.0, 2.1}}]

Show[Plot[Evaluate[{x + 1, x + 2}], {x, -1*10^-15, 1*10^-15},
 PlotRange -> {{-1.*10^-15, 1.*10^-15}, {-1.0, 2.1}}], gg]


text:
Q: Reading the g:datePicker-value in Grails without using the "new Object(params)"-method Let's say I have a datePicker called "foobar":
<g:datePicker name="foobar" value="${new Date()}" precision="day" />

How do I read the submitted value of this date-picker?
One way which works but has some unwanted side-effects is the following:
def newObject = new SomeClassName(params)
println "value=" + newObject.foobar

This way of doing it reads all submitted fields into newObject which is something I want to avoid. I'm only interested in the value of the "foobar" field.
The way I originally assumed this could be done was:
def newObject = new SomeClassName()
newObject.foobar = params["foobar"]

But Grails does not seem to automatically do the translation of the foobar field into a Date() object.
Updated: Additional information can be found in the Grails JIRA.

A: Use the command object idiom.  In the case of your example, I will assume that your form calls the action handleDate. Inside the controller:

def handleDate = { FoobarDateCommand dateCommand ->
    def theNextDay = dateCommand.foobar + 1
}

Here's FoobarDateCommand.  Notice how you name the field the same as in the view:

class FoobarDateCommand {
    Date foobar
}

Command objects are a handy way to encapsulate all validation tasks for each of your forms, keeping your controllers nice and small.

A: Reading the g:datePicker value became a lot easier in Grails 1.2 (see release notes):

Better Date parsing
If you submit a date from a
   tag,
  obtaining the Date object is now as
  simple as looking it up from the
  params object by name (eg. params.foo
  )

A: When a param says to be a "struct", this means there are a number of params to represent its value. In your case, there are:

*

*params["foobar_year" storing year

*params["foobar_month"] storing month

*params["foobar_day"] storing day

Just fetch them out and do whatever you want :)

A: You still need to know the format though
def newObject = new SomeClassName()
newObject.foobar = Date.parse('yyyy-MM-dd', params.foobar)


text:
Q: Dynamic column create from child table I have two table one for master and another child. Which is depicting below
Master table:

and scripts:
CREATE TABLE [dbo].[SET_HRShiftProfile](
    [id] [smallint] NOT NULL,
    [LocationID] [tinyint] NOT NULL,
    [ShiftTypeID] [smallint] NOT NULL,
    [ProfileName] [nvarchar](50) NULL,
    [EmpTypeCode] [nvarchar](10) NOT NULL,
    [IsActive] [bit] NOT NULL,
 CONSTRAINT [PK_HR_ShiftProfile] PRIMARY KEY CLUSTERED
(
    [id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

Child Table:

And script:
CREATE TABLE [dbo].[SET_HRShiftProfileDetail](
    [id] [int] NOT NULL,
    [LocationID] [tinyint] NOT NULL,
    [ShiftprofileID] [smallint] NOT NULL,
    [ShiftProfTypeCode] [nvarchar](10) NOT NULL,
    [Start] [nvarchar](5) NULL,
    [End] [nvarchar](5) NULL,
    [ToleranceBefore] [nvarchar](5) NULL,
    [ToleranceAfter] [nvarchar](5) NULL,
 CONSTRAINT [PK_SET_HRShiftProfileDetail] PRIMARY KEY CLUSTERED
(
    [id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

I need to final query result look like this, means all child table row will be column for master table

Any idea give me appreciate. Thanks.

A: Try this:
with pivoted as
(
    select LocationID, ShiftprofileID, [IN], [OUT], [Break]
    from (
        select distinct LocationID, ShiftprofileID, [ShiftProfTypeCode]
        from [dbo].[SET_HRShiftProfileDetail]
    ) as t
    pivot (
        count([ShiftProfTypeCode]) for [ShiftProfTypeCode] in ([IN], [OUT], [Break])
    ) as p
)
select p.*
, x.[IN], x.[OUT], x.[Break]
from [dbo].[SET_HRShiftProfile] as p
left join pivoted x on x.ShiftprofileID = p.id
    and x.locationid = p.locationid

Results:
id      LocationID  ShiftTypeID ProfileName EmpTypeCode IsActive    IN  OUT Break
1003    1           1001        Day-Summar  REG         1           1   1   1
1006    1           1005        Say-Winter  REG         1           1   1   0

Since you said nothing about what data you like to get into cells, I have placed there the count of rows with such value (as column name) from the child table.
Hope it will help you to solve your problem

LATER EDIT
Solution without using PIVOT:
with pivoted as
(
    select LocationID
    , ShiftprofileID
    , sum(case when [ShiftProfTypeCode] = 'OUT' then 1 else 0 end) [OUT]
    , sum(case when [ShiftProfTypeCode] = 'IN' then 1 else 0 end) [IN]
    , sum(case when [ShiftProfTypeCode] = 'Break' then 1 else 0 end) [Break]
    from [dbo].[SET_HRShiftProfileDetail]
    group by LocationID, ShiftprofileID
)
select p.*
, x.[IN], x.[OUT], x.[Break]
from [dbo].[SET_HRShiftProfile] as p
left join pivoted x on x.ShiftprofileID = p.id
    and x.locationid = p.locationid

Results:
id      LocationID  ShiftTypeID ProfileName EmpTypeCode IsActive    IN  OUT Break
1003    1           1001        Day-Summar  REG         1           1   1   1
1006    1           1005        Say-Winter  REG         1           1   1   0


text:
Q: Ignore all output arguments if no variable is assigned I have wondered for sometime now if it is possible to write a function in Matlab that does not return an argument if none is requested. For example does plot returns the axis handle if it is called as h = plot(x,y);, but not if it is called as plot(x,y);. It is just that plot is not written in Matlab.

A: A short example to demonstrate how to get a flexible number of random outputs:
function varargout=myFancyOutput()
    varargout=cell(1,nargout)
    for idx=1:numel(varargout)
        varargout{idx}=rand
    end
end

nargout gives the number of output arguments and varargout is expanded to a list of individual outputs.

A: You can do it using varargout, for example:
function varargout = test()

    for k = 1:nargout
        varargout{k} = k;
    end

    disp(['Test function called with ', str2num(nargout), ' output arguments']) %// Just so you can see the function working when you call no outputs

end

A: Actually when a function returns an output you can just choose not to store it.
Let a function be:
function [out1,out2,out3] = testfunction(x,y)
    out1 = 2.*x;
    out2 = 2.*y;
    out3 = x.*y;
    plot(1:10,1:10)
end

Now you can call this function using:
% Call function interested in no output
testfunction(2,3); % Although in this case `ans` is generated as pointed out by Dan.
% Call function only interested in first output
[out1] = testfunction(2,3)
% Call function only interested in first and second output
[out1,out2] = testfunction(2,3)
% Call function only interested in first, second and third output
[out1,out2,out3] = testfunction(2,3)
% Only the first output
[~,~,out3] = testfunction(2,3)

Depending on the assignment of the output the output is generated.
A very dirty work-around to avoid ans being generated is:
[~]=testfunction(2,3)

This avoids the extra coding telling how much output arguments are needed.


text:
Q: Why isn't the callback function called in IE ($.getJSON)? Why isn't the callback function called in IE?

*

*A call to Flickr:
$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos",
{
    api_key: APIKey,
    photoset_id: photoSetID,
    format: "json",
    per_page: 40,
    nojsoncallback: 1
}, displayImages);

function displayImages(data) { alert('called'); }

*A call to YouTube:
$.getJSON('https://gdata.youtube.com/feeds/api/users/username/favorites?alt=json', function(data)
{
    alert('called');
})

Both of these types of calls work on any other browser, except IE.
Can you please explain me why?

A: jQuery only supports cross-domain ajax in non-IE<=9 browsers. To use those APIs in IE, you need to use JSONp if available or add a jQuery plugin that adds support for the XDomainRequest api used by IE.
If possible use JSONp; XDR has quite some limitations - see http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx for details.


text:
Q: how to change .vs\config\applicationhost.config once and for all? I have an ASP.Net MVC web application. When i initially created the project i specified it as a windows authentication. After some experimentation and development, the requirements shifted away from windows authentication, so i reconfigured the solution/web config etc. to allow anonymous authentication, and to disable windows authentication. However, i seem to have missed something somewhere along the way.
My web application now works great when i publish it, but i am constantly needing to edit the .vs\config\applicationhost.config file.
The config file defaults to the following state whenever i open the solution in visual studio:
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="false" />
                <windowsAuthentication enabled="true" />
            </authentication>
        </security>
    </system.webServer>

These edits are required to get my ctrl+F5 functionality to work, each time i open the project in visual studio 2017.
At this stage i am not exactly sure, whether i should be looking at some setting in visual studio or perhaps IIS Express, so any help would be greatly appreciated!

A: I received the following communication from Bill H. at Microsoft which resolved the issue, sharing here in case anyone else encounters this problem:
"The value is stored in the project file so that it can be applied when you first download/clone a project. You can change the value in the property grid - select the project and press F4 to see the property grid"


text:
Q: Add a directory of multiple files to iTunes library with Terminal? Based on this post How can I add a file to iTunes, from the command line, without playing the file which works I want to add multiple files not one.
I tried with adding a loop and a find:
for f in ./*.m4a; do osascript -e \
    "tell application \"iTunes\" to add "$f" Posix file; done

# Or...

find /Users/filedirectory\
  -type f -name "*.m4a" \
  -osascript -e "tell application \"iTunes\" to add Posix file {}; done
Terminal gives the > with no error.

A: AppleScript requires that POSIX paths must be quoted, and the paths for iTunes must be full path names.
For the shell for command, the path must be and a full path, so use pwd. $f must be quoted:
for f in "`pwd`"/*.m4a; do osascript -e \
  "tell application \"iTunes\" to add Posix file \"$f\""; done

For the find version (no "done" at the end), quote the {} like this:
find /Users/filedirectory \
  -type f -name "*.m4a" \
  -exec osascript -e "tell application \"iTunes\" to add Posix file \"{}\"" \;

Use pwd to locate files in the current directory. After pwd, the rest of the command is the same.
find "`pwd`" -type f ...

Each file added to iTunes will display a line like this:

file track id 142123 of library playlist id 25858 of source id 65


text:
Q: Часть svg скрывается после преобразования skew Я работаю над svg и продолжаю узнавать   много нового.
Вот одна проблема, с которой я столкнулся. У меня есть svg со многими путями, и когда я трансформирую один из них, его часть скрывается. Я не мог понять, как сделать его видимым. Я попытался поиграть с окном просмотра, но это не дало мне того, что я хотел.

.notebook{
  margin-top:0px;
  width:300px;
  height:auto;

}

.path{
  transform:rotateY(40deg) skewY(20deg);
}
<!DOCTYPE html>

<svg class="notebook"

fill="none" viewBox="0 0 176 227" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#a)">
<path d="m173.58 0.18188h-162.68v226.21h162.68c0.585 0 1.145-0.232 1.558-0.645 0.414-0.413 0.646-0.974 0.646-1.558v-221.8c0-0.58435-0.232-1.1448-0.646-1.558-0.413-0.4132-0.973-0.64534-1.558-0.64535zm-153.5 219.96c-0.7989 0-1.5799-0.237-2.2441-0.68-0.6643-0.444-1.1821-1.075-1.4878-1.813s-0.3857-1.55-0.2299-2.334c0.1559-0.784 0.5406-1.503 1.1055-2.068 0.565-0.565 1.2847-0.95 2.0683-1.106s1.5958-0.076 2.3339 0.23 1.3689 0.824 1.8128 1.488 0.6808 1.445 0.6808 2.244c0 0.53-0.1045 1.056-0.3075 1.546s-0.5006 0.935-0.8756 1.31c-0.3751 0.375-0.8204 0.673-1.3105 0.876s-1.0154 0.307-1.5459 0.307zm0-20.564c-0.7989 0-1.5798-0.237-2.2441-0.681s-1.182-1.074-1.4878-1.812c-0.3057-0.739-0.3857-1.551-0.2298-2.334 0.1558-0.784 0.5405-1.504 1.1055-2.069 0.5649-0.565 1.2846-0.949 2.0682-1.105s1.5958-0.076 2.3339 0.23 1.3689 0.823 1.8128 1.488c0.4439 0.664 0.6808 1.445 0.6808 2.244 0 0.53-0.1045 1.055-0.3075 1.546-0.203 0.49-0.5005 0.935-0.8756 1.31s-0.8204 0.673-1.3105 0.876-1.0154 0.307-1.5459 0.307zm0-20.564c-0.7989 0-1.5798-0.237-2.2441-0.681s-1.182-1.075-1.4878-1.813c-0.3057-0.738-0.3857-1.55-0.2298-2.334 0.1558-0.783 0.5405-1.503 1.1055-2.068 0.5649-0.565 1.2846-0.95 2.0682-1.105 0.7836-0.156 1.5958-0.076 2.3339 0.229 0.7381 0.306 1.3689 0.824 1.8128 1.488 0.4439 0.665 0.6808 1.445 0.6808 2.244 0 0.531-0.1045 1.056-0.3075 1.546s-0.5006 0.936-0.8756 1.311c-0.3751 0.375-0.8204 0.672-1.3105 0.875s-1.0154 0.308-1.5459 0.308zm0-20.564c-0.7989 0-1.5798-0.237-2.2441-0.681s-1.182-1.075-1.4878-1.813c-0.3057-0.738-0.3857-1.55-0.2298-2.334 0.1558-0.784 0.5405-1.503 1.1055-2.068 0.5649-0.565 1.2846-0.95 2.0682-1.106s1.5958-0.076 2.3339 0.23 1.3689 0.824 1.8128 1.488 0.6808 1.445 0.6808 2.244c0 0.531-0.1045 1.056-0.3075 1.546s-0.5006 0.935-0.8756 1.31c-0.3751 0.375-0.8204 0.673-1.3105 0.876s-1.0154 0.308-1.5459 0.308zm0-20.565c-0.7989 0-1.5798-0.237-2.2441-0.681-0.6643-0.443-1.182-1.074-1.4878-1.812-0.3057-0.738-0.3857-1.551-0.2298-2.334 0.1558-0.784 0.5405-1.504 1.1055-2.068 0.5649-0.565 1.2846-0.95 2.0682-1.106s1.5958-0.076 2.3339 0.23 1.3689 0.823 1.8128 1.488c0.4439 0.664 0.6808 1.445 0.6808 2.244 0 0.53-0.1045 1.056-0.3075 1.546s-0.5006 0.935-0.8756 1.31c-0.3751 0.375-0.8204 0.673-1.3105 0.876s-1.0154 0.307-1.5459 0.307zm0-20.564c-0.7989 0-1.5798-0.237-2.2441-0.681s-1.182-1.075-1.4878-1.813c-0.3057-0.738-0.3857-1.55-0.2298-2.334 0.1558-0.783 0.5405-1.503 1.1055-2.068 0.5649-0.565 1.2846-0.949 2.0682-1.105s1.5958-0.076 2.3339 0.23c0.7381 0.305 1.3689 0.823 1.8128 1.487 0.4439 0.665 0.6808 1.446 0.6808 2.245 0 0.53-0.1045 1.055-0.3075 1.545s-0.5006 0.936-0.8756 1.311c-0.3751 0.375-0.8204 0.672-1.3105 0.875s-1.0154 0.308-1.5459 0.308zm0-20.564c-0.7989 0-1.5798-0.2369-2.2441-0.6807-0.6643-0.4439-1.182-1.0748-1.4878-1.8129-0.3057-0.7381-0.3857-1.5503-0.2298-2.3338 0.1558-0.7836 0.5405-1.5034 1.1055-2.0683 0.5649-0.5649 1.2846-0.9496 2.0682-1.1055 0.7836-0.1558 1.5958-0.0758 2.3339 0.2299s1.3689 0.8234 1.8128 1.4877 0.6808 1.4453 0.6808 2.2442c0 0.5305-0.1045 1.0557-0.3075 1.5458s-0.5006 0.9354-0.8756 1.3105c-0.3751 0.3751-0.8204 0.6726-1.3105 0.8756s-1.0154 0.3075-1.5459 0.3075zm0-20.564c-0.7989 0-1.5798-0.2369-2.2441-0.6807-0.6643-0.4439-1.182-1.0748-1.4878-1.8129-0.3057-0.7381-0.3857-1.5503-0.2298-2.3338 0.1558-0.7836 0.5405-1.5034 1.1055-2.0683 0.5649-0.5649 1.2846-0.9496 2.0682-1.1055 0.7836-0.1558 1.5958-0.0758 2.3339 0.2299s1.3689 0.8235 1.8128 1.4877c0.4439 0.6643 0.6808 1.4453 0.6808 2.2442 0 0.5305-0.1045 1.0558-0.3075 1.5458-0.203 0.4901-0.5006 0.9354-0.8756 1.3105-0.3751 0.3751-0.8204 0.6727-1.3105 0.8757s-1.0154 0.3074-1.5459 0.3074zm0-20.564c-0.7989 0-1.5798-0.2369-2.2441-0.6807-0.6643-0.4439-1.182-1.0748-1.4878-1.8129-0.3057-0.7381-0.3857-1.5503-0.2298-2.3338 0.1558-0.7836 0.5405-1.5034 1.1055-2.0683 0.5649-0.5649 1.2846-0.9496 2.0682-1.1055 0.7836-0.1558 1.5958-0.0758 2.3339 0.2299s1.3689 0.8235 1.8128 1.4878c0.4439 0.6642 0.6808 1.4452 0.6808 2.2441 0 0.5305-0.1045 1.0558-0.3075 1.5458-0.203 0.4901-0.5006 0.9354-0.8756 1.3105-0.3751 0.3751-0.8204 0.6727-1.3105 0.8757s-1.0154 0.3074-1.5459 0.3074zm0-20.564c-0.7989 0-1.5799-0.2369-2.2441-0.6807-0.6643-0.4439-1.1821-1.0747-1.4878-1.8129-0.3057-0.7381-0.3857-1.5502-0.2299-2.3338 0.1559-0.7836 0.5406-1.5034 1.1055-2.0683 0.565-0.5649 1.2847-0.9496 2.0683-1.1055 0.7836-0.1558 1.5958-0.0759 2.3339 0.2299 0.7381 0.3057 1.3689 0.8235 1.8128 1.4877 0.4439 0.6643 0.6808 1.4453 0.6808 2.2442 0 0.5305-0.1045 1.0558-0.3075 1.5458-0.203 0.4901-0.5006 0.9354-0.8756 1.3105-0.3751 0.3751-0.8204 0.6727-1.3105 0.8757s-1.0154 0.3074-1.5459 0.3074zm0-20.564c-0.7989 1e-4 -1.5799-0.2369-2.2441-0.6807-0.6643-0.4439-1.1821-1.0747-1.4878-1.8128s-0.3857-1.5503-0.2299-2.3339c0.1559-0.78357 0.5406-1.5033 1.1055-2.0682 0.565-0.56493 1.2847-0.94965 2.0683-1.1055s1.5958-0.07587 2.3339 0.22986c0.7381 0.30574 1.3689 0.82348 1.8128 1.4878s0.6808 1.4453 0.6808 2.2442c0 0.5305-0.1045 1.0558-0.3075 1.5458-0.203 0.4901-0.5006 0.9354-0.8756 1.3105-0.3751 0.3751-0.8204 0.6727-1.3105 0.8757s-1.0154 0.3075-1.5459 0.3074z" fill="#3F3D56"/>
<path d="m10.901 12.667c-1.09 0-10.649-0.0515-10.649-1.8361 0-1.7846 9.5594-1.8361 10.649-1.8361v0.73444c-5.6304 0-9.2812 0.63024-9.8692 1.1016 0.58794 0.4714 4.2388 1.1017 9.8692 1.1017 5.6178 0 9.2648-0.6276 9.865-1.0984-0.2856-0.2018-1.4525-0.6246-4.5823-0.89514l0.0632-0.73157c5.3034 0.4583 5.3034 1.3048 5.3034 1.6234 0 1.7846-9.5593 1.8361-10.649 1.8361z" fill="#2F2E41"/>
<path d="m10.901 32.865c-1.09 0-10.649-0.0515-10.649-1.8361 0-1.7847 9.5594-1.8361 10.649-1.8361v0.7344c-5.6303 0-9.2811 0.6303-9.8691 1.1017 0.58794 0.4714 4.2388 1.1017 9.8691 1.1017 5.6178 0 9.2649-0.6276 9.8651-1.0985-0.2857-0.2017-1.4525-0.6245-4.5823-0.8951l0.0632-0.7315c5.3034 0.4583 5.3034 1.3048 5.3034 1.6234 0 1.7846-9.5594 1.8361-10.649 1.8361z" fill="#2F2E41"/>
<path d="m10.901 53.429c-1.09 0-10.649-0.0514-10.649-1.8361s9.5594-1.8361 10.649-1.8361v0.7344c-5.6304 0-9.2812 0.6303-9.8692 1.1017 0.58794 0.4714 4.2388 1.1017 9.8692 1.1017 5.6178 0 9.2648-0.6276 9.865-1.0985-0.2856-0.2017-1.4525-0.6245-4.5823-0.8951l0.0632-0.7315c5.3034 0.4583 5.3034 1.3048 5.3034 1.6234 0 1.7847-9.5593 1.8361-10.649 1.8361z" fill="#2F2E41"/>
<path d="m10.901 73.993c-1.09 0-10.649-0.0515-10.649-1.8362 0-1.7846 9.5594-1.8361 10.649-1.8361v0.7345c-5.6303 0-9.2811 0.6302-9.8691 1.1016 0.58794 0.4715 4.2388 1.1017 9.8691 1.1017 5.6178 0 9.2649-0.6276 9.8651-1.0984-0.2857-0.2017-1.4525-0.6246-4.5823-0.8951l0.0632-0.7316c5.3034 0.4583 5.3034 1.3048 5.3034 1.6235 0 1.7846-9.5594 1.8361-10.649 1.8361z" fill="#2F2E41"/>
<path d="m10.901 94.558c-1.09 0-10.649-0.0515-10.649-1.8361 0-1.7847 9.5594-1.8361 10.649-1.8361v0.7344c-5.6304 0-9.2812 0.6303-9.8692 1.1017 0.58794 0.4714 4.2388 1.1016 9.8692 1.1016 5.6178 0 9.2648-0.6276 9.8651-1.0984-0.2857-0.2017-1.4526-0.6245-4.5824-0.8951l0.0632-0.7316c5.3034 0.4583 5.3034 1.3048 5.3034 1.6235 0 1.7846-9.5593 1.8361-10.649 1.8361z" fill="#2F2E41"/>
<path d="m10.901 115.12c-1.09 0-10.649-0.052-10.649-1.836 0-1.785 9.5594-1.837 10.649-1.837v0.735c-5.6304 0-9.2812 0.63-9.8692 1.102 0.58794 0.471 4.2388 1.101 9.8692 1.101 5.6178 0 9.2648-0.627 9.865-1.098-0.2856-0.202-1.4525-0.625-4.5823-0.895l0.0632-0.732c5.3034 0.458 5.3034 1.305 5.3034 1.624 0 1.784-9.5593 1.836-10.649 1.836z" fill="#2F2E41"/>
<path d="m10.901 135.69c-1.09 0-10.649-0.052-10.649-1.836 0-1.785 9.5594-1.836 10.649-1.836v0.734c-5.6304 0-9.2812 0.63-9.8692 1.102 0.58794 0.471 4.2388 1.101 9.8692 1.101 5.6178 0 9.2648-0.627 9.865-1.098-0.2856-0.202-1.4525-0.625-4.5823-0.895l0.0632-0.732c5.3034 0.459 5.3034 1.305 5.3034 1.624 0 1.784-9.5593 1.836-10.649 1.836z" fill="#2F2E41"/>
<path d="m10.901 156.25c-1.09 0-10.649-0.051-10.649-1.836 0-1.784 9.5594-1.836 10.649-1.836v0.735c-5.6304 0-9.2812 0.63-9.8692 1.101 0.58795 0.472 4.2388 1.102 9.8692 1.102 5.6178 0 9.2648-0.628 9.8651-1.099-0.2857-0.201-1.4525-0.624-4.5824-0.895l0.0632-0.731c5.3035 0.458 5.3035 1.305 5.3035 1.623 0 1.785-9.5594 1.836-10.649 1.836z" fill="#2F2E41"/>
<path d="m10.901 176.82c-1.09 0-10.649-0.052-10.649-1.837 0-1.784 9.5594-1.836 10.649-1.836v0.735c-5.6304 0-9.2812 0.63-9.8692 1.101 0.58794 0.472 4.2388 1.102 9.8692 1.102 5.6178 0 9.2648-0.628 9.865-1.098-0.2856-0.202-1.4525-0.625-4.5823-0.895l0.0632-0.732c5.3034 0.458 5.3034 1.305 5.3034 1.623 0 1.785-9.5593 1.837-10.649 1.837z" fill="#2F2E41"/>
<path d="m10.901 197.38c-1.09 0-10.649-0.052-10.649-1.836 0-1.785 9.5594-1.836 10.649-1.836v0.734c-5.6304 0-9.2812 0.63-9.8692 1.102 0.58794 0.471 4.2388 1.101 9.8692 1.101 5.6178 0 9.2648-0.627 9.8651-1.098-0.2857-0.202-1.4526-0.624-4.5824-0.895l0.0632-0.732c5.3034 0.459 5.3034 1.305 5.3034 1.624 0 1.784-9.5593 1.836-10.649 1.836z" fill="#2F2E41"/>
<path d="m10.901 217.94c-1.09 0-10.649-0.052-10.649-1.836 0-1.785 9.5594-1.836 10.649-1.836v0.734c-5.6304 0-9.2812 0.63-9.8692 1.102 0.58794 0.471 4.2388 1.101 9.8692 1.101 5.6178 0 9.2648-0.627 9.865-1.098-0.2856-0.202-1.4525-0.624-4.5823-0.895l0.0632-0.732c5.3034 0.459 5.3034 1.305 5.3034 1.624 0 1.784-9.5593 1.836-10.649 1.836z" fill="#2F2E41"/>
<path d="m141.33 71.242h-87.765c-0.6875-4e-4 -1.3465-0.1453-1.8327-0.403-0.4861-0.2577-0.7595-0.607-0.7603-0.9714v-18.185c8e-4 -0.3645 0.2742-0.7138 0.7603-0.9715 0.4862-0.2577 1.1452-0.4026 1.8327-0.403h87.765c0.688 4e-4 1.347 0.1453 1.833 0.403s0.76 0.607 0.76 0.9715v18.185c0 0.3644-0.274 0.7137-0.76 0.9714s-1.145 0.4026-1.833 0.403z" fill="#fff"/>
<g clip-path="url(#clip1)">
<path d="m150.92 159.82c0.01 7.675-1.544 15.272-4.566 22.327l-0.188 0.432c-5.113 11.632-13.978 21.212-25.178 27.211-11.201 5.998-24.089 8.067-36.604 5.877-0.3406-0.061-0.6805-0.123-1.0199-0.188-3.507-0.68-6.9411-1.693-10.256-3.025-0.5384-0.216-1.073-0.44-1.6036-0.672-0.3623-0.158-0.7246-0.321-1.0836-0.488-9.8198-4.551-18.134-11.815-23.962-20.935s-8.9281-19.716-8.9339-30.539c0-31.313 25.385-56.697 56.697-56.697 31.313 0 56.698 25.384 56.698 56.697z" fill="#2F2E41"/>
<path d="m84.379 215.66c-0.3405-0.061-0.6805-0.123-1.0199-0.188-0.2214-6.426-0.9813-19.616-3.5729-33.43-1.4175-7.56-3.3851-15.31-6.1143-22.237-0.935-2.397-2.0029-4.741-3.1989-7.019-2.7577-5.208-6.1025-9.593-10.158-12.564l0.5972-0.815c3.3733 2.473 6.405 5.944 9.095 10.414 0.8069 1.338 1.5818 2.766 2.3249 4.284 0.7968 1.624 1.5567 3.347 2.2797 5.171 0.4613 1.161 0.9069 2.362 1.3369 3.603 1.872 5.39 3.4633 11.539 4.774 18.449 0.2902 1.526 0.5664 3.09 0.8286 4.692 2.0314 12.408 2.6437 23.879 2.8282 29.64z" fill="#07C5AE" opacity=".2"/>
<path d="m71.5 211.78c-0.3623-0.158-0.7247-0.321-1.0836-0.488-0.3506-3.808-0.9947-8.532-2.1723-13.016-0.5158-2.013-1.1779-3.987-1.9811-5.904-1.3436-3.145-3.0831-5.819-5.3326-7.468l0.5972-0.814c2.3551 1.725 4.1718 4.451 5.5758 7.639 1.5819 3.593 2.637 7.775 3.3398 11.771 0.5217 2.967 0.8505 5.834 1.0568 8.28z" fill="#07C5AE" opacity=".2"/>
<path d="m54.674 140.2c2.7874 0 5.0471-2.26 5.0471-5.047 0-2.788-2.2597-5.047-5.0471-5.047-2.7875 0-5.0472 2.259-5.0472 5.047 0 2.787 2.2597 5.047 5.0472 5.047z" fill="#07C5AE" opacity=".2"/>
<path d="m56.299 183.65c2.7875 0 5.0472-2.26 5.0472-5.047 0-2.788-2.2597-5.047-5.0472-5.047-2.7874 0-5.0471 2.259-5.0471 5.047 0 2.787 2.2597 5.047 5.0471 5.047z" fill="#07C5AE" opacity=".2"/>
<path d="m74.711 143.63c-1.0702 6.039 1.2924 11.506 1.2924 11.506s4.098-4.322 5.1683-10.36c1.0702-6.039-1.2924-11.506-1.2924-11.506s-4.098 4.322-5.1683 10.36z" fill="#07C5AE" opacity=".2"/>
<path d="m57.937 157.97c5.7595 2.106 11.547 0.754 11.547 0.754s-3.5505-4.766-9.31-6.872-11.547-0.754-11.547-0.754 3.5505 4.766 9.3099 6.872z" fill="#07C5AE" opacity=".2"/>
<path d="m56.961 196.44c4.037 1.476 8.0992 0.513 8.0992 0.513s-2.4828-3.356-6.5198-4.832c-4.0369-1.477-8.0992-0.514-8.0992-0.514s2.4829 3.357 6.5198 4.833z" fill="#07C5AE" opacity=".2"/>
<path d="m94.101 172.37c12.207 0 22.104-9.896 22.104-22.104 0-12.207-9.897-22.103-22.104-22.103-12.208 0-22.104 9.896-22.104 22.103 0 12.208 9.8961 22.104 22.104 22.104z" fill="#A0616A"/>
<path d="m85.467 167.19s2.763 13.124 2.763 14.505c0 1.382 13.124 7.598 13.124 7.598l11.742-2.072 4.145-12.433s-6.908-10.361-6.908-14.506l-24.866 6.908z" fill="#A0616A"/>
<path d="m146.35 182.14-0.188 0.433c-5.113 11.631-13.978 21.212-25.178 27.21s-24.089 8.067-36.604 5.877c-0.3405-0.06-0.6804-0.123-1.0198-0.188-3.507-0.68-6.9412-1.693-10.256-3.024-0.5385-0.217-1.073-0.441-1.6036-0.673-0.3624-0.158-0.7247-0.32-1.0837-0.488-3.2537-1.508-6.3569-3.321-9.2678-5.415l-2.6201-7.6 1.4727-1.124 6.2619-4.781 0.8404-0.642 12.683-9.682 0.936-0.715 6.5923-5.032 0.0017-2e-3s7.1291 11.616 17.49 8.162c10.362-3.453 10.135-13.357 10.135-13.357l31.407 11.041z" fill="#3A3768"/>
<path d="m74.933 132.46s7.0179-15.205 20.469-11.697c13.45 3.509 21.054 8.773 21.638 14.036s-0.293 13.158-0.293 13.158-1.462-10.819-10.819-8.479c-9.3569 2.339-23.977 0.584-23.977 0.584l-2.3393 21.054s-2.6317-3.802-5.5558-1.462c-2.9241 2.339-8.4798-22.516 0.8772-27.194z" fill="#3A3768"/>
<path d="m73.104 212.45c-0.5384-0.216-1.073-0.44-1.6036-0.672-0.3623-0.158-0.7247-0.321-1.0836-0.488-5.3814-2.496-10.339-5.818-14.693-9.847 1.5416-2.1 2.8047-3.169 2.8047-3.169h10.362l1.5533 5.224 2.6604 8.952z" fill="#3A3768"/>
<path d="m137.27 181.01 8.889 1.57c-2.379 5.419-5.592 10.432-9.521 14.857l0.632-16.427z" fill="#3A3768"/>
</g>
</g>
<defs>
<clipPath id="a">
<rect width="176" height="227" fill="#fff"/>
</clipPath>
</defs>
</svg>

Как вы видите на изображении выше, skewed часть пути скрыта, как я могу увеличить границу svg, чтобы путь был виден даже после skewed
Свободный перевод вопроса Part of svg getting hidden after transformation от участника  @Hileamlak 2.

A: Если вам интересно, вы можете добиться того же с помощью только CSS.

.box{
  width:300px;
  height:400px;
  padding-left:28px;
  box-sizing:border-box;
  border-radius:0 15px 15px 0;
  margin-left:30px;
  position:relative;
  display:flex;
  flex-direction:column;
  transform-origin:left center;
  transform:perspective(300px) rotateY(0deg);
  transform-style:preserve-3d;
  transition:0.5s;
  background:
      radial-gradient(circle 10px,transparent 98%,#3f3d56 100%) 0 0/30px 40px repeat-y,
      linear-gradient(#3f3d56 0 0) content-box content-box;
}
.box img {
  border-radius:50%;
  max-width:80%;
  margin:auto auto 20px;
}
.box h1 {
  margin:50px auto auto;
  background:#fff;
  color:#000;
}
.box:before,
.box:after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:-20px;
  width:40px;
  background:
      radial-gradient(20px 8px at var(--p,top),transparent calc(100% - 5px),
         red calc(100% - 4px) calc(100% - 2px),
         transparent 100%) 0 20px/100% 40px;
}

.box:after {
  --p:bottom;
  transform:translateZ(-1px)
}

.box:hover {
 transform:perspective(300px) rotateY(30deg);
}

body {
  background:#f0f0f0;
}

title here

Свободный перевод  ответа от участника  Temani Afif.


text:
Q: Why do you need to fold/unfold using coalesce for a conditional insert? I'm trying to understand how this pattern for a conditional insert works:
g.V()
  .hasLabel('person').has('name', 'John')
  .fold()
  .coalesce(
    __.unfold(),
    g.addV('person').property('name', 'John')
  ).next();

What is the purpose of the fold/unfold? Why are these necessary, and why does this not work:
g.V()
  .coalesce(
    __.hasLabel('person').has('name', 'John'),
    g.addV('person').property('name', 'John')
  ).next();

The fold-then-unfold pattern seems redundant to me and yet the above does not yield the same result.

A: Consider what happens when you just do the following:
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().has('name','marko')
==>v[1]
gremlin> g.V().has('name','stephen')
gremlin>

For "marko" you return something and for "stephen" you do not. The "stephen" case is the one to pay attention to because that is the one where the fold() truly becomes important in this pattern. When that traversal returns nothing, any steps you add after that will not have a Traverser present to trigger actions in those steps. Therefore even the following will not add a vertex:
gremlin> g.V().has('name','stephen').addV('person')
gremlin>

But looks what happens if we fold():
gremlin> g.V().has('name','stephen').fold()
==>[]

fold() is a reducing barrier step and will thus eagerly evaluate the traversal up to that point and return the contents as a List even if the contents of that traversal up to that point yield nothing (in which case, as you can see, you get an empty list). And if you have an empty List that empty List is a Traverser flowing through the traversal and therefore future steps will fire:
gremlin> g.V().has('name','stephen').fold().addV('person')
==>v[13]

So that explains why we fold() because we are checking for existence of "John" in your example and if he's found then he will exist in the List and when that List with "John" hits coalesce() its first check will be to unfold() that List with "John" and return that Vertex - done. If the List is empty and returns nothing because "John" does not exist then it will add the vertex (by the way, you don't need the "g." in front of addV(), it should just be an anonymous traversal and thus __.addV('person')).
Turning to your example, I would first point out that I think you wanted to ask about this:
g.V().
  coalesce(
    __.has('person','name', 'John'),
    __.addV('person').property('name', 'John'))

This is a completely different query. In this traversal, you're saying iterate all the vertices and for each one execute what is in the coalesce(). You can see this fairly plainly by replacing the addV() with constant('x'):
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().
......1>   coalesce(
......2>     has('person','name', 'John'),
......3>     constant('x'))
==>x
==>x
==>x
==>x
==>x
==>x
gremlin> g.V().
......1>   coalesce(
......2>     has('person','name', 'marko'),
......3>     constant('x'))
==>v[1]
==>x
==>x
==>x
==>x
==>x

Now, imagine what happens with addV() and "John". It will call addV() 6 times, once for each vertex it comes across that is not "John":
gremlin> g.V().
......1>   coalesce(
......2>     __.has('person','name', 'John'),
......3>     __.addV('person').property('name', 'John'))
==>v[13]
==>v[15]
==>v[17]
==>v[19]
==>v[21]
==>v[23]

Personally, I like the idea of wrapping up this kind of logic in a Gremlin DSL - there is a good example of doing so here.
Nice question - I've described the "Element Existence" issue as part of a Gremlin Recipe that can be read here.


text:
Q: Show ProgressDialog in Fragment class I am trying to show a ProgressDialog within a Fragment class. The following code just works within an Activity class but not for Fragment. Can somebody please help me on this, why this ProgressDialog implementaion just works within an Activity and not for a Fragment?
private class ProcessUpdateProfile extends
        AsyncTask<String, String, JSONObject> {

    private ProgressDialog nDialog;

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        nDialog = new ProgressDialog(PFragment.this); //Here I get an error: The constructor ProgressDialog(PFragment) is undefined
        nDialog.setMessage("Loading..");
        nDialog.setTitle("Checking Network");
        nDialog.setIndeterminate(false);
        nDialog.setCancelable(true);
        nDialog.show();

    }
}

A: Try this in Fragment
 nDialog = new ProgressDialog(getActivity());

A: ProgressDialog take Context input so use getActivity() in object creation.
ProgressDialog dialog = ProgressDialog.show(getActivity(), "Loading...", "Please wait...", true);


text:
Q: Why PUSHAD instruction stores ESP? Why PUSHAD instruction bother to store ESP? If I want to use POPAD to restore ESP, I have to know the correct content of ESP before I use POPAD. It seems useless to store ESP in PUSHAD.
Can anyone provide some explanation? Thanks.

A: According to my research, the PUSHA instruction was introduced in 1982 in processor Wikipedia: Intel 80286.
Document "Intel 80286 Programmer's Reference Manual 1987" explains it's purpose using words:

...PUSHA (Push All Registers) saves the contents of the eight general
  registers on the stack... This instruction simplifies
  procedure calls by reducing the number of instructions required to retain
  the contents of the general registers for use in a procedure. PUSHA is
  complemented by POPA...
...POPA (Pop All Registers) pops the eight general registers given in the description above,
  except that the SP value is discarded instead of loaded into SP. POPA
  reverses a previous PUSHA, restoring the general registers to their values
  before PUSHA was executed...
...An interrupt service routine may affect registers other than other IP, CS,
  and FLAGS. It is the responsibility of an interrupt routine to save
  additional context information before proceeding so that the state of the
  machine can be restored upon completion of the interrupt service routine
  (PUSHA and POPA instructions are intended for these operations). Finally,
  execution of the IRET instruction pops the old IP, CS, and FLAGS from the
  stack and resumes the execution of the interrupted program...
...In general, the system designer is free to use almost any interrupt vectors
  for any given purpose. Some of the lowest-numbered vectors, however, are
  reserved by Intel for dedicated functions; their use is specifically implied
  by certain types of exceptions. None of the first 32 vectors should be
  defined by the user; these vectors are either invoked by pre-defined
  exceptions or reserved by Intel for future expansion...

My loose translation is that it should be an easy way to create a snapshot of processor's "state" in a point of time such that it can be examined by exception handlers and appropriate corrective actions taken. Examination of caller's stack frames is one of the things that may be needed.
Once this design decision was made, if was practically fixed and frozen until today because "fully backwards compatible instruction set" is typical characteristics of the x86 architecture (see Wikipedia: x86, Wikipedia: x86-64)

delphifirst: Why PUSHAD instruction bother to store ESP?

It does it. Period. Why engineers 30 years ago decided that.. is nowadays pointless question with no impact on programming decisions of nowadays programmers


text:
Q: Argument passing to using popen3 (spawn)? I am trying to write a gem that interacts with the Android ADB command. I am having trouble trying to understand how arguments are passed to sub-processes.
I am using the POpen4 gem, which is just a wrapper around the platforms specific open3/open4 modules. On OSX I run the following and I get back the desired output:
>> require 'POpen4'
=> true
>> POpen4::popen4("/Library/android-sdk-mac_x86/platform-tools/adb shell pm list packages -f") do |pout, perr, pin|
?> pout.each { |line| puts line.to_s.strip }
>> end
package:/system/app/Fallback.apk=com.android.fallback
package:/system/app/SoundRecorder.apk=com.android.soundrecorder
..<snip>..
package:/system/app/VpnServices.apk=com.android.server.vpn
=> #<Process::Status: pid=13833,exited(0)>

When I run the same on Win32 I get:
irb(main):001:0> require 'POpen4'
=> true
irb(main):002:0> POpen4::popen4("C:\\Android\\android-sdk-windows\\platform-tools\\adb.exe shell pm list packages -f")
Errno::ENOENT: No such file or directory - C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f
        from C:/Ruby192/lib/ruby/1.9.1/open3.rb:202:in `spawn'
        from C:/Ruby192/lib/ruby/1.9.1/open3.rb:202:in `popen_run'
        from C:/Ruby192/lib/ruby/1.9.1/open3.rb:90:in `popen3'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/win32-open3-19-0.0.1/lib/win32/open3.rb:5:in `popen4'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/POpen4-0.1.4/lib/popen4.rb:48:in `popen4'
        from (irb):2
        from C:/Ruby192/bin/irb:12:in `<main>'

If I monitor what Ruby is doing using procexp I can see that it is treating the whole argument to popen4 as the command to run:
ruby.exe    5800    QueryDirectory  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.exe NO SUCH FILE
ruby.exe    5800    QueryOpen   C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.exe FAST IO DISALLOWED
ruby.exe    5800    CreateFile  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.exe NAME NOT FOUND
ruby.exe    5800    QueryDirectory  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.com NO SUCH FILE
ruby.exe    5800    QueryOpen   C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.com FAST IO DISALLOWED
ruby.exe    5800    CreateFile  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.com NAME NOT FOUND
ruby.exe    5800    QueryDirectory  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.cmd NO SUCH FILE
ruby.exe    5800    QueryOpen   C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.cmd FAST IO DISALLOWED
ruby.exe    5800    CreateFile  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.cmd NAME NOT FOUND
ruby.exe    5800    QueryDirectory  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.bat NO SUCH FILE
ruby.exe    5800    QueryOpen   C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.bat FAST IO DISALLOWED
ruby.exe    5800    CreateFile  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f.bat NAME NOT FOUND
ruby.exe    5800    CreateFile  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f NAME NOT FOUND
ruby.exe    5800    CreateFile  C:\Android\android-sdk-windows\platform-tools\adb.exe shell pm list packages -f NAME NOT FOUND

Although the popen3 docs say that this should be treated as command line and arguments:
The parameters +cmd…+ is passed to Process.spawn. So a commandline string and list of argument strings can be accepted as follows.

  Open3.popen3("echo a") {|i, o, e, t| ... }
  Open3.popen3("echo", "a") {|i, o, e, t| ... }
  Open3.popen3(["echo", "argv0"], "a") {|i, o, e, t| ... }

What am I missing here?


text:
Q: RaspBerry Pi3: Trying to put a lua file in lutro (recalbox) not working I'm currently trying to run a Lua file (A game developed by my class for a school project) on lutro which is in Recalbox (OS running on a raspberry pi3). After many tries, I and my group discovered that only .lutro files can be launched on lutro. However, I can't find any way to create a .lutro file or to convert a .lua file into a .lutro file. The final goal is to launch a game coded in lua on a raspberry pi3. What it does now: It runs .lutro games perfectly, but it doesn't launch Lua files, it runs the game for 2 seconds and automatically exits the game (With nothing showing up on the screen).
I would need help very soon, my group's time is running out D:


text:
Q: Flutter Web: FCM cannot register Service Worker I am trying to implement FCM notification inside a Flutter Web application but I am getting errors when registering my service worker. I think it might come from the way my files index.html and firebase-messaging-sw.js are made.
index.html
<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>MyApp</title>
</head>

<body>
  <script src="https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js"></script>

  <script>
    // Your web app's Firebase configuration
    // For Firebase JS SDK v7.20.0 and later, measurementId is optional
    var devConfig = {
      apiKey: "API_KEY",
      authDomain: "AUTH_DOMAIN",
      databaseURL: "DB_URL",
      projectId: "PROJECT_ID",
      storageBucket: "STORAGE_BUCKET",
      messagingSenderId: "MESSAGING_SENDER_ID",
      appId: "APP_ID",
      measurementId: "MEASUREMENT_ID"
    };

    // Initialize Firebase
    firebase.initializeApp(devConfig);
  </script>

  <script>
    if ("serviceWorker" in navigator) {
      window.addEventListener("load", function () {
        navigator.serviceWorker.register("/firebase-messaging-sw.js");
      });
    }
  </script>

  <script src="main.dart.js" type="application/javascript"></script>
</body>

</html>

firebase-messaging-sw.js
importScripts('https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/7.5.0/firebase-messaging.js');

var devConfig = {
   apiKey: "API_KEY",
   authDomain: "AUTH_DOMAIN",
   databaseURL: "DB_URL",
   projectId: "PROJECT_ID",
   storageBucket: "STORAGE_BUCKET",
   messagingSenderId: "MESSAGING_SENDER_ID",
   appId: "APP_ID",
   measurementId: "MEASUREMENT_ID"
};

// Initialize the Firebase app in the service worker by passing in
// your app's Firebase config object.
// https://firebase.google.com/docs/web/setup#config-object
firebase.initializeApp(devConfig);

// Retrieve an instance of Firebase Messaging so that it can handle background
// messages.
const messaging = firebase.messaging();
messaging.setBackgroundMessageHandler(function (payload) {
    console.log('[firebase-messaging-sw.js] Received background message ', payload);
    // Customize notification here
    const notificationTitle = 'Background Message Title';
    const notificationOptions = {
        body: 'Background Message body.',
        icon: '/firebase-logo.png'
    };

    return self.registration.showNotification(notificationTitle,
        notificationOptions);
});

Errors
Uncaught FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
    at p (https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js:1:10100)
    at Object.o [as messaging] (https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js:1:9710)
    at http://localhost:56234/firebase-messaging-sw.js:33:28

Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('http://localhost:56234/') with script ('http://localhost:56234/firebase-messaging-sw.js'): ServiceWorker script evaluation failed

*

*I am testing the application using the command flutter run -d web-server.

*I am correctly calling await Firebase.initializeApp() before starting my application in my main.dart.

*I am using the package firebase_core: ^0.5.0.

*I have tested with firebase scripts in version 7.22.1 and 7.5.0.

A: add follow ing in your index.html
<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-messaging.js"></script>


text:
Q: java, xenserver, does anybody knows how to run a command on a virtual machine? i'm using XenServer, i'm connecting the pool, getting the list of all VM.
now i need to loging to the VM.
and to execute an exe file on all VM.
anyone has any idea ?
Thank you!
connection = new Connection(url);
Session.loginWithPassword(connection, userName, Password, APIVersion.latest().toString());

Map<VM, VM.Record> vms = VM.getAllRecords(connection);
for (VM.Record record : vms.values()){
    if (!record.isATemplate){
        // now i need somehow to connect with the VM username and password
        // now i need to run an exe file.
    }
}

A: As far as I know, XenServer API doesn't provide any api that can execute commands in VM. And IMHO, a VMM like XenServer or VMware should not have the right to execute commands in any VM that it hosts. So , why not get the ip of all the vm and use some ssh libraries to execute the commands ?

A: Use sshj's Session.exec() to execute remote commands via ssh. There's an example of doing this in the Github repo.


text:
Q: SQL convert DATETIME TO VARCHAR? I am working on a query something require DATE!!
DECLARE @YesterDay DATETIME, @Today DATETIME

SET @YesterDay = DateAdd(DD, DateDiff(DD, 0, GETDATE())-1, 0)
SET @Today = DateAdd(DD, DateDiff(DD, 0, GETDATE()), 0)
select @YesterDay = convert(varchar, getdate()-1 , 110)
select @Today = convert(varchar, getdate() , 110)
EXEC    @return_value = [dbo].[post_sec_admin_list_user_log]
        @pDateFr = @YesterDay ,
        @pDateTo = @Today,
        @pName = '',
        @pSec = NULL

@DateFr is varchar(50)
@DateT0 is varchar(50)

the @dateFr and @dateTo are both varchar..
And I try to execute it, it print the time format as this 2011-06-09 16:15:38.927
error statement

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

Additionally, the varchar format I need is MM-DD-YYYY
Anyone know where is my error at?
thanks

A: Your code is confusing:
DECLARE @YesterDay DATETIME, @Today DATETIME
SET @YesterDay = DateAdd(DD, DateDiff(DD, 0, GETDATE())-1, 0)
SET @Today = DateAdd(DD, DateDiff(DD, 0, GETDATE()), 0)
select @YesterDay = convert(varchar, getdate()-1 , 110)
select @Today = convert(varchar, getdate() , 110)

So you declare it as DATETIME, set value with DateDiff then overwrite that value with an varchar representation of a date that is recalculated using different method.
At line 4 and 5 @Yesterday and @Today variables are still DATETIME, because it's declared that way.
EDIT: As mentioned in the comment to my answer you need a variable to pass to the procedure.
So the correct fix would be to declare the variables as VARCHAR(50) at the beginning and do the conversion directly.
DECLARE @YesterDay VARCHAR(50), @Today VARCHAR(50)
SELECT @YesterDay = convert(varchar(50), dateadd(dd, -1, getdate()) , 110)
SELECT @Today = convert(varchar(50), getdate() , 110)

And then call the procedure the way you did originally.

A: My guess is that getdate()-1 part is wrong.
Also, you were making dateadd and datediff why? Try it like this:
SET @YesterDay = dateadd(dd, -1, GETDATE())
SET @Today = GETDATE()
select @YesterDay = convert(varchar(50), dateadd(dd, -1, getdate()) , 110)
select @Today = convert(varchar(50), getdate() , 110)
EXEC    @return_value = [dbo].[post_sec_admin_list_user_log]
        @pDateFr = @YesterDay ,
        @pDateTo = @Today,
        @pName = '',
        @pSec = NULL


text:
Q: physical meaning of heat equation consider the heat equation
$u_t=a(t)u_{xx}+f(x,t)$, $0<x<L$, $0<t<T$
subject to the initial condition
$u(x,0)=g(x)$
and boundary conditions
$u(1,t)=0,$ $u_x(0,t)+hu(0,t)=0$
where the functions $f,g$ and the constant$h$ is known.
My question is about meaning of this model in diverse scientific field. Such as in physics, chemistry, biology etc. can you give me some example about what it models in these area ? What does the boundary conditions model? and Is there any relationship between $a(t)$ and $h$?
Please help me about this problem. I really wonder the answers of these questions.
Thanks in advance!

A: For example, it can model a process of heating a rod with time-depending heat conductivity coefficient (it can either rise or decay), for example, there is a chemical reaction in a rod, and a material (consequently, conductivity coefficient) changes with time. The boundary condition tells us that on one side of rod the temperature is constant, and on another a heat flow is constant (you might have made a mistake in a text, because in this moment your problem is ill-posed), which says us, for example, that there is a constant heat exchange with something. Here $a$ and $h$ can be both dependent and independent, because $a $ is a characteristic of rod, and $h$ is a characteristic of media, in which this rod is situated


text:
Q: Calculating partial derivatives python I am little bit confused how to calculate the partial derivatives of sigmoid function in python. Since in general we can calculate that by using the given code:
Example: f(x,y) = x4 + x * y4
w.r.t x. would be then :
import sympy as sym
#Derivatives of multivariable function
x , y = sym.symbols('x y')
f = x4+x*y4
#Differentiating partially w.r.t x
derivative_f = f.diff(x)
derivative_f
how would the code work for partial derivatives of this then:

I tried to sub to the same function but I think I am doing something incorrectly


text:
Q: Saving object while the object could be changed I want to serialize an object and after that it shall be saved to the disk. The serialization takes a lot of time. So instead of serializing it synchronously, I want to save the "freezed" data at this point. But because of the size of the object, it should not be deep copied.
Is there any technique to do it?
Graph to show the procedure:


text:
Q: Pause function while JSON call is running I would like my save button to run the JSON call and then finish it's function, but it finishes the function while running the JSON call, so the variables become initialized as nil.
My DeviceDetailViewController.m
//
//  DeviceDetailViewController.m
//  Steam Backpack Viewer
//
//  Created by Vishwa Iyer on 5/22/14.
//  Copyright (c) 2014 MoAppsCo. All rights reserved.
//

#import "DeviceDetailViewController.h"
#import "MasterViewController.h"
#import "ProfileManager.h"
#import "ProfileCommunicator.h"
#import "SteamProfile.h"
#import "DeviceViewController.h"

@interface DeviceDetailViewController () <ProfileManagerDelegate> {
    ProfileManager *_manager;
    NSArray *profile;
    SteamProfile *s;
}
extern NSString *ID;

@end

@implementation DeviceDetailViewController

- (NSManagedObjectContext *)managedObjectContext {
    NSManagedObjectContext *context = nil;
    id delegate = [[UIApplication sharedApplication] delegate];
    if ([delegate performSelector:@selector(managedObjectContext)]) {
        context = [delegate managedObjectContext];
    }
    return context;
}

- (IBAction)cancel:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (IBAction)save:(id)sender {
    NSManagedObjectContext *context = [self managedObjectContext];

    // Create a new managed object
    NSManagedObject *newDevice = [NSEntityDescription insertNewObjectForEntityForName:@"BackpackViewer" inManagedObjectContext:context];
    [newDevice setValue:self.steamIDTextField.text forKey:@"steamID"];
    ID = [NSString stringWithFormat:@"%@", [newDevice valueForKey:@"steamID"]];

    [self startFetchingGroups]; // I would like this JSON call to finish before calling the rest of the function below

    [newDevice setValue:s.personaname forKey:@"steamName"];
    [newDevice setValue:s.avatar forKey:@"imageURL"];

    NSError *error = nil;
    // Save the object to persistent store
    if (![context save:&error]) {
        NSLog(@"Can't Save! %@ %@", error, [error localizedDescription]);
    }
    [self dismissViewControllerAnimated:YES completion:nil];

}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    _manager = [[ProfileManager alloc] init];
    _manager.communicator = [[ProfileCommunicator alloc] init];
    _manager.communicator.delegate = _manager;
    _manager.delegate = self;
    // Do any additional setup after loading the view.
}

- (void)startFetchingGroups
{
    [_manager fetchGroups];
}

- (void)didReceieveProfileInfo:(NSArray *)groups
{
    //the JSON call finishes here, when the groups are receives from the call. I would then like the rest of the save button method above to run after this runs, so that the s variable (which corresponds to a SteamProfile object) becomes initialized correctly.
    profile = groups;
    s = [profile objectAtIndex:0];
    NSLog(s.personaname);

}

- (void)fetchingGroupsFailedWithError:(NSError *)error
{
    NSLog(@"Error %@; %@", error, [error localizedDescription]);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

A: I think you looking for something like this. Note this syntax could be wrong it is untested. I will leave it to you to read the documentation on function call backs.
@interface MyClass: NSObject
{
    void (^_completionHandler)(int someParameter);
}

- (void)startFetchingGroups:(void(^)(int))handler;
@end

@implementation MyClass

- (void)startFetchingGroups:(void(^)(void))handler
{
    [_manager fetchGroups];
    if (handler) {
        handler();
    }
}

@end

[var startFetchingGroups:^{
     [newDevice setValue:s.personaname forKey:@"steamName"];
    [newDevice setValue:s.avatar forKey:@"imageURL"];

    NSError *error = nil;
    // Save the object to persistent store
    if (![context save:&error]) {
        NSLog(@"Can't Save! %@ %@", error, [error localizedDescription]);
    }
    [self dismissViewControllerAnimated:YES completion:nil];
}];

The behavior of when a callback gets called depends on what the _manager fetchGroups actually does. You could also use delegation as some of the people in the comments suggested, and is definatly a clean solution as well.

A: Sorry for ugly formatting. This code does exactly what you want..
#import "DeviceDetailViewController.h"
#import "MasterViewController.h"
#import "ProfileManager.h"
#import "ProfileCommunicator.h"
#import "SteamProfile.h"
#import "DeviceViewController.h"

typedef void(^EmptyBlock_t)();

@interface DeviceDetailViewController () <ProfileManagerDelegate> {
    ProfileManager *_manager;
    NSArray *profile;
    SteamProfile *s;

    //  1
    //  here you define a block, an anonymous function pointer that will be called right after you callback is called..
    EmptyBlock_t _blockAfterJSONFetched;
}
extern NSString *ID;

@end

@implementation DeviceDetailViewController

- (NSManagedObjectContext *)managedObjectContext {
    NSManagedObjectContext *context = nil;
    id delegate = [[UIApplication sharedApplication] delegate];
    if ([delegate performSelector:@selector(managedObjectContext)]) {
        context = [delegate managedObjectContext];
    }
    return context;
}

- (IBAction)cancel:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (IBAction)save:(id)sender {
    NSManagedObjectContext *context = [self managedObjectContext];

    // Create a new managed object
    NSManagedObject *newDevice = [NSEntityDescription insertNewObjectForEntityForName:@"BackpackViewer" inManagedObjectContext:context];
    [newDevice setValue:self.steamIDTextField.text forKey:@"steamID"];
    ID = [NSString stringWithFormat:@"%@", [newDevice valueForKey:@"steamID"]];

    [self startFetchingGroups]; // I would like this JSON call to finish before calling the rest of the function below

    //  2
    //  here you assign a value to your block. Notice that all objects inside block are called "retain" automatically. Also they a called "release" when you release the block itself..
    _blockAfterJSONFetched=^{
        [newDevice setValue:s.personaname forKey:@"steamName"];
        [newDevice setValue:s.avatar forKey:@"imageURL"];

        NSError *error = nil;
        // Save the object to persistent store
        if (![context save:&error]) {
            NSLog(@"Can't Save! %@ %@", error, [error localizedDescription]);
        }
        [self dismissViewControllerAnimated:YES completion:nil];
    };
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    _manager = [[ProfileManager alloc] init];
    _manager.communicator = [[ProfileCommunicator alloc] init];
    _manager.communicator.delegate = _manager;
    _manager.delegate = self;
    // Do any additional setup after loading the view.
}

- (void)startFetchingGroups
{
    [_manager fetchGroups];
}

- (void)didReceieveProfileInfo:(NSArray *)groups
{
    //the JSON call finishes here, when the groups are receives from the call. I would then like the rest of the save button method above to run after this runs, so that the s variable (which corresponds to a SteamProfile object) becomes initialized correctly.
    profile = groups;
    s = [profile objectAtIndex:0];
    NSLog(s.personaname);

    //  3
    //  finally after your callback is fired you check if block pointer is not null and if it is you call it as a casual function. Assigning nil in the end is optional..
    if(_blockAfterJSONFetched){
        _blockAfterJSONFetched();
        _blockAfterJSONFetched=nil;
    }

}

- (void)fetchingGroupsFailedWithError:(NSError *)error
{
    NSLog(@"Error %@; %@", error, [error localizedDescription]);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
Q: Mechanize not working for automating gmail login in Google Appengine I have used mechanize and deployed an app on GAE and it works fine. But, for an app that I am making, I am trying to automate login to gmail through mechanize. It doesn't work in the development environment on local machine as well as after deploying on appengine.
I have been able to use the same script to run it on my server through mod_python using PSP.
I found a lot of solutions here, but none of them seem to work for me. Here is a snippet of my code:
<snip>
br = mechanize.Browser()
response = br.open("http://www.gmail.com")
loginForm = br.forms().next()
loginForm["Email"] = self.request.get('user')
loginForm["Passwd"] = self.request.get('password')
response = br.open(loginForm.click())
response2 = br.open("http://mail.google.com/mail/h/")
result = response2.read()
<snip>

When I look at the result, all I get is the login page when used with appengine. But with mod_python hosted on my own server, I get the page with the user's inbox.

A: The problem is most likely due to how Google crippled the urllib2 module on GAE.
Internally it now uses the urlfetch module (which is something that Google wrote) and they have completely removed the HTTPCookieProcessor() functionality - meaning, cookies are NOT persisted from request to request which is the critical piece when automatically logging into sites programmatically.
There is a way around this, but not using mechanize. You have to roll your own Cookie processor - here is the basic approach I took (not perfect, but it gets the job done):
import urllib, urllib2, Cookie
from google.appengine.api import urlfetch
from urlparse import urljoin
import logging

class GAEOpener(object):
    def __init__(self):
        self.cookie = Cookie.SimpleCookie()
        self.last_response = None

    def open(self, url, data = None):
        base_url = url
        if data is None:
            method = urlfetch.GET
        else:
            method = urlfetch.POST
        while url is not None:
            self.last_response = urlfetch.fetch(url = url,
                payload = data,
                method = method,
                headers = self._get_headers(self.cookie),
                allow_truncated = False,
                follow_redirects = False,
                deadline = 10
                )
            data = None # Next request will be a get, so no need to send the data again.
            method = urlfetch.GET
            self.cookie.load(self.last_response.headers.get('set-cookie', '')) # Load the cookies from the response
            url = urljoin(base_url, self.last_response.headers.get('location'))
            if url == base_url:
                url = None
        return self.last_response

    def _get_headers(self, cookie):
        headers = {
            'Host' : '<ENTER HOST NAME HERE>',
            'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)',
            'Cookie' : self._make_cookie_header(cookie)
             }
        return headers

    def _make_cookie_header(self, cookie):
        cookie_header = ""
        for value in cookie.values():
            cookie_header += "%s=%s; " % (value.key, value.value)
        return cookie_header

    def get_cookie_header(self):
        return self._make_cookie_header(self.cookie)

You can use it like you would urllib2.urlopen, except the method you would use is just "open".


text:
Q: What is wrong with this broken analog oscilloscope? I own an Hameg 204 analog oscilloscope.
Unfortunately the x-axis oscillation on the CRT screen is broken. I am looking for advice on how to fix this.
My background: I have fixed several little electronics devices. Examples include networks switch with burnt capacitors. This oscilloscope is much more complicated and a little above my level to handle it myself.
Precise description of the issue

*

*Expected behavior: the CRT ray moves from the far left to the far right of the CRT screen.

*Actual behavior: the CRT ray is stuck at 60% of the x-axis of the screen (y-axis works fine). The x-pos button does nothing from 100 down to 50% and move the line start further right when turned from 50% to 0%.
When I activate the "x magn x10" button, the ray moves from 60% to the far right.
Basically, with the "x magn x10" trick, I have a working oscilloscope with only 40% of the original screen width. These "40%" do not depend on the time resolution.
What I already did
The following was made with "x magn x10" always activated.
First thing I did what to get the schematics: http://www.sky-messtechnik.de/images/PDFs/HM204-1.pdf .
I made the hypothesis the issue comes from a faulty component in the 'x-final amplifier' (page 37 reproduced below).

I then used a working (digital) oscilloscope to check "from S281" point (it is not only 'from CT' as stated in the manual but also 'from timebase').
Here I see the x-oscillation I expected to see, with 0V in the middle (see image below). I can also confirm that x-pos (bottom left) works as intended (-12V to 0V).
"Inside" the x-final amplifier though, the situation is very different. I always see the same pattern (at both 'W2-6 CRT', Chp12, ...) but obviously with different voltages. depending on the location in the amplifier (see image below; minimum value is very close to 0V).

I do not see any weird-looking component (see picture).

EDIT: I also checked all power rails and all are at their expected voltage.
Where you can help
As the board is quite difficult to take apart (so I would like to do it only once), I am looking for some advice on how to precisely locate the faulty component so I can order a replacement.
I am hoping that for an experienced eye, the pattern would be typical of a specific component failure.
If needed, I can make further measurements.
EDIT: new measurement:
T2101, base (to R2101):

T2101, collector (to R2110):

T2101, emitter (to R2100/R2101/R2108):

T2102, base (to R2103):

T2102, collector (to R2112):

T2102, emitter (to R2109, VR2100, VR2101):