text:
Q: Can't see reason for Compiling… Compilation failed: (Executor::NonZeroExitStatus) Deploying on beanstalk. Using rails with webpacker.
Compiling…
  Compilation failed:

  (Executor::NonZeroExitStatus)

We can't seem to get anymore info as to what caused the compilation fail.
How can we get more info? Is there a debug mode for beanstalk?
These are the most descriptive errors we can see:
Webpacker is installed
Using /var/app/ondeck/config/webpacker.yml file for setting up webpack paths
Compiling…
Compilation failed:.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed.

A: My issue ended up being that the node_modules directory was being created with root as owner, which caused permissions problems.
To figure this out, I set webpack_compile_output to true in webpacker.yml and then re-deployed. Doing that increases the logging output by webpacker, which revealed the problem.
default: &default
  source_path: app/javascript
  source_entry_path: packs
  public_root_path: public
  public_output_path: packs
  cache_path: tmp/cache/webpacker
  check_yarn_integrity: false
  webpack_compile_output: true

Hope that helps.

A: You can add webpack_compile_output: true to your webpacker.yml to see more details about a failure like this. By default this is turned off.
Source: https://github.com/rails/webpacker/issues/955#issuecomment-503830871

A: You can use eb logs for tail logs are the last 100 lines of the most commonly used log files.
You can read more about logs here:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html
Also ssh the machine and check/share this log - "/var/log/directory-hooks-executor.log".


text:
Q: Javascript.Why the fist click is not functioning but the second click is function normally? This is an add-to-cart function. So basically when I pressed the add cart button, it will show the number at the cart icon there. But it doesn't work at all at the first click, but the second click is functioning well.

//cart function
function cartAdd() {
  let cart = document.querySelector('.cart');
  let add = document.querySelectorAll('.add');

  for (let but of add) {

    cart.setAttribute('data-count', 0);
    but.onclick = () => {
      let item = Number(cart.getAttribute('data-count') || 0);
      cart.setAttribute('data-count', item + 1);
      cart.classList.add('on');

    }
  }
}
.cart i {
  position: relative;
  font-size: 30px;
  cursor: pointer;
  margin: 0px 10px;
  top: 18PX;
}

.cart::after {
  position: absolute;
  content: attr(data-count);
  width: 15px;
  height: 15px;
  font-size: 12px;
  border-radius: 15px;
  text-align: center;
  background-color: red;
  color: white;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
}

.cart.on::after {
  opacity: 1;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<button class="add" onclick="cartAdd()">Add-cart</button>

I have used console.log('hi') inside the but.onclick but it also won't show the 'hi' for the first click.

A: Because you already have an event listener onclick="cartAdd()" you don't need one in the js. Remove that, the add query/loop, and the set to 0 and it should work as expected

//cart function
function cartAdd() {
  let cart = document.querySelector('.cart');
  let item = Number(cart.getAttribute('data-count') || 0);
  cart.setAttribute('data-count', item + 1);
  cart.classList.add('on');
}
.cart i {
  position: relative;
  font-size: 30px;
  cursor: pointer;
  margin: 0px 10px;
  top: 18PX;
}

.cart::after {
  position: absolute;
  content: attr(data-count);
  width: 15px;
  height: 15px;
  font-size: 12px;
  border-radius: 15px;
  text-align: center;
  background-color: red;
  color: white;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
}

.cart.on::after {
  opacity: 1;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<button class="add" onclick="cartAdd()">Add-cart</button>

A:
but it also won't show the 'hi' for the first click

But it does show for the second click, correct?  Then what happens on the third click?  And the fourth?  How many times is it showing that message with each subsequent click?
This is because of what the code does on each click.  Specifically, what does the cartAdd function do?
It adds a click event handler to the buttons.
It doesn't execute that handler, just adds it.  So now the button has two click event handlers.  The cartAdd function, and the handler function that was just added.  So you click it again, and both of those functions are executed.  One of which adds another click event handler.
And so on, and so on.
Don't add event handlers as part of the event.  Just add them.  Get rid of onclick="cartAdd()" entirely and just add the handler when the page loads (or when the elements exist):

let cart = document.querySelector('.cart');
let add = document.querySelectorAll('.add');

for (let but of add) {

  cart.setAttribute('data-count', 0);
  but.onclick = () => {
    let item = Number(cart.getAttribute('data-count') || 0);
    cart.setAttribute('data-count', item + 1);
    cart.classList.add('on');
  }
}
.cart i {
  position: relative;
  font-size: 30px;
  cursor: pointer;
  margin: 0px 10px;
  top: 18PX;
}

.cart::after {
  position: absolute;
  content: attr(data-count);
  width: 15px;
  height: 15px;
  font-size: 12px;
  border-radius: 15px;
  text-align: center;
  background-color: red;
  color: white;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
}

.cart.on::after {
  opacity: 1;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<button class="add">Add-cart</button>

A:

//cart function
function cartAdd() {
  let cart = document.querySelector('.cart');
  let add = document.querySelectorAll('.add');

  for (let but of add) {

    cart.setAttribute('data-count', 0);
    but.onclick = () => {
      let item = Number(cart.getAttribute('data-count') || 0);
      cart.setAttribute('data-count', item + 1);
      cart.classList.add('on');

    }
    but.click('trigger');
  }
}
.cart i {
  position: relative;
  font-size: 30px;
  cursor: pointer;
  margin: 0px 10px;
  top: 18PX;
}

.cart::after {
  position: absolute;
  content: attr(data-count);
  width: 15px;
  height: 15px;
  font-size: 12px;
  border-radius: 15px;
  text-align: center;
  background-color: red;
  color: white;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
}

.cart.on::after {
  opacity: 1;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<button class="add" onclick="cartAdd()">Add-cart</button>

here no need to change your code just i added trigger for first click event and your code is working fine, you can also refer code from jsfiddle

redpajama_set_name: RedPajamaStackExchange


text:
Q: GCM error on receive: Failed to resolve target intent service, skipping classname enforcement I followed the instructions here to set up a client GCM app: https://developers.google.com/cloud-messaging/android/client
I opted to use the standard GCM rather than the new Firebase Cloud Messaging, for now.
My app server is a node.js instance using node-gcm to send push notifications.
My app receives the notifications successfully, however prints out the following errors:
E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

Here are the relevant bits of my AndroidManifest.xml:
<receiver
    android:name="com.google.android.gms.gcm.GcmReceiver"
    android:exported="true"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
        <category android:name="com.example.myapp" />
    </intent-filter>
</receiver>

<service
    android:name="com.example.myapp.gcm.GcmListener"
    android:exported="false" >
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    </intent-filter>
</service>

<service
    android:name="com.example.myapp.gcm.InstanceIDListener"
    android:exported="false">
    <intent-filter>
        <action android:name="com.google.android.gms.iid.InstanceID" />
    </intent-filter>
</service>

<service android:name="com.example.myapp.gcm.RegistrationIntentService"
         android:exported="false" />

My project has all of the above classes (minus GcmReceiver which is provided by Google).
GcmReceiver extends GcmListenerService
InstanceIDListener extends InstanceIDListenerService
RegistrationIntentService extends IntentService
Am I missing anything that might be causing this error? Does the error actually affect anything?


text: Q: How to add automatic description to all shapefiles from the folder name in Google Earth? In Google Earth I have many folders containing many shapefiles, so I would like how to attribute automatically the folder name as a description for all these shapefiles?


text:
Q: unable to render boxplot to html page using python flask
I am trying to render boxplot to html page using python flask. In the code i have imported excel sheet .xls to a data frame. On this dataframe have used pandas boxplot method to get box plot successfully. But when i am trying to render this box plot to html page using flask, i am able to see only box plot grid in html page and not actual box plot.
I have tried to save the box plot image first and then give its image source path in html page. but still unable to render it successfully to html page.
Python code:
from flask import Flask, render_template, send_file, make_response
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from mpl_toolkits.mplot3d import Axes3D
from io import BytesIO
import pandas as pd
plt.style.use('ggplot')

app = Flask(__name__)

@app.route('/do_box_plot/')

def do_box_plot():
    df = pd.read_excel('Path\\sfile_name.xls', sheet_name='Sheet1')
    df.boxplot(by = 'Programming_Language', column =['Entry_ProgrammingScore'], grid = True)
    bytes_image = io.BytesIO()
    plt.savefig(bytes_image, format='png')
    bytes_image.seek(0)
    return send_file(bytes_image, mimetype='image/png')

@app.route('/')
def index():
    return render_template("index2.html")

if __name__ == '__main__':
    app.run(debug = True)

HTML code:
<!doctype html>

BOX PLOT VISUALIZATIONS FOR TEST SCORES

BOX PLOTS

`enter code here`

Expect to render generated box plot to html page using flask. Could anyone help, thanks.


text:
Q: How to update a combo box with a list of items I am trying to update the list of items in one combobox2 depending on the item selected in another - combobox1.
For example, if the user selects a file.mp3 in combobox1 then combobox2 will display a list of audio extension (.aac, .wav, .wma). However, if the user selects a file.flv from combobox1, combobox2 will display a list of video extensions (.mpg, mp4, .avi, .mov).
I initially thought I could accomplish this with if statements. The initial selection works, but there after, if you continue to choose different files, the combobox2 is not updated. I tried using an Event, but it didn't work.
Below if a very stripped-down version of the code so that you can get the gist:
import wx
import os
import sys
import time
from wx.lib.delayedresult import startWorker

class udCombo(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'd-Converter', size=(500, 310))
        panel = wx.Panel(self, wx.ID_ANY)#Creates a panel over the widget
        toolbar = self.CreateToolBar()
        toolbar.Realize()

        font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
        font2 = wx.Font(7, wx.DECORATIVE, wx.NORMAL, wx.NORMAL)

        directory = wx.StaticText(panel, -1, 'Path to media files: c:\\ffmpeg\\bin', (300, 13))
        directory.SetFont(font2)

        convertfile = wx.StaticText(panel, -1, 'File:', (270, 53))
        convertfile.SetFont(font)

        convertfile2 = wx.StaticText(panel, -1, 'Format:', (245, 83))

        #Select Media
        os.chdir("c:\\ffmpeg\\bin")
        wrkdir = os.getcwd()
        filelist = os.listdir(wrkdir)
        self.formats1 = []

        for filename in filelist:
            (head, filename) = os.path.split(filename)
            if filename.endswith(".avi") or filename.endswith(".mp4") or filename.endswith(".flv") or filename.endswith(".mov") or filename.endswith(".mpeg4") or filename.endswith(".mpeg") or filename.endswith(".mpg2") or filename.endswith(".wav") or filename.endswith(".mp3"):
                self.formats1.append(filename)
        self.format_combo1=wx.ComboBox(panel, size=(140, -1),value='Select Media', choices=self.formats1, style=wx.CB_DROPDOWN, pos=(300,50))

        self.Bind(wx.EVT_COMBOBOX, self.fileFormats, self.format_combo1)

        self.format_combo2=wx.ComboBox(panel, size=(100, -1),pos=(300,81))
        self.Bind(wx.EVT_COMBOBOX, self.fileFormats, self.format_combo2)

    def fileFormats(self, e):
    myFormats = {'audio': ('.wav', '.wma', '.mp3'), 'video': ('.mpg', '.mp4', '.mpeg')}
    bad_file = ['Media not supported']
    myFile = self.format_combo1.GetValue()
    f_exten = [x for x in myFormats['audio'] or myFormats['video'] if myFile.endswith(x)]

    if f_exten[0] in myFormats['audio']:
        self.format_combo2.SetItems(myFormats['audio'])

    elif f_exten[0] in myFormats['video']:
        self.format_combo2.SetItems(myFormats['video'])
    else:
        self.format_combo2.SetItems(bad_file)

if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = udCombo()
    frame.SetSizeHints(500,310,500,310)
    frame.Show()
    app.MainLoop()

Traceback error:
Traceback (most recent call last):
File "C:\Users\GVRSQA004\Desktop\udCombo.py", line 86, in fileFormats
if f_exten[0] in myFormats['audio']:
IndexError: list index out of range

A: Use a dictionary to hold the two lists. Then when the user clicks something in the first widget, you can call the second combobox's SetItems(myDict[selection]) method or something along those lines. The error message is because you're trying to do something with a CommandEvent that it doesn't support. They don't have an "rfind" attribute, for example.
EDIT: The new code the OP posted doesn't work because it's only running the list comprehension against the first half of the OR statement. It never runs against the "video" portion, so it returns an empty list if the user chooses anything with a video format extension. It WILL work if you select an audio selection.
Personally, I would recommend creating a video extension list and an audio list. That would be easier to understand in the future should you need to fix it later.


text:
Q: Set environment variables within SSH Session I have a situation where I have a host machine where I need certain applications installed with side by side versions. Obviously only one can get added to the exports to run by default. As an example we might say it's Python 2.7, Python 3.5, & Python 3.7.
I need to be able to establish an SSH connection to the host, where each connection can set the correct path for the specific version that is required. Is there an easy way to do this. The key here is that each connection cannot affect either the host itself or other connections. Someone running on the host itself shouldn't break because the path was updated by a remote connection.

A: For the case of multiple (python and other) hierarchies, and assuming that the tools are invokes by the tool name (python ...), prepending the preferred path to the system path will provide a way to specify per-instance tool setting, without having side effect between jobs.
ssh ... 'PATH=/path/to/python3.1/bin:$PATH command'

Depending on the number of tools, and complexity of the setup, you might want to implement this as a wrapper
ssh ... '/path/to/run-with-pkgs python-3.2 pkg2 -- command'

With the pkg-setup script source various config script. Something along the lines of:
run-with-pkgs

#! /bin/bash
while [ $# -gt 0 ] && [ "$1" != "--" ] ; do
   source "/path/to/setup.d/$1.sh"
   shift
done
if [ "$1" = "--" ] ; then
    shift
    exec "$@"
fi


text:
Q: apache(cpanel) + mod_wsgi + Python3 + Service Temporarily Unavailable Goodnight everyone. I'm trying to do the deployment of an application developed with django in a VPS. This VPS has installed centos 6.8. Apache is configured through the cpanel. After installing python3 and wsgi proceeded to configure the icnlude of the virtual host, which was as follows:
<ifmodule mod_wsgi.c>

    WSGIDaemonProcess pruebas.caso.org python-path=/home/admin/pruebas.org/envSpf/spf:/home/admin/pruebas.org/envSpf/lib/python3.5/site-packages/
    WSGIProcessGroup pruebas.caso.org
    WSGIScriptAlias / /home/admin/pruebas.org/envSpf/spf/spf/wsgi.py

</ifmodule>

Alias /static "/home/admin/pruebas.or/envSpf/spf/static/"
<Directory /home/admin/pruebas.or/envSpf/spf/static>
    Require all granted
</Directory>

Alias /media "/home/admin/pruebas.or/envSpf/spf/media/"
<Directory /home/admin/pruebas.or/envSpf/spf/media>
    Require all granted
</Directory>

<Directory /home/admin/pruebas.or/envSpf/spf/spf>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

With this configuration at the moment the server gives me the following response in the browser request:

Service Temporarily Unavailable The server is temporarily unable to
  service your request due to maintenance downtime or capacity problems.
  Please try again later. Additionally, a 503 Service Temporarily
  Unavailable error was encountered while trying to use an ErrorDocument
  to handle the request.

The VPS provider is not very helpful and the error log refers to another domain (?? !!!). I would appreciate any guidance that could help me resolve this inconvenience.


text:
Q: How to get instances class name
In a class function i need to know if the current class is called by another class.
Debugging with netbeans/xdebug i can see this class instance has a property called *yii\base\Model*__instances (the current class extends yii\base\Model).
*yii\base\Model*__instances is an array and inside there's an instance of the different classes.
How can i get the key or classname of the first element of this array? (in this case app\models\User)
Can i access __instances at all?

A: As above. What is the actual problem you face? To get class in php you can find built-in get_class http://php.net/manual/en/function.get-class.php .
To access the first element of sequential (indexed) array it would be $array[0] , in php 7.3 an above you could use http://php.net/manual/en/function.array-key-first.php , on associative array in previous versions of php you could simply iterate over and get the first one.


text:
Q: How can I display a Angularjs Object? How do I display the content of a AngularJS Object in a string format like when we alert a variable?

A: Depending on what you want from an object either:
$log.debug('Some message', theObject);

Advantages: you can leave it inproduction but disable output using $logProvider and for most browsers the object displays collapsed until you expand it. The disadvantage is that you have to find an appropriate place to insert the call and you may get a torrent of debug messages more than you want.
Or you can use $log.error() which at least on Chrome has the advantage of including a stacktrace in the console log.
Or, insert into your html:
<pre>{{theObject|json:4}}</pre>

The advantage is the current value is present in your page, it's always there so you can look at it whenever you want and there's no torrent of messages. Disadvantages are that the object has to be convertible to json, you won't see all of the properties (e.g. any functions it contains or properties beginning with '$'), you have to store the object in a scope, and you don't get the history.

A: You should use console.log instead of alert. It's more flexible. You will see logged values in browser console.


text:
Q: Building multiple outputs through the same build process with external config I'm trying to leverage GruntJS to create a build process that is uniform across multiple teams and projects at my company. The idea hear is that we have a config file for each application that only specifies the files that need to be processed and what bundles they need to be concatenated into at the end. The build process would be the same for all apps: pick up the config for the app, process files in each bundle using a uniform build process.
For Example:

*

*asset.json config file specifies two bundles, "main" with 1.js + 2.js and "secondary" with 2.js and 3.js

*Build process says for each bundle, preprocess, minify, then concatenate into a js file based on the bundle

*Get output of "main.js" and "secondary.js"

The problem I'm running into is that Grunt takes a "static" configuration and executes it. I've already abstracted out the building of the configuration so that I can add chunks dynamically, but right now I don't see a better way forward than literally looping over each bundle and building out a unique task for each section of the build process for each bundle, building up queues of tasks to execute, and then running each task in the queues during the build process. Its definitely possible, but its a lot of manual work and seems prone to breaking. Is there way to just execute each task in order as I loop over the bundles? Any better way to achieve the same net result of config + source in, N bundles out?
I want to be clear that I am fully aware that Grunt CAN build multiple files. What I'm trying to do is separate the specification of how many bundles from the build steps themselves. Grunt core has to bake these two things together which means each project would have to go in and alter their build steps rather than an external configuration. As per the example above, I should be able to swap out the asset.json file specified in step 1 for any config file that has 1, 2, 3, ... N bundles with N files in each one (and potentially specifying a "type" like scripts or styles).

A: Edit 10/12/13: The Nitty Gritty posted an article yesterday that might be another approach to tackling your issue.

This can be done by passing the module name you want to build as a command line argument and loading in the whole assets file in your grunt config. Please note this is example code, I have not tested this, so it's possible you need to set paths etc. correct for your case.
Start with updating the assets.json file to a plain JavaScript file, and reform it like so:
module.exports = {
    main: ["1.js", "2.js"],
    secondary: ["2.js","3.js"]
}

Next, you can pass a command line argument to Grunt, which should specify one of the module names in assets.js. Example:
grunt --bundle=main

Now, you'll need to load in the assets.js file in the Gruntfile:
var assets = require('./assets'); // assuming assets.js is on the same level as your Gruntfile

And then you can get the argument name by using:
var bundle = grunt.option("bundle");

Now you can use bundle as your output file name and assets.bundle to get the array files for that bundle.


text:
Q: How to use Kernel Density Estimation for Prediction? I would like to apply KDE to inventory replenishment, but I am not sure how to use the analysis to predict future sales based on past sales. Given a set of data and having applied KDE to it (probably using a Gaussian distribution), how do I make a prediction about the future?
Thanks for any help! Please let me know if I can clarify - I'm only starting to pick up the language for talking about KDE ... I'm glad to do reading on my own - pointers to any resources would be welcome.

A: You can use conditional kernel density estimation to obtain the density of sales at time $t+h$ conditional on the values of sales at times $t, t-1, t-2, \dots$ This gives you a density forecast rather than a point forecast. The problem is that the conditioning is difficult in a density setting when the number of conditioning variables is more than 2. See this paper for a discussion of the basic idea.
An alternative procedure that imposes more assumptions (but allows more conditioning variables) is to fit an additive autoregression such as described in Chen and Tsay (1993) and then use kde on the residuals to obtain the forecast densities.
However, I suspect that both of these are more complicated than what you really want. I suggest you read a textbook on demand forecasting such as Levenbach and Cleary (2006).

A: I would have thought that KDE bear little if any relationship to predicting future sales based on past sales. Sounds more like time series analysis to me, though that's really not my area.


text:
Q: Output to devices in Assembly I was wondering how, exactly, one is able to read and write directly to and from I/O devices using assembly or C with no system libraries. I know, for instance, that you can render to text-based VGA in x86 real mode by writing character data to 0xB8000. But how do you gain access to other devices, on other CPU architectures? Are they all memory-mapped from the start, or are there tricks to get them to be when you need them?
Specifically, I would like to know, in C or ARM asm, how would I read/write to vga in text mode, a usb port, and a ps/2 port. I don't need to know about the standard communication protocols, I can figure that out on my own. I would just like to know how to identify and communicate with ports and other devices.
For the compiler and assembler, I am using a cross-compiled GNU toolchain running on x86_64 as the host architecture. I don't have any libraries or an operating system on the target machine, so I am really just making flat binaries and writing them to the boot sector of an sd card. The hardware is a raspberry pi model b.

A: If you are asking this level of question, vga text mode is a long long way away from the first thing you should be trying.  Although that depends on your platform of course.  If this is a raspberry pi, then I would still start with blinking leds and then the uart, then do video if you so desire, video on the raspberry pi is quite trivial.   Text mode, there isnt, you have to draw the pixels, but with a little experience with raster based fonts (do this on your x86 machine make bitmaps or print strings of xxes and 00s or something) you can easily come up with a font set and then for each character just draw the pixels.
The language has little to do with it, C or asm work fine, most folks do C and asm only when needed, that is the recommendation I would give as well.
I have many bare metal examples (github.com/dwelch67), one of which for the gba does a little bit of font stuff with an 8x8 font, which you can steal from me I dont care.  I have yet to actually do the raspberry pi video stuff, but there are soo many examples, you go through one gyration to get a pointer in the arm address space (And set the video mode, etc) and then it is just a matter of writing pixel data to that memory range and the gpu echos it to the video card.
the beaglebone black or one of the allwinner cards (pcduino, apc.io) (I would avoid those due to lack of documentation) could be used, they have different video interfaces than the raspberry pi, so more work is involved.  I have yet to figure out the beaglebone black for bare metal, and have some allwinner info but have not done any real bare metal there.  So dont buy unless you know someone else has done it.  Actually the early ipods, classi gen 1 - at least 5, the ipod nano gen 1, are not hard to do video with if video is really what you are after.  The gameboy advance is pretty easy and there are gazillions of examples and visualboyadvance is a good simulator so you dont really need hardware you can start writing arm code to draw pixels right now.
the hawkboard and pandaboard are also something you might want to look at I think both have video, I have a couple of hawkboards and bare metal is easy, dont have a pandaboard.  I have also used a open-rd board, dont remember what it has on it...
If you want a pc like experience with pcie cards that is a lot more work you have to setup the root complex, reset and train the endpoints, configure them, then you can talk to them and depending on the video chip/board determines how much work is involved in even the simplest video task.  (if the video card uses system memory then you have to bring that up, if it is ddr then pcie is very trivial compared to bringing up ddr).
start with the game boy advance simulator.

A: Actually, what you say about VGA is only partly true; in real mode, that is correct.  History lesson: the reason that DOS only provided 640K of memory was to reserve the remaining addressable memory for device drivers.  This is the same reason that the Linux kernel is compressed; until the processor is switched into protected mode, in which case, every process has it's own virtual memory space.  Device drivers (basically) work by, at some level, translating calls to the driver to actual getting and putting of data to the hardware buffer of the device.
tl;dr.  What you're asking is specific to the hardware and OS you're writing to.  Sorry I can't be more specific.

A: You could start by a) choosing an assembly architecture e.g. MIPS or likewise. If you have not programmed assembly before I suggest you choose MIPS since it is easier than x86 and then b) looking at how to transfer data with the serial port to begin with since this illustrates memory-mapped i/o that is used. FPGA is a nice way to learn this if you are training.
To write to hardware, you do write to certain memory addresses using memory-mapped i/o. I could not find any documentation how ARm does it, but in Nios 2 assembly, which is a RISC, writing to hardware is for example: writing the value 0x17 to address 0x810 will light LEDs LEDR4, LEDR2, LEDR1, and LEDR0 and the serial port also has a memory address that you can write transmit data to.


text:
Q: Xcode 4.1 with more than 400 compiling errors Probably is a stupid thing but I'm quite new with Xcode... Today I've updated to OS X Lion and XCode 4.1 but now when I try to compile my iPhone app more than 400 compiling errors appear, some of them are even from sqlite3.h, CLLocation.h and other original libraries from Apple. All errors seem to be originated by a problem with #import ...
Yesterday I was working with OS X Snow Leopard with Xcode 4.0 and all was fine. I'm using GCC 4.2 compiler in Xcode and I haven't change any configuration on Xcode or my app.
Here are some errors:
http://img10.imageshack.us/img10/7585/screenshotyum.png
Help please!
UPDATE:
Ok, I solved the problem. It was not related with the compiler version or the base SDK, the error was that Xcode 4.1 doesn't accept the #import "/usr/include/sqlite3.h", it has to be change to #import <sqlite3.h>
More info here (only Apple Developers)
Hope this will help to other people.

A: This caused me some serious headaches so thanks for posting! To clarify, after updating to Lion and Xcode 4.1 I had 400 errors because of: #import "/usr/include/sqlite3.h" but changing it to #import <sqlite3.h> solved it! Took me ages to figure this out!!!


text:
Q: Rascal access the REPL from a java application Has anyone attempted to "link" in the Rascal command line jar in a java executable and call REPL commands from this java executable?
I found a similar question on stackoverflow (Running a Rascal program from outside the REPL), but that doesn't go into details unfortunately.
I also checked the Rascal tutor site, but couldn't find any examples on how to do this. Tijs told me that it's something along the lines of "instantiate an interpreter and then call the import() function, after which the call() function can be called to inject REPL commands).
Is there any example code on how to do, e.g. the following from the tutor site on the REPL but from a java programming context instead of on the command line:
rascal>import demo::lang::Exp::Concrete::NoLayout::Syntax;
ok
rascal>import ParseTree;
ok
rascal>parse(#Exp, "2+3");
sort("Exp"): `2+3`

A: The following would do the trick; a utility class for the same can be found in rascal/src/org/rascalmpl/interpreter/JavaToRascal.java:
GlobalEnvironment heap = new GlobalEnvironment();
IValueFactory vf = ValueFactoryFactory.getValueFactory();
TypeFactory TF = TypeFactory.getInstance();
IRascalMonitor mon = new NullRascalMonitor();
Evaluator eval = new Evaluator(vf, new PrintWriter(System.err), new PrintWriter(System.out), new ModuleEnvironment(ModuleEnvironment.SHELL_MODULE, heap), heap);

eval.doImport(mon, "demo::lang::Exp::Concrete::NoLayout::Syntax");
eval.doImport(mon, "ParseTree");
eval.eval(mon, "parse(#Exp, \"2+3\");", URIUtil.rootLocation("unknown"));

There is also more efficient ways of interacting with the evaluator, via the pdb.values IValue interfaces to build data and ICalleableValue to call Rascal functions. You can use the above heap object to query its environments to get references to functions and you can use the low level pdb.values API to construct values to pass to these functions.
Caveat emptor: this code is "internal" API with no guarantee for backward compatibility. I can guarantee that something like this will always be possible.


text:
Q: How to automatically print on GUI upon opening? When I start my program, date should be printed on label named dan.Text automatically but it prints only when I make mouse click input on GUI.
How do I fix that ?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace VremenskaPrognoza
{
    public partial class vremenskaPrognoza : Form
    {
        public vremenskaPrognoza()
        {
            InitializeComponent();
        }

        private void vremenskaPrognoza_Load(object sender, EventArgs e)
        {

        }

        private void ime_grada_Click(object sender, EventArgs e)
        {

        }

        private void dan_Click(object sender, EventArgs e)
        {

            Console.WriteLine(dan.Text = DateTime.Now.ToString("DDDD/MM/YYYY"));

        }
    }
}

A: Put the dan.Text assignment in the form Load event:
private void vremenskaPrognoza_Load(object sender, EventArgs e)
{
  dan.Text = DateTime.Now.ToString("DDDD/MM/YYYY");
}

Or in the form Shown event:
private void vremenskaPrognoza_Shown(object sender, EventArgs e)
{
  dan.Text = DateTime.Now.ToString("DDDD/MM/YYYY");
}

Here is the chain of calls:

*

*Constructor : prefered place to instantiate objects and initialize UI instances.

*Load : prefered place to create and initialize non designer UI objects or complete them like populating combobox or dataset.

*Activated : prefered place to do things each time the form is activated and get focus.

*Shown : prefered place to do things after the form is showned like open another form or show a info box.

The difference between using constructor, load or shown is mainly to have a clean code design and a smooth UI behavior.
There is no real difference between putting code in the constructor or in the load, but if an exception occurs in the constructor it is more serious than in the load.
https://learn.microsoft.com/en-us/dotnet/framework/winforms/order-of-events-in-windows-forms

A: Put the code to be executed into the Form.Shown Event.
It is very important to put it in the right event. Putting it in a event that is too early, can cause the code to run before the elements it tries to access have been added/initialized or cause similar sequence issues. And it is the last event of a Form opening for the first time.
Once you do use the same code in 2 places, it is usually beneficial to have a subfunction for this. Some like "update_dan()" perhaps? You can then call that function in the click and/or shown event handler.

A:
When I start my program, date should be printed on label named dan.Text automatically but it prints only when I make mouse click input on GUI

This is because you only put code in the private void dan_Click(object sender, EventArgs e) event, it will only ever work in this event.
Firstly, in your code, you have wrapped an assignment in Console.WriteLine and it's not like you think it would. What's happening is the assignment does happen, but then the Console.WriteLine happens which is the result of dan.Text.
Your button text would look like:
 DDDD/10/YYYY

Not what I think you'd want; it doesn't even print out a DateTime. I think wrapping the whole thing is a type-o to be honest, just remove it. So it would look like this now:
 da.Text = DateTime.Now.ToString("DDDD/MM/YYYY");

If you want to assign something to the dan.Text property at load time, there are more than a few event's to do this as already mentioned.
One recommendation that hasn't been mentioned is overriding the OnLoad event. This would look like:
 protected override void OnLoad( EventArgs e)
 {
    base.OnLoad(e);
    // do something here?
 }

Using the event is only appropriate when another class would be interested in the event. Which is what events are for. Another class being interested in the Load event is very rare, only really useful to do window arrangement stuff.
Still, the Load event works well with the designer and programmers are very comfortable with it. It isn't horribly wrong, you'd only get in trouble when you start inheriting the form and code doesn't run in the right order.
Most code that now gets put in the Load event really belongs in the constructor.

On a final note about the DateTime.Now.ToString("DDDD/MM/YYYY"), it's not even a valid format. To see what ones are, please see there and or here.
References:
Form_Load() 'event' or Override OnLoad()

A: We rarely refer to a console applicaiton as a GUI, but sure I will bite.
Move your Console.WriteLine out of the "CLICK" event and into the load event.


text:
Q: ASP.NET cannot connect to 64-bit Sql Server 2008 We have an ASP.NET application written in Visual Studio 2003 (c#) using SQL Server 2000 as database. It's an old web application that our clients have been using for 4+ years.
Now, we needed to upgrade the application to work on Windows Server 2008 using SQL Server 2008, both 64bit, both on the same machine. So we ported the application to Visual Studio 2008, made some needed modifications and successfully installed the application on Windows Server 2008 with database still being the old SQL Server 2000. Everything worked fine. But as soon as I modified the connection string to work with the new SQL Server 2008 64bit, it stopped working. Basically the web browser just shows – The webpage cannot be displayed; no error messages whatsoever.
I monitored the processess and event log - basically it seems that asp.net worker process is generating errors until it stops working. And I can't figure out why. All should be fine on SQL Server 2008 side, all protocols enabled, even disabled  firewall; i can connect to the instance using Management studio from the same server (64bit) and from other development machines (64bit/32bit).
Then i tried using the web application from my development machine (still Vistual Studio 2003 one, i.e. 32 bit with ASP.NET 1.1) and connect to the new SQL Server 2008 and i got "Server application unavailable" error. Same thing happens, worker process is generating errors until it stops working.
I used IIS Diagnostic Tool to debug the moment the error occurs – all i got was basically unlimited numbers of "First chance" exceptions (problems with msvcr80.dll, mscorwks.dll). If I limited the number of those, I also managed to get "Kernel32!TerminateProcess" exception, which after analysis stated that it didn't detect any problems with that; only one time i got the warning, describing that 1 client connection was executing for more than 90 seconds.
I dont think the problem is on the 64bit Windows server 2008 or SQL server 2008 side, since when, just for checking, we used Sharepoint application with the new SQL Server 2008 as database, it connected just fine.
So what am I missing with our ASP.NET application configuration/development that it cannot connect to 64 bit Sql server 2008?
Thanks and regards,
  Martin.

A: This sounds like a configuration problem, probably a permissions problem. Your Sql Server is on a different box than the your web server? If so I would look at what user your web site is running under. Make sure that user has access to the Sql Server.
If your user does have access make sure it has access to travel the wire to your SQL Server. Try to connect to the SQL Server via Sql Management Studio with the user's credentials.


text:
Q: My Cloned WP site keeps redirecting to the old one This is my website: http://thiencheong.com.my/, I created my WP site at first at the ver2 directory, and when I'm ready for it to go live I cloned it over to the main directory.
But now whenever I'm accessing http://thiencheong.com.my/ the website automatically redirects to http://thiencheong.com.my/ver2/
I checked the database and for both home and siteurl both are http://thiencheong.com.my/
There's no redirect set up on my domain and the .htaccess looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

Any help will be greately appreciated, thanks!

A: Did you try to clear your cookies and history? It's working fine here.


text:
Q: Javascript else loop executing after if loop executes I have an index.js file with API's that upload a gameData model to a mongoDB:`

var gameValue = require('../models/gameValues');

router.post('/add_game_to_dB', function(req, res, next) {
    newGame = new gameValue(req.body);
    newGame.save(function (err, game) {
        if (err)
            throw err;

        res.json({
            "id": game._id
        });
    });
});

Then I have a .js file that takes detected if a button id clicked and uploads the game to the database:

$("#upVoteBattlefieldOne").click(function(event) {
  console.log(event.target.name);
  var newGameName = $("#BattlefieldOne .panel-heading").text();
  newGameToDatabase(newGameName);
});

$("#upVoteBatmanTheEnemyWithin").click(function(event) {
  console.log(event.target.name);
  var newGameName = $("#BatmanTheEnemyWithin .panel-heading").text();
  newGameToDatabase(newGameName);
});

function newGameToDatabase(name) {
  $.get("/get_gameValues", function(data) {
    if (data.length == 0) {
      $.post("/add_game_to_dB", {
        gameName: name
      }, function(result) {
        alert("Upvoted " + name);
      });
    }
    for (var i = 0; i < data.length; i++) {
      if (name === data[i].gameName) {
        alert("game is in database already");
        return;
      } else {
        $.post("/add_game_to_dB", {
          gameName: name
        }, function(result) {
          alert("Upvoted " + name);
        });
      }
    }
  });
}

The javascript seems to work for the first game I click. For example, if I click battlefield one, it adds it to the database if its not already there. After battlefield one is on the database, it detects that the document with the name attribute of "battlefield one" is on the database and alerts the user that the game is already in the database. Once I click on the other game i.e batman the enemy within, it adds that other game to the database if its not already there. If I click on the button to add that game(batman the enemy within) to the database again, it acknowledges that the game is on the database, but then it adds the game to the database again. It executes the if loop on line 23, and also executes the else loop as well. I tried to include a return statement to exit out of the function if the if loop conditions are met, but it seems to ignore this return statement and execute that else loop anyways. The reverse happens if I click on batman, then battlefield one has this issue. I'm new to node js and javascript so I might be making a silly mistake, but I've looked at this for a long time and I can't seem to figure it out

A: I guess you should use variable for mark existing state and use break in loop.

function newGameToDatabase(name) {
  $.get("/get_gameValues", function(data) {
    var alreadyExist = false;

    for (var i = 0; i < data.length; i++) {
      if (name === data[i].gameName) {
        alert("game is in database already");
        alreadyExist = true;
        break;
      }
    }

    if (!alreadyExist) {
      $.post("/add_game_to_dB", {
        gameName: name
      }, function(result) {
        alert("Upvoted " + name);
      });
    }
  });
}


text:
Q: GWT Multiple Independent Entry Points I"m working on a GWT application that has three different areas (top nav bar, content pane, and bottom panel) on the page that are more or less independent of each other. One area is updated based on the action from the other area; for example, clicking on a link at the top nav bar will update the content area with the relevant info. The bottom panel is totally independent of the others and only updates itself upon some server push.
I'm thinking of having three modules or three entry points in one module for these three areas. The problem I'm facing is "how can I refresh only the content pane while at the same time supporting history stack?" It's probably similar to Gmail app: clicking on Inbox or Sent only refreshes the list of emails but not the other parts of the screen.
I know I can easily do the refresh part in JavaScript. My concern is how to support the history stack. Thanks!

A: Did you take a look at the Activities and Places framework? This approach totally solves your problem while taking care of the history stack for you.
In short, you only need a single entry point. Your application would be divded into three display areas. And each display area is a container for an "Activity" where the activity decides what gets displayed.
If you click on a link in the nav bar you go to a new "Place" which might update the Activity in the content pane or even start a different Activity there (e.g. going from Inbox to Outbox will discard InboxActivity and start an OutboxActivity). Going to a new place will also update the URL and thus handle the back button.
This will make more sense to you if read the documentation and maybe this article.


text:
Q: "Direct" derivation of exponential form of the Riemann zeta function. There is the identity
$$ \zeta(s) = \exp\left(\sum_{n=2}\frac{\Lambda(n)}{\log(n)} n^{-s}  \right) $$ for $\Re(s)>1$. Apparently there are quite a few possibilities to derive this. I am out to "try to prove this identity directly, at the level of formal Dirichlet series, using the fundamental theorem of arithmetic of course." as is suggested here.
Since the von-Mangoldt function $\Lambda$ is zero for all n except those which are powers of a prime, I start with
$$ \exp\left(\sum_{n=2}\frac{\Lambda(n)}{\log(n)} n^{-s}  \right) = \exp\left(\sum_{p,\alpha}\frac{\Lambda(p^\alpha)}{\log(p^\alpha)} (p^\alpha)^{-s}  \right) $$
$$ = \exp\left(\sum_{p,\alpha}\frac{1}{\alpha} p^{-\alpha s} \right) $$
$$ = \prod_{p}\exp \sum_{\alpha} \frac{1}{\alpha p^{\alpha s}}.$$ Thats about as far as I get.
(I hope that has not been asked, yet).

A: using $\sum_{k=1}^\infty \frac{1}{k}z^k = \log\frac{z}{z-1}$, gives
$$ \prod_{p} \exp \sum_\alpha \frac{(p^{-s})^\alpha}{\alpha} = \prod_{p} \exp ( \log(\frac{p^{-s}}{p^{-s} - 1})) = \prod_p \frac{1}{1-p^{-s}} = \zeta(s).$$


text:
Q: JNA mapping to pass in/out buffer to winapi function I need to enumerate hardlinks to files in a Java app for Windows. I considered using Runtime with fsutil hardlink list, but requires administrative privileges.  That led me to WINAPI (ugh).  The Kernel32.dll functions, FindFirstFileNameW and FindNextFileNameW should do this, but I'm having trouble with calling it via the JNA API. FindFirstFileNameW has the specification:
HANDLE WINAPI FindFirstFileNameW(
 _In_     LPCWSTR lpFileName,
 _In_     DWORD dwFlags,
 _Inout_  LPDWORD StringLength,
 _Inout_  PWCHAR LinkName
);

My JNA mapping:
public interface Kernel32 extends StdCallLibrary {
    Kernel32 INSTANCE = (Kernel32)Native.loadLibrary("kernel32",Kernel32.class, W32APIOptions.UNICODE_OPTIONS);
    HANDLE FindFirstFileNameW(WString wString, int dwFlags, IntByReference StringLength, ______ LinkName);

    boolean FindNextFileNameW(HANDLE hFindStream, IntByReference StringLength, ______ LinkName);
    boolean FindClose(HANDLE hFindFile);
    int GetLastError();
}

Relevant parts of calling function:
public String[] getHardLInks(Path path)
{
  Kernel32 lib = Kernel32.INSTANCE;
  IntByReference stringLength = new IntByReference();
  ______ linkName = ______;
  HANDLE hFile = lib.FindFirstFileNameW(new WString(path.toString()), 0, stringLength, linkName);
  String hardlink = //Convert linkName to String
  //Add to array
  // Loop through FindNextFileName
  //Close handle
}

The blanks are where I've tried mapping LinkName, "a pointer to a buffer to store the first link name found for lpFileName", to many things, unsuccessfully.  That includes, strings, char[], byte[], Buffer, Pointer, and Memory, but nothing ever comes back from the call. I believe the rest to be correct from the return values I get from StringLength in testing.  However, GetLastError always returns ERROR_MORE_DATA (234), which according to the documentation means the buffer is too small, even when I've passed in kilobytes of Memory.
What datatype should I be using and how do I get it back into a String?

A: PWCHAR => char[], although NIO Buffers or memory will also work (just keep in mind that Buffer and memory count in bytes, while the API expects the count in chars).
You also need to initialize the IntByReference to the size of your array, otherwise you're telling the API that your buffer is of size zero, and it will obediently fill your buffer with exactly zero characters.
Like most MS API functions of this sort, you can probably pass null for the buffer and then it'll write the required buffer size into your length reference.
EDIT
One other thing - since you're (correctly) using W32API_UNICODE_OPTIONS to initialize your library mapping, String will now automatically be mapped to wide character strings (so you don't have to use WString), and the -A/W function suffix is taken care of automatically, so you can drop the -W suffix from your method names.


text:
Q: Characterizing $x y \equiv r \pmod{a^n}$ when $a^{n-1} \leq x, y < a^n$ Let $x, y \in \mathbb{Z}$ such that $a^{n-1} \leq x, y < a^n$ for some fixed positive integers $a$ and $n$. Is there a nice characterization of the remainders $r$ satisfying $x y \equiv r \pmod{a^n}$? Further, given $r$, under what conditions does $x y \bmod a^n < r$ hold?
Number theory isn't my specialty, so any pointers would be appreciated. I would ideally be looking for an answer that doesn't rely on factoring, if possible.


text:
Q: MySQL subquery within self join or alternative? I'm trying to form a query for our scholarship fundraising club that returns all ticket sales to a dinner event, as well as indicates whether or not each member who's purchased tickets is current on her dues (paid within last 365 days).  This will be used for a sign-in sheet that indicates how many tickets have been purchased and whether we need to ask them to renew their membership yet, update their contact info, etc.  I can return either ticket sales or active memberships, but I can't figure how to incorporate both queries into a single query so I won't have to use a PHP array.  Hopefully someone can help:
/* Here are excerpts from the relevant tables */
+----------+  +--------------------+  +--------------------------+
| members  |  | store_transactions |  | store_product_categories |
+----------+  +--------------------+  +--------------------------+
| id       |  | id                 |  | id                       |
| last     |  | invoice            |  | category                 |
| first    |  | memberID           |  | officeID                 |
| spouse   |  | categoryID         |  | modified                 |
| lifetime |  | productID          |  +--------------------------+
| email    |  | name               |
| phone    |  | price              |  +-------------+
| created  |  | quantity           |  | pmt_methods |
+----------+  | addedBy            |  +-------------+
              | pmtMethod          |  | id          |
              | created            |  | method      |
              +--------------------+  +-------------+

/* The 1st query returns all Muster ticket sales w/whom added (auto transaction via website or manual via club officer) and method of pmt (RSVP only, cash, etc) */
SELECT member.last, member.first, member.spouse,
       member.email, member.phone,
       SUM(transaction.quantity) dinnerTix,
       SUM(transaction.price * transaction.quantity) total,
       IF (addedBy = '0' OR addedBy IS NULL, 'Website',
           CONCAT_WS(' ', officer.first, officer.last))
           AS addedBy, method
FROM store_transactions AS transaction
LEFT JOIN members AS member ON transaction.memberID = member.id
LEFT JOIN store_product_categories ON transaction.categoryID =
          store_product_categories.id
LEFT JOIN pmt_methods ON transaction.pmtMethod = pmt_methods.id
LEFT JOIN members officer ON officer.id = addedBy
WHERE categoryID = '2'
    AND year(transaction.created) = '2015'
    AND (name LIKE '%member%')
GROUP BY CONCAT(member.last, '_', member.first)
ORDER BY member.last, member.first;

The 1st query returns something like this:
+------+-------+--------+-------------+--------------+---
| last | first | spouse | email       | phone        |
+------+-------+--------+-------------+--------------+---
|  Doe | John  | Jane   | abc@abc.com | 123-456-7890 |
+------+-------+--------+-------------+--------------+---

---+-----------+--------+-----------+--------+
   | dinnerTix | total  | addedBy   | method |
---+-----------+--------+-----------+--------+
   |     5     | 150.00 | President | cash   |
---+-----------+--------+-----------+--------+

/* This 2nd query returns all active members, adding 1 year to last membership purchase to show annual membership expiration */
SELECT last, first,
    DATE_FORMAT(ADDDATE(store_transactions.created, INTERVAL 1 YEAR),
        '%M %e, %Y') AS expires
FROM store_transactions
LEFT JOIN members ON store_transactions.memberID = members.id
WHERE store_transactions.created >= SUBDATE(CURDATE(), INTERVAL 1
    YEAR) AND categoryID = 1 OR lifetime = 'Y'
GROUP BY members.id
ORDER BY members.last, members.first;

The 2nd query returns something like this:
+------+-------+-------------+
| last | first | expires     |
+------+-------+-------------+
|  Doe | John  | May 3, 2015 |
+------+-------+-------------+

I thought it would be simple to combine the two queries so the expiration date returned in the second query would be appended to each row of the first query result.  Unfortunately, I'm chasing my tail here, so any help would be greatly appreciated!  This was my first foray into self-joins and table aliases, so I'm trying to expand my horizons without breaking the site which has been operating smoothly for the last 8 years!  Thanks!!

A: It should be easy. Lets say Q1 = your first query, and Q2 = your second query. it should be as simple as:
select q1.*, q2.expires
  from (Q1) q1
    inner join (Q2) q2
      on q1.last = q2.last and q1.first = q2.first

Simply copy and paste your first query where Q1 is, inside the parenthesis, and do the same for your second query into Q2
Of course, this will break if there are two people with the same name, in which case you would be better off including the id field in both queries, and joining on that.


text:
Q: Is it possible to wso2is scim interface by using oauth clientid and client secret I am using wso2is 5.4 and want to access the scim2 rest API. I am able to do so by using basic authorization and bearer token, but I would prefer to do it by using client id and client secret. Is there a way to do this?
Thanks
 Clemens

A: You can use Client Credentials Grant [1] to get a bearer token and use that to access the SCIM2 endpoint.
[1] https://docs.wso2.com/display/IS540/Client+Credentials+Grant


text:
Q: Python - SSL: CERTIFICATE_VERIFY_FAILED I have a python script that uses the VirusTotal API.  It has been working with no problems, but all of a sudden when I run the script I am getting the following error:

urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

I believe it may be our web proxy that is causing the issue.  Is there a way to prevent it from verifying the cert?  Here is the portion of the code that uses the API:
json_out = []
url = "https://www.virustotal.com/vtapi/v2/file/report"

parameters = {"resource": my_list,
              "apikey": "<MY API KEY>"}

data = urllib.urlencode(parameters)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
json_out.append (response.read())

A:
I believe it may be our web proxy that is causing the issue.  Is there a way to prevent it from verifying the cert?

If you assume that a SSL intercepting proxy is denying the connection then you have to fix the problem at the proxy, i.e. there is no way to instruct the proxy to not check the certificate from your application.
If instead you assume that there is a SSL intercepting proxy and thus the certificate you receive is not signed by a CA you trust then you should get the CA of the proxy and trust it in your application (see cafile parameter in the documentation). Disabling validation is almost never the right way. Instead fix it so that validation works.

A: There are two possibilities,

*

*You are using a self-signed certificate. Browsers don not trust on such certificate, so be sure that you are using CA-signed trusted certificate.

*If you are using CA-signed trusted the certificate that you should have to check for install CA chain certificates (Root and Intermediate certificate).

You can refer this article, it may help you. - https://access.redhat.com/articles/2039753


text:
Q: Where are variables and watches in the Xcode debuggger? I am in the Xcode debugger.  I do see the console print outputs and the llvm at the bottom . But the debugger buttons and most notably the variables/watches are not showing. I have looked through all the menu options and clicked on many tiny icons trying to discover how to have them show.

What is the IDE command to show the debugger variables and watches?

A: It's the middle of these three icons:


text:
Q: How to migrate from Evolution with Maildir to Thunderbird
Possible Duplicate:
Migrating from Evolution to Thunderbird

After Upgrading to 11.10 Evolution convert at first start the my Mails into the Maildir format.
Now I want to change my Mail Program to Thunderbird. Is there any Migration Guide (maybe a official one; since this Migration many User are doing, since the default changed) or similar for this. I found only Instruction for the old mbox format.

A: Why not install IMAP locally and put the mails there.
After that you should be able to connect thunderbird and sync it with the IMAP.

A: Someone posted a solution for this on Ubuntu Forums:
http://ubuntuforums.org/showthread.php?t=1870445


text:
Q: Pie do Highchart A minha dúvida é como alterar as markers do pie do highchart (na legenda) de rectangulos para circulos e como agrupar a minha legenda por category, mostro o código abaixo:
var categories = ['Product', 'Competition'],
                        data = {
                                Product: {
                                        name: 'Product',
                                        size:'100%',
                                        innerSize: '85%',
                                        data: [{ name: "Product", y: 851.8, color: colors[1], category: 'TV', marker: { symbol: 'circle' } },
                                                       { name: "Product", y: 554.2, color: colors[2], category: 'Radio', marker: { symbol: 'circle' } },
                                                       { name: "Product", y: 487.6, color: colors[3], category: 'Press', marker: { symbol: 'circle' } },
                                                       { name: "Product", y: 375.3, color: colors[4], category: 'Outdoor', marker: { symbol: 'circle' } },
                                                       { name: "Product", y: 298, color: colors[5], category: 'Cinema', marker: { symbol: 'circle' } },
                                                       { name: "Product", y: 653.2, color: colors[6], category: 'Internet', marker: { symbol: 'circle' } }],
                                        dataLabels: { enabled: false },
                                        marker: { symbol: 'circle' }
                                },
                                Competition: {
                                        name: 'Competition',
                                        size:'75%',
                                        innerSize: '90%',
                                        data: [{ name: "Competition", y: 710.2, color: colors[1], category: 'TV', marker: { symbol: 'circle' } },
                                                       { name: "Competition", y: 0, color: colors[2], category: 'Radio', marker: { symbol: 'circle' } },
                                                       { name: "Competition", y: 9.2, color: colors[3], category: 'Press', marker: { symbol: 'circle' } },
                                                       { name: "Competition", y: 0, color: colors[4], category: 'Outdoor', marker: { symbol: 'circle' } },
                                                       { name: "Competition", y: 0, color: colors[5], category: 'Cinema', marker: { symbol: 'circle' } },
                                                       { name: "Competition", y: 0, color: colors[6], category: 'Internet', marker: { symbol: 'circle' } }],
                                        color: [colors[1], colors[2], colors[3], colors[4], colors[5], colors[6]],
                                        dataLabels: { enabled: false },
                                        marker: {symbol:'circle'}
                                },
                        },
                        ProductData = [],
                        CompetitionData = [],
                        PointFormatToolTipProduct, PointFormatToolTipCompetition;

                $("#DonuTchartIBV-MMS-1").highcharts({
                        chart: {
                                type: 'pie'
                        },
                        legend: {
                                enabled: true,
                                layout: 'vertical',
                                align: 'right',
                                width: 500,
                                verticalAlign: 'middle',
                                useHTML: true,
                                marker:{ symbol: 'circle'},
                                labelFormatter: function () {
                                        return '
' + this.category + '' + this.y + 'K
';
                                }
                        },
                        tooltip: {
                                pointFormat: '\u25CF {point.category}: {point.y} K
'

                        },
                        credits: { enabled: false },
                        title: { text: null },
                        plotOptions: {
                                pie: {
                                        shadow: false,
                                        center: ['50%', '50%'],
                                        borderColor: 'transparent',
                                        cursor: 'pointer',
                                        showInLegend: true,
                                        marker: { symbol: 'circle' }
                                },
                                series: {
                                        marker: {
                                                enabled: true,
                                                symbol: 'circle'
                                        }
                                }
                        },
                        series: [
                                data.Product
                                ,
                                data.Competition
                        ]
                },
                function(chart) { // on complete
                        var textX = chart.plotLeft + (chart.plotWidth  * 0.5 + 10);
                        var textY = chart.plotTop  + (chart.plotHeight * 0.5);
                        var idNumber = $('.number-piechart');
                        var publish = [];
                        var total = 0;
                        idNumber.each(function (i,e) {
                                publish.push($(e).text().replace('K', ''));
                                total += parseFloat(publish);
                        });
                        var result = Number(total).toFixed(2);
                        var span = '
';
                        span += '\u25CF' + result + 'K
';
                        span += '\u25CF' + result + 'K';
                        span += '
';
                        $("#DonuTchartIBV-MMS-1").append(span);
                        span = $('#pieChartInfoText');
                        span.css('left', textX + (span.width() * -0.5)),
                                        ('color', colors[2]);
                        span.css('top', textY + (span.height() * -0.5 +10)),
                                        ('color', colors[2]);;
                });
        });

Apresento esta screen para visualizarem onde tenho as minhas dúvidas.
EDIT:
Apresento também um fiddle para ajudar a perceber melhor.

A: Para tornar os retangulos em círculos basta adicionar isso no parametro 'legend' [Exemplo]:
symbolWidth: 12,
symbolRadius: 6,

E para agrupar elementos na legenda não há nenhum jeito que eu considere elegante, mas voce pode usar o useHTML como verdadeira e usar o labelFormatter para conseguir um resultado razoável [Exemplo]:
labelFormatter: function () {

        if (this.x == 0) return '
Título grupo 1
' + this.name;
        else if (this.x == 2) return '

Título grupo 2
' + this.name + '
';
        else return this.name;

    },


text:
Q: Can't add foreign key to table MariaDB/MySQL I'm creating tables in MariaDB 10.6 database for TPC-H benchmark.
CREATE TABLE works ok, but adding FOREIGN KEY fails.
I tried following mariadbtutorial and documentation but this doesn't work too.
I suspect:

*

*syntax of FOREIGN KEY is wrong

*Wrong datatype in column that reference foreign key.

*column refering to foreign key should be index

*there's something wrong with data generated by dbgen from TPC-H benchmark.

The errors that occured:

*

*warning 150:   alter table bazatest2.nation with foreign key (N_REGIONKEY) constraint failed. field type or character set for column 'N_REGIONKEY' does not match referenced column 'R_REGIONKEY'.
Tried changing BIGINT NOT NULL to BIGINT UNSIGNED NOT NULL
but different error occurs:

*error 1452 when i tried adding UNSIGNED to BIGINT in column that should refer to foreign key.
Part of file containing creates:
DROP TABLE IF EXISTS NATION CASCADE;
CREATE TABLE NATION (
    N_NATIONKEY     SERIAL PRIMARY KEY,
    N_NAME          CHAR(25),
    N_REGIONKEY     BIGINT UNSIGNED NOT NULL,  -- references R_REGIONKEY
    N_COMMENT       VARCHAR(152)
);
DROP TABLE IF EXISTS REGION CASCADE;
CREATE TABLE REGION (
    R_REGIONKEY SERIAL PRIMARY KEY,
    R_NAME      CHAR(25),
    R_COMMENT   VARCHAR(152)
);

Part of file with foreign key constraints:
ALTER TABLE NATION ADD CONSTRAINT FOREIGN KEY (N_REGIONKEY) REFERENCES REGION(R_REGIONKEY);

I tried solving this by changing syntax of alter table add constraint foreign key and searching for solutions all yesterday and haven't found solution.
Most likely is that column referencing to foreign key should be index, or multiple errors,
but I don't know what should i change in my code.

A: syntax is wrong, use this
ALTER TABLE NATION ADD CONSTRAINT NATION_FK FOREIGN KEY (N_REGIONKEY) REFERENCES REGION(R_REGIONKEY);

A: Thanks for all answers,
I added UNSIGNED to BIGINT, but it wasn't main source of my problem.
The problem was that I imported data from file where primary key values started at 0.
Here I found that in MariaDB/MySQL if 0 is given for primary key, it will automatically assign first value. It changed
0, 1, 2 to 1, 1, 2 and error occured.
There are two options:

*

*changing settings of dbgen (program generating data for TPC-H benchmark).
Possible options are: INFORMIX, DB2, TDAT (Teradata), SQLSERVER, SYBASE, ORACLE, VECTORWISE. Options stand for database syntax, by there is no MYSQL option.
dbgen creates '|' separated file (.tbl) with records for this tables.
I used ORACLE and it generated file with primary keys starting at 0.
You can comment if you know which option would be most similar to MySQL syntax and contain keys starting at 0.

*Or is there any automatic software which will add 1 to primary keys in this file. Although NATION and REGION tables are not so big (20, 5), some other tables (which I removed from this question for clarity) will have over 100 000 records.


text:
Q: Issue with waiting for an event to be done then execute another I'm trying to use jQuery Promises to solve a problem.
I have a UI in which I make an API call and waiting for a response (Which takes a while). I want to wait for the response to see if everything is loaded then do an action. How can I achieve this?
This is my code:
                var d1 = new $.Deferred();

                if(($('.fa-spin').length + $('.chart-loading').length )==0){
                  d1.resolve();
                }   //Logic behind here is, I'm checking for loading icon,
                    loading spinner and once they are destroyed,
                    I want to execute something!

                    $.when(d1).then(function() {
                      console.log("fetched");
                      //Run something
                    });

I want to check if my loading spinner is done, and then fire an event. How can I do this?
When I execute this code, the deferred never gets resolved and fetch is never printed

A: you'll need to continually check in order to resolve:
var d1 = new $.Deferred();

var testInterval = setInterval(function() {
  if(($('.fa-spin').length + $('.chart-loading').length )==0){
    clearInterval(testInterval);
    d1.resolve();
  }
},100);

$.when(d1).then(function() {
    console.log("fetched");
    //Run something
});

this will check every .1sec if the spinner's gone, and resolve your defer object when the condition is met.  although, you could just run your code there instead of as a defer/resolve.
additionally it might be more effective to hook into your actual process rather than the existence of a spinner dom object, consider implementing an existing observer pattern or roll your own: observer pattern


text:
Q: Save 3D Matplot as interactive HTML I´m trying to save my 3D trisurface Plot as an interactive HTML figure, so it should be possible to zoom in/ out and change the viewpoint. In the IDE the plot already exists and works so far, but I
can`t save it in the HTML format because of the ValueError:
"The fig parameter must be a dict or Figure.
Received value of type <class 'matplotlib.figure.Figure'>: Figure(1600x900)".
I don´t understand why the "<class 'matplotlib.figure.Figure'>" is not a Figure?
This was my approach: https://plotly.com/python/interactive-html-export/
And I tried it with go.Figure() (Export rotable 3D plots from Python to HTML) already but it didn´t work with the trisurf.
Is there a way to keep my Plot settings (use trisurf as it is) and get the interactive figure in HTML?
Thanks a lot for any answer
#Import libraries
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator
import numpy as np
from mpl_toolkits.mplot3d import axes3d, Axes3D
import pandas as pd
import plotly.express as px
import io
import plotly.io as pio
%matplotlib notebook

E = np.arange(225)
D = np.arange(225)
A = np.arange(225)

E = [10000.0, 10000.0, ...]
D = [500.0, 1000.0, ...]
A = [1.9495, 1.9644, ...]

#Create figure
fig = plt.figure(figsize =(16, 9))
ax = plt.axes(projection ='3d')

# Creating color map
my_cmap = plt.get_cmap('hot')

# Data for three-dimensional scattered points
zdata = A
xdata = D
ydata = E

# Creating plot
trisurf = ax.plot_trisurf(xdata, ydata, zdata,
                         cmap = my_cmap,
                         linewidth = 0.2,
                         antialiased = True,
                         edgecolor = 'grey')
fig.colorbar(trisurf, ax = ax, shrink = 0.5, aspect = 10)
ax.set_title('AIE_SIM0.003__lowE_10000_upE_460000_stepE_30000_lowD_500.0_upD_8000.0_stepD_500.0')

ax.set_xlabel('Damping Ns/m')
ax.set_ylabel('Stifness N/m')
ax.set_zlabel('Amplification')

A2 = np.arange(225)

A2.fill(20.757)

# Creating color map
my_cmap2 = plt.get_cmap('gray')

# Data for three-dimensional scattered points
zdata2 = A2
xdata = D
ydata = E

# Creating plot
trisurf2 = ax.plot_trisurf(xdata, ydata, zdata2,
                         cmap = my_cmap2,
                         linewidth = 0.2,
                         antialiased = False,
                         edgecolor = 'none', alpha = 0.2)
fig.colorbar(trisurf2, ax = ax, shrink = 0.5, aspect = 10)
print(type(fig))
#fig.write_html("file.html")
plotly.io.to_html(fig=fig)

fig.savefig('3D_Plot_PNG_lowE_10000_upE_460000_stepE_30000_lowD_500.0_upD_8000.0_stepD_500.0.png')
fig.show()

------------------------------------------------------------------------------------------
Figure 1

printed: <class 'matplotlib.figure.Figure'>

ValueError:
The fig parameter must be a dict or Figure.
    Received value of type <class 'matplotlib.figure.Figure'>: Figure(1600x900)

A: As far as I'm aware, Matplotlib is not able to generate 3D html plot.
Moreover, what you tried above is wrong. That error message is telling you that Plotly's to_html only works with Plotly's Figure. So mixing Plotly and Matplotlib is not going to work. You need to create a Plotly figure.
Also, I don't think that Plotly exposes something similar to Matplotlib's plot_trisurf. However, it exposes go.Mesh that allows us to achieve the same result.
The recipe:

*

*Generate your numerical data.

*Create a triangulation. We will use Matplotlib's Triangulation class for this part.

*Create the Plotly figure and add the surface.

*Export the figure to html.

Here I'm going to post an example to guide you:
import numpy as np
import matplotlib.tri as mtri
import plotly.graph_objects as go

### DATA GENERATION
# Make parameter spaces radii and angles.
n_angles = 36
n_radii = 8
min_radius = 0.25
radii = np.linspace(min_radius, 0.95, n_radii)

angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)
angles = np.repeat(angles[..., np.newaxis], n_radii, axis=1)
angles[:, 1::2] += np.pi/n_angles

# Map radius, angle pairs to x, y, z points.
x = (radii*np.cos(angles)).flatten()
y = (radii*np.sin(angles)).flatten()
z = (np.cos(radii)*np.cos(3*angles)).flatten()

### TRIANGULATION
# Create the Triangulation; no triangles so Delaunay triangulation created.
triang = mtri.Triangulation(x, y)

# Mask off unwanted triangles.
xmid = x[triang.triangles].mean(axis=1)
ymid = y[triang.triangles].mean(axis=1)
mask = xmid**2 + ymid**2 < min_radius**2
triangles = triang.triangles[~mask]

### PLOT
fig = go.Figure(data=[
    # go.Mesh allows to provide the triangulation
    go.Mesh3d(
        x=x, y=y, z=z,
        colorbar_title='z',
        colorscale="aggrnyl",
        # Intensity of each vertex, which will be interpolated and color-coded
        intensity =z,
        # i, j and k give the vertices of triangles
        i = triangles[:, 0],
        j = triangles[:, 1],
        k = triangles[:, 2],
        showscale=True
    )
])

fig.show()

### EXPORT TO HTML
# Please, execute `help(fig.write_html)` to learn about all the
# available keyword arguments to control the output
fig.write_html("test.html", include_plotlyjs=True, full_html=True)


text:
Q: How to create row headers spanning two columns in a Handsontable? I'm trying to create two-column row headers in a Handsontable but it is not happening:
     ------------------------
    | C1 | C2 | c3 | c4 | c5 |
    | ------------------------
    | R1 | R1 |
    | ---------
    | R2 | R2 | These are copy paste area
    |----------
    | R3 | R3 |
    -----------

I have tried the following:
hot = new Handsontable(container,
{
    minRows:rlength,
    minCols:clength,
    rowHeaders: [["R1","R2","R3"],["R1","R2","R3"]],
    colHeaders: colHead, // This is working
    contextMenu: false,

    maxCols:clength,
    maxRows:max_row,
    outsideClickDeselects: true,
    removeRowPlugin: false
});

In rowHeaders  I'm passing the Array of Array but it is showing in one row.
How can I fix this issue?

A: Handontable's rowHeaders member doesn't support more that one row header column. The documentation only mentions passing a single dimension array and from trying it out, it treats each element in the outermost array as a single row header string (so converting the inner arrays into comma-separated strings).
Since the rendering is different for the row header column, it would seem that the only sensible solution here would be to somehow combine the multiple row header values into single header values - i.e. something like this:
rowHeaders: ["R1 R1", "R2 R2", "R3 R3"]


text:
Q: best php method of getting images from a url and saving? I want to allow users to put in am img url instead of uploading an image, the image would then go through my thumbnailing class.
Is file_put_contents the best method?

A: Yep, you can get the contents of a file given its url using file_get_contents, and then just write that to disk, or pass the contents to your thumbnail class to save. There might be safe_mode restrictions on this, but usually it's fine.

A: file_get_contents will work fine for pulling an external image.
Just bare in mind that some hosts put restrictions on fopen and fopen's wrappers (like file_get_contents and file_put_contents). These can be an all out block on fopen or restricting what it can access (like external files).

A: Beware of security implications!!! If you aren't careful, users will be able to put ARBITRARY STUFF on your server - including an evil PHP script, renamed as an image! All that they'll have to do to pwn your server when that's done is to rename the file to .php... Be careful.


text:
Q: PHP Composer failed to open stream: Cannot connect to HTTPS server through proxy While running composer install, I keep getting following error all of a sudden
[Composer\Downloader\TransportException]
 The "https://packagist.org/packages.json" file could not be downloaded: SSL
  operation failed with code 1. OpenSSL Error messages:
 error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
failed to open stream: Cannot connect to HTTPS server through proxy

Does anyone had this issue before?
Following are my composer settings -
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] true
[secure-http] false
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] 1

A: The problem resolved for me by making this:
HTTP_PROXY_REQUEST_FULLURI=false

It is a Composer environment parameter, there is one for the HTTP and the HTTPS proxy:

HTTP_PROXY_REQUEST_FULLURI
If you use a proxy, but it does not support the request_fulluri flag, then you should set this env var to false or 0 to prevent Composer from setting the request_fulluri option.
HTTPS_PROXY_REQUEST_FULLURI
If you use a proxy, but it does not support the request_fulluri flag for HTTPS requests, then you should set this env var to false or 0 to prevent Composer from setting the request_fulluri option. (source)

Both relating to the request_fulluri flag:

request_fulluri bool
When set to true, the entire URI will be used when constructing the request. (e.g. GET http://www.example.com/path/to/file.html HTTP/1.0). While this is a non-standard request format, some proxy servers require it. (source)

A: Composer uses wget to request the network.
:SSL routines:ssl3_get_server_certificate:certificate verify failed
failed to open stream: Cannot connect to HTTPS server through a proxy

I think you can add check_certificate = off in your ~/.wgetrc not to check certificates. If you prefer you can configure certificate verification in /etc/wgetrc too.


text:
Q: Custom Push Service In the context of pushing notifications to web-browsers, the PUSH SERVICE acts as interface between the SERVICE WORKER and APPLICATION SERVER.
My current understanding is that

*

*Google FCM is the Push Service for Google Chrome & FireFox browsers

*APNS (Apple Push Notification Service) is the Push Service for Safari browser

Here, is it technically possible to substitute the 'push service(s)' (– i.e., Google FCM for Google Chrome & FireFox browsers and APNS for Safari) with a generic custom service worker which could potentially address all the popular browsers that support Service Worker and Push API?
In other words, whether developers have control over which push service to be used for a browser (or) develop a custom push service for all the browsers?

A: You're mostly correct: the Push Service acts as an interface between a service worker and application server, with the addition that the service worker (or potentially the web app) sends subscription info to the application server outside the Push Service, so the application server knows the endpoint and how to properly encrypt any notification content.
Google uses GCM/FCM for Chrome, and Mozilla uses its own Push Service in Firefox for desktop, while using GCM/FCM and/or its own service for Android; see the "What information does Firefox use to provide Web Push?" section here.
At the time of writing this, Chrome, Firefox and Edge support the Push API, so there's no need to handle each seperately (WebKit doesn't support it).
Short answer: developers don't have a choice in which Push Service the client uses, but the adoption of the Push API standardizes the service worker and web push across major browsers (excluding WebKit).


text:
Q: Manipulating huge data in Excel VBA I have written some VBA code to put custom checks on the data entered in data sheet. Currently i am using Workbook_BeforeSave event to get all the validation data from validation sheet and perform validation on data entered in data sheet . Based on the validation error i add comment to the data sheet cells. The problem is that it works fine for hundred records in data sheet but when it comes to thousands of records it takes several minutes. And the ask is to do it for data that might be close to 50K records or more.
Do excel VBA script provide support for  multithreading?
Or is there any other way to do the same?
I have searched for multithreading in VBA but the answer is no, in some posts it shows possible but they can't work on active worksheet simultaneously.
Please suggest.
*Data might be copied from other sheet also in the data sheet.
I check for validations before save button click:
 Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
     Dim WS_Count As Integer
     Dim i As Integer
     WS_Count = ActiveWorkbook.Worksheets.Count
     ' Begin the loop.
     For i = 1 To WS_Count

        ' Insert your code here.
        ' The following line shows how to reference a sheet within
        ' the loop by displaying the worksheet name in a dialog box.
        If Not ActiveWorkbook.Worksheets(i).Name = "Validation Data" Then
            CheckForCellValidation ActiveWorkbook.Worksheets(i).Name
        End If
     Next i
 End Sub

Below is my validation check method for range in sheet it finds target range and based on column id it checks for validation:
Function CheckForCellValidation(ByVal sheetName As String)
Dim rng As Range
Dim sheetRng As Range
Dim varRng As Range
Dim lastCol As Long
Dim colName As String
Dim valOption As Long
Dim param
Dim errMsges
Dim Larr
Dim errMsg As String

Set rng = {Get all entries in validation sheet}

For Each cell In rng.Cells
    Set varRng = cell.Offset(1, 0)
    param = Split(varRng.Offset(1, 0).Value2, ":;") 'parameter in validation sheet, see attached image(multiple validations can be present for one column)
errMsges = Split(varRng.Offset(2, 0).Value2, ":;") 'error message, see attached image
Larr = Split(varRng.Value2, ":;")

Set sheetRange = Sheets(sheetName).Cells.Find(what:=cell.Value2, LookIn:=xlFormulas, LookAt _
    :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False)

If Not sheetRange Is Nothing Then
    colName = Replace(sheetRange(1).Address(0, 0), sheetRange(1).row, "")
    strVal = Sheets(sheetName).UsedRange.Rows.Count
    'Data entry starts from 7th row in data sheet
    Set sheetRange = Sheets(sheetName).Range(colName & CStr(7) & ":" & colName & strVal)
    sheetRange.Cells.Interior.ColorIndex = xlNone
    sheetRange.Cells.ClearComments

    For i = 0 To UBound(Larr)
        valOption = Larr(i)

        If UBound(errMsges) >= i Then
          errMsg = errMsges(i)
        Else
          errMsg = ""
        End If

    Select Case valOption
    Case Is = 1
        For Each cel In sheetRange.Cells
        ValidateMandatoryField cel, errMsg
        Next cel

    Case Is = 6
    For Each cel In sheetRange.Cells
        ValidateRegEx cel, param(i), errMsg
    Next cel

    Case Is = 8
    For Each cel In sheetRange.Cells
    ValidateMinTextLength cel, param(i), errMsg
    Next cel

    Case Is = 9
    For Each cel In sheetRange.Cells
        ValidateNumericalLength cel, param(i), errMsg
    Next cel
    End Select
  Next i
  End If
Next cell
End Function

Sample data in validation sheet attached:

A: Excel and VBA are definitely NOT multi-threading technologies.
You could use Windows Task Scheduler to open your Workbook, fire and Open_Workbook event, and run your script sometime after you leave the office (i.e., run the take each evening at midnight, save all changes, and the results will be waiting for you when you get into the office in the morning).
https://www.sevenforums.com/tutorials/11949-elevated-program-shortcut-without-uac-prompt-create.html


text:
Q: Where to best execute database operations using Django framework? Thanks in advance for any help.   I am new to django specifically as well as web development in general.  I have been trying to teach myself and develop a website using the Django framework and while everything is working so far, I am not sure if I am really doing things in the best possible way.
Typically, within my django app, I will have certain points where I want to modify the contents of my database model in some way.  A typical use case is where I have button on my site that says "Add a post":
models.py:
from django.db import models

# data model import
from django.contrib.auth.models import User

# Create your models here.
class Post(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    post = models.CharField(max_length=1024)

urls.py:
from django.urls import include, path
from . import views

urlpatterns = [
    path('', views.post, name='new_post'),
    path('post_exec', views.post_exec, name='post_exec'),
]

views.py:
from django.contrib import messages
from django.shortcuts import render, redirect

# import data models
from django.contrib.auth.models import User
from .models import Post

def post(request):
    # make sure the user has privileges
    user = User.objects.get(id = request.user.id)
    if not user.is_superuser:
        return redirect('home')

    return render(request, 'post.html')

def post_exec(request):

    # make sure the user has priveledges
    user = User.objects.get(id = request.user.id)
    if not user.is_superuser:
        return redirect('home')

    # create the post
    new_post = Post.objects.create()
    new_post.user = user
    new_post.post = request.POST['post']
    new_post.save()

    # this could redirect to a confirmation page or something too
    return redirect('home')

You can see what I am doing here is that everytime I need a change to the database due to user input, I am executing the code to do the requested database change in a django view and then redirecting to another page following completion of the database change.  While this works, it feels kind of clunky (you end up needing pages that you never actually use), it seems pretty sketchy in terms of security (although I am checking for credentials on each page), and I imagine there is a better way to do this.
Can any experience Django developers offer some advice for how I should be best structuring my project for these specific types of common database operations?

A: The Django's views is a good place to organize the project's CRUD system so users can manage their data. You can use the class-based views to group the GET, POST etc requests. Also there are better ways of using the authorization system with the login_required() decorator, the LoginRequiredMixin class and other solutions that you can rich here


text:
Q: Getting the error "Module not found: Error: Can't resolve 'querystring'", how do I fix this? After installing react-instagram-embed package I got this error and tried all possible solution but still not working!!! Anyone knows solution for this??

Module not found: Error: Can't resolve 'querystring' in
'C:\Users\vytck\Desktop\ibm\node_modules\finnhub\dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js
core modules by default. This is no longer the case. Verify if you
need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:

*

*add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'

*install 'querystring-es3' If you don't want to include a polyfill, you can use an empty module like this:     resolve.fallback: {
"querystring": false }

A: querystring is deprecated since at least since last Node LTS version 14.
So if you want to keep your current version of react-instagram-embed
install querystring-es3
yarn add querystring-es3 or npm i querystring-es3
in your webpack.config.js configuration file update or add the resolve entry to look like this
resolve: {
   fallback: { "querystring": require.resolve("querystring-es3") }
}


text:
Q: generators of a transitive permutation group I know that the symmetric group $S_n$ is generated by $(12)$ and $(2345\dots n)$.

Let $G$ be a transitive subgroup of $S_n$ (transitive with respect to the natural action of $S_n$ on $\{1,2,\dots,n\}$) that contains a transposition and an $(n-1)$-cycle. Prove that $G=S_n$.


text:
Q: Cocoapods: Pod is in the master repo but is not available for install I've created and submitted a podspec, BCJSONMapper, but when I search for it using pod search BCJSONMapper I receive the following error: [!] Unable to find a pod with name matching 'BCJSONMapper'.
The spec is in the master repo (it was submitted via trunk). I can use the pod as expected if I refer to a local copy of the podspec in a podfile (pod 'BCJSONMapper', :podspec => '~/path/to/local/copy/of/BCJSONMapper.podspec').
How do I fix this? This is the first podspec that I've submitted to the master repo so I may have missed something obvious.

A: I've fixed it. I solved it by removing my ~/.cocoapods/repos/master and letting Cocoapods re-initalize the repo. What was confusing was that the same error message was occurring on a different machine. It may have just been coincidence, but I guess it could also have been a bug in Cocoapods.


text:
Q: Inner measure on locally measurable sets Let $(X,\mathcal{M}, \mu)$ be a measure space, let $\mathcal{M'}$ be the $\sigma$-algebra of locally measurable sets, i.e.
$$\mathcal{M'}=\{ E \subset X : E \cap A \in \mathcal{M} \quad \forall A \in \mathcal{M} \quad \text{with} \ \ \mu(A)<\infty \}$$
define for $E \in \mathcal{M'} \quad$ $\mu_* (E) = \sup \{ \mu(A) : A \in \mathcal{M} \quad \text{and} \ \ A \subset E\}$
Assume $\mu$ is semifinite, then prove $\mu_*$ is a measure on $\mathcal{M'}$.
$\\$
More precisely I am interested in this inequality: let $\{E_n\} \subset \mathcal{M'}$ be a disjoint collection then
$$\mu_*(\bigcup_{n=1}^\infty E_n) \leq \sum_{n=1}^\infty \mu_*(E_n)$$
Take any $C \in \mathcal{M}$ with $C \subset \bigcup_{n=1}^\infty E_n $
a) if $\mu(C) < \infty$ then $C\cap E_n \in \mathcal{M}$ so
$$\mu(C)=\mu(\bigcup_{n=1}^\infty C\cap E_n)=\sum_{n=1}^\infty \mu(C\cap E_n) \leq \sum_{n=1}^\infty \mu_*(E_n)$$
b) if $\mu(C) = \infty$ ... don't know how to deal with this case
(by semifinitness we have $\exists F \in \mathcal{M}$ with $F \subset C$ such that $0<\mu(F)<\infty$)


text:
Q: Mapster generation output directory The structure of the project looks so that for each entity a separate folder is allocated, which stores the mapper interface, but the generation occurs in the directory above. I need to make the mapper class be generated in the same directory as the interface regardless of the directory name.
example
My settings:
    <ItemGroup>
        <Generated Include="**/*.g.cs" />
        <!--to clean up generated files dotnet msbuild -t:CleanGenerated-->
    </ItemGroup>
    <Target Name="CleanGenerated" BeforeTargets="build">
        <Delete Files="@(Generated)" />
    </Target>
    <Target Name="Mapster" AfterTargets="AfterBuild">
        <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" />
        <!--<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster model -a "$(TargetDir)$(ProjectName).dll"" />
        <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster extension -a "$(TargetDir)$(ProjectName).dll"" />-->
        <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster mapper -a "$(TargetDir)$(ProjectName).dll"" />
    </Target>

Changing the values of the property Generated Include="**/*.g.cs" did not bring any results
as well as the use of different options for Mapster.Tool (tried -n -b and -o)


text:
Q: How to change a Vue.js data value within a method called by a DOM event? Disclaimer: I know that there is data biding in Vue.js.
So I have this:

        <input @input="update">

An input that will trigger a method called update every time the user type in something. The idea here is to change the value of the data property called info with the value typed in the input by the user.
But, for some reason, the value of the data attribute doesn't change. The current input value is printed normally in the console with the console.log(value) call every time the update method is fired, but nothing changes to the info attribute.
So, how to make this work?

A: The problem here is that i've mixed two different contexts.
In another script I was doing the same thing, but the input was binded to another js cript that was applying a mask to it. So, that caused the problem of the info value not being changed.
Then I tried to replicate the problem in this script in the question (without the js mask script) and then I thought that nothing was changing in the info attribute because the chrome extension for Vue.js showed me that the value didn't changed, was always staying empty no matter how much i've typed in the input (so maybe an environment problem).
In the end this was just a hicup from my part and the real problem lies in binding two different libraries in a single input. Eventually one of them will not work and this is content for another question.

A: You could always create a two-way data binding using v-model, thus essentially binding the value of the input field to the info property. This way, the value of info gets updated as the user enters something in the input field.
Example below:-

    <!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Vue.js stuff</title>

You typed {{info}}

            <input type="text" v-model="info">

A: I'm not seeing what your problem is; your example works perfectly:

new Vue({
  el: '#app',
  data: {
    info: '',
  },
  methods: {
    update: function(event) {
      value = event.target.value;
      this.info = value;
      console.log(value)
    }
  }
});

  <input @input="update">
  {{ info }}


text:
Q: Existence of $B$-reduction of a $G$-torsor on a curve Let $k$ be an algebraically closed field, $X$ a connected smooth curve over $k$, $G$ a connected reductive group over $k$, and $B \subset G$ a Borel subgroup.
Given a $G$-torsor $E$ on $X$ in the etale topology, I would like to understand why it has a reduction to $B$, in the simple case above (usually one finds some generalizations).
I already understood that on some open dense subset the $G$-torsor trivializes, and hence has a $B$-reduction. The next step is to consider $B\backslash E \to X$, which is a fiber bundle in the etale topology, with fiber $B \backslash G$. If I understand correctly, it is clear what is $B \backslash E$ as an algebraic space - since $E$ is etale-locally trivial and algebraic spaces glue in the etale topology. I also read somewhere that in fact $B \backslash E$ is a scheme, but I don't know the reason, and it says it is not important for the argument.
Now, I would like to take a section of $B\backslash E \to X$ over some dense open subset, and continue it to the missing points, by valuative criterion of properness. The problem is that for algebraic spaces in the criterion there appears some finite field extension, and anyway I don't understand algebraic spaces to well. So the question is - could somebody explain how to technically proceed to show that one can extend the section to the missing points?
Thank you,
Sasha

A: It is not too difficult to show that $B\backslash E$ is a scheme -- see e.g. http://arxiv.org/pdf/1308.3078.pdf, Prop. 4.4.

A: It seems to me that perhaps one can argue as follows: We know that there is a section on some open dense $U \subset X$. we can assume that $X-U$ is one point. Find etale $V \to X$ which hits that point, and on which $E$ becomes trivial. Thus, on $V$ sections are maps to $B\backslash G$. On $V\times_X U$ we have section, and since $V$ is a smooth curve, we can continue it to a section on $V$. Thus, we get that we have compatible sections on $U$ and on $V$, and thus we get a section on $X$, since maps to $B \backslash E$ are a sheaf on quasi-compact schemes.