text:
Q: how do I use svn in eclipse? I'm trying to create my own SVN server so I can work on my android projects everywhere.
I have an VPS and I installed svn, I set up the directory and added a use to the password file.
After a while I finally managed to create a project with
svn import -m "initial import" . file:///home/admin/svn/reposvn/testp/trunk

But I don't understand?
Can I only import project that are on my server?
If thats the case I could just use ftp and not worry about svn at all.
What I would like to do is have a url to use in things like eclipse.
my subdomain points to /home/admin/svn/ and then I typed in /reposvn
So I tried the urls
http://(mydomain)/reposvn

and
svn://(mydomain)/reposvn

but neither worked
Says
Detected a cycle while processing the operation
svn: Redirected cycle detected for URL ....
I also set up daemon or whatever with svnserve -d
any ideas? Thanks!

A: Once I wrote an article about this. I think it will give you enough information about this issue: How to set up SVN version control over SSL with Apache to use in Eclipse.

A: OK I got it working
One of the thing that took me a while to figure out is that svn:// is for the svnserve daemon
where the http:// access has to be set up through Apache.
I deleted my entire svn and reinstall / re set up everything, so there might have been some sort of messed up configuration.
However I set up the daemon with
svnserve -d --foreground -r /home/admin/svn

and then I was able to connect with svn://
https://help.ubuntu.com/community/Subversion
Thanks


text:
Q: How to read interleaved binary data from a Raspberry Pi Camera v2 I am attempting to take unencoded images for a remote sensing project for vegetation mapping. My setup is a PiCamera v2 NoIR on a Raspberry Pi 3, with the included Roscolux #2007 StoraroBlue gel filter taped over the sensor and a SenseHat for environmental logging.
I can take normal PNG photos just fine, but I can't figure out how to read the binary data correctly, as all my attempts result in a striped mess of colors.
Here is the section of the Python script that captures the images:
def picamera_logging_thread():
    logger.info('Started camera logging thread')
    while time() < start_time + timeout:
        with PiCamera() as camera:
            # set values
            camera.resolution = (3280, 2464)

            # let automatic exposure settle
            sleep(2)
            image_name = 'image_' + str(int(time()))

            # capture in PNG format at native resolution
            camera.capture(os.path.join(image_dir, image_name + '.png'))
            logger.info('Saved image ' + image_name + '.png')

            # let automatic exposure settle
            sleep(2)
            image_name = 'image_' + str(int(time()))

            # capture in unencoded RGB format
            camera.capture(os.path.join(image_dir, image_name + '.bip'), 'rgb')
            logger.info('Saved image ' + image_name + '.bip')

        # delay the specified interval
        sleep(picamera_logging_interval - 4)
    logger.info('Stopped camera logging thread')

start_time = time()

# start logging threads
Thread(target = sensehat_logging_thread).start()
Thread(target = picamera_logging_thread).start()

The online documentation for capturing unencoded RGB images using the picamera Python library says this:

The resulting RGB data is interleaved. That is to say that the red, green and blue values for a given pixel are grouped together, in that order. The first byte of the data is the red value for the pixel at (0, 0), the second byte is the green value for the same pixel, and the third byte is the blue value for that pixel. The fourth byte is the red value for the pixel at (1, 0), and so on.

Now, I gather that means the resulting binary data will be in standard BIP (Band Interleaved by Pixel) format, but I'm unsure whether their wording infers the pixels are grouped into rows or columns, because they say the second pixel is at (1, 0), which makes me think the second pixel in the data is at Row 2, Column 1 instead of the expected Column 2, Row 1.
I wrote a script in R that reads the data as a matrix of 1 byte integers (0 - 255) and adds them to a RasterStack of three RasterLayer objects, one for each band (RGB). I even tried adding an .hdr file and opening it in QGIS, but it's always striped noise.
Here is the R script:
# This script parses BIP pixel data from a binary file, assuming order band first then rowwise

# imports
#install.packages("raster")
library(raster)

# define filename of binary data
binary_filename <- "image_1490191326.bip"

# define pixel dimensions of the data, width then height
pixel_dimensions <- c(width = 3280, height = 2464)

# open file connection in Binary Read mode
data_file <- file(binary_filename, "rb")

# get data (and upshift)
binary_data <-
  readBin(
    data_file,
    what = "int",
    size = 1,
    n = pixel_dimensions["height"] * pixel_dimensions["width"] * 3 # hopefully the number of bytes in the file
  ) + 128 # upshift data from (-128, 127) to (0, 255) by adding 128

# close connection to file
close(data_file)

# create red raster layer of every 3rd byte, starting at the first one
red <-
  raster(
    matrix(binary_data[seq(from = 1,
                           to = length(binary_data),
                           by = 3)], nrow = pixel_dimensions["width"], ncol = pixel_dimensions["height"]),
    ymn = pixel_dimensions["height"] / 2 * -1,
    ymx = pixel_dimensions["height"] / 2,
    xmn = pixel_dimensions["width"] / 2 * -1,
    xmx = pixel_dimensions["width"] / 2
  )
names(red) <- "red"

# create green raster layer of every 3rd byte, starting at the second one
green <-
  raster(
    matrix(binary_data[seq(from = 2,
                           to = length(binary_data),
                           by = 3)], nrow = pixel_dimensions["width"], ncol = pixel_dimensions["height"]),
    ymn = pixel_dimensions["height"] / 2 * -1,
    ymx = pixel_dimensions["height"] / 2,
    xmn = pixel_dimensions["width"] / 2 * -1,
    xmx = pixel_dimensions["width"] / 2
  )
names(green) <- "green"

# create blue raster layer of every 3rd byte, starting at the third one
blue <-
  raster(
    matrix(binary_data[seq(from = 3,
                           to = length(binary_data),
                           by = 3)], nrow = pixel_dimensions["width"], ncol = pixel_dimensions["height"]),
    ymn = pixel_dimensions["height"] / 2 * -1,
    ymx = pixel_dimensions["height"] / 2,
    xmn = pixel_dimensions["width"] / 2 * -1,
    xmx = pixel_dimensions["width"] / 2
  )
names(blue) <- "blue"

# create raster stack of the three layers
rgb_stack <- stack(red, green, blue)

# plot hopefully correct raster
plot(rgb_stack)
plotRGB(rgb_stack)

# remove unused large data variables from memory
rm(red, green, blue, binary_data)

Here is a link to a Google Drive folder with the binary data, R output, and a JPG version of the PNG image.
What am I doing wrong here? How might I read this and extract useable pixel data?

A: Aha! I think I have solved it. The image is actually padded with some unused pixels on the right and bottom edges (which you can see as black in the image below), so the publicised dimensions of 3280x2464 are incorrect in the case of a raw image. The correct ones are 3296x2464 and if you multiply these numbers together and then multiply by 3 (for R,G & B pixels), you will get a file size that matches yours.
You can convert the RGB file to a JPEG with ImageMagick which is installed on most Linux distros and is available for macOS/OSX and Windows (and Raspberry Pi):
magick -depth 8 -size 3296x2464 image.rgb result.jpg

Note 1: If your filename doesn't actually end in .rgb, you can instead prefix it with RGB: to give ImageMagick a hint as to its contents, e.g.
magick -depth ... -size ... RGB:image.xyz ...

Note 2: If you use an older version of ImageMagick, replace magick with convert.
Note 3: If you want to crop off the black padding pixels with ImageMagick, use:
convert -depth 8 -size 3296x2464 image.rgb -trim result.jpg

redpajama_set_name: RedPajamaStackExchange


text:
Q: Regex for scientific number and hex and decimal numbers for vim produces error while works for Perl? I was trying to learn how to write vim plugins and required to match numbers which a language would allow to work with and trying to highlight it with different colors and wrote following regex in very magic mode:
 syntax match cNumberGroup "\v\d+"
 syntax match cNumberGroup "\v0x\x+"
 syntax match cNumberGroup "\v[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?"

The first one is for decimal numbers. The second one for hex numbers
The third one is for scientific numbers representations.
The first two are working fine but last one is not working. I want to know that why it is not working and also that, Is there a better way to write all the regex to cover all the three number systems efficiently.
Thanks.

A: Just slapping \v (very magic) in from of the regular expression doesn't make Vim's regular expression syntax Perl-compatible. As @Carpetsmoker has already commented, :help perl-patterns shows the differences.
For your example, the (?:...) has to be written as \v%(...):
syntax match cNumberGroup "\v[+\-]?%(0|[1-9]\d*)%(\.\d*)?%([eE][+\-]?\d+)?"


text:
Q: How can I get SASS working in Netbeans for mac Does anyone one know what to add in the Sass path in a mac? All the tutorials I have found are for Windows: https://medium.com/@raaechelb/sass-installing-on-netbeans-and-getting-started-2b5ce99d985c
I have installed Ruby and Sass. I can get SCSS to compile if I use --watch in the command line, but I can't seem to get Netbeans to see SASS within the IDE. I have also tried the file path /usr/bin/sass suggested on the Netbeans website:https://netbeans.org/kb/docs/webclient/html5-editing-css.html
I keep getting 'SASS executable must be a valid file' - Any ideas?
enter image description here

A: Go to your terminal and type which sass. It should give you the path that you can copy and paste in NetBeans.


text:
Q: Bootstrap Datepicker not working on RAZOR HTML So I have a page that needs to select a date and I'm using Bootstrap's "Datepicker" to provide for this functionality. I've tried most, if not all of the questions here and they mostly seem to be syntax issues that user end up figuring out.  Here's my code:

<link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" />
<link href="~/Content/bootstrap-datepicker.min.css" rel="stylesheet" />

Select Invoice Criteria

    @Html.TextBoxFor(model => model.InvoiceFromDate, new {@class = "form-control datepicker", placeholder = "Enter Drop-off date here"})

This just produces a normal bootstrapped textbox, when I click on it nothing pops up.
Thanks a lot in advance.


text:
Q: on() doesn't recognize a class I am facing a problem with on(). Here is my code:
add this stuff

$(".add").on('click', function() {
    $.post("/toto.com/add.php", { trainning: this.id }, function() {});
    $(this).html("Remove this stuff");
    $(this).removeClass("add").addClass("remove");
    //alert($(this).attr("class"));-->give the good class
});

$(".remove").on('click', function() {
    //doesn't work
    $.post("/toto.com/remove.php", { trainning: this.id }, function() {});
    $(this).html("add this stuff");
    $(this).removeClass("remove").addClass("add");
});

The selector for the class remove doesn't recognize it whereas when I click on the button with the add class, the class is changing. Do you know what the problem is?
Thank you for your help!

A: You need to use delegated event handlers as you're dynamically changing the classes the handlers are attached to. Try this:
$(document).on('click', ".add", function() {
    $.post("/toto.com/add.php", { trainning: this.id });
    $(this).html("Remove this stuff").toggleClass("add remove");
});

$(document).on('click', ".remove", function() {
    $.post("/toto.com/remove.php", { trainning: this.id });
    $(this).html("add this stuff").toggleClass("remove add");
});

Depending on the location of the script tag this JS code is in you may also need to wrap your code in a document.ready handler. If it's just before the  tag it will work fine, if it's in the head, place it inside $(function() { /* your code here */ });


text:
Q: How to install driver Archer T3U Plus for Linux 20.04 (AC1300) I get this error when I try to install brand wi-fi, linux:
TP-Link Archer-T3U-Plus AC1300 High Gain Wireless Dual Band USB Adapter
kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... 'make' KVER=5.15.0-kali3-amd64 src=/usr/src/rtl88x2bu-5.8.7.1.....(bad exit status: 2) Error! Bad return status for module build on kernel: 5.15.0-kali3-amd64 (x86_64) Consult /var/lib/dkms/rtl88x2bu/5.8.7.1/build/make.log for more information.

A: You can install the driver from RinCat git repository with support kernel 2.6.24 ~ 5.17:
sudo apt install git build-essential linux-headers-$(uname -r)
git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
cd RTL88x2BU-Linux-Driver
make
sudo make install
sudo modprobe 88x2bu

or use the Manual DKMS installation:


text:
Q: Compare Encrypted Bank Account Details without full Decryption I am building a database that stores employee information, including bank account details. The bank account details are stored so that we can check for current or past staff using our company, which in our case might be a reason to be concerned about fraud. I have been reading up on SQL Server 2008 R2 Encrption and Decryption on MSDN and other places and have come up with the following sample script:
IF NOT EXISTS(SELECT * FROM sys.symmetric_keys WHERE symmetric_key_id = 101)
    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'BankDetai!5'
GO

CREATE CERTIFICATE Employees_01 WITH SUBJECT = 'Employee Bank Account Details'
GO

CREATE SYMMETRIC KEY AccountNos_01
    WITH ALGORITHM = AES_256
    ENCRYPTION BY CERTIFICATE Employees_01
GO

CREATE TABLE #Bank_Accounts
( Id            INT IDENTITY(1,1)   NOT NULL    CONSTRAINT PK_BankAccount_Id PRIMARY KEY CLUSTERED (Id ASC)
 ,AccountNumber VARBINARY(128)      NOT NULL
 ,BankName      NVARCHAR(255)       NOT NULL
 ,CountryCode   VARCHAR(2)          NOT NULL
 ,CreateDate    DATETIME2(0)        NOT NULL
 ,EmployeeId    INT                 NOT NULL
 ,IsActive      BIT                 NOT NULL
 ,SortCode      VARBINARY(128)      NOT NULL
);

OPEN SYMMETRIC KEY AccountNos_01
    DECRYPTION BY CERTIFICATE Employees_01;

CREATE TABLE #SampleBankAccounts
( Id INT IDENTITY(1,1)
 ,AccountNumber VARCHAR(255)
 ,BankName      NVARCHAR(255)
 ,CountryCode   VARCHAR(2)
 ,EmployeeId    INT NOT NULL
 ,IsActive      BIT
 ,SortCode      VARCHAR(255))

INSERT #SampleBankAccounts
SELECT * FROM
(   SELECT
         '123456789'    AccountNo
        ,'Barclays'     BankName
        ,'US'           Country
        ,1              Employee
        ,1              IsActive
        ,'12-34-56'     SortCode
UNION
    SELECT
         '9876543210'
        ,'Barclays'
        ,'US'
        ,1
        ,0
        ,'12-34-56'
UNION
    SELECT
         '111111111111'
        ,'HSBC'
        ,'UK'
        ,2
        ,1
        ,'222222'
UNION
    SELECT
         'IBAN 123 456 9875 3215'
        ,'Nationwide'
        ,'ES'
        ,3
        ,1
        ,'00_gn321654'
)AS Samples
ORDER BY Employee

MERGE #Bank_Accounts        AS Target
USING #SampleBankAccounts   AS Source   ON Target.EmployeeId = Source.EmployeeId
                                            AND Source.AccountNumber = Target.AccountNumber
                                            AND Source.BankName = Target.BankName
                                            AND Source.CountryCode = Target.CountryCode
                                            AND Source.SortCode = Target.SortCode
WHEN NOT MATCHED
    THEN INSERT (AccountNumber, BankName,CountryCode,CreateDate,EmployeeId,IsActive,SortCode)
        VALUES (
             ENCRYPTBYKEY(KEY_GUID('AccountNos_01'),Source.AccountNumber)
            ,Source.BankName
            ,Source.CountryCode
            ,GETDATE()
            ,Source.EmployeeId
            ,Source.IsActive
            ,ENCRYPTBYKEY(KEY_GUID('AccountNos_01'),Source.SortCode));
GO

DROP TABLE #SampleBankAccounts

That seems to work fine, but now I need to take a variable e.g. @AccountNo and see if it matches any of the bank accounts we have stored (I'll use a stored procedure in all likelihood). I would much rather avoid decryption in any scripts if possible, so I wondered if it was possible to encrypt the @AccountNo variable and then compare it, so we might see a match:
DECLARE @MyTestBankAccount NVARCHAR(255) = '123456789'
DECLARE @MyEncryptedTestBankAccount VARBINARY(128)

OPEN SYMMETRIC KEY AccountNos_01
    DECRYPTION BY CERTIFICATE Employees_01;

SELECT @MyEncryptedTestBankAccount = ENCRYPTBYKEY(KEY_GUID('AccountNos_01'),@MyTestBankAccount)

SELECT
     AccountNumber
    ,EmployeeId
FROM Bank_Accounts
WHERE
    @MyEncryptedTestBankAccount = AccountNumber

This does not work; as you can see, I use an account number that should be present in the table, but no results are returned. I have tried to decrypt the account number column and compare it to the variable, but I get a load of Chinese characters coming out (much as in this question), and they do not match the characters created by encrypting and decrypting the variable, so that doesn't work for a match either...
So why does the following query (using data from above) not give me the encrypted and decrypted values for the account details? Can I use this method to search employee bank accounts against a given bank account?
OPEN SYMMETRIC KEY AccountNos_01
    DECRYPTION BY CERTIFICATE Employees_01;
SELECT
     AccountNumber                                  AS Encrypted_AccountNo
    ,EmployeeId                                     AS EmployeeId
    ,CONVERT(NVARCHAR,DECRYPTBYKEY(AccountNumber))  AS Decrypted_AccountNo
FROM Bank_Accounts

A: So I found the answer: exit SQL Server and re-enter.
Something must have had to be updated to work, because now everything is fine.

~gentle screaming~


text:
Q: React native - add discovered ble devices to set, and add option to picker I am using a Picker in react native. While the screen is open, the device scans for ble devices, and adds them to a devices array in the state. The picker should have an option for each of the values in the devices array.
Ordinarily, I would do this:
Constructor:
this.state = { devices: [] };

When a device is found:
let devices = this.state.devices;
devices.push(device.id);
this.setState({ devices: devices });

And then do the Picker like this:
<Picker>
  {(this.state.devices).map((item, index) => {
    return <Picker.item key={index} label={item} value={item} />;
  })}
</Picker>

This works fine, except that since devices are constantly re-discovered, they end up the array multiple times. Not only is this useless, but the array length grows until the app runs out of memory.
To fix this, I tried using a set, since that should automatically not contain duplicates:
Constructor:
this.state = { devices: new Set() };

When a device is found:
let devices = this.state.devices;
devices.add(device.id);
this.setState({ devices: devices });

Picker:
Since the set does not have a map function, I took the entries (an iterator), and turned it into an array, and then mapped it:
<Picker>
  {Array.from(this.state.devices.entries).map((item, index) => {
    return <Picker.item key={index} label={item} value={item} />;
  })}
</Picker>

This, does not work. The debug tools suggest that the set in the state never gets added to, so I think that's the problem (rather than with the picker), but I don't understand why that would be the case.
No errors are thrown.

A: You might want to check first and then push in your array to avoid duplicate entries,
let devices = this.state.devices;
if(devices.indexOf(device.id) == -1){
  devices.push(device.id);
  this.setState({ devices: devices });
}

This will surely not push deviceID that is already in state.


text:
Q: how to add dependencies to Openshift V3 nodeJs env I need some help, i'm trying to add mongoose to my openshift v3 env but can't find how.
already try to use package.json.
Edit :
deploy log
package.json
{
  "name": "nodejs-ex",
  "version": "0.0.1",
  "description": "projet",
  "main": "server.js",
  "dependencies": {
    "body-parser": "^1.17.2",
    "chai": "^3.5.0",
    "chai-http": "^2.0.1",
    "ejs": "^2.4.1",
    "express": "^4.13.4",
    "mocha": "^2.4.5",
    "mongodb": "^2.1.16",
    "mongoose": "^4.10.3",
    "morgan": "^1.7.0",
    "object-assign": "4.1.0"
  },
  "engine": {
    "node": "*",
    "npm": "*"
  },
  "scripts": {
    "start": "node server.js",
    "test": "IP=0.0.0.0 PORT=3030 mocha --timeout 5000 tests/*_test.js"
  },

Thanks


text:
Q: Python Socket programming: printing source address and source destination I'm currently studying socket.io and I wonder if I could print the 4 tuples in tcp connection (Source port, address, destination port, address). I am able to print the destination port and address by after 'accept()', but struggled with the source part.
Here are my codes.
Server:
import socket

serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print ("Socket successfully created")

serverPort = 39557

serverSocket.bind(('', serverPort))
print ("socket binded to %s" %(serverPort))

serverSocket.listen(5)
print ("socket is listening")

while True:
    connectionSocket, addr = serverSocket.accept()
    #this will print out destination address & port
    print ('Destination address & port:', addr )
    sentence='thank you for connecting'
    connectionSocket.send(sentence.encode())
    connectionSocket.close()
    break

Client:
import socket
clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverName = ''
serverPort = 39557
clientSocket.connect((serverName, serverPort))
sentence = clientSocket.recv(1024).decode()
print ("from server:", sentence)
clientSocket.close()


text:
Q: Are two commas needed in this sentence? Could someone tell me that is this possible to write moreover between two commas?
Therefore, it is concluded that the two herbs named garlic and the black seeds may be good alternative choices for chemical drugs, moreover, these two anti-parasitic Herbs can be considered as harmless and affordable additives.....
Thank you in advance

A: Yes, it is common to write it this way. If you think how you would naturally speak this, there would be a pause before and after moreover.
There are some example sentences you can check here: moreover


text:
Q: Why is the set $\{\omega\in \Omega: \exists t \geq 0: -\infty < D^-(t,\omega) \leq D^+(t,\omega) < + \infty\}$ measurable? I'm reading a proof in Billingsley that the continuous paths of the Brownian motion $\{W_t: t \geq 0\}$ on the probability space $(\Omega, \mathcal{F}, \mathbb{P})$ are nowhere differentiable, with probability $1$. The author does this by showing that if
$$E=  \{\omega\in \Omega: \exists t \geq 0: -\infty < D^-(t,\omega) \leq D^+(t,\omega) < + \infty\}$$
then $\mathbb{P}(E) = 0$.
Here $$D^- (t,\omega) = \liminf_{h \searrow 0} \frac{W(t+h,\omega)-W(t,\omega)}{h}, D^+ (t,\omega) = \limsup_{h \searrow 0} \frac{W(t+h,\omega)-W(t,\omega)}{h}$$
However, why are we sure that $E$ is a measurable set? I.e. why is $E \in \mathcal{F}$?
The following facts are definitely relevant:
(1) The maps $t \mapsto D^-(t, \omega), t \mapsto D^+(t, \omega)$ are measurable for all $\omega \in \Omega$
(2) The map $(t, \omega) \mapsto W(t,\omega)$ is jointly measurable.
We can write
$$E=\bigcup_{t \geq 0} \{\omega \in \Omega: -\infty < D^{-}(t, \omega) \leq D^+(t,\omega) < + \infty\}$$
but this does not quite help.
Any help will be appreciated!

A: Billingsley doesn't assert that $E$ is measurable. He does show that $E$ has outer measure $0$, and so will be measurable provided the measure space $(\Omega,\mathcal F,P)$ is complete.  A discussion of the advantages of completion follows in the text.


text:
Q: Can I save a file directly as an email attachment? I often work on a file (e.g. an Excel sheet) and, when finished, want to mail it to someone. I find it a bit cumbersome to save it to the desktop and then attach it to a mailing (my desktop is a bit cluttered, I have to scroll through a lot of stuff before I find it in the selector), and I was wondering whether there isn't a way to save it into the attachment slot of a mail document directly?

A: For Excel 2010 this can be done the following way:
In the Excel menu go to "File" -> "Share". There you'll find the option to send the file as an email attachment.
I myself use a specific folder where I save all file I want to send out. It's on the very top of the root directory so it's easy to access through the Save-dialogue as well as the attachment dialogue of my email application.


text:
Q: Personal vs central repositories I am trying to set up version control software, currently I work alone (but I expect that to change), and I want to store the code on a network drive which is regularly backed up but work off the same code on my laptop's hard drive.
But GIT is confusing me greatly!
So from what I can understand, I should create a personal repository on my laptop, and then either push or clone this to a new central repository on the network drive. Does this sounds correct? Is this done by pushing or cloning?
I'm using GIT-Extensions and they have this to say about central repositories:

Central repositories only contain the version history. Because a
  central repository has no working directory you cannot checkout a
  revision in a central repository. It is also impossible to merge or
  pull changes in a central repository. This repository type can be used
  as a public repository where developers can push changes to or pull
  changes from.

So this sounds to me like a normal SVN repository? As in I can get code from it and send code to it, but it can't take code from me and force code on me? Does that sound right?
But if that's right, then according to the diagram in this answer: What are the differences between "git commit" and "git push"? what would my two repositories be? Would they be the workspace and local repo, or the local and remote repos? And is this what determines is I should be committing and checking out or pushing and pulling?

A: If you don't have a remote repository yet, you will have to clone your local one to it. You then push to it.
You can work fine with your local repository. When you're ready with a fix, first commit it to your local repository. Then you need to push it to the remote.
This all sounds confusing initially. The ideas is that you may want to work in isolation for a while and make a bunch of local fixes and commits before you consider your work ready enough to be pushed into the main (remote) repository from where other people will be getting the latest changes.
The idea of having a local repository is so that you could have all the branches the remote has and even create more of your own in your local repository. You can develop your features on your own branches without affecting other people's work or being affected by theirs.

A:
GIT is confusing me greatly!

You seem to come from a centralized-VCS background, and you show symptoms of the curse of knowledge described by Joel here. You just need to come to terms with Git's distributed nature. Everything will soon make sense. :)
A good starting point is the following passage of the Pro Git book, which should help improve your understanding: http://git-scm.com/book/en/Getting-Started-About-Version-Control.

I should create a personal repository on my laptop, and then either push or clone this to a new central repository on the network drive. Does this sounds correct?

Git itself doesn't make any prescription in this regard, but yes, it's a reasonable setup that is widely used.

Is this done by pushing or cloning?

Pushing means sending your local changes from a local branch living in "your repository" to some branch living in another repository, called a "remote repository".
This terminology can be confusing, though, because the remote repo in question can actually reside on the same machine as "your repository". "Remote" is a relative, not absolute, term in Git. The term "remote repository" should be understood as some other repository that the local repository under consideration knows about.
Cloning, roughly speaking, means getting a local copy (which becomes "your repository") of a remote repository.
Bonus: fetching means 'downloading' all the changes present in some remote repository to "your repository".
You would need to create/initialize a repository on the network drive, and then setup your local repo so you can communicate (push, fetch, etc.) with it.

I'm using GIT-Extensions and they have this to say about central repositories: [...]

I think that passage of the Git-Extensions help is misleading. A repository that you consider "central" can be bare (i.e. only contain the version history, without any working copy), but it doesn't have to be.

So this sounds to me like a normal SVN repository?

Git is distributed in nature, which means, roughly speaking, that all repositories are on equal footing; there doesn't have to be any repository more important or central than another. That said, nothing prevents you from treating one particular repository as the central/canonical one. This is one of the major difference between Git and centralized VCS, such as SVN.

As in I can get code from it and send code to it, but it can't take code from me and force code on me?

You decide what happens in "your repository". You can, if you want, get changes from or send changes to another repo (assuming you have write access to it), but the latter cannot get anything from nor force anything upon "your repository" without you explicitly asking for it... unless whoever controls that remote repo has write access to yours, of course.

But if that's right, then according to the diagram in this answer: What are the differences between "git commit" and "git push"? what would my two repositories be? Would they be the workspace and local repo, or the local and remote repos?

Although I find this description a tad misleading, you can consider, as a first approximation, that each repo is composed of three areas (see http://git-scm.com/book/en/Getting-Started-Git-Basics#The-Three-States).

*

*The working directory or, more precisely, working tree (called "workspace" in the diagram you link to). Broadly speaking, it corresponds to your checked out copy, i.e. the body of files that's sitting in your project's tree structure in your filesystem.

*The "place where snapshots/commits are stored", which is called "Git directory" in the Pro Git book, but I'm not a big fan of that phrase. You can see this area as a photo album dedicated to chronicling the history of your project.

*The index or staging area is an intermediate layer between the working tree and the "place where snapshots/commits are stored". See What does 'adding to the index' really mean in Git?

On the diagram you link to, workspace, index, repository refer to the three states of "your repository"; the three states of the remote repository are not shown; the remote repo is just described as a black box.

And is this what determines if I should be committing and checking out or pushing and pulling?

Committing and checking out are operations that are completely local to "your repository".

*

*Committing means taking a snapshot of your project and storing it in the repository; this operation is associated with a transfer of data from the staging area to the "place where the snapshots are stored".

*Checking out means getting a copy of an existing snapshot to your working tree so you can have a look at it and play with it, and possibly take your code in a completely different direction.

Pushing and fetching, on the other hand, imply a transfer of data between "your repository" and some remote repository, but in opposite directions:

*

*pushing: "your repository" --> remote repo

*fetching: "your repository" <-- remote repo

Pulling consists in fetching and then automatically integrating the changes you just got from the remote repository into "your repository".


text:
Q: Highcharts not showing string value I'm trying to add localstorage values into highchart series but it doesn't work.
When i print the "newString" value on the console and replace the value for "newString" at the code it works but it doesn't when I use var newString.
Here is the code:
$(document).ready(function () {
    var archive,
        j = "",
        keys = Object.keys(localStorage),
        x = keys.length;
    var i = 0;
    while (i < x) {
        archive = JSON.parse(localStorage.getItem(keys[i]));
        j += "{ name: " + keys[i] + ", data: [" + archive.username + ", " + archive.email + ", " + archive.password + "]},";
        i++;
    }
    var newString = j.substr(0, j.length - 1);
    console.log('newString: ', newString);

    Highcharts.chart('container', {

        title: {
            text: 'Datos ingresados'
        },

        subtitle: {
            text: 'Localstorage'
        },

        yAxis: {
            title: {
                text: 'Datos ingresados'
            }
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle'
        },

        plotOptions: {
            series: {
                label: {
                    connectorAllowed: false
                },
                pointStart: 2017
            }
        },

        series: [
            newString
        ],

        responsive: {
            rules: [{
                condition: {
                    maxWidth: 500
                },
                chartOptions: {
                    legend: {
                        layout: 'horizontal',
                        align: 'center',
                        verticalAlign: 'bottom'
                    }
                }
            }]
        }

    });

});

This is what console.log shows:

{ name: 2, data: [12345, 23456, 34567]},{ name: 3, data: [23456, 34567, 45678]},{ name: 4, data: [34567, 45678, 56789]},{ name: 5, data: [45678, 56789, 67890]}

When I change the value of newString for that, it works properly.

A: Because in the second case, Highcharts see your data as a pure string. So, you need to parse your string.
But first of all, we should create valid json for parsing correctly:
var newString = "{ name: 2, data: [12345, 23456, 34567]}"; //bad json
var json = newString.replace(/(['"])?([a-zA-Z0-9]+)(['"])?:/g, '"$2":');
var goodJson = "[" + json + "]"; //valid json

Now we can create options for the Highcharts:
var options = {
   chart: {
     renderTo: 'container',
     type: 'spline'
   },
   series: []
};

And push data to series as follows:
$.each(JSON.parse(goodJson), function(i, item) {
   options.series.push({
    name: item.name,
    data: item.data
   });
});

And finally initialize Highcharts:
var chart = new Highcharts.Chart(options);

See at Plunker


text:
Q: OnCameraChangeListener is not responsive enough - is there another way? I am porting a layer I have in a v1 map to v2. The layer draws a custom control on the map and, as the map moves, it must stay in place on its current geolocation (w/ the correct scale).
It had been suggested to me to use onCameraChange to communicate to my layer (a custom view, on top of the map) that the camera was panning or zooming and update the layer appropriately.
My problem is that onCameraChange is only called after the camera has been moved - not during. It is therefor not responsive enough. Is there another way to achieve this?

A: Try to wrap the MapFragment (or MapView) inside your custom class inherited from something like RelativeLayout. Then you can override onInterceptTouchEvent or dispatchTouchEvent in that custom layout and move your custom view from there. I tried it myself and it will give you definitely more callbacks than with the onCameraChange.
You can also take a look at my answer here:
Google Maps Android API v2 - Interactive InfoWindow (like in original android google maps)
I was dealing with something little bit different (I tried to avoid moving custom views over the map but I needed only some buttons on an infoWindow), but I used this wrapping layout there too.


text:
Q: Capturing code between two tags in Flex [/][*][^*]*[*]+([^*/][^*]*[*]+)*[/]

This is what I got from a different post on stack overflow. I can't seem to find a way to make it work with "#" instead of "/*" and "*/"

A: With a single character, the pattern is much simpler: a #, a sequence of any length not containing #, and another #:
"#"[^#]*"#"


text:
Q: ImportError: No module named django.core.management when using manage.py I'm trying to run python manage.py runserver on a Django application I have and I get this error:
Traceback (most recent call last):
File "manage.py", line 8, in <module>
 from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

Here is the output of pip freeze | grep -i django to show I do in fact have Django installed:
Django==1.6.5
django-cached-authentication-middleware==0.2.0
django-cors-headers==1.1.0
django-htmlmin==0.7.0
django-static-precompiler==0.9
djangorestframework==2.3.14

Also, trying to run /usr/local/bin/python2.7 manage.py runserver yields the same error.

A: I solved this same error by running the below command:
python3.4 manage.py runserver

And the above command successfully executed for me. So what you can try is, if you are using python 2.7 then just replace 3.4 with 2.7. Hope this helps.

A: Possible issues that may cause your problem:

*

*PYTHONPATH is not well configured, to configure it you should do:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages

*You forgot the line #!/usr/bin/env python at the beginning of manage.py

*If you're working on virtualenv you forgot to activate the virtual env to execute manage.py commands (You may have installed Django on your system but not on your virtualenv)
source path/to/your/virtualenv/bin/activate

or
workon env_name

*You have Python 2.7 and Python 3.4 messing with the package

*You're using a very old Python 2.4 and you should tell the system to use your Python 2.7 with:
alias python=python2.7

Some times reinstalling/upgrading Django fix some of those issues.
You may want to execute
python -c "import django; print(django.get_version())"

to check if Django is installed on your PC or your virtualenv if you're using one
You can find some other solutions in other similar questions:

*

*Django import error

*Django uwsgi error

*Django module error

A: I came across the same issue when I did all the setup and run for django with Python3 but ran the following command:
$ python manage.py migrate

fixed the issue by using a consistent version of Python:
$ python3 manage.py migrate
Operations to perform:
  Apply all migrations: sessions, auth, admin, contenttypes
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying sessions.0001_initial... OK

Other commands I ran before this were:
python3 -m pip install django
django-admin startproject learning_site
python3 manage.py  runserver 0.0.0.0:8000

A: If you use virtualenv and run manage.py runserver in windows system, cmd will use system's python, not the python in virtualenv.
Because If you install python in system, cmd will automatically use python that installed in system, not the python in virtualenv.
So if you use virtualenv in Windows. you need run
>python .\manage.py runserver

A: To fix my problem I used the following line in my .zprofile:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages

I was trying to import Django and it couldn't be found, and doing the above solved the issue.

A: That error is due to the user environment. Indeed i just add the virtuel environment bin path to  PATH and the problem has been solved.
PATH=/bin/of_virtualenvironment/:$PATH

A: The direct problem is that django package is missing. For me, as I was running django in virtualenv, this problem occurs after I rename my working directory.
Reinstalling the env worked for me.

A: in where your django file resides, check the first line of django-admin.py:
#!/usr/bin/env python

If you use python 3+, python here may refers python2 here. So check which python you install django with.
ls -l $(which -a python3)

If you do have python3 installed and not linked as python, change the first shebang line into
#!/usr/bin/env python3

A: Also, make sure you did not mess up your .bashrc with aliases.
You would get this kind of errors if .bashrc contains something like alias python="/usr/bin/python3".

A: I found that I could import the django module from the python interpreter, but django-admin.py could not import it when run from the command line.
I confirmed that I was using the python interpreter in my virtual environment.
I was using a 64-bit version of python. Uninstalling, and installing the 32-bit version, then re-creating my venv solved this for me.

A: Fixed the same problem in my project using only;
pip install -r requirements.txt

I didn't have to do anything else. When I ran./manage.py runserver everything worked!

A: Using Pycharm go to Configurations add runserver 8080
to parameters, or I fixed my issue by restarting my computer....strange but worked.
I did not have to change pip or install anything else, first try the first method I listed, if you are fine with running manage.py through PyCharm arrow icon, it will work, if you want to go back to the terminal and type python manage.py runserver:port try restarting your machine.

A: Trying the solutions here didn't work for me. Reinstalling Django and upgrading pip removed the error and everything now works as expected when I run python migrate.py runserver
Here are the CLI commands I used:

python -m pip install django

python -m pip install --upgrade pip

A: i solved this problem by installing django inside the virtual enviromment that i was working on


text:
Q: Compare Two File And Match Column One Compare two files if second file contains a domain which is not found in first file than add "Static" in second field.
File1:
cleanwatersaveslives.com      WordPress
blood-mate.com                CodeIgniter
brotex.com                    WordPress

File2:
brotex.com
blood-mate.com
cleanwatersaveslives.com
suhailacademy.com
damiastudioz.com
support.techpublications.org
techpublications.org
tekstilworks.com

What i want to get is:
cleanwatersaveslives.com      WordPress
blood-mate.com                CodeIgniter
brotex.com                    WordPress
suhailacademy.com             Static
damiastudioz.com              Static
support.techpublications.org  Static
techpublications.org          Static
tekstilworks.com              Static


text:
Q: using boost::lambda_ to compress whitespaces in a string I am using boost::lambda to remove subsequent whitespaces in a string, leaving only one space. I tried this program.
#include <algorithm>
#include <iostream>
#include <string>
#include <boost/lambda/lambda.hpp>

int main()
{
    std::string s = "str     str st   st sss";
    //s.erase( std::unique(s.begin(), s.end(), (boost::lambda::_1 == ' ') && (boost::lambda::_2== ' ')), s.end()); ///< works
    s.erase( std::unique(s.begin(), s.end(), (boost::lambda::_1 == boost::lambda::_2== ' ')), s.end()); ///< does not work
    std::cout << s << std::endl;
    return 0;
}

the commented line works fine, but the uncommented one does not.
How is
(boost::lambda::_1 == boost::lambda::_2== ' ')

different from
(boost::lambda::_1 == ' ') && (boost::lambda::_2== ' '))

in the above progam. The commented one also gives me a warning that "warning C4805: '==' : unsafe mix of type 'bool' and type 'const char' in operation"
Thanks.

A: In C and C++
a == b == x is very different than (a == x) && (b == x),
the former is interpreted as (a == b) == x,
which compares a with b and the result of that comparison (true or false)
is compared with x. In your case x is a space character,
and in typical implementation that uses ASCII its code is equal to 32,
comparing it with boolean value which is converted either to 0 or 1
gives always false.


text:
Q: What is the best/fastest way to rip and convert a Blu-ray Disc on an iMac? I've recently switched (back) from Windows 10 to macOS running on an iMac 27-inch Retina late 2015. While I still used my Windows 10 laptop, I used a program called DVDFab to rip my collection of Blu-ray movies into a format suitable for Plex and Emby. The process took about 45 minutes per disc and used the GPU part of the Intel i7 processor in my laptop to speed things up.
Now that I am on a Mac, I can't seem to find a program (or set of programs) that allows me to rip Blu-ray movies with the same, or better, speed. Most articles seem to suggest a combination of MakeMKV for ripping and Handbrake for converting. However, this takes about 45 minutes for ripping and 2 hours for converting, as none of these programs seems to make use of GPU acceleration. I have also downloaded a few commercial packages to see if they make use of acceleration, but I have yet to find a program that both can read directly from a Blue-ray disc and do the transcoding to give me a suitably small mp4 file.
Can you recommend a solution other than sticking with Windows 10 and DVDFab?

A: So I found a solution, just not a short or elegant one:

*

*Install bootcamp on the iMac

*Install Windows 10

*Install dvdfab.

At first dvdfab did not want to work with the GPU (AMD Radeon). Turns out that the graphic drivers bundled with bootcamp were too old, but there is no update from Apple. http://bootcampdrivers.com has newer driver packages for the mac / AMD GPU.
I had to follow a long set of instructions to install it, including booting the Windows machine into Safe mode. In the end, everything works as it should, and Blu-ray conversion time is now around 40 minutes!
As converting Blu-ray movies is not something I do everyday, I can live with this solution.


text:
Q: Visualizing Residuals and Squared Residuals in ggplot2 I've created a plot based on the diamonds data-set with a regression line and 10 cases. I want to add a residual (a vertical line going from observed price to its predicted value, the regression line, in red) specificly for one case (case 3, with the second highest value for price). In a second plot I want to add a red square with side equal to its residual (with the residual on the right side so the square doesn't overlap with the regression line) just to visualize the residuals and the squared residuals (I always do them in red). The code I have so far is shown below. Does someone know how to create these?
library(ggplot2)
library(dplyr)
data(diamonds)
set.seed(123)
small_n = sample_n(diamonds, 10, replace = TRUE)
small_n = select(small_n, price, carat)

p = ggplot(small_n, aes(x = carat, y = price))
p = p +
geom_point() +
ggtitle("Price by Carat") +
geom_hline(yintercept = mean(small_n$price),
         linetype = "dashed") +
    geom_vline(xintercept= mean(small_n$carat),
         linetype = "dashed") +
    geom_smooth(method=lm,   # Add linear regression lines
          se=FALSE, color = "black", size = .2) +
    coord_cartesian(xlim = c(0, 3), ylim = c(0, 13000))

p


text:
Q: El Capitan Mail 9.0 won't accept active accounts (MacBook Air, mid 2013, new install on wiped drive of OS X 10.11 El Capitan)
According to "Internet Accounts" preferences, I have five active email accounts: iCloud, gmail, yahoo, americtech.net, and Comcast. I thought I had set up Mail.app, but found only two accounts were listed: iCloud and Comcast. When I attempt to add an account (any of the remaining three), I am asked for username and password, then informed that the account is already active. Mail.app has not crashed, just won't accept any other accounts. I have all five running on an iMac (Yosemite) and an iPad.
No apparent way of manually setting up the accounts; I'm thinking of visiting the Genius bar!

A: O.K. I have an update. I had checked the "hand-off" to another Mac in the General preferences. I unchecked it and now have two of the accounts added. Then, finally, I unchecked all the Google items in the Internet Accounts pane, turned off any device with Google anything, logged into Google from the Internet Accounts pane and mirabile dictu! gmail is now in place and downloading messages.
So: 1. Handoff is a nice feature, but it sure can mess up Mail.
    2. Gmail is as quirky as many have claimed.
Thanks to bike for his answer.

A: Apple is shifting software questions to online support since you don't need an appointment there. http://support.apple.com
However, you might make a head start on the troubleshooting by making a second user account. Log out of your problematic account and log into the new account.
Set up one mail account only in Internet accounts and open mail. The connection Doctor window will let you see any errors with that one account. If it's green, delete it and move on to the rest of the accounts, one by one.
Then you'll know if the error is settings or one mail server or the computer itself.


text:
Q: EmojiCompat fetchFont result is not OK My app uses EmojiCompat with font downloading (not bundled) and a big amount of my users are reporting the following error:
Non-fatal Exception: java.lang.RuntimeException: fetchFonts result is not OK. (2)
   at android.support.text.emoji.FontRequestEmojiCompatConfig$FontRequestMetadataLoader.createMetadata(FontRequestEmojiCompatConfig.java:307)
   at android.support.text.emoji.FontRequestEmojiCompatConfig$FontRequestMetadataLoader.access$100(FontRequestEmojiCompatConfig.java:164)
   at android.support.text.emoji.FontRequestEmojiCompatConfig$FontRequestMetadataLoader$1.run(FontRequestEmojiCompatConfig.java:218)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:158)
   at android.os.HandlerThread.run(HandlerThread.java:61)

I could not find any reference to this error message and I have no idea what is causing it. My guess is that it is an internal problem on the Google Play Services font downloading.
Edit on 2017-11-13: Still happening on support library 27.0.0.
Edit on 2017-11-15: My configuration.
On my Application class, on the onCreate():
val fontRequest = FontRequest(
        "com.google.android.gms.fonts",
        "com.google.android.gms",
        "Noto Color Emoji Compat",
        R.array.com_google_android_gms_fonts_certs)
val config = FontRequestEmojiCompatConfig(this, fontRequest)
config.setReplaceAll(true)
EmojiCompat.init(config)

Parsing text with Emoji:
EmojiCompat.get().registerInitCallback(object : EmojiCompat.InitCallback() {
    override fun onInitialized() {
        text = EmojiCompat.get().process(charSequence)
    }

    override fun onFailed(throwable: Throwable?) {
        throwable?.let { Crashlytics.logException(throwable) }
    }
})

The above exception is logged on the Crashlytics.logException()

A: Issue is more related to Google Play Services and network connection. Added comments to the bug created at https://issuetracker.google.com/issues/64430424#comment8


text:
Q: Clipboard.setData times out in Flutter I have this code present inside the onPressed of an IconButton, to copy some text to the clipboard, but it always times out.
await Clipboard.setData(ClipboardData(text: "text to be copied"))
.timeout(Duration(seconds: 5),
         onTimeout: () async {
                      Toast.show("inside timeout", context);
                    });


text:
Q: GitHub - LGTM and adding comments I received PR and went to test, research etc.
It looks good but I would like to add details in WRITE box (where usually we just put LGTM) in terms of:
1) "I tested function X and Y like this..."
2) "Here is a link to online documentation for Y describing why it is a good idea..."
3) "LGTM"
So my keyword LGTM should trigger approval but would additional comments mess up finding LGTM (so in that case additional comments are not allowed)?
Also, is it a good practice to add more details (e.g. as above)?

A:
So my keyword LGTM should trigger approval but would additional comments mess up finding LGTM (so in that case additional comments are not allowed)?

No, as per the official readme:

Project maintainers can indicate their approval by commenting on the pull request and including LGTM (looks good to me) in their approval text.

Emphasis mine - note that LGTM just needs to be included, it doesn't have to be the sole comment.

Also, is it a good practice to add more details (e.g. as above)?

If more details would be helpful, then sure. But no reason to add them in just for the sake of it.


text:
Q: Why do multiple instances of a component share the same state? I am building a todo list, and one of the functionalities is to display a list of completed tasks when the "completed" text is clicked and hide the list when it is clicked again. However, I can't get the first step - saving the state of the list, whether shown or hidden - to work.
There are several of these "CompletedRow" components (for different categories of tasks), and while clicking the text does toggle the state successfully, it seems that all these "CompletedRow" components share the same state - they are not independent. Why is this the case when I have already assigned keys to these components, and how can I solve this issue?
var CompletedRow = React.createClass({
    getInitialState: function () {
        return {
            show: false
        };
    },
    handleChange: function() {
        this.setState.show = !this.setState.show;
        console.log(this.state.show);
    },
    render: function() {

        return (

                 {this.props.count} tasks completed

);
    }
});

var TaskTable = React.createClass({
    // other code omitted for simplicity
    render: function() {
    var rows = [];
    var completedTasks = 0;

    this.state.taskList.forEach(function(task, index) {

        // do something
         if (completedTasks > 0) {
                rows.push(<CompletedRow
                    count={completedTasks}
                    key={getKey()}
                    taskList={this.state.taskList}
                    />);
                completedTasks = 0;
            }

    }.bind(this));

        return (

{rows}

        );
    }
});

A: This may be a typo, but you have a line in handleChange that is toggling a property attached to the setState function. This is shared by all the components
this.setState.show = !this.setState.show;

That line should be
this.setState({show: !this.state.show});

Also, the console.log on the following line will reflect the old state because setState is asynchronous to allow batching of state changes.


text:
Q: How to find faces of polytope defined by a Weyl orbit A few days ago I asked the following question at MSE and received no answer.  I thought I would try here.
Let $\xi$ be an integral dominant weight of an irreducible root system $\Delta$, and let $\mathcal{O}_{\xi}$ be its orbit under the action of the Weyl group. The elements of the orbit are the vertices of an n-dimensional convex polytope.
Is there an efficient way to pick out all the subsets of points in $\mathcal{O}_{\xi}$ forming the faces of the convex polytope?  I would like to have an algorithm that takes a Weyl orbit of an integral dominant weight as input and gives as output a list of subsets of vertices forming the faces of the polytope.  By efficient, I mean that I would like something better than a brute force algorithm.
Let $G$ be the compact connected Lie group corresponding to the root system $\Delta$, and let $T\subset G$ be a maximal torus.  We could also view the orbit $\mathcal{O}_{\xi}$ as the moment map image for a Hamiltonian group action of $T$ on $G/T$.  In this case, the faces of the moment map image can be viewed as the image of points fixed under a one parameter subgroup of $T$.
Is there a way to understand which 1-parameter subgroups have fixed point sets that get mapped to the faces of the moment map image?

A: The faces are all of the following form: $w W_P / Stab_W(\xi)$, where $W_P$ varies over the subgroups generated by subsets of the simple reflections. In particular, for $\xi$ regular, the number of them is $\sum_P |W / W_P|$. (Note that $\mathcal O_\xi$ is only $G/T$ when $\xi$ is regular; otherwise it's $G/Stab_G(\xi)$.)
I wrote up a Hamiltonian-geometry-based proof of this, then realized the combinatorics is pretty easy too, assuming $\xi$ is regular as it seems you're doing.
The set of faces ("external" faces, to us Hamiltonians) is obviously $W$-invariant. So it's enough to find the ones nearby the basepoint, then permute them.
The polytope is "simple" -- it has the right number of edges coming out of each vertex, namely the rank of $G$. So the number of faces at the basepoint is $2^{rank(G)}$. Each $W_P$ gives one, so that's all of them. QED.
Here are some related computations in the Hamiltonian formalism. If $S \leq T$ is a connected subgroup, then $ (G/T)^S = C_G(S) N(T)/ T $. Proof: $\subseteq$ is easy. For the reverse, let $s$ be a topological generator of $S$. If $s gT = gT$, then $g^{-1} s g \in T$, so $\exists n \in N(T)$ s.t. $n g^{-1} s g n^{-1} = s$, so $g n^{-1} \in C_G(s) = C_G(S)$.
We're interested in the set $\coprod_S C_G(S) N(T)/T$ of all components, over all $S$, so we get the same set if we look at $\coprod_S N(T) C_G(S)/T$. Since the $T$-moment map is $N(T)$-equivariant, we just need to figure out which components of $\coprod_S C_G(S)/T$, i.e. which $S$, give external walls of the moment polytope.
Every Levi subgroup of $G$ (w.r.t. a fixed Weyl chamber) arises as a $C_G(S)$, where $S$ is a dominant coweight. Each of those gives a wall around the basepoint of the Weyl polyhedron, and there are the same number of each: $2^{rank}$. So all the walls near the basepoint are images of $Levi/T$, i.e. with fixed points $W_P$.

A: This is not a direct answer to your questions (which I still haven't understood completely from your formulation).   But it seems important to place these questions within the extensive theoretical background, since I'm unconvinced that computing large examples (by brute force or otherwise) will provide much insight.
A convenient recent source is a short announcement by A. Khare here.   He and various collaborators have posted on arXiv a number of related papers on the faces of weight polytopes.  For example, a paper with Ridenour was published in 2012 in Algebras and Representation Theory; the preprint is here.
Some of this work refers back to work of Vinberg and others.   Since the combinatorics of weight polytopes gets formidable even when the Weyl group is a symmetric group (presumably the best-behaved family of examples), it's a good idea to explore this literature and also to refine your own questions as far as possible.


text:
Q: (MQL4) QUESTION: How do you find a percent of a number in mql4? Its just simply that, lol.
Example. I need to find 5% of 1000 (which I do know it's 50 in real life), but how do I calculate this math using mql4 language?

A: Very simply, just multiply the number of percentages by the number you want to get the percentage from and divide by 100. If you want to store percentage the value, remeber to use double type.
In your example:
double percentage = 5 * 1000 / 100;


text:
Q: Using Html.DisplayFor in mvc with templates I have a model
public class Person {
    public string Name { get; set; }
    public int Age { get; set; }
}

and a Simple View
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IList<Site.Models.Person>>" %>

    <% for (int i = 0 ; i < Model.Count ; i++) {  %>
        <%: Html.DisplayFor(m => m[i])%>
    <% } %>

With a Partial View
 <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Site.Models.Person>" %>

A person

Name: <%: Html.DisplayFor(x => x.Name)%>

Age: <%: Html.DisplayFor(x => x.Age)%>

and single Controller
public ActionResult Index () {
        Person p1 = new Person { Age = 18 , Name = "jon" };
        Person p2 = new Person { Age = 23 , Name = "bob" };

        return View(new List<Person> { p1 , p2 });
    }

The Displayfor in the view should show each person displayed with the Template specified in the partial view, but it is not. Thanks for any help

A: The partial view name must be Person.ascx placed in shared\DisplayTemplates folder


text:
Q: Why Does Absolute Positioning Within Container Require Container to be Relative It doesn't make sense to me.
If I want a div to be left:20px;top:20px from the container edge, I should be able to do something like position:absolute-within-parent;. Defining the positioning of a child should not require modification of the parent.
At least it seems more modular and decoupling that way. And as a programmer I've been taught to obsess with that.

A: Absolute positioning is relative to something called the containing block. The containing block is the closest parent which has relative or absolute positioning (which may be the body element if nothing else could be found). This allows you to position an element relative to any one of its parents. absolute-within-parent would restrict you to only being able to absolutely position an element relative to its immediate parent, which isn't always what you need.


text:
Q: How to omit author field of a citation locally in biblatex? I need to create a list of citation shorthands, but my document only uses shorthands to works of one single author. The full citation scheme in shorthands is, therefor, redundant: It should omit the author's name.
That is achievable by reseting the author field with an \AtBeginShorthands, like:
\AtBeginShorthands{\renewbibmacro*{author}{}}

But I also need this behavior in other places: There's a section i the document where I'm planning to put a description list, introducing and explaining the main bibliography...
I'd like to create a separate bibliography, something like "Works by Author Name", where the author's name would also be redundant... (I think this supposed to be made inside a \defbibenvironment but I don't know how)
So, summarizing:

*

*1) how to reset author bibmacro inside a single environment

*2) how to reset author bibmacro inside a separated bibliography

A: Prenote: Although you state to have managed resetting the author field inside an environment, I'm afraid that \renewbibmacro*{author}{} will cover many, but not all cases. (The standard bibliography drivers use a lot of different bibmacros!)
For a separated bibliography, I suggest to clone the bibenvironment used by your favourite bibliography/citation style and to add \clearname{author} (and \clearname{editor}) to the fourth mandatory argument of \defbibenvironment -- the one that contains "code to be executed at the beginning of each entry in the bibliography or the list of shorthands" (manual, section 3.5.7).
In the following example, I have also semi-automatized the creation of the "Works by author name" bibliographies. biblatex doesn't (yet?) feature a \bibbyauthor command, but you can declare categories for the different authors and use \bibbycategory.
\documentclass{article}

\usepackage[defernumbers=true]{biblatex}

\defbibenvironment{bibnoauthors}
  {\list
     {\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\clearname{author}%
  \clearname{editor}%
  \item}

\DeclareBibliographyCategory{Author}
\DeclareBibliographyCategory{Buthor}
\addtocategory{Author}{A01x,A01y}
\addtocategory{Buthor}{B02}
\defbibheading{Author}{\section*{Works by A.~Author}}
\defbibheading{Buthor}{\section*{Works by B.~Buthor}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01x,
  author = {Author, A.},
  year = {2001},
  title = {Alpha-First},
}
@misc{A01y,
  author = {Author, A.},
  year = {2001},
  title = {Alpha-Second},
}
@misc{B02,
  editor = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\bibbycategory[env=bibnoauthors]

\printbibliography

\end{document}


text:
Q: Efficiency of regular wakeups (Alarms) vs. staying awake (WakeLocks) I want to accept Bluetooth connections (even when the screen is off) for building a mobile ad-hoc P2P network. Since it seems that incoming connections don't wake the device up, I think I will either need to keep the device permanently awake with a partial WakeLock (which will drain the battery relatively quickly), or wake it up for short periods of time to check for new connections.
Now, my question is: Is it more efficient to wake the device up at regular intervals, or is it better to just keep it awake because the wakeup-sleep-transition will eat more power than simply keeping the device awake all the time? The intervals I am talking about here are on a scale of 1-10 seconds.
Alternate solutions that get around the issue are also highly welcome, of course, if they aren't limited to a small set of devices.

A: You  need to test with a real device and you might get different results with different devices. Generally, if you are going to wake up every second, just keep the thing awake (you can blank the screen to save some power). Or you can use something like cloud messaging (GCM) to wake up the device, but that will require a separate server. Example: device1 sends to server 'I am here message', server sends to device2 'device1 is over there, wake up and check it out' message, device1 connects to device2. This, of course, might be overkill for you :)


text:
Q: Создать bat файл для перекидывания определенных логов в текстовой документ может мой вопрос покажеться примитивным, но не могу понять как можно отправить логи из командной строки после выполнения команды, в текстовый документ. Необходимо отправить только определенные команды. Я сделал так:
D:\Soft\file.bat > D:\Soft\1.txt

Но он выводит только одну строчку, а у меня в логах их много.
И как можно сделать так чтобы перекидывались те логи в которых, допустим, есть слово «Ошибка». Заранее спасибо.


text:
Q: Using LINQ query result for data source for GridControl c# I have a function like this in a static class
public static IEnumerable<MyObject> getFilteredList(int docType)
{
    var fItems = from i in list
                 where i.DocType == docType
                 select i;

    return fItems;
}

When I use this returned list for a data source to my Grid in the form like this for example:
GridControl.DataSource = staticClass.getFilteredList(10)

The Grids DataSource property is null. Can you explain me why this is happening ?
Edit: the list variable is List which contains elements with DocType = 10.
The Items contains elements.

A: You should use
GridControl.DataSource = staticClass.getFilteredList(10).ToList();

to create a new List instance to bind to your grid.
Another way is to use a BindingList, which fully supports databinding and gives you usefull events like ListChanged and AddingNew.
var list = new BindingList(staticClass.getFilteredList(10).ToList());

GridControl.DataSource = list;

A: Try
GridControl.DataSource = staticClass.getFilteredList(10).ToList();

because DataSource must be inherited from IList

A: You ca try with ToList()
GridControl.DataSource = staticClass.getFilteredList(10).ToList();
GridControl.DataBind();

A: public static IEnumerable<MyObject> getFilteredList(int docType)
    {
        var fItems = from i in list
                     where i.DocType.docTypeId == docType
                     select i;

        return fItems;
    }

correct me if I am wrong but right now it seems as if you are comparing an int with the DocType class. if that's not the case then your query could just be returning an empty set since it can't find anything that matches.


text:
Q: R: merging matrices (not data.frames) merge is a very nice function: It merges matrices and data.frames, and returns a data.frame.

Having rather big character matrices,
  is there another good way to merge -
  without data.frame conversion?

Comment 1:
A small function to merge a named vector with a matrix or data.frame. Elements of the vector can link to multiple entries in the matrix:
expand <- function(v,m,by.m,v.name='v',...) {
  df <- do.call(rbind,lapply(names(v),function(x) {
    pos <- which(m[,by.m] %in% v[x])
    cbind(x,m[pos,],...)
  }))
  colnames(df)[1] <- v.name
  df
}

Example:
v <- rep(letters,each=3)[seq_along(letters)]
names(v) <- letters
m <- data.frame(a=unique(v),b=seq_along(unique(v)),stringsAsFactors=F)
expand(v,m,'a')

A: You can use a combination of match and cbind to do the equivalent of merge without conversion to data frame, a simple example:
st1 <- state.x77[ sample(1:50), ]
st2 <- as.matrix( USArrests )[ sample(1:50), ]

tmp1 <- match(rownames(st1), rownames(st2) )

st3 <- cbind( st1, st2[tmp1,] )
head(st3)

Keeping track of which columns you want, and merging whith many to 1 relationships or missing rows in one group require a bit more thought but are still possible.

A: No, not without either (a) overwriting the merge function or (b) creating a new merge.matrix() S3 function (this would be the right approach to the problem).
You can see in the merge help:

Value
A data frame.

Also, the merge.default function:
> merge.default
function (x, y, ...)
merge(as.data.frame(x), as.data.frame(y), ...)

A: There is now a merge.Matrix function in the Matrix.utils package.  This works on combinations of matrices as well as capital M Matrices, data.frames, etc.
The match solution is nice, but as someone pointed out does not work on m:n relationships.  It also does not implement the other features of merge, including all.x, all.y, etc.


text:
Q: send email in Python and list items as email content not as attachment I am trying to send an email containing list of URLs along with message stating these are urls for example:
BADURL = ['abc.123.com','xyz.456.com','rtf.892.com']

Requiring output
Following are BAD URLs
abc.123.com
xyz.456.com
rtf.892.com

I am writing following code but I am getting message as email body and urls as an attachment. I don't want to send URLs as attachment instead I just want them to be listed in the email. Following is my code:
message = multipart.MIMEMultipart('mixed')

message['Subject'] = 'Policy.txt file update'

message['From'] = sender

message['To'] = ','.join(destination)

message['Date'] = formatdate(localtime=True)

message.attach(text.MIMEText('Following are BAD URLs'))

message.attach(text.MIMEText('\n'.join(y),'plain'))

print('sending message')enter code here

print (message.as_string())

try:

z = smtplib.SMTP('localhost')

z.sendmail(sender, destination, message.as_string())

z.quit()

except(smtplib.SMTPException, IOError) as e:

z.quit()

print(str(e))

A: Try changing the corresponding part of your code by these
message = multipart.MIMEMultipart('alternative')

message.attach(text.MIMEText('\n'.join(y),'html'))

and when you include the URL-s, embrace them into  tags; say put
some title here

in your message.
This should work.


text:
Q: last_scan_date and timestamp in Python looking for an advise. Everyday I scan the SalesForce to find new opportunities and update the data accordingly. I am looking for a library or method that will store the last_scan_day and create a timestamp afterwards. So that the next day when the code scans for new opportunities it knows what the last_scan_day was - only checks the data that is Date >  last_scan_day and updates the timestamp with a new date. And so on. It is a very high level of what I am trying to do, but if anyone can direct me to the right python methods, that would be awesome.
Currently, this works for me in php, but I need to translate it to Python.
    $last_run_date = file_get_contents("./last_scan_date.txt");
    $last_run_date = str_replace("\n","",$last_run_date);

    $t = getDatetimeNow();
    $t = substr($t,0,19)."Z";
    file_put_contents("./last_scan_date.txt",$t);

A: from datetime import date, timedelta
yesterday = date.today() + timedelta(days=-1)


text:
Q: Update empty values with null I create a Job that runs the query below for all databases in a server in order to update empty values with null in all columns for all tables. The problem I'm facing is this query literally killed the sql server, was in a dev enviroment.
I notice the log for the first DataBase grew up from 6gb to 80gb and left the server without space.
Is there a better way to achieve update all empty columns with null in all Tables without crashing the server?
This query generate around 5,000 update statements for each database
I plane to run this kind of cleanup once a week.
SELECT
ROW_NUMBER ( )
    OVER (ORDER BY [object_id] DESC) AS iRow
,name,[object_id]
INTO #temp
FROM sys.Tables
WHERE
name NOT LIKE 'old%'
AND name NOT LIKE '%old'
AND name NOT LIKE '%copy'
AND name NOT LIKE 'copy%'
AND name <> 'sysdiagrams'

--SELECT * FROM #temp
DECLARE @intFlag INT,@endFlag INT

SELECT @intFlag= MIN(iRow) FROM  #temp
SELECT @endFlag= MAX(iRow) FROM  #temp

CREATE TABLE #temp2(name VARCHAR(250),tablename VARCHAR(250))

--SELECT * FROM #temp
WHILE (@intFlag<=@endFlag)
    BEGIN
        INSERT INTO #temp2
        SELECT c.name,(SELECT name FROM #temp WHERE iRow=@intFlag) AS TableName
        FROM syscolumns c
        INNER JOIN systypes t ON c.xtype=t.xtype
        WHERE id =(SELECT [object_id] FROM #temp WHERE iRow=@intFlag)
        AND isnullable = 1 AND c.xtype IN(99,167,175,231,239)
        order by c.name
        SET @intFlag = @intFlag + 1;
    END

DECLARE @SQLquery AS VARCHAR(MAX) = ''

SELECT @SQLquery +='UPDATE ['+tablename+'] SET ['+ name+'] = NULL WHERE LTRIM(RTRIM(['+name+']))='''';'
FROM #temp2

--SELECT @SQLQuery
EXECUTE (@SQLquery)

DROP TABLE #temp
DROP TABLE #temp2

A: I believe the problem is that you are executing all 5000 update statements as a single transaction. You need to break them up so each one is done in its own transaction. Then there are two options:

*

*If you are in simple recovery mode (or can temporarily switch the database to simple recovery mode), then breaking them up should be enough for the database to automatically truncate the log after each transaction.

*If you are in full recovery mode, you'll probably need to do a transaction log backup after each update statement to allow the log to be truncated.

So the last part of your query would look like this:
DECLARE @SQLquery AS VARCHAR(MAX)
DECLARE @name AS VARCHAR(250)
DECLARE @tablename AS VARCHAR(250)

DECLARE columns_cursor CURSOR FOR
  SELECT name, tablename
  FROM #temp2
OPEN columns_cursor

FETCH NEXT FROM columns_cursor INTO @name, @tablename
WHILE @@FETCH_STATUS = 0
BEGIN
  @SQLquery ='UPDATE ['+@tablename+'] SET ['+ @name+'] = NULL WHERE LTRIM(RTRIM(['+@name+']))='''';'
  --SELECT @SQLQuery
  EXECUTE (@SQLquery)
  BACKUP LOG db_name TO DISK = 'backup_path' -- Not needed in simple recovery mode
  FETCH NEXT FROM columns_cursor INTO @name, @tablename
END

CLOSE columns_cursor
DEALLOCATE columns_cursor
DROP TABLE #temp
DROP TABLE #temp2


text:
Q: Vimeo API not detecting play event I'm trying to detect a click of the play button using hte vimeo js api. Here is my code:
html:

and the JS:
        var iframe = document.getElementById('video');
        var player = $f(iframe);

        player.on('play', function() {
            console.log('played the video!');
        });

At the moment i'm not getting anything logged in the console. I do have another function using the Vimeo API later down in the DOM which seems to be working fine:
        jQuery("body").on("click",".watch-vid-cta",function(){
              player.api("play");
        });

I got the code straight form their API so not sure what I could be doing wrong:
https://github.com/vimeo/player.js

A: It seems that there are two issues here.
First : vimeo has released it's new api (2016) recently, and it's not compatible with the former one. The code you provided is a mix of the two api, player.api("play") is the old syntax, while the new synax is player.play().
As you second function is working, I would assume that you're using the old api (known as froogaloops). The github page of vimeo contains all the explanation you may nedd to migrate and it's super easy.
Second : within the new api, it seems that you mixed the event listener player.on('play', function() {} whitch do something when the player is played and the play() method, use to play the player.
With the new api your code might look like this :
html :
<button type="button" id="playButton">Play</button>

then you need to include the api in your page

and finally your js :
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);

function vimeoPlay(){
    player.play().then(function(){
    })
    .catch(function(error) {
        switch (error.name) {
            case 'PasswordError':
                break;
            case 'PrivacyError':
                break;
            default:
                break;
        }
    });
}

document.getElementById("playButton").onclick = function (){vimeoPlay()}

Here the player.play() method has a promise .then(function{}), this enable you to do something once the player is played, and thus only once every time you call the vimeoPlay function, by clicking on the button in this case.
Hope this helps
EDIT :
regarding your comment, I belive that you are facing the first issue.
If your second function, which contains player.api("play") works, it probably means that you are using the old api (froogaloops) as with the new api (2016) it would be player.play().
If so, you can't expect player.on('play', function() {console.log('played the video!');}); to work as it is the syntax of the new api.
You should double check which version of the api you are using, the link to the old and the new ones are respectively :

    //versus

If your wish is indeed to listen to a play event then you may try this with the new api

I highligh your attention toward the difference between the way you embed the video and the way I do, you shouldn't add ?api=1 with the new api :

    //versus

and toward the difference between the way you set your variables and I do:
var iframe = document.getElementById('video');
var player = $f(iframe);
    //versus
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);

If you have multiple vimeo video on the same page you may of couses attribute an id to your vimeo iframes, for instance vimeoPlayer1 and vimeoPlayer2 and write

var vPlayer1 = document.getElementById("vimeoPlayer1");
var player1 = new Vimeo.Player(vPlayer1)

var vPlayer2 = document.getElementById("vimeoPlayer2");
var player2 = new Vimeo.Player(vPlayer2)

Finally you may upgrade you second function by replacing player.api("play") by player.play() (but I'm not confortable with jQuery if there is something else going on here):


text:
Q: Vim: Error detected while processing function vundle#config#bundle[2]..33_check_bundle_name: I'm currently getting the following error when I open up the vim editor.
 Error detected while processing function vundle#config#bundle[2]..<SNR>33_check_bundle_name:
    line    1:
    E121: Undefined variable: s:bundle_names
    E116: Invalid arguments for function has_key(s:bundle_names, a:bundle.name)
    line   11:
    E121: Undefined variable: s:bundle_names
    Press ENTER or type command to continue

From doing research it seems as though this is coming from two conflicting bundles.But is hard to determine from what plugin this error is comign from since it seems I'm only using Vundle.
https://github.com/VundleVim/Vundle.vim/issues/682
When I run BundleInstall I get the following file open up:
" Installing plugins to /Users/staguilar/.vim/bundle
Plugin 'VundleVim/Vundle.vim'
Helptags

Not sure if the error is coming from this plugin. Here is my .vimrc file.
let mapleader = " "

set backspace=2   " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile    " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler         " show the cursor position all the time
set showcmd       " display incomplete commands
set incsearch     " do incremental searching
set laststatus=2  " Always display the status line
set autowrite     " Automatically :write before running commands

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
  syntax on
endif

if filereadable(expand("~/.vimrc.bundles"))
  source ~/.vimrc.bundles
endif

" Wrap commit message to 72 characters
filetype indent plugin on
autocmd FileType gitcommit set textwidth=72
" Set spellfile to location that is guaranteed to exist, can be symlinked to
" Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm.
set spellfile=$HOME/.vim-spell-en.utf-8.add

" Autocomplete with dictionary words when spell check is on
set complete+=kspell

" Always use vertical diffs
set diffopt+=vertical

" Local config
if filereadable($HOME . "/.vimrc.local")
  source ~/.vimrc.local
endif

and this is the .vimrc.bundles file.
if &compatible
  set nocompatible
end

" Remove declared plugins
function! s:UnPlug(plug_name)
  if has_key(g:plugs, a:plug_name)
    call remove(g:plugs, a:plug_name)
  endif
endfunction
command!  -nargs=1 UnPlug call s:UnPlug(<args>)

let g:has_async = v:version >= 800 || has('nvim')

call plug#begin('~/.vim/bundle')

" Define bundles via Github repos
Plug 'christoomey/vim-run-interactive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'elixir-lang/vim-elixir'
Plug 'fatih/vim-go'
Plug 'janko-m/vim-test'
Plug 'kchmck/vim-coffee-script'
Plug 'pangloss/vim-javascript'
Plug 'pbrisbin/vim-mkdir'
Plug 'slim-template/vim-slim'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-projectionist'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-surround'
Plug 'vim-ruby/vim-ruby'
Plug 'vim-scripts/tComment'
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'https://github.com/scrooloose/nerdtree.git'
Plug '/usr/local/opt/fzf'
Plug 'mustache/vim-mustache-handlebars'

if g:has_async
  Plug 'w0rp/ale'
endif

if filereadable(expand('~/.vimrc.bundles.local'))
  source ~/.vimrc.bundles.local
endif

call plug#end()

A: Look in your vimrc.bundles.local file and compare it with your vimrc.bundles file. See if you find any plugin appearing in both files, and if you find it, remove it from either of them.


text:
Q: Python class variable access speed Say there is a class:
class x(obj):
    y = 1

What is faster (or preferred):
    def __init__(self):
        print self.y

or:
    def __init__(self):
        print x.y

I assume x.y better communicates the intend but I'm interested in the speed implications.

A: The performance gain you could possibly achieve with these micro optimizations doesn't matter. The impact of the printing dwarfs the cost of attribute access by far. For reference, here's a test script:
import sys,timeit
class ClassAccess(object):
    y = 1
    def __init__(self):
        print(ClassAccess.y)

class SelfAccess(object):
    y = 1
    def __init__(self):
        print(self.y)

ca = timeit.timeit(ClassAccess, number=100000)
sa = timeit.timeit(SelfAccess, number=100000)

sys.stderr.write(str(ca) + "\n")
sys.stderr.write(str(sa) + "\n")

On my machine (with the yakuake terminal), this outputs
0.640013933182
0.628859043121

This is within experimental error of both variants being identical. Crude experimentation shows that:

*

*Approximately 90% of the runtime is caused by actually displaying the printed result.

*Of the rest, approximately 50% is the time that the print statement alone takes up.

*Approximately 80% of the rest of that is caused by the allocation of the objects.

Therefore, it's safe to say to derive the conclusion that there is no difference in performance.

A: Note that depending on the class implementation the returned values may differ.
This returns the y attribute of the instance :
def __init__(self):
    print self.y

While this returns the y attribute of the class :
def __init__(self):
    print x.y

If the constructor override the y attribute a la :
def __init__(self, y=None):
    self.y = y
def print(self):
    print self.y

the returned values will differ.
Python looks up the instance internal dictionary checking for y before to check for the class internat dictionary.
So I think that print x.y should be slightly faster because it avoids looking up the instance dictionary.


text:
Q: NuGet force update of dependency packages in Visual Studio I have currently installed the NuGet packages Xamarin.GooglePlayServices.Base version 32.961.0 and Xamarin.Forms version 3.0.0.561731. Now I want to update Xamarin.GooglePlayServices.Base to the newest version 60.1142.1, but I can't because it has a dependency NuGet package Xamarin.Android.Support.Compat (>= 26.0.2) which is also da dependency of Xamarin.Forms 3.0.0.561731. On the other hand, Xamarin.Forms has a dependency to the same package via Xamarin.Android.Support.v4 (>= 25.4.0.2).
I get the following version conflict in VS:
 MyApp.Android -> Xamarin.GooglePlayServices.Base 60.1142.1 -> Xamarin.GooglePlayServices.Basement 60.1142.1 -> Xamarin.Android.Support.Compat (>= 26.0.2)
 MyApp.Android -> Xamarin.Forms 3.0.0.561731 -> Xamarin.Android.Support.v4 25.4.0.2 -> Xamarin.Android.Support.Compat (= 25.4.0.2).

If I could just force an update of dependency package Xamarin.Android.Support.v4 to the newest version, then it would also require a newer version of Xamarin.Android.Support.Compat and the conflicts are gone.

A:
NuGet force update of dependency packages in Visual Studio

Just like the error shows:

Xamarin.GooglePlayServices.Base 60.1142.1 ->
  Xamarin.GooglePlayServices.Basement 60.1142.1 ->
  Xamarin.Android.Support.Compat (>= 26.0.2)
Xamarin.Forms 3.0.0.561731 -> Xamarin.Android.Support.v4 25.4.0.2
  -> Xamarin.Android.Support.Compat (= 25.4.0.2).

we could to know the version conflict comes from Xamarin.Android.Support.Compat (>= 26.0.2) and Xamarin.Android.Support.Compat (= 25.4.0.2). Then check the dependencies info about package Xamarin.Forms, we could to know Xamarin.Forms 3.0.0.561731 -> Xamarin.Android.Support.v4 (>= 25.4.0.2).
So, to resolve this issue, we just need update package Xamarin.Android.Support.v4 to version 26.0.2, which have dependency Xamarin.Android.Support.Compat (26.0.2).
To accomplish this, uninstall the Xamarin.GooglePlayServices.Base packages that you have added, then update those Xamarin.Android.Support.XXX packages manually:
Details steps:

*

*Unload your projects and edit it.

*Change the version of those Xamarin.Android.Support.XXX packages to 26.0.2:
<ItemGroup>
  <PackageReference Include="Xamarin.Forms" Version="3.0.0.561731" />
  <PackageReference Include="Xamarin.Android.Support.Design" Version="26.0.2" />
  <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="26.0.2" />
  <PackageReference Include="Xamarin.Android.Support.v4" Version="26.0.2" />
  <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="26.0.2" />
  <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="26.0.2" />
</ItemGroup>

*Reload the project, then add the package Xamarin.GooglePlayServices.Base 60.1142.1
With this way, you can update Xamarin.GooglePlayServices.Base to the newest version 60.1142.1.
update:

Why does XF request Xamarin.Android.Support.Design 25.4.0.2, when the
  docs say >= 25.4.0.2?

You may need check my above steps again, do not install the package Xamarin.GooglePlayServices.Base before updating those  Xamarin.Android.Support.xx packages.
That because if you install Xamarin.GooglePlayServices.Base (60.1142.1) first, NuGet will add its dependency Xamarin.Android.Support.Compat (>=26.0.2).
However, when you install the package Xamarin.Forms (3.1.0.583944), NuGet will add the lowest version dependencies by default.
Doc: How NuGet resolves package dependencies
So, NuGet will add the Xamarin.Android.Support.xx 25.4.0.2. And that is the reason why doc say >= 25.4.0.2 but NuGet add version 25.4.0.2. Of course, since doc say >= 25.4.0.2, you could update the dependencies Xamarin.Android.Support.xx to 26.0.2.
So the solution is:

*

*Uninstall the Xamarin.GooglePlayServices.Base packages, do NOT install it again immediately.

*Install packages Xamarin.Forms (3.1.0.583944), and update those Xamarin.Android.Support.xx 25.4.0.2 to 26.0.2(Check above Details steps).

*Add the package Xamarin.GooglePlayServices.Base 60.1142.1.
Hope this helps.


text:
Q: Find $f(x)$ if $f$ is a polynomial and $f(x) + f'(x) = x^3 + 5x^2 + x + 2$.
If
  $$f(x)+f'(x)=x^3+5x^2+x+2$$
  find $f$, if it is a polynomial function.

The answer given is : $f(x) = x^3+2x^2-3x+5$. Please anyone explain simple way to solve.

A: Let $f(x)$ be $ax^3 + bx^2 + cx + d$, then $f'(x)$ is $3ax^2 + 2bx +c$ . Adding them we get, $ax^3 +x^2(b+3a) +x(c+2b) + d+c$. Comparing with the given equation, $a = 1$, $b =2$, $c=-3$,  $d=5$.
So, $f(x)$ is obtained.

A: at first solve the equation $$y(x)+y'(x)=0$$
write $$\frac{dy}{dx}+y=0$$ or $$\frac{dy}{y}=-dx$$ and integrate


text:
Q: Reading data from Angular Elements Web Component in plain JavaScript I'm building a few WebComponent that I'll be using across different libraries/frameworks, but mostly with plain vanilla JavaScript. I'm considering using Angular Elements for this, and built a sample one following few documents.
It works fine, with all natural Angular goodies built in. But, what I'm struggling with is, reading data out of the web component from plain JavaScript, something like var result = myComponent.value.

*

*Note that this data I'm reading is not primitive, or a single value. It's like an object with many details from a complex WebComponent

*I'd want something like a readonly property

*Standard Angular documents for components always use @Output() with an EventEmitter for this purpose. But since I'll be using the component as WebComponent outside Angular world, I cannot (and don't want to) use that approach. Also, I do not want to notify on each change of the value, but just read the value when needed

If I'm writing a standard WebComponent in plain JavaScript, I can do this
class MyComponent extends HTMLElement {

    constructor() {
        super();
        this.name = 'Guest';
        this.count = 0;
    }

    // more code...

    // THIS result PROPERTY IS USED TO READ DATA FROM THE WEB COMPONENT
    get result() {
        return { name: this.name, count: this.count }; // <<== to read data
    }

    connectedCallback() {
        this.attachShadow({ mode: 'open' });
        this.shadowRoot.innerHTML = `

MyComponent

            More HTML...
        `;
    }
}

customElements.define('my-component', MyComponent);

// Then I can use <my-component></my-component> in my application HTML
// And in the JavaScript code, I can read data from my-component as

const result = document.querySelector('my-component').result;
// which would be something like { name: 'Guest', count: 0 }

Is there a way to do this in AngularElements ?

A: Ok, so I have got 2 workarounds to deal with it for now! They are more like hacks as (1) they are not done the standard Angular way, and (2) might break in future with implementation changes within Angular. Below are the 2 ways I could achieve an output property for a WebComponent built with Angular Elements
(I'm using "@angular/core": "~9.1.11" & "@angular/elements": "^9.1.11")

*

*My colleague pointed out that createCustomElement only exposes inputs as properties. See code here. SO the hack is, to mark a property as Input() then just read it from outside like a normal property! It's very non-intuitive and doesn't follow any standard semantics. And it's interesting that Angular does not complain if I have just a getter for a property decorated with @Input()

*A better approach, as was pointed out by Danny '365CSI' Engelman in the comments, we can define a new property on the native HTML element, using Object.defineProperty
Note that, instead of option (1), a better approach could be to enhance/extend the logic in Angular to include other properties from the component class as the element properties, maybe with a new custom decorator like @outputProperty.
Sample code with implementation of both the above approaches
// The component
import { Component, OnInit, ViewEncapsulation, Input, ElementRef } from '@angular/core';

@Component({
    // selector, templateUrl & styleUrls
    encapsulation: ViewEncapsulation.ShadowDom,
})
export class MyComponent implements OnInit {

    constructor(
        private element: ElementRef,
    ) {
        // THIS IS APPROACH 2 => we are defining a 'result2' property on the HTMLElement
        Object.defineProperty(this.element.nativeElement, 'result2', {
            get: () => { return { name: this.name, count: this.count }; },
            enumerable: true,
        });
    }

    public name = 'World';
    public count = 0;

    // More code for component functionalities and state management...

    // Just note that this does NOT work i.e. cannot read it from outside
    public get result0(): ElementMetadata {
        return { name: this.name, count: this.count };
    }
    public set result0(value) { console.log(`result value set to ${value}`); }

    // THIS IS APPROACH 1 => we are marking 'result1' with a getter, as @Input
    @Input()
    public get result1(): ElementMetadata {
        return { name: this.name, count: this.count };
    }
}

// The module (no changes made specifically for this)
export class AppModule {
    constructor(private injector: Injector) { }

    ngDoBootstrap() {
        const custElement = createCustomElement(
            MyComponent,
            { injector: this.injector },
        );
        customElements.define('my-component', custElement);
    }
}