text:
Q: Does it affect the performance, if a table holds a lot of unused/unselected columns? Background:
I have a table called cars that holds a lot of used cars, aprox 1 million rows. The table has a little more than 170 columns. The table is indexed on individual columns alone. Most of the columns are booleans (e.g. has_automatic_gearbox etc.) and the rest is strings and numbers (e.g. color and price). The cars are shown in a view, where i use around 80 columns out of the total 170.
My question:
So my question is, does it make a difference to the performance, whether I select only the 80 columns out of the table when doing a search, or on the other hand I made a new table ONLY consisting of those 80 columns that I need, instead of the total 170 columns? So in other words, does it make a difference to performance, that a table holds columns, that is not selected?

A: Andomar is correct in his comment that "it depends". However, if you question is something like this:

Can the number of columns in a table have an effect upon select queries?

Then the answer is YES. Whether or not they're "extra" or "unused" is a question of database design, and doesn't have anything to do with the question of performance.
All other things being equal, a row in a table with 100 columns is going to take up more space than a row in a table with 10 columns. Because the rows will be larger, your server will have to work (relatively) harder to go over an equal number of rows in the wider table than in the smaller table.
Things like page splitting will also occur more often in tables whose rows take up more space.
If your question is (and I think this might be more along the lines of what you're asking)

Would, all things being equal, a select query pulling 80 columns from a table with 170 columns be slower than a query pulling 80 columns from a table with 80 columns?

Then the answer should be NO.

A: Also you may want to read the answers to a similar question on dba.SE:

Do the number of columns in a particular table affect the performance
of a query, when querying on a subset of that table?

In short: yes it does, because the non-selected columns generally live in the same disk blocks than the selected columns, so they're going to be read anyway.

A: Most of the attributes of your 1E6 cars will probably depend on some hidden factor, such as  {brand,model,make,model_version}. You could queeze out these attributes into a separate table, and refer to that table in your main cars table. In the ultimate case, your main cars table will only contain attributes that belong to the particular instance of a car model (eg: {number, price, build_date, buy_date, (maybe) colour}.)


text:
Q: Ubuntu on a SSD and everything else on a HDD So I am looking into the future on getting a new computer, one with a 1TB Hard Disk Drive for everything and a Solid State Drive STRICTLY for Ubuntu, I did some research and found out that you have to move each program every time you install it or another one.
I know that in Microsoft Windows you can put the OS on a Solid State Drive and everything else on a Hard Disk Drive (I believe the user files to). I am not aware what Ubuntu's "Programs File(x86)/Programs File x64" equivalent is since it... well does not seem to have one.
I use Steam with a library of 2 to 4 games, 10+ virtual Boxes, a bunch of different programs, including Wine. Wile keeping the Solid State Drive all to Ubuntu (since the OS is read-only, I figured this would work well on a Solid State Drive without wear and tear off the Drive.) So how would I set something like this up? Even for guest users and other users.
And how to install the OS properly to the computer to have the following confuration?
P.S. What do people call that when you have a Solid State Drive as your OS Drive and a Hard Disk Drive as your storage?

A: I have a SSD with with Sheerly Ubuntu and a 1TD HDD set up as a network share on my desko. I haven't had any issues with this setup so far.
The Equivalent to the Program files in Ubuntu is the /etc folder so you would need to format a disk with a mount point of /etc and the system would put that folder there to r/w from.
for you I would recommend putting your /home and /etc on an the separate drive. Also I don't think it's really called anything, You just DO that with your hard drives windows or linux. both user groups do it

A: Choose the "something else"  option off the installer and create the appreciate mount points on each of your disks

redpajama_set_name: RedPajamaStackExchange


text:
Q: Office365 push notification API error: verification failed because the response body I am referring to o365 API documentation for adding push notification of calendar event. I am getting below error-
Post>>
array:4 [▼
  "@odata.type" => "#Microsoft.OutlookServices.PushSubscription"
  "Resource" => "https://outlook.office.com/api/v2.0/me/events"
  "NotificationURL" => "https://mywebsite.com/notifications"
  "ChangeType" => "Created,Updated"
]
Response>>
"{"error":{"code":"ErrorInvalidParameter","message":"Notification URL 'https://mywebsite.com/notifications?validationtoken=ODFkNDllYWEtMmExYi00NDVjLWJmNzUtOTBhZjg3MDAyNjhh' verification failed because the response body '\tsuccess\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000' is unexpected."}} ◀"

My code is as-
$post_data = [          "@odata.type"=> "#Microsoft.OutlookServices.PushSubscription",
   "Resource"=>  "https://outlook.office.com/api/v2.0/me/events",
   "NotificationURL"=>  'https://mywebsite.com/notification',
   "ChangeType"=>  "Created,Updated",
  // "expirationDateTime"=>  "2018-05-09T18:23:45.9356913Z",
  // "clientState"=> "testClientState"

  ];
   $curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://outlook.office.com/api/v2.0/me/subscriptions",
    //CURLOPT_URL => "https://graph.microsoft.com/beta/subscriptions",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => json_encode($post_data),
    CURLOPT_HTTPHEADER => array(
        // Set Here Your Requesred Headers
        'Authorization: Bearer '.TOKEN,
        'Content-Type: application/json',
        'X-CSRF-TOKEN: TOKEN-XXXXX'

    ),
));

How can I resolve the error?
Thanks in advance.

A: Your notification endpoint must respond to a validation POST in a very specific way. Your response doesn't match that way, so the validation is failing.
From https://developer.microsoft.com/en-us/graph/docs/concepts/webhooks:
Microsoft Graph validates the notification URL in a subscription request before creating the subscription. The validation process occurs as follows:

*

*Microsoft Graph sends a POST request to the notification URL:
POST https://{notificationUrl}?validationToken={TokenDefinedByMicrosoftGraph}
ClientState: {Data sent in ClientState value in subscription request (if any)}

*The client must provide a response with the following characteristics within 10 seconds:

*

*A 200 (OK) status code.

*The content type must be text/plain.

*The body must include the validation token provided by Microsoft Graph.

The client should discard the validation token after providing it in the response.


text:
Q: What means Into in Rust? I'm reading this piece of code:
pub fn ip_addrs<T>(mut self, ip_addrs: T) -> Self
        where T: Into<ManagedSlice<'c, IpCidr>>
    {

T must be of type Into. However, I cannot understand what Into does by reading its definition. Can somebody explain?

A: From and Into are two traits specifying protocols for converting between types (without failure). That is if A implements Into<B>, you can always convert an A to a B and it will never fail.
Here it's used such that you can give this function anything which is convertible to a ManagedSlice.


text:
Q: Set JComboBox height I'm not able to set the height of a JComboBox, I searched in the web but didn't found the right answer.
As you can see from the image below the combo box fills nearly all the panel height and I'd like it to have a smaller height.
I tried setting size with getPreferredSize() method but it didn't work, it worked only for other components like the button.

My code
  private JComponent firstPanel()
  {
        JPanel panel = new JPanel();

    panel.setLayout(new BorderLayout());
    JLabel spesaAnnuaSingola = new JLabel();
    spesaAnnuaSingola.setText("Spesa Annua Singola");
    panel.add(spesaAnnuaSingola, BorderLayout.NORTH);

    JComboBox<String> listaSpese = new JComboBox<String>();
    panel.add(listaSpese, BorderLayout.CENTER);

    JTextField speseAnnuaSingolaTF = new JTextField();
    speseAnnuaSingolaTF.setText("");
    speseAnnuaSingolaTF.setEditable(false);
    panel.add(speseAnnuaSingolaTF, BorderLayout.LINE_START);

    JButton button = new JButton("CALCOLA")
    {
           public Dimension getPreferredSize()
           {
                  return new Dimension(150,50);
            };
    };

    JPanel leftflowpanel = new JPanel( new FlowLayout(FlowLayout.LEFT) );
    leftflowpanel.add(speseAnnuaSingolaTF);
    panel.add(leftflowpanel, BorderLayout.SOUTH);

    JPanel rightflowpanel = new JPanel( new FlowLayout(FlowLayout.RIGHT) );
    rightflowpanel.add(button);
    panel.add(rightflowpanel, BorderLayout.SOUTH);

    return panel;
}

And then:
public StatsPanel()
{
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      this.setExtendedState(JFrame.MAXIMIZED_BOTH);
      GridBagConstraints c = new GridBagConstraints();
      // I will need a grid layout
      this.setLayout(new GridLayout(1, 1, 30, 30));
      JPanel panelLeft = new JPanel(new BorderLayout());
      panelLeft.setBorder(BorderFactory.createEmptyBorder(20, 10, 20, 50));
      panelLeft.add(firstPanel(), BorderLayout.NORTH);

      c.fill = GridBagConstraints.VERTICAL;
      c.gridx = 0;
      c.gridy = 0;
      this.add(panelLeft);
  }

A: JComboBox<String> listaSpese = new JComboBox<String>();
panel.add(listaSpese, BorderLayout.CENTER);

You add your combo box to the CENTER of the BorderLayout, which gets all the extra space of the frame. Don't add the combo box to the CENTER.
Instead you will need to nest panels. So create a panel for the NORTH of the BorderLayout. Then this panel will contain both your label and your combo box. Maybe use a vertical BoxLayout for this panel. Then both the label and the combo box will be displayed at their preferred heights.
Read the section from the Swing on Layout Manager for more information. The point is you can nest multiple panels each using a different layout to achieve your desired layout.


text:
Q: Custom AppBarButton and AppBarToggleButton in Windows Apps I'm trying to create a custom an AppBarButton and an AppBarToggleButton in my Windows app. In the design view in Visual Studio I created a custom style that I applied to my button like so:
<Page.Resources>
    <Style x:Key="NewAppBarStyle" TargetType="AppBarToggleButton">
    (...)
    </Style>
</Page.Resources>

<AppBarToggleButton Icon="Stop" Label="Style" Style="{StaticResource NewAppBarStyle}" />

And in that view everything works fine. However, everytime I check the app in the phone, the result is not what I expected. Here are some pics:

I'm not sure why this happens and it would be a great help if someone could explain me why and how can I in fact create a custom AppBarButton.
Default style for the AppBarButton and AppBarToggleButton.
You can find a project to test this here: http://1drv.ms/1OdhBwX


text:
Q: How To Check If A Visual Studio Extension Is Safe Is there a way to examine a Visual Studio Extension before installing to see if it is safe?

A: There isn't an in-built way to check if an extension is non-malicious. However if this is something you are worried about then there are quite a few extensions built off of proven open-source packages.
You can also download the extension and then extract the .VSIX file to look at some of the source code for the extension.
Bearing in mind that the main attack vector would be a malicious or compromised extension dev (as all extensions are signed). Open-source, well-proven packages from reputable devs are the way to go. This is normally a requirement in secure development environments.


text:
Q: Какие виды или алгоритмы комбинированного обучения существуют? Нашел слайд, где говорится, что способы обучения  в компьютерных системах делятся на:

*

*Дедуктивное, или аналитическое, обучение (экспертные системы).
Имеются знания, сформулированные экспертом и как-то формализованные.
Программа выводит из этих правил конкретные факты иновые правила.

*Индуктивное обучение (статистическое обучение). На основе
эмпирических данных программа строит общее правило. Эмпирические
данные могут быть получены самой программой в предыдущие сеансы ее
работы или просто предъявлены ей.

*Комбинированное обучение.
Приведите пожалуйста виды и алгоритмы комбинированного обучения.

A: Я нашел неплохое описание. И оно (кажется) сделано с помощью манинного переовда. Но можно посмотреть и оригинал.
Выбор алгоритмов машинного обучения Microsoft Azure
Памятка по алгоритмам машинного обучения
https://docs.microsoft.com/ru-ru/azure/machine-learning/studio/algorithm-choice
25.04.2017 Время чтения: 29 мин
Коротко, с иллюстрациями графиков.
С наилучшими.


text:
Q: How to set up webpack/babel with vue3 app in existing web application We have an asp.net web application in which we've used babel for the last couple of years for minifying and transpiling our javascript files.  Here's the webpack.config.js file as I currently have it trying to work in vue compilation.
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const { VueLoaderPlugin } = require('vue-loader');

module.exports = {
    optimization: {
        minimizer: [
            new TerserPlugin({
                terserOptions: {
                    ecma: undefined,
                    warnings: false,
                    parse: {},
                    compress: {},
                    mangle: true, // Note `mangle.properties` is `false` by default.
                    module: false,
                    output: null,
                    toplevel: false,
                    nameCache: null,
                    ie8: false,
                    keep_classnames: undefined,
                    keep_fnames: true,
                    safari10: false,
                },
            }),
        ],
    },
    entry: {
        translate: ["@babel/polyfill", "./Scripts/es6/translate.js"],
        setupForm: ["./Scripts/es6/setupForm.js"],
        signup: ["./Scripts/es6/signup-script.js"],
        client: ["./Vue/src/index.js"]
    },
    output: {
        filename: '[name].js',
        path: path.resolve(__dirname, './Scripts/build'),
    },
    module: {
        rules: [
            {
                test: /\.vue$/,
                loader: 'vue-loader'
            },
            {
                loader: 'babel-loader',
                test: /\.js$/,
                exclude: /node_modules/
            }]
    },
    plugins: [
        new VueLoaderPlugin()
    ]
}

We started a new vue3 app using vite that we want to pull into our existing .net web app.  So, the folder structure now looks like
Root
    Controllers
    Views
    packages.json
    vue.config.js
    webpack.config.js
    Vue
        src
            index.html
            index.js
        vite.config.js

I've been googling quite a bit on how to do this but can't find a straightforward solution as to what needs to go into our packages.json file, the vue.config.js and webpack.config.js to get this to work.  I can run the app fine using vite, but it's the whole build process we're trying to get working where we can specify where we want the compiled vue files to be placed and how to compile them in the first place with webpack/babel.
Here's our current packages.json
{
  "name": "webapp",
  "version": "1.0.0",
  "description": "",
  "main": "map_embed.js",
  "directories": {
    "doc": "docs"
  },
  "scripts": {
    "build": "webpack",
    "build-vue": "vue-cli-service build",
    "dev": "vite --config Vue/vite.config.js Vue/src"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.2.0",
    "@fortawesome/free-solid-svg-icons": "^6.2.0",
    "@fortawesome/vue-fontawesome": "^3.0.1",
    "@vue/compiler-sfc": "^3.2.41",
    "axios": "^0.25.0",
    "core-js": "^3.20.3",
    "npm-run-all": "^4.1.5",
    "vue": "^3.2.41",
    "vue-router": "4.0.5",
    "vuex": "4.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.16.12",
    "@babel/polyfill": "^7.4.4",
    "@babel/preset-env": "^7.16.11",
    "@vue/cli-plugin-babel": "^5.0.1",
    "@vue/cli-service": "^5.0.1",
    "babel-loader": "^8.2.3",
    "node-sass": "^7.0.1",
    "sass-loader": "^12.4.0",
    "terser-webpack-plugin": "^5.3.0",
    "vue-template-compiler": "^2.6.14",
    "webpack": "^5.69.1",
    "webpack-cli": "^4.9.2",
    "@vitejs/plugin-vue": "^3.2.0",
    "vite": "^3.2.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

And when we build our visual studio project, we have this in the build events which calls the webpack script to do the transformations.
if $(ConfigurationName) == Debug npm run build --prefix $(ProjectDir)

Building the app now results in errors like the following.  It mentions You may need an additional loader to handle the result of these loaders but I don't know what loaders we might need.
assets by status 353 KiB [1m[32m[cached][39m[22m 7 assets
5>  orphan modules 1.59 MiB [1m[33m[orphan][39m[22m 44 modules
5>  runtime modules 221 bytes 1 module
5>  modules by path [1m./node_modules/@babel/polyfill/node_modules/core-js/modules/*.js[39m[22m 190 KiB 273 modules
5>  modules by path [1m./node_modules/@babel/polyfill/node_modules/core-js/library/[39m[22m 6.43 KiB 18 modules
5>  modules by path [1m./node_modules/@babel/polyfill/node_modules/core-js/fn/[39m[22m 1.29 KiB 11 modules
5>  modules by path [1m./Scripts/es6/*.js[39m[22m 105 KiB
5>    [1m./Scripts/es6/translate.js[39m[22m 1 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
5>    + 5 modules
5>  modules by path [1m./Vue/src/[39m[22m 1.59 MiB
5>    [1m./Vue/src/index.js + 41 modules[39m[22m 1.59 MiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
5>    + 3 modules
5>  modules by path [1m./node_modules/@babel/polyfill/lib/*.js[39m[22m 1.22 KiB
5>    [1m./node_modules/@babel/polyfill/lib/index.js[39m[22m 686 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
5>    [1m./node_modules/@babel/polyfill/lib/noConflict.js[39m[22m 567 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
5>  + 4 modules
5>
5>  [1m[33mWARNING[39m[22m in [1mconfiguration
5>  The [1m[31m'mode' option has not been set[39m[22m[1m, webpack will fallback to 'production' for this value.
5>  [1m[32mSet 'mode' option to 'development' or 'production'[39m[22m[1m to enable defaults for each environment.
5>  You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/[39m[22m
5>
5>  [1m[31mERROR[39m[22m in [1m./Vue/src/Components/UI/Card.vue?vue&type=style&index=0&id=4ece4234&scoped=true&lang=css[39m[22m (./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[4].use[0]!./Vue/src/Components/UI/Card.vue?vue&type=style&index=0&id=4ece4234&scoped=true&lang=css) [1m[32m2:0[39m[22m
5>  [1mModule parse [1m[31mfailed[39m[22m[1m: [1m[31mUnexpected[39m[22m[1m token (2:0)
5>  File was processed with these loaders:
5>   * ./node_modules/vue-loader/dist/index.js
5>  You may need an additional loader to handle the result of these loaders.
5>  |
5>  > .card {
5>  |   border-radius: 2px;
5>  |   transition: 0.2s;[39m[22m
5>   @ ./Vue/src/Components/UI/Card.vue?vue&type=style&index=0&id=4ece4234&scoped=true&lang=css 1:0-173 1:0-173 1:174-336 1:174-336
5>   @ ./Vue/src/Components/UI/Card.vue 5:0-75
5>   @ ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[4].use[0]!./Vue/src/Components/Quotes/Quotes.vue?vue&type=script&lang=js 1:0-34 8:4-8
5>   @ ./Vue/src/Components/Quotes/Quotes.vue?vue&type=script&lang=js 1:0-194 1:0-194 1:195-378 1:195-378
5>   @ ./Vue/src/Components/Quotes/Quotes.vue 2:0-57 3:0-52 3:0-52 6:49-55
5>   @ ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[4].use[0]!./Vue/src/App.vue?vue&type=script&lang=js 1:0-52 4:4-10
5>   @ ./Vue/src/App.vue?vue&type=script&lang=js 1:0-179 1:0-179 1:180-348 1:180-348
5>   @ ./Vue/src/App.vue 2:0-54 3:0-49 3:0-49 6:49-55
5>   @ ./Vue/src/index.js 2:0-28 15:22-25


text:
Q: Problem with gem loading I struggle to have gems correctly loading in a Snow Leopard environment. I installed ruby and rubygems in '/usr/local' (from http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/ instructions), I installed some gems with 'gem install gem-name'.
I correctly see the gem list:
$ gem list

*** LOCAL GEMS ***
chrisjpowers-iterm_window (0.3.2)
gemcutter (0.3.0)

I can see the gems correctly installed:
$ ls /usr/local/lib/ruby/gems/1.8/gems/
chrisjpowers-iterm_window-0.3.2
gemcutter-0.3.0

And the gem path correctly defined:
$ gem env path
/usr/local/lib/ruby/gems/1.8

And I defined various paths in my bash profile:
$ cat ~/.bash_profile

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
export GEM_HOME="/usr/local/lib/ruby/gems/1.8"
export GEM_PATH="/usr/local/lib/ruby/gems/1.8"
export RUBY_LIB="/usr/local/lib/ruby:/usr/local/lib/ruby/site_ruby"

However when I run the following script
#!/usr/local/bin/ruby

require 'rubygems'
require 'chrisjpowers-iterm_window'

I get the following error
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- chrisjpowers-iterm_window (LoadError)
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/local/bin/sp:4

I have no idea how to fix it, any help would be greatly appreciated :)

A: You're requiring the wrong lib name.  The gem is named chrisjpowers-iterm_window because of GitHub namespacing, but the library is named iterm_window:
require 'rubygems'
require 'iterm_window'

The lib path differs from the gem path.  The gem path is where the gems are installed, but the lib path contains the lib directory of every installed gem after rubygems is loaded.  You should see an iterm_window.rb inside the lib directory of that gem.


text:
Q: ENQUEUE Script directly rather then registering first How does registering a stylesheet then enqueue-ing it differ from directly enqueue-ing it?
Here I registered then enqueued.
    function calling_script(){
    wp_register_style('bootstrap', get_template_uri(). `enter code here`'/css/bootstrap.min.css',array(),'1.0.0', 'all');
    wp_enqueue_style('bootstrap');
    wp_register_style('style', get_template_uri(). '/css/style.css',array(),'1.0.0', 'all');
    wp_enqueue_style('style');

}
add_action('wp_enqueue_style','calling_script');

Here I enqueued directly:
function calling_resources(){
    //Calling Styles
    wp_enqueue_style('style',get_stylesheet_uri(),'','1.0.0');
    wp_enqueue_style('comment_style',get_template_directory_uri().'/css/comments.css','','1.0.0');
    wp_enqueue_style('404 style',get_template_directory_uri().'/css/style-404.css','','1.0.0');

}
add_action('wp_enqueue_scripts','calling_resources');

Both work the same. But I saw many experts doing in these two different ways.

A: wp_register_style :-
This means, if you want to register your scripts, but not directly load them in your pages, you can register the files once, and then load them when you need them.
wp_enque_style :-
It helps you load the script


text: Q: How to find a sum $10\log_{10}{\frac{A}{1}} + 10\log_{10}{\frac{B}{1}}$ in not log scale. It is kind a school question, but I don't see it. For example, we have 150 [mW] and 200 [mW], in log scale it is equal to $10\log_{10}{\frac{150}{1}} = 21.76 [dBm] $ and $10\log_{10}{\frac{200}{1}} = 23.01 [dBm]$. I need to find a sum of $150 [mW] + 200 [mW] = 350 [mW]$ but in log scale using $21.76 [dBm] + 23.01  [dBm] = 25.44 [dBm]$. It is important because mostly values from -50 [dBm] to -150 [dBm] are used, which are small values on normal scale.


text:
Q: How to check if a Google PubSub subscription got created after its context has been cancelled During a Google PubSub CreateSubscription the context gets cancelled. This results in the CreateSubcription function returning the following error: rpc error: code = Canceled desc = context canceled
Most of the time the Subscription will still get created, but sometimes (although I have yet to see it happen) it may not, depending on at what point the Context got cancelled.
What I want to do is delete any potential subscription that may have been created.
My current solution is to try and create the Subscription again, with a new Context and PubSub Client. It will either create, or return an error, if the Subscription already exists.
Another solution is to poll to see if the Subscription exists via the PubSub subscription Exists function, and if it exists then delete it, or if after a set amount of time it does not exist then assume the subscription never got created.
Both ideas don't seem that good, is there a more idiomatic way of achieving this?


text:
Q: How to get the actual current user in Cygwin when "run as administrator"? Basically the cygwin CLI (or bash in particular, if that helps) equivalent of this question.  I want to start cygwin as administrator, but then get my name, not the administrator's name, somehow.  (All the environment variables like $USER, $USERNAME, etc. get set to the administrator.)
This could include any utility that comes with Windows, but it has to come with all editions, not just Pro.

A: realCurrentUser=$(wmic PATH Win32_Process WHERE "Name='explorer.exe' AND SessionId=1" CALL GetOwner | grep User | sed 's/^\s*User = "//' | sed 's/";$//')


text:
Q: Letter E gets cut off when sending a WS message I am having the weirdest bug. (Which probably has a perfectly logical explanation)
I am sending a connection message to Bitfinex platform. It is this:
ws.send(json.dumps({
    "event": "subscribe",
    "channel": "ticker",
    "pair": PAIR,
    }))

The PAIR variable is a pair of traded elements e.g. "EURUSD", "BTCEUR"...
The fun part is that this websocket request works perfectly with all strings EXCEPT for ones that begin with "E". One of the example responses I get with a string starting in E is this:

{"channel":"ticker","pair":"URBTC","event":"error","symbol":"EURBTC","msg":"symbol:
  invalid","code":10300}

notice the "pair" having "E" cut off, while "symbol" has the correct value. I have tried appending an extra string to the "pair" and adding an extra "symbol" element. None of that worked. I also tried encoding the string in ascii and utf-8, but that did nothing.
Anyone has any idea what this is?
P.S. this is an example of a positive response:

{"event":"subscribed","channel":"ticker","chanId":9226,"symbol":"tBTCEUR","pair":"BTCEUR"}


text:
Q: If statement with multiple arguments not being met I am creating an account system which logs the user in if the correct credentials have been used. Currently my code is the following
    n=0
    for row in StaffAccounts:
        potential_user = StaffAccounts[n]
        n=n+1
        potential_user2 = potential_user.split(',')
        if stop:
            print ("fail")
            break
        elif potential_user2[0] == staff_idv2 and potential_user2[1] == staff_passv2:
            print ("Success")

StaffAccounts is array which holds the user's username and password. potential_user then copies a row out of StaffAccounts (thus copying the username and password for one user), whilst potential_user2 splits this string into 2 seperate elements so that it is stored like this [username, password] rather than this [usernamepassword]
Test Data:
staff_idv2 = "Dominic"
staff_passv2 = "Dom123"
The condition should be met when staff_idv2 and staff_passv2 find their correspondents within potential_username2. However, this does not occur. The condition simply does not get met.
Here is a screenshot of what the text file array StaffAccounts looks like
https://gyazo.com/022cb37d34220e3155f85c451da8836c


text:
Q: Collect Instagram Followers Good evening everyone. I'm supposed to teach a data processing course for high school students. The course is based on data extracted from Instagram. There are several tools in python, R etc. that I could use to extract data from Instagram. But I'd like the students to do that, and the course is too short to introduce languages like these I mentioned. Furthermore, students come from different fields and may not have sufficient technical knowledge to follow a programming course. A (free) web collector of Instragram followers where it is possible to search for the user and then click on "download" to scrape their followers (if any) might be a good solution for these students. Do you know similar tools?
Thank you in advance.

A: I'm not sure we are the correct platform for this question but you have this chrome extension and detailed explanation here How to Export Instagram Followers to Excel
Video description has all the steps:
"1.    You'll need to have Google Chrome installed, just follow the instructions on their website.
With Chrome installed, either search for Helper Tools for Instagram or go to this link:
https://chrome.google.com/webstore/de....
Then click Add to Chrome.

*Go to the Instagram page you wish to export a list of followers and click the new icon in the top-right to open the Helper Tools.

*In this case we want just the followers, so change the box from All to Followers and then click Get List of Users.

*Make sure you have ample time to generate the list as it can take hours if there are many followers. "

A: You can scrape/collect any instagram followers of any account in this web. Just create account and try for free. https://phantombuster.com/automations/instagram/7175/instagram-follower-collector


text:
Q: How to return a JSON list in the following format I am using the bubble.io plugin builder. To return a response under bubble.io's api connector, all parameters returned must have the prefix "p". In the following case, this returns the correct results for an api call.
const options = {
    url: url
    ,method: method
    ,headers: {
        "Content-Type": "application/json"
    }
}
const response = context.request(options);
    console.log(response);

/*

The model we will use
{
  "mins": 5,
  "price": "34823.91104827"
}

*/

var body = JSON.parse(response.body);

const {convert} = require('json-to-bubble-object');

let returnlist = []
returnlist.push(     {
  "_p_mins": body.mins.toString(),
  "_p_price": body.price,
  "_p_api_response": JSON.stringify(convert(body))

})

    return {
        "result": returnlist

    }

This call generates the following response:
_p_api_response: "{"_p_mins":5,"_p_price":"36703.73207769"}"
_p_mins: "5"
_p_price: "36703.73207769"

What I am trying to do is use the module 'json-to-bubble-object' as returned in the _p_api_response parameter (which is a test parameter and is not actually needed) to return the data. This makes my call dynamic so I don't have to manually specify the parameters for each different api call.
Hence, I am trying to make the API call look something like this:
var body = JSON.parse(response.body);

const {convert} = require('json-to-bubble-object');

let returnlist = []
returnlist.push(     JSON.stringify(convert(body))

)

    return {
        "result": returnlist

    }

but this returns null results
_p_api_response: null
_p_mins: null
_p_price: null

can someone let me know how I can return the data generated from the convert function as a list as done in the first request? Thanks
EDIT: For clarification, the p prefix allows the response headers to be viewed in the bubble.io builder, as seen in the below image.

A: I dont have enough reputation to comment but
I am unable to repro your problem.
You can view my repro here:
https://runkit.com/runkitname/so-a-nodejs
const {convert} = require('json-to-bubble-object');

var body = {
    "mins": 5,
    "price": "34823.91104827"
}

body.api_response = JSON.stringify(convert(body))

let returnlist = []
returnlist.push(convert(body))

console.log({"result": returnlist})

console
{
  result: [
    {
      _p_mins: 5,
      _p_price: '34823.91104827',
      _p_api_response: '{"_p_mins":5,"_p_price":"34823.91104827"}'
    }
  ]
}


text:
Q: admin login problem ? when I login to admin panel it's successfully login but  login screen remain same ,does not redirect to dashboard show proper URL ( like that admin/admin/dashboard/).
I want to know why this happen , it redirect to dashboard when i click to url /refresh

A: Try clearing cache/session
Try incognito /private browsing
Check logs
What recent changes have been made?

A: I would recommend to check if there is a value set for the cookie domain in the configuration. Database table: core_config and than search for path like %cookie% . The cookie domain is probably referring to a different domain, I recommend to set the value to NULL

A: In  > configuration > web > Session Cookie Management:

*

*Fill in the cookie path with '/' see screen shot

*Fill in the cookie domain value with 'yourdomainname' see screen shot

*As pontikos says I agree. You should clear out your browser cache or try another browser as well. If you are doing a lot of development and dealing with multi store or two separate environments, the cookies could clash. Might want to try this first.

(if multistore make sure you are choosing the correct website and website scope)


text:
Q: change default page in cpanel What do I need to do to change the default page in cpanel?

A: If you are referring to the default apache cPanel page then you will need whm access for that
WHM >> Main >> Account Functions >> Web Template Editor
Here you can change the default page, suspended page etc.

A: Update or create .htaccess file in the public_html folder and make the following content..
DirectoryIndex index.php home.php

A: Assuming you are referring to the default page when an account is created, this is easily done by creating an index.html or .php page within your /etc/skel folder (assuming you have a VPS or dedicated server).
There is a setting within WHM that allows for it in case you are not CLI savvy.
Hope this helps, sorry for the delayed response, but I'm new and trying to build my rep up!

A: You can create custom branded login pages for cPAnel and WHM by using the advanced branding features of cPanel.  cPanel also supports custom login pages for each reseller's accounts.  Linked Below is the documentation.
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/CustomBrandedLoginPages

A: how to create cpanel default page for hosting domains.
create default html page and upload the files in Skeleton Directory on cpanel root domain.
http://www.motherhost.in/members/knowledgebase/22/how-to-change-default-page-in-cpanel.html
The skeleton directory ( Skeleton Directory: A directory that defines what files and subdirectories new accounts will have by default. When the account is created, the new user's account will contain an exact copy of the skeleton directory.) exists to let you easily copy the same files into every new account's public_html and public_ftp directories when the account is created.
Keep in mind that:
When a visitor accesses http://example.com, he will see the contents of example.com 's public_html directory.
When a visitor accesses http://example.com/subdirectory, he will see the contents of public_html/subdirectory.
Contents of the public_ftp directory are available for anonymous FTP users to download.

This WHM feature simply states the location of the skeleton directory (/root/cpanel3-skel).
To set up your skeleton directory:
These files will be accessible to the new user via an FTP client.
Decide what kind of default setup you would like your new users to have.
Place the appropriate subdirectories and HTML files in /root/cpanel3-skel/public_html.
    These files will be copied to new accounts' public_html directories when accounts are created.
Place the appropriate FTP-related files in /root/cpanel3-skel/public_ftp.
    These files will be accessible to the new user via an FTP client.


text:
Q: Include Javascript on wordpress sidebar pages I want to add one javascript on  the wordpress pages  where my sidebar is called i.e when I call sidebar like
<?php get_sidebar(); ?>

it should automatically include javascript on to that page. is there any such hook to which I can attach my javascript including  code?

A: Try this code, this will call when any sidebar is called:--
add_action('get_sidebar', 'add_before_siderbar');
function add_before_siderbar($name)
{
    //Here `$name` is  name of side bar, it will blank if default sidebar is call.
    if($name == 'your-sidebar')
    {
        add_action( 'wp_enqueue_scripts', 'add_scripts' );
    }
}
function add_scripts()
{
    wp_enqueue_script( 'your-script', 'YOUR-SCRIPT-PATH', array( 'jquery' ), 'version', false);
}


text:
Q: Length of external lines in feynman diagrams (TikZ) I would like to make the following diagram

using TikZ (The above diagram was done using feynmf package). So far I have written this:
\documentclass[12pt]{article}
\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\begin{tikzpicture}
    \feynmandiagram [ horizontal=i to v1] {
    i -- [double] v1 -- [double] v2 -- [double] v3 -- [double] v1,
    v2 -- [double] o1,
    v3 -- [double] o2,
};
\end{tikzpicture}
\end{document}

and obtained this

However, I can't figure out, how to decrease the length of the external lines. In addition, I can't figure out how to make lines crossed like in the first figure. Any suggestions?

A: If you are going to use the automatic placement algorithms in TikZ-Feynman (CTAN), then unfortunately there's no straightforward way of shortening the external lines as the underlying algorithm has no idea of which lines are external.
It is possible to tweak how far the edges are drawn with shorten <=(distance) and shorten >=(distance) (the difference being whether it cuts off the start of the end); but this only affects the drawing of the edge and not the way the algorithm treats the edge length and as a result  I would not really recommend using this.  In particular, this will look weird if used in conjunction with the particle style as text will be a long way away from the end of the line.
In your case, a neat way of achieving the desired result is to take advantage of the simple geometry:
\RequirePackage{luatex85}
\documentclass[tikz,border=10pt]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\begin{tikzpicture}
  \begin{feynman}
    \vertex (i);
    \vertex [right=2cm of i] (center);
    \pgfmathsetmacro\vert{2 * sin(2 * pi / 6 r)};
    \pgfmathsetmacro\horz{2 * cos(2 * pi / 6 r)}
    \vertex [above right=\vert cm and \horz cm of center] (o1);
    \vertex [below right=\vert cm and \horz cm of center] (o2);
    \vertex (v1) at ($(center)!0.7!(i)$);
    \vertex (v2) at ($(center)!0.7!(o1)$);
    \vertex (v3) at ($(center)!0.7!(o2)$);

    \diagram* [edges=double] {
      (i) -- (v1) -- (v2) -- (v3) -- (v1),
      (v2) -- (o1),
      (v3) -- (o2),
    };
  \end{feynman}
\end{tikzpicture}
\end{document}

This initially places all of the outer vertices 2cm from the center vertex.  It then places each v1, v2 and v3 vertices at 0.7 of the distance between the center and the desired outer vertex.
I realize this solution is very specific to the layout above and is not general at all.  More generally though, you can tweak the distances in the above right=(distance) and (distance) of (vertex).  There are plenty of other examples that make use of this on this website, and there are examples of this within the documentation for TikZ-Feynman itself.
As for the second part of your question regarding the perpendicular lines crossing the various propagators, this is best achieved using a custom style which itself defines a new custom decoration:
\RequirePackage{luatex85}
\documentclass[tikz,border=10pt]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}

\tikzfeynmanset{
  crossed/.style={
    /tikz/postaction={
      /tikz/decoration={
        show path construction,
        lineto code={
          \coordinate (tmp1) at ($(\tikzinputsegmentfirst)!5pt!(\tikzinputsegmentlast)$);
          \draw
          ($(tmp1)!4pt!90:(\tikzinputsegmentlast)$)
          -- ($(tmp1)!4pt!-90:(\tikzinputsegmentlast)$);
        },
      },
      /tikz/decorate=true,
    },
  },
  crossed'/.style={
    /tikz/postaction={
      /tikz/decoration={
        show path construction,
        lineto code={
          \coordinate (tmp1) at ($(\tikzinputsegmentlast)!5pt!(\tikzinputsegmentfirst)$);
          \draw
          ($(tmp1)!4pt!90:(\tikzinputsegmentlast)$)
          -- ($(tmp1)!4pt!-90:(\tikzinputsegmentlast)$);
        },
      },
      /tikz/decorate=true,
    },
  },
}

\begin{document}
\begin{tikzpicture}
  \begin{feynman}
    \vertex (i);
    \vertex [right=2cm of i] (center);
    \pgfmathsetmacro\vert{2 * sin(2 * pi / 6 r)};
    \pgfmathsetmacro\horz{2 * cos(2 * pi / 6 r)}
    \vertex [above right=\vert cm and \horz cm of center] (o1);
    \vertex [below right=\vert cm and \horz cm of center] (o2);
    \vertex (v1) at ($(center)!0.7!(i)$);
    \vertex (v2) at ($(center)!0.7!(o1)$);
    \vertex (v3) at ($(center)!0.7!(o2)$);

    \diagram* [edges=double] {
      (i) -- (v1) -- [crossed] (v2) -- [crossed] (v3) -- [crossed'] (v1),
      (v2) -- [crossed] (o1),
      (v3) -- [crossed] (o2),
    };
  \end{feynman}
\end{tikzpicture}
\end{document}

The postaction ensures that what follows (in this case the decoration) is drawn on top.  We then tell it to draw a decoration in the postaction, and the decoration type is show path construction.
This decoration is a specialized kind of decoration which gives access to \tikzinputsegmentfirst and \tikzinputsegmentlast, and allows for arbitrary code to be executed.  In this case, we create a temporary coordinate 5pt away from the start and call it tmp1, and we then draw a straight line that is 8pt long at a 90 degree angle to the original path going through tmp1.  For convenience, I have also defined a complementary style crossed' which places the tmp1 coordinate 5pt away from the end.


text:
Q: What does the UseCompressedOops JVM flag do and when should I use it? What does the HotSpot JVM flag -XX:+UseCompressedOops do and when should I use it? What sort of performance and memory-usage differences will I see when using it on a 64-bit Java instance (vs. not using it)?

A: Most HotSpot JVM in the last year have had it on by default. This option allows references to be 32-bit in a 64-bit JVM and access close to 32 GB of heap. (more than 32-bit pointers can) (You can have near unlimited off heap memory as well).  This can save a significant amount of memory and potentially improve performance.
If you want to use this option I suggest you update to a version which has it on by default as there may have been a good reason, such as bugs, why it wasn't enabled previously. Try Java 6 update 23 or Java 7 update 5.
In short, don't turn it on, use a version which has it on by default.

Update:
In Java 8 you have the option to set the -XX:ObjectAlignmentInBytes= and in fact if you heap size to 64 GB it will use -XX:ObjectAlignmentInBytes=16 and still use 32-bit references.


text:
Q: call web service (API) using php there is a web service with end points .( get and post developed by back end developer ) .web service is already hosted in Azure .i want to make a site which can communicate with the web service. how can i call those methods using PHP ? or JavaScript ? how to make a connection between web site and web service .

A: I'll forgive you for the basic nature (and details) in your question but refrain from attempting to build this for you. Instead I'll point you to some basic concepts and hope further digging on your part will help.
Assuming the API endpoints are public or if not, that you have access to authentication credentials to access them, then it may be as simple as using an AJAX call to the endpoint.
E.g. assuming the endpoint is located at: https://220.10.11.123:8080/api/v1/getstuff and your app / site is already authenticated (or you don't need authentication because the app / site is hosted within the same network) and assuming that endpoint returns JSON, you could call it using AJAX directly from JavaScript and iterate over the JSON object, printing out values or whatever.
Or you could call it from PHP using curl (See curl_exec() and related functions on php.net). There are plenty of libraries and frameworks that have already solved this problem, as well as error handling, logging, testing etc so I really don't think I can help you much more at this point, just encourage you to have a crack at it to start with.
Having said that,once you've had a go calling your web-service with JS or PHP and used AJAX or curl and you have problems, then SO is the place to come for help.
Good luck :-)


text:
Q: MongoDB JDBC select sub document syntax I am using Progree DirectData drivers in coldfusion 11 and I can return data using a simple select * from accounts.
I can see in RoboMongo that there are sub documents, however I can't work out how to select the sub document as it's not coming up.


text:
Q: How to recognize cross lines in opengl? I'm trying to write a program in which I should recognize when 2 lines cross each other. Can anyone help me ?

A: OpenGL is for rendering geometry. This is a simple mathematical problem which you don't need OpenGL to solve.  You would normally use algorithms in a geometry library or scene graph. CGAL has a nice writeup here:

*

*http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Sweep_line_2/Chapter_main.html


text:
Q: jQuery Validate adds display:block I am using jQuery Validation plugin on my pages
When the field first has jquery error it displays as the following:
<label for="fromDate" generated="true" class="error" style="">This field is required.</label>

when I correct a validated error it adds the following CSS style to the element.
display: none

The issue is though when I make the element have an error again it changes the CSS style to the following
display: block

How can I make it just remove the CSS style instead of switching it to block?

A: "How can I make it just remove the CSS style instead of switching it to block?"
You can't unset properties in CSS. You just can set them to some default value.
The display property must be set to some valid value, e.g. block and it doesn't get inherited. This is the common way to go in CSS. See: https://developer.mozilla.org/en-US/docs/CSS/display
(also read @Sparky672 comment to understand whats happening here)

A: Since display:block is the normal default state of this element, it is functionally identical to removing display:none. In other words, even if you could do what you want, the browser still sees it as display:block... no difference. What exactly is the real issue here?
To control where the error is placed, search for errorPlacement option on this page in the documentation.  Although, you'll probably have the same issue, whatever it is.
This shows the errorPlacement: option with the default function.
$("#myform").validate({
    // options,
    errorPlacement: function(error, element) {
       error.insertAfter(element); // change this to place error message elsewhere
    }
});


text:
Q: Need to Loop thru a firebaseArray and returning 1 object I am trying to access data returned in a firebase array and return 1 of these objects - my firebase array is returning 3 objects and I want to be able to loop through these 3 objects and compare data. Really not sure what to do:
its the function getNewsDetail is the problem.
angular.module('news.services', ['ionic', 'firebase' ])
.factory('NewsItems', ['$firebaseArray', function($firebaseArray){
  var newsRef = new Firebase ('https://xxxx.firebaseio.com/newsitems');

    var theNewsItems = [$firebaseArray(newsRef)];
    //alert($firebaseArray(newsRef).length)
    return{
    getNewsItems: function(){
        return $firebaseArray(newsRef);
    },
    getNewsDetail: function(newsID){
        for(var i = 0; i < theNewsItems.length; i++){
            if(theNewsItems[i].id == parseInt(newsID)){
                return theNewsItems[i];
            }
        }
        return null;
    }
    };

}]);

Including Firebase layout:
      newsitems
          -KIip4vmlntvakLoBAXA
                 Detail: "Detail Y"
                 Title: "Title X"
                 id: 0
          -KIipATckNU1WzEhkY9-
                Detail: "Come down and play with us"
                Title: "New Players Welcome"
                id: 1
          -KIipHiM2NYlh_BgG8UM
               Detail: "story 3"
               Title: "title 3"
               id: 2

A: When you want to use a single object from Firebase in an AngularJS view, you use $firebaseObject. So:
getNewsItems: function(){
    return $firebaseArray(newsRef);
},
getNewsDetail: function(newsID){
    return $firebaseObject(newsRef.child(newsID);
}

Firebase is intelligent enough in its loading of the data that it won't reload it, if it already has it in memory.


text:
Q: What happened to OmniXML? There seems to be a great deal of enthusiasm about OmniXML, but omnixml.com is offline and the Google Code project is empty. What happened to this library and where can I find the code (since it's open source)?

A: The OmniXML Google Code project does have source available if you click on the "Source" link, but you'll need a Subversion client to get the source.
I made a local Mercurial repository with the releases I could easily collect and a few modifications.  I'll archive the entire repo and throw it online for anyone to download...
It's available at http://www.traumazone.com/OmniXML.7z
Changes from the official source:

*

*Support for xml:space attribute as created by Ondřej Pokorný

*Shuffled source around and created Delphi 2007 and XE packages

*Updated 3rd party units with latest versions from upstream sources (e.g. jedi.inc, GpDelphiUnits)

*Add optional useBoolStrs parameter to SetNodeTextBool

The Mercurial history is available in the archive, so you can always roll back to a different release (what few I bothered to collect).


text:
Q: Can't change target in schema compare When I try to select Target (or select Source) in a schema compare I get a Microsoft .NET Framework error: "System.ArgumentException: An item with the same key has already been added." It doesn't matter if I use a saved schema compare or make a new one. This is only an issue in one of my solutions, one created by merging several projects into a single solution when we moved from TFS/TFVC to VSTS/Git. The full error is this:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareConnectionDialog.PopulateProjectCombos()
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareConnectionDialog..ctor(Boolean isSource, ISchemaCompareParticipant participant)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.CollectFromConnectionDialog(Boolean isSource)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.<>c__DisplayClass29_0.<SetupComboBox>b__0(IImageComboBoxItem i)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.OnSelectionChangeCommitted(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommitted(EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommittedInternal(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

A: The problem turned out to be that when I merged the projects two projects called "Database" were added. I renamed one and the problem went away.


text:
Q: Use OpenMP with Windows SDK I am aware that VC2010 Express Edition does not include OpenMP support and therefore would report omp.h file missing. Therefore, I have installed Windows SDK v7.1 64-bit version in Windows. However, even I ran:
set DISTUTIL_USE_SDK=1
setenv /x64 /release

And then try to compile the code, it would still report cannot find omp.h. Could anyone give me a hint on how to solve this?

A: Did some checking, and it appears that OpenMP is not part of the Windows SDK, and is only shipped with Visual C++ 2010 Professional or Ultimate editions.


text:
Q: Web Service capture Response My web service calls a url which returns a value which I must capture and use in a different function.
I've only recently starting working with web services and am very new to the concept of calling a url within a web service (Previously asked and answered on this forum for those requiring more information)
Webservice method to call a url
My web service is: Insurance Service.
My client sends me data through the Insurance service which calls a url which returns an Insurance Number.
How do I capture this insurance number? I thought I could use session to capture it but I was so wrong insurance Number comes as null with an object reference error.
int insuranceNo;
insuranceNo = Convert.ToInt16(HttpContext.Current.Session["insuranceNo"]);

It must have something to do with response right?
I thought I could try google what I am looking for but I honestly don't know what to call this in order to search for it. Thought I'd give it another shot in this forum since I found the answer to the first part of this function here.
code to call url:
 string url = string.Format("www.insuranceini.com/insurance.asp?fileno1={0},&txtfileno2={1}&username={2}&userid={3}&dteinsured={4}&dteDob={5}&InsurerName={6}", txtfileno1, txtfileno2, username, userid, dteinsured,dteDob,InsurerName)
WebRequest request = HttpWebRequest.Create(url);
using(WebResponse response = request.GetResponse())
{
    using(StreamReader reader = new StreamReader(response.GetResponseStream()))
    {
        string urlText = reader.ReadToEnd();
        //Do whatever you need to do
    }
}

I would be grateful for any sort of pointers or places to start looking or any advice.

A: Code began giving different errors. Closing this and referring to : Datetime Conversion and Parsing
Thank you everyone for the helpful comments.


text:
Q: opening sdcard directory and showing it on screen I have a query. I need to show all the contents of sdcard specific folder. What I need to do is I need to tell the user that there are no files in a particular directory in sdcard so need to open that folder and show it on screen. For eg. I there is no internet we can show an alert to open internet and also open the settings screen. Same way I also want to open the sdcard/myFolder screen. Please guide me what to do if its possible in android?
Thank you all in advance.

A: Try to use the following code to check if the directory is available and have files:
String Directory = "";
String[] mFileList ;
//GET ROOT DIRECTORY OF EXTERNAL STORAGE + DIRECTORY THAT YOU WANT

File dir = new File(Environment.getExternalStorageDirectory() + DIRECTORY);
if(dir.exists()) {
  mFileList = dir.list(filter);
  if(mFileList.length==0)
    //Inform that directory is empty
}
else {
  //Inform user that there is no such directory
}

Then you can open dialog:
Dialog dialog = null;
AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, android.R.style.Theme_Holo));//this, R.style.AlertDialogCustom));
builder.setTitle("Choose your file");
if(mFileList == null) {
    //Log.e(TAG, "Showing file picker before loading the file list");
    dialog = builder.create();
}
builder.setItems(mFileList, new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
        mChosenFile = mFileList[which];
        //Do something after choosing the file
    }
});

dialog = builder.show();
return true;

I hope it will help you.


text:
Q: My react app suddenly missing all dependencies? I have been working on a react app for two months.
Suddenly today when I ran 'npm start' it runs basic react app. By basic react app I mean the basic template you get when you create app using 'npx create-react-app', the one with react logo spinning etc.
My index.js file is returned to basic, App.js file as well.
Most dependencies in package.json file are gone, and I had plenty of them, axios, react-redux, redux-thunk, to name a few. Everything is gone.
Most other components are there. The ones that I created during the process.


text:
Q: Using jQuery ajax in UIWebView.EvaluateJavascript() In my app I am using UIWebView in MonoTouch to evaluate some javascript. The javascript needs to retrieve some json using ajax from a service. When the ajax finishes it calls back into the app using NSUrlProtocol.
This works very well as long as I am using XMLHttpRequest for the ajax stuff. But when using jQuery.getJSON or jQuery.ajax it does not work at all. In fact the request does not even get executed by the UIWebView. (I can tell this since the NSUrlProtocol is notified for every Url being loaded). The service is an ASP.NET MVC4 Web API app which is setup to handle jsonp and cross service scripting. It works very well from every scenario I can come up with except this one.
Any suggestions on what may cause jQuery to fail?


text:
Q: Iframe links not redirecting despite correct syntax (HTA file) I am trying to embed a website in an HTML application that has links. I've tried this:
<iframe id="frame" application="yes"></iframe>

(I haven't really figured out the size) and it worked, just you can't use links on the page. I would usually just put the code of the webpage into the hta file, but there were some problems with javascript. I need to make a  multi-page site, so I need links. Is there a way to embed a website that has links onto an HTML app, and still keep the links working? Thank you for any help.


text:
Q: Bootstrap model auto spinning icon issue According to this tutorial i used auto spinning icon for my bootstrap model. when footer button click spinning icon started. after 3 second i want to stop spinning and display a new button or a div on model body. how to do it and where i missed coding?
BootstrapDialog.show({
            title: 'dialog header',
            message: 'my details',
            buttons: [{
                label: 'Contact',
                autospin: true,
                action: function(dialogRef) {
                    dialogRef.enableButtons(false);
                    dialogRef.setClosable(false);
                    setTimeout(function(){
                        dialogRef.enableButtons(true);
                        dialogRef.setClosable(true);
                        autospin: false;  //??? error
                        //display new button or div on body
                    }, 3000);

                }
            },  {
                label: 'Close',
                action: function(dialog) {
                    dialog.close();
                }
            }]
        });

A:
autospin: false;

This is the syntax that you can use in object initializers. You cannot use it to change an object.
The simplest approach here would be to manually remove the Bootstrap classes that add that spinning icon.
Put this code inside of your timeout callback function:
$('.modal-dialog span.icon-spin').removeClass('glyphicon-asterisk icon-spin')


text:
Q: Unknown column 'list' in 'field list' php mysql multiple selections I'm not sure what I a missing here... Any pointers would be greatly appreciated. keep getting Unknown column 'list' in 'field list' for some reason. I'm not sure what I am missing exactly.
<?php
if (isset($_POST['list'])) {
  $_POST['list'] = implode(',', $_POST['list']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "create_list")) {
   $insertSQL = sprintf("INSERT INTO listp (one) Values (%s)"),
     GetSQLValueString($_POST['company_category'], "text"));
?>

<select name="list[]" size="12" multiple="multiple" id="list">

<?php

do {

?>
  <option value="<?php echo $row_huff_list['id'] ?>">
    <?php
    echo $row_huff_list['list']
    ?>
  </option>

<?php
  } while ($row_huff_list = mysql_fetch_assoc($huff_list));

  $rows = mysql_num_rows($huff_list);
  if($rows > 0) {
    mysql_data_seek($huff_list, 0);
    $row_huff_list = mysql_fetch_assoc($huff_list);
  }
?>
</select>

A: Its super simple: $row_huff_list is not defined when the program enter the loop for the first time, only at the end of the first loop, the $row_huff_list is assigned some value, for second time its ok already, just change do-while loop to while loop, like this:
 while ($row_huff_list = mysql_fetch_assoc($huff_list)) {
    ?>
    <option value="<?php echo $row_huff_list['id'] ?>">
        <?php
        echo $row_huff_list['list']
        ?>
    </option>
    <?php
}


text:
Q: Is there any well-known reason for this Django issue? I created a django (1.8+) project some time ago, and it's weird that it works well with runserver, but it's not working with gunicorn (requests never end, nothing is received using curl or any browser to test my server). The funny fact is that it worked until recently (I'm in an AWS/AmazonLinux server; never changed the server image).
Since this timeout really annoyed me (and still does) I checked the project, opened a python interactive interpreter inside my virtualenv, and tried:
from my_project.wsgi import application

inside the appropiate folder (so this statement does not raise ImportError). But that single line took a lot (at least 10 seconds) to execute.
I think that is the reason why is gunicorn not working.
Is there any well-known reason this could happen? How can I debug further?
Edit My gunicorn command: gunicorn trescloud_landing.wsgi:application --daemon --bind=127.0.0.1:8888 --pid=/opt/webapps/pid/landing-pages.pid --access-logfile=/opt/webapps/log/landing-pages.access.log --error-logfile=/opt/webapps/log/landing-pages.error.log
Edit 2 Changed --timeout=600 (yes, 10 minutes) and gunicorn worked. But it is still troublesome to me that the server has a somehow low wsgi bootstrap


text:
Q: How to track function calls in MATLAB? I would like a way to track all function calls that have operated on a specific workspace variable -- for instance, a sound waveform that will be transformed by various signal processing functions.
One cumbersome and fragile way is to do this:
>> cfg = [];
>> curr_call = 'data_out = my_function(cfg,data_in);';
>> eval(curr_call);
>> data_out.cfg.history = cat(1,data_out.cfg.history,{curr_call});

What would be much better is the following:
>> cfg = [];
>> data_out = my_function(cfg,data_in);
>> data_out.cfg.history

  'data_out = my_function(cfg,data_in);'

EDIT for clarification: In other words, this variable has a field, cfg.history, that keeps track of all history-enabled functions that have operated on it (ideally with arguments). The history field should be updated regardless of where function calls originate: my example above is from the command line, but calls made from cell mode or within a script should also be appended to the history. Obviously, I can edit my_function() in the above example so that it can modify the history field.
NOTE in response to discussion below: the motivation for doing this is to have the  history "attached" to the data in question, rather than say, in a separate log file which would then need to be packaged with the data somehow.
Can this be done?

A: You can access the full Session history using this code:
import com.mathworks.mlservices.MLCommandHistoryServices
history=MLCommandHistoryServices.getSessionHistory;

To achive what you want, use this code:
import com.mathworks.mlservices.MLCommandHistoryServices;
startcounter=numel(MLCommandHistoryServices.getSessionHistory);
disp('mydummycommand');
disp('anotherdummycommand');
history=MLCommandHistoryServices.getSessionHistory;
commands=cell(history(startcounter-2:end-1));

Be aware that these functions are undocumented. It uses the command history which is typically located at the bottom right in your matlab.


text:
Q: geotools wfs-ng thread safety and strange behaviour problem I'm having a big trouble using geotools wfs-ng datastore plugin together with geoserver instance (geoserver is not a problem here, it's just a wfs implementation and provider of the data).
Use case seems plain:

*

*custom web service that is sort of proxy to underlying wfs

*create wfs data store while my web service application starts:

final URL wfsUrl = new URL(url);
final WFSConfig wfsConfig = WFSConfig.fromParams(Map.of(
    WFSDataAccessFactory.AXIS_ORDER.key, WFSDataAccessFactory.AXIS_ORDER_EAST_NORTH));
final SimpleHttpClient httpClient = new SimpleHttpClient();
return new WFSDataStore(new WFSClient(wfsUrl, httpClient, wfsConfig));

*

*reuse it on consecutive custom api calls to proxy underlying wfs, many of below calls are being done in multiple threads

final SimpleFeatureSource eventsSource = dataStore.getFeatureSource(typeName);
final String geometryColumn = dataStore.getSchema(typeName).getGeometryDescriptor().getLocalName();
final Filter filter = filterOf(parameters, geometryColumn);
final SimpleFeatureCollection eventsFeatures = eventsSource.getFeatures(new Query(typeName, filter));
final SimpleFeatureIterator features = eventsFeatures.features();
try {
    while (features.hasNext()) {
        final SimpleFeature next = features.next();
        //do something
    }
} finally {
    features.close();
}

tried version of geotools wfs-ng datastore plugin: 22.3, 23.5
symptoms:

*

*strange in behaviour of the wfs-ng plugin is that every wfs GetFeature call releases DescribeFeatureType call (for the schema which seems failing, from org.geotools.xsd.impl PullParser probably), why isn't one sufficient?

*after number of multithreaded wfs calls (sometimes less, somethimes more)

Caused by: java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 94 out of bounds for object array[93]
    at java.base/java.lang.System.arraycopy(Native Method) ~[na:na]
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.ensureSafety(BasicNotifierImpl.java:214) ~[org.eclipse.emf.common-2.15.0.jar!/:na]
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.remove(BasicNotifierImpl.java:244) ~[org.eclipse.emf.common-2.15.0.jar!/:na]
    at org.geotools.xsd.impl.SchemaIndexImpl.destroy(SchemaIndexImpl.java:93) ~[gt-xsd-core-22.3.jar!/:na]
    at org.geotools.xsd.Encoder.encode(Encoder.java:1119) ~[gt-xsd-core-22.3.jar!/:na]
    at org.geotools.filter.v2_0.bindings.BinarySpatialOpTypeBinding$1.encode(BinarySpatialOpTypeBinding.java:70) ~[gt-xsd-fes-22.3.jar!/:na]
    at org.geotools.xsd.Encoder.encode(Encoder.java:727) ~[gt-xsd-core-22.3.jar!/:na]
    ... 103 common frames omitted


text:
Q: Is there a way to Collect Lat-Long in a Google Docs Form? I'm helping out a small non profit. They are collecting some simple data using a Google Docs Form. The need to collect exact latlong (upto 5 meters accuracy is fine).
Ideally the end user would click on a map and that lat-long would be submitted along with the rest of the form.
I have seen the mapbox blog talk about this here. But that is using the mapbox API.
I was wondering if there exists a ready made template to collect the point on top of Google Maps. I don't want to spend half a day converting the mapbox sample to Google Maps API, and then find out that something already existed.
So Is anyone aware of template where a point was collected from Google Maps in Google Forms?

A: If Google docs is using googles web Mercator projection and accuracy in the range of +-5m is needed you should read this to understand this aspect of your challenge.
https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/

A: Don't know about Google maps but you might try something like itouchmap.com  or mapcoordinates.net. Also Excel has a mapping plug-in.  I haven't used it for quite a while but I think you can get coordinates outputted to a spread sheet.  Search for "Excel Power Map"


text:
Q: converting string into date format with Python Hi I am trying to convert this string in Python : '2019-01-10' into date format as 2019-01-10
I have tried this code :
from datetime import datetime

date_time_str = '2019-01-10'

date_time_obj = datetime.strptime(date_time_str, '%y-%m-%d )

but i have a ValueError : time data '2019-01-10' does not match format '%y-%m-%d'
Can you help me please ?

A: %y format specifier is 2 digits, use uppercase %Y. Ref: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

A: from datetime import datetime
date_time_str = '2018-06-29'
date_time_obj = datetime.strptime(date_time_str, '%Y-%m-%d')

try changing it to the above code.


text:
Q: Store xml value as a Map using XPATH using JAVA I am using XPATH to parse xml document,please find the xml below
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <bookEvent>
            <bookName>harry_potter</bookName>
            <bookEntity>comic</bookEntity>
            <bookEntityId>10987645</bookEntityId>
            <bookParameter>
                <name>Name1</name>
                <value>value1</value>
            </bookParameter>
            <bookParameter>
                <name>Name2</name>
                <value>value2</value>
            </bookParameter>
            <bookParameter>
                <name>Name3</name>
                <value>value3</value>
            </bookParameter>
            <bookParameter>
                <name>Name4</name>
                <value>value4</value>
            </bookParameter>
            <bookParameter>
                <name>Name5</name>
                <value>value5</value>
            </bookParameter>
        </bookEvent>
    </soap:Body>
</soap:Envelope>

Here I would like to convert BookParameters to Map like below
{"Name1":"value1","Name2":"value2" etc}

I have tried the below code and i can get a Map but not in the expected format,
      try{
        Map<String,String> eventParameters = new HashMap<>();
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse("book.xml");
        XPathFactory xPathfactory = XPathFactory.newInstance();
        XPath xpath = xPathfactory.newXPath();
        NodeList nodeList = (NodeList)xpath.compile("//bookEvent//eventParameter").evaluate(doc, XPathConstants.NODESET);
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node node = nodeList.item(i);
            if(node.hasChildNodes()) {
                NodeList childNodes = node.getChildNodes();
                for (int j = 0; j < childNodes.getLength(); j++) {
                    Node childNode = childNodes.item(j);
                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                        System.out.println(childNode.getNodeName()+"::"+childNode.getNodeValue()+"::"+childNode.getTextContent());
                        eventParameters.put(childNode.getTextContent(),childNode.getTextContent());
                    }
                }
            }
        }
        System.out.println("print map::"+eventParameters);
    } catch (Exception e) {
        e.printStackTrace();
    }

The output looks like this
print map::{Name3=Name3, Name4=Name4, value5=value5, Name5=Name5, value2=value2, value1=value1, value4=value4, value3=value3, Name1=Name1, Name2=Name2}

Please somebody guide me to create a below map from the xml,Any help would be appreciable.
{"Name1":"value1","Name2":"value2" etc}

A: You can do it as a one-liner in XPath 3.1:
map:merge(//bookParameter!map{string(name): string(value)})
   => serialize(map{'method':'json'})

You can run XPath 3.1 from Java by installing Saxon-HE 9.8 (open source)

A: Use Below code :
import java.io.File;
import java.util.LinkedHashMap;
import java.util.Map;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class ReadXMLFile {

    public static Map<String,String> hMap = new LinkedHashMap<>();
    public static void main(String argv[]) {

        try {

            File fXmlFile = new File("C:\\Users\\jaikant\\Desktop\\QUESTION.xml");
            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
            Document doc = dBuilder.parse(fXmlFile);
            doc.getDocumentElement().normalize();

            NodeList nodeList = doc.getElementsByTagName("bookParameter");

            for (int parameter = 0; parameter < nodeList.getLength(); parameter++) {
                Node node = nodeList.item(parameter);
                if (node.getNodeType() == Node.ELEMENT_NODE) {
                    Element eElement = (Element) node;
                    String name = eElement.getElementsByTagName("name").item(0).getTextContent();
                    String value = eElement.getElementsByTagName("value").item(0).getTextContent();
                    hMap.put(name, value);

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

        hMap.forEach((h,k) -> {
            System.out.println(h + ":" + k);
        });
    }

}

It will print exactly what you are looking for.


text:
Q: How to apply the same theme in all WPF windows using MahApps.Metro I'm newer with WPF projects and I have a question about the component MahApps.Metro.
I created a MainWindow and other windows in my project, my question is: How to apply the same theme in MainWindow to the others windows of the project? And, I must to apply the ResourceDictionary for all windows or exist any way to do this one time only?
Thank you guys!

A: In your App.xaml, set the ResourceDictionary property like this:
<Application.Resources>
    <ResourceDictionary Source="MyResourceDictionary.xaml"/>
</Application.Resources>

Notice that in order for the styles in your resource dictionary to be applied to all controls of that type, the style should NOT have a key. For example, a style defined like this:
<Style TargetType="{x:Type Button}">
    <Setter Property="Content" Value="This is the default button text"/>
</Style>

In the ResourceDictionary will cause all the buttons in the project to have a default value when you create them.

A: Resource's in WPF work based on their available "scope". Check this article for a detailed explanation
Now Application(App.xaml) is in a higher scope to Window. Thus to share these MahApps control resources across your Window's just move the ResourceDictionary's to the Application.Resources scope
something like:
<Application.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Application.Resources>

Now you no longer need to add these Dictionary's in each Window as they are available implicitly


text:
Q: How to retry an official race in Trackmania 2 Stadium? I'm playing Trackmania 2 Stadium (beta) and I've noticed that the first time after I retry a race after beating the gold medal time, it offers to let me do an "official" race for SP points. But after that race is complete, or if I decline to do the race, I don't know how to try for another official time.
Does that option exist?

A: You may only attempt an "official race" every 5 minutes. After finishing an attempt you will see a timer appear in the bottom right of the screen. Once this reaches zero, the next time you reset you will be asked if you want to try another official race.


text:
Q: Custom Button to update Field on Account object I have a custom button that's supposed to update a field on the Account Object.  I made this work via Javascript process, but the problem is this Custom button won't show up under custom links in Account object when in Lighting, it only shows up if I am using Classic.
On the warning it says Java script behavior isn't supported in lighting, what else can I do to update a field on the Account object?
Here is the code I have thas currently working but it's Javascript.
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
var accnt = new sforce.SObject("Account");
accnt.Id = '{!Account.Id}';
accnt.wow= 'True';

var result = sforce.connection.update([accnt]);
if(result[0].getBoolean("success"))
{
alert('Running process...');
window.location.reaload();
}
else
{
alert('Error : '+result);

}

How can I archive this without using the Java Script

A: So Javascript buttons don't work in Lightning experience. So for your usecase, first you need to create an object action (aka quick action) by creating a button in Account object where you need to select "Action Type" as "Update a Record". After that, modify the Publisher Actions Layout by dragging the newly created action to the Publisher Actions section.
You can check the link below for more information and perform the 1st and 3rd steps to replicate the scenario with your needs:
https://ccoenraets.github.io/salesforce1-app-tutorial/object-action-update-record.html

A: Setting>object manager>your object>Lightning record pages.  Click on the top object where your buttons are and add an action on the right side.  Find your newly created button and add it here.


text:
Q: Broker Network flooded with unconsumed ActiveMQ.Advisory.TempQueue messages I'm currently investigating a memory problem in my broker network.
According to JConsole the ActiveMQ.Advisory.TempQueue is taking up 99% of the configured memory when the broker starts to block messages.
A few details about the config
Default config for the most part. One open stomp+nio connector, one open openwire connector. All brokers form a hypercube (one on-way connection to every other broker (easier to auto-generate)). No flow-control.
Problem details
The webconsole shows something like 1974234 enqueued and 45345 dequeued messages at 30 consumers (6 brokers, one consumer and the rest is clients that use the java connector). As far as I know the dequeue count should be not much smaller than: enqueued*consumers. so in my case a big bunch of advisories is not consumed and starts to fill my temp message space. (currently I configured several gb as temp space)
Since no client actively uses temp queues I find this very strange. After taking a look at the temp queue I'm even more confused. Most of the messages look like this (msg.toString):
ActiveMQMessage {commandId = 0, responseRequired = false, messageId = ID:srv007210-36808-1318839718378-1:1:0:0:203650, originalDestination = null, originalTransactionId = null, producerId = ID:srv007210-36808-1318839718378-1:1:0:0, destination = topic://ActiveMQ.Advisory.TempQueue, transactionId = null, expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1318840153501, brokerOutTime = 1318840153501, correlationId = null, replyTo = null, persistent = false, type = Advisory, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = org.apache.activemq.util.ByteSequence@45290155, dataStructure = DestinationInfo {commandId = 0, responseRequired = false, connectionId = ID:srv007210-36808-1318839718378-2:2, destination = temp-queue://ID:srv007211-47019-1318835590753-11:9:1, operationType = 1, timeout = 0, brokerPath = null}, redeliveryCounter = 0, size = 0, properties = {originBrokerName=broker.coremq-behaviortracking-675-mq-01-master, originBrokerId=ID:srv007210-36808-1318839718378-0:1, originBrokerURL=stomp://srv007210:61612}, readOnlyProperties = true, readOnlyBody = true, droppable = false}

After seeing these messages I have several questions:

*

*Do I understand correctly that the origin of the message is a stomp connection?

*If yes, how can a stomp connection create temp queues?

*Is there a simple reason why the advisories are not consumed?

Currently I sort of postponed the problem by deactivating the bridgeTempDestinations property on the network connectors. this way the messages are not spread and they fill the temp space much slower. If I can not fix the source of these messages I would at least like to stop them from filling the store:

*

*Can I drop these unconsumed messages after a certain time?

*what consequences can this have?

UPDATE: I monitored my cluster some more and found out that the messages are consumed. They are enqueued and dispatched but the consumers (the other cluster nodes as mutch as java consumers that use the activemq lib) fail to acknowledge the messages. so they stay in the dispatched messages queue and this queue grows and grows.

A: This is an old thread but in case somebody runs into it having the same problem, you might want to check out this post: http://forum.spring.io/forum/spring-projects/integration/111989-jms-outbound-gateway-temporary-queues-never-deleted
The problem in that link sounds similar, i.e. temp queues producing large amount of advisory messages. In my case, we were using temp queues to implement synchronous request/response messaging but the volume of advisory messages caused ActiveMQ to spend most of its time in GC and eventually throw a GC Overhead Limit Exceeded Exception. This was on v5.11.1. Even though we closed connection, session, producer, consumer the temp queue would not be GC'd and would continue receiving advisory messages.
The solution was to explicitly delete the temp queues when cleaning up the other resources (see https://docs.oracle.com/javaee/7/api/javax/jms/TemporaryQueue.html)

A: If you are not using this advisory topic - you may want to turn it off as it's suggested at http://activemq.2283324.n4.nabble.com/How-to-disable-advisory-for-gt-topic-ActiveMQ-Advisory-TempQueue-td2356134.html
Dropping the advisory messages will not have any consequences - since those are just the messages meant for system health analysis and statistics.


text:
Q: Knowing only the coordinates of the North-East and South-West corners of a rectangle, how to check if a point is inside a rectangle? This is similar to this question. What's different is that only the coordinates of the North-East and South-West (or North-West and South-East) corners are known.
My question is, can you directly determine if a point lies inside the rectangle without finding the coordinates of the other 2 corners?
If finding the other 2 coordinates is necessary, what would be a good approach for finding them?

A: I assume that, as in the question you linked to, the rectangle can have any orientation and is not limited to horizontal/vertical sides.
There are infinitely many rectangles that have two given points as opposite vertices: a third vertex can be any point on the circle that has those two points as the ends of a diameter. A point outside that circle will be in none of the rectangles, while a point on the line segment between the two points will be in all the rectangles. All other points inside the circle but not on the line segment will be in some rectangles and not in others.
Therefore, there is no way to " directly determine if a point lies inside the rectangle without finding the coordinates of the other 2 corners" for those points. Also, there is no way to find the other two corners without additional information.


text:
Q: Cannot convert string in utf8 I have this string: Deportivo La Coruña, if I return it I'll get: Deportivo la coruña, so I tried to handle the encoding in this way:
$homeName = "Deportivo La Coruña";
return mb_convert_encoding($homeName, 'UTF-8', 'UTF-8'),

but same problem. I tried also utf8_encode but same result. How can I fix this issue without installing external libs?

A: I think the $homeName = "Deportivo La Coruña"; is in ISO-8859-1
return mb_convert_encoding($homeName,  'ISO-8859-1' ,'UTF-8');

Use this to achieve your result.