text:
Q: Looking for simple persistent message buffer in Java I am looking for a simple persistent buffer as temporary storage for JSON messages in a Java application. Memory usage should be relatively constant and not depend on the number of messages in the buffer. It would nice to be able to replay messages from a point in the past. Deletion of old messages should be efficient. Needs to be able to handle 1m messages/h.
Currently my application uses a local RabbitMQ broker which shovels messages to a remote RabbitMQ broker. When the remote broker is down or not accepting messages the local RabbitMQ broker's memory usage rises with the queue length and eventually it stops accepting messages. I want to swap this out for a local disk based buffer and a thread copying messages to the remote RabbitMQ broker.
Anyone have any ideas? I have looked at Kafka but it seems like overkill for my use-case. MongoDB is a possibility but I am worried about its memory usage.

A: Memory usage is always an issue in any system.I am using MongoDB for production and when I compare with similar solutions (CouchDB,CouchBase,redis.io), MongoDB is really good in memory management and easiness of implementation. But I should admit , I never had a chance to test Riak more in detail.
I am storing 5.000.000 user records with 4 index fields and all user session behind a rest/web service api which uses a messaging service behind.
My messaging service uses another db instance on the same server.
My user records have at least 20 fields and session records have just 5 fields.
My ubuntu servers never used more than 10 GB rams even with heavy loading processes.
Hope this helps to figure out.
ps: all depend on data model and how you implement your infrastructure.
Regards,
EDIT:
I think this is a good slideshow about using MongoDB for messaging.
and a nice article about MongoDB and messaging.
You can use the test code and see the results are ok for your solution.
Please don't forget to share your results if you test.


text:
Q: SharePoint Online, Migrate related Flows and Power Apps Are there some tools that allow to migrate SharePoint + Flows and PowerApps between tenants? I know there is Saketa and AvePoint (I suppose free versions could do something too), but what about Flows and Power Apps, how do You migrate them?..

A: Both Microsoft Flow and PowerApps supports Export and Import functionalities to migrate them across another tenant or another environments.
You can find the Microsoft official documentation for the same in below links:

*

*Migrate PowerApps between environments and tenants.

*Export and import your flows across environments with packaging.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Entire function that is a bijection on the unit disk is a rotation I'm working on this problem
"Let $f$ be an entire function. Suppose $f$ restricted to the unit disk is a bijection. Prove that $f$ is a rotation."
My attempt: It is tempting to use Schwarz lemma. Let $T$ be the linear transformation that maps the unit disk to itself and $T(f(0))=0$ (If I remember it right, $T=\frac{z-f(0)}{1-\overline{f(0)}z}$). Then $|Tf(z)|\leq 1$ in the unit disk and $T(f(0))=0$.
So, if I can show that $|Tf(z)|=|z|$ for some nonzero $z$, we are done by the lemma. I want to say $Tf$ achieves maximum on the unit circle. So if the maximum is 1, $|T(f(z))|=1=|z|$ for some $z$ there. However I am stuck here.

A: All holomorphic bijections of the unit disk onto itself are Möbius transformations  of the form
$$
 T(z) = e^{i\lambda} \frac{z-a}{1-\overline a z}
$$
for some $a \in \Bbb D$ and $\lambda \in \Bbb R$. (See for example Can we characterize the Möbius transformations that maps the unit disk into itself?.)
If $T$ is the restriction of an entire function $f$ then necessarily $a=0$ (otherwise $f$ would have a pole at $z= 1/\overline a$).


text:
Q: Repaint TextFile in JPanel I quite new in java and I encounter a problem with repaint a TextFile in my JPanel, this is code:
JPanel paneldol = new JPanel();

        paneldol.add(new JButton(new AbstractAction("Oblicz pole i obwód")
        {
            @Override
            public void actionPerformed(ActionEvent e) {

                paneldol.repaint();
                paneldol.revalidate();

            }
        }
        ));
        paneldol.add(new TextField(model.getPole(), 10));
        paneldol.add(new TextField(model.getObwod(), 10));
        this.add(paneldol, BorderLayout.PAGE_END);

As you see TextField have metod that generate string, so when i click in button I want to repain panel to have new value in my Textfield, Is this possibly?

A:
so when i click in button I want to repain panel to have new value in my Textfield, Is this possibly?"`

If all you want to do is to change the text in text field on button push, then you should give your class a JTextField variable (or multiple JTextField variables), assign a JTextField object to the variable, and this to the GUI. Then when within your button's listener, simply set the text of the JTextField via its setText(...) method. There's no need to call repaint() or revalidate() as they will do nothing useful in this situation.
Also don't mix AWT with Swing components. Use JTextFields not TextFields.


text:
Q: SqlDataSource1_Selected not working I need to be able to change a Boolean variable if a datasource actually retrieves any data, so gridviews/detailsviews aren't displayed. I've placed all the data inside a PlaceHolder tag which is by default not visible.
But using the SqlDataSource1_Selected method, it doesn't actually change the boolean variable - why is this? Here is my code:
    protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.AffectedRows == 0)
        {
            displayData = false;
        }
        else
        {
            displayData = true;
        }

    }

And this is a snippet from my datasource in ASP to show it is indeed linking to the method:
onselected="SqlDataSource1_Selected"

A: I think you are going about this the wrong way
Can you try something like this
SqlDataSource DS = new SqlDataSource();
DataView DV = new DataView();
DS.ConnectionString = _Conn_String;
DS.SelectCommand = query_String;
DataView DV = new DataView();
DV = (DataView)DS.Select(DataSourceSelectArguments.Empty);
if (DV != null)
{
//display data
}
else
{
//do not display data
}


text:
Q: Position a Quickfix window to the bottom down globally I setup my vim with amix/vimrc. The Quickfix window is below NERDTree, as shown below.

How do I move it to the bottom down? I followed this thread, and added the following codes to my_configs.vim,
augroup DragQuickfixWindowDown
    autocmd!
    autocmd FileType qf wincmd J
augroup end

However, the Quickfix window is still on the bottom right.
My desired behaviour like this,

*

*Open Quickfix window automatically after running :make

*The Quickfix window is on the bottom with full width

My related settings are,
"a global quickfix window on the bottom down
augroup DragQuickfixWindowDown
    autocmd!
    autocmd FileType qf wincmd J
augroup end

" Open Quickfix window automatically after running :make
augroup OpenQuickfixWindowAfterMake
        autocmd QuickFixCmdPost [^1]* nested cwindow
        autocmd QuickFixCmdPost    1* nested lwindow
augroup END

"compile and run
" Quick compile and run kinds of files via ,p
nmap <F10> :call <SID>compile_and_run()<CR>

function! s:compile_and_run()
    exec 'w'
    exec 'vertical rightbelow copen 80'
    exec 'wincmd w'
    if &filetype ==# 'c'
        exec 'AsyncRun! gcc % -o %<; time ./%<'
    elseif &filetype ==# 'cpp'
       exec 'AsyncRun! g++ -std=c++11 % -o %<; time ./%<'
    elseif &filetype ==# 'rust'
       exec 'AsyncRun! rustc %; time ./%<'
    elseif &filetype ==# 'java'
       exec 'AsyncRun! javac %; time java %<; rm -f *.class'
    elseif &filetype ==# 'sh'
       exec 'AsyncRun! time bash %'
    elseif &filetype ==# 'python'
       exec 'AsyncRun! time python3 "%"'

A: Put this command in a file stored in this path ~/.vim/after/ftplugin/qf.vim :
wincmd J " Forces QFW to go to bottom of screen across all windows

Reload vim and the quickfix window should be at the bottom.


text:
Q: Setting up a cloud server with IP-based virtual server -> Beginner questions! Beware Looking for some advice. This is my first time having to manage my own server and I'm having to connect a lot of dots.
I currently have around 10 websites on an inmotion shared hosting account. For a number of reasons, I've decided to time to migrate them into a cloud account on either AWS or GCP.
Here's what I'm trying to achieve:
- I want to have one server where I can launch multiple websites from.
- Some of the websites need to have different IPs from the other sites. (I'm looking to have a combination of IP-based virtual hosts and name based virtual hosts on the same server. Is this possible?)
- I want to be able to scale the instance on the fly if traffic for one of the sites picks up.
My initial attempt at this was to try to set it up on GCP, however this isn't going great. I'm finding that there are less tutorials and documentation online for GCP than for AWS and I'm frequently getting stuck.
I'm currently unable to get root access with the default SSH account which is making it impossible to create the virtual servers. I guess my questions are the following:

*

*Is there a more "out of the box" solution with AWS or GCP? Like a preconfigured instance that will allow me to do this?

*What OS should I be running on these servers? The default for GCP was Linux but this is proving to just put another barrier between me and what I'm trying to achieve.

*Any ideas on why the default SSH account on GCP doesn't have root access?

Thanks in advance for your help!

A: Do you really need multiple IPs? That's not particularly common. However it's not particularly difficult, but I've read can be a little fiddly or tricky to get working properly.

*

*No, this isn't a common scenario, so there's unlikely to be anything that will do it out of the box.

*Ubuntu is the best documented and has the most help available.

*Probably for security.
I know AWS, not Google, so I can't say which is better for you. I have a few thoughts for you:

*

*On AWS you can attach multiple elastic IP addresses to an instance. From what I've read it can be fiddly to get the return traffic back to the correct interface.

*I assume you want to "host" multiple websites, not "launch" them.

*On AWS you can scale vertically (a larger machine), but you need to take the server down for a short time to do this. A better approach is to scale horizontally. This requires a load balancer, which costs around $20/month from memory. You also need to have your server saved as an AMI (machine template) or scripted to be built with Puppet/Chef. You can start out with a single machine (suggest you look at t2 instances), scale vertically to start with, and then add a load balancer and scale horizontally later if you need to.


text:
Q: Is there a chart showing all building and their prerequisites in Civilization 5? While playing Civilization V on my PC, I noticed that some buildings are not shown or cannot be built unless you already have another building in that city.
Example: A shrine is required to construct a temple.

A: It's not exactly a building tech tree, but the List of buildings in Civ5 wiki page contains all buildings and whatever prerequisites or requirements they might have (in the Notes section).

A: All of the building tech trees in Civilization 5 are dead-simple. To build the next Science building, you need the previous Science building. To build the next Culture building, you need the previous Culture building. All of the buildings that require particular resources or nearby tiles have no prerequisites. As you've probably discovered by now, the later buildings get really expensive for relatively-small gains, but they're worth it if you've chosen to specialize your cities.
Here's the chart:
Science
Library -> University -> Public School -> Research Lab
Observatory (requires only mountain adjacent to city)
Faith (Gods & Kings or later)
Shrine -> Temple
Culture
Monument -> Amphitheater -> Opera House -> Museum -> Broadcast Tower
Money
Market -> Bank -> Stock Exchange
Mint (requires only gold or silver)
Production
Workshop -> Factory
Forge (requires only iron)
Stone Works (requires only stone)
Stable (requires only horses)
Windmill (requires city not being on a hill)
Water Mill (requires only river adjacent to city)
Lighthouse (requires coastal city)
Harbor -> Seaport (requires coastal city; harbor provides no hammers in BNW)
Hydro Plant (city must be adjacent to river)
Solar Plant (city must be adjacent to desert or on one, and not have a Nuclear Plant)
Nuclear Plant (city must not have a Solar Plant)
Food
Aqueduct -> Hospital -> Medical Lab
Granary
Happiness
Colosseum -> Theatre/Zoo -> Stadium
Stone Works (requires only stone)
Circus (requires only horses or elephants)
Defense
Walls -> Castle -> Arsenal -> Military Base
Bomb Shelter (defense against nukes only)
Increase XP of units
Barracks -> Armory -> Military Academy


text:
Q: Why is exponentiation not atomic? In calculating the efficiency of algorithms, I have read that the exponentiation operation is not considered to be an atomic operation (like multiplication).
Is it because exponentiation is the same as the multiplication operation repeated several times over?

A: This is a matter of definition. For example in hardware-design and biginteger-processing multiplication is not considered an atomic operation (see e.g. this analysis of the karatsuba-algorithm).
On the level that is relevant for general purpose software-design on the other hand, multiplication can be considered as a fairly fast operation on fixed-digit numbers implemented in hardware. Exponentiation on the other hand is rarely implemented in hardware and an upper bound for the complexity can only be given in terms of the exponent, rather than the number of digits.

A: In principle, you can pick any set of "core" operations on numbers that you consider to take a single time unit to evaluate. However, there are a couple of reasons, though, why we typically don't count exponentiation as one of them.
Perhaps the biggest has to do with how large of an output you produce. Suppose you have two numbers x and y that are each d digits long. Then their sum x + y has (at most) d + 1 digits - barely bigger than what we started with. Their product xy has at most 2d digits - larger than what we started with, but not by a huge amount. On the other hand, the value xy has roughly yd digits, which can be significantly bigger than what we started with. (A good example of this: think about computing 100100, which has about 200 digits!) This means that simply writing down the result of the exponentiation would require a decent amount of time to complete.
This isn't to say that you couldn't consider exponentiation to be a constant-time operation. Rather, I've just never seen it done.
(Fun fact: some theory papers don't consider multiplication to be a constant-time operation, since the complexity of a hardware circuit to multiply two b-bit numbers grows quadratically with the size of b. And some theory papers don't consider addition to be constant-time either, especially when working with variable-length numbers! It's all about context. If you're dealing with "smallish" numbers that fit into machine words, then we can easily count addition and multiplication as taking constant time. If you have huge numbers - say, large primes for RSA encryption - then the size of the numbers starts to impact the algorithm's runtime and implementation.)


text:
Q: Why the Expands/Collapse panes button is not shown in the inspector tab I have noticed that since version 57 of firefox the expand/collapse panes button is not shown anymore in the inspector tab. The dropper button appears instead. Any idea how to restate it
Here a firefox 59.1 screenshot
An here is the expand/collapse panes button

This is the state of inspector sidebar when devtools.inspector.split-sidebar-toggle is applied, this actually add the expand/collapse button but the behaver is not the expected

A: Seems like the button has been removed in recent version(s) of Firefox, I don't know why.
I created bug 1449119 and asking to bring back the button again.
For now you can enable the button using following steps (Firefox v59.x):

*

*Go to about:config

*Search for devtools.inspector.split-sidebar-toggle

*Double-click on that (to toggle the value)

*Done!


text:
Q: WordPress recoger datos en frontend desde input de plugin wordpress estoy trabajando en el desarrollo de un plugin para wordpress. El plugin es para mostrar un slider en el front, desde los ajustes del plugin en el backoffice podemos establecer la url de la imagen, título, subtitulo...

En el front tengo el slider correctamente renderizado.

en el archivo principal del plugin encolo los estilos css propios, el js propio, bootstrap... También creo el menú del backoffice y hago el enlace al archivo en el que maqueté el backoffice (otro archivo) y al archivo en el que maqueté el slider (otro archivo) la maquetación del slider básicamente va en un función la cual tiene hook en generate_after_header por lo tanto, siempre me pinta el slider después del header.
Ahora mismo tengo las fotos y texto hardcodeados, el problema es que quiero meter los datos desde los inputs del backoffice pero no lo logro.
En el backoffice tengo el form con method post y action front-content.php para que al hacer el submit lleve esos datos al archivo del front.
en el archivo del front, creeé una variable para recoger uno de los datos que envío por post.
Cuando desde el backoffice agrego un título y pulso el botón de envíar, la página del backoofice cambia y se agrega la página del front a la url y efectivamente veo el dato introducido...
Pero la idea es poder ver esto desde el front (desde el cual no me reconoce la variable)
gestion-web.php archivo principal del plugin
<?php

/**
 * Plugin Name: Gestion web
 * Plugin URI: https://www.altia.es/es/altia
 * Description: Plugin para gestionar la home de sitios WordPress
 * Version: 1.0
 * Author: Adrián Fraga Cortés
 * Author URI: https://www.altia.es/es/altia
 * License: GPLv2
*/

//ACTIVAR Y DESACTIVAR PLUGIN

function activate(){

}

function deactivate(){

}

register_activation_hook(__FILE__, 'activate');
register_deactivation_hook( __FILE__, 'deactivate');

//AGREGAR MENU DE ADMINISTRADOR

function createMenu(){
    add_menu_page(
        'Gestión web',                                    //Título de la página
        'Gestión web',                                    //Título del menú
        'manage_options',                                 //Permiso de administrador
        'gw_menu',                                        //Slug
        'requireContent',                                 //Función del contenido, llama al archivo del backOffice
         plugin_dir_url(__FILE__).'/img/icon.png',        //Icono
        '1'                                               //Posición menú
    );
}

function requireContent(){
    require_once 'views/admin-content.php';
}
add_action('admin_menu', 'createMenu');

//LLAMADA A ARCHIVO FRONTEND

include 'views/front-content.php';

//ENCOLAR BOOTSTRAP

function enqueueBootstrapJS($hook){
    // echo "";

    // Comprobar si estamos en el hook correspondiente para que cargue el archivo
    if($hook != "toplevel_page_gw_menu"){
        return;
    }

    wp_enqueue_script('bootstrapJs', plugins_url('bootstrap/js/bootstrap.min.js', __FILE__), array('jquery'));
}
add_action('admin_enqueue_scripts', 'enqueueBootstrapJS');

function enqueueBootstrapCSS($hook){

    // Comprobar si estamos en el hook correspondiente para que cargue el archivo
    if($hook != "toplevel_page_gw_menu"){
        return;
    }

    wp_enqueue_style('bootstrapCSS', plugins_url('bootstrap/css/bootstrap.min.css', __FILE__));
}
add_action('admin_enqueue_scripts', 'enqueueBootstrapCSS');

//ENCOLAR CSS PROPIO

function enqueueCSS($hook){

    // Comprobar si estamos en el hook correspondiente para que cargue el archivo
    if($hook != "toplevel_page_gw_menu"){
        return;
    }

    wp_enqueue_style('css', plugins_url('css/style.css', __FILE__));
}
add_action('admin_enqueue_scripts', 'enqueueCSS');

//ENCOLAR jS PROPIO

function enqueueJS($hook){

    // Comprobar si estamos en el hook correspondiente para que cargue el archivo
    if($hook != "toplevel_page_gw_menu"){
        return;
    }

    wp_enqueue_script('js', plugins_url('js/gestion-web.js', __FILE__), array('jquery'));
}
add_action('admin_enqueue_scripts', 'enqueueJS');

?>
admin-content.php archivo para el backOffice

        <img src="<?php $path = plugin_dir_url(__FILE__);
                    echo $path ?>../img/icon-header.png" alt="Luckia_logo">

Gestión Web

Configuración slider

    <form method="POST" action="front-content.php" id="slider-form">

Slider 1

                        Título

                        <input class="w-100" name="s1" type="text" id="slider1-titulo" placeholder="Título"></input>

                        Subtítulo

                        <input class="w-100" type="text" id="slider1-subtitulo" placeholder="Subtítulo"></input>

                        Textos con mayor contraste

                        <input type="checkbox" class="form-check-input" id="exampleCheck1">

                    Imagen

                    <input class="w-100" type="text" id="slider1-imagen" placeholder="Url imagen"></input>

                    Imagen móvil

                    <input class="w-100" type="text" id="slider1-imagen-movil" placeholder="Url imagen móvil"></input>

Slider 2

                        Título

                        <input class="w-100" type="text" id="slider2-titulo" placeholder="Título"></input>

                        Subtítulo

                        <input class="w-100" type="text" id="slider2-subtitulo" placeholder="Subtítulo"></input>

                        Textos con mayor contraste

                        <input type="checkbox" class="form-check-input" id="exampleCheck1">

                    Imagen

                    <input class="w-100" type="text" id="slider2-imagen" placeholder="Url imagen"></input>

                    Imagen móvil

                    <input class="w-100" type="text" id="slider2-imagen-movil" placeholder="Url imagen móvil"></input>

Slider 3

                        Título

                        <input class="w-100" type="text" id="slider3-titulo" placeholder="Título"></input>

                        Subtítulo

                        <input class="w-100" type="text" id="slider3-subtitulo" placeholder="Subtítulo"></input>

                        Textos con mayor contraste

                        <input type="checkbox" class="form-check-input" id="exampleCheck1">

                    Imagen

                    <input class="w-100" type="text" id="slider3-imagen" placeholder="Url imagen"></input>

                    Imagen móvil

                    <input class="w-100" type="text" id="slider3-imagen-movil" placeholder="Url imagen móvil"></input>

            <button type="submit" form="slider-form" class="w-25 btn btn-primary">Enviar</button>

    </form>

front-content.php archivo para el frontend
request )

    ?>

            <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
            <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
            <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>

First slide label

Some representative placeholder content for the first slide.

First slide label

Some representative placeholder content for the first slide.

First slide label

Some representative placeholder content for the first slide.

        <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">

            Previous
        </button>
        <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">

            Next
        </button>

<?php
}

add_action('generate_after_header', 'printCarousel');

?>
Alguien hizo algo similar? Necesito poder mostrar los inputs en el front. Estoy atascado. Gracias de antemano!


text:
Q: plotting points with geom_point() and gmap() I have 20 UTM locations included below.
EDIT I have modified the included data to include the locations in Lat Long and added additional code below.  I get the same result with either UTMs or Lat, Long.  I have double checked the points in google earth and they are certainly within the extent of the BaseMap I define below.  Any other suggestions...
    Data <- structure(list(Latitude = c(43.383819, 43.383787, 43.383838,
43.384088, 43.392086, 43.393099, 43.388453, 43.384829, 43.399706,
43.40308, 43.408739, 43.40765, 43.407522, 43.413508, 43.418288,
43.416157, 43.417822, 43.417221, 43.417209, 43.417603), Longitude = c(-111.130989,
-111.130988, -111.130996, -111.129578, -111.122884, -111.12143,
-111.126514, -111.12809, -111.125333, -111.126616, -111.139745,
-111.140401, -111.140614, -111.161305, -111.158135, -111.153607,
-111.141158, -111.13867, -111.138528, -111.138884), UTM_E = c(489389.998429055,
489390.073847615, 489389.434748439, 489504.334690555, 490047.849470232,
490165.770080405, 489753.250369502, 489624.98731782, 489850.781221576,
489747.455360571, 488685.407063201, 488632.089708587, 488614.819667178,
486940.804672798, 487198.453753294, 487564.574155778, 488572.710048877,
488774.012335271, 488785.505688775, 488756.758707237), UTM_N = c(4803447.00888757,
4803443.45497495, 4803449.11983808, 4803476.70438902, 4804364.10875695,
4804476.43597084, 4803961.08216192, 4803558.81058659, 4805210.65084223,
4805585.51119635, 4806215.67635871, 4806094.82531047, 4806080.6391722,
4806748.45554565, 4807278.81358453, 4807041.46688704, 4807224.59410279,
4807157.51112311, 4807156.15933319, 4807199.96352795)), .Names = c("Latitude",
"Longitude", "UTM_E", "UTM_N"), row.names = c(NA, 20L), class = "data.frame")

And I can plot them in using ggplot
library(ggplot2)

ggplot(aes(x = UTM_E, y = UTM_N), data = Data )+ geom_point()
ggplot(aes(x = Latitude, y = Longitude), data = Data )+ geom_point()

However I want to plot them over a map base layer using qmap and have specified the object below.
library(ggmap)
Area <- "palisades wyoming"
BaseMap <- qmap(Area , zoom = 10)
BaseMap

Following the helpful ggmap site linked here, I am trying to plot the points over the base map with the following code
BaseMap + geom_point(aes(x = UTM_E, y = UTM_N), data = Data )
BaseMap + geom_point(aes(x = Latitude, y = Longitude), data = Data )

but get the following warning
Removed 20 rows containing missing values (geom_point).

Why are the values missing when not mapped with ggplot(), but only included with geom_point()
Mapping the points within ggplot() return the following error incompatability between ggplot() and qmap()
BaseMap + ggplot(aes(x = UTM_E, y = UTM_N), data = Data )+ geom_point()

Error in p + o : non-numeric argument to binary operator
In addition: Warning message:
Incompatible methods ("+.gg", "Ops.data.frame") for "+"

Thanks in advance.

A: You can combine them. Don't add your map to an object, just call it with the geom_point code:
qmap(Area , zoom = 10) + geom_point(aes(x = UTM_E, y = UTM_N), data = Data )

And you'll get your map printed.
Good Luck!


text:
Q: Matching groups of nested parentheses using Regex and Pushdown-Automata I'm working on a c# regular expression that can match nested constructions (parentheses in this case) as well as arbitrary operators (a '|' character in this case).
I've gotten started by using a push-down automata as described here.
What I have so far:
String pattern = @"
(?# line 01) \(
(?# line 02) (?>
(?# line 03) \( (?<DEPTH>)
(?# line 04) |
(?# line 05) \) (?<-DEPTH>)
(?# line 06) |
(?# line 07) .?
(?# line 08) )*
(?# line 09) (?(DEPTH)(?!))
(?# line 10) \)
";

var source = "((Name1| Name2) Blah) | (Name3 ( Blah | Blah))";

var matches = Regex.Matches(source, pattern,
  RegexOptions.IgnorePatternWhitespace);
matches.Dump();

Yields the following results:
// ((Name1| Name2) Blah)
// (Name3 ( Blah | Blah))

Desired results:
// ((Name1| Name2) Blah)
// |
// (Name3 ( Blah | Blah))

Note: There may or may not be any operators between the groups. For example, the source may look like "((Name1| Name2) Blah) (Name3 ( Blah | Blah))"

A: You can try this: (just adding |\| at the end)
\((?>\((?<DEPTH>)|\)(?<-DEPTH>)|.?)*(?(DEPTH)(?!))\)|\|


text:
Q: C# connect to LTP3 with range E000-E007 I'm using C# to create a software that sends triggers to a special machine connected to the computer in parallel port.
I can't do anything about the hardware there and I'm trying to send numbers via LTP3, and the LTP3 is defined with different range than usual, the range (according to the DeviceManager) is E000-E007.
I'm using c# and I'm trying to send event but it doesn't work. The code I have do work for regular LTP3 and I use 632 as the address (or 888 in case of LTP1).
I really don't understand how it works, what is the correct port? should I change the code?
Here is the part in the code that deals with the sending the events :
class PortControl
{
    [DllImport("inpout32.dll", EntryPoint = "Out32")]
    public static extern void Output(int adress, int value); // decimal
}

private void SendTrigger(int triggerId)
{
    try
    {
        PortControl.Output(632, (short)triggerId);
        Thread.Sleep(1);
        PortControl.Output(632, 0);
    }
    catch (Exception e)
    {
        MessageBox.Show("Error in sending trigger: " + e.Message);
    }
}

This work when the LPT3 has a standard range, but not in the this unfamiliar range E000-E007.
Thanks in advance for your help!!

A: The address parameter 632 is the decimal equivalent to the hexadecimal value 278.  Likewise, the hexadecimal value E000 would have the decimal equivalent of 57344.
You can pass the address in decimal if you like, but it's much easier to read if you use hexadecimal notation.  Simply prefix the address with 0x, like so:
PortControl.Output(0xE000, ...


text:
Q: A callback was made on a garbage collected delegate of type 'NDde!NDde.Foundation.Ddeml+DdeCallback::Invoke'. I have a WPF application and we open Avaya dialer application using a DDE(Dynamic Data Exchange). It launches fine for two or three times, But when we launch for 4th time, sometimes after a long gap, I find the below error.
"A callback was made on a garbage collected delegate of type 'NDde!NDde.Foundation.Ddeml+DdeCallback::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called."
Below is the code for this. You can find full code in https://ndde.codeplex.com/
Please help me find the root cause and resolve it.
 //call back declared here
     internal static class Ddeml
        {
      public delegate IntPtr DdeCallback(
                int uType, int uFmt, IntPtr hConv, IntPtr hsz1, IntPtr hsz2, IntPtr hData, IntPtr dwData1, IntPtr dwData2);
    }

        internal sealed class DdemlContext : IDisposable
        {
 private int  _InstanceId   = 0;     // DDEML instance identifier
            private Ddeml.DdeCallback _Callback   = null  ;

        public DdemlContext()
        {

            // Create the callback that will be used by the DDEML.
            _Callback = new Ddeml.DdeCallback(this.OnDdeCallback);
        }

            private IntPtr OnDdeCallback(int uType, int uFmt, IntPtr hConv, IntPtr hsz1, IntPtr hsz2, IntPtr hData, IntPtr dwData1, IntPtr dwData2)
            {
                // Create a new transaction object that will be dispatched to a DdemlClient, DdemlServer, or ITransactionFilter.
                DdemlTransaction t = new DdemlTransaction(uType, uFmt, hConv, hsz1, hsz2, hData, dwData1, dwData2);

                // Run each transaction filter.
                foreach (IDdemlTransactionFilter filter in _Filters)
                {
                    if (filter.PreFilterTransaction(t))
                    {
                        return t.dwRet;
                    }
                }

                // Dispatch the transaction.
                switch (uType)
                {
                    case Ddeml.XTYP_ADVDATA:
                    {
                        DdemlClient client = _ClientTable[hConv] as DdemlClient;
                        if (client != null)
                        {
                            if (client.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_ADVREQ:
                    {
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_ADVSTART:
                    {
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_ADVSTOP:
                    {
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_CONNECT:
                    {
                        // Get the service name from the hsz2 string handle.
                        StringBuilder psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                        int length = Ddeml.DdeQueryString(_InstanceId, hsz2, psz, psz.Capacity, Ddeml.CP_WINANSI);
                        string service = psz.ToString();

                        DdemlServer server = _ServerTable2[service] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_CONNECT_CONFIRM:
                    {
                        // Get the service name from the hsz2 string handle.
                        StringBuilder psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                        int length = Ddeml.DdeQueryString(_InstanceId, hsz2, psz, psz.Capacity, Ddeml.CP_WINANSI);
                        string service = psz.ToString();

                        DdemlServer server = _ServerTable2[service] as DdemlServer;
                        if (server != null)
                        {
                            _ServerTable1[hConv] = server;
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_DISCONNECT:
                    {
                        DdemlClient client = _ClientTable[hConv] as DdemlClient;
                        if (client != null)
                        {
                            _ClientTable[hConv] = null;
                            if (client.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            _ServerTable1[hConv] = null;
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_EXECUTE:
                    {
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_POKE:
                    {
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_REQUEST:
                    {
                        DdemlServer server = _ServerTable1[hConv] as DdemlServer;
                        if (server != null)
                        {
                            if (server.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_XACT_COMPLETE:
                    {
                        DdemlClient client = _ClientTable[hConv] as DdemlClient;
                        if (client != null)
                        {
                            if (client.ProcessCallback(t))
                            {
                                return t.dwRet;
                            }
                        }
                        break;
                    }
                    case Ddeml.XTYP_WILDCONNECT:
                    {
                        // This library does not support wild connects.
                        return IntPtr.Zero;
                    }
                    case Ddeml.XTYP_MONITOR:
                    {
                        // Monitors are handled separately in DdemlMonitor.
                        return IntPtr.Zero;
                    }
                    case Ddeml.XTYP_ERROR:
                    {
                        // Get the error code, but do nothing with it at this time.
                        int error = dwData1.ToInt32();

                        return IntPtr.Zero;
                    }
                    case Ddeml.XTYP_REGISTER:
                    {
                        if (Register != null)
                        {
                            // Get the service name from the hsz1 string handle.
                            StringBuilder psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                            int length = Ddeml.DdeQueryString(_InstanceId, hsz1, psz, psz.Capacity, Ddeml.CP_WINANSI);
                            string service = psz.ToString();

                            Register(this, new DdemlRegistrationEventArgs(service));
                        }
                        return IntPtr.Zero;
                    }
                    case Ddeml.XTYP_UNREGISTER:
                    {
                        if (Unregister != null)
                        {
                            // Get the service name from the hsz1 string handle.
                            StringBuilder psz = new StringBuilder(Ddeml.MAX_STRING_SIZE);
                            int length = Ddeml.DdeQueryString(_InstanceId, hsz1, psz, psz.Capacity, Ddeml.CP_WINANSI);
                            string service = psz.ToString();

                            Unregister(this, new DdemlRegistrationEventArgs(service));
                        }
                        return IntPtr.Zero;
                    }
                }
                return IntPtr.Zero;
            }


text:
Q: ¿como cambio de color un canvas con un clic en html5? Disculpe pero quisiera saber como puedo hacer para cambiar de color un dibujo en canvas por el metodo de darle clic al dibujo.
Es para otro tipo trabajo pero solo quiero el metodo de darle un clic al dibujo y que realize una accion.

A:

window.onload = function(){
  var canvas = document.getElementById("canvas");
  var ctx = canvas.getContext("2d");
  ctx.fillStyle = "green";
  ctx.fillRect(10, 10, 200, 200);
  ctx.fill();
  canvas.addEventListener("click", function(e){
    if(e.clientX-canvas.offsetLeft > 10 && e.clientX-canvas.offsetLeft < 210){
      if(e.clientY-canvas.offsetTop > 10 && e.clientY-canvas.offsetTop < 210){
        ctx.fillStyle = "red";
        ctx.fillRect(10, 10, 200, 200);
        ctx.fill();
      }
    }
  },false);
};

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Un canvas</title>
</head>
<body>
        <canvas width="1080" height="720" id="canvas"></canvas>
</body>
</html>

Tienes que añadir un eventListener y luego buscar en que zona de la pantalla se ha hecho click, este ejemplo superpone un cuadrado rojo sobre el otro.


text:
Q: How to structure panel data for LSTM and Keras? I am trying to figure out how to structure my dataset and build the X and y such that it will work with Keras' Stacked LSTM for sequence classification.
I have panel data where I am trying to predict classifications. I am not entirely sure how to understand timesteps or how to properly craft data's shape given my panel data.
# Libraries
from keras.models import Sequential
from keras.layers import LSTM, Dense
import numpy as np
import pandas as pd

# Here is an example of my data
df = pd.read_csv('https://raw.githubusercontent.com/rocketfish88/democ/master/sample2.csv')
df

# Contains a handful of features, a target, year, and id of the observation
   id        year  x1 x2  x3  y
0   A       2015   1   1   1  1
1   A       2016   2   2   2  1
2   A       2017   3   3   3  2
3   A       2018   4   4   4  2
4   B       2015   1   1   1  3
5   B       2016   2   2   2  2
6   B       2017   3   3   3  1
7   B       2018   4   4   4  1
8   C       2015   1   1   1  2
9   C       2016   2   2   2  2
10  C       2017   3   3   3  3
11  C       2018   4   4   4  2

Keras.io presents the following with example:
data_dim = 16
timesteps = 8
num_classes = 10

# expected input data shape: (batch_size, timesteps, data_dim)
model = Sequential()
model.add(LSTM(32, return_sequences=True,
               input_shape=(timesteps, data_dim)))  # returns a sequence of vectors of dimension 32
model.add(LSTM(32, return_sequences=True))  # returns a sequence of vectors of dimension 32
model.add(LSTM(32))  # return a single vector of dimension 32
model.add(Dense(10, activation='softmax'))

model.compile(loss='categorical_crossentropy',
              optimizer='rmsprop',
              metrics=['accuracy'])

# Generate dummy training data
x_train = np.random.random((1000, timesteps, data_dim))
y_train = np.random.random((1000, num_classes))

# Generate dummy validation data
x_val = np.random.random((100, timesteps, data_dim))
y_val = np.random.random((100, num_classes))

model.fit(x_train, y_train,
          batch_size=64, epochs=5,
          validation_data=(x_val, y_val))

I am fairly lost as to how to take my dataset and transform it into the proper shape of (size, timesteps, dimensions)
I appreciate any help!


text:
Q: Android weird lib.c crash I'm writing an Android app.
I totally have no idea why it happenes often.
Could someone tell me what reason might cause it happened?
Thanks!
09-29 13:58:00.540: INFO/DEBUG(4658): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-29 13:58:00.540: INFO/DEBUG(4658): Build fingerprint: 'MOTO/wifi_hubble/wifi_hubble:3.1/H.6.4-20/1310119769:user/ota-rel-keys,release-keys'
09-29 13:58:00.540: INFO/DEBUG(4658): pid: 23390, tid: 23390  >>> com.aaa.bbb <<<
09-29 13:58:00.540: INFO/DEBUG(4658): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
09-29 13:58:00.540: INFO/DEBUG(4658):  r0 deadbaad  r1 00000001  r2 a0000000  r3 00000000
09-29 13:58:00.540: INFO/DEBUG(4658):  r4 00000000  r5 00000027  r6 00000028  r7 00000005
09-29 13:58:00.540: INFO/DEBUG(4658):  r8 00000002  r9 001aa540  10 00000005  fp 0000005e
09-29 13:58:00.540: INFO/DEBUG(4658):  ip ffffffff  sp bed42ee8  lr afe164ad  pc afe12c1c  cpsr 68000030
09-29 13:58:00.540: INFO/DEBUG(4658):  d0  000000a043208000  d1  0000000043208000
09-29 13:58:00.540: INFO/DEBUG(4658):  d2  0000000000000000  d3  3ff0000000000000
09-29 13:58:00.540: INFO/DEBUG(4658):  d4  0000000000000000  d5  4082780000000000
09-29 13:58:00.540: INFO/DEBUG(4658):  d6  c413c000c30c0000  d7  0000000000000000
09-29 13:58:00.540: INFO/DEBUG(4658):  d8  0000000043fa8000  d9  3f80000000000000
09-29 13:58:00.540: INFO/DEBUG(4658):  d10 4004cccd430e0000  d11 0000000040951f28
09-29 13:58:00.540: INFO/DEBUG(4658):  d12 00000000bfd55580  d13 0000000000000000
09-29 13:58:00.540: INFO/DEBUG(4658):  d14 0000000000000000  d15 0000000000000000
09-29 13:58:00.540: INFO/DEBUG(4658):  scr 8000001b
09-29 13:58:00.640: INFO/DEBUG(4658):          #00  pc 00015c1c  /system/lib/libc.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #01  pc 00013efe  /system/lib/libc.so (dlfree)
09-29 13:58:00.640: INFO/DEBUG(4658):          #02  pc 0001445c  /system/lib/libc.so (free)
09-29 13:58:00.640: INFO/DEBUG(4658):          #03  pc 0002239e  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #04  pc 0000483c  /system/lib/libsqlite.so (sqlite3_free)
09-29 13:58:00.640: INFO/DEBUG(4658):          #05  pc 00005b28  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #06  pc 00005b60  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #07  pc 00005d20  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #08  pc 00005e76  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #09  pc 0000a7c2  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #10  pc 0000a7e0  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #11  pc 0001cd96  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #12  pc 0001d8fa  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #13  pc 0001da3c  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #14  pc 0001e31c  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658):          #15  pc 0003b68e  /system/lib/libsqlite.so
09-29 13:58:00.640: INFO/DEBUG(4658): libc base address: afdfd000
09-29 13:58:00.640: INFO/DEBUG(4658): code around pc:
09-29 13:58:00.640: INFO/DEBUG(4658): afe12bfc 4623b15c 2c006824 e026d1fb b12368db
09-29 13:58:00.640: INFO/DEBUG(4658): afe12c0c 21014a17 6011447a 48124798 24002527
09-29 13:58:00.640: INFO/DEBUG(4658): afe12c1c f7f57005 2106eb8a ec18f7f6 460aa901
09-29 13:58:00.640: INFO/DEBUG(4658): afe12c2c f04f2006 94015380 94029303 efe2f7f5
09-29 13:58:00.640: INFO/DEBUG(4658): afe12c3c 4622a905 f7f52002 f7f5efec 2106eb76
09-29 13:58:00.640: INFO/DEBUG(4658): code around lr:
09-29 13:58:00.640: INFO/DEBUG(4658): afe1648c 41f0e92d 46804c0c 447c2600 68a56824
09-29 13:58:00.640: INFO/DEBUG(4658): afe1649c e0076867 300cf9b5 dd022b00 47c04628
09-29 13:58:00.640: INFO/DEBUG(4658): afe164ac 35544306 37fff117 6824d5f4 d1ee2c00
09-29 13:58:00.640: INFO/DEBUG(4658): afe164bc e8bd4630 bf0081f0 0002802e 41f0e92d
09-29 13:58:00.640: INFO/DEBUG(4658): afe164cc fb01b086 9004f602 461f4815 4615460c
09-29 13:58:00.640: INFO/DEBUG(4658): stack:
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ea8  00af9de0
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42eac  008aa8f8
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42eb0  00000000
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42eb4  00000007
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42eb8  afe3e700
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ebc  afe3e690
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ec0  00000000
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ec4  afe164ad  /system/lib/libc.so
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ec8  00000000
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ecc  bed42efc
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ed0  00000028
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ed4  00000005
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ed8  00000002
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42edc  afe15619  /system/lib/libc.so
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ee0  df002777
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ee4  e3a070ad
09-29 13:58:00.640: INFO/DEBUG(4658): #00 bed42ee8  00000002
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42eec  00000001
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ef0  00afe158
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ef4  00afe5cc
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42ef8  00afe150
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42efc  fffffbdf
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f00  00000002
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f04  afe434a0
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f08  00000888
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f0c  afe10f03  /system/lib/libc.so
09-29 13:58:00.640: INFO/DEBUG(4658): #01 bed42f10  00afe158
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f14  00afe5cc
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f18  00000002
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f1c  005e6c90
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f20  00000002
09-29 13:58:00.640: INFO/DEBUG(4658):     bed42f24  afe1145f  /system/lib/libc.so
09-29 13:58:04.160: INFO/DEBUG(4658): debuggerd committing suicide to free the zombie!
09-29 13:58:04.170: INFO/BootReceiver(148): Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
09-29 13:58:04.180: INFO/DEBUG(25207): debuggerd: Jul  8 2011 03:35:12

EDIT:
Add another log.
10-04 10:21:31.210: INFO/DEBUG(2375): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-04 10:21:31.210: INFO/DEBUG(2375): Build fingerprint: 'asus/TW_epad/TF101:3.2.1/HTK75/TW_epad-8.6.5.13-20110925:user/release-keys'
10-04 10:21:31.210: INFO/DEBUG(2375): pid: 4044, tid: 4045  >>> com.aaa.bbb <<<
10-04 10:21:31.210: INFO/DEBUG(2375): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
10-04 10:21:31.210: INFO/DEBUG(2375):  r0 deadbaad  r1 00000001  r2 a0000000  r3 00000000
10-04 10:21:31.210: INFO/DEBUG(2375):  r4 00000000  r5 00000027  r6 002f3540  r7 0000b000
10-04 10:21:31.210: INFO/DEBUG(2375):  r8 100ffad0  r9 4002bfa0  10 4002bf8c  fp fffffe90
10-04 10:21:31.210: INFO/DEBUG(2375):  ip ffffffff  sp 100ffa78  lr aff194ad  pc aff15c1c  cpsr 60000030
10-04 10:21:31.210: INFO/DEBUG(2375):  d0  42c8000042a982a6  d1  0000005f01997918
10-04 10:21:31.210: INFO/DEBUG(2375):  d2  4e19740842be9580  d3  42c8000000670ff0
10-04 10:21:31.210: INFO/DEBUG(2375):  d4  000001fd006235c8  d5  3fe999999999999a
10-04 10:21:31.210: INFO/DEBUG(2375):  d6  01e31fe000000000  d7  000000544f1ff34d
10-04 10:21:31.210: INFO/DEBUG(2375):  d8  0000000000000000  d9  0000000000000000
10-04 10:21:31.210: INFO/DEBUG(2375):  d10 0000000000000000  d11 0000000000000000
10-04 10:21:31.210: INFO/DEBUG(2375):  d12 0000000000000000  d13 0000000000000000
10-04 10:21:31.210: INFO/DEBUG(2375):  d14 0000000000000000  d15 0000000000000000
10-04 10:21:31.210: INFO/DEBUG(2375):  scr 80000012
10-04 10:21:31.330: INFO/DEBUG(2375):          #00  pc 00015c1c  /system/lib/libc.so
10-04 10:21:31.330: INFO/DEBUG(2375):          #01  pc 00013efe  /system/lib/libc.so (dlfree)
10-04 10:21:31.330: INFO/DEBUG(2375):          #02  pc 0001445c  /system/lib/libc.so (free)
10-04 10:21:31.330: INFO/DEBUG(2375):          #03  pc 000009bc  /system/lib/libstdc++.so (_ZdaPvRKSt9nothrow_t)
10-04 10:21:31.330: INFO/DEBUG(2375):          #04  pc 0005cccc  /system/lib/libandroid_runtime.so
10-04 10:21:31.330: INFO/DEBUG(2375): libc base address: aff00000
10-04 10:21:31.330: INFO/DEBUG(2375): code around pc:
10-04 10:21:31.330: INFO/DEBUG(2375): aff15bfc 4623b15c 2c006824 e026d1fb b12368db
10-04 10:21:31.330: INFO/DEBUG(2375): aff15c0c 21014a17 6011447a 48124798 24002527
10-04 10:21:31.330: INFO/DEBUG(2375): aff15c1c f7f57005 2106eb8a ec18f7f6 460aa901
10-04 10:21:31.330: INFO/DEBUG(2375): aff15c2c f04f2006 94015380 94029303 efe2f7f5
10-04 10:21:31.330: INFO/DEBUG(2375): aff15c3c 4622a905 f7f52002 f7f5efec 2106eb76
10-04 10:21:31.330: INFO/DEBUG(2375): code around lr:
10-04 10:21:31.330: INFO/DEBUG(2375): aff1948c 41f0e92d 46804c0c 447c2600 68a56824
10-04 10:21:31.330: INFO/DEBUG(2375): aff1949c e0076867 300cf9b5 dd022b00 47c04628
10-04 10:21:31.330: INFO/DEBUG(2375): aff194ac 35544306 37fff117 6824d5f4 d1ee2c00
10-04 10:21:31.330: INFO/DEBUG(2375): aff194bc e8bd4630 bf0081f0 0002802e 41f0e92d
10-04 10:21:31.330: INFO/DEBUG(2375): aff194cc fb01b086 9004f602 461f4815 4615460c
10-04 10:21:31.330: INFO/DEBUG(2375): stack:
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa38  0023aa60
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa3c  0000b000
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa40  100ffad0
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa44  4002bf80
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa48  aff41700
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa4c  aff41690
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa50  00000000
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa54  aff194ad  /system/lib/libc.so
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa58  00000000
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa5c  100ffa8c
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa60  002f3540
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa64  0000b000
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa68  100ffad0
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa6c  aff18619  /system/lib/libc.so
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa70  df002777
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa74  e3a070ad
10-04 10:21:31.330: INFO/DEBUG(2375): #00 100ffa78  8bfffbfc
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa7c  00000001
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa80  002f3578
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa84  00000000
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa88  002f3578
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa8c  fffffbdf
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa90  100ffad0
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa94  00000006
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa98  00000080
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffa9c  aff13f03  /system/lib/libc.so
10-04 10:21:31.330: INFO/DEBUG(2375): #01 100ffaa0  002f3578
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffaa4  00000000
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffaa8  100ffb78
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffaac  4002bfa8
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffab0  100ffad0
10-04 10:21:31.330: INFO/DEBUG(2375):     100ffab4  aff1445f  /system/lib/libc.so
10-04 10:21:34.920: INFO/BootReceiver(140): Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)
10-04 10:21:34.930: INFO/DEBUG(2375): debuggerd committing suicide to free the zombie!

A: The system is crashing trying to dereference the address 'deadbaad'.  That looks like a debugging hint (someone is initializing a pointer to deadbaad to make crashes a bit easier to identify).
Looks like you're not the first to hit this: http://groups.google.com/group/android-ndk/browse_thread/thread/8d083a0ccebe0faa
Looks like 'deadbaad' means the Dalvik heap got corrupted.  So some JNI code or C library is messing with the heap.  Do you have any Native code in your app?  Blame it.
Update #1
No native code to blame....
Are there any interesting log lines before the crash happens?  From looking at the android source the 0xdeadbaad crash is used to implement 'abort()'.  And both backtraces are in the C 'free' routine (some simple sanity checks on the memory range are done there).  Note 'free' is just detecting the memory corruption and isn't likely the source of the corruption.
Does your app do a lot of native memory allocations indirectly?  E.g., through OpenGL textures or loading of audio?  Are you doing any SQL directly?
Can you add some details to the question about what's going on in your app when this happens?  (How long is the app running?  Anything happening on the UI or the network? etc)


text:
Q: Double cannot be dereferenced...? import java.awt.Rectangle;
import java.util.Comparator;
public class RectangleComparator implements Comparator
{
      public int compare(Object object1, Object object2)
      {
        Rectangle rec1 = (Rectangle) object1;
        Rectangle rec2 = (Rectangle) object2;

        return rec1.getWidth().compareTo(rec2.getWidth());
    }
}

For some reason, I'm getting the error double cannot be dereferenced. Can anyone help me figure out why?

A: To compare two double primitives:
Java old school:
return new Double(rec1.getWidth()).compareTo(new Double(rec2.getWidth());

Java 1.4 onwards:
return Double.compare(rec1.getWidth(), rec2.getWidth());

A: rocketboy is correct with regard to why this is happening.
Consider using the Double wrapper class like this
new Double(rec1.getWidth()).compareTo(rec2.getWidth());

Only the first value need to be converted to a wrapper Double, the second one will be auto boxed.

A: I think your Rectangle.getWidth() returns a double. It is not a wrapper Object like Double, so the dot operator cannot be used.
Had it been:
Double getWidth() instead of double getWidth()
then rec1.getWidth().compareTo(rec2.getWidth()); would have been valid.
How to compare doubles in Java?


text:
Q: How to change the position of save and cancel buttons (for example, when you download a file from web)? This question is the same as Move GNOME file dialog buttons. However,the answer given there didn't work for me. The answer was
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/DialogsUseHeader':<0>}"

Typing the above, gave me the following error.
GLib-GIO-Message: 11:59:17.132: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.

Kindly, help me in solving this. I have also tried issuing the above command in sudo mode but without success.


text:
Q: Corona SDK - Tap and Touch Event on a single object, object rotation I'm trying to do an application that simulates the planets rotation around the sun.
I want that when the application starts, the planets are stopped. When I press the sun the first time the planets starts to rotate and when I press the second time, the planets stops.
I also want that if I do an up swipe, the planets begins to rotate faster and when I do a down swipe, the planets slows down.
Here's what i've done:
-- Sun
local sun = display.newImage ( "Sole.png")
sun.x = display.contentCenterX
sun.y = display.contentCenterY

-- First Planet
local group1 = display.newGroup()
p1 = display.newImage("P1(2).png")
group1:insert(p1)
group1.x = sole.x
group1.y = sole.y
p1.x = 270
p1.y = 0

-- Second Planet

local group2 = display.newGroup()
p2 = display.newImage("P2.png")
group2:insert(p2)
group2.x = sole.x
group2.y = sole.y
p2.x = -270
p2.y = 0

local function increaseSpeed(event)

   group1.rotation = group1.rotation + 1
   group2.rotation = group2.rotation + 1

end

local function decreaseSpeed(event)

   group1.rotation = group1.rotation - 1
   group2.rotation = group2.rotation - 1

end

-- * State 1: The planets begins to rotate

function state1( event )
   print("state1")
   sun.enterFrame = increaseSpeed
   Runtime:addEventListener("enterFrame", sun)
   sun:removeEventListener( "tap", state1 )
   timer.performWithDelay( 1, addListener2 )
   sun:addEventListener( "touch", swipe)
   return true
end

-- * State 2: The planets stops

function state2( event )
   print("state2")
   sole:removeEventListener( "touch", swipe)
   Runtime:addEventListener("enterFrame")
   sun:removeEventListener( "tap", state2 )
   timer.performWithDelay( 1, addListener1 )
   return true
end

function addListener2()
   sun:addEventListener( "tap", state2 )
end

function addListener1()
   sun:addEventListener( "tap", state1)
end

-- Swipe function

local beginX
local beginY
local endX
local endY

local xDistance
local yDistance

function checkSwipeDirection()

    xDistance =  math.abs(endX - beginX)
    yDistance =  math.abs(endY - beginY)

    if xDistance > yDistance then
            if beginX > endX then
                    print("swipe left")
            else
                    print("swipe right")
            end
    else
            if beginY > endY then
                    print("swipe up")
                    timer.performWithDelay(10, increaseSpeed ,0)
            else
                    print("swipe down")
                    timer.performWithDelay(10, decreaseSpeed ,0)
            end
    end

end

function swipe(event)
   if event.phase == "began" then
            beginX = event.x
            beginY = event.y
   end

   if event.phase == "ended"  then
            endX = event.x
            endY = event.y
            checkSwipeDirection();
   end

   return true
end

My problem is that if I am in the state1, I do the swipe up and the I press the sun, I am in the state2 but the planets continues to rotate even if I removed the Event Runtime, enterFrame.
Can somebody help me ?
Thanks :)

A: I can see in state2 that you wrote :
Runtime:addEventListener("enterFrame")

You should write :
Runtime:removeEventListener("enterFrame", sun)


text:
Q: JPA: Join across two persistence units I have two different persistence units in my application. I'm using JPA 2.0 with Hibernate as my entity provider. In one of my database schemas, I have a table which contains a column which has a foreign key relationship to a table in the other schema. These tables are mapped as separate entities in my code with no relationship. Is it possible to construct a named query to join across these two schemas?

A: No, it's not possible. You have a few options, not all of them will be useful for your case:

*

*You can do the join yourself in code - it might seem ugly & dirty, but this is the way to go if you don't want to mix two domains and it's very doable if the datasets are small.

*You can move the entitiy from one PU (or schema) to the other

*If the DB supports views, you could create a view of the table from the other schema.

*You could map the same data table twice (once per each PU) -  This might give you a headache with caching.

As a rule of thumb, if you have a FK between schemas, you have a problem with how the domain was divided, as the boundaries are not exaclty right.


text:
Q: Sudo environment variable I want to create an environment variable and set it in sudo, I mean, I want it to be in sudo printenv but I just can put it in printenv.
I am making a program and I need to run the program with sudo and inside I use getenv(), but running the program with sudo it does not work properly.
Does anyone know how to help me?

A: You can set it right before executing the command. For example:
sudo A=B printenv


text:
Q: Nokogiri and random div name Using Nokogiri and Ruby.
I have a page to parse with div id's like:
div id="some-list-number^875"
Numbers after ...-number^ changes  random, and i just can't do
doc.css('#wikid-list-genres^875').each do |n|
       puts n.text.to_s
end

But the base structure is always the same -number^..some digits...
So i need some kind of wildmask for those digits.
How can I deal with that using ruby and Nokogiri?
Thanks!

A: You can use ^= to match the beginning of an attribute, e.g. div[id^=wikid-list-genres]. (Source: W3C)
However, I noticed that your id attribute has a ^ character in it, which is not allowed in ids, so "wikid-list-genres^875" is not a valid id and will likely cause you problems down the road. (Source: SO) May I suggest changing it to "wikid-list-genres-875" or "wikid-list-genres_875"?


text:
Q: Как дождаться выполнения функции Иммеется такой код:
struct ContentView: View {
    @EnvironmentObject var appState: AppState
    var body: some View {
        Button(action: {
            var s = RunQuery() //В функции RunQuery() выполняется запрос, после его выполнения запускается
                               //функция Singleton.setParam(value: "test", key: "keyWord")
            if(Singleton.getParam(key: "keyWord")) {
                print("Yes")
            } else {
                print("No")
            }
        })
    }
}

Проблема в том, что когда в первый раз нажимаю на кнопку в функции не успевает выполниться запрос и записаться значение и поэтому выводится No. При повторном нажатии выводится Yes, так как значение уже записано с того раза. Как правильно сделать, что бы сперва отобразился Yes

A: Могу предложить использование колбеков, и вы сможете подцепиться к выполнению метода напрямую. Вот например:
func getBoolValue(number : Int, completion: (Bool)->()) {
    if number > 5 {
        completion(true)
    } else {
        completion(false)
    }
}

getBoolValue(number: 2) { (result) -> () in
    // do stuff with the result
    print(result)
}

вы же будете возвращать тип который вам нужен. Вот есть примеры как с этим можно работать. Если же речь идет о запросах, то стоит посмотреть в стороне асинхронности, чтобы не блокировать UI в ожиданиях.


text:
Q: Performance in an SSIS package with multiple Conditional Split Components I am using conditional splits to validate data and send bad data down an alternate path in my package.  My conditional split code is similar to this:
(Gender != "M" ||Gender != "F" ||Gender != "U") == FALSE
(Gender == "M" ||Gender == "F" ||Gender == "U") == TRUE
If the value is true I pass control to another conditional split or if false I will redirect that row to an error table.
I am using 25 conditional splits in a single package and I want to know if this is a good thing to do from a performance perspective.  How is the performance of using conditional splits as opposed to using another method to validate data?
I have added another scenario but its not working in conditional split. Please find the below information
I have allowed date values only this format and this period '01/01/1753' to '12/31/9000'
My Conditions
(Dob Varchar(10))
SUBSTRING(Dob,1,2) <= "12" && SUBSTRING(Dob,4,2) <= "31" && (SUBSTRING(Dob,7,4) >= "1753" || SUBSTRING(Dob,7,4) <= "9000") ==  TRUE
SUBSTRING(Dob,1,2) > "12" || SUBSTRING(Dob,4,2) > "31" || SUBSTRING(Dob,7,4) < "1753" || SUBSTRING(Dob,7,4) > "9000" ==  FALSE
My Input - 12/32/1990, 13/15/2000, 12/31/2010,01/01/1753,12/31/9000,12/31/9001,01/01/9001
Expected Output - 12/31/2010,01/01/1753,12/31/9000
But all the records considered as false in my conditions.
Kindly give the solution for this scenario.

A: The best way to determine this is to create the same package twice, once where you validate this way, and then once where you validate in another way.  You can use BIDS with BIDS Helper to run each of the packages by right clicking on the package and choosing Execute and Visualize Performance from the context menu.  Once you have done this, post the results as an answer so that others can benefit from your work!

A: As William Todd Salzman has indicated, testing is the only way you will determine what is the optimal setup for your package. Generally speaking however, as counter-intuitive as it may seem, the less you do in a particular component, the faster SSIS can make it. The reason for this is the way the SSIS engine can determine parallelism - if it can determine column B is not manipulated in Derived column 1, then it can safely start making changes to that value in Derived Column 2.

*

*Can different combinations of components affect Dataflow performance?

*Increasing Throughput of Pipelines by Splitting Synchronous Transformations into Multiple Tasks
Given your scenario, I would look to create multiple Derived Column Transformations that define your various boolean checks. For example, I'd create one field that indicates whether we have a valid gender like this.
Add a Derived Column Transformation named DFT IsGenderValid and I'd configure it thus

*

*IsGenderValid

*"add as new column"

*Gender != "M" || Gender != "F" || Gender != "U"

*DT_BOOL

I would then have a Conditional Split transformation operating on boolean value if for no other reason than I have one place to test, correct and maintain logic.
Repeat this pattern for as many validations as your business logic requires.


text:
Q: Creating an Alexa conversational skill using AWS I am trying to develop an Alexa skill that works as an everyday conversation.
For e.g -
Me - Alexa, what time is it?
Alexa - It's 9.00 pm
Me - Can I reach airport by 10 p.m ?
Alexa - Yes if you take route XYZ
..
and so on
Essentially, instead of
this, I need the skill to function as this
Is there any extra piece of code that I need to build to keep the session alive?
Note - I am using AWS lambda function with Python backend to develop this skill.

A: If you want to continue the session, use ask responses instead of tell responses. A tell response will cause the skill to stop listening to the user.
You'll have to keep a few variables in state to persist data between intents, but besides that, you can treat each of those intents the same as your first.
Best of luck!


text:
Q: Google Chrome - Auto log-off from sites I use Google Crome, everytime I close the browser or Shutdown my system and open the browser again, I am automatically logged off from all my accounts - GMail, Facebook, Yahoo but not from the Stack Exchange Websites. I want Google Crome to not log me out of any of the websites at all. How can I make that possible?

A: Go to
Settings -> Under the hood -> Select Allow local data to be set in cookies
Uncheck the 2 checkboxes below this setting
allow Javascript (from same page)
Basically, use these settings :
Also, when logging into sites, make sure you select the remember me option

A: Use Lastpass for password management. When you save new password, check Auto Login option.


text:
Q: typescript google maps errors I am learning typescript with an Udemy course, . I did an exercise where google maps was used.
Then, as I use nvm I updated the node version to 16. As I updated node, I executed the commands to install typescript to the newer version
$ npm install -g typescript ts-node
$ npm install -g @types/node @types/google.maps

I started a new exercise where I have to write only a console log
index.ts
console.log('Hi there')

then I should compile the file
$ ts index.ts

The index.js gets generated but also I get a tone of errors
...
../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:51:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'path' must be of type '(LatLngLiteral | LatLng)[] | MVCArray<any>', but here has type 'LatLng[] | MVCArray<LatLng> | LatLngLiteral[]'.

51         path?: MVCArray<LatLng> | LatLng[] | LatLngLiteral[];
           ~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5066:5
    5066     path?: google.maps.MVCArray<any>|null|
             ~~~~
    'path' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:75:11 - error TS2300: Duplicate identifier 'Polygon'.

75     class Polygon extends MVCObject {
             ~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:4804:9
    4804   class Polygon extends google.maps.MVCObject {
                 ~~~~~~~
    'Polygon' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:145:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'paths' must be of type 'any[] | MVCArray<any>', but here has type 'LatLng[] | MVCArray<LatLng> | LatLngLiteral[] | MVCArray<MVCArray<LatLng>> | LatLng[][] | LatLngLiteral[][]'.

145         paths?:
            ~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:4932:5
    4932     paths?: google.maps.MVCArray<any>|null|any[];
             ~~~~~
    'paths' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:194:11 - error TS2300: Duplicate identifier 'Rectangle'.

194     class Rectangle extends MVCObject {
              ~~~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5122:9
    5122   class Rectangle extends google.maps.MVCObject {
                 ~~~~~~~~~
    'Rectangle' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:226:11 - error TS2300: Duplicate identifier 'Circle'.

226     class Circle extends MVCObject {
              ~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:74:9
    74   class Circle extends google.maps.MVCObject {
               ~~~~~~
    'Circle' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:322:9 - error TS2300: Duplicate identifier 'CENTER'.

322         CENTER = 0,
            ~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5883:5
    5883     CENTER = 0.0,
             ~~~~~~
    'CENTER' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:324:9 - error TS2300: Duplicate identifier 'INSIDE'.

324         INSIDE = 1,
            ~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5887:5
    5887     INSIDE = 1.0,
             ~~~~~~
    'INSIDE' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:326:9 - error TS2300: Duplicate identifier 'OUTSIDE'.

326         OUTSIDE = 2,
            ~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5891:5
    5891     OUTSIDE = 2.0,
             ~~~~~~~
    'OUTSIDE' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:1:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: StreetViewService, OK, UNKNOWN_ERROR, ZERO_RESULTS, BEST, NEAREST, DEFAULT, OUTDOOR

1 declare namespace google.maps {
  ~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:20:1
    20 declare namespace google.maps {
       ~~~~~~~
    Conflicts are in this file.

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:25:9 - error TS2687: All declarations of 'location' must have identical modifiers.

25         location: LatLng | LatLngLiteral;
           ~~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:32:9 - error TS2687: All declarations of 'pano' must have identical modifiers.

32         pano: string;
           ~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:38:9 - error TS2687: All declarations of 'pano' must have identical modifiers.

38         pano?: string;
           ~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:57:9 - error TS2687: All declarations of 'tiles' must have identical modifiers.

57         tiles?: StreetViewTileData;
           ~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:61:9 - error TS2687: All declarations of 'description' must have identical modifiers.

61         description?: string;
           ~~~~~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:62:9 - error TS2687: All declarations of 'heading' must have identical modifiers.

62         heading?: number;
           ~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view-service.d.ts:63:9 - error TS2687: All declarations of 'pano' must have identical modifiers.

63         pano?: string;
           ~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:2:11 - error TS2300: Duplicate identifier 'StreetViewPanorama'.

2     class StreetViewPanorama extends MVCObject {
            ~~~~~~~~~~~~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5452:9
    5452   class StreetViewPanorama extends google.maps.MVCObject {
                 ~~~~~~~~~~~~~~~~~~
    'StreetViewPanorama' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:69:9 - error TS2687: All declarations of 'centerHeading' must have identical modifiers.

69         centerHeading?: number;
           ~~~~~~~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:70:9 - error TS2687: All declarations of 'tileSize' must have identical modifiers.

70         tileSize?: Size;
           ~~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:71:9 - error TS2687: All declarations of 'worldSize' must have identical modifiers.

71         worldSize?: Size;
           ~~~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:75:9 - error TS2687: All declarations of 'heading' must have identical modifiers.

75         heading?: number;
           ~~~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:76:9 - error TS2687: All declarations of 'pitch' must have identical modifiers.

76         pitch?: number;
           ~~~~~

../../../../../../node_modules/@types/googlemaps/reference/street-view.d.ts:79:11 - error TS2300: Duplicate identifier 'StreetViewCoverageLayer'.

79     class StreetViewCoverageLayer extends MVCObject {
             ~~~~~~~~~~~~~~~~~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:5347:9
    5347   class StreetViewCoverageLayer extends google.maps.MVCObject {
                 ~~~~~~~~~~~~~~~~~~~~~~~
    'StreetViewCoverageLayer' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/visualization.d.ts:2:11 - error TS2300: Duplicate identifier 'HeatmapLayer'.

2     class HeatmapLayer extends MVCObject {
            ~~~~~~~~~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:8717:9
    8717   class HeatmapLayer extends google.maps.MVCObject {
                 ~~~~~~~~~~~~
    'HeatmapLayer' was also declared here.

../../../../../../node_modules/@types/googlemaps/reference/visualization.d.ts:12:9 - error TS2687: All declarations of 'data' must have identical modifiers.

12         data: MVCArray<LatLng | WeightedLocation> | Array<LatLng | WeightedLocation>;
           ~~~~

../../../../../../node_modules/@types/googlemaps/reference/visualization.d.ts:12:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'data' must be of type 'MVCArray<any> | (LatLng | WeightedLocation)[]', but here has type '(LatLng | WeightedLocation)[] | MVCArray<LatLng | WeightedLocation>'.

12         data: MVCArray<LatLng | WeightedLocation> | Array<LatLng | WeightedLocation>;
           ~~~~

  ../../../../../../node_modules/@types/google.maps/index.d.ts:8752:5
    8752     data?: google.maps.MVCArray<any>|null|
             ~~~~
    'data' was also declared here.

Found 240 errors.

I have been trying to fix this uninstalling typescript and installing again, but I couldn't.
Also I am not sure why I am getting google maps errors since google maps is not used in the file I am compiling

A: @types/google.maps is conflicting with deprecated package @types/googlemaps
Try
npm uninstall @types/googlemaps


text:
Q: Tensorflow Implementation of image gradients Issue
I am trying to implement image gradients from scratch. I understand that there are multiple ways to do it (including Sobel and other filters). My question is regarding the Tensorflow implementation of image gradient.
TF implements image gradients by this method as shown here. So according to the TF documentation, for a dummy input,
  [[ 0.  1.  2.  3.  4.]
  [ 5.  6.  7.  8.  9.]
  [10. 11. 12. 13. 14.]
  [15. 16. 17. 18. 19.]
  [20. 21. 22. 23. 24.]

dy and dx are respectively,
dy = [[5. 5. 5. 5. 5.]
  [5. 5. 5. 5. 5.]
  [5. 5. 5. 5. 5.]
  [5. 5. 5. 5. 5.]
  [0. 0. 0. 0. 0.]]

dx = [[1. 1. 1. 1. 0.]
  [1. 1. 1. 1. 0.]
  [1. 1. 1. 1. 0.]
  [1. 1. 1. 1. 0.]
  [1. 1. 1. 1. 0.]],

But when using Sobel filter (as shown here) my outputs are,
dx = [[[[-8., -8., -8.],
          [-8., -8., -8.],
          [-8., -8., -8.]]]]

dy = [[[[-40., -40., -40.],
          [-40., -40., -40.],
          [-40., -40., -40.]]]]

While I understand both are accepted ways of calculating the gradient, my question is,

*

*Why aren't the results from these two methods equal?

*Is there are way to convert the results of one method into the other?

A:
Why aren't the results from these two methods equal?

Because they do different things. Tensorflow's image_gradients function computes the finite difference approximation to the derivatives, which is equivalent to convolving with the two kernels:
 |  1 -1 |                     |  1 |
                               | -1 |

The Sobel filter convolves with these two kernels:
|  1  0 -1 |                |  1  2  1 |
|  2  0 -2 | / 8            |  0  0  0 | / 8
|  1  0 -1 |                | -1 -2 -1 |

These are two different ways to estimate the gradient.
Note that some implementations use a different normalization. The result for Sobel in the OP is exactly 8 times as large as the expected value of the derivatives, so it is not normalizing the kernels at all. It is missing the /8 needed to get the right magnitude.

Is there are way to convert the results of one method into the other?

Yes, I guess you could figure out how to do this, but why would you want to? It is much easier to directly compute the desired output from the input image.


text:
Q: How to convert Date/time from the character string How to convert Date/time from the character string
  ,CONVERT(VARCHAR(10), RegistrationCreatedDate, 10) AS 'Date Submitted'
    ,CONVERT(VARCHAR(10), StatusUpdatedDate, 10) AS 'Current Status Date'
    ,CONVERT(VARCHAR(10), CONVERT(DATETIME, CONVERT(DATETIMEOFFSET, [AcceptedDate])), 10) AS 'Date Accepted'
    , PaymentAuthID
    , PaymentAmount
FROM (
    SELECT R.RegistrationGUID
        ,CAST(RR.ShortResponseValue AS VARCHAR(MAX)) AS ResponseValue
        ,RR.QuestionShortCode
        ,R.ApplicationGUID
        ,R.RegistrationUpdatedDate
        ,XRSH.StatusUpdatedDate
        ,OD.ResponseValue AS PaymentAuthID
        ,CD.ResponseValue AS PaymentAmount
        ,APS.STATUSNAME
        ,O.OrderGUID
        ,[RegistrationCreatedDate]

I have an error on this line:
,CONVERT(VARCHAR(10), CONVERT(DATETIME, CONVERT(DATETIMEOFFSET, [AcceptedDate])), 10) AS 'Date Accepted'
The error is:

Conversion failed when converting date and/or time from character string.

A: Try it like this:
SELECT CONVERT(VARCHAR(10), CONVERT(DATETIME, CONVERT(DATETIMEOFFSET, [NameColumn])), 10) AS 'Date Accepted'
FROM [NameTable]


text:
Q: BrokenPipeError: [Errno 32] Broken pipe on Windows and CUDA 10 I am able to run my program on system with CUDA 9.2, Quadro M5000 (5), and python 3.7.0 (anaconda) while the same program giving me an error on another system with the CUDA 10.0, GeForce GTX 1080 Ti (6), and python 3.7.1
here is the error
 ForkingPickler(file, protocol).dump(obj)

 BrokenPipeError: [Errno 32] Broken pipe

the whole code wrap in a function named train_valid_model() and just add the main guard in the script:
def train_valid_model():
# complete code here

 if __name__=='__main__':
     train_valid_model()

It only works when num_workers=0 and if I set it to 1 or 2 I will get this error. Any idea why I am getting this error while the program is same just the CUDA version and python version are different?


text:
Q: $f(x) = (\cos x - \sin x) (17 \cos x -7 \sin x) $ $f(x) = (\cos x - \sin x) (17 \cos x -7 \sin x)$
Determine the greatest and least values of $\frac{39}{f(x)+14}$ and state a value of x at which greatest values occurs.
Do I just use a graphing calculator for this? Is there a way I could do this without a graphing calculator?

A: you can do this without calculus. here is a way.  i will use $t$ for $x.$ we have
$$\begin{align}y &=  14 + (\cos t - \sin t)(17 \cos t - 7 \sin t) \\&= 14 + 17 \cos^2 t-24 \sin t \cos t+7 \sin ^2 t\\
&=14 + \frac{17}{2}(1 + \cos 2t)-12 \sin 2t+\frac 72(1-\cos 2t)\\
&=26+5\cos 2t-12\sin 2t\\
&=26 + 13\cos(2t+\phi), \text{ where} \cos \phi = \frac 5{13}, \sin \phi = \frac{12}{13} \end{align}$$  so the maximum value of $y$  is $39$ and minimum value of $y$ is $13.$
therefore  $$1 \le \frac {39}{ 14 + (\cos t - \sin t)(17 \cos t - 7 \sin t)} \le 3.$$

A: HINT:
$$f(x)=17\cos^2x+7\sin^2x-24\sin x\cos x=\dfrac{17(1+\cos2x)+7(1-\cos2x)-24\sin2x}2$$
$$=12+5\cos2x-12\sin2x=12+\sqrt{12^2+5^2}\cos\left(2x+\arctan\dfrac{12}5\right)$$
Now for real $x,-1\le\cos\left(2x+\arctan\dfrac{12}5\right)\le1$

A: $$f(x) = (\cos x - \sin x) (17 \cos x -7 \sin x)\\=17c^2-24sc+7s^2=7+5(1+c_2)-12s_2=12+5c_2-12s_2$$
And as we know $|as+bc|\le\sqrt{a^2+b^2}$, so:
$$-1=12-13\le f(x)\le 12+13=25$$

*$s:=\sin,c:=\cos,s_n=s(nx)$


text:
Q: AWS S3 authentification from windows I am using Pentaho (8.1) from windows environment (remote desktop).
To Upload files to S3 I am using config & credential files.
When I use default file location in %USERPROFILE%.aws\config and %USERPROFILE%.aws\credentials it works fine.
I don't want every user to manually handle credentials file, so I would like to use same location for all users.
I have set environment variables:
AWS_SHARED_CREDENTIALS_FILE D:\data.aws\credentials
AWS_CONFIG_FILE D:\data.aws\config
But looks like it doesn't pick up this location correctly.
I am sure that files in %USERPROFILE% are actually used. I have also done full restart after changing variables, but it doesn't help.
Is there something I am missing from configuration?

A: If you are willing to set environment variables, then you can simply put the credentials in environment variables for each user:

*

*AWS_ACCESS_KEY_ID

*AWS_SECRET_ACCESS_KEY


text:
Q: Port unavailable in Kubernetes pod I have a three node Kubernetes cluster and a deployment with 5 replicas. Each pod of the deployment exposes port :3401 and :4000 (one for debugging, and one for the application). I have two services (one for each port the pods expose). I have an ingress controller, and a single ingress for the application that is exposed by the application service.
Three of my pods are able to start while the other two log the following error:
 main: error: server error: listen tcp :3401: bind: address already in use

Is it possible to have more pods than nodes listening on a single port using Kubernetes? If so, where would I go about debugging this issue?

A: I had the following lines in my pod spec for the deployment:
 hostNetwork: true

Must have copied and pasted it from somewhere without thinking. :(


text:
Q: Code generation tool for object wrapping Imagine you have to wrap an instance of a java.sql.ResultSet. You can't extend it because you don't know what is the concrete class implementing ResultSet being actually instantiated. You can just aggregate the instance, implement ResultSet and override all the methods.
Now imagine you want to change the behavior of just one method. All the other overridden methods are just a long boilerplate like this:
public void foo() {
    wrapped.foo();
}

Do you know any automatic code-generation tool that can perform this job for me (either standalone or included into common IDEs)?

A: In Eclipse, create a class with the ResultSet as a member, put the cursor on this member and then choose the menu "Source > Generate delegate Methods".

Check the methods you want to generate delegates for and it's done.

A: Any decent IDE should be able to do that. E.g. in InteilliJ Idea: Code -> Generate -> Delegate Methods
This option becomes available if the class has a member field with a type that the class implements/extends.


text:
Q: Extra padding on PreferenceScreen I'm having some problems with my preferenceactivity. The code show the screen perfect on preview, but when I test on emulator Its show a extra padding on SwitchPreference, and the switch doesn't work.
Besides that, when testing on pre-lollipop emulator, theres no margin at all.
My code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <SwitchPreference
        android:title="Tema"
        android:key="night_mode"
        android:summary="Ativar tema escuro"/>
    <CheckBoxPreference
        android:title="App Update"
        android:defaultValue="true"
        android:summary="This option if selected will allow the application to check for latest versions."
        android:key="app_update"/>

    <Preference
        android:title="Clean cache"
        android:summary="Resetar preferencias do app"
        android:key="clean_cache"/>
   <PreferenceScreen
       android:title="Sobre">
       <intent android:targetClass="llamaze.com.br.whattodraw.Activitys.AboutActivity"
           android:targetPackage="llamaze.com.br.whattodraw"/>/

   </PreferenceScreen>/
</PreferenceScreen>

 public static class PrefsFragment extends PreferenceFragmentCompat {
        Context context;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.preferences);
            Preference customPref = findPreference("clean_cache");
            customPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
                @Override
                public boolean onPreferenceClick(Preference preference) {
                    showDialogCache();
                    Log.d("PREFRE", "onPreferenceClick: foi clicado");

                    return false;
                }
            });
        }

Screens:

A: Well, the problem was resolved by google with the update of preference-v7 to 24.1.1


text:
Q: HTML5 and Android: image with transparent background I have many problems with HTML 5 for mobile.
See photo (same photo) when I'm running on an Android tablet HTML and side as compared running in a browser on mac.
http://img545.imageshack.us/img545/562/brdr.png
Note that black and white lines appear in the image into the Android Tablet.
I'm using the library CreateJS to generate images. In the image the only thing I do is to change x, y, scaleX and scaleY.
PS: The images are in PNG transparent.


text:
Q: mysql Simple Query + if Seems like I'm not able to do a simple query.
What I want to achieve is all the results that have 'best2' value '1' so the div will be attached to only those results.
Right now , the div 'badge-best2div' attaches to ALL the products.
I don't know what I'm missing out.
<?php $show = true; ?>
        <?php

        $roman  = Doctrine_Query::create()->from("Product")
                                  ->where("status = 1")
                                  ->andWhere("site_id = ? ", SITE_ID)
                                  ->andWhere("best2 = 1")
                                  ->fetchOne(array(), Doctrine_Core::HYDRATE_ARRAY);

         ?>
        <?php if ($product->getIsTop()  && !isset($hide_badge_top)): $show = false;?>

        <?php endif; ?>
        <?php if ($roman['best2']){
            $show = false;      ?>

        <?php } ?>

    <?php if ($product->getIsBestBuy() && !isset($hide_badge_bestbuy) && $show): ?>

        <?php endif ; ?>

A: got it working using
<?php if (($roman['best2'])==1){


text:
Q: Webview with Pinch zoom not working when the content more than height and having scroll? I am using webview in my application.
The Same webview is supporting pinch zoom for some websites and not supporting for some websites.
Usually I have set all the webview settings also like
    webView.getSettings().setSupportZoom(true);
    webView.getSettings().setBuiltInZoomControls(true);

But when loading the some websites  having vertically scrolled content are unable to work for pincn zoom.
other websites like having horizontal scrolling and fixed content are able to work for pinch zooming.
Please suggest me if any one solve this kind of behaviour with webview.
Thanks in advance.

A: Some mobile pages are designed to fit the device width, with some attribute width=device-width or even user-scalable=no in the meta filed of the page. In this case zooming is disabed by browser.


text:
Q: How do I add addons to Minecraft Bedrock edition on an Xbox One by converting a USB hard drive to be used for a computer? I found a program to convert the hard drive to be able to be used for a computer. However, how do I open the files? One of them is Microsoft.MinecraftUWPConsole_8wekyb3d8bbwe.UWA, which is probably Minecraft, but I cannot open it.
I have tried notepad and opening the file as an archive with 7zip but both did not work.

A: Heres an easier way, go into microsoft store and get "Mc addons' or sum like that, then go into internet explorer on the xbox, find a bedrock edition addon, go into mc addons and click import, then find your addon.
NOTE: Some addons may not work


text:
Q: Perl "HTTP::cookies"" with "LWP::UserAgent" error: "does not look like a Netscape cookies file" I'm trying to do the equivalent of curl --cookie cookies.txt "https://foo.example.org/bar" in a Perl script.  I have a cookies file that I believe is in Netscape format (tab delimited) that works fine with curl.  HTTP::cookies complains:

cookies.txt does not look like a Netscape cookies file at
  /System/Library/Perl/Extras/5.10.0/HTTP/Cookies/netscape.pm line 21,
   line 1.

My script is just a stub for testing:
#!/usr/bin/perl -w

use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
use HTTP::Cookies::Netscape;
my $cookie_jar = HTTP::Cookies::Netscape->new
                  ( 'file' => 'cookies.txt', );
my $url = 'http://www.google.com/';
my $response = $ua->get( $url );
print "Return: $response->status_line\n";

The cookies.txt file actually starts with a comment:
# This content may be pasted into a cookies.txt file and used by wget

But I tried deleting the comment and got the same exact error.  The cookies.txt file has Unix style line endings.

A: Arg!
Turns out that, while curl is happy with the file, the HTTP::Cookes::Netscape module wants the first line to be
# Netscape HTTP Cookie File

I added that, and now it seems happy.
(I found the module source code and searched for the error message.)


text:
Q: Is it true that $\preceq$ is well order on $P(x)$? Let $X$ be a finite set and $P(x)$ the power of $X$. Consider the relation $A\preceq B$ if there exists $f: A \to B$ injective. Is it true that $\preceq$ is well order on $P(x)$?
There is a problem that a tried to solve but a can not be able to do it and a really need some help. If someone can give me a hand I'd really thank you.


text:
Q: Can anyone help me with the following JScript? In Vista, I am trying to get "Local AppData" path for an user account (other than current user) on a local machine but facing some issue. can anyone pls help me what is wrong with the below code.
var HKU = 0x80000003;
var username = "xyz";

//Loading registry hive of user xyz
var WshShell = new ActiveXObject("WScript.Shell");
var LoadHiveCmd = "REG LOAD " + "HKU" + "\\" + username + " \"" + "c:\\users\\xyz\\NTUSER.DAT" + "\"";
var oExec = WshShell.Exec(strLoadHiveCmd);

var oReg = GetObject("WinMgmts:/root/default:StdRegProv");

var profileRegPath = username  + "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders";

var method, inparams, outparams;

method = oReg.Methods_.Item("GetExpandedStringValue");
inparams = method.InParameters.SpawnInstance_();
inparams.hDefKey = HKU;
inparams.sSubKeyName = profileRegPath ;
inparams.sValueName =  "Local AppData";

outparams = oReg.ExecMethod_(method.Name, inparams);
var appDataPath= outparams.sValue;

Here the appDataPath value in the registry is %USERPROFILE%\AppData\Local
But I am getting a value C:\Windows\system32\config\systemprofile\AppData\Local
I dont understand from where the value c:\windows\system32\config\systemprofile is coming and how it replaced %USERPROFILE% value.

A: USERPROFILE is a environment variable and will replace %USERPROFILE% to get it's correct location on this computer. it changes from computer to computer.
To see all environment variables type "set" on a command shell, or go to "Control Panel" > "System settings" > "Advanced" > Environment variables

A: GetExpandedStringValue automatically replaces any environment variables included in the registry value data with actual values of these variables. Most likely, %USERPROFILE% expands to C:\Windows\system32\config\systemprofile instead of C:\users\admin because the WMI service itself runs under Local System account.
What you need to get your script working is to:

*

*use GetStringValue instead of GetExpandedStringValue to read the unexpanded Local AppData value,

*get the profile path of the needed user by reading the ProfileImagePath value from the HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\<user_SID> key,

*do a string replace to substitute %USERPROFILE% with the profile path.
You can find an example of how to do this in this my answer:
Getting special Folder path for a given user in Jscript
You may also want to use WshShell.RegRead instead of WMI, because it's more JScript-friendly.