text:
Q: Tmux Stack based behaviour (like dwm) Hi I use tmux at work on Windows Subsystem for Linux and have it set up to behave like a
stack based tiling window manager. i.e the main window is the leftmost vertical one, the first
new window I open does a vertical split pane, and each subsequent window I open is a horizontal
split in the 2nd vertical pane.
Here is my tmux.conf:
## Unbind some default keys
unbind-key C-b

## Set tmux options
# Replace with Ctrl+Space
set-option -g prefix C-Space
set-option -g default-command bash
# This fixes the weird prompt issue
set -g default-terminal "xterm-256color"

## Custom Keybinds
# C-j moves to next pane, C-k moves to prev pane
bind-key -n C-j select-pane -t :.+
bind-key -n C-k select-pane -t :.-
# TODO: Set h and l to increase and decrease length of pane
bind-key -n C-h resize-pane -L 5
bind-key -n C-l resize-pane -R 5
bind-key -n C-n split-window -b
# Swap current pane with currently active pane
bind-key -n C-s swap-pane -s "$TMUX_PANE" -t 0

## TO SHOW ALL TMUX KEYBINDS
# tmux list-keys

I also remote in a red hat linux machine, however when I use this tmux.conf on the linux
machine every new window is a vertical split.
Does anyone have any idea why this discrepancy exists and/or how I could remedy it?
(Note: I am using the tmux.deb from the official repos on the WSL machine, while I am using the latest appimage provided on the tmux/tmux github on the red hat linux server).


text:
Q: Why cant I change the text on this theme? I am a noob at website creation, and I have only recently begun to use wordpress. I looked at a bunch of demos online and they have helped, but I a seemingly simple problem.
My problem is that I am using the (free) theme from here and I cannot for the life of me figure out how to change the text inside that blue image. I want to remove "A bold big slider" and the sentence underneath it. But how do I do that?? Its becoming frustrating.
Thanks for any help.

A: Looking through the docs reveals that you can either disable that slider all together, or add your own slides in it which will replace the default text that you see now.
To add your own slides, use the instructions here: http://siteorigin.com/pitch-documentation/content/home-page-slider/
To disable the slider you should probably hunt for the option. I'm guessing that it's under Appearance > Theme Settings: http://siteorigin.com/pitch-documentation/theme-settings/

redpajama_set_name: RedPajamaStackExchange


text:
Q: Getting no data for sending a POST request with JSONArray using volley I'm trying to send a data using POST method and get a JSONArray array but i'm getting no data from the server, when i test my php file with specific value then it's ok but when I use POST method for send the key then not giving any data.
here is my JSONArray Request:
final JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Request.Method.POST, jsonURL, (String) null,
            new Response.Listener<JSONArray>() {
                @Override
                public void onResponse(JSONArray response) {
                    int count = 0;
                    while (count < response.length()){
                        try {
                            JSONObject jsonObject = response.getJSONObject(count);
                            DataProvider dataProvider = new DataProvider(jsonObject.getString("Name"),
                                    jsonObject.getString("Url"),

                            arrayList.add(dataProvider);
                            count++;

                        } catch (JSONException e) {

                            Toast.makeText(context,"Error",Toast.LENGTH_SHORT).show();
                            e.printStackTrace();
                        }
                    }
                    CarFragment.adapter.notifyDataSetChanged();
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {

        }
    }
    ){
        @Override
        protected Map<String, String> getParams() throws AuthFailureError {

            Map<String,String> param = new HashMap<String,String>();
            param.put("id","01675904620");
            return param;
        }
    };
    Singletone.getSingletone(context).addToRequest(jsonArrayRequest);

and here is my php code:
<?php

$user_id = $_POST["id"];

$db_name = "andr";
$user_name = "user";
$password = "12345";
$server = "localhost";

$con = mysqli_connect($server,$user_name,$password,$db_name);

$result = mysqli_query($con, "SELECT * FROM user WHERE user_id = ".$user_id.";") or die("Error: " . mysqli_error($con));

$response = array();

while($row = mysqli_fetch_array($result))
{
    array_push($response, array("Name"=>$row["name"],"Url"=>$row["image_url"]));
}

echo json_encode($response);

?>

A: This is how you send data to server using volley
StringRequest stringRequest = new StringRequest(Request.Method.POST, REGISTER_URL,
            new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                    Toast.makeText(MainActivity.this,response,Toast.LENGTH_LONG).show();
                }
            },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    Toast.makeText(MainActivity.this,error.toString(),Toast.LENGTH_LONG).show();
                }
            }){
        @Override
        protected Map<String,String> getParams(){
            Map<String,String> params = new HashMap<String, String>();
            params.put("ID","1234");
            return params;
        }

    };

    RequestQueue requestQueue = Volley.newRequestQueue(this);
    requestQueue.add(stringRequest);

Above you can see that once you post id to server ,the server will send its response to your app , and it will be available here String response.
you can further process this response and fetch whatever you want.
JSONObject jsonObject=null;
    try {
        jsonObject = new JSONObject(json);//json is the response you get from server
        users = jsonObject.getJSONArray(JSON_ARRAY);//JSON_ARRAY is the name of your array

        ids = new String[users.length()];

        for(int i=0;i<users.length();i++){
            JSONObject jo = users.getJSONObject(i);
            ids[i] = jo.getString("ID");

        }
    } catch (JSONException e) {
        e.printStackTrace();
    }

For more refrences:
https://www.simplifiedcoding.net/android-volley-tutorial-to-get-json-from-server/
https://www.simplifiedcoding.net/android-volley-post-request-tutorial/
Thanks....Happie Coding


text:
Q: Equivalent of layer.redraw(true) in OpenLayers 3? I have a geojson layer in my OL3 app which I want to redraw every 5 seconds (to show movement on map) .
How do I do it ? Couldn't find the equivalent of Layer.redraw().

A: I know that this question is old but i've finally found a solution to refresh a layer on openlayers 3.
You have to update params of the layer source like this:
var source = yourLayer.getSource();
var params = source.getParams();
params.t = new Date().getMilliseconds();
source.updateParams(params);

A: You can refresh a WFS layer with myLayer.getSource().clear().

A: You can use the changed method for layers to indicate a change and let OL repaint it:
layer.changed();

A: With OL2 I used a layer refresh strategy which hasn't been added to OL3. Below is a self calling function that will use an ajax request to fetch the GeoJSON and then read it and add it to a source.
var yourSource = new ol.source.GeoJSON();

//add this source to a layer, the layer to a map with a view etc
...

//now fetch the data
var fetchData = function () {
    jQuery.ajax(url,
    {
        dataType: 'json',
        success: function (data, textStatus, jqXHR) {
            yourSource.clear(); //remove existing features
            yourSource.addFeatures(yourSource.readFeatures(data));
        },
        error: function (jqXHR, textStatus, errorThrown) {
            console.log(errorThrown);
        }
    });

    //call this again in 5 seconds time
    updateTimer = setTimeout(function () {
        fetchData();
    }, 5000);
};
fetchData(); //must actually call the function!

Hope this helps.

A: This is how you can refresh a vector source every 5 seconds, from a web service returning features in a GeoJSON document:
var vectorSource = new ol.source.Vector();
var geojsonFormat = new ol.format.GeoJSON();

window.setTimeout(function() {
  $.ajax('http://example.com/data.json', function(data) {
    var features = geojsonFormat.readFeatures(data
        {featureProjection:"EPSG:3857"});
    geojsonSource.clear();
    geojsonSource.addFeatures(features);
  });
}, 5000);

jQuery is used here for requesting the data through Ajax ($.ajax), but you can obviously use the library of your choice.
This code snippet also assumes that the map's projections is "EPSG:3857" (web mercator) and that the coordinates in the GeoJSON documents are longitudes and latitudes.

A: There is no need to refresh explicitly.
Each time you update the content of a layer the map is refreshed requesting a new frame rendering.
To force rendering manually you have map.render() and map.renderSync()methods.

A: I don't know if in OpenLayer 3 this works, but in actual version (OL6) I use a simple
layer.setStyle(layer.getStyle())


text:
Q: make test a feature is available or not return error make -v return:
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

In a directory, one one file: makefile
ifneq ($(jobserver),T)
$(error This makefile only works with a Make program that supports $$(eval))
endif

invoke make by type make
makefile:2: *** This makefile only works with a Make program that supports $(eval).  Stop.

even I try
ifneq ($(eval),T)
$(error This makefile only works with a Make program that supports $$(eval))
endif

still return
makefile:2: *** This makefile only works with a Make program that supports $(eval).  Stop.

I follow the tutorial from online, these makefile test a feature/function in make is available or not. It should not yield error.

A: You're missing the use of eval which sets the variable before the test:
$(eval eval_available := T)
ifneq ($(eval_available),T)
$(error This makefile only works with a Make program that supports $$(eval))
endif

If eval is available, the first line will set eval_available to T; if it isn't, it won't. The second line checks whether eval_available was set to T.


text:
Q: Strict typing issue with generic types in typescript I am trying to learn strict typing in Typescript.
I defined these classes:
 export abstract class MyAbstractClass<TParam extends MyParamBaseType> {
  private param: TParam;

  setInitParams(init: TParam): void {
   ...
  }

  getInitParams(): TParam {
   ....
  }
}

export class MyClass extends MyAbstractClass<AParamType> {
 private param: AParamType;

 ...
}

The problem is that I get the error " Class 'MyClass' incorrectly extends base class 'MyAbstractClass'.
Types have separate declarations of a private property 'param'."
I don't understand why I get this error because AParamType type correctly extends MyParamBaseType
Can somebody helps me ? Thanks for your help.

A: The private keyword is just a compile time checked. This means that the field param will be stored at runtime in the instance of the class. MyAbstractClass  declares it's member private, so if MyClass were allowed to redeclare the param field it would end up accessing the same field named param in the instance at runtime breaking privacy.
You can use the ES private class fields (with #). These ensure hard privacy even at runtime and name collisions in the sub class are not an issue since each declared field is distinct even if they share the same name:
type MyParamBaseType = {}
export abstract class MyAbstractClass<TParam extends MyParamBaseType> {
  #param!: TParam;

  setInitParams(init: TParam): void {

  }

  getInitParams(): TParam {
    return this.#param;
  }
}

type AParamType = {}
export class MyClass extends MyAbstractClass<AParamType> {
  #param!: AParamType;

}

Playground Link
Or if you want to access the same field from the base class you might consider protected instead:
 type MyParamBaseType = {}
 export abstract class MyAbstractClass<TParam extends MyParamBaseType> {
  protected param!: TParam;

  setInitParams(init: TParam): void {

  }

  getInitParams(): TParam {
    return this.param
  }
}

type AParamType = {}
export class MyClass extends MyAbstractClass<AParamType> {
 protected param!: AParamType;

}

Playground Link


text:
Q: How to send body data within a redirect using Spring Security AuthenticationFailureHandler? I would like to provide detailed information about a failed login attempt.
Thymleaf shall display regarding information as well as prefill the login form with already given values like email or username. I don't want to send these information as url parameters. From my understanding I need a POST request to the login url.
How can I achieve this using an AuthenticationFailureHandler, and is this even doable without implementing the login process completely manually?
At the moment, all I have is this:
public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler {

    private final RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();

    @Override
    public void onAuthenticationFailure(
            HttpServletRequest request,
            HttpServletResponse response,
            AuthenticationException exception) throws IOException {

        String email = request.getParameter("email");
        String password = request.getParameter("password");

        /* How to make the response POST including data for Thymeleaf? */

        redirectStrategy.sendRedirect(request, response, "/login");
    }
}

Many thanks for any information


text:
Q: Sitecore item DisplayName is valid used as a page title We are working on Sitecore application. There is our vendor team is using sitecore item DisplayName as a page title. As per my knowledge this is wrong approach. But i need your help please give me a strong reason i can prove this approach is wrong.
If this is right way then please suggest that also.
Thanks in advance.

A: There is nothing inherently 'wrong' in using the Display Name of an item for a page title. As @Piotr Wicijowski mentions, it is better than using the item name. The Display Name can also be used for different languages, unlike the item name.
However, there are a few issues (in addition to Piotr's post) with using Display Name as the page title:

*

*No personalization. A separate datasource would be needed on the component in order to support personalization of the page title. It is very uncommon to personalize the page title, however, so this is not a big issue.

*Impacts Content Editor. The Content Editor interface will show the display name in the hierarchy of the content tree. This can be helpful that the user will see a page title in the content tree, but sometimes page titles can be quite long and you may want a shorter name in the content tree.

*Impacts Multilingual URLs. In order to support different URLs in different languages, I have always enabled the links to be generated using display name and then provide the proper link value in the display name. A link is not always the text you want to display as the page title.

On the flip side, there are some benefits to using the Display Name:

*

*Easy for content editors to find (ribbon button already there in content editor)

*Shows up in the Content Editor for easy seeing of page titles

*No template customization of Sitecore required to add new fields

*Less code required to model custom fields

A: As opposed to using item Name (which has a lot of restrictions, like disallowed characters and not being able to have different values per language), using DisplayName for page title can, in fact, be a good choice, for the following reasons:

*

*It can be any UTF8 string, which helps with internationalization of the site

*It can have different values per language.

*DisplayName can be used for url->item resolutions, which would result in having your title as a part of the url. This is beneficial both for SEO and for user-friendliness of your urls.

The only possible downside is the fact that DisplayName field is unversioned, which means that you won't be able to have different values per item version.

A: I agree that there is nothing wrong technically but I don't think its the correct approach.
Display Name field is for all the sitecore items and I believe the mainly purpose is to show in the content editor tree.
I'd suggest that is a good practice that all your page templates inherit from base templates/interfaces where you have the page related fields like Page Title, Navigation Link Title etc.


text:
Q: Does SQL Server 2000 MSDE have DTS? We are currently evaluation our hosting options and the cheapest suitable option we've found only has SQL Server 2000 MSDE as the database server.
Does this version have DTS?

A: SQL Server 2000 MSDE does have it; however, SQL Server 2005 Express does not have SSIS which is a replacement for DTS.
MSDN Article

A: It supports running them but not developing them. Here's an article from Microsoft that discusses it.
MSDN Article

A: You can run DTS packages on SQL Server 2000 MSDE, but you'll need to create them on a full copy of SQL Server and copy them across.  Run them using DTSrun.exe
I've used MSDE on several occasions under similar circumstances.  It's quite sufficient for small to medium sized websites but if you have anything of complexity then a full version of SQL Server is to be recommended. You'll most likely need an additional tool too to set up scheduled jobs Lazy Coding's SQLScheduler is a good solution.


text:
Q: Actualizar el prefijo de un campo Necesito cambiar el prefijo de un campo por otro para todos los registros anteriores a una fecha.
UPDATE tabla
SET campo1 LIKE 'YYYYYYY%';
WHERE (campo1 LIKE 'XXXXXXXXXXXXX%' AND FECHA<DATE('2017-04-05'));

Aparece el siguiente informe de error:
Error SQL: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: LIKE;D
SET ACT_GEOGRAFIA;=

¿Cómo sería la consulta correcta?

A: No puedes usar LIKE en la parte del SET de la query.
Puedes intentar utilizando REPLACE, función disponible en DB2:
UPDATE tabla
SET campo1 = REPLACE(campo1, 'XXXXXXXXXXXXX', 'YYYYYYY');
WHERE (campo1 LIKE 'XXXXXXXXXXXXX%' AND FECHA<DATE('2017-04-05'));


text:
Q: Why should I install Ubuntu on a not so new computer? I'm currently reading "The Linux Command" and there is written:

Install Linux on a (not so new) computer. It doesn't matter which distribution you choose, though most people today start out with either Ubuntu, Fedora, or OpenSUSE. If in doubt, try Ubuntu first. Installing a modern Linux distribution can be ridiculously easy or ridiculously difficult depending on your hardware. I suggest a desktop computer that is a couple of years old and has at least 256 megabytes of RAM and 6 gigabytes of free hard disk space. Avoid laptops and wireless networks if at all possible, as these are often more difficult to get working.

Why shouldn't I install it on a new computer?
My system's specifications:

*

*AMD FX-6300 6x3.5GHz CPU

*8GB Memory @ 1600 MHz

*GeForce GTX 960 2GB GDDR5

*2TB HDD

Can I still install it?

A: You should install it on a newer computer, if you can! That said, it's fine to install Linux on an older computer if you want.
It is unlikely that anything will go really wrong if you do install it. However, bear this in mind:

*

*Toshiba heat management isn't very well supported (I don't know how good kernel 4.0 is yet, I haven't updated my toshiba recently)

*Ubuntu may not be as fast as the latest Windows is (Windows 10 is pretty good)

*Not all hardware is compatible.

*It might be worthwhile to dual boot, so you still have Windows if you ever need it.

A: You should not install Ubuntu on a not so new computer, you should rather install it on a supported computer.
The problem is that sometimes the two things coincide.
That's because most hardware manufacturers either don't ship any driver for Linux or they ship them as proprietary.
Ubuntu distributions, per Ubuntu's philosophy, don't include any proprietary driver, plus to provide the hardware support is all on Canonical.
For those two things, it might happen that even the latest distribution could, upon installation, lack the support for some hardware.
But that again doesn't mean that you should install it on a not so new computer, rather just that, if you're buying a new computer for Ubuntu, you'll want to pay attenction on whether the hardware is supported or not.
If you're buying a new computer, here is the list of the officially supported desktops and laptops, but you can install Ubuntu on whatever desktop / laptop you want, it's just for your own ease that you'll want to choose one that is fully supported and that you might want to choose one that is fully supported out-of-the-box (even outside of that list of course).

A: Why shouldn't I install it on a new computer?
You should, actually. The article suggests Ubuntu since it's much gentle for the beginners (although this is a subjective, but was true for me).
Your machine has sufficient RAM and nice CPU. Feel free to install it; Unity, which is default desktop, should run alright with your graphics card, but if you have any issues, there's plenty of other choices

A: you can install Ubuntu Linux as long as

*

*the computer has the minimum specification for the distribution

*the machine's warranty is not invalidated and

*your machine is not corporate and being administered by an IT department
New or old - it doesn't matter - as long as you do not try to install a 64 bit version on a 32 bit (older) machine.  As has already been mentioned, laptops - especially older ones, can be tricky to set up with WIFI - but with a bit of determination, they can be made to work with NDISWRAPPER. If your machine does not have enough resources to run Ubuntu, there are some lightweight Ubuntu variants such as Lubuntu which are intended for older machines with less processing/memory.
It is possible to buy a new machine online to a custom specification where you can specify no Windows. In not buying Windows with the machine, you can save money here!   When I did this, the manufacturer put a 30 day free trial version of Windows on the machine.  The first thing I did on boot up was to install Ubuntu on the machine using the opportunity remove the pre-installed Windows OS.

A: I don't think it matters whether you install Ubuntu on new computer or old one.
My suggestion is you try to do this.

*

*Get your hands on any computer (supported or not supported, windows or without windows, laptop or desktop or supercomputer, it doesn't really matter)

*Try Ubuntu(or any Linux OS of your choice) in live run and see if everything works properly.

*If everything is fine, install Ubuntu and see if the speed with which it works is acceptable to you.

*If it is acceptable, go with it. If not, try another distro. If it doesn't work even after trying a few distros, then go with windows)


text:
Q: Reading the log when the service is running (Ansible) There is a service that performs an update of our system, the execution status can only be viewed in the log or in the service status. The problem is that the execution process takes time, and it will not be possible to just read a static log. How to use Ansible to read a dynamic log before the "Update success" line appears

A: Regarding

How to use Ansible to read a dynamic log before the "Update success" line appears?

the following approach of Retrying a task until a condition is met and Return Values might work for you.
---
- hosts: test
  become: false
  gather_facts: false

  tasks:

  - name: Check for success
    shell:
      cmd: grep 'Update success' /home/{{ ansible_user }}/service.log
    register: result
    retries: 5
    delay: 5
    until: result.rc == 0

Since grep has a return code of 0 if it find the pattern and a return code of 1 if not, resulting into an output of
PLAY [test] ******************************************
FAILED - RETRYING: Check for success (5 retries left).
FAILED - RETRYING: Check for success (4 retries left).
FAILED - RETRYING: Check for success (3 retries left).

TASK [Check for success] *****************************
changed: [test.example.com]

after writing echo "Update success" >> service.log on the test host.
Further Q&A

*

*Ansible - Retry task until a file contains a log line

*How to retry Ansible task that may fail?


text:
Q: Get last months data divided in weeks in Laravel Fellow coders,
I'm trying to get the data from last month divided in weeks from the database, I have heard about Carbon but I have no idea on how implement carbon in my actual data.
Does anyone have an idea on how to do this?
I currently have
$currentDate = Carbon::now()->subWeek();
$agoDate = $currentDate->subDays($currentDate->dayOfWeek)->subWeek();

Which does return the useful date info. But I would love to see how it's executed with some dummy data


text:
Q: counting: How many functions are there from the set $ \{1,2,...,n\} $where $n$ is a positive integer, to the set $\{0,1\}$ what does he mean? I didn't get the question, does he mean any function that its domain is subset of the first set and the codomain is subset of the other?
for example for $n=2$
$$f : \phi \rightarrow \phi$$
$$f : \{1\} \rightarrow \{1\}$$
$$f : \{1, 2\} \rightarrow \{1\}$$
and so on?

A: The punchline at the end of the day is that the set of functions from a set $A$ to a set $B$ is often given the convenient notation of $B^A$.  It is a convenient notation because we then have the result:
$$|B^A|=|B|^{|A|}$$
This is proven for example by the Rule of Product.  For the first element of $A$ pick which element of $B$ it gets mapped to.  Then for the second element of $A$ again pick which element of $B$ it gets mapped to, repeating the process until having chosen where each element of $A$ gets mapped and combining the results together via multiplication.
Here, $$|\{0,1\}^{\{1,2,\dots,n\}}| = |\{0,1\}|^{|\{1,2,\dots,n\}|} = 2^n$$


text:
Q: Is there eot font editor? Is there an editor for eot fonts? Known editors like font forge and font creator and font lab doesn't support eot font type.

A: Nope, but you can do an .eot->.ttf and edit from there. There have been many failed attempts to reverse engineer .eot, such as Reverse Engineering the Embedded OpenType Decompression. However, this one works and I've used it to save an .eot to a .ttf: Rhymes with Amharic #4. During the save process, you can edit a number of meta-properties as well.


text:
Q: Unable to center align Column Widgets children I want to align the children widgets of my Column to the center of the cross axis.
I tried to do this using the crossAxisAlignment property of Column however its not working. How can i fix this?
 @override Widget build(BuildContext context) {

    Container buttonView = Container(
          padding: EdgeInsets.only(top: 30.0, left: 35.0, right: 35.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,

            children: <Widget>[

          DropdownButton<String>(
           ...
            ),
              SizedBox(height: 20.0),
              DropdownButton<String>(
         ...
        ],
      ));

    return Scaffold(

      body: buttonView,
    );
  }

A: you should try mainAxisAlignment: MainAxisAlignment.center, below is snap,
    @override Widget build(BuildContext context) {

  Container buttonView = Container(
      padding: EdgeInsets.only(top: 30.0, left: 35.0, right: 35.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,  // <---- try this property

        children: <Widget>[

      DropdownButton<String>(
       ...
        ),
          SizedBox(height: 20.0),
          DropdownButton<String>(
     ...
    ],
  ));

return Scaffold(

  body: buttonView,
  );
}


text:
Q: What happened to Jonny Quest's mother? The Jonny Quest franchise has been around for over 50 years. In most versions, Dr. Benton Quest is a widower, effectively being Jonny and Haji's legal guardian, while Race Bannon takes a more active part in the protecting and raising. In some versions, Race's daughter Jessie, of similar age to Johnny and the slightly older Haji, is also there.
We know Mrs. Quest is dead (adding to the "missing mom" trope), and I think  Jessie's mom may just be divorced from Race, but we never find out what happened specifically to either of these women... at least, I have no memories of those episodes.
I know there have been comic books and other media, so I was wondering, has anything been mentioned specifically as to how Mrs. Quest died, what her first name was, and what, if anything, happened to Jessie's mom?


text:
Q: How to create a variable based on another variable I am learning xsl and I have some questions about variables. If I have a variable

These would load the $Rows variable with some rows based on the conditions... However I would like to create a new variable from $Rows called $newRows just with rows where column @States are equal to "Florida."
Is that possible and how should I do that.
I thought about creating a variable and populate it using a for-each loop like:

Is this possible and if is how can I populate the values into the new variable.
Thank you

A: As long as the condition can be expressed as an XPath predicate I suggest to simply use <xsl:variable name="filteredRows" select="$Rows[@States = 'Florida']"/>.


text:
Q: Not enabling verbose kernel output causes windbg to not print my dbgprints in my kernel driver? The problem with turning on verbose kernel output on debugview is that it prints loads of garbage when i attach my windbg to the system, like its too much noise.
and if i don't turn it on, my debug messages don't get printed in windows 7+ (unlike older systems where there is no such thing as verbose output)
what should i do?
by garbage i mean stuff like this gets printed in windbg a LOT (from SXS.DLL) :
SXS.DLL: Read 896 bytes from XML stream; HRESULT returned = 0x00000000
   00000000: 3c-3f-78-6d-6c-20-76-65-72-73-69-6f-6e-3d-22-31 (<?xml version="1)
   00000010: 2e-30-22-20-65-6e-63-6f-64-69-6e-67-3d-22-55-54 (.0" encoding="UT)
   00000020: 46-2d-38-22-20-73-74-61-6e-64-61-6c-6f-6e-65-3d (F-8" standalone=)
   00000030: 22-79-65-73-22-3f-3e-0d-0a-3c-21-2d-2d-20-43-6f ("yes"?>..<!-- Co)
   00000040: 70-79-72-69-67-68-74-20-28-63-29-20-4d-69-63-72 (pyright (c) Micr)
   00000050: 6f-73-6f-66-74-20-43-6f-72-70-6f-72-61-74-69-6f (osoft Corporatio)
   00000060: 6e-20-2d-2d-3e-0d-0a-3c-61-73-73-65-6d-62-6c-79 (n -->..<assembly)
   00000070: 20-78-6d-6c-6e-73-3d-22-75-72-6e-3a-73-63-68-65 ( xmlns="urn:sche)
   00000080: 6d-61-73-2d-6d-69-63-72-6f-73-6f-66-74-2d-63-6f (mas-microsoft-co)
   00000090: 6d-3a-61-73-6d-2e-76-31-22-20-6d-61-6e-69-66-65 (m:asm.v1" manife)
   000000a0: 73-74-56-65-72-73-69-6f-6e-3d-22-31-2e-30-22-3e (stVersion="1.0">)
   000000b0: 0d-0a-3c-61-73-73-65-6d-62-6c-79-49-64-65-6e-74 (..<assemblyIdent)
   000000c0: 69-74-79-0d-0a-20-20-20-20-76-65-72-73-69-6f-6e (ity..    version)
   000000d0: 3d-22-35-2e-31-2e-30-2e-30-22-0d-0a-20-20-20-20 (="5.1.0.0"..    )
   000000e0: 70-72-6f-63-65-73-73-6f-72-41-72-63-68-69-74-65 (processorArchite)
   000000f0: 63-74-75-72-65-3d-22-78-38-36-22-0d-0a-20-20-20 (cture="x86"..   )
   00000100: 20-6e-61-6d-65-3d-22-4d-69-63-72-6f-73-6f-66-74 ( name="Microsoft)
   00000110: 2e-57-69-6e-64-6f-77-73-2e-46-69-6c-65-53-79-73 (.Windows.FileSys)
   00000120: 74-65-6d-2e-43-4d-44-22-0d-0a-20-20-20-20-74-79 (tem.CMD"..    ty)
   00000130: 70-65-3d-22-77-69-6e-33-32-22-0d-0a-2f-3e-0d-0a (pe="win32"../>..)
   00000140: 3c-64-65-73-63-72-69-70-74-69-6f-6e-3e-57-69-6e (<description>Win)
   00000150: 64-6f-77-73-20-43-6f-6d-6d-61-6e-64-20-50-72-6f (dows Command Pro)
   00000160: 63-65-73-73-6f-72-3c-2f-64-65-73-63-72-69-70-74 (cessor</descript)
   00000170: 69-6f-6e-3e-0d-0a-0d-0a-3c-74-72-75-73-74-49-6e (ion>....<trustIn)
   00000180: 66-6f-20-78-6d-6c-6e-73-3d-22-75-72-6e-3a-73-63 (fo xmlns="urn:sc)
   00000190: 68-65-6d-61-73-2d-6d-69-63-72-6f-73-6f-66-74-2d (hemas-microsoft-)
   000001a0: 63-6f-6d-3a-61-73-6d-2e-76-33-22-3e-0d-0a-20-20 (com:asm.v3">..  )
   000001b0: 20-20-3c-73-65-63-75-72-69-74-79-3e-0d-0a-20-20 (  <security>..  )
   000001c0: 20-20-20-20-20-20-3c-72-65-71-75-65-73-74-65-64 (      <requested)
   000001d0: 50-72-69-76-69-6c-65-67-65-73-3e-0d-0a-20-20-20 (Privileges>..   )
   000001e0: 20-20-20-20-20-20-20-20-20-3c-72-65-71-75-65-73 (         <reques)
   000001f0: 74-65-64-45-78-65-63-75-74-69-6f-6e-4c-65-76-65 (tedExecutionLeve)
   00000200: 6c-0d-0a-20-20-20-20-20-20-20-20-20-20-20-20-20 (l..             )
   00000210: 20-20-20-6c-65-76-65-6c-3d-22-61-73-49-6e-76-6f (   level="asInvo)
   00000220: 6b-65-72-22-0d-0a-20-20-20-20-20-20-20-20-20-20 (ker"..          )
   00000230: 20-20-20-20-20-20-75-69-41-63-63-65-73-73-3d-22 (      uiAccess=")
   00000240: 66-61-6c-73-65-22-0d-0a-20-20-20-20-20-20-20-20 (false"..        )
   00000250: 20-20-20-20-2f-3e-0d-0a-20-20-20-20-20-20-20-20 (    />..        )
   00000260: 3c-2f-72-65-71-75-65-73-74-65-64-50-72-69-76-69 (</requestedPrivi)
   00000270: 6c-65-67-65-73-3e-0d-0a-20-20-20-20-3c-2f-73-65 (leges>..    </se)
   00000280: 63-75-72-69-74-79-3e-0d-0a-3c-2f-74-72-75-73-74 (curity>..</trust)
   00000290: 49-6e-66-6f-3e-0d-0a-3c-61-70-70-6c-69-63-61-74 (Info>..<applicat)
   000002a0: 69-6f-6e-20-20-78-6d-6c-6e-73-3d-22-75-72-6e-3a (ion  xmlns="urn:)
   000002b0: 73-63-68-65-6d-61-73-2d-6d-69-63-72-6f-73-6f-66 (schemas-microsof)
   000002c0: 74-2d-63-6f-6d-3a-61-73-6d-2e-76-33-22-3e-0d-0a (t-com:asm.v3">..)
   000002d0: 20-20-20-20-3c-77-69-6e-64-6f-77-73-53-65-74-74 (    <windowsSett)
   000002e0: 69-6e-67-73-3e-0d-0a-20-20-20-20-20-20-20-20-3c (ings>..        <)
   000002f0: 64-70-69-41-77-61-72-65-20-20-78-6d-6c-6e-73-3d (dpiAware  xmlns=)
   00000300: 22-68-74-74-70-3a-2f-2f-73-63-68-65-6d-61-73-2e ("http://schemas.)
   00000310: 6d-69-63-72-6f-73-6f-66-74-2e-63-6f-6d-2f-53-4d (microsoft.com/SM)
   00000320: 49-2f-32-30-30-35-2f-57-69-6e-64-6f-77-73-53-65 (I/2005/WindowsSe)
   00000330: 74-74-69-6e-67-73-22-3e-74-72-75-65-3c-2f-64-70 (ttings">true</dp)
   00000340: 69-41-77-61-72-65-3e-0d-0a-20-20-20-20-3c-2f-77 (iAware>..    </w)
   00000350: 69-6e-64-6f-77-73-53-65-74-74-69-6e-67-73-3e-0d (indowsSettings>.)
   00000360: 0a-3c-2f-61-70-70-6c-69-63-61-74-69-6f-6e-3e-0d (.</application>.)
   00000370: 0a-3c-2f-61-73-73-65-6d-62-6c-79-3e-0d-0a-0d-0a (.</assembly>....)

A: try .ofilter in windbg to filter only your programs dbgprints
or try .ocommand tosend a specialized dbg prints


text:
Q: How to edit a *nix system file using Ruby's File.open command? In my CMS (Rails 4), I need to let a user make CRUD processes on CIFS mount points. In order to have a permanent CIFS mount on a CentOS (6) system, I need to edit the /etc/fstab file and update the mount list with the sudo mount -a command. When I try to open /etc/fstab file with File.open:
File.open("/etc/fstab", "a") do |f|
  f.puts "\n test"
end

I get this error:
Errno::EACCES: Permission denied - /etc/fstab

It's normal because /etc/fstab file belongs to the root user. Is there a way to open a file as super user? At the other hand, I'm open to different ideas. My requirement is to edit the fstab file from inside of my application.

A: See this answer in the ruby forum:

Start your script using
sudo ruby myscript.rb

You can't gain root privileges mid-script, short of
system("sudo ruby anotherscript.rb")

A: This one is tricky but you could add your Web user to the sudoers list and submit the sudo password when trying to edit the file. Make sure your connection is secured via https


text:
Q: Why illegal forward reference error not shown while using static variable with class name In the below code while accessing a static variable with class name it doesn't throw a forward reference error but accessing it without class name does.
Why this doesn't happen when accessing with class name?
class Test{
    static {
        System.out.println(a); // shows error
        a = 99; // and this line too doesn't give error
        System.out.println(Test.a); // this line doesn't
    }
    static int a = 10;
    static{
        System.out.println(a);
    }
}

A: The rules for forward reference is defined in JLS §8.3.3:

Use of class variables whose declarations appear textually after the
  use is sometimes restricted, even though these class variables are in
  scope (§6.3). Specifically, it is a compile-time error if all of the
  following are true:

*

*The declaration of a class variable in a class or interface C appears
  textually after a use of the class variable;

*The use is a simple name in either a class variable initializer of C
  or a static initializer of C;

*The use is not on the left hand side of an assignment;

*C is the innermost class or interface enclosing the use.

So, basically your first Sysout(), satisfies all the above 4 conditions, and hence it's a compile time error.
In the 2nd Sysout(), you're accessing a using it's qualified name, rather than simple name, which as per the above rules is allowed.
Now, the reason for this would be, when you access Test.a, the compiler is sure that Test class has been loaded and all static fields have been initialized, so it can access the field a. But while accessing a on simple name, the compiler isn't sure that initializer for a has already run or not, since it might still be in process of loading the class.
Consider the following process of loading of class:

*

*When a class is loaded, memory is allocated for all the static variables declared in it. At this point, the variable a has got its memory allocated (declaration done)

*Then all the static initializers run in the order of occurrence.

*

*First statement is Sysout(a);. a hasn't been initialized yet, so you can't access it. (error)

*Second statement is a = 99. Here you're actually initializing the variable a. Perfectly fine.

*Third one is Sysout(Test.a) - reasoning for this is already posted above. Compiler knows Test is already loaded.

*Then static int a = 10 is executed. It re-initializes a to 10. Remember, declaration part is already taken care of in first step.

A: First , let's see what JLS have to say for illegal forward references.

Use of class variables whose declarations appear textually after the
  use is sometimes restricted, even though these class variables are in
  scope (§6.3). Specifically, it is a compile-time error if all of the
  following are true:
The declaration of a class variable in a class or interface C appears
  textually after a use of the class variable;
The use is a simple name in either a class variable initializer of C
  or a static initializer of C;
The use is not on the left hand side of an assignment;
C is the innermost class or interface enclosing the use.
Use of instance variables whose declarations appear textually after
  the use is sometimes restricted, even though these instance variables
  are in scope. Specifically, it is a compile-time error if all of the
  following are true:
The declaration of an instance variable in a class or interface C
  appears textually after a use of the instance variable;
The use is a simple name in either an instance variable initializer of
  C or an instance initializer of C;
The use is not on the left hand side of an assignment;
C is the innermost class or interface enclosing the use.

It defines what is a illegal forward reference for each - static and instance variables. However, definition seems to be same for both of them. Since your question asks about static, we will dig deep into this only.
1) See, for a static variable, there is declaration and there is initialization.
 static int a; //only declaration
 static int b = 10; //both declaration and initialization

2) Use of class variables whose declarations appear textually after the use is sometimes restricted, even though these class variables are in scope.
What does it explains to us ? It says that there are cases when we can use static variables even if we declare them afterwards. And in some cases this wont be allowed. So, what are the cases that this won't be allowed ?
If the following 4 conditions are true at the same time. Else you are free to use it even though you have declared it afterwards.
a) The declaration of a class variable in a class or interface C appears textually after a use of the class variable;

b) The use is a simple name in either a class variable initializer of C or a static initializer of C;

c) The use is not on the left hand side of an assignment;

d) C is the innermost class or interface enclosing the use.

Well, the a) point is simple. It says that you must be looking at these rules only when you want to use a static variable before declaring it else why would you dig up into this JLS.
The b) point is that if you use simple name like boy [and not class name appended to it like MyClass.boy only then you might enter the problem of illegal forward reference else you are safe my friend. But just this condition don't qualifies for Illegal forward reference else your a=99 in you code would have given us error immediately. There are 2 more conditions that HAVE to be true for this error to generate . If the below 2 does not qualify, you are allowed to use it like this.]
The point c) is pretty straightforward. Are you not using in left hand side of assignment ? If we look at a=99 , Nope !! System.out.println(a) - This is not even an assignment. Hence no left hand assignment is true.
The point d) is also simple. It just tell you which class/Interface C he means in definition.Your C = Test.
Now let's revisit your code. At each line of code, I will comment True+False+True+false something like this meaning that for each line what point a), b) , c) ,d) will give to each of line. Okay ?
class Test {

    static {
        System.out.println(a); // True + True + True +True ; Illegal forward reference
        a = 99; // True +  True + False +True ; No illegal forward reference
        System.out.println(Test.a); // True + False + True + True No illegal forward reference
    }

    static int a = 10;

    static {
        System.out.println(a);
    }
}

The next question one may think is now what it will print ? What values will it take if we use before declaring it ?
Now we come to rules of static initialization. Here, we will go according to your code.
When class is loaded and no illegal forward reference is not there , all the static variables have been initialized to default value and are present in memory.
Now, after this static initialization takes place.
class Test {

    static {
        System.out.println(Test.a);  // prints 0
        a = 99; // a get 99
        System.out.println(Test.a); // prints 99
    }

    static int a = 10;

    static {
        System.out.println(a); // prints 10
    }

    public static void main(String[] args) {

    }
}

A: Class initializers are run at the time that the class is loaded, and you cannot determine when exactly this happens.  Code that runs within a class initializer should only be for things that need to be processed or "initialized" for other static methods (or the class itself) to work properly.
Additionally, you are referencing a variable that has not yet been declared.  In your class initializer (the first static block) you assign a = 99, but a has not yet been declared.  If anything you'd want to declare the variable, and then initialize it within the static block.
There is no reason to use class initializers for the type of code you are posting.  This should be a static method if anything.
Here's an example
class Test{
    static int a = 10;

    static void doSomething(){
        System.out.println(a);
        a = 99;
        System.out.println(a);
    }
}

Then in main you can call Test.doSomething();

A: Well, the static block
static {
    System.out.println(a);
    a = 99;
    System.out.println(Test.a);
}

will be executed before a is declared.
The line with Test.a won't fire any error because the compiler checks and finds static variable a declared within class Test.


text:
Q: Monitor doesn't seem to lock the object I'm trying to implement a basic Future class (yeah, I know about Task but this is for educational purposes) and ran into strange behavior of Monitor class. The class is implemented so that it enters the lock in constructor, queues an action which exits the lock to a thread pool. Result getter checks an instance variable to see if the action is completed and if it isn't, enters lock and then returns the result. Problem is that in fact result getter doesn't wait for the queued action to finish and proceeds anyway leading to incorrect results. Here's the code.
// The class itself
public class Future<T>
{
    private readonly Func<T> _f;
    private volatile bool _complete = false;
    private T _result;
    private Exception _error = new Exception("WTF");
    private volatile bool _success = false;
    private readonly ConcurrentStack<Action<T>> _callbacks = new ConcurrentStack<Action<T>>();
    private readonly ConcurrentStack<Action<Exception>> _errbacks = new ConcurrentStack<Action<Exception>>();
    private readonly object _lock = new object();

    public Future(Func<T> f)
    {
        _f = f;
        Monitor.Enter(_lock);
        ThreadPool.QueueUserWorkItem(Run);
    }

    public void OnSuccess(Action<T> a)
    {
        _callbacks.Push(a);
        if (_complete && _success)
            a(_result);
    }

    public void OnError(Action<Exception> a)
    {
        _errbacks.Push(a);
        if (_complete && !_success)
            a(_error);
    }

    private void Run(object state)
    {
        try {
            _result = _f();
            _success = true;
            _complete = true;
            foreach (var cb in _callbacks) {
                cb(_result);
            }
        } catch (Exception e) {
            _error = e;
            _complete = true;
            foreach (var cb in _errbacks) {
                cb(e);
            }
        } finally {
            Monitor.Exit(_lock);
        }
    }

    public T Result {
        get {
            if (!_complete) {
                Monitor.Enter(_lock);
            }
            if (_success) {
                return _result;
            } else {
                Console.WriteLine("Throwing error complete={0} success={1}", _complete, _success);
                throw _error;
            }
        }
    }

        // Failing test
        public void TestResultSuccess() {
        var f = new Future<int>(() => 1);
        var x = f.Result;
        Assert.AreEqual (1, x);
    }

I'm using Mono 3.2.3 on Mac OS X 10.9.

A: Only the thread that took the lock can exit the lock. You can't Enter it in the constructor on the calling thread then Exit from the thread-pool when it completes - the thread-pool worker does not have the lock.
And conversely: presumably it is the same thread that created the future that is accessing the getter: that is allowed to Enter again: it is re-entrant. Also, you need to Exit the same number of times that you Enter, otherwise it isn't actually released.
Basically, I don't think Monitor is the right approach here.


text:
Q: Java - "String index out of range" exception I wrote this little function just for practice, but an exception ("String index out of range: 29") is thrown and I don't know why...
(I know this isn't the best way to write this function and can I use regular expressions.)
This is the code:
public String retString(String x)
{
    int j=0;
    int i=0;
    StringBuffer y = new StringBuffer(x);

try
{

    while ( y.charAt(i) != '\0' )
    {
        if (y.charAt(i) != ' ')
        {
            y.setCharAt(j, y.charAt(i));
            i++;
            j++;
        }
        else
        {
            y.setCharAt(j, y.charAt(i));
            i++;
            j++;
            while (y.charAt(i) == ' ')
                i++;
        }
    }
    y.setCharAt(j,'\0');

}
finally
{

    System.out.println("lalalalololo " );
}

    return y.toString();

}

A: Are you translating this code from another language? You are looping through the string until you reach a null character ("\0"), but Java doesn't conventionally use these in strings. In C, this would work, but in your case you should try
i < y.length()

instead of
y.charAt(i) != '\0'

Additionally, the
 y.setCharAt(j,'\0')

at the end of your code will not resize the string, if that is what you are expecting. You should instead try
y.setLength(j)

A: This exception is an IndexOutOfBoundsException but more particularly, a StringIndexOutOfBoundsException (which is derived from IndexOutOfBoundsException). The reason for receiving an error such as this is because you are exceeding the bounds of an indexable collection. This is something C/C++ does not do (you check bounds of collections manually) whereas Java has these built into their collections to avoid issues such as this. In this case, you're using the String object like an array (probably what it is in implementation) and going over the boundary of the String.
Java does not expose the null terminator in the public interface of String. In other words, you cannot determine the end of the String by searching for the null terminator. Rather, the ideal way to do this is by ensuring you do not exceed the length of the string.

A: Java strings are not null-terminated. Use String.length() to determine where to stop.

A: Looks like you are a C/C++ programmer coming to java ;)
Once you have gone out of range with .charAt (), it doesn't reach null, it reaches a StringIndexOutOfBoundsException. So in this case, you will need a for loop that goes from 0 to y.length()-1.

A: a much better implementation (with regex) is simply return y.replaceAll("\\s+"," "); (this even replaces other whitespace)
and StringBuffer.length() is constant time (no slow null termination semantics in java)
and similarly x.charAt(x.length()); will also throw a StringIndexOutOfBoundsException (and not return \0 like you'd expect in C)
for the fixed code:
while ( y.length()>i)//use length from the buffer
{
    if (y.charAt(i) != ' ')
    {
        y.setCharAt(j, y.charAt(i));
        i++;
        j++;
    }
    else
    {
        y.setCharAt(j, y.charAt(i));
        i++;
        j++;
        while (y.charAt(i) == ' ')
            i++;
    }
}
y.setLength(j);//using setLength to actually set the length

btw a StringBuilder is a faster implementation (no unnecessary synchronization)


text:
Q: Tensorflow Dataset.from_tensor_slices taking too long I have the following code:
data = np.load("data.npy")
print(data) # Makes sure the array gets loaded in memory
dataset = tf.contrib.data.Dataset.from_tensor_slices((data))

The file "data.npy" is 3.3 GB. Reading the file with numpy takes a couple of seconds but then the next line that creates the tensorflow dataset object takes ages to execute. Why is that? What is it doing under the hood?

A: Quoting this answer:

np.load of a npz just returns a file loader, not the actual data. It's a 'lazy loader', loading the particular array only when accessed.

That is why it is fast.
Edit 1: to expand a bit more this answer, another quote from tensorflow's documentation:

If all of your input data fit in memory, the simplest way to create a Dataset from them is to convert them to tf.Tensor objects and use Dataset.from_tensor_slices().
This works well for a small dataset, but wastes memory---because the contents of the array will be copied multiple times---and can run into the 2GB limit for the tf.GraphDef protocol buffer.

The link also shows how to do it a efficiently.

A: Try:
data = np.load("data.npy")
a = tf.placeholder(tf.float32, shape)
dataset = tf.data.Dataset.from_tensor_slices(a)
dataset = dataset.prefetch(buffer_size=1000)
dataset = dataset.batch(128)
iterator = dataset.make_initializable_iterator()
next_batch = iterator.get_next()
with tf.Session() as sess:
    sess.run(iterator.initializer, feed_dict={a: data})

When processing large dataset, tf.placeholder is better.


text:
Q: Part of UWP page doesn't refresh after navigation I've developed an UWP app. There I have a part of the page with charts on the bottom (from Telerik) which sometimes changes the data an then have to be updated. This part of the page is separated from the top of the page by an GridSplitter.
By the way this page is the MainPage.
When I load the page the first time everything works well. Also updating the chart is working.
But if I navigate to another page and then navigate back to the MainPage the loading of the charts doesn't work. Also refreshing the charts with the data doesn't work.
I've tried to use charts from another library (not Telerik) - doesn't work.
I've build my own chart control - doesn't work.
Updating the controls by calling .UpdateLyout() also doesn't work.
The top of this part of the page does work (it's a GridView). But it seems that the part of the page which is fully or partly not completely shown on the top of this part the page (because I'm using an ScrollViewer) doesn't refresh. But in the code behind I can see that the data (also in the control) is loaded.
I've also completely deleted the not working UserControl from the containing StackPanel and then added another simple UserControl. But it doesn't refresh. Also I'm sure that I've deleted the chart from the StackPanel it will still be displayed and the new UserControl will not be displayed.
        <Grid Name="grd_all_content">
            <Grid.RowDefinitions>
                <RowDefinition MinHeight="100" />
                <RowDefinition Height="11" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <ucs:SprintListUC x:Name="sprintListUC" Grid.Row="0" />
            <controls:GridSplitter Foreground="White" Grid.Row="1" ResizeBehavior="BasedOnAlignment" ResizeDirection="Auto" Background="Gray" Height="11" HorizontalAlignment="Stretch" FontSize="13">
                <controls:GridSplitter.Element>
                    <Grid>
                        <TextBlock HorizontalAlignment="Center"  IsHitTestVisible="False"
                VerticalAlignment="Center" Text=""
                Foreground="Black" FontFamily="Segoe MDL2 Assets"/>
                    </Grid>
                </controls:GridSplitter.Element>
            </controls:GridSplitter>
            <Grid Name="grd_graphics" Grid.Row="2" Background="{ThemeResource SystemAltMediumColor}" Padding="10,10,10,20" SizeChanged="Grid_SizeChanged"
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <ScrollViewer x:Name="scrlvwr_charts">
                    <StackPanel Orientation="Vertical">
                        <TextBlock Foreground="#FFC31727" FontWeight="Bold" FontSize="20" Margin="0,0,0,20">Auswertung zu der aktuellen Sprint-Auswahl:</TextBlock>
                        <GridView HorizontalAlignment="Stretch" ItemsSource="{x:Bind Path=Evaluations}" SelectionMode="None">
                            <GridView.ItemTemplate>
                                <DataTemplate x:DataType="classes:Evaluation">
                                    <StackPanel Orientation="Vertical" Padding="5" BorderBrush="Gray" BorderThickness="1" Width="250" Background="#FFC31727">
                                        <TextBlock FontWeight="Bold" Foreground="White" Text="{x:Bind Path=Name}" />
                                        <TextBlock Margin="10,5,0,0" Foreground="White" Text="{x:Bind Path=Value}" />
                                    </StackPanel>
                                </DataTemplate>
                            </GridView.ItemTemplate>
                        </GridView>

                            <TextBlock Foreground="#FFC31727" FontWeight="Bold" FontSize="20" Margin="0,20,0,20">Sprints je KW (Gesamt und davon Erledigt):</TextBlock>
                            <telerik:RadCartesianChart PaletteName="DefaultLight" Height="250">
                                <telerik:RadCartesianChart.HorizontalAxis>
                                    <telerik:CategoricalAxis/>
                                </telerik:RadCartesianChart.HorizontalAxis>
                                <telerik:RadCartesianChart.VerticalAxis>
                                    <telerik:LinearAxis/>
                                </telerik:RadCartesianChart.VerticalAxis>
                                <telerik:RadCartesianChart.Grid>
                                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y"/>
                                </telerik:RadCartesianChart.Grid>
                                <telerik:BarSeries ItemsSource="{x:Bind SprintsDoneAmountData}">
                                    <telerik:BarSeries.ValueBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Value"/>
                                    </telerik:BarSeries.ValueBinding>
                                    <telerik:BarSeries.CategoryBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Name"/>
                                    </telerik:BarSeries.CategoryBinding>
                                </telerik:BarSeries>
                                <telerik:BarSeries ItemsSource="{x:Bind SprintsAmountData}" CombineMode="Cluster">
                                    <telerik:BarSeries.ValueBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Value"/>
                                    </telerik:BarSeries.ValueBinding>
                                    <telerik:BarSeries.CategoryBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Name"/>
                                    </telerik:BarSeries.CategoryBinding>
                                </telerik:BarSeries>
                            </telerik:RadCartesianChart>

                            <TextBlock FontSize="16" FontStyle="Italic" Margin="5,5,0,0">(gelb = gesamt; blau = erledigt)</TextBlock>

                            <TextBlock Foreground="#FFC31727" FontWeight="Bold" FontSize="20" Margin="0,20,0,20">Einsparpotential je KW (in €):</TextBlock>
                            <telerik:RadCartesianChart PaletteName="DefaultLight" Height="250">
                                <telerik:RadCartesianChart.HorizontalAxis>
                                    <telerik:CategoricalAxis/>
                                </telerik:RadCartesianChart.HorizontalAxis>
                                <telerik:RadCartesianChart.VerticalAxis>
                                    <telerik:LinearAxis/>
                                </telerik:RadCartesianChart.VerticalAxis>
                                <telerik:RadCartesianChart.Grid>
                                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y"/>
                                </telerik:RadCartesianChart.Grid>
                                <telerik:BarSeries ItemsSource="{x:Bind SavingPotensialsData}">
                                    <telerik:BarSeries.ValueBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Value"/>
                                    </telerik:BarSeries.ValueBinding>
                                    <telerik:BarSeries.CategoryBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Name"/>
                                    </telerik:BarSeries.CategoryBinding>
                                </telerik:BarSeries>
                            </telerik:RadCartesianChart>
                    </StackPanel>
                </ScrollViewer>
            </Grid>

The GridView ist updating. But the rest of the content of the StackPanel not. Also if I use another simple UserControl and not the Telerik Control.
That's a really tricky problem.


text:
Q: Getting data from a DynamoDb table into an HTML table using API Gateway I've managed to query a DynamoDb table using Lambda triggered by an API Gateway. Clicking on the API URL gives me this:
{
  "Items": [
    {
      "date": "1522395676041",
      "UUID": "2deed071-f2ad-46f8-b30f-69e2da55d4c9",
      "message": "0941 from John",
      "commentId": "ba6c3749-33ed-11e8-95a6-0f2f6e50e87f",
      "reason": "1",
      "pageId": "0"
    },
    {
      "date": "1522685413383",
      "UUID": "085b71b3-98a9-4155-be19-a6c221b3d60a",
      "message": "0933",
      "commentId": "53c9bb19-3690-11e8-abfb-b5a9138e7fe2",
      "reason": "1",
      "pageId": "0"
    },
    {
      "date": "1522574265688",
      "UUID": "2deed071-f2ad-46f8-b30f-69e2da55d4c9",
      "message": "1117 from John's iPhone",
      "commentId": "8a3cc78a-358d-11e8-803c-659d2c124a1d",
      "reason": "1",
      "pageId": "0"
    },
 ],
  "Count": 3,
  "ScannedCount": 3
}

I can't work out how to get these into a simple array so that Javascript can  send it to a table (I am using the Convert JSON To Table library). I've looked at AWS API Gateway templates and JavaScript examples but they don't really help.
Does anyone know of an easier way?
Cheers,
JC

A: Suggest using this jquery plugin called - Tabulator. You won't need to write HTML or any other DOM generating code.
Or if you'd like to build your own html custom table then, use array.map() function in javascript.


text:
Q: Shortest path algorithm js error I am quite new into JS and a friend of mine sent me this fiddle
function shortestPath(g, s) {
    g.vertexes.forEach(function(u) {
        u.dist = Infinity;
        u.prev = null;
    });

    s.dist = 0;

    for (var i = 0; i < g.vertexes.length - 1; i++) {
        g.edges.forEach(function(e) {
            update(e);
        });
    }

    printResult(); }

function update(e) {
    var u = e.from;
    var v = e.to;

    if (v.dist > u.dist + e.data) {
        v.dist = u.dist + e.data;
        v.prev = u;
    } }

var result = [];

function printResult() {
    var str = '';
    debugger;
    for (var i = 0; i < result[0].length; i++) {
        for (var j = 0; j < result.length; j++) {
            str += result[i][j] + ' ';
        }
        console.log(str);
        str = '';
    } }

function printGraph(G) {
    var a = [];

    G.vertexes.forEach(function(u) {
        a.push(u.dist);
    });
    result.push(a); }

function Graph(options) {
    options = options || {};
    this.directed = (options.directed != null) ? options.directed : true;
    this.vertexes = [];
    this.edges = []; }

Graph.prototype.vertex = function(name) {
    var v = {
        adjacent: [],
        name: name.toString()
    };

    this.vertexes.push(v);

    return this; };

Graph.prototype.get = function(name) {
    return this.vertexes.filter(function(el) {
        return el.name === name.toString();
    })[0]; };

Graph.prototype.edge = function(a, b, w) {
    var that = this;

    connect(a, b, w);
    if (!this.directed) {
        connect(b, a, w);
    }

    function connect(a, b, data) {
        var u = that.vertexes.filter(function(el) {
            return el.name === a.toString();
        })[0];
        var v = that.vertexes.filter(function(el) {
            return el.name === b.toString();
        })[0];

        u.adjacent.push(v);
        that.edges.push({
            from: u,
            to: v,
            data: data
        });
    }

    return this; };

function main() {
    var g = new Graph();
    g.vertex(1)
        .vertex(2)
        .vertex(3)
        .vertex(4)
        .vertex(5)
        .vertex(6)
        .vertex(7)
        .vertex(8);

    g.edge(1, 2, -2);
    g.edge(1, 5, -2);
    g.edge(1, 6, -3);
    g.edge(1, 8, -1);

    g.edge(2, 6, 7);
    g.edge(2, 8, 4);
    g.edge(3, 2, 2);
    g.edge(3, 4, 5);

    g.edge(3, 7, 9);
    g.edge(4, 7, 4);
    g.edge(5, 7, 5);
    g.edge(7, 8, -1);

    g.edge(8, 2, 2);
    g.edge(8, 5, 8);
    g.edge(8, 6, 3);
    g.edge(8, 7, 7);

    shortestPath(g, g.get(3));
    console.log(g); }

main();

(Shortest path Bellman-Ford)
and don't really get it why it throws the error property 'length' of undefined in the console.
Any advice how to fix this error?

A: In general, when JS complains Cannot read property "xxx" of undefined, that means that somewhere you have foo.xxx and foo is the JavaScript value undefined (which is not an object, and has no properties).
Track such a problem down by finding the line in question (using debugging tools, or even just looking for .length in your case) and considering: when might the variable in question be undefined?
In your specific case, the error occurs on this line:
for (var i = 0; i < result[0].length; i++) {

which means that result[0] is undefined. Which means that your result array has no value at [0]. It is empty.
Since the printResult function is called from one place (line 59), this likely means that result is still an empty array when printResult() is called. You can confirm this by setting a breakpoint at that location and examining what result is.
As for why it is empty:
The only code that affects the result array is result.push(a) in the printGraph() function. And this function is never called. Ask your friend why s/he defined printGraph() but never invoked it.
It may be as simple as calling printGraph(g) right before printResult().


text:
Q: Special character problem in J2ME I am reading unicode character from XML like \u09A8\u09AC\u09AE. I have used <?xml version="1.0" encoding="utf-8"?> in the heading of XML. When I parsing xml from server using KXML2 parser it makes every unicode character a string. If I convert it to character array it gives like :
Char 0: \
Char 1: u
Char 2: 0
Char 3: 9
Char 4: B
Char 5: E
How can I get my unicode character back?

A: In XML \u09A8 is not a Unicode character reference in XML!
There are only a few places that treat \u as the beginning of a Unicode escape, and they are mostly in the Java area.
In XML a hexidecimal Unicode escape would be ন and a decimal one would be ন.
In other words: You get the characters \, u, 0, 9, B, E back, because that's what the XML contains.
The best solution is to fix whatever produces this XML to use actual numeric entity references. Alternatively, you can manually replace the \u escapes with their corresponding characters, but then only your code will correctly interpret this non-standard XML.


text:
Q: undefined reference to a function call? I think my only problem this undefined reference to...well all of my function calls. I've done functions and pointers before and tried to follow the same format but I'm lost as to what I'm doing wrong :/ I voided them all, defined my pointers, and gave them the correct types...It just says 4 errors stating "undefined reference to __menuFunction" etc...
#include<stdio.h>

void menuFunction(float *);
void getDeposit(float *, float *);
void getWithdrawl(float *, float *);
void displayBalance(float );

int main()
    {
       float menu, deposit,withdrawl, balance;
       char selection;

       menuFunction (& menu);
       getDeposit (&deposit, &balance);
       getWithdrawl(&withdrawl, &balance);
       displayBalance(balance);

    void menuFunction (float *menup)
    {

        printf("Welcome to HFCC Credit Union!\n");
        printf("Please select from the following menu: \n");
        printf("D: Make a Deposit\n");
        printf("W: Make a withdrawl\n");
        printf("B: Check your balance\n");
        printf("Or Q to quit\n");
        printf("Please make your slelction now: ");
        scanf("\n%c", &selection);
    }

        switch(selection)
        {
            case'd': case'D':
                *getDeposit;
            break;
            case 'W': case'w':
                *getWithdrawl;
            break;
            case'b': case'B':
                *displayBalance;
        }

        void    getDeposit(float *depositp, float *balancep)
        {
            printf("Please enter how much you would like to deposit: ");
            scanf("%f", *depositp);
                do
               {
                   *balancep = (*depositp + *balancep);
               } while (*depositp < 0);

        }

        void getWithdrawl(float *withdrawlp, float *balancep)
            {
                printf("\nPlease enther the amount you wish to withdraw: ");
                scanf("%f", *withdrawlp);
                    do
                    {
                        *balancep = (*withdrawlp - *balancep);
                    } while (*withdrawlp < *balancep);

            }

        void displayBalance(float balance)
            {
                printf("\nYour current balance is: %f", balance);
            }

        return 0;
    }

A: Take your functions out of the main() function.
int main()
{
   float menu, deposit,withdrawl, balance;
   char selection;

   menuFunction (& menu);
   getDeposit (&deposit, &balance);
   getWithdrawl(&withdrawl, &balance);
   displayBalance(balance);
}

void menuFunction (float *menup)
{
  ...
  ...

Beside this your program has many errors. Correct them.

A: Your menuFunction() getDeposit() and getWithdrawl() are defined in main()'s body. Nested functions aren't supported of ANSI-C. The easiest way to make your code work is to define functions in the global scope.

[Upd.] but don't forget to fix another bugs in your code (for example, statement variable in menuFunction() is an unresolved symbol, it must be declared as global variable or should be sent into the function as an argument. I advise you to read K&R, it is classics for C programmers!


text:
Q: Can not create foreign keys and check constraints using HeidSql I am trying to create some tables in HeidiSql, but got stuck at the point I noticed that I can not create foreign keys. At first I tried it with SQL statements and later on with the key generation menu of HeidiSql. Both ended in giving me an index instead of a foreign key for the specified column.
Here is an example:

CREATE TABLE Test(
testId INT NOT NULL,
PRIMARY KEY(testId));

CREATE TABLE secondTest(
secondTestId INT NOT NULL,
test INT NOT NULL,
FOREIGN KEY(test) REFERENCES Test(testId),
PRIMARY KEY(secondTestId));

I do not get any error message, all it does is converting the foreign key, the symbol of the foreign key shows up until I save the table, into a index.
Furthermore, it does not apply check constraints if specify one for a column.
Has anyone faced the same problem yet? Thank you for your help!

A: Seems like the engine was the problem. Changed it from 'MyIsam' to 'InnoDB' and it creates the constraints and keys now as it should.


text:
Q: Getting stackoverflow error in widget in flutter that show a simple text I make a widget that takes a string as a parameter and show it with a special case
this is the widget :
class Hometext extends StatelessWidget {
  final Size size;
  final String text;
  final bool islogin;
  Hometext({@required this.size, @required this.text, @required this.islogin});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(
        top: islogin ? size.height * 0.06 : size.height * 0.03,
        left: size.width * 0.05,
      ),
      child: Row(
        children: [
          Text(
            text,
            style: TextStyle(
              color: Data().colorslist['black'],
              fontSize: 30,
              fontWeight: islogin ? FontWeight.bold : FontWeight.normal,
            ),
          ),
          Container(
            width: size.width * 0.08,
            height: size.height * 0.02,
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              color: Data().colorslist['darkgreen'],
            ),
          ),
        ],
      ),
    );
  }
}

when using this widget the debug console gives me a StackOverflow error it gave me this error for a lot of  widget in my application and I don,t know why it crashed my app for weeks and I don,t know what to do to deal with it
this is an error :
Stack Overflow

The relevant error-causing widget was
Hometext
lib\screens\wholescreen.dart:31
#1      _LinkedHashMapMixin._init (dart:collection-patch/compact_hash.dart:217:18)
#2      _LinkedHashMapMixin._rehash (dart:collection-patch/compact_hash.dart:199:7)
#3      _LinkedHashMapMixin._insert (dart:collection-patch/compact_hash.dart:247:7)
#4      _LinkedHashMapMixin.[]= (dart:collection-patch/compact_hash.dart:296:7)
...
════════════════════════════════════════════════════════════════════════════════

Data class :
class Data {
  Map colorslist = {
    'black': Color.fromRGBO(10, 9, 8, 1),
    'darkgreen': Color.fromRGBO(34, 51, 59, 1),
    'offwhite': Color.fromRGBO(234, 224, 213, 1),
  };

  List pageviewdata = [
    'lib/assets/pageview1.jpg',
    'lib/assets/pageview2.jpg',
    'lib/assets/pageview3.jpg',
  ];

  List pageviewnumbers = [0, 1, 2];

  List categories = [
    Categories(name: 'Health&Beuty', image: 'lib/assets/health&beuty.jpg'),
    Categories(name: 'Books', image: 'lib/assets/books.jpg'),
    Categories(name: 'Fashion', image: 'lib/assets/fashion.jpg'),
    Categories(name: 'Electronics', image: 'lib/assets/electronics.jpg'),
  ];

  List<Drawerlisttile> drawerlisttile = [
    Drawerlisttile(name: 'Home', icon: Icon(Icons.home,color: Data().colorslist['offwhite'])),
    Drawerlisttile(name: 'Cartlist', icon: Icon(Icons.shopping_cart,color: Data().colorslist['offwhite'])),
    Drawerlisttile(name: 'Orders', icon: Icon(Icons.shopping_bag_rounded,color: Data().colorslist['offwhite'])),
    Drawerlisttile(name: 'Settings', icon: Icon(Icons.settings,color: Data().colorslist['offwhite'])),
  ];
}

A: make colorslist static inside Data class
when you create an instance of it using Data(), then a drawerlisttile is being instantiated which creates Data()
in other words, creating Data creates multiple instances of Data, hence the overflow
class Data {
  static Map colorslist = {
    'black': Color.fromRGBO(10, 9, 8, 1),
    'darkgreen': Color.fromRGBO(34, 51, 59, 1),
    'offwhite': Color.fromRGBO(234, 224, 213, 1),
  };

  List<Drawerlisttile> drawerlisttile = [
    Drawerlisttile(name: 'Home', icon: Icon(Icons.home,color: Data.colorslist['offwhite'])),
    Drawerlisttile(name: 'Cartlist', icon: Icon(Icons.shopping_cart,color: Data.colorslist['offwhite'])),
    Drawerlisttile(name: 'Orders', icon: Icon(Icons.shopping_bag_rounded,color: Data.colorslist['offwhite'])),
    Drawerlisttile(name: 'Settings', icon: Icon(Icons.settings,color: Data.colorslist['offwhite'])),
  ];
}


text:
Q: How can I use Puppet to Enforce Local Group Membership? Cross posting this from Ask@PuppetLabs. (There simply isn't enough traffic there.)
I've seen a number of examples for adding users to %wheel with Augeas. These are all variations of the same thing; inserting a user node at the end.

*

*Quick Tip: Add users to a group with augeas

*How to manage configurations in Linux with Puppet and Augeas

*Puppet Group Management Module
What I need to do is also remove users that are added outside of configuration management. For Puppet to manage the group, only users defined in my Puppet class should be present and any others removed.
Seems like exec'ing a simple Sed command would be much easier, but so many people say to try to stay away from exec. Is it such a bad solution in this case?

A: Defining wheel users this way causes them to be added, but if you remove jane from the class, she will not be removed from the wheel group on the next Puppet run.
class wheel {
  augeas { "wheelgroup":
    context => "/files/etc/group/wheel",
    changes => [
      'set user[1] bob',
      'set user[2] jane',
    ]
  }
}

The only way I have found around this is to purge the wheel group and re-add them each time.
class wheel {
  augeas { "wheelgroup":
    context => "/files/etc/group/wheel",
    changes => [
      'rm user',
      'set user[1] bob',
      'set user[2] jane',
    ]
  }
}

I considered an onlyif to match my defined users to prevent this from running on each Puppet run. However, this is also the only way to remove users added outside of Puppet to ensure that %wheel is managed solely by Puppet.
This solution also doesn't lend well to parametrization for reuse.

A: It might be possible to use the Group members type to specifically set the members of the group. You may need to use the forcelocal option.


text:
Q: Send attribute to custom element on change I am developing a web-app with Polymer. In my index.html I have 2 custom elements like follows
...
<body unresolved>
...
    <template is="dom-bind" id="app">
        <detail-card></detail-card>
        <information-card></information-card>
    </template>
...
</body>

Both custom elements are located in its own html file detail-card.html and infromation-card.html and then imported to the index file.
What I am trying to do is to set a property on detail-card custom element and once it changes its value to execute a function on information-card custom element with the new value on the other side.
Basically I have 2 columns. detail-card shows a short version of the data of a purchase made by the user and the information-card shows the full data and specifications of the purchase. In both columns I have a set of buttons that change status (color) when pressed. I would like to change the color on both custom elements even when user only inputs in one of them. I was trying to do so by databinding a property and fire a function once it changes but I can't figure out how to sync both custom elements
Can anyone please help me to achieve this?

A: Basically to do what you ask you need a top level parent container,
something like:
<dom-module id="parent-card">
    <template>
        <detail-card prop-color="{{propColor}}"></detail-card>
        <information-card prop-color="{{propColor}}"></information-card>
    </template>
</dom-module>
<script>
    class ParentCard extends Polymer.Element {
        static get is() {
            return 'parent-card';
        }
        static get properties() {
            return {
                propColor: {
                    type: String,
                    notify: false
                }
            };
        }
    }

    window.customElements.define(ParentCard.is, ParentCard);
</script>

You should have another property propColor in both of 2 cards,
when in one of the cards you change color maybe pressing the button,
set the new value to propColor, that should trigger the change to the parent component ParentCard which will notify the second card.


text:
Q: Replace characters within one line with sed I have a file full of lines like:
ATOM  27576  OT2 TYR X 360      33.646  13.165  20.334  1.00  1.00      PROE

I want to convert it to be like:
ATOM  27576  OT2 TYR E 360      33.646  13.165  20.334  1.00  1.00      PROE

in other words, put the last letter from PRO where X stands. X is a constant within the file, but the PRO postfix varies. Is it possible to achieve it with a one line sed command?

A: Just use capture groups:
sed 's/TYR X \(.*\)PRO\(.*\)$/TYR \2 \1PRO\2/'

$ echo "ATOM 27576 OT2 TYR X 360 33.646 13.165 20.334 1.00 1.00 PROE" | sed 's/TYR X \(.*\)PRO\(.*\)$/TYR \2 \1PRO\2/'
ATOM 27576 OT2 TYR E 360 33.646 13.165 20.334 1.00 1.00 PROE

A: awk solution would be more suitable for such case:
awk '{ $5=substr($NF,length($NF)) }1' file

A: You can use this sed:
sed -i '' -E 's/ X( .*PRO([A-Za-z]))/ \2\1/' file
ATOM 27576 OT2 TYR E 360 33.646 13.165 20.334 1.00 1.00 PROE

A: Creative use of backreferences:
sed 's/^\(.\+\) X \(.\+\) \(...\)\(.\)$/\1 \4 \2 \3\4/'


text:
Q: Android webview not able to locate same element on second time I am successfully able to switch context from Native app to WebView and vice-versa, but when I am executing the same steps for second time, at that time I am getting NoSuchElementException error. When I used getPageSource(), there I am getting previous visited page source i.e. second Page
Application Flow:

*

*Switched to WebView_

*Perform Activity on 1st page, when executed 2nd time I am getting 2nd Page page source

*Perform Activity on 2nd page,

*Switched back to NativeApp

Appium Environment Details:

*

*Appium version: 1.22.3 CLI

*Android Version: Android 12 Executed

*Environment : emulator

First Web Page

        <title> </title>

        <form name="TransactionForm" id="TransactionForm" method="post" action="/transaction.do" autocomplete="off">

                    Payment Details

                        Reference No.:

                        RBL8ybXJQQGQi9

        </form>

Second Web Page

        <title> </title>

        <form method="post" action="./PaymentCancel.aspx" id="form1">
            <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="" />
            <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" />

        </form>

This is error that I am getting
2022-04-16 02:37:23:706 [HTTP] --> GET /wd/hub/session/459b7826-8f0f-4321-8dc8-fadd746dad28/source
2022-04-16 02:37:23:707 [HTTP] {}
2022-04-16 02:37:23:707 [W3C (459b7826)] Driver proxy active, passing request on via HTTP proxy
2022-04-16 02:37:23:708 [WD Proxy] Matched '/wd/hub/session/459b7826-8f0f-4321-8dc8-fadd746dad28/source' to command name 'getPageSource'
2022-04-16 02:37:23:708 [WD Proxy] Proxying [GET /wd/hub/session/459b7826-8f0f-4321-8dc8-fadd746dad28/source] to [GET http://127.0.0.1:8000/wd/hub/session/053655c5ba9990a7bd056b131cebc396/source] with no body
2022-04-16 02:37:23:709 [Chromedriver] [STDERR] [1650076643.709][INFO]: [053655c5ba9990a7bd056b131cebc396] COMMAND GetSource {
2022-04-16 02:37:23:710 [Chromedriver] [STDERR] }
2022-04-16 02:37:23:710 [Chromedriver] [STDERR] [1650076643.709][INFO]: Waiting for pending navigations...
2022-04-16 02:37:23:711 [Chromedriver] [STDERR] [1650076643.709][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=263) C41003041B44623FC8598D1BCE563383 {
2022-04-16 02:37:23:711 [Chromedriver] [STDERR]    "expression": "1"
2022-04-16 02:37:23:711 [Chromedriver] [STDERR] }
2022-04-16 02:37:23:715 [Chromedriver] [STDERR] [1650076643.715][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=263) C41003041B44623FC8598D1BCE563383 {
2022-04-16 02:37:23:718 [Chromedriver] [STDERR]    "result": {
2022-04-16 02:37:23:718 [Chromedriver] [STDERR]       "description": "1",
2022-04-16 02:37:23:718 [Chromedriver] [STDERR]       "type": "number",
2022-04-16 02:37:23:719 [Chromedriver] [STDERR]       "value": 1
2022-04-16 02:37:23:719 [Chromedriver] [STDERR]    }
2022-04-16 02:37:23:720 [Chromedriver] [STDERR] }
2022-04-16 02:37:23:720 [Chromedriver] [STDERR] [1650076643.715][INFO]: Done waiting for pending navigations. Status: ok
2022-04-16 02:37:23:720 [Chromedriver] [STDERR] [1650076643.715][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=264) C41003041B44623FC8598D1BCE563383 {
2022-04-16 02:37:23:721 [Chromedriver] [STDERR]    "awaitPromise": true,
2022-04-16 02:37:23:721 [Chromedriver] [STDERR]    "expression": "(function() { // Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Enum f...",
2022-04-16 02:37:23:722 [Chromedriver] [STDERR]    "returnByValue": true
2022-04-16 02:37:23:723 [Chromedriver] [STDERR] }
2022-04-16 02:37:23:723 [Chromedriver] [STDERR] [1650076643.722][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=264) C41003041B44623FC8598D1BCE563383 {
2022-04-16 02:37:23:724 [Chromedriver] [STDERR]    "result": {
2022-04-16 02:37:23:724 [Chromedriver] [STDERR]       "type": "object",
2022-04-16 02:37:23:725 [Chromedriver] [STDERR]       "value": {
2022-04-16 02:37:23:725 [Chromedriver] [STDERR]          "status": 0,
2022-04-16 02:37:23:726 [Chromedriver] [STDERR]          "value": "\u003Chtml xmlns=\"http://www.w3.org/1999/xhtml\">\u003Chead>\u003Ctitle>\n\n\u003C/title>\u003C/head>\n\u003Cbody>\n    \u003Cform method=\"post\" action=\"./PaymentCancel.aspx\" id=\"form1\">\n\u003Cinput type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEW..."
2022-04-16 02:37:23:726 [Chromedriver] [STDERR]       }
2022-04-16 02:37:23:727 [Chromedriver] [STDERR]    }
2022-04-16 02:37:23:727 [Chromedriver] [STDERR] }
2022-04-16 02:37:23:728 [Chromedriver] [STDERR] [1650076643.722][INFO]: Waiting for pending navigations...
2022-04-16 02:37:23:731 [Chromedriver] [STDERR] [1650076643.722][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=265) C41003041B44623FC8598D1BCE563383 {
2022-04-16 02:37:23:732 [Chromedriver] [STDERR]    "expression": "1"
2022-04-16 02:37:23:732 [Chromedriver] [STDERR] }
2022-04-16 02:37:23:733 [WD Proxy] Got response with status 200: {"value":"<title>\n\n</title>\n\n    <form method=\"post\" action=\"./PaymentCancel.aspx\" id=\"form1\">\n<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"aleE/7H3BN6BEWf+XdDKzoB51Aa4E50X5VR51B8/Mk5J1MjjyGMR0JZP4fxN0ScavtuVLk06qEPGlDJKYNrWrvRy14FKCcPOIvmKcvsbzKQ=\">\n\n<input type=\"hidden\" name=\"__VIEWSTATEGENERATOR\" id=\"__VIEWSTATEGENERATOR\" value=\"DACA2748\">\n
\n    \n
\n    </form>\n\n\n"}
2022-04-16 02:37:23:734 [HTTP] <-- GET /wd/hub/session/459b7826-8f0f-4321-8dc8-fadd746dad28/source 200 27 ms - 520

Also complete log attached here


text:
Q: Induction. Prove: $n! \ge 3^{n-1}/2$ for $n\geq1$
Induction. Prove: $n! \ge 3^{n-1}/2$ for $n\geq1$

For $n = 1$, $1! \geq 1/2$ which is true.
When I start with induction I can't prove it for all natural numbers. I really appreciate your help.

A: You want to show that $$ n! \ge 3^{(n-1)}/2$$
The problem begs for Mathematical Induction proof.
The statement it true for $n=1$ and $n=2$
If the statement is true for $k\ge 2$ , then
$$(k+1)!= (k+1)k! \ge (k+1)( 3^{(k-1)}/2)\ge 3( 3^{(k-1)}/2) = 3^{k}/2$$
Thus the statement is true for all $n\ge 1.$

A: Alt. hint:   for $\,n \ge 2\,$:
$$
\dfrac{(n+1)!}{n!} = n+1 \ge 3 = \dfrac{3^n}{3^{n-1}} \;\;\implies\;\;\dfrac{(n+1)!}{3^n} \ge \dfrac{n!}{3^{n-1}} \ge \dfrac{(n-1)!}{3^{n-2}} \ge \ldots \ge \dfrac{2!}{3^1} \gt \dfrac{1}{2}
$$

A: Induction step:
Assume $k!\ge 3^{\frac {k-1}2}$. Can you prove:
$(k+1)! = k!(k+1) \ge 3^{\frac {k-1} 2}(k+1) \underbrace{\ge}_{\text{prove this}} 3^{\frac {k} 2}$?
Note: $3^{\frac k2} = 3^{\frac {k-1}{2}}3^{\frac 12}$.
So can you prove that if $k \ge 1$ that $k + 1 \ge \sqrt{3}$?
Can you prove if $k \ge 1$ then $(k+1)^2 \ge 3$?

A: Problem statement: Prove using induction that $$n! \geq \dfrac{3^{n-1}}{2}; \forall n \geq 1$$
Solution

*

*Base case: For $n = 1$

$$1! = 1 \geq \dfrac{3^{1-1}}{2} = \dfrac{1}{2} \tag{1}$$
which is true.

*

*Assume that the given relation is true of any $n \geq 1$.

*The for $n + 1$, we have
\begin{align}
  (n + 1)! = (n + 1) \times n! \geq \dfrac{3^{n+1-1}}{2} = \dfrac{3^n}{2} = \dfrac{3 \times 3^{n- 1}}{2} = 3 \times \dfrac{3^{n-1}}{2}
\end{align}
The relation ($\geq$) above is true as using the relation, $n! \geq \dfrac{3^{n-1}}{2}$ and also using the base case, the minimum value possible for $n$ after the base case is $n = 2$, and $n + 1 = 2 + 1 \geq 3$. Hence this proves the claim.


text:
Q: Excel to CSV is very slow We receive multiple Excel files from different partners.  The problem is that these excels are differently formated.  So sometimes we get excels with merged fields or with EAN numbers as E+ numbers.  So we have created a vbscript that loops through the rows and cells and does various checks and adjusts the cells and then writes the line to a csv file.  This works well for small files but for larger files, it takes extremely long.
I have read through a number of posts but could not find a solution
Does anyone have suggestion on how to optimise this?
OPTION Explicit

Dim Arg
Set Arg = WScript.Arguments
'Excel objekte
DIM fso, objxl, objwb, objSheet
'Define Variables for Arguments
DIM src_file_path, dest_file_path, dest_sheet, dest_file_name, SheetNr
'Define Output files
Dim objFile
'Define working variables
Dim LRow, LCol, zeile, spalte, aktsheet

ON ERROR RESUME NEXT
dest_file_path     = "C:\WORK\"
src_file_path      = "C:\WORK\Test.xlsx"
SheetNr            = 1
SheetNr            = Int(SheetNr)
dest_file_name     = "DS_CSV.csv"

LRow = 0
LRow = CLng(LRow)
LCol = 0
LCol = CLng(LCol)

wscript.echo off
Set fso        = CreateObject("Scripting.FileSystemObject")
set objxl      = createobject("excel.application")
set objwb      = objxl.workbooks.open(src_file_path)
set objSheet   = objwb.Worksheets(SheetNr)
objxl.DisplayAlerts = False
dest_sheet = objwb.Sheets(SheetNr).Name

objSheet(dest_sheet).Select
objSheet.Activate

'Delete empty cells
Const xlCellTypeBlanks = 4
objwb.Worksheets(dest_sheet).Columns("a:a").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

'Find number of rows and cells
LRow=objxl.ActiveSheet.UsedRange.Rows.Count
LCol=objxl.ActiveSheet.UsedRange.Columns.Count

If LRow = 0 Then LRow = 1
If LCol = 0 Then LCol = 1

'start formating
Format_Number LRow, LCol

'close DS_CSV.csv
objFile.close
objFile.quit

'close excel
objxl.ActiveWorkbook.Close
objxl.Workbooks.Close
objxl.Application.Quit
Set Arg      = Nothing
Set objwb    = Nothing
Set objSheet = Nothing
Set objxl    = Nothing

WScript.quit 99

'----------
sub Format_Number (LRow, LCol)
  ON ERROR RESUME Next
  dim result, CsvStr, listsep, s_value, vrow
  Zeile = 0
  Zeile = CLng(Zeile)
  spalte = 0
  spalte = CLng(spalte)
  listsep = ";"

 'open DS_CSV.csv file
  Set objFile = fso.OpenTextFile((dest_file_path+dest_file_name) ,8 , True)

  with objxl.ActiveSheet

  For zeile = 1 To LRow
    CsvStr = ""
    For spalte = 1 To LCol
        s_value = ""
    If IsEmpty(.Cells(zeile, spalte).Value) = False And Str(.Cells(zeile,spalte).Value) = "Fehler 2029" Then
      s_value = "'" & Mid(.Cells(zeile, spalte).Formula, 2, Len(.Cells(zeile, spalte).Formula))
    end if

    If IsNumeric(.Cells(zeile, spalte).Value) = False And (InStr(.Cells(zeile, spalte).Value, vbLf) <> 0 Or InStr(.Cells(zeile, spalte).Value, vbCr) <> 0) Then
      s_value = CStr(Replace(.Cells(zeile, spalte).Value, vbLf, " "))
      s_value = CStr(Replace(.Cells(zeile, spalte).Value, vbCr, " "))
    end if

    'Unmerge cells:
    If .Cells(zeile, spalte).MergeCells Then.Cells(zeile, spalte).MergeArea.UnMerge

    If IsEmpty(.Cells(zeile, spalte).Value) = True Then
          If IsDate( .Cells(zeile, spalte).Value) = False Then
        .Cells(zeile, spalte).Style = "STANDARD"
      'NumberFormat changed to General as certain partners have changed Style:
      If objxl.ActiveWorkbook.Styles("Normal").NumberFormat <> "General" Then
            objxl.ActiveWorkbook.Styles("Normal").NumberFormat = "General"
        s_value = CStr(.Cells(zeile, spalte).value)
      End If
    Else
          'remove E+- formating
      If IsNumeric(.Cells(zeile, spalte).Value) And Len(.Cells(zeile, spalte).Value) > 11 And inStr(1,.Cells(zeile, spalte).Text, "E+",0) <> 0 Then
        s_value = CStr(FormatNumber(.Cells(zeile, spalte).Value,1,0,0,0))
        s_value = Left(s_value, Len(s_value) - 2)
      ' If cell value > 11
      ElseIf IsNumeric(.Cells(zeile, spalte).Value) And Len(.Cells(zeile, spalte).Value) > 11 And InStr(.Cells(zeile, spalte).Value, ",") <> 0 Then
         s_value = CStr(FormatNumber(.Cells(zeile, spalte).Value,20,0,0,0))
      End If
    End If
    if s_value = "" then s_value = CStr(.Cells(zeile, spalte).Value)
          CsvStr = CsvStr & """" & s_value & """" & listsep
      Next
      objFile.WriteLine(CsvStr)
    Next
  End With

end sub
'---------------`


text:
Q: How to run mulitple Kafka brokers using docker-compose? I am trying to run multiple Kafka brokers with docker-compose. I am going to use it both in Docker network and on local machine, that's why I am using different ports for brokers:
version: '3'

services:
  zookeeper_local_dev:
    image: wurstmeister/zookeeper
    container_name: zookeeper_local_dev
    ports:
      - "2181:2181"
  kafka_local_dev_1:
    image: wurstmeister/kafka
    hostname: kafka
    ports:
      - "9092:9092"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ADVERTISED_PORT: 9092
      KAFKA_ADVERTISED_HOST_NAME: kafka
      KAFKA_ZOOKEEPER_CONNECT: zookeeper_local_dev:2181
      KAFKA_LISTENERS: INTERNAL://kafka:9092
      KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
    depends_on:
      - zookeeper_local_dev
  kafka_local_dev_2:
    image: wurstmeister/kafka
    hostname: kafka
    ports:
      - "9093:9093"
    environment:
      KAFKA_BROKER_ID: 2
      KAFKA_ADVERTISED_PORT: 9093
      KAFKA_ADVERTISED_HOST_NAME: kafka2
      KAFKA_ZOOKEEPER_CONNECT: zookeeper_local_dev:2181
      KAFKA_LISTENERS: INTERNAL://kafka2:9093
      KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:9093
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
    depends_on:
      - zookeeper_local_dev

I am getting an error for the second broker when it's started:
org.apache.kafka.common.KafkaException: Socket server failed to bind to kafka2:9093: Unresolved address.
Could anybody assist?

A: Try this ...

*

*the point is hostname
...
  kafka_local_dev_2:
    image: wurstmeister/kafka
    hostname: kafka2
    ports:
      - "9093:9093"
    environment:
      KAFKA_BROKER_ID: 2
      KAFKA_ADVERTISED_PORT: 9093
      KAFKA_ADVERTISED_HOST_NAME: kafka2
      KAFKA_ZOOKEEPER_CONNECT: zookeeper_local_dev:2181
      KAFKA_LISTENERS: INTERNAL://kafka2:9093
      KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:9093
...

A: You should not change the internal port of kafka broker. It will remain 9092 which is exposed by the kafka container.
Try below
kafka_local_dev_2:
    image: wurstmeister/kafka
    hostname: kafka
    ports:
      - "9093:9092"
    environment:
      KAFKA_BROKER_ID: 2
      KAFKA_ADVERTISED_PORT: 9093
      KAFKA_ADVERTISED_HOST_NAME: kafka2
      KAFKA_ZOOKEEPER_CONNECT: zookeeper_local_dev:2181
      KAFKA_LISTENERS: INTERNAL://kafka2:9092
      KAFKA_ADVERTISED_LISTENERS: INTERNAL://localhost:9093
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
    depends_on:
      - zookeeper_local_dev


text:
Q: What was the availability of silk in the Waste among the Aiel? In The Shadow Rising, Mat notes that

Laces and velvets vanished as soon as they were brought out, for astonishing quantities of silver and gold, and ribbons for not much less, but the finest silks just lay there. Silk was cheaper in trade to the east, he overheard a Shaido tell Kadere.

We also learn that an extensive trade route with silk runs through, or did run through the Waste, between Shara and Cairhien, and that the Aiel themselves trade extensively with the Sharans.
However, Aviendha in A Crown of Swords:

—and here she wore a silk dress—of which she now owned four!—and silk stockings instead of stout wool, and a silk shift that made her aware of her skin in a way she never had been before. She could not deny the beauty of the dress, no matter how odd it was to find herself wearing such things, but silk was precious, and rare. A woman might have a scarf of silk, to be worn on feastdays and envied by others. Few women had two. It was different among these wetlanders, though.

What is the actual availability of silk in the Waste?