text:
Q: Built in chroot jail RHEL 5 returns No such file or directory I need to create a chroot jail on my RHEL5 production server to allow a specific user to work with the less right possible, but with GIT.
Here is my system configuration :

*

*RHEL 5 : Release 5.10

*OpenSSH : OpenSSH_6.4p1, OpenSSL
  0.9.8e-fips-rhel5 01 Jul 2008

I've created, for testing, a folder /chroot with a subfolder toto where I want to chroot my user.
# ls -la /chroot
total 24
drwxr-xr-x  3 root root 4096 Nov 11 15:22 .
drwxr-xr-x 31 root root 4096 Nov 12 13:02 ..
drwxr-xr-x  5 root root 4096 Nov 11 15:22 toto

# ls -la /chroot/toto
total 40
drwxr-xr-x 5 root root 4096 Nov 11 15:22 .
drwxr-xr-x 3 root root 4096 Nov 11 15:22 ..
drwxr-xr-x 2 root root 4096 Nov 11 15:22 bin
drwxr-xr-x 2 root root 4096 Nov 11 15:22 lib
drwxr-xr-x 5 root root 4096 Nov 11 15:22 usr

I've created a chroot group named chroot_www and added my user toto to it.
I've edited /etc/ssh/sshd_config and added the necessary lines at the end.
#Subsystem      sftp    /usr/libexec/openssh/sftp-server

Subsystem sftp internal-sftp
Match Group chroot_www
#       ForceCommand internal-sftp
        ChrootDirectory /chroot/toto
        AllowTcpForwarding no

But when I want to connect with ssh I get this error :
ssh toto@********
toto@********'s password:
Last login: Thu Nov 14 13:22:35 2013 from ********
Could not chdir to home directory /chroot/toto: No such file or directory
Connection to ******** closed.

but the directory exists, and the rights are good.
And it's strange for two reason :

*

*I've got the same configuration on a RHEL6 server and it's working.

*I can connect with SFTP and I'm chroot jailed in the right folder, but I can't with SSH.

So I'm really interested if you got experience with chroot jail or problem like this one...


text:
Q: Angular CLI add SASS after the project has been created I have an Angular 4 project created using the Angular CLI.
I know that when you are using the Angular CLI you can create a project that uses SASS like this:
ng new ProjectName --style=sass

My question is: "Can I use the Angular CLI to install SASS after a project has been already created without it?"

A: You can set it to style with ng set after installing node-sass
npm install node-sass --save-dev

ng set defaults.styleExt scss

Taken from here: Angular CLI SASS options

A: You can use node-sass, install it by running the following command:
npm install node-sass --save-dev

Then, if you want to use SASS syntax, run:
ng set defaults.styleExt sass

It should do the trick.

A: Using Angular CLI - just do
ng set defaults.styleExt scss

All new components will use SCSS not CSS. Though if you just want to start using SCSS - changing existing .css files to .scss files will work. The relevant compiler is already present batteries included

A: if you want to do it manually you can also do that by changing the angular cli configuration file
in your .angular-cli.json change style css to scss
  "defaults": {
    "styleExt": "scss"
  }

And then install node-scss to compile your scss files
npm install node-sass --save-dev

redpajama_set_name: RedPajamaStackExchange


text:
Q: Add a JLabel on key press I have a simple JFrame that implements a KeyListener. I want to add a label when the user type the letter A. When I do so The label doesn't appear directly. When I resize the frame it appear. But it is not the purpose to resize the frame. I want it to appear directly.
How to add a JLabel on key press?

A: How about calling validate()?
http://docs.oracle.com/javase/7/docs/api/java/awt/Container.html#validate()

A: Sounds like you need to call the repaint() function to make it appear directly.


text:
Q: Is there a way to output just the first element in this if statement, Django template? In my table and in the some record I have lot of link_img, but I want only the first link_img, what can I do ?
I have something like this in my temp
{% for link in sousimg %}

 {% if article.article_img.id == link.img_link.id %}

    {{ link.link_img }}

 {% endif %}

{% endfor %}

A: This type of question is already present so I suggest having a look at it.
django for loop counter break
You have to do a little bit of hit and trial in this case.


text:
Q: Making a capturing regex repeat I have a regex \[\[(.+)\]\]. I use it to capture wikilinks like hey I [[am]] so awesome (captures am). How could I modify this so that hey I [[am]] more [[awesome]] than you think yields both am and awesome, separately? My attempts have yielded single strings like am]] more [[awesome. A little context: I'm using this to write a Ruby IRC bot.
P.S. Wikilinks can also be multi-word, like hey I am much [[more awesome]] than you [[probably think]].

A: You might use a non-greedy version, e.g. \[\[(.+?)\]\] (note the question mark).

A: String's scan operators should work to capture everything the regex you are looking for is /\[\[([^\]])+\]\]/ the [\]]+ being key. that will match through until the first ] and stop.
string.scan( /\[\[([^\]])+\]\]/ );

A: You need to make the .+ non-greedy:
\[\[(.+?)\]\]

See this reference: ruby regexen.


text:
Q: java.lang.NoSuchMethodError Rest Assured exception in play framework Hi I am using play framework 2.4.3 and scala version 2.11
I am using rest assured scala support for testing routes but i am getting
java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V

after researching I found out that Junit causes the problem in rest assured hamcrest matcher
NoSuchMethodError with Hamcrest 1.3 & JUnit 4.11
as I am using play framework I think it comes with Junit by default maybe this was causing the problem
here is the code
import io.restassured.RestAssured._
import io.restassured.RestAssured.when
import io.restassured.module.scala.RestAssuredSupport.AddThenToResponse
import io.restassured.matcher.RestAssuredMatchers._
import org.hamcrest.Matchers._
import org.scalatest._
import org.scalatest.FunSpec
import play.api.libs.json._

describe("user signed up")
  {
    it("user inserted to db after signup")
    {
      val json: JsValue = JsObject(Seq(
       "firstName" -> JsString("alice"),
       "lastName" -> JsString("bob"),
       "email" -> JsString("example@gmail.com"),
       "secondryEmail" -> JsString("example1@gmail.com"),
       "password" -> JsString("a@s**dasda_sds5")
    ))
      given()
      .port(9000)
      .contentType("application/json")
      .body(json.toString())
     .when()
      .post("/direct-user/signup-processing")
     .Then()
       .statusCode(200)
       .body("status", equalTo(200)
           ,"msg", equalTo("Signup Successful"))
    }
  }

}

here is build.sbt file contents
libraryDependencies ++= Seq(filters,
                "io.rest-assured" % "scala-support" % "3.0.6",
                "org.scalatest" %% "scalatest" % "2.2.6" % "test"withSources() withJavadoc(),
                "org.scalatestplus" %% "play" % "1.4.0-M3" % "test",
                "com.esotericsoftware.kryo" % "kryo" % "2.10",
                "org.mongodb" %% "casbah" % "2.8.0",
                "org.slf4j" % "slf4j-api" % "1.6.4",
                "org.elasticsearch" % "elasticsearch" % "1.6.0",
                "com.typesafe.akka" %% "akka-actor" % "2.3.6",
                "com.typesafe.akka" % "akka-testkit_2.11" % "2.3.6",
                "ch.qos.logback" % "logback-core" % "1.0.9",
                "com.github.nscala-time" %% "nscala-time" % "2.0.0",
                "com.hazelcast" % "hazelcast" % "3.5",
                "com.hazelcast" % "hazelcast-client" % "3.5",
                "com.twitter" % "chill-bijection_2.11" % "0.7.0",
                "com.github.slugify" % "slugify" % "2.1.3" ,
                "org.mindrot" % "jbcrypt" % "0.3m",
                "org.codehaus.groovy" % "groovy-all" % "2.4.0",
                "org.apache.lucene" % "lucene-expressions" % "4.10.4",
                "com.restfb" % "restfb" % "1.19.0",
                "org.twitter4j" % "twitter4j-core" % "4.0.0",
                "org.scribe" % "scribe" % "1.3.5",
                "com.google.code.gson" % "gson" % "2.6.2",
                "com.google.oauth-client" % "google-oauth-client" % "1.20.0",
                "com.google.api.client" % "google-api-client-auth-oauth2" % "1.2.0-alpha",
                "com.google.api-client" % "google-api-client" % "1.20.0",
                "com.google.http-client" % "google-http-client-jackson" % "1.20.0",
                "com.google.apis" % "google-api-services-oauth2" % "v2-rev120-1.20.0",
                "com.google.oauth-client" % "google-oauth-client-appengine" % "1.20.0",
                "com.google.oauth-client" % "google-oauth-client-java6" % "1.20.0",
                "com.google.oauth-client" % "google-oauth-client-jetty" % "1.20.0",
                "com.google.oauth-client" % "google-oauth-client-servlet" % "1.20.0",
                "com.google.apis" % "google-api-services-calendar" % "v3-rev120-1.19.1",
                "com.google.inject" % "guice" % "3.0")

and here is the exception log
DirectUserSignUpTest:
[info] user signed up
[info] Exception encountered when attempting to run a suite with class name: endtoendtesting.directusertests.DirectUserSignUpTest *** ABORTED ***
[info]   java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V
[info]   at io.restassured.internal.util.MatcherErrorMessageBuilder.buildError(MatcherErrorMessageBuilder.java:19)
[info]   at io.restassured.internal.util.MatcherErrorMessageBuilder$buildError.call(Unknown Source)
[info]   at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
[info]   at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
[info]   at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
[info]   at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validateStatusCodeAndStatusLine(ResponseSpecificationImpl.groovy:536)
[info]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[info]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[info]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[info]   at java.lang.reflect.Method.invoke(Method.java:498)

please help what is causing the exception

A: Add the dependency to Hamcrest explicitly
libraryDependencies ++= Seq(filters,
    "org.hamcrest" % "hamcrest-core" % "1.3",
    "org.hamcrest" % "hamcrest-library" % "1.3",
    ...


text:
Q: How to get parts of an boolean logical expression/ math expression in sympy? I would like to get all the parts of a boolean logic expression like this (x & y) | (a | b). I would like to get (x & y) and (a | b) as separated functions. I tried to use args, but it delivered me (x & y, a,b). I tried use atoms() but it just delivers me {a, x, y, b}. Even iteration through the args as a list didnt give me the wanting result.
I want to get an expression such as (x & y) | (a | b), separate it into parts to create a truth table showing step by step what (x & y) and (a | b) evaluates in between before showing the final results of the expression.
Thank you

A: I am not aware of any way to create a nested Or, so your expression automatically becomes (x & y | a | b) and that is why you get the args you do. I would just create those two expressions in addition to the desired Or having them as arguments:
o1 = x & y
o2 = a | b
eq = o1 | o2
from sympy.utilities.iterables import *
for i in subsets((True, False), 4, repetition=True):
    for p in multiset_permutations(i):
        reps = dict(zip((x,y,a,b),p))
        print(reps, o1.xreplace(reps), o2.xreplace(reps), eq.xreplace(reps))


text:
Q: jQuery Mobile: Getting ID of previous page I basically need a custom function to be used only when, for example, the #reviews page is clicked on from the home page.
Here is the current code I am using:
$(document).bind("mobileinit", function(){
    $('#reviews').live('pagebeforeshow',function(event){
    var cpage = $.mobile.activePage.attr('id');
        if (cpage == 'home') {
            addPages();
        }
    });
});

The problem is, even though it is using 'pagebeforeshow' it is using the id of the page it is about to transition to as the active page, in this case 'reviews' rather than home, thus causing the if statement to fail.
So my question is, in this example, how would i get the id of the previous page, to make sure it is in fact coming from the #home page?

A: pagebeforeshow event handler actually gets 2 params: event and ui. You can access the previous page from the ui. This is an example from jquery-mobile event docs:
$('div').live('pageshow', function(event, ui){
  alert( 'This page was just hidden: '+ ui.prevPage);
});

Those params are the same for all 4 page show/hide events.

A: To complete the answer: you will get a jQuery object back, so to get the ID of the page do this:
$("#page-id").live('pagebeforeshow', function(event, data) {
    console.log("the previous page was: " + data.prevPage.attr('id'));
});

data.prevPage is getting the previous page as jQuery object,
.attr('id') is getting the id from that jQuery object.


text:
Q: jquery adding a row at the bottom of a table I am adding some rows into my table but right now this row it is going to the top instead of the bottom of the table.
I tried use find("tr:last") but still broken, can someone help on this?  thank you.
http://plnkr.co/edit/YaYihiOAS0C0wsyzUeat?p=preview
css:
  div.addRow {
      line-height: 45px;
      background-color: #fff;
      padding-left: 10px;
      border-bottom: 1px solid;
      border-top: 1px solid #e5e5e5;
    }

html:

        order
        name
        country
        action

          <select id="selectbasic" name="selectbasic" class="form-control">
            <option value="1">option 1</option>
            <option value="2">option 2</option>
            <option value="2">option 3</option>
          </select>

        DVap

          www

jquery:
 $(document).ready(function() {

      var table;

      $("#example").on("mousedown", "td .fa.fa-minus-square", function(e) {
        table.row($(this).closest("tr")).remove().draw();
      })

      $("#example").on('mousedown.edit', "i.fa.fa-pencil-square", function(e) {

        $(this).removeClass().addClass("fa fa-envelope-o");
        var $row = $(this).closest("tr").off("mousedown");
        var $tds = $row.find("td").not(':first').not(':last');

        $.each($tds, function(i, el) {
          var txt = $(this).text();
          $(this).html("").append("<input type='text' value=\"" + txt + "\">");
        });

      });

      $("#example").on('mousedown', "input", function(e) {
        e.stopPropagation();
      });

      $("#example").on('mousedown.save', "i.fa.fa-envelope-o", function(e) {

        $(this).removeClass().addClass("fa fa-pencil-square");
        var $row = $(this).closest("tr");
        var $tds = $row.find("td").not(':first').not(':last');

        $.each($tds, function(i, el) {
          var txt = $(this).find("input").val()
          $(this).html(txt);
        });
      });

      $("#example").on('mousedown', "#selectbasic", function(e) {
        e.stopPropagation();
      });

      var url = 'http://www.json-generator.com/api/json/get/ccTtqmPbkO?indent=2';
      table = $('#example').DataTable({
        ajax: url,
        rowReorder: {
          dataSrc: 'place',
          selector: 'tr'
        },
        columns: [{
          data: 'place'
        }, {
          data: 'name'
        }, {
          data: 'order'
        }, {
          data: 'delete'
        }]
      });

      $('#example').css('border-bottom', 'none');
      $('
<button id="addRow">Add New Row</button>
').insertAfter('#example');

      // add row
      $('#addRow').click(function() {
        //t.row.add( [1,2,3] ).draw();
        var rowHtml = $("#newRow").find("tr")[0].outerHTML
        console.log(rowHtml);
        table.row.add($(rowHtml)).draw();
      });
    });

A: According to DataTables documentation, the position of added row is determined by ordering and filtering applied to the table.

The rows that are added are subjected to the ordering and search criteria that are applied to the table, which will determine the new row's position and visibility in the table.

You can assign specific ordering to DataTable:
table = $('#example').DataTable({
    ...,
    order: [[ 0, "desc" ]],
    ...

Here is example with changed ordering.

A: Use this instead:
$('#example').DataTable({
  bSort: false,
  ...
  ..
});

If you set bSort parameter into false, the newly appended row will be placed at the bottom. This is because when adding a row, it will refer on which sorting criteria your table is currently in (either 'Asc' or 'Desc').
If you want to keep the sorting functionality, just set the default sorting into descending, by adding the option order.
$("#example").DataTable({
  "order": [[ 0, "desc" ]],
  ...
  ..
})

A: You can use append instead add
$('#example').find( 'tbody' ).append( rowHtml).draw();

http://plnkr.co/edit/KQnOWCDGLI8MzKFfEnAS?p=preview


text:
Q: SQLite3 with Ruby, Cannot Search Resulting Array (iterates over array as if it were one giant element) I've been trying to find an answer for a little while now, and I'm not sure if I'm asking the wrong questions, but I've had no luck so far.
I have an array generated from querying an SQLite table. I also have an array of times generated from a csv file. I am trying to pull the time[0] (an id number) and check if it exists in the array from the SQL table
array = []
SQLite3::Database.new("t.db") do |db|
    db.execute ("SELECT t FROM ts") do |row|
        array << row
    end
end

times = CSV.read('times1.csv')

times.each do |time|
    #puts "This is the trip id: #{time[0]}"
    if array.include? time[0]
        puts time[0]
        end
end

When I do this, I get no results. I know for a fact that there should be a few matches. When I try to iterate over the array like:
array.each do |row|
    if row = 2345
         puts "Match found"
    end
end

Here is the strange part that has really stumped me. I know that 2345 only comes up once or twice in the array, however when I run this code, it seems as though it prints "Match found" for every element (like 5,000 times it says "Match found"). I feel like something is wrong with the array generated from the SQLite but I can't for the life of me figure it out.
Any ideas? Thanks.

A: In here:
db.execute ("SELECT t FROM ts") do |row|

your row is an array whose sole element is the t you're after. That means that you end up with an array-of-arrays in array rather than an array of numbers and of course your array.include? time[0] check fails because array only contains other arrays.
You probably want to say:
array << row[0]

to collect the t values in array.


text:
Q: Understanding Loss Functions I was following this pytorch tutorial on how to setup a neural network, but I don't understand the loss function, loss = (y_pred - y).pow(2).sum().item(). Why is this being used rather than the derivative of the function used to calculate the predicted y value? I also don't understand what that function returns.

A: That function is the euclidean L2-norm. It returns the sum of the squared errors between network output and expected output.
As for the derivative of the function, or better its gradient, it it computed internally by the deep learning framework you are using (here pytorch I assume) and is needed to update the network parameter. For most use cases, you do not need to think at it. Its computation is totally automatic.
One note: if you call .item() on a tensor, you are extracting its raw value, i.e. what you get is no more a tensor but just a number. This means that you cannot compute the gradient from it (call .backward()).


text:
Q: How can I prevent overlapping in a family tree generator? I'm creating an interactive family tree creator, unlike more simpler versions which are simple pedigree charts/trees.
The requirements for mine (based on familyecho.com) are:

*

*multiple partners vs just a simple 2 parent to 1 child that you normally see.

*multiple siblings

*partners dont necessarily need to have children

*there doesn't always have to be a parent "pair", there can just be a single father/mother

The problem I'm encountering is: I'm generating the offsets based on the "current" node/family member and when I go past the first generation with say, 2 parents, it overlaps.
Example of the overlap as well as partner not being drawn on the same X axis:

Here is the actual app and main js file where I'm having the issue. And here is a simplified jsfiddle I created that demonstrates the parent/offset issue though I really have to solve overlapping for this in general, in addition to making sure partners are drawn on the same x axis as other partners.
How can I go about solving this and possible future overlapping conflicts? Do I need some sort of redraw function that detects collisions and adjusts the offsets of each block upon detecting? I'm trying to make it seamless so there's a limited amount of redrawing done.
An example of calculating offset relative to the "context" or current node:
var offset = getCurrentNodeOffset();

                        if ( relationship == RELATIONSHIPS.PARTNER ) {
                            var t = offset.top; // same level
                            var l = offset.left + ( blockWidth + 25 );
                        } else {
                            var t = offset.top - (blockHeight + 123 ); // higher
                            var l = offset.left - ( blockWidth - 25 );
                        }

A: Since you are already using Family Echo, I'd suggest you look at how they develop their online family tree diagram, since they seem to have solved your problem.
When I enter your sample diagram into Family Echo, I can build a nice looking tree that seems to be what you are looking for with no cross over.

Although they are creating their diagrams with html and css, you can add the people to their diagrams one by one and then inspect where the boxes are being placed in terms of the left and top pixel locations of each element.

If I had more expertise in JavaScript, I would have tried building up some code to replicate some of what Family Echo is doing, but I'm afraid that's not my mojo.

A: you'll have to adjust all the branches off the node that you affect, each branch will have to recalculate the position of its nodes, and each node will have to be recalculated locally reaching the leaves.You calculated once the leaves are going to have to recalculate all the way to backing up, all that recursively. It's like a real tree, when you add physically branch to trunk ... the other branches move alone to leave some space, all sheets are automatically reset, so you have to imagine. And simulate this process in your diagram. Processes each branch reaches each leaf, and recalculates up to recompute the modified node neighbors. (one level above you started) That is not easy or single job to do.

A: I'm going to give a complicated answer, and that's because this situation is more complicated than you seem aware of. Graph layout algorithms are an active field of research. It's easy to attempt a simpler-than-general algorithm and then have it fail in spectacular ways when you make unwarranted, and usually hidden, assumptions.
In general, genetic inheritance graphs are not planar (see Planar Graphs on Wikipedia). Although uncommon, it certainly happens that all the ancestral relationships are not filled by unique people. This happens, for example, when second cousins have children.
Another non-planar situation can occur in the situation of children from non-monogamous parents. The very simplest example is two men and two women, each pairing with children (thus at least four). You can't lay out even the four parent pairs in one rank without curved lines.
These are only examples. I'm sure you'll discover more as you work on your algorithm. The real lesson here is to explicitly model the class of relationship your algorithm is able to lay out and to have verification code in the algorithm to detect when the data doesn't meet these requirements.
The question you are actually asking, though, is far more basic. You're having basic difficulties because you need to be using a depth-first traversal of the graph. This is the (easiest) full version of what it means to lay out "from the top down" (in one of the comments). This is only one of many algorithms for tree traversal.
You're laying out a directed graph with (at least) implicit notion of rank. The subject is rank 0; parents are rank 1; grandparents at rank 2. (Apropos the warnings above, ranking is not always unique.) Most of the area of such graphs is in the ancestry. If you don't lay out the leaf nodes first, you don't have any hope of succeeding. The idea is that you lay out nodes with the highest rank first, progressively incorporating lower-ranked nodes. Depth-first traversal is the most common way of doing this.
I would treat this as a graph-rewriting algorithm. The basic data structure is a hybrid of rendered subgraphs and the underlying ancestry graph. A rendered subgraph is a (1) a subtree of the whole graph with (1a) a set of progeny, all of whose ancestors are rendered and (2) a collection of rendering data: positions of nodes and lines, etc.  The initial state of the hybrid is the whole graph and has no rendered subgraphs. The final state is a rendered whole graph. Each step of the algorithm converts some set of elements at the leaf boundary of the hybrid graph into a (larger) rendered subgraph, reducing the number of elements in the hybrid. At the end there's only one element, the render graph as a whole.


text:
Q: Highest eigenvalues/vectors of graph laplacian In page 8 of the paper Laplacian Eigenmaps for dimensionality reduction and Data Representation it reads:

Standard methods show that the solution is provided by the matrix of
  eigenvectors corresponding to the lowest eigenvalues of the
  generalized eigenvalue problem...

Can anyone explain why in this representation the "lowest eigenvalues" correspond to eigen-vectors which capture more information on the manifold? This is counter-intuitive to what happens in standard eigen-methods such as PCA.
I would also love an intuitive explanation to the isoperimetric/geometric properties of the high eigenvectors/eigenvalues, since these appear to be easier to compute for the problem I am facing (A large, sparse graph).
Any help is appreciated,
thanks!


text:
Q: Blazor client authentication login against the User table in a SQL Server database (I know this bad practise, but it is just a test) In my appsettings.json I have set up the server login, works just fine.
I would like to change the login form, from email / password to user / password and authenticate from the users in a SQL Server database, but I can't find anything in my pages folder that looks remotely like the login form? Can anybody point me in the right direction?

*

*Question #1: where is the login form to be found?

*Question #2: get the login form to authenticate with the users in the SQL Server database?

A:
Question #1: where is the login form to be found?

When you scaffold the Indentity UI you can select from a range of pages.
Server Project: Add | New Scaffolded Item | Identity

Question #2: get the login form to authenticate with the users in the SQL Server database?

The login page already uses 'UserName' to login. The switch should be made on the Register page where UserName is set to the EmailAddress by default.
The scaffolded items contain the C# code, edit away.


text:
Q: Resolving yacc conflicts - rules useless in parser due to conflicts I am working on a yacc file to parse a given file and convert it to an equivalent c++ file. I have created the following grammar based on the provided syntax diagrams:
program:    PROGRAMnumber id 'is' comp_stmt
            ;

comp_stmt:    BEGINnumber statement symbol ENDnumber
              ;

statement:    statement SEMInumber statement
              | id EQnumber expression
              | PRINTnumber expression
              | declaration
              ;

declaration:    VARnumber id
                ;

expression:    term
               ;

term:    term as_op term
         | MINUSnumber term
         | factor
         ;

factor:    factor md_op factor
           | ICONSTnumber
           | id
           | RPARENnumber expression LPARENnumber
           ;

as_op:    PLUSnumber
          | MINUSnumber
          ;

md_op:    TIMESnumber
          | DIVnumber
          ;

symbol:    SEMInumber
           | COMMAnumber
           ;

id:    IDnumber
       | id symbol id
       ;

The only issue I have remaining is that I am receiving this error when trying to compile with yacc.
conflicts: 14 shift/reduce
calc.y:103.17-111.41: warning: rule useless in parser due to conflicts: declaration: VARnumber id

I have resolved the only other conflict I have encountered, but I am not sure what the resolution for this conflict is. The line it should match is of the format
var a, b, c, d;

or
var a;

A: All of your productions intended to derive lists are ambiguous and therefore generate reduce/reduce conflicts. For example:
 id: id symbol id

Will be clearly ambiguous when there are three identifiers: are the first two to be reduced first, or the last two? The usual list idiom is left-recursion:
id_list: id | id_list `,` id

For most languages, that would not be correct for statements, which are terminated with semi-colons, not separated by them, but that model would work for a comma-separated list of identifiers, or for a left-associative sequence of addition operators.
For statements, you probably want something more like:
statement_list: | statement_list statement ';'

Speaking of symbol, do you really believe that , and ; have the same syntactic function? That seems unlikely, since you write var a, b, c, d; and not, for example, var a; b, c; d,.
The "useless rule" warning produced by bison is exactly because your grammar allows ids to be separated with semicolons. When the parser sees "var" ID with ; as lookahead, it first reduces ID to id and then needs to decide whether to reduce var id to declaration or to shift the ; in order to later reduce it to symbol and then proceed with the reduction of id symbol id. In the absence of precedence rules, bison always resolves shift/reduce conflicts in favour of shifting, so that is what it does in this case. But the result is that it is never possible to reduce "var" id to declaration, making the production useless as the result of a shift-reduce conflict resolution, which is more or less what the warning says.


text:
Q: EF Required to Optional Relationship not using the right columns for FK I already read many questions, but still couldn't find a solution to my problem.
I am trying to have something like this I drawed very quickly

First Try:
public class CarMap : EntityTypeConfiguration<Car>
    {
        public CarMap()
        {
            ToTable("Cars", Constants.Schema);
            Property(t => t.EngineId);

            HasRequired(x => x.SPropertyPolicyInsurance).WithMany().HasForeignKey(x => x.SPropertyPolicyInsuranceId);
        }
    }

public class Car : MyBase
    {
        public int EngineId { get; set; }
        public virtual Engine Engine { get; set; }
    }

public class EngineMap : EntityTypeConfiguration<Engine>
    {
        public EngineMap()
        {
            ToTable("Engines", Constants.Schema);

            Property(t => t.MyField1).HasColumnType("nvarchar").HasMaxLength(128).IsRequired();
            Property(t => t.MyField2).HasColumnType("nvarchar").HasMaxLength(128).IsRequired();
            Property(t => t.MyField3).HasColumnType("bit").IsRequired();
        }
    }

public class Engine : MyBase
    {
        public string MyField1 { get; set; }
        public string MyField2 { get; set; }
        public bool MyField3 { get; set; }

        public virtual Car Car { get; set; }
    }

Using this solution it creates a new column on my Engine table that I don't want...
Second Try:
Changing the CarMap to the following code:
public class CarMap : EntityTypeConfiguration<Car>
    {
        public CarMap()
        {
            ToTable("Cars", Constants.Schema);
            Property(t => t.EngineId);

            HasRequired(x => x.Engine).WithOptional(p => p.Car);
        }
    }

The problem is that it doesn't use the column EngineId to store my FK key values...
Thank you very much for your help anyway...

A: Never mind, it's working now, I cleaned up all my code, deleted extra relationships that were maybe conflicting and now using the following Fluent API relationship it's working properly using only one Column for FK (EngineId).
The resulting code first migrations are the following:
CreateTable(
     "myschema.Engines",
       c => new
       {
          Id = c.Int(nullable: false),
          myfield = c.String(nullable: false, maxLength: 128),
          myfield2 = c.String(nullable: false, maxLength: 128),
          myfield3 = c.Boolean(nullable: false),
       })
  .PrimaryKey(t => t.Id)
  .ForeignKey("basechema.Engines", t => t.Id)
  .Index(t => t.Id);

CreateTable(
     "myschema.Cars",
        c => new
        {
            Id = c.Int(nullable: false),
            EngineId = c.Int(nullable: false),
        })
   .PrimaryKey(t => t.Id)
   .ForeignKey("baseschema.Cars", t => t.Id)
   .ForeignKey("myschema.Engines", t => t.EngineId)
   .Index(t => t.Id)
   .Index(t => t.EngineId);

I hope it helps someone out there ;)


text:
Q: Can I use latexmk -C for cleaning up only, and compile with another tool? Can I compile my document with other tools and use latexmk -C only for cleaning up?
One application could be to use it then in the clean: section of a Makefile that uses pdflatex for make pdf.

A: Yes, you can use latexmk -C (or -c) just to clean up auxiliary files. By default, -c cleans up the following files types:
@generated_exts = ( 'aux', 'bcf', 'fls', 'idx', 'ind', 'lof', 'lot',
                'out', 'toc' );

(latexmk.pl, l. 1088f)
-C also cleans up the actual output, i.e pdf, dvi, or what have you. If you want to add more file extensions to this list, have a look at https://tex.stackexchange.com/a/83386/4012.
latexmk -C / -c can be run no matter how you initially compiled your document, and may very well be used only for cleanup.


text:
Q: Unable to find an entry point named 'NetSecurityNative_ImportPrincipalName' in shared library 'System.Net.Security.Native' I am running sql server on Mac using docker and it is talking to my .net core application. I am running specflow tests which connects to the specified database, creates the required schema and then run the tests. I get the following exception when I run these tests on Mac but it works fine on a windows machine. Are there any libraries missing in .net core?
My connection string looks like this: public static string ConnectionString = @"Server=localhost:1433; Database=csn_product; User=sa; Password=****;";
MultipleActiveResultSets = true; Trusted_Connection=False; Integrated_Security=False

I have also tried the above parameters in connection string but nothing worked.
Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server MyServer. ---> System.Data.SqlClient.SqlException: Unable to find an entry point named 'NetSecurityNative_ImportPrincipalName' in shared library 'System.Net.Security.Native'.
   at Interop.NetSecurityNative.ImportPrincipalName(Status& minorStatus, String inputName, Int32 inputNameByteCount, SafeGssNameHandle& outputName)
   at Microsoft.Win32.SafeHandles.SafeGssNameHandle.CreatePrincipal(String name)
   at System.Net.Security.SafeDeleteNegoContext..ctor(SafeFreeNegoCredentials credential, String targetName)
   at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags)
   at System.Net.Security.NegotiateStreamPal.InitializeSecurityContext(SafeFreeCredentials credentialsHandle, SafeDeleteContext& securityContext, String spn, ContextFlagsPal requestedContextFlags, SecurityBuffer[] inSecurityBufferArray, SecurityBuffer outSecurityBuffer, ContextFlagsPal& contextFlags)
   at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName)
   at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer)
   at System.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
  at at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
  at at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
  at at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
  at at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
  at at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
  at at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
  at at System.Data.SqlClient.SqlConnection.Open()
  at at Microsoft.SqlServer.Management.Common.ConnectionManager.InternalConnect()
  at at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()


text:
Q: Data not displaying in EditText fields ( Android using php and json for mysql db ) EDIT: edited to make the question clearer
The app I created Can display all data in a class using listview. When I click one of the results, EditEmpresaActivity is called but no data is displayed in the EditText fields.
EditEmpresaActivity class which should handle the displaying of the data
package com.example.androidhivetest;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class EditEmpresaActivity extends Activity {

    EditText txtMarca;
    EditText txtInvestimento;
    EditText txtMarcaTotal;
    Button btnSave;
    Button btnDelete;

    String eid;

    // Progress Dialog
    private ProgressDialog pDialog;

    // JSON parser class
    JSONParser jsonParser = new JSONParser();

    // single product url
    private static final String url_product_details = "http://192.168.1.90/android_connect/get_product_details.php";

    // url to update product
    private static final String url_update_product = "http://192.168.1.90/android_connect/update_product.php";

    // url to delete product
    private static final String url_delete_product = "http://192.168.1.90/android_connect/delete_product.php";

    // JSON Node names
    private static final String TAG_SUCCESS = "success";
    private static final String TAG_PRODUCT = "product";
    private static final String TAG_EID = "eid";
    private static final String TAG_MARCA = "marca";
    private static final String TAG_INVESTIMENTO = "investimento";
    private static final String TAG_MARCATOTAL = "marcatotal";

    String sMarca, sInvestimento, sMarcaTotal; // edit1

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.edit_empresa);

        // save button
        btnSave = (Button) findViewById(R.id.btnSave);
        btnDelete = (Button) findViewById(R.id.btnDelete);

        // getting product details from intent
        Intent i = getIntent();

        // getting product id (eid) from intent
        eid = i.getStringExtra(TAG_EID);

        // Getting complete product details in background thread
        new GetEmpresaDetails().execute();

        // save button click event
        btnSave.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // starting background task to update product
                new SaveEmpresaDetails().execute();
            }
        });

        // Delete button click event
        btnDelete.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // deleting product in background thread
                new DeleteEmpresa().execute();
            }
        });

    }

    /**
     * Background Async Task to Get complete product details
     * */
    class GetEmpresaDetails extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread Show Progress Dialog
         * */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(EditEmpresaActivity.this);
            pDialog.setMessage("Loading empresa details. Please wait...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(true);
            pDialog.show();
        }

        /**
         * Getting product details in background thread
         * */
        protected String doInBackground(String... params) {

            // updating UI from Background Thread
            Thread th = new Thread(new Runnable() {
            //runOnUiThread(new Runnable() {
                public void run() {
                    // Check for success tag
                    int success;
                    try {
                        // Building Parameters
                        List<NameValuePair> params = new ArrayList<NameValuePair>();
                        params.add(new BasicNameValuePair("eid", eid));

                        // getting product details by making HTTP request
                        // Note that product details url will use GET request
                        JSONObject json = jsonParser.makeHttpRequest( url_product_details, "GET", params);

                        // check your log for json response
                        Log.d("Single Product Details", json.toString());

                        // json success tag
                        success = json.getInt(TAG_SUCCESS);
                        if (success == 1) {
                            // successfully received product details
                            JSONArray productObj = json
                                    .getJSONArray(TAG_PRODUCT); // JSON Array

                            // get first product object from JSON Array
                            JSONObject product = productObj.getJSONObject(0);

                            // product with this eid found
                            // Edit Text
                            txtMarca = (EditText) findViewById(R.id.inputMarca);
                            txtInvestimento = (EditText) findViewById(R.id.inputInvestimento);
                            txtMarcaTotal = (EditText) findViewById(R.id.inputMarcaTotal);

                            // display product data in EditText
                            txtMarca.setText(product.getString(TAG_MARCA));
                            txtInvestimento.setText(product.getString(TAG_INVESTIMENTO));
                            txtMarcaTotal.setText(product.getString(TAG_MARCATOTAL));

                        }else{
                            // product with eid not found
                        }
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            });

            return null;
        }

        /**
         * After completing background task Dismiss the progress dialog
         * **/
        protected void onPostExecute(String file_url) {
            // dismiss the dialog once got all details
            pDialog.dismiss();
        }
    }

    /**
     * Background Async Task to  Save product Details
     * */
    class SaveEmpresaDetails extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread Show Progress Dialog
         * */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(EditEmpresaActivity.this);
            pDialog.setMessage("Saving empresa ...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(true);
            pDialog.show();
        }

        /**
         * Saving empresa
         * */
        protected String doInBackground(String... args) {

            // getting updated data from EditTexts
            String marca = txtMarca.getText().toString();
            String investimento = txtInvestimento.getText().toString();
            String marcatotal = txtMarcaTotal.getText().toString();

            // Building Parameters
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            params.add(new BasicNameValuePair(TAG_EID, eid));
            params.add(new BasicNameValuePair(TAG_MARCA, marca));
            params.add(new BasicNameValuePair(TAG_INVESTIMENTO, investimento));
            params.add(new BasicNameValuePair(TAG_MARCATOTAL, marcatotal));

            // sending modified data through http request
            // Notice that update product url accepts POST method
            JSONObject json = jsonParser.makeHttpRequest(url_update_product,
                    "POST", params);

            // check json success tag
            try {
                int success = json.getInt(TAG_SUCCESS);

                if (success == 1) {
                    // successfully updated
                    Intent i = getIntent();
                    // send result code 100 to notify about product update
                    setResult(100, i);
                    finish();
                } else {
                    // failed to update product
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        /**
         * After completing background task Dismiss the progress dialog
         * **/
        protected void onPostExecute(String file_url) {
            // dismiss the dialog once empresa uupdated
            pDialog.dismiss();
        }
    }

    /*****************************************************************
     * Background Async Task to Delete Empresa
     * */
    class DeleteEmpresa extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread Show Progress Dialog
         * */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(EditEmpresaActivity.this);
            pDialog.setMessage("Deleting Empresa...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(true);
            pDialog.show();
        }

        /**
         * Deleting product
         * */
        protected String doInBackground(String... args) {

            // Check for success tag
            int success;
            try {
                // Building Parameters
                List<NameValuePair> params = new ArrayList<NameValuePair>();
                params.add(new BasicNameValuePair("eid", eid));

                // getting product details by making HTTP request
                JSONObject json = jsonParser.makeHttpRequest(
                        url_delete_product, "POST", params);

                // check your log for json response
                Log.d("Delete Empresa", json.toString());

                // json success tag
                success = json.getInt(TAG_SUCCESS);
                if (success == 1) {
                    // product successfully deleted
                    // notify previous activity by sending code 100
                    Intent i = getIntent();
                    // send result code 100 to notify about product deletion
                    setResult(100, i);
                    finish();
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        /**
         * After completing background task Dismiss the progress dialog
         * **/
        protected void onPostExecute(String file_url) {
            // dismiss the dialog once product deleted
            pDialog.dismiss();

        }

    }
}

JSONParser class:
package com.example.androidhivetest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

public class JSONParser {

    static InputStream is = null;
    static JSONObject jObj = null;
    static String json = "";

    // constructor
    public JSONParser() {

    }

    // function get json from url
    // by making HTTP POST or GET mehtod
    public JSONObject makeHttpRequest(String url, String method,
                                      List<NameValuePair> params) {

        // Making HTTP request
        try {

            // check for request method
            if(method == "POST"){
                // request method is POST
                // defaultHttpClient
                DefaultHttpClient httpClient = new DefaultHttpClient();
                HttpPost httpPost = new HttpPost(url);
                httpPost.setEntity(new UrlEncodedFormEntity(params));

                HttpResponse httpResponse = httpClient.execute(httpPost);
                HttpEntity httpEntity = httpResponse.getEntity();
                is = httpEntity.getContent();

            }else if(method == "GET"){
                // request method is GET
                DefaultHttpClient httpClient = new DefaultHttpClient();
                String paramString = URLEncodedUtils.format(params, "utf-8");
                url += "?" + paramString;
                HttpGet httpGet = new HttpGet(url);

                HttpResponse httpResponse = httpClient.execute(httpGet);
                HttpEntity httpEntity = httpResponse.getEntity();
                is = httpEntity.getContent();
            }

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    is, "iso-8859-1"), 8);
            StringBuilder sb = new StringBuilder();
            String line = null;
            while ((line = reader.readLine()) != null) {
                sb.append(line + "\n");
            }
            is.close();
            json = sb.toString();
        } catch (Exception e) {
            Log.e("Buffer Error", "Error converting result " + e.toString());
        }

        // try parse the string to a JSON object
        try {
            jObj = new JSONObject(json);
        } catch (JSONException e) {
            Log.e("JSON Parser", "Error parsing data " + e.toString());
        }
// return JSON String
        return jObj;

    }
}

A: Solved by not using a specific query to display details and instead pass the values from ALL results activity to the details activity

A: check your PHP file.i think the json node name not defined properly.


text:
Q: How to list files given path with poorly escaped Windows separator I'm attempting to do this:
Dir["c:\temp\*.*"]

but that is failing.  I understand why, but I seem to lack the Ruby prowess to work around it.
I am given the path in a variable and otherwise have no control over it.  Nor do I know the contents ahead of time.
Is there a way to make Dir function with double quoted strings that are poorly escaped? Alternatively, how does one take a variable with the apparent contents
"c:\temp\*.*"

and convert it into
'c:/temp/*.*'

This problem at the core seems to be how to potentially escape a string that should have been escaped but now is not.
The end result is I am not able to use the given string to do this as conceptually simple as puts() or Dir[].
If given 'c:\temp\*.*' then I have no problem.  I can fix that:
foo = 'c:\temp\*.*'.gsub('\\', '/')

If given "c:\\\\temp\\\\*.*" then I have no problem.  I can fix that:
foo = "c:\\temp\\*.*".gsub("\\", "/")

However, I am passed neither of those, but rather "c:\\temp\\*.*".  This string contains a TAB and a second undefined escape. It is this that I can't fix in a general way.
Even if I knew the contents ahead of time I am stumped on how to properly escape and transform this.  I should add that I am not a ruby programmer at the moment so maybe there is some simple method to deal with this that I am not aware of.
I tried a bunch of stuff like:
"c:\temp\*.*".gsub("\t", "/t")

which gets me part of the way, but since the actual contents of the string are not known to me ahead of time this is a little wonky.  Further, if the escape character is not valid as in \\* then I am also in a jam. So this also fails:
"c:\temp\*.*".gsub("\t", "/t").gsub("\*", "/*")

A:
Is there a way to make Dir function with double quoted strings that are poorly escaped?

No.
Garbage in, garbage out. There is no Rumpelstiltskin routine that returns gold when given trash.
Ruby auto-converts forward-slashes in filenames/paths to reverse-slashes when running on Windows. Simply make it a habit of using forward, *nix-style, slashes and you'll be fine.
From the IO documentation:

Ruby will convert pathnames between different operating system conventions if possible. For instance, on a Windows system the filename "/gumby/ruby/test.rb" will be opened as "\gumby\ruby\test.rb". When specifying a Windows-style filename in a Ruby string, remember to escape the backslashes:

"c:\\gumby\\ruby\\test.rb"

I don't have "c:\temp" I have "c:\temp" as input

In a properly defined Windows path you should see:
'c:' + '\temp' + '\*.*' # => "c:\\temp\\*.*"

Note that the single-quotes are treating "\t" as an escaped-escape + "t". Your source for the variable is creating the string improperly by using double-quotes:
'c:' + "\temp" + "\*.*" # => "c:\temp*.*"

If you have "\t", you have a TAB character. It's possible to change it to an escaped-T using:
"c:\temp" # => "c:\temp"
"c:\temp"[2] # => "\t"
"c:\temp"[2].ord # => 9

'\t' # => "\\t"

"c:\temp".sub("\t", '\t') # => "c:\\temp"

The next problem is what to do when you have a String containing "*" to convert it to "\*". There's no way to search for "\*" because that's the same as "*" as seen above:
"\*.*" # => "*.*"

But, since "*.*" is a fairly specific "anything" wildcard, maybe simply searching for and replacing that pattern would work:
"c:\temp\*.*".gsub('*.*', '\\*.*') # => "c:\temp\\*.*"

or:
"c:\temp\*.*".gsub('*.*', '/*.*') # => "c:\temp/*.*"

Back to dealing with "\t" and putting it all together... I'd start with:
"c:\temp\*.*".gsub("\t", '\t').gsub('*.*', '/*.*') # => "c:\\temp/*.*"
"c:\temp\*.*".gsub("\t", '/t').gsub('*.*', '/*.*') # => "c:/temp/*.*"

You'll have to figure out what to do if you have something like:
c:/dir/file*.*

where they mean they want all files starting with file. Since you're seeing ambiguous inputs it seems the input routine needs to be more rigorous to not allow reversed-slashes.


text:
Q: mount: mounting /dev on /root/dev failed: No such file or directory after converting lxc to virtual machine I've been trying to convert an lxc container to a virtual machine, but I've encountered a problem when trying to boot. I end up with the (initramfs) command line and I've got the following errors:
mount: mounting /dev on /root/dev failed: No such file or directory

mount: mounting /run on /root/run failed: No such file or directory
run-init: opening console: No such file or directory

Target filesystem
doesn't have requested /sbin/init.

run-init: opening console: No such
file or directory (repeated a few times)

No init found. Try passing init= bootarg

BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash) Enter
'help' for a list of built-in commands.
(initramfs)

From the live cd ubuntu 16.04:
blkid
/dev/sda1: UUID="3e671c97-7695-49e7-8c83-4527c94d8f14" TYPE="ext4" PARTUUID="406cef0c-01"
/dev/sda2: UUID="c555438a-fd29-4cad-a8cf-fe92c3b78e0b" TYPE="ext4" PARTUUID="406cef0c-02"
/dev/sr0: UUID="2018-07-31-01-12-13-00" LABEL="Ubuntu 16.04.5 LTS amd64" TYPE="iso9660" PTUUID="6be2cd0d" PTTYPE="dos

 cat /etc/fstab:

 UUID="3e671c97-7695-49e7-8c83-4527c94d8f14"    /boot   ext4    defaults,noatime0   0 UUID="c555438a-fd29-4cad-a8cf-fe92c3b78e0b"   /   ext4    defaults,noatime0   1
 UUID="688b6a9b-0f30-450c-b8d6-1316c0d17798"    none    swap    defaults    00

Relevant parts of /boot/grub/grub.cfg:
set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ];
then
 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2
 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  c555438a-fd29-4cad-a8cf-fe92c3b78e0belse   search --no-floppy
 --fs-uuid --set=root c555438a-fd29-4cad-a8cf-fe92c3b78e0b fi

and:
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu
 --class os $menuentry_id_option 'gnulinux-simple-c555438a-fd29-4cad-a8cf-fe92c3b78e0b' {
        recordfail
         load_video
         gfxmode $linux_gfx_mode
         insmod gzio
         if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
         insmod part_msdos
         insmod ext2
         set root='hd0,msdos1'
         if [ x$feature_platform_search_hint = xy ]; then
           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  3e671c97-7695-49e7-8c83-4527c94d8f14
         else
           search --no-floppy --fs-uuid --set=root 3e671c97-7695-49e7-8c83-4527c94d8f14
         fi
         linux   /vmlinuz-4.15.0-30-generic root=UUID=3e671c97-7695-49e7-8c83-4527c94d8f14 ro  quiet splash
 $vt_handoff initrd  /initrd.img-4.15.0-30-generic }

I changed the uuid for the linux /vmlinuz-4.15.0-30-generic so that it matches /dev/sda1 and not /dev/sda2. The grub-installer placed the UUID of /dev/sda2, where the root partition is, and I'm not sure why.
Any ideas as to how to solve this problem?

A: I finally realised what the actual problem was after solving the grub issue. The blank screen was related to how the consoles (tty) were identified. Each time the blank screen appeared after the grub menu, the operating system would actually boot fine, but it didn't show anything. But whenever I pressed ctrl+alt F1 or F2, the prompt would show up and everything was actually fine. To solve this issue, I replaced this line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
with GRUB_CMDLINE_LINUX_DEFAULT="text"
Works just fine now and the boot process is also displayed on the screen.


text:
Q: How to display only the filename in a JavaFX TreeView? So i have figured out how to get all the files and directories and add them to the treeview but it shows me the complete file path: C/user/file.txt i just want the file or folder name and not the path.
The code to create the list is as follows:
private TreeItem<File> buildFileSys(File dir, TreeItem<File> parent){
    TreeItem<File> root = new TreeItem<>(dir);
    root.setExpanded(false);
    File[] files = dir.listFiles();
    for (File file : files) {
        if (file.isDirectory()) {
            buildFileSys(file,root);
        } else {
            root.getChildren().add(new TreeItem<>(file));
        }

    }
    if(parent==null){
        return root;
    } else {
        parent.getChildren().add(root);
    }
    return null;
}

I then take the returned TreeItem and do treeview.setroot(treeItem< File> obj);
Any help would be greatly appreciated.

A: Use a custom cellFactory to determine, how the items are shown in the TreeView:
treeView.setCellFactory(new Callback<TreeView<File>, TreeCell<File>>() {

    public TreeCell<File> call(TreeView<File> tv) {
        return new TreeCell<File>() {

            @Override
            protected void updateItem(File item, boolean empty) {
                super.updateItem(item, empty);

                setText((empty || item == null) ? "" : item.getName());
            }

        };
    }
});


text:
Q: What security settings in IE prevent running autoit form submit macros? I'm trying to automate logging in to Amazon Web Services with autoit on a fairly hardened windows machine.  I can run a script as admin on the box and it works just fine, but when I go in as a user under the "hardened" rules (hardened by installing Cyberark PSM software).
I had to modify the Group Policy just to allow javascript to not redirect to the default AWS landing page.  My autoit script is putting the Username and Password in, but it's not successfully clicking the Sign In link under this user (although the return value from calling click in the autoit script says it worked). This autoit script works on my PC and it works on that Server if I'm logged in as administrator, just not as the locked down user.
$uname=$TargetUsername
$pwd=$TargetPassword
_IEFormElementSetValue ($oQuery1, $uname)
_IEFormElementSetValue ($oQuery2, $pwd)

_IEAction ($oButton, "click")

_IELoadWait($oIE,0)

I've tried using formSubmit too and that had the same results. I have also tried to call the oauth javascript method directly, but I'm not sure what that is and the things I tried with autoit have not worked.


text:
Q: Does for-await-of wait for the current iteration to complete before going to the next? Given a loop like:
for await(let line of readFileLineByLine('./long-file.txt')) {
    const interestingFacts = await processLine(line);
}

Where readFileLineByLine returns an AsyncGenerator, will this start processing the 2nd line before or after await processLine returns? (assuming the 2nd line is ready before processLine completes)
And if not, how would one parallelize this? (so that many lines can be processed simultaneously)

A: The next iteration will only start after the last iteration completes. This can be easily shown by awaiting inside the for loop:

const asyncIterable = {
  [Symbol.asyncIterator]() {
    return {
      i: 0,
      next() {
        if (this.i < 3) {
          return Promise.resolve({ value: this.i++, done: false });
        }

        return Promise.resolve({ done: true });
      }
    };
  }
};

const delay = ms => new Promise(resolve => setTimeout(resolve, ms));

(async function() {
   for await (let num of asyncIterable) {
     console.log('start ' + num);
     await delay(1000);
     console.log('end ' + num);
   }
})();

To parallelize, you can call a function (but don't wait for it to resolve) and push the (new) Promise to an array, then call Promise.all on the array:

const asyncIterable = {
  [Symbol.asyncIterator]() {
    return {
      i: 0,
      next() {
        if (this.i < 3) {
          return Promise.resolve({ value: this.i++, done: false });
        }

        return Promise.resolve({ done: true });
      }
    };
  }
};

const processNum = num => new Promise(resolve => setTimeout(resolve, 1000));

(async function() {
   console.log('start');
   const proms = [];
   for await (let num of asyncIterable) {
     proms.push(processNum(num));
   }
   await Promise.all(proms);
   console.log('all done (1000ms)');
})();

(because the number of items returned by the iterable isn't known in advance, something cleaner-looking like .map isn't possible, unfortunately)

A: Your for await loop is a syntactic sugar for the following:
let generator = readFileLineByLine();

while (true) {
    let promise = generator.next();
    let item = await promise;

    if (item.done)
        break;

    let line = item.value;
    await processLine(line)

}

So the answer is yes, readLine(nextLine) won't start until processLine(previousLine) completes.
If you want two functions not to depend on each other, one option would be to make readFileLineByLine non-async, that is, just yield pending promises. Consume this generator normally, attach then(processLine) to each promise and await them all:
let promises = [];

for (let promise of readFileLineByLinePending())
    promises.push(promise.then(processLine))

await Promise.all(promises)

Here's a demo:

async function delay(n) {
    return new Promise(res => setTimeout(res, n))
}

async function processLine(s) {
    console.log('process BEGIN:', s)
    await delay(300);
    console.log('process END:', s)
}

async function* readFileLineByLine() {
    for (let i = 0; i < 6; i++) {
        console.log('read BEGIN', i)
        await delay(500);
        let t = await 'line' + i;
        console.log('read END', i)
        yield t;

    }
}

function* readFileLineByLinePending() {
    for (let i = 0; i < 6; i++) {
        console.log('readPending BEGIN', i)
        let t = delay(500).then(() => {
            console.log('readPending END', i);
            return 'line' + i;
        });
        yield t;

    }
}

async function main() {

    console.time('async gen')

    for await(let line of readFileLineByLine())
       await processLine(line)

    console.log('----------------------------------------')
    console.timeEnd('async gen')
    console.log('----------------------------------------')

    console.time('sync gen')

    let promises = [];

    for (let promise of readFileLineByLinePending())
        promises.push(promise.then(processLine))

    await Promise.all(promises)

    console.log('----------------------------------------')
    console.timeEnd('sync gen')
    console.log('----------------------------------------')
}

main().then(() => console.log('done'))
.as-console-wrapper {max-height:100% !important; top:0;}


text:
Q: Git push fails for large number of commits Similar to:
Github remote push pack size exceeded
Failure message:
Pushing efb55fab0352e4fff42129d00b642e908e9d09c1...
Counting objects: 617706, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (368204/368204), done.
Writing objects:  36% (222375/617706), 1.79 GiB | 278.60 MiB/s

remote: fatal: pack exceeds maximum allowed size
error: RPC failed; curl 55 Failed sending data to the peer
fatal: The remote end hung up unexpectedly
Writing objects: 100% (617706/617706), 4.37 GiB | 185.36 MiB/s, done.
Total 617706 (delta 218614), reused 617467 (delta 218375)
fatal: The remote end hung up unexpectedly
Everything up-to-date
Counting objects: 617709, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (368206/368206), done.
Writing objects:  36% (222376/617709), 1.83 GiB | 392.11 MiB/s

Context:

*

*Working on a fork  of kiwi (https://github.com/kiwibrowser/src)

*Created a script from answer https://stackoverflow.com/a/51468389/1079483

*Added token to url for convenience:
$ git remote set-url origin https://:@github.com/path/to/repo.git

*Ran push; after a few hours the above error was thrown?

A: On GitHub.com the size limit is 100MB
https://docs.github.com/en/github/managing-large-files/working-with-large-files/conditions-for-large-files
If you have Github Enterprise Server you can change the size limit if you have the permissions to do so.
https://docs.github.com/en/enterprise-server@3.1/github/managing-large-files/working-with-large-files/conditions-for-large-files
If some of these files are binary files, you could use Git LFS?


text:
Q: file exists but will not load? I have added a resource (blue folder) to my resource bundle and all seems well even to the point where I use NSFileManger to determine if the files exists and if it does to print out the full path used in the check which it does like so:
NSString *p = [NSString stringWithFormat:@"%@/words/001",
   [[NSBundle mainBundle] resourcePath]];

NSFileManager *fm = [NSFileManager defaultManager];

NSString *a = [p stringByAppendingPathComponent:@"001-1.png"];

UIImage *i;

if ([fm fileExistsAtPath:a]) {

  NSLog(@"file found ... %@", a);

  i = [UIImage imageWithContentsOfFile:a];
}
else {

  NSLog(@"doh!");
}

[iv setImage:i];

I get this output from the file exists check
/Users/phh/Library/Application Support/iPhone Simulator/4.2/Applications/3DAB4772-7251-4E39-8EA8-4AFE32DFB61A/MyApp.app/words/001/001-1.png
but the UIImage is always nil?  I just cant see what is going on here....
Help....?
Thanks

A: The return value for imageWithContentsOfFile: is

A new image object for the specified
  file, or nil if the method could not
  initialize the image from the
  specified file.

Are you certain that the file at that location is a valid image file?

A: Try this out while passing on the image to i
 i = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"001-1.png" ofType:@"png" inDirectory:@"word/001"];

hAPPY cODING...


text:
Q: XPath evaluation with Saxon doesn't work for nodename Why doesn't the following xpath return any results with Saxon 9.6 in Java?
//field
The strange part is I also evaluated //* and looped over the results comparing the nodeNames with "field" and got 889 hits for my document.
Full codeexample below:
Initializing and running the test:
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(file);

test(doc, "//*");
test(doc, "//field");

Test execution code:
private void test(Document doc, String xpathString) throws Exception {
    System.setProperty("javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON, "net.sf.saxon.xpath.XPathFactoryImpl");
    XPathFactory xpf;
    xpf = XPathFactory.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);

    XPath xpath = xpf.newXPath();

    XPathExpression expr = xpath.compile(xpathString);

    Object result = expr.evaluate(doc, XPathConstants.NODESET);
    NodeList nodes = (NodeList) result;

    int fieldHits = 0;
    for (int i = 0; i < nodes.getLength(); i++) {
        Node node = nodes.item(i);
        String name = node.getNodeName();
        fieldHits = "field".equals(nodes.item(i).getNodeName()) ? fieldHits + 1 : fieldHits;
    }

    System.out.println("#hits total: " + nodes.getLength());
    System.out.println("#hits 'field': " + fieldHits);
}

Output:
#hits total: 26256
#hits 'field': 889
#hits total: 0
#hits 'field': 0

Example XML-File (thanks to wero I now know it has something to do with namespaces):
<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesignerES_V9.0.1.0.20091206.1.615263" APIVersion="3.2.9310.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2015-11-17T07:12:49Z" uuid="262c190c-1563-4ae8-ae6e-4c8d59494a3c">
<template xmlns:xliff="urn:oasis:names:tc:xliff:document:1.1" xmlns="http://www.xfa.org/schema/xfa-template/2.8/">
    <field name="A"></field>
    <field name="B"></field>
    <field name="C"></field>
    <field name="D"></field>
    <field name="E"></field>
    <field name="F"></field>
</template>
</xdp:xdp>

A: The most likely explanation is that your field elements have a non-null namespace uri and therefore aren't matched by your XPath expression.
EDIT:
As I guessed your document declares the default namespace
xmlns="http://www.xfa.org/schema/xfa-template/2.8/"

and so the template and field elements are in that namespace.
To match the field elements you either need to tweak your XPath query to also declare that namespace or search for the local name only.

A: Note that if you were to use the s9api interface instead of JAXP, you could take advantage of the ability in XPath 2.0 to set a default namespace for element names in the XPath expression. Your code would then look like this:
private void test(Document doc, String xpathString) throws Exception {
    Processor proc = new Processor(false);
    XdmNode docNode = proc.newDocumentBuilder().wrap(doc);
    XPathCompiler xpath = proc.newXPathCompiler();
    xpath.declareNamespace("", "http://www.xfa.org/schema/xfa-template/2.8/");
    XdmValue result = xpath.evaluate(xpathString, docNode);
    int fieldHits = 0;
    for (XdmItem item : result) {
        String name = ((XdmNode)node).getNodeName().getLocalName();
        fieldHits = "field".equals(name) ? fieldHits + 1 : fieldHits;
    }

    System.out.println("#hits total: " + nodes.getLength());
    System.out.println("#hits 'field': " + fieldHits);
}


text:
Q: Implementing Exception Handling ArrayIndexOutOfBoundsException Java This is a homework problem.
Here is an example of a maze I am solving:
6 6
5 0 5 5 5 5
5 0 0 0 0 5
5 5 0 5 0 5
5 5 0 5 5 5
5 0 0 0 0 0
5 5 5 5 5 5
4 5
EDIT: There is no error in my program. My professor wants me to find the maze exit by catching the ArrayIndexoutOfBoundsException
I was tasked with writing a program to read a file and put all of the numbers into a 2D array. I am given the starting point and was told to write a program that navigates its way through the maze by adding coordinates onto a stack.
It moves to one coordinate in the array and checks coordinates in a clockwise direction to see if there is a potential move.
I have the program working smoothly and outputting correctly.
However, today in class, my professor said that we must catch the ArrayIndexOutOfBoundsException in our program.
I originally just created a method to check if the coordinates I want to look at exist and are inside the array.
My question is is there an easy way to implement exception handling into the code I already have?
I don't have any experience handling exceptions and everything I see when I research is used just to print out a string saying that there was an error.
Thanks for the help in advance!
import java.io.File;
import java.util.*;
import java.util.Scanner;
import stackpackage.*;
public class mazeDriver {

public static void main(String[] args)
{
    File inputFile = new File("maze1.txt");
    Scanner in = new Scanner(inputFile);
    int rows = getRows(in);
    int columns = getColumns(in);
    int[][]maze = createMaze(in, rows, columns);
    int sRow = getSRow(in);
    int sColumn = getSColumn(in);
    Coordinate start = new Coordinate(sRow, sColumn);
    in.close();
    GoodStack stack = new GoodStack();
    GoodStack answerStack = mazeRunner(start, maze, stack, columns, rows);
    coursePrint(answerStack);
}
public static int getRows(Scanner in){
    int rows = in.nextInt();
    return rows;
}
public static int getColumns(Scanner in){
    int columns = in.nextInt();
    return columns;
}
public static int[][] createMaze(Scanner in, int rows, int columns){
    int[][]maze = new int[rows][columns];
    int rowAccumulator = 0;
    int columnAccumulator = 0;
    for(int i = 0; i <= (rows*columns)-1; i++){
        int value = in.nextInt();
        maze[rowAccumulator][columnAccumulator] = value;
        if (columnAccumulator == columns - 1){
            columnAccumulator = 0;
            rowAccumulator += 1;
        }
        else{
            columnAccumulator += 1;
            }
        }
        return maze;
        }
public static int getSRow(Scanner in){
    int sRow = in.nextInt();
    return sRow;
    }
public static int getSColumn(Scanner in){
    int sColumn = in.nextInt();
    return sColumn;
    }

/*
This method is what searches through the maze in a clockwise direction.
@param The starting point coordinates, the 2d array of the maze, the empty             stack, and the maze size
@return The stack of coordinates to navigate the maze
**/
public static GoodStack mazeRunner(Coordinate startingPoint, int[][]array,      GoodStack stack, int columns, int rows){
    array[startingPoint.getRow()][startingPoint.getColumn()] = 1; // Sets   the starting coordinate to 1
    stack.push(startingPoint); // Adds the point to the stack
    boolean finish = false; // Sets the value to false until the maze is   finished
    int skipFirst = 0; // this is a counter I used so that it does not exit on it's first run

while(finish ==  false){ // Create a loop to run until the maze has been finished
    if(inBounds(startingPoint.getRow()-1, startingPoint.getColumn(), rows, columns)){ // checks if the array location is in the array
        if (array[startingPoint.getRow()-1][startingPoint.getColumn()] == 0){ // checks if the value of that location is 0.
            Coordinate location = new Coordinate(startingPoint.getRow()-1 , startingPoint.getColumn()); // creates a coordinate instance of the location
            stack.push(location);// pushes the location onto the stack
            array[startingPoint.getRow()-1][startingPoint.getColumn()] = 1; // sets the array value to 1 for that location
            startingPoint = location; // makes the location the next search point
            skipFirst +=1; // adds to the counter
            continue;}} // skips the rest of the loop and moves on to the next iteration
    // The next three if statements have the same effect as the last one, the only difference being it checks in the other three directions
    if(inBounds(startingPoint.getRow(),startingPoint.getColumn() + 1, rows, columns)){
        if(array[startingPoint.getRow()][startingPoint.getColumn()+1] == 0){
            Coordinate location = new Coordinate(startingPoint.getRow(), startingPoint.getColumn()+ 1);
            stack.push(location);
            array[startingPoint.getRow()][startingPoint.getColumn() + 1] = 1;
            startingPoint = location;
            skipFirst +=1;
            continue;}}

    if(inBounds(startingPoint.getRow()+1, startingPoint.getColumn(), rows, columns)){
        if(array[startingPoint.getRow()+1][startingPoint.getColumn()] == 0){
            Coordinate location = new Coordinate(startingPoint.getRow()+1, startingPoint.getColumn());
            stack.push(location);
            array[startingPoint.getRow()+1][startingPoint.getColumn()] = 1;
            startingPoint = location;
            skipFirst +=1;
            continue;}}

    if(inBounds(startingPoint.getRow(),startingPoint.getColumn()-1, rows, columns)){
        if(array[startingPoint.getRow()][startingPoint.getColumn()-1] == 0){
            Coordinate location = new Coordinate(startingPoint.getRow(), startingPoint.getColumn()-1);
            stack.push(location);
            array[startingPoint.getRow()][startingPoint.getColumn()-1] = 1;
            startingPoint = location;
            skipFirst +=1;
            continue;}}
    if(mazeExit(startingPoint.getRow(), startingPoint.getColumn(), rows, columns)){ // Checks to see if there is a potential exit
        if(skipFirst>2){ // This makes sure that it does not exit the maze from the entry
            finish = true; // Sets the boolean to true to stop the while loop
            return stack;}} // And returns the stack of coordinates
     // This  code happens only if it does not find any 0's to travel to
    array[startingPoint.getRow()][startingPoint.getColumn()] = 1; // sets the space it is on to 1
    stack.pop(); // removes the space from the stack
    Coordinate nextStart = (Coordinate)stack.peek(); // takes the top coordinate off of the stack
    startingPoint = nextStart; // sets the top coordinate to the starting search point
}

return stack;
}

/*
This method checks the coordinates that are about to be check to see if they are inside the array
@param The row and column that is being checked and the size of the array
@return boolean value
**/
public static boolean inBounds(int row, int column, int arrayRow, int  arrayColumn){
    boolean result = false;
    if (row <= arrayRow -1 && row >= 0 && column <= arrayColumn-1 && column  >= 0){ // checks to see if the coordinate is in the array
    result = true;}
    return result;
 }
 /*
This method is what searches through the maze in a clockwise direction.
@param The starting point coordinates, the 2d array of the maze, the empty  stack, and the maze size
@return The stack of coordinates to navigate the maze
**/
public static boolean mazeExit(int row, int column, int arrayRow, int    arrayColumn){
    boolean result = false;
    // This method checks all four directions to see if there is a potential  exit
    if(row == arrayRow-1){
        result = true;}
    if(column == arrayColumn-1){
        result = true;}
    if(row == 0){
        result = true;}
    if(column == 0){
        result = true;}

    return result;}
/*
This method reverses the order of the coordinates and prints it out.
@param The stack of coordinates
**/
public static void coursePrint(GoodStack stack){
    List<Coordinate> list = new ArrayList<Coordinate>(); // Creates an empty  arraylist
    while(stack.isEmpty() == false){
        Coordinate myObject = (Coordinate)stack.pop(); // takes the top    coordinate from the array
        list.add(myObject); // and adds it into the array list
    }
        Collections.reverse(list); // Reverses the order of the arraylist
    for(Coordinate i:list){
        System.out.println(i);} // Prints out every coordinate in the array list
}

}

A: If you really must end program with catching exception even though your program works correctly (which i think is stupid, but ok), then you could do something like this:
if you check for exit only if the location is out of bounds(mazeExit method), then you could just add to your stack locations that point to outside of bounds and replace
if(mazeExit(startingPoint.getRow(), startingPoint.getColumn(), rows, columns)){ // Checks to see if there is a potential exit
        if(skipFirst>2){ // This makes sure that it does not exit the maze from the entry
            finish = true; // Sets the boolean to true to stop the while loop
            return stack;}} // And returns the stack of coordinates
     // This  code happens only if it does not find any 0's to travel to
    array[startingPoint.getRow()][startingPoint.getColumn()] = 1; // sets the      space it is on to 1

with
try{
     // This  code happens only if it does not find any 0's to travel to
    array[startingPoint.getRow()][startingPoint.getColumn()] = 1; // sets the space it is on to 1
} catch(ArrayIndexOutOfBoundsException  e) {
    // Checks to see if there is a potential exit
    if (skipFirst>2) { // This makes sure that it does not exit the maze from the entry
        finish = true; // Sets the boolean to true to stop the while loop
        return stack;
    } // And returns the stack of coordinates
}

What this will do is when you get to a location that is outside bounds, then this will trigger Exception because of array[startingPoint.getRow()][startingPoint.getColumn()] and then it will execute catch block. But be careful with having an if in your catch, because if your if code won't execute, then you need to be aware that you won't set value in array to 1 and you won't exit the program, so watch out what happens next.
But again, it is usually not a good practice to force catching exceptions if you don't have, if you don't have a good reason to.