text:
Q: Mapping mismatch between variables from the same grid cell structure + R I created the following map with tmap.
The VCI and shp_union dataset were both created with the same grid cell structure.
However, when I map shp_union, some of the bubbles are mapped outside the grid structure. Why is that ?
I though it was just a window adjustment in R but even with a larger version of the map, the problem persists.
Map
The code for the map:
`tm_shape(vci) +
  tm_polygons(col="vcidrought_type",
          pal =c("#BCE395","#21908CFF", "#3B528BFF", "#440154FF", "#000004FF"),
          levels = labels,
          title="VCI drought types") +
  tm_shape(shp_union) +
  tm_bubbles(col = "red", border.col = "black", size = "total_conflicts",
             scale = 1,
             sizes.legend=c(400, 1000, 2000, 5000),
             legend.col.show= F,
             breaks=c(1, 100, 500, 1000, 4000),
             sizes.legend.labels= c("1 to 100", "101 to 500", "501 to 1000", "1001 and greater"),
             title.size = "Cumulated conflicts")+
  tm_scale_bar(position = c("right", "bottom"),
               breaks = c(0,1000,2000))`

VCI dataset:
`structure(list(gid = c(100468L, 100468L, 100468L, 100468L, 100468L,
100468L, 100468L, 100468L, 100468L, 100468L), country = structure(c(32L,
32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L), .Label = c("Angola",
"Benin", "Botswana", "Burkina Faso (Upper Volta)", "Burundi",
"Cameroon", "Cape Verde", "Central African Republic", "Chad",
"Comoros", "Congo", "Congo, Democratic Republic of (Zaire)",
"Djibouti", "Equatorial Guinea", "Eritrea", "Ethiopia", "Gabon",
"Gambia", "Ghana", "Guinea", "Guinea-Bissau", "Ivoire", "Kenya",
"Lesotho", "Liberia", "Madagascar (Malagasy)", "Malawi", "Mali",
"Mauritania", "Mauritius", "Mozambique", "Namibia", "Niger",
"Nigeria", "Rwanda", "Senegal", "Sierra Leone", "Somalia", "South Africa",
"Sudan", "Swaziland (Eswatini)", "Tanzania (Tanganyika)", "Togo",
"Uganda", "Zambia", "Zimbabwe (Rhodesia)"), class = "factor"),
    xcoord.x = c(13.75, 13.75, 13.75, 13.75, 13.75, 13.75, 13.75,
    13.75, 13.75, 13.75), ycoord.x = c(-20.25, -20.25, -20.25,
    -20.25, -20.25, -20.25, -20.25, -20.25, -20.25, -20.25),
    col = c("388", "388", "388", "388", "388", "388", "388",
    "388", "388", "388"), row = c("140", "140", "140", "140",
    "140", "140", "140", "140", "140", "140"), gwno = c(565L,
    565L, 565L, 565L, 565L, 565L, 565L, 565L, 565L, 565L), km2 = c(3282.64642089,
    3282.64642089, 3282.64642089, 3282.64642089, 3282.64642089,
    3282.64642089, 3282.64642089, 3282.64642089, 3282.64642089,
    3282.64642089), Year = c("2008", "2009", "2010", "2003",
    "2004", "2005", "2006", "2007", "1997", "1998"), ycoord.y = c(-20.25,
    -20.25, -20.25, -20.25, -20.25, -20.25, -20.25, -20.25, -20.25,
    -20.25), xcoord.y = c(13.75, 13.75, 13.75, 13.75, 13.75,
    13.75, 13.75, 13.75, 13.75, 13.75), VCI = c(47.6116253045889,
    66.8255937282856, 42.5661983856788, 33.233853670267, 29.5257619689493,
    38.4215158606475, 71.3801674476037, 45.530642912938, 28.4013691682082,
    42.433207145104), vcidrought = c(0, 0, 0, 1, 1, 1, 0, 0,
    1, 0), vcidrought_type = structure(c(1L, 1L, 1L, 2L, 3L,
    2L, 1L, 1L, 3L, 1L), .Label = c("No drought", "Mild drought",
    "Moderate drought", "Severe drought", "Extreme drought"), class = "factor"),
    geometry = structure(list(structure(list(structure(c(13.5,
    13.5, 14, 14, 13.5, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg")), structure(list(
        structure(c(13.5, 13.5, 14, 14, 13.5, -20.5, -20, -20,
        -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
    "sfg")), structure(list(structure(c(13.5, 13.5, 14, 14, 13.5,
    -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY",
    "POLYGON", "sfg")), structure(list(structure(c(13.5, 13.5,
    14, 14, 13.5, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg")), structure(list(
        structure(c(13.5, 13.5, 14, 14, 13.5, -20.5, -20, -20,
        -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
    "sfg")), structure(list(structure(c(13.5, 13.5, 14, 14, 13.5,
    -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY",
    "POLYGON", "sfg")), structure(list(structure(c(13.5, 13.5,
    14, 14, 13.5, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg")), structure(list(
        structure(c(13.5, 13.5, 14, 14, 13.5, -20.5, -20, -20,
        -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
    "sfg")), structure(list(structure(c(13.5, 13.5, 14, 14, 13.5,
    -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY",
    "POLYGON", "sfg")), structure(list(structure(c(13.5, 13.5,
    14, 14, 13.5, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg"))), class = c("sfc_POLYGON",
    "sfc"), precision = 0, bbox = structure(c(xmin = 13.5, ymin = -20.5,
    xmax = 14, ymax = -20), class = "bbox"), crs = structure(list(
        input = "WGS 84", wkt = "GEOGCRS[\"WGS 84\",\n    DATUM[\"World Geodetic System 1984\",\n        ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n            LENGTHUNIT[\"metre\",1]]],\n    PRIMEM[\"Greenwich\",0,\n        ANGLEUNIT[\"degree\",0.0174532925199433]],\n    CS[ellipsoidal,2],\n        AXIS[\"latitude\",north,\n            ORDER[1],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        AXIS[\"longitude\",east,\n            ORDER[2],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n    ID[\"EPSG\",4326]]"), class = "crs"), n_empty = 0L)), row.names = c(1L,
3L, 4L, 6L, 7L, 8L, 9L, 10L, 14L, 15L), class = c("sf", "data.frame"
), sf_column = "geometry", agr = structure(c(gid = NA_integer_,
country = NA_integer_, xcoord.x = NA_integer_, ycoord.x = NA_integer_,
col = NA_integer_, row = NA_integer_, gwno = NA_integer_, km2 = NA_integer_,
Year = NA_integer_, ycoord.y = NA_integer_, xcoord.y = NA_integer_,
VCI = NA_integer_, vcidrought = NA_integer_, vcidrought_type = NA_integer_
), .Label = c("constant", "aggregate", "identity"), class = "factor"))`

shp_union dataset:
`structure(list(gid = 100467:100476, country = structure(c(32L,
32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L), .Label = c("Angola",
"Benin", "Botswana", "Burkina Faso (Upper Volta)", "Burundi",
"Cameroon", "Cape Verde", "Central African Republic", "Chad",
"Comoros", "Congo", "Congo, Democratic Republic of (Zaire)",
"Djibouti", "Equatorial Guinea", "Eritrea", "Ethiopia", "Gabon",
"Gambia", "Ghana", "Guinea", "Guinea-Bissau", "Ivoire", "Kenya",
"Lesotho", "Liberia", "Madagascar (Malagasy)", "Malawi", "Mali",
"Mauritania", "Mauritius", "Mozambique", "Namibia", "Niger",
"Nigeria", "Rwanda", "Senegal", "Sierra Leone", "Somalia", "South Africa",
"Sudan", "Swaziland (Eswatini)", "Tanzania (Tanganyika)", "Togo",
"Uganda", "Zambia", "Zimbabwe (Rhodesia)"), class = "factor"),
    xcoord = c(13.25, 13.75, 14.25, 14.75, 15.25, 15.75, 16.25,
    16.75, 17.25, 17.75), ycoord = c(-20.25, -20.25, -20.25,
    -20.25, -20.25, -20.25, -20.25, -20.25, -20.25, -20.25),
    col = c("387", "388", "389", "390", "391", "392", "393",
    "394", "395", "396"), row = c("140", "140", "140", "140",
    "140", "140", "140", "140", "140", "140"), gwno = c(565L,
    565L, 565L, 565L, 565L, 565L, 565L, 565L, 565L, 565L), km2 = c(3282.64642089,
    3282.64642089, 3282.64642089, 3282.64642089, 3282.64642089,
    3282.64642089, 3282.64642089, 3282.64642089, 3282.64642089,
    3282.64642089), total_conflicts = c(0, 0, 0, 0, 0, 0, 0,
    0, 0, 0), geometry = structure(list(structure(list(structure(c(13,
    13, 13.5, 13.5, 13, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg")), structure(list(
        structure(c(13.5, 13.5, 14, 14, 13.5, -20.5, -20, -20,
        -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
    "sfg")), structure(list(structure(c(14, 14, 14.5, 14.5, 14,
    -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY",
    "POLYGON", "sfg")), structure(list(structure(c(14.5, 14.5,
    15, 15, 14.5, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg")), structure(list(
        structure(c(15, 15, 15.5, 15.5, 15, -20.5, -20, -20,
        -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
    "sfg")), structure(list(structure(c(15.5, 15.5, 16, 16, 15.5,
    -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY",
    "POLYGON", "sfg")), structure(list(structure(c(16, 16, 16.5,
    16.5, 16, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L
    ))), class = c("XY", "POLYGON", "sfg")), structure(list(structure(c(16.5,
    16.5, 17, 17, 16.5, -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L,
    2L))), class = c("XY", "POLYGON", "sfg")), structure(list(
        structure(c(17, 17, 17.5, 17.5, 17, -20.5, -20, -20,
        -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
    "sfg")), structure(list(structure(c(17.5, 17.5, 18, 18, 17.5,
    -20.5, -20, -20, -20.5, -20.5), .Dim = c(5L, 2L))), class = c("XY",
    "POLYGON", "sfg"))), class = c("sfc_POLYGON", "sfc"), precision = 0, bbox = structure(c(xmin = 13,
    ymin = -20.5, xmax = 18, ymax = -20), class = "bbox"), crs = structure(list(
        input = "WGS 84", wkt = "GEOGCRS[\"WGS 84\",\n    DATUM[\"World Geodetic System 1984\",\n        ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n            LENGTHUNIT[\"metre\",1]]],\n    PRIMEM[\"Greenwich\",0,\n        ANGLEUNIT[\"degree\",0.0174532925199433]],\n    CS[ellipsoidal,2],\n        AXIS[\"latitude\",north,\n            ORDER[1],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        AXIS[\"longitude\",east,\n            ORDER[2],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n    ID[\"EPSG\",4326]]"), class = "crs"), n_empty = 0L)), row.names = c(NA,
10L), class = c("sf", "data.frame"), sf_column = "geometry", agr = structure(c(gid = NA_integer_,
country = NA_integer_, xcoord = NA_integer_, ycoord = NA_integer_,
col = NA_integer_, row = NA_integer_, gwno = NA_integer_, km2 = NA_integer_,
total_conflicts = NA_integer_), .Label = c("constant", "aggregate",
"identity"), class = "factor"))`


text:
Q: Why debug.log doesn't work? I used the proper way to setup Wordpress debugging:
1.) Set up the wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true );
define('WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

2.) apache is the owner of wp-content folder
3.) apache has the proper SElinux rights:
drwxrwxr-x. 11 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0  4096 Aug  5 19:32 wp-content

I found and followed all the previous Q&As and solutions here in this topic.
But Wordpress still doesn't update debug.log in wp-content folder.
I'm working on Fedora28.
What could be the problem?
EDIT:
if (!function_exists('write_log')) {
    function write_log ( $log )  {
        if ( true === WP_DEBUG ) {
            if ( is_array( $log ) || is_object( $log ) ) {
                error_log( print_r( $log, true ) );
            } else {
                error_log( $log );
            }
        }
    }
}

I use the function above for get debugging info, like end of some function etc.

A: Based on this question:

You have @ini_set('display_errors', 0); - which will tell PHP (not
  WordPress) to stop displaying errors. WordPress requires errors to be
  turned on in order for it to pass them to the appropriate place.
  define('WP_DEBUG_DISPLAY', false); or define('WP_DEBUG', false);
  should take care of hiding them on the front end for you.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Word to describe someone picking up on accent/dialect quickly and easily. And without trying? I have recently moved down to Alabama with my fiance. And I have, without even my noticing, heavily picked up on the drawl down here without any sort of trying involved. A good phrase or word would be appreciated.
However, I understand this is a moderately loaded concept. I would love any help, direction, or advice on how to say this better, if not an appropriate word or phrase.

A: You are perhaps a natural mimic with a knack for absorbing an accent?
That second phrase is used in a Quora answer:
How can some people catch the accent of a language so fast and speak it much like locals? What ability do they have?


text:
Q: Outputting from .net to a simple electronics project I'm looking to build a simple electronics project (with some help, I'm not a hardware kinda person) and I'd like to use .net (C#) to do the coding side of it.
What I need to know is where can I get a cheap controller that I can connect via USB or serial and the suitable libraries to use for talking to it (as most System.IO.Serial documentation seems to assume I'm talking to another computer, not something that consists of a few chips and some LEDs).

A: Have you considered to use an Arduino? https://www.arduino.cc/
You can use Arduino UNO for your purpose. You will find tons of examples how to interface it by using C#.
This page has many examples : https://playground.arduino.cc/Interfacing/Csharp
Particularly, this dimmer example can be a good start : https://github.com/StanislavUshakov/ArduinoCSharpDimmer

A: for my robot projects i use the Serializer .NET Robot Controller, you can get it here:
http://www.roboticsconnection.com/p-16-serializer-net-robot-controller.aspx

A: That's highly depending on what you want do do!
Using the serial interface is quite simple for example but limited in speed.
Please ask a little bit more precise.
Further:
FTDI makes some nice chips that do a USB-RS232 conversion.  Some of the pre-made boards that do this can be very useful.  They give you a low current 3.3V output and "RS232" lines that are at 3.3V logic levels.  For low speed stuff this can be all you need.


text:
Q: Print the jest coverage table using exec via script I am trying to create a utility to take the windows relative path from VSCode or IntelliJ and replace the forward slash from the path with backslash and execute the jest command to produce the coverage of the files mentioned in the argument to a script.
This is what I tried:
Script_file.js
const yargs = require('yargs');
const exec = require('child_process').exec;

const options = yargs
   .usage('Some info')
   .option('t', {some_object})
   .option('m', {some_object})
   .argv;
const tp = options.t.replace(/\\/g, '/');
const mp = options.m.replace(/\\/g, '/');

exec(`jest ${tp} --coverage --collectCoverageFrom=${mp} --colors`, (error, stdout, stderr) => {
 if(error){
  console.log('err');
}
console.log(stdout);
})

My script in package.json
"test:CoverageFile": "node Script_file.js",

Command
npm run test:CoverageFile -- -t=windows\style\file\path\for\test -m=windows\style\file\path\for\file\to\get\coverage\from

Now, everything is fine and I'm getting the output as expected too except the marked area in the image attached below[Image is just for reference]:

My question is how can I print this table as well in the output? I'll be highly obliged for any help.
EDIT:

*

*I also tried hooking up the --coverageReporters flag with jest command using various available options but to no avail.


text:
Q: POST Caspio API I'm trying to post to Caspio's API - I've been able to perform POST & GET requests fine to get my token and retrieve data in XML from Caspio although having problems using the POST method to get data back into Caspio. In the example below I've encoded my body as {"First_Name":"John"}.
Currently I'm getting 415 Unsupported Media Type - The server cannot service the request because the media type is unsupported.
var requestPost = new XMLHttpRequest();

 function PostWebAPI() {
       requestPost.open("POST", "https://c2ezh542.caspio.com/rest/v1/tables/Patient/rows", true);
       requestPost.setRequestHeader("Authorization", "Bearer " + token_);
       requestPost.send("%7B%22First_Name%22%3A%22John%22%7D");

The table operations specify the following:
POST Table Rows
/tables/<name>/rows

*

*Method: POST

*Description: Inserts a row into the table

*Parameters:
URL, Body, required – {"field1″:"value1″,"field2″:"value2"}

*Result:
201 Created (if successful) + Location Header contains URL to
inserted row

A: Use Following
var params= {"field1″:"value1″,"field2″:"value2"};
request.setRequestHeader("Accept", "application/json");
request.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
request.send(JSON.stringify(params));

request.onreadystatechange = function () {`enter code here`
if (request.readyState == 4 && request.status== 201) {
     var obj = JSON.parse(response);
         }
}

}


text:
Q: C# ScatterView, how to bind two items together to behave as one? I have a scatterview control into which I load rather large images from a URL. The images are of different size, and sometimes the image is too large to grab in one piece and I have to download two halves of it as individual images. I'm trying to join the two halves so they look and behave as one whole. I've killed two days and got it close, but not perfect.
Things I've tried:
Add both halves to a StackPanel, which then gets wrapped with a ScatterViewItem. For some reason, the SVI doesn't adjust its size properly if the panel is much wider than it is high. I tried a few things, including the suggested style on MSDN for having the SVI adjust height/width to its content. Works great for most cases, but if the image is long and narrow, a chunk of it gets lopped off *(see below).
Add both halves to a Canvas. Doesn't seem to resize properly with manipulations.
Add both halves to a Grid. Can't get the halves to form one image. Strangely, the entire grid gets displayed properly by the SVI, including long images. However, the two halves are either on top of each either (no horizontal allignment), or really far apart (doing column def and setting them to col 0 and 1), or almost perfect but with a small gap between them (setting one to left allign and the other to right allign).
*So far, StackPanel seems the most promising. I could get the entire thing to show by setting the SVI MinWidth manually, but then the control's hit area for manipulation is larger than the image itself. I've been trying to play around with the SizeChanged event of the images, trying to dynamically adjust the SVI midwith as the images actually load, so that it's equal to their combined rendered width, but by now it's starting to become more shamanism than science. I'm at the point of throwing random code at this thing and just hoping the results will be of some use or insight.
Part of the problem, I think, is that the image source bitmap can take a good 5 seconds to actually download after the images are added to a container, and it's wrapped into the SVI, and the svi is added to the scatterview itself. It tells me that each image has a Height of NaN but an ActualHeight of 87 before the bitmap is ready and the image is rendered. How this all affects the size of the stack panel and the SVI, I don't really know.
So, perhaps someone has some insight or suggestions to try while I keep tinkering around and hoping something will come out of it.

A: I used to work at Microsoft and was responsible for creating the ScatterView control.  This question really has 2 parts:
First, why are ScatterViewItem sizes acting strange?  ScatterViewItems will autosize themselves based on their contents but in doing so enforce 2 restrictions:  a) the initial height and width are large enough so that the user can comfortably grab the item to resize it and b) the initial height and width are small enough that the item only takes up no more than ~20% of each dimension of the screen, leaving room for other items to be visible.  Both of these behaviors can be overridden if you explicitly set the Height & Width properties yourself.
Second, what's the best way to combine multiple images into a single ScatterViewItem?  My recommendation would be to create a single WriteableBitmap which is the size of the combined image.  Put this into your ScatterViewItem.  Then, as each image chunk is downloaded, insert that chunk into the WriteableBitmap.  This is going to yield better performance and ensure no issues with visial artifacts appearing along the seams.

A: If StackPanel is almost working but you're having problems with sizing you might want to try using a DockPanel instead.
StackPanel doesn't constrain the size of it's children in the direction of its Orientation so it is effectively infinite in size in that direction which can cause the type of weird sizing behavior you're describing (this is why they're usually wrapped in a ScrollViewer like ListBox does).
DockPanel does the same sort of stacking behavior if all items use the same DockPanel.Dock setting, but with sizing constraints based on the parent layout. It might be able to give you the right mix of what Grid and StackPanel are doing.
Grid might also work if set up correctly - without seeing it I think 2 Auto rows or columns, with Horizontal and VerticalAlignment on both images set to Stretch might do it. It may also need an additional empty * row or column if you need to eat up empty space when the images don't fill the SVI.


text:
Q: Propagation of standard error of fit through to the average and standard deviation of replicates I am using an equation to fit measured data. I have measured multiple replicates for each condition, each of which is then individually fitted to this equation.
Once the data are fitted I obtain a constant and associated standard error for each fit (this should represent the magnitude of the average distance each point is from the fitted line if my understanding is correct?).
The measurement error is negligible (tiny) given the magnitude of the fitted error and the differences between replicates.
So I have fitted constants with standard errors $C1\pm\epsilon1$, $C2\pm\epsilon2$ & $C3\pm\epsilon3$ and I would like to take the average of these and calculate their standard deviation.
If we consider $C1 = 38.4 \pm 0.06$ $C1 = 42.5 \pm 0.08$ and $C1 = 41.2 \pm 0.07$ then the mean and SD, ignoring the SE, are $40.77 \pm 2.12$. We can see that the SE is very small given this variation but intuitively we would still expect a slight increase in the error.
As I understand it, we can calculate the SD from the SE by multiplying by the square root of the sample size. In this case, the sample size would be the number of data points along the curve to be fitted, let's say $240$ points. Now the small SE of fitting becomes much larger.
$SD = \frac{SE}{\sqrt n}$
$0.06$ becomes $0.93$ while $0.08$ and $0.07$ become $1.24$ and $1.08$ respectively.
Would it still be correct to then plug these new standard deviations into the traditional formula for error propagation for multiplication/division (i.e. is the derivation of a SD from a SE of fit in this manner compatible with typical error propagation afterwards?):
SD of the mean $=  \sqrt{(\frac{0.93}{38.4})^2 + (\frac{1.24}{42.5})^2 + (\frac{1.08}{41.4})^2} = 0.046$
However, this error is much smaller than expected and fails to take into account the variance in samples I think. Is this extra error a value than can be linearly added to the larger error for sample variation? Or is there a better formula/approach to correctly propagate this type of error when averaging fitted constants?
A similar question has suggested pooling all the original data ("Average" standard errors of multiple samples) but I do not see how this could appropriately be applied to curve fitting.
This question (Average of Average Quantities and Their Associated Error) seemed like it might be what I'm after but applying the suggested formula yielded a similarly small final SD:
SD of the Mean $=\sqrt{\frac{1}{N^2} \sum_i^N{Var(X)}} = \sqrt{\frac{1}{9} * \left( 0.93^2 + 1.24^2 + 1.08^2 \right)} = 0.63$
While larger than the previous attempt of 0.046, it is still much smaller than the 2.12 calculated without the corresponding SE.
How should one go about propagating the error associated with fitted data through to their averages when performed in replicates?


text:
Q: Android and IOS game engine I'm looking for a 2D game engine to use to target both Android and IOS without the need to rewrite my code. Bonus points if WP7 is supported too.
I found many of them, but they all uses c++. I would really like a game engine that uses an interpreted/high level language(c#, java, python, lua, you say. My preference is toward strong typed ones), productivity with this languages is far better than with C/C++(at least on my side)
I found this ones:
Emo framework
pros:

*

*BSD licence

*Uses interpreted language (Squirrel, ps: never heard of it, but it seams good)

cons:

*

*Really simple Api

*No access to full features of the underlying system (no way to connect with bluetooth or internet using the os api)

Mono
pros:

*

*C#

*WP7 support, + other

*it seams very well supported

cons:

*

*both mono for android and mono for ios are 400$ each. I'm a student and i develop in free time, i have no such money to invest, and if i must chose between the 2, i'll chose android and stick with AndEngine, that is really good for my needs right now(too sad it is Android only)

Well, i don't know other engines that work on both platforms and use an interpreted language.
About C++ ones,
cocos2d-x

*

*open source

*C++

*well documented? (since it is a porting from cocos2d, i expect the tutorials for cocos2d to be useful to cocos2d-x too)

*WP7 possible porting

*it doesn't ease developing for both platform from only pc (obviously a mac is needed in any case to load the app to the store)

Marmalade

*

*C++

*reasonable price (149$ with in-app splash. +300$ just to remove it is a bit too much)

*Apps program

*Very well support for running it in the emulator (paragraph: Technology)

*Good help in deploying the app (paragraph: Getting it on a Device)

Have i missed some good one? I really would like to find a good one that uses an interpreted language, but the one i found is too much expensive or doesn't fulfil my needs(i need to fully access the networking apis). If such an engine doesn't exists, i think i'll use cocos2d-x (since it is open source), but i'm sure i haven't taken into consideration other engines!

A: There are many game engines that work for both Android and iOS, 26 by my last count. Take a look at http://mobilegameengines.com/

A: There is also Unity.
For 2D games you don't need the Pro version of it, though the non-Pro is still 2*$400 for iOS and Android.
It is well known and uses mono (C#) as the scripting engine.

A: You also have the option to compile mono for ARM/Android, and use it natively. It is not supported, and you have to create some wrappers around your code, so it can interface with the Android native APIs.
If using commands carefully you can then port this code with some changes to Mono for iOs and XNA (WP7) too

A: V-Play (v-play.net) is a cross platform 2D game engine based on Qt/QML. API reference.
It already  supports iOS, Android, Symbian, MeeGo and Desktop platforms. BlackBerry and Windows Phone support is in progress and will be added soon.
V-Play also comes with ready-to-use game templates for the most successful game genres like tower defense, platform games or puzzle games, several tutorials and demos. (V-Play examples & demos)
(Disclaimer: I'm one of the guys behind V-Play)

A: I'd also suggest GameSalad, it's 2D, runs on Android, iOS, and used HTML5 to support Tizen.  It's got a declarative drag-and-drop programming UI (so if you're looking for traditional text based program it's not for you).  There are many examples and tutorials online and a couple of marketplaces of templates you can use as a starting point.  Disclaimer, I'm one of the co-founders.


text:
Q: RMSE with and without standardizing the output variable I have a time series data that I would like to be able to forecast. I was trying to standardize the data as my columns are all of different ranges. I have standardized the input variables, but was reluctant of whether should I standardize the output variable or not. The following code snippet describeswhat I did.
class OutOfSampleForecasting:

    def __init__(self, train_df, test_df):
        train_df = train_df.dropna()
        test_df = test_df.dropna()

        #make the 'date' the index column
        train_df = train_df.set_index('date')
        test_df = test_df.set_index('date')

        #change rows were demand = 0, make them demand = 1
        train_df.loc[train_df.demand == 0, 'demand'] = 1
        test_df.loc[test_df.demand == 0, 'demand'] = 1

        self.X_train = np.array(train_df.loc[:, train_df.columns != 'demand'])
        self.y_train = np.array(train_df.loc[:, 'demand'])

        self.X_test = np.array(test_df.loc[:, test_df.columns != 'demand'])
        self.y_test = np.array(test_df.loc[:, 'demand'])

        #standardizing only the training, applying parameters to testing
        scaler = StandardScaler()
        self.X_train = scaler.fit_transform(self.X_train)
        self.X_test = scaler.transform(self.X_test)

        y_scaler = StandardScaler()
        self.y_train = y_scaler.fit_transform(self.y_train.reshape(-1, 1)).reshape(-1)
        self.y_test = y_scaler.transform(self.y_test.reshape(-1, 1)).reshape(-1)

        print('avg demand: %.3f', np.mean(self.y_test))

    def forecast(self, model, model_name, isCatBoost=False):
        print('*** Results for %s ***' % model_name)
        t1 = time.time()
        if isCatBoost:
            model.fit(self.X_train, self.y_train, verbose=False)
        else:
            model.fit(self.X_train, self.y_train)
        y_pred = model.predict(self.X_test)
        t2 = time.time()
        time_taken = float(t2 - t1) / 60
        print('time taken %.3f min' % time_taken)
        self.print_stats(self.y_test, y_pred)

    def print_stats(self, y_test, y_pred):
        r2_Score = r2_score(y_test, y_pred)
        rmse_score = np.sqrt(mean_squared_error(y_test, y_pred))
        mse_score = mean_squared_error(y_test, y_pred)
        mae_score = mean_absolute_error(y_test, y_pred)
        print('R^2: %.3f\nRMSE: %.3f\nMSE: %.3f\nMAE: %.3f\n' % (r2_Score, rmse_score, mse_score, mae_score))

        plt.plot(y_test, label='actual')
        plt.plot(y_pred, label='predicted')
        plt.legend()
        plt.show()

    def run_all(self):
        self.forecast(Ridge(), 'Ridge Regression')
        self.forecast(Lasso(), 'Lasso Regression')
        self.forecast(ElasticNet(), 'Elastic Net Regression')
        self.forecast(DecisionTreeRegressor(), 'Decision Tree')
        self.forecast(RandomForestRegressor(), 'Random Forest')
        self.forecast(AdaBoostRegressor(), 'Ada Boost')
        self.forecast(GradientBoostingRegressor(), 'Gradient Descent')
        self.forecast(XGBRegressor(), 'XGBoost')
        self.forecast(CatBoostRegressor(), 'Cat Boost', True)
        self.forecast(SVR(), 'Support Vector Regressor')

As you can see in this part, I am stnadardizing both the input and the output variable:
#standardizing only the training, applying parameters to testing
            scaler = StandardScaler()
            self.X_train = scaler.fit_transform(self.X_train)
            self.X_test = scaler.transform(self.X_test)

            y_scaler = StandardScaler()
            self.y_train = y_scaler.fit_transform(self.y_train.reshape(-1, 1)).reshape(-1)
            self.y_test = y_scaler.transform(self.y_test.reshape(-1, 1)).reshape(-1)

However, what made me wonder is the RMSE results (and other metrics) with and without standardizing the output variable:
With standardizing output variable:
RMSE: 1.213
MSE: 1.472
MAE: 1.014

Without Standardizating output variable
RMSE: 48.784
MSE: 2379.876
MAE: 42.317

So basically, which results should I consider ?
I assume that what happened when standardizing the output variable is that ALL COLUMNS are now of the same scale, but is and RMSE of 1.2 good ? Or is an somehow a 'transformed' RMSE ? And what should I do in this case ?

A: 1) There's no useful meaning I can see in a RMSE/MSE/MAE calculated based on standardized data. Standardization has changed the variable and removed the  interpretability of RMSE/MAE/MSE.
2) As for what RMSE value is good, this is impossible for us to say for reasons I explain in this thread Is my model any good, based on the diagnostic metric ($R^2$/ AUC/ accuracy/ RMSE etc.) value?
3) It's not obvious that standardization is necessary (or even useful) in your case.


text:
Q: How do we explain accelerated motion in Newtonian physics and in modern physics? Maybe my question will seem stupid, but I am not a physicist so I have some problems understanding a classic Newtonian experiment: in the bucket experiment, why does he have to introduce the absolute space in order to explain the accelerated motion of water in the bucket. Also i read that in modern physics (Einstein) the accelerated motion of the water in the bucket is explained by the action of gravitational field. How does this work exactly? Other sources say that the accelerated motion remains a dilemma even for modern physics, if so why is that? Sorry that my question is a bit too broad, but i really have a problem understanding this topic so thank you in advance for your answers.

A: Newton's bucket is a thought experiment, not a real experiment (although it is also easy to do). The point of the experiment is that the notion of "rotating" or "not rotating" is not measured by the relative distances between objects, but by the relative motion of objects relative to a space-time structure.
When a bucket is rotating, the distance between any two atoms is the same in Newtonian mechanics, so that the geometrical relationship between any two particles is no different than when it is at rest. But when it is rotating, the water is pushed out by a centrifugal force, and when it is at rest, there is no centrifugal force.
Newton concludes that the centrifugal force is a property of the motion of the bucket relative to a notion of absolute non-accelerated space. This conclusion is already present in the structure of Newton's mechanics, where the accelerations are physical forces, and they are only physical forces relative to an inertial frame--- a description of space where the coordinate axes are given at any time, so that the axes can rotate and move at a constant velocity relative to another inertial frame, but they can't accelerate. This description is not completely circular, because it is asserting the existence of rotation and Galilean symmetry, and Newton's laws of motion have this symmetry.
In Special Relativity
Newton's bucket is clarified somewhat in special relativity. When viewed in space-time, with time considered vertical, the motion of points on a stationary bucket make vertical lines that trace out a cylinder in time. When you rotate the bucket, the trajectories of the atoms of the bucket make spirals in time. Even in Euclid's geomety, spirals are different from straight lines, in that straight lines have no curvature and are minimum distance paths between two points.
In special relativity, the reason that a rotating bucket is different from a non-rotating one is obviously pure geometry. The time-paths of the atoms in the rotating case are curved, while the time-paths of the non-rotating bucket atoms are straight. The relative distances between points are not just the relative distances in space, but in space-time, and these are not invariant under rotation.
So extending the notion of distance to space-time makes the choice of reference frame no different from the choice of coordinate axes in geometry. This removes a lot of the philosophical bite of Newton's bucket, because the only reason you expected things to be the same is because of the three dimensional distances were preserved. When you see that the four-dimensional distances are not preserved, why would you expect that everything must stay the same?
Mach's Principle and General Relativity
But for Einstein, this was still not enough. The issue left is that the notion of geometry, the notion of perpendicularity and distance, is something that is acting on material objects, but is not acted upon. This is inconsistent with Newton's third-law philosophy, anything that acts must in turn be modified by its action.
That this is unnatural was pointed out by Ernst Mach. Put Newton's bucket outside in a field at night. When the bucket is rotating, the distant stars are whirling around the bucket in its frame, while when it is still, the distant stars are still. Why should the two notions of rest coincide?
In other words, Mach is asking why the local notion of "at rest, no rotation" should coincide with the cosmological notion of "at rest, no rotation". By asking this question, he is implicitly allowing the local notion of "no rotation" to vary from point to point, and then he is asking "what dynamical law makes the no-rotation frame at any one point coincide with the global notion determined by far away matter?"
Mach concludes that the matter determined the local frame. He concluded that if Newton made the bucket "Many leagues thick", that there would be some effect between the water and the bucket which would make the water follow the bucket motion, so that the centrifugal force would be relative to the bucket, and not relative to the distant stars.
This idea was uppermost on Einstein's mind when formulating GR. Einstein realized that the observed force of gravity allows for an ambiguity in the notion of rest, since it is impossible to distinguish between acceleration and a local gravitational field. So he introduced a dynamical geometry, whose dynamics would produce gravity, and so on to GR, this story is well known.
Frame Dragging
When GR was finished, Einstein asked again about the bucket. If you place a bucket in space-time, there would be a gravitational analog of a magnetic force from the walls of the rotating bucket on the water inside. When the bucket is rotating relative to the local notion of no-rotation, this force will pull the water outward a tiny amount. The force is consistent with Mach's interpretation, when the bucket is rotating and the water is not rotating along, the gravitomagnetic force pulls the water out into an immeasurably tiny parabola.
If the bucked is made more massive, the effect is enhanced. In the limit that the bucket is about to collapse to a black hole, the exterior decouples, so that the water follows the bucket only. In this way, General Relativity incorporates Mach's principle. For a bucket sufficiently massive, the water's shape will be determined by its motion relative to the bucket, not relative to the distant stars.
This effect is called "Frame dragging", and it is a well known prediction of GR which has either already been observered or is soon to be observed.
Cosmological Mach's Principle
But there is a second notion of Mach's principle, that the motion of the bucket is relative to distant matter. This notion seemed for a long time to be incompatible with GR.
There are bogus arguments in the literature regarding this. One argument is that the Kerr solution is a counter-example to Mach's principle, because it describes a black hole rotating in empty space-time, and what's the black hole rotating relative to?
Of course this is nonsense, since you can scale solutions to become arbitrarily small in classical GR. So if you have any rotating object, rotating relative to distant matter, you can scale the solution to become infinitesimal, and send the objects it is rotating relative to to infinity. Then the object will rotate relative to boundary conditions at infinity.
The real question is for situations where there are no boundary conditions. For Einstein, this meant a closed compact universe, like a sphere. In this case, he spent much time trying to establish that Mach's principle would hold precisely, so that the rotation of objects would be relative to distant objects.
The problem is that he needed a stable spherical universe first! A static spherical universe didn't work as a solution of GR. So Einstein considered a universe with a uniform dust of matter all over, and added a cosmological constant to stabilize the universe, and studied this solution as a model cosmology.
But this cosmology is unstable too. The matter will form black holes, the black holes swallow each other, and eventually, one of the black holes becomes cosmological in size. The biggest black hole turns inside out to become a cosmological horizon, and eventually swallows all the other black holes, leaving only a uniform deSitter space.
The deSitter space is the universe of inflation--- it is constantly spreading out, in a process that can be thought of as matter constantly falling into the cosmological horizon that surrounds any observer. The cosmological horizon stays a certain distance away from any observer, and this is the only stable universe of positive cosmological constant.
In deSitter space, the cosmological horizon is a form of matter--- it is continuously linked to the largest black hole in the Einstein static universe. Further, once deSitter space is empty, this horizon cannot rotate, it can only rotate if there is something in the interior (deSitter space is unique). This means that deSitter spaces, like Einstein static universes, also obey Mach's principle, so long as the notion of matter is expanded to include cosmological horizons.
Modern Answer
The modern answer is that Newton's bucket is rotating mostly relative to the cosmological horizon, and partly relative to the distant stars. If all the stars and the cosmological horizon were rotating, we would rotate with them, so that there would be no centrifugal force (this is difficult to even say in GR, because there is no coordinate independent way to set the distant stars and cosmological horizon in a rotating motion, although one can do it for the stars alone, using Godel's universe, so long as the horizon becomes inconsistent).
This is the modern view of Mach's principle. This point of view is obvious given modern holographic physics, but is not in the literature. It is a complete resolution to the problems raised by Mach's principle, so that there is no mystery left. Mach's principle in this point of view, is just a stunted classical precursor to the holographic principle. It is asserting that all motion is to be measured relative to distant horizons.

A: Because motion is generally regarded as relative. In other words, you cannot tell whether sth. is moving or not without a reference object. However, since in the bucket experiment the dynamical effect of rotation and no rotation is distinct without any reference object, he introduces absolute space so motion is no longer relative, but absolute.

Also i read that in modern physics (Einstein) the accelerated motion of the water in the bucket is explained by the action of gravitational field.

This is wrong. Despite the name "relativity", Einstein's theory is about the absoluteness of spacetime. Rotation is still absolute; something either rotates or not, without reference.

Other sources say that the accelerated motion remains a dilemma even for modern physics.

I don't know any dilemma in this.

Response to Ron Maimon's answer :
Mach's principle and general relativity
It is true that Mach's principle inspired Einstein to discover his famous general relativity, but Mach's principle is in fact incompatible with general relativity. Mach himself rejects general relativity for it admits absolute spacetime.
The corollary of Mach's principle about the bucket experiment is that the centrifugal force water experiences results from the dragging of distant star swirling around. This poses a serious question: how does the motion of stars light-years away affects the  water instantly?
In addition, the well-known result of Thirring has shown that while rotating shells (as a model of distant stars or a big and massive enough bucket that drags the water with gravitation itself) do have effects the same as centrifugal forces and Coriolis forces, they also exert axial forces with the same order of magnitude, without a fictitious force counterpart.
Fictitious forces and gravitational field
The famous equivalence principle states that fictitious forces and gravitation are indistinguishable locally. This gives people false impression that fictitious forces are actually a product of gravitation. But no, while "true" gravitational field is manifestation of spacetime curvature, fictitious forces are a result of non-zero spatial curvature depending on how you slice spacetime into spatial and temporal part. No matter how you rotate the bucket and choose the coordinate system, a flat spacetime is a flat spacetime, and no gravitation is present.
Holographic principle
Holographic principle is more of a conjecture than an established theory. It is "a property of quantum gravity and string theories" as said by Wikipedia. And it is well-known that none of quantum gravity and string theories have ever been experimentally verified and they are constantly evolving, unlike general relativity. So while it is certainly an interesting way to think about bucket experiment, the holographic perspective is by no means the accepted "modern view".

A: My problem with Mach's Principle -- that the water in the bucket experiences centrifugal force (really its inertial tendence to fly off on a tangent to the center of rotation) due to its angular velocity relative to the mass of the rest of the universe -- is that it takes less force to spin the water-filled bucket than it would to spin the universe itself. Therefore, we can be sure it is the bucket which is spinning and not the universe. Thus, both the bucket and the universe enjoy what Einstein called "priviledged states": one "moving" and the other "at rest".


text:
Q: Send a notification with R under Windows I am currently recording / updating my tables in the bank with the R language:
dbWriteTable (with," table ", table, row.names = FALSE, overwrite = TRUE)
This script of mine that updates the tables in R in a postgres database, is automatically run from time to time by a windows task.
I need to know when the information is recorded or not, perhaps in an alert format on the screen, or something that catches the eye.
note: I know that there is "r.out", but it overwrites, does not warn when the problem occurs, or anything like that.

A: You could call Windows Powershell:

*

*Run powershell and authorize script execution:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

*Create a notification script and execute it with system:

showMessage <- function(message) {
  MessageScript <-'
    [CmdletBinding()]

    $ErrorActionPreference = "Stop"

    $notificationTitle = "{message}"

    [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
    $template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)

    #Convert to .NET type for XML manipuration
    $toastXml = [xml] $template.GetXml()
    $toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null

    #Convert back to WinRT type
    $xml = New-Object Windows.Data.Xml.Dom.XmlDocument
    $xml.LoadXml($toastXml.OuterXml)

    $toast = [Windows.UI.Notifications.ToastNotification]::new($xml)
    $toast.Tag = "PowerShell"
    $toast.Group = "PowerShell"
    $toast.ExpirationTime = [DateTimeOffset]::Now.AddMinutes(5)
    #$toast.SuppressPopup = $true

    $notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("PowerShell")
    $notifier.Show($toast);'

  system('powershell',input=glue::glue(MessageScript),show.output.on.console=F)

}

showMessage(message = 'this is a test')

This works for me:


text:
Q: Reuse the same IntBuffer object to wrap a different Bytebuffer I need to get a view of a ByteBuffer b using the same object IntBuffer viewBuffer without having to instantiate a new object every time the reference to the ByteBuffer changes.
// An external ByteBuffer
ByteBuffer b1 = ByteBuffer.allocateDirect(1024 * 4).order(ByteOrder.LITTLE_ENDIAN);
// get a Int view over the bytebuffer
IntBuffer viewBuffer1 = b1.asIntBuffer() // this creates an object

// Another external ByteBuffer
ByteBuffer b2 = ByteBuffer.allocateDirect(1024 * 4).order(ByteOrder.LITTLE_ENDIAN);
// get an Int view offer the new bytebuffer
IntBuffer viewBuffer2 = b1.asIntBuffer() // this creates another object

Here is the implementation of asIntBuffer() in DirectByteBuffer where a new object is created every time we call the method.
public IntBuffer asIntBuffer() {
        int off = this.position();
        int lim = this.limit();

        assert off <= lim;

        int rem = off <= lim ? lim - off : 0;
        int size = rem >> 2;
        if (!UNALIGNED && (this.address + (long)off) % 4L != 0L) {
            return (IntBuffer)(this.bigEndian ? new ByteBufferAsIntBufferB(this, -1, 0, size, size, this.address + (long)off) : new ByteBufferAsIntBufferL(this, -1, 0, size, size, this.address + (long)off));
        } else {
            return (IntBuffer)(this.nativeByteOrder ? new DirectIntBufferU(this, -1, 0, size, size, off) : new DirectIntBufferS(this, -1, 0, size, size, off));
        }
    }

We work on a high performance application requiring copy-free, allocation-free and fast processing and since IntBuffer does not provide a wrap method, I tried to implement my own view class that wraps different ByteBuffers, the performance in terms of processing time was not the same as Java's IntBuffer. Indeed, I could see in the disassembled code that operations over an IntBuffer are auto-vectorized but operations over the ByteBuffer are not.
I also tried creating a class that extends IntBuffer in order to add a method wrap(ByteBuffer bb), but not only the package java.nio is private, the field ByteBuffer bb used internally is final.
See how an IntBuffer is instantiated.  I do not see why they did not provide a wrap method here or why the field bb is made final. I mean, using the same constructor code we could easily have a wrap method that just points to a different ByteBuffer bb without the unnecessary object creation.
class ByteBufferAsIntBufferB extends IntBuffer {
    protected final ByteBuffer bb;

    ByteBufferAsIntBufferB(ByteBuffer bb) {
        super(-1, 0, bb.remaining() >> 2, bb.remaining() >> 2);
        this.bb = bb;
        int cap = this.capacity();
        this.limit(cap);
        int pos = this.position();

        assert pos <= cap;

        this.address = bb.address;
    }

My question is how can I make operations over Ints in a ByteBuffer run as fast as the java IntBuffer, i.e. get auto-vectorized by the JIT compiler.
Edit:
Here is my custom class IntViewBuffer where one object can be reused.
public class IntViewBuffer{
    private ByteBuffer bb;
    private int offset;
    private int limit;
    private int INT_BYTE_SIZE = 4;

    public IntViewBuffer(ByteBuffer bb, int offset, int limit) {
        this.wrap(bb, offset, limit);
    }

    public void wrap(ByteBuffer bb, int offset, int limit){
        this.bb = bb;

        assert (limit <= bb.capacity() && offset <= limit);
        this.offset = offset;
        this.limit = limit;
    }

    private int getByteIndex(int index){
        int byteIndex = (offset + index * INT_BYTE_SIZE);
        assert(byteIndex <= limit);
        return byteIndex;
    }
    public void put(int index, int value){
        this.bb.putInt(getByteIndex(index), value);
    }

    public int get(int index){
        return this.bb.getInt(getByteIndex(index));
    }
}

With this class I can reuse my view buffer but operations will not be auto-vectorized (by checking the assembly code, I did not find the AVX-512 SIMD instructions that usually appear with IntBuffer).
// An external ByteBuffer
ByteBuffer b1 = ByteBuffer.allocateDirect(1024 * 4).order(ByteOrder.LITTLE_ENDIAN);
// get a Int view over the bytebuffer
IntViewBuffer view  = new IntViewBuffer(b1, 0, b1.capacity());

// Another external ByteBuffer
ByteBuffer b2 = ByteBuffer.allocateDirect(1024 * 4).order(ByteOrder.LITTLE_ENDIAN);
// reuse my object to wrap the new bytebuffer
view.wrap(b2, 0, b2.capacity());


text:
Q: How can I update zlib to a custom version in Debian I've a special/very slim version of debian. I want to install a custom version av zlib and I only want one zlib version on my system. Let's say I update zlib, then I also need to recompile and update (for example) openssh since it has zlib as one of its dependencies. Do I need to list those dependencies manually or is there a tool that will recompile all packages with reverse dependencies (something like bitbake does for yocto). How does upstream debian developer handle those cases?

A: If you install it as a .deb file via dpkg, I'd expect you'll be fine since those other packages are linked to the zlib package ... unless there are items you're removing that other packages will fail upon not getting. If that's the case, you probably want Alpine Linux or some other minimalist distro.
I'm a bit rusty, but I believe the process is something like this:
$ apt source zlib
$ cd zlib*/debian
[ make your changes in new diffs in the `patches` subdirectory]
$ dpkg-buildpackage -rfakeroot

This creates a .deb file and IIRC also installs it. If it doesn't also install it, then you can do that with a command like dpkg -i zlib*.deb
See also Debian's Building the Package documentation.

If all you need is a newer version of a particular package, you can add it from Debian Testing or Unstable in three steps:
1. Edit /etc/apt/sources.list or something in /etc/apt/sources.list.d/ to include
deb http://deb.debian.org/debian/ testing main non-free contrib

2. Edit /etc/apt/preferences or something in /etc/apt/preferences.d/ to include
Explanation: Don't use testing by default
Package: *
Pin: release a=testing
Pin-Priority: 1

3a. Install it manually:
$ sudo apt install -t testing zlib1g

3b. Alternatively, ensure it always installs from testing with another preferences stanza:
Explanation: Use zlib from testing
Package: zlib1g
Pin: release a=testing
Pin-Priority: 500


text:
Q: How to integrate jasper report in flutter mobile app? I am searching for document how to connect or call or view jasper report from flutter mobile application but i was unable to find one. Hope community will help me out.
TIA


text:
Q: Circle touching a given line at a point The line $x=y$ touches a circle at a point $(1,1).$ If the circle also passes through the point $(1,-3)$ then find it.
Circle touching a line is $$(x-x_1)^2+(y-y_1)^2+λL=0$$
we get $(x-x_1)^2+(y-y_1)^2+λ(x-y)=0.$
Now according to my textbook, this is the substitution
$(x-1)^2+(y-1)^2+λ(1-1)=0$ and $(1,-3)$ in $x$ and $y.$
But according to the solution in the test from which the question is, the substitution is $(x-1)^2+(y-1)^2+λ(1-(-3))=0$ and $(x, y)= (1,-3).$
How is the second one correct when $(1,-3)$ does not even lie on the line $x=y ?$
OR is the formula in my textbook wrong ?
I referred to other books but they have the same formula as my textbook.
A similar method of substitution has been used to solve many sums of the similar kind in the test.
I do not need a solution.

A: Tangent: so the line $y = 2 - x$ is a diameter of the circle. The perpendicular bisector of the segment from $(1,1)$ to $(1,-3)$  also passes through the circle center.


text:
Q: Having a multi-module project inside of another multi-module project in gradle I have this question with regards to a gradle multi-module setup:
I have
root project
   build.gradle
   settings.gradle <-include 'subproject','multimodule'
   multi module project
       build.gradle
       settings.gradle <- include multi1, multi2
       multi1
           build.gradle
       multi2
           build.gradle <- compile project(':multi1')
   subproject
       build.gradle <- How can this reference multi1?
       settings.gradle

Now both subproject and multi2 needs to refer to multi1. multi2 is easily able to refer to multi1. But how do I make subproject refer multi1?

A: It looks like it is a limitation of Gradle that it does not support multiple root/sub-projects. This is because Gradle does not support the use of multiple settings.gradle files in a project setup. See this question. And this answer from me on a related question.


text:
Q: Play Window Games on Ubuntu I have many windows games on my PC like Doom, Doom 2, Diablo, Diablo 2, Diablo 3, NFS Games, Left 4 Dead games call of Duty games, Halo games and many many more games i have in my Laptop. I just like to know if its possible to intall them and play them on Ubuntu without using Steam, im not a Steam fan at all. Because im a Hard core gamer and i dont want to change from Window 8.1 to Ubuntu if all of my games are not compatible.

A: You can install Wine (http://www.winehq.org/)
sudo apt-get install wine

This programme allow you to execute Windows software in linux plateforms. Or you can use a virtual machine (with virtualbox for example), and to install on Windows 8 for your games.

A: Most of those games do not have Linux native versions, but many work well using Wine. You can find out more about which games work in Wine and how well using the app database:
http://appdb.winehq.org/
Doom, in particular, has lots of Linux ports and can be played natively.

A: Most of the games work in Ubuntu under wine. Wine is program that let's you run windows programs on Linux(ubuntu) without emulation(no CPU loss, lagging, etc.). You can check if  certain game(or program) is compatible with wine and if it possibly has some problems running on wine on Wine HQ. Just enter the game you want in search. I'll do it for the games you mentioned, but you can see more details by clicking on the links.

*

*Doom - No information

*Doom II - Everything works except background music(old results)

*Diablo, Diablo II, Diablo 3 - Everything works

*NFS work fine as far as I know

A: you can run windows programs in linux via wine. install it with sudo apt-get isntall wine1.7 and install latest Nvidia or ATI driver,Then install your games.


text:
Q: Excel VBA - Get Table from Outlook and Paste to Excel I'm trying to use this code on Excel from an old post by @RyanL to extract a table from an email. However, I'm not experience with coding so, I would like some help with the following.
Weekly, I'm receiving emails from two sources with a specific subject ("Source" & # & "Pipeline Schedule -" & "Date()") but different to each other. Source1 send the table on its body and in a PDF format where Source2 send either one or two table only on its body.
Using the answer from the aforementioned post, I'm able to copy the whole body but unfortunately it paste it in one cell (can't figure out why, beside the suggestion there). However, in my case I only need the tables.
See the code below
Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As Outlook.Namespace
Dim olFldr As Outlook.MAPIFolder
Dim olItms As Outlook.Items
Dim olMail As Variant
Dim i As Long
Dim xTable As Word.Table
Dim xDoc As Word.document
Dim xRow As Integer

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set olFldr = olNs.GetDefaultFolder(olFolderInbox)
Set olItms = olFldr.Items

olItms.Sort "Subject"

i = 1
On Error Resume Next

xRow = 1
For Each olMail In olItms
    If InStr(1, olMail.Subject, "Supplier 2 Pipeline Schedule - 26 Mar 2021") > 0 Then
    Set xDoc = olMail.GetInspector.WordEditor
    For i = 1 To xDoc.Tables.Count
        Set xTable = xDoc.Tables(i)
        xTable.Range.Copy
        ThisWorkbook.Sheets("Sheet2").Paste
        xRow = xRow + xTable.Rows.Count + 1
        ThisWorkbook.Sheets("Sheet2").Range("A" & CStr(xRow)).Select
    Next
    End If
Next olMail

    Set olFldr = Nothing
    Set olNs = Nothing
    Set olApp = Nothing

    End Sub

Maybe the answer is posted somewhere, but due to my limited knowledge I probably can't locate it.
Any suggestion?
EDIT: So, I managed to combine some codes and import tables from Outlook (see updated code). However, on one of the Supplier, it also copy the images from the email signature. Can we avoid that?
2nd issue is that the tables are not pasted on the 1st Row so, for me with hard to manipulate the data automatically. Any ideas?
3rd issue, some of this email have a trail of correspondence with "draft" plans. Can somehow stop reading the email body once it reach the end of the current correspond?
Cheers

A: So, I've managed to make it work, using parts of @Kobayashi code.
See below for reference.
Sub GetFromInbox()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False

Dim olApp As Outlook.Application
Dim olNs As Outlook.Namespace
Dim olFldr As Outlook.MAPIFolder
Dim olItms As Outlook.Items
Dim olMail As Variant
Dim i, j, eRow As Long
Dim olMail1 As Outlook.MailItem
Dim olHTML As MSHTML.HTMLDocument: Set olHTML = New MSHTML.HTMLDocument
Dim olEleColl As MSHTML.IHTMLElementCollection
Dim t
Dim posicao As String

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set olFldr = olNs.GetDefaultFolder(olFolderInbox)
Set olItms = olFldr.Items

olItms.Sort "Subject"

i = 1
xRow = 1
For Each olMail In olItms
    If InStr(1, olMail.Subject, "Supplier1 Pipeline Schedule - 26 Mar 2021") > 0 Then
'    If InStr(1, olMail.Subject, "Supplier2 Pipeline Schedule - 26 Mar 2021") > 0 Then
        With olHTML
            .body.innerHTML = olMail.HTMLBody
            Set olEleColl = .getElementsByTagName("table")
        End With

        With ThisWorkbook.Sheets("Sheet1")
            'which row to start
            eRow = 1
            posicao = "A" & eRow
            For Each t In olEleColl
                For i = 0 To t.rows.Length - 1
                    For j = 0 To t.rows(i).Cells.Length - 1
                        'ignore any problems with merged cells etc
                        On Error Resume Next
                        .Range(posicao).Offset(i, j).Value = t.rows(i).Cells(j).innerText
                        On Error GoTo 0
                    Next j
                Next i
                'define from which row the next table will be written
                eRow = eRow + t.rows.Length + 1
                posicao = "A" & eRow
            Next t
        End With
    End If
Next olMail

Last = Cells(rows.Count, "A").End(xlUp).Row
For i = Last To 1 Step -1
    If (Cells(i, "A").Value) = " " Then
        Cells(i, "A").EntireRow.Delete
    End If
Next i

Set olFldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub

Any suggestion for optimisation is welcome.


text:
Q: TypeScript List won't validate the element's type when initializing with a list The following code in TypeScript won't throw any error nor warning,
even though the 1st element is not compliant to IFileStatus.
interface IFileStatus {   a: string;   b: number; }
let statuses: IFileStatus[] = [
                {
                    a: '123',
                    c: [],
                }];

If alternatively, trying to push the element, it does show the expected error (a should be a string, b property is missing, and c does not exist and is not allowed).
statuses.push({
                a: 123,
                c: []
            });

Why the 1st code does not show the expected error?
how can I enable validation of elements type in the list in the initial declaration?
I'm using the very latest TypeScript 3.5.2
UPDATE #1+2:
At least WebStorm complaints for other errors the same as in the gulp-typescript build.
The tsconfig.json is below.

{
      "compilerOptions": {
          "declaration": false,
          "noEmitOnError": true,
          "noUnusedLocals": true,
    "noExternalResolve": true,

    "target": "es5",
    "lib": ["es6", "dom"],
    "baseUrl": "",
    "sourceMap": false,
    "typeRoots": [
        "./node_modules/@types",
        "./typings"
    ],
    "types": [
        "jasmine",
        "node"
    ],
    "paths": {
        "@ngtools/json-schema": [
            "./packages/@ngtools/json-schema/src"
        ],
        "@ngtools/logger": [
            "./packages/@ngtools/logger/src"
        ],
        "@ngtools/webpack": [
            "./packages/@ngtools/webpack/src"
        ]
    }
},
"exclude": [
    "packages/@angular/cli/blueprints/*/files/**/*",
    "dist/**/*",
    "node_modules/**/*",
    "tmp/**/*"
] }

The tslint.json is below.

{
    "rules": {
        "max-line-length": [
            true,
            150
        ],
        "no-inferrable-types": true,
        "class-name": true,
        "comment-format": [
            true
        ],
        "indent": [
            true,
            "spaces"
        ],
        "eofline": true,
        "no-duplicate-variable": true,
        "no-eval": true,
        "no-arg": true,
        "no-internal-module": true,
        "no-trailing-whitespace": true,
        "no-bitwise": true,
        "no-unused-expression": true,
        "no-var-keyword": true,
        "no-consecutive-blank-lines": [true, 1],
        "triple-equals": true,
        "one-line": [
            true,
            "check-catch",
            "check-else",
            "check-open-brace",
            "check-whitespace"
        ],
        "quotemark": [
            true,
            "single",
            "avoid-escape"
        ],
        "semicolon": [
            true,
            "always"
        ],
        "typedef-whitespace": [
            true,
            {
                "call-signature": "nospace",
                "index-signature": "nospace",
                "parameter": "nospace",
                "property-declaration": "nospace",
                "variable-declaration": "nospace"
            }
        ],
        "curly": true,
        "variable-name": [
            true,
            "ban-keywords",
            "check-format",
            "allow-leading-underscore",
            "allow-pascal-case"
        ],
        "whitespace": [
            true,
            "check-branch",
            "check-decl",
            "check-operator",
            "check-separator",
            "check-type"
        ]
    }
}

A: I have found the reason: an 'any' element was added in between, and for whatever reason, TypeScript assumed the whole list was any[]. And so the developer was free to do whatever with the elements of the list.
Demo of bypassing the TypeScript type check of a list during direct value initialization


text:
Q: Menu creation in Activity with Fragments I'm programming an app based on the Weather App from Udacity Courses.
The app is based in a two activies: one general and other for weather detail with a fragment inside.
I've been experimenting with menu creation and I have and issue that I would like to comment with you all.
AFAIK, If I want to share an option between different fragments, it seems a good idea to put that option in the activity menu instead of the fragment menu, so that's what I'm doing with the Share button.
But I've seen that I have two possible situations:
1) If the menu item inside the xml is declared as showAsAction = never I can create the instance of the ShareActionProvider and the intent inside the onOptionsItemSelected, within the corresponding if sentence (and works fine):
public class DetailActivity extends Activity {

ShareActionProvider mShareActionProvider;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detail);

    getActionBar().setDisplayHomeAsUpEnabled(true);

    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.container, new DetailFragment()).commit();
    }
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.detail, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        startActivity(new Intent(this, SettingsActivity.class));
        return true;
    }
    if (id == R.id.action_share) {
        mShareActionProvider = (ShareActionProvider) item.getActionProvider();
        Intent shareIntent = new Intent(Intent.ACTION_SEND);
        shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(Intent.EXTRA_TEXT, "nada");
        mShareActionProvider.setShareIntent(shareIntent);
        return true;
    }
    return super.onOptionsItemSelected(item);
}

2) If the menu item is declared as showAsAction = always and the Share button is in the action bar, the above doesn't work as the Share button isn't even clickable. I have to declare the above code inside the onCreateOptionsMenu to make things work.
Why is that? Is different the chain of events for creating a menu when is not in the action bar Vs. when it's in it?
Thanks for the answers and excuse me for my english.


text:
Q: APK of react-native app shows blank screen I have built a react-native app which works perfectly fine in development, but when I generate the APK with expo build:android, it doesn't work. If I load the app on my android device, the splash screen is displayed for a few moments and then it just shows a blank screen. I am unsure how to check what the error is when using the apk. How do I do so?

A: The issue could be with the SDK version. Check your device API level and the SDK version your building with.
You could set up a ADB (Android Debug Bridge) and install the apk onto a device/emulator. There you have a number of options for debugging.
Edit:
If there isn't any android specific code that uses the API then you can ignore what I said before.

*

*Uninstall the app on your device. Settings > Apps > [Your App] > Uninstall

*In your development run 'expo start'

*If dev is working, then run 'expo start --no-dev --minify'

*If that works then you can build 'expo build:android'

*Install apk on your device || with ADB preferably

Information need for further troubleshooting:-

*

*Device Version [Found on device Settings>System>About]

*Expo SDK [Found in app.json]

*ADB logs


text:
Q: c# asp.net website calling a webApi I meet a problem because of my inexperience managing Threads.
I have this Action bellow :
 public static async Task<joueurs> loadjoueurs(int id)
        {
            joueurs EmpInfo = new joueurs();

            using (var client = new HttpClient())
            {
                //Passing service base url
                client.BaseAddress = new Uri("http://www.myWebApi.fr/api/");

                client.DefaultRequestHeaders.Clear();
                //Define request data format
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                //Sending request to find web api REST service resource GetAllEmployees using HttpClient
                HttpResponseMessage Res = await client.GetAsync("joueurs?id=" + id);

                //Checking the response is successful or not which is sent using HttpClient
                 if (Res.IsSuccessStatusCode)
                  {
                      //Storing the response details recieved from web api
                      var EmpResponse = Res.Content.ReadAsStringAsync().Result;

                      //Deserializing the response recieved from web api and storing into the Employee list
                       EmpInfo = JsonConvert.DeserializeObject<joueurs>(EmpResponse);
                      return EmpInfo;
                  }

                return null;
            }

it s just client to get my data from a webApi (no ssl no authentication, when I test it I receive the right values)
but when I make a call using the function above (in my asp.net website) .... it stay stucked at the HttpResponseMessage = await .... eternally.
In my webApi I have two functions same name but different parameters .
 public async Task<IHttpActionResult> Getjoueur(int iduser, int idsport)

and
 public async Task<IHttpActionResult> Getjoueur(int id)

So I am don't know where the problem comes from.
(sequel) Here is the place where I call the Task :
public SuperModel(int id)
        {
            this.joueur =  Repojoueurs.loadjoueurs(id).Result;
       /*     this.classificationSport =  Repoclassificationsport.loadclassificationsport().Result;
             ...
       */
        }

And then my Supermodel is instantiated here in my Home controller  :
public ActionResult Index(int id)
        {
            SuperModel superModel = new SuperModel(id);

            return View(superModel);
        }

A: Can you try not to use the async and wait. Around three changes like below
public static HttpResponseMessage loadjoueurs(int id)
    {

            HttpResponseMessage Res = client.GetAsync("joueurs?id=" + id);

return Request.CreateResponse(HttpStatusCode.OK,EmpInfo, "application/json");
     }


text:
Q: Reload UITableView after removing Subview I have added TableView which data will be dynamically changes after filling form. and I have inserted form on TableView view controller class. But can't able to reload the tableview.
How can reload UITableView after removing Subview?
Please suggest solution.
Thanks..

A: Use - [tableView reloadData].


text:
Q: Selecting rows in mySQL table by comparing the value to python dictionary I have 2 databases one in mongoDB and one table in mySQL. I am taking data from mongoDB which is being stored in a dictionary and looks like this-
dictionary = {
           "message_code": "12345"
}

I want to match this message_code value in the mySQL tables colums called final_code and retrieve table rows which match the message_code. How can I do that?
SELECT *
FROM mysql_table
WHERE final_code = dictionary.message_code

Something like this?

A: You pass a string to mysql, not python objects. So you must build that string interpolating the values you want in python, i.e.
'SELECT * FROM mysql_table WHERE final_code='+dictionary["message_code"]

and pass that string to mysql as query.


text:
Q: Ebay ebaysdk-python - get error Code: 18000, Too many requests i got this error

'GetOrders: Class: RequestError, Severity: Error, Code: 18000, Too many requests. Short-duration threshold exceeded. You have exceeded the call threshold per second. Please throttle traffic for this call and then retry.'

I use ebaysdk-python lib, i fill all params and my code like
api = Trading(debug=True,token=token, appid="", certid="", devid="",config_file="/e_bay/ebay.yaml", warnings=True)
api.execute('GetOrders', {})

What i do wrong ?
Thx for help.
Edit
When i request in this url https://developer.ebay.com/DevZone/build-test/test-tool/?index=0&api=developer-analytics&call=rate_limit__GET&variation=json i get info that  i have  but i nowhere see Trading ,

{
    "rateLimits": [
      {
        "apiContext": "api context test",
        "apiName": "api name",
        "apiVersion": "v1",
        "resources": [
          {
            "name": "DELETE1",
            "rates": [
              {
                "limit": 100,
                "remaining": 100,
                "reset": "2020-04-27T13:17:45.000Z",
                "timeWindow": 15
              }
            ]
          },
          {
            "name": "GET1",
            "rates": [
              {
                "limit": 100,
                "remaining": 100,
                "reset": "2020-04-27T13:17:45.000Z",
                "timeWindow": 15
              }
            ]
          },
          {
            "name": "POST1",
            "rates": [
              {
                "limit": 100,
                "remaining": 100,
                "reset": "2020-04-27T13:17:45.000Z",
                "timeWindow": 15
              }
            ]
          },
          {
            "name": "PUT1",
            "rates": [
              {
                "limit": 100,
                "remaining": 100,
                "reset": "2020-04-27T13:17:45.000Z",
                "timeWindow": 15
              }
            ]
          }
        ]
      },
      {
        "apiContext": "commerce",
        "apiName": "translation",
        "apiVersion": "v1_beta",
        "resources": [
          {
            "name": "commerce.translation.translate"
          }
        ]
      },
      {
        "apiContext": "sell",
        "apiName": "listingapi",
        "apiVersion": "v1_beta",
        "resources": [
          {
            "name": "createListingDraft",
            "rates": [
              {
                "limit": 5000,
                "remaining": 5000,
                "reset": "2020-04-28T00:05:55.000Z",
                "timeWindow": 89999
              }
            ]
          }
        ]
      },
      {
        "apiContext": "sell",
        "apiName": "logistics",
        "apiVersion": "v1",
        "resources": [
          {
            "name": "sell.logistics",
            "rates": [
              {
                "limit": 2500000,
                "remaining": 2500000,
                "reset": "2020-04-27T07:00:00.000Z",
                "timeWindow": 86400
              }
            ]
          }
        ]
      },
      {
        "apiContext": "sell",
        "apiName": "recommendation",
        "apiVersion": "v1",
        "resources": [
          {
            "name": "POST"
          },
          {
            "name": "GET"
          },
          {
            "name": "DELETE"
          },
          {
            "name": "PUT"
          }
        ]
      }
    ]
  }

maybe this is a problem ?
EDIT
This problem was about sandbox, as i wrote limit ws applicable to other endpoints, not getorders

A: Below info from documentation.
You need to modify Your code a bit (1000 queries per 15 seconds), so maybe sleep for 15sec after each 1000: time.sleep(15)
Per (seller) user ID, no more than 1000 GetSellerEvents calls can be executed within any 15-second interval. If this call rate limit is exceeded at any time, the application making the called is blocked. Each time an application is blocked, the user/application must wait until the block is reset after 15 seconds. This short-duration call rate limit applies to all seller accounts, and sellers/developers cannot appeal or request for a higher limit.


text:
Q: getting values from  onSubmit using React.js and redux. Hi I am learning Reactjs, redux, and I want to simply print to console.log the username and password for this form.
I have tried console.log(e.target.user.value) but I a getting no results.
here is the handle function.
and then the Form and 2 fields.

how can I print the value of username and password in the handleSubmit function ?

A: Try Below Code:
handleSubmit = values => {
   console.log('values',values);
   //Here you will get values in values.username & values.password
}

render(){
  const { handleSubmit } = this.props;
  return(
     <form onSubmit={handleSubmit(this.handleSubmit)}>

         <Field type="text" label="Name" name="username" data-fieldname="username"
           component={bootstrapFormField} placeholder="Username" />
         <Field type="password" label="Password" name="password" data-
           fieldname="password" component={bootstrapFormField}
           placeholder="Password" />

          <button type="submit" className="btn btn-submit green">
                Sign In
          </button>

    </form>
   )
}


text:
Q: changing two-level navigation menu to three-level I'm trying to make a modification to turn a two-level navigation menu into a three level menu but I can't get the third level items to appear. When I click on a second level, it currently just retracts into the first level without showing the third-level items. I've re-arranged the code in various ways, but I can't figure it out. Any hints would be much appreciated. (In the HTML, "Menu 3", "Page 6" and "Page 7" is what I added to the original code.)
JS:
 $(document).ready(function(){
 // Menu.
 var $menu = $('#menu');
    $menu_openers = $menu.children('ul').find('.opener');

// Openers.
    $menu_openers.each(function() {

        var $this = $(this);

        $this.on('click', function(event) {

            // Prevent default.
                event.preventDefault();

            // Toggle.
                $menu_openers.not($this).removeClass('active');
                $this.toggleClass('active');

            // Trigger resize (sidebar lock).
                $window.triggerHandler('resize.sidebar-lock');

        });

        });

CSS:
/* Menu */
#menu ul {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  color: #3d4449;
  font-family: "Roboto", sans-serif;
  font-family: 400;
  letter-spacing: 0.075em;
  list-style: none;
  margin-bottom: 0;
  padding: 0;
  text-transform: uppercase;
}
#menu ul a,
#menu ul span {
  border-bottom: 0;
  color: inherit;
  cursor: pointer;
  display: block;
  font-size: 0.9em;
  padding: 0.625em 0;
}
#menu ul a:hover,
#menu ul span:hover {
  color: #f56a6a;
}
#menu ul a.opener,
#menu ul span.opener {
  -moz-transition: color 0.2s ease-in-out;
  -webkit-transition: color 0.2s ease-in-out;
  -ms-transition: color 0.2s ease-in-out;
  transition: color 0.2s ease-in-out;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  position: relative;
}
#menu ul a.opener:before,
#menu ul span.opener:before {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-family: FontAwesome;
  font-style: normal;
  font-weight: normal;
  text-transform: none !important;
}
#menu ul a.opener:before,
#menu ul span.opener:before {
  -moz-transition: color 0.2s ease-in-out, -moz-transform 0.2s ease-in-out;
  -webkit-transition: color 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
  -ms-transition: color 0.2s ease-in-out, -ms-transform 0.2s ease-in-out;
  transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
  color: #9fa3a6;
  content: '\f078';
  position: absolute;
  right: 0;
}
#menu ul a.opener:hover:before,
#menu ul span.opener:hover:before {
  color: #f56a6a;
}
#menu ul a.opener.active+ul,
#menu ul span.opener.active+ul {
  display: block;
}
#menu ul a.opener.active:before,
#menu ul span.opener.active:before {
  -moz-transform: rotate(-180deg);
  -webkit-transform: rotate(-180deg);
  -ms-transform: rotate(-180deg);
  transform: rotate(-180deg);
}
#menu>ul>li {
  border-top: solid 1px rgba(210, 215, 217, 0.75);
  margin: 0.5em 0 0 0;
  padding: 0.5em 0 0 0;
}
#menu>ul>li>ul {
  color: #9fa3a6;
  display: none;
  margin: 0.5em 0 1.5em 0;
  padding-left: 1em;
}
#menu>ul>li>ul>ul {
  color: #9fa3a6;
  display: none;
  margin: 0.5em 0 1.5em 0;
  padding-left: 1em;
}
#menu>ul>li>ul a,
#menu>ul>li>ul span {
  font-size: 0.8em;
}
#menu>ul>li>ul>li {
  margin: 0.125em 0 0 0;
  padding: 0.125em 0 0 0;
}
#menu>ul>li:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

HTML

Menu

Page 1

Page 2

Page 3

      Menu 1

Page 4

Page 5

      Menu 2

        Menu 3

Page 6

Page 7

A: This piece of code:
$menu_openers.not($this).removeClass('active');

doesn't work because it removes the active class to every element different from $this, but what you want to do is to remove the active class from the siblings of $this. You should use this instead:
$this.parent().siblings().children('.opener').removeClass('active');

Btw, you can write just the following:
$menu_openers = $menu.children('.opener');

It's simpler.


text:
Q: How to insert a datetime properly in a Sqlite database? (UTC vs with-timezone time) I need to insert a datetime into a Sqlite database with Python. (I already read this question, it's not a duplicate here because I'm dealing with timezones questions).
import sqlite3, datetime
dbconn = sqlite3.connect(':memory:')
c = dbconn.cursor()
c.execute('create table mytable(title text, t timestamp)')

#1
c.execute('insert into mytable (title, t) values (?, ?)', ("hello2", datetime.datetime(2018,3,10,12,12,00)))

#2
c.execute('insert into mytable (title, t) values (?, ?)', ("hello", "Sat Mar 10 2018 12:12:00 GMT+0100 (Paris, Madrid)"))

c.execute("select * from mytable")
for a in c.fetchall():
    print a

# (u'hello', u'Sat Mar 10 2018 12:12:00 GMT+0100 (Paris, Madrid)')
# (u'hello2', u'2018-03-10 12:12:00')

*

*The method #1 seems to be the natural way to insert a datetime object inside a Sqlite database, but then it doesn't save the timezone.

*I receive user input in the form Sat Mar 10 2018 12:12:00 GMT+0100 (Paris, Madrid). The method #2 seems to save it into the DB as a string only, and this is not very good: then we can't easily query all rows with date between day1 and day2 for example.

*Question: Should I use another method, and convert Sat Mar 10 2018 12:12:00 GMT+0100 (Paris, Madrid) , and insert this UTC in the Sqlite DB?
Or even should I only insert the UNIX timestamp as an integer in the DB?
Note: I'm ok to discard the original timezone, if it's properly converted to UTC: when I'll query from DB and display for output on a web page, I'll format with the user browser timezone.
Note2: According to https://www.sqlite.org/datatype3.html#date_and_time_datatype, it seems that Sqlite doesn't have a datetime type, it's stored as TEXT, REAL, or INT. But how does it internally know what to use among these choices?

A: The column t is not "really" a datetime one. According to: https://docs.python.org/2/library/sqlite3.html#default-adapters-and-converters , python adds the "timestamp" type to allow easy insertion of datetime objects into sqlite. These objects are converted into strings when they are stored in sqlite. sqlite only supports these datatypes: https://www.sqlite.org/datatype3.html
According to https://www.sqlite.org/lang_datefunc.html , sqlite uses UTC time internally. I think the easiest way for you to store your times is to either convert them into UTC or Unix time before inserting them.
If your times are in local time, you can convert them this way: How do I convert local time to UTC in Python?
If your times are not in local time, converting them is a bit more complicated, as Python does not define any timezones in the standard library. Your best bet here is probably to use a library such as the one described here: https://stackoverflow.com/a/4771733/6180687
I would recommend using Unix time if you already have it, to make your life easier.


text:
Q: Fatal error: Class CI_Session_files_driver contains 1 abstract method
Fatal error: Class CI_Session_files_driver contains 1 abstract method
  and must therefore be declared abstract or implement the remaining
  methods (SessionHandlerInterface::open) in
  C:\xampp\htdocs\cmms2\system\libraries\Session\drivers\Session_files_driver.php
  on line 49

this error keeps on showing up while i'm working on my localhost xampp web app projec. I'm using codeigniter by the way. What do you think is the reason this shows up?
These are the only codes that I've done with session.
  $this->session->set_userdata($data);
    $autoload['libraries'] = array('database','session');
    $config['sess_driver'] = 'files';
    $config['sess_cookie_name'] = 'ci_session';
    $config['sess_expiration'] = 7200;
    $config['sess_save_path'] = sys_get_temp_dir();
    $config['sess_match_ip'] = FALSE;
    $config['sess_time_to_update'] = 300;
    $config['sess_regenerate_destroy'] = FALSE;

A: Please restart apache server if not working then download CodeIgniter again and replace your system/ directory with a fresh one.

A: Edit: This is a PHP bug that in my observation triggers on Windows, Apache+mod_php.
(old answer below)

SessionHandlerInterface::open() is implemented by system/libraries/Session/drivers/Session_files_driver.php in CodeIgniter.
The only way to trigger the error you've shown is by modifying that file, which you're not supposed to do.

A: Go in System folder
/system/libraries/Session
Then comment the code in SessionHandlerInterface.php
interface SessionHandlerInterface {

// public function open($save_path, $name);
// public function close();
// public function read($session_id);
// public function write($session_id, $session_data);
// public function destroy($session_id);
// public function gc($maxlifetime);
}

Let's try your code is working or not


text:
Q: How to trigger s3 copy cli copy events in cdk python? What EventType should I use? Tried all CREATED properties e.g. OBJECT_CREATED_PUT yet can't catch any event.
$ aws s3 cp ./testFile.txt s3://.... >> CloudWatch > log > Received event: {}
app.py
from aws_cdk import aws_s3 as _s3

output_s3 = _s3.Bucket(self,
                       "output_s3",
                       removal_policy=core.RemovalPolicy.DESTROY,
                       auto_delete_objects=True)

# allows the instance to read/write files
output_s3.grant_read_write(instance)

# create s3 notification for lambda function
notification = aws_s3_notifications.LambdaDestination(function)

output_s3.add_event_notification(
    _s3.EventType.OBJECT_CREATED_COMPLETE_MULTIPART_UPLOAD,
    notification)

output_s3.add_event_notification(_s3.EventType.OBJECT_CREATED_PUT,
                                 notification)

lambda_handler.py
import json

def main(event, context):
    print("Received event: " + json.dumps(event, indent=2))
    return json.dumps(event, indent=2)


text:
Q: Converting values of dictionary to the timestamp format I have the dictionary like this:
>>print xdict
{'time': [(2015, 6, 3, 10, 41, 3), (2015, 6, 3, 20, 32, 21), ..., ...]}

Is it a way to transform those values to timestamp format? I wanted to be exactly like  this:
print xdict
{'time': [1433320863.0, 1433356341.0, ..., ...]}

A: Your time tuples do not represent time in UTC. If it is your local timezone and the utc offset rules for the corresponding times are the same as they are now or if C time library has access to a historical time zone database on your platform then you could pass the time tuples to time.mktime() to get "seconds since epoch":
#!/usr/bin/env python
import time

x = {'time': [(2015, 6, 3, 10, 41, 3), (2015, 6, 3, 20, 32, 21)]}
x['time'] = [time.mktime(tt + (-1,)*3) for tt in x['time']]

Otherwise, you should use pytz to get access to the tz database on all platforms and compute the correct "seconds since the Epoch" (POSIX timestamp) corresponding to the input time tuples:
#!/usr/bin/env python
from datetime import datetime
import pytz # $ pip install pytz
import tzlocal # $ pip install tzlocal

local_timezone = tzlocal.get_localzone() # pytz tzinfo representing local time
epoch = datetime(1970, 1, 1, tzinfo=pytz.utc)
x = {'time': [(2015, 6, 3, 10, 41, 3), (2015, 6, 3, 20, 32, 21)]}
x['time'] = [(local_timezone.localize(datetime(*tt), is_dst=None) - epoch).total_seconds()
             for tt in x['time']]

A: Loop through the list and excute the code below. You need time.mktime in order to change into seconds
import time
import datetime

a = (2015, 6, 3, 10, 41, 3)

b = datetime.datetime.strptime(', '.join(str(x) for x in a),'%Y, %m, %d, %H, %M, %S')

print(time.mktime(b.timetuple()))

>>> 1433342463.0

A: Initialize datetime.datetime with unpacked tuple(over * operator).
Then using map and lambda you can easily get your goal.
import time
import datetime

def transform(xdict):
  return {"time": map(lambda k: time.mktime(datetime.datetime(*k).timetuple()), xdict["time"])}


text:
Q: Open loop voltage gain in a datasheet Here is a datasheet for LM324:
https://www.fairchildsemi.com/datasheets/LM/LM2902.pdf
It says: Large DC Voltage Gain: 100dB
Does that mean the "open loop voltage gain is" 100000?
Is "Open loop voltage gain" the same thing with "Large DC Voltage Gain"?
Are they the same thing?

A: Open loop gain and DC gain is actually not the same thing. The open loop gain is the gain without any feedback. The open loop gain falls off with increasing frequency. The open loop gain at DC is often called the "DC voltage gain".
Another important characteristic is the gain-bandwidth product (GBW). Which is the product of the DC voltage gain times the open loop bandwidth of the amplifier. To a first approximation the gain decreases with 20dB (or a factor 1/10) per decade, therefore the GBW is roughly equal to the unity gain frequency of the amplifier.
Usually feedback is used to trade off bandwidth with gain.

A: The answer (as alluded to by Vladimir) can be seen from figure 5, which I have annotated).

At low frequencies (somewhere less than 10Hz), there is a typical gain of 110dB; this is the DC gain, also known as the large signal gain.
The gain starts to roll off quite early, due to the internal compensation of the amplifier.
Even though this is the typical gain, it is not guaranteed; over temperature we can see it can be as low as 83.5dB


text:
Q: how to open multiple files in pdfplumber? I have multiple PDF files created with Access DB forms. The only way I can extract text from them is using pdfplumber. Here is my code and it works perfectly for just 1 file.
import pdfplumber

with pdfplumber.open('CS_page_1.pdf') as pdf:
    page = pdf.pages[0]
    string = page.extract_text()
    file_name = string[43:48]
    print(file_name)

I need to use this extracted string to rename this file and the 100 other files in the folder.
What would be the best way to do it?

A: Would first build a list of all the pdfs in your folder using glob (https://docs.python.org/3/library/glob.html).
Then iterate through each of them- pdfplumb them to obtain the desired string (which you want to rename the file to)- and then rename each individually (https://www.tutorialspoint.com/python/os_rename.htm). Something like this:
import glob
import pdfplumber
import os

arr_of_files = (glob.glob("/path/to/pdfs/*.pdf"))

for file in arr_of_files:
    with pdfplumber.open(file) as pdf:
        page = pdf.pages[0]
        string = page.extract_text()
        file_name = string[43:48]
        os.rename(file, file_name)

A: import pdfplumber
import glob
from tqdm.auto import tqdm
for current_pdf_file in tqdm(glob.glob("<pathname>\.pdf")):
    with pdfplumber.open(current_pdf_file) as my_pdf:
         # do other things here?


text:
Q: Users with Full Control cannot see web part zones I have created a page layout that (among other Things) have three web part zones.
If I use this page layout on a page, I can easily add web parts to the zones. But trouble is, I'm not the one, who needs to do this. For this I've created a user Group, giving them Full Control to the site containing the page. But, when they edit the page, the web part zones are not even shown!
I tried giving the same users Full Control to the masterpage gallery to see, whether they needed some kind of extra access to the page layout. No luck.
The web part zone has all the trimming to be editable in the page layout:
AllowLayoutChange="True" Visible="True" AllowCustomization="True"
AllowPersonalization="True" FrameType="TitleBarOnly" LockLayout="False"

I also tried giving the users Full Control to the Web Part Gallery to no avail.
Hope somebody can help!

A: You can set permissions directly for your page layout within SharePoint Designer, but it's no a solution for you. (SharePoint Designer -> Page Layouts -> Permissions -> Stop Inheriting)
You have to give
1. full control
2. Contribute
3. Designers Group Permissions
in order to be able to work on webparts

A: So... this had nothing to do with SharePoint apparently, as other users with Edit permissions WERE able to add web parts to the (visible) web part zones.
We're guessing that out test user has some sort of IE policy setup that is different to regular users.
So thanks to all for their help!


text:
Q: Type conversion failure in update query I'm fairly new to Access so this is driving me a little crazy.
I'm creating an inventory database and want to count the number of items in stock to update an ordering form. Received items are assigned an order code, and I want to count the number of instances of each order code found within the master table. I have a make table query which does this just fine:
SELECT PrimerList.PrimerName
    , First(Primer_Master.FR) AS FR
    , Primer_Master.OrderCode
    , Count(Primer_Master.OrderCode) AS InStock
INTO PrimerOrder
FROM PrimerList
LEFT JOIN Primer_Master ON PrimerList.ID = Primer_Master.PrimerName
GROUP BY PrimerList.PrimerName
        , Primer_Master.OrderCode
        , Primer_Master.PrimerName
        , Primer_Master.FR
        , Primer_Master.Finished
HAVING ((([Primer_Master]![Finished])=No));

I want to use PrimerOrder to update an order list table PrimerOrderList which has all of the different possible order codes, updating the InStock value for records with matching OrderCode:
UPDATE PrimerOrderList
SET PrimerOrderList.InStock = PrimerOrder.InStock
WHERE (((PrimerOrderList.OrderCode)=[PrimerOrder].[OrderCode]));

However, when I try to run it I get parameter boxes which pop-up asking for PrimerOrder.OrderCode and PrimerOrderList.OrderCode. Even if I put in a valid value for each, I get a type conversion failure. I've checked the data types for both tables and don't see how there could be a type conversion failure - both are set to text.
Any insight would be greatly appreciated! Thanks in advance!

A: You haven't included the PrimerOrder table in your query. Should be:
UPDATE PrimerOrderList INNER JOIN PrimerOrder
ON PrimerOrderList.OrderCode = PrimerOrder.OrderCode
PrimerOrderList.InStock = PrimerOrder.InStock