text:
Q: I am trying to instal HDF5 on my windows 10 64-bit computer. I have python(x,y) and am trying to install h5py. however the error I receive is
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Yaady\AppData\Local\Temp\pip-build-wa42hjf9\h5py\
when I run:
pip install h5py
Then is says:
Collecting h5py
  Using cached h5py-2.6.0.tar.gz
    Complete output from command python setup.py egg_info:
    no previously-included directories found matching 'doc.build'
Installed c:\users\yaady\appdata\local\temp\easy_install-rawecmvd\pkgconfig-1.1.0\.eggs\nose-1.3.7-py3.5.egg
zip_safe flag not set; analyzing archive contents...

Installed c:\users\yaady\appdata\local\temp\pip-build-wa42hjf9\h5py\.eggs\pkgconfig-1.1.0-py3.5.egg
Searching for Cython>=0.19
Reading https://pypi.python.org/simple/Cython/
Best match: Cython 0.24.1
Downloading https://pypi.python.org/packages/c6/fe/97319581905de40f1be7015a0ea1bd336a756f6249914b148a17eefa75dc/Cython-0.24.1.tar.gz#md5=890b494a12951f1d6228c416a5789554
Processing Cython-0.24.1.tar.gz
Writing C:\Users\Yaady\AppData\Local\Temp\easy_install-dhfiv996\Cython-0.24.1\setup.cfg
Running Cython-0.24.1\setup.py -q bdist_egg --dist-dir C:\Users\Yaady\AppData\Local\Temp\easy_install-dhfiv996\Cython-0.24.1\egg-dist-tmp-39sv6o4m
Unable to find pgen, not compiling formal grammar.
warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.h' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Utility'
Traceback (most recent call last):
  File "c:\users\yaady\miniconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\yaady\miniconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "c:\users\yaady\miniconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\bdist_egg.py", line 161, in run
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\bdist_egg.py", line 147, in call_command
  File "c:\users\yaady\miniconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\yaady\miniconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\install_lib.py", line 10, in run
  File "c:\users\yaady\miniconda3\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "c:\users\yaady\miniconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\yaady\miniconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Yaady\AppData\Local\Temp\easy_install-dhfiv996\Cython-0.24.1\Cython\Distutils\build_ext.py", line 164, in run
  File "c:\users\yaady\miniconda3\lib\distutils\command\build_ext.py", line 338, in run
    self.build_extensions()
  File "C:\Users\Yaady\AppData\Local\Temp\easy_install-dhfiv996\Cython-0.24.1\Cython\Distutils\build_ext.py", line 172, in build_extensions
  File "c:\users\yaady\miniconda3\lib\distutils\command\build_ext.py", line 532, in build_extension
    depends=ext.depends)
  File "c:\users\yaady\miniconda3\lib\distutils\_msvccompiler.py", line 317, in compile
    self.initialize()
  File "c:\users\yaady\miniconda3\lib\distutils\_msvccompiler.py", line 210, in initialize
    vc_env = _get_vc_env(plat_spec)
  File "c:\users\yaady\miniconda3\lib\distutils\_msvccompiler.py", line 85, in _get_vc_env
    raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 154, in save_modules
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 195, in setup_context
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 243, in run_setup
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 273, in run
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 242, in runner
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 46, in _execfile
  File "C:\Users\Yaady\AppData\Local\Temp\easy_install-dhfiv996\Cython-0.24.1\setup.py", line 326, in <module>
  File "c:\users\yaady\miniconda3\lib\distutils\core.py", line 163, in setup
    raise SystemExit("error: " + str(msg))
SystemExit: error: Unable to find vcvarsall.bat

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\easy_install.py", line 1064, in run_setup
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 246, in run_setup
  File "c:\users\yaady\miniconda3\lib\contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 195, in setup_context
  File "c:\users\yaady\miniconda3\lib\contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 166, in save_modules
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 141, in resume
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\pkg_resources\_vendor\six.py", line 685, in reraise
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 154, in save_modules
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 195, in setup_context
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 243, in run_setup
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 273, in run
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 242, in runner
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\sandbox.py", line 46, in _execfile
  File "C:\Users\Yaady\AppData\Local\Temp\easy_install-dhfiv996\Cython-0.24.1\setup.py", line 326, in <module>
  File "c:\users\yaady\miniconda3\lib\distutils\core.py", line 163, in setup
    raise SystemExit("error: " + str(msg))
SystemExit: error: Unable to find vcvarsall.bat

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Yaady\AppData\Local\Temp\pip-build-wa42hjf9\h5py\setup.py", line 149, in <module>
    cmdclass = CMDCLASS,
  File "c:\users\yaady\miniconda3\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\dist.py", line 269, in __init__
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\dist.py", line 313, in fetch_build_eggs
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\pkg_resources\__init__.py", line 827, in resolve
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\pkg_resources\__init__.py", line 1072, in best_match
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\pkg_resources\__init__.py", line 1084, in obtain
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\dist.py", line 380, in fetch_build_egg
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\easy_install.py", line 640, in easy_install
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\easy_install.py", line 670, in install_item
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\easy_install.py", line 850, in install_eggs
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\easy_install.py", line 1078, in build_and_install
  File "c:\users\yaady\miniconda3\lib\site-packages\setuptools-20.3-py3.5.egg\setuptools\command\easy_install.py", line 1066, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: Unable to find vcvarsall.bat

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Yaady\AppData\Local\Temp\pip-build-wa42hjf9\h5py\

A: Steps:

*

*You need to install Microsoft Visual C++ Compiler for Python 2.7.

*If you get error:

'hdf5.h': No such file or directory

Download the .whl file from Python libs

*

*In my case it was h5py‑2.7.0‑cp27‑cp27m‑win_amd64.whl

*Install .whl file using following command python -m pip install <filename>.whl [make sure pip is updated to latest version]
Additional instructions:
http://docs.h5py.org/en/latest/build.html


text:
Q: How to send videos to process on the server side I want to ask a few questions about sending a video file to be process on the server side.
So right now I have a php-based web app where I used to upload my video into the server that hosted my web app,
and I have a python files where I use to process the video (process such as cutting a portion of video,
removing the green screen) which took time to process on my computer.
What I have done right now:
Web app (to upload video from mobile to server) -> download file from server to my computer
-> manually process videos
What I planned:
Web app (to upload video to server and process those video automatically from the server) ->
notifying user when process are done (so user doesn't need to be on the app waiting for the process)
-> download processed video from the web app
As I described above, I want the video process to be done on the server automatically which will
take less time to process the video. So, how can I do this based on what I've described? Or if there
are any better way to make the process take less time and automatically on the app, I would appreciate that.
Another things is that, based on what I've planned, are there anything that I have to look out? (I am very
new to php and doing server things)
Thank you

A: You should make use of a queue system. When a user uploads a video you add a task into that queue (store it in the database).
Now make a cron job that processes the tasks in the queue. It takes the task from the database, finds the video and executes the python scripts. When a task is finished it notify the applicable user (through mail I guess).
Since you are new to server things: here is a link https://en.wikipedia.org/wiki/Cron
Frameworks like Symfony have nice solutions for your purpose https://symfony.com/doc/current/console.html

redpajama_set_name: RedPajamaStackExchange


text:
Q: php upload images and save file name to mysql I have this html form
<form action="insert.php" method="post" enctype="multipart/form-data">>

    Cover Artwork:
    <input type="file" name="file"/>

    Text Artwork:
    <input type="file" name="textname"/>

<input type="submit" name="submit" value="Upload"/>

and this is the insert.php
//Upload cover artwork
$name= $_FILES['file']['name'];
$tmp_name= $_FILES['file']['tmp_name'];
$submitbutton= $_POST['submit'];
$position= strpos($name, ".");
$fileextension= substr($name, $position + 1);
$fileextension= strtolower($fileextension);

if (isset($name)) {

$path= 'uploads/';

if (!empty($name)){
if (move_uploaded_file($tmp_name, $path.$name)) {
echo 'Uploaded!';

}
}
}

//Upload text artwork
$textname= $_FILES['file']['textname'];
$tmp_textname= $_FILES['file']['tmp_textname'];
$textsubmitbutton= $_POST['submit'];
$textposition= strpos($textname, ".");
$textfileextension= substr($textname, $textposition + 1);
$textfileextension= strtolower($textfileextension);

if (isset($textname)) {

$textpath= 'uploads/';

if (!empty($textname)){
if (move_uploaded_file($tmp_textname, $textpath.$textname)) {
echo 'Uploaded!';

}
}
}

// attempt insert query execution
$sql = "INSERT INTO table (covername, textname) VALUES ('$name', '$textname')";
if(mysqli_query($link, $sql)){
    echo "Records added successfully.";
} else{
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}

// close connection
mysqli_close($link);
?>

The covername is saved to the database and the file is uploaded to uploads/ - this works great. But the second upload isn't working at all, textname isn't saved to the db nor is it uploaded. What am i missing?

A: Just change this:
//Upload text artwork
$textname= $_FILES['textname']['name'];
$tmp_textname= $_FILES['textname']['tmp_name'];
$textsubmitbutton= $_POST['submit'];
$textposition= strpos($textname, ".");
$textfileextension= substr($textname, $textposition + 1);
$textfileextension= strtolower($textfileextension);

if (isset($textname)) {

$textpath= 'uploads/';

if (!empty($textname)){
if (move_uploaded_file($tmp_textname, $textpath.$textname)) {
echo 'Uploaded!';


text:
Q: Can't reach shared folder from VM over VPN My network knowledge is a bit lacking so I'm looking for some help on why we can't access a shared folder.  We have a Windows 8 VM on a Mac host that is sharing a folder that we want accessible from several other Windows 8 VMs on Mac hosts (using VMware Fusion).  When those other hosts are on the local network both the host and VM can access the shared network location/folder without issue.
However, we also have a VPN server set up.  When those hosts are not on the network (they are mobile and need to be able to access the network location from home) they can connect to the VPN and reach the shared folder.  However the client VMs cannot access the shared location/file.  They cannot even ping the server where the shared file is located or the VPN server.
I'm sure there is something simple I am missing but I'm not sure what it is, any help/suggestions?


text:
Q: How to configure WebSphere to sync with LDAP on regular period? I've been searching online, and specifically on IBM's site, but have not yet found where WebSphere configures its setting for regular/periodic syncs with its LDAP repository.  I've heard that on some regular/periodic default interval (30 mins maybe?), WebSphere will update itself with the data in its LDAP repository.  This is to account for updates being made to the LDAP repository outside of WebSphere's control.  Anyone know where in WebSphere this interval setting is configured?

A: By default WAS will sync with LDAP and update the user and group information into cache.
This cache timeout was set to 10 mins by default. When the cache timeout expires, all cached information not accessed within the timeout period is purged from the cache.
Again WAS will sync with LDAP server and fetch information and stored in cache.
Global security > Authentication cache settings

A: There is no such setting for LDAP synchronization with WebSphere.  Explains why I couldn't find it.

A: I had similar problem. It seems that WAS keeps search results for some time in cache. Solution is to setup low LDAP cache timeouts. Navigate here: Global security > Federated repositories > LDAP1 > Performance


text:
Q: HTML PHP Advice for storing variable I have a web app working fully Ajax wise. The user has the opportunity to apply a location filter. He or she can enter a city or region for instance. If that variable is set, I will use it as parameter in all my ajax calls.
My question is as follows: what is the best "place" to store that variable?
I hesitate between two solutions:

*

*The first idea is to create an attribute called location that I integrate in an element with a value equal to the user input.

*My second idea is to store the variable in my session array.

If there is a better idea out there I take it.

A: Use a session variable. This value is assumed to be near-constant over the session, so you shouldn't send it at every request.


text:
Q: What does [[Scopes]] mean in prototype? I'm studying prototype and doing some testing, and I've decided to assign a method to the String object like this:
String.prototype.sel = function sel() {
    var elem = doc.querySelectorAll(this);
    if (elem.length == 1)
        return elem[0];

    return elem;
}

And when getting a console.log(String.prototype) and getting the method I created, I noticed that in [[Scopes]] I get 1: Global {window: Window..., what does [[Scopes]] mean?
Complete test:

String.prototype.sel = function sel() {
    var elem = document.querySelectorAll(this);
    if (elem.length == 1)
        return elem[0];

    return elem;
}

'[btnSend]'.sel().onclick = () => {
    alert('ok')
}

console.log(String.prototype);
<button btnSend>Send</button>


text:
Q: Magento 2: Custom customer attribute not saving on DB I have added a custom customer attribute on_account. It is displayed as expected in the admin forms: to create a new customer or to edit an existing one, also when creating an Order with a new customer.
However, when I try to save any customer it gives me the error:
"On Account" is a required value.
This is how my tables look like:
eav_attribute
attribute_id => 248,
entity_type_id => 1,
attribute_code => on_account,
attribute_model => null,
backend_model => null,
backend_type => int,
backend_table => null,
frontend_model => null,
frontend_input => boolean,
frontend_label => On Account,
frontend_class => null,
source_model => Magento\Eav\Model\Entity\Attribute\Source\Boolean,
is_required => 1,
is_user_defined => 1,
default_value => 0,
is_unique => 0,
note => null

customer_eav_attribute
attribute_id => 248,
is_visible => 1,
input_filter => null,
multiline_count => 0,
validate_rules => null,
is_system => 0,
sort_order => 120,
data_model => null,
is_used_in_grid => 0,
is_visible_in_grid => 0,
is_filterable_in_grid => 0,
is_searchable_in_grid => 0,
is_used_for_customer_segment => 0

customer_eav_attribute_website
attribute_id => 248,
website_id => 10,
is_visible => null,
is_required => null,
default_value => null,
multiline_count => null

customer_form_attribute
form_code => adminhtml_checkout,
attribute_id => 248

form_code => adminhtml_customer,
attribute_id => 248

Any ideas?
Thanks in advanced

A: *

*There is no meaning to add required for the boolean typ. bcz if it is required then it's value always becomes 1. so is_required should be 0.

*Use the backend model: Magento\Customer\Model\Attribute\Backend\Data\Boolean

*Use the backend Type: static, or try with varchar.
maybe this will help you to make your attribute workable.


text:
Q: What is the effect of a low pass filter on a stepped signal? I'm trying to smooth out the steps from a digitally-generated LFO signal which changes step-wise.  The digital steps are small, but still audible when the LFO is hooked up to the circuit that uses it (zipper noise).
I'm considering using a low-pass RC filter.  I'd like to predict the effect it would have so I can decide if it will be a useful approach. Are there any free or affordable resources I could use?  I'm pretty much a layperson when it comes to electronics, so the simpler the better.
Given that the effect of a low pass RC filter on a square wave is asymptotic, something like this (borrowed from here)...

... my assumption about how an RC filter works is that the gradient of the filtered signal is proportional to the voltage differential between the filtered signal and the source signal; and that the proportionality is determined by the R and C values.
Edit I've TL;DR;ed the question - the accepted answer says everything I was trying to elicit.

A: Besides analysis, another option is simulation. Here is a start. The schematic editor and simulator are free, but you can't save.
For a simple RC filter, your digital frequency must be much, much higher than the output frequency.

simulate this circuit – Schematic created using CircuitLab


text:
Q: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'Number' at row 1 using CSV I am getting the following error while inserting data from CSV:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value
  for column 'Number' at row 1

My Database:

My CSV File:

My Codes:
$user = new USER();

$file = "test.csv";
 $handle = fopen($file, "r");
 $c = 0;
 while(($filesop = fgetcsv($handle, 1000, ",")) !== false)
 {
 $name = $filesop[0];
 $user->new_number($name);
 }


text:
Q: SQL Server: proof of sensitive data really deleted by table drop I was asked to drop some tables on a Company SQL 2005 Server and provide proof of deletion because of these tables contains sensitive data. Is it possible?
Thank you all for help

A: No - especialy as a drop does NOT DELETE THE DATA at this moment.

A: If you're just looking to prove the drop, you can use this:
USE MyDB
SELECT Name
FROM sysobjects
WHERE Name='MyDroppedTableName'

If nothing is returned then the drop worked.  But as the others have said, the drop of the table just removes the pointer to the data.
And on another note, if you're looking for total eradication you also have to keep backups in mind as well.  If your database has ever been backed up then that data is there, and if the server's ever been backed up you have it those as well.

A: If they're looking to totally eradicate the data, no; and the only way to prove it would be remove the disks containing the data and scan it outside of the file system. It would be better to replace the sensitive data with random characaters. Even then you have to deal with the old data residing in transaction logs.

A: The only way to truly destroy all traces of the data is to copy the good data into a new database, and perform a secure deletion of the old database's files.  You'll then need to securely delete any backups of the DB and server that may contain the target data.  It's a task that leaves you open to loosing data if you should ever need one of those backups.

A: As suggested above we did a secure delete of database files using sdelete (sysinternals), then we removed the disks and sent them to the company (they compared the disk serials from the vendor hardware monitoring tool). Backup tapes were sent too.

A: You can update the data, replace it with spaces, before drop. This way you are replacing the value bits on the disk with space values. However, a pre-update image of the data will always be in the log and in backups. The actual propagation of erasure would have to be custom tailored for your environment, according to whatever technologies and procedures are in place (eg. log-shipping and/or mirroring, database snapshots, SSIS extraction jobs, track the location of backups etc).


text:
Q: How to pass data from javascript to node and response back with other data? [POSSIBLY A DUPLICATE]
I have been working on a simple form that will accept the following input element:
<input type="text" class="form-control" id="input01" name="job_title" placeholder="Enter a job title (e.g. Engineering)">
<button class="btn btn-primary ml-auto" id="form_submit_button">Search</button>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js "></script>
<script type="text/javascript" src="parser.js"></script>

What I want to do is to:

*

*Pass the input from browser to client-side JavaScript.

*Make an AJAX request success to the server-side NODE.

*NODE will receive data (user input) and perform some tasks

*NODE will respond back to client-side JavaScript.

*AJAX will receive the respond complete and modify some HTML.

JS CODE:
(function($){
    "use strict";
    jQuery(document).ready(function($) {

        var $this = $(window);

        $("#form_submit_button").on("click", function () {

            //GET VALUES FROM USER INPUT AND STORE IN VARIABLES
            var job_title = $("#input01").val();
            var job_country = $("#input02").val();
            var job_contract = $("#input03").val();
            var job_education = $("#input04").val();

            var userInput = JSON.stringify({
                job_title,
                job_country,
                job_contract,
                job_education
            });

            //PASS DATA INTO NODE VIA HTTP POST REQUEST
            myAjaxCall("POST", "http://localhost:80/test01", userInput, function(response){
                console.log(response);
            });
        });

    });
})();

function myAjaxCall(method, url, userInput, callback) {

    $.ajax({
        datatype: "jsonp",
        contentType: "applicatin/json",
        type: method,
        url: url,
        data: userInput,
        success: function (userInput) {
            console.log("success");
            console.log(userInput);
        },
        complete: function(responseData) {
            console.log("complete");
            return callback(responseData);
        }
    })
}

NODE:
const express = require('express');
const cors = require('cors');
const app = express();
app.use(cors({
    origin: '*',
    optionsSuccessStatus: 200,
}));
app.post("/test01", (req, res) => {

    //get data
    //do some stuff

    //data to be returned back to client
    var object = {
        message: "hello world"
    }

    res.status(200).send(object).end(); //THIS DOESN'T RELOAD PAGE BTW!!!
});
app.listen(80, ()=> {
    console.log("\n    > Server listening on port: 80");
});

The NODE works okay when accessing http://localhost from the local machine, but when I try the requests on my website (hosted on noip.com), that is where it gets tricky. Basically, when I run the above code on my local machine through the public URL that uses my public IP address, it will work fine and return the results I want. I assume this is because the NODE environment is set on my computer locally.
CONSOLE LOG ON LOCAL COMPUTER:
success
parser.js:42 {message: "hello world"}
parser.js:45 complete
parser.js:24 {readyState: 4, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, responseJSON: {message: "hello world"}, responseText: "{"message":"hello world"}", ...}

However, when I do this request from another computer also by using the public URL, it will give me an error JSON object back, without the information I want (responseJSON or responseText). I can't figure out why this is happening.
CONSOLE LOG FROM ANOTHER MACHINE:
jquery.min.js:2 Access to XMLHttpRequest at 'http://localhost/test01' from origin 'http://192.168.178.50' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
jquery.min.js:2 POST http://localhost/test01 net::ERR_FAILED
parser.js:45 complete
parser.js:24
{readyState: 0, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}
abort: ƒ (e)
always: ƒ ()
catch: ƒ (e)
done: ƒ ()
fail: ƒ ()
getAllResponseHeaders: ƒ ()
getResponseHeader: ƒ (e)
overrideMimeType: ƒ (e)
pipe: ƒ ()
progress: ƒ ()
promise: ƒ (e)
readyState: 0
setRequestHeader: ƒ (e,t)
state: ƒ ()
status: 0
statusCode: ƒ (e)
statusText: "NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost/test01'."
then: ƒ (t,n,r)
_proto_: Object

I have read the following SO posts but couldn't figure out what I did wrong:

*

*Returning a value from callback function in Node.js

*How do I return the response from an asynchronous call?

UPDATE:
Based on Quentin comment and this link i have modified the code. This will work okay on local computer but not on another computer:
app.use(
    cors({
        origin: 'http://192.168.178.50',
        methods: "GET, POST",
        optionsSuccessStatus: 200, // some legacy browsers (IE11, various SmartTVs) choke on 204
        preflightContinue: false,
    }),
    function(req, res, next) {
        res.header("Access-Control-Allow-Origin", "http://192.168.178.50"); // update to match the domain you will make the request from
        res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
        next();
    }
);


text:
Q: Laravel 5.1 - Manipulating Multiple Databases I have a situation where by I need to manipulate two databases that  have exactly the same structure.
I don't really want to do the following method in all of my model's methods:
$data = [
    'username' => 'john.doe'
];

DB::connection('mysql1')->table('users')->update($data);
DB::connection('mysql2')->table('users')->update($data);

Is there an API in Laravel 5.1 to insert, update and delete from multiple databases? For example, calling update in the user model would update both databases.
$this->update(['username' => 'john.doe']);

A: Create some sort of bridge class that accepts a query, duplicates it and then processes it in both databases with the '->connection('dbname')'. Create a new facade for it like DB2:: and run them through there.
There's no native functionality as it's not a typical use-case to manipulate 2 identical DBs at the same time from 1 app :)


text:
Q: Count days between two dates, excluding weekends (MySQL only) I need to calculate the difference (in days) between two dates in MySQL excluding weekends (Saturday and Sunday). That is, the difference in days minus the number of Saturday and Sunday in between.
At the moment, I simply count the days using:
SELECT DATEDIFF('2012-03-18', '2012-03-01')

This return 17, but I want to exclude weekends, so I want 12 (because the 3rd and 4th, 10th and 11th and 17th are weekends days).
I do not know where to start. I know about the WEEKDAY() function and all related ones, but I do not know how to use them in this context.

A: Illustration:
mtwtfSSmtwtfSS
  123456712345   one week plus 5 days, you can remove whole weeks safely
  12345-------   you can analyze partial week's days at start date
  -------12345   or at ( end date - partial days )

Pseudocode:
@S          = start date
@E          = end date, not inclusive
@full_weeks = floor( ( @E-@S ) / 7)
@days       = (@E-@S) - @full_weeks*7   OR (@E-@S) % 7

SELECT
  @full_weeks*5 -- not saturday+sunday
 +IF( @days >= 1 AND weekday( S+0 )<=4, 1, 0 )
 +IF( @days >= 2 AND weekday( S+1 )<=4, 1, 0 )
 +IF( @days >= 3 AND weekday( S+2 )<=4, 1, 0 )
 +IF( @days >= 4 AND weekday( S+3 )<=4, 1, 0 )
 +IF( @days >= 5 AND weekday( S+4 )<=4, 1, 0 )
 +IF( @days >= 6 AND weekday( S+5 )<=4, 1, 0 )
 -- days always less than 7 days

A: Simply try it using a simple function :
CREATE FUNCTION TOTAL_WEEKDAYS(date1 DATE, date2 DATE)
RETURNS INT
RETURN ABS(DATEDIFF(date2, date1)) + 1
     - ABS(DATEDIFF(ADDDATE(date2, INTERVAL 1 - DAYOFWEEK(date2) DAY),
                    ADDDATE(date1, INTERVAL 1 - DAYOFWEEK(date1) DAY))) / 7 * 2
     - (DAYOFWEEK(IF(date1 < date2, date1, date2)) = 1)
     - (DAYOFWEEK(IF(date1 > date2, date1, date2)) = 7);

Test :
SELECT TOTAL_WEEKDAYS('2013-08-03', '2013-08-21') weekdays1,
       TOTAL_WEEKDAYS('2013-08-21', '2013-08-03') weekdays2;

Result :
| WEEKDAYS1 | WEEKDAYS2 |
-------------------------
|        13 |        13 |

A: Below function will give you the Weekdays, Weekends, Date difference with proper results:

You can call the below function like,
select getWorkingday('2014-04-01','2014-05-05','day_diffs');
select getWorkingday('2014-04-01','2014-05-05','work_days');
select getWorkingday('2014-04-01','2014-05-05','weekend_days');

    DROP FUNCTION IF EXISTS PREPROCESSOR.getWorkingday;
    CREATE FUNCTION PREPROCESSOR.`getWorkingday`(d1 datetime,d2 datetime, retType varchar(20)) RETURNS varchar(255) CHARSET utf8
    BEGIN
     DECLARE dow1, dow2,daydiff,workdays, weekenddays, retdays,hourdiff INT;
        declare newstrt_dt datetime;
       SELECT dd.iDiff, dd.iDiff - dd.iWeekEndDays AS iWorkDays, dd.iWeekEndDays into daydiff, workdays, weekenddays
      FROM (
       SELECT
         dd.iDiff,
         ((dd.iWeeks * 2) +
          IF(dd.iSatDiff >= 0 AND dd.iSatDiff < dd.iDays, 1, 0) +
          IF (dd.iSunDiff >= 0 AND dd.iSunDiff < dd.iDays, 1, 0)) AS iWeekEndDays
           FROM (
          SELECT  dd.iDiff, FLOOR(dd.iDiff / 7) AS iWeeks, dd.iDiff % 7 iDays, 5 - dd.iStartDay AS iSatDiff,  6 - dd.iStartDay AS iSunDiff
         FROM (
          SELECT
            1 + DATEDIFF(d2, d1) AS iDiff,
            WEEKDAY(d1) AS iStartDay
          ) AS dd
        ) AS dd
      ) AS dd ;
      if(retType = 'day_diffs') then
      set retdays = daydiff;
     elseif(retType = 'work_days') then
      set retdays = workdays;
     elseif(retType = 'weekend_days') then
      set retdays = weekenddays;
     end if;
        RETURN retdays;
        END;

Thank You.
Vinod Cyriac.
Bangalore

A: IT my helpful to you
The bellow logic only show the how many days
like
sun   mon

1      2 .....................

DELIMITER $$
DROP FUNCTION IF EXISTS `xx`.`get_weekday` $$
CREATE FUNCTION `xx`.`get_weekday` (first_date date, last_date date, curr_week_day int) RETURNS INT
BEGIN
DECLARE days_tot int;
DECLARE whole_weeks int;
DECLARE first_day int;
DECLARE last_day int;
SET whole_weeks = FLOOR(DATEDIFF(last_date,first_date)/7) ;
SET first_day = WEEKDAY(first_date) ;
SET last_day = WEEKDAY(last_date)  ;
IF curr_week_day  BETWEEN first_day AND  last_day
           AND  last_day > first_day
           OR ( curr_week_day BETWEEN last_day AND first_day
           AND  last_day <  first_day  )
THEN SET days_tot = whole_weeks + 1;
ELSE SET days_tot = whole_weeks ;
END IF;
RETURN  days_tot;
END $$
DELIMITER ;

    SELECT
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 0) as mo,
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 1) as tu,
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 2) as we,
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 3) as th,
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 4) as fr,
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 5) as sa,
      `xx`.`get_weekday` ('2009-01-01', '2009-07-20', 6) as su;

Table based query
ip:
Weekday count
2        10
3         5

SELECT WEEKDAY( `req_date_time` ) AS weekday, COUNT( id ) AS id
FROM `ddd`
WHERE (
`req_date_time` >= '2014-12-01'
AND `req_date_time` <= '2014-12-31'
)
AND WEEKDAY( `req_date_time` ) != '1'
GROUP BY WEEKDAY( `req_date_time` )

A: You can use a dates table:
tbl_dates

dow is 'day of week' in my table. Then your query looks like this:
SELECT Count(theDate) AS numWeekDays
FROM tbl_dates
WHERE theDate >[startDate] And theDate <=[endDate] AND dow <> 1 AND dow <> 7;

In this case, 1 and 7 are Sunday, Saturday, respectively (which is the default) and, of course, you can nest that into another query if you need to calculate this for many startDate(s) and endDate(s).


text:
Q: How to re-enable the default binding in an override I have a TestModule which does several bindings for my unit tests, e.g. it replaces accessor classes for external systems with stubs:
bind(ExternalSystemAccessor.class).to(ExternalSystemAccessorStub.class).in(Singleton.class);

Now one of my tests needs to use the productive implementation, so I tried to bind it back the default with an override:
injector = Guice.createInjector(Modules.override(new TestModule()).with(new AbstractModule() {
    @Override
    protected void configure() {
        bind(ExternalSystemAccessor.class).to(ExternalSystemAccessor.class);
    }
}));

However, this leads to a Guice error:
com.google.inject.CreationException: Guice creation errors:

1) Binding points to itself.

So how can I get back to the default binding with an override?

A: Just found the answer while typing the question. The solution is to omit the to method:
@Override
protected void configure() {
    bind(ExternalSystemAccessor.class); // re-enable default binding
}


text:
Q: Using IP connected arduinos to trigger cameras I am looking to build a 5 DSLR camera triggering system using arduinos over our network.
Currently we have physical trigger cables so that we can trigger each DLSR camera without delay. Even though all the cameras are on the network and running Nikon capture pro, there is a small delay from hitting the "shoot button" in the software, and the camera actually capturing the image. The physical trigger is instantaneous.
Basically I'd like to eliminate the need to run dedicated triggering cable to the cameras, as all I want to run is power, and a couple of ethernet to each camera. I want to have the ability to trigger, and intelligently change camera timings through an arduino or similar ip connectible device, sometimes we may have a single trigger, but slight delays to each shot, like, take one immediately, then two slightly later....
The triggering needs to be done physically, but may be done via sensor, so having an arduino with each camera will give us lots of options.
In the control room we want to be able to trigger any of the cameras with physical buttons, much like you'd see in industrial applications, something that can really take a beating. So from these buttons I would expect to run them all into an arduino, and then that arduino communicates with the others to trigger them.
Signal flow is like this
Button in control room > arduino > internet > arduino > Nikon external trigger cable > Nikon Camera.
Some cameras will trigger at the same time, others with delays.
So my key question is: What is the latency of one ip connected arduino, triggering another?

A: TCP/IP on Arduinos isn't exactly the best choice for anything real-time.  Ethernet timing isn't deterministic, so regardless of any method that attempts to remove jitter or compensate for latency, it will never be spot on.
You mention "Arduino -> network -> Arduino" as your desired topology, in which case I would throw away the idea of using the (very expensive) Ethernet boards and use something designed for embedded systems, like RS-485.  As you have total network control, your master module could send a 'shutter' message for every slave to pick up and act upon after message completion.  They would all receive it at the exact same time (+/- 1 ns/foot), so jitter and lag would be negligible for any camera application.
Here's a shield that has RS-485 on it, but it's just a single chip (e.g. MAX485 & friends) that you could breadboard.

Edit:
How far apart are these cameras?  If they're only ~10 meters apart and you want a (light?) sensor that goes to each one, just wire up a sensor+shutter+power cable and run them to the same Arduino.  It should only be 4-6 wires; buy some good connectors and it should be painless to tear-down and set-up.  You might be able to get away with significantly longer cables even, depending on the sensor, etc.

A: To answer your key question, the latency of one IP connected arduino to another is almost completely dependent on your computer network. The arduino hardware and trigger will add some latency, but it can be treated as 0 compared to the amount of latency that a computer network and physical trigger hardware will add.
Typically in medium to large size corporate networks I have seen a latency of anywhere between 3ms and 50ms.
If you are wanting all of your cameras to trigger at the exact same time you might want to consider a more sophisticated approach to deal with unpredicted delays on the network. Every so often you can send timing information to your trigger arduino. Over time you can start to average out the jitter on the network. Jitter being the difference between the latency of one packet to the latency of other packets at different times. You should be able to get "ok" time with this method, then when you want your cameras to trigger, you send a packet saying what time stamp you want them to trigger at.
You can also add a return packet which the user control side ardunio would receive. With a bit of work you can use the round trip time to perfect your timing even more.
If you don't care about having them all go at the exact same time, you will just need to keep your trigger packet, and any associated overhead, as small as possible.


text:
Q: Best way to search for 3 comparisons in a Bank Note dataset So, I need to create a classifier  with 3 simple comparisons to detect a fake bill, based on something like this pseudocode:
assume you are examining a bill
with features f_1 ,f_2 ,f_3 and f_4
your rule may look like this :
if ( f_1 > 4) and ( f_2 > 8) and ( f_4 < 25):
  x = " good "
else :
  x = " fake "

What is best to use for this - a lambda? I started with this:
distdf = {
f1 : banknote['variance']
f2 : banknote['skewness']
f3 : banknote['curtosis']
f4 : banknote['entropy']
}

But I am not sure how to proceed. This is using the famous bank note authentication dataset: BankNote_Authentication.csv that can be found on Kaggle.

A: We can try with np.where to check all conditions and apply the corresponding labels. No need to alias columns to f1, f2, f3 etc:
banknote_df['classifier'] = np.where(
    (banknote_df['variance'] > 4) &
    (banknote_df['skewness'] > 8) &
    (banknote_df['entropy'] < 25),
    'good',
    'fake'
)

Sample Program:
import numpy as np
import pandas as pd

banknote_df = pd.DataFrame({
    'variance': [2.2156, 4.4795, 1.866, 3.47578, 0.697854],
    'skewness': [9.45647, 8.54688, -5.4568, 6.15258, -3.4564],
    'curtosis': [-1.12245, -1.2454, 2.75, -6.5468, 3.45875],
    'entropy': [-0.424514, -2.45687, 0.1230152, -6.1254, -0.45241],
    'class': [0, 0, 0, 0, 0]
})

banknote_df['classifier'] = np.where(
    (banknote_df['variance'] > 4) &
    (banknote_df['skewness'] > 8) &
    (banknote_df['entropy'] < 25),
    'good',
    'fake'
)
print(banknote_df)

banknote_df:
   variance  skewness  curtosis   entropy  class classifier
0  2.215600   9.45647  -1.12245 -0.424514      0       fake
1  4.479500   8.54688  -1.24540 -2.456870      0       good
2  1.866000  -5.45680   2.75000  0.123015      0       fake
3  3.475780   6.15258  -6.54680 -6.125400      0       fake
4  0.697854  -3.45640   3.45875 -0.452410      0       fake


text:
Q: Proving a matrix is surjective Is a $n \times n$ matrix always surjective? If it is, how can I prove it using the rank-nullity theorem?

A: No it's not. To see this consider the zero matrix as a map from $\mathbb{R}^n\rightarrow \mathbb{R}^n$ which is clearly not surjective.

A: Recall that surjective means that for any $b\in \mathbb{R^n}$ the system
$$Ax=b$$
has solution, that is true if and only if $\dim(Im(A))=n$ that if and only if $A$ is full rank.

A: Maybe your getting confused because there is a fact that says that a $n\times n$ matrix which has null kernel is always surjective. This is a classical applications of  rank-nullity theorem because $$n=\dim Ker (A) + \dim Im (A)$$ and its clear that $\dim Ker(A)=0 \implies \dim Im(A)=n$ which in this case means that $A$ is surjective.


text:
Q: How to suppress constraint layout error "MATCH_PARENT is not supported in ConstraintLayout" On the newest version of constraint layout, Beta 5, using match_parent throws an exception:
android.view.InflateException: Binary XML file line #12: MATCH_PARENT is not supported in ConstraintLayout

As explained in the release note:

"(...) its behavior undefined. To reduce the risk of errors we now throws an
  exception if we encounter it." - source

They suggested that the correct usage would be to use 0dp (MATCH_CONSTRAINT), but since I have a Drawer Layout inside my constraint layout, setting the width to 0dp throws "DrawerLayout must be measured with MeasureSpec.EXACTLY" error.
So my question is how can I suppress the error "MATCH_PARENT is not supported in ConstraintLayout"?

A: The replacement of
android:layout_width="match_parent"

in a ConstraintLayout can be done with
android:layout_width="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"

i.e. constraining the widget to the right and left edges of the parent

A: At least as of version 1.1.0-beta3 of the constraint layout,
You can use match_parent without issues.
However it's still recommended that you use:
android:layout_width="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"


text:
Q: ProgrammingError: Failed processing format-parameters; Python 'int64' cannot be converted to a MySQL type I need to make an update in a database, I have this code:
data = pd.read_excel(r'path')

mydb = mysql.connector.connect(
    host="x",
    user="x",
    password="x",
    database="x"
)

mycursor = mydb.cursor()
max_row = data.shape[0]

for r in range(0,max_row+1):
    sql = "UPDATE table SET grade= '%s' WHERE id= '%s';"
    val = (data.iloc[r]['grade'], data.iloc[r]['id'])

    mycursor.execute(sql, val)

    mydb.commit()

And I get this error:
mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python 'int64' cannot be converted to a MySQL type
I have tried to convert the ID to integer but it does not solve the problem.


text:
Q: How to stat the time a file was modified ins specific datetime format I need to write to a file and then get the last_modified date and update a table.
How would I do the following:
echo 'new file' > /tmp/file.txt
stat /tmp/file.txt
16777218 16641883 -rw-r--r-- 1 david wheel 0 6 "Feb 19 16:48:21 2013"
"Feb 19 16:48:21 2013" "Feb 19 16:48:21 2013" "Feb 19 16:48:21 2013"
4096 8 0 hello.txt

How would I get the last_modified time in the format of "YYYY-MM-DD HH:MM:SS" to do the following SQL update?
update title set datetime='2012-01-01 00:00:01' where id=2

A: As you are using bash, it's precised in the man page that you can display your result in a specific format, so you can precise stat to print the result with a human readable time format.
 stat --format=%x your_file

will display the time of last access.
Now the output format can depend on the shell you are using, (as stat can be a builtin), so if you want to be sure to get it parsed as you want to, you can use the uppercase option letter, which will give you the lowercase letter option result, in Epoch format.
So that if you create a little program that can take in entry an Epoch time and prints out the human readable time you want to get, you could do:
cat --format=%X your_file | ./your_epoch_translator_program > your_result_file
update tile set datetime=`cat your_result_file` where id=2

That's just an idea, hope this helps !


text:
Q: How to sub string dynamic character with numric (eg: $1000, 100units) I'm trying to do data cleansing that require to clean up some text based on specific pattern, but i still quite new on regular expression, based on RegExCheatsheet, i'hv try out some simple regex for data cleansing (remove any pattern like $1000 & 1000pcs).
Below is my sample strings:
[1] "(Promotion) stuff ABC 1pcs"
[2] "(Trial) $200 stuff XYZ 200pcs"
[3] "(Test) $1000 stuff WER 5000pcs"

I have tried method as below
x <- c("(Promotion) stuff ABC 1pcs",
       "(Trial) $200 stuff XYZ 20pcs",
       "(Test) $1000 stuff WER 5000pcs")

gsub('$[0-9][0-9][0-9][0-9]','',x) #replace all $200, $1000 & etc.. into ""
gsub('[0-9][0-9][0-9][0-9]pcs','',x) #replace all 1pcs, 20pcs, 5000pcs & etc.. into ""

Question: Is there any better (more dynamic regex) to capture the "$200 / 5000pcs" pattern? Note that the data range for $ and pcs is unknown, might start from 1 to 10000 or more.
Expect result (after substring):
[1] "(Promotion) stuff ABC"
[2] "(Trial) stuff XYZ"
[3] "(Test) stuff WER"

Any help and comment is welcome, thanks!

A: We may do the following
x <- c("(Promotion) stuff ABC 1pcs", "(Trial) $200 stuff XYZ 200pcs", "(Test) $1000 stuff WER 5000pcs")
gsub(" (\\$\\d+|\\d+pcs)", "", x)
# [1] "(Promotion) stuff ABC" "(Trial) stuff XYZ"     "(Test) stuff WER"

This replaces a space followed by $ and at least one digit or at least one digit followed by pcs. So, comparing with your approach, I added | as the OR operator and used + as to allow for one or more digits (and where \\d is the same as your [0-9]).

The approach above assumes that the target is not at the beginning of a string. Otherwise we may do
gsub("  ", " ", trimws(gsub("\\$\\d+|\\d+pcs", "", "$200  $300  stuff XYZ 200pcs")))
# [1] "stuff XYZ"

which deals with leading/trailing spaces whitespace and multiple spaces.

A: Using gsub we can remove any word that has a digit in it and an optional $ argument from the string.
gsub("\\$?[0-9]+\\w+", "", x)
#[1] "(Promotion) stuff ABC " "(Trial)  stuff XYZ "    "(Test)  stuff WER "

A: You may use this regex, which captures any continuous text not having any space inside it and which has at least one digit, either inside it or in the beginning or in the end,
[^\s]*\d+[^\s]* ?

And replace it with empty string.
Demo

A: A rather novice answer:
library(tidyverse)
x <- c("(Promotion) stuff ABC 1pcs", "(Trial) $200 stuff XYZ 200pcs", "(Test) $1000 stuff WER 5000pcs")
x %>%
  str_remove_all("\\$(?=[0-9])") %>%
  str_remove_all("\\d") %>%
  str_remove_all("pcs")

EDIT: Or:
x %>%
  str_remove_all("\\$(?=[0-9]+)") %>%
  str_remove_all("\\d|pcs")

Same result but longer:
#"(Promotion) stuff ABC " "(Trial)  stuff XYZ "    "(Test)  stuff WER "


text:
Q: Lenovo ThinkBook 14 G2 : I can't use fingerprint sensor in Ubuntu 22.04 I have Lenovo Thinkbook 14 G2 and Ubuntu 22.04 and I'm unable to use the fingerprint scanner for login. Also I don't see frintprint option in user setting.
My device information is as follows:
ID 27c6:55a4 Shenzhen Goodix Technology Co.,Ltd. Goodix FingerPrint Device

A: I think that fprint will solve the problem you have.
Link to the documentation.
According to descriptions you'll need to perform following steps:

*

*Install
sudo apt install libpam-fprintd

*First test it by running following command in the terminal
fprint_demo

*Save the fingerprint, which will make your login screen to require a finger swipe instead of a pass
fprint-enroll
Info:
In some cases you'll need to activate fingerprint reader for elevated privileges for example with sudo by running following command sudo pam-auth-update


text:
Q: How can I reference a helm array parameter with index I have this helm parameters in a values.yaml file.
spec:
   containers:
     - name: mycontainer
       image: my.image.url

I would like to reference the name and image parameters from another kubernetes-resource.yaml file with index.
I tried
containerReference: {{ index .Values.spec.containers[0].name | quote }}

and
containerReference: {{ (index .Values.spec.containers 0).name | quote }}

But I get: bad character U+002D '-'

A: try
{{ with index .Values.spec.containers 0 }}
containerReference: {{ .name | quote }}
{{ end }}


text:
Q: Position image to the right of content using css/bootstrap I am trying to position an image to the right of the content area as shown in this dribble shot.
https://dribbble.com/shots/15571736-Money-Transfer-Website
Here is what I have so far.
https://codepen.io/pinapelkod/pen/RwLJJNm
.content {
  position: relative;
}
.bg-image {
  position: relative;
  top: 350px;
  left: 450px;
  height: 350px;
  z-index: 2;
}

When I float the image or position using top and left properties, the layout gets distorted.

A: By updating the bg-image class style I got the following result. If there is a different problem, specify it more clearly.

body {
  background-color: white;
  color: #1d2331;
}

.bg-image {
  float: right !important;
  width: 100%;
  position: relative;
  height: auto;
  margin-right: -40% !important;
}

a.nav-link,
a.navbar-brand {
  color: #1d2331;
}

a i {
  color: #c9327b;
}

form .btn {
  background-color: #1d2331;
  color: #f3f1fe;
}

.action-call {
  min-height: 35vh;
}

.feature {
  background-color: #f3f1fe;
  min-height: 56vh;
}

.feature .icon-link {
  text-decoration: none;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
  integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

        Fincy App

        <button class="btn dropdown-toggle" type=" button" id="personalbtn" data-bs-toggle="dropdown"
          aria-expanded="false">Personal</button>

          Download

 Plans

 Product

      <form class="ms-5">
        <button class="btn btn-outline-success px-5" type="submit">Login</button>
      </form>

 Send money
abroad more faster

 Safety guarantee

We make sure your money will
be safe 100% guarantee

             Read more

 Send money in minutes

Your money will be sent faster
than your blue wallet

             Send money now

A:

   ...text...

A: I restructured the html and added a bootstrap display (d-flex) class as shown below.
Update HTML structure:

           .....

           .....

The corresponding CSS:
.content {
  position: relative;
}

.bg-image {
  position: relative;
  top: -310px;
  left: 160px;
  height: 500px;
}

Link to codepen:
https://codepen.io/pinapelkod/pen/RwLJJNm


text:
Q: How should I update individual rows within a timescaledb where the CTID is not unique, and serial keys aren't allowed I have a timescale database with a couple dozen corrupt rows. I'd like to either delete or correct the corrupt rows, but my query editor is getting tripped up and when I try to do it manually I can see why.
Schema:
-- Table Definition ----------------------------------------------

CREATE TABLE metric_data (
    name text NOT NULL,
    metric integer NOT NULL,
    units text,
    type text,
    time timestamp with time zone NOT NULL DEFAULT now()
);

-- Indices -------------------------------------------------------

CREATE INDEX metric_data_time_idx ON metric_data(time timestamptz_ops DESC);
CREATE UNIQUE INDEX metric_data_pk ON metric_data(name text_ops,type text_ops,time timestamptz_ops);

The timescale creation call was straightforward: select create_hypertable('metric_data', 'time'); -- no additional partitions or anything.
My data browser / query editor is Postico.app, and when I attempt to edit a row manually it provides this message: "The query did not affect the expected number of rows." Postico appears to wrap an update in a transaction and roll it back if something goes sideways -- clever.

The update statement available to me from the editor is:
UPDATE "public"."metric_data" SET "type" = 'temperature'
WHERE
    ctid IN (
        SELECT ctid
        FROM "public"."metric_data"
        WHERE -- here I've censored the values
            "name" = 'blah'
            AND "metric" = 1
            AND "units" = 'blah'
            AND "type" = 'blah'
            AND "time" = '2022-02-08 21:52:51.115266-07'
        LIMIT 1
        FOR UPDATE)
RETURNING
    "name",
    "metric",
    "units",
    "type",
    "time";

Suspicious, I cancelled the GUI update and started poking around.
These are some unexpected query results:
select ctid, count(*) from metric_data group by ctid;

ctid
count

(145,37)
1

(200,108)
1

(17,93)
22

(195,12)
1

(62,35)
12

(152,13)
1

(164,85)
1

(50,71)
20

(39,3)
22

...
...

Some additional notes:

*

*Originally my table was created without the metric_data_pk unique index. I added that in an attempt to make updates and deletes on the table work predictably.

*I was first faced with some duplicate data and I started poking at ctid after reading another question. There, I witnessed a query which should have deleted ~20 rows based off of CTID alone delete ~200 rows.


text:
Q: Active Directory and PowerShell Does not Read a Variable I'm trying to create a script, but when I put the root manual, it will function perfectly but when I assign to a dinamical variable like I've commented "$Usuario = dsquery user -d $Dominio -samid $User" does not function and I receive an error:

Get-ADUser : The supplied distinguishedName must belong to one of the following
   partition(s): At line:1 char:19 ,Microsoft.ActiveDirectory.Management.Commands.GetADUser.

Import-Module ActiveDirectory
$User        = "ET308990"
$Fecha       = Get-Date -format dd/MM/yyyy
$Dominio     = "contoso"
$Descri      = " - Salida: "+$Fecha
$Usuario     = "CN=Folder4,OU=Folder3,OU=Folder2,OU=Folder1,DC=contoso,DC=com"
#    $Usuario     = dsquery user -d $Dominio -samid $User
    Get-ADUser -server $Dominio -Filter * -SearchBase $Usuario -Properties Department,Description,DistinguishedName|
        foreach { Set-ADUser $_ -Description ($_.Description+$Descri)}

So I don't know Why don't read the dinamical variable, I'm so close.
I appreciate your help!

A: You are passing double quotes to the parameter -SearchBase and it is only expecting a string without quotes around it. I.e this is what the parameter is seeing from the variable $Usuario; extra set of quotation marks:
'"CN=Folder4,OU=Folder3,OU=Folder2,OU=Folder1,DC=contoso,DC=com"'

To remove these simply use the following -replace operation:
$Usuario = (dsquery user -d $Dominio -samid $User) -replace '"',''


text:
Q: Jekyll images getting wrong url on release (not on localhost) I just tryed to release my first Jekyll site from localhost to a live version and got some img-url problems. I have got a image folder in the root that contains a subfolder called staff where I get my staffmembers images.
My problem is that when I loop through my staff members on the staff.html
the page tryes to get the images from:
mysite/staff.html/images/staff/img1.png
... when the image accually is in:
mysite/images/staff/img1.png
The staff.html file looks like this:
 {% for member in members %}

{{ member.name }}

{{ member.position }}
 {{ member.section }}

 {{ member.email }}

Mobil: {{ member.mobil }}

Kontor: {{ member.office }}

        {% endfor %}

I also have a folder in the root called '_staff' that contains .md files for all staff members that looks like this:
name: Jon doe
position: supervisor
section: carpenter
email: jon@site.se
mobil: 073-000 00 00
office: 08-000 00 00
img: images/staff/img1.jpeg

any ideas how to solve?

A: Replace images/staff/img with /images/staff/img. The first slash tells the server to look in the root (top folder of the website).
Tip: You could/should also check that you set permalink: pretty in your _config.yml file. That should hide the .html exentsion in your URL's. Source


text:
Q: XmlRpcException: Failed to parse parameters I recently made a remote call using metaweblog, and an error occurred. As shown below

But I can use native calls

The parameters in the official documents are consistent

Can you help me?


text:
Q: FLAC encoders – any difference in output between the command-line tools? I would like to know if there is any difference in the final output between the various command-line tools for encoding FLAC files, like ffmpeg, sox, the "official" flac etc. In some contexts, I have noticed that it's recommended to use flac over the others, but given that FLAC represents lossless encoding, am I correct in assuming that they should all produce identical output (given the same options)?

A: The FLAC encoder has a ton of parameters, so you'll need to consult with the source code of ffmpeg/sox to see how they use the codec but despite all of this does it really matter? FLAC is a lossless encoder, so even if flac, ffmpeg and sox produce different FLAC files, they will all decode bit perfectly.
FFmpeg will produce a different output (header) as it adds itself to tags unless instructed otherwise.


text:
Q: How can I round a date to nearest 15 minute interval in Perl? I want to round current time to the nearest 15 minute interval.So if it is currently 6:07, it would read 6:15 as the start time.
How can I do that?

A: An easy solution is to use Math::Round from CPAN.
use strict;
use warnings;
use 5.010;

use Math::Round qw(nearest);

my $current_quarter = nearest(15*60, time());
say scalar localtime($current_quarter);

A: You can split the time into hours and minutes and then use the ceil function as:
use POSIX;

my ($hr,$min) = split/:/,$time;
my $rounded_min = ceil($min/15) * 15;

if($rounded_min == 60) {
   $rounded_min = 0;
   $hr++;
   $hr = 0 if($hr == 24);
}

A: The nearest 15 minute interval to 6:07 is 6:00, not 6:15. Do you want the nearest 15 minute interval or the next 15 minute interval?
Assuming it's the nearest, something like this does what you want.
#!/usr/bin/perl

use strict;
use warnings;

use constant FIFTEEN_MINS => (15 * 60);

my $now = time;

if (my $diff = $now % FIFTEEN_MINS) {
  if ($diff < FIFTEEN_MINS / 2) {
    $now -= $diff;
  } else {
    $now += FIFTEEN_MINS - $diff;
  }
}

print scalar localtime $now, "\n";

A: Minor variation on first answer using sprintf instead of ceil and POSIX.  Also does not use any additional CPAN modules.  This rounds up or down so 6:07 = 6:00, 6:08 = 6:15, 6:22 = 6:15 and 6:23 = 6:30.  Note that a hour is added if the rounded minutes equal 60.  However to do this properly, you would have to use a timelocal and localtime functions to add the hour.  i.e. adding an hour may add a day, month or year.
  #!/usr/bin/perl

  my ($hr,$min) = split/:/,$time;

  my $interimval = ($min/15);

  my $rounded_min = sprintf "%.0f", $interimval;

  $rounded_min = $rounded_min * 15;

  if($rounded_min == 60)

  {

     $rounded_min = 0;

     $hr++;

     $hr = 0 if($hr == 24);

  }


text:
Q: CUDA/Thrust Image Processing I was unable to find any information about if the Thrust library could support matrix operations. Therefore, I was wondering if it were possible to use the Thrust library in Image processing? I would also like to see any examples.
Thanks for any responses.

A: For image processing, you may want the NPP library. Since you asked about matrix operations, you may want to take a look at CUBLAS and CUSPARSE, also available from nVidia, here.
As for actual Thrust integration of these libraries, many of us have been asking nVidia for that for ages. Roll your own wrapper is the way to go in this case.
That said, Thrust is fantastic for manipulating 1D signals.

A: Thrust supports regualar algebra operations on matrices but if you are using mostly sparse matrices and need solver type operations take a look at cusp

A: You can look and extend OPENCV
's Image libraries. They use NPP underlying and the code is BSD.


text:
Q: PLSQL Convert String to Datetime The 'closed_date' column and 'submit_date' are loaded into Oracle as strings, they look like this:
8/17/2017 12:41 (in 24hrs)
How can I convert this string format into date in the format of
mm/dd/yyyy hh24:mi:ss
Thank you!

A: Given your date format, you don't want seconds:
select to_date(CLOSED_DATE, 'mm/dd/yyyy hh24:mi') as CLOSED_DATE,
       to_date(SUBMIT_DATE, 'mm/dd/yyyy hh24:mi') as SUBMIT_DATE
from s_daily_ops

A: Tack on a trailing ':00', or remove ':ss' from your format string.


text:
Q: Why does a function pointer declaration need to know the types of the parameters and return value? Why does a function declaration in C need to know the types of the pointed-to-function's parameters and return value?
A pointer declaration in c is written as follows:
returnType ( *funcPtrName ) ( paramTypes )

For example foo below:
char my_func ( int x )
{
    ...
}

int main ()
{
    char ( *foo ) ( int );

    foo = my_func;

    foo( 2 );
}

When declaring a pointer to a value, the type is used to determine the size (in bytes) of one element. For example in int* p, the int tells the compiler that the elements pointed to by p are sizeof( int ) apart. This information is used for pointer arithmetic.
However, a function pointer points to a single address and pointer arithmetic is not allowed.
So why is the extra information needed? Are the returnType and paramTypes included solely for the purpose of supporting error checking by the compiler? (Eg. to alert the user when they assign a function whose type doesn't match).

A: There are several reasons. Let's consider the return value first.
Suppose a program contains the code y = f(x);. After calling f, the compiler need to get the value it returned and assign it to y. Where does it get that value? In some systems, integer return values are passed in general registers and floating-point return values are passed in floating-point registers. So the compiler cannot know where the return value is unless it knows the type. Wide integers, such as long long int, might be passed in multiple registers. Small structures might be returned in registers, while large structures might be returned in memory, using a pointer to space the calling function provides and that it is required to pass to the called function as a hidden argument.
Similarly, the compiler needs to know where to put the arguments when it is calling a function. The first several integer arguments might be passed in general registers, while the first few floating-point arguments might be passed in floating-point registers. Additional arguments of either type might be pushed onto the stack.
Additionally, sometimes programmers might pass an integer expression where the function actually expects a floating-point argument, such as in pow(x, 4). When the compiler knows the argument must be a floating-point argument, it can convert it to the expected type.
Another benefit is that, when the compiler knows the types, it can report an error if the argument does not match the expected type and cannot be implicitly converted to the expected type, and it can similarly report an error if the return type does not match.

A: Yes, the "extra information" you're asking about is mostly "for the purpose of supporting error checking by the compiler."
Function prototypes carry along argument type information so that the compiler can check that calls through the function pointer will have the correct arguments for the called function -- whatever it is.  That's the whole point of function prototypes -- to ensure that functions are called with the correct arguments.
If you're not interested in this (or if you're cheating and using function pointers that point to a variety of heterogenous functions, taking different numbers of arguments, and hoping everything works out), you can do that -- by simply leaving the parentheses empty, as in this example:
#include <stdio.h>

int f1(int a, int b) { printf("f1(%d, %d)\n", a, b); }
int f2(double d) { printf("f2(%f)\n", d); }

int main()
{
    int (*allegedly_generic_function_pointer)();

    allegedly_generic_function_pointer = f1;
    (*allegedly_generic_function_pointer)(1, 2);
    allegedly_generic_function_pointer = f2;
    (*allegedly_generic_function_pointer)(3.4);
}

Here allegedly_generic_function_pointer is a pointer to a function taking unspecified arguments, and returning int.  ("Function taking unspecified arguments" was how all functions and function pointers were described in pre-ANSI C, before function prototypes were invented.)  As shown, you can use allegedly_generic_function_pointer to point to -- and call -- functions taking different arguments.  (Your compiler might give you various "helpful" warnings, though.)
So far I've only been talking about argument information.  The return type of the pointed-to function has a more vital purpose -- so the compiler can generate correct code for dealing with the return value at all.
(Why is the return type more vital than the argument types?  Well, when you call a function without a prototype in scope, the compiler assumes that the number and types of the expected arguments exactly match the number and types of the arguments you actually supplied in your call -- and the compiler obviously knows that, because the information is right in front of it as it's compiling the call.  But the only way it can know the return type of the called function is for that to have been explicitly specified in the function pointer type declaration.)
If you want a pointer to a function taking unspecified arguments and with an unspecified return type, that's one of the things that you simply can't do in C.  (Why would you want such a thing?  Ask me about the C interpreter I wrote once.)


text:
Q: Difference between YUI 3.3 and YUI 3.7 I have a website that uses YUI 3.3.0 and YUI 2.9.0 (using YUI 2in3 project), right now I'm trying to improve performance in the initial load time of the site, I followed several tips that I found on the web, but I wonder if I have any improvement if I make an upgrade from YUI 3.3.0 to YUI 3.7.1

A: What's the difference?  YUI 3.3.0 was released in January 2011, and 3.7.1 in September 2012, so that is ~20 months of work by the YUI team and community on the library that is missing (4 versions).  Since YUI has hundreds of modules, it's tough to pin-down exactly what changed that could affect your site. It could be very little, or it could be a lot.  It's very unlikely that an upgrade could slow-down your site, though.  Performance has always been a high priority for the project, so whenever performance wins can be had, they are taken.  For example, this recent 3.6.0->3.7.0 introduced some significant custom-event performance improvements (source).
You can take a peek through each release announcement to see if any of your specific needs were addressed:

*

*3.4.0

*3.5.0

*3.6.0

*3.7.0
Also, stop by #yui on Freenode if you have any specific questions about your site and YUI performance.


text:
Q: heroku undefined method `name' for User In my app it was User model without 'name' field, when I added this field by migration. On my localhost my sign up form works fine, but on heroku I have this log:
ActionView::Template::Error (undefined method `name' for #<User:0x0000000518fb00>):
Rendered users/new.html.haml within layouts/application (3.1ms)
     5:       = f.input :name, required: 'true'
     6:       = f.input :email, required: 'true'
     3:     %h1 Sign up
     4:     = simple_form_for @user do |f|
     7:       = f.input :password
     8:       = f.input :password_confirmation, required: 'true'

What I've tried:
heroku run rake db:migrate
heroku run rake db:reset

but nothing helped.

A: you also have to restart heroku after migrating - you'd want to run
heroku run rake db:migrate
heroku restart

A: Make sure you have done git add .. Then git status to make sure that all the files have been committed. Then try the push again. Then migrate again.


text:
Q: WebService con Entity Framework. POST funciona solo con json, no con xml a ver si alguien puede ayudarme.
Estoy montando un webservice con Entity Framework para que desde un cliente realicen una petición POST enviando un XML y este guarde esos datos en una base de datos.
Funciona perfectamente si realizo un POST enviando un json ( utilizando postman ), sin embargo si envío un XML me da error : 400 Bad Request
He puesto un punto de interrupción y los POST con xml se van por el return BadRequest(ModelState);
        // POST: api/MT_PalletMovement
    [ResponseType(typeof(MT_PalletMovement))]
    public IHttpActionResult PostMT_PalletMovement(MT_PalletMovement mT_PalletMovement)
    {
        if (!ModelState.IsValid)
        {
            return BadRequest(ModelState);
        }

        db.MT_PalletMovement.Add(mT_PalletMovement);

        try
        {
            db.SaveChanges();
        }
        catch (DbUpdateException)
        {
            if (MT_PalletMovementExists(mT_PalletMovement.OT))
            {
                return Conflict();
            }
            else
            {
                throw;
            }
        }

        return CreatedAtRoute("DefaultApi", new { id = mT_PalletMovement.OT }, mT_PalletMovement);
    }

A: 1) Necesitas configurar la salida de datos con soporte para XML.
   Puedes ver un ejemplo completo AQUÍ
2) Para la entrada de datos en XML puedes procesar el Request manualmente así:

using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Web.Http.Metadata;
using System.Xml.Serialization;

namespace WebApiXmlRequest.Controllers
{
    public class ValuesController : ApiController
    {
        // POST api/values
        [ResponseType(typeof(MT_PalletMovement))]
        public IHttpActionResult Post([XmlBody] MT_PalletMovement Model)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            // TODO: Lógica de programación que necesites

            return Ok(Model);
        }
    }

    public class MT_PalletMovement
    {
        public int Id { get; set; }

        [Required]
        public string Type { get; set; }
    }

    public sealed class XmlBodyAttribute : ParameterBindingAttribute
    {
        public override HttpParameterBinding GetBinding(HttpParameterDescriptor Parameter)
        {
            return new XmlParameterBinding(Parameter);
        }
    }

    public class XmlParameterBinding : HttpParameterBinding
    {
        public XmlParameterBinding(HttpParameterDescriptor Descriptor) : base(Descriptor)
        {
        }

        public override Task ExecuteBindingAsync(ModelMetadataProvider MetadataProvider, HttpActionContext ActionContext, CancellationToken CancellationToken)
        {
            return ActionContext.Request.Content.ReadAsStringAsync().ContinueWith(Task =>
            {
                var Binding = ActionContext.ActionDescriptor.ActionBinding;
                var Type = Binding.ParameterBindings[0].Descriptor.ParameterType;

                XmlSerializer Serializer = new XmlSerializer(Type);

                using (StringReader Reader = new StringReader(Task.Result))
                    SetValue(ActionContext, Serializer.Deserialize(Reader));
            });
        }

        public override bool WillReadBody => true;
    }
}


text:
Q: Zero divided by zero must be equal to zero What is wrong with the following argument (if you don't involve ring theory)?
Proposition 1: $\frac{0}{0} = 0$
Proof: Suppose that $\frac{0}{0}$ is not equal to $0$
$\frac{0}{0}$ is not equal to $0 \Rightarrow \frac{0}{0} = x$ , some $x$ not equal to $0$ $\Rightarrow$ $2(\frac{0}{0}) = 2x$  $\Rightarrow$  $\frac{2\cdot 0}{0} = 2x$ $\Rightarrow$ $\frac{0}{0} = 2x$ $\Rightarrow$ $x = 2x$ $\Rightarrow$ $ x = 0$ $\Rightarrow$[because $x$ is not equal to $0$]$\Rightarrow$ contradiction
Therefore, it is not the case that $\frac{0}{0}$ is not equal to $0$
Therefore, $\frac{0}{0} = 0$.
Q.E.D.

Update (2015-12-01) after your answers:
Proposition 2: $\frac{0}{0}$ is not a real number
Proof [Update (2015-12-07): Part 1 of this argument is not valid, as pointed out in the comments below]:
Suppose that $\frac{0}{0}= x$, where $x$ is a real number.
Then, either $x = 0$ or $x$ is not equal to $0$.
1) Suppose $x = 0$, that is $\frac{0}{0} = 0$
Then, $1 = 0 + 1 = \frac{0}{0} + \frac{1}{1} = \frac{0 \cdot 1}{0 \cdot 1} + \frac{1 \cdot 0}{1 \cdot 0} = \frac{0 \cdot 1 + 1 \cdot 0}{0 \cdot 1} = \frac{0 + 0}{0} = \frac{0}{0} = 0 $
Contradiction
Therefore, it is not the case that $x = 0$.
2) Suppose that $x$ is not equal to $0$.
$x = \frac{0}{0} \Rightarrow 2x = 2 \cdot \frac{0}{0} = \frac{2 \cdot 0}{0} = \frac{0}{0} = x \Rightarrow x = 0 \Rightarrow$ contradiction
Therefore, it is not the case that $x$ is a real number that is not equal to $0$.
Therefore, $\frac{0}{0}$ is not a real number.
Q.E.D.

Update (2015-12-02)
If you accept the (almost) usual definition, that for all real numbers $a$, $b$ and $c$, we have $\frac{a}{b}=c$ iff $ a=cb $, then I think the following should be enough to exclude $\frac{0}{0}$ from the real numbers.
Proposition 3: $\frac{0}{0}$ is not a real number
Proof: Suppose that $\frac{0}{0} = x$, where $x$ is a real number.
$\frac{0}{0}=x \Leftrightarrow x \cdot 0 = 0 = (x + 1) \cdot 0 \Leftrightarrow \frac{0}{0}=x+1$
$ \therefore x = x + 1 \Leftrightarrow 0 = 1 \Leftrightarrow \bot$
Q.E.D.

Update (2015-12-07):
How about the following improvement of Proposition 1 (it should be combined with a new definition of division and fraction, accounting for the $\frac{0}{0}$-case)?
Proposition 4: Suppose $\frac{0}{0}$ is defined, so that $\frac{0}{0} \in \mathbb{R}$, and that the rule $a \cdot \frac{b}{c} = \frac{a \cdot b}{c}$ holds for all real numbers $a$, $b$ and $c$.
Then, $\frac{0}{0} = 0$
Proof: Suppose that $\frac{0}{0}=x$, where $x \ne 0$.
$x = \frac{0}{0} \Rightarrow 2x = 2 \cdot \frac{0}{0} = \frac{2 \cdot 0}{0} = \frac{0}{0} = x \Rightarrow x = 0 \Rightarrow \bot$
$\therefore \frac{0}{0}=0$
Q.E.D.

Suggested definition of division of real numbers:
If $b \ne 0$, then
$\frac{a}{b}=c$ iff $a=bc$
If $a=0$ and $b=0$, then
$\frac{a}{b}=0$
If $a \ne 0$ and $b=0$, then $\frac{a}{b}$ is undefined.

A somewhat more minimalistic version:
Proposition 5. If $\frac{0}{0}$ is defined, so that $\frac{0}{0} \in \mathbb{R}$, then $\frac{0}{0}=0$.
Proof: Suppose $\frac{0}{0} \in \mathbb{R}$ and that $\frac{0}{0}=a \ne 0$.
$a = \frac{0}{0} = \frac{2 \cdot 0}{0} = 2a \Rightarrow a = 0 \Rightarrow \bot$
$\therefore \frac{0}{0}=0$
Q.E.D.

A: Your proof assumes that $0/0$ is a number since your argument involves arithmetic operations.
Now, if we assume the usual rules of arithmetic for the rationals, why can't we do this:
$$
\frac00+\frac11=\frac{0\times1+1\times0}{1\times0}=\frac00.
$$
Then
$$
1=\frac11=0.
$$

A: How do you define a fraction?
The definition I know is that for any number $a \neq 0$ we say the symbol $\frac{1}{a}$ satisfies  $a \cdot  \frac{1}{a} = 1$. One can show that this is well defined for any $a \neq 0$ and unique. Further, the symbol $\frac{b}{a}$ for any numbers $b,a$ with $a\neq 0$ is defined as $\frac{b}{a}:=b \cdot \frac{1}{a}$.
If $\frac{1}{0}$ would exists, then clearly by definition we would have  $$\frac{0}{0}=0 \cdot \frac{1}{0} = 1.$$ However,
the symbol $\frac{1}{a}$ is not definied for $a=0$, because there exists no number $b$ with $0 \cdot b  = 1$, so there is no value to which we can assign the symbol $\frac{1}{0}$.
Example of the above definition:
We can compute $\frac{1}{2}$, because we know
$$ 2 \cdot \frac{1}{2} = \frac{1}{2} +\frac{1}{2} =1$$  and since
$$ 2 \cdot  0.5 = 0.5 + 0.5 = 1 $$ it follows that
$$\frac{1}{2} = 0.5$$
holds.

A: If $\frac00 = 0$ then $0\times0=0$ would work as a proof. The problem is that also $3\times0=0$ and $7\times0$ and so on would all work.
So $\frac00=0,\space\frac00=1,\space\frac00=3,\space\frac00=$ just about anything.
There are too many possible results, we want such operations to return defined results (one and only one result), otherwise the operation itself is not actually defined. In fact, dividing any number by $0$ is 'undefined', 'illegal'.
When dividing a non-zero integer by zero, we have the same problem. only, in that case, we simply have no-results.
ie: $\frac60 =$ number which multiplied by $0$ equals $6$.
We can say $\frac60=\infty$ only to cut short on a theorem, stating that the limit of $\frac mn$ with m integer and $n$ going to $0$ is infinite. It is obviously a notation-artifact. Otherwise we should say that $\infty\times0$ equals $6$, and $7$, and $8$, and $9$...

A: The first fault is in the very statement. You assume that there is a $0/0$ in the first place, you have to have that before you even assume that it's not equal to zero.
Then even if there were a $0/0$ you're assuming that there is a $2{0\over0}$ and then that it is equal to ${2\cdot 0\over0}={0\over0}$.
Finally you assume that if $2x=x$ you must have that $x=0$, even if you've got this far there's no reason to think that $x$ is a number and must obey the rules for numbers.

Your updated proposition is true, but your proof has some issues.
In the first case you use the identity ${a\over b}+{c\over d} = {ad+bc\over bd}$ which is only shown to be true if $bd\ne0$.
In the second case you use the identity $a{b\over c} = {ab\over c}$ which is only shown to be true if $c\ne 0$.
That is you use twice identities where the prerequisite is not fulfilled.

A: The multiplicative semigroup of a field is not a group, but only an inverse semigroup. In the context of semigroups, we call $y$ an inverse element of $x$, if $x=xyx$ and $y=yxy$. An inverse semigroup is a semigroup where each element has an unique inverse element, such that an inverse operation $^{-1}$ can be defined via $x=xyx \land y=yxy \Leftrightarrow y=x^{-1}$. The unique multiplicative inverse element of $0$ in this context is $0$, so $\frac{0}{0}=0\cdot 0^{-1}=0\cdot 0=0$. But note that we also have $\frac{1}{0}=0$.
Note however that the rules for dealing with fractions get more complicated, because the sum of two symbolic  fractions is not necessarily a pure symbolic fraction:
$\frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}+0_d\frac{a}{b}+0_b\frac{c}{d}$. Here $0_x:=1-\frac{x}{x}$ is idempotent, because $\frac{x}{x}$ is idempotent, i.e. $0_x^2=1-2\frac{x}{x}+\frac{x^2}{x^2}=1-\frac{x}{x}=0_x$. The details of this standard representation are are worked out in a paper by Bergstra et al.
Inverse semigroups are the appropriate generalization of groups if we look at partial bijections instead of total bijections. In the context of rings, a ring whose multiplicative semigroup is an inverse semigroup is called a strongly regular ring. The category of strongly regular rings is related to the category of skew fields in a similar way as the integers are related to the prime numbers (and the same applies to the relation of the category of regular commutative rings to the category of fields). The name meadow has also been proposed for such rings. I have collected some scattered informations on those subjects in a blog post.
If we add the universal formula $a = 0 \lor (ab = ac \Rightarrow b = c)$ characterizing integral domains to the equations characterizing regular commutative rings, then we end up with a finite set of universal formulas characterizing the category of fields, as I learned from a paper by Hiroakira Ono. From this we can learn that the class of fields is closed under isomorphism, substructures and ultraproducts, see theorem 2.20 in chapter V "Connections with Model Theory" of Burris and Sankappanavar's A Course in Universal Algebra.
Now goblin decided to give an answer with a slightly different spin, but goblin has played with meadows himself in the past. He probably noticed that inversion defined like this is not a continuous function, and so kept on searching.
I decided to mention this, not in order to avoid partial functions, but in order to point out that partial functions (and especially partial bijections) do have nice properties on their own, which are different from the properties of total functions.
It is important to keep in mind that this definition of $\frac{x}{0}$ leads to discontinuous operations, so it cannot be used to evaluate limits. And for meromorphic functions, using this definition would even destroy part of the inherent structure, but declaring division by zero as undefined will do so too.

A: In order to prove anything whatsoever about $\frac{0}{0}$, we need a definition of $\frac{a}{b}$ where $a$ and $b$ are, say, integers. The correct definition is $ \frac{a}{b} = ab^{-1}$, where the definition of $b^{-1}$ is the number (which is unique, when it exists, according to some basic properties of numbers) such that $bb^{-1} = 1$. But then one can see (again, assuming some basic properties of numbers) that $0^{-1}$ does not exist, so $\frac{0}{0}$ isn't even defined.

A: You can define $\frac{0}{0}$ to be anything you want; it can be $0$, or $1$, or $\pi$. But here's the catch: we want the choice of value for $\frac{0}{0}$ to be compatible with the usual laws of arithmetic.
From this standpoint, what you've really proved is that if $\frac{0}{0}$ is anything except $0$, then the law $2\frac{0}{0} = \frac{2 \cdot 0}{0}$ cannot hold. Therefore, the law: $a\frac{b}{c} = \frac{ab}{c}$ cannot hold, either. This suggests that simply defining $\frac{0}{0}=0$ might actually be a good idea. Unfortunately, this breaks another law of arithmetic, namely $\frac{a}{a} = 1.$
Since we cannot have the best of both worlds, perhaps it is best to simply leave $\frac{0}{0}$ undefined.
Actually, I think the best solution is to define division not of real numbers, but of affine subsets of $\mathbb{R}$. These are: the singleton subsets of $\mathbb{R}$, the empty subset, and $\mathbb{R}$ itself. So by passing to the affine subsets, we've effectively adjoined two new "points", namely $\emptyset$ and $\mathbb{R}$.
Now define that given affine subsets $Y$ and $X$ of $\mathbb{R}$, we have:
$$\frac{Y}{X} = \{r \in \mathbb{R} \mid Y \supseteq rX\}$$
You can check that the result of dividing one affine subset by another will itself always be affine.
Under these conventions, we have:
$$\frac{0}{0} = \mathbb{R}, \qquad \frac{1}{0} = \emptyset$$
This justifies the intuition that trying to divide $0$ by $0$ is somehow different from trying to divide a non-zero number by $0$.
Full disclosure: although passing to the affine subsets works algebraically, I'm not entirely sure how to put a topology or uniform structure or metric on the collection of affine subsets of $\mathbb{R}$. Until we can figure out how to do this, my proposed solution probably isn't that useful.

A: The error is in the very first implication.  If $0/0$ is not equal to zero, there is no reason why $0/0$ must equal some $x$.  There is no reason to believe that we can do this division and get a number.
Therefore you have a proof that $0/0$ cannot equal any nonzero $x$.  Combine this with a proof that $0/0$ cannot equal zero, and you have proved that $0/0$ is not a number.

A: In my experience, when people have a problem with $\frac 0 0$ it generally means
they have not developed a clear idea of the way mathematics forms models.
The character of mathematical systems
At first, every expression a pupil meets can be evaluated to a number they understand,
but fairly soon $\frac 0 0$ and $\sqrt -1 $ turn up,
yet they cling to the feeling that "if you can write it, it must mean something".
The point has to be made that we define what expressions mean
in such a way as to help us solve problems,
and sometimes these definitions just can't be made to cover all cases
without implying weird behaviour,
and so we agree to consider some cases undefined.
This makes maths sound a rather arbitrary process,
but the constraint of solving problems actually makes it about the least contingent human activity there is.
Of course, having made some definitions, we experiment with their implications,
which gives rise to new problems, so pure mathematics feeds off itself as well as off applications.
We discover that we can create things in an inevitable way.
Algorithmic v. solution seeking operations
We can distinguish algorithmic operations such as addition, multiplication and raising to powers,
from solution-seeking operations such as subtraction, division and the taking of roots.
Operations in the first class are defined by some terminating algorithm
(such as repeated increment, addition or multiplication),
often in the form of a recursive definition, which we show terminates.
Operations in the second class are defined as solutions to equations,
i.e. they are required to yield numbers which,
when combined using previously defined operations, yield a certain result.
More generally, we may have conditions which are not written as equations,
and we may be operating on other entities than 'numbers'
(whatever they may be!1).
New numbers to make insoluble equations soluble
Sometimes we find that our condition can be satisfied by members of the set defined so far.
For example, given numbers $a$ and $b$,
we want to solve  $ a + n =b $ for $n$, and call that $ b - a $;
then, since $ 1 + 2 = 3 $, we say $ 3 - 1 = 2 $.
At other times, we find that there is no such solution,
e.g. there is no natural (counting) number $n$ such that $ 3 + n = 2 $
— this is when we ask ourselves if we can define $ 2 - 3 $.
Thus we move from natural to integers.
Given a type of equation we are trying to solve,
we hope we can define the new 'numbers' in a useful way:

*

*They should include the old numbers, or something very like them.

*We want to be able to apply the existing operations to them.

*We want them to obey they same rules that the old numbers did.

As goblin's answer said,

You can define $\frac 0 0$ to be anything you want; it can be 0, or 1, or π.
  But here's the catch: we want the choice of value for $ \frac 0 0 $ to be compatible with the usual laws of arithmetic.

Actually, though you can define it as you want,
it may make you rather unpopular if you insist on something really quirky,
so perhaps it is better to say "one could" etc.
Two ways of formalising a new number system
Typically we find that obeying the existing rules means that several expressions,
such as $ 2 - 3 $ and $ 3 - 4 $, should have the same value.
One way we deal with that is to define equivalence classes of pairs of numbers
(if the operation is binary) that should yield the same value;
we then show that we can define the various operations on the pairs
so that they respect the classes and work as in the original situation.
Another way to deal with it is to introduce one or two new symbols
and a syntax for combining them:
we might then define integers as formal expressions of the form $+n$ or $-n$,
and show that these formal expressions behave as desired.
Similarly, introducing $i$ lets us define complex numbers.
These are two important ways to build a formal 'working model' of a number system, but there are many others, such as Dedekind cuts, von Neumann's construction of $\mathbb N$ as 'free sets' and Conway's construction of Surreal numbers.
The error in the question
The problem with $\frac 0 0$ in this question arises
partly from failing to recognise
that the formal expressions we introduce have only those properties we
(consistently) define them to have and anything that follows from those.
A bigger problem, though, is not realising that the formal expressions
do not automatically mean anything, until we have shown that they
reproduce the old numbers as a subset.
Once we realise that they do not automatically mean anything,
it is easier to accept that our definition may exclude
expressions like $\frac 0 0$ (or call them 'undefined')
in order to ensure desirable behaviour of the new number system.
Another error in the question as first formulated was to assume that the new expressions
behave like the numbers they were constructed from,
rather than considering that as something to be investigated.
The solution set approach
Goblin's answer,
(after making the essential point that we decide how to define expressions)
went on to suggest an alternative definition of division in terms of the solution set of $a \times n = b$.
This suggests you consider $ \frac 0 0 $ as $ \mathbb R $ (why not $ \mathbb Q $ or $ \mathbb C $ … or even $ \mathbb Z $ or $ \mathbb N $ ?),
but it does not help you deal with $n^2 = -1$,
which needs the approach described above.
Notes
1 As Dedekind asked,
Was sind und was sollen die Zahlen?
"What are numbers and what should they be?"
or just possibly "… what is the point of them"!

A: Using the definition of a Ring, it is pretty simple to show that
$$\forall a, 0\times a=a\times 0=0$$
Thus, If we were to define division (only in the case where $c=ab=ba$):
$$\forall a, a=\frac{0}{0}$$
Which can be true if and only if your ring is the Zero ring
$$\{0\}$$
Therefore, when $\frac{0}{0}$ exists, it is actually $0$ (but there aren't any other numbers in the ring)

A: The answer to this might be better understood in layman's terms. Going back to grade-school level word puzzles, $\frac{x}{0}$ means:
If you have $x$ items, and you distribute them equally among $0$ people, how many items does each have?
The answer is not a number—it is "I can't answer that" because it rests on an invalid assumption, exposed by noticing that each doesn't refer to any people. The correct response is "each who?" or "there are no people!"
Just because a math problem is expressed using normal numbers and operators, taking the form of other valid math problems to which an answer is possible, doesn't mean that it must have an answer nor that the answer is a number. Division by 0 really means "don't divide."
What's the result of a division where you don't divide? Whatever the answer is, it's $NaN$—not a number.
Using a logic analogy (since math is ultimately just a specialized branch of logic), if someone asks you a question that normally has a true/false answer, such as "Have you stopped beating your wife?" but the premise is wrong because you have never done so, then neither true nor false is a correct answer. It is either the case that the answer is outside the domain of Boolean, or there is no answer at all. One cannot do further Boolean or true-false logic on such a non-Boolean. Attempting to do so is a category mistake.
Similarly, doing any number math with the result of the requested operation $\frac{x}{0}$ is also a category mistake. Proceeding as though it must equal some number $n$ is to act like "What does the color blue taste like?" is a sensible question. But blue doesn't taste like anything, because it isn't a flavor.

*

*If you don't have a temperature, what is your temperature?

*If you punch no one in the nose, how mad will they all be?

*If you forgot to buy a coffee cup, does your empty cup have 0 ml caffeinated or 0 ml decaffeinated coffee in it?

*Of all the times you've successfully committed suicide, which one hurt the most?

*Were all the parents you never had blue-eyed or green-eyed?

*How many ccs does a little white lie occupy?

A: Actually there are solid arguments why $0/0$ can be defined as $0$.
Here is a graphic of the function $f(x,y)=x/y$:

The function is odd against both $x$ and $y$ variables.
Along the axis $x=0$ it is constant zero.
Along the axis $y=0$ it is unsigned infinity, but its Cauchy principal value is constant zero.
Along the diagonal $y=x$ it is constant 1.
Along the diagonal $y=-x$ it is constant -1.
As all odd functions its behavior around zero does not have any preference to positive or negative values. As all odd analytic functions, this function in zero(if defined) can either be zero or unsigned infinity. But unsigned infinity is not a part of affinely extended real line or complex plane, which is usually used in analysis (it is part of projectively extended real line/complex plane). As such, the only variant that remains is $0$.
Note also that we can define a Cauchy principal value of a two-variable function in a point $(x_0,y_0)$ as a limit of the following integral:
$$\lim_{r\to 0}\frac 1{2\pi}\int_0^{2\pi}f(x_0+ r \sin (t),y_0+r \cos(t)) dt$$
This integrates the values of a function over a circle around a point. For analytic functions as long as the radius of the circle r comes to 0, the value of the integral comes to the value of the function in $(x_0,y_0)$. For our function, in $x_0=0, y_0=0$ the value of the integral is constant zero (because the function is odd) and does not depend on r. Consequently, the limit is also zero.
We can extend our analysis to complex numbers, but we again will get the same result, $0$.

A: The problem is that you assume $\frac00$ is = some $x$ belong to the real number group.$\frac00$ is just not defined for you to assume it to be $=x$.
Basically its one of the seven indeterminate forms of mathematics.Look here for the complete list-https://en.wikipedia.org/wiki/Indeterminate_form#List_of_indeterminate_forms

A: Try to cancel 0/0 with different numbers each time you will get different solutions for 0/0 . Suppose 1×0/1×0 you get solution 1. Suppose 2×0/0×1 you get solution 2 . Suppose n×0/0×1 you get solution n. ∵0/0 has infinitely many solutions 0/0 is not defined.

A: Well, then $n \cdot 0=0\; \forall \mathbb{R} \implies \frac{0}{0}=n=\frac{1}{n}$ so, $\frac{0}{0}$ is pretty much any real number. This is definitely not the case. This is why it is undefined.

A: 0/0 is indeterminate. Which means it has infinite number of values.
(0)(1) = 0     =>     0/0 = 1
(0)(2) = 0     =>     0/0 = 2
(0)(4) = 0     =>     0/0 = 3 .....

From above it can be shown that 0/0 has infinite number of values which make it meaningless. Hence the term.