text:
Q: Display list of values in database $sql   = "SELECT * FROM themes";
$query = mysqli_query($db_conx, $sql);

while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
    $id           = $row["id"];
    $name         = $row["name"];
    $developers   = $row["developers"];
    $description  = $row["description"];
    $category     = $row["category"];
    $logo         = $row["logo"];
    $officialLink = $row["link"];

    //////////////////////

    $sql          = "SELECT * FROM file WHERE software_id = '$id'";
    $query        = mysqli_query($db_conx, $sql);
    while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
        $version = $row["version"];
        $file    = $row["file"];
        $link    = $row["link"];
        $created = $row["created"];

        $versions .= '

 ' . $version . '
';
        $logos = "";
    }

    //////////////////////

    $solfList .= '

' . $name . '

                ';

}

This code displays only one value. I want to display all values stored in table. I have got this code. but I can't understand where I have made a mistake.

A: Because of using same variable in both the sql you are losing the values of first loop. So use two different variable of both of queries and their results.
$sql = "SELECT * FROM themes";
$query = mysqli_query($db_conx, $sql);
            while ($row_outer = mysqli_fetch_array($query, MYSQLI_ASSOC)){
            $id = $row_outer["id"];
            $name = $row_outer["name"];
            $developers = $row_outer["developers"];
            $description = $row_outer["description"];
            $category = $row_outer["category"];
            $logo = $row_outer["logo"];
            $officialLink = $row_outer["link"];
            //////////////////////
            $solfList = "";
            $sql_inner = "SELECT * FROM file WHERE software_id = '$id'";
            $query_inner = mysqli_query($db_conx, $sql_inner);
                while ($row_inner = mysqli_fetch_array($query_inner, MYSQLI_ASSOC)){
                $version = $row_inner["version"];
                $file = $row_inner["file"];
                $link = $row_inner["link"];
                $created = $row_inner["created"];
                    $versions .='

 ' .$version. '
';
                    $logos = "";
            }
                    //////////////////////
                $solfList .='

' .$name. '

                ';

            }

A: Just like I said, by running the inner query you're losing all the outer query result set. So your code should be like this:
$sql = "SELECT * FROM themes";
$query = mysqli_query($db_conx, $sql);
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)){
$id = $row["id"];

// your code

$sql = "SELECT * FROM file WHERE software_id = '$id'";
$result = mysqli_query($db_conx, $sql);
    while ($r = mysqli_fetch_array($result, MYSQLI_ASSOC)){
        $version = $r["version"];

        // your code

    }

    // your code

}


text:
Q: GDAL extracted EPSG not compatible with Fiona I am creating Shapefiles from features extracted from JP2 images in python. My current method of creating Shapefiles by extracting the EPSG from the source image with GDAL  and using Fiona is as below and works for most images.
# getEPSG from image
ds = gdal.Open("jp2_image.jp2", gdal.GA_ReadOnly)
proj = osr.SpatialReference(wkt=ds.GetProjection())
epsg = proj.GetAttrValue('AUTHORITY',1)

# create shape file
with fiona.open(shp_file_output, 'w', 'ESRI Shapefile', schema=schema, crs=from_epsg(espg)) as shp_file:
        shp_file.write({
            'geometry' : {'type':'MultiPolygon',
            'coordinates': [multi_polygon]},
            'properties': {
                'tag': 'Image features'
            }
        })

However, I received some new images and Fiona throws an error with the extracted EPSG.
Invalid input to create CRS: {'init': 'epsg:6326', 'no_defs': True}

What is interesting is I can see the correct EPSG in the image metadata, the EPSG being 32756. When I manually enter 32756 the shapefiles are correctly generated.
with fiona.open(shp_file_output, 'w', 'ESRI Shapefile', schema=schema, crs=from_epsg(32756)) as shp_file:

Here is the get projection output for the file that works:
'PROJCS["GDA2020 / MGA zone 56",GEOGCS["GDA2020",DATUM["Geocentric_Datum_of_Australia_2020",SPHEROID["GRS 1980",6378137,298.257222100887,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1168"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","7844"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","7856"]]'

and for file that doesn't, no mention of 32756:
'PROJCS["WGS_84_UTM_zone_56S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS84",6378137,298.257223563],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'

How do I get GDAL to return the correct EPSG needed to locate the Shapefiles correctly?

A: The authority code you're extracting isn't always the code for the whole coordinate system. In this case, GDAL is giving you the code for the WGS84 datum EPSG:6326 (not the WGS84 Geodetic CRS which is EPSG:4326).
Simplest way of doing this is to pass the wkt to fiona.open and let fiona generate a CRS.
Basic example:
import fiona

# wkt = ds.GetProjection()  # commented out just to demo, hardcoded wkt below is the same as yours.
wkt = 'PROJCS["WGS_84_UTM_zone_56S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS84",6378137,298.257223563],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'
schema = {'geometry': 'Point', 'properties': {'id': 'int'}}

with fiona.open('/tmp/test.shp', 'w', 'ESRI Shapefile', schema, crs=wkt) as layer:
    print(layer.crs)  # I'm creating an empty file here just to  demo...

{'init': 'epsg:32756'}

And if you use rasterio instead of GDAL, you can just pass the raster dataset crs property to fiona:
import fiona
import rasterio

with rasterio.open('your.jp2') as src:
    crs = src.crs

schema = {'geometry': 'Point', 'properties': {'id': 'int'}}

with fiona.open('/tmp/test.shp', 'w', 'ESRI Shapefile', schema, crs=crs) as layer:
    pass

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can I use family sharing but still buy/download apps without permission? I'm using family sharing to get the Apple Music family discount, but the only problem is that it stops me buying apps with my own account, and instead requires the family sharing organiser to buy them. This is the same even with free apps, which seems a bit weird.
Is there any way to keep family sharing, but use my own account for buying apps?

A: Ask to Buy funnels all requests for app or media content purchases to the Family Organizer, and anyone else they have designated as a Parent/Guardian, to approve the purchase. For a paid app or media content, once approved it is bought with the credit card designed by the Family Organizer.
When setting up Family Sharing, all Apple IDs which have an age of 13 or less automatically have Ask to Buy enabled for them. When inviting those aged 13 to 17, iOS prompts you to enable Ask to Buy.
Once enabled, the Family Organizer can later disable it for each individual. If their account reflects that they are over 18 when it is disabled, it cannot be reenabled for that account. Similarly, Ask to Buy is not even an option for users who are invited after they turn 18.
In your case, your ID is set up for Ask to Buy. You can give your Family Organizer a link to the Ask to Buy Apple Support page for details on how to disable it. It has to be done from their device.
Free apps are included in Ask to Buy for two reasons:

*

*Ask to Buy is not just about the cost of the purchase, it is also about parental review of the content of the app/media content

*Free apps can (and often do) still have in-app purchases, though an Ask to Buy user attempting to do this will still have to get permission to complete the in-app purchase


text:
Q: JS For loop is just not iterating, Why? So, I am making this discord bot and I wanted to make it so if someone's message gets deleted, It can be stored onto a .txt file, And if someone wanted, They could just type in a command and the bot will show the list of deleted messages.
So, when the command is fired, it will need a number parameter and that parameter will be the number of messages that will be shown.
Let's call that number numberOfSnipes
The code will get the .txt file and turn it into an array by splitting each line and putting it in one array.
As so,
fs.readFile('deletedMsgs/' + message.guildId + '.txt', function (err, data) {
  messagesArray = data.toString().split('\n');
});

As the code says, It will be called messagesArray
Now the problem comes here, We will need to iterate through the array and get the number of messages needed, This will be put into another array which will be called messagesToShow
So, I tried coding that and failed,
Code:
messagesToShow = []
for (let i = messagesArray.length; i < messagesArray.length - numberOfSnipes; i--) {
     console.log(i)
     messagesToShow.push(messagesArray[i])
}

FYI, console.log(i) did not log anything.
I tried to log messagesArray, It logged an empty array
Keep in mind that numberOfSnipes and messagesArray were both logged and they returned the right information.
Since, This can be more easier for you all. To solve, I will provide the whole code:
if (message.content.toLowerCase().startsWith(config.prefix + 'snipelist')) {
  numberOfSnipes = parseInt(message.content.split(' ')[1]);
  if (fs.existsSync('deletedMsgs/' + message.guildId + '.txt')) {
    fs.readFile(
      'deletedMsgs/' + message.guildId + '.txt',
      function (err, data) {
        messagesArray = data.toString().split('\n');
        console.log(messagesArray);
        if (numberOfSnipes > messagesArray.length) {
          message.reply('Unable to return messages.');
        } else {
          messagesToShow = [];
          for (
            let i = messagesArray.length;
            i < messagesArray.length - numberOfSnipes;
            i--
          ) {
            console.log(i);
            messagesToShow.push(messagesArray[i]);
          }
          console.log(messagesToShow);
          finalMessage = ' ';
          for (let letter in messagesToShow.toString()) {
            if (letter != ',') {
              finalMessage += letter;
            } else if (letter == ',') {
              finalMessage += '\n';
            }
          }
          message.reply(finalMessage);
        }
      }
    );
  }
}

Any help is appreciated.


text:
Q: "The closure of the unit ball of $C^1[0, 1]$ in $C[0, 1]$" and its compactness [I really want to apologize if this problem looks a little too long.]
The problem :
This is taken from here [Question. 3.7 (c)] and it says...

Prove or disprove the comapctness of the closure of the unit ball of $C^1[0, 1]$ in $C[0, 1]$.

What have I tried?
I think it's pretty clear that the unit ball in $C^1[0,1]$ is $B= \{f \in C^{1}[0,1]: \lVert f \rVert \leq 1\}$. Let us denote $K= \operatorname{cl}_{C[0,1]}(B)$, the closure of $B$ in $C[0,1]$.
I really didn't have much clue how to start working on this problem but finally thought about using the sequential approach. If $a$ and $b$ are two points such that $0<a<b<1$ then I think there can be functions $f_a$ and $f_b$ having the property that $\lVert f_a-f_b \rVert = 1$ which are sufficiently smooth to be in $C^1$.  Now as it is quite tedious to construct these functions explicitly, I scanned a hand-drawn picture of what I think they might look like.

Here $f_a$ and $f_b$ take zero values in almost all of the interval $[0,1]$ and jumps up at $a$ and $b$ respectively. Also, as is clear from the figure, they don't assume non-zero values simultaneously. Now, my argument is clear: however close the two points $a$ and $b$ come to each other (remaining distinct) there will always be functions like $f_a$ and $f_b$. They may get steeper and steeper but will never lose their $C^1$-ness.
So if I consider the sequence $(\frac{1}{n})$ in $[0,1]$, I will get a sequence $(f_{\frac{1}{n}})$ in $B (\subseteq K)$ where for $m \neq n$ we will have $\lVert f_{\frac{1}{m}} - f_{\frac{1}{n}}\rVert = 1$. Hence the sequence $(f_{\frac{1}{n}})$ cannot have a convergent subsequence, thereby proving that $K$ is not sequentally compact and hence not compact.
But I'm not very sure about all these. A friend of mine told me that this same problem has a positive answer and that made me sufficiently confused.
So, here comes my question...

In the above argument, where have I gone wrong?
  What is the real answer? And how to prove it?

Thanks a million for reading my extra-long question. And thanks a zillion for any help that you can offer.

A: Ascoli-Arzelá requires says that a set $\scr F$ in $C^0([0,1])$ is compact iff it is:
1) closed, 2) bounded (or ``equibounded'') and 3) equicontinuous.
If if $L=\{f\in \cal C^1:\max\{||f'||_\infty,  ||f||_\infty\} <1 \}$ is considered as a subset of $C^0$ then
1) it is equibounded because it is a subset of the unit ball in $\cal C^0$ (i.e. $||f||_\infty<1$);
2) it is equicontinuous because all $f\in L$ are Lipshitz with constant at worst $1$ (by the "mean value theorem" of calculus).
3) As written it is clearly not closed in $\cal C^0$; but the question asks for its closure in $\cal  C^0$, so that comes for free.
What I am not sure of, is whether the closure in $\cal C^0$ coincides with the closure in $\cal C^1$, but I doubt it.

A: This is basically a rehash of what Martin put in his comments following my question.
With the norm that I had in mind while posting this problem (the sup-norm $\lVert \rVert _{\infty}$ on $C^1[0,1]$), the argument which I originally laid out, works well. Therefore, $K$ is not compact in $(C^1[0,1], \lVert \rVert _{\infty})$.
But, as Martin kindly pointed out, the usual norm on $C^1[0,1]$ is not the sup-norm but the norm defined by $\lVert f \rVert _{C^1[0,1]}= \operatorname{max}\{\lVert f \rVert_{\infty}, \lVert f' \rVert_{\infty}\}$. If we consider this norm then, the unit ball changes to $B' = \{f \in C^1[0,1]: \lVert f \rVert_{C^1[0,1]} \leq 1\} = \{f \in C^1[0,1]: \lVert f \rVert_{\infty} \leq 1, \lVert f' \rVert_{\infty} \leq 1\} $. Here my original argument fails, because as the functions $f_{\frac{1}{n}}$ get very steep with each increasing $n$, their derivatives become unbounded. Hence they cannot belong in $B'$.
Evebtually, by an application of Arzelà–Ascoli theorem in $(C^1[0,1], \lVert \rVert_{C^1[0,1]})$, the set $K$ turns out to be compact. But since I don't have much experience about that theorem (and about stuff like uniform boundedness, equicontinuity etc.), I won't risk any half-hearted attempt to prove this claim.

A: The argument for the positive answer is a straightforward application of the Arzela-Ascoli theorem. Recall that a set $B \subset C[0,1]$ is sequentially compact in the uniform ($\|\cdot\|_{\infty}$) topology on $C[0,1]$ iff it is equicontinuous and uniformly bounded. I will first define these terms and will then show they hold in this case.
Equicontinuity: for all $\epsilon > 0$ there exists $\delta > 0$ such that for any $f \in B$ and any $x,y \in [0,1]$, we have $|x-y| < \delta$ implies $|f(x) - f(y)| < \epsilon$. Note that we're demanding that the modulus of continuity may be uniformly chosen across $B$.
Uniform Boundedness: There is an $M > 0$ such that for any $f \in B$, $\|f\|_{\infty} \leq M$.
Indeed, $B = \{f \in C^1[0,1] \mid \|f\|_{\infty} \vee \|f'\|_{\infty} \leq 1\}$ and so immediately we have uniform boundedness for $M = 1$. For equicontinuity, recall by the mean value theorem that for any $f \in B$,
$$
|f(x) - f(y)| \leq \|f'\|_{\infty}|x-y| \leq |x - y|
$$
which means that for the $\epsilon$ challenge, we may take $\delta = \epsilon$ for any $f \in B$.


text:
Q: Is it possible to freeze a version in SonarQube's time machine? Is it possible to freeze a version in SonarQube's time machine and make this snapshot always visible in the history chart? For example I have tagged a version in Git as v1.0 and I want this to be always in the chart so I can compare it with the latest versions and track the progress. Is the only way to launch Sonar Maven each time on this version?

A: It is possible to set a version on SonarQube snapshot. You can then use this version in the differential period including the leak period.
Note also that adding an event to a snapshot prevent the snapshot to get deleted from the history. Find more information about this in History and Events documentation.
You can set a version to a snapshot from SonarQube UI in the history of project's analyses (project administration permission is required).


text:
Q: Type '{ children: string; exact: true; activeClassName: string; className: string; to: string; }' is not assignable to type 'IntrinsicAttributes & Nav Hello I am a beginner getting started with React Router -v^6.2.2, and generated the basic sources with create-react-app on template typescript -v4.6.2.
It works but I have this error on my console Visual studio code.
I have a problem on exact and activeClassName on the tag NavLink.
Error message:
"Type '{ children: string; className: string; activeClassName: string; exact: true; to: string; }' is not assignable to type 'IntrinsicAttributes & NavLinkProps & RefAttributes'. Property 'activeClassName' does not exist on type 'IntrinsicAttributes & NavLinkProps & RefAttributes'. "
import { NavLink } from "react-router-dom";
import '../styles/styles-pages/navigation.scss'
export const Navigation = () => {
return (

Home

Discution

)
}

A: In react-router-dom@6 the NavLink component hasn't any activeClassName and exact props.
NavLink

declare function NavLink(
  props: NavLinkProps
): React.ReactElement;

interface NavLinkProps
  extends Omit<
    LinkProps,
    "className" | "style" | "children"
  > {
  caseSensitive?: boolean;
  children?:
    | React.ReactNode
    | ((props: { isActive: boolean }) => React.ReactNode);
  className?:
    | string
    | ((props: {
        isActive: boolean;
      }) => string | undefined);
  end?: boolean;
  style?:
    | React.CSSProperties
    | ((props: {
        isActive: boolean;
      }) => React.CSSProperties);
}

Remove the activeClassName prop from your links. If you still need to apply an active class then use a function on the className prop and access the isActive prop.
import { NavLink } from "react-router-dom";
import '../styles/styles-pages/navigation.scss'

export const Navigation = () => {
  return (
    <div id="navigation_div_container">
        <NavLink
          className={({ isActive }) =>
            [
              "link_nav",
              isActive ? "active" : null,
            ]
              .filter(Boolean)
              .join(" ")
          }
          end // <-- prevents matching on sub-routes, similar to exact
          to="/"
        >
          Home
        </NavLink>
        <NavLink
          className={({ isActive }) =>
            [
              "link_nav",
              isActive ? "active" : null,
            ]
              .filter(Boolean)
              .join(" ")
          }
          to="/discution"
        >
          Discution
        </NavLink>
    </div>
  );
};


text:
Q: Question about the cell cycle A diploid cell in G1 has 6 chromosomes. How many chromosomes and how many chromatids are present in each of the following stages?
Here is what I am guessing
G1: 6 chromosomes ;  6 chromatids
G2: 6 chromosomes ; 12 chromatids
Prophase: 6 chromosomes; 12 chromatids
Metaphase: 6 chromosomes; 12 chromatids
Anaphase: 12 chromosomes; 12 chromatids
Telophase: 12 chromosomes; 12 chromatids


text:
Q: Windows 8.1 Desktop background turns black upon closing personalization settings w/ external monitor I'm having some trouble changing the desktop background for my external monitor on windows 8.1. For setting the background on just my laptop, I can right click the picture and hit Set as desktop background, which works OK for that background, but doesn't work for my external.
When I go to the personalization settings, if I try to set a new background for my external monitor (by going to the wallpaper settings, right clicking on the image and hitting Use for monitor 2) or if I try to use one of my pre-existing themes, it changes correctly and everything looks fine until I close the window, at which point any changes I made go away and the background on both monitors reverts to solid black.
Once I've opened the personalization settings and changed the theme (to one of my custom ones, the built-in themes don't have this problem) the only way to get the background to display (without leaving the personalization window open) is to reboot the computer.
I know my copy of Windows is activated, I'm not in high contrast mode, and I've seen the techniques people have suggested here, but none of these have worked for me, especially having an extra monitor and all. Does anyone know if there's some sort of registry hack to stop this annoying behavior?

A: Before even finishing this post I stumbled across a video that very closely reproduces the problem. Turns out that all I needed to do to fix this was re-enable the 'show desktop icons' setting, which made the background reappear. After that I was able to turn them off again with no ill effects.

A: I had this problem. When reading this It reminded me that I had gone into ease of access to mess with the animations and turn them off. Sure enough, I had checked one for turning off desktop images. When unchecked , a picture came on instantly.


text:
Q: Angular2 ng-bootstrap: Reuse modal template with different data I am building a dashboard-like interface with a set of entities containing comparable data. Each of these entities have an edit-button which I would like to use to open a modal with the respective data displayed.
I would like to reuse the same modal template, and display the data from the entity who's edit-button was clicked. I am using Angular2 with ng-bootstrap, which relies on Bootstrap 4.
From the ng-bootstrap modal docs, and it's accompanying plunkr, I was able to create my own working modal component like so (simplified for layout):
//editmodal.html

<template #content let-c="close" let-d="dismiss">
  //Modal html content
</template>

<button class="btn btn-lg btn-outline-primary" (click)="open(content)">Edit</button>

//dashboard.html

<template ngbModalContainer></template>
<edit-modal></edit-modal>

//editmodal.component.ts

@Component({
  selector: 'edit-modal',
  templateUrl: 'entity/assets/templates/editmodal.html'
})

export class EditModal {
  //exported class logic
}

The main thing which struck me as odd, coming from the previous bootstrap version, is that the button to open the modal is now displayed within the template itself, encapsulating it. This makes it hard to attach a reference to it so I could figure out what to show from the class logic. How can I achieve this behaviour with Angular2 and ng-bootstrap?

A: You can open a modal window that holds a component from anywhere with the NgbModal service.
Call this.ngbModalService.open(NgbdModalContent) where NgbdModalContent is the component you are going to display in your modal.
Check out Components as content:
https://ng-bootstrap.github.io/#/components/modal

A: Similar to what Lev wrote in his answer, you can use the NgbModal.open() method and pass it a component to populate the content of a modal.
Now, you don't just want a component. You also want the component to fetch the data from an API. You can do this by combining the NgbModalRef.componentInstance parameter, with the OnInit interface.
So the solution would be something like this:
constructor(
  private modalService: NgbModal
) { }

openModal() {
  const modalRef = this.modalService.open(MyComponent)
  modalRef.componentInstance.mycomponent_id = 1;
}

Your component look like this:
export class PlayerComponent implements OnInit {
  @Input() mycomponent_id;
  myObject: MyObject;

  ngOnInit() {
    this.myService.getObject(mycomponent_id)
      .subscribe(value => this.myObject = value);
  }
  ...
}

So basically to summarize it. You open the modal by passing it the component you want as content. Then you set the mycomponent_id value from outside your component. After this your component will run the ngOnInit() method which allow you to use the mycomponent_id value to fetch the correct data from your API using your service.


text:
Q: Chrome isn't displaying borders (sometimes) So, my site (www.around-around.com), has a lot of borders and they work fine on Safari, FF, and IE; but on Chrome, occasionally, they disappear. I've searched through the code and it doesn't make sense to me.
If you go to http://www.around-around.com/8/ on FF, you'll see the borders around the article. But on Chrome, they disappear.
The relevant CSS is:
#page {
background: none repeat scroll 0 0 #FFFFFF;
border-left: 1px dotted #222222;
border-right: 1px dotted #222222;
margin: 0 auto;
width: 1148px;
}
.singular #primary {
margin-bottom: 0;
padding: 0 0 20px 20px;
width: 787px;
border-right: 1px dotted #222222;
float: left;
}

(and #primary)
I'm totally baffled. On other pages, such as http://www.around-around.com/dream-perfume/ , Chrome displays the borders fine. The code is exactly the same - the only difference is the post content.

A: I had this problem, too.
Chrome didn't seem to like this.
{border: <size> <style> <color>;}

It only worked if I put the parameters in separately like this.
{
    border: <size>;
    border-style: <style>;
    border-color: <color>;
}

A: I believe you are hitting http://code.google.com/p/chromium/issues/detail?id=32702
EDIT:
The bug has been fixed, verified against Chromium src@139014! Should go live in Chrome 21.

A: because default border-style in Chrome is "none".
for each border attribute in Chrome you must assign border-style value.

A: I had this issue recently (Chrome 72), long after the bug was marked as resolved in the Chromium project. Disabling hardware acceleration solved the issue.

A: Year 2023 but I still get this bag on client notebook on latest Chrome 110.0.5481.178


text:
Q: How to setup a Docker VM with a developer ssl certificate? I use the ASP.NET Core 7 I just learn the Docker and the ASP.NET Core now. I wanna deploy My first developer machine to use the ASP.NET Core 7 under the Debian Linux v11. I have next docker file:
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 5000

ENV ASPNETCORE_URLS=http://+:5000

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
RUN openssl req -new -newkey rsa:4096 -x509 -sha256 -days 9999 -nodes -out MyCertificate.crt -keyout MyKey.key -subj "/C=US/ST=Utah/L=Lehi/O=Your Company, Inc./OU=IT/CN=yourdomain.com"
RUN cp MyCertificate.crt /usr/local/share/ca-certificates/
RUN dotnet dev-certs https -ep /usr/local/share/ca-certificates/MyCertificate.crt --trust --format PEM
COPY ["webapi/webapi.csproj", "webapi/"]
RUN dotnet restore "webapi\webapi.csproj"
COPY . .
WORKDIR "/src/webapi"
RUN dotnet build "webapi.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "webapi.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=build /usr/local/share/ca-certificates/ /usr/local/share/ca-certificates/
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "webapi.dll"]

All rows is default, but next is of mine:
RUN openssl req -new -newkey rsa:4096 -x509 -sha256 -days 9999 -nodes -out MyCertificate.crt -keyout MyKey.key -subj "/C=US/ST=Utah/L=Lehi/O=Your Company, Inc./OU=IT/CN=yourdomain.com"
RUN cp MyCertificate.crt /usr/local/share/ca-certificates/
RUN dotnet dev-certs https -ep /usr/local/share/ca-certificates/MyCertificate.crt --trust --format PEM

I'm trying educate My Default Docker machine use SSL. But I have no an idea how is it.
Could you give me an advice. All 3 commands must work:
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 9999 -nodes -out MyCertificate.crt -keyout MyKey.key -subj "/C=US/ST=Utah/L=Lehi/O=Your Company, Inc./OU=IT/CN=yourdomain.com"
cp MyCertificate.crt /usr/local/share/ca-certificates/
dotnet dev-certs https -ep /usr/local/share/ca-certificates/MyCertificate.crt --trust --format PEM

I tried to use that commands. Also I used it in the Debian, but I couldn't save a Docker machine state.


text:
Q: MongoDB not saving correct data and duplication records instead I have an express app.
In app.js I require mongoose and connect to my db.
Here is the code for that which is in my app.js:
var mongoose = require("mongoose");
mongoose.connect(CONNECTION STRING IS IN HERE);

In ./schemas I have a timelineItems.js which module.exports my model.
Here is that model:
var mongoose = require("mongoose");

var timelineItemsSchema = mongoose.Schema({
    postedTime: String,
    postedPlace: String,
    postedContent: String,
    postedTitle: String,
});

var timelineItems = mongoose.model('timelime_items', timelineItemsSchema);

module.exports = timelineItems;

In admin-panel I require that schema and assign it to the variable timelineItems, I then say that timelineItem is a new version of that and pass in the req.body (to capture the data posted to the create route), here is that code:
router.post('/:action', function (req, res, next) {
    if (req.cookies.loggedIn) {
        if (req.params.action.toLowerCase() == "create") {

            var timelineItems = require("../schemas/timelineItems.js");

            console.log(req.body)

            var timelineItem = new timelineItems(req.body);

            console.log(timelineItem)

            timelineItem.save(function (err, item) {
                if (err) return console.error(err);
                res.send("item saved!");
                console.log(item)
            });

        } else {
            res.send("invalid post request - wrong route selected.");
        }

    } else {
        var err = new Error('Access forbidden, please login!');
        err.status = 403;
        next(err);
    }
});

All is good. When I post to the /admin-panel/create route, I get 3 console.log results in my terminal, as follows:
The posted data (req.body):

The timelineItem:

The returned item from the .save function:

Now, this is all well and good, but 4 times I have tried sending data, 4 times the terminal has shown the data as I would expect but when I go to the mlab mongoDB and look at the collection, It is saving random code with a different ID from the one I see in the terminal and also, it doesnt even save the data!!
I am so confused, how can the terminal tell me one thing but the database show another?
Here is a screenshot of the last 4 db entries with their ID's to show you that the data I sent is not among them, nor is the ID that is shown to me, the one in the DB, infact, none of the post requests I have sent and have had return showing as good in the console, actually saved correctly...

Am I doing something wrong here? I dont believe that I am, so why is it not saving the correct data and instead duplicating the last record already in the collection and just incrementing the id?
I am seriously confused, any ideas?


text:
Q: What is the best way to get a form row into a table? I'm building an app that displays a table with some information. I want the user to be able to click on the cells and have a row slide out below it containing a form in which an action can be made.
so it would look like this:

    some info 1
    some info 2
    some info 3

    <form> some form that spans the entire row + submit button </form>

</table

The form would be hidden and by clicking on one of the cells the form would slide down.
The problem i'm facing is that it is not possible to render a form as a table row. I have read multiple sources that say it can't be done. I can render it inside a single cell but the form is too big for that.
One solution i read would be to wrap the entire table with a form tag and have multiple submit buttons. This to me feels like bad practice and I'm not sure it would work.
I've also looked into recreating the table with div's however every solution i find uses 'display: table' which has the exact same problem.
What is the best way to handle this? (i'm using Ruby on Rails)

A:

    1
    2
    3

   <form action="">
     <input type="text">
   </form>

have you tried using colspan?

A: My advice is to replace table with divs if your project allows you to do it. You can use bootstrap (https://getbootstrap.com/examples/grid/) for making this easier.
Why:
1. Cleaner code
2. You can manipulate the divs easier than table raws/cells...
3. You can duplicate div as fast as tr .
Give it a try and than take your decision.


text:
Q: Can't display Google+ and Facebook Like on the same line I have been banging my head for last many hour to get this solved but it is not working.
I want to display Facebook Like box, Twitter and Google + on one line but it displays them on different lines and just shows Facebook Like box correctly.
Here is the code I am using:

Tweet

<g:plusone size="medium" annotation="inline"></g:plusone>

CSS file is here:
http://www.box.net/shared/2agu4dy10mb4y3pj7e1m

A: please try

Tweet

<g:plusone size="medium" annotation="inline"></g:plusone>

A: *

*wrap the elements in

*style them display:inline

*omit the data-width attribute from the
 tag.

css:
ul.social { list-style: none outside none; }
ul.social > li { display:inline; }

html:

    <{{ twitter button }}>

A: The solution may be far easier -- the default width of the Facebook button is 250, open up the html and reduce it to 75 or so.

A: iFrame is a block-level element by default. You'll have to make the display:inline in the CSS.
g:plusone might be one too, but I've never heard of that tag.

A: put padding-top:5px; on the one that is on the second line.

A: If CSS tweaks do not help make sure that your document is not rendering in quirks mode. Sometimes quirks rendering mode causes the +1 button to display on the next line.
You can check for this using Firefox webmaster tools or try tossing your page into a validator (http://validator.w3.org/) to make sure there aren't too many errors.

A: This code works:

                        <g:plusone size="tall" href="http://gnosisarts.com/home/Internet_PR"></g:plusone>

#
Just change the social share URLs and other params to your own sites accordingly.
Eric


text:
Q: Swift: Cannot convert value of type ViewController to expected argument type SKNode I'm implementing and extension of my viewController and implementing SpriteKit scene in the extension. But I'm getting an error touchesBegan function. This is my implementation:
import UIKit
import SpriteKit

extension ViewController{

    func makeScene() -> SKScene {

        let scene = SKScene.init(size: CGSize(width:view.frame.width-50,height:view.frame.height-50))
        scene.backgroundColor = .black
        return scene
    }

    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        let  touch = touches.first
        firstPoint = touch!.locationInNode(self)
    }
}

On this line firstPoint = touch!.locationInNode(self) I'm getting this error:
Cannot convert value of type ViewController to expected argument type SKNode
Any of you knows why I'm getting this error? or if there is any workaround this error?
I'll really appreciate your help.


text:
Q: IONIC 2, npm ERR! code ELIFECYCLE I was creating a project and, after the latest updates (without SCSS)I read on some websites about the error in SCSS, but it did not work when I followed the procedure. I'm not sure if the error is this , the ionic serves me returns this error:

And the generated log is this:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Kevin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'ionic:serve',
1 verbose cli   '--',
1 verbose cli   '--v2',
1 verbose cli   '--address',
1 verbose cli   '0.0.0.0',
1 verbose cli   '--port',
1 verbose cli   '8100',
1 verbose cli   '--livereload-port',
1 verbose cli   '35729' ]
2 info using npm@4.4.4
3 info using node@v6.10.1
4 verbose run-script [ 'preionic:serve', 'ionic:serve', 'postionic:serve' ]
5 info lifecycle ionic-hello-world@~preionic:serve: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~preionic:serve: no script for preionic:serve, continuing
7 info lifecycle ionic-hello-world@~ionic:serve: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~ionic:serve: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~ionic:serve: PATH: C:\Users\Kevin\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\Kevin\Documents\IONIC\Idestudos\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Users\Kevin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Kevin\AppData\Roaming\npm
10 verbose lifecycle ionic-hello-world@~ionic:serve: CWD: C:\Users\Kevin\Documents\IONIC\Idestudos
11 silly lifecycle ionic-hello-world@~ionic:serve: Args: [ '/d /s /c',
11 silly lifecycle   'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"' ]
12 silly lifecycle ionic-hello-world@~ionic:serve: Returned: code: 1  signal: null
13 info lifecycle ionic-hello-world@~ionic:serve: Failed to exec ionic:serve script
14 verbose stack Error: ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\Kevin\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\Kevin\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:886:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid ionic-hello-world@
16 verbose cwd C:\Users\Kevin\Documents\IONIC\Idestudos
17 verbose Windows_NT 10.0.14393
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Kevin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
19 verbose node v6.10.1
20 verbose npm  v4.4.4
21 error code ELIFECYCLE
22 error errno 1
23 error ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
23 error Exit status 1
24 error Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the ionic-hello-world package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs ionic-hello-world
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls ionic-hello-world
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]


text:
Q: Get alternative text and source attributes of an image using JavaScript (not jQuery) I have the following markup:

I would like to get the values of "src" and "alt", and use them in a little different way, along with removing the image element from the page.

        Title of Site

I'm not too familiar with plain ol' JavaScript, so, this has me quite stumped.
Any thoughts on how to solve this?

A: window.addEventListener('load', function load(){
    var logo = document.getElementById('logoImage'),
        img,
        parent;

    if (!logo) {
        return;
    }

    img = logo.querySelector('img');

    if (!img) {
        return;
    }

    parent = img.parentNode;

    parent.style.backgroundImage = 'url(' + img.src + ')';
    parent.style.display = 'block';
    parent.style.width = img.width + 'px';
    parent.style.height = img.height + 'px';
    parent.textContent = img.alt;
});

http://jsfiddle.net/q7brkkbt/1


text:
Q: sqoop with sql server retrieving more records Q: I want to import 5000 rows from SQL server using SQOOP but its giving me 20000 rows. I am using below query.
sudo -E -u hdfs sqoop import --connect "jdbc:sqlserver://hostname;username=*****;password=*****;database=*****" --driver com.microsoft.sqlserver.jdbc.SQLServerDriver --query "select top 5000 * from Tb_Emp  where \$CONDITIONS" --split-by EmpID -m 4 --target-dir /home/sqoop_SQLServeroutput

retrieved 20000 records
every mapper is getting 5000 records. but if i do this on mysql then it gives 5000 records as expected.
sudo -E -u hdfs sqoop import --connect jdbc:mysql://hostname/<database_name> --username **** --password **** --query 'select * from Tb_Emp where $CONDITIONS limit 5000' --split-by EmpID -m 4 --target-dir /home/sqoop_MySqloutput

retrieved 5000 records.
don't why its happening.

A: Using the "top x" or "limit x" clauses do not make much sense with Sqoop as it can return different values on each query execution (there is no "order by"). Also in addition the clause will very likely confuse split generation, ending with not that easily deterministic outputs. Having said that I would recommend you to use only 1 mapper (-m 1 or --num-mappers 1) in case that you need to import predefined number of rows. Another solution would be to create temporary table with the required data on the MySQL/SQL Server side and import this whole temp table with Sqoop.


text:
Q: how do i load content into a page from another page with the associated jquery function that makes it work (slider) yes that's right , I have a slider on html page B and have a menu option that when selected on html page A will load the content of a div in this case a slider into the space defined as tile-are-main... question is how do I also load the associated jquery that makes the slider work ? ?
The line of code to load the content is as follows....
main html page menu option
 $(".tile-area-main").load("referrals.html .slider");

html page B where slider and content resides....

lets just say for arguments sake that there is a script and a js file that are both assocaited with the slider working properly.....
EDIT ....
actually this is the code that makes the slider work .....

A: You need to make that code from page B available on page A. Using load will not execute the js. Ideally, you could create a function and then, just call the function, instead of writing all that code on 2 separate pages.
From jQuery: jQuery uses the browser's .innerHTML property to parse the retrieved document and insert it into the current document. During this process, browsers often filter elements from the document such as , , or  elements. As a result, the elements retrieved by .load() may not be exactly the same as if the document were retrieved directly by the browser.
Script Execution
When calling .load() using a URL without a suffixed selector expression, the content is passed to .html() prior to scripts being removed. This executes the script blocks before they are discarded. If .load() is called with a selector expression appended to the URL, however, the scripts are stripped out prior to the DOM being updated, and thus are not executed.
Read More here: http://api.jquery.com/load/

/**
 * Add to both page A and page B.
 * diysInit.js or in your concatenated and minified file
 * @example diysInit();
 */

function diysInit() {
  $(".slider").diyslider({
    width: "400px",
    height: "400px",
    animationEasing: "linear",
    animationDuration: 2000,
    animationAxis: "y"
  });

  // set up a timer to change slides automatically
  $(".slider").diyslider("move", "forth");
  setInterval(function() {
    $(".slider").diyslider("move", "forth");
  }, 2000);
}

A: try
 $(".tile-area-main").load("referrals.html .slider" , function(){
       $(".slider").diyslider();
});


text:
Q: Javascript platformer lever reader? I'm making an HTML5/Javascript platformer (or at least trying to) and I'm wondering how to make it read something like this level plan below:
var simpleLevelPlan = '
......................
..#................#..
..#..............=.#..
..#................#..
..#.@......#####...#..
..#####............#..
......#............#..
......##############..
......................';

I had to use single quotes because if I use the correct ones it will mess up the code format. A hash symbol represents wall or floor, the @ symbol represents the player's spawn point. How can I make a simple reading function and how does it work? Thanks in advance!

A: You could use ` instead of ', and split the string by newlines:
var simpleLevelPlan = `
......................
..#................#..
..#..............=.#..
..#................#..
..#.@......#####...#..
..#####............#..
......#............#..
......##############..
......................`;

var level = simpleLevelPlan.split('\n');

Using that way, the following code represents the '@' in the level:
//coordinates: y  x
var at = level[4][4];


text:
Q: How can I chop a large and growing CSV file in python I have a growing.csv file that looks like this:
...
20211213 20:49:01,61826.0,61925.0,61928.0,1014.41
20211213 20:50:01,61839.0,62122.0,61928.0,1014.41
20211213 20:51:01,61901.0,62026.0,62035.0,1015.03
...

But I'd like to keep this file to the latest, say ~10,000 lines/rows, as the last ~7,500 rows are used by the program. Is there perhaps a smart way to do this?

A: You can get the lowest 10000 lines of a file with the tail command on your command line, e.g.
tail -n 10000 growing.csv > truncated.csv

If you have headers or top-level comments you would like to keep, you can similarly use the head command to get those too:
# write the first line of growing.csv to truncated.csv
# truncated.csv will be overwritten
head -n1 growing.csv > truncated.csv

# Now append the lowest 10k lines to the newly
# created/truncated file
tail -n 10000 growing.csv >> truncated.csv


text:
Q: dotnet monitor in kubernetes cluster when 2 or more replicas I want to monitor several pods of the same application in kubernetes deployment. It turns out to monitor one pod correctly, and if there are many of them, then how to monitor correctly
single replicas deployment config
apiVersion: apps/v1
kind: Deployment
namespace: test
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  template:
    spec:
      volumes:
      - name: diagnostics
        emptyDir: {}
      containers:
      - env:
        - name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
          value: Listen
        - name: DOTNETMONITOR_DiagnosticPort__EndpointName
          value: /diag/port.sock
        - name: DOTNETMONITOR_Storage__DumpTempFolder
          value: /diag/dumps
        - name: DOTNETMONITOR_Urls
          value: http://localhost:52323
        image: manager:master
        imagePullPolicy: Always
        name: chart
        ports:
        - containerPort: 10800
          protocol: TCP
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
          - mountPath: /tmp
            name: diagnostics
      - name: sidecar
        image: dotnet/nightly/monitor
        ports:
        - containerPort: 52325
        args: ["collect","--urls", "http://*:52323", "--metricUrls", "http://*:52325", "--no-auth"]
        volumeMounts:
          - name: diagnostics
            mountPath: /tmp
        resources:
          limits:
            cpu: "1"
            memory: 500Mi
          requests:
            cpu: 200m
            memory: 500Mi

A: not a very nice solution, but I decided using vmagent and a role in configs for pod


text:
Q: using FBA can create a new account but people picker doesn't recognize it I am using FBA on a wss 3.0 site, I can create new users in the DB by using the ASP.NET management site.  The users can then log in, but receive an error: access denied message.
So, I know that the accounts are being authenticated properly (since when i type the username or password incorrectly I get a different message, "the server could not sign you in")
I have working fba accounts on the site since I set this up over a year ago.  I can log in fine using those, and the people picker recognizes those accounts with membership provider i.e.:  FBAMember:testaccount - the people picker will recognize this and allow me to add it to more groups.
But the picker does not recognize any of the accounts I just created using the management tool, using the same connection string i'm using in the web.config of the sp site.
Any ideas on what's wrong?
Thanks
EDIT:
So, FBAMember:membername is listed as the account name for the accounts already in sharepoint, but I can't even add those accounts to a new group, I get a SP error "the user or group is unknown". .. so, these users can log in, but for some reason that's it.

A: Did you add the wildcard setting to the PeoplePicker element in web.config?


text:
Q: jQuery Deferred resolving early I am having a struggle with getting jQuery deferreds to work for me.
I am attempting to chain together a number of function calls which make $.ajax calls with jQuery .then statements, using the pattern set out below, however each function is returning (and so the then chain continuing) before the ajax call is resolved.
// earlier code runs fine to here
})
.then(function (r) {
    getCurrentYearAbsenceRequestData(); // calls function which contains a $.ajax request
})
.then(function (r) {
    restructureCurrentYearAbsenceData();
});

// further processing of results

The functions called above follow this pattern:
function getCurrentYearAbsenceRequestData() {
var dfd = $.Deferred();

    var today = moment();
    var startOfCurrentHolidayYear = moment($clnt.holidayYearStartDate, "DD MMMM").format("DD/MM/YYYY");
    var startDayOfCurrentHolidayYear = moment().dayOfYear(startOfCurrentHolidayYear)
    var currentDayOfYear = moment().dayOfYear();

    if (moment(today).isBefore(startOfCurrentHolidayYear)) { //checks if holiday year started last year
        startOfCurrentHolidayYear = moment(startOfCurrentHolidayYear).subtract(1, "years"); //if so subtract 1 year from start of currently holiday year date
    };

    console.log("Start of Holiday year is " + startOfCurrentHolidayYear);

    var getOrgDataQuery = $apiUrl + "/web/lists/getbytitle('AbsenceRequests')/Items?$select=Id,AssocBranch/Title,DateFrom,DateTo,EmployeeLookup/EmployeeName,EmployeeLookup/Id,AbsenceType/AbsenceTypeShort,ReviewOutcome,TotalDays,AbsenceNotes&$expand=AssocBranch/Title,EmployeeLookup/EmployeeName,AbsenceType/AbsenceTypeShort&$filter=DateFrom ge '" + startOfCurrentHolidayYear + "'";

        $.ajax(_cnxRest.getRequest(getOrgDataQuery)) //calls personal library function which formats the parameter - this works OK)
            .done(function (r) {
                console.log("Get Org data success" + r);
                var $absDataCurrentYearData = r.d.results;
                $absData.allCurrentYear = $absDataCurrentYearData;

             dfd.resolve();
            })
        .fail(function (err) {
            logError(err);
        });
    };

    return dfd.promise();

};

I am wanting the $.ajax call to resolve before the subsequent .then function progresses and would pleased to receive some intelligent advice as to where I am going wrong.

A: Asynchronous functions must return a promise in order to inform their callers of the asynchronism. Otherwise a caller's .then(...).then(...) chain will continue with no regard to the asynchronism, which is the symptom described in the question.
You are just missing some returns, though the code could also be tidied somewhat.
// earlier code runs fine to here
.then(function (r) {
    return getCurrentYearAbsenceRequestData();
//  ^^^^^^
})
.then(function (r) {
    return restructureCurrentYearAbsenceData();
//  ^^^^^^
})
.fail(function (err) {
    logError(err); // by logging here you will see reported errors arising from the entire chain.
});

function getCurrentYearAbsenceRequestData() {
    var startOfCurrentHolidayYear = moment($clnt.holidayYearStartDate, "DD MMMM").format("DD/MM/YYYY");
    if(moment(moment()).isBefore(startOfCurrentHolidayYear)) {
        startOfCurrentHolidayYear = moment(startOfCurrentHolidayYear).subtract(1, "years");
    };
    var getOrgDataQuery = $apiUrl + "/web/lists/getbytitle('AbsenceRequests')/Items?$select=Id,AssocBranch/Title,DateFrom,DateTo,EmployeeLookup/EmployeeName,EmployeeLookup/Id,AbsenceType/AbsenceTypeShort,ReviewOutcome,TotalDays,AbsenceNotes&$expand=AssocBranch/Title,EmployeeLookup/EmployeeName,AbsenceType/AbsenceTypeShort&$filter=DateFrom ge '" + startOfCurrentHolidayYear + "'";
    return $.ajax(_cnxRest.getRequest(getOrgDataQuery))
//  ^^^^^^
    .then(function(r) {
        $absData.allCurrentYear = r.d.results;
        retrun r; // make the result available to the next step in the caller's .then chain, even if it's not going to be used
//      ^^^^^^
    });
};

The main chain could be simplified to :
.then(getCurrentYearAbsenceRequestData) // calls function which contains a $.ajax request
.then(restructureCurrentYearAbsenceData)
.fail(function(err) {
    logError(err);
});

Here, the retruns are those written within the named functions.


text:
Q: Prescribing V shapes to the real numbers Can I prescribe a V shape to every number on the real number line so that the point of the V is in contact with this number, and no two V shapes intersect? (You may choose any specifically shaped "V" for each number, change the width of the V's, change the length of the legs of the V's, place V's in in the upper half-plane or lower half-plane)
Here's a picture describing the situation

A: I'm afraid not. Every V shape (when filled in) contains a rational point, and there are only countably many of those, but there are uncountably many reals, so at least one point is shared between two filled-in V's. Now show that those two V's intersect at an edge.


text:
Q: Error when trying to acess API with http.get in node.js I'm a begginer in node.js and now I'm trying to get API's result from http.get. But, when running the code I'm receiving this error:
Error: getaddrinfo ENOTFOUND
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)

I'm requiring http correctly (I had it tested to be sure)
Here is my function to illustrate the problem:
function getData(apiUrl, getUrl) {

    var options = {
        host : apiUrl,
        port : 80,
        path : getUrl
    };

    var content = "";

    http.get(options, function(res) {
        console.log("Got response: " + res.statusCode);

        res.on("data", function(chunk) {

            content += chunk;
            console.log(content);

        });

    }).on('error', function(e) {
        console.log("Error: " + e.message);
        console.log( e.stack );
    });

}

And calling it this way:
getData('https://api.twitter.com', '/1/statuses/user_timeline.json?&screen_name=twitter&callback=?&count=1');

Hope you can help me, thanks!

A: You must use the https instead of http module. See http://nodejs.org/api/https.html
In the options object, "host" should just be the hostname, i.e. api.twitter.com.
Specifying port is not necessary, but "80" is wrong in case of https. HTTPS is 443, unless explicitly specified otherwise.
You can generate correct options like this:
    parseURL = require('url').parseURL;
    parsedURL = parseURL(apiURL);
    var options = {
        hostname : parsedURL.hostname,
        path : getUrl
    };

For efficiency, the parseURL function could best be defined outside of the getData function.
If it's important that your getData function supports both http and https urls, you could check parsedURL.protocol. If "https", then use https.get, if "http", then use http.get.


text:
Q: Android chat working on emulators with redir I have read tons of this same advices about connecting two emulators using telnet. For example this one: Connecting 2 Emulator instances In Android
I've made all as it is said and nothing works. I have got server app on emulator 5554 and client app on emulator 5556. They are using ports 6000 server app and 5000 client app. What I want is to communicate when this two emulators are open - in both ways.
At the beginning server app shows her ip, and in client app user have to write this ip. That is whole configuration.
As in mentioned post was said I've written redir add tcp:5000:6000 but nothing works. Also when I write redir add tcp:6000:5000 nothing happen. Those apps don't hear each other. However if server is on other device than everything works fine.
Maybe it is stupid question but can someone guide me through this, because I don't know what am I doing wrong.


text:
Q: Proposed limit proofs I have a question regarding an approach to finding the limit of a function:
Consider the function $$f(x) = x^{2}\sin(\frac{1}{x})~~~\text{for }x \neq 0~~~\text{and }f(0) =1$$
Show that $\lim\limits_{x \rightarrow 0,x \in \mathbb{R}}f(x)$ does not exist.
I will use a result I found in the wiki entry 'first-countable spaces' which states: If $f$ is a function on a first-countable space then $f$ has a limit $L$ at the point $x$ if and only if for every sequence $x_{n} \rightarrow x$ where $x_{n} \neq x$ for all $n$ we have $f(x_{n}) \rightarrow L$.
If I want to prove that $\lim\limits_{x \rightarrow 0, x \in \mathbb{R}}f(x)$ does not exists, I have the following two proposed ideas, the first is:

*

*Define the sequence $x_{n} = 0$ when $n =2k-1$ for $k \geq 1$ and $x_{n} = \frac{1}{n}$ when $n = 2k$. Then this sequence converges to $0$ but $f(x_{2k})$ converges to $0$ while $f(x_{2k-1})$ converges to $1$. Therefore the limit does to exists by wiki result.

*The second idea is similar to the first but I consider the two sequences separately. So consider sequences $x_{n} = 0$ and $y_{n} = \frac{1}{n}$. Then $f(x_{n}) \rightarrow 0$ and $f(y_{n}) \rightarrow 1$. By wiki result it follows that the limit does not exists.
I'm pretty sure that proposed answer 1 is fine. As for 2. I'm not sure if we can consider the sequence $x_{n} = 0$ as it is stated that the result holds only for $x_{n} \neq x$ for all $n$.
What do you think?

A: I think those were both really solid first steps toward attempting to prove the limit does not exist. Unfortunately, the technical conditions are not on your side:

*

*As you observed, the wiki result you quoted does not suffice to complete your proposed second idea, since you cannot have $x_n=x$.

*(edited) The same problem blocks the wiki result from completing the first proposed idea as well.
Obligatory helpful comment: Do you know what the graph of $f$ looks like? (This is not quite your function, but it is for all values except $x=0$).


text:
Q: how to use the Laravel-OracleDB? I want to add the Laravel-OracleDB in the lumen,but I can't use the composer because my company can't use it.So I need to add the Laravel-OracleDB manually.But this is my first time to use the lumen or the laravel.
This is the address of the Laravel-OracleDB:
https://github.com/jfelder/Laravel-OracleDB;
And this is the folder list of the lumen:


text:
Q: Select Text Using DoubleClick from WebDriver Java I want to do double click on search inputbox of google page and it should be selected
This is my code :
    WebDriver driver = new FirefoxDriver();
    driver.navigate().to("http://www.google.com");
    WebElement oWE = driver.findElement(By.name("q"));
    WebDriverWait wait = new WebDriverWait(driver, 30);
    wait.until(ExpectedConditions.presenceOfElementLocated(By.name("q")));
    if (oWE.isDisplayed()) {
       System.out.println("Displayed");
       oWE.sendKeys("abcd");
       driver.findElement(By.id("gbqfb")).click();
       Actions oAction = new Actions(driver);
       oAction.moveToElement(oWE);
       oAction.doubleClick(oWE).build().perform();
    }

but text is not selected.
1.Why it is not working?
2.We always use By.ID,By.name etc why we do not use ById.Id ByName.name etc
if we can use this where it should be used if not why we did not use this?

A: if you want to select all the text you can do it like this...
driver.findElement(By.xpath("xpath")).sendKeys(Keys.chord(Keys.CONTROL, "a"));

A: Your code is perfect: instead of trying to "double click" the web element you've given, try some other element.
Try this:
WebDriver driver = new FirefoxDriver();
    driver.navigate().to("http://jsbin.com/obeyu4/3");
    WebDriverWait wait = new WebDriverWait(driver, 30);
    Actions act = new Actions(driver);
    act.doubleClick(driver.findElement(By.id("golink"))).perform();
    Thread.sleep(3000);
    System.out.println(driver.getTitle());


text:
Q: Can't Read Data from external Server to Hololens I have written some code to transfer data from external server to Hololens. I am able to connect Hololens to the server. But I am facing problem in sending the data from server to Hololens. Whenever I call ReadData function it isn't even connected(it prints Not connected).
I am quite new to c# and unity and isn't able to sort out this matter yet.
I am using StreamSocket and DataReader classes to connect and read the data respectively. Function Connect() connects with the server in start() method and then I call ReadData function in update() method  to get the data from the server at every frame. I am attaching my code file.
Can you help me out in solving my problem Thanks in advance.
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Threading;
using System.Text;
using System.Net;
using System;
using UnityEngine;
#if !UNITY_EDITOR && UNITY_METRO
using Windows.Networking.Sockets;
using Windows.Storage.Streams;
using Windows.Networking;
using Windows.Foundation;
#endif
public class TCPclientRead : MonoBehaviour
{
    public string ServerIP = "10.1.2.35";

    [Tooltip("The connection port on the machine to use.")]
    public int ConnectionPort = 11000;

    private string data = "connected" ;

    public TextMesh mesh;
    private bool connected = false;

#if !UNITY_EDITOR && UNITY_METRO

  private StreamSocket networkConnection;

        /// <summary>
        /// Temporary buffer for the data we are recieving.
        /// </summary>
    //private byte[] dataBuffer;

    public void Connect( )
    {
          // Setup a connection to the server.
               HostName networkHost = new HostName(ServerIP.Trim());

              //HostName networkHost = new HostName( IPAddress.Any.ToString());
              networkConnection = new StreamSocket();

            // Connections are asynchronous.
            // !!! NOTE These do not arrive on the main Unity Thread. Most Unity operations will throw in the callback !!!
            IAsyncAction outstandingAction = networkConnection.ConnectAsync(networkHost, ConnectionPort.ToString());
            AsyncActionCompletedHandler aach = new AsyncActionCompletedHandler(NetworkConnectedHandler);
            outstandingAction.Completed = aach;
    }

    public void NetworkConnectedHandler(IAsyncAction asyncInfo, AsyncStatus status)
    {
            if (status == AsyncStatus.Completed)
            {
                connected = true;
                 // Here Just display connected

            }
            else
            {
                connected = false;
                Debug.Log("Failed to establish connection. Error Code: " + asyncInfo.ErrorCode);
                // In the failure case we'll requeue the data and wait before trying again.
                networkConnection.Dispose();

            }

    }

    public void ReadData()
    {
        if(connected)
        {
            DataReader reader = new DataReader(networkConnection.InputStream);
            reader.InputStreamOptions = InputStreamOptions.Partial;
            reader.LoadAsync(512);
            data = reader.ReadString(512);

         }

    }

    private void Start()
    {
        mesh = gameObject.GetComponent<TextMesh>();
        Connect();
    }

    private void Update()
    {

        if (connected)
        {
            mesh.text = data;

        }
         else
            mesh.text = "Not Connected";
         ReadData();
    }

#endif

}

Edit : 1. I have doubt that ReadData() needs to be called asynchronously Therefore I updated the code but it isn't working even now.
2. I am using Unity Editor and I have enabled the required settings and I am able to connect to the server. It's just that I am not able to transfer the data.
3. I am using netcat to create server.
My updated code
 delegate void DelegateMethod();

    public async void ReadData()
    {
        if(connected)
        {
            DataReader reader = new DataReader(networkConnection.InputStream);
            reader.InputStreamOptions = InputStreamOptions.Partial;
            await reader.LoadAsync(512);
            data = reader.ReadString(512);

         }

    }

    public void AsynCall()
    {
        DelegateMethod dlgt = new DelegateMethod(this.ReadData);
        IAsyncResult ar = dlgt.BeginInvoke(null, null);
        dlgt.EndInvoke(ar);
    }

    private void Start()
    {
        mesh = gameObject.GetComponent<TextMesh>();
        Connect();
    }

    private void Update()
    {

        if (connected)
        {

           if(String.IsNullOrEmpty(data))
                data = "Improper";

             AsynCall();
             mesh.text = data;
        }
         else
            mesh.text = "Not Connected";

    }

A: My suspicion is that you have not enabled the UWP Capability "InternetClient" which would prevent it from actually connecting to the remote server.  You don't mention what tool chain you are using, but if you are in Unity check under Build Settings -> Publish Settings -> Windows Store -> Publishing Settings -> Capabilities.  If you are working in Visual Studio, you can adjust this in the project properties.


text:
Q: Obtaining the name of a known struct field I have a struct which represents an object in a database, something like:
type Object struct {
    Id string
    Field1 string
    Field2 int
}

And I'd like to have a function that updates the specific field in the database whenever the field is modified, something along these lines:
func (self *Object) SetField1(value string) {
    self.Field1 = value
    database.Update(self.Id, "Field1", self.Field1) // pseudocode
}

Is there a way to replace the "Field1" hard-coded string such that my code is resistant to future changes in the struct field ordering and naming?
I've poked around the reflect package, and it would be nice to be able to get the StructField that represents the field I'm working with, but it seems to require either the name of the field via hard-coded string, or the field's index in the struct (which is subject to change).

A: not in the context that you're talking about.  It's not passed in as a parameter, so you need some other way of specifying which of the struct's fields to be sent.  The mental gap here is you're trying to treat that set function like it's a property when it's not; the key difference between a property, as seen in other languages, is that a property is bound to a specific field, whereas your SetField1 method is bound to the whole struct.  That method might as well set two fields.
Generally if you're doing field-wise reflective stuff, and you want to do fancy dynamic stuff with fields, you want to use struct tags.  e.g., like this:
type Object struct {
    Id string     `db:"id"`
    Field1 string `db:"field1"`
    Field2 int    `db:"field2"`
}

you can access those tags like-a-this:
package main

import (
    "reflect"
    "fmt"
)

func main() {
    var x struct {
        MyField int `core:"required"`
    }
    t := reflect.TypeOf(x)

    for i := 0; i < t.NumField(); i++ {
        field := t.Field(i)
        fmt.Println(field.Name, ":", field.Tag.Get("core"))
    }
}

that's not really a full solution, but... the question in the way it's asked is impossible to do.

A: You could validate your string by adding a method something like this:
func (self *Object) verify(field string) string {
    if _, ok := reflect.TypeOf(*self).FieldByName(field); ok {
        return field
    }
    panic("Invalid field name")
}

And then use it when passing the string to the database update
func (self *Object) SetField1(value string) {
    self.Field1 = value
    database.Update(self.Id, self.verify("Field1"), self.Field1) // pseudocode
}

But I would think that if you're willing to use reflection, that you'd be better off just making a generic setField method that accepts the field as a string, and the value as a interface{}, checks the field and value, sets the value and updates the database.
This way everything is done using the string, so it'll either work or panic, and you don't need to remember to use the .verify() method.
Somthing like:
func (self *Object) SetField(field string, value interface{}) {
    // verify field and value using reflection
    // set the value using reflection
    database.Update(self.Id, field, self.Field1)

}

Though I don't think this'll work on unexported fields.


text:
Q: SSRS Force blank pages I have some SSRS reports that are generated via a subscription. They Get PDF'd and dropped on a share. The way the report was designed there is a potential for one record (or row if you will) to take up more than one page. I would like to know if it is possible to insert a blank page only after a single record/row takes up more than one page. This includes not showing any headers or footers on the blank page.
I've tried adding a text box with a form feed character to the end of the page, which did not work. I also tried creating a text box that is wider than the page (using an expression to control it's visibility) but that just forced the body of the report to be larger than the report's width which caused blank pages to show up everywhere.
Any help would be great.


text:
Q: Prove that $13|2^{70}+3^{70}$
Prove that $$13|2^{70}+3^{70}$$

Any HINT how I can start solving this task? What can be a first step?

A: Recall that $(a+b) \vert (a^{2n+1} + b^{2n+1})$ where $n \in \mathbb{N}$ (Why?) and note that we have
$$2^{70} + 3^{70} = (2^2)^{35} + (3^2)^{35} = 4^{35} + 9^{35}$$


text:
Q: onAppear not displaying Interface Elements So I am having a weird issue where in my view stack, .onAppear is running my function to pull data from my server, but it fails to display card elements that I have created for the interface. What I am trying to achieve is when the user opens the app and it takes them to the dashboard it will show the various headlines of the platform. I am not getting any errors, as the JSON Object is being read correctly.
Some things that I have read is that the view may need to be updated after .onAppear is called, but the resources I have found don't really explain how to do so. The first bit of code is my JSON Object:
{"results" : [{"id":1,"title":"Meet ergoWare","header_image":"http://gba.ergoware.io/cache/content/topstory/ergo_news_01.svg","summary":"GBA's New Ergonomic Portal!"}]}

That is pulled in through this function
func loadHeadlines(CDNLink: String) {
    guard let url = URL(string: CDNLink) else {
        print("Invalid URL")
        return
    }

    let request = URLRequest(url: url)

    URLSession.shared.dataTask(with: request) { data, response, error in
        if error != nil {
            print("Fetch failed: \(error?.localizedDescription ?? "Unknown error")")
            return
        } else {
            do {
                let decodedResponse = try JSONDecoder().decode(Response.self, from: data!)
                    print(decodedResponse)
                self.results = decodedResponse.results
                } catch let err {
                    print("Error parsing: \(err)")

                }
            }
        }.resume()
    }

Then tagging on .onAppear to my HStack, it preforms the function and runs my ForEach Statement like so
ScrollView(showsIndicators: false){
                Text("HEADLINES")
                    .font(.system(size: 18))
                    .fontWeight(.medium)
                    .foregroundColor(.secondary)
                    .frame(maxWidth: .infinity, alignment: .leading)
                ScrollView(.horizontal, showsIndicators: false) {
                    HStack {
                        ForEach(results) { result in
                            CardView(image: result.header_image, heading: result.title, summary: result.summary)
                        }
                    }.onAppear(perform:{self.loadHeadlines(CDNLink: "http://\(self.defaults.object(forKey: "domain") as! String)/cdn?funct=fetchNews")})
                }

So my question is, why is the CardView not showing when the scene loads? Using Simulator, if I build and test the app, then switch out of the app and back in, the cards start showing up. Thank you for any insight you can provide. Below I have some links to my full code.
Dashboard View
CardView

A: Just to clarify the difference between init and onAppear() (accoding to comments)
Let's imagine you have a TabView with 2 views. First view is the view you created and provided code for, the second view could be a profile view. onAppear() function will be called each time the user switch between these two TabViews while init() function will only run once in this particular use case.
Next, it is important to note that URLSession is running on background thread. You can only update the Views from the MainThread which means, you should encapsulate the result into:
DispatchQueue.main.async {
    self.results = decodedResponse.results
}

But the acutal answer to your Question
I just faced the same issue few days ago. ScrollView has some bug/feature at this moment, which means, if you try to ScrollView + ForEach an empty array that is going to be updated later it will not show up. If you give a hardcoded Article as your first item, and update the rest later, it will work. Atleast for me worked under swift5 xcode 11.3.1 on iOS 13.3.1. However I use ObservableObject to handle datas in a class and ObservedObject to take advantage of @Published modifier. Like this
class Result : ObservableObject{
    @Published var results = [Article]()
}

And Write this to your swiftUI code:
@ObservedObject private var data = Result()

Your swiftui init function should contain an add function like so to bypass ScrollView bug/feature:
init() {
    self.data.results.append(....)
    self.callYourRestAPIHere(URL:"whateverhere", result: data)
}

Hope I did not miss anything, but I am ready to improve my Answer if I did.

A: I think you should identify the data in the ForEach loop so SwiftUI can distinguish the different data items and can properly see if the content of the array have been changed. Like this:
ForEach(results, id: \.id) { result in
    CardView(image: result.header_image, heading: result.title, summary: result.summary)
}


text:
Q: How to use grafana's plugin "Worldmap Panel" with zabbix? Is there a decision, how to use Grafana's Worldmap with zabbix 3.0.3?
I do not understand how to send geo information from servers to zabbix and from zabbix to grafana. I want to do something like this (on the first screenshot) - servers with errors on the map.
Thanks.

A: https://grafana.net/plugins/grafana-worldmap-panel says:

World Map panel for Grafana. Displays time series data or geohash data
  from Elasticsearch overlaid on a world map.

World Map plugin is not for Zabbix. It's only for data from Elasticsearch.
Zabbix provides maps - https://www.zabbix.com/documentation/3.0/manual/config/visualisation/maps/map - use some nice map background and place your hosts into maps. Use different icons for different host problems states and result will be probably ok-awesome.
https://github.com/SpawW/zabbix-extras is project for Zabbix 2.2/2.4, which provides also Zabbix integration with Google Maps. It's not ported for Zabbix 3.0, but you can try.


text:
Q: XSLT not able to read the data from XML I am new to XML and XSL. Doing the transformations of XML using XSL but its not working. Any insight on this topic, why XSL is not printing the data from XML?
Below is a raw example of XML Input, XSL, Current output & Expected Output
XML
<PersonalDetails Target='prepare-html-output'>
    <MultiApi>
        <API Name="getPersonalDetails">
            <Output>
                <Person Id="ID_0" Name="Name1" Status="Active" Type="INT">
                    <Service Name="Service_0" NoOfService="3" Status="Active"/>
                </Person>
            </Output>
        </API>
        <API Name="getPersonalDetails">
            <Output>
                <Person Id="ID_1" Name="Name2" Status="Active" Type="INT">
                    <Service Name="Service_1" NoOfService="3" Status="Active"/>
                    <Service Name="Service_2" NoOfService="1" Status="Active"/>
                </Person>
            </Output>
        </API>
        <API Name="getPersonalDetails">
            <Output>
                <Person Id="ID_2" Name="Name3" Status="Active" Type="INT">
                    <Service Name="Service_3" NoOfService="2" Status="Active"/>
                </Person>
            </Output>
        </API>
    </MultiApi>
</PersonalDetails>

XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">

Info

                        PersonID
                        Status
                        PersonName
                        ServiceName
                        NoOfService

                    <xsl:for-each select="PersonalDetails/MultiApi/API/Output">

                            <xsl:value-of select="Person/Id"/>
                            <xsl:value-of select="Person/Status"/>
                            <xsl:value-of select="Person/Name"/>
                            <xsl:value-of select="Person/Service/Name"/>
                            <xsl:value-of select="Person/Service/NoOfService"/>
                                <xsl:text>/</xsl:text>
                                <xsl:value-of select="count(Person[@Id]/Service[@Name])"/>

                    </xsl:for-each>

    </xsl:template>
</xsl:stylesheet>

Current Output
Info

PersonID    Status  PersonName  ServiceName NoOfService
                                            /1
                                            /2
                                            /1

Expected Output
Info

PersonID    Status  PersonName  ServiceName NoOfService
ID_0        Active  Name1       Service_0   3/1
ID_1        Active  Name2       Service_1   3/1
ID_1        Active  Name2       Service_2   1/1
ID_2        Active  Name3       Service_3   2/1

A: The Id of a Person is an attribute, not an element. You must use:
<xsl:value-of select="Person/@Id"/>

to select it, instead of:
<xsl:value-of select="Person/Id"/>

Likewise for your other cells.


text:
Q: Using COM Callable Wrappers in PLC components I have a Motorolla based, Programmable Logic Control (PLC) device and I write code in it using IEC-61131 structured programming language. The problem is that I have some complex computation to do, so I am trying to write the code in COM Callable Wrapper. So the question is, Is it possible to access functionality coded in CCW developed on .NET framework to access in Motorola based PLC device??
So in short, also what I mean to ask is that whether this CCW be accessible on a non-.NET Framework devices??
Thank you very much in advance.
Regards
Irfan

A: No. You should reimplement your .NET logic in ST (structured text Pascal like IEC-61131 language), or run your .NET logic on PC and then constantly communicate with PLC via some protocol it supports (MODBUS, PROFIBUS...) and write results of your PC based calculations into some PLC tags that will be processed further in PLC.

A: One way is to get an OPC server for your device and then write an OPC client that communicates with the OPC server which implements your logic. That way you can write your program logic in any .NET language (or other language).
You can check with Motorola to see if they have an OPC server for your device.


text:
Q: How to Print in Vaadin Flow? I would like to print out the content of a homepage created with Vaadin 14 from a button.
with Vaadin 8 was a solution that unfortunately is no longer applicable:
Button print = new Button("Print This Page");
print.addClickListener(new Button.ClickListener() {
    public void buttonClick(ClickEvent event) {
        // Print the current page
        JavaScript.getCurrent().execute("print();");
    }
});

Any Idea how to do this in Vaadin14 please?

A: In Vaadin 10 and later, you can run arbitrary JavaScript by calling Page::executeJs
UI.getCurrent().getPage().executeJs( … )

There you should be able to call the same print function. See: Executing JavaScript in the Browser.
So in your case, for printing the current page:
UI.getCurrent().getPage().executeJs( "print();" ) ;

Full example in Vaadin 14.0.12, using lambda syntax:
package com.example;

import com.vaadin.flow.component.ClickEvent;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

/**
 * The main view contains a button and a click listener.
 */
@Route ( "" )
public class MainView extends VerticalLayout
{
    public MainView ( )
    {
        this.add( new H1( "Print example" ) );

        Button printButton = new Button( "Print…" );
        printButton.addClickListener( ( ClickEvent < Button > clickEvent ) ->
        {
            UI.getCurrent().getPage().executeJs( "print();" );
        } );
        this.add(printButton);
    }
}


text:
Q: Displaying Product Properties in a Static Block Short of creating my own widget or block class to do so, is there a way to display a product's name, sku, price, or other property in a static block or CMS page?
If there isn't a way to do this out of the box, is there a well excepted way to achieve this?
That is, I'd like to be able to do something like this in a block or page
{{block type="some/block" sku="PRODUCT_SKU" variable_to_display="name"}}

and have the product's name appear in the static-block/page.
Does this exist in Magento's core?  Somewhere in the community?

A: I'm not fully aware of a core means to go about this (I've not looked), but the following isn't particularly difficult to implement.
Just a few days ago, we needed the output from a helper - passed back into another helper, rendered via a CMS block.
This won't require phtml files to be created just for the sake of a single function - and will allow a fairly flexible use of helper or model methods to be executed.
Whilst probably not the clean core solution you want, the output should be what you are after.
Calling Helper Methods
There is no fault tolerance in this (ie. checking a method/class even exists etc.); but if you really need it, you could modify it to suit.
What I wanted was to fetch the return value of a helper that got the minimum price of a bundle product; then push that output through the currency helper to format it appropriately.
{{block type="sonassi.core/helper" helper="sonassi.core/catalog" function="getMinMaxPrice" arg1="5" arg2="" arg3="min" callback_helper="core" callback_function="currency" callback_arg1="function_response" callback_arg2="true" callback_arg3="false"}

Which was rendered using the following class.
<?php
/*
* @category    Module
* @package     Sonassi_Core
* @copyright   Copyright (c) 2012 Sonassi
*/
class Sonassi_Core_Block_Helper extends Mage_Core_Block_Abstract
{
  protected function _toHtml()
  {
    try {
      $args = $this->getData();
      $_helper = Mage::helper($args['helper']);
      $html = false;
      $argStr = implode("###", array_keys($args));
      if (preg_match_all('/arg[0-9]+/', $argStr, $matches)) {
        $data = array_intersect_key($args,array_flip($matches[0]));
        array_walk($data, array(Mage::helper('sonassi.core'),'stringToBoolean'));
        $html = call_user_func_array(array($_helper, $args['function']), $data);
      }
      if (isset($args['callback_helper'])) {
        $_callbackHelper = Mage::helper($args['callback_helper']);
        if (preg_match_all('/callback\_arg[0-9]+/', $argStr, $matches)) {
          $data = array_intersect_key($args,array_flip($matches[0]));
          $testCase = array_flip($data);
          if (isset($testCase['function_response'])) {
            $position = $testCase['function_response'];
            $data[$position] = $html;
          }
          array_walk($data, array(Mage::helper('sonassi.core'),'stringToBoolean'));
          $html = call_user_func_array(array($_callbackHelper, $args['callback_function']), $data);
        }
      }
      return $html;
    } catch(Exception $e) {}
    return;
  }
}

Calling Model Methods
So tweaking the above code ever-so-slightly (I've stripped out the helper callback just to shorten the amount of code).
You could execute,
{{block type="sonassi.core/model" model="catalog/product" load_attribute="sku" load_value="product-sku" function="getName"}}

With the following supporting class,
<?php
/*
* @category    Module
* @package     Sonassi_Core
* @copyright   Copyright (c) 2012 Sonassi
*/
class Sonassi_Core_Block_Model extends Mage_Core_Block_Abstract
{
  protected function _toHtml()
  {
    try {
      $args = $this->getData();
      $_model = Mage::getModel($args['model'])
      if (isset($args['load_id']))
        $_model->load($args['load_id']);
      elseif (isset($args['load_attribute']) && isset($args['load_value']))
        $_model->loadByAttribute($args['load_attribute'], $args['load_value']);
      $html = false;
      $argStr = implode("###", array_keys($args));
      if (preg_match_all('/arg[0-9]+/', $argStr, $matches)) {
        $data = array_intersect_key($args,array_flip($matches[0]));
        array_walk($data, array(Mage::getModel('sonassi.core'),'stringToBoolean'));
        $html = call_user_func_array(array($_model, $args['function']), $data);
      }
      return $html;
    } catch(Exception $e) {}
    return;
  }
}

This class was kept fairly generic and loading a whole method for one method would be heavy - but you can just tailor it to your needs.
Obviously something like this would be more lightweight, but you can tweak your methods to suit your needs.
Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'attribute_code', $storeId);

Common Method
The referenced helper method above, stringToBoolean, was just the following:
public function stringToBoolean(&$value, $key)
{
  if ($value == "true")
    $value = true;
  elseif ($value == "false")
    $value = false;
}


text:
Q: Ansible AWS Route53 URL doesn't resolve but page loads OK via IP The following ansible playbook runs fine, no error at all but the URL just don't resolve/load afterwards. If I use the public IP created for the instance, the page loads.
---
  - name: Provision an EC2 Instance
    hosts: local
    remote_user: ubuntu
    become: yes
    connection: local
    gather_facts: false
    vars:
      instance_type: t2.micro
      security_group: "Web Subnet Security Group"
      image: ami-0c5199d385b432989
      region: us-east-1
      keypair: demo-key
      count: 1
    vars_files:
      - keys.yml

    tasks:
      - name: Create key pair using ouw own pubkey
        ec2_key:
          ec2_access_key: "{{ ec2_access_key }}"
          ec2_secret_key: "{{ ec2_secret_key }}"
          name: demo-key
          key_material: "{{ lookup('file', '/root/.ssh/id_rsa.pub') }}"
          region: us-east-1
          state: present

      - name: Launch the new EC2 Instance
        ec2:
          ec2_access_key: "{{ ec2_access_key }}"
          ec2_secret_key: "{{ ec2_secret_key }}"
          assign_public_ip: yes
          vpc_subnet_id: subnet-0c799bda2a466f8d4
          group: "{{ security_group }}"
          instance_type: "{{ instance_type}}"
          image: "{{ image }}"
          wait: true
          region: "{{ region }}"
          keypair: "{{ keypair }}"
          count: "{{ count }}"
          state: present
        register: ec2

      - name: Add tag to Instance(s)
        ec2_tag:
          ec2_access_key: "{{ ec2_access_key }}"
          ec2_secret_key: "{{ ec2_secret_key }}"
          resource: "{{ item.id }}"
          region: "{{ region }}"
          state: present
          tags:
            Name: demo-webserver
        with_items: "{{ ec2.instances }}"

      - name: Add the newly created EC2 instance(s) to the local host group (located inside the directory)
        lineinfile:
          path="./hosts"
          line="{{ item.public_ip }}"
          insertafter='\[demo-webserver\]'
          state=present
        with_items: "{{ ec2.instances }}"

      - name: Pause for 2 minutes
        pause:
          minutes: 2

      - name: Write the new ec2 instance host key to known hosts
        connection: local
        shell: "ssh-keyscan -H {{ item.public_ip }} >> ~/.ssh/known_hosts"
        with_items: "{{ ec2.instances }}"

      - name: Waiting for the instance to come
        local_action: wait_for
                      host="{{ item.public_ip }}"
                      delay=10
                      connect_timeout=300
                      state=started
                      port=22
        with_items: "{{ ec2.instances }}"

      - name: Install packages
        delegate_to: "{{ item.public_ip }}"
        raw: bash -c "test -e /usr/bin/python || (apt -qqy update && apt install -qqy python-minimal && apt install -qqy apache2 && systemctl start apache2 && systemctl enable apache2)"
        with_items: "{{ ec2.instances }}"

      - name: Register new domain
        route53_zone:
          ec2_access_key: "{{ ec2_access_key }}"
          ec2_secret_key: "{{ ec2_secret_key }}"
          zone: ansible-demo-domain.com

      - name: Create new DNS record
        route53:
          ec2_access_key: "{{ ec2_access_key }}"
          ec2_secret_key: "{{ ec2_secret_key }}"
          zone: ansible-demo-domain.com
          record: ansible-demo-domain.com
          type: A
          ttl: 300
          value: "{{ item.public_ip }}"
          state: present
          overwrite: yes
          private_zone: no
          wait: yes
        with_items: "{{ ec2.instances }}"

      - name: Create new DNS record
        route53:
          ec2_access_key: "{{ ec2_access_key }}"
          ec2_secret_key: "{{ ec2_secret_key }}"
          zone: ansible-demo-domain.com
          record: www.ansible-demo-domain.com
          type: CNAME
          ttl: 300
          value: ansible-demo-domain.com
          state: present
          overwrite: yes
          private_zone: no
          wait: yes

Appreciate your help to point what/where I'm missing is. I usually wait at least 5 minutes before testing the URL but really doens't resolve/load.
Thank you!
20190301_Update: Here's how the hosted zone looks like after provisioning:
hosted-zone-after-provisioning and its associated TTLs ttl


text:
Q: What does "_$vdhHitId is not defined" error refer to? I'm getting the following Javascript error appearing in the Google Chrome debugger.

This doesn't appear on a regular, consistent, basis and it doesn't appear to impact the normal operation of the page. I've never seen this before and am curious if anyone knows what this is referring to? This is not coming from any of my code, or any library I'm using, as far as I know.
A Google search on this returns nothing that I could find.

A: @SimonNigro is correct. In my case it was extension "Video DownloadHelper"
https://chrome.google.com/webstore/detail/video-downloadhelper/lmjnegcaeklhafolokijcfjliaokphfk. An error disappeared after I disabled the extension.


text:
Q: Region of Convergence for the complex series $\sum {((z-1)/(z+2))^k} $ I am trying to solve this problem from the textbook "A First Course in Complex Analysis with Applications" in section 6.1.
The question asks to sketch the region of convergence of the following series:
$\sum {((z-1)/(z+2))^k} $
So, I tried using the ratio test, and I found that $ {|((z-1)/(z+2))| < 1} $. This leads to a lot of algebraic equations and boils down to
$ \sqrt{\frac{x^{4}+y^{4}+2x^{3}-3x^{2}+5y^{2}+x^{2}y^{2}-4x+y^{2}x^{2}+2xy^{2}+4}{\left(\left(x+2\right)^{2}+y^{2}\right)^{2}}}<1  $
I tried simplifying it, but I got this.
$-6x^{3}-27x^{2}-36x-6y^{2}x-3y^{2}-12<1$
So, my questions are:

*

*Is there an easier way to figure out the region of convergence?

*Is there an easy way to sketch the first inequality?

*More importantly, Why when I sketch the first inequality using a graphic calculator, it looks like its the same as $ {x>-1/2} $? and are they same?

This is a link to the desmos graph https://www.desmos.com/calculator/zimzjveiet.

A: The ratio test is a sufficient but not necessary condition of convergence.
For a geometric series with ratio $q$, the necessary and sufficient condition is $|q|<1$.
Your complicated numerator is probably wrong.
$$\left|\frac{z-1}{z+2}\right|<1\Leftrightarrow(x-1)^2+y^2<(x+2)^2+y^2\Leftrightarrow x>-\frac12.$$


text:
Q: Clearcase: moving a sub branch to a main branch In clearcase I started work on a branch called main/release4/release5. After I had began my work, release4 was merged into main. My coworkers started work on main/release5. Is there anyway I can move my main/release4/release5 work to main/release5?
So far, I've tried to merge from main/release4/release5 to main/release5 but that didn't work. The files stayed on main/release4/release5.
Visual example of what it looks like in version tree:
main
|   \
|     release 4
|     /      \
main        release 5
    \              \
    release 5      *move files from here
         \
         *to here

Here is the original config spec I was working with.
element * CHECKEDOUT
element - directory * /main/LATEST
element * /main/release4/release5/LATEST
element * /main/release4/LATEST -mkbranch release5
element * /main/LATEST -mkbranch release4

Here is the config spec my coworkers started with after merging release 4 with mainline
element * CHECKEDOUT
element - directory * /main/LATEST
element * main/release5/LATEST
element * main/LATEST -mkbranch release5

A: The idea of those selection rules ending with branchname/LATEST -mkbranch newBranch is to allow an element (file or directory) to start a new branch from whatever version happens to be the LATEST, unless there are already versions on said newbranch.
So it is a file-by-file mechanism.
To ensure all files to start from the release4 merged into main, put a label on all elemenents of main/LATEST right after that merge (preferably using the snapshot view used for said merge), then use a config spec like:
element * CHECKEDOUT
element * .../release5/LATEST
element * REL4 -mkbranch release5
element * main/LATEST -mkbranch release5

Starting a branch from a fixed label is safer than starting from /main/LATEST (which can see a new version at any time)

The OP Gregory Peck comments:

using .../release5/LATEST fixed it!

The reason the "three dots" syntax worked (as illustrated in "clearcase latest version of a file on a particular branch") is that some versions had their branches starting from the release4 branch, other from main.
With .../release5/LATEST, you select the LATEST of release5, no matter which branch release5 is starting from.


text:
Q: Encode Columns based on Categorical Values I am "learning" from the Kaggle IMDB movie database.  There is a "genre" column often with multiple categorical values i.e. Action, Drama, Sci-Fi.
Where the values in the genre column intersect with the column name, is there a neat way to set it to 1.  i.e. if "genre" contains Action, Adventure, Sci-Fi, , set those columns values from NaN to 1.
I haven't seen one-hot type coding where the  a field has multiple categorical values. I started with a nested "For" block, but I got stuck about how to efficiently check the categorical values against the column names and set the values.  Any ideas? TIA
SAMPLE DATA
   --genre------------------------------ Drama --Adventure ---Sci-Fi ---Action
2  Action, Adventure, Sci-Fi -----NaN-------NaN------------NaN------NaN
3  Drama-----------------------------NaN-------NaN------------NaN------NaN
4  Drama-----------------------------NaN-------NaN------------NaN------NaN
I want it to look like this:
--genre------------------------------ Drama --Adventure ---Sci-Fi ---Action
2  Action, Adventure, Sci-Fi -----NaN-------1---------------1----------1
3  Drama-----------------------------1------------NaN-----------NaN------NaN
4  Drama-----------------------------1------------NaN-----------NaN------NaN