text:
Q: Boost.Build conditional library compilation per-project I have C++ project that are built using Boost.Build. The project consists of 3 subprojects.

    . [root]
    \-- source
        \-- common
            \-- config
                \-- config.cpp
        \-- project_1
            \-- Jamfile.jam
        \-- project_2
            \-- Jamfile.jam
        \-- project_3
            \-- Jamfile.jam
    \-- Jamroot.jam

Jamroot.jam:

    project my_project
        : requirements
          multi
          debug:DEBUG
        : default-build
          static
        : build-dir bin
        ;

    alias project_1 : source/project_1 ;
    alias project_2 : source/project_2 ;
    alias project_3 : source/project_3 ;

    install dist : project_1 project_2 project_3
        : on EXE
        ;

Each project has Jamfile.jam according to this template:

    project project_N
      : requirements
          CONFIG_DEFINE_1=
          CONFIG_DEFINE_2=
      ;

    lib config : [ glob ../common/config/*.cpp ] ;

    exe project_N
        : [ glob *.cpp ]  config
        :
        ;

config.cpp uses defines CONFIG_DEFINE_1 and CONFIG_DEFINE_2 for conditional compilation (actually they are simply constants), so there's a separate version of config library per project.
The problem is that such approach causes the config library to be rebuilt each time the whole project is built regardless of were the files changed or not. I.e. building the first time everything is compiled and linked, building the second time without doing any modifications - only the config library is built for each project_N. How should I properly setup the building so no redundand compilation occur?

A: As I understand it, your config library is shared over different projects and uses different defines for each project.
It's not possible to overcome recompilation in that case, irrespective of boost build.or any other build system. In between compiles of the cpp files the preprocessed files have changed.
If you want to avoid recompilation one option is to split of the config library into different libraries for each project, but depending on what config looks like, having a lot of code duplication is rarely desireable either...
The only other option I can think of is reducing the amount of code that needs to be recompiled every time.
e.g. you have a sourcefile LargeFunction.cpp with
 #if CONFIG_DEFINE_1
     void VeryLargeFunction() {
        ...
     }
 #elif CONFIG_DEFINE_2
     void VeryLargeFunction() {
        ...
     }
 #endif

Split it into three files, one containing the VeryLargeFunction as defined for DEFINE_1, one as defined for DEFINE_2, and one which simply includes these two based on the values of the defines.
 #if CONFIG_DEFINE_1
    #include "definitionFileFor1"
 #elif CONFIG_DEFINE_2
    #include "definitionFileFor2"
 #endif

This file still needs to be recompiled every time, but the object files which contain the 'real' code, will not.
You'll effectively only relink existing object files on every compile, i.s.o. recompiling everything.
The disadvantage is more maintenance though, and the different function definitions reside in different files, so the code becomes a bit harder to read.


text:
Q: Granting user access We're developing a web app using the Zend framework and Mysql.
Currently, accounts are unique by email address. We want to be able to allow the admin of an account to grant access to the admin of another account. This person would then be a "user" of the linked account. The account holder would then log into their admin account and then select which linked account they want to access.
Please note: the access should only be one way. Account 1, who grants access to Account 2, should not be able to access account 2. Only account 2 can access account 1. If Account 1 wanted access to account 2, account 2 would then have to grant access to account 1.
What is the best method of going about this?

A: I think trying to tie permissions to accounts is your problem, you need to add a second 'layer'. Let's stick with Google Analytics as the example:
Let's say Joe Bloggs wants to use Google Analytics. He first has to create a Google account (assuming he doesn't already have one). He then creates a Google Analytics account for his site. Say Joe then wants to give access to Jane Smith, let's assume she already has a Google account. To give her access all he is doing is giving her Google account access to his site, he's not giving her access to his Google account.
Zend_Acl is role based so let's try and apply ZF concepts to this example. The user management screens in GA allow you to give users either "View reports only" access, or "Account administrator". So you'd define a role in Zend_Acl for each of these access levels:
$acl = new Zend_Acl();
$acl->addRole(new Zend_Acl_Role('guest'));
$acl->addRole(new Zend_Acl_Role('admin'), 'guest');

the second parameter on addRole means the role should inherit all permissions from the other role specified. So what I've done above is define two roles: guest and admin; and said admin should inherit all permissions that guest has.
You then have your 'resources', which are the things that can be accessed. So we'll define one for reports, and one for user management:
$acl->add(new Zend_Acl_Resource('reports'));
$acl->add(new Zend_Acl_Resource('users'));

we'll then give 'guest' access to reports, and 'admin' access to users:
$acl->allow('guest', 'reports');
$acl->allow('admin', 'users');

then in the relevant controllers (or plugin, or wherever) you can check permissions:
public function reportsAction()
{
    [...]

    // assume $role contains the role of the currently logged in user
    if (!$acl->isAllowed($role, 'reports')) {
        // show a permissions error
    }
}

public function usersAction()
{
    [...]

    if (!$acl->isAllowed($role, 'users')) {
        // permissions error
    }
}

As far as storing this in MySQL goes, you just need a lookup table that links users, sites (in this example) and roles:
userID | siteID | role
   1       1      admin
   2       1      guest

redpajama_set_name: RedPajamaStackExchange


text:
Q: JDBC mysql Setting and retrieving data from a database any help would be greatly appreciated. Been stuck on this for a while and seem to be confusing myself more and more!
I have simple database with a table 'VowelCount' which has the columns (A, E, I, O and U) and one row underneath which stores how many of each vowel have been typed by a user.
The number of vowels needs to be updated each time the user inputs a new sentence and then the vowels for the current input, and all previous inputs need to be displayed.
I have figured out how to show the current vowels. But having trouble updating the data to the database table and retrieving it back again and storing it into a variable so that it can be added to the running total
If that makes any sense!
package managed_bean;

import javax.inject.Named;
import javax.enterprise.context.RequestScoped;
import java.sql.*;

@Named(value = "dataVowelBean")
@RequestScoped
public class dataVowelBean
{
private String name;
private int numberOfA;
private int numberOfE;
private int numberOfI;
private int numberOfO;
private int numberOfU;
private int totalA;
private int totalE;
private int totalI;
private int totalO;
private int totalU;

public String getName()
{
    return name;
}

public void setName(String name)
{
    this.name = name;
    numberOfA();
    numberOfE();
    numberOfI();
    numberOfO();
    numberOfU();
    storeVowelsInDatabase();

}

public int getNumberOfA()
{
    return numberOfA;
}

public int getNumberOfE()
{
    return numberOfE;
}

public int getNumberOfI()
{
    return numberOfI;
}

public int getNumberOfO()
{
    return numberOfO;
}

public int getNumberOfU()
{
    return numberOfU;
}

public int getTotalOfA()
{
    return totalA;
}

public int getTotalOfE()
{
    return totalE;
}

public int getTotalOfI()
{
    return totalI;
}

public int getTotalOfO()
{
    return totalO;
}

public int getTotalOfU()
{
    return totalU;
}

 public void storeVowelsInDatabase()
{
    int countA;
    int countE;
    int countI;
    int countO;
    int countU;

 try
    {
        DriverManager.registerDriver(new ());
        Connection con;
        con = DriverManager.getConnection(url, "user", "pass");

        PreparedStatement stmtGet = con.prepareStatement("SELECT A, E, I, O,
        U FROM vowelCountTable");
        //countA = stmtGet.executeQuery();
        ResultSet rs = stmtGet.executeQuery();

        countA = (rs.getInt("A") + getNumberOfA());
        totalA = countA;

        countE = (rs.getInt("E") + getNumberOfE());
        totalE = countE;

        countI = (rs.getInt("I") + getNumberOfI());
        totalI = countI;

        countO = (rs.getInt("O") + getNumberOfO());
        totalO = countO;

        countU = (rs.getInt("U") + getNumberOfU());
        totalU = countU;

        PreparedStatement stmtSet = con.prepareStatement("UPDATE
        vowelCountTable SET A = ?, E = ?, I = ?, O = ?, U = ?");

    stmtSet.setInt(1, totalA);
    stmtSet.setInt(2, totalE);
    stmtSet.setInt(3, totalI);
    stmtSet.setInt(4, totalO);
    stmtSet.setInt(5, totalU);
    stmtSet.executeUpdate();

       stmtSet.close();
       con.close();
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}

private void numberOfA()
{
    for (int i = 0; i < name.length(); i++)
    {
        if (name.charAt(i) == 'a')
            {
                numberOfA++;
            }
    }
}

private void numberOfE()
{
    for (int i = 0; i < name.length(); i++)
    {
        if (name.charAt(i) == 'e')
            {
                numberOfE++;
            }
    }
}

private void numberOfI()
{
    for (int i = 0; i < name.length(); i++)
    {
        if (name.charAt(i) == 'i')
            {
                numberOfI++;
            }
    }
}

private void numberOfO()
{
    for (int i = 0; i < name.length(); i++)
    {
        if (name.charAt(i) == 'o')
            {
                numberOfO++;
            }
    }
}

private void numberOfU()
{
    for (int i = 0; i < name.length(); i++)
    {
        if (name.charAt(i) == 'u' || name.charAt(i) ==  'U')
            {
                numberOfU++;
            }
    }
}

}
Here is the input xhtml screen:
<h:head>
    <title>Vowel Count Example</title>
</h:head>
<h:body>

This is a vowel count example

    <h:form>

 Please type your name in the box and I will tell you how many vowels were used:

        <h:inputText value="#{dataVowelBean.name}" />

          <h:commandButton type="submit" value="Submit" action="databaseVowelCount" />
    </h:form>
</h:body>

Here is the xhtml output:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<h:head>
    <title>Vowel Count Output</title>
</h:head>
<h:body>

Vowel count output

You typed: <h:outputText value="#{dataVowelBean.name}" />

   The number of A's: <h:outputText value="#{dataVowelBean.numberOfA}" />

   The number of E's: <h:outputText value="#{dataVowelBean.numberOfE}" />

   The number of I's: <h:outputText value="#{dataVowelBean.numberOfI}" />

   The number of O's: <h:outputText value="#{dataVowelBean.numberOfO}" />

   The number of U's: <h:outputText value="#{dataVowelBean.numberOfU}" />

   The total number of A's: <h:outputText value="#{dataVowelBean.totalOfA}" />

   The total number of E's: <h:outputText value="#{dataVowelBean.totalOfE}" />

   The total number of I's: <h:outputText value="#{dataVowelBean.totalOfI}" />

   The total number of O's: <h:outputText value="#{dataVowelBean.totalOfO}" />

   The total number of U's: <h:outputText value="#{dataVowelBean.totalOfU}" />

</h:body>

A: You have to call the next() method on the ResultSet variable. The ResultSet in JDBC works as a kind of pointer and this pointer starts before the first result.
Since you don't iterate over the result set, your probably getting some default value for int, this being value zero.
P.S. I would suggest having a simpler model for your table, like just vowelCountTable(letter, count). You can then restrict the domain of the letter column to only vogals.


text:
Q: Adding an Owl component to an existing view in Odoo 16 I have an existing Odoo 16 application with a working view that contains the following inside a Form view:
          <sheet>
            <notebook>
              <page name="plan_vehicles" string="Vehicles">
                <field name="vehicle_time_ids"/>
              </page>
            </notebook>
          </sheet>

I want to add another page to the notebook that will display an Owl component.
I have tried to extract the required code from the official tutorial, so I have the following code:
templates.xml
<odoo>
<data>
      <template id="transport.stops" name="Awesome T-Shirt thank you">
        <html>
            <head>
                <t t-call-assets="transport.assets"/>
            </head>

            <body>
            </body>
        </html>
      </template>
</data>

main.js:
/** @odoo-module **/

import { browser } from "@web/core/browser/browser";
import { mount } from "@odoo/owl";
import { Stops } from "./stops";

// The following code ensures that owl mount the component when ready.
// `templates` contains templates contained in the bundles.
//
// In the mount options, it's also possible to add other interresting
// configuration: https://github.com/odoo/owl/blob/master/doc/reference/app.md#configuration
import { templates } from "@web/core/assets";
owl.whenReady( () => {
    mount(Stops, document.body, { templates, dev: true });
});

stops.js:
/** @odoo-module **/

import { Component, useState } from "@odoo/owl";

export class Stops extends Component {
    static template = "transport.stops";
}

stops.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
    <t t-name="transport.stops" owl="1">
        <div class="p-3">
            hello world
        </div>
    </t>
</templates>

manifest.xml:
'assets': {
        'web.assets_backend': [
            'transport/static/src/*.**',
        ],
        'web.assets_qweb': [
            'transport/static/src/*.xml'
        ],
        'transport.assets': [
            # bootstrap
            ('include', 'web._assets_helpers'),
            'web/static/src/scss/pre_variables.scss',
            'web/static/lib/bootstrap/scss/_variables.scss',
            ('include', 'web._assets_bootstrap'),

            'web/static/src/libs/fontawesome/css/font-awesome.css', # required for fa icons
            'web/static/src/legacy/js/promise_extension.js', # required by boot.js
            'web/static/src/boot.js', # odoo module system
            'web/static/src/env.js', # required for services
            'web/static/src/session.js', # expose __session_info__ containing server information
            'web/static/lib/owl/owl.js', # owl library
            'web/static/lib/owl/odoo_module.js', # to be able to import "@odoo/owl"
            'web/static/src/core/utils/functions.js',
            'web/static/src/core/browser/browser.js',
            'web/static/src/core/registry.js',
            'web/static/src/core/assets.js',
            'transport/static/src/**/*',
        ],
    },

*

*the import of the template.xml file in the data list.

I think I am missing two things:

*

*how does the Owl template stops.xml relate to the template in templates.xml and

*how to add the the component/template to a new page in my notebook so that I can see the 'hello world'.


text:
Q: Pasting large files I'm writing a plugin to handle file uploads. I thought implementing a paste feature would be awesome (how often have you event just wanted to paste instead of having to open a photo editor and then save it as file and then upload, but I digress). What I'm doing so far works, except for when the file being pasted becomes too big. I cannot tell you what size 'too big' is, because I'm doing a screenshot selection and saving it to the clipboard.
My current code looks like
document.getElementById('AJS').onpaste = function (e) {
    var items = (e.clipboardData || e.originalEvent.clipboardData).items,
    blob = items[0].getAsFile();
    if (blob && blob.type.match(T.s.accept) && T.currentlength < T.s.maxFiles) {
        T.process(param1, param2, param3, param4, items[0].getAsFile());
    }
};

T.process
T.process = function (file, i, changing, target, pasteblob) {
    var fr = new FileReader();
    fr.onload = function (e) {
        var blob = pasteblob || new Blob([e.target.result], {type: file.type});
        var dataURL = (win.URL || win.webkitURL).createObjectURL(blob);
        var index = changing ? i : T.currentlength;
        var filedata =  {};
        if (file.type.match('image/*')) {
            var img = new Image();
            img.onload = function () {
                // Doing stuff
            };
            img.src = dataURL;
        } else {
            // Doing stuff
        }
    };
    fr.readAsArrayBuffer(pasteblob || file);
};

For larger files, the blob from blob = items[0].getAsFile() returns a size of 0. Has anyone else experienced this problem and how have you been able to overcome it?
Note: I'm using the latest Chrome on Ubuntu 14.04

A: Although I don't have any references to anyone other than my own personal research into the matter, it seems as if there is a bug on the Ubuntu version of chrome that prevents users copying and pasting using the native JS api. If you attempt to paste a screenshot in a GMail message using Ubuntu Chrome, you get an error, but this error doesn't come up in any other version of chrome. It was also the same for my code above as well. I tested it on native windows and OS X environments running chrome that were pointing to my machine, and pasting using this script worked just fine!


text:
Q: google_map_flutter onMapCreated is not called when update with GetX I am using google_maps_flutter in my app. However, I am having an issue that when recreate GoogleMap object, the onMapCreated is not called.
The view that contains GoogleMap is as follow:
class ViewInMapWidget extends GetView<ViewInMapWidgetController> {
  final ListRequest listRequest;

  ViewInMapWidget({Key? key, required this.listRequest}) : super(key: key) {
    controller.listRequest = listRequest;
    controller.googleMapController = Completer<GoogleMapController>();
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<ViewInMapWidgetController>(
      builder: (ViewInMapWidgetController ctrl) => GoogleMap(
          markers: ctrl.markers,
          mapType: MapType.normal,
          minMaxZoomPreference: const MinMaxZoomPreference(0, 20),
          initialCameraPosition: ctrl.initialCameraPosition,
          zoomGesturesEnabled: true,
          onMapCreated: (GoogleMapController controller) async {
            ctrl.googleMapController.complete(controller);
            ctrl.clusterManager.setMapId(controller.mapId);
            final LatLngBounds bounds = await controller.getVisibleRegion();
            ctrl.updateBound(bounds);
            await ctrl.listForMap();
          },
          onCameraIdle: () async {
            if (!ctrl.googleMapController.isCompleted) {
              final GoogleMapController googleMapController =
                  await ctrl.googleMapController.future;
              final LatLngBounds bounds =
                  await googleMapController.getVisibleRegion();
              ctrl.updateBound(bounds);
              await ctrl.listForMap();
            }
          }),
    );
  }
}

In the list records page, I have
GetBuilder<ListPageController>(
          builder: (ListPageController ctrl) {
        return ctrl.viewType == ViewType.List
            ? ViewInListWidget(listRequest: ctrl.listRequest)
            : ViewInMapWidget(listRequest: ctrl.listRequest);
      })

The first time when ViewInMapWidget is created,  onMapCreated is called successfully and data is loaded.
What I expect is that when a function in ListPageController calls the update() of GetX, the ViewInMapWidget should be recreated, thereby recreating the GoogleMap object. When I put some break points, I can see that ViewInMapWidget is recreated since its constructor is called, and the GetBuilder and GoogleMap() in ViewInMapWidget is also called. However, the onMapCreated is not called so there is no data loaded.
Can anyone please help on it? Thank you.


text:
Q: Transistors emitter pin has lowered output I have a BD135 NPN and BD136 PNP transistor, When i try to apply 5V of power to the collector pin, The emitter pin Voltage output is much lower.
The goal i want to achieve for this circuit is to control when the motor spins by a programmable circuit board which emits power which i believe is 0.5V from pins on the board, I'm connection a pin from the board to the base pin of a transistor while connection 5V to the collector pin and attaching the emitter pin to the motor which i want to control by turning off/on the pin.
I have tried directly connecting my power source to a electric motor and it spins fast, But when i try to connect the power to a transistor and then connecting the emitter pin from the transistor to the motor it spin very slow and sometimes stalls and needs to be pushed to continue. The motor needs more voltage then the transistor is emitting even when the collector pin is getting more then enough Voltage input(5V).
I thought the problem could be because i'm applying 3V to the base pin and maybe the base pin resists the collector but i'm not quite sure. I,m applying 5V of power into the collector but i don't know the output because i don't have the right equipment to measure it, All i know is that much less power comes out the emitter then what enters the collector.
I have tried researching this but i have found no topics or questions about this. I,m sure that my transistor is working because the problem happens for both my BD135 NPN and BD136 PNP transistors.
This is how i put my circuit for testing:

I have just discovered that the output is not 3v but 0.5v and the electric motor is also making a ticking sound.

A: First: Without the proper tools you're doomed to fail, so at the very least do yourself a favor and get yourself a digital multimeter and learn how to use it.
Second: When you ask a question you should provide at least enough information (Like a schematic diagram of your circuit) to show how you connected all of the circuit elements together.
If you don't do that, then how are we supposed to know whether you connected the power supply backwards or made some other gross error which let the magic smoke escape from the circuit?
The short answer is, "We won't", and all we'll wind up doing is wasting a lot of time guessing at what your problem might be before your question gets closed.
EDIT:
The drawing below shows your circuit, which is an emitter follower, and a common emitter circuit.

The reason the emitter follower circuit doesn't work very well for your application is because the base-to-emitter junction looks like a diode and needs to drop about 0.7 volts higher than the emitter voltage before the collector can start supplying current into the load connected to the emitter.  However, with the motor in there, as the current through the motor starts to increase, its voltage drop increases and starts pushing back on the emitter, so that the base-to-emitter voltage drops and the current into the load starts being limited. In your case, since there's only 3 volts available to drive the base and the base-to-emitter diode takes about 0.7 volts of that, the highest voltage that can be developed across the motor is 3 volts - 0.7 volts, which is 2.3 volts, and that's why your motor doesn't work very well.
In the common emitter circuit, however,  the motor is located between the supply and the collector, so its voltage drop doesn't affect the emitter much, its being connected directly to the negative (ground) side of the supply.
That being the case, all that's necessary to turn the transistor on and put nearly all of the 5 volts across the motor is to put enough current into the base.
A transistor has what's called "current gain", or "beta", which means that if it has a beta of 100 and I want one ampere of collector current, what I have to do is force  10 milliamperes of current into the base and that'll turn the transistor ON enough to let 1 ampere flow from the supply through the load, then through the transistor's collector-to emitter junction, and then from the emitter back to the supply.
In switching situations, though, what we do to make sure that the transistor is fully turned on is to push enough current into the base to saturate the collector-to emitter junction by making the base current about 10% of the load current.
In the example I've given, I've assumed a load current of about 500 milliamperes for the motor and, consequently, forced 50 milliamperes into the base for what's called a "forced beta" of 10.  If the load current is less than 500 milliamperes it won't matter at all because the transistor will still be fully turned on, but if it's a lot more than 500 milliamperes, then the transistor's data sheet will need to be reviewed to make sure everything's OK.
The diode across the motor is used to clamp the high voltage spike which will occur when the motor is abruptly turned off - and would otherwise destroy the transistor - to Vcc + 1 diode drop, or about 6 volts.

A: Bipolar transistors act as current amplifiers. Inject a small current into the Base, and you can extract a proportionally larger current from the Collector. But how much current does your motor need, and how much Base current is required to get it?
The behavior of your motor indicates that it is not getting enough current, most likely because you aren't supplying enough Base current to the transistor. "But how can this be?" you say. "The BD135 has a typical current gain of well over 100, and I am feeding 20mA into the Base. It should be good for at least 2A! (and my motor only draws 0.5A)". Of course it isn't quite that simple.
Several factors may be contributing to your problem:-

*

*The transistor's current gain decreases at high current. In the graph below you can see that the BD135's gain starts to drop off rapidly above 100mA, falling to almost nothing at 1A. It might be 'rated' for 2A maximum, but is really only good for about 800mA max.

*At startup a DC motor draws very high current, limited only by the resistance of the armature windings and commutator/brushes. As it spins faster it draws less current due to the generator effect (armature generates an opposing voltage which reduces the effective voltage across the motor's internal resistance). However if it isn't supplied with sufficient current to get up to speed then it will run very slowly, and even the slightest load may stall it. The stall current of a DC motor is typically 2-5 times it's rated operating current, so a '0.5A' motor could draw 2A at stall!

*With your transistor connected in 'Common Collector' configuration, the voltage at the Emitter will be ~0.6V (up to 1V at high current) less than the voltage on the Base. So if for example you are only supplying 3V to the Base, the output voltage at the Emitter will be ~2.4V. Any resistance in the Base circuit will drop the voltage even lower. You may be driving the transistor from an MCU with 20mA rated I/O, but at that current its output voltage might drop from 3V to 2V, reducing motor voltage to 1.4V or less!
Motor drive techniques that avoid these problems include:-
a. Use MOSFETs instead of bipolar transistors. MOSFETs are turned by voltage rather than current, and can switch very high currents from a low power voltage signal.
b. Don't use common Collector (MOSFET: common Drain) configuration. Use common Emitter (Source) instead, and connect the motor between Collector (Drain) and the supply.
or
c. Drive the Base/Gate with a higher voltage. MOSFET drivers often have a booststrap circuit for this purpose (may only work when appplying PWM).
d. Use transistors which are rated well above the stall current of the motor. A MOSFET driving a 0.5A motor might be rated at 5A or higher.

A: You are doing it wrong. You need to more powerful transistor, but for now yours will work. Connect the motor between collector and + of the  battery. Connect 3v through 500-1000 Ohm resistor to the base and emiiter.


text:
Q: Having trouble showing and hiding the Windows 10 On Screen Keyboard (osk.exe) I have been trying to get the onscreen keyboard (osk.exe) to appear (and disappear) on Windows 10 from within my app.  My app was running fine in windows 7.  Calling ShellExecute() on osk.exe would show the keyboard there but trying to get the same behaviour in Windows 10 has proved to be a pain.
To try to hide the keyboard, once it is visible, I tried this:
HANDLE wHandle = FindWindowW(L"OSKMainClass", L"On-Screen Keyboard");
if (wHandle != NULL)
{
    long style = GetWindowLong(wHandle, GWL_STYLE);
    if (style & WS_VISIBLE)
    {
        return TRUE;
    }
    else
    {
        SetWindowLongPtr(wHandle, GWL_STYLE, WS_VISIBLE);
    }

but that had no effect.
I also tried using the TabTip keyboard but was unable to detect when it is visible (I can detect when it's not visible but I can't get a handle to it when it is visible!).
Any help with this problem would be appreciated.
Update: The reason osk wasn't initially been shown was the 'nCmdShowparameter supplied toShellExecute`, the original code supplied NULL for this value and it was working fine on Windows 7 so I had assumed the problem lay elseware. changing it from NULL to SW_SHOWNORMAL fixed the issue with the keyboard appearing.
Comment by Paul Sanders: In a 32 bit app you have to do one more thing, see, see: https://stackoverflow.com/a/50510526/5743288.

A: I have decided to rewrite this answer, because the original contained a lot of irrelevant details, most of which were wrong.  Now that I understand properly how it all actually works there's a lot less to say, and what there is to say should be a lot more useful to future visitors.
First up, the answer to the OP's question is here.  That should let him do exactly what he wants to do.  Kudos to @zett42 for pointing out the WM_SYSCOMMAND trick.  Now for the interesting stuff.
Question 1: why does posting a WM_SYSCOMMAND message to osks main window work when calling ShowWindow(), as the OP was trying to do, does not?
Answer: Well, putting aside the fact that hiding the OSK rather than closing or minimising it is probably not a good idea anyway, the answer lies in something called UI Privilege Level Isolation (UIPI).  OSK runs elevated and this limits the ways it can be manipulated by a regular app.  You can read more about UIPI here.
For future reference, you can figure out if a program is running elevated using SysInternals' Process Explorer.  If you look in the Security tab of the Process Properties window, then for OSK you see:
Flags: Integrity Group: Mandatory Label\ High Mandatory Label
while for (e.g.) the Settings app, you see:
Flags: Integrity Group: Mandatory Label\ Medium Mandatory Label
Question 2: Is any of this affected by the fact that OSK is a UWP app (see comments below by @IInspectable)?
Answer: Actually, no.  The top-level HWND's of UWP apps appear to be just regular HWND's, although Microsoft don't want you to rely on that.  You can investigate the exact window hierarchy they use - what there is of it - with Spy++ (and use the 64 bit version, lol).
Asides:

*

*OP, please try to write better questions.  This one was a bit of a mess and it has caused a lot of trouble.  I have edited your question by way of example and to clean it up for future visitors, please take a look.  And please vote me up.  I have earned it.

*People posting replies: please do a bit of research first.  The other answers in this thread are not useful, partly (I would be the first to admit) because of the way the question was originally worded.  I myself made this mistake in my initial comments so we can all learn from this.

A: You can use IsWindowVisible function from WinAPI to determine if your hwnd is a visible window or not. Have you tried that? Checking and managing flags directly for such simple task is not the best idea
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633530(v=vs.85).aspx

A: You are making a few errors:

*

*in your if you use an assignment in stead of a test

*in your SetWindowLongPtr you set only one bit and all existing flags are lost. You should use:
   long style = GetWindowLong(wHandle, GWL_STYLE);
    if (style & WS_VISIBLE) // test
    {
        return TRUE;
    }
    else
    {
        style |= WS_VISIBLE; // set the bit
        SetWindowLongPtr(wHandle, GWL_STYLE, style); // set the new style
        ShowWindow(wHandle, SW_SHOWDEFAULT);
    }

Note: The windows documentation says you must call SetWindowPos, not ShowWindow.


text:
Q: Error when updating MySQL database using UPDATE - SET - WHERE method in Eclipse I am making a program using Eclipse that allows the user to update the volume of chemicals everytime they're restocked/used, which requires them to enter the ID of the chemical and the amount they would like to add/subtract. A query is then performed to search for the chemical's ID in the database, and its volume is updated accordingly.
However, I'm having difficulties getting the volume to update. I tried adapting MySQL's UPDATE statement from this website to SET volume = volume + amount added, WHERE chemical ID = ID entered by the user; however, there appears to be some syntax errors in my code, more specifically at the UPDATE - SET - WHERE line:
public void IDEnter() {
    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8889/StockControlSystem","root","root");
        Statement stmt = con.createStatement();
        String sql = "Select * from Chemicals where `Chemical ID` ='" + txtChemical_ID.getText()+"'";
        ResultSet rs = stmt.executeQuery(sql);
        if(rs.next()) {
            stmt.executeUpdate("UPDATE Chemicals" + "SET `Volume` = rs.getInt(Volume) + Integer.parseInt(AmountAdded.getText()) WHERE `Chemical ID` in (txtChemical_ID.getText())");
        }
        else {
            JOptionPane.showMessageDialog(null, "Invalid chemical ID");
            txtChemical_ID.setText(null);
        }
    } catch(Exception exc) {
        exc.printStackTrace();
    }
}

Since I'm still new to MySQL, can someone help me correct this? Thank you so much for your help!

A: Your whole query is badly formatted. Change your code to this:
stmt.executeUpdate("UPDATE Chemicals SET Volume = " +
 rs.getInt(Volume) + Integer.parseInt(AmountAdded.getText())
 + " WHERE Chemical_ID in (" + txtChemical_ID.getText() +  ")");

You cannot use ' single quotes when defining Column names in queries. Single quotes are used for string values!
Still, this would not be the best way to do this. use PreparedStatement!
This way:
String updateString = "UPDATE Chemicals SET Volume = ? WHERE Chemical_ID in (?)"; // Creation of the prepared statement, the ? are used as placeholders for the values
PreparedStatement preparedStatement = con.prepareStatement(updateString);
preparedStatement.setInt(1, rs.getInt(Volume) + Integer.parseInt(AmountAdded.getText())); // Setting the first value
preparedStatement.setString(2, txtChemical_ID.getText()); // Setting the second. I am supposing that this txtChemical_ID textField has values seperated by commas, else this will not work!
preparedStatement.executeUpdate();

If you need to read more for PreparedStatement there are a lot of great resources out there. They also protect against SQL injections.

A: I think your problem might be with the "rs.getInt(Volume)"
Yours:
    "UPDATE Chemicals" + "SET `Volume` = rs.getInt(Volume)
+ Integer.parseInt(AmountAdded.getText())
WHERE `Chemical ID` in (txtChemical_ID.getText())"

Can you try this:
 "UPDATE Chemicals" + "SET `Volume` = " +
Integer.parseInt(AmountAdded.getText()) + "
WHERE `Chemical ID` in (" + (txtChemical_ID.getText()) +")"


text:
Q: Are there alternatives to paid HDD data recovery on a semi-dead drive that actually work? I need a file from a WD caviar 80 GB SATA hard drive.  It doesn't show up in my computer. It's in disk management but you can't assign a drive letter.  It says cyclic errors so i tried chkdsk but the partition that has all the stuff on is not there.  It's a 80 GB capacity but it says on diskpart that there are no partitions and the capacity of the drive is only 5.7 GB the other 70 GB has dissapeared.
I tried a few recovery programs but they can't see the lost partition either and think its only a 5.7 GB drive. I think the original problem occured when the computer was unexpectedly cut off from the power.
Any suggestions to recover my lost file?

A: At a minimum your partition table is fried.  Many recovery programs can't touch that.
I have had success in the past with: http://www.r-studio.com/
Last I knew there was a free version that let you do everything except actually recover files over some small size limit--you could try it and see if it finds your stuff without paying.
Beware that there seems to be an unrelated www.rstudio.com that I know nothing about but the similarity of the names strongly suggests they aren't honest.


text:
Q: C# SslStream throws "Verification failure during handshake" I'm trying to establish a simple TLS-connection between a server and a client in Unity with C#'s SslStream-class. Currently, both client and server run on my machine and the hostIpAddress and serverName are set to "127.0.0.1". I created a (self-signed) certificate file with OpenSSL and saved it under pathToCertificate.
The certificate file is being read without issues and the server can be opened, but when a client tries connecting, an AuthentificationException (Outer: "Authentication failed, see inner exception.", Inner: "Verification failure during handshake") is thrown in sslStream.AuthenticateAsServer(hostCertificate, false, true);.
Server:
    hostCertificate = new X509Certificate2(pathToCertificate, "pw");
    listener = new TcpListener(IPAddress.Any, port);
    listener.Start();

    TcpClient tcpConnection = listener.AcceptTcpClient();

    // A client has connected. Create the
    // SslStream using the client's network stream.
    SslStream sslStream = new SslStream(tcpConnection.GetStream(), false);

    // Authenticate the server but don't require the client to authenticate.
    try
    {
        sslStream.AuthenticateAsServer(hostCertificate, false, true);

        // Set timeouts for the read and write to 2 seconds.
        sslStream.ReadTimeout = 2000;
        sslStream.WriteTimeout = 2000;
    }
    catch(AuthenticationException exc)
    {
        Debug.LogError("Exception during HostController Network Authentification:");
        Debug.LogError(exc.Message);
        if(exc.InnerException != null)
        {
            Debug.LogError(exc.InnerException.Message);
        }

        tcpConnection.Close();
        sslStream.Close();
        }
    }

Client:
public ClientController()
{
    TcpClient tcpConnection = new TcpClient(hostIpAddress, port);

    // Create an SSL stream that will enclose the client's stream.
    hostStream = new SslStream(tcpConnection.GetStream(), false,
        new RemoteCertificateValidationCallback(ValidateServerCertificate));
    // The server name must match the name on the server certificate.
    try
    {
        hostStream.AuthenticateAsClient(serverName);
    }
    catch(AuthenticationException exc)
    {
        Debug.LogError("Exception during ClientController Network Authentification:");
        Debug.LogError(exc.Message);
        if(exc.InnerException != null)
        {
            Debug.LogError(exc.InnerException.Message);
        }

        tcpConnection.Close();
        hostStream.Close();
    }
}

// The following method is invoked by the RemoteCertificateValidationDelegate.
    public bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {
        if(sslPolicyErrors == SslPolicyErrors.None)
        {
            return true;
        }

        Debug.LogError("Certificate error: " + sslPolicyErrors);

        // Do not allow this client to communicate with unauthenticated servers.
        return false;
    }

OpenSSL-Commands to create Certificate:
openssl genrsa -out LocalCA.key 2048

openssl req -x509 -new -nodes -key LocalCA.key -sha256 -days 3650 -out LocalCA.crt -config localhost.cnf -extensions v3_ca -subj "/CN=SocketTools LocalCA"

openssl genrsa -out localhost.key 2048

openssl req -new -key localhost.key -out localhost.csr -config localhost.cnf -extensions v3_req

openssl x509 -req -in localhost.csr -CA LocalCA.crt -CAkey LocalCA.key -CAcreateserial -out localhost.crt -days 3650 -sha256 -extfile localhost.cnf -extensions v3_req

openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt -certfile LocalCA.crt -password pass:pw

localhost.cnf:
[req]
default_bits = 2048
default_md = sha256
prompt = no
distinguished_name = req_distinguished_name
x509_extensions = v3_ca
req_extensions = v3_req

[req_distinguished_name]
C = AT
ST = Vienna
L = Vienna
O = FluffyVoxels
CN = localhost

[v3_ca]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
basicConstraints = critical, CA:true, pathlen:0
keyUsage = critical, digitalSignature, cRLSign, keyCertSign

[v3_req]
subjectKeyIdentifier = hash
basicConstraints = critical, CA:false
nsCertType = server
keyUsage = digitalSignature, nonRepudiation, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost
IP.1 = 127.0.0.1
IP.2 = 192.168.0.4
IP.3 = 2a02:8388:8a03:ac80:c8d6:6a1d:f2b0:c17d
IP.4 = ::1

Wireshark Output during Connection

A: I figured out how to make this work:
If you use a client certificate, can simply be a self-signed one you supply with the client application, then the handshake does go well. I have now also successfully got it working with a LetsEncrypt cert on the server and a self-signed one on the client.
Tested with Unity 2021.3.7f1, both in 2 editors and with the server running on Ubuntu Linux as a Unity Dedicated Server build.

*

*Generate a self-signed pfx cert:

*

*Create private key:
openssl genrsa -out key.pem 2048

*Create certifcate signing request (csr)
openssl req -new -sha256 -key key.pem -out csr.csr

*Create certificate
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem

*Convert to .pfx file
openssl pkcs12 -export -inkey key.pem -in certificate.pem -out certificate.pfx
Note the password you set on the pfx file, to use in your C# code.

*Change the code for creating the SslStream and for AuthenticateAsClient and AuthenticateAsServer and include a LocalCertificateSelectionCallback.
Here is an example of what I got working:
(Specifically for Unity this example also includes storing the certificates in a TextAsset (just name it like certificate.pfx.txt), using a Coroutine to start the client, and using async on the server side so it doesn't block)
Server side
[SerializeField] int serverPort = 4578;
[SerializeField] TextAsset certificateFile;

void RunServer()
{
    X509Certificate2 serverCertificate = new(certificateFile.bytes, "password");
    TcpListener listener = new(IPAddress.Any, serverPort);
    listener.Start();
    listener.BeginAcceptTcpClient(new AsyncCallback(ConnectCallback), listener);
}

private void ConnectCallback(IAsyncResult result)
{
    TcpListener listener = (TcpListener)result.AsyncState;
    TcpClient tcpClient = listener.EndAcceptTcpClient(result);
    ProcessClient(tcpClient);

    listener.BeginAcceptTcpClient(new AsyncCallback(ConnectCallback), listener);
}

void ProcessClient(TcpClient tcpClient)
{
   ClientConnection client = new() { tcpClient = tcpClient };

    // A client has connected. Create the
    // SslStream using the client's network stream.
    client.stream = new(
        client.tcpClient.GetStream(),
        false,
        new RemoteCertificateValidationCallback(ValidateRemoteCertificate),
        new LocalCertificateSelectionCallback(CertificateSelectionCallback)
        );
    try
    {
        client.stream.AuthenticateAsServer(serverCertificate, true, false);

        client.stream.BeginRead(client.buffer, 0, ClientConnection.BUFFER_SIZE,
            new AsyncCallback(ReadCallback), client);
    }
    catch (AuthenticationException e)
    {
        Debug.LogException(e);
        if (e.InnerException != null)
        {
            Debug.LogError($"Inner exception: {e.InnerException.Message}");
        }
        Debug.LogWarning("Authentication failed - closing connection");
        client.stream.Close();
        tcpClient.Close();
        return;
    }
}

bool ValidateRemoteCertificate(
      object sender,
      X509Certificate certificate,
      X509Chain chain,
      SslPolicyErrors sslPolicyErrors)
{
    // Allow any client certificate
    return true;
}

X509Certificate CertificateSelectionCallback(object sender, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
{
    return localCertificates[0];
}

State object class for async:
public class ClientConnection
{
    internal TcpClient tcpClient = null;
    internal SslStream stream = null;

    // These are used for reading from the stream async
    internal const int BUFFER_SIZE = 1024;
    internal byte[] buffer = new byte[BUFFER_SIZE];
    internal StringBuilder stringBuffer = new();
}

Client side
[SerializeField] string serverAddress;
[SerializeField] TextAsset clientCertificate;
TcpClient tcpClient;
SslStream stream;

void RunClient()
{
    StartCoroutine(nameof(RunClientCoroutine));
}

IEnumerator RunClientCoroutine()
{
    yield return new WaitForFixedUpdate();

    // Create a TCP/IP client socket.
    // machineName is the host running the server application.
    tcpClient = new(serverAddress, serverPort);

    // Create an SSL stream that will close the client's stream.
    stream = new(
        client.tcpClient.GetStream(),
        false,
        new RemoteCertificateValidationCallback(ValidateServerCertificate),
         new LocalCertificateSelectionCallback(CertificateSelectionCallback)
        );
    // The server name must match the name on the server certificate.
    try
    {
        bool authenticationPassed = true;
        X509Certificate2 cert = new(clientCertificate.bytes, "password");
        X509Certificate2Collection certs = new();
        certs.Add(cert);
        stream.AuthenticateAsClient(serverAddress, certs, SslProtocols.Tls, true);
        authenticationPassed = client.stream.IsAuthenticated;

        if(authenticationPassed) StartClient();
    }
    catch (AuthenticationException e)
    {
        Debug.LogException(e);
        if (e.InnerException != null)
        {
            Debug.LogError($"Inner exception: {e.InnerException.Message}");
        }
        Debug.LogWarning("Authentication failed - closing connection");
        tcpClient.Close();
    }
}

// The following method is invoked by the RemoteCertificateValidationDelegate.
bool ValidateServerCertificate(
    object sender,
    X509Certificate certificate,
    X509Chain chain,
    SslPolicyErrors sslPolicyErrors)
{
    if (sslPolicyErrors == SslPolicyErrors.None)
        return true;

#if UNITY_EDITOR
    if (sslPolicyErrors == SslPolicyErrors.RemoteCertificateNameMismatch && (serverAddress == "localhost" || serverAddress == "127.0.0.1" || serverAddress == "::1"))
        return true;
#endif

    Debug.LogError($"Certificate error: {sslPolicyErrors}");

    // Do not allow this client to communicate with unauthenticated servers.
    return false;
}

X509Certificate CertificateSelectionCallback(object sender, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
{
    return localCertificates[0];
}

For production, to convert a LetsEncrypt cert already running on a unix server from certbot apache to a pfx file for C# X509, it would be something like this:
sudo openssl pkcs12 -inkey /etc/letsencrypt/live/<domain>/privkey.pem -in /etc/letsencrypt/live/<domain>/fullchain.pem -export -out unitykey.pfx

A: Looks like a Unity Bug here (calling VerifyCertificate() with null and throwing an exception when null is not recognized as a valid certificate):
https://github.com/Unity-Technologies/mono/blob/06e6ccece853a5373a6545a821ca178f4ec57f20/mcs/class/System/Mono.UnityTls/UnityTlsContext.cs#L344


text:
Q: Создать кнопку на disnake меня очень давно волнует вопрос как сделать кнопку на disnake, я слышал что это disnake.ui. Всё перечитал, не понял ничего. Буду благодарен.

A: Хоть ответ и поступает в течение месяца, могу дать 3 варианта кнопок

*

*кнопка с простым выводом текста в чат:

class Role_list(disnake.ui.View):
    def __init__ (self):
        super().__init__(timeout=None)
        self.value: Optional[bool] = None

    @disnake.ui.button(label='Вывод текса',style=disnake.ButtonStyle.gray)
    async def vivod_texta(self,button:disnake.Button,interaction:disnake.Interaction):
        await interaction.response.send_message('Проверка')

*выдача роли по кнопке

   @disnake.ui.button(style=disnake.ButtonStyle.grey,label='Черный',row=1)
    async def Black (self,button:disnake.Button,interaction:disnake.Interaction):
        Black = interaction.guild.get_role(1072561365438451743)
        if Black in interaction.user.roles:
            await interaction.user.remove_roles(Black)
            await interaction.response.send_message(f'{Black.mention} Успешно забрана',ephemeral=True)

        else:
            await interaction.user.add_roles(Black)
            await interaction.response.send_message(f'{Black.mention} Успешно присвоено',ephemeral=True)

Если у вас возникает вопрос касаемо этого участка кода
if Black in interaction.user.roles:
            await interaction.user.remove_roles(Black)
            await interaction.response.send_message(f'{Black.mention} Успешно забрана',ephemeral=True)

        else:
            await interaction.user.add_roles(Black)
            await interaction.response.send_message(f'{Black.mention} Успешно присвоено',ephemeral=True)

Объясню. Чтобы не делать много кнопок,а не дай бог кнопки для очистки всех ролей. Сделаем небольшую проверку на на наличие роли у пользователя

*кнопки принятия и отказа

class Confirm(disnake.ui.View):
    def __init__(self):
        super().__init__(timeout=10.0)
        self.value: Optional[bool] = None

    @disnake.ui.button(style=disnake.ButtonStyle.grey,emoji='✅')
    async def confirm(self, button: disnake.ui.Button, inter: disnake.MessageInteraction):
        self.value = True
        self.stop()

    @disnake.ui.button(style=disnake.ButtonStyle.grey,emoji='❌')
    async def cancel(self, button: disnake.ui.Button, inter: disnake.MessageInteraction):
        self.value = False
        self.stop()

Итак, кнопки и их виды я дал,но не показал как применять
P.s для третьего вида потребуется импорт from typing import Optional
Внимательный читатель мог увидеть ,что в выдаче роли по кнопке использовалось:
await interaction.response.send_message(f'{Black.mention} Успешно забрана',ephemeral=True)

ephemeral означает видимое ли это сообщение или нет
interaction совмещает в себе класс disnake.Member
А также является чем-то вроде cxt. Прочесть подробнее о методах и атрибутах interaction можно здесь
Чтобы применять первые два варианта кнопка достаточно просто сделать следующий код:
@commands.command(name='verify')
    @commands.has_permissions(administrator=True)
    async def verify(self,ctx):
        view=Verify_button()
        verify_embed = disnake.Embed(
            title='Верификация',
            description='Пройдите верификацию чтобы продолжить общение!'
        )
        await ctx.send(embed=verify_embed,view=view)

А чтобы использовать кнопки принятия потребуются условные операторы
код ниже :
    @commands.command(name='test')
    async def test(self,ctx):
        view = Confirm()
        message = await ctx.send ('Тест',view=view)
        await view.wait()
        if view is None:
            await ctx.send('Вы не успели)')
        elif view.value:
            message.delete()
            await ctx.send('тест успешно пройден')
        else:
            message.delete()
            await ctx.send('тест успешно провален')


text:
Q: jQuery UI sortable element with input fields does not work on mobile devices I would like to add input and textarea elements to a jQuery UI sortable.  Here's a simple example of what I'm trying:

        alpha
        <input type="text"/>

        beta
        <textarea></textarea>

On desktop, I have no problem interacting with both fields.  But on my Android device, clicking on either field seemingly does nothing.  I have been told that the elements also do not work on iOS.
I've tried a few possible workarounds, but to little avail.  First I've tried attaching to the click event, on either the draggable element or the input fields themselves:
$('input, textarea').click(function(){
    $(this).focus();
});

Strangely, this seemed to work maybe 10% of the time?  The inconsistent behavior made me think that I had a race condition with some aspect of jQuery UI, so I experimented with delaying my code:
var interval = setInterval(function(){
    $(this).focus();
    clearInterval(interval);
}, 1000);

Even with such a long wait, my clicks are still frequently ignored.  I've also tried attaching to one of jQuery UI's sortable events, but requiring a user to drag an element in order to get focus on the field is not ideal.  Could someone with more mobile development skills enlighten me about why this isn't working?  Any other workarounds that could be used to get this working?


text:
Q: Webpack 4 With Aurelia Not Automatically Doing Splitting For some reason after upgrading everything, I cannot get my webpack to split the code into chunks so my main js file is 5mb. Any ideas why this is not working?  Below is a screenshot showing what the output is.  The project is using aurelia, but I don't think that matter.  Why isn't this splitting into multiple bundles based on the routes?  This was working well in webpack 2 with the commonchunks plugin.

Here is my webpack config:
import { merge } from '@easy-webpack/core';
const webpack = require('webpack');
const DefinePlugin = require('webpack/lib/DefinePlugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HappyPack = require('happypack');
const path = require("path");
const WebpackMd5Hash = require('webpack-md5-hash');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { AureliaPlugin, ModuleDependenciesPlugin } = require("aurelia-webpack-plugin");
const webpackPort = parseInt(process.env.WEBPACK_PORT) || 9000;
const webpackHost = process.env.WEBPACK_HOST || 'localhost';
const ENV = process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() || (process.env.NODE_ENV = 'local');
const isHMR = process.argv.join('').indexOf('hot') > -1 || !!process.env.WEBPACK_HMR;
const title = 'My Title';
const baseUrl = '/';
const rootDir = __dirname;
const extractCSS = new ExtractTextPlugin({
                                          "filename" : '[name]-css.css'
                                         });
const extractLESS = new ExtractTextPlugin({
                                           "filename" : '[name]-less.css'
                                          });

let plugins = [
               new HappyPack({
                              "id" : "css1",
                              "loaders" : ['css-loader']
                             }),
               new HappyPack({
                              "id" : "css2",
                              "loaders" : ['style-loader', 'css-loader']
                             }),

               new HappyPack({
                              "id" : "less1",
                              "loaders" : ['css-loader', 'less-loader']
                             }),
               new HappyPack({
                              "id" : "less2",
                              "loaders" : ['style-loader', 'css-loader', 'less-loader']
                             }),
               new HappyPack({
                              "id" : "ts",
                              "threads" : 2,
                              "loaders" : [{
                                            "path" : "ts-loader",
                                            "query" : {
                                                       happyPackMode: true
                                                      }
                                           }]
                             }),
               new HappyPack({
                              "id" : "js",
                              "loaders" : ['babel-loader']
                             }),
               new AureliaPlugin(),
               new webpack.ProvidePlugin({
                                          $: "jquery",
                                          jQuery: "jquery",
                                          "window.jQuery": "jquery",
                                          'Promise': 'bluebird',
                                         }),
                new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
                new ModuleDependenciesPlugin({
                                              "au-table": [ './au-table', './au-table-pagination', './au-table-pagination.html', './au-table-select', './au-table-sort' ],
                                              "aurelia-authentication": ["./authFilterValueConverter", "./authenticatedFilterValueConverter", "./authenticatedValueConverter" ],
                                              "aurelia-mdl-plugin" : ['./mdl'],
                                              "aurelia-froala-editor": [ './froala-editor' ],
                                            }),

                 //new HardSourceWebpackPlugin()
               ];

plugins.push(extractCSS);
plugins.push(extractLESS);

let base = {
            entry: {
                    main: [
                           //'whatwg-fetch',
                           'aurelia-bootstrapper',
                           ]
                   },
            output: {
                     path: path.resolve(__dirname, "dist_"+process.env.NODE_ENV.toLowerCase()),
                     publicPath: baseUrl,
                     filename: (ENV === 'prod' || ENV === 'stage' || ENV === 'qa' || ENV === 'dev') ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
                     sourceMapFilename: (ENV === 'prod' || ENV === 'stage' || ENV === 'qa' || ENV === 'dev') ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
                     chunkFilename: (ENV === 'prod' || ENV === 'stage' || ENV === 'qa' || ENV === 'dev') ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js',
                    },
            resolve: {
                      extensions: [".ts", ".js"],
                      modules: ["src", "node_modules", 'kendo/js'],
                      symlinks: false,
                     },
            module: {
                     rules: [
                             {
                              test: /\.css$/i,
                              issuer: [{ not: [{ test: /\.html$/i }] }],
                              use: (ENV !== 'local') ? extractCSS.extract({
                                                                           fallback: 'style-loader',
                                                                           use: 'happypack/loader?id=css1',
                                                                          })
                                                     : 'happypack/loader?id=css2'
                             },
                             {
                              test: /\.css$/i,
                              issuer: [{ test: /\.html$/i }],
                              // CSS required in templates cannot be extracted safely
                              // because Aurelia would try to require it again in runtime
                              use: 'happypack/loader?id=css1'
                             },
                             {
                              test: /\.less$/i,
                              use: (ENV !== 'local') ? extractLESS.extract({
                                                                            fallback: 'style-loader',
                                                                            use: 'happypack/loader?id=less1',
                                                                           })
                                                     : 'happypack/loader?id=less2',
                              issuer: {
                                       // only when the issuer is a .js/.ts file, so the loaders are not applied inside templates
                                       test: /\.[tj]s$/i,
                                      }
                             },
                             {
                              test: /\.ts$/i,
                              use: 'happypack/loader?id=ts',
                              include: path.resolve(__dirname, 'src'),
                              exclude: /node_modules/
                             },
                             {
                              test: /\.js$/,
                              exclude: /(node_modules|bower_components|src)/,
                              use: 'happypack/loader?id=js',
                             },
                             {
                              test: /\.html$/i, use: ["html-loader"]
                             },
                             {
                              test: /\.mp4$/,
                              loader: 'url-loader?limit=100000&mimetype=video/mp4'
                             },
                             {
                              test: /\.ogv$/,
                              loader: 'url-loader?limit=100000&mimetype=video/ogv'
                             },
                             {
                              test: /[\/\\]node_modules[\/\\]bluebird[\/\\].+\.js$/,
                              loader: 'expose-loader?Promise'
                             },
                             {
                              test: /\.json$/, loader: 'json-loader'
                             }
                            ]
                    },
            plugins: plugins
           }

const local = {
               mode: 'development',
               // output: {
               //          filename: 'bundle.js',
               //         },
               devServer: {
                           port: webpackPort,
                           host: '0.0.0.0',
                           historyApiFallback: true,
                           watchOptions: {
                                          aggregateTimeout: 300,
                                          poll: 1000
                                         },
                          },
              }

const production = {
                    mode: 'production',
                    devtool: '#source-map',
                    plugins: [
                              new WebpackMd5Hash(),
                              new BundleAnalyzerPlugin(),
                              // new (webpack as any).LoaderOptionsPlugin({
                              //                                           test: /\.html$/i,
                              //                                           minimize: true,
                              //                                           removeAttributeQuotes: false,
                              //                                           caseSensitive: true
                              //                                          })
                             ]
                   }

const variables = {
                   plugins: [
                             new CleanWebpackPlugin(path.resolve(__dirname, "dist_"+process.env.NODE_ENV.toLowerCase()), {"verbose" : false}),
                             // literally replaces all mentions of a given variable in your code with the given value
                             new DefinePlugin({
                                               ENV: JSON.stringify(ENV),
                                               HMR: isHMR,
                                               'process.env': {
                                                               NODE_ENV: JSON.stringify(ENV),
                                                               HMR: isHMR,
                                                               WEBPACK_PORT: JSON.stringify(webpackPort),
                                                               WEBPACK_HOST: JSON.stringify(webpackHost),
                                                               VERSION: JSON.stringify(process.env.npm_package_appversion),
                                                               BUILD: JSON.stringify(process.env.npm_package_build),
                                                               BRANCH: JSON.stringify(process.env.NODE_ENV.toLowerCase())
                                                              }
                                             })
                            ]
                  }

const fontsAndImages = {
                        module: {
                                 rules: [
                                         // embed small images and fonts as Data Urls and larger ones as files
                                         { test: /\.(png|gif|jpg)$/, loader: 'url-loader', options: { limit: 8192 } },
                                         { test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader', options: { limit: 10000, mimetype: 'application/font-woff2' } },
                                         { test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader', options: { limit: 10000, mimetype: 'application/font-woff' } },
                                         { test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' },
                                        ]
                                }
                       }

const generateIndexHtml = {
                           plugins: [
                                     new HtmlWebpackPlugin({
                                                            template: 'index.ejs',
                                                            chunksSortMode: 'dependency',
                                                            minify: ENV === 'prod' ? {
                                                                                removeComments: true,
                                                                                collapseWhitespace: true
                                                                                }
                                                                                : undefined,
                                                                                metadata:
                                                                                {
                                                                                title, ENV, isHMR
                                                                                }
                                                           })
                                    ]
                          }

const copyFiles = {
                   plugins: [
                             new CopyWebpackPlugin([
                                                    { from: 'favicon.png', to: 'favicon.png' },
                                                    { from: 'apple-touch-icon.png', to: 'apple-touch-icon.png' },
                                                    { from: 'manifest.json', to: 'manifest.json' },
                                                    { from: 'src/main.css', to: 'src/main.css' },
                                                    { from: 'images/**/*'},
                                                    { from: 'widget/**/*'},
                                                    { from: 'notifications-sw.js', to: 'notifications-sw.js' },
                                                   ])
                            ]
                  }

const config = merge(
                     base,
                     ENV === 'prod' || ENV === 'stage' || ENV === 'qa' || ENV === 'dev' ? production : local,
                     variables,
                     fontsAndImages,
                     generateIndexHtml,
                     ...(
                         ENV === 'prod' || ENV === 'stage' || ENV === 'qa' || ENV === 'dev' ? [copyFiles] : []
                        ),
                    )

module.exports = config;

Here is my app.ts:
import {AuthenticateStep} from 'aurelia-authentication';
import AppRoutes from './configs/routes';
import {inject} from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';
import {Router, RouterConfiguration, Redirect} from 'aurelia-router';
import {AppState} from './resources/global/appState';
import {NotificationsInit} from './libs/notificationsInit';

import './resources/global/less/base/base.less';
import './resources/global/less/layout/layout.less';

import '../kendo/styles/web/kendo.common.less';
import '../kendo/styles/web/kendo.common-material.less';
import '../kendo/styles/web/kendo.material.less';

import './components/nonAppHeader/nonAppHeader.less';

@inject(AppState, Router, EventAggregator)
export class App {
                  router: Router;
                  appState: any;
                  eventAggregator: any;

                  constructor(appState, router, eventAggregator)
                               {
                                this.router = router;
                                this.appState = appState;
                                this.eventAggregator = eventAggregator;

                                if (this.appState.isLoggedIn)
                                 {
                                  new NotificationsInit(this.appState, this.eventAggregator);
                                 }
                               }

                  configureRouter(config: RouterConfiguration, router: Router)
                                  {
                                   var step = {
                                     run: (navigationInstruction, next) => {

                                      if(this.appState.isLoggedIn === true)
                                       {
                                        if (this.appState.userInfo.status !== 9 && navigationInstruction.config.settings.admin === true)
                                         {
                                          return next.cancel(new Redirect('treks'));
                                         }
                                       }
                                      else if (navigationInstruction.config.settings.admin === true)
                                       {
                                        return next.cancel(new Redirect('/'));
                                       }

                                      return next();
                                     }
                                   };

                                   config.addPreRenderStep(step);
                                   config.title = 'My site';
                                   config.options.pushState = true;
                                   config.options.root = '/';
                                   config.addPipelineStep('postcomplete', PostCompleteStep);
                                   config.addPipelineStep('authorize', AuthenticateStep); // Add a route filter so only authenticated uses are authorized to access some routes

                                   config.map(AppRoutes["AppRoutes"]);

                                   config.mapUnknownRoutes(instruction => {

                                     window.dataLayer.push({
                                                            "event" : "404"
                                                           });

                                     return "application/404/404";
                                   });

                                   this.router = router;
                                  }
                  }

class PostCompleteStep {
                        run(routingContext,
                            next)
                            {
                             let metaInfoTmpl;

                             if (routingContext.config.moduleId !== "trek/trek/trek")
                              {
                                metaInfoTmpl = `<link rel="canonical" href="`+window.location.href+`" />
                                                <meta name="og:title" content="`+routingContext.config.title+` | Trekeffect">
                                                <meta name="og:site_name" content="`+routingContext.config.title+` | Trekeffect">
                                                <meta name="twitter:title" content="`+routingContext.config.title+` | Trekeffect">`;
                              }

                             if (routingContext.config.settings !== undefined)
                             {
                              if(routingContext.config.settings.metaDescription !== undefined)
                              {
                               metaInfoTmpl += `<meta name="description" content="`+routingContext.config.settings.metaDescription+`">
                                                 <meta name="og:description" content="`+routingContext.config.settings.metaDescription+`">
                                                 <meta name="twitter:description" content="`+routingContext.config.settings.metaDescription+`">`;
                              }

                              $('link[rel="canonical"], meta[name="og:title"], meta[name="og:site_name"], meta[name="twitter:title"], meta[name="description"], meta[name="og:description"], meta[name="twitter:description"]').remove();
                              $('head').append(metaInfoTmpl);
                             }

                             $(window).scrollTop(0);
                             $("body").removeClass().addClass(routingContext.config.name);

                             //Store the last visited url in local storage for Google Tag Manager
                             setTimeout(()=>{
                              localStorage.setItem("lastURL", window.location.pathname);
                             }, 2000);

                             //mt('send', 'pageview', {email: 'my@email.com', firstname: 'John'});

                             // window.dataLayer.push({
                             //  "event" : "aureliaPageView"
                             // });

                             //OfflinePluginRuntime.install();

                             return next();
                            }
                       }

And here is my the class that contains a few of my routes:
import {PLATFORM} from 'aurelia-pal';

export default {
                "AppRoutes" : [{
                                route: '',
                                name: 'homepage',
                                moduleId: PLATFORM.moduleName('application/homepage/homepage'),
                                title: 'lorem',
                                appPage: false,
                                settings: {
                                           "metaDescription" : "lorem"
                                          }
                               },
                               {
                                route: 'about',
                                name: 'about',
                                moduleId: PLATFORM.moduleName('application/about/about'),
                                title: 'About Us',
                                appPage: false,
                                settings: {
                                           "metaDescription" : "lorem."
                                          }
                               },
                               {
                                route: 'affiliates',
                                name: 'affiliates',
                                moduleId: PLATFORM.moduleName('integrations/affiliates/affiliates'),
                                title: 'Affiliates',
                                appPage: false
                               },

                              ]
               }

EDIT: When I add in moduleName I get this loader error:

UPDATE: When platform moduleName has the same ID, in this case 'story/stories/stories', the first route gets corrupt and throws a can't find module error.  How can we fix this?
{
                 route: 'stories',
                 name: 'stories',
                 moduleId: PLATFORM.moduleName('story/stories/stories', "featureStories"),
                 title: 'Featured Stories',
                 appPage: true,
                },
                {
                 route: 'stories/published',
                 name: 'storiesPublished',
                 moduleId: PLATFORM.moduleName('story/stories/stories', "stories"),
                 title: 'Published Stories',
                 appPage: true,
                },

A:
This was working well in webpack 2 with the commonchunks plugin.

From this remark I'm gonna assume you didn't split your routes inside your code but hard-coded some chunks repartition in your webpack 2 config instead.
Since that config is gone, there's no reason anything would be split anymore.
You should create split points when importing dependencies in your code by passing chunk names to moduleName.
For example:
{ route: 'admin', /* ... */, moduleId: PLATFORM.moduleName('./Pages/admin', /* chunk: */ 'admin') }

Reference:
https://github.com/aurelia/webpack-plugin/wiki/Managing-dependencies#code-splitting


text:
Q: Assign a return value in Task HttpClient Async to another variable I'm stuck at casting my return value in a Tast Async function to another variable.
           using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
            client.BaseAddress = new Uri("https://foo.com");
            await GetSecret(client);
        }
    }

    public static async Task<String> GetSecret(HttpClient client)
    {
        //JArray results = new JArray();
        string url = $"/strkey?api-version=2016-10-01";

        using (var httpResponse = await client.GetAsync(url))
        {
            httpResponse.EnsureSuccessStatusCode();
            string responsContent = await httpResponse.Content.ReadAsStringAsync();
            JObject password = JObject.Parse(responsContent);
            string ip = password["value"].ToString();
            return ip;
        }
    }

How can I assign the value of ip to out of the function? For example I want something like below:
public class objA
{
    public string key { get; set; }
    public objA(string ip)
    {
        key = ip;
    }
}

A: Because your await Task returns a string which is ip, you can just easily call to the previous method as below.
static async Task yourMethod(HttpClient client)
        {
            var obj = await GetSecret(client);
            Console.WriteLine(obj);
        }

A: declare a variable outside of the using scope where you call HttpClient
    public void MethodName()
    {
        var returnedIp = "";
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
            client.BaseAddress = new Uri("https://foo.com");
            returnedIp = await GetSecret(client);
        }
    }

As has been pointed out above in a comment, you should not use the HttpClient in the way you are, but I have answered your question with out a change to the code you are currently using


text:
Q: Kill method that is stuck via multithreading/multiprocessing I have a script that visits the website of a local weather station every hour and scrapes the current rainfall. This gets fed in my sprinkler server/database/etc. Sometimes there is a hiccup in the network connection or something on the side of the website. such an unfortunate makes the method hang indefinitely. This is not good for the stability of my program.
I've experimented with multiprocessing but I couldn't get it to work properly. Ideally it would launch the scraping module, and returns every second for a maximum of 10 so see if the method has stopped and produced an output. If the 10 sec is exceeded it should kill it and try the next hour.  How would you tackle this issue?
My current script is this:
from multiprocessing import Process,Queue,Pipe
import time
import requests
import urllib.request
from bs4 import BeautifulSoup

url = "https://www.weerstationzoersel.be/weather2/index.php?p=10"
def get_rain():
    try:
        response = requests.get(url)
        responsestr = str(response)
        if "200" in responsestr:
            soup = BeautifulSoup(response.text, "html.parser")
            tags = soup.findAll('span')
            line_rain = str(tags[15])
            line_rain = line_rain[62::]
            rainfall = line_rain.rstrip("")
            rainfall = round(float(rainfall.replace(',','.')),1)
    except:
        rainfall="error"
    return(rainfall)

if __name__ == '__main__':
    print(get_rain())

A: The multiprocessing.pool.Pool class has the apply_async method that returns an AsyncResult object on which you can issue a get call to block for the return value. This method allows you to specify an optional timeout value such that if the task does not complete and has a result for you within the specified number of seconds a TimeoutError exception is thrown. However, the process in the pool is still continuing to run the submitted task. This no problem; you simply terminate the pool and all of its running processes.
Note that I modified get_rain to return the actual Exception object rather than the string "error" if an exception occurs:
from multiprocessing import Pool, TimeoutError
import requests
from bs4 import BeautifulSoup

def get_rain_worker():
    url = "https://www.weerstationzoersel.be/weather2/index.php?p=10"
    try:
        response = requests.get(url)
        # throw exception if error:
        response.raise_for_status()
        soup = BeautifulSoup(response.text, "html.parser")
        tags = soup.findAll('span')
        line_rain = str(tags[15])
        line_rain = line_rain[62::]
        rainfall = line_rain.rstrip("")
        rainfall = round(float(rainfall.replace(',','.')),1)
    except Exception as e:
        # return the exception:
        rainfall = e
    return rainfall

def get_rain():
    # We just want a pool size of 1,
    # which will be automatically terminated at the end of the with block
    with Pool(1) as pool:
        async_result = pool.apply_async(get_rain_worker)
        try:
            # timeout after 10 seconds:
            rainfall = async_result.get(10)
        except TimeoutError as e:
            rainfall = e
    return rainfall

if __name__ == '__main__':
    rainfall = get_rain()
    if isinstance(rainfall, Exception):
        print('Got exception:', rainfall)
    else:
        print('rainfall = ', rainfall)

Prints:
rainfall =  0.0

A Simpler Approach?
I would think, however, that the only hang-up would be on doing the GET request, which does take an optional timeout argument. In fact, it is recommended that this argument be specified for all production code. So the following code may be sufficient for your needs:
import requests
from bs4 import BeautifulSoup

def get_rain():
    url = "https://www.weerstationzoersel.be/weather2/index.php?p=10"
    try:
        response = requests.get(url, timeout=10)
        # throw exception if error:
        response.raise_for_status()
        soup = BeautifulSoup(response.text, "html.parser")
        tags = soup.findAll('span')
        line_rain = str(tags[15])
        line_rain = line_rain[62::]
        rainfall = line_rain.rstrip("")
        rainfall = round(float(rainfall.replace(',','.')),1)
    except Exception as e:
        # return the exception:
        rainfall = e
    return rainfall

if __name__ == '__main__':
    rainfall = get_rain()
    if isinstance(rainfall, Exception):
        print('Got exception:', rainfall)
    else:
        print('rainfall = ', rainfall)

A: It might work to set a signal alarm to go off if the connection hangs for too long. Something like this:
import signal

def timeout():
    raise TimeoutError

signal.signal(signal.SIGALRM, timeout)
signal.setitimer(signal.ITIMER_REAL, 10)

followed by your existing try block. If the get() doesn't complete in 10 seconds, your try block will get a TimeoutError exception.
If you do complete the get() you can call setitimer() with a seconds count of 0 to remove the previous timer.


text:
Q: Set-up GRASS for use in QGIS 3.10 with Mac OS X I want to use GRASS 7.6 with QGIS 3.10 installed on my Mac (10.13 - High Sierra).
I have installed QGIS 3.10 for Mac via this link : https://qgis.org/en/site/forusers/download.html
I have installed GRASS 7.6 for Mac via this link : http://grassmac.wikidot.com/downloads
QGIS and GRASS both work separately, however when I am unable to use GRASS via QGIS. After activating the plugin in QGIS, I do not have access to any of the features (New Mapset, Open Mapset, etc.). Accessing at Plugins > GRASS > GRASS Options > General, I get the following error message :
Currently selected GRASS installation is not valid

I have the application located in my Applications directory.

What are the steps that I should do to be able to use GRASS via QGIS?

A: They announced in the QGIS github (see issue : https://github.com/qgis/QGIS/issues/34721#issuecomment-592090316) that the plugin was abandoned and that GRASS should be used directly via Processing > Toolbox > GRASS


text:
Q: Unhandled event loop exception, No more handles I've been trying to set up Eclipse Kepler on Windows 7 (64-bit). When I start up and load my workspace I'm greeted with a lovely Problem Occured message saying Unhandled event loop exception. No more handles. It then prompts me asking if I want to close eclipse saying  an SWT error has occurred. I have no calls to SWT in my code as I'm just doing a simple recursion assignment. In fact, even if I start a brand new class with no code in it, clicking into the code to edit it triggers the error. I've also tried updating to Eclipse Luna, uninstalling and reinstalling Eclipse Kepler, and making the default editor WindowBuilder as suggested at Eclipse Bug: Unhandled event loop exception No more handles but nothing has worked. Below is my exception stack trace
org.eclipse.swt.SWTError: No more handles
    at org.eclipse.swt.SWT.error(SWT.java:4467)
    at org.eclipse.swt.SWT.error(SWT.java:4356)
    at org.eclipse.swt.SWT.error(SWT.java:4327)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:476)
    at org.eclipse.swt.widgets.Control.createHandle(Control.java:703)
    at org.eclipse.swt.widgets.Label.createHandle(Label.java:199)
    at org.eclipse.swt.widgets.Control.createWidget(Control.java:743)
    at org.eclipse.swt.widgets.Control.<init>(Control.java:111)
    at org.eclipse.swt.widgets.Label.<init>(Label.java:101)
    at org.eclipse.ui.texteditor.StatusLineContributionItem.fill(StatusLineContributionItem.java:182)
    at org.eclipse.jface.action.SubContributionItem.fill(SubContributionItem.java:61)
    at org.eclipse.jface.action.StatusLineManager.update(StatusLineManager.java:345)
    at org.eclipse.ui.internal.WorkbenchPage.updateActivations(WorkbenchPage.java:309)
    at org.eclipse.ui.internal.WorkbenchPage.access$17(WorkbenchPage.java:287)
    at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:209)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$3.run(PartServiceImpl.java:236)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:233)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:684)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:615)
    at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:106)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:61)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
    at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1453)
    at org.eclipse.swt.widgets.Shell.WM_MOUSEACTIVATE(Shell.java:2334)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4654)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
    at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:79)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036)
    at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:3141)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

A: I figured it out. I had to update Windows 7


text:
Q: Komodo Edit shortcuts on Mac? I am trying to find some shortcuts for Komo Edit on Mac. How do i set up the traditional cmd+i to invoke file/folder properties? Also, i cant seem to figure out the shortcut for "Show in Finder". Any tips about the shortcuts will be helpful. I am using v7.1 and python3.2 with OSX 10.7.3

A: The OSX Keybindings are documented. Use the Key Bindings menu to redefine the defaults.


text:
Q: How to add an arrow (pointer image) to box plot in R? I'm working on box plot using R. I have already plotted one boxplot and now i need to put a pointer somewhere on box plot?
 input<-c(1,2,3,4,5)
 boxplot(input)

How to import or design an arrow image at position 1.5 on boxplot?

A: To place a single image on a graph look at the rasterImage function.  If you want to put multiple images on the graph (possibly using them as plotting points) then the my.symbols and ms.image functions in the TeachingDemos package may be helpful.