git – Github Commit Syntax to Link a Pull Request/ Issue

git – Github Commit Syntax to Link a Pull Request/ Issue

Use the documented auto-linking format for issues across repositories.

  • Syntax: {owner}/{repository}#{issue_number}
  • Example: mojombo/jekyll#1

When such formatted text is present in a commit message, its automatically transformed into a clickable link which will redirect one to https://github.com/{owner}/{repository}/issues/{issue_number}

Github share PR/Issue number use the same sequence.

So, one #number either one PR or one Issue.

Just use #number is OK.

git – Github Commit Syntax to Link a Pull Request/ Issue

Use #1234 in a comment to reference pull request 1234 from the current repo.

Web Console Access for Azure Virtual Machine?

Web Console Access for Azure Virtual Machine?

When i contact Azure Support they give this solution:

As console access is not an available feature yet in Azure, you will basically be mounting the problem OS disk as a data disk on a working VM to correct changes to the file system configuration:

A = Original VM (Inaccessible VM)
B = New VM (New Temp VM)

1) Stop VM A via the Azure management portal

2) Delete VM A BUT select “keep the attached disks”

3) Once the lease is cleared, attach the Data Disk from A to VM B via the Azure Portal, Virtual Machines, Select “A”, Attach Disk

4) On VM “B” eventually the disk will attach and you can then mount it.

5) Locate the drive name to mount, on VM “B” look in relevant log file note each linux is slightly different.

grep SCSI /var/log/kern.log (ubuntu)

6) Mount the attached disk onto mountpoint /tempmount

df -h
mkdir /tempmount
mount /dev/sdc1 /tempmount
df –h

7) Change into /etc directory where the original OS disk from resides

cd /tempmount/etc/
cp fstab fstab_orig

8) Now that you have made a backup of you fstab you can proceed to make the changes you require using vi, nano or your preferred text editor.

vi fstab
cd /
umount /tempmount

9) Detach the disk from VM B via the management portal

10) Recreate the original VM A (Create VM from Gallery, Select My Disks) you will see the Disk referring to VM A – Select the original Cloud Service name.

i think that there is the best solution for now.

Web Console Access for Azure Virtual Machine?

vb6 migration – How to declare a fixed-length string in VB.NET?

vb6 migration – How to declare a fixed-length string in VB.NET?

Use the VBFixedString attribute. See the MSDN info here

<VBFixedString(256)>Dim strBuff As String

It depends on what you intend to use the string for. If you are using it for file input and output, you might want to use a byte array to avoid encoding problems. In vb.net, A 256-character string may be more than 256 bytes.

Dim strBuff(256) as byte

You can use encoding to transfer from bytes to a string

Dim s As String
Dim b(256) As Byte
Dim enc As New System.Text.UTF8Encoding
...
s = enc.GetString(b)

You can assign 256 single-byte characters to a string if you need to use it to receive data, but the parameter passing may be different in vb.net than vb6.

s = New String( , 256)

Also, you can use vbFixedString. Im not sure exactly what this does, however, because when you assign a string of different length to a variable declared this way, it becomes the new length.

<VBFixedString(6)> Public s As String
s = 1234567890  len(s) is now 10

vb6 migration – How to declare a fixed-length string in VB.NET?

To write this VB 6 code:

Dim strBuff As String * 256

In VB.Net you can use something like:

Dim strBuff(256) As Char

git – Cant push/pull to Github using Gitbox after password change

git – Cant push/pull to Github using Gitbox after password change

Try this:

open Keychain Access.app, search for GitBox, and delete the relevant entry there (in the All items category in the left pane).

Then try GitBox again — it should accept the new password.

git – Cant push/pull to Github using Gitbox after password change

Web Console Access for Azure Virtual Machine?

Web Console Access for Azure Virtual Machine?

When i contact Azure Support they give this solution:

As console access is not an available feature yet in Azure, you will basically be mounting the problem OS disk as a data disk on a working VM to correct changes to the file system configuration:

A = Original VM (Inaccessible VM)
B = New VM (New Temp VM)

1) Stop VM A via the Azure management portal

2) Delete VM A BUT select “keep the attached disks”

3) Once the lease is cleared, attach the Data Disk from A to VM B via the Azure Portal, Virtual Machines, Select “A”, Attach Disk

4) On VM “B” eventually the disk will attach and you can then mount it.

5) Locate the drive name to mount, on VM “B” look in relevant log file note each linux is slightly different.

grep SCSI /var/log/kern.log (ubuntu)

6) Mount the attached disk onto mountpoint /tempmount

df -h
mkdir /tempmount
mount /dev/sdc1 /tempmount
df –h

7) Change into /etc directory where the original OS disk from resides

cd /tempmount/etc/
cp fstab fstab_orig

8) Now that you have made a backup of you fstab you can proceed to make the changes you require using vi, nano or your preferred text editor.

vi fstab
cd /
umount /tempmount

9) Detach the disk from VM B via the management portal

10) Recreate the original VM A (Create VM from Gallery, Select My Disks) you will see the Disk referring to VM A – Select the original Cloud Service name.

i think that there is the best solution for now.

Web Console Access for Azure Virtual Machine?

string – Java codingbat help – withoutString

string – Java codingbat help – withoutString

Your solution IS failing AND there is a display bug in coding bat.

The correct output should be:

 withoutString(This is a FISH, IS) -> Th  a FH

Yours is:

 withoutString(This is a FISH, IS) -> Th a FH

Yours fails because it is removing spaces, but also, coding bat does not display the correct expected and run output string due to HTML removing extra spaces.

This recursive solution passes all tests:

public String withoutString(String base, String remove) {
    int remIdx = base.toLowerCase().indexOf(remove.toLowerCase());
    if (remIdx == -1)
        return base;
    return base.substring(0, remIdx ) + 
           withoutString(base.substring(remIdx + remove.length()) , remove);
}

Here is an example of an optimal iterative solution. It has more code than the recursive solution but is faster since far fewer function calls are made.

public String withoutString(String base, String remove) {
    int remIdx = 0;
    int remLen = remove.length();
    remove = remove.toLowerCase();
    while (true) {
        remIdx = base.toLowerCase().indexOf(remove);
        if (remIdx == -1)
            break;
        base = base.substring(0, remIdx) + base.substring(remIdx + remLen);
    }
    return base; 
}

I just ran your code in an IDE. It compiles correctly and matches all tests shown on codingbat. There must be some bug with codingbats test cases.

If you are curious, this problem can be solved with a single line of code:

public String withoutString(String base, String remove) {
     return base.replaceAll((?i) + remove, ); //String#replaceAll(String, String) with case insensitive regex.
}

Regex explaination:

The first argument taken by String#replaceAll(String, String) is what is known as a Regular Expression or regex for short.

Regex is a powerful tool to perform pattern matching within Strings. In this case, the regular expression being used is (assuming that remove is equal to IS):

(?i)IS

This particular expression has two parts: (?i) and IS.

IS matches the string IS exactly, nothing more, nothing less.

(?i) is simply a flag to tell the regex engine to ignore case.

With (?i)IS, all of: IS, Is, iS and is will be matched.

As an addition, this is (almost) equivalent to the regular expressions: (IS|Is|iS|is), (I|i)(S|s) and [Ii][Ss].

EDIT

Turns out that your output is not correct and is failing as expected. See: dansalmos answer.

string – Java codingbat help – withoutString

public String withoutString(String base, String remove) {
        String temp = base.replaceAll(remove, );
        String temp2 = temp.replaceAll(remove.toLowerCase(), );
        return temp2.replaceAll(remove.toUpperCase(), );
    }

Related posts