text:
Q: Identity and primary key c# + sql server: I have to import a few tables from Access into sql server. The new sql server tables are already defined and created. The Access tables have primary key - foreign key relationships that have to be maintained. I would like to have the new sql tables use identity values for the primary keys, but I can't easily load the legacy rows and maintain the relationships if I do that. I could possibly load the data using identity_insert but I have to back way out of my ORM software (subsonic) to do that. Perhaps I can make my new primary keys non-identity types, but then there is the hassle of generating unique ids for all the rows I add later. I'm sure this has a decent solution out there somewhere.

A: Create the tables with the PKs as "int" (without identity), load your data, and then change the PK fields to int identity...

A: Could you import the primary keys as non-identity types, then once all the data from all the tables is imported change them to identity types?


text:
Q: jQuery: How to get value from "this" object? I made one helper for open new popup window on click and I have a problem with setup default values inside object. I need to calculate position for TOP and LEFT position for popup to center new popup. Here is complete code:
/*
    $(element).onPopup(options); - Open Popup window
    -Ths function open new popup window on your browser

    EXAMPLE:
    ----------------------------------------------
    Google

    $("a#link").onPopup({
        name        :   "Popup Window",
        width       :   800,
        height      :   600
    });

    OPTIONS:
    ----------------------------------------------
    attr            // attribute where is located link
    name            // name of popup window
    width           // max width
    height          // max height
    left            // position left    (px)
    top             // position top (px)
    resizable       // resizable 1 or 0
    location        // display location 1 or 0
    fullscreen      // open in full screen  1 or 0
    scrollbars      // display scroll bars  1 or 0
    titlebar        // display title bar    1 or 0
    toolbar         // display tool bar     1 or 0
    directories     // display directories  1 or 0
*/
$.fn.onPopup=function(options){
    var s   = {
            attr        :   "href",
            name        :   "Popup Window",
            width       :   700,
            height      :   600,
            left        :   ($(window).width()/2)-(this.width/2),
            top         :   ($(window).height()/2)-(this.height/2),
            resizable   :   0,
            location    :   0,
            fullscreen  :   0,
            scrollbars  :   1,
            titlebar    :   0,
            toolbar     :   0,
            directories :   0
        },
        $element    = this;

    s = $.extend(s,options);

    $element.on("click",function(e) {
        e.stopPropagation(); e.preventDefault();
        window.open(
            $(this).attr(s.attr), s.name, "width="+s.width+", height="+s.height+", directories="+s.directories+", toolbar="+s.toolbar+", titlebar="+s.titlebar+", scrollbars="+s.scrollbars+", fullscreen="+s.fullscreen+", location="+s.location+", resizable="+s.resizable+", top="+s.top+", left="+s.left
        );
     });
};

And here is where is my problem:
var s   = {
             /*...*/

                width       :   700,
                height      :   600,
                left        :   ($(window).width()/2)-(this.width/2),
                top         :   ($(window).height()/2)-(this.height/2),

             /*...*/

            },

How to pass width/height to another object to work?

A: One way is to create the object first then add extra properties that reference other properties in the object
var s   = {
        attr        :   "href",
        name        :   "Popup Window",
        width       :   700,
        height      :   600,
        left        :   null, //calculated if not user provided
        top         :   null  //calculated if not user provided
       ....
    };

// update user settings
s = $.extend(s,options);

// calculate based on actual values
if(s.left === null){
   s.left =  ($(window).width()/2)-(s.width/2);
}
if(s.top === null){
   s.top  =  ($(window).height()/2)-(s.height/2);
}

Also note you should return this.each(.. and run your business there so you have separate instances when selector includes more than one element as well as make the plugin chainable with other jQuery methods

A: According to your API in the code comments you want the caller to be able to specify their own left and top positions.
You therefore need to check whether any values have been given at all, and only then calculate the default position based on the configured width and height.
var s = {
    ... // defaults, *not including* "left" and "top"
};

// override the defaults with the user-supplied options
// NB: no need to re-assign to `s` - `$.extend` overwrites
//     the contents of the first parameter
$.extend(s, options);

// then calculate `left` and `top` if they weren't supplied
if (s.left === undefined) {
    s.left = ($(window).width() - s.width) / 2;
}
if (s.top === undefined) {
    s.top  = ($(window).height() - s.height) / 2;
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to display a string, based on number in a form with JavaScript I have the user entering a post-number in a form-field, and then I want to display the town with that post-number.
I have the server-side function set up, it takes a variable from the URL and returns a plain string.
As I see it, I need to get the variable from the form-field after the user has written it and the focus has left the form-field, use that number in an XMLHttpRequest call to the server and display the resulted string.
But the problem is, that I've never written any JavaScript, more complex than a Hello World. So I would like some help with writing the JavaScript for that page, any help would be appreciated.

A: Since you are new to JavaScript I won't recommend using any JS framework for this.
To get the value from an input box you can use
document.getElementById("txt1").value;

where txt1 is the id of the input element.
Then you can append the element value to the query string and call the server-side function. And if the response text is a plain string put that inside a div or span
document.getElementById("divTown").innerText = "response string"; // for IE

document.getElementById("divTown").textContent = "response string"; // for FF

You can get a basic understanding of AJAX and JavaScript read these
AJAX Introduction
JavaScript Tutorial


text:
Q: Is it possible to distribute newer version of libc with my application? I have an application that needs to be run on various ancient Linux platforms so I link it against GNU libc 2.1.2. However currently I'm considering building a UNICODE version of the app. The problem is that the libc I'm linking against does not have certain basic functions like vswprintf.
Would it be possible to use let's say libc 2.4 and provide it with my application (as a separate file libc.so.6)? Would it violate the GNU libc license?
Are there other solutions? Perhaps there is a vswprintf function available (I believe it's not very efficient to code this one). So far the only other option I have is to convert everything to char* and use vsprintf.

A: Sounds like pretty bad idea. Ancient platforms should have ancient system calls, with ancient prototypes.Read  here

The world changes and system calls change. Since one must not break old binaries, the semantics associated to any given system call number must remain fully backwards compatible.
What happens in practice is one of two things: either one gets a new
  and improved system call with a new name and number, and the libc
  routine that used to invoke the old call is changed to use the new
  one, or the new call (with new number) gets the old name, and the old
  call gets "old" prefixed to its name.

A:
Would it be possible to use let's say libc 2.4 and provide it with my application (as a separate file libc.so.6)?

Yes and no. You can't distribute just libc.so.6, for reasons explained here.
You would have to distribute an almost complete build of GLIBC, and it would have to be installed in a fixed location (because you can't easily update path to ld-linux that is hardcoded into your executable at build time). And your build will likely not work on sufficiently old kernels anyway.

Would it violate the GNU libc license?

Not if you make the sources that you used to build libc available, and use dynamic linking (but I am not a lawyer, and you should consult with one for legal questions like this one).

Are there other solutions?

BSD libc appears to have an implementation of wide-character printf that you may be able to reuse, as do musl and uClibc. Beware, this is likely a non-trivial proposition.


text:
Q: Naming Windows API constants in C# The naming convention for constants in C# is Pascal casing:
private const int TheAnswer = 42;

But sometimes we need to represent already-existing constants from the Windows API.
For example, I don't know how to name this:
/// <summary>
/// With this style turned on for your form,
/// Windows double-buffers the form and all its child controls.
/// </summary>
public const int WS_EX_COMPOSITED = 0x02000000;

What should I name it?
Keeping it as WS_EX_COMPOSITED allows me to quickly associate it with the WinAPI, but it's wrong.
Some options:

*

*WsExComposited -- Too hungarian

*Composited -- Too short

*WsEx enum with Composited in it -- Still hungarian

*ExtendedWindowsStyles.Composited -- Constant in a class? Enum?
It should be noted that the objectives for a good naming are:

*

*It must be readable.

*It must not trigger FxCop and StyleCop, even if that means hiding it from them.

A: WS_EX_COMPOSITED is perfectly fine for part that directly interfaces with Win API (or any other documented API for that matter). The portion that you want to expose should follow standard conventions - have separate public facade to call native functions with good method names (you'll eventually forget what you've researched about particular combinations of flags, but good wrapper method name will at least let you use it).
The side benefit of keeping the name as close as possible to native API is that you can search for constant directly in the MSDN/other documentation and find answer immediately. It will be much harder if you rename it.

A: Maybe this will help new visitors with this question.

If the field or variable name is intended to match the name of an item associated with Win32 or COM, and thus needs to begin with an underscore, place the field or variable within a special NativeMethods class. A NativeMethods class is any class which contains a name ending in NativeMethods, and is intended as a placeholder for Win32 or COM wrappers. StyleCop will ignore this violation if the item is placed within a NativeMethods class.


text:
Q: pypi sas7bdat to_data_frame taking too long for large data(5 GB) I have a 5GB SAS file and the requirment is to create parquet file in Hadoop. I am using SAS7BDAT library and using following approach which is taking more then 5 hours in creating pandas dataframe when running pyspark on client mode. Curious to know if there is any better way of doing the same.
I know there is saurfang package available which is more efficient in this case, but we do not want to use any 3rd part software.
f =  sas7bdat.SAS7BDAT(str(source_file))
pandas_df = f.to_data_frame()
spark_df = spark.createDataFrame(pandas_df)
del pandas_df
spark_df.write.save(dest_file,format='parquet', mode='Overwrite')

A: Please use Spark to read the file, not Pandas
https://github.com/saurfang/spark-sas7bdat/blob/master/README.md#python-api
Add this to your packages
saurfang:spark-sas7bdat:2.1.0-s_2.11

Note, I've not personally used this, I only search for "SAS 7B DAT + Spark". If you have issues, please report here
https://github.com/saurfang/spark-sas7bdat/issues/


text:
Q: How to allow access to the module with the appropriate(specify) IP addresses, in Yii2? How to allow access to the module with the appropriate(specify) IP addresses, in Yii2?
I try, but give error:
Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: app\modules\getsp\getsp::allowedIPs

web.php
//....
'modules' => [
    'getsp' => [
        'class' => 'app\modules\getsp\getsp',
        'allowedIPs' => ['127.0.0.1', '::1'],
    ],
],
 //...

A: Try this solution might be resolve your issue.
Main-local.php
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';

$config['bootstrap'][] = 'getsp';
$config['modules']['getsp'] = 'yii\getsp\Module';
}

Main.php
'modules' => [
    'getsp' => [
        'class' => 'yii\getsp\Module',
        'allowedIPs' => ['127.0.0.1', '::1', '192.168.1.*', 'XXX.XXX.XXX.XXX'] // The server machine ip is ex:-(192.168.1.102). or your PC PC ip address ex:-(192.168.1.101) adjust this to your needs
    ],
],


text:
Q: How to stop / pause webcamera I need to close access to the webcam from the browser tab which has localvideo. Im using this for video conference app and need to pause the localvideo
    async getUserMedia() {
    if (navigator.getUserMedia) {
      try {
        let constraints;
          constraints = { 'video': true, 'audio': true };
          const stream = await navigator.mediaDevices.getUserMedia(constraints);
          this.localStream = stream;
          this.localVideo = document.getElementById('localVideo');
          this.localVideo.srcObject = stream;
      } catch (err) {
        console.error('Error getting user media.', err);
      }
    }

    else {
      console.log('Your browser does not support getUserMedia API');
    }
  }

I tried with this, but its just stop the video and wont cannot connect again with the users
    export async function camera(e) {
  var stream = localVideo.srcObject;
  var tracks = stream.getTracks();

  for (var i = 0; i < tracks.length; i++) {
    var track = tracks[i];
    track.stop();
  }

  localVideo.srcObject = null;
}

A: Use
//for disable
  for (var i = 0; i < tracks.length; i++) {
    var track = tracks[i];
    track.enabled = false;
  }

//for enable

  for (var i = 0; i < tracks.length; i++) {
    var track = tracks[i];
    track.enabled = false;
  }


text:
Q: Find $P(z)$ so that $P\left(x-\frac1x\right) = x^5 - \frac1{x^5}.$ Given that $x^n - \frac1{x^n}$ is expressible as a polynomial in $x - \frac1x$ with real coefficients only if $n$ is an odd positive integer, find $P(z)$ so that $P\left(x-\frac1x\right) = x^5 - \frac1{x^5}.$

My brain is not working with me today!  I don't know how to start this problem.  Solutions are greatly appreciated.

A: $$\left(x-\frac{1}{x}\right)^5 = x^5-5x^3+10x-\frac{10}{x}+\frac{5}{x^3}-\frac{1}{x^5} $$
$$\left(x-\frac{1}{x}\right)^3 = x^3-3x+\frac{3}{x}-\frac{1}{x^3}$$
hence
$$ \left(x-\frac{1}{x}\right)^5 + 5\left(x-\frac{1}{x}\right)^3 +5\left(x-\frac{1}{x}\right)=x^5-\frac{1}{x^5}$$
and
$$ P(z) = \color{red}{z^5+5z^3+5z}.$$

A: Hint:
$$(x-\frac{1}{x})^5=(x^5-\frac{1}{x^5})-5(x^3-\frac{1}{x^3})+10(x-\frac{1}{x})$$
$$(x-\frac{1}{x})^3=(x^3-\frac{1}{x^3})-3(x-\frac{1}{x})$$


text:
Q: Algorithm for finding the closest set of measurment to certain measurment
I have a collection of measurments, example:
measurment #1: { 200, 350, 712, 1023, 1430, 1555, 1800, 2036, 2569 }
measurment #2: { 165, 400, 974, 1124, 1600, 1893, 1919, 2032, 2654, 2932 }
...
measurment #N: { 234, 454, 879, 1432, 1877, 2000, 2543, 2876 }
The order of the elements in each measurment is important.
Each element will have higher value than the previous.
The number of elements in each measurment may vary,
but they should not vary to much.
Now i am getting as an input a new measurment
(lets say: { 212, 354, 978, 1222, 1454, 1922, 2013, 2432, 2987})
and should find the closest measurment from the collection of measurment i already possess.
My question is what algorithm should i use for this task ?
More:
1. It is also possible to extend the task in such meatter that instead input of one measurment i will be given a small collection of measurments.
2. Each element in a measurment represent time passed in second from the begining.
The measuring is stoped when reached 3600 seconds (1 hour), therfore the minimal posible value will be 0 and the maximal will be 3599.
The events creating each element in the measurment to be created is affected by a human behaviour.
Thanks for your help :)

A: Find the squared sum of errors of your new measure with each measurement in your collection. Then return the one from your collection with the smallest error.
var measures = [
 [1, 2, 3, 4],
 [10, 20, 30, 40],
 [66, 77, 88, 99],
 [101, 202, 303, 404]
];

// ignores measurements that aren't the same length as the data
// uses the squared sum of differences (errors)
function findClosest(data) {
  var minError = 0x7FFFFFFF; // max 32bit signed int
  var result = null;
  for(var i=0; i < measures.length; i++) {
    if(data.length !== measures[i].length) { continue; }
    var error = 0;
    for(var j=0; j < data.length; j++) {
      error += Math.pow(measures[i][j] - data[j], 2);
    }
    if(error < minError) {
      minError = error;
      result = measures[i];
    }
  }
  return result;
}

// allows data that is different length than measurements by trying to best fit each element of data to an element of the tested measurement
// uses the squared sum of differences (error)
function findClosestV2(data) {
  var minError = 0x7FFFFFFF; // max 32bit signed int
  var result = null;
  for(var i=0; i < measures.length; i++) {
    var measure = measures[i];
    var error = 0;
    var minLocalError = 0x7FFFFFFF;
    for(var j=0; j < data.length; j++) {
      for(var k=0; k < measure.length; k++) {
        var localError = Math.pow(measure[k] - data[j], 2);
        if(localError < minLocalError) {
          minLocalError = localError;
        }
      }
      error += minLocalError;
    }
    if(error < minError) {
      minError = error;
      result = measures[i];
    }
  }
  return result;
}

// allows data that is different length than measurements by trying to best fit each element of data to an element of the tested measurement
// uses the average of the absolute error % using the previous measurement as the ideal value
function findClosestV3(data) {
  var minError = 0x7FFFFFFF; // max 32bit signed int
  var result = null;
  for(var i=0; i < measures.length; i++) {
    var measure = measures[i];
    var error = 0;
    var minLocalError = 0x7FFFFFFF;
    for(var j=0; j < data.length; j++) {
      for(var k=0; k < measure.length; k++) {
        var localError = Math.abs( (measure[k] - data[j]) / measure[k] );
        if(localError < minLocalError) {
          minLocalError = localError;
        }
      }
      error += minLocalError;
    }
    // average of sum of error percentages
    error /= data.length;
    if(error < minError) {
      minError = error;
      result = measures[i];
    }
  }
  return result;
}

console.log(findClosest([2,3,4,5])); // [1,2,3,4]
console.log(findClosest([70,80,90,100])); // [66,77,88,99]
console.log(findClosest([9,19,304,405])); // [101,202,303,404]

console.log(findClosestV2([404])); // [101,202,303,404]
console.log(findClosestV2([66,67,68,69])); // [66,77,88,99]
console.log(findClosestV2([9,19,304,405])); // [10,20,30,40]

console.log(findClosestV3([404])); // [101,202,303,404]
console.log(findClosestV3([66,67,68,69])); // [66,77,88,99]
console.log(findClosestV3([9,19,304,405])); // [10,20,30,40]

A: Assuming that your data is "fuzzy", one class of algorithms you may want to look into is dynamic programming. By fuzzy I mean that two sets are almost align, but one set may have extra elements inserted, removed compared to the other and the matching elements "almost" matches.
In these types of algorithms you typically define a distance score by defining a penalty for inserting/removing an element in the alignment and a penalty score for two elements not quite matching.
In your case you may define an insert / delete penalty of "100" seconds for inserting an extra timing event, and a two-element distance score as the absolute distance in seconds.
Given that definition you can easily find and modify a needleman-wunsch algorithm implementation or something similar. This will give you the distance between two small sets of measurements in an acceptable amount of time.
However, if your number of elements in your measurements is huge or your number of sets is huge, and you need the answer in say milliseconds, then it is a rather difficult problem unless you can find a lot of good constraints for your problem.
The above is just an example, it all boils down to the context. Is your data noisy? How "noisy", with extra elements in the middle, start or end or just slightly off in position? plus a ton of other questions.
Choosing and implementing fuzzy algorithms can range between pretty easy to near impossible all depending on the context and what you are going to use the result for. Does it need to be exact or "just good enough". Does it need to be fast, etc.


text:
Q: Batch Active Learning for classification? Say we have unlimited unlabeled data and we can ask an oracle for labels. We can use active learning to choose the most informative data samples for labeling, thus minimizing data labeling cost. If we choose a single sample at a time, we can choose the one with the highest class entropy.
How do we go about choosing a batch of k samples to be labeled, e.g. for deep learning?
Some approaches I encountered are:

*

*Choose k samples with the highest class entropy.

*As in 1., but ensure that there are the same amount of samples from every class in the batch.

*Select K samples with the highest class entropy and randomly choose k samples out of them.

Are there any more sophisticated approaches that work in every scenario? Which of the above would be the best to use?

A: I can recommend you Yuxin Chen and Andreas Krause's NIPS'13 paper about Near-optimal Batch Mode Active Learning and Adaptive Submodular Optimization.
Reformulating your hypothesis tests using the Adaptive Submodularity framework provides great theoretical run-time guarantees for greedy algorithms.
In this paper, they showed that their hit-and-run sampler works near-optimal for sampling for any results which are confined by a convex body (like linear separators). For a non convex body, you can use hit-and-run as a good heuristic.


text:
Q: Feature Page Lets say that I want to create a feature environment, which has two columns, in one column there is a picture (with a caption), in the second there is text. For the odd pages, I want the picture on the left, text on the right, and, for the even pages, I want the text on the left, picture on the right.
What is the best way to achieve this, Does someone have an example?
I have something working, using tikz, but the code is messy (lots of manual tweaking on a case-by-case basis). I am sure a cleaner example exists....

A: You can use the changepage  package to detect if it is an odd or even page, and switch the order you place things:

Notes:

*

*Text block near image shows how to use tikz to place text at the appropriate points relative to the image.

Code:
\documentclass{article}
\usepackage[paperwidth=9.0cm, margin=0.5cm]{geometry}% For better illustrative image
\usepackage{graphicx}
\usepackage{array}
\usepackage{booktabs}

\usepackage{changepage}
\strictpagecheck

\newcommand*{\ImageSize}{3.5cm}%  Set the width of the images here

\newcommand*{\TextSize}{\dimexpr\linewidth-\ImageSize-4\tabcolsep}%
\newcommand{\MyTwoColumn}[2]{%
\medskip\par\noindent%
\centering\checkoddpage%
    \noindent
    \ifoddpage
        \begin{tabular}{m{\ImageSize}m{\TextSize}}\toprule
        \includegraphics[width=\ImageSize]{#1} &  {\raggedright#2\par} \\
    \else
        \begin{tabular}{m{\TextSize}m{\ImageSize}}\toprule
        {\raggedright#2\par} & \includegraphics[width=\ImageSize]{#1}\\
    \fi\bottomrule
\end{tabular}%
\medskip\par%
}

\begin{document}
\MyTwoColumn{../images/EiffelWide}{Awesome Vacation on left page}
\clearpage
\MyTwoColumn{../images/EiffelWide}{Awesome Vacation on right page}
\end{document}


text:
Q: Cannot read .sign of undefined error being thrown with Fastify I am creating my server the following way:
const createServer = options => {
  const { logSeverity } = options;

  const server = Fastify({
    ignoreTrailingSlash: true
  });

  server.listen(5000, err => {
    if (err) {
      server.log.error(err);
      console.log(err);
      process.exit(1);
    }
  });

  server.register(AutoLoad, {
    dir: path.join(__dirname, "api", "routes")
  });

  server.register(jwt, {
    secret: nconf.get("secrets.jwt")
  });
};

And in one of my modules at ./some/child/path/signToken.js, I do:
const nconf = require("nconf");
const jwt = require("fastify-jwt");

const signToken = payload => {
  fastify.jwt.sign(payload, nconf.get("secrets.jwt"), (err, token) => {
    if (err) throw err;

    const response = {
      userId: payload.user._id,
      username: payload.user.username,
      token
    };

    return response;
  });
};

module.exports = { signToken };

Which throws an error, Cannot read property 'sign' of undefined.
According to the docs,
This will decorate your fastify instance with the standard jsonwebtoken methods

What am I doing wrong here? Is this perhaps not possible because I am creating a server, and server is my fastify instance? Would I then have to import server somehow?

A: You are starting your server with
server.listen(5000...

Before registering your plugins.
According to the fastify docs  the proper order is:

*

*plugins (from the fastify ecosystem)

*your plugins (your custom plugins)

*decorators

*hooks and middlewares

*your services

This should happen before calling fastify.listen().


text:
Q: Setting background of imageView in RelativeLayout I am setting a background of an imageView of a relative layout using Helper.sync_settting_2(img_sync, context).
 try {
            final RelativeLayout layout_img_sync = (RelativeLayout) findViewById(R.id.relative_lay_6);
            final ImageView img_sync = (ImageView) findViewById(R.id.img_sync);
            layout_img_sync.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    Helper.sync_settting_2(img_sync, context);
                }
            });
        } catch (Exception e) {
    };

Here is the function Helper.sync_settting_2(ImageView sync, Context ct).
 public static void sync_settting_2(ImageView sync, Context ct) {
    Toast.makeText(ct, "Sync Started", Toast.LENGTH_LONG).show();
    getJobData getJobs = new getJobData(null);
    sync.setBackground(ct.getResources().getDrawable(
            com.org.courier.R.drawable.sync_image_orange));
    getJobs.setOnApiLIstner(new onApiCompleted() {
        @Override
        public void onApiResults(ArrayList<job_entity> events_list) {
            getMessageData getMessage = new getMessageData(null);
            getMessage.setOnApiLIstner(new getMessageData.onApiCompleted() {

                @Override
                public void onApiResults(
                        ArrayList<message_entity> events_list) {
                    getContactData getContact = new getContactData(null);
                    getContact
                            .setOnApiLIstner(new getContactData.onApiCompleted() {

                                @Override
                                public void onApiResults(
                                        ArrayList<contact_entity> events_list) {
                                }
                            });
                    getContact.execute();
                }
            });
            getMessage.execute();
        }
    });
    getJobs.execute();
    sync.setBackground(ct.getResources().getDrawable(
            com.org.courier.R.drawable.sync_image_03));
    Toast.makeText(ct, "Sync Finished", Toast.LENGTH_SHORT)
    .show();
}

It showing an error

"java.lang.NoSuchMethodError: android.widget,ImageView.setBackground"

A: View.setBackground wasn't added until API 16. I ran into this issue myself, and couldn't figure out for the life of me why it was happening, since I didn't get any newAPI warnings.
If you want it to be compatible with all versions of Android, you should use:
setBackgroundResource()
or
setBackgroundDrawable()
However, for an ImageView, you should instead be setting the SRC, not the Background:
setImageResource() or setImageDrawable()


text:
Q: Having a static variable called as argument I would like to implement a structure which contains a defined color issued from System.Drawing.Color. Here is my final code.
namespace ColorSystem
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

    }

    internal void testfunc(Label lbl, System.Drawing.Color newcolor)
    {
        lbl.BackColor = newcolor;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        var getvalue = ColorValues.NormalFont;
        testfunc(label1, ColorValues.NormalFont);
        testfunc(label2, ColorValues.NormalFont2);
    }

}
public static class ColorValues
{
    // Private variable to hold font once instantiated
    public static System.Drawing.Color NormalFont{ get{ return Color.AliceBlue;}}//Dynamic
    public static System.Drawing.Color NormalFont2 =         Color.AliceBlue;//static ??
}

What I still don't get is what the difference between those two lines:
 public static System.Drawing.Color NormalFont{ get{ return        Color.AliceBlue;}}//Dynamic
 public static System.Drawing.Color NormalFont2 =         Color.AliceBlue;//static ??

When I look with the mouse I see that.

What is the difference between the cube and the hand? Hand is the (get) so is it dynamic? and the cube is a data in memory... ??
Thanks a lot folks!

A: Your testfunc should look like this:
internal void testfunc(Label lbl, ColorValue newcolor)
{
    lbl.BackColor = newcolor.NormalFont;
}

How are you passing in your struct? It should be like so:
ColorValue colorstruct;
testfunc(somelabel, colorstruct);

Also, consider changing the name of NormalFont since its not really a font but a color.

A: Your first example works, but then you say you want make your method take your struct ColorValue as parameter, sure you can do it, but you can't fill BackColor of Label with your struct, because it is of different type and as you guess you would have to pass instance of your struct as you did in your last example.
So either go with your first example, or with your last, but you have to create instances of your struct.
Regarding memory, if you created 1000 instances of Form1 you would make 1000 instances of ColorValue, but if your struct ColorValue will stay as it is, it is only 1 byte. Generally memory is not an issue.
Edit:
What is the difference between the following?
public static System.Drawing.Color NormalFont{ get{ return        Color.AliceBlue;}}//Dynamic
public static System.Drawing.Color NormalFont2 =         Color.AliceBlue;//static ??

First one is a property, while the second is a field. Properties have set and get methods, so difference is that trying to get value of property will call get method which will return what you want, while field is direct reference to what you want. It is generally advised to expose only properties and hide fields, reason being, that you cannot (or cannot easily) debug/monitor access to fields, while it is easy to debug access to properties.

A: I would use a static class, and have some read-only properties. Only instantiate the colors when they are used, so your class will start out with all nulls (no memory allocated), then as you read/get each property, it will instantiate based on the System.Drawing.Color
public static class ColorValues
{
    // Private variable to hold font once instantiated
    private static System.Drawing.Color _normalFont;
    public static System.Drawing.Color NormalFont
    {
        get
        {
            // Only instantiate when needed
            if (_normalFont == null)
            {
                _normalFont = Color.AliceBlue;
            }
            return _normalFont;
        }
    }
}

Then you can use in your form like:
   private void button1_Click(object sender, EventArgs e)
   {
       testfunc(label1, ColorValues.NormalFont);
   }

I tried this
  public partial class Form1 : Form
  {
    public Form1()
    {
        InitializeComponent();
    }

    internal void testfunc(Label lbl, ColorValues newcolor)
    {
        lbl.BackColor = newcolor;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        testfunc(label1, ColorValues.NormalFont);
    }

}
public static class ColorValues
{
    // Private variable to hold font once instantiated
    public static System.Drawing.Color NormalFont{ get{ return Color.AliceBlue;}}
}
/*  public struct ColorValue
{
    public static System.Drawing.Color NormalFont = Color.AliceBlue;
}*/


text:
Q: Same file system but different hardware abstraction confusion I still don't fully grasp how file systems work deep down.
For example, I have both a hard disk drive and a Flash USB stick connected to my Linux or Windows computer.
I'm presented with options of different file system types to format with, for example FAT32 and NTFS.
I format both devices for FAT32 (Just picking any for an example).
On my computer, I guess that there is a driver / interface for the FAT32 filesystem type.
However, at a lower level, writing and reading bytes to and from both devices will work differently right?
Therefore, in between the filesystem driver and hardware, there should be another hardware-specific driver? If so, Is this control logic on the device itself or on my Windows or Linux computer?
Thanks in advance.


text:
Q: Does particle's speed affects double slit result? Just curious did anyone try to do double slit using particles traveling at the slowest speed possible, imagine the particle trajectory subject to Earth's gravity and the screen is on the floor. This may sound preposterous even by my standard but I like to know do speed matters or not, thanks.

A: Not exactly what you seek but close: the diffraction of $C_{60}$ molecules by a grating [ANVA+99]. The speed was about 220 m/s. An interference pattern was observed.

The bottom picture shows the profile of the beam without the grating and the top one shows the outcome with the grating. The solid line is a fit using Kirchhoff diffraction theory.
So now, a bit of theory! The relevant parameter is the de Brolie wavelength of the particles, which is $\lambda=h/p$ where $h$ is the Planck constant and $p$ is the momentum. The width of the slits in the grating has to be approximately equal to $\lambda$ for diffraction to happen. For slow moving particle such as in this experiment, the Newtonian version is enough: $p=mv$ where $m$ is the mass of the particle. So yes, the speed $v$ matters but the theory accounts for it.
[ANVA+99] Markus Arndt, Olaf Nairz, Julian Vos-Andreae, Claudia Keller, Gerbrand van der Zouw, and Anton Zeilinger. Wave-particle duality of c60 molecules. Nature, 401(6754):680–682, 10 1999.


text:
Q: Notepad++ Regular Expression Find and Replace 2 characters from line except it starts with So I am new into Regular Expression and I have this problem here.
I need to replace some data in a multple lines which are seperated by commas. But it should skip the lines which starts with Style: sign.
Example:
These are the meanings for the data (which are seperated by commas, just to show what it stands for) .
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding

The things which have to be replaced are: Bold (to 0) and ScaleX (to 85)
This is the whole block of text which need to have some things replaced.
Style: main,Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,1.35,0,2,10,10,20,1
Style: italics,Arial,23,&H00FFFFFF,&H000000FF,&H004E2C2A,&H00000000,-1,-1,0,0,100,100,0,0,1,1.35,0,2,10,10,20,1
Style: sign_1330_2_K_a_t_a_g_i_r_i_,Trebuchet MS,12,&H00C1D8BF,&H000000FF,&H004D973B,&H00000000,-1,0,0,0,100,100,0,17,1,3,0,8,30,375,80,1
Style: sign_1446_5_K_a_g_a_r_i___A_,Trebuchet MS,12,&H00F1FBE9,&H000000FF,&H004F963D,&H00000000,-1,0,0,0,100,100,0,-15,1,3,0,2,335,30,100,1
Style: sign_2051_16_M_a_t_s_u_o___M_,Trebuchet MS,12,&H00C1D8BF,&H000000FF,&H004D973B,&H00000000,-1,0,0,0,100,100,0,7,1,3,0,8,162,468,64,1
Style: sign_2163_16_Schleich,Times New Roman,16,&H0021110C,&H000000FF,&H007D594A,&H00000000,-1,0,0,0,100,100,0,-10,1,3,0,8,67,507,25,1

and this should be the result:
Style: main,Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,85,100,0,0,1,1.35,0,2,10,10,20,1
Style: italics,Arial,23,&H00FFFFFF,&H000000FF,&H004E2C2A,&H00000000,0,-1,0,0,85,100,0,0,1,1.35,0,2,10,10,20,1
Style: sign_1330_2_K_a_t_a_g_i_r_i_,Trebuchet MS,12,&H00C1D8BF,&H000000FF,&H004D973B,&H00000000,-1,0,0,0,100,100,0,17,1,3,0,8,30,375,80,1
Style: sign_1446_5_K_a_g_a_r_i___A_,Trebuchet MS,12,&H00F1FBE9,&H000000FF,&H004F963D,&H00000000,-1,0,0,0,100,100,0,-15,1,3,0,2,335,30,100,1
Style: sign_2051_16_M_a_t_s_u_o___M_,Trebuchet MS,12,&H00C1D8BF,&H000000FF,&H004D973B,&H00000000,-1,0,0,0,100,100,0,7,1,3,0,8,162,468,64,1
Style: sign_2163_16_Schleich,Times New Roman,16,&H0021110C,&H000000FF,&H007D594A,&H00000000,-1,0,0,0,100,100,0,-10,1,3,0,8,67,507,25,1

The lines which start with Style: sign should stay untouched like I wrote before. Also it can be done in two or more commands. It doesn't have to be a one-liner.
Could anyone help me here?

A: *

*Ctrl+H

*Find what: ^Style:\h+(?:(?!sign)[^,]+,){7}\K-?\d+((?:,[^,]+){3}),-?\d+

*Replace with: 0$1,85

*check Wrap around

*check Regular expression

*Replace all
Explanation:
^               # beginning of line
  Style:        # literally
  \h+           # 1 or more horizontal spaces
  (?:           # start non capture group
    (?!         # negative lookahead, make sure we haven't
      sign      # literally
    )           # end lookahead
    [^,]+       # 1 or more non comma
    ,           # 1 comma
  ){7}          # end group, must appear 7 times
  \K            # forget all we have seen until this position
  -?            # optional minus sign
  \d+           # 1 or more digits
  (             # start group 1
    (?:         # start non capture group
      ,         # 1 comma
      [^,]+     # 1 or more non comma
    ){3}        # end group, must appear 3 times
  )             # end group 1
  ,             # 1 comma
  -?            # optional minus sign
  \d+           # 1 or more digits

Replacement:
0           # zero
$1          # content of group 1
,           # a comma
85          # 85

Result for given example:
Style: main,Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,85,100,0,0,1,1.35,0,2,10,10,20,1
Style: italics,Arial,23,&H00FFFFFF,&H000000FF,&H004E2C2A,&H00000000,0,-1,0,0,85,100,0,0,1,1.35,0,2,10,10,20,1
Style: sign_1330_2_K_a_t_a_g_i_r_i_,Trebuchet MS,12,&H00C1D8BF,&H000000FF,&H004D973B,&H00000000,-1,0,0,0,100,100,0,17,1,3,0,8,30,375,80,1
Style: sign_1446_5_K_a_g_a_r_i___A_,Trebuchet MS,12,&H00F1FBE9,&H000000FF,&H004F963D,&H00000000,-1,0,0,0,100,100,0,-15,1,3,0,2,335,30,100,1
Style: sign_2051_16_M_a_t_s_u_o___M_,Trebuchet MS,12,&H00C1D8BF,&H000000FF,&H004D973B,&H00000000,-1,0,0,0,100,100,0,7,1,3,0,8,162,468,64,1
Style: sign_2163_16_Schleich,Times New Roman,16,&H0021110C,&H000000FF,&H007D594A,&H00000000,-1,0,0,0,100,100,0,-10,1,3,0,8,67,507,25,1


text:
Q: Server specifies `charset=utf-8`, downloads as ISO-8859 I have a process on my server that generates GPX (a type of XML) files. The file uses UTF-8 encoding because of some accented characters, and specifies it in the head with:
<?xml version="1.0" encoding="UTF-8"?>

Also, on the Apache server I added AddType and AddEncoding directives so if you do a HEAD command or examine the headers in Chrome developer tools, you see
Content-Type: application/octet-stream; charset=utf-8

However, if you use the file command on it after you've downloaded it, it reports:
# file 9f90063f.gpx
9f90063f.gpx: XML 1.0 document text, ISO-8859 text

This is causing problems for the people consuming the file since they're reporting that the program they're feeding the file is getting confused. How can I make it so the files download as utf-8 rather than ISO-8859?

A: Thanks to the comments on the question, I was able to figure out that the problem wasn't in the download link, it was when I generated the file. I added a binmode(XML, ":utf8") and it appears to be encoded correctly.


text:
Q: Can I start a sentence with the word maybe? Can I use the word maybe to start this sentence?

"Maybe this week won't be so bad after all."

A: There's nothing wrong with that sentence, and no problem starting a sentence with maybe.


text:
Q: Somehow this code cannot run I recently trying to create a BMI calculator for iPhone. I started off with the layout and it is nearly done. Then when I try to run it, there is a SIGABRT in the file of AppDelegate.swift. I didn't alter anything in this file. Here is the code That I wrote:
import UIKit

class FirstViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {

    @IBOutlet weak var Height_txt: UITextField!
    @IBOutlet weak var Weight_txt: UITextField!

    @IBOutlet weak var Height_label: UILabel!
    @IBOutlet weak var Weight_label: UILabel!

    @IBOutlet weak var Height_picker: UIPickerView!
    @IBOutlet weak var Weight_picker: UIPickerView!

    var picker1Options = []
    var picker2Options = []

    @IBOutlet weak var Calc_button: UIButton!

    @IBOutlet weak var Result_Label: UILabel!
    @IBOutlet weak var Description_Label: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        picker1Options = ["ft","cm"]
        picker2Options = ["lbs","kg"]
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
        return 1
    }

    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        if (pickerView.tag == 1){
            return picker1Options.count
        }else{
            return picker2Options.count
        }
    }
    func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        if (pickerView.tag == 1){
            return "\(picker1Options[row])"
        }else{
            return "\(picker2Options[row])"
        }
    }
    func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        Height_label = picker1Options[row] as! UILabel
        Weight_label = picker2Options[row] as! UILabel
    }
}

Would appreciate any help according to this problem. Thank you!


text:
Q: What is the difference between Behaviors and Event Triggers? In Xamarin.Forms you have Behaviors that perform certain actions on certain events. For example checking if input is valid on a text change event.
This morning I started reading up on Triggers, there is a certain type of trigger called the Event Trigger that pretty much does the same thing as a Behavior. Even the sample performs the same action.
double result;
bool isValid = Double.TryParse (entry.Text, out result);
entry.TextColor = isValid ? Color.Default : Color.Red;

So my question: What is the difference between Behaviors and Event Triggers?

A:
Triggers allow us to conditionally make actions within XAML, whereas Behaviors allow to modify and increment the default
  behavior of any control.

Triggers :  A Trigger is an action fired after a certain situation. This situation is defined in XAML with the Trigger declaration. Each trigger could be composed of one or more TriggerActions
Behaviors : Behaviors are meant to extend the View you apply them to far beyond the normal use.
Continue reading...

Related articles :

*

*http://www.bravent.net/xamarin-forms-13/

*http://www.damirscorner.com/blog/posts/20130624/

*http://blogs.msdn.com//an-introduction-to-behaviors-triggers-and-actions.aspx

*https://blog.xamarin.com/behaviors-in-xamarin-forms/

*https://blog.xamarin.com/triggers-in-xamarin-forms/

A: Triggers are objects that contain one or more actions and invoke those actions in response to some stimulus. One very common trigger is one that fires in response to an event (an EventTrigger). Other examples might include a trigger that fires on a timer, or a trigger that fires when an unhandled exception is thrown.
A behavior does not have the concept of invocation; instead, it acts more as an add-on to an object: optional functionality that can be attached to an object if desired. It may do certain things in response to stimulus from the environment, but there is no guarantee that the user can control what this stimulus is: it is up to the behavior author to determine what can and cannot be customized.
For More Info,
See This
or
See This


text:
Q: Posting JSON with file content on Ruby / Rails Does anyone know how to post a JSON to a Rails server with a file attached? Would the content be base64 encoded? Multipart? I honestly have no idea and havent really found anything here to help. Idea is to have a client posting a JSON to a rails API with the file attached, as well as having the Rails (with paperclip would be perfect) getting the JSON and saving the file properly. Thanks in advance

A: Here is how I solved this problem. First I created a rake task to upload the file within the json content:
desc "Tests JSON uploads with attached files on multipart formats"
task :picture => :environment do
    file = File.open(Rails.root.join('lib', 'assets', 'photo.jpg'))

    data = {title: "Something", description: "Else", file_content: Base64.encode64(file.read)}.to_json
    req = Net::HTTP::Post.new("/users.json", {"Content-Type" => "application/json", 'Accept' => '*/*'})
    req.body = data

    response = Net::HTTP.new("localhost", "3000").start {|http| http.request(req) }
    puts response.body
  end

And then got this on the controller/model of my rails app, like this:
params[:user] = JSON.parse(request.body.read)

...

class User < ActiveRecord::Base
  ...

    has_attached_file :picture, formats: {medium: "300x300#", thumb: "100#100"}

    def file_content=(c)
      filename = "#{Time.now.to_f.to_s.gsub('.', '_')}.jpg"
      File.open("/tmp/#{filename}", 'wb') {|f| f.write(Base64.decode64(c).strip) }
      self.picture = File.open("/tmp/#{filename}", 'r')
    end
end

A: JSON is a data serializing format. There is no standard pattern for uploading data or files as data in the serialized object. JSON has expectations that the data fields will be basic objects so you probably want to use Base64 encoding of the file to turn it into a string.
You are free to define your structure however you want, and processing it is your responsibility.


text:
Q: UTF-8 Font Embed in Mobile I am developing a application with PhoneGap and embedding Persian fonts in CSS.
When an HTML file is open with the desktop browser, everything is correct, but in the mobile-installed app, some embedded numbers and other characters use the originally-defined fonts.
How can I solve this problem?


text:
Q: How to use "map" function in Python? (How to rewrite a for loop?) I have an array of classes and I want to create objects of them. This works:
    classArray = [Auto, Wheel]
    objectArray = []
    for myClass in classArray:
        objectArray += [myClass()]

Can I use the map function to accomplish the same?
    objectArray = map( ??? , classArray)

My apologies if this is a dumb question. I am fairly new to Python.
Thanks!

A: You could use a list comprehension instead. Many consider them to be preferred over the map function.
objectArrray = [ c() for c in classArray ]

If you insist on using map, you can do
map(lambda c: c(), classArray)

Here, I am creating an anonymous function with lambda that simply takes the item, and calls it. If you are unfamiliar with map, it takes a 1-parameter function as the first argument.


text:
Q: Trying to generate a php download link. Name of file will not set Hello I am trying to generate a php powered download link for my program, I had copied and pasted some old code I had laying around which worked in the past, and it still seems to work okay except for 2 issues.
Issue 1: No matter what it always download the file as link.php not the filename
Issue 2:The filesize isn't sent to the browser(not really that concerned about this)
Mainly I need to know what I am doing wrong in setting the filename, here is my code below:
$file = $_GET['file'].'.exe';
if ($_GET['DL'] == "GO") {
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false); // required for certain browsers
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'. basename('MIRROR/'.$file) . '";');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize('MIRROR/'.$file));
ob_clean();
flush();
readfile('MIRROR/'.$file);
die();
}

A: Try taking out the trailing ;:
header('Content-Disposition: [..snip...] . basename($file) . '";');
                                                               ^--- here


text:
Q: mysql stored procedure not found I have create a mysql stored procedure and it correctly works if I call it (from MySQL Workbench) this way:
call sp_testACL('#-10$+00/00/00;14 #-1$+00/00/00;0 #1$+00/00/00;0 #-2$+00/00/00;14 #-73$+00/00/00;14',3885,'#3885#-9#-80#-10#-70#-14#','89890/0004',@valore);

When I try to use it within a select statement the response is:

"FUNCTION papamysql.SP_TESTACL does not exist".

by the way I call it like this:
select *
from mytable
where SP_TESTACL('#-10$+00/00/00;14 #-1$+00/00/00;0 #1$+00/00/00;0 #-2$+00/00/00;14 #-73$+00/00/00;14','3885','#3885#-9#-80#-10#-70#-14#','89890/0004','valore')>0;

A: Have you tried
select *
from mytable
where dbo.SP_TESTACL('#-10$+00/00/00;14 #-1$+00/00/00;0 #1$+00/00/00;0 #-2$+00/00/00;14 #-73$+00/00/00;14','3885','#3885#-9#-80#-10#-70#-14#','89890/0004','valore')>0;
select *
from mytable
where dbo.databasename.SP_TESTACL('#-10$+00/00/00;14 #-1$+00/00/00;0 #1$+00/00/00;0 #-2$+00/00/00;14 #-73$+00/00/00;14','3885','#3885#-9#-80#-10#-70#-14#','89890/0004','valore')>0;
select *
from mytable
where userthatcreatedprocedureid.databasename.SP_TESTACL('#-10$+00/00/00;14 #-1$+00/00/00;0 #1$+00/00/00;0 #-2$+00/00/00;14 #-73$+00/00/00;14','3885','#3885#-9#-80#-10#-70#-14#','89890/0004','valore')>0;
You may have to specify the user and database depending on how you created the procedure and who you are running it as.


text:
Q: How to erase .lof file (and other auxiliary files) in Overleaf? I am working on the Overleaf collaborative platform. I am facing the following error code :
./main.lof:18:
Missing $ inserted.
<inserted text> $
l.18 ...some figure_name}}{23}{figure.17}

The thing is, even after correcting/deleting the figure that causes this error, the compilation will always stop on this.
From my understanding, I would need to erase the .lof file to avoid this error again but I do not know how to access it on the overleaf platform.
Do you think I undersand well the situation? Do you know how to access the .lof file?

A: Overleaf v1
If you click on the "compile error" or "warning" label on the upper right, that should display the error message or warning message window (if it's not already open). There's a recompile from scratch option at the bottom of this message window; you can click on that to delete the auxiliary files (.aux, .toc, .lof...)
Overleaf v2
Click on the "Logs and other files" icon next to the "Recompile" button, then scroll right to the bottom, and click on the Trashcan icon.

A: There is an icon of error and warning in the upper right corner. Scroll down to bottom of the warning and error. You will see a trash icon and click on that icon. Then click on clear the cache. It works for me.


text:
Q: Dimension of eigenspaces w/o multiplicity Is it possible to show that the sum of the dimensions of all eigenspaces of an n x n matrix cannot be greater than n (in other words, that you cannot find more than n linearly independent eigenvectors), without using the fact that the geometric multiplicity is less than or equal to the algebraic multiplicity?
My text book of algebra indirectly implied this (in explaining how to confirm that a matrix is diagonizable) before introducing the theorem of geometric and algebraic multiplicity. Is there some obvious reason I don't see?

A: In $\mathbb R^n$ you can't have more than $n$ independent vectors (eigen or not) so certainly you can't have more than $n$ independent eigenvectors of any $n\times n$ matrix. This follows immediately by showing that the dimension of $\mathbb R^n$ is $n$, a fact that does not involve any consideration of algebraic or geometric multiplicity of anything.

A: If we denote $E_{\lambda}$ the eigenspace of the eigenvalue $\lambda$, and since $$E_{\lambda_i}\cap E_{\lambda_j}=\{0\}$$ for different eigenvalues $\lambda_i$ and $\lambda_j$ we then find $$\dim(\oplus_iE_{\lambda_i})=\sum_i\dim E_{\lambda_i}\leq n$$


text:
Q: 'System.Net.HttpWebRequest' does not contain a definition for 'GetRequestStream' I am new to both C# and Windows phone and am trying to make a small app that performs a JSON request. I am following the example in this post https://stackoverflow.com/a/4988809/702638
My current code is this:
public string login()
{
    var httpWebRequest = (HttpWebRequest)WebRequest.Create(MY_URL);
    httpWebRequest.ContentType = "text/plain";
    httpWebRequest.Method      = "POST";

    using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
    {
       string text = MY_JSON_STRING;
       streamWriter.Write(text);
    }
}

but for some reason Visual Studio is flagging GetRequestStream() with an error message:

error CS1061: 'System.Net.HttpWebRequest' does not contain a
  definition for 'GetRequestStream' and no extension method
  'GetRequestStream' accepting a first argument of type
  'System.Net.HttpWebRequest' could be found (are you missing a using
  directive or an assembly reference?)

Any thoughts on why this would be happening? I have already imported the System.Net package.

A: HttpWebRequest doesn't have a GetRequestStream or GetRequestStreamAsync in WP8.  Your best bet is to create a Task and await on it, like so:
using (var stream = await Task.Factory.FromAsync<Stream>(request.BeginGetRequestStream, request.EndGetRequestStream, null))
{
    // ...
}

Edit: as you've mentioned that you're new to C#, you would need to have your login method be async to use the await keyword:
public async Task<string> LoginAsync()
{
    // ...
}

Callers to login would need to use the await keyword when calling:
string result = await foo.LoginAsync();

Here's a good primer on the subject: http://msdn.microsoft.com/en-us/library/vstudio/hh191443.aspx


text:
Q: Unable to start Virtualbox machine on Kubuntu 22.04 / VM session was aborted I am having issues with Virutalbox 6.1.34 on kubuntu 22.04. Many Virtual machines that used to work don't now.
I get this kind of error:
.
I search a bit on google, but there is not simple fix. It seems it has something to do with Extensionpack. I have uninstall and re-install multiple times, but this don't seems to solve the issue.
The complete log file looks like this:
00:00:01.043985 VirtualBox VM 6.1.34_Ubuntu r150636 linux.amd64 (May 13 2022 07:34:48) release log
00:00:01.043985 Log opened 2022-09-11T03:43:14.596308000Z
00:00:01.043985 Build Type: release
00:00:01.043985 OS Product: Linux
00:00:01.043985 OS Release: 5.15.0-47-generic
00:00:01.043985 OS Version: #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022
00:00:01.043985 DMI Product Name: Precision T1650
00:00:01.043985 DMI Product Version: 01
00:00:01.043985 Firmware type: UEFI
00:00:01.043985 Secure Boot: Disabled
00:00:01.043985 Host RAM: 31991MB (31.2GB) total, 29800MB (29.1GB) available
00:00:01.043985 Executable: /usr/lib/virtualbox/VirtualBoxVM
00:00:01.043985 Process ID: 4592
00:00:01.043985 Package type: LINUX_64BITS_GENERIC (OSE)
00:00:01.105530 Installed Extension Packs:
00:00:01.105568   VNC (Version: 6.1.34 r150636; VRDE Module: VBoxVNC)
00:00:01.105578   Oracle VM VirtualBox Extension Pack (Version: 6.1.38 r153438; VRDE Module: VBoxVRDP)
00:00:01.107089 Console: Machine state changed to 'Starting'
00:00:01.107269 Qt version: 5.15.3
00:00:01.107278 X11 Window Manager code: 3
00:00:01.112073 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:00:01.113311 X Server details: vendor: The X.Org Foundation, release: 12101003, protocol version: 11.0, display string: :0
00:00:01.113349 Using XKB for keycode to scan code conversion
00:00:01.120712 SUP: seg #0: R   0x00000000 LB 0x0004d000
00:00:01.120753 SUP: seg #1: R X 0x0004d000 LB 0x0011c000
00:00:01.120758 SUP: seg #2: R   0x00169000 LB 0x00060000
00:00:01.120762 SUP: seg #3: RW  0x001c9000 LB 0x000350a8
00:00:01.121378 GUI: UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated: Screen 0 work area is actually resized to: 0x0 x 1920x1044
00:00:01.121963 SUP: Loaded VMMR0.r0 (/usr/lib/virtualbox/VMMR0.r0) at 0xXXXXXXXXXXXXXXXX - ModuleInit at XXXXXXXXXXXXXXXX and ModuleTerm at XXXXXXXXXXXXXXXX
00:00:01.121978 SUP: VMMR0EntryEx located at XXXXXXXXXXXXXXXX and VMMR0EntryFast at XXXXXXXXXXXXXXXX
00:00:01.124038 Guest OS type: 'Windows7_64'
00:00:01.125916 GUI: UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated: Screen 1 work area is actually resized to: 1920x0 x 1920x1036
00:00:01.130766 fHMForced=true - No raw-mode support in this build!
00:00:01.139195 File system of '/media/parfait/2TBSTORE/vms/New group/w_10/Snapshots' (snapshots) is unknown
00:00:01.139216 File system of '/media/parfait/2TBSTORE/vms/New group/w_10/w_10.vdi' is ext4
00:00:01.141341 File system of '/home/parfait/Downloads/iso/2022-09-04/Win10_21H2_English_x64.iso' (DVD) is ext4
00:00:01.143991 GUI: Machine-window #0 activated
00:00:01.144039 GUI: Machine-view #0 focused, reason=3
00:00:01.165011 Shared Clipboard: Service loaded
00:00:01.165038 Shared Clipboard: Mode: Off
00:00:01.165080 Shared Clipboard: Service running in normal mode
00:00:01.166326 Drag and drop service loaded
00:00:01.166335 Drag and drop mode: Off
00:00:01.168861 ************************* CFGM dump *************************
...
...
...

00:00:01.169171
00:00:01.169172 [/Devices/hda/0/LUN#0/AttachedDriver/Config/] (level 6)
00:00:01.169174   VmName <string>  = "w_10" (cb=5)
00:00:01.169174
00:00:01.169175 [/Devices/hda/0/LUN#0/Config/] (level 5)
00:00:01.169176   DriverName    <string>  = "PulseAudio" (cb=11)
00:00:01.169177   InputEnabled  <integer> = 0x0000000000000000 (0)
00:00:01.169178   OutputEnabled <integer> = 0x0000000000000001 (1)
00:00:01.169179
00:00:01.169179 [/Devices/hda/0/LUN#1/] (level 4)
00:00:01.169181   Driver <string>  = "AUDIO" (cb=6)
00:00:01.169181
00:00:01.169182 [/Devices/hda/0/LUN#2/] (level 4)
00:00:01.169183   Driver <string>  = "AUDIO" (cb=6)
00:00:01.169183
00:00:01.169184 [/Devices/i8254/] (level 2)
00:00:01.169185
00:00:01.169185 [/Devices/i8254/0/] (level 3)
00:00:01.169186
00:00:01.169187 [/Devices/i8254/0/Config/] (level 4)
00:00:01.169188
00:00:01.169188 [/Devices/i8259/] (level 2)
00:00:01.169189
00:00:01.169190 [/Devices/i8259/0/] (level 3)
00:00:01.169191   Trusted <integer> = 0x0000000000000001 (1)
00:00:01.169192
00:00:01.169193 [/Devices/i8259/0/Config/] (level 4)
00:00:01.169194
00:00:01.169194 [/Devices/ioapic/] (level 2)
00:00:01.169196
00:00:01.169196 [/Devices/ioapic/0/] (level 3)
00:00:01.169198   Trusted <integer> = 0x0000000000000001 (1)
00:00:01.169198
00:00:01.169199 [/Devices/ioapic/0/Config/] (level 4)
00:00:01.169200   NumCPUs <integer> = 0x0000000000000001 (1)
00:00:01.169201
00:00:01.169201 [/Devices/mc146818/] (level 2)
00:00:01.169203
00:00:01.169203 [/Devices/mc146818/0/] (level 3)
00:00:01.169204
00:00:01.169205 [/Devices/mc146818/0/Config/] (level 4)
00:00:01.169206   UseUTC <integer> = 0x0000000000000000 (0)
00:00:01.169207
00:00:01.169207 [/Devices/parallel/] (level 2)
00:00:01.169208
00:00:01.169209 [/Devices/pcarch/] (level 2)
00:00:01.169210
00:00:01.169210 [/Devices/pcarch/0/] (level 3)
00:00:01.169211   Trusted <integer> = 0x0000000000000001 (1)
00:00:01.169212
00:00:01.169213 [/Devices/pcarch/0/Config/] (level 4)
00:00:01.169214
00:00:01.169214 [/Devices/pcbios/] (level 2)
00:00:01.169215
00:00:01.169216 [/Devices/pcbios/0/] (level 3)
00:00:01.169217   Trusted <integer> = 0x0000000000000001 (1)
00:00:01.169218
00:00:01.169218 [/Devices/pcbios/0/Config/] (level 4)
00:00:01.169220   APIC               <integer> = 0x0000000000000001 (1)
00:00:01.169221   BootDevice0        <string>  = "FLOPPY" (cb=7)
00:00:01.169222   BootDevice1        <string>  = "DVD" (cb=4)
00:00:01.169222   BootDevice2        <string>  = "IDE" (cb=4)
00:00:01.169223   BootDevice3        <string>  = "NONE" (cb=5)
00:00:01.169224   FloppyDevice       <string>  = "i82078" (cb=7)
00:00:01.169225   HardDiskDevice     <string>  = "piix3ide" (cb=9)
00:00:01.169226   IOAPIC             <integer> = 0x0000000000000001 (1)
00:00:01.169227   LanBootRom         <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/PXE-Intel.rom" (cb=85)
00:00:01.169228   McfgBase           <integer> = 0x0000000000000000 (0)
00:00:01.169229   McfgLength         <integer> = 0x0000000000000000 (0)
00:00:01.169230   NumCPUs            <integer> = 0x0000000000000001 (1)
00:00:01.169231   PXEDebug           <integer> = 0x0000000000000000 (0)
00:00:01.169232   SataHardDiskDevice <string>  = "ahci" (cb=5)
00:00:01.169233   SataLUN1           <integer> = 0x0000000000000000 (0)
00:00:01.169234   UUID               <bytes>   = "f9 ee 86 19 b3 69 ab 4a a5 14 70 a7 46 d6 ff 0d" (cb=16)
00:00:01.169237   UuidLe             <integer> = 0x0000000000000001 (1)
00:00:01.169238
00:00:01.169238 [/Devices/pcbios/0/Config/NetBoot/] (level 5)
00:00:01.169240
00:00:01.169240 [/Devices/pcbios/0/Config/NetBoot/0/] (level 6)
00:00:01.169242   NIC           <integer> = 0x0000000000000000 (0)
00:00:01.169243   PCIBusNo      <integer> = 0x0000000000000000 (0)
00:00:01.169244   PCIDeviceNo   <integer> = 0x0000000000000003 (3)
00:00:01.169245   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:01.169246
00:00:01.169247 [/Devices/pci/] (level 2)
00:00:01.169248
00:00:01.169248 [/Devices/pci/0/] (level 3)
00:00:01.169250   Trusted <integer> = 0x0000000000000001 (1)
00:00:01.169251
00:00:01.169251 [/Devices/pci/0/Config/] (level 4)
00:00:01.169253   IOAPIC <integer> = 0x0000000000000001 (1)
00:00:01.169254
00:00:01.169254 [/Devices/pcibridge/] (level 2)
00:00:01.169255
00:00:01.169255 [/Devices/pckbd/] (level 2)
00:00:01.169257
00:00:01.169257 [/Devices/pckbd/0/] (level 3)
00:00:01.169258   Trusted <integer> = 0x0000000000000001 (1)
00:00:01.169259
00:00:01.169259 [/Devices/pckbd/0/Config/] (level 4)
00:00:01.169260
00:00:01.169261 [/Devices/pckbd/0/LUN#0/] (level 4)
00:00:01.169262   Driver <string>  = "KeyboardQueue" (cb=14)
00:00:01.169263
00:00:01.169263 [/Devices/pckbd/0/LUN#0/AttachedDriver/] (level 5)
00:00:01.169265   Driver <string>  = "MainKeyboard" (cb=13)
00:00:01.169266
00:00:01.169266 [/Devices/pckbd/0/LUN#0/AttachedDriver/Config/] (level 6)
00:00:01.169268   Object <integer> = 0x00005579f7f3c530 (93 982 339 351 856)
00:00:01.169270
00:00:01.169270 [/Devices/pckbd/0/LUN#0/Config/] (level 5)
00:00:01.169271   QueueSize <integer> = 0x0000000000000040 (64)
00:00:01.169272
00:00:01.169273 [/Devices/pckbd/0/LUN#1/] (level 4)
00:00:01.169274   Driver <string>  = "MouseQueue" (cb=11)
00:00:01.169275
00:00:01.169275 [/Devices/pckbd/0/LUN#1/AttachedDriver/] (level 5)
00:00:01.169277   Driver <string>  = "MainMouse" (cb=10)
00:00:01.169278
00:00:01.169278 [/Devices/pckbd/0/LUN#1/AttachedDriver/Config/] (level 6)
00:00:01.169280   Object <integer> = 0x00007f8b8c00fa30 (140 237 326 055 984)
00:00:01.169281
00:00:01.169282 [/Devices/pckbd/0/LUN#1/Config/] (level 5)
00:00:01.169284   QueueSize <integer> = 0x0000000000000080 (128)
00:00:01.169285
00:00:01.169285 [/Devices/pcnet/] (level 2)
00:00:01.169286
00:00:01.169287 [/Devices/serial/] (level 2)
00:00:01.169288
00:00:01.169288 [/Devices/usb-ehci/] (level 2)
00:00:01.169289
00:00:01.169290 [/Devices/usb-ehci/0/] (level 3)
00:00:01.169291   PCIBusNo      <integer> = 0x0000000000000000 (0)
00:00:01.169293   PCIDeviceNo   <integer> = 0x000000000000000b (11)
00:00:01.169294   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:01.169294   Trusted       <integer> = 0x0000000000000001 (1)
00:00:01.169295
00:00:01.169296 [/Devices/usb-ehci/0/Config/] (level 4)
00:00:01.169297
00:00:01.169297 [/Devices/usb-ehci/0/LUN#0/] (level 4)
00:00:01.169299   Driver <string>  = "VUSBRootHub" (cb=12)
00:00:01.169299
00:00:01.169300 [/Devices/usb-ehci/0/LUN#0/Config/] (level 5)
00:00:01.169301
00:00:01.169301 [/Devices/usb-ehci/0/LUN#999/] (level 4)
00:00:01.169303   Driver <string>  = "MainStatus" (cb=11)
00:00:01.169303
00:00:01.169304 [/Devices/usb-ehci/0/LUN#999/Config/] (level 5)
00:00:01.169306   First   <integer> = 0x0000000000000000 (0)
00:00:01.169307   Last    <integer> = 0x0000000000000000 (0)
00:00:01.169308   papLeds <integer> = 0x00007f8b8c002758 (140 237 326 002 008)
00:00:01.169309
00:00:01.169309 [/Devices/usb-ohci/] (level 2)
00:00:01.169311
00:00:01.169311 [/Devices/usb-ohci/0/] (level 3)
00:00:01.169312   PCIBusNo      <integer> = 0x0000000000000000 (0)
00:00:01.169313   PCIDeviceNo   <integer> = 0x0000000000000006 (6)
00:00:01.169315   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:01.169316   Trusted       <integer> = 0x0000000000000001 (1)
00:00:01.169317
00:00:01.169317 [/Devices/usb-ohci/0/Config/] (level 4)
00:00:01.169318
00:00:01.169318 [/Devices/usb-ohci/0/LUN#0/] (level 4)
00:00:01.169320   Driver <string>  = "VUSBRootHub" (cb=12)
00:00:01.169321
00:00:01.169321 [/Devices/usb-ohci/0/LUN#0/Config/] (level 5)
00:00:01.169322
00:00:01.169323 [/Devices/usb-ohci/0/LUN#999/] (level 4)
00:00:01.169324   Driver <string>  = "MainStatus" (cb=11)
00:00:01.169325
00:00:01.169325 [/Devices/usb-ohci/0/LUN#999/Config/] (level 5)
00:00:01.169327   First   <integer> = 0x0000000000000000 (0)
00:00:01.169328   Last    <integer> = 0x0000000000000000 (0)
00:00:01.169329   papLeds <integer> = 0x00007f8b8c002750 (140 237 326 002 000)
00:00:01.169330
00:00:01.169330 [/Devices/vga/] (level 2)
00:00:01.169332
00:00:01.169332 [/Devices/vga/0/] (level 3)
00:00:01.169334   PCIBusNo      <integer> = 0x0000000000000000 (0)
00:00:01.169335   PCIDeviceNo   <integer> = 0x0000000000000002 (2)
00:00:01.169336   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:01.169337   Trusted       <integer> = 0x0000000000000001 (1)
00:00:01.169337
00:00:01.169338 [/Devices/vga/0/Config/] (level 4)
00:00:01.169342   3DEnabled        <integer> = 0x0000000000000000 (0)
00:00:01.169343   CustomVideoModes <integer> = 0x0000000000000000 (0)
00:00:01.169344   FadeIn           <integer> = 0x0000000000000001 (1)
00:00:01.169345   FadeOut          <integer> = 0x0000000000000001 (1)
00:00:01.169346   HeightReduction  <integer> = 0x0000000000000000 (0)
00:00:01.169348   LogoFile         <string>  = "" (cb=1)
00:00:01.169349   LogoTime         <integer> = 0x0000000000000000 (0)
00:00:01.169350   MonitorCount     <integer> = 0x0000000000000001 (1)
00:00:01.169351   ShowBootMenu     <integer> = 0x0000000000000002 (2)
00:00:01.169352   VMSVGA3dEnabled  <integer> = 0x0000000000000000 (0)
00:00:01.169353   VMSVGAEnabled    <integer> = 0x0000000000000001 (1)
00:00:01.169354   VRamSize         <integer> = 0x0000000001b00000 (28 311 552, 27 MB)
00:00:01.169356
00:00:01.169356 [/Devices/vga/0/LUN#0/] (level 4)
00:00:01.169357   Driver <string>  = "MainDisplay" (cb=12)
00:00:01.169358
00:00:01.169358 [/Devices/vga/0/LUN#0/Config/] (level 5)
00:00:01.169359   Object <integer> = 0x00007f8b8c004090 (140 237 326 008 464)
00:00:01.169361
00:00:01.169361 [/Devices/vga/0/LUN#999/] (level 4)
00:00:01.169362   Driver <string>  = "MainStatus" (cb=11)
00:00:01.169363
00:00:01.169363 [/Devices/vga/0/LUN#999/Config/] (level 5)
00:00:01.169365   First   <integer> = 0x0000000000000000 (0)
00:00:01.169365   Last    <integer> = 0x0000000000000000 (0)
00:00:01.169366   papLeds <integer> = 0x00007f8b8c002760 (140 237 326 002 016)
00:00:01.169367
00:00:01.169368 [/Devices/virtio-net/] (level 2)
00:00:01.169369
00:00:01.169369 [/EM/] (level 1)
00:00:01.169370   TripleFaultReset <integer> = 0x0000000000000000 (0)
00:00:01.169370
00:00:01.169371 [/GIM/] (level 1)
00:00:01.169372   Provider <string>  = "HyperV" (cb=7)
00:00:01.169372
00:00:01.169373 [/HM/] (level 1)
00:00:01.169374   64bitEnabled       <integer> = 0x0000000000000001 (1)
00:00:01.169375   EnableLargePages   <integer> = 0x0000000000000000 (0)
00:00:01.169376   EnableNestedPaging <integer> = 0x0000000000000001 (1)
00:00:01.169377   EnableUX           <integer> = 0x0000000000000001 (1)
00:00:01.169378   EnableVPID         <integer> = 0x0000000000000001 (1)
00:00:01.169379   Exclusive          <integer> = 0x0000000000000001 (1)
00:00:01.169380   HMForced           <integer> = 0x0000000000000001 (1)
00:00:01.169381   IBPBOnVMEntry      <integer> = 0x0000000000000000 (0)
00:00:01.169382   IBPBOnVMExit       <integer> = 0x0000000000000000 (0)
00:00:01.169383   L1DFlushOnSched    <integer> = 0x0000000000000001 (1)
00:00:01.169384   L1DFlushOnVMEntry  <integer> = 0x0000000000000000 (0)
00:00:01.169385   MDSClearOnSched    <integer> = 0x0000000000000001 (1)
00:00:01.169386   MDSClearOnVMEntry  <integer> = 0x0000000000000000 (0)
00:00:01.169387   SpecCtrlByHost     <integer> = 0x0000000000000000 (0)
00:00:01.169388   UseNEMInstead      <integer> = 0x0000000000000000 (0)
00:00:01.169389
00:00:01.169390 [/MM/] (level 1)
00:00:01.169391   CanUseLargerHeap <integer> = 0x0000000000000000 (0)
00:00:01.169392
00:00:01.169392 [/NEM/] (level 1)
00:00:01.169393   Allow64BitGuests <integer> = 0x0000000000000001 (1)
00:00:01.169394
00:00:01.169394 [/PDM/] (level 1)
00:00:01.169396
00:00:01.169396 [/PDM/AsyncCompletion/] (level 2)
00:00:01.169397
00:00:01.169398 [/PDM/AsyncCompletion/File/] (level 3)
00:00:01.169399
00:00:01.169400 [/PDM/AsyncCompletion/File/BwGroups/] (level 4)
00:00:01.169401
00:00:01.169402 [/PDM/BlkCache/] (level 2)
00:00:01.169403   CacheSize <integer> = 0x0000000000500000 (5 242 880, 5 MB)
00:00:01.169405
00:00:01.169405 [/PDM/Devices/] (level 2)
00:00:01.169406
00:00:01.169406 [/PDM/Devices/VBoxEhci/] (level 3)
00:00:01.169408   Path         <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxEhciR3.so" (cb=97)
00:00:01.169409   R0SearchPath <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64" (cb=83)
00:00:01.169410
00:00:01.169411 [/PDM/Devices/VBoxNvme/] (level 3)
00:00:01.169412   Path         <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxNvmeR3.so" (cb=97)
00:00:01.169413   R0SearchPath <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64" (cb=83)
00:00:01.169414
00:00:01.169414 [/PDM/Drivers/] (level 2)
00:00:01.169415
00:00:01.169416 [/PDM/Drivers/DrvHostWebcam/] (level 3)
00:00:01.169417   Path <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxHostWebcam.so" (cb=101)
00:00:01.169418
00:00:01.169418 [/PDM/Drivers/VBoxC/] (level 3)
00:00:01.169420   Path <string>  = "/usr/lib/virtualbox/components/VBoxC" (cb=37)
00:00:01.169420
00:00:01.169421 [/PDM/NetworkShaper/] (level 2)
00:00:01.169422
00:00:01.169422 [/PDM/NetworkShaper/BwGroups/] (level 3)
00:00:01.169424
00:00:01.169424 [/PDM/USB/] (level 2)
00:00:01.169425
00:00:01.169426 [/PDM/USB/VBoxUsbCardReader/] (level 3)
00:00:01.169427   Path <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxUsbCardReaderR3.so" (cb=106)
00:00:01.169428
00:00:01.169429 [/PDM/USB/VBoxUsbWebcam/] (level 3)
00:00:01.169430   Path <string>  = "/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxUsbWebcamR3.so" (cb=102)
00:00:01.169432
00:00:01.169432 [/TM/] (level 1)
00:00:01.169433   UTCOffset <integer> = 0x0000000000000000 (0)
00:00:01.169435
00:00:01.169435 [/USB/] (level 1)
00:00:01.169436
00:00:01.169437 [/USB/HidMouse/] (level 2)
00:00:01.169439
00:00:01.169439 [/USB/HidMouse/0/] (level 3)
00:00:01.169440
00:00:01.169441 [/USB/HidMouse/0/Config/] (level 4)
00:00:01.169443   Mode <string>  = "absolute" (cb=9)
00:00:01.169443
00:00:01.169444 [/USB/HidMouse/0/LUN#0/] (level 4)
00:00:01.169445   Driver <string>  = "MouseQueue" (cb=11)
00:00:01.169445
00:00:01.169446 [/USB/HidMouse/0/LUN#0/AttachedDriver/] (level 5)
00:00:01.169447   Driver <string>  = "MainMouse" (cb=10)
00:00:01.169448
00:00:01.169448 [/USB/HidMouse/0/LUN#0/AttachedDriver/Config/] (level 6)
00:00:01.169450   Object <integer> = 0x00007f8b8c00fa30 (140 237 326 055 984)
00:00:01.169451
00:00:01.169452 [/USB/HidMouse/0/LUN#0/Config/] (level 5)
00:00:01.169453   QueueSize <integer> = 0x0000000000000080 (128)
00:00:01.169454
00:00:01.169454 [/USB/USBProxy/] (level 2)
00:00:01.169455
00:00:01.169456 [/USB/USBProxy/GlobalConfig/] (level 3)
00:00:01.169457
00:00:01.169457 ********************* End of CFGM dump **********************
00:00:01.170339 HM: HMR3Init: VT-x w/ nested paging and unrestricted guest execution hw support
00:00:01.170410 MM: cbHyperHeap=0x200000 (2097152)
00:00:01.171759 CPUM: fXStateHostMask=0x7; initial: 0x7; host XCR0=0x7
00:00:01.172620 CPUM: Matched host CPU INTEL 0x6/0x3a/0x9 Intel_Core7_IvyBridge with CPU DB entry 'Intel Core i5-3570' (INTEL 0x6/0x3a/0x9 Intel_Core7_IvyBridge)
00:00:01.173152 CPUM: MXCSR_MASK=0xffff (host: 0xffff)
00:00:01.173167 CPUM: Microcode revision 0x00000021
00:00:01.173179 CPUM: MSR/CPUID reconciliation insert: 0x0000010b IA32_FLUSH_CMD
00:00:01.174004 PGM: Host paging mode: AMD64+PGE+NX
00:00:01.174017 PGM: PGMPool: cMaxPages=4352 (u64MaxPages=4136)
00:00:01.174023 PGM: pgmR3PoolInit: cMaxPages=0x1100 cMaxUsers=0x2200 cMaxPhysExts=0x2000 fCacheEnable=true
00:00:01.175312 PGM: /proc/sys/vm/max_map_count = 65530 (rc2=VWRN_TRAILING_CHARS); cGuessNeeded=16384
00:00:01.187988 TM: GIP - u32Mode=3 (Invariant) u32UpdateHz=62 u32UpdateIntervalNS=16000000 enmUseTscDelta=2 (Practically Zero) fGetGipCpu=0x1b cCpus=8
00:00:01.187988 TM: GIP - u64CpuHz=3 392 284 703 (0xca32281f)  SUPGetCpuHzFromGip => 3 392 284 703
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x0 idCpu=0x0 idApic=0x0 iGipCpu=0x7 i64TSCDelta=0 enmState=3 u64CpuHz=3392284648(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x1 idCpu=0x1 idApic=0x2 iGipCpu=0x5 i64TSCDelta=0 enmState=3 u64CpuHz=3392284464(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x2 idCpu=0x2 idApic=0x4 iGipCpu=0x0 i64TSCDelta=0 enmState=3 u64CpuHz=3392284703(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x3 idCpu=0x3 idApic=0x6 iGipCpu=0x4 i64TSCDelta=0 enmState=3 u64CpuHz=3392284418(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x4 idCpu=0x4 idApic=0x1 iGipCpu=0x6 i64TSCDelta=0 enmState=3 u64CpuHz=3392284596(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x5 idCpu=0x5 idApic=0x3 iGipCpu=0x2 i64TSCDelta=0 enmState=3 u64CpuHz=3392284506(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x6 idCpu=0x6 idApic=0x5 iGipCpu=0x1 i64TSCDelta=0 enmState=3 u64CpuHz=3392266934(*) cErrors=0
00:00:01.187988 TM: GIP - CPU: iCpuSet=0x7 idCpu=0x7 idApic=0x7 iGipCpu=0x3 i64TSCDelta=0 enmState=3 u64CpuHz=3392284286(*) cErrors=0
00:00:01.187988 TM: cTSCTicksPerSecond=3 392 284 703 (0xca32281f) enmTSCMode=3 (Dynamic)
00:00:01.187988 TM: TSCTiedToExecution=false TSCNotTiedToHalt=false
00:00:01.192260 EMR3Init: fIemExecutesAll=false fGuruOnTripleFault=true
00:00:01.192343 IEM: TargetCpu=CURRENT, Microarch=Intel_Core7_IvyBridge
00:00:01.192827 GIM: Using provider 'HyperV' (Implementation version: 0)
00:00:01.192833 GIM: HyperV: Reporting vendor as 'VBoxVBoxVBox'
00:00:01.192838 CPUM: SetGuestCpuIdFeature: Enabled Hypervisor Present bit
00:00:01.252069 AIOMgr: Default manager type is 'Async'
00:00:01.252144 AIOMgr: Default file backend is 'NonBuffered'
00:00:01.252524 BlkCache: Cache successfully initialized. Cache size is 5242880 bytes
00:00:01.252533 BlkCache: Cache commit interval is 10000 ms
00:00:01.252537 BlkCache: Cache commit threshold is 2621440 bytes
00:00:01.261510 PcBios: [SMP] BIOS with 1 CPUs
00:00:01.262383 PcBios: Using the 386+ BIOS image.
00:00:01.263809 PcBios: MPS table at 000e1300
00:00:01.264458 PcBios: Using LAN ROM '/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/PXE-Intel.rom' with a size of 0xc000 bytes
00:00:01.264838 PcBios: fCheckShutdownStatusForSoftReset=true   fClearShutdownStatusOnHardReset=true
00:00:01.266641 SUP: seg #0: R   0x00000000 LB 0x00009000
00:00:01.266647 SUP: seg #1: R X 0x00009000 LB 0x00020000
00:00:01.266650 SUP: seg #2: R   0x00029000 LB 0x0000c000
00:00:01.266652 SUP: seg #3: RW  0x00035000 LB 0x000074d8
00:00:01.266731 SUP: Loaded VBoxDDR0.r0 (/usr/lib/virtualbox/VBoxDDR0.r0) at 0xXXXXXXXXXXXXXXXX - ModuleInit at XXXXXXXXXXXXXXXX and ModuleTerm at XXXXXXXXXXXXXXXX
00:00:01.267386 CPUM: SetGuestCpuIdFeature: Enabled xAPIC
00:00:01.267565 IOAPIC: Using implementation 2.0! Chipset type ICH9
00:00:01.267622 PIT: mode=3 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:01.267759 VMMDev: cbDefaultBudget: 524 141 120 (1f3dc240)
00:00:01.270578 Shared Folders service loaded
00:00:01.272127 Guest Control service loaded
00:00:01.282498 VGA: Using the 386+ BIOS image.
00:00:01.284924 VD: VDInit finished with VINF_SUCCESS
00:00:01.285171 DrvVD: Flushes will be ignored
00:00:01.285176 DrvVD: Async flushes will be passed to the disk
00:00:01.287096 AIOMgr: Endpoint for file '/media/parfait/2TBSTORE/vms/New group/w_10/w_10.vdi' (flags 000c0723) created successfully
00:00:01.289691 VD: Opening the disk took 2884002 ns
00:00:01.289758 AHCI: LUN#0: disk, PCHS=16383/16/63, total number of sectors 314572800
00:00:01.290449 DrvVD: Flushes will be ignored
00:00:01.290457 DrvVD: Async flushes will be passed to the disk
00:00:01.292327 AIOMgr: Endpoint for file '/home/parfait/Downloads/iso/2022-09-04/Win10_21H2_English_x64.iso' (flags 000c0781) created successfully
00:00:01.292344 VD: Opening the disk took 148623 ns
00:00:01.292427 AHCI: LUN#1: CD/DVD
00:00:01.292686 AHCI#0: Reset the HBA
00:00:01.292695 VD#0: Cancelling all active requests
00:00:01.293143 E1000#0: Chip=82540EM LinkUpDelay=3000ms EthernetCRC=on GSO=enabled Itr=disabled ItrRx=enabled TID=disabled R0=enabled RC=disabled
00:00:01.300448 NAT: Guest address guess set to 10.0.2.15 by initialization
00:00:01.300543 NAT: resolv.conf: nameserver 127.0.0.53
00:00:01.300549 NAT: resolv.conf: ignoring "options edns0 trust-ad"
00:00:01.300559 NAT: DNS server 127.0.0.53 registration detected, switching to the DNS proxy
00:00:01.300563 NAT: Adding domain name .
00:00:01.300565 NAT: DNS#0: 127.0.0.53
00:00:01.302298 Audio: Initializing PulseAudio driver
00:00:01.303931 PulseAudio: Using version 15.99.0
00:00:01.305652 PulseAudio: Retrieving server information ...
00:00:01.306133 Audio: Found 3 devices for driver 'PulseAudio'
00:00:01.306139 Audio: Device 'Built-in Audio Analog Stereo':
00:00:01.306140 Audio:   ID              = alsa_output.pci-0000_00_1b.0.analog-stereo
00:00:01.306140 Audio:   Usage           = output
00:00:01.306140 Audio:   Flags           = DEFAULT_OUT
00:00:01.306141 Audio:   Input channels  = 0
00:00:01.306141 Audio:   Output channels = 2
00:00:01.306144 Audio: Device 'Monitor of Built-in Audio Analog Stereo':
00:00:01.306144 Audio:   ID              = alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
00:00:01.306144 Audio:   Usage           = input
00:00:01.306145 Audio:   Flags           = NONE
00:00:01.306145 Audio:   Input channels  = 2
00:00:01.306145 Audio:   Output channels = 0
00:00:01.306155 Audio: Device 'Built-in Audio Analog Stereo':
00:00:01.306156 Audio:   ID              = alsa_input.pci-0000_00_1b.0.analog-stereo
00:00:01.306156 Audio:   Usage           = input
00:00:01.306156 Audio:   Flags           = DEFAULT_IN
00:00:01.306156 Audio:   Input channels  = 2
00:00:01.306157 Audio:   Output channels = 0
00:00:01.306213 HDA: Codec reset
00:00:01.306219 HDA: Reset
00:00:01.306992 SUP: seg #0: R X 0x00000000 LB 0x00001000
00:00:01.307000 SUP: seg #1: R X 0x00001000 LB 0x00002000
00:00:01.307003 SUP: seg #2: R   0x00003000 LB 0x00101000
00:00:01.307006 SUP: seg #3: RW  0x00104000 LB 0x00000820
00:00:01.307356 SUP: Loaded VBoxEhciR0.r0 (/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxEhciR0.r0) at 0xXXXXXXXXXXXXXXXX - ModuleInit at XXXXXXXXXXXXXXXX and ModuleTerm at XXXXXXXXXXXXXXXX

Any one has an idea how to fix this ?
Thanks !


text:
Q: argument out of range exception in a memory puzzle game I'm following along a course on udemy which is for free it's a memory game (https://www.udemy.com/xamarin-native-ios-memory-game-csharp/learn/v4/overview)
Now with the randomizer method i get a new problem with the same out of range error
using System;
using System.Collections;
using System.Collections.Generic;

using UIKit;

namespace iOSMemoryGame
{
    public partial class ViewController : UIViewController
    {
        #region vars

    List<String> imgArr = new List<String>();

    float gameViewWidth;
    int gridSize = 6;

    ArrayList tilesArr = new ArrayList();
    ArrayList coordsArr = new ArrayList();

    #endregion

    public ViewController(IntPtr handle) : base(handle)
    {

    }

    public override void ViewDidLoad()
    {
        base.ViewDidLoad();
        // Perform any additional setup after loading the view, typically from a nib.
    }

    public override void ViewDidAppear(bool animated)
    {
        base.ViewDidAppear(animated);

        // make sure Game View is Laid Out
        gameView.LayoutIfNeeded();
        gameViewWidth = (float)gameView.Frame.Size.Width;

        // let's load all of our images into an array
        for (int i = 1; i <= 18; i++)
        {
            imgArr.Add("img_" + i.ToString() + ".png");
        }

        // let's make a call to tileMaker
        tileMaker();

        // let's call the randomizer
        randomizer();
    }

    private void randomizer()
    {
        // we are gonna go through our tiles in ORDER
        // and we are gonna assign a new center to them RANDOMLY

        foreach (UIView any in tilesArr)
        {
            // UIImageView thisTile = (UIImageView)tilesArr[i];

            Random myRand = new Random();
            int randomIndex = myRand.Next(0, coordsArr.Count);

            CoreGraphics.CGPoint newRandCenter = (CoreGraphics.CGPoint)coordsArr[randomIndex];
            any.Center = newRandCenter;

            coordsArr.RemoveAt(randomIndex);
        }
    }

    private void tileMaker()
    {
        float tileWidth = gameViewWidth / gridSize;

        float xCenter = tileWidth / 2;
        float yCenter = tileWidth / 2;

        int imgCounter = 0;

        for (int h = 0; h < gridSize; h++)
        {
            for (int v = 0; v < gridSize; v++)
            {
                UIImageView tileImgView = new UIImageView();

                CoreGraphics.CGPoint newCenter = new CoreGraphics.CGPoint(xCenter, yCenter);

                tileImgView.Frame = new CoreGraphics.CGRect(0, 0, tileWidth - 5, tileWidth - 5);

                String imgName = imgArr[imgCounter];
                tileImgView.Image = new UIImage(imgName);
                tileImgView.Center = newCenter;

                // user CAN interact with this image view
                tileImgView.UserInteractionEnabled = true;

                // adding the new image view to the array
                tilesArr.Add(tileImgView);

                gameView.AddSubview(tileImgView);

                xCenter = xCenter + tileWidth;
                imgCounter++;

                if (imgCounter == gridSize * gridSize / 2)
                {
                    imgCounter = 0;
                }
            }

            xCenter = tileWidth / 2;
            yCenter = yCenter + tileWidth;
        }
    }

    public override void DidReceiveMemoryWarning()
    {
        base.DidReceiveMemoryWarning();
        // Release any cached data, images, etc that aren't in use.
    }

    partial void Rst4Button_TouchUpInside(UIButton sender)
    {
        throw new NotImplementedException();
    }

    partial void Rst6Button_TouchUpInside(UIButton sender)
    {
        throw new NotImplementedException();
    }
}

}
Something is wrong with the randomizer method but i dont know what.
it gives me again a out of range error.
without the randomizer method it works fine

A: This line
for (int i = 1; i < 18; i++)

creates 17 images, not 18 as expected by the following loops.
// 0-5 = 6 loops
for (int h = 0; h < gridSize; h++)
{
    // 0-5 = 6 loops (h*v=18)
    for (int v = 0; v < gridSize; v++)
    {
        ....

You need to write
for (int i = 0; i < 18; i++)
   imgArr.Add("img_" + (i+1).ToString() + ".png");


text:
Q: Reading emails with groovy (Java Mail) I am using groovy in order to access gmail and read the Inbox. It is regular JavaMail and will not describe it here.
So for simplicity, after I connect to the store, I use this:
folder.open(Folder.READ_ONLY)

 folder.messages.each { msg ->
    ...
    doSomething with msg
...
}

this is working fine.
However I have a performance issue. Sometimes messages[] could be big. Some folders contain more than 1000 messages, and checking them all takes time.
I am looking for a quicker way to get only those emails that are the most recent (for example messages from the last 5 days or something like that)
of course I have the date information in each msg and I could do my comparison, but this is not efficient since it will loop through the entire collection.
Is there a better way to get those messages?

A: If you have JavaMail issue a SEARCH command with the criterion SINCE 04-JAN-2011, you'll get back the set messages in the currently-selected folder delivered since January 4th.  (SENTSINCE 04-JAN-2011 will do the same thing, only based on the "Date" message header.)
Something along the lines of this:
folder.search(new ReceivedDateTerm(ComparisonTerm.GE, sinceDate));


text:
Q: migrate samba users to new server I've read
How to migrate Samba User Accounts to a new linux server?
however it doesn't address my situation, or at least not with a solution.
I have a RHEL 5 machine, wood, running Samba, Dovecot, PostFix.  I would like to move these services to another machine, stone which is Centos 6.  Authentication is done via LDAP and PAM on both machines ( /etc/{passd*,shadow*} files have no user info - which is why the linked question doesn't help as that is what it suggest transfering ).
I have copied /etc/samba/* to the new machine (stone), and wasn't getting user authentication until I did smbpasswd -a user1  this allowed user1 to authenticate from a third, Windows Server 2008, machine however browsing to the users home directory results in a permission denied error.  ( Since it probably should be clarified; when connecting to the wood Samba server from the same Server 2008 machine, user home directory is not blocked ).
I can't figure out if the error lies with Samba configuration or LDAP?
My question is if coping /etc/samba is sufficient to transfer samba configuration - clearly it doesn't transfer user information.
UPDATE:  I started the question before realizing smbpasswd created the new user with a next in line user id ... which didn't match up with the home directory file permissions ... so my question is really how can I transfer all the users from wood to stone and maintain their original passwd/id ?  or even just id?
UPDATE 2:  I used pdbedit to export/import the users, as was suggested.  I get a different error now from the Windows side explaining it couldn't authenticate and that multiple connections with the same users aren't allowed.  I stopped the samba service on wood, and did a restart on stone.

A: First export your users to a file on wood -
pdbedit -e smbpasswd:/tmp/sambausers.bak
Then import users to to stone -
pdbedit -i smbpasswd:/tmp/sambauses.bak


text:
Q: Send Stream through post I'm trying to send a photo through post and I've found a class that does it, but from a FileInfo object. I need to change this class in order to send a Stream (returned by the photoChooserTask) and I don't know how. Here's the class:
public class DataContractMultiPartSerializer
{
  private string boundary;
  public DataContractMultiPartSerializer(string boundary)
  {
      this.boundary = boundary;
  }

 private void WriteEntry(StreamWriter writer, string key, object value)
 {
     if (value != null)
     {
         writer.Write("--");
         writer.WriteLine(boundary);
         if (value is FileInfo)
         {

             FileInfo f = value as FileInfo;
             writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""; ilename=""{1}""", key, f.Name);
             writer.WriteLine("Content-Type: application/octet-stream");
             writer.WriteLine("Content-Length: " + f.Length);
             writer.WriteLine();
             writer.Flush();
             Stream output = writer.BaseStream;
             Stream input = f.OpenRead();
             byte[] buffer = new byte[4096];
             for (int size = input.Read(buffer, 0, buffer.Length); size > 0; size = nput.Read(buffer, 0, buffer.Length))
             {
                 output.Write(buffer, 0, size);
             }
             output.Flush();
             writer.WriteLine();
         }
         else
         {
             writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""", key);
             writer.WriteLine();
             writer.WriteLine(value.ToString());
         }
     }
 }

I've tried to change it this way:
    if (value is Stream)
    {
        //FileInfo f = value as FileInfo;
        FileStream f = value as FileStream;

        writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""; filename=""{1}""", key, "sentPhoto.jpg");
        writer.WriteLine("Content-Type: application/octet-stream");
        writer.WriteLine("Content-Length: " + f.Length);
        writer.WriteLine();
        writer.Flush();
        Stream output = writer.BaseStream;
        //Stream input = f.OpenRead();
        byte[] buffer = new byte[4096];

        for (int size = input.Read(buffer, 0, buffer.Length); size > 0; size = nput.Read(buffer, 0, buffer.Length))
        {
            output.Write(buffer, 0, buffer.Length);
        }
        output.Flush();
        writer.WriteLine();
    }
    else
    {
        writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""", key);
        writer.WriteLine();
        writer.WriteLine(value.ToString());
    }

but it does not enter to the for loop because size is 0.
Can anyone give me a clue?
Thank you very much

A: I've converted the function to this:
private void WriteEntry(StreamWriter writer, string key, object value)
    {
        if (value != null)
        {
            writer.Write("--");
            writer.WriteLine(boundary);
            if (value is byte[])
            {
                byte[] ba = value as byte[];

                writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""; filename=""{1}""", key, "sentPhoto.jpg");
                writer.WriteLine(@"Content-Type: application/octet-stream");
                writer.WriteLine(@"Content-Length: " + ba.Length);
                writer.WriteLine();
                writer.Flush();
                Stream output = writer.BaseStream;

                output.Write(ba, 0, ba.Length);
                output.Flush();
                writer.WriteLine();
            }
            else
            {
                writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""", key);
                writer.WriteLine();
                writer.WriteLine(value.ToString());
            }
        }
    }

Now I'm passing already a bytearray and I write it in one piece. Doing what I was doing with the Stream I only got corrupted images.
I hope it helps someone


text:
Q: Strange Undefined index error from deep string I know there is another question similar, but my problem look strange. The string on deep location (apologize if I am wrong, I am a newby.). I am running a PHP script, and keep getting errors like:

Notice: Undefined index: default in D:\SERVER-MYWEB\InstantWP_4.3.1\iwpserver\htdocs\wordpress\wp-content\themes\MYTHEME\admin\library\options\options.php on line 843

Line 843 looks like this:
$value['default']['font-family']);

Here the code:
$family = isset($option['font']) && $option['font'] ? $option['font'] :
(isset($value['default']['font-family'])?$value['default']['font-family']:
$value['default']['font-family']);

Edit for full codes:
  <?php
 }

 function upfw_typography($value,$attr){
global $up_options,$up_fonts,$wpdb;

  $option = (isset($up_options->$value['id'])?$up_options->$value['id']:'');
if(!$option):
    global $default_options;
    $option = isset($value['value'])?$value['value']:array();
endif;

 $family = isset($option['font']) && $option['font'] ? $option['font'] : (isset($value['default']['font-family'])?$value['default']['font-family']:$value['default']['font-family']);
$fontsize = isset($option['fontsize']) && $option['fontsize'] ? $option['fontsize']: (isset($value['default']['font-size']) ? $value['default']['font-size'] : '');
$fontstyle = isset($option['fontstyle']) && $option['fontstyle'] ? $option['fontstyle']: (isset($value['default']['font-style']) ? $value['default']['font-style'] : '');

    $lineheight = isset($option['lineheight']) && $option['lineheight'] ? $option['lineheight'] : (isset($value['default']['line-height']) ? $value['default']['line-height'] : '');
    $texttransform = isset($option['texttransform']) && $option['texttransform'] ? $option['texttransform'] : (isset($value['default']['text-transform']) ? $value['default']['text-transform'] : '');
    $fontweight = isset($option['fontweight']) && $option['fontweight'] ? $option['fontweight'] : (isset($value['default']['font-weight']) ? $value['default']['font-weight'] : '');
   $textdecoration = isset($option['textdecoration']) && $option['textdecoration'] ? $option['textdecoration'] : (isset($value['default']['text-decoration']) ? $value['default']['text-decoration'] : '');
    $textshadow = isset($option['textshadow']) && $option['textshadow'] ? $option['textshadow'] : (isset($value['default']['text-shadow']) ? $value['default']['text-shadow'] : '');
    $letterspacing = isset($option['letterspacing']) && $option['letterspacing'] ? $option['letterspacing'] : (isset($value['default']['letter-spacing']) ? $value['default']['letter-spacing'] : '');
    $show_selector = (isset($value['show_selector']) ? $value['show_selector'] : '');
    $selector = isset($option['selector']) && $option['selector'] ? $option['selector'] : (isset($value['selector']) ? $value['selector'] : '');
    $fonts = $up_fonts; ?>

Is there a quick fix to resolve these error?
Really appreciate for any help
Thank you

A: What about
$family = (isset($option['font']) && $option['font'])? $option['font'] :((isset($value['default']))?((isset($value['default']['font-family']))?$value['default']['font-family']:"Arial"):"Arial");

A: you should check for default index before using it:
if(isset($value['default'])) {
//your code here
$family = isset($option['font']) && $option['font'] ? $option['font'] :
(isset($value['default']['font-family'])?$value['default']['font-family']:
$value['default']['font-family']);
}


text:
Q: What does "Visit Waypoint" in missions mean? The new "Missions" feature has some mission steps called "Visit Waypoint". What does that mean? How do you visit waypoints?
I've tried a mission yesterday and couldn't clearly figure out what it meant. Some waypoints were completed automatically in a few seconds after walking into the waypoints but some didn't. I had to press on the waypoint markers and open the linked Fieldtrip page to complete them and one of them even reacted more strangely: I had to select the waypoint marker and press on "Navigate" to finally complete it.

A: A waypoint is a designated location, usually one of several that you need to visit in order to complete the mission. Field Trip locations require you to open the "card" that links to the Field Trip page in order to complete.
Depending on the particular mission, the order in which you visit each waypoint might also be important, so you may find that they don't complete when visited out of the listed order (these ones are marked "complete waypoints in sequence" on the Details screen). Sometimes the order is hidden and linked by clues (and some require actions to be performed, such as using the "Navigate" function).
Source: Google - Experience Ingress Missions
Source: The Verge - Google's 'Ingress' will soon let players build scavenger-hunt missions across the globe


text:
Q: How to check user is actively present or not in react native? I want to check that user is active or not at application level.I have used PanResponder to detect user activity for one screen but I want to check for whole application in one component because I have more than 20 screens in application.
Note: I am using wix-react-native-navigation for navigation so every new screen is in navigation stack.