text:
Q: Table position is not changing I want to put two tables on one page but when it won't be positioned at the top of the page. this is the code:
\documentclass[
a4paper,
12pt,
blue,
rgb,
]{tubsbook}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{array,multirow}
\newcommand\mcbf[1]{\multicolumn{2}{|c|}{\textbf{#1}}}
\newcommand\mlbf[1]{\multicolumn{2}{|l|}{\textbf{#1}}}
\usepackage{graphicx}
\usepackage[activate]{pdfcprot}

\begin{document}
\begin{table}[htb]
\centering
\renewcommand\arraystretch{1.2}
\begin{tabular}{|>{\bfseries}c|>{\bfseries}l|c|}
\hline
\mcbf{Cortex A9 Parameters}                         & \textbf{Values}   \\ \hline
\mcbf{Core clock}                                   & 800 MHz           \\ \hline
\multirow{5}{*}{L2}             &  Size             & 512 kB            \\ \cline{2-3}
                            &  Associativity    & 8                 \\ \cline{2-3}
                            &  Latency          & 8                 \\ \cline{2-3}
                            &  MSHRs            & 11                \\ \cline{2-3}
                            &  Write buffers    & 9                 \\ \hline
\multirow{4}{*}{L1 - I}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 2                 \\ \hline
\multirow{5}{*}{L1 - D}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 4                 \\ \cline{2-3}
                            &  Write buffers    & 16                \\ \hline
{Stride prefetcher}            &  Degree           & 1                 \\ \hline
\multirow{2}{*}{Global BP}     &  Entries          & 4096              \\ \cline{2-3}
                            &  Bits             & 2                 \\ \hline
\mlbf{BTB entries}                                  & 4096              \\ \hline
\mlbf{Return Address Stack (RAS) entries}           & 8                 \\ \hline
\mlbf{Issues width}                                 & 2                 \\ \hline
\mlbf{Pipeline stages}                              & 8                 \\ \hline
\mlbf{Physical INT registers}                       & 62                \\ \hline
\mlbf{Physical FP registers}                        & 256               \\  \hline
\mlbf{IQ entries}                                   & 32                \\ \hline
\mlbf{LSQ entries}                                  & 8 / 8             \\ \hline
\mlbf{ROB entries}                                  & 40                \\ \hline
\end{tabular}%
\caption{My caption}
\label{my-label}
\end{table}
\end{document}

And this is how the table is positioned:

A: See: two tables on one page.
\documentclass[
a4paper,
12pt,
blue,
rgb,
]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{array,multirow}
\newcommand\mcbf[1]{\multicolumn{2}{|c|}{\textbf{#1}}}
\newcommand\mlbf[1]{\multicolumn{2}{|l|}{\textbf{#1}}}
\usepackage{graphicx}
\usepackage[activate]{pdfcprot}
\usepackage[margin=1in]{geometry}

\begin{document}
\begin{table}[p]
\centering
\renewcommand\arraystretch{1.2}
\begin{tabular}{|>{\bfseries}c|>{\bfseries}l|c|}
\hline
\mcbf{Cortex A9 Parameters}                         & \textbf{Values}   \\ \hline
\mcbf{Core clock}                                   & 800 MHz           \\ \hline
\multirow{5}{*}{L2}             &  Size             & 512 kB            \\ \cline{2-3}
                            &  Associativity    & 8                 \\ \cline{2-3}
                            &  Latency          & 8                 \\ \cline{2-3}
                            &  MSHRs            & 11                \\ \cline{2-3}
                            &  Write buffers    & 9                 \\ \hline
\multirow{4}{*}{L1 - I}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 2                 \\ \hline
\multirow{5}{*}{L1 - D}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 4                 \\ \cline{2-3}
                            &  Write buffers    & 16                \\ \hline
{Stride prefetcher}            &  Degree           & 1                 \\ \hline
\multirow{2}{*}{Global BP}     &  Entries          & 4096              \\ \cline{2-3}
                            &  Bits             & 2                 \\ \hline
\mlbf{BTB entries}                                  & 4096              \\ \hline
\mlbf{Return Address Stack (RAS) entries}           & 8                 \\ \hline
\mlbf{Issues width}                                 & 2                 \\ \hline
\mlbf{Pipeline stages}                              & 8                 \\ \hline
\mlbf{Physical INT registers}                       & 62                \\ \hline
\mlbf{Physical FP registers}                        & 256               \\  \hline
\mlbf{IQ entries}                                   & 32                \\ \hline
\mlbf{LSQ entries}                                  & 8 / 8             \\ \hline
\mlbf{ROB entries}                                  & 40                \\ \hline
\end{tabular}%
\caption{My caption}
\label{my-label}
\end{table}
\begin{table}[p]
    \centering
    \renewcommand\arraystretch{1.2}
    \begin{tabular}{|>{\bfseries}c|>{\bfseries}l|c|}
        \hline
        \mcbf{Cortex A9 Parameters}                         & \textbf{Values}   \\ \hline
        \mcbf{Core clock}                                   & 800 MHz           \\ \hline
        \multirow{5}{*}{L2}             &  Size             & 512 kB            \\ \cline{2-3}
        &  Associativity    & 8                 \\ \cline{2-3}
        &  Latency          & 8                 \\ \hline
    \end{tabular}%
    \caption{My caption}
    \label{my-label2}
\end{table}
\end{document}


text:
Q: Find strings in a C++ file with regex I have a large project with many CPP files containing hardcoded english strings. The idea is now to enable translations, so I want to replace in each CPP file with a function call that will return the strings depending on the language.
The idea is to write another program that would detect the strings within the CPP code and replace them with a function that returns a const string based on some unique index that will be built automatically.
For example: std::cout << "Hello"; to std::cout << s(1); or MessageBox(0,L"You are wrong!",L"Error",MB_OK); to MessageBox(0,s(2),s(3),MB_OK);
The app then will create a new CPP file with those changes and build an index with the original english strings that would now be able to be translated.
The question is, what would be a good way to use regex to detect strings?
I 've thought of /(?:")(?=(?:[^"]|"[^]*")*$)/g (as I found online, I 'm not experienced with regex). Ideally it would catch L"" (since most of the strings are unicode), raw stuff like LR"(xxx)" (altough those are a few).
Of course, I plan to have my app present me a list which I can review the proposed changes so to not accidentally fail, but I 'd wish the manual intervention would be minimal.
Perhaps later I can build a VS extension for that.
Thanks for your comments.

redpajama_set_name: RedPajamaStackExchange


text:
Q: $\lim\limits_{u\rightarrow\infty}|F_1(u,x)-F_2(u,x)|=0,\forall x\geq0\implies\lim\limits_{u\rightarrow\infty}\sup_{x\geq0}|F_1(u,x)-F_2(u,x)|=0$? $\lim\limits_{u\rightarrow \infty}|F_1(u,x)-F_2(u,x)|=0,\forall x\geq 0  \ \implies \ \lim\limits_{u\rightarrow \infty}\sup\limits_{x\geq 0}|F_1(u,x)-F_2(u,x)|=0$ ?
I get the question when I read the proof of Theorem 7 from a paper titled Statistical Inference Using Extreme Order Statistics (link: https://projecteuclid.org/download/pdf_1/euclid.aos/1176343003 )
Is the statement above always true? If it is not always true, why it is true in the paper's case?

A: No, take
\begin{align*}
F_1(u,x) = \frac{(x+1)^2}{u}, \quad F_2(u,x) = \frac{x^2}{u}
\end{align*}
Clearly,
\begin{align*}
\lim_{u\rightarrow \infty}|F_1(u,x) - F_2(u,x)| = \lim_{u\rightarrow \infty}\frac{2x + 1}{u} = 0
\end{align*}
for all $x \ge 0$. But
\begin{align*}
\lim_{u\rightarrow \infty}\sup_{x\ge 0}\frac{2x + 1}{u} = \infty
\end{align*}
You would need $F_1, F_2$ to both be uniformly continuous in $x$.


text:
Q: PIC18 Global Interrupt Enable bit toggling when keypad button pressed Objective
I am trying to interface a 4x3 matrix keypad and 7 segment LED display to PIC18f4550 microcontroller. When I press buttons on keypad, I want the 7 segment display to show the number accordingly.

What I have done so far
Based on my research, I can either use scanning (continuously polling) or use interrupts to interface the keypad with the MCU. I decided to use interrupts as that way the microcontroller can be free up for other operations.
The following is the connection of keypad to MCU.

I am using RB0-2 as input to MCU and RB4-7 are set as output from MCU. RB4-7 are permanently set high so when the user press on the keypad button, it will trigger the RB0-2(INT0-INT2) interrupt to process.
For simplicity in this post, I will only discuss about the Column 1 of the keypad.
This is how I initialize and setup the registers.
void main(void)
{
OSCCON = 0x72;
TRISD = 0;
LATD = 0;
ADCON1 = 0x0F;

TRISB = 0x07;
LATB = 0xF0;// keep the RB4-7 high

INTCONbits.GIE = 1;
INTCONbits.INT0IF = 0;
INTCONbits.INT0IE = 1;
INTCON2bits.INTEDG0 = 1;

while (1);
}

My interrupt handling is as below:
if(INTCONbits.INT0IF == 1)
{
    for(char scan=0x10; scan>=0x80; scan <<= 1) // send 1 to each row starting from RB4 till RB7
    {
        LATB = scan;
        if (PORTBbits.RB0 = 1)
        {
            if(scan == 0x10)
            {
                display_number(1);
            }
            if(scan == 0x20)
            {
                display_number(4);
            }
            if(scan == 0x40)
            {
                display_number(7);
            }
        }

    }
    LATB = 0xF0;
    INTCONbits.INT0IF == 0;

My problem
When I run the simulation, I noticed that the GIE bit keep toggling very fast between 0 and 1 as soon as I press on any button in Column 1 and no display of any number on 7segment as well. I added the watch window screenshot and highlighted the GIE bit that is toggling.

What have I done wrong? Is my logic of handling interrupt flawed?

UPDATE 1
As DavidHoadley suggested, I have changed to use use unsigned char instead of char.
I have also corrected the for loop condition.
What I observed was, If I keep the loop inside the interrupt routine, the loop will get stuck for some reason.
For now, I have given up trying to use loop inside the interrupt function and instead resort to have a function in main while loop to output high at each row sequentially forever and the interrupt function is only used to check the output using switch statement.

A: Your for loop end condition looks like the loop will immediately exit. The line:
for(char scan=0x10; scan>=0x80; scan <<= 1)

Should probably be:
for(char scan=0x10; scan<=0x80; scan <<= 1)

Can't test this - hope it works

A: It is a normal behaviour for PIC micros. When PIC goes to the interrrupt vector the GIE bit reset by hardware and when it finishes servicing the interrupt, it returns with the RETFIE assembly instruction by setting the GIE bit which is not visible in C code. So there is no fault in your code for this matter, this is not even a matter.
I see in your code you are using only INT0 interrupt to detect presses and the rest of INTx pins are not activated. That's why the PIC micro will be able to detect the changes of the only first column. I suggest you to use interrupt on change (IOC) which features on RB<7:4> bits. This way you can free the INTx pins for other purposes. And you can move the 3 pins to a PORT other than PORTB. Here is the procedure or my suggestion if you interest:

*

*Configure RB<7:4> pins as inputs and enable their IOC feature.

*Configure any 3 pins as output of any port.

*If you use the positive logic set the 3 pins high otherwise, low.

*In your ISR poll the RBIF to know if there is a change on RB<7:4> pins.

*If so make a button scan to detect the pressed key.

Unfortunately can't tell you anything for your display issue since you haven't shared the codes and the configuration of display.


text:
Q: powershell The underlying connection was closed: An unexpected error occurred on a send I'm new to Powershell and created some breakpoints to figure out why the script times out. But I'm getting below error. Any help would be appreciated.

Exception calling "GetRequestStream" with "0" argument(s): "The
  underlying connection was closed: An unexpected error occurred on a
  send." At C:\Users\ksingh\Documents\SQL
  scripts\pdfimportPowerShell.ps1:155 char:5
  +     $requestStream = [System.IO.Stream]$request.GetRequestStream()
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : WebException

Here is part of the script and the error occurs at ---
bytes = [System.Text.Encoding]::ASCII.GetBytes($data)

function to call token service
function GetNewToken()
{
    $request = [Net.WebRequest]::Create($temptokenserviceurl)

    $request.ServicePoint.Expect100Continue = $false

    $request.ContentType = "application/json"

    $request.Method = "POST"

    $data = (New-Object PSObject |
        Add-Member -PassThru NoteProperty username $temptokenserviceuser |
        Add-Member -PassThru NoteProperty password $temptokenservicepassword
    ) | ConvertTo-JSON

    $bytes = [System.Text.Encoding]::ASCII.GetBytes($data)

    $request.ContentLength = $bytes.Length

    $requestStream = [System.IO.Stream]$request.GetRequestStream()

    $requestStream.write($bytes, 0, $bytes.Length)

    $response = $request.GetResponse()

    $StreamReader = New-Object IO.StreamReader($response.getResponseStream())

    $Json = $StreamReader.ReadToEnd()

    $responseString = $Json | ConvertFrom-Json

    $response.Close()

    return $responseString.tokenId
}


text:
Q: Knockout late binding with MappingOptions I want to use KnockoutJS to map a list of objects on an ajax-call.
Also I want to pass a mapping object.
The binding on button click works perfect and if I skip the mapping objects it creates all properties as observable as expected.
Now I want only some properties created as observable and so I try to pass a mapping object. But when I do so, Knockout creates a correct binding but it seems there are no observables at all.
This only happens if I pass a valid mapping object (knockout documentation). If I pass an invalid object, it creates a correct binding with all properties as observable.
Can you tell me what I'm missing?
(The mapping object neither works with 'observe' nor 'copy')
This is my HTML:
<button type="button" data-bind="click: load">Load</button>

<form>

            Name

            Number

                <input data-bind="value: Name" />

                <input data-bind="value: Number" />

</form>

And this is my JavaScript:

Thanks in advance!

A: Check out the documentation observing_only_certain_properties_using_observe. Following the provided example you can use observe on direct object not on an array.
So you need to apply your mapping on the object level not the array level. I have made simple code of you:
function ViewModel() {

    var self = this;

    self.mapping = {
        //observe: ["Number"]
        create: function (options) {
            //customize at the root level.
            var innerModel = ko.mapping.fromJS(options.data, { observe: ["Number"] });

            return innerModel;
        }
    };

    self.infos = ko.mapping.fromJS([]);
    //self.infos = ko.observableArray();

    self.load = function () {
        // Ajax-Call
        var data = [{ "Name": "MyName", "Number": "12345" }, { "Name": "MyName", "Number": "12345" }, { "Name": "MyName", "Number": "12345" }];

        self.SuccessfullRetrievedModelsFromAjax(data);
    };

    self.SuccessfullRetrievedModelsFromAjax = function (data) {
        ko.mapping.fromJS(data, self.mapping, self.infos);
    };
}

var model = new ViewModel();
model.load();
console.log(model.infos());

Here is a JSFiddle Example


text:
Q: Codeigniter action error image cannot be displayed because it contains errors     function load_image() {
       header('ETag: 8ba645e803f8dc1020b1a74b5ec03fba');
       header('Last-Modified: Tue, 21 Jul 2015 10:36:31 GMT');
       header('Content-Type: image/jpeg');
       header('Content-Length: 41374' );
       echo readfile("images/France/paris.jpg");
       exit;
    }

I have this codeigniter function which should read image and load it in browser but I have the error
 /France/paris.jpg" cannot be displayed because it contains errors.

A: You must not output anything before header().
Just start your document with <?php followed by the code for displaying the image. Skip the html tags.
Do not even write a single blank-line before header().
ob_clean — Clean (erase) the output buffer and helpful in manipulating the images and PHP Should I use ob_clean after ob_start

A: I have checked whether the image path is correctly set or if it passes only null value.
If image not found then it gives this error in Firefox. In IE, it shows sample square box. No error message is shown in Chrome.
So, Check if the image passes correctly or pass null value.
In my code I have checked like this
if(!empty("Passing image here path"))
{
compress image here
}


text:
Q: Using classpaths I plan on becoming a certified Java programmer and am studying from the Sierra-Bates book. I had a question about classpaths. Do classpaths need to find only the supporting classes of the class I'm running/compiling, or the supporting classes and the class itself? Also, when I'm getting classes in packages from classpaths, is it legal to just put the adress of the file(the path to it), instead of putting it's root package. Thanks.

A: 1 - a classpath has to give access to each class that needs to run in your program. That would include the main class and any classes it calls and those they call. If there is some code in one of those classes that is never called, in many cases, you don't need to have the classes referenced by the uncalled code.
2 - you have to put the root of the packages in the classpath. So a class "com.bob.myprog.Main" would need to have the class path point to the folder where the "com" package/folder lies. It will need to contain a "bob" folder and "bob" will need to contain a "myprog" folder with "Main.class" in it.

A: Classpath has to contain both the supporting classes and the class itself.
However, sometimes you can run a single file without specifying classpath (and it will work).
As specified in http://docs.oracle.com/javase/tutorial/essential/environment/paths.html :

The default value of the class path is ".", meaning that only the
  current directory is searched. Specifying either the CLASSPATH
  variable or the -cp command line switch overrides this value.

Therefore, if you have a class MyClass compiled in the current directory, the following will work:
java MyClass

while pointing classpath to another directory will lead to an error (classpath no longer contains MyClass):
java -cp lib MyClass

When you have a class in a package, it is not enough to put the address to the class file in the classpath. According to SCJP Sun Certified Programmer for Java 5 Study Guide:

In order to find a class in a package, you have to have a directory in
  your classpath that has the package's leftmost entry (the package's
  "root") as a subdirectory.


text:
Q: Corona SDK collision inside radius I have a problem with a game I am making. I am using physics and have 2 objects, and enemy and a turret. I have a body radius set on the turret which is a sensor. The collision kind of works but it only works when the enemy hits the radius and when exiting the radius. How can I continue to track the enemy when it is inside the sensor so i can carry on firing? Some example would be good if possible
Thanks

A: That's how the physics engine works, it only catch certain events: "collision:, "preCollision", and "postCollision".
for "collision" there have 2 phase: "began" and "ended", that's why your turret only fire when the enemy hit and exit the radius.
My suggestion is: you can setup a timer when the enemy hit the radius, the timer will call the firing function. while the enemy exit the radius, stop and clean the timer.


text:
Q: Run Matlab commands with reduced priority I frequently encounter the following problem: I start a time-consuming (sometimes parallelized) script, and while the said script is running Matlab becomes very slow & unresponsive. (I would like to keep editing files). I suspect that part of the problem is that the script that's running is eating up all CPU capacities.
Hence my question: is there a way to start all commands from within Matlab with a reduced process priority, while not reducing the priority of the Matlab GUI from which these processes are started? I'd be interested in solutions for Windows & Linux.
E.g., on Linux I know I can increase the niceness of the sub-processes using renice on the command line, but I obviously do not want to do so manually each time. I also checked whether there's a way to start the parallel worker threads with a modified priority, but I could not find anything in the documentation. Ideally - as in many other IDEs - there would be a setting somewhere in Matlab where one can configure how to run commands, and I would change it from matlab ... to nice -10 matlab ....


text:
Q: How can we call webview from the click of a link in a custom listview? I am having a listView and a custom adapter, and i made an onclicklistener to a text view, now i want to open a link from that textview in webview, how can i do it?

A: After a lot of research i found the answer, it was really easy.
You have to set the onclickListener in custom adapter class, thats it and make a class to show a webview send a string to that class using intent.putextra();. The class where i am showing webview is this
public class Main extends Activity {

WebView myWebView;

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);

Intent in = getIntent();
String url = in.getStringExtra(("url"));
myWebView = (WebView) findViewById(R.id.webview);

myWebView.getSettings().setBlockNetworkImage(true);

myWebView.getSettings().setBlockNetworkLoads(true);

myWebView.setWebViewClient(new WebViewClient());
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
myWebView.getSettings().setDomStorageEnabled(true);
myWebView.getSettings().setPluginState(PluginState.ON);
myWebView.getSettings().setUserAgentString("Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3");
myWebView.loadUrl(url);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) {
    myWebView.goBack();
    return true;
    }
    return super.onKeyDown(keyCode, event);
    }
class MyWebViewClient extends WebViewClient {
      @Override
      // show the web page in webview but not in web browser
       public boolean shouldOverrideUrlLoading(WebView view, String url) {
        //1 option
         getApplicationContext().startActivity(
         new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        // 2 option
        view.loadUrl(url);
            return true;
      }
    }
    }


text: Q: Can't "select an UEFI file as trusted for executing" Im getting an issue where whenever I boot up it says "reboot and select proper boot device." Many people have this issue and the solution is to turn on secure boot and do something "select an UEFI file as trusted for executing." But whenever I boot in secure mode or not, I never get that option in the security tab of the BIOS.


text:
Q: How do you make a button alert() the text of a textbox? In "Introduction to Nitrogen", there is this example:
body() ->
    #panel { style="margin: 50px;", body=[
        #h1 { text="My Page" },
        #label { text="Enter Your Name:" },
        #textbox { },
        #button { id=mybutton, text="Submit" }
    ]}.

Then they have you add an event that alert()'s hello:
body() ->
    [
        #button { text="Submit", actions=[
          #event{type=click, actions=#alert { text="Hello" }
        ]}
    ].

so I came up with this:
%% -*- mode: nitrogen -*-
%% vim: ts=4 sw=4 et
-module (my_page).
-compile(export_all).
-include_lib("nitrogen_core/include/wf.hrl").
-include("records.hrl").

main() -> #template { file="./site/templates/bare.html" }.

title() -> "Hello from my_page.erl!".

body() ->
    wf:wire(#event{
        type=click,
        trigger=mybutton,
        actions="alert('hello')"
    }),
    #panel{ style="margin: 50px;", body=[
        #h1{ text = "My Simple App..." },
        #label{ id=mylabel, text="Enter your name:"},
        #textbox{ id=mytextbox },
        #button{ text="Submit", id="mybutton"}
    ]}.

It would only seem natural that the guide would show you how to alert() a name that is entered in the textbox.  I tried:
body() ->
    wf:wire(#event{
        type=click,
        trigger=mybutton,
        actions="alert(obj('mytextbox').text)"
    }),
    #panel{ style="margin: 50px;", body=[
        #h1{ text = "My Simple App..." },
        #label{ id=mylabel, text="Enter your name:"},
        #textbox{ id=mytextbox },
        #button{ text="Submit", id="mybutton"}
    ]}.

...but the alert() says undefined.  I can't even find the docs for the obj() function.
I also tried using pure js for the action because the guide says:

What is a Nitrogen Action?
An action can either be Javascript, or some record that renders into
  Javascript.

body() ->
    wf:wire(#event{
        type=click,
        trigger=mybutton,
        actions="alert(document.getElementById('mytextbox').innerHTML)"
    }),
    #panel{ style="margin: 50px;", body=[
        #h1{ text = "My Simple App..." },
        #label{ id=mylabel, text="Enter your name:"},
        #textbox{ id=mytextbox },
        #button{ text="Submit", id="mybutton"}
    ]}.

But, no alert() pops up.  Can anyone help?
Edit:
Well, when I look at the page source, the html looks like this:
<input type="text" class="wfid_temp182655 wfid_mytextbox textbox" value="" />
<input type="button" value="Submit" class="wfid_temp182684 wfid_mybutton button" />

I notice that even though the button and textbox records have an id field, nitrogen does NOT set the id attribute for those html elements--which makes no sense to me.

A: According to the docs:

Event Action - #event {}
  ...
  Within the Javascript, you can use obj('id') where id is the id of a
  Nitrogen element. You can also use obj('me') to refer to the target of
  the current action.

Using the value property (rather than the textContent or innerHTML property--yeah, my js is rusty!) in conjunction with obj('mytextbox') works:
body() ->
    wf:wire(#event{
        type=click,
        trigger=mybutton,
        actions="alert( obj('mytextbox').value )"
    }),
    #panel{ style="margin: 50px;", body=[
        #h1{ text = "My Simple App..." },
        #label{ id=mylabel, text="Enter your name:"},
        #textbox{ id=mytextbox },
        #button{ text="Submit", id=mybutton}
    ]}.

Elsewhere, the docs say:

trigger - (atom) The id of the Nitrogen element that will trigger this action. Set automatically.
target - (atom) The id of the Nitrogen element to be referenced by obj('me'). Set automatically.

So, if I set the target to 'mytextbox', then I should be able to write:
"alert( obj('me').value )"

but no alert() pops up when I try the following code:
%% -*- mode: nitrogen -*-
%% vim: ts=4 sw=4 et
-module (my_page).
-compile(export_all).
-include_lib("nitrogen_core/include/wf.hrl").
-include("records.hrl").

main() -> #template { file="./site/templates/bare.html" }.

title() -> "Hello from my_page.erl!".

body() ->
    wf:wire(#event{
        type=click,
        trigger=mybutton,
        target=mytextbox,
        actions="alert( obj('me').value )"
    }),
    #panel{ style="margin: 50px;", body=[
        #h1{ text = "My Simple App..." },
        #label{ id=mylabel, text="Enter your name:"},
        #textbox{ id=mytextbox },
        #button{ text="Submit", id=mybutton}
    ]}.

And if I try just:
actions="alert( obj('me') )"

still no alert() pops up.


text:
Q: Negative buffer of Boost::geometry::multi_polygon I try to apply a negative buffer to a multipolygon using Boost::geometry. When I run the code below, I get the proper result. But if I remove the marked block, which just export and re-import the geometry in WKT, I get an empty MultiPolygon in the tmp_erosion geometry. I tried to use the boost::geometry::correct() function but it does not change anything. Do you have any idea on how to fix that?
Also, I tried to export the geometries to WKB and it is different before and after the export-then-import-WKT. I guess it is due to some rounding operation somewhere, could it be related to my problem?
std::string wkt = "MULTIPOLYGON(((-203.3984972480392 326.87043766411114,-234.3294031269611 350.72117460025004,-234.32940582512484 350.7211767561067,-234.59541944833873 350.9413566745228,-234.5954246133754 350.9413612592119,-234.8456066177885 351.1793768235705,-234.84561145406377 351.179381753826,-235.078768547128 351.43409770182103,-235.07877303157431 351.43410295412707,-235.29379312442313 351.70430436766964,-235.29379723565108 351.7043099169743,-235.39951413618792 351.85781786966413,-240.86780715032046 350.38218215855835,-241.2049443604434 350.30361570297174,-241.20495115354115 350.3036143659985,-241.5467165739732 350.24856362767656,-241.54672344329876 350.24856276394,-241.89147886679623 350.21729162130026,-241.89148577942245 350.2172912349408,-242.23758558935015 350.20994967493,-242.58335698974216 350.2265727030494,-242.5833638895166 350.22657327470256,-242.9271563937872 350.26708130353956,-242.92716323747084 350.2670823512364,-243.26732892181855 350.3312812109238,-243.26733567660713 350.3312827296422,-243.60225063542637 350.4188666739157,-243.93029626301933 350.52941192532916,-243.93030274346452 350.52941436202866,-244.24991952642313 350.66239589829064,-244.55956286161836 350.81717054531686,-244.55956894361645 350.81717385333343,-244.8577608930744 350.99300259862656,-244.85776673160544 350.99300631954446,-245.14307795174008 351.18904635131906,-245.1430835188178 351.18905046730254,-245.41415167705114 351.40436658497003,-245.6696669314724 351.6379177381484,-245.66967187701746 351.63792258327567,-245.90841706208894 351.88859631483484,-266.58920031948566 375.16554041806563,-266.58920258870927 375.16554306360825,-266.8114462984894 375.433970996735,-266.8114505535744 375.43397651693255,-267.0144568842047 375.7172330288498,-267.0144607444406 375.7172388320306,-267.19724352509485 376.01394790994334,-267.1972469717292 376.0139539679166,-267.358918274207 376.32267424871253,-267.35892129049665 376.3226805320497,-267.49869574263016 376.6419123042001,-267.4986983139225 376.6419187823777,-267.6158969147833 376.97011127128593,-267.6158990285875 376.970117912834,-267.7099540930073 377.30568358689385,-267.7804054331035 377.6469788117333,-267.780406603398 377.6469856825949,-267.8269143132387 377.99236621139704,-267.8492510917757 378.34014040558645,-267.84925129584775 378.3401473724138,-267.84730904189666 378.68863970288874,-267.8210977526416 379.03614335774023,-267.8210969865306 379.036150285323,-267.7707424635338 379.3809909713855,-267.6964900867632 379.72148658265553,-267.59870274954784 380.0559764307823,-267.5987005618558 380.05598304835985,-267.4778489339802 380.38285544057135,-267.3345253662763 380.7005096185073,-267.334522280147 380.700515867838,-267.1694203712224 381.00741516970913,-267.1694168572867 381.0074211888939,-266.9833347199501 381.3020805089815,-266.77718414040345 381.58305694993714,-266.7771798240608 381.58306242236944,-266.5519583226944 381.8489968074004,-266.5519536356491 381.8490019658822,-266.30875282540296 382.09860488379184,-232.51589024775978 414.4450812583296,-232.51588002802416 414.4450898114167,-232.51586876173633 414.4450969296367,-232.51585664898366 414.445102486571,-232.51584390488657 414.4451063835295,-232.5158373664838 414.445107686701,-211.12681324719696 417.9713206571314,-211.12680695294904 417.97132149052527,-211.1267942693878 417.9713219522357,-211.12678793120457 417.971321578691,-211.1267816295017 417.9713208036793,-211.12676923690148 417.97131806335767,-211.1267572912145 417.97131377541353,-211.12675154646425 417.9713110717222,-177.1106691504801 400.6223337146699,-177.1106636027793 400.62233015463886,-177.11065830167098 400.6223262368518,-177.11064853019522 400.6223173975823,-177.11064000569968 400.62230735032404,-177.11063625823746 400.6223019274713,-177.11063287618194 400.6222962695118,-177.11062726542067 400.6222843475245,-177.11062327082684 400.622271791345,-177.11062190239758 400.6222653432285,-165.59426937600804 335.9234066092942,-162.6596781566315 302.06171116087233,-162.6596788436905 302.0616975137797,-162.65967988463825 302.06169075731424,-162.65968333706937 302.06167753627386,-162.65968573241835 302.0616711334854,-162.6596885596208 302.06166490931287,-162.65969545477958 302.06165311219564,-162.65970389380263 302.0616423651924,-162.65970864407186 302.06163744906183,-162.65971909523134 302.0616286463092,-162.65973064885196 302.0616213504858,-162.65974308921002 302.0616156978157,-162.6597561840252 302.0616117938428,-162.65976290080164 302.0616105217139,-162.65977651628992 302.06160936686865,-162.65979016210093 302.0616100789291,-162.65979691664793 302.06161113225346,-162.65981013134098 302.0616146089008,-162.65982274871268 302.0616198545771,-204.8758528204258 323.10306070098704,-204.8758584840069 323.10306427432,-204.87586903132672 323.1030725164298,-204.87587838335946 323.10308209337154,-204.87588255785658 323.1030873296329,-204.87588981029387 323.1030985804321,-204.8758928557106 323.103104544516,-204.87589549513 323.1031106990528,-204.87589771671574 323.10311701644275,-204.87590086845387 323.1031300258577,-204.87590225445257 323.1031433396602,-204.8759018498778 323.10315671929584,-204.8444560373964 323.42562807154223,-204.84445513319602 323.42563489982314,-204.78751382477697 323.76528940556193,-204.78751245267617 323.76529615540176,-204.70732324106254 324.10023186228716,-204.60427022620226 324.42884648764846,-204.60426794001853 324.4288529850604,-204.47883820282144 324.74959412196023,-204.47883547479194 324.74960044658303,-204.33162256579686 325.0609494910012,-203.3984972480392 326.87043766411114)))";

typedef double coordinate_2d;
typedef boost::geometry::model::d2::point_xy<coordinate_2d> point_2d;
typedef boost::geometry::model::polygon<point_2d> polygon_2d;
typedef boost::geometry::model::multi_polygon<polygon_2d> multi_polygon_2d;
multi_polygon_2d test_erosion, tmp_erosion;

// Read WKT
boost::geometry::read_wkt(wkt, test_erosion);

// Check validity
std::cout<<boost::geometry::is_valid(test_erosion)<<std::endl;

//////////////////////////////////////////////
// WHY DO I NEED THIS BLOCK???
//////////////////////////////////////////////
// Export to wkt
std::ostringstream tmp_wkt;
tmp_wkt << boost::geometry::wkt(test_erosion);

// And read it again
boost::geometry::read_wkt(tmp_wkt.str(), test_erosion);
std::cout<<boost::geometry::is_valid(test_erosion)<<std::endl;
//////////////////////////////////////////////

// Apply buffer
boost::geometry::buffer(test_erosion, tmp_erosion,
    boost::geometry::strategy::buffer::distance_symmetric<double>(-0.00001),
    boost::geometry::strategy::buffer::side_straight(),
    boost::geometry::strategy::buffer::join_round(),
    boost::geometry::strategy::buffer::end_round(),
    boost::geometry::strategy::buffer::point_circle(360)
    );

// Print result
std::cout<<boost::geometry::wkt(test_erosion)<<std::endl;
std::cout<<boost::geometry::wkt(tmp_erosion)<<std::endl;

A:
But if I remove the marked block, which just export and re-import the
  geometry in WKT, I get an empty MultiPolygon in the tmp_erosion
  geometry.

tmp_erosion is empty in that case because boost::geometry::buffer didn't write anything to it.
The reason nothing was written is because boost::geometry::strategy::buffer::distance_symmetric<double>(-0.00001) is too coarse. boost::geometry::strategy::buffer::distance_symmetric<double>(-0.0000001) with more decimals would work.

I guess it is due to some rounding operation somewhere

Yes it is.
std::ostringstream tmp_wkt; has a default precision set. Currently the program does not write all the digits and so there is rounding applied.
Adding tmp_wkt.precision(16); before tmp_wkt << boost::geometry::wkt(test_erosion); will cause the same behavior as not having the block because now all the digits are written.
Here is an updated program to show these points in action:
#include <iostream>
#include <sstream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/point_xy.hpp>

int main()
{
    std::string wkt = "MULTIPOLYGON(((-203.3984972480392 326.87043766411114,-234.3294031269611 350.72117460025004,-234.32940582512484 350.7211767561067,-234.59541944833873 350.9413566745228,-234.5954246133754 350.9413612592119,-234.8456066177885 351.1793768235705,-234.84561145406377 351.179381753826,-235.078768547128 351.43409770182103,-235.07877303157431 351.43410295412707,-235.29379312442313 351.70430436766964,-235.29379723565108 351.7043099169743,-235.39951413618792 351.85781786966413,-240.86780715032046 350.38218215855835,-241.2049443604434 350.30361570297174,-241.20495115354115 350.3036143659985,-241.5467165739732 350.24856362767656,-241.54672344329876 350.24856276394,-241.89147886679623 350.21729162130026,-241.89148577942245 350.2172912349408,-242.23758558935015 350.20994967493,-242.58335698974216 350.2265727030494,-242.5833638895166 350.22657327470256,-242.9271563937872 350.26708130353956,-242.92716323747084 350.2670823512364,-243.26732892181855 350.3312812109238,-243.26733567660713 350.3312827296422,-243.60225063542637 350.4188666739157,-243.93029626301933 350.52941192532916,-243.93030274346452 350.52941436202866,-244.24991952642313 350.66239589829064,-244.55956286161836 350.81717054531686,-244.55956894361645 350.81717385333343,-244.8577608930744 350.99300259862656,-244.85776673160544 350.99300631954446,-245.14307795174008 351.18904635131906,-245.1430835188178 351.18905046730254,-245.41415167705114 351.40436658497003,-245.6696669314724 351.6379177381484,-245.66967187701746 351.63792258327567,-245.90841706208894 351.88859631483484,-266.58920031948566 375.16554041806563,-266.58920258870927 375.16554306360825,-266.8114462984894 375.433970996735,-266.8114505535744 375.43397651693255,-267.0144568842047 375.7172330288498,-267.0144607444406 375.7172388320306,-267.19724352509485 376.01394790994334,-267.1972469717292 376.0139539679166,-267.358918274207 376.32267424871253,-267.35892129049665 376.3226805320497,-267.49869574263016 376.6419123042001,-267.4986983139225 376.6419187823777,-267.6158969147833 376.97011127128593,-267.6158990285875 376.970117912834,-267.7099540930073 377.30568358689385,-267.7804054331035 377.6469788117333,-267.780406603398 377.6469856825949,-267.8269143132387 377.99236621139704,-267.8492510917757 378.34014040558645,-267.84925129584775 378.3401473724138,-267.84730904189666 378.68863970288874,-267.8210977526416 379.03614335774023,-267.8210969865306 379.036150285323,-267.7707424635338 379.3809909713855,-267.6964900867632 379.72148658265553,-267.59870274954784 380.0559764307823,-267.5987005618558 380.05598304835985,-267.4778489339802 380.38285544057135,-267.3345253662763 380.7005096185073,-267.334522280147 380.700515867838,-267.1694203712224 381.00741516970913,-267.1694168572867 381.0074211888939,-266.9833347199501 381.3020805089815,-266.77718414040345 381.58305694993714,-266.7771798240608 381.58306242236944,-266.5519583226944 381.8489968074004,-266.5519536356491 381.8490019658822,-266.30875282540296 382.09860488379184,-232.51589024775978 414.4450812583296,-232.51588002802416 414.4450898114167,-232.51586876173633 414.4450969296367,-232.51585664898366 414.445102486571,-232.51584390488657 414.4451063835295,-232.5158373664838 414.445107686701,-211.12681324719696 417.9713206571314,-211.12680695294904 417.97132149052527,-211.1267942693878 417.9713219522357,-211.12678793120457 417.971321578691,-211.1267816295017 417.9713208036793,-211.12676923690148 417.97131806335767,-211.1267572912145 417.97131377541353,-211.12675154646425 417.9713110717222,-177.1106691504801 400.6223337146699,-177.1106636027793 400.62233015463886,-177.11065830167098 400.6223262368518,-177.11064853019522 400.6223173975823,-177.11064000569968 400.62230735032404,-177.11063625823746 400.6223019274713,-177.11063287618194 400.6222962695118,-177.11062726542067 400.6222843475245,-177.11062327082684 400.622271791345,-177.11062190239758 400.6222653432285,-165.59426937600804 335.9234066092942,-162.6596781566315 302.06171116087233,-162.6596788436905 302.0616975137797,-162.65967988463825 302.06169075731424,-162.65968333706937 302.06167753627386,-162.65968573241835 302.0616711334854,-162.6596885596208 302.06166490931287,-162.65969545477958 302.06165311219564,-162.65970389380263 302.0616423651924,-162.65970864407186 302.06163744906183,-162.65971909523134 302.0616286463092,-162.65973064885196 302.0616213504858,-162.65974308921002 302.0616156978157,-162.6597561840252 302.0616117938428,-162.65976290080164 302.0616105217139,-162.65977651628992 302.06160936686865,-162.65979016210093 302.0616100789291,-162.65979691664793 302.06161113225346,-162.65981013134098 302.0616146089008,-162.65982274871268 302.0616198545771,-204.8758528204258 323.10306070098704,-204.8758584840069 323.10306427432,-204.87586903132672 323.1030725164298,-204.87587838335946 323.10308209337154,-204.87588255785658 323.1030873296329,-204.87588981029387 323.1030985804321,-204.8758928557106 323.103104544516,-204.87589549513 323.1031106990528,-204.87589771671574 323.10311701644275,-204.87590086845387 323.1031300258577,-204.87590225445257 323.1031433396602,-204.8759018498778 323.10315671929584,-204.8444560373964 323.42562807154223,-204.84445513319602 323.42563489982314,-204.78751382477697 323.76528940556193,-204.78751245267617 323.76529615540176,-204.70732324106254 324.10023186228716,-204.60427022620226 324.42884648764846,-204.60426794001853 324.4288529850604,-204.47883820282144 324.74959412196023,-204.47883547479194 324.74960044658303,-204.33162256579686 325.0609494910012,-203.3984972480392 326.87043766411114)))";

    typedef double coordinate_2d;
    typedef boost::geometry::model::d2::point_xy<coordinate_2d> point_2d;
    typedef boost::geometry::model::polygon<point_2d> polygon_2d;
    typedef boost::geometry::model::multi_polygon<polygon_2d> multi_polygon_2d;
    multi_polygon_2d test_erosion, tmp_erosion;

    // Read WKT
    boost::geometry::read_wkt(wkt, test_erosion);

    // Check validity
    std::cout << boost::geometry::is_valid(test_erosion) << std::endl;

    //////////////////////////////////////////////
    // WHY DO I NEED THIS BLOCK???
    //////////////////////////////////////////////
    // Export to wkt
    std::ostringstream tmp_wkt;
    tmp_wkt.precision(16); // changing the precision to include all digits will render this block moot
    tmp_wkt << boost::geometry::wkt(test_erosion); // this will round according to the precision for the stream

    // And read it again
    boost::geometry::read_wkt(tmp_wkt.str(), test_erosion);
    std::cout << boost::geometry::is_valid(test_erosion) << std::endl;
    //////////////////////////////////////////////

    // Apply buffer
    boost::geometry::buffer(test_erosion, tmp_erosion,
                            boost::geometry::strategy::buffer::distance_symmetric<double>(-0.0000001), // this will produce output in tmp_erosion, even with all the digits
                            //boost::geometry::strategy::buffer::distance_symmetric<double>(-0.00001), // this will not produce output if the coordinates are not rounded
                            boost::geometry::strategy::buffer::side_straight(),
                            boost::geometry::strategy::buffer::join_round(),
                            boost::geometry::strategy::buffer::end_round(),
                            boost::geometry::strategy::buffer::point_circle(360)
                            );

    // Print result
    std::cout << boost::geometry::wkt(test_erosion) << std::endl;
    std::cout << boost::geometry::wkt(tmp_erosion) << std::endl;;


text:
Q: command ps with option -l I'm working on linux terminal,Fedora. And I want to find number of processes that have executed fork() call. I used first command ps -elf to list all processes with all possible details.
I want to know what does the first column from the left "F" refers to? maybe number of children for a parent?
p.s: manual doesn't mention the details of option -l.

A: actually, the man gives the answer:
f          F        flags associated with the process, see the PROCESS FLAGS section. (alias flag, flags).
then if you look at the PROCESS FLAGS section, you get:
PROCESS FLAGS
The sum of these values is displayed in the "F" column, which is provided by the flags output specifier.
1    forked but didn't exec
4    used super-user privileges
which will probably explain why you get only 0, 1, 4 or 5 as values in this column,

A: It's the option for how it will display the output of ps command.
Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

In case ps -l, it will display the below detail,
Usage:
 ps [options]

Selection by list:
 -C <command>         command name
 -G, --Group <gid>    real group id or name
 -g, --group <group>  session or effective group name
 -p, --pid <pid>      process id
     --ppid <pid>     select by parent process id
 -s, --sid <session>  session id
 -t, t, --tty <tty>   terminal
 -u, U, --user <uid>  effective user id or name
 -U, --User <uid>     real user id or name

  selection <arguments> take either:
    comma-separated list e.g. '-u root,nobody' or
    blank-separated list e.g. '-p 123 4567'

For more details see ps(1).


text:
Q: Ng-click and ng-repeat - angularJs doesn't work I know about different scopes inside ng-repeat, I headed about this but I still can't solute removing of selected item of li ( I don't use $index ) instead of future sortable objects

  {{students.student}} :knowledge is - {{students.knowledge}}
  <button type="button" class="btn btn-danger ml-2" ng-click="students.removeItem(item)">Delete</button>

and my function working behind li-element, but delete only last element
vm.removeItem = function (item) {
  vm.students.splice(vm.students.indexOf(item), 1);
}

and I don't need $parent in ng-repeat

A: Maybe you are trying to do something like:

  {{student.name}} :knowledge is - {{student.knowledge}}
  <button type="button" class="btn btn-danger ml-2" ng- click="removeItem(student)">Delete</button>

$scope.removeItem = function (item) {
    this.students.students = this.students.students.filter(student => student !== item)
};

This is a working demo
Honestly, I don't understand why you have students object in students.
In addition, why every item in ng-repeat is called: students?
I guess that every item needs the variable name of student.


text:
Q: module import in loop python, value not updating I have a file that contains:

Hello There

    This is an example of a pml file

    <pml>
    def f():
        return "
First PML block
"
    pml = f()
    </pml>

Here is another paragraph

    <pml>
    def g():
        return "
Second PML block
"
    pml = g()
    </pml>

This is the last paragraph.

    <pml>
    def h():
        return "
Third PML block
"
    pml = h()
    </pml>

I'm writing a python script that will produce an output file that replaces the pml blocks with the result of the code in the block.  I want the output file to look like:

Hello There

This is an example of a pml file

First PML block

Here is another paragraph

Second PML block

This is the last paragraph.

Third PML block

Here is my script:
import sys

#define main

def main(argv):
    #make sure usage is proper
    if len(sys.argv) != 3:
        print 'Usage: pmlparser.py <input_file> <output_file>'
    else:
          #get the filenames
          inputfilename = sys.argv[1]
          outputfilename = sys.argv[2]
          #open the files
          with open(inputfilename,"r") as inputfile, open(outputfilename,"w") as outputfile:
                  for line in inputfile:
                         if not "<pml>" in line:
                               outputfile.write(line)
                         else:
                               pmlfile = open("pmlcode.py","a")
                               for line in inputfile:
                                       if not "</pml>" in line:
                                              pmlfile.write(line[1:])
                                       else:
                                              #I think the problem is somewhere in here
                                              pmlfile.close()
                                              import pmlcode
                                              outputfile.write(pmlcode.pml + "\n")
                                              break

if __name__ == "__main__":
   main(sys.argv[1:])

Unfortunately, I get the following as my result:

Hello There

This is an example of a pml file

First PML block

Here is another paragraph

First PML block

This is the last paragraph.

First PML block

I am iteratively importing pmlcode.py, and trying to write the new value for pml to the outputfile.  However, this script keeps writing the original value for pml to the output file.
I've tried the following as a test:
a.py:
def f():
    return 1
var = f()
def g():
    return 2
var = g()

b.py:
import a
print a.var

$> python b.py
2
I just started learning Python yesterday, so I apologize if my question sounds dumb or if I'm misunderstanding something.  I appreciate any help!

A: import is not the tool you want here. As you discovered, once you've imported a module, you always get the same module; Python caches it in memory for performance. The problem, in other words, is not that pmlcode.py isn't getting updated, but rather that it is only actually read the first time import pmlcode is executed.
Since you already have a string, why write it to a file and then import it? Just use exec directly on the string.


text:
Q: Uploading video file on website throw UIWebView in iOS When I want to upload a video to my website, throw UIWebview using <input file="type"/> the files are picked from the Photo Library and the videos are compressed before being sent to the server. This works great in UIWebview! But now is there a way to get rid of that compression? a have a good quality video sent to the server.

*

*I try with multiple libraries like dropzonejs, file-uploader but no one seems to work in UIWebview when the videos are uploaded from the Photo Library (the compression step is skipped and the upload fail because of a file size that is equal to 0).

Strangely everything works fine in every case (UIWebview, Safari), when the video is uploaded from another app like (Documents) no compression done in any case so the video is sent directly.
What I also try:

*Look on iPad to disable some preferences in Photos and found nothing.

*I just take the simple example: http://www.dropzonejs.com/examples/simple.html and  did some testing and it seems that dropzone.js works well in Safari but not when accessed throw UIWebView.

*Load the vimeo website in UIWebview and try to upload video, it also fail saying that the video size is not valid (0B)
Any idea on how can I avoid the compression step when the photo is picked from the Photo Library using the simple <input file="type"/> which is the only one that worked with Photo Library in UIWebview?
Or is there a way to use libraries like dropzone.js and upload file throw UIWebview. Moreover every type of file works (music and images). It is only videos that are not correctly handled in UIWebview.

A: I found that a workaround to the bug can be done by limiting the max number of files uploaded to one.
In Dropzone this means:
objFacilityDropzone = new Dropzone("#mainFileUploader",
    {
        url: "/posUrl",
        autoProcessQueue: false,
        addRemoveLinks: true,
        maxFilesize:100,
        acceptedFiles: "image/*,video/*,.mov,.mp4",
        maxFiles: 1,
   }

A: I try your solution but it is not working for me… ios 13.2
here my code :
    <form action="/wp-content/uploads/upload_video/upload.php" class="dropzone" id="myAwesomeDropzone">
    <input type="text" id="post_id" name="post_id" value="<?php echo $_POST["property_id"];?>"/>
    </form>

                                         <script>
    jQuery(function($)
    {

    // "myAwesomeDropzone" is the camelized version of the HTML element's ID
Dropzone.options.myAwesomeDropzone = {
  paramName: "file", // The name that will be used to transfer the file
  autoProcessQueue: false,
        addRemoveLinks: true,
        maxFilesize:100,
        acceptedFiles: "video/*",
        maxFiles: 1,
        multiple: false,
        uploadMultiple: false,
  };
  alert("coco");
                                    });
                                    </script>


text:
Q: xamarin forms cannot implicitly convert type 'system.threading.tasks.taskHi I am new to programming, but currently I encounter xamarin forms cannot implicitly convert type 'system.threading.tasks.task> to system.collections.generic.List
as I am trying to use global variable upon launching the app to optimized the app
when I am trying to set the List of menu items into the global variable which will be access by the other pages, it gave me that error. I have no idea how to solve that issue so someone please help me
Here is my
App.cs
private static int globalVariable = 1;
        public static List<MenuItemModel> foodList = new List<MenuItemModel>();
        private static List<MenuItemModel> beverageList = new List<MenuItemModel>();
        public static int GlobalVariable
        {
            get { return globalVariable; }
            set { globalVariable = value; }
        }
        public static List<MenuItemModel> FoodList
        {
            get { return foodList; }
            set { foodList = value; }
        }
        public static List<MenuItemModel> BeverageList
        {
            get { return beverageList; }
            set { beverageList = value; }
        }

        public App()
        {
            GlobalVariable = 10;

            BeverageList = getBeverageList();
            FoodList = getFoodList();
        }
public async Task<List<MenuItemModel>> getBeverageList()
        {
            ConstantCS constant = new ConstantCS();
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("http://172.20.129.44/");

            // Add an Accept header for JSON format.
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            HttpResponseMessage response = new HttpResponseMessage();
            response = client.GetAsync("WebServices/menu.svc/GetBeveragesJSON").Result;

            if (response.IsSuccessStatusCode)
            {
                string jsonString = await response.Content.ReadAsStringAsync();
                dynamic dynamicObject = JsonConvert.DeserializeObject(jsonString);

                int itemId_;
                string itemName_;
                string itemCategory_;
                string itemSubCategory_;
                string itemDescription_;
                string itemImage_;
                int itemQuantity_;
                double itemPrice_;
                string itemStatus_;
                string itemAddOn_;

                for (int i = 0; i < dynamicObject.d.Count; i++)
                {
                    itemId_ = dynamicObject.d[i]["itemID"];
                    itemName_ = dynamicObject.d[i]["itemName"].ToString();
                    itemCategory_ = dynamicObject.d[i]["itemCategory"].ToString();
                    itemSubCategory_ = dynamicObject.d[i]["itemSubCategory"].ToString();
                    itemDescription_ = dynamicObject.d[i]["itemDesc"].ToString();
                    itemImage_ = dynamicObject.d[i]["itemImg"].ToString();
                    itemQuantity_ = int.Parse(dynamicObject.d[i]["itemQty"].ToString());
                    itemPrice_ = double.Parse(dynamicObject.d[i]["itemPrice"].ToString());
                    itemStatus_ = dynamicObject.d[i]["itemStatus"].ToString();
                    itemAddOn_ = dynamicObject.d[i]["itemRequest"].ToString();

                    string itemURL_ = constant.PhotoBaseURL + itemImage_;

                    beverageList.Add(new MenuItemModel(itemId_, itemName_, itemCategory_, itemSubCategory_, itemDescription_, itemURL_, itemQuantity_, itemPrice_, itemStatus_, itemAddOn_));
                }

            }
            else
            {
                //Debug.WriteLine("It entered else not if");
            }
            return beverageList;
        }

Thanks!

A: You're not doing anything async in getBeverageList(), so you can safely change its signature to
public List<MenuItemModel> getBeverageList()

After that, you should stop for a few days, and learn about async/await and TPL...


text:
Q: JSON.Stringify fails on Scripting.Dictionary objects I am working on an ASP classic project where I have implemented the JScript JSON class found here. It is able to interop with both VBScript and JScript and is almost exactly the code provided at json.org. I am required to use VBScript for this project by the manager of my team.
It works very well on primitives and classes defined within ASP. But I have need for Dictionary objects which from my knowledge are only available through COM interop. (via Server.CreateObject("Scripting.Dictionary")) I have the following class which represents a product: (ProductInfo.class.asp)
<%
Class ProductInfo

    Public ID
    Public Category
    Public PriceUS
    Public PriceCA
    Public Name
    Public SKU
    Public Overview
    Public Features
    Public Specs

End Class
%>

The Specs property is a Dictionary of key:value pairs. Here's how I'm serializing it: (product.asp)
<%
dim oProd
set oProd = new ProductInfo
' ... fill in properties
' ... output appropriate headers and stuff
Response.write( JSON.stringify( oProd ) )
%>

When I pass an instance of ProductInfo to JSON.Stringify (as seen above) I get something like the following:
{
    "id": "1547",
    "Category": {
        "id": 101,
        "Name": "Category Name",
        "AlternateName": "",
        "URL": "/category_name/",
        "ParentCategoryID": 21
    },
    "PriceUS": 9.99,
    "PriceCA": 11.99,
    "Name": "Product Name",
    "SKU": 3454536,
    "Overview": "Lorem Ipsum dolor sit amet..",
    "Features": "Lorem Ipsum dolor sit amet..",
    "Specs": {}
}

As you can see, the Specs property is an empty object. I believe that the JSON stringify method knows that the Specs property is an object, so it appends the {} to the JSON string around the stringified output. Which in this case is an empty string. What I expect it to show, however is not an empty object. See below:
"Specs": {
    "foo":"bar",
    "baz":1,
    "etc":"..."
}

I believe the problem area of the JSON library is here: (json2.asp)
// Otherwise, iterate through all of the keys in the object.

for (k in value) {
    if (Object.hasOwnProperty.call(value, k)) {
        v = str(k, value);
        if (v) {
            partial.push(quote(k) + (gap ? ': ' : ':') + v);
        }
    }
}

I postulate that the problem with the above code is that it assumes that all objects inherit from the Object class. (The one that provides hasOwnProperty) However I think that it's likely that COM objects don't inherit from the Object class — or at least the same Object class. Or at least don't implement whatever interface is required to do for ... in on them.
Update: While I feel it is irrelevant for the question to be answered — I expect some sort of web client to request (via http) the JSON representation of this object or a collection of this object.
tl;dr The question: What should I do to make it so that the Scripting.Dictionary can be output properly as JSON instead of failing and returning just an empty string? Do I need to 'reinvent the wheel' and write my own Dictionary class in VBScript that does act as a normal object in ASP?

A: Javascript's for...in construct (which is used in the JSON serializer you refer to) only works on native JS objects.  To enumerate a Scripting.Dictionary's keys, you need to use an Enumerator object, which will enumerate the keys of the Dictionary.
Now the JSON.stringify method has a nifty way of allowing custom serialization, by checking for the presence of a toJSON method on each property.  Unfortunately, you can't tack new methods on existing COM objects the way you can on native JS objects, so that's a no-go.
Then there's the custom stringifier function that can be passed as second argument to the stringify method call.  That function will be called for each object that needs to be stringified, even for each nested object.  I think that could be used here.
One problem is that (AFAIK) JScript is unable to differentiate VBScript types on its own.  To JScript, any COM or VBScript object has typeof === 'object'.  The only way I know of getting that information across, is defining a VBS function that will return the type name.
Since the execution order for classic ASP files is as follows:

*

*<script> blocks with non-default script languages (in your case, JScript)

*<script> blocks with the default script language (in your case, VBScript)

*<% ... %> blocks, using the default script language (in your case, VBScript)

The following could work — but only when the JSON.stringify call is done within <% ... %> brackets, since that's the only time when both JScript and VBScript <script> sections would both have been parsed and executed.
The final function call would be this:
<%
    Response.Write JSON.stringify(oProd, vbsStringifier)
%>

In order to allow JScript to check the type of a COM object, we'd define a VBSTypeName function:
<script language="VBScript" runat="server">
    Function VBSTypeName(Obj)
        VBSTypeName = TypeName(Obj)
    End Function
</script>

And here we have the full implementation of the vbsStringifier that is passed along as second parameter to JSON.stringify:
<script language="JScript" runat="server">

    function vbsStringifier(holder, key, value) {
        if (VBSTypeName(value) === 'Dictionary') {
            var result = '{';
            for(var enr = new Enumerator(value); !enr.atEnd(); enr.moveNext()) {
                key = enr.item();
                result += '"' + key + '": ' + JSON.stringify(value.Item(key));
            }
            result += '}';
            return result;
        } else {
        // return the value to let it be processed in the usual way
            return value;
        }
    }

</script>

Of course, switching back and forth between scripting engines isn't very efficient (i.e. calling a VBS function from JS and vice versa), so you probably want to try to keep that to a minimum.

Also note that I haven't been able to test this, since I no longer have IIS on my machine.  The basic principle should work, I'm not 100% certain of the possibility to pass a JScript function reference from VBScript.  You might have to write a small custom wrapper function for the JSON.stringify call in JScript:
<script runat="server" language="JScript">
    function JSONStringify(object) {
        return JSON.stringify(object, vbsStringifier);
    }
</script>

after which you can simply adjust the VBScript call:
<%
    Response.Write JSONStringify(oProd)
%>

A: I ended up writing a function to serialize the Dictionary type myself. Unfortunately, you'll have to go in and do a find & replace on any failed dictionary serializations. ({}) I haven't the time to figure out an automated way to do this. You're welcome to fork it on BitBucket.
Function stringifyDictionary( key, value, sp )

  dim str, val

  Select Case TypeName( sp )
    Case "String"
      sp = vbCrLf & sp
    Case "Integer"
      sp = vbCrLf & Space(sp)
    Case Else
      sp = ""
  End Select

  If TypeName( value ) = "Dictionary" Then
    str = """" & key & """:{" & sp
    For Each k in value
      val = value.Item(k)
      If Not Right(str, 1+len(sp)) = "{" & sp And Not Right(str, 1+len(sp)) = "," & sp Then
        str = str & "," & sp
      End If
      str = str & """" & k & """: "
      If TypeName( val ) = "String" Then
        If val = "" Then
          str = str & "null"
        Else
          str = str & """" & escapeJSONString( val ) & """"
        End If
      Else
        str = str & CStr( val )
      End If
    Next
    str = str & sp & "}"
    stringifyDictionary = str
  Else
    stringifyDictionary = value
  End If

End Function

Function escapeJSONString( str )
  escapeJSONString = replace(replace(str, "\", "\\"), """", "\""")
End Function

This was written as a function to use with JSON.stringify's replace argument (2nd arg). However you cannot pass a VBScript function as an argument. (From my experience) If you were to rewrite this function in JScript you could use it when you're calling JSON.stringify to ensure that Dictionaries do get rendered properly. See the readme on BitBucket for more on that. Here's how I implemented it:
dim spaces: spaces = 2
dim prodJSON: prodJSON = JSON.stringify( oProduct, Nothing, spaces)
prodJSON = replace(prodJSON, """Specs"": {}", stringifyDictionary("Specs", oProduct.Specs, spaces * 2))

Known issues:

*

*The closing } for the Dictionary serialization will be the same number of indentations as the properties it contains. I didn't have time to figure out how to deal with that without adding another argument which I don't want to do.

A: JSON does not inherently encode any type information at all. What JSON enables you to represent is an arbitrary data structure involving either an object or an array of values. Any such object may have an arbitrary number of named properties such that the names are strings and the values are either the constant null, the constants true or false, numbers, strings, objects, or arrays of values.
How such a data structure is realized in any given programming language runtime is your problem :-)  For example, when de-serializing JSON into Java, one might use ArrayList instances for arrays, HashMap instances for objects, and native types for simpler values.  However, it might be that you really want the objects to be some particular type of Java bean class. To do that, the JSON parser involved would have to be somehow guided as to what sort of objects to instantiate. Exactly how that works depends on the JSON parser and its APIs.
(edit — when I said "no type information at all", I meant for "object" values; clearly booleans, strings, and numbers have obvious types.)


text:
Q: how to use anchors on swapping content? I have two wrappers A and B swapping visibility due to @support. If B is supported the divs of B are visible, if B is not supported the divs of A are visible.
I use these wrappers to swap div-contents (same images, but different sizes) and now I am facing the problem with setting anchors to elements inside the wrappers now. The divs in A and divs in B should share the same anchors, but I know that I should not give same id twice to different contents.
What can I do? Is it somehow possible to make elements on both sides share the same anchors? Or is there another way to solve this?

<...>

<...>

<...>

<...>

<...>

<...>

A: The solution is to get your ids out of the containers and have sub-containers in each section:

  ...

  ...

  ...

  ...

  ...

  ...

You might also want to have a look at srcset, which takes the responsiveness problem down to  element level.

A: Have two classes on your parent element and allow the cascade of CSS to overwrite properites of one class with the properties of another. Both will have equal specificity so CSS will use the last rules defined. This will likely change your overall approach, but it does allow for conditional logic without the use of javascript.

<...>

<...>

<...>


text:
Q: "Started the washing machine" vs "started the washing machine up." What's the correct construction? Example sentences:

I didn't start the watching machine (up).
The washing machine is spinning. Who started it (up)?

A: When talking about devices or machines, as far as I know, both start and start up can be used interchangeably:

Go and start the car, I'll be there in a moment.
  Go and start up the car, I'll be there in a moment.
My pad won't start.  Can you fix it?
  My pad won't start up.  Can you fix it?

There may be idiomatic exceptions, but I can't think of any.  However because "start up" means "get running", you don't normally use "start up" with things like events.

The race is scheduled to start at ten.

Unless you mean to imply that you want to get things going

Welcome to the tenth national gathering of the English Learners' Society!  Let's get things started up by singing our theme song!


text:
Q: Session timeout in web application on window Azure platform I need your help to sort out one problem with session timeout in my application which are hosted on Azure platform.
I have developed web application in asp.net and make login functionality with session and put following code maintain timeout period for session like
<sessionState mode="InProc" timeout="20"></sessionState>

It working fine on local system but when i will tested it with live URL on Azure platform it will signout frequently (session expired).
Can any one please suggest me how can i resolve this issues?
Thanks
Arun.

A: Are you running more than one WebRole instance?  Remember, "InProc" session-state will not be shared across multiple web-role instances.  In fact, InProc session state is "evil" in the cloud world, will not work for any deployments with more than 1 instance running. You really want to use another provider, like Session provider for AppFabric Cache

A: Are you sure the session is expiring? If you are using ASP.NET forms authentication there is another timeout to consider (here I have set it to 180 mins)
<authentication mode="Forms">
  <forms loginUrl="Login/" timeout="180"/>
</authentication>

If you do have multiple instances Igorek is right - the session will not be shared.
Please see how-does-microsoft-azure-handle-session-state/1023125#1023125
or refer to the Azure SDK for more information.


text:
Q: SQL order by sequence of IN values in query For example I have this code:
SELECT *
FROM table_name
WHERE column_name IN (value6,value4,value11,value19)

Is there a way to order the result in that exact sequence in the query? The code above returns the default ordering of table_name, completely disregarding the sequence of IN values. I know I can do additional coding in PHP to properly order them according to the IN values but that would create a significant overhead.

A: SELECT
  *
FROM
  table_name
WHERE column_name IN (value6,value4,value11,value19)
ORDER BY FIELD(column_name,value6,value4,value11,value19)

Explanation here: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_field

*

*FIELD(str,str1,str2,str3,...)

  Returns the index (position) of str in
  the str1, str2, str3, ... list.
  Returns 0 if str is not found.

A: For a DB agnostic answer, look here:
Order resultset based on WHERE IN clause data
However, I would love to have an array construct that is DB agnostic.


text:
Q: Role doesn't appear in database, but `getRoles` should always add ROLE_USER I tried to store a user in the database.
When I create a new user, the role doesn't appear in database, even if my function inside my "candidate" entity says that any user should have at least the role USER_ROLE
public function getRoles(): array
{
       $roles = $this->roles;
       // guarantee every user at least has ROLE_USER
       $roles[] = 'ROLE_USER';

       return array_unique($roles);
}

Do you know what I am doing wrong?

A: The getter method is not called when storing data in the DB.
First the object is retrieved from the DB and its properties populated. getRoles() read from those properties (specifically from $this->roles, which should reflect the DB content.
What getRoles() does is make sure that even if you didn't assign any role to a specific user (as the case for your second row), the application will see that the user has the USER_ROLE assigned.


text:
Q: mongodb and geospatial schema im breaking my head with mongo and geospatial,
so maybe someone has some idea or solution how to solve this:
my object schema is like this sample for geoJSON taken from http://geojson.org/geojson-spec.html.
{
"name":"name",
"geoJSON":{
"type":"FeatureCollection",
"features":[
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]},"properties":{}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]},"properties":{}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]},"properties":{}}
]}}

additional info: I'm using spring data but that shouldn't influence the answer.
main problem is how/where to put indexes in this schema. I need to make a query to find all documents for given Point if some polygon intersects.
thanks in advance.

A: By creating a 2d or 2dsphere index on geoJSON.features.geometry you should be able to create an index covering all of the geoJSON-objects.
To get all documents where at least one of the sub-object in the features array covers a certain point, you can use the $geoIntersects operator with a geoJSON Point:
db.yourcollection.find(
            { `geoJSON.features.geometry` :
              { $geoIntersects :
                { $geometry :
                  { type : "Point" ,
                    coordinates: [ 100.5 , 0.5 ]
                  }
                }
              }
            }
          )


text:
Q: Problems setting useState inside onClick handler I am using useState hook inside onClick handler to change and track the focus state. I set it to false initially and then change it to true and false several times in the handler. After each change, I do console.log(focus) and I expect it to be respective to the changes made.
    function App() {
       const [focus, setFocus] = useState(false);

       return (

 {
          console.log(focus);
          setFocus(true);
          console.log(focus);
          setFocus(false);
          console.log(focus);
      }}
       >

App

     );
    }

In my case, in this code snippet, I expect to see in console false, true and then false again, but I see all of them false.
Why does it happen? I feel I am missing something quite fundamental here.

A: When you set the state, the component will be re-rendered. State changes are not synchronous in nature. Try adding a console.log below your useState line and you'll see that it gets called every time you set the focus because the entire component is re-rendered.


text:
Q: prestashop: Show read more at product description if description longer than XXX number of characters Would you guys recomend me a way i could make the read more button appear only if the description has a certain ammount of characters only?
{if isset($product) && $product->description }

{$product->description}

    <input id="button" type="button" style="margin-top:5px;font-size:12px;color:white;font-family:avantgarde-book; width:120px;background:#4e3248;border:none;height:30px;border-radius:5px;" value="Mostrar +" onclick="showMore()">
            <input id="button2" type="button" style="margin-top:5px;display:none;font-size:12px;color:white;font-family:avantgarde-book; width:120px;background:#4e3248;border:none;height:30px;border-radius:5px;" value="Mostrar -" onclick="showLess()">

{/if}

i got this code so far and its working fine but the button appears even when its too short description, so i want to make the condition to show of only when the description is XXX number of characters long or more...

A: This is fairly easy since prestashop uses smarty.
Let's say you want to limit your description to 200 chars and after that display read more button
You can use count_characters. Here is a example:
{if isset($product) && $product->description }
        {* full description *}

{$product->description}

        {if $product->description|count_characters:true > 200 }
            <input id="button" type="button" style="margin-top:5px;font-size:12px;color:white;font-family:avantgarde-book; width:120px;background:#4e3248;border:none;height:30px;border-radius:5px;" value="Mostrar +" onclick="showMore()">
            <input id="button2" type="button" style="margin-top:5px;display:none;font-size:12px;color:white;font-family:avantgarde-book; width:120px;background:#4e3248;border:none;height:30px;border-radius:5px;" value="Mostrar -" onclick="showLess()">
        {else}
            {* don't display anything *}
        {/if}

{/if}

You can read about count_characters and about it's attributes from here
http://www.smarty.net/docsv2/en/language.modifier.count.characters.tpl
P.S right way to display something as a comment in smarty syntax is to display it between these tags {* *}
BR's
(if this helps you dont forget to accept it :) )


text:
Q: Can I destroy this orphan's letter? As part of the Wintersday holiday, an orphan sends you a message in the mail which contains an item called [Orphan Laine's Letter]. It appears to just be taking up an inventory slot, but attempting to destroy it raises a confirmation dialog:

Is this safe to delete, or will it be needed further down the line?

A: It is exactly as your link describes it :

Orphan Laine's Letter is a letter that starts the Warming Grawnk's Heart scavenger hunt. When double-clicking, it will point towards your home instance.

It does nothing less, nothing more, start the scavenger hunt and feel free to do whatever you want with it after that !

A: It's for a scavenger quest, double clicking the letter should point you to your racial home, going here will start the quest. Unless you do want to do the mission destroying the letter should be fine.


text:
Q: Set ProgressBar visibility from ViewModel before and after retrieving data from webservice service I am creating a Windows Phone 8.1 app using an MVVM design pattern and the MVVM Light toolkit.
I am trying to create a simple login page that takes a username and password from a user and authenticates with a webservice. During this authentication process I want to show a ProgressBar (loading dots) at the top of the page to indicate that something is happening.
I have successfully created my ViewModel and bound my View to allow me to control the visibility of the ProgressBar from a Command attached to my login button. This works, however, the UI only updates to show the ProgressBar once the entire Login process is completed, making the use of a progress indicator pointless.
How do I first set the visibility of the ProgressBar (and have the UI update) then go off an perform my Login process?
Here is some code:
xaml
<ProgressBar IsIndeterminate="True" Height="1" Visibility="{Binding Login.ProgressVisibility, UpdateSourceTrigger=PropertyChanged, FallbackValue=Collapsed}" />

ViewModel
public class LoginViewModel : ViewModelBase
{
    private IDialogService dialogService;
    private INavigationService navigationService;

    private string _username;
    private string _password;

    private Visibility _progressVisibility = Visibility.Collapsed;

    /// <summary>
    /// User login name / email address
    /// </summary>
    public string Username
    {
        get
        {
            return _username;
        }
        set
        {
            Set(() => Username, ref _username, value);
        }
    }

    /// <summary>
    /// User password
    /// </summary>
    public string Password
    {
        get
        {
            return _password;
        }
        set
        {
            Set(() => Password, ref _password, value);
        }
    }

    /// <summary>
    /// Is loading in progress
    /// </summary>
    public Visibility ProgressVisibility
    {
        get
        {
            return _progressVisibility;
        }
        set
        {
            Set(() => ProgressVisibility, ref _progressVisibility, value);
        }
    }

    /// <summary>
    /// Perform login action
    /// </summary>
    public RelayCommand LoginCommand { get; private set; }

    /// <summary>
    /// constructor
    /// </summary>
    /// <param name="dialogService"></param>
    public LoginViewModel(IDialogService dialogService, INavigationService navigationService)
    {
        this.LoginCommand = new RelayCommand(this.Login, CanLogin);
        this.dialogService = dialogService;
        this.navigationService = navigationService;

    }

    public void Login()
    {
        this.ProgressVisibility = Visibility.Visible;

        //check the credentials have been provided
        if (this._username == null || this._password == null)
        {
            //show dialogue
            dialogService.ShowMessage("Please enter you login credentials", "Login");
        }
        else
        {

            //perform an authentication request with the service
            ValidateLoginRequest request = new ValidateLoginRequest();

            request.Device = new Device();
            request.UserName = this.Username;
            request.Password = this.Password;

            var response = Task.Run(() => LoginAsync(request)).GetAwaiter().GetResult();

            if (response != null)
            {
                if (response.IsSuccessful)
                {
                    navigationService.NavigateTo("Main");
                }
                else
                {

                    dialogService.ShowMessage(response.ErrorCode + " :" + response.ErrorMessage, "Login");
                }
            }
            else
            {
                //failure
                dialogService.ShowMessage("ECOM000: An unknown error has occurred", "Login");
            }
        }

    }

    async Task<ValidateLoginResponse> LoginAsync(ValidateLoginRequest request)
    {
        Model.RuntimeDataService proxy = new Model.RuntimeDataService();
        ValidateLoginResponse response = (ValidateLoginResponse)await proxy.PostAsync(request, typeof(ValidateLoginResponse), "ValidateLogin");
        return response;
    }

    public bool CanLogin()
    {
        return true;
    }
}

A: I solved this using Kotlin by adding my own CustomBindingAdapter:
@BindingAdapter("android:visibility")
fun setVisibility(view: View, visible: Boolean) {
view.visibility = if (visible) View.INVISIBLE else View.VISIBLE
}

Inside your view.xml:
First add data variable:
<data>
    <variable name="loginViewModel" type="yourpackage.viewmodel.LoginViewModel"/>
</data>

<ProgressBar
        android:id="@+id/login_progress_bar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:visibility="@{!loginViewModel.loginProgress}" />

Your Activity must have:
val binding = DataBindingUtil.setContentView<LoginViewBinding>(this, R.layout.login_view)
val loginViewModel = LoginViewModel(this)
binding.setLoginViewModel(loginViewModel)

At the end your ViewModel needs to handle the visibility:
    var loginProgress = ObservableField<Boolean>()
fun doSomething(){
        this.loginProgress.set(true)
}

And set loginProgress.set(false) wherever you need to stop the progressBar.
I hope this can help someone else ;)

A: You are creating a background Task and then causing the UI thread to wait for the response.
Try awaiting the Task returned from the LoginAsync method:
var response = await LoginAsync(request);

This should allow your UI thread to continue, with the rest of the method acting as a callback.
You will probably need to add the async keyword to the Login method.


text:
Q: Stuck in a logical problem. How do I loop through a json tree having unknown nested arrays? I have to build a graph kind of thing where I have a output of a json tree. This json tree will have multiple unknown levels of nested arrays. I am not able to iterate through these json arrays as I cannot build a 'for loop'.
How will be my logic here and how will my HTML code be?
I found a handful of duplicate questions which didnt answer properly OR I am still not developed enough to understand them.
This is the JSON Structure I am dealing with:
{
  "name": "TEST",
  "children": [
    {
      "title": "a",
      "description": "a",
      "children": [
        {
          "title": "b1",
          "description": "b1",
          "children": [
            {
              "title": "c1",
              "description": "c1",
              "children": [
                {
                  "title": "e1",
                  "description": "e1",
                  "children": []
                }
              ]
            },
            {
              "title": "d2",
              "description": "d2",
              "children": []
            }
          ]
        },
        {
          "title": "b2",
          "description": "b2",
          "children": []
        }
      ]
    }
  ]
}

The image shows expected output. Also I am trying to achive this in angular 7.

A: You will need to do this recursively.
The first thing you need to do is create a custom component where we will display your data in the template recursively. This component will check if there are any children present in the current iteration and if there are, it will call itself by passing in the children data.
Here is what the template in your recursive component will look like

            Title: {{detail.title}}

            Description: {{detail.description}}

        <test *ngIf="detail.children" [details]="detail.children"></test>

Then in your parent component, you simply call your recursive component passing in the initial data (which for you is data.children where data is the sample JSON in the OP).
Here is a working example on StackBlitz.

A: You should use recursive function for this.
HTML

TypeScript
I suggest two approaches to achieve this. you can use one of those.
1. Use for loop inside recursive function.
import { Component,ViewChild,ElementRef } from '@angular/core';

@Component({...})
export class AppComponent  {

    myObj = {...};
    @ViewChild('parent') d1:ElementRef;
    constructor() {}

    createArrayUsingFor() {
      let recursiveFn = (obj) => {

        for (let i = 0 ; i < obj.children.length; i++) {

          const html = `<div><p>${obj.children[i].title}</p><p>${obj.children[i].description}</p></div>`
          this.d1.nativeElement.insertAdjacentHTML('beforeend', html);

          if (obj.children[i].children.length > 0) {

            recursiveFn(obj.children[i]);
          }
        }
      }
      recursiveFn(this.myObj);
    }

    ngAfterViewInit() {
      this.createArrayUsingFor();
    }
}

2. Use map function inside recursive function.
import { Component,ViewChild,ElementRef } from '@angular/core';

@Component({...})
export class AppComponent  {

    myObj = {...};
    @ViewChild('parent') d1:ElementRef;
    constructor() {}

    createArrayUsingMap() {
      let recursiveFn = (obj) => {

        if (obj.title && obj.description) {
          const html = `<div><p>${obj.title}</p><p>${obj.description}</p></div>`
          this.d1.nativeElement.insertAdjacentHTML('beforeend', html);
        }

        obj.children.map(recursiveFn)
      }
      recursiveFn(this.myObj);
    }

    ngAfterViewInit() {
      this.createArrayUsingMap();
    }
}

Find Working StackBlitz Here.
Note: If you need nice html structure like the image in your question, you need to define a level for each object in your array(to each child of each children) and you need set styles according to that level. As an example set margin-left for each div according to that level.


text:
Q: C# Refresh DataGridView with another Form I have a problem with not being able to refresh my form that has a DataGridView.
I open a form called MaintenanceForm.
Here I will choose a car, give the amount of km, and the option to add products.
If I click on the add products button, this form will stay open while another will open as well called AddProducts. In this form I will choose from a list of products that I will add to my final listbox. If I click Save, these items will go to my BindingList and populate my grid.
I have tested this with closing my first form first and reopening it with my second form. The grid was populated.
How do I populate my grid without having to close my first form?
Here are the methods I'm using
Save button on my second form:
private void btnOpslaan_Click(object sender, EventArgs e)
{
    lstTotal = new BindingList<Product>();
    foreach (object product in listBtotal.Items)
    {
        lstTotal.Add((Product)product);

    }
    MaintenanceForm maintenanceForm = new MaintenanceForm();
    maintenanceForm.FillDataGridView(lstTotal);
    this.Close();
}

Method to populate my grid:
public void FillDataGridView(BindingList<Product> products)
{
    dGvProducts.DataSource = null;
    dGvProducts.AutoGenerateColumns = false;
    dGvProducts.AllowUserToAddRows = false;
    dGvProducts.DataSource = products;
    dGvProducts.Refresh();

}

Again the MaintenanceForm is still open while AddProductsForm is open?
Thanks in advance

A: Thanks to the user JDB i have fixed my problem.
Instead of making a new instance (Thank you Junaith for correcting me for it) I'm now making a LogicalParent method.
public AdminForm LogicalParent { get; set; }
With this i have access to al methods and functions of my parent Form and no problems with refreshing.


text:
Q: Azure Function fires multiple times for the same Blob storage event My Python Azure Function configuration file (function.json) defines a Blob storage trigger.
When the Azure Function wakes up (i.e. the server shown in Live Metrics becomes online after some sleeping time) it processes all the existing blobs regardless which ones have already generated trigger events.
I noticed that the azure-webjobs-hosts/blobreceipts folder is populated with sandboxhost637nnn folders. A new sandboxhost folder is created every Azure Function wake up event. This way the function forgets previously processed blobs (no old receipts found). In the past (Dec '19), I remember that a unique webjobs-hosts folder containing all receipts persisted across invocations.

A: To explain why this happens:
Irrespective of your environment , the blob trigger, by design, keeps track of new & updated blobs by maintaining blob receipts in azure-webjobs-hosts container. These receipts are correlated by their **eTags** to **host ID** of your Functions runtime.
When your function wakes up, it'll result in change of your **host ID and the eTag->host ID correlations** you previously had will no longer apply which then results in the new host re-processing all of your existing blobs -- the behavior you've observed.
The recommendation is to use Event Grid trigger instead or use the Azure app service base plan for your function app which will be costlier.
Additional reference:
https://github.com/Azure/azure-webjobs-sdk/issues/1327
Hope it helps.

A: I am not sure what happened to you. But this problem should not occured any more now.
This is an old problem. And the sdk has update.
BlobTriggers will be processed only once now, have a look of this:
https://azure.microsoft.com/zh-cn/blog/announcing-the-0-5-0-beta-preview-of-microsoft-azure-webjobs-sdk/
May be your problem is a new one. But you need to provide your logs and SDK you used. Then we can help you solve this. Let me know if you update later.


text:
Q: AIR Native Extension issue I built an AIR native extension with following setup:

*

*Visual studio 2005 for building my dll

*Flash CS6 IDE with AIR SDK 3.2 to create SWC from my AS3 source

*The namespace version of my ANE is 33.1

*ADT (AIR SDK 33.1)

I tested the ANE with FlashDevelop 5.3.3.1 and the ANE works as expected on a machine that I use for development. However, when I test the same ANE in FlashDevelop on a different machine, the AIR can't find a necessary method in the native side implementation (Error code #3500). I am using the same version of FlashDevelop with same AIR SDK (33.1) in both machines.
It seems that for some reason AIR could not load the dll in second machine (but does so in my development machine), and I am not sure why. Any help would be highly appreciated.
Thank you.

A: You are probably missing some of the dependency dlls, most likely part of the vc++ redistributable package or potentially .net if you are using any of that functionality.
Try to install the VC++ redist on your test machine:
https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0


text:
Q: logic only on href having certain text - jQuery I have several a tags on a dynamically generated web page and they are like this
Add

Cancel

several others like mentioned above. I need to execute some logic when link with text 'Add' is clicked. I know one of the way is to attach click event to a tags and then check for text.
$('a[href*="SWESubmitForm"]').click(function(){
if($(this).text() == "Add"){
//do something
}

but I am not sure if this is most efficient way to do this.
Can you guys please suggest the right way of doing this?

A: You could use filter for this.
As you posted in another answer that you wanted to know whether this is 'the right way' - I would say no. The right way would of course be to assign a class to each of these links then use a class selector to bind the click event to them. But I am assuming that you don't have too much control over the html.
That being said I would use filter as I have suggested below. This minimizes the number of events which are bound. If you want to make it even more efficient I would instead make use of delegate or on and bind to a common parent. This reduces the number of bound click events also.
http://jsfiddle.net/mrtsherman/Uypuq/
$('a[href*="SWESubmitForm"]').filter(function() {
    if ($(this).text() == "Add") {
        return true;
    }
}).click(function() {
    alert();
    return false;
});

A: Your code works but you have problems with brackets.I tested on jsfiddle
$('a[href*="SWESubmitForm"]').click(function(){
if($(this).text() == "Add"){
//do something
    alert('ok')}
});

A: If the link id is predictable and as shown in your HTML, you can just use this:
$('#s_9_1_35_1').click(function() {
    // put your code here
});

If you control the HTML, you can either put an appropriate ID or class on the desired links and just use selectors off those.  That is much more efficient than trying to filter all links based on their text.


text:
Q: How to mine information from a game with no API I want to gather information from a game called Tera. It's an MMO and I'd like to gather prices on specific items in the broker on a daily basis. I'm wondering how people build programs that mine data from games that don't have an API.
There are many websites that mine data from a game called League of Legends. These sites include:
http://www.lolking.net
http://www.lolnexus.com
http://www.elophant.com
And league of legends does not have an api in place. How do these websites accomplish this? Can someone link a tutorial or a guide or sample code?

A: At the time, there was no public API for League of Legends and these sites were getting information by scraping the RTMP API used by the client. However, there is now a public API for League of Legends: https://developer.riotgames.com


text:
Q: Assign values to points according to a pattern I'm making a map of trees in QGIS (3.10). Each point represents a tree and the attribute table has a column that should contain the tree species. For now this column is empty, but I would like to fill this column. The trees are planted in a pattern, for example cashew tree - baobab tree - banana tree.
How can I assign the tree species to the table according to the pattern? So every first tree is a cashew, every second tree is a baobab and every 3rd tree is a banana. The fid of the table is in the right order, so I could build an expression with fid+0 = cashew, fid+1 = baobab and fid+2 is banana. Would that be possible?

A: If you data is as organised as you say, creating the "tree column" with following expression for the field calculator should work:
CASE
WHEN $id%3=0 THEN 'Cashew'
WHEN $id%3=1 THEN 'Baobab'
ELSE 'Banana'
END

Short explanation: This checks whether the feature's ID is divisible by 3, and if not, what rest (% is the modulo-operator) is left, then assigns the fitting tree-type. As ID starts with 0, Cashew is assigned to all IDs with no rest.

A: Open the field calculator, select the function editor and make the content look like:
from qgis.core import *
from qgis.gui import *

@qgsfunction(args='auto', group='Custom')
def tree(value1, feature, parent):
   trees=['Cashew','Baobab','Banana']
   idx=value1%(len(trees)-1)
   return(trees[idx])

Press "Save and load functions" then in the Expression tab, type
tree(fid)

If you want the easiest possible solutiuon, look at Erik's below, but it is less flexible if you want to add more types.