text:
Q: Programming with a group of people I've never met I've been assigned a group project from my AP computer science class, and I am required to work with three other people. I've never talked to them before, I have no idea their skill level, and all I have is their email address. The assignment, summed up, is this:
"As a team you will complete a minimum of three Modules to a Class...."
I going to try and become "Team captain" because none of them have attempted to contact each other but I am curious: how to go about this? I've emailed them and asked them if there are any methods of communication they prefer over emailing each other, but once we actually start the project I'll have to figure out who is doing what.
What should I do? How do I "take charge" and lead three people that I've never met?
Here is an excerpt of the actual assignment:

Therefore you will need to discuss the various roles each team member
  will take in this project early in the week.  You can communicate via
  Pronto (or Blackboard IM), email, a wiki, a google group, blog or any
  other method that you see fit. If a group member does not engage the
  group by the end of week let your instructor know and they will
  provide additional guidance.
  ...
  Also due at the end of a project will be a team evaluation in which you will rate each team members contribution to the completion of this project along with a suggested grade.

Edit: Many people suggested that I meet them in a coffee shop, or something like that. Only problem is, all of us are in different states. I also figured out one of them isn't allowed to use Facebook/Skype/twitter, so I have to resort to messaging them over yahoo messenger and emails.

A: The leader of this project will be the person who steps up and takes charge at the beginning.
This applies to most things in life - not just software development. When everybody else is running around like chickens with no heads, the person who thinks things through, steps forward and says, "This is what we're going to do and this how we're going to do it." is usually the person looked to as the leader for the rest of the project. Bear in mind that by doing this you are taking responsibility for the ultimate success or failure of the project.
You want to lead this project? Here's a couple of things you can start doing right away to make a big impact.

*

*Use a project management tool like Trello and send invites to everybody and start assigning parts of the project out to people.

*Generate a bug database and start adding tasks and bugs - again, just start assigning.

*Set up a version control repository and check in a good initial chunk of code that everyone can work from. Refuse to deal with any other form of code control.

*Offer to help people get going with development by showing them how to use the version control system and bug database.

*Send out weekly emails detailing the status of the project and the progress of the previous week.

None of these steps are particularly hard, or time consuming, but they will be huge time savers down the road. Furthermore, it will get your team talking to each other, and get them used to seeing you in charge.

A: First thing to do in cases like this is to establish an issue tracker and learn how to use it.
For a more fundamental introduction on how to handle development like you describe, my favorite reference goes for Martin Fowler's article Using an Agile Software Process with Offshore Development. This article outlines basics and advanced concepts of setting up distributed team communication:

Use Continuous Integration to Avoid Integration Headaches
Have Each Site Send Ambassadors to the Other Sites
Use Contact Visits to build trust
Don't Underestimate the Culture Change
Use wikis to contain common information
Use Test Scripts to Help Understand the Requirements
Use Regular Builds to Get Feedback on Functionality
Use Regular Short Status Meetings
Use Short Iterations
Use an Iteration Planning Meeting that's Tailored for Remote Sites
When Moving a Code Base, Bug Fixing Makes a Good Start
Separate teams by functionality not activity
Expect to need more documents.
Get multiple communication modes working early

For your project you sure won't be able to follow all the tips and tricks mentioned there (eg there likely be no Ambassadors nor Contact Visits for you :) but it is worth studying anyway.

*

*For many teams having all of above would be an overkill for sure. Still, I find it really helpful to have a comprehensive checklist like that - so that even skipped items are checked and have clearly documented reasons for rejection - just to make sure nothing important was missed.

A: You haven't told us how much time you have for this, or the language you're working in (I would say a single class is very small, but perhaps in your language it's a good deal more).
First of all, have a working product at any cost.
If the project lasts two weeks or less, assume you will be the only one doing anything and be very happy about any help you get.  Try to schedule things for everyone, but make sure that if nobody does anything, you'll still have a working product.  Even if someone does something, don't rely on them continuing: be prepared for anyone to drop out at any point.
If you have more than one week, consider scheduling a day of the week when the product should be marked as a milestone and stick to that as much as possible.  Make sure you have something you can kick around and check the deficiencies of: if worst comes to worst, this will be what you hand in.  Each one you create, you will see how much you could improve things, which will motivate you to go on.  Don't plan too far forwards: sure, you need to have an idea of what you'll end up with, but keep your most specific plans short-term.
Notice that those two overlap a little: this is intentional, as two weeks is in my opinion a bit of a grey area where getting two iterations done is hard, but only working in one iteration is risky.
I'm assuming the worst case, where you'll be working with people very new to programming.  My general advice would be:

*

*Keep a list of features you want to implement soon, and who will work on them.  Jarrod suggested Trello, and I entirely support that: if your teammates aren't very experienced, it'll help a lot.  You could try keeping the bugs there, too.

*In a team of four, you need version control.  It may make others more reluctant to contribute if they don't know how to work it, but it's worth it.

*Any external dependencies may scare away newbies.  If you write unit tests, tell people that they shouldn't worry about breaking them.  Tell people that they shouldn't worry about breaking the build, especially at first.  It's much harder to correct people who don't commit any code than those who commit buggy code.

*Check whether things suggested here really apply to you.  "Continuous integration" is a fancy term -- for a small program, that might mean "this program runs and all features can be used".  Do you even have sites?  Does splitting into teams help you?

*YAGNI, a hundred times over.  If you really have to, write things in advance for features you'll be making yourself.  Make it work, then refactor, or you won't get around to making it work.

*Refactor.  Once it's working, spend some time fixing it.  Don't forget your teammates will have to read your code, too: a day spent fixing ugly pieces and replacing simple solutions with better-performing ones is not a day wasted.

*Keep an eye on all parts.  Skimming changelogs and occasionally reading others' code helps make sure that everything is up to the quality standards you feel you should enforce and makes sure it isn't as hard to dive in if the person drops out.

*Don't hesitate to work on the most important thing, as opposed to your designated thing.  If someone is falling behind schedule, make a written note of that somewhere and do it yourself.  Ask them first, but go ahead if they don't answer, or if you ask once or twice and then feel like they still won't do it.

*Focus on making something you're proud of.  Even if it deviates from the assignment.  Even if you have to cut big features in favour of making what you have more smooth.  Every iteration think "Am I proud of this?", and in the next iteration, try to fix those things.

I had a project that failed horribly recently; you can read my thoughts on why it failed if you want to, but this summarises how I'd do something like this if I had another chance to.

A: Jarrod Nettles's answer is good.  I would add this:

*

*Expect that at least one of the other three people will be completely useless.

*Just accept that you will feel like you are doing most (or all) of the work, but everyone will get equal credit.  Any attempt at trying to make things "fair" will only cause unnecessary conflict and slow you down.

*Stay in contact with any team members who are good.  Such people are hard to find, and you will want to work with them again.

A: I have been in a similar position a few times as I am sure have a lot of people. The main thing though is to do your best to keep everyone content and happy, so I think it is good that you want to take on the task of team leader, however like someone mentioned above - this does need to be approached carefully as someone else may feel they should do the job instead.
I know you said that no one has taken it upon themselves to contact each other but sometimes these situations can be difficult for people, like you said you are working with people you have never met and it can be difficult to communicate etc.
I would begin with an email just addressing everyone and letting them know who you are how you feel the project should be addressed and make it known that you want to lead the project taking responsibility for setting roles, goal, deadlines, communication time, meetups (if wanted/desired) and project updates.
Although you can not completely influence other people you can keep track of who is doing what and who is not. Delegating jobs allows the work to be split up evenly or appropriately to people with different skill sets or levels.
This way if certain work is not being done you can take it upon yourself to divide the work between the people who are actually keen to work on it. This way you wont end up with a failed project at the end and you will have records of trying to communicate dates, times and all the relevant information you can show at the end if things go wrong. ALl things which keep you in the right if some people dont pull their weight.
In terms of tips:
I personally love a collaborative working environment found here: https://docs.google.com/
This allows you to share word documents, spreadsheets etc. It is a great way of collaboratively working. I cant stress how useful this is sometimes. I use it with some people I work with who aren't in the country at the moment.
Hope this helped someone, there are so many aspects of leading a project we could go on forever but it just depends on so many things. At least this is a tiny bit to help.

A: Jarrod Nettles' answer pretty much summarises a lot what I was going to suggest, so I'll throw in some of what worked in my recent experiences in a similar situation.
I would suggest finding some way to talk with them vocally, rather than by email. If you're not in the same area, get them all on Skype. If you're in the area, meet them at a coffee shop or something. Speaking in person in initial meetings will lead to you actually making decisions and getting work done then and there; email threads allow those who're shy or often not at their computer to hold up the process - we all know how lazy students can be!
In your first meeting, I would try to get to know your group over trying to get on with the project - but don't ignore the project! 10 or 20 minutes spent ice breaking is probably enough amongst 4 people.
When it comes to talking about the project, I would suggest running through what you think the project involves. I think it's important you make it clear this is your understanding, and not a case of you telling them exactly what to do. Everybody should be able to throw their thoughts and ideas in to the ring if they have any, and you should come away from that initial meeting with a decent enough understanding of what you, as a group, feel the project entails.
In future (regular) meetings, you can start to look at different bits of the project in more detail; look at what needs doing exactly, what resources and how much time will be needed and who can do what. Split the piece up further if necessary. Perhaps try set some soft deadlines?

A:
Do any of you have experience with working with a group of people you've never met online, and you don't get to meet them in person but must complete a project together?

Add in underbudgeting, ridiculous deadlines and getting sold down the river by marketing and this sounds like roughly 65% of software development projects in the real world.
You'd probably be best served by getting folks to volunteer for parts they would be interested in doing rather than taking charge unilaterally and assigning tasks. They are all probably sitting there thinking about how they should take charge. Or how they can get some poor sod who cares too much to do all the group work so they can ride on his grade.


text:
Q: VueJS: How to force recompile of
A: I see you are already using JQuery, so the easiest solution is to use the dynamic jQuery.fn.on way to register the event handler. That handler will recognize the elements you add dynamically. Read more here

redpajama_set_name: RedPajamaStackExchange


text:
Q: sqlite optimal update after an alter table add I have a process where at some point I got to add a new column to a table of type INTEGER, then I got to populate this new column with an UPDATE. I do this in C.
I can lean down my code to
CREATE table t (a integer, b integer)
populate t
CREATE INDEX t_ndx on t (a)
ALTER TABLE t add c integer

The C pseudo code to update the column 'c' look like this
sqlite3_stmt u;
sqlite3_prepare_v2(db, "update t set c=? where a=?, -1, &u, 0);
for(i=0;i<n;i++)
{ c=c_a[i];
  a=a_a[i];
  sqlite3_bind_int64(u, 1, c);
  sqlite3_bind_int64(u, 1, a);
  sqlite3_step(u);
}

The order of a's are the same for this UPDATE as the one given when t was created.
I'd like to know if the sqlite3 engine detect the 'sequential' access and do speed up  the "where a=?" (i.e keep a kind of caching of previous cursor ?
I'd like to know as well if there are 'hidden' feature like binding array's (at least when dealing witn INTEGERs) to avoid construct such a loop and avoid all those bindings and avoid the bytecode for doing all those insert something along the line of
sqlite3_stmt u;
sqlite3_prepare_v2(db, "update t set c=? where a=?, -1, &u, 0);
sqlite3_bind_int64_array(u, 1, c_a, n);
sqlite3_bind_int64_array(u, 1, a_a, n);
sqlite3_step_array(u,n);

Thanx in advance
Cheers
Phi

A: Your code already is pretty much optimal. Searching for the row by a needs a single index lookup and a single table row lookup; both will be fast because the needed pages are likely to be already cached.
You could speed up the lookup on a by making this column the INTEGER PRIMARY KEY, but this makes sense only if a actually is the primary key.
In theory, it would be possible to update multiple rows at once:
UPDATE t
SET c = CASE a
        WHEN :a1 THEN :c1
        WHEN :a2 THEN :c2
        WHEN :a2 THEN :c3
        END
WHERE a IN (:a1, :a2, :a3);

But for many a values, this is likely to be implemented as a scan over the table, so it would make sense only if you could fit all values into the query, which is not possible for a large table.


text:
Q: Uncaught TypeError: Cannot set property 'innerHTML' of nulll Im getting a error menioned above to not use innerHTML please help with this.Getting error in js file.
Its just a basic counter im trying to make......
index.html

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

Counter

(..)

      <button class="counter-minus">-</button>
      <button class="counter-plus">+</button>

Script.js
 let counterDisplayElem = document.querySelector('.counter-display');
    let counterMinusElem = document.querySelector('.counter-minus');
    let counterPlusElem = document.querySelector('.counter-plus');
    let count = 0;

    updateDisplay();

    counterPlusElem.addEventListener("click", () => {
        count++;
        updateDisplay();
    });

    counterMinusElem.addEventListener("click", () => {
        count--;
        updateDisplay();
    });

    function updateDisplay() {
        counterDisplayElem.innerHTML = count;
    };

A: Put your code in a window's load event handler, then your code will run when your DOM has been loaded and document.querySelector('.counter-display'); can access to the h1 element.
Try this:

A: Javascript can't find the elements since the script runs before the DOM is loaded.
You should put your code inside of a function and run it through the body onload.

function loaded() {
  let counterDisplayElem = document.querySelector('.counter-display');
  let counterMinusElem = document.querySelector('.counter-minus');
  let counterPlusElem = document.querySelector('.counter-plus');
  let count = 0;

  updateDisplay();

  counterPlusElem.addEventListener("click", () => {
    count++;
    updateDisplay();
  });

  counterMinusElem.addEventListener("click", () => {
    count--;
    updateDisplay();
  });

  function updateDisplay() {
    counterDisplayElem.innerHTML = count;
  };
}

Counter

(..)

    <button class="counter-minus">-</button>
    <button class="counter-plus">+</button>

Another option would be to put the script tag at the end of your  rather than inside of

A: Your querySelector functions are probably not finding the HTML elements because they are running before the elements are created.
To prevent this without the use of jQuery you should surround your JS code with this:
document.addEventListener("DOMContentLoaded", function(event) {
  //do work
});

It's supported by 99 % of browsers.


text:
Q: XML Transform FileNotFoundException I'm creating a game using LibGDX and I want to create a XML file so I can save some configuration settings.
I want the file to be inside the assets folder, inside another directory (assets/xml/ajustes.xml)
If I execute the game as a Desktop Application it works OK, if the XML directory doesn't exist it is created and after that the XML file is created inside it. The problem comes when I execute the game in my Android device. I get an exception:
javax.xml.transform.TransformerException: java.io.FileNotFoundException: /xml/datos.xml (No such file or directory)

I cannot figure out where the problem is ...
This is what I wrote:
public static final String localizacionXML = "xml/datos.xml";

...

try {

        //THE xml DIRECTORY SHOULD BE CREATED HERE
        File dir = new File("xml");
        dir.mkdirs();

        File f = new File(localizacionXML);

        DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = docFactory.newDocumentBuilder();

        //IF XML ALREADY EXISTS
        if(f.exists() && !f.isDirectory()) {
            ...
        }else{
            DocumentBuilderFactory docFactory =
            DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();

            Document doc = docBuilder.newDocument();

            ...

            TransformerFactory transformerFactory =
            TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            DOMSource source = new DOMSource(doc);
            StreamResult result = new StreamResult(new
                File(localizacionXML).getAbsolutePath());

            //EXCEPTION HERE
            transformer.transform(source, result);
        }
}catch (Exception e){
    e.printStackTrace();
}

A: To get access to files in the assets folder by using a relative path you had to use Gdx.files.internal(RELATIVE_PATH_TO_ASSETS)
By using this method you get a FileHandle, which holds the file you want to use.
Click here to visit the wiki page of file handling in libGDX.

A: To save user data you might want to use Preferences instead.
You can save and load user preferences super easily
https://github.com/libgdx/libgdx/wiki/Preferences
It will manage the XML file for you
That said, more generically speaking, to load a file you use Gdx.files.internal(RELATIVE_PATH_TO_ASSETS)


text:
Q: How to open Wordpress server using Selenium, Python My Wordpress website can be accessed by typing localhost/wordpress in the browser. So I thought if I pass that inside driver.get() in Selenium, I'll be able to access it. But it didn't turn out the way I wanted it to and got an error.
What should I try for this?

A: Though manually when you pass localhost/wordpress in the url bar you are able to access the My Wordpress website but while passing through get() you have to pass the fully qualified url_string. Else you will face InvalidArgumentException

Solution
You need to pass localhost/wordpress as the url: str through get()as an argument as follows:
driver.get("https://localhost/wordpress")

References
You can find a couple of relevant detailed discussions in:

*

*Trying to access an internal page from browser which doesn't have a url format ex: chrome://settings


text:
Q: Explicitly stating a type in list comprehension that uses List.zip I have got the following list comprehension
member this.a l1 =
        let res = [for x, y in List.zip l1 this.l2 do if y > 0 then yield (x |> double)/(y |> double) else yield 0.]

and I get the error

The type '(float -> float)' does not support the 'comparison'
  constraint. For example, it does not support the 'System.IComparable'
  interface
This expression was expected to have type     float -> float     but
  here has type     int

at the y > 0 expression.
Is there a way to instruct the compiler, that x and y is a certain type, or that the l1 and l2 are of the same type?
EDIT:
What I actually have is a inside a class, updated to reflect that fact.

A: Whenever you create a named value, you can specify the type like so: y:int.  For example: [for y:int in 1..10 -> y].
As noted in the comments, I don't think that will resolve your issue, but it will probably help you narrow down what bit of your source is to blame.  A likely culprit is your definition of l2.  I'm guessing you are defining it using a function taking multiple parameters, but failed to supply sufficient parameters resulting in a function of type float->float instead of just a float.


text:
Q: Styling Select Drop down box I have a HTML Select drop down box, which I have styled, the problem I am having is that I can not seem to style the background color of the options.    Below is a link to a demo as you can see the drop down options has a white background, which i am trying to change.
http://cssdeck.com/labs/lnroxrua
Here is my HTML Code:
<div class="select-div">
    <select name="pagination">

      <option value="10" selected="selected">10</option>
      <option value="20">20</option>
      <option value="30">30</option>
      <option value="40">40</option>
      <option value="50">50</option>
    </select>
    </div>

CSS Styling
  select{
    background:transparent;
    width: 170px;
    padding: 2px;
    font-family:Arial, Helvetica, sans-serif;
    font-size:11px;
    font-weight:600;
    color:#fff;
    line-height: 1;
    border: 0;
    border-radius: 0;
    height: 22px;
    -webkit-appearance: none;

    }

    .select-div{
width: 170px;
height: 22px;
overflow: hidden;
background: url(arrowhead.png) no-repeat right #363636;
border-top:#575757 1px solid;
-webkit-border-radius: 4px 4px 4px 4px;
 -moz-border-radius: 4px 4px 4px 4px;
      border-radius: 4px 4px 4px 4px;
-webkit-box-shadow: inset 0 2px 4px rgba(107, 105, 105, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
 -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
      -moz-box-shadow:    0px 8px 3px -9px #000000;
      -webkit-box-shadow: 0px 8px 3px -9px #000000;
      box-shadow:         0px 8px 3px -9px #000000;
   }

Thanks

A: Here's a DEMO.
Just add this CSS rule:
select > option {
   background: color;
}

For example:
select > option {
   background: pink; /* Or an hexadecimal value */
}

Cheers,
Leo!

A: Unfortunately, webkit browsers do not support styling of  tags yet.
check:
How to style a select tag's option element?


text:
Q: Express in Nodejs Permission denied when entering DEBUG=app ./bin/www I changed the name of 'my-application' to just 'app' but now when i enter the DEBUG command i get an error in the terminal:
i entered DEBUG=app ./bin/www
by default it was 'my-application', when it is created by express. so i changed the name to 'app' and it gives the error below.
-bash ./bin/www Permission denied
any ideas how to fix this?, i even tried to run it as root.

A: You can set the proper permissions on the file to ensure you no longer get that error:
sudo chmod 755 ./bin/www


text:
Q: Select data based on condition that match multiple column values I am quite new to the SQL world. Wondering if someone could shed some light on the situation below. I am trying to get a list of account numbers that contain both transaction codes 150 and 300 for that particular account.
Table:Transactions
+-------+--------+----------+
| AcNum | TxCode |   Date   |
+-------+--------+----------+
|   111 |    150 | 1/1/2019 |
|   111 |    100 | 1/1/2019 |
|   111 |    100 | 1/2/2019 |
|   123 |    100 | 1/1/2019 |
|   123 |    200 | 1/1/2019 |
|   123 |    300 | 1/1/2019 |
|   123 |    300 | 1/2/2019 |
|   222 |    150 | 1/1/2019 |
|   222 |    150 | 1/2/2019 |
|   333 |    300 | 1/2/2019 |
|   333 |    150 | 1/3/2019 |
|   444 |    100 | 1/1/2019 |
|   444 |    300 | 1/1/2019 |
|   444 |    150 | 1/1/2019 |
|   456 |    100 | 1/1/2019 |
|   456 |    200 | 1/1/2019 |
|   456 |    300 | 1/1/2019 |
|   456 |    150 | 1/2/2019 |
|   789 |    100 | 1/1/2019 |
|   789 |    100 | 1/2/2019 |
|   789 |    300 | 1/1/2019 |
+-------+--------+----------+

Here is the SQL query I created but it returns accounts that have 150 and 300 but it also contains the account that just have one of those transactions. I am looking for accounts that contain both transactions.
SELECT acnum
FROM   transactions
WHERE  txcode IN ( '150', '300' )

Desired result would be as follows
AcNum
333
444
456

Result I am getting is as follows
AcNum
111
123
222
333
444
444
456
789

A: You must GROUP BY acnum and count the distinct txcode to be 2:
SELECT acnum
FROM   transactions
WHERE  txcode IN ( '150', '300' )
GROUP BY acnum
HAVING COUNT(DISTINCT txcode) = 2

See the demo.
Results:
| acnum |
| ----- |
| 333   |
| 444   |
| 456   |

A: You could also use subselects in the IN:
SELECT DISTINCT acnum
FROM transactions
WHERE
   acnum IN (SELECT acnum FROM transactions WHERE tx=150) AND
   acnum IN (SELECT acnum FROM transactions WHERE tx=300)

See it in action.


text:
Q: CAS Policy for Sharepoint Application Page I have an application page that I am creating in SharePoint to host in the LAYOUTS directory. The web project reference an external Assembly that access the file system to get files from a external file share.
My problem is that I want to deploy the assembly to the application BIN directory (not GAC) and use a CAS permission policy to allow it to execute within SharePoint. However, at this point, whenever I deploy the page I get this exception:
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I know that the issue is CAS-related, as it works fine when I deploy to the GAC.
My current CAS permissions look like this:
<SecurityClasses>
    <SecurityClass Name="AllMembershipCondition" Description="System.Security.Policy.AllMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="AspNetHostingPermission" Description="System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="FirstMatchCodeGroup" Description="System.Security.Policy.FirstMatchCodeGroup, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="NamedPermissionSet" Description="System.Security.NamedPermissionSet"/>
    <SecurityClass Name="SecurityPermission" Description="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="StrongNameMembershipCondition" Description="System.Security.Policy.StrongNameMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="UnionCodeGroup" Description="System.Security.Policy.UnionCodeGroup, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="UrlMembershipCondition" Description="System.Security.Policy.UrlMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="WebPartPermission" Description="Microsoft.SharePoint.Security.WebPartPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
    <SecurityClass Name="ZoneMembershipCondition" Description="System.Security.Policy.ZoneMembershipCondition, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="SharePointPermission" Description="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    <SecurityClass Name="FileIOPermission" Description="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <SecurityClass Name="EnvironmentPermission" Description="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</SecurityClasses>
<NamedPermissionSets>
    <PermissionSet
            class="NamedPermissionSet"
            version="1"
            Unrestricted="true"
            Name="FullTrust"
            Description="Allows full access to all resources"
    />
    <PermissionSet
            class="NamedPermissionSet"
            version="1"
            Name="Nothing"
            Description="Denies all resources, including the right to execute"
    />
    <PermissionSet
            class="NamedPermissionSet"
            version="1"
            Name="SPRestricted">
        <IPermission
                class="AspNetHostingPermission"
                version="1"
                Level="Minimal"
        />
        <IPermission
                class="SecurityPermission"
                version="1"
                Flags="Execution"
        />
        <IPermission class="WebPartPermission"
                version="1"
                Connections="True"
        />
    </PermissionSet>
    <PermissionSet
            class="NamedPermissionSet"
            version="1"
            Name="CustomTrust">
        <IPermission
                class="AspNetHostingPermission"
                version="1"
                Level="Medium"
        />
        <IPermission class="WebPartPermission"
                version="1"
                Connections="True"
        />
        <IPermission class="SharePointPermission"
                version="1"
                ObjectModel="True" />
        <IPermission
                class="FileIOPermission"
                version="1"
                Unrestricted="true"
                Read="$AppDir$"
                Write="$AppDir$"
                Append="$AppDir$"
                PathDiscovery="$AppDir$"
        />
        <IPermission
                class="SecurityPermission"
                version="1"
                Flags="Assertion, Execution, ControlThread, ControlPrincipal, RemotingConfiguration, ControlEvidence, UnmanagedCode"
                Unrestricted="true"
        />
        <IPermission
                class="EnvironmentPermission"
                version="1"
                Unrestricted="true"
        />
    </PermissionSet>
</NamedPermissionSets>
<CodeGroup
        class="FirstMatchCodeGroup"
        version="1"
        PermissionSetName="Nothing">
    <IMembershipCondition
            class="AllMembershipCondition"
            version="1"
    />
<CodeGroup class="UnionCodeGroup"
    version="1"
    PermissionSetName="CustomTrust">
    <IMembershipCondition class="StrongNameMembershipCondition"
        version="1"
        PublicKeyBlob="0x00240000048000009400000006020000002400005253413100040000010001002B54E7863E7D5443ACBF8DD7F18B9D2399FF73AE7C791BDEFA2BF7544DFB5B8DBB5C8DD705374386CD6A729C755ED4478CD9FA0FF912385FA1AE684345E82E793262A2DCEE1DEC1178BE488C18D338CFE62BCC1C06E4B235BBB6A886884889FC854F8CFA149DFCD18CC479229F0956E19A1DC9FDECAE844F850C2A34121546B8"
        Name="ConteoPolicy" />
    </CodeGroup>
<CodeGroup
            class="UnionCodeGroup"
            version="1"
            PermissionSetName="FullTrust">
        <IMembershipCondition
                class="UrlMembershipCondition"
                version="1"
                Url="$AppDirUrl$/_app_bin/*"
        />
    </CodeGroup>
    <CodeGroup
            class="UnionCodeGroup"
            version="1"
            PermissionSetName="SPRestricted">
        <IMembershipCondition
                class="UrlMembershipCondition"
                version="1"
                Url="$AppDirUrl$/*"
        />
    </CodeGroup>
    <CodeGroup
            class="UnionCodeGroup"
            version="1"
            PermissionSetName="FullTrust">
        <IMembershipCondition
                class="UrlMembershipCondition"
                version="1"
                Url="$CodeGen$/*"
        />
    </CodeGroup>
    <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Nothing">
        <IMembershipCondition
            class="ZoneMembershipCondition"
            version="1"
            Zone="MyComputer" />
        <CodeGroup
                class="UnionCodeGroup"
                version="1"
                PermissionSetName="FullTrust"
                Name="Microsoft_Strong_Name"
                Description="This code group grants code signed with the Microsoft strong name full trust. ">
            <IMembershipCondition
                    class="StrongNameMembershipCondition"
                    version="1"
                    PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293"
            />
        </CodeGroup>
        <CodeGroup
                class="UnionCodeGroup"
                version="1"
                PermissionSetName="FullTrust"
                Name="Ecma_Strong_Name"
                Description="This code group grants code signed with the ECMA strong name full trust. ">
            <IMembershipCondition
                    class="StrongNameMembershipCondition"
                    version="1"
                    PublicKeyBlob="00000000000000000400000000000000"
            />
        </CodeGroup>
    </CodeGroup>
</CodeGroup>

I used the permcalc tool available from Microsoft on my assembly and added the permissions that it discovered, but the issue was not resolved.
Has anyone ever have this problem deploying application pages in Bin folder?

A: I prefer to deploy to the bin folder but have had issues specifiying the required permissions.
This approach works well and grants your assembly full trust while still located in the bin folder.
http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html
Unfortunalty it's a manual process.

A: After reading some articles in Internet and MSDN i came up with another solution, just make a WSP package to install the solution and to define in the manifest file the apropiate permissions. This solution is great because you dont have to modify the Web.config and the wss_minimaltrust.config manually, the stsadm make all this automaticly and in all the nodes of the server farm.
When you deploy the solution dont forget to put de option -allowCasPolicies.

STSADM -o deploysolution -name
  Mysolution.wsp -immediate -url
  http://serverfarm:8083
  -allowCasPolicies

My manifest look like this
    <Solution
  SolutionId="27F5B763-2613-41a7-84D9-458A7206F1BE"
  xmlns="http://schemas.microsoft.com/sharepoint/">
<TemplateFiles>
    <TemplateFile Location="LAYOUTS\MyAppPage\apppage.aspx" />
</TemplateFiles>

<Assemblies>
    <Assembly DeploymentTarget="WebApplication" Location="MyAssembly.dll" >
        <SafeControls>
            <SafeControl Assembly="MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=..." Namespace="MyAssembly" TypeName="*" Safe="True" />
        </SafeControls>
    </Assembly>
</Assemblies>

<CodeAccessSecurity>
    <PolicyItem>
        <PermissionSet class="NamedPermissionSet" version="1" Description="Permisos para My assembly">
            <IPermission class="AspNetHostingPermission" version="1" Level="Minimal" />
            <IPermission class="SecurityPermission" version="1" Flags="Execution,UnmanagedCode,ControlPrincipal,ControlEvidence,Assertion" />
            <IPermission class="System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" version="1" Unrestricted="true" />
            <IPermission class="System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
            <IPermission class="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" version="1" ObjectModel="True" Impersonate="True" />
            <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" PathDiscovery="*AllFiles*" />
            <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
            <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
            <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        </PermissionSet>
        <Assemblies>
            <Assembly PublicKeyBlob="..."/>
        </Assemblies>
    </PolicyItem>
</CodeAccessSecurity>

A: I've always had problems with the BIN folder working correctly, so I always build mine to deploy to the GAC.
Microsoft does describe how to make the correct settings to your web.config file that should allow your assembly to run with higher permissions.
Take a look at this page for more information. I know the page is about WebParts but it should also go with what you are trying to do.
http://msdn.microsoft.com/en-us/library/cc768621.aspx


text:
Q: Query for distance OR taxonomy term I'm using a custom query to retrieve posts with geo-coordinates within 10 miles of user coordinates and order them by distance. The query works as intended without issue.
However, my client now wants results to include posts with the term 'online' in a 'business-type' taxonomy. I'm familiar with adding taxonomy terms to a query like this but I can't figure out the 'OR'; that is, return everything within 10 miles OR marked 'online.'
my (hard-coded) query is below. Thanks for any help or suggestions.
SELECT SQL_CALC_FOUND_ROWS  wp_5_posts.* ,
pm1.meta_value as lat, pm2.meta_value as lng,
(ACOS(SIN(RADIANS(37.7749295))*SIN(RADIANS(pm1.meta_value))+COS(RADIANS(37.7749295))*COS(RADIANS(pm1.meta_value))*COS(RADIANS(pm2.meta_value)-RADIANS(-122.4194155))) * 3959) AS distance

FROM wp_5_posts
INNER JOIN wp_5_postmeta as pm1 ON wp_5_posts.id = pm1.post_id AND pm1.meta_key = 'latitude'
INNER JOIN wp_5_postmeta as pm2 ON wp_5_posts.id = pm2.post_id AND pm2.meta_key = 'longitude'
WHERE 1=1
AND wp_5_posts.post_type = 'partners-cpt'
AND wp_5_posts.post_status = 'publish'
GROUP BY wp_5_posts.ID
HAVING distance < 10
ORDER BY distance ASC
LIMIT 0, 10


text:
Q: If $f \in L^+$ and $\int f<\infty$ then there exists a null set I would like to know if this proof works, since it's a bit different then what I have seen.
It's in Folland , Proposition 2.20 - If $f \in L^+$
 and $\int f<\infty$
 then  $\{x:f(x)=\infty\}$
  is a null set
Proof: By theorem 2.10 , there is an increasing sequence of simple functions $\varphi_n$ that converge to $f$ point wise.by the monotone convergence theorem $\int f = \lim \int \varphi_n$.
If $\varphi_n=\infty$ on null set then since the sequence converge to $f$ point wise the result follows.
Now to show that $\varphi_n=\infty$ only on a null set, note that the integral of $\varphi_n=\infty$ becomes $\sum a_j \mu(E_j)$ which by above is less than $\infty$ , hence non of the terms in the sum is $\infty$ , which implies that $a_j$ is not infinite except maybe on a null set which implies that the standard representation of the simple functions is $\infty$ only on a null set (if anywhere).

A: No, the proof doesn't work.
If $f_n \to f$ and $\mu(f_n=\infty) = 0$ for all $n$, this does not imply that $\mu(f=\infty)=0$. As a counterexample, consider $f_n = n \mathbf{1}_{[0,1)}$ for all $n$.
A correct argument could go something like this: suppose $A = \{f = \infty\}$ has positive measure. Then
$$
\int f d\mu \geq \int_A f d\mu = \infty
$$
contradicting that $f \in L^1$.


text:
Q: How to mount a host directory in a Docker container I am trying to mount a host directory into a Docker container so that any updates done on the host is reflected into the Docker containers.
Where am I doing something wrong. Here is what I did:
kishore$ cat Dockerfile

FROM ubuntu:trusty
RUN apt-get update
RUN apt-get -y install git curl vim
CMD ["/bin/bash"]
WORKDIR /test_container
VOLUME ["/test_container"]

kishore$ tree
.
├── Dockerfile
└── main_folder
    ├── tfile1.txt
    ├── tfile2.txt
    ├── tfile3.txt
    └── tfile4.txt

1 directory, 5 files
kishore$ pwd
/Users/kishore/tdock
kishore$ docker build --tag=k3_s3:latest .

Uploading context 7.168 kB
Uploading context
Step 0 : FROM ubuntu:trusty
 ---> 99ec81b80c55
Step 1 : RUN apt-get update
 ---> Using cache
 ---> 1c7282005040
Step 2 : RUN apt-get -y install git curl vim
 ---> Using cache
 ---> aed48634e300
Step 3 : CMD ["/bin/bash"]
 ---> Running in d081b576878d
 ---> 65db8df48595
Step 4 : WORKDIR /test_container
 ---> Running in 5b8d2ccd719d
 ---> 250369b30e1f
Step 5 : VOLUME ["/test_container"]
 ---> Running in 72ca332d9809
 ---> 163deb2b1bc5
Successfully built 163deb2b1bc5
Removing intermediate container b8bfcb071441
Removing intermediate container d081b576878d
Removing intermediate container 5b8d2ccd719d
Removing intermediate container 72ca332d9809

kishore$ docker run -d -v /Users/kishore/main_folder:/test_container k3_s3:latest
c9f9a7e09c54ee1c2cc966f15c963b4af320b5203b8c46689033c1ab8872a0eakishore$ docker run -i -t k3_s3:latest /bin/bash

root@0f17e2313a46:/test_container# ls -al
total 8
drwx------  2 root root 4096 Apr 29 05:15 .
drwxr-xr-x 66 root root 4096 Apr 29 05:15 ..

root@0f17e2313a46:/test_container# exit
exitkishore$ docker -v
Docker version 0.9.1, build 867b2a9

*

*I don't know how to check boot2docker version

Questions, issues facing:

*

*How do I need to link the main_folder to the test_container folder present inside the docker container?

*I need to make this automatically. How do I to do that without really using the run -d -v command?

*What happens if the boot2docker crashes? Where are the Docker files stored (apart from Dockerfile)?

A: 2 successive mounts:
I guess many posts here might be using two boot2docker, the reason you don't see anything is that you are mounting a directory from boot2docker, not from your host.
You basically need 2 successive mounts:

the first one to mount a directory from your host to your system
the second to mount the new directory from boot2docker to your container like this:

*

*1) Mount local system on boot2docker
sudo mount -t vboxsf hostfolder /boot2dockerfolder

*2) Mount boot2docker file on linux container
docker run -v /boot2dockerfolder:/root/containerfolder -i -t imagename

Then when you ls inside the containerfolder you will see the content of your hostfolder.

A: How do I link the main_folder to the test_container folder present inside the docker container?
Your command below is correct, unless your on a mac using boot2docker(depending on future updates) in which case you may find the folder empty. See mattes answer for a tutorial on correcting this.
docker run -d -v /Users/kishore/main_folder:/test_container k3_s3:latest

I need to make this run automatically, how to do that without really
using the run -d -v command.
You can't really get away from using these commands, they are intrinsic to the way docker works. You would be best off putting them into a shell script to save you writing them out repeatedly.
What happens if boot2docker crashes? Where are the docker files stored?
If you manage to use the -v arg and reference your host machine then the files will be safe on your host.
If you've used 'docker build -t myimage .' with a Dockerfile then your files will be baked into the image.
Your docker images, i believe, are stored in the boot2docker-vm. I found this out when my images disappeared when i delete the vm from VirtualBox. (Note, i don't know how Virtualbox works, so the images might be still hidden somewhere else, just not visible to docker).

A: Had the same problem. Found this in the docker documentation:

Note: The host directory is, by its nature, host-dependent. For this reason, you can't mount a host directory from Dockerfile, the VOLUME instruction does not support passing a host-dir, because built images should be portable. A host directory wouldn't be available on all potential hosts.

So, mounting a read/write host directory is only possible with the -v parameter in the docker run command, as the other answers point out correctly.

A: I found that any directory laying under system directive like /var, /usr, /etc could not be mount under the container.
The directive should be at user's space -v switch instructs docker daemon to mount local directory to the container, for example:
docker run -t -d -v /{local}/{path}:/{container}/{path} --name {container_name} {imagename}

A: Here's an example with a Windows path:
docker run -P -it --name organizr --mount src="/c/Users/MyUserName/AppData/Roaming/DockerConfigs/Organizr",dst=/config,type=bind organizrtools/organizr-v2:latest

As a side note, during all of this hair pulling, having to wrestle with figuring out, and retyping paths over and over and over again, I decided to whip up a small AutoHotkey script to convert a Windows path to a "Docker Windows" formatted path. This way all I have to do is copy any Windows path that I want to use as a mount point to the clipboard, press the "Apps Key" on the keyboard, and it'll format it into a path format that Docker appreciates.
For example:
Copy this to your clipboard:
C:\Users\My PC\AppData\Roaming\DockerConfigs\Organizr
press the Apps Key while the cursor is where you want it on the command-line, and it'll paste this there:
"/c/Users/My PC/AppData/Roaming/DockerConfigs/Organizr"
Saves a lot to time for me. Here it is for anyone else who may find it useful.
; --------------------------------------------------------------------------------------------------------------
;
; Docker Utility: Convert a Windows Formatted Path to a Docker Formatter Path
;                   Useful for (example) when mounting Windows volumes via the command-line.
;
; By:       J. Scott Elblein
; Version:  1.0
; Date:     2/5/2019
;
; Usage:    Cut or Copy the Windows formatted path to the clipboard, press the AppsKey on your keyboard
;           (usually right next to the Windows Key), it'll format it into a 'docker path' and enter it
;           into the active window. Easy example usage would be to copy your intended volume path via
;           Explorer, place the cursor after the "-v" in your Docker command, press the Apps Key and
;           then it'll place the formatted path onto the line for you.
;
; TODO::    I may or may not add anything to this depending on needs. Some ideas are:
;
;           - Add a tray menu with the ability to do some things, like just replace the unformatted path
;               on the clipboard with the formatted one rather than enter it automatically.
;           - Add 'smarter' handling so the it first confirms that the clipboard text is even a path in
;               the first place. (would need to be able to handle Win + Mac + Linux)
;           - Add command-line handling so the script doesn't need to always be in the tray, you could
;               just pass the Windows path to the script, have it format it, then paste and close.
;               Also, could have it just check for a path on the clipboard upon script startup, if found
;               do it's job, then exit the script.
;           - Add an 'all-in-one' action, to copy the selected Windows path, and then output the result.
;           - Whatever else comes to mind.
;
; --------------------------------------------------------------------------------------------------------------

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

AppsKey::

    ; Create a new var, store the current clipboard contents (should be a Windows path)
    NewStr := Clipboard

    ; Rip out the first 2 chars (should be a drive letter and colon) & convert the letter to lowercase
    ; NOTE: I could probably replace the following 3 lines with a regexreplace, but atm I'm lazy and in a rush.
    tmpVar := SubStr(NewStr, 1, 2)
    StringLower, tmpVar, tmpVar

    ; Replace the uppercase drive letter and colon with the lowercase drive letter and colon
    NewStr := StrReplace(NewStr, SubStr(NewStr, 1, 2), tmpVar)

    ; Replace backslashes with forward slashes
    NewStr := StrReplace(NewStr,  "\", "/")

    ; Replace all colons with nothing
    NewStr := StrReplace(NewStr, ":", "")

    ; Remove the last char if it's a trailing forward slash
    NewStr :=  RegExReplace(NewStr, "/$")

    ; Append a leading forward slash if not already there
    if RegExMatch(NewStr, "^/") == 0
        NewStr :=  "/" . NewStr

    ; If there are any spaces in the path ... wrap in double quotes
    if RegExMatch(NewStr, " ") > 0
        NewStr :=  """" . NewStr . """"

    ; Send the result to the active window
    SendInput % NewStr

A: There are a couple ways you can do this. The simplest way to do so is to use the dockerfile ADD command like so:
ADD . /path/inside/docker/container

However, any changes made to this directory on the host after building the dockerfile will not show up in the container. This is because when building a container, docker compresses the directory into a .tar and uploads that context into the container permanently.
The second way to do this is the way you attempted, which is to mount a volume. Due to trying to be as portable as possible you cannot map a host directory to a docker container directory within a dockerfile, because the host directory can change depending on which machine you are running on. To map a host directory to a docker container directory you need to use the -v flag when using docker run, e.g.,:
# Run a container using the `alpine` image, mount the `/tmp`
# directory from your host into the `/container/directory`
# directory in your container, and run the `ls` command to
# show the contents of that directory.
docker run \
    -v /tmp:/container/directory \
    alpine \
    ls /container/directory

A: To get this working in Windows 10 I had to open the Docker Settings window from the system tray and go to the Shared Drives section.
I then checked the box next to C. Docker asked for my desktop credentials to gain authorisation to write to my Users folder.
Then I ran the docker container following examples above and also the example on that settings page, attaching to /data in the container.
docker run -v c:/Users/<user.name>/Desktop/dockerStorage:/data -other -options

A: boot2docker together with VirtualBox Guest Additions
How to mount /Users into boot2docker
https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c

tl;dr Build your own custom boot2docker.iso with VirtualBox Guest
  Additions (see link) or download
  http://static.dockerfiles.io/boot2docker-v1.0.1-virtualbox-guest-additions-v4.3.12.iso
  and save it to ~/.boot2docker/boot2docker.iso.

A: Note that in Windows you'll have to provide the absolute path.

*

*Host: Windows 10

*Container: Tensorflow Notebook
Below worked for me.
docker run -t -i -v D:/projects/:/home/chankeypathak/work -p 8888:8888 jupyter/tensorflow-notebook /bin/bash

A: Is it possible that you use docker on OS X via boot2docker or something similar.
I've made the same experience - the command is correct but nothing (sensible) is mounted in the container, anyway.
As it turns out - it's already explained in the docker documentation. When you type docker run -v /var/logs/on/host:/var/logs/in/container ... then /var/logs/on/host is actually mapped from the boot2docker VM-image, not your Mac.
You'll have to pipe the shared folder through your VM to your actual host (the Mac in my case).

A: For those who wants to mount a folder in current directory:
docker run -d --name some-container -v ${PWD}/folder:/var/folder ubuntu

A: I'm just experimenting with getting my SailsJS app running inside a Docker container to keep my physical machine clean.
I'm using the following command to mount my SailsJS/NodeJS application under /app:

cd my_source_code_folder
docker run -it -p 1337:1337 -v $(pwd):/app my_docker/image_with_nodejs_etc

A: i had same issues , i was trying to mount C:\Users\ folder on docker
this is how i did it Docker Toolbox command line
 $ docker run -it --name <containername> -v /c/Users:/myVolData <imagename>

A: You can also do this with Portainer web application for a different visual experience.
First pull the Portainer image:
docker pull portainer/portainer

Then create a volume for Portainer:
docker volume create portainer_data

Also create a Portainer container:
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

You will be able to access the web app with your browser at this URL: "http://localhost:9000". At the first login, you will be prompted to set your Portainer admin credentials.
In the web app, follow these menus and buttons: (Container > Add container > Fill settings > Deploy Container)
I had trouble to create a "mount" volume with Portainer and I realized I had to click "bind" when creating my container's volume. Below is an illustration of the volume binding settings that worked for my container creation with a mounted volume binded to the host.

P.S.: I'm using Docker 19.035 and Portainer 1.23.1

A: [UPDATE] As of ~June 2017, Docker for Mac takes care of all the annoying parts of this where you have to mess with VirtualBox. It lets you map basically everything on your local host using the /private prefix. More info here. [/UPDATE]
All the current answers talk about Boot2docker. Since that's now deprecated in favor of docker-machine, this works for docker-machine:
First, ssh into the docker-machine vm and create the folder we'll be mapping to:
docker-machine ssh $MACHINE_NAME "sudo mkdir -p \"$VOL_DIR\""

Now share the folder to VirtualBox:
WORKDIR=$(basename "$VOL_DIR")
vboxmanage sharedfolder add "$MACHINE_NAME" --name "$WORKDIR" --hostpath "$VOL_DIR" --transient

Finally, ssh into the docker-machine again and mount the folder we just shared:
docker-machine ssh $MACHINE_NAME "sudo mount -t vboxsf -o uid=\"$U\",gid=\"$G\" \"$WORKDIR\" \"$VOL_DIR\""

Note: for UID and GID you can basically use whatever integers as long as they're not already taken.
This is tested as of docker-machine 0.4.1 and docker 1.8.3 on OS X El Capitan.

A: The user of this question was using Docker version 0.9.1, build 867b2a9, I will give you an answer for docker version >= 17.06.
What you want, keep local directory synchronized within container directory, is accomplished by mounting the volume with type bind. This will bind the source (your system) and the target (at the docker container) directories. It's almost the same as mounting a directory on linux.
According to Docker documentation, the appropriate command to mount is now mount instead of -v. Here's its documentation:

*

*--mount: Consists of multiple key-value pairs, separated by commas. Each key/value pair takes the form of a <key>=<value> tuple. The --mount syntax is more verbose than -v or --volume, but the order of the keys is not significant, and the value of the flag is easier to understand.

*The type of the mount, which can be bind, volume, or tmpfs. (We are going to use bind)

*The source of the mount. For bind mounts, this is the path to the file or directory on the Docker daemon host. May be specified as source or src.

*The destination takes as its value the path where the file or directory will be mounted in the container. May be specified as destination, dst, or target.
So, to mount the the current directory (source) with /test_container (target) we are going to use:
    docker run -it --mount src="$(pwd)",target=/test_container,type=bind k3_s3

If these mount parameters have spaces you must put quotes around them. When I know they don't, I would use `pwd` instead:
    docker run -it --mount src=`pwd`,target=/test_container,type=bind k3_s3

You will also have to deal with file permission, see this article.

A: Using command-line :
docker run -it --name <WHATEVER> -p <LOCAL_PORT>:<CONTAINER_PORT> -v <LOCAL_PATH>:<CONTAINER_PATH> -d <IMAGE>:<TAG>

Using docker-compose.yaml :
version: '2'
  services:
    cms:
       image: <IMAGE>:<TAG>
       ports:
       - <LOCAL_PORT>:<CONTAINER_PORT>
       volumes:
       - <LOCAL_PATH>:<CONTAINER_PATH>

Assume :

*

*IMAGE: k3_s3

*TAG: latest

*LOCAL_PORT: 8080

*CONTAINER_PORT: 8080

*LOCAL_PATH: /volume-to-mount

*CONTAINER_PATH: /mnt

Examples :

*

*First create /volume-to-mount. (Skip if exist)

$ mkdir -p /volume-to-mount

*docker-compose -f docker-compose.yaml up -d

version: '2'
  services:
    cms:
       image: ghost-cms:latest
       ports:
       - 8080:8080
       volumes:
       - /volume-to-mount:/mnt

*Verify your container :

docker exec -it CONTAINER_ID ls -la /mnt

A: docker run -v /host/directory:/container/directory -t IMAGE-NAME /bin/bash

docker run -v /root/shareData:/home/shareData -t kylemanna/openvpn /bin/bash

In my system I've corrected the answer from nhjk, it works flawless when you add the -t flag.

A: On Mac OS, to mount a folder /Users/<name>/projects/ on your mac at the root of your container:
docker run -it -v /Users/<name>/projects/:/projects <container_name> bash
ls /projects

A: I had the same requirement to mount host directory from container and I used volume mount command. But during testing noticed that it's creating files inside container too but after some digging found that they are just symbolic links and actual file system used form host machine.

A: If the host is windows 10 then instead of forward slash, use backward slash -
docker run -it -p 12001:80 -v c:\Users\C\Desktop\dockerStorage:/root/sketches

Make sure the host drive is shared (C in this case). In my case I got a prompt asking for share permission after running the command above.

A: For Windows 10 users, it is important to have the mount point inside the C:/Users/ directory. I tried for hours to get this to work. This post helped but it was not obvious at first as the solution for Windows 10 is a comment to an accepted answer. This is how I did it:
docker run -it -p 12001:80 -v //c/Users/C/Desktop/dockerStorage:/root/sketches \
<your-image-here> /bin/bash

Then to test it, you can do echo TEST > hostTest.txt inside your image. You should be able to see this new file in the local host folder at C:/Users/C/Desktop/dockerStorage/.

A: you can use -v option from cli, this facility is not available via Dockerfile
docker run -t -i -v <host_dir>:<container_dir>  ubuntu /bin/bash
where host_dir is the directory from host which you want to mount.
you don't need to worry about directory of container if it doesn't exist docker will create it.
If you do any changes in host_dir from host machine (under root privilege) it will be visible to container and vice versa.

A: As of Docker 18-CE, you can use docker run -v /src/path:/container/path to do 2-way binding of a host folder.
There is a major catch here though if you're working with Windows 10/WSL and have Docker-CE for Windows as your host and then docker-ce client tools in WSL. WSL knows about the entire / filesystem while your Windows host only knows about your drives. Inside WSL, you can use /mnt/c/projectpath, but if you try to docker run -v ${PWD}:/projectpath, you will find in the host that /projectpath/ is empty because on the host /mnt means nothing.
If you work from /c/projectpath though and THEN do docker run -v ${PWD}:/projectpath and you WILL find that in the container, /projectpath will reflect /c/projectpath in realtime. There are no errors or any other ways to detect this issue other than seeing empty mounts inside your guest.
You must also be sure to "share the drive" in the Docker for Windows settings.

A: Jul 2015 update - boot2docker now supports direct mounting. You can use -v /var/logs/on/host:/var/logs/in/container directly from your Mac prompt, without double mounting

A: I've been having the same issue.
My command line looked like this:
docker run --rm -i --name $NAME -v `pwd`:/sources:z $NAME

The problem was with 'pwd'. So I changed that to $(pwd):
docker run --rm -i --name $NAME -v $(pwd):/sources:z $NAME

A: Quoting from the Official Website:

*

*Make sure you don't have any previous getting-started containers running.

*Run the following command from the app directory.

*

*x86-64 Mac or Linux device:
docker run -dp 3000:3000 \
  -w /app -v "$(pwd):/app" \
  node:12-alpine \
  sh -c "yarn install && yarn run dev"

*Windows (PowerShell):
docker run -dp 3000:3000 \
  -w /app -v "$(pwd):/app" \
  node:12-alpine \
  sh -c "yarn install && yarn run dev"

*Aple silicon Mac or another ARM64 device:
docker run -dp 3000:3000 \\
  -w /app -v "$(pwd):/app" \\
  node:12-alpine \\
  sh -c "apk add --no-cache python2 g++ make && yarn install && yarn run dev"

Explaining:

*

*dp 3000:3000 - same as before. Run in detached (background) mode and create a port mapping

*w /app - sets the "working directory" or the current directory that the command will run from

*v "$(pwd):/app" - bind mount the current directory from the host into the /app directory in the container

*node:12-alpine - the image to use.

Note that this is the base image for our app from the Dockerfile sh -c "yarn install && yarn run dev" - the command.
We're starting a shell using sh (alpine doesn't have Bash) and running yarn install to install all dependencies and then running yarn run dev. If we look in the package.json, we'll see that the dev script is starting nodemon.


text:
Q: Xdebug with Docker on Windows and PhpStorm I run a Docker image with Symfony and API-platform. My docker image is running on Windows with Traefik.
When I start Xdebug (In PhpStorm and Chrome), it stops in the public/index.php if I put a breakpoint, but when I put a breakpoint in a controller or in an Authenticator, there is no break. When I add a debug line with dd(), I can debug but the purpose is doing this with Xdebug.
What can I look to understand what's wrong ?
OS: Windows 10
IDE: PhpStorm
PHP: Symfony 5 / Api Platform / PHP 7.4

A: I found my problem, In "Language & Frameworks > PHP > Servers" the absolute path in my docker image was set only for the public folder. i updated the absolute path for the parent folder "src > /var/www/html" and now it works


text:
Q: Is it possible to digitally sign a Flex application? We keep getting dinged by our security team because we don't sign our Flex applications. As far as I know, it's not possible to sign a Flex application, but it is possible to sign an AIR application. Does anyone know of a way to do this for Flex web applications (swfs) or Flex libraries (swcs)?
My initial thought is, "what's the point?" since I can't see any way for a user to actually verify that a swf file was signed by us, rendering any kind of signing pointless. Am I missing something? The closest thing I've seen to this is how Adobe signs their framework RSLs so they can get cached and they can know for sure the functionality in each swz file is the same, but all those caching features are built into Flash player and have nothing to do with what a client can actually do to verify a projects source.


text:
Q: how to pass query parameter in resolve method Here is my js code
var MYApp = angular.module('myApp', ['ngRoute', 'myAppServices', 'ngSanitize'])
    .config(myRouter);

angular.module('myAppServices', ['ngResource'])
    .factory('GridsAPI', function($resource) {
        return {
            GetUser: $resource('/MY/system/getUser/:id')
        };
    });
function ViewUserController($scope, user) {

}
function myRouter($routeProvider) {

    $routeProvider
        .when('/users/view/:id', {
            templateUrl: '/MY/system/users/view/:id',
            controller: 'ViewUserController',
            resolve: {
                user: function(GridsAPI) {
                    //how to return user based on id passed to this url?
                }
            }
        });
}

I want to get the user via ajax call before the view has loaded, how can I get the id parameter in resolve?

A: Inject $route and then:
resolve: {
    user: ['$route', 'GridsAPI', function($route, GridsAPI) {
      var userId = $route.current.params.id;
      ...
    }]
}


text:
Q: Making jagged triangle border in CSS I have a shape with an edge like this in Photoshop:

Is it possible to make the repeated triangles as a border with CSS?

A: Personally, I think clip-path is easier to work with/understand than complex background gradients.

body {
  font-family:Roboto,'Open Sans',Helvetica,sans-serif;
}
.container {
  background:#ddd;
  margin:0 auto;
  max-width:800px;
  padding:30px;
}
h1:first-child {margin:0;}

.jagged-bottom {
  position:relative;
}
.jagged-bottom:after {
  background:#ddd;
  content:"";
  height:2vw;
  position:absolute;
  top:100%;
  left:0;
  right:0;
  clip-path:polygon(
     0 0, 2.5% 100%, 5% 0,  7.5% 100%,
   10% 0,12.5% 100%,15% 0, 17.5% 100%,
   20% 0,22.5% 100%,25% 0, 27.5% 100%,
   30% 0,32.5% 100%,35% 0, 37.5% 100%,
   40% 0,42.5% 100%,45% 0, 47.5% 100%,
   50% 0,52.5% 100%,55% 0, 57.5% 100%,
   60% 0,62.5% 100%,65% 0, 67.5% 100%,
   70% 0,72.5% 100%,75% 0, 77.5% 100%,
   80% 0,82.5% 100%,85% 0, 87.5% 100%,
   90% 0,92.5% 100%,95% 0, 97.5% 100%, 100% 0);
}

Looks Like A Receipt

Simply adjust the clip path on the pseudo-element if you want more or fewer spikes, and the height if you want them to be taller or shorter.

A: You can use gradients to create a zig-zag patterned background, use the ::after pseud-element to apply it like a border.

.header{
    color: white;
    background-color: #2B3A48;
    text-align: center;
}
.header::after {
    content: " ";
    display: block;
    position: relative;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 36px;
    background: linear-gradient(#2B3A48 0%, transparent 0%), linear-gradient(135deg, #272220 33.33%, transparent 33.33%) 0 0%, #272220 linear-gradient(45deg, #272220 33.33%, #2B3A48 33.33%) 0 0%;
    background-repeat: repeat-x;
    background-size: 0px 100%, 9px 27px, 9px 27px;
}

This is a header

Source: CSS Zigzag Border with a Textured Background
JSFiddle: http://jsfiddle.net/kA4zK/

A: For future viewers, I found this adaptation of @extramaster's answer to be a little simpler.
It's essentially the same, but it uses one fewer background gradients and allows the backing object (.navbar in my markup) to show through instead of hard-coding the second color into the zig-zag.
JsFiddle: http://jsfiddle.net/861gjx0b/2/

.header {
  position: relative;
  color: white;
  background-color: #2B3A48;
  text-align: center;
}

.navbar {
  background: #272220;
  height: 20px;
}

.header:after {
  content: "";
  position: absolute;
  display: block;
  height: 10px;
  bottom: -10px;
  /* -height */
  left: 0;
  right: 0;
  /* TODO Add browser prefixes */
  background: linear-gradient( 45deg, transparent 33.333%, #2B3A48 33.333%, #2B3A48 66.667%, transparent 66.667%), linear-gradient( -45deg, transparent 33.333%, #2B3A48 33.333%, #2B3A48 66.667%, transparent 66.667%);
  background-size: 8px 20px;
  /* toothSize doubleHeight */
  background-position: 0 -10px;
  /* horizontalOffset -height */
}

This is a header

A: There is a border-image property in CSS3.
Maybe you can work it out in a way you want. More here:
https://developer.mozilla.org/en-US/docs/Web/CSS/border-image
Or here
https://www.w3schools.com/cssref/css3_pr_border-image.asp

A: You can create an individual triangle using CSS quite easily (just tweak border properties). In order for this to work you will need to generate quite a bit of markup yourself. I would recommend against this approach.
Instead you are likely better off using an individual image containing a single triangle (preferably a transparent .png) and then use background-image and background-repeat (repeat-x) properties to bind that to a div (your "border").
Unfortunately there is no yet a straight-forward way to achieve this using pure CSS.


text:
Q: Tomcat context.xml resource password not allow special charcaters I have been trying for add data source in tomcat conf/context.xml as below.
<Resource name="jdbc/DS1"
                        auth="Container"
                        type="javax.sql.DataSource"
                        driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
                        url="jdbc:sqlserver://121.111.11.91;databaseName=DB_NAME"
                        username="testUanme"
                        password="TT&123$"
                        maxPoolSize="50"
                        removeAbandoned="true"
                        removeAbandonedTimeout="1000"
                        logAbandoned="true"
                        />

After set Data Source entry in config file i m restarting tomcat and it gives error like:
The reference to entity "TT" must end with the ';' delimiter.
Password not allowing special characters which i have used & and $.
Please suggest what should be there which allows me to enter special characters in password..
Thanks in advance.

A: If you replace & in your password with & you should be fine.


text:
Q: Of me / of mine / by me I'm wondering how you would say that because it sounds really weird to me:
Would you say "stuff by me/of me/of mine"?
For example if you posted things on Instagram and would say something like "official stuff by/of me" cause I saw someone who used "official stuff of me" as his description on Instagram and that sounds so wrong to me still. So what would you say?

A: You would say "my stuff." It does sound wrong to say "official stuff of me"; it's probably intended to be humorous. In normal usage, you would say "my official stuff."

A:
stuff by me
The photo exhibit is full of stuff by me.

means stuff you produced,as opposed to stuff lying along side you.

stuff of me
Q: Do you have any things from when you were a baby?
  A: Here's a box with pictures and baby boots and my rattle.
       here's some stuff of me when I was a baby

means stuff about me, along the lines of "a photograph of me", "an article of me", stuff is used as a general catch all.

stuff of mine
The car is full of stuff of mine.
  The car is full of my stuff.

means stuff which belongs to you.


text:
Q: Using of functions and lists from other Mathematica files I have a code in which I have to use some functions and lists and use them in the body of the code. If I want to type all of them in a file in Mathematica, that file becomes very very long. For example, I have
Func1[x1_,x2_,x3_,x4_,x5_]:=f(x1,x2,x3,x4,x5);
Func2[x1_,x2_,x3_,x4_,x5_]:=f(x1,x2,x3,x4,x5);
Func3[x1_,x2_,x3_,x4_,x5_]:=f(x1,x2,x3,x4,x5);
Func4[x1_,x2_,x3_,x4_,x5_]:=f(x1,x2,x3,x4,x5);
Func5[x1_,x2_,x3_,x4_,x5_]:=f(x1,x2,x3,x4,x5); ...

List1={...};
List2={...};
List3={...};
List4={...};
List5={...}; ...

the body of my code...

I have to use them these functions and lists in the body of my code. Is it possible to type those functions and lists in a separate file and call them in the body of the code then use them?

A: Say you have a notebook called "stuff.nb". In my case, I made one that has a single line:
a=100;

Now in another notebook (located in the same directory as stuff.nb), evaluate:
NotebookEvaluate[NotebookDirectory[] <> "stuff.nb"]

Everything in stuff.nb is evaluated and so $a$ takes on the value $100$. If you are not in the same directory, then you would need to use the correct path to get to stuff.nb


text:
Q: not able to get the actual record id I  have create the the jqgrid which loads the data from the server , i am able to view the data in a grid , but when i try to extend and fire up onclickSubmit of $.jgrid.del i am not be able to get the actual record id (which is in my case it is 101 , 102 ) instead of that it returns 1 , 2 , may be a row index id.
JqGrid
jQuery("#eventGrid").jqGrid({
    url:"/eventAllInfo",
    datatype: "json",
    restful:  true,
    mtype: 'GET',
    width:900,

    colNames:['id','title', 'description'],
    colModel:[
        {name:'e_info_id',index:'e_info_id', width:60, sorttype:"int",editable:true,editoptions:{size:10}},
        {name:'e_meta_title',index:'e_meta_title', width:90,editable:true,editoptions:{size:10}},
        {name:'e_meta_description',index:'e_meta_description', width:100,editable:true,editoptions:{size:10}},
    ],
    rowNum:10, rowList:[10,20,30],
    jsonReader : { repeatitems: false },
    pager: '#pager',
    caption: "Show Events"
});

JSON Response
{
  "success": true,
  "message": "Records Retrieved Successfully -EventAllInfo",
  "page": "1",
  "total": 1,
  "records": "2",
  "rows": [
    {
      "e_info_id": "101",
      "e_meta_title": "Oracle Business Summit",
      "e_meta_description": null,
      "e_meta_img": null,
      "e_meta_video": null,

    },
    {
      "e_info_id": "102",
      "e_meta_title": "Expo 2014 - Environment",
      "e_meta_description": "",
      "e_meta_img": "",
      "e_meta_video": "",

    }
  ]
}

Well specifying id in json reader solved my problem in deleting record , but when i edit the record my postdata argument contains
e_info_id: "101"
e_meta_description: ""
e_meta_title: "Oracle Business Summit"
id: "101"
oper: "edit"

and when i try to access it as postdata.id or postdata.e_info_id it returns undefined , here is the onclickSubmit of edit
 onclickSubmit: function (options, postdata) {
        console.log(postdata);
        console.log(postdata.id); //undefined

        options.url = options.editurl +'/' + encodeURIComponent(postdata.id);
    }

A: Looking at the docs here I think you should specify your id property name in the jsonReader.
jsonReader : { repeatitems: false, id: "e_info_id" }

A: If you use jsonReader: { repeatitems: false } jqGrid don't know which values it should use as so named rowid. The rowid is the value of id attribute of <tr> elements in the grid.
To fix the problem you have two options:

*

*To define key: true property in the e_info_id column.

*To use id: "e_info_id" in jsonReader (see the answer of Christian)

The default value of id property in the jsonReader is id: "id".
It's important to know that the id value have to be unique on the page. If you for example have two grids on the page and both have information with integer ids you can have conflicts. In the case you can use idPrefix option. In the case the value of id attribute of <tr> elements will be constructed from the idPrefix (which should be different in both pages of cause) and the "standard" id.


text:
Q: Set supplementary group ids of a user in linux using C There is setgroups(size_t size, const gid_t *list) method in C which would allow me to set the supplementary group ids of the calling process.
Question 1:
But in order run this we need to have proper rights so the only way I got to run this program without getting Operation not permitted error is to run it using root. But does that mean using this method we could only set the groups of root??
Question 2:
On the other hand what I intend to do is given a particular user and a list of gid's I want to set the given gid's as the supplementary groups to given user. Is there a method defined for this in C/C++?
Thanks in advance

A: Technically under Linux you need the CAP_SETGID capability, which need not be root (but normally is).
Note that this works with the effective gid, not the actual gid. Note also the actual / effective gid of the calling process is not necessarily the same as the actual / effective uid. You should have a look at the manpages for setuid, seteuid, setgid and setegid for more details, but one scenario would be for a SUID program to setegid back to an unprivileged group then use setgroups.


text:
Q: How to completely remove audio (kmix, pulseaudio) on kubuntu-desktop for rdp/x2go I use a ubuntu-server distribution (14.04) along with the package "kubuntu-desktop" to allow users to log in remotely and access a desktop. I currently use "x2go" as the remote-desktop connection software, but this question applies more to the desktop packages rather than the connection client. The server is also hosted using AWS, if that is relevant.
I now have about 10 regular users on the system. A concern that has come to my attention is the usage of audio processes on the server. I can run top and see many "kmix" processes, which take about 5% cpu each, and many "pulseaudio" processes, which range from 2-10% cpu each. In the case of "kmix", it looks like the same user is even spawning more than one process.
This is a serious drain on system resources, and there is no use of sound whatsoever in the usage of this system. (it is a research platform) How can I cleanly remove or disable all audio processes and features, system wide, from the "kubuntu-desktop" package?

A: You can disable sound in the session settings on the client. If this does not help, try disabling autostart of pulseaudio for the users.
Removing pulseaudio completely from the system may result in unpredictable behaviour.
Edit: Setting "autospawn = no" in /etc/pulse/client.conf should keep pulseaudio from autostarting for all users (man pulse-client.conf). For further explanation, see e.g. https://wiki.archlinux.org/index.php/PulseAudio/Configuration


text:
Q: Access get request in express with middleware Is there any way to access the request object that is sent to any route without accessing it in a .get or something like that but instead access any request sent to express globally?

A: Yes. That's the most of the point of middleware.
Quoting from the documentation:

var requestTime = function (req, res, next) {
  req.requestTime = Date.now()
  next()
}

app.use(requestTime)


text:
Q: parsing XML document Spring Config I am trying to read the spring configuration xml from the Unix file system but it throws this error, if I run it in windows this code works perfectly but when running in Unix does not load the xml.
Already validate that the xml exists in the unix file system and if it exists in the indicated path:
         private static final String URL_UNIX="/test/SCRIPTS/config/contextConfig.xml";

                String locate = "";
                locate= new File ("").getAbsolutePath ();
                String urlFinal= locate+URL_UNIX;

                    System.out.println("*****" +"Loading Config Context from File Sistem :UNIX *****");

                    File fichero = new File(urlFinal);

                        //Validate that configuration file exists
                    if (fichero.exists()){
                        System.out.println("*****" +"if exis  file: True *****");

                        // value urlFinal= /home/wasbin/test/SCRIPTS/config/contextConfig.xml
                  ctx = new FileSystemXmlApplicationContext(urlFinal);

                    }else{

                        logger.error("*****" +"ERROR: " + urlFinal +" NO Existe  *****");
                        exitCode = -1;
                        throw new Exception("*****" +"ERROR: " + urlFinal +" NO Existe  *****");

                    }

Stack Traced:
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [/home/wasbin/test/SCRIPTS/config/contextConfig.xml]; nested exception is java.io.FileNotFoundException: home/wasbin/test/SCRIPTS/config/contextConfig.xml (No such file or directory)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
    at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
    at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)
    at fi.banamex.s440.business.reports.ReportRunner.main(ReportRunner.java:96)
    at fi.banamex.s440.business.reports.BatchDispatcher.main(BatchDispatcher.java:107)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.io.FileNotFoundException: home/wasbin/test/SCRIPTS/config/contextConfig.xml (No such file or directory)
    at java.io.FileInputStream.<init>(FileInputStream.java:137)
    at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:113)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
    ... 19 more

I'm using: Spring framework 3.2 and jdk 1.6

A: I solved the problem by adding a prefix in the absolute path "file"
 // value urlFinal= "file:/home/wasbin/test/SCRIPTS/config/contextConfig.xml";

        ctx = new FileSystemXmlApplicationContext(urlFinal);

Load Success!


text:
Q: Proving Odd & Even Functions For the following:

If $f$ is an odd function, then $|f|$ is _______.
If $f$ is an odd function and $g$ is an even function then, $(f\circ g)(x)$ is _______.
If $f$ is an odd function and $g$ is an odd function, then $(f\cdot g)(x)$ is _______.

I can't tell the answer all of a sudden, however whenever I start trying to prove them, I get it.
Anyways, how would you guys approach this? I learned how to actually go about proving it but is there anyway you can solve this without actually trying to prove it?

A: 1. If $f$ is odd , then $|f|$ is even because $\left | f(-x) \right |= \left | -f(x) \right |= \left | f(x) \right |$.
2. If $f$ is odd and $g$ is even then $f\circ g$ is even. That is because if $h(x)=(f\circ g)(x)$ then:
$$h(-x)=\left ( f\circ g \right )(-x)= f\left ( g(-x) \right )= f(g(x))=h(x)$$
3. If $f$ is odd and $g$ is odd then $\varphi(x)=f(x) \cdot g(x)$ is even. That is because:
$$\varphi(-x)= f(-x) g(-x)= -f(x)\cdot (-g(x))= f(x)g(x)=\varphi(x)$$
Fixed typos!


text:
Q: Lose data on page refresh I am trying to achieve what may look like a simple task but it is totally confusing me.
When the user clicks a menu item the page refreshes and the user ends up on another page.
A div gets updated with an updated text.
The problem I have is that when the page is refreshed I lose the message "You are on a new page", how do I keep the updated message on the new page?
jquery -

html -

My link

A: You need to first "save" your first location in the infoObj, I suggest you do it with the url of the first page.
This will prevent the string "You are on a new page" when you are on the first page.
$(document).ready(function() {
    var infoObj = {};
    var url = window.location.href;

    if (localStorage.myLink != null) {
      infoObj = JSON.parse(localStorage.myLink)
      if (infoObj.url == url) {
        $('.mylink').html(infoObj.text);
      }
    }

    $("li.sub-level").click(function(e) {
      infoObj = {
        url: "PUT YOU FIRST PAGE URL HERE",
        text: "You are on a new page"
      }
      localStorage.myLink = JSON.stringify(infoObj)
    });
});

A: I think you should visit this link. i hope you will get your answer.
Link is here Demo Link
Or user this below code. how sessionStorage works.


text:
Q: #Develop installer- This setup requires the .NET Framework 3.5 SP1 to be installed I'm trying to install the latest version of #Develop but am getting the message
This setup requires the .NET Framework 3.5 SP1 to be installed
I'm running Windows 7, and I've tried running the installer for .NET Framework 3.5 SP1 plus the installer for the Windows 7 SDK.
The installer just says to use the Control Panel to turn Windows Features on and off to configure .NET Framework 3.5 SP1
Anyone got any suggestions ?

A: As the message says, install .net3.5 SP1

A: There seems to be a problem identifying whether .NET 3.5 SP1 is installed on Windows 7.
SharpDevelop's installer checks the following registry key to ensure .NET 3.5 SP 1 is installed:
Key="HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5"
Name="SP"
The value of this registry entry needs to be 1. Create this registry entry if it does not exist and SharpDevelop should install successfully.

A: I used Control Panel to disable the 3.5 features, reinstalled 3.5 sp1 and then used Control Panel to re-enable them.
I checked the registry value that Matt suggested, and it was indeed 1, without any editing required.
Ran the installer and it installed successfully.
I even have version 2.2 installed and both seem to work.


text:
Q: How to debug greenplum using gdb I need to use gdb to debug greenplum, the distributed version of PostgreSQL database. Now I have successfully installed greenplum and was able to use psql to run a sql. However, when I use gdb to debug it, it is difficult to get the code trace. It reports "no such file" frequently. I did not find useful documents online. Does anyone has related experience? Thanks.
For the greenplum database, I have one master node and two segment nodes.
In terminal A, I first use pg_backend_pid() on the master node to get the backend thread id.
[testDB=# select pg_backend_pid();
pg_backend_pid
----------------
           9893
(1 row)

In a different terminal B, I then use gdb to attach to the backend process:
gpadmin@greenplum-mdw:/home/build/gpdb$ sudo gdb -p 9893

I can see the threads information by "info thre":
(gdb) info thre
  Id   Target Id                                   Frame
* 1    Thread 0x7fe0a51a7740 (LWP 9893) "postgres" 0x00007fe0a24d587f in __libc_recv (fd=11, buf=buf@entry=0x102db80 <PqRecvBuffer>, n=n@entry=8192, flags=flags@entry=0)
    at ../sysdeps/unix/sysv/linux/x86_64/recv.c:28
  2    Thread 0x7fe08cee7700 (LWP 9894) "postgres" 0x00007fe0a194974d in poll () at ../sysdeps/unix/syscall-template.S:84

In terminal A, I run a sql through the psql interface:
[testDB=# select count(*) from customers;

In terminal B, I run the program by steps, but it says no such file or directory like this:
(gdb) n
29  ../sysdeps/unix/sysv/linux/x86_64/recv.c: No such file or directory.

and this
(gdb) n
pq_recvbuf () at pqcomm.c:925
925 pqcomm.c: No such file or directory.

I want to look at function PostgresMain, so I did:
(gdb) b PostgresMain
Note: breakpoint 1 also set at pc 0x87c860.
Breakpoint 2 at 0x87c860: file postgres.c, line 4590.

But after I run continue like this:
(gdb) c
Continuing.

It just never stop.

A: I finally found that greenplum did not add -g and -ggdb flags when compiling. I added it and then it works.


text:
Q: HTML Form Method Post with Golang So, I have this form in an html. It is intended to have a POST request to /subscribe page:

  <form action="/subscribe" method="post">
    First Name: <input type="text" name="first_name" placeholder="Willy"/>

    Last Name: <input type="text" name="last_name" placeholder="Warmwood"/>

    Email: <input type="email" name="email" placeholder="willy.warwood@gmail.com"/>

    <input type="submit" value="Submit"/>
  </form>

Then, I have this router in golang:
http.HandleFunc("/subscribe/", SubscribeHandler)

And this handler in golang:
func SubscribeHandler(w http.ResponseWriter, r *http.Request) {
    log.Println(r.Method)
}

But the problem is, it always print GET.
How to post the form, so the value of r.Method is POST?
Thanks

A: Per the docs:

If a subtree has been registered and a request is received naming the subtree root without its trailing slash, ServeMux redirects that request to the subtree root (adding the trailing slash). This behavior can be overridden with a separate registration for the path without the trailing slash.

Because you registered "/subscribe/", with the trailing slash, it is registered as a subtree.  Again, per the docs:

a pattern ending in a slash names a rooted subtree

Because an HTTP redirect is (in practice) always a GET request, the method after the redirect is of course a GET.  You can see that a real redirect is happening in this example: https://play.golang.org/p/OcEhVDosTNf
The solution is to either register both:
http.HandleFunc("/subscribe/", SubscribeHandler)
http.HandleFunc("/subscribe", SubscribeHandler)

Or point your form to the one with a /:
<form action="/subscribe/" method="post">


text:
Q: Where to put the custom error page on Google App Engine I would like to add a custom error page on my GAE service.
From the document , it doesn't mention where to put the error page.
Here is my app.yaml file:
handlers:
- url: /static
  static_dir: static

- url: .*
  script: mega_jav.wsgi.application

error_handlers:
- file: error_default.html

- error_code: over_quota
  file: error_over_quota.html

And I put my both error_default.html and error_over_quota.html in my templates folder.
It doesn't work.
Where should I put the error page into?
or can I modify the app.yaml file to make it works?
Thank you very much.

A: I suggest you read the docs https://cloud.google.com/appengine/docs/python/config/appconfig?hl=en#Python_app_yaml_Custom_error_responses
It's pretty clear, the error handler referers to a file but not a static resource (in fact there is an explicit warning to not make the file overlap with the static handlers (I raised the issue with the docs in 2010 as it didn't note this fact, causing deployment problems - https://code.google.com/p/googleappengine/issues/detail?id=3759)

Warning: Make sure that the path to the error response file does not
  overlap with static file handler paths.

The page for the error handler is deployed in your code base.
And it has nothing to do with templates. Though it's path could be in your templates. However its is purely static html/text that is served if there is an uncaught error, putting it in your templates could be a source of confusion as it's not a template.
The simplest place in is the root of your project.  The file directive is a relative path not a handler


text:
Q: How to clear logon credentials from WebView? I want to clear application data like i can do it from settings. I need to clear login information in WebView when i am login to facebook or twitter, because when i log on once for each of the following uses the same data automatically
I try this:
http://www.hrupin.com/2011/11/how-to-clear-user-data-in-your-android-application-programmatically
didn't work, login information are still in browser
I try reset app:
Intent i = getBaseContext().getPackageManager()
             .getLaunchIntentForPackage( getBaseContext().getPackageName() );
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);

also
@Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        view.clearCache(true);

        if(b){
            Log.d("WEBVIEW", "onFinisghed b true");
        Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
        noCacheHeaders.put("Pragma", "no-cache");
        noCacheHeaders.put("Cache-Control", "no-cache");
        view.loadUrl(url, noCacheHeaders);
        b = false;
        }...

Most of the entries refers to the first method which is described in the link, but it does not work in my case, any ideas?

A: Try clearing the browser cookies. Logon credentials are often stored in browser cookies, which you can delete by a call to
CookieManager.getInstance().removeAllCookie();

Update:
CookieManager.getInstance().removeAllCookie() was deprecated in Android SDK 21 (Lollipop), and was replaced by CookieManager.getInstance().removeAllCookies(ValueCallback callback). As of November 2018, removeAllCookie() stills works as specified. Also, in the newer method removeAllCookies(ValueCallback callback), the callback function can be null if you don't want to be notified about removed cookies. Thus, it's safe to use
CookieManager.getInstance().removeAllCookies(null)

as a direct replacement for CookieManager.getInstance().removeAllCookie() when targeting devices after Android SDK 21.
CookieManager documentation is here.

A: How about WebView.clearCache(boolean)?

A: CookieManager.getInstance().removeAllCookie();

above method will resolved problem but This method was deprecated in API level 21 so use removeAllCookies(ValueCallback) instead.
This method is asynchronous. If a ValueCallback is provided, onReceiveValue() will be called on the current thread's Looper once the operation is complete. The value provided to the callback indicates whether any cookies were removed. You can pass null as the callback if you don't need to know when the operation completes or whether any cookies were removed, and in this case it is safe to call the method from a thread without a Looper.
ValueCallback: a callback which is executed when the cookies have been removed


text:
Q: Why did Ymir die after being pierced by a spear, if she should have the regenerative powers of a Titan? In one of the last episodes of the anime of Attack on Titan, we see a flashback where Ymir is pierced by a spear, and because of this she dies. But by then she had the powers of the titans, so she should be able to regenerate her wounds.
Why did Ymir die after being pierced by a spear, if she should have the regenerative powers of a Titan?


text:
Q: Existence of 2006 distinct natural numbers Does there exists $2006$ distinct natural numbers such that the sum of any two divides the sum of all the given numbers?

A: The answer is no, and for any $n$, not just $n=2006$.
Suppose $a_1<a_2<\cdots<a_n$ be a such numbers, with the desired property. Let $S=\sum_{k=1}^n a_k$. Then observe that, $a_n+a_{n-1},a_n+a_{n-2},\cdots,a_n+a_1$ all divide $S$, and
$$
\frac{S}{a_n+a_1}>\frac{S}{a_n+a_2}>\cdots>\frac{S}{a_n+a_{n-1}} \geq 2.
$$
Hence,
$$
\frac{S}{a_n+a_1}\geq n+1 \implies a_1+\cdots+a_{n-1}\geq na_n+(n+1)a_1,
$$
which is a clear contradiction.