text:
Q: SOAP Server with CodeIgniter I'm extending a webapp written with CI to communicate with visual basic application.
First of all i'd like to know if the solution i've choosen is a good option... i previously worked whith xml-rpc and put hands in a REST service, but to me SOAP solutions look more complete. Am i wrong?
Anyway, the problem up to now is that i cant call function inside my controller... here's my code:
class Webservice extends CI_Controller {

    function  __construct() {
        parent::__construct();
    }

    public function index() {
        $server = new SoapServer("http://www.site.com/test.wsdl");
        $server->setObject($this);
        //$server->addFunction('sayHello');
        $server->handle();
    }

    function sayHello($name) {
        $salute = "Hi " . $name . ", it's working!";
        return $salute;
    }

}

I've compiled the wsdl file, but after i call site.com/webservice i get the following error:
SoapServer::addFunction() [soapserver.addfunction]: Tried to add a non existant function 'sayHello'
I've also tried passing $CI=& get_instance() to $server->setObject(), but i think its the same as passing $this.
UPDATE - 12/09/2011
I figured it out... there is no need to use addFunction() if is already set the entire object $this. SOAP will call only the functions declared in the wsdl file, anyway it seems that i could not set a function as privete/protected.
Having said that I'm not sure to go ahead with SOAP... the tutorial written by Phil Sturgeon show a good solution using REST approach that return different response types (json, xml, serialize, csv).

A: More complete? How so?
SOAP is a much more defined and typed transfer protocol, but it's complicated as hell for just sending data around. WSDL is to me a layer of complexity that is unnecessary. It is used just to tell the client and server what type the data is, but PHP doesn't give a damn about type so why use this?
REST and JSON = quick and easy
SOAP and XML = slower and fugly

A: If you use NuSOAP class then WSDL is not problem. You just need to call your server like:
http://yoururl/api?wsdl

and NuSOAP will generate WSDL for you. I have some SOAP services developed by NuSOAP and all works like charm in any lang. that support SOAP.
Good Luck !

A: try this
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

ini_set("soap.wsdl_cache_enabled", "0");
$srv = new SoapServer("http://www.example.com/test.wsdl");
$srv->setClass('Webservice');
$srv-> addFunction(SOAP_FUNCTIONS_ALL);
$srv->handle();

class Webservice extends CI_Controller {

function  __construct() {
    parent::__construct();
}

public function index() {
}

function sayHello($name) {
    $salute = "Hi " . $name . ", it's working!";
    return $salute;
}

}


text:
Q: XCOPY files in batch to another folder but with structure of folders I am trying to get the following done.
Let's say I have a directory stucture like this
C:\photos\all\abc\def\001.jpg
C:\photos\all\abc\def\002.jpg
C:\photos\all\abc\def\003.jpg
C:\photos\all\xyz\111.jpg
C:\photos\all\xyz\222.jpg
etc.

I want to use XCOPY to copy certain files to another base directory, but I want to keep the structure of the folders. So, for example I want to copy 3 files from the example above to another disk.
D:\newphotos\abc\def\001.jpg
D:\newphotos\abc\def\002.jpg
D:\newphotos\xyz\111.jpg

How can I achieve this?
I tried the following but none seems to do what I want (i ran those from C:\photos\all)
XCOPY "abc\def\001.jpg" "D:\newphotos\abc\def\001.jpg" (keeps asking if it is a file or folder)

XCOPY "abc\def\001.jpg" "D:\newphotos\" (doesn't create the target folder structure)

XCOPY /S "abc\def\001.jpg" "D:\newphotos\" (doesn't create the target folder structure)

A: Ah, finally found it. Putting an asterisk * behind the filename will do the trick. So, for any of you with the same problem:
XCOPY "abc\def\001.jpg" "D:\newphotos\abc\def\001.jpg*"

This does the trick.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Camel CDI runtime InstanceAlreadyExistsException on JBoss EAP 6.1 When multiple wars are deployed, and each war file contains one instance of a class StandardContext that extends DefaultCamelContext and context name is set to "StandardContext" using @ContextName, this exception gets thrown. Is this due to class loader setup on JBoss?
Camel version: 2.17.4
JBoss version: EAP 6.1

A: You can configure your Camel application to use a naming pattern (such as managementNamePattern) for JMX. See more details in the JMX documentation: http://camel.apache.org/camel-jmx.html
You can then let the pattern use a counter or something to avoid the clash. Or you can override the name and set it to something you know is unique such as the module name.

A: Earlier I had used
    getManagementNameStrategy().setNamePattern("#name#");

But that did not work, so I modified my code to the following:
    @ApplicationScoped
    @ContextName("StandardContext")
    public class StandardContext extends DefaultCamelContext {

    @Resource(lookup = "java:module/ModuleName")
    private String moduleName;

    @PostConstruct
    public void init() {

    getManagementNameStrategy().setNamePattern(moduleName);

Posting this code to clarify my solution for other readers


text:
Q: Remove memcached completely from django Please tell some way to completely remove memcached from Django server. Using apache with mod WSGI and have already deleted all caches lines from settings.py but even that file is being cached.
Even removing settings.py doesn't stop site from working. This is ridiculous. There is no .pyc being formed which I could delete. Where are the files being cached.
I cannot get code changes in .py files to reflect in any way. They sometimes reflect, sometimes the old code comes back from some cache. How can I delete all caching mechanisms from this server ?
Regards !

A: This isn't anything to do with memcache; it sounds like the old compiled python scripts are still being used. Theoretically, restarting apache should do it. If not, deleting all the .pyc files (compiled python files; not .py, which are your source code) and restarting your server should force it to regenerate the .pyc files from the current source.


text:
Q: Adding a ContextMenu to a ListView results in empty rows showing null I'm using a CellFactory to add a ContextMenu to a ListView as shown here.  I'm using a ListView<File> instead of ListView<String>.  The problem is that empty rows in the ListView show "null".  This is caused by the line
cell.textProperty().bind(cell.itemProperty().asString());
but I can't leave that out or else all rows are blank even when the row is not empty.
What's the correct way to bind the cell.textProperty() to not display null when the row is empty?
public class FileUploaderVBox extends VBox {

    ListView<File> filesToUpload = new ListView<>();

    public FileUploaderVBox(Stage primaryStage) {
        setAlignment(Pos.TOP_CENTER);

        Label l = new Label("Select Files to Upload");
        l.setStyle("-fx-font: 12 arial; -fx-font-weight: bold;");
        setMargin(l, new Insets(25,0,20,0));

        Separator horizSeparator1 = new Separator();
        horizSeparator1.prefWidthProperty().bind(widthProperty());

        filesToUpload.setCellFactory(lv -> {

            ListCell<File> cell = new ListCell<>();

            ContextMenu contextMenu = new ContextMenu();

            MenuItem deleteItem = new MenuItem();
            deleteItem.textProperty().bind(Bindings.format("Delete \"%s\"", cell.itemProperty()));
            deleteItem.setOnAction(event -> filesToUpload.getItems().remove(cell.getItem()));

            contextMenu.getItems().addAll(deleteItem);

//            cell.textProperty().bind(cell.itemProperty());
            cell.textProperty().bind(cell.itemProperty().asString());

        cell.emptyProperty().addListener((obs, wasEmpty, isNowEmpty) -> {
            if (isNowEmpty) {
                cell.setContextMenu(null);
            } else {
                cell.setContextMenu(contextMenu);
            }
        });

            return cell ;
        });

        Separator horizSeparator2 = new Separator();
        horizSeparator2.prefWidthProperty().bind(widthProperty());

        Button chooseFileButton = new Button("Choose File");

        chooseFileButton.setOnAction(new EventHandler<ActionEvent> () {

            @Override
            public void handle(ActionEvent event) {

                FileChooser fileChooser = new FileChooser();
                File f = fileChooser.showOpenDialog(primaryStage);
                if (null != f)
                    filesToUpload.getItems().add(f);
            }
        });

        getChildren().addAll(l, horizSeparator1, filesToUpload, horizSeparator2, chooseFileButton);

    }

    public ObservableList<File> getFilesToUpload() {
        return filesToUpload.getItems();
    }
}

Edit
Replacing cell.textProperty().bind(cell.itemProperty().asString()) with the following gives a StackOverflowError.
    ObjectProperty<File> itemProperty = cell.itemProperty();
    StringBinding sb = Bindings.createStringBinding(new Callable<String>() {

        @Override
        public String call() throws Exception {

            if (null == itemProperty)
                return "";
            else
                return itemProperty.toString();
        }

    }, itemProperty);

    cell.textProperty().bind(sb);

What the heck?

A: You can try something like this:
StringBinding stringBinding = new StringBinding(){
      {
       super.bind(cell.itemProperty().asString());
      }
      @Override
      protected String computeValue() {
          if(cell.itemProperty().getValue()==null){
              return "";
          }
          return cell.itemProperty().getValue().getPath();
     }
};

cell.textProperty().bind(stringBinding);


text:
Q: Number of open file descriptors won't change when I set them in CentOS 6.3? uname -a
Linux lab.testing.com 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux

ulimit -Hn
1024

ulimit -Sn
1024

ulimit -n
1024

I opened /etc/sysctl.conf in vi and added this at the bottom:
fs.file-max = 65536

I opened /etc/security/limits.conf in vi and added this at the bottom:
*        soft    open files      8192

*        hard    open files     10240

testuser   soft    open files      8192

testuser   hard    open files     10240

Whether I login as root or as testuser, and whether I reboot or cold-boot the box, I still get:
ulimit -Hn
1024

ulimit -Sn
1024

ulimit -n
1024

I can set the open file descriptors to 10240 at the command line but that only sets it for the session and then it's lost when I logout/login and/or reboot/cold-boot:
[root@lab ~]# ulimit -n 10240
[root@lab ~]# ulimit -Hn
10240

[root@lab ~]# ulimit -Sn
10240

[root@lab ~]# ulimit -n
10240

What am I missing?
And in case someone wants to see the initial values:
[root@itnm ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 46464
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 46464
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

A: I think you misconfigure the limits.conf file. There is no option like open files.
 - **nofile** - max number of open file descriptors

You should be using "nofile" option instead of open files. That will solve the problem i think.


text:
Q: Convert NSObject to JSON serializable? I'm getting a result and I'm trying to make it JSON serializable, which probably mean to convert it from NSObject to Object. Is that possible? I've checked Codable, but I didn't understand what I'm supposed to do. My result could change in the future (types, keys, values, etc).
dump(result):
{ test1: 123, test2: () }> #0
  - super: NSObject

Edit:
let result = appleIDCredential
let jsonEncoder = JSONEncoder()
let jsonData = try jsonEncoder.encode(result)
let json = String(data: jsonData, encoding: String.Encoding.utf8)

Returns:

Argument type 'ASAuthorizationAppleIDCredential' does not conform to
  expected type 'Encodable'

A: You can serialize and deserialize NSObjects with this useful framework.
HandyJSON is a framework written in Swift which to make converting model objects( pure classes/structs ) to and from JSON easy.
https://cocoapods.org/pods/HandyJSON


text:
Q: How can I set a QTextEdit to indent like a terminal? I wish to indent my text according to the amount of characters there is ( the same was a terminal works on Linux / Mac) rather than the width of each individual letter ( the way text editors / HTML usually handle it)
My goal is to be able to indent using spaces as I have a logger that is already configured for console and file output, this would allow me to use the already existing indentation system without having to create one using HTML / CSS
Edit : here is a photo to try and clarify what I am trying to achieve, the screen comes from the output I wish to use ( color is a bonus but not vital ). As you can see everything is lined up.

A: In the end the solution I used is the kbd html tag such as seen here.
My understanding is that it's a tag that applies default monospace font to the text inside of it. In any case it yields the output I was trying to get.


text:
Q: Aggregate points with same values to polygons I have a shapefile with 2M measurement points (each measurement point has a resolution of a 1/10). How can I aggregate points around each other if and create polygons out of it?
They do not have to match a grid, polygons should not overlap.
In addition, I would like to reduce the resolution, e.g. aggregate all points around a 1/2 resolution.
Can I do this with QGIS or in PostGIS?
I have tried convex hull, but it seems that the polygons overlapped. Also, some answers are referring to ArcGIS 10, which I do not have.

A: Without using a grid, it's going to be quite hard to avoid overlaps without using a Voronoi approach. You can ST_Collect them and then pass them to ST_ConcaveHull if you have a recent PostGIS. That will produce a result close to what you want, but without a "no overlap" guarantee.


text:
Q: Linq to SQL one:one relationship not setting child's PK to parent's identity value I have two tables: ScheduledEvent and DrawSequence. The ScheduledEvent table has zero or one DrawSequence entries. The PK of the ScheduledEvent is an identity integer which is used in a FK from DrawSequence.
I have created by dbml file, generated the classes and it shows the parent (ScheduledEvent) has an EntitytRef to the child (DrawSequence).
When I create a new parent and set its child to a new DrawSequence and save it, the child's FK field is not set to the parent's newly allocated PK.
I have googled this and found nothing that helps. if you have any ideas, I'd greatly appreciate it.
I've added the change log after this:
INSERT INTO [dbo].[ScheduledEvent]([StartDate], [EndDate], [Ongoing], [Active], [ScheduledEventName], [LastUpdated], [LastUpdatedUser])
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6)

SELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value]
-- @p0: Input DateTime (Size = 0; Prec = 0; Scale = 0) [11/03/2010 12:00:00 AM]
-- @p1: Input DateTime (Size = 0; Prec = 0; Scale = 0) [11/03/2010 12:00:00 AM]
-- @p2: Input Bit (Size = 0; Prec = 0; Scale = 0) [False]
-- @p3: Input Bit (Size = 0; Prec = 0; Scale = 0) [False]
-- @p4: Input NVarChar (Size = 4; Prec = 0; Scale = 0) [ssss]
-- @p5: Input DateTime (Size = 0; Prec = 0; Scale = 0) [11/03/2010 5:22:04 PM]
-- @p6: Input NVarChar (Size = 10; Prec = 0; Scale = 0) [TODO: fred]
-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.30729.1

INSERT INTO [dbo].[DrawSequence]([ScheduledEventID], [SendEmails], [EmailAdds], [SendPages], [PageNums], [IsInstantDraw], [InstantDrawRunDate])
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6)

SELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value]
-- @p0: Input Int (Size = 0; Prec = 0; Scale = 0) [0]
-- @p1: Input Bit (Size = 0; Prec = 0; Scale = 0) [False]
-- @p2: Input NVarChar (Size = 0; Prec = 0; Scale = 0) []
-- @p3: Input Bit (Size = 0; Prec = 0; Scale = 0) [False]
-- @p4: Input NVarChar (Size = 0; Prec = 0; Scale = 0) []
-- @p5: Input Bit (Size = 0; Prec = 0; Scale = 0) [True]
-- @p6: Input DateTime (Size = 0; Prec = 0; Scale = 0) [Null]
-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.30729.1

A: Maybe your mapping is not correct, did you check that the parents PK is set as Identity and Auto-generated? Normally L2S would SELECT Scope_Identity() after the first one and pass that to the second insert.


text:
Q: boost::asio::io_service destructor runs very long time I'm novice in boost::asio and have the first own troubles.
I create a simple Host resolver (see full code below).
Problem 1.
In case of lost Internet connection, my host resolver stops resolving after the first enter into deadline_timer.
My assumption, that "localhost" must be resolved at any time. But "localhost" are not resolved after timeout during resolving google.us (for example, we unplugged Ethernet jack).
The same behaviour in case of resolving unexisted TLD (for example, google.usd instead google.us).
Problem 2.
In case of lost Internet connection, destructor io_service runs very long (usually, 5 seconds).
What's wrong?
I use VS2012, boost 1.54
File hostresolver.h
pragma once

#include <set>

#include <boost/system/error_code.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ip/basic_resolver.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>

typedef std::set<unsigned long> hostresolver_result_container;

class hostresolver
{
public:
    hostresolver(boost::asio::io_service* io_service);
    ~hostresolver(void);

    boost::asio::io_service* ios_ptr;
    boost::asio::ip::tcp::resolver resolver_;
    boost::asio::deadline_timer timer_;

    volatile bool is_completed;
    bool is_timeout;
    std::string hostname;
    hostresolver_result_container result;

    void on_timeout(const boost::system::error_code &err);
    void start_resolve(const char* hostname, int timeout_seconds);
    void finish_resolve(const boost::system::error_code& err, boost::asio::ip::tcp::resolver::iterator endpoint_iterator);

private:
    void stop();
};

File hostresolver.cpp
#include "stdafx.h"
#include "hostresolver.h"

#include <boost/bind.hpp>

hostresolver::hostresolver(boost::asio::io_service* io_service) :
    resolver_(*io_service), timer_(*io_service), is_completed(false), is_timeout(false)
{
    ios_ptr = io_service;
}

hostresolver::~hostresolver(void)
{
}

void hostresolver::start_resolve(const char* hostname, int timeout_second)
{
    this->hostname.assign(hostname);

    timer_.expires_from_now(boost::posix_time::seconds(timeout_second));
    timer_.async_wait(boost::bind(&hostresolver::on_timeout, this, _1));

    boost::asio::ip::tcp::resolver::query query(hostname, "http");
    resolver_.async_resolve(query,
                            boost::bind(&hostresolver::finish_resolve, this,
                            boost::asio::placeholders::error,
                            boost::asio::placeholders::iterator));

    do
    {
        ios_ptr->run_one();
    }
    while (!is_completed);
}

void hostresolver::stop()
{
    resolver_.cancel();
    timer_.cancel();
    is_completed = true;
}

void hostresolver::on_timeout(const boost::system::error_code &err)
{
    if ((!err) && (err != boost::asio::error::operation_aborted))
    {
        is_timeout = true;
        stop();
    }
}

void hostresolver::finish_resolve(const boost::system::error_code& err, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
{
    if (!err)
    {
        while (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
        {
            boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
            if (endpoint.address().is_v4())
            {
                result.insert(endpoint.address().to_v4().to_ulong());
            }
            endpoint_iterator++;
        }
    }

    stop();
}

File main.cpp
#include "stdafx.h"

#include "hostresolver.h"

int _tmain(int argc, _TCHAR* argv[])
{
    boost::asio::io_service ios;

    for (int i = 0; i < 2; i++)
    {
        std::cout << "iteration: " << i << std::endl;

        {
            hostresolver hres(&ios);
            hres.start_resolve("localhost", 1);
            if (hres.result.size() == 0)
                std::cout << "failed" << std::endl;
        }

        {
            hostresolver hres(&ios);
            hres.start_resolve("google.usd", 1);
        }
    }

    return 0;
}

A: After returning from run_once, the io_service would most likely enteres the "stopped" state. Thus, you should call ios_ptr->reset() prior to calling run_once() again. Quoting from run_once reference:

Return Value: The number of handlers that were executed. A zero return
  value implies that the io_service object is stopped (the stopped()
  function returns true). Subsequent calls to run(), run_one(), poll()
  or poll_one() will return immediately unless there is a prior call to
  reset().


text:
Q: Lodash: Join values by given key I am trying to search easy function on Lodash.js for joining values by given key or something...
Example:
const obj = {firstname : 'John', title: 'Mr.', lastname: 'Due'}

Expected results:
Mr. John Due

Any function like _.join() but better and I can do something like..
_.joinX(obj, ['title', 'firstname', 'lastname'], ' ')

Why not just...?
obj.title + ' ' + obj.firstname + ' ' + obj.lastname

Because sometimes my object is so long like... (And I will not give more variable)
obj.current.user.info.title + ' ' + obj.current.user.info.firstname + ' ' + obj.current.user.info.lastname

A: You can port the following to Lodash.

const joinByKeys = (obj = {}, props = [], separator = '') => {
    // empty array.
    let arr = [];
    // push props to array
    props.forEach(p => arr.push(obj[p]))
    // return the joined array.
    return arr.join(separator);
}

const obj = {firstname : 'John', title: 'Mr.', lastname: 'Due'}

console.log( joinByKeys(obj, ['title', 'firstname', 'lastname'], ' ') );

A: I think I got it:
const obj = {firstname : 'John', title: 'Mr.', lastname: 'Due'}
let name = _(obj).pick(['title', 'firstname', 'lastname']).values().join(' ')
console.log(name)

Not really special function as I expected but have to run tho Lodash's functions a bit


text:
Q: getDownloadURL isn't inputting the link i need Trying to get the downloadUrl link and put it into the "profile/imageURL" node on database.
I'm new to firebase and android development, so i was reading through release notes etc on storage and noticed in the notes and found information on downloadUrl. I understand there are plenty of questions on this topic but it's hard to apply it to this code.
"Deprecated the getDownloadUrl() and getDownloadUrls() methods of the StorageMetadata class. Use StorageReference.getDownloadUrl() instead."
But i'm trying to pull the downloadUrl link not from the metadata stored in firebase storage
I can successfully upload the picture to firebase storage but when i put the downloadUrl into firebase DB into the node i want. it inputs "com.google.android.gms.tasks.zzu@xxxxx"
final String downloadUrl = task.getResult().getStorage().getDownloadUrl().toString();

                            UserProfileRef.child("profile").child("imageURL").setValue(downloadUrl)

I have tried the following 2 codes, This code outputs the uri com.google.xxxx
protected void onActivityResult( int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);

    if(requestCode==Gallery_Pick && resultCode==RESULT_OK && data!=null)
    {
        Uri ImageUri = data.getData();

        CropImage.activity()
                .setGuidelines(CropImageView.Guidelines.ON)
                .setAspectRatio(1,1)
                .start(this);
    }
    if (requestCode==CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE)
    {
        CropImage.ActivityResult result = CropImage.getActivityResult(data);

        if(resultCode == RESULT_OK)
        {

            loadingBar.setTitle("Profile Image");
            loadingBar.setMessage("Please wait, while we are uploading image...");
            loadingBar.setCanceledOnTouchOutside(true);
            loadingBar.show();

            Uri resultUri = result.getUri();

            StorageReference filePath = UserProfileImageRef.child(currentUserID + ".jpg");

            filePath.putFile(resultUri).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
                @Override
                public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {

                    if(task.isSuccessful())
                    {
                        Toast.makeText(ProfileActivity.this, "Profile Image stored Successfully to the the storage...", Toast.LENGTH_SHORT).show();

                        final String downloadUrl = task.getResult().getStorage().getDownloadUrl().toString();

                        UserProfileRef.child("profile").child("imageURL").setValue(downloadUrl)
                                .addOnCompleteListener(new OnCompleteListener<Void>() {
                                    @Override
                                    public void onComplete(@NonNull Task<Void> task)
                                    {
                                        if(task.isSuccessful())
                                        {
                                            Intent selfIntent = new Intent(ProfileActivity.this, ProfileActivity.class);
                                            startActivity(selfIntent);

                                            Toast.makeText(ProfileActivity.this, "Profile image stored to firebase database successfully.", Toast.LENGTH_SHORT).show();
                                            loadingBar.dismiss();
                                        }
                                        else
                                        {
                                            String message = task.getException().getMessage();
                                            Toast.makeText(ProfileActivity.this, "Error Occured..." + message, Toast.LENGTH_SHORT).show();
                                            loadingBar.dismiss();
                                        }
                                    }
                                });
                    }
                }
            });
        }
        else
        {
            Toast.makeText(this, "Error Occured: Image can't be cropped, try again..", Toast.LENGTH_SHORT).show();
            loadingBar.dismiss();
        }
    }
}

This second code was tried with the help of other users questions and trying to solve it that way. Although i get an error on .setValue(downloadUrl)
protected void onActivityResult( int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);

    if(requestCode==Gallery_Pick && resultCode==RESULT_OK && data!=null)
    {
        Uri ImageUri = data.getData();

        CropImage.activity()
                .setGuidelines(CropImageView.Guidelines.ON)
                .setAspectRatio(1,1)
                .start(this);
    }
    if (requestCode==CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE)
    {
        CropImage.ActivityResult result = CropImage.getActivityResult(data);

        if(resultCode == RESULT_OK)
        {

            loadingBar.setTitle("Profile Image");
            loadingBar.setMessage("Please wait, while we are uploading image...");
            loadingBar.setCanceledOnTouchOutside(true);
            loadingBar.show();

            Uri resultUri = result.getUri();

            final StorageReference filePath = UserProfileImageRef.child(currentUserID + ".jpg");

            filePath.putFile(resultUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
                @Override
                public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                    filePath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
                        @Override
                        public void onSuccess(Uri uri) {

                            final String downloadUrl = uri.toString();
                        }
                    });

                    UserProfileRef.child("profile").child("imageURL").setValue(downloadUrl)
                            .addOnCompleteListener(new OnCompleteListener<Void>() {
                                @Override
                                public void onComplete(@NonNull Task<Void> task)
                                {
                                    if(task.isSuccessful())
                                    {
                                        Intent selfIntent = new Intent(ProfileActivity.this, ProfileActivity.class);
                                        startActivity(selfIntent);

                                        Toast.makeText(ProfileActivity.this, "Profile image stored to firebase database successfully.", Toast.LENGTH_SHORT).show();
                                        loadingBar.dismiss();
                                    }
                                    else
                                    {
                                        String message = task.getException().getMessage();
                                        Toast.makeText(ProfileActivity.this, "Error Occured..." + message, Toast.LENGTH_SHORT).show();
                                        loadingBar.dismiss();
                                    }
                                }
                            });
                }
            });
        }
        else
        {
            Toast.makeText(this, "Error Occured: Image can't be cropped, try again..", Toast.LENGTH_SHORT).show();
            loadingBar.dismiss();
        }
    }
}

A: Calling getDownloadUrl() returns a Task that asynchronously gets the download URL from the server. When it has retrieved the download URL, it calls onComplete/onSuccess. This means the download URL value is only available inside the onComplete/onSuccess method. Any code that needs the download URL needs to be inside onComplete/onSuccess.
So something like:
filePath.putFile(resultUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
    @Override
    public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
        filePath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
            @Override
            public void onSuccess(Uri uri) {

                final String downloadUrl = uri.toString();
                UserProfileRef.child("profile").child("imageURL").setValue(downloadUrl)
                  .addOnCompleteListener(new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(@NonNull Task<Void> task) {
                        loadingBar.dismiss();
                        if(task.isSuccessful()) {
                            Intent selfIntent = new Intent(ProfileActivity.this, ProfileActivity.class);
                            startActivity(selfIntent);
                            Toast.makeText(ProfileActivity.this, "Profile image stored to firebase database successfully.", Toast.LENGTH_SHORT).show();
                        }
                        else {
                            String message = task.getException().getMessage();
                            Toast.makeText(ProfileActivity.this, "Error Occured..." + message, Toast.LENGTH_SHORT).show();
                        }
                    }
                });
            }
        });
    }
});

Now having the code inside the onSuccess is of course not going to be very reusable. So you may consider creating a custom callback interface as shown here. But the interface will be quite similar to the Task<Uri> interface in the example above, so I'm not sure it is worth the effort.

For an example of how to still keep the code separate from the onComplete by having your own custom callback interface, see getContactsFromFirebase() method return an empty list.


text:
Q: How to search class deserialized from xml for specific value, and place nodes into it I have an xml document that was build from classes then serialized. Later, I have deserialized the data and have used the same class structure. I currently have a variable that is filled with objects. What I need now, is the ability to search each object for a specific value, if the value exists, append new data as a child. I have poked around with Reflection and the GetValue property in .NET but have become rather confused. Some sample code is below.
Thank you.
public class Root
{
    [XmlElement("Product")]
    public List<Product> Product { get; set; }

    [XmlElement("Modification")]
    public List<Modification> Modification { get; set; }
}

public class Product
{
    public string ProductID { get; set; }
    public string ProductName { get; set; }
    public List<ColorVariants> ColorVariants { get; set;}
    public List<FeatureAddOns> FeatureAddOns { get; set; }
}

DataTable DTFeatureAddOn = new DataTable();
DTFeatureAddOn.Columns.Add("ProductID", typeof(String));
DTFeatureAddOn.Columns.Add("ProductName", typeof(String));

DataRow drDTFeatureAddOn = DTFeatureAddOn.NewRow();
drDTFeatureAddOn["ProductID"] = "ProductID";
drDTFeatureAddOn["ProductName"] = "ProductName";

DTFeatureAddOn.Rows.Add(drDTFeatureAddOn);

catalogFeed = DeserializeCatalogFeed();

if (DTFeatureAddOn.Rows.Count > 0)
{
    foreach (DataRow row in DTFeatureAddOn.Rows)
{
//a. For each unique ProductID, first check to make sure the does not exist – if NOT then create
    List<int> ProductIDList = new List<int>();
    PropertyInformation pinfo = typeof(Root).GetProperty("ProductID");
    //foreach (catalogFeed.Product
    //b. For each PlacementCode, create a structure FeatureAddOn below that ProductID.  This may results into a list of FeatureAddons for a given ProductID
    }

SerializeToXML(catalogFeed, DeltaCatalogFeedUpload.FileName);
}

    public static void SerializeToXML(Root rootNode, string FileName)
    {
        XmlSerializer serializer = new XmlSerializer(typeof(Root));
        TextWriter tw = new StreamWriter(FileName);
        serializer.Serialize(tw, rootNode);
        tw.Close();
    }

    public static Root DeserializeFromXML()
    {
        XmlSerializer deserializer = new XmlSerializer(typeof(Root));
        TextReader textReader = new StreamReader(DeltaCatalogFeedUpload.FileName);
        Root nodes;
        nodes = (Root)deserializer.Deserialize(textReader);
        textReader.Close();

        return nodes;
    }

    public static Root DeserializeCatalogFeed()
    {
        Root root = new Root();
        try
        {

            FileInfo fInfo = new FileInfo(DeltaCatalogFeedUpload.FileName);
            if (fInfo.Exists)
            {

                root = DeserializeFromXML();

            }
            else
            {
                root.Product = new List<Product>();
                root.Modification = new List<Modification>();
                root.PlacementCodeList = new List<PlacementCodeList>();
                root.AssociatedSKU = new List<AssociatedSKU>();
                root.FontStyle = new List<FontStyle>();
                root.FontSize = new List<FontSize>();
                root.FontType = new List<FontType>();
                root.Alignment = new List<Alignment>();
                root.ThreadColor = new List<ThreadColor>();
                root.Category = new List<Category>();
                root.ProductLine = new List<ProductLine>();
                root.ProductStock = new List<ProductStock>();
                root.ProductFiber = new List<ProductFiber>();
                root.ProductFabric = new List<ProductFabric>();
                root.Season = new List<Season>();
            }
        }
        catch (Exception e)
        {
            // do something with the error but always return a price list
            root.Product = new List<Product>();
            root.Modification = new List<Modification>();
            root.PlacementCodeList = new List<PlacementCodeList>();
            root.AssociatedSKU = new List<AssociatedSKU>();
            root.FontStyle = new List<FontStyle>();
            root.FontSize = new List<FontSize>();
            root.FontType = new List<FontType>();
            root.Alignment = new List<Alignment>();
            root.ThreadColor = new List<ThreadColor>();
            root.Category = new List<Category>();
            root.ProductLine = new List<ProductLine>();
            root.ProductStock = new List<ProductStock>();
            root.ProductFiber = new List<ProductFiber>();
            root.ProductFabric = new List<ProductFabric>();
            root.Season = new List<Season>();
        }
        return root;
    }

A: It sounds like you're looking for LINQ to Objects.
catalogFeed.Product is a list of Product objects (List<Product>). Personally, I would have named that property Products, but that would just be for readability.
Assuming from your code that Product class has a property named ProductID and that is what you want to match on.
I would create a dictionary of Product objects with ProductID as the key. Do this via the ToDictionary LINQ method like this:
var productLookup = catalogFeed.Product.ToDictionary(p => p.ProductID);

Then inside your loop through the data table, you can locate the matching product in the dictionary.
foreach (DataRow row in DTFeatureAddOn.Rows)
{
    var productId = row["ProductID"];
    if (productLookup.ContainsKey(productId))
    {
        var matchingProduct = productLookup[productId];
        // get whatever you need out of the matching product.
    }
}

You could use a LINQ query to locate the matching product on each iteration through the loop, but using the ToDictionary approach means that the scan of the list only happens once. It's essentially creating an in-memory index so you can quickly find the object you're looking for without scanning the whole list each time, but if you did want to do that, finding a single matching product by ProductID with FirstOrDefault would look like this:
var matchingProduct = catalogFeed.Product.FirstOrDefault(p => p.ProductID = desiredProductID);

If there was no match, then matchingProduct would be null.


text:
Q: Reading text file truncates line output in PHP Reading text file truncates line output in PHP:
Text-file:
NEXT_GEN_TO="Project Bribara<project-automation@bribara.com>"

Code:
$lines = file('Text-file');
foreach ($lines as $line) {
   echo "$line
";
}

Expected:
NEXT_GEN_TO="Project Bribara<project-automation@bribara.com>"

Actual:
NEXT_GEN_TO="Project Bribara"

How can I print expected result after reading the lines from file?

A: The <project-automation@bribara.com> is treated as an html tag by your browser. If you check out the outputted html source code for the page using "View Source" in your browser, it's all going to be there.
Use one of the php functions to turn html into non-html text such as htmlentities() on the text before output.
http://php.net/manual/en/function.htmlentities.php

A: Try to give output like this...
echo htmlentities($line) . "
";


text:
Q: pillow. how do I convert an image to a specific, defined palette I need to convert an image to specific palette. It does not not need to use all the colours in that palette but it must not in any circumstances use colours from outside it.
I also need to reduce the number of colours in the image to a defined number - say 10.
I have tried all versions of image.quantize() and in each case they completely change the defined palette. After going round in circles for days I thought it is time to ask for advice :)
Addition: running quantise without a quantisation method does maintain the palette - but does not reduce the number of colours. Looking at the output from getpixel, running it without a method does not seem to amend the image in any way.
from PIL import Image

# palette contains 20 unique colours and is padded out to 256 colours to avoid
#being automatically padded with random greycale colours.
palette=[255, 223, 213, 199, 43, 59, 210, 16, 53, 253, 156, 151, 250, 50, 3,
         253, 93, 53, 227, 29, 66, 255, 139, 0, 247, 203, 191, 255, 223, 217,
         255, 238, 235, 209, 88, 7, 235, 99, 7, 255, 123, 77, 255, 222, 213,
         247, 139, 19, 252, 171, 152, 217, 137, 120, 254, 205, 194, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
         252, 252, 252]

pImg=Image.new("P",(16, 16))
pImg.putpalette(palette)
print("\n\n\npImg palette: "+ str(pImg.getpalette()))

# open the image which I want to convert to the new palette
sourceImg= Image.open("whirl.png")
sourceImg=sourceImg.convert("RGB")
sourceImg.thumbnail(size=(100, 100))

#force the source image to use the new palette
sourceImg=sourceImg.quantize(palette=pImg,dither=0)
print("sourceImg mode: "+ str(sourceImg.mode))
print("sourceImg palette: "+ str(sourceImg.getpalette()))

#quant=sourceImg.copy()
sourceImg=sourceImg.quantize(colors=10,method=2,kmeans=10)
print("sourceImg mode: "+ str(sourceImg.mode))
print("sourceImg palette: "+ str(sourceImg.getpalette()))

Output:
pImg palette: [255, 223, 213, 199, 43, 59, 210, 16, 53, 253, 156, 151, 250, 50, 3, 253, 93, 53, 227, 29, 66, 255, 139, 0, 247, 203, 191, 255, 223, 217, 255, 238, 235, 209, 88, 7, 235, 99, 7, 255, 123, 77, 255, 222, 213, 247, 139, 19, 252, 171, 152, 217, 137, 120, 254, 205, 194, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252]
sourceImg mode: P
sourceImg palette: [255, 223, 213, 199, 43, 59, 210, 16, 53, 253, 156, 151, 250, 50, 3, 253, 93, 53, 227, 29, 66, 255, 139, 0, 247, 203, 191, 255, 223, 217, 255, 238, 235, 209, 88, 7, 235, 99, 7, 255, 123, 77, 255, 222, 213, 247, 139, 19, 252, 171, 152, 217, 137, 120, 254, 205, 194, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252]
sourceImg mode: P
sourceImg palette: [228, 34, 29, 238, 97, 16, 254, 226, 219, 252, 165, 151, 255, 123, 77, 247, 203, 191, 217, 137, 120, 227, 29, 66, 247, 139, 19, 252, 252, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]


text:
Q: how to make @symbol in string.xml for android I am trying to make @sancorporation in my android application. I have written strings in string.xml e.g "<"string  name="cor_name">sancorporation"<"/string>, but I need something like this "<"string  name="cor_name">@sancorporation"<"/string>. How to take special symbol in android?

A: Use ascii  value of @  symble is 0040 so try it
for @sancorporation
          <string name="mytest">@sancorporation</string>

           or
           <string name="mytest">\u0040 sancorporation</string>

A: Maybe this will help
<string name="specialChar"> "@" </string>

You can also try this
<string name="specialChar"> \@ </string>

Edit:
Now I notice that you want to write @sanCorporation.
so you can use this in string.xml file:
<string name="corp"> "@sanCorp" </string>


text:
Q: Symfony service container - Catchable Fatal Error - Argument passed to construct I'm getting an error with using the Symfony service container. This is the error I'm getting:
Catchable Fatal Error: Argument 3 passed to housesBundle\Model\PropertyDetailsModel::__construct() must be an instance of
housesBundle\Model\AuditModel, instance of sharedBundle\Model\AuditModel given,
called in /var/www/anildave/symfony/app/cache/dev/appDevDebugProjectContainer.php
on line 1876 and defined
500 Internal Server Error - ContextErrorException

services.yml
audit_model_service:
    class: sharedBundle\Model\AuditModel
    arguments: [@doctrine.dbal.default_connection]

property_details_model_service:
    class: housesBundle\Model\PropertyDetailsModel
    arguments: [@doctrine.dbal.default_connection,@request_stack,@audit_model_service]
    calls:
        - [ setContainer, [ @service_container ]]

PropertyDetailsModel.php
namespace housesBundle\Model;

use Doctrine\DBAL\Connection;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use sharedBundle\Model;
use sharedBundle\Helper;

class PropertyDetailsModel extends Controller
{
    private $connection;
    private $requestStack;
    private $auditModel;

    public function __construct(Connection $connection, RequestStack          $requestStack, AuditModel $auditModel)
    {
        $this->connection = $connection;
        $this->requestStack = $requestStack;
        $this->auditModel = $auditModel;
    }

I'm not sure what I'm doing wrong.
Thanks

A: Look at your uses :
use Doctrine\DBAL\Connection;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use sharedBundle\Model;
use sharedBundle\Helper;
use sharedBundle\Model\AuditModel;     // <---- Look here, add this


text:
Q: can we display Purchase Order as a payment method for non-logged in customers also? Purchase order payment method available for all customer groups except Non-Logged-in customers on the checkout page.
can we display Purchase Order as a payment method for non-logged in customers also?

A: This is enabled in Magento by default.
Is it possible that you have a module installed that would disable that?
Probably it'd look similar to what's in answer here:
How to disable purchase order for guest checkout?


text:
Q: why doesn't my code work when i have a subfolder statring with numeric values in PATH? I am reading a folder of multiple images and here's the part of code where i read the folder specified in path,
path =  'C:\main\folder\sub-folder\08001\V.1\abc\2015'

for infile in glob.glob( os.path.join(path, '*.tif') ):

    Img = gdal.Open( infile )
    if Img is None:
      print 'Unable to open Input Image'
      sys.exit(1)

... so the code doesn't work as in it doesn't read any files in that folder but it also doesn't throw any error. I figured that it's not working only when the path has any of the Sub-folder's name starting with numeric values.
Here Path = 'C:\main\folder\sub-folder\08001\V.1\abc\2015' and as you can see it has two Sub-folder's (08001 and 2015) starting with numeric values.
** It works absolutely fine when there are no such sub-folder's starting with numeric values.
Why does this happen and how can i fix this ??
Also how can i automatically look into any sub-folder's if exist in the original path provided ?
when i look for that path in command shell, here's what it shows.
>>> path =  'C:\P\S\Mo\C\08008\L\V.1R\2015'
>>> path
'C:\\P\\S\\Mo\\C\x008008\\L\\V.1R\x815'

A: You need to escape the backslashes in your string:
path =  'C:\\P\\S\\Mo\\C\\08008\\L\\V.1R\\2015'

It's just coincidence that your path works when there are no numbers in it. If you had a path with a folder that began with a, b, n, or certain other letters, it wouldn't work either.
A backslash followed by three numbers is parsed as an octal number whose value to insert into the string. The first such sequence is \080. 8 is not a valid octal digit, so Python stops parsing octal after the zero. This is displayed in hexadecimal as \x00 in your output. The second sequence is \201, and octal 201 is equal to hexadecimal 81—\x81.
Alternatively, you can use a raw string:
path =  r'C:\P\S\Mo\C\08008\L\V.1R\2015'

The r before the string literal tells Python not to parse escape sequences in the string. When working with Windows paths, this can make your paths look much nicer.
A third possibility is to use forward slashes instead of backslashes in your path string:
path =  'C:/P/S/Mo/C/08008/L/V.1R/2015'


text:
Q: How to split values into different columns? This is what I have
|name|surname|job       |
|Mike|Watson |programmer|
|Josh|White  |manager   |

And what I need to make:
|name|surname|programmer|manager|
|Mike|Watson |programmer|null   |
|Josh|White  |null      |manager|

What is the easiest way to do that, maybe without using addtional temporary tables?
Regards

A: This is a simple application of a case expression:
select name, surname,
       (case when job = 'manager' then job end) as manager,
       (case when job = 'programmer' then job end) as programmer
from table t;

Note that you need to write specific logic for each column.  You cannot use SQL to add a variable number of columns, based on the contents in the rows.  So, if you added "intern', you would have to add logic for this value.
It is also unclear to me why you want a column that takes on either NULL or the name of the column.  Presumably, you have a good reason.

A: You can either use case and group by or pivot method to solve it.


text:
Q: Read a file that's actively being written I am downloading a large file via FTP so that I can process the file on my local system. The program that processes the file reads the file line by line in a single pass, creating two new files from the original.
Would it be possible to start processing the file before it is completely downloaded? What are the potential issues with this?
Note: I'm not really worried about the program reaching the end of the file before it's done downloading--the file is being downloaded more quickly than the program can process the data.

A: Assuming that the file is not compressed you can try the following on Linux:
wget -O - www.fileserver.com/file.ext | tee outputfile.out | ./someprogram

-O - will cause wget to output the file to stdout which will then be piped to someprogram  while tee will save a copy of the wget output to outputfile.

A: It's possible, if the program reads data sequentially from start. (Some, such as unzip, attempt seek to the end of the file first.)

A:
Would it be possible to start processing the file before it is completely downloaded?

yes

What are the potential issues with this?

When reaching EOF - how to determine if it's really EOF or if the reader was just faster than the receiver and it should just wait a second before retrying the read?
Solutions to this would be:

*

*use timeouts - if the file size does not change anymore for a couple of minutes, the transfer may be considered as complete. I don't like this solution since one never knows, if the transfer was terminated ok or if the connection got lost.

*try to get the file size beforehand - if using an ftp server one can usually perform a 'dir' command to get the file size before downloading. This value may be passed to the reader program

*make the download script to create a 'transfer complete' file which the reader-program may check when it encounters EOF.

Note: I'm not really worried about the program reaching the end of the file before it's done downloading--the file is being downloaded more quickly than the program can process the data.

You should - really! What if the network connection is slower than usual just because of some other transfers going on? Would it be ok to loose data in this case?

A: This might be a good candidate for pipelining. Use an FTP client that writes to standard output have the splitting program read from standard input.


text:
Q: Controller hangs when opened using url in mvc 5 I'm new on asp.net mvc. I created a basic controller and I tried to open it using url. But rendering is not finished and my controller didn't display in several minutes. I did not change anything from default asp.net 5 mvc project also my controller's index method return only hello world string. I don't is there any problem on iis or VS. Any idea about that problem?
Thanks for help.

A: In MVC only public methods that return an ActionResult are accessible as web pages.
So you MUST use something like this:
public class HelloWorldController : Controller
{
    // GET: HelloWorld/Index
    public ActionResult Index()
    {
        return Content("This is <b>Index</b> action...");
    }
    // etc
}

Content(...) is a special method the wraps text into an ActionResult.
Note: only use Content(...) if you specifically do NOT want to use a View such as Index.cshtml - which is what you normally WOULD do, of course.


text:
Q: WCF service hosted in IIS throws 'Failed to access IIS metabase' error Deployed a WCF service in IIS 6.0 gave NETWORK_sERVICE user read/write privileges.
When tries to brows to .SVC file i get below error
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HostingEnvironmentException: Failed to access IIS metabase.]
   System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +637
   System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +174
   System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51
   System.Web.CachedPathData.GetConfigPathData(String configPath) +341
   System.Web.CachedPathData.GetConfigPathData(String configPath) +234
   System.Web.CachedPathData.GetApplicationPathData() +38
   System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +8806383
   System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +117

Any thoughts?

A: Was told that we get 'Failed to access IIS metabase' error if we install IIS after intalling .NET Framework, and remedy is to re-install ASP.NET.
To resolve this error I have followed below steps
1. Stopped IIS
2. Ran below command in command prompt to re-install aspnet.
%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Result:
Start installing ASP.NET (2.0.50727).
..................................................................
Finished installing ASP.NET (2.0.50727).
3. Re-started IIS and WCF service is responding without any issues.


text:
Q: Android Twitter integration failed even using latest Twitter 4J 3.0.3 Hi i'm using this Project. And i have replace old Twitter4j with the latest version (3.0.3).
I also changed from
   mHttpOauthprovider = new DefaultOAuthProvider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token", "http://twitter.com/oauth/authorize");

to
  mHttpOauthprovider = new DefaultOAuthProvider("https://api.twitter.com/oauth/request_token", "https://api.twitter.com/oauth/access_token","https://api.twitter.com/oauth/authorize");

I'm getting this error. Please help me thanks.
Errors:
11-28 11:33:44.574: W/System.err(334): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: https://api.twitter.com/oauth/request_token
11-28 11:33:44.583: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
11-28 11:33:44.583: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
11-28 11:33:44.583: W/System.err(334):  at com.twitter.android.TwitterApp$2.run(TwitterApp.java:126)
11-28 11:33:44.583: W/System.err(334): Caused by: java.io.FileNotFoundException: https://api.twitter.com/oauth/request_token
11-28 11:33:44.583: W/System.err(334):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)
11-28 11:33:44.583: W/System.err(334):  at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:253)
11-28 11:33:44.583: W/System.err(334):  at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18)
11-28 11:33:44.594: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:228)
11-28 11:33:44.594: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
11-28 11:33:44.594: W/System.err(334):  ... 2 more

A: FYI, current version of API is 1.1.
All the URLs you have used are deprecated and one example of correct path is:
For example:
https://api.twitter.com/oauth/request_token


text:
Q: How can I programmatically remove tagged cells without scrolling to them? I've learned a rather succinct way to delete tagged cells using NotebookLocate, but I would prefer the notebook did not scroll to the selection just for a delete operation. How can I delete tagged cells without the notebook scrolling?
Minimal example:
CellPrint[ExpressionCell[x^2, CellTags -> "oldcell"]];

Button["Remove old cell", {
  NotebookLocate["oldcell"];
  NotebookDelete[];
}]

A: Button["Remove old cell",
NotebookFind[InputNotebook[], "oldcell",All, CellTags, AutoScroll -> False];
NotebookDelete[]]

A: Another idea is to use Cells to find the cells instead of NotebookFind:
Button[
    "Remove old cell",
    NotebookDelete @ Cells[CellTags -> "oldcell"]
]


text:
Q: Getting some error after going to checkout page Getting a error while entering the checkout page, attached below is the screenshot.

Below is the code inside the file.
<?php
$mobileHelper = $this->helper('Meetanshi\Mobilelogin\Helper\Data');
if ($helper->isMobileloginEnabled()) {

if (!$mobileHelper->customerLoggedIn()) { ?>
    <div class="check-loginlink">
        <button class="action action-auth-toggle"
                id="checkoutlogin"><?php echo __('Already Have an Account? Click here to login') ?>
        </button>
    </div>
<?php } ?>
<script type="text/javascript">
    require(['jquery', 'jquery/ui'], function ($) {
        $(document).ready(function ($) {
            $('.authentication-wrapper').hide();
            $('#checkoutlogin').on('click', function () {
                $('.mobile-sendotp-popup').modal('openModal');
            });
        });
    });
</script>
<style>
    .authentication-wrapper {
        display: none;
    }

    .check-loginlink {
        width: 100%;
        text-align: right;
    }
</style>

I had tried re-installing the plugin, but its still the same. Please if anyone can help me out that would be great.

A: Line 3, Replace
 if ($helper->isMobileloginEnabled()) {

with
if ($mobileHelper->isMobileloginEnabled()) {


text:
Q: When is it appropriate to use the original pronunciation of a foreign word versus the English pronunciation? When reading to an audience, or speaking in conversation, when is it appropriate to use the original pronunciation of a foreign word versus the English pronunciation (assuming you know the appropriate pronunciation for it)? Is it considered rude, or condescending? Or is it considered a mark of being knowledgeable?
One of the things to consider are place names. When referring to Paris, France, should it be pronounced with the silent 'S' as the French would say it, or with the 'S'? Should Hiroshima be pronounced as a Japanese speaker would pronounce it slightly more emphasis on RO, rather than the SHI? Should Mount Pinatubo be pronounced as a Filipino speaker would pronounce it with shorter stronger vowels, or the longer vowels? (e.g. Pi as is 'pick' rather than 'pea'.) Should Wichita be pronounces as the original "shi" rather than the modern "chi"?
Pronounce pesos or sombrero as a Spanish speaker 'eh' or the English 'ay'?
(I can't think of other common words right now that aren't words taken from other languages like hurricane, boondocks, tornado, etc. which I think have (correctly) changed to English pronunciations.)

A: Paris is the English word for the French city "Paris", as Florence is the English word for the Italian city "Firenze". It is the translated place name and therefore should have the English pronunciation.
That is my recommendation for translated words in general, even if the spelling is the same as in the original language.
But if the word is really not English, then I'd say the speaker should use the original pronunciation.

A: If I am talking to a native French person, it may show appreciation for his language and culture to use the French pronunciation. On the other hand, there may be cases where using the French pronunciation would feel condescending.
When speaking to an audience, I think it is appropriate to use whatever you think will be the most understood. If I am talking to a group of Americans who have very little or no knowledge of French, they may not understand if I used a foreign pronunciation.
Communication is about building relationships. If I alienate someone by using a particular pronunciation, I am defeating the purpose of our interaction. To consolidate my answer to one sentence: Pronounce in whatever way will build the most solidarity between yourself and those to whom you are communicating.

A: Personally, I always go with the English pronunciation, even when speaking to a knowledgeable audience. This is mainly for two reasons:

*

*The English pronunciation is more familiar, even to knowledgeable people. They simply hear it more often. They might know how karate is pronounced in Japanese, but hearing [kəˈrɑːtiː] still makes them feel better, if only subconsciously. English and Japanese are stored in two entirely different parts of their brain, and while some people can constantly flip switches in their brain in the middle of a sentence, nobody really wants it. It is always an effort, however minor.

*More importantly though, I just don't see any need to use the original pronunciation. When I'm speaking English, I'm speaking English. If I wanted to speak French instead, I'd be speaking French. The English pronunciation of Paris is not incorrect in any way or by any measure. Yes, it's different from the French one, but so what?

If we started pronouncing everything the same in all languages, languages as we know them would cease to exist. I don't want to live in that world.

A: I personally HATE when people call me Mike or Michael or even Michelle (my given name is Michel, i.e. masculine version of the French name Michelle) and I cringe when I hear English speakers pronounce Copenhagen with a Germanic aa instead of ei - I believe that particular pronunciation was a mistake perpetrated and perpetuated by a song by David Daniel Kaminsky (Danny Kaye)
As mentioned already in this question, Paris is an unfortunate example because it is spelled the same in English and French.
I work in an international environment but if the conversation is held in English I would pronounce the s and if in French I would not, regardless of the native tongue of the people at the table. If I were to converse in English about a trip from Antwerp via Cologne to Alsace I could but would never use Antwerpen via Köln to Elsass, oh pardon, Alsace, just because there were Flemish/Dutch, German and French colleagues around, unless I KNEW one of them would not recognise the English version...

A: When speaking "pronounceable" foreign words, keep their foreign pronunciation.  If they have sounds that do not occur in the English language, they should be pronounced as English-speakers have agreed to bastardize them.  VERY common Anglicized words should take the audience into account.  I'd sound like a pretentious twit talking to small children about places they don't recognize because I don't use the pronunciations they know.  I'd sound like an uneducated boor using those (easier?) pronunciations in a room full of academics.

A: This is an interesting question. I've recently been rewatching "The World At War" and one interesting feature of the programme is the care that the narrator (actor Laurence Olivier) takes with the pronunciation of foreign words. For example he correctly pronounced Japanese names like "Yamamoto" and he also pronounced names like "Soviet" as if it was Russian.

When referring to Paris, France,
  should it be pronounced with the
  silent 'S' as the French would say it,
  or with the 'S'?

Of course, it should be pronounced as it usually is. "Paris" is the English name. Saying "Pari" sounds affected and ridiculous.

Should Hiroshima be pronounced as a
  Japanese speaker would pronounce it
  slightly more emphasis on RO, rather
  than the SHI?

Japanese has no emphasis (stress) at all, only pitch accent. The Japanese pronunciation of Hiroshima would be difficult to understand for English speakers, so it would be better to use the accepted English pronunciation.

A: I think it depends heavily on the word in question. Take composers' names for instance:
"Hindemith" is acceptable with a German or an English "th". "Beethoven", on the other hand, is pretty unacceptable as "bee though vehn."

A: I think the appropriate degree of anglicization is highly variable and extremely arbitrary; it basically amounts to what people are used to. For instance, often when NPR mentions van Gogh, they add a disclaimer that they know that "van go" is far from the Dutch pronunciation, but that they are sticking with the familiar anglicized pronunciation.
On the other hand, it was NPR reporters like Maria Hinojosa who started a trend of maintaining the "foreign" pronunciation of their names even for American audiences. (Well, I guess Gerry Rivers went back before that, but that was before my time.)

A: I would expect (and accept) native speakers of the language in question to use the foreign pronunciation of foreign words. In other cases, I would tend to expect (and accept) the Anglicized version.
As a resident of East Africa, I often resort to Africanized pronunciations for the sake of being understood. I can use my "proper English" pronunciations until I go mad not being understood, so I find it infinitely more productive to speak in a way that will be easily understood.
For example, if I say with my most natural American accent:

I am going to take it with me to town,

I am likely to get nowhere. If I say:

I tack eet weeth me een tone,

I am instantly understood.
I have regularly agonized over whether this is a good strategy as far as raising the level of English, but ease of communication most always weens out. I say Anglicize away.

A: For words which are commonly used in English (like "Paris") using the foreign pronunciation is guaranteed to sound pretentious.
English has a distinctive phonetic pattern, and switching to another phonetic system in the middle of a sentence for the purpose of pronouncing a different place name would sound odd and draw attention to yourself. Imagine an American speaker switching to a British accent every time he had to say "England". When speaking in an American accent, saying frahns instead of fraens (for France) is unbearably pretentious... even though frahns is the way it's pronounced in British English.
For more rarely used words (for example, small place names rarely mentioned in English), using foreign pronunciations won't be noticed. Nobody in America has ever heard of Ramat Gan, Israel, so pronouncing it the Israeli way (raMAT GAN) instead of the English way (RAMat GAN) won't even be noticed... but with American audiences, switching to American phonetics is always appreciated (using a hard American R instead of a gutteral or fricative will help people understand what you said).

A: I'm fully bilingual in English and Spanish (I grew up in both England and Spain, and I speak both with transparency).
When I speak in Spanish and mention an English word (like "iPod", "Google", "Pokémon"), I consciously dumb it down to how a Spaniard would say it. It is much easier for them to understand, as they are used to the dumbed-down pronunciation, and would perhaps not understand it if I said it to them as an Englishman would.
I'd also get an odd look, and feel like I'm being condescending if I spoke "correctly".

A: When speaking English, keep things in English. If the words were changed when "translated" to English it's because they sounded out of place.

A: Occasionally when listening to an audio book in my Spanish Classes, I would hear mispronounced English words in them occasionally. The most annoying one was when I heard Nike (the shoe manufacturer) pronounced Naik as opposed to a more correct pronunciation Naiki. My opinion on pronouncing foreign words is that to only pronounce them in the original language if you know how to correctly pronounce it in that language.

A: Personally, I think it's a shame so many wonderful words and pronunciations go unused due to fear of being viewed as "pretentious."  That word should be banned from the English language altogether. When it comes to original pronunciations of foreign words, I say speak confidently, boldly and without fear. If you want to say Paree or Venezia (vs Venice) or Para-GWHY vs Para-GWAY, then do so and the heck with what the other fellow thinks!


text:
Q: Can i have some python code in second file and when i run the first file its like the code is inside the first file? I have 2 python files and i want to run the second file in the first one like the code in the second file was inside the first file. Is this possible and if so how?
I dont know what to try please help. Thanks!

A: Just like how you can use import to import other python libraries (built-in or third-party), you can also import your own libraries/modules/files. if the two files are in the same directory, you can do import file2 at the top of file one and run any of the functions or modules within it.
ex:
# this is file_2

def main():
    print('this is from file_2')

# this is file_1
import file_2

file_2.main()

If you then run file_1 (you could run python file_1.py from the terminal, or however you run it), it will print out 'this is from file_2'


text:
Q: mysql #1064 error for parenthesis around FROM I am facing a weird issue while trying to run following query :
SELECT a, b
FROM (
x_tbl AS tbl
)
UNION
SELECT a, b
FROM (
y_tbl AS tbl
)

where x_tbl and y_tbl are 2 tables with common columns a and b.
this query works fine if i do like (no parenthesis) :
SELECT a, b
FROM
x_tbl AS tbl
UNION
SELECT a, b
FROM
y_tbl AS tbl

any idea why ? The same query with parenthesis works fine on a different server but doesn't work on my local.

A: This appear to be connected to an old MySQL parser bug. Are you using a version older than 5.0?


text:
Q: Multitask learning Gaussian Processes A small question
In the book of Rasmussen Page 115 last paragraph. When we have multiple databases you setup a gaussian for each database and the optimisation is said can be done by adding the likelihoods as a single one.
What about the gradients? do I add the gradients?
If I have a simple gaussian with three hyperparameters and I using minimize I will have a function to optimise with 4 hyperparameters, the function and three gradients. is suppose that I just add the gradients? am i correct?
EDIT: Why I am asking this: I have a robot with 6 DoF highly couple. a dataset is a movement in x,y plane, second dataset is a movement in other plane. I am using multioutput gaussians processes.

A: $4$ points?  Did you mean $4$ different problems that you want to link together and learn the same set of hyperparameters? Then your new objective function would be the sum of $4$ (log marginal) likelihoods (Instead of optimizing the each of the $4$ likelihoods independently).  To do so one can use gradient descent (which searches for $0$ in the sum of the $4$ gradients).
This is what the paragraph discusses.
If you only have $4$ points just use the standard GP which involves optimizing a single likelihood function. There are ways that people have used the derivatives to treat ill-posed problems.  But this is not what the paragraph is about.

A: Following the comment of Seeda
i can said that:
The likelihood is defined as:
$$\mathcal{L}\left( \Theta  \right) =  - \frac{1}{2}\log \left( {\left| K \right|} \right) - \frac{1}{2}{y^T}{K^{ - 1}}y - \frac{N}{2}\log \left( {2\pi } \right)
$$
Supposing that there are two set of data A and B.we can define two Likelihood
$$\begin{array}{l}\mathcal{L}{\left( \Theta  \right)_A}\\\mathcal{L}{\left( \Theta  \right)_B}\end{array}
$$
As both describe a same process the optimization can be expressed as
$$\mathcal{L}{\left( \Theta  \right)_{A + B}} = \mathcal{L}{\left( \Theta  \right)_A} + \mathcal{L}{\left( \Theta  \right)_B}
$$
the gradients to apply gradient descend to both set of data will be:
$$\frac{{\partial \mathcal{L}{{\left( \Theta  \right)}_{A + B}}}}{{\partial {\Theta _i}}} = \frac{{\partial \mathcal{L}{{\left( \Theta  \right)}_A}}}{{\partial {\Theta _i}}} + \frac{{\partial \mathcal{L}{{\left( \Theta  \right)}_B}}}{{\partial {\Theta _i}}}
$$


text:
Q: What can go wrong implementing swap copying the bits at low level? Consider this code:
#include <cstring>
#include <memory>

namespace mstd {
template <typename T>
void swap(T& lhs, T& rhs) {
    char tmp[sizeof(T)];

    std::memcpy(tmp, std::addressof(lhs), sizeof(T));
    std::memcpy(std::addressof(lhs), std::addressof(rhs), sizeof(T));
    std::memcpy(std::addressof(rhs), tmp, sizeof(T));
}
}

Using mstd::swap is in general not safe; it is only if std::is_trivially_copyable<T>::value is true.
However I cannot see how it can go wrong. Do anyone know a real example where using this swap will bring a behavior that is not a correct swap, and why?

A: Suppose a class contains a pointer, which must point to one of its own members. It will need copy/move semantics which preserve that invariant. A bytewise copy will ignore those semantics, leaving it incorrectly pointing a member of a different object.
For a specific example, consider a string with "small string optimisation". It contains an embedded buffer to use instead of dynamic memory, if the string is small enough; and a pointer pointing to either that buffer, or dynamic memory. It needs non-trivial copy (and move) operations to make sure the pointer isn't copied, but rather points to the target object's buffer:
string(string const & other) :
    size(other.size),
    data(other.data == other.buffer ? buffer : new char[size])
{
    copy(other.data, other.data+size, data);
}

A bytewise swap (of two small strings) will make each string point to the other's buffer. You'll end up with a dangling pointer if one is destroyed before each other; worse, a destructor implemented as
~string() {if (data != buffer) delete [] buffer;}

will delete something it shouldn't, giving undefined behaviour.

A: I think I understood you correctly, so I'll make this an answer.
If the ctor and consequently the copy ctor of a class has certain side effects, those will not be respected by a bitwise copy. As an example: if an object registers itself upon creation in a central registry by address, e.g. because it is a callback functor. Then the address will point to the wrong object after the swap. In the example, the wrong callback will be executed by the callback holder.

A: One example from the top of my mind is a class, where a child has a pointer to its own parent:
#include <memory>

struct Parent;
struct Child{
    Parent* parent;
};
struct Parent {
    std::unique_ptr<Child> child;
};
void swap(Parent& lhs, Parent& rhs) {
    std::unique_ptr<Child> tmp(std::move(lhs.child));
    lhs.child=std::move(rhs.child);
    rhs.child=std::move(tmp);

    //there is no equivalence for those two lines in your example
    lhs.child->parent=&lhs;
    rhs.child->parent=&rhs;
}

You encounter this e.g. quite often in Qt.


text:
Q: MySQL - reformat a column value dependant on existing value Am needing to provide a concatenated field from a select query which is dependant on existing values.
SELECT `delegate`.`FirstName` AS `First Name`,
   `delegate`.`LastName` AS `Last Name`,
   `organisation`.`Name` AS `Organisation`,
    IF (`delegate`.`PhoneWork`  IS NOT NULL, 'Yes','No') AS `WorkPhone`),
   `delegate`.`EmailAddress` AS `Email Address`
FROM `delegate`
JOIN `organisation` on((`delegate`.`OrganisationID` = `organisation`.`ID`))

Can anyone point me in the right direction?

A: In Mysql you can use CONCAT function to concatenate values ,you can use your logic in if() to show yes/no according to the criteria.if you want to show the value from column when its not empty then replace 'Yes' with your column name
SELECT
   `d`.`FirstName` AS `First Name`,
   `d`.`LastName` AS `Last Name`,
   `o`.`Name` AS `Organisation`,
    IF (`d`.`PhoneWork`  IS NOT NULL AND `d`.areacode IS NOT NULL,CONCAT(`d`.`PhoneWork`,' ',`d`.areacode),'your value') AS `concat_colum`,
    IF (`d`.`PhoneWork`  IS NOT NULL,'Yes','No') AS `WorkPhone`,
    IF (`d`.`areacode`  IS NOT NULL,'Yes','No') AS `areacode`,
   `d`.`EmailAddress` AS `Email Address`,
FROM `delegate` d
JOIN `organisation` o ON(`d`.`OrganisationID` = `o`.`ID`)

You can do the same by using CASE too
SELECT
   `d`.`FirstName` AS `First Name`,
   `d`.`LastName` AS `Last Name`,
   `o`.`Name` AS `Organisation`,
    CASE WHEN
    `d`.`PhoneWork`  IS NOT NULL AND `d`.areacode IS NOT NULL
    THEN CONCAT(`d`.`PhoneWork`,' ',`d`.areacode)
    ELSE 'your value' END  AS `concat_colum`,
    CASE WHEN `d`.`PhoneWork`  IS NOT NULL THEN 'Yes' ELSE 'No' END AS `WorkPhone`,
    CASE WHEN `d`.`areacode`  IS NOT NULL THEN 'Yes' ELSE 'No' END  AS `areacode`,
   `d`.`EmailAddress` AS `Email Address`,
FROM `delegate` d
JOIN `organisation` o ON(`d`.`OrganisationID` = `o`.`ID`)


text:
Q: JavaScript fetch: missing RapidAPI application key I'm learning how to use RapidAPI and I get the same problem. I'm trying to use Random Famous quotes with JavaScript fetch. I copy this code:
async componentDidMount() {
    await fetch("https://andruxnet-random-famous-quotes.p.rapidapi.com/?count=10&cat=movies", {
        "method": "POST",
        "headers": {
            "x-rapidapi-host": "andruxnet-random-famous-quotes.p.rapidapi.com",
            "x-rapidapi-key": "5d4682bb48msh8e662b997230c75p180ff3jsne9e95966eb37",
            "content-type": "application/x-www-form-urlencoded"
        },
        "body": {}
    })
    .then(response => {
        console.log(response);
    })
    .catch(err => {
        console.log(err);
    });

And in the console this is the response:
body: ReadableStream { locked: false }

bodyUsed: false

headers: Headers {  }

ok: true

redirected: false

status: 200

statusText: "OK"

type: "cors"

url: "https://andruxnet-random-famous-quotes.p.rapidapi.com/?count=10&cat=movies"

The url leads to the error: "message": "Missing RapidAPI application key. Go to https://docs.rapidapi.com/docs/keys to learn how to get your API application key."
It seems that the api key is missing, but as I understand it is provided in fetch headers. Is this is a syntax mistake or something else I'm missing? Thanks in advance.

A: This code is working fine for me.
fetch("https://andruxnet-random-famous-quotes.p.rapidapi.com/?cat=movies&count=10", {
    "method": "POST",
    "headers": {
        "x-rapidapi-host": "andruxnet-random-famous-quotes.p.rapidapi.com",
        "x-rapidapi-key": "fdb84465dfmsh5c2245c197e72f7p1cf738jsnabb992bd3635"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});

If it still does not work and the error persists, I recommend you rotate your API key or generate a new API key for you on RapidAPI Developer Dashboard as you have exposed your API key in your question.


text:
Q: Virtualbox 4.2 not booting any virtual machines I upgraded from 12.10 to 13.04 and my Virtualbox-4.1 stopped working. So I downloaded the Virtualbox-4.2 deb for Raring ringtail from their website and installed it. When I start Virtualbox, it starts fine. On trying to start a Virtual Machine I get this error.
RTR3InitEx failed with rc=-1912 (rc=-1912)

The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

'/etc/init.d/vboxdrv setup'

may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

On running /etc/init.d/vboxdrv setup I get:
farhat@palantir:~$ /etc/init.d/vboxdrv setup
 * Stopping VirtualBox kernel modules
 * Cannot unload module vboxdrv

What should be done here?
Thanks,
ETA:
farhat@palantir$ sudo dpkg -l | grep -e virtualbox -e linux-headers -e dkms
ii  dkms                                      2.2.0.3-1.1ubuntu2                     all          Dynamic Kernel Module Support Framework
ii  linux-headers-3.8.0-26                    3.8.0-26.38                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-26-generic            3.8.0-26.38                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-generic                     3.8.0.26.44                            amd64        Generic Linux kernel headers
rc  virtualbox-4.1                            4.1.26-84997~Ubuntu~precise            amd64        Oracle VM VirtualBox
ii  virtualbox-4.2                            4.2.16-86992~Ubuntu~raring             amd64        Oracle VM VirtualBox

A: This command must run with root privileges. Try:
sudo /etc/init.d/vboxdrv setup

Also try purging everything:
apt-get purge virtualbox-4.1 virtualbox-4.2

then reboot, reinstall VirtualBox 4.2, and run:
sudo apt-get -f install

to install any missing dependencies.
Run sudo /etc/init.d/vboxdrv setup again to make sure the VirtualBox kernel module is installed.

A: I might have a good hint on this one. I've had a 64 bit kernel on my 32 bit system for some funny reason. Nothing I did managed to avert this annoyance but once I reverted back to a 32 bit kernel all of a sudden everything popped back into place.

A: This is pretty old question, but I recently had similar issue with Virtual Box 5.0. Reinstalling Virtual Box using '.deb' from their website helped.

A: First you need to remove all Virtualbox-related Softwares/Dependencies by running this:
sudo apt-get  remove virtualbox

then reboot your OS and reinstall downloaded version.
It happens when you have an installed app with same name as one of Virtualbox dependencies has.
Hope it help.

A: Stolen from VirtualBox - RTR3InitEx failed with rc=-1912 (rc=-1912)
Credits go to @Ravexina https://askubuntu.com/users/264781/ravexina)
But it's the definite solution to the problem.

It seems that your installation version of virtualbox is for 32-bit architecture while you are running 64-bit operation system which can be the cause of this problem.
My workaround would be to remove the installed version from PPA, and installing virtualbox from official repositories.
To remove virtualbox, run:
sudo apt autoremove --purge virtualbox*

After that make sure there is no other version installed on your system by:
dpkg -l virtualbox* | grep ^i

You shouldn't get any output, also you can try to run virtualbox to make sure it's not installed.
Then remove all related PPAs from your sources.list and sources.list.d directory. ex:
mkdir ~/apt-tmp
sudo mv /etc/apt/sources.list.d/* ~/apt-tmp

Make sure there is nothing except official repositories sources in /etc/sources.list.
And update your sources:
sudo apt update

Now we can search to see which versions are available to install:
apt-cache madison virtualbox | grep -iv sources

Which produces an output like this:
virtualbox | 5.0.32-dfsg-0ubuntu1.16.04.2 | http://mirrors.kernel.org/ubuntu xenial-updates/multiverse amd64 Packages
virtualbox | 5.0.18-dfsg-2build1 | http://mirrors.kernel.org/ubuntu xenial/multiverse amd64 Packages

Then I would install the last version mentioned in xenial-updates:
sudo apt install virtualbox=5.0.32-dfsg-0ubuntu1.16.04.2

Also sudo apt install virtualbox, would be fine, but I would go with the above command to make sure my desired version is going to be installed.
And after all, check that the correct version is installed.
From command line:
dpkg -l virtualbox* | grep ^i

ii  virtualbox                     5.0.32-dfsg-0ubuntu1.16.04.2 amd64        x86 virtualization solution - base binaries
ii  virtualbox-dkms                5.0.32-dfsg-0ubuntu1.16.04.2 all          x86 virtualization solution - kernel module sources for dkms
ii  virtualbox-qt                  5.0.32-dfsg-0ubuntu1.16.04.2 amd64        x86 virtualization solution - Qt based user interface

From GUI: to make sure correct version is running.
Help menu -> about virtualbox


text:
Q: How to create a resource with Resource id? When I used proc_open, it returns a resource handle represented as Resource id #4. This code runs on the server, and I want to use this 'handle' again using the id. But after some kind of data transfer between the client and the server, all I got is the resource's id, Resource id #4, instead of the pointer.
Is is possible to recreate the resource with the only id?

A: No, this could never reliably work, because in a new request you have no clue whether the resource is even still accessible - in a preforked environment like Apache the second request might be executed by a completely different process, in which accessing the same resource would be impossible on the OS level. Also, in a clustered and/or load balanced environment the second request could even end up on a completely different server.