text:
Q: Vscode+arduino : Where to find the "arduino.json" parser? I'm trying to upload a new program into my ESP8266 but I want to do this OTA like I do it with arduino's IDE successfully.
I have vscode + arduino's extension installed.
I guess the "arduino.json" is read by vscode before sending program.
I set the "port" field "port": "192.168.x.xxx",
Now I want to set the password field too, but I don't know how it is supposed to be named ("password" or "auth" doesn't seems to work!)
So where can I find the code that parse the "arduino.json" file and pass the parameters to espota.py file execution?
(I know that espota.py is waiting the password in the field --auth="xxx"


text:
Q: Storing contents from Viewbag into a local jquery array or object Let's imagine a situation like this:
I have an ViewBag dynamic object which is basically a list fille with some results;
Scenario 1:

*

*User 1 comes in and fills the ViewBag.Products object with a list of 50 items inside;

Scenario 2:

*User 2 comes in and fills ViewBag.Products object with a list of 50 NEW items which ARE DIFFERENT than the previous 50 ones of a user 1.

Now when the both users get displayed results onto their page, which is located at /Analyze/Index <- view
I enable them so that they can sort out that list by a certain property of a class which is located inside the object like this:
public JsonResult GetSortedBySales()
    {
        var list = lista.OrderByDescending(x => x.SaleNumber).ToList();
        return Json(list, JsonRequestBehavior.AllowGet);
    }
    public JsonResult GetSortedByFeedback()
    {
        var list = lista.OrderByDescending(x => x.Feedback).ToList();
        return Json(list, JsonRequestBehavior.AllowGet);
    }

As you can see this produces an issue like this:
The last user that added it's own items to the list are the items which will be shown to User 1 when he tries to sort out the list, since the list is now filled with User #2's items...
The list is filled with the items from the eBay API, therefore I cannot guarantee the integrity and uniqueness of the data to each user...
What I thought I can do here?? Is that I can store these items from the list somehow into the local jquery array and then perform the sorting from that local array, so that each jquery array is local to each user in their browser and no mixing of data is done...
Do you guys understand me what I'm trying to achieve here?
I apologize if my English is bad, I've tried my best to explain the issue that I have.
Edit: here is more data on what I'm trying to achieve
Basically I have a form where users perform a search of ebay items based on a certain keyword. After the search via http request I display the results to them in a manner where they can select all of those products in a table and then perform analyzing of those selected products.
Then they are transferred with another page with the analyzed data and I display the results to them in the list object called "lista".
The "lista" list is always filled differently based on what the user searches on the page via the process that I just explained above.
So the "lista" object is always filled with the new data and when the user performs sorting of data in list "lista" they are always displayed differently if 2 users perform analyzing of data like in scenario 1 and 2 that I explained above.
Does this helps?
Edit 2:
Here is a graphical explanation of what I ment
Step 1:

Step 2:

P.S. the "lista" list is declared as static, is that what's causing the issue?
Edit again:
Okay so guys I've found a way so that the data isn't changed when I sort it. Instead of doing a jQuery post, I perform sorting of data based on two extra attributes that I added into my table tr - sales and feedback and then sorted it like following:
$(".feedbackClick").click(function() {
    var $wrapper = $('#tableSellers');

    $wrapper.find('.test').sort(function(a, b) {
        return +$(b).attr('feedback') - +$(a).attr('feedback');
    }).appendTo($wrapper);
});

This sorts the data locally in jQuery thus no data is lost at the time when multiple users perform a search.

A:
P.S. the "lista" list is declared as static, is that what's causing the issue?

Yes.  That is the problem.
You should almost never be using static variables in a web site, as those variables will end up being shared across all users.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Chaining dataframes in a list I have a list of data.frames an example of which can be found in the example.data below
example.data <- list(
  stage1 <- data.frame(stuff=c("Apples","Oranges","Bananas"),
                       Prop1=c(1,2,3),
                       Prop2=c(3,2,1),
                       Wt=c(1,2,3)),
  stage2 <- data.frame(stuff=c("Bananas","Mango","Cherry","Quince","Gooseberry"),
                       Prop1=c(8,9,10,1,2),
                       Prop2=c(23,32,55,5,4),
                       Wt=c(45,23,56,99,2)),
  stage3 <- data.frame(stuff=c("Gooseberry","Bread","Grapes","Butter"),
                       Prop1=c(9,8,9,10),
                       Prop2=c(34,45,67,88),
                       Wt=c(24,56,31,84))
)

The data.frames will always have the same number of columns but their rows will vary, as will the number of data.frames in the list.  Notice the chain through the list apples go to bananas, bananas go to gooseberry and gooseberry goes to butter.  That is, each pair of data.frames has a common element.
I want to scale-up the weights throughout the whole list as follows.  Firstly, I need to input my final weight, say 20e3.  Secondly I need a scale factor for the last row, last column of the last data frame: in this particular case this will be 20e3/84 for the last dataframe.  I want to use this scale factor at some point to create new columns in the last dataframe.
Next I want to scale between the last dataframe and the previous one.  So using the scale factor previously calculated the input for the stage2 is (24*20e3/84) / 2 that is the weight of stage3 Gooseberry multiplied by the scale factor with respect to 20e3 divided by the stage2 Gooseberry weight to give a new scale factor.  This process is repeated (via Bananas) to give the stage1 scale factor.
In this particular example the scale factors should be 42858.0  2857.2   238.1 for stage1  stage2  stage3.
I tried doing a for loop over the reverse of the length of the list with appropriate sub-setting after extracting the coordinates of the last element of each data.frame.  This failed because the for loop was out of synch.  I'm loathe to post what I've tried in case I lead anyone astray.
Not getting many responses so here's what I've done so far ...
last.element <- function(a.list) {

  ## The function finds the last element in a list of dataframes which

  a <- length(a.list) ## required to subset the last element
  x <- dim(a.list[[a]])[1]
  y <- dim(a.list[[a]])[2]

  details <- c(a,x,y)
  return(details)
}

details  <- as.data.frame(matrix(,nrow=length(example.data),ncol=3))

for (i in length(example.data):1) {
  details[i,1:3]  <- last.element(example.data[1:i])
}

The function gives the last element in each of the data.frames down the list.  I've set up a data.frame which I want to populate with the scale factor.  Next,
details[,4] <- 1

for (i in length(example.data):1) {

  details[i,4]  <- 20e3 / as.numeric(example.data[[i]][as.matrix(details[i,2:3])])

}

I set an extra column in the details data.frame ready for the scale up factors.  But the for loop only gives me the last scale factor,
> details
  V1 V2 V3         V4
1  1  3  4  6666.6667
2  2  5  4 10000.0000
3  3  4  4   238.0952

If I multiply 238.0952 by 84 it will give me 20000.
But the scale factor for the second data frame should be (24 * 238.0952) / 2 that is ... all the weights in the third data.frame are multiplied by the scale factor.  A new scale factor is derived by dividing the scaled up Gooseberry value in the third data.frame by the Gooseberry value in the second data.frame.  The scale factor for the first data frame is found in a similar manner.


text:
Q: Как поставить нужный порядок элементов в Bootstrap 5? (нестандартная ситуация) Моя проблема заключается в следующем:

*

*При адаптивной верстке необходимо, чтобы при расширении экрана xxl+ было вот так:

*При остальном расширении (xl и меньше) необходимо создать следующий порядок:

A: Дока по тому что вы ищите
https://getbootstrap.com/docs/5.1/utilities/flex/#direction
Вам необходимо поиграть с данными свойствами изучить их работу и собрать то что требуется. Делайте группировку блоков и у же к ним применяйте реверс.
По ссылки, что выше, найдете много полезной информации как решить не только это, главное хорошо изучи как все работает на личном опыте
Пример решения 1

Flex item 1

Flex item 2

Flex item 3

Flex item 1

Flex item 2

Flex item 3

Пример решения 2

Flex item 1

Flex item 2

Flex item 3

Flex item 1

Flex item 2

Flex item 3


text:
Q: How to keep different colors on tab's background in android? I want to change the background color of the tab. for e.g if there are three tabs on single activity then need to keep different colors on that three tabs. Please anyone can do this?

A: You can follow below link for your requirement:
http://www.technotalkative.com/android-change-tab-bar-background-color/
It sets default colors on startup as well change color on tab change if you want to implement that too.
thanks your upvote would be appreciated back :)


text:
Q: show hive partitions in a nested sub query I have a hive table that is partitioned by day (e.g. 20151001, 20151002,....).
Is there a hive query to list these partitions in a way that it is possible to be used in a nested sub query?
That is can I do something along the line of:
SELECT * FROM (SHOW PARTITIONS test) a where ...

The query-
SELECT ptn FROM test

returns as many rows as the number of rows in the test table. I want it to return only as many rows as the number of partitions (without using the DISTINCT function)

A: A potential solution is to find the partitions from the hdfs location for the table of interest by using either shell script/python.
The data that corresponds to the hive table is stored in the hdfs e.g
/hive/database/table/partition/datafiles
in your case,
/hive/database/table/20151001/datafiles
If the table is bucketed there are as many individual files as the cluster size.
Once you have the above path, create a shell script to loop through the folder (in this case 20151001 etc..)
capture this in a shell variable and pass it as a parameter to the hive query.


text:
Q: Existence of smooth partition of unity Suppose that $0<\alpha_1<\cdots<\alpha_n<1$. Let $M$ be a smooth paracompact connected manifold of dimension $d$.
Let $(U_k)_{k\in\mathbb{N}}$ be a locally finite open covering of $M$. Suppose that each $U_k$ is relatively compact.
Is it true that there exists a partition of unity $(\zeta_k)_{k\in\mathbb{N}}$ on $M$ subordinates to the open covering $(U_k)_k$ such that for each $k\in\mathbb{N}$ $\zeta_k$ and $\zeta_k^{\alpha_1}$ and $\cdots$ $\zeta_k^{\alpha_n}$ are smooth?
I want to know especially the result when $\alpha_1=\frac{1}{4}, \alpha_2=\frac{1}{2}$.


text:
Q: Regex to remove specific words I want to without words of abc: with def:
Only want to match "22" "46"
How can without that words?

A: Although you did not specify much information, you may use the regex below, it matches only the numbers :
[^"A-z: ]+

or use  :
\d+


text:
Q: Sublime 4/Vintage: repeat key on key down only in edit mode On my mac, I need to be able to access special characters such as accents for editing purposes and for now I access this by holding a key down and then get the suggestions shortcut.
However, I would like to use the Vim mode in Sublime as well so moving around with h, j, k, l is quite tedious if I can't hold the key down to move faster.
Is there any way to only repeat a key when pressing it down in edit mode, or to have this behaviour only for h, j, k, l?
Thanks

A: Probably unsurprisingly, the press-and-hold-for-special-characters behavior is a macOS feature. It doesn't seem possible to change the behavior on the fly. You can adjust it per app like this:
defaults write com.sublimetext.4 ApplePressAndHoldEnabled -bool false

So the question becomes: how can you enter special characters in insert mode? In vanilla vim, you could use inoremap to replace, say, Option+l with "ł". However, NeoVintageous (which I hope you're using, not the deprecated Vintage mode) does not support remaps in insert mode. It claims to support digraphs, which would be another way of achieving this. However, the keyboard command to insert a digraph is Ctrl+k, which conflicts with one of the default Sublime Text key bindings on macOS. (The one to kill from the cursor to EOL, which is copied from Emacs and available in standard macOS text fields.) It's presumably possible to work around this, but I felt like Ctrl+k+l+/ was kind of wordy anyway.
Fortunately, there IS a fast, simple solution: a Sublime key remap. Open your user key bindings (Sublime Text > Preferences > Key Bindings) and add this one:
    { "keys": ["option+l"], "command": "insert", "args": {"characters": "ł"} }

Now Option+l will add the l-slash character to your document. If you need the special character this is replacing (the not sign "¬"), you can of course choose another binding.
I presume this is the one you want, since it's the only special character available for me when I press-and-hold any of the hjkl keys. But this approach will work equally well for any other characters you might want to insert.


text:
Q: Get Return URL Query String Value having # I am working on an application that uses Angular.js and ASP.NET MVC. The routes for angular.js  contain a '#'. Some pages in the application can be viewed without needing to log in. These pages however contain URL's to pages in the application that need the user to be logged in. They look like:
Want this voucher?

So when these links are clicked, MVC forms authentication redirects to the sign in page with the return URL query string that looks like this:
http://localhost:18030/signin?ReturnUrl=%2f#/shop/voucher/6bc1

So on the sign in pages, when i try to look at the query string I only get '/' for return URL as that is the %2f part. I lose the remaining value because of the #.
If I try to URL encode the link, the # and other '/' characters do get encoded but then the routing gets messed up and I get 404 errors.
Is there anyway to access the full query string value with the '#' in it? I am not sure why forms authentication does not encode the #.

A: The url fragment is never sent to the server, so you have to get a little creative here.
One way I have solved this in the past is to use client side code to modify the action URL for the login, and append the fragment as a query string parameter.
//Pulls out everything past the '#'
var fragment = $location.path();

$scope.fragmentParam = "&fragment=" + fragment;

You can append that query string param to your form action, and then handle it on the server side in order to redirect the user appropriately.
public ActionResult Login(MyLoginInfo info, string returnUrl, string fragment){

    //Normal login code

    var redirectUrl = String.Format("{0}#{1}", returnUrl, fragment);

    Redirect(redirectUrl);

}

This is a simplified version, but you should be able to get the general idea. You need to pass that information to the server, and then reconstruct a redirect url that includes the fragment.


text:
Q: Have changed content of file, but in web browser the new content appears only after some minutes. Where to set cache time CentOS php? Using WinSCP and Notepad++ changed content of php file. Save.
Then in web browser open the changed file. But see previous content. The changed (new) content appears only after ~3 minutes.
Here https://stackoverflow.com/a/1581067/2465936 found related question. And answer that it is related with cache time. So as understand need to change cache time? Where to change? Suppose in php.ini? What to change? Tried to reduce session.cache_expire = 180 but no solution.
May be it is because of Varnish http://www.servermom.com/install-varnish-3-to-run-with-apache-2-on-centos-server/552/ ? May be to try to uninstall?

A: It is because of Varnish program. Possibly need change configuration.
Or can uninstall
yum remove varnish
Then edit httpd.conf (change ports to 80)
Then service httpd restart


text:
Q: I have some troubles with my code I'm having some troubles with my code. I'm running the code I put the teams like Madrid - Barça and then in File only appears Madrid. Otherwise if I put only Barça, the file don't recognize 'ç'.
while (camp<5) {
  printf("Altere Jogos da Liga dos Campeões %d: ", camp+1);
  scanf("%s", futebol[camp].campeoes);
  while (getchar() != '\n');
  camp++;
}

feventosDesportivosFutebol = fopen("EventosDesportivosFutebol.txt", "w");
if (feventosDesportivosFutebol != NULL) {
  fprintf(feventosDesportivosFutebol, "\n\nLiga dos Campeões:\n\n");
  for (camp = 0; camp<5; camp++) {
    fprintf(feventosDesportivosFutebol, "%s\n", futebol[camp].campeoes);
  }
}
fclose( feventosDesportivosFutebol);

Someone can help me?


text:
Q: NDIS proto sample and ethernet bridge I was trying to write a test bridge between two ethernet adapters using the NDIS proto example given in the WDK for Win 7. So far just got the driver and prototest built.
Now I was wondering how to proceeed?
Is there any way to bind to only a couple of adapters at one time?

A: An NDIS protocol automatically binds to all supported adapters.  So you don't need to do extra work to get NDISPROT to bind over two Ethernet NICs.
Once you've built the driver, all you need to do is:

*

*Install the driver (use INetCfgClassSetup::Install as illustrated in the bindview sample; or for casual experimentation, the NIC properties GUI has an Add... button that lets you install protocols with a GUI).

*Start the driver service (use StartService API; or for casual experimentation, net start ndisprot will do).

That's it.  NDIS will call your protocol's ProtocolBindAdpaterEx handler for each Ethernet NIC on the system.  This callback is named NdisprotBindAdapter in the sample.
Use !ndiskd.protocol to verify that your protocol is now bound to multiple miniports.


text:
Q: Accessing Nested Field Values javascript I'm trying access accounts -> posts -> message with a for loop but I'm not sure how to write the dot annotation for accessing the nested field values. With the code below I receive the first field value for accounts -> posts -> message but I want to be able to access all instances of message for all posts under the account. Thank you.
FB.api(
'/me',
'GET',
{"fields":"accounts{posts{message,permalink_url,picture,created_time}}"},
function(response) {
  console.log('GET accounts completed');
  console.log(response);
    var list = document.getElementById('status');

    for (var i=0; i < response.accounts.data.length; i++) {
            console.log('FOR Loop completed');
            var li = document.createElement('li');
            li.style.listStyle = 'none';

            li.innerHTML = response.accounts.data[i].posts.data[i].message;
            list.appendChild(li);

    }

}
);

A: It's not hard, use a for loop again for the posts.data.
for (var i=0; i < response.accounts.data.length; i++) {
        console.log('FOR Loop completed');
        var li = document.createElement('li');
        li.style.listStyle = 'none';

        var posts = response.accounts.data[i].posts.data;
        for (var j = 0; j < posts.length; j++) {
            li.innerHTML = posts[j].message;
            list.appendChild(li);
        }
}


text:
Q: Can we rule out sets like $R:=\{r,\{r\},\{\{r\}\},...| r\in R \land urel(r)\}$ in a set theory with regularity and urelements? Sorry if the question is asked sloppily (I'm not a set theorist), but can we generally rule out the existence of a set like $R:=\{r,\{...,r,...\},\{...,\{...,r,...\},...\},...| r\in R \land urel(r)\}$ in a set theory with the axiom of regularity and urelements? (Is there any such set theory that is worked out?) A simpler version of the question would be for $R:=\{r,\{r\},\{\{r\}\},...| r\in R \land urel(r)\}$. Looking at the regularity axiom in ZFC, there's no mention of urelements (of course because there are no such things in ZFC), but I wonder if there's any other way to ban such sets in a system where urelements do exist.

A: This answer is primarily to make something explicit which was stated in the comments.
In ordinary set theory, we have the axioms of infinity and replacement. If we have any $r$, these axioms together allow us to form the set $\{r, \{r\}, \{\{r\}\}, ...\}$ for every specific $r$. We do this by defining $f_r(0) = r$, $f_r(S(n)) = \{f_r(n)\}$ using recursion on $\mathbb{N}$ - then the desired set is $\{f_r(n) | n \in \mathbb{N}\}$.
It's also possible to interpret your set as $S = \{f_r(n) | n \in \mathbb{N}, r$ a urelement$\}$. That is, if $u$ and $v$ are both urelements, the set would contain $u$, $\{u\}$, $\{v\}$, etc. If the class of urelemenets forms a set (which it usually does), the set $S = \{f_r(n) | n \in \mathbb{N}, r$ a urelement$\}$ exists by the axiom of replacement again. Conversely, if $S$ exists, then the class of urelements forms a set, since the class of urelements is a subclass of $S$.


text:
Q: Setting date into "dd"-"mm"-"yy" format from "dd"-"mm"-"yyyy" in java I have a date in the format dd-mm-yyyy format(inside my db).I need to convert it to dd-mm-yy format.I retrieved date from db and stored it inside a string.
String date=doc.getString("date");

for example: 05-19-1990

to
    05-19-90.

That 1990 is not fully needed only 90 is needed.Using split() in java  i tried some thing but it wont helps me.Can anyone please help.Any help will be highly appreciated.......

A: Use DateFormat for that issue:
DateFormat df = SimpleDateFormat("dd-MM-yyyy");
DateFormat df1 = SimpleDateFormat("dd-MM-yy");
df1.format(df.parse(date));

A: Try below code
 try {
        SimpleDateFormat sdf= new SimpleDateFormat("MM-dd-yy");
        Date d = sdf.parse("05-19-1990");
        System.out.println(sdf.format(d));
    } catch (ParseException ex) {
       ex.printStackTrace();
    }

A: Use two SimpleDateFormats, one to parse it, one to format it..
SimpleDateFormat in = new SimpleDateFormat("MM-dd-yyyy");
Date inDate = in.parse(date); // 05-19-1990
SimpleDateFormat out = new SimpleDateFormat("MM-dd-yy");
String newDate = out.format(inDate);

or
SimpleDateFormat out = new SimpleDateFormat("dd-MM-yy");
String newDate = out.format(inDate);

If you really want 19-05-90 as per the title of your question ;)
Check java.text.SimpleDateFormat for more details

A: Try this..
DateFormat df2 = new SimpleDateFormat("dd-mm-yy");
String formattedDate2 = df2.format(theDate);


text:
Q: Save TextInput on button press - kivy/python I have a class with a button "Save game", which opens a popup with textinput widget and a button with which I would like to save the users text input. I tried this but it doesn't work.
If I print out the filename after "modifying" it, it prints out the filename that I defined beforehand: .txt, not Game1.txt or something like this.
class Something(Widget):
    filename = ".txt"
    # code for game
    def save(self,*args):
        def on_text(instance, value):
            return value

        name = TextInput(text="")
        name.bind(text=on_text)
        self.filename = "{}.txt".format(name.text)

        b = BoxLayout()
        save_button = Button(text="Save file")
        b.add_widget(save_button)
        b.add_widget(name)
        popup = Popup(title="Enter the name:", content=b)

        save_button.bind(on_release=popup.dismiss)
        name.bind(on_text_validate=popup.on_dismiss) # I wanted to save it when the user closes the popup
        popup.open()

Where am I doing it wrong? (I know this won't actually save it, I just want to create the name here, I have a different class method for saving it)

A: I'm looking at a similar problem: when the user types text into a text input box, but does not hit return before hitting the 'exit' button, the changes are lost.
You might want to see if this is your error as well.


text:
Q: Updating an Appointment causes it to change to a Meeting in EWS 1.1 Here's what I'm trying to do:

*

*get all items on a user's calendar between two dates

*update the Location or Subject for some items

I get the items with:
FindItemsResults<Appointment> findResults = calendar.FindAppointments(new CalendarView(startDate, endDate));
This query works fine. But whenever I call Update to save the item I get an exception:
Microsoft.Exchange.WebServices.Data.ServiceResponseException: One or more recipients are invalid.
Even though I get an exception, the item is saved and gets changed to have IsMeeting set to true!  Now the updated item is a meeting with an organizer etc...  This is, effectively, data corruption for me.
Here's the code. It is no more complicated than this.  I've tested it by just changing Location or Subject and both cause the problem.
Appointment a = Appointment.Bind(_service, new ItemId(id));
a.Location = newLocation
a.Update(ConflictResolutionMode.AlwaysOverwrite);

Am I missing some concept or something? This seems like a pretty egregious problem.
FWIW, this is EWS 1.1 against an Office 365 server.

A: So tig's answer works when you never want to send out appointment updates to the other attendees. However to answer this properly you actually need to get the attendee state loaded.
By default it is trying to send appointment updates to the attendees, however your appointment object doesn't have the attendee state loaded and is hence blowing up. When you do the bind you should load the attendee properties. You should probably also load the organizer as well to cover another edge case:

*

*AppointmentSchema.RequiredAttendees

*AppointmentSchema.OptionalAttendees

*AppointmentSchema.Resources

*AppointmentSchema.Organizer

This will get the attendees populated if you want to do an update that sends out updates to the attendees.
However there is then another edge case that you have to worry about. If you have an appointment with no attendees added to it (just the organizer), then EWS may still complain and throw this error. It will actually work for appointments in some states, but fail in other states.
So the most complete solution is a combination of:

*

*Loading the attendee state.

*Inspecting the attendee state to see if there are any attendees other than the organizer (depending on how the appointment was created the organizer may or may not appear in the RequiredAttendees collection). If there are not then you must use SendInvitationsOrCancellationsMode.SendToNone.

So the full sample would look something like:
Appointment a = Appointment.Bind(_service, new ItemId(id), new PropertySet(AppointmentSchema.RequiredAttendees, AppointmentSchema.OptionalAttendees, AppointmentSchema.Resources, AppointmentSchema.Organizer));
a.Location = newLocation

// Check if the appointment has attendees other than the organizer. The organizer may
// or may not appear in the required attendees list.
if (HasNoOtherAttendee(a.Organizer.Address, a.RequiredAttendees) &&
    (a.OptionalAttendees.Count == 0) && (a.Resources.Count == 0))
{
    a.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);
}
else
{
    // We have other attendees in the appointment, so we can use SendToAllAndSaveCopy so
    // they will see the update.
    a.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToAllAndSaveCopy);
}

bool HasNoOtherAttendee(string email, AttendeeCollection attendees)
{
    bool emptyOrOnlyMe = true;
    foreach (var a in attendees)
    {
        if (!string.Equals(email, a.Address, StringComparison.OrdinalIgnoreCase))
        {
            emptyOrOnlyMe = false;
            break;
        }
    }
    return emptyOrOnlyMe;
}

A: I figured it out with help from this Question:
Exchange Appointment Types
The key is the Update method needs to be called with the SendInvitationsOrCancellationsMode.SendToNone flag set in the 2nd parameter.
Like this:
a.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);

A: To answer this bit of the question

"Even though I get an exception, the item is saved and gets changed to
  have IsMeeting set to true! Now the updated item is a meeting with an
  organizer etc... This is, effectively, data corruption for me."

The Microsoft documentation states, in the small print,  "A meeting request is just an appointment that has attendees. You can convert an appointment into a meeting request by adding required attendees, optional attendees, or resources to the appointment"  - as seen here
http://msdn.microsoft.com/en-us/library/office/dd633641%28v=exchg.80%29.aspx
In other words, as soon as you have any attendees, Exchange converts it to a meeting automatically.

A: public static bool UpdateAppointment(ExchangeCredential credentials,
           ItemId appointmentId, string newLocation, string newSubject,
DateTime startTime,
            DateTime endTime)
        {
            ExchangeService service = GetExchangeService(credentials);
            try
            {
                Appointment appt = Appointment.Bind(service, appointmentId,
                    new PropertySet(BasePropertySet.IdOnly, AppointmentSchema.Start,
                        AppointmentSchema.ReminderDueBy, AppointmentSchema.End,   AppointmentSchema.StartTimeZone,
                        AppointmentSchema.TimeZone));

                appt.Location = newLocation;
                appt.Start = startTime;
                appt.End = endTime;
                appt.Subject = newSubject;
                // very important! you must load the new timeZone
                appt.StartTimeZone = TimeZoneInfo.Local;
                //appt.Body.Text = newBody; //if needed
                appt.Update(ConflictResolutionMode.AlwaysOverwrite);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return true;
        }


text:
Q: React combineReducers create action for secondReducer after firstReducer finished I have several reducers and using combineReducers
`export default combineReducers({
firstReducer: firstReducer,
secondReducer: secondReducer});`

I want to trigger secondReducer only when have firstReducer data in state.
What is the correct approach?

A: You need this:
http://redux.js.org/docs/api/applyMiddleware.html
Try it please.


text:
Q: Center of mass in a straight rod I got an assignment to prove that in a straight homogeneous rod, you can always choose a coordinate system in such a way that
$$\int_S x_1 \, dx_1 \, dx_2=0 $$
$$\int_S x_2 \, dx_1 \, dx_2=0 $$
$$\int_S x_1x_2 \, dx_1 \, dx_2=0$$
where $S$ is the cross section of the rod
Now, intuitively, I can understand that the first two expressions basically state that if you find the mass center of the rod, then all you have to do is to put the origin of the coordinate system in the mass center, and the integrals turn out to be zero. What I'm curious about is whether or not this is a good enough of an explanation, and also, a hint on how to obtain the third equality.

A: For the third, put the origin at the centroid of the cross section of the rod.  As you say, that will make the first two integrals zero.  Pick the orientation of the $x_1$ axis randomly.  Now imagine rotating the coordinate system $\frac \pi 2$ counterclockwise, plotting the integral as a function of rotation angle.  It is clearly a continuous function.  After the rotation, you can also get the same integral with the substitution $x_1 \to x_2, x_2 \to -x_1$, so the sign will invert.  Somewhere in the rotation there must be a point where the value is zero.


text:
Q: Pop certain screens and push a screen in flutter I pushed(with named routes) few screens like so,
BaseScreen >>(pushNamed) ScreenOne >>(pushNamed) ScreenTwo >>(pushNamed) ScreenThree >>(pushNamed) ScreenFour
While I am at ScreenFour what I wanted was that instead of just pushing ScreenFour to the stack, to remove ScreenThree and ScreenTwo from the stack and then have ScreenFour at top of the stack.
so at the end while im at ScreenFour the stack should look like,
BaseScreen >> ScreenOne >> ScreenFour.
How can I achieve this in flutter?

A: Okay you can do that using Navigator.pop(context), before pushing ScreenFour, use Navigator.pop twice. That would do BaseScreen >> ScreenOne >> ScreenFour.

A: You can use Navigator.pushAndRemoveUntil() for 2nd and 3rd screen and use normal Navigator.push  for 4th screen.
Thus it will be possible.
Learn more about pushAndRemoveUntil here


text:
Q: How to differentiate this integral? Given
$$g(x)=\int_{0}^{x} (x-t)e^{t}dt$$ find out $g''(x)$
I thought of using Lebnitz theorem to differentiate it but using Lebnitz I get this $g'(x)=1\cdot (x-x)e^{x}=0$ I don't know how to find the second order derivative of this function.

A: Your zero Leibniz partial result comes from the upper limit of the integral. You forgot the contribution
$$\int_0^x \frac{\partial}{\partial x}((x-t)e^{t}) dt = \int_0^x e^t d t=e^x-1$$
So $g'(x)= e^x-1\;$ and $g''(x)= e^x.$
The Leibniz rule for your case is (see e.g. http://mathworld.wolfram.com/LeibnizIntegralRule.html)
$$\frac{\partial}{\partial x}\int_{a(x)}^{b(x)} f(t,x) dt =
\int_{a(x)}^{b(x)}
 \frac{\partial}{\partial x} f(t,x) dt + f(b(x),x)\frac{\partial b(x)}{\partial x}
-f(a(x),x)\frac{\partial a(x)}{\partial x}
$$
With $b(x) = x, \; f(t,x)=(x-t)e^{t}\; $
the mentioned contribution is the first term, your's is the second and the third is obviously zero because $a(x)\equiv 0$.

A: Write:
$$\forall x\in\mathbb{R},\ g(x)=x\int_0^x\mathrm{e}^t\,\mathrm{d}t-\int_0^x t\mathrm{e}^t\,\mathrm{d}t.$$
This can be computed explicitly, but we don't really mind, as we can differentiate using the product rule (and the integrals that appear are understood as antiderivatives):
$$\forall x\in\mathbb{R},\ g'(x)=\int_0^x\mathrm{e}^t\,\mathrm{d}t+x\mathrm{e}^x-x\mathrm{e}^x=\int_0^x\mathrm{e}^t\,\mathrm{d}t$$
and hence
$$\forall x\in\mathbb{R},\ g''(x)=\mathrm{e}^x.$$


text:
Q: Show a WebApp hosted in localhost on windowsform I have a custom HMI (Human machine interface) programmed in VB.NET. I want to show a webapp that is hosted in other pc (localhost:888) on my HMI. To do this, I put a webbrowser in my windowsform. I have never done this, so for testing I tried with www.google.com in the webbrowser URL and it works.
Now I want to show the webapp in this webbrowser. What URL should I set ?
My PC and the Windows Server PC are in a local area network, the IP's are:
My PC: 192.168.1.99
Server: 192.168.1.90

A: I done it, sorry if this was a very noob question.
I did 192.168.1.90:888


text:
Q: Detecting small circles with OpenCV (bad image quality) I'm trying to detect the four dots you can see in the center of this picture:

This one is converted to png, I actually use a ppm format (after conversion from raw output from the camera). The actual processed image is available here
I'm new to opencv and therefore have a huge problem detecting those dots. Here's my so far best result:

As you can see, I've detected 3 of the dots, but aside from that also lots of other things in the picture are recognized as circles.
And here's the code:
    IplImage* img;
    if((img = cvLoadImage( "photos/img-000012.ppm", 1)) == 0 )
    {
        perror("cvLoadImage");
        return 1;
    }
    cvNamedWindow( "Image view", 1 );
    cvShowImage( "Image view", img );
//  cvWaitKey(0);

    IplImage* gray = cvCreateImage( cvGetSize(img), 8, 1 ); // allocate a 1 channel byte image
    CvMemStorage* storage = cvCreateMemStorage(0);
    cvCvtColor( img, gray, CV_BGR2GRAY );
    cvShowImage( "Image view", gray );
//  cvWaitKey(0);

    cvSmooth( gray, gray, CV_GAUSSIAN, 3, 3, 0, 0 );
    cvShowImage( "Image view", gray );
    cvWaitKey(0);

    CvSeq* circles = cvHoughCircles(gray, storage, CV_HOUGH_GRADIENT,
            4,      // inverse ratio of the accumulator resolution
            1,      // minimum distance between circle centres
            100,    // higher threshold value for Canny
            20,     // accumulator threshold for the circle centers; smaller->more false circles
            1,  // minimum radius
            10 );   // maximum radius

    printf("circles == %d\n", circles->total);
    int i;
    for (i = 0; i < circles->total; i++) {
        float *p = (float*)cvGetSeqElem(circles, i);
        CvPoint center = cvPoint(cvRound(p[0]),cvRound(p[1]));
        CvScalar val = cvGet2D(gray, center.y, center.x);
        if (val.val[0] < 1) continue;
        printf("%d %d %d\n", cvRound(p[0]),cvRound(p[1]), cvRound(p[2]));
        cvCircle(img,  center, cvRound(p[2]),             CV_RGB(0,255,0), 1, CV_AA, 0);
    }
    cvShowImage( "Image view", img );
    cvWaitKey(0);

Do you have any idea how to help that? I would be most grateful. I think it's quite easy for a human eye to spot the dots, so I hope I can detect them using a computer.

A: You should have a look at this post.
With the application I am developing based on it, I got:

You could basically adapt this method to you case and make it much more efficient:
 "5." ("validate or invalidate contours on the grant of their shape (size, area, convexity..."). In your case could be much more stringent since you do not have clusters of circles. You could just map objects that are almost perfect circles. In addition, you know that your circles have the same size/relative intensity...
Tell me if anything is not clear,
Good luck,

A: I think that hough transform is not a best case. Probably you can segment them and simply recognize using their color and geometric parameters.


text:
Q: What is a good way to test a simple Recurrent Neural Network I have coded up a simple real-value regression RNN in theano.

*

*What kind of dataset should I test it on?

*How should I go about testing it?

My structure is:

*

*Univariate (for now) timeseries, $x_{in}(t)$

*$n_{Input Nodes}$ separated by ~equal timesteps, $t_{step}$. Where, $n_{Input Nodes}$ should be sufficiently large to capture a recurrence in the data

*$n_{Hidden Nodes} = n_{Input Nodes}$

*A prediction time lag following the final Input Node of, $lt_{step}$, where $l$ is an integer

*One Output Node taken from the final hidden node, giving a prediction, at $t_{p}=t+lt_{step}$

*$x_{p}(t_p)$ is the prediction of $x_{in}(t_p)$ in training data

*Error by R.M.S.E. $\sqrt{\left(x_{in}(t_p)-x_{p}(t_p)\right)^2}$

*Finally, each node in the hidden layer feeds through to the weight at the next timestep

Tested $y=sin(t) + 0.2*\epsilon$, where $\epsilon \sim N(0,1)$, in a sliding window. I used a historic lag of 5 data points, $y(t-5, t-4, ... , t)$, and tried to predict the following point in the curve, $y(t+1)$.
I only used 100 noisey versions of $sin(x)$ over 100 epochs for training. Results weren't too bad...

Thanks for the help. Code seems bug free so I'll optimise for GPU & mini-batches and ramp it up with more up to date algorithms.

A: A very simple time series to validate the correctness of your code is the one caused by the function sin(x). It's periodic nature makes it a good test function imo. Just print out (or plot) the output activations of your network and compare it with the desired values to see the performance.
Alternatively you can just test XOR like Elman did in his original paper:
101 000 011 110 101 ...

A: There's a good list of tests in Hochreiter's paper here. Also check this and the next slide on Schmidhuber's presentation.


text:
Q: How to figure out the used cryptographic algorithm? I have two files:

*

*one is a raw plain text file which is first compressed using ZStandard and then encoded with Base64

*one is basically the same file but it is encrypted after the compression but before the encoding. I know the password used und have a 32 byte long salt.

Assumptions made:

*

*I assume that the algorithm used is aes-128. Why? Because I actually have four files (two pairs) and the biggest common divisor of the two ciphers is 16, so I at least can assume a 128bit blocksize. And AES because it is the most common

*The cipher is not generated using ECB since the same plain text results in different ciphers each time I let it generate.

I can provide one pair with its password and salt. I can also provide multiple pairs all with the same plain text if needed.
What is this for:
I am currently implementing a golang library to communicate with TeamSpeak 3 ServerQuery. It provides the possibility to create snapshots of servers and you can encrypt them using a password. I'd like to decrypt them with the password and the salt to parse and manipulate them.
I was not yet able to figure out, which mode is used with what IV.
I've tried many different possibilities including but not limited to:

*

*Hashing the password using MD5 and using it as a key

*Hashing the password with the salt using MD5

*Hashing the password and then hashing the password hash and salt using MD5

*Using the first half of the salt in the Key hash and the second half as a iv and vise versa

I am pretty much all out of ideas at this point. If anyone can just so much as point me in a direction would be appreciated.
MfG


text:
Q: How do I concatenate a string to all the members inside a comma seperated list in SQL Server 2008? For example my comma separated string looks like
Declare @lists nvarchar(max) = N'EmailID , PhoneNumber , Profession'

I want to append a string like 'aliasName.' to all the members such that the list should look like
@lists = N'aliasName.EmailID , aliasName.PhoneNumber , aliasName.Profession'

A: Declare @lists nvarchar(max) = N'EmailID , PhoneNumber , Profession'
SET @lists = N'aliasName.' + replace(@lists,' , ', ' , aliasName.')
SELECT @lists

That should give you the following result:
 aliasName.EmailID , aliasName.PhoneNumber , aliasName.Profession

A: Try like this:
DECLARE @lists NVARCHAR(100)=N'EmailID , PhoneNumber , Profession';
DECLARE @AliasName NVARCHAR(100)=N'aliasName.';
SET @lists = @AliasName +  REPLACE(REPLACE(@lists,' ',''),',',' , ' + @AliasName);
SELECT @lists;


text:
Q: Admob not shown I'm trying to add AdMob in an app i've developed.
This is my xml:
<LinearLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity" >
    <com.google.ads.AdView
        xmlns:googleads="http://schemas.android.com/apk/lib/com.google.ads"
        android:id="@+id/ad"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        googleads:adSize="BANNER"
        googleads:adUnitId="###########" />
</LinearLayout>

And my code in onCreate method:
//ads
AdView adView = (AdView) findViewById(R.id.ad);
adView.loadAd(new AdRequest());

LogCat gives something like:
Received ad url <url: http://googleads.....

So it's somehow working, but on my app, i never see any banner. Do you've any idea what is happening?
I've followed this tutorial:
http://androcode.es/2012/05/monetizando-nuestras-apps-admob-en-android/
Aswel as http://developer.android.com/intl/es/training/monetization/ads-and-ux.html
But none with luck.
Edit:
Oh, forgot to mention that I've those two lines in manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

For instance, if I remove any of those permissions, the AD is SHOWN saying that there's some permissions missing. So I think layout is fine.
Edit2:
Also tried to set this code for testing purposes and it's happening exactly the same:
adRequest.addTestDevice("#############");

Edit3:
I've read that it might take long first time. How long might it take? Because I've waited for about 30 minutes. Would logcat say that it received ad anyways?

A: Solved it. Apparently its working on emulator:
added this on the xml file:
googleads:loadAdOnCreate="true"


text:
Q: Pass array of integer as parameter to the url of an Ajax call I know this has been asked multiple times, but unfortunately it's still unclear to me. How do I pass array of integer as parameter to the url of an Ajax call? I need the elements of the array to show in the url.
This is inside script tags in the View :
function DeleteRoom(id, IDarray) {
    $.ajax({
        url: "/api/Room/DeleteRoom?RoomId=" + id + "&userDevicesId="+ IDarray,
        type: "DELETE",
        dataType: 'json',
        data: IDarray, //data that will be passed to the array (?)
        traditional: true, //if I get it right, this serializes the array
        success: function (data) {
        ... }
    });
}

This is the API
public void DeleteRoom (int id, [FromUri] int[] IDarray)

This only reads the first element in the array from database, and so it deletes only the first element. It's like I'm passing Int! Then the browser crashes (stop script) and I get this error

DELETE .../api/Room/RemoveRoomWithDevices?RoomId=2392&userDevicesId=1549
204 No Content   62ms
XML Parsing Error: no element found Location: moz-nullprincipal

Is the url syntax wrong? Or else, is there suggestions to make this work?

A: You can use JSON.stringify()
here is your url
url: "/api/Room/DeleteRoom?RoomId=" + id + "&userDevicesId="+ JSON.stringify(IDarray)

Btw why you are using again a data attribute in ajax call..? Since you have included data array in the url.


text:
Q: 'pygame.Rect' object is not callable Code:
import pygame , sys, time, random
from pygame.locals import *

def enemie():
    global speed, ball
    ball.y += speed
    if ball.y == 602:
        ball = pygame.Rect(random.randint(0, 450), 0 ,20,20)

def blast():
    global bl, blast
    blast.y = bl

def player_animation():
    global player_speed, playerx
    player.x = player_speed

pygame.init()
running = True

clock = pygame.time.Clock()

speed = 7
bl = 1
player_speed = 1

ball = pygame.Rect(random.randint(0, 450), 0 ,20,20)
player = pygame.Rect(250, 450, 50, 50)
blast = pygame.Rect(300, 0 ,20,20)
screen = pygame.display.set_mode((500, 500))

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
                running = False
    enemie()
    player_animation()
    blast()

    screen.fill((255, 255, 255)) #color

    pygame.draw.ellipse(screen, [255, 0, 0], ball)
    pygame.draw.ellipse(screen, [0, 0, 255], player)
    pygame.draw.ellipse(screen, [0, 255, 0], blast)

    if ball.colliderect(player):
        pygame.quit()
        sys.exit()

    keys=pygame.key.get_pressed()
    if keys[K_LEFT] and player.x !=  -4 :
        player_speed -= 5

    if keys[K_RIGHT] and player.x !=  451:
        player_speed += 5

    if event.type == pygame.MOUSEBUTTONDOWN:
        bl += 5
    pygame.display.flip()

    clock.tick(30)
pygame.quit()

error:
line 54, in <module>
    blast()
TypeError: 'pygame.Rect' object is not callable

I am trying to create some balls that move. and the green ball or blast is supposed to move when I click,
Does the error mean that there is a ) or a ( that doesn't belong? But I can't find my mistake... I've had this error before and I  can't remember how I solved it. what does the error mean? and how can I fix this?

A: Your global blast variable shadows the blast function.  By the time you call blast(), blast is no longer defined as a function, but is a pygame.Rect instead.  The error is telling you that you can't call a Rect like a function.
Change the name of one of them so they don't collide.


text:
Q: How do I get asynchronous / event-driven LISTEN/NOTIFY support in Java using a Postgres database? From what I can tell, the JDBC drivers for LISTEN/NOTIFY in Java do NOT support true event-driven notifications.  You have to poll the database every so often to see if there's a new notification.
What options do I have in Java (possibly something other than JDBC?), if any, to get notifications asynchronously in a true event-driven manner without polling?

A: Use the pgjdbc-ng driver.
http://impossibl.github.io/pgjdbc-ng/
It supports async notifications, without polling. I have used it successfully.
See https://database-patterns.blogspot.com/2014/04/postgresql-nofify-websocket-spring-mvc.html
Source code: https://bitbucket.org/neilmcg/postgresql-websocket-example
Oleg has a nice example answer as well

A: Here's an asynchronous pattern using com.impossibl.postgres.api (pgjdbc-ng-0.6-complete.jar) with JDK 1.8:
import com.impossibl.postgres.api.jdbc.PGConnection;
import com.impossibl.postgres.api.jdbc.PGNotificationListener;
import com.impossibl.postgres.jdbc.PGDataSource;
import java.sql.Statement;

public static void listenToNotifyMessage(){
    PGDataSource dataSource = new PGDataSource();
    dataSource.setHost("localhost");
    dataSource.setPort(5432);
    dataSource.setDatabase("database_name");
    dataSource.setUser("postgres");
    dataSource.setPassword("password");

    PGNotificationListener listener = (int processId, String channelName, String payload)
        -> System.out.println("notification = " + payload);

    try (PGConnection connection = (PGConnection) dataSource.getConnection()){
        Statement statement = connection.createStatement();
        statement.execute("LISTEN test");
        statement.close();
        connection.addNotificationListener(listener);
        while (true){ }
    } catch (Exception e) {
        System.err.println(e);
    }
}

Create a trigger function for your database:
CREATE OR REPLACE FUNCTION notify_change() RETURNS TRIGGER AS $$
    BEGIN
        SELECT pg_notify('test', TG_TABLE_NAME);
        RETURN NEW;
    END;
$$ LANGUAGE plpgsql;

Assign a trigger for every table you want to track:
CREATE TRIGGER table_change
    AFTER INSERT OR UPDATE OR DELETE ON table_name
    FOR EACH ROW EXECUTE PROCEDURE notify_change();

A: It appears as though there's no way around this.  You can work around it, as several suggestions have been made along those lines, but ultimately, you're going to be polling.


text:
Q: Insert image into pie chart slice I am using python 3.5.2
I would like to make a pie chart with an png image imbedded. I have pictures of certain bulk products that I would like to insert into the slices. For example strawberries in one slice and raspberries in another. Much like the picture http://www.python-course.eu/images/pie_chart_with_raspberries.png shows.
I can produce images and even plot images instead of points as demonstrated here Matplotlib: How to plot images instead of points?
However, I could not find any approach towards what I am proposing. I suppose it could be manually done in paint, but I was trying to avoid that.

A:
That is sure possible. We can start with a normal pie chart. Then we would need to get the images into the plot. This is done using plt.imread and by using a matplotlib.offsetbox.OffsetImage. We would need to find good coordinates and zoom levels to place the image, such that it overlapps completely with respective pie wedge. Then the Path of the pie's wedge is used as a clip path of the image, such that only the part inside the wedge is left over. Setting the zorder of the unfilled wedge to a high number ensures the borders to be placed on top of the image. This way it looks like the wedges are filled with the image.
import matplotlib.pyplot as plt
from matplotlib.patches import PathPatch
from matplotlib.offsetbox import OffsetImage, AnnotationBbox

total = [5,7,4]
labels = ["Raspberries", "Blueberries", "Blackberries"]
plt.title('Berries')
plt.gca().axis("equal")
wedges, texts = plt.pie(total, startangle=90, labels=labels,
                        wedgeprops = { 'linewidth': 2, "edgecolor" :"k","fill":False,  })

def img_to_pie( fn, wedge, xy, zoom=1, ax = None):
    if ax==None: ax=plt.gca()
    im = plt.imread(fn, format='png')
    path = wedge.get_path()
    patch = PathPatch(path, facecolor='none')
    ax.add_patch(patch)
    imagebox = OffsetImage(im, zoom=zoom, clip_path=patch, zorder=-10)
    ab = AnnotationBbox(imagebox, xy, xycoords='data', pad=0, frameon=False)
    ax.add_artist(ab)

positions = [(-1,0.3),(0,-0.5),(0.5,0.5)]
zooms = [0.4,0.4,0.4]

for i in range(3):
    fn = "data/{}.png".format(labels[i].lower())
    img_to_pie(fn, wedges[i], xy=positions[i], zoom=zooms[i] )
    wedges[i].set_zorder(10)

plt.show()


text:
Q: std::cin.putback() and "wake up" it I have threads in my program and I want to put character into stream and read it in another thread, but after std::cin.putback() I need to write something from keyboard to "wake up" std::cin in function main. Can I do something to read automatically?

A: That's not how streams work. The std::cin reads data that come from outside your program to standard input and the putback only allows keeping a character that you actually just read back to the buffer for re-parsing next time you invoke operator>> (or get or getline or other read method).
If you want to communicate between threads, you should use a message queue from some threading library, e.g. Boost provides a decent portable one.
It is not possible to use streams, at least those provided by standard library, because stringstream is not thread-safe and fistream/fostream can't be created from raw file handle, so you can't combine them with POSIX pipe function. It would be possible to wrap a message queue in a stream (and boost gives you enough tools to do it), but the raw message queue API will probably be suitable.


text:
Q: Combine values on matching strings I have two files and I want to combine the logFC from File2 for those miRNA that have similar ID in File1 and matches File2. F.ex all miRNA with ID1 should be combined based on the matching string in File2.
File1:

ID  miRNA
ID1 hsa-miR-512-1
ID1 hsa-miR-512-2
ID1 hsa-miR-1323
ID1 hsa-miR-498
ID1 hsa-miR-520e
ID1 hsa-miR-515-1
ID1 hsa-miR-519e
ID1 hsa-miR-520f
ID2 hsa-miR-495
ID2 hsa-miR-376c
ID2 hsa-miR-376a-2
ID2 hsa-miR-654
ID2 hsa-miR-376b
ID2 hsa-miR-376a-1
ID2 hsa-miR-300
ID2 hsa-miR-1185-1
ID2 hsa-miR-1185-2
ID24    hsa-miR-1179
ID24    hsa-miR-7-2
ID24    hsa-miR-3677
ID25    hsa-miR-940
ID25    hsa-miR-4717

File2:
miRNA           logFC
hsa-miR-512-1   13
hsa-miR-512-2   123
hsa-miR-1323    53
hsa-miR-498     4.2
hsa-miR-520e    12
hsa-miR-515-1   1
hsa-miR-519e    56
hsa-miR-520f    113
hsa-miR-495     11
hsa-miR-376c    11
hsa-miR-376a-2  113
hsa-miR-654     13
hsa-miR-376b    123
hsa-miR-376a-1  567
hsa-miR-300     757
hsa-miR-1185-1   6
hsa-miR-1185-2  35
hsa-miR-1179    2
hsa-miR-7-2     2
hsa-miR-3677    1
hsa-miR-940     134
hsa-miR-4717    566

Output:

ID1     Average logFC for all ID1 miRNA
ID2     Average logFC for all ID2 miRNA
...

A: As @Heroka mentioned in the beginning it is a merge job (that means joining your tables on the right key column). I'm using a dplyr approach, however there are many other ways/commands to do this:
File1 = read.table(text="ID  miRNA
ID1 hsa-miR-512-1
ID1 hsa-miR-512-2
ID1 hsa-miR-1323
ID1 hsa-miR-498
ID1 hsa-miR-520e
ID1 hsa-miR-515-1
ID1 hsa-miR-519e
ID1 hsa-miR-520f
ID2 hsa-miR-495
ID2 hsa-miR-376c
ID2 hsa-miR-376a-2
ID2 hsa-miR-654
ID2 hsa-miR-376b
ID2 hsa-miR-376a-1
ID2 hsa-miR-300
ID2 hsa-miR-1185-1
ID2 hsa-miR-1185-2
ID24    hsa-miR-1179
ID24    hsa-miR-7-2
ID24    hsa-miR-3677
ID25    hsa-miR-940
ID25    hsa-miR-4717", header=T)

File2 = read.table(text="miRNA           logFC
hsa-miR-512-1   13
hsa-miR-512-2   123
hsa-miR-1323    53
hsa-miR-498     4.2
hsa-miR-520e    12
hsa-miR-515-1   1
hsa-miR-519e    56
hsa-miR-520f    113
hsa-miR-495     11
hsa-miR-376c    11
hsa-miR-376a-2  113
hsa-miR-654     13
hsa-miR-376b    123
hsa-miR-376a-1  567
hsa-miR-300     757
hsa-miR-1185-1   6
hsa-miR-1185-2  35
hsa-miR-1179    2
hsa-miR-7-2     2
hsa-miR-3677    1
hsa-miR-940     134
hsa-miR-4717    566", header=T)

library(dplyr)

File1 %>%
  inner_join(File2, by="miRNA") %>%     # join your datasets based on miRNA column
  group_by(ID) %>%                      # group by ID
  summarise(AvgLogFC = mean(logFC))     # calculate average values

#     ID   AvgLogFC
# 1  ID1  46.900000
# 2  ID2 181.777778
# 3 ID24   1.666667
# 4 ID25 350.000000

Note that I'm using inner_join which assumes that all your miRNA values in File1 exist in File2.


text:
Q: How can I autocomplete the name of a file in Linux when passing the remote flag to firefox? I am attempting to open a file using firefox via the command line. The command I run is;
firefox -remote "openurl(file://`pwd`/filename.html)"

I would like to be able to autocomplete the name of the file which can sometimes be lengthy by hitting tab.

A: Well, it's clunky, but you could type

sh -c 'firefox -remote "openurl(file://`pwd`/$1)"'  -  PeaTab

or

sh -c 'firefox -remote "openurl(file://$1/$2)"'  -  `pwd`  PeaTab

If you're going to be doing this on a regular basis (without a lot of variation), you might want to put it into a script.
P.S. You could leave off one of the slashes after the file: because the pwd will provide one.

Edit:
How/why does this work?
The interactive shell that you're running (let's assume that it is bash and refer to it as such, for disambiguation) is the one that's reading your command line input and doing things like autocomplete, and it requires that any command-line word that it autocompletes must look like a filename or pathname.  I've had the experience that it can handle

        … $PWD/ScoTab

and

        … `pwd`/ScoTab

but not

        … $(pwd)/ScoTab

Go figure.  YMMV.  In any case, it cannot handle

… "openurl(file://`pwd`/ScoTab

because that cannot possibly be interpreted as a filename or pathname
(unless bash could parse the "openurl(…  call, which it cannot).
The trick is to get it to do the autocomplete on an isolated filename and then glue the pieces together.  The only way to set $1, $2, etc., for your interactive shell is to type a command like set foo bar or set -- foo bar, and this is generally not done.  We need a sh on the command line so we can set its $1, $2, etc., by putting values on its command line.
So we use the bash to do the autocomplete, which provides command-line parameter(s) to sh,
and then we use the sh command

'firefox -remote "openurl(file://$1/$2)"'

to interpret the $1 and $2, and then "glue the pieces together".

The process of writing this made me realize another option:

set  `pwd`  ScoTab(do autocomplete) Enter

followed by

firefox -remote "openurl(file:/$1/$2)" Enter

As I indicated earlier, the first command above sets the positional parameters ($1 and $2) for the interactive shell (bash) and the second line uses them.
As I mentioned, people generally don't set the positional parameters of their interactive shell,
but there's nothing wrong with it –– it's just uncommon.
It should be noted that $1 and $2 will retain these values until you reset them, or you logout.
You should be able to combine the above two lines into one:

set `pwd` ScoTab(do autocomplete) ;
 firefox -remote "openurl(file:/$1/$2)" Enter


text:
Q: Exporting Dot Density Map as Points using ArcGIS Desktop? I have a polygon with a sum_count field. Using the Dot Density symbology in ArcMap, I was able to display this value as a series of points (seen in the image below).
Is it possible to export these points as their own feature?
The objective is to do some advanced cartography with these points.

A: It is not possible to convert these symbols to points but there is a Create Random Points tool available in ArcGIS Desktop which:

Creates a specified number of random point features. Random points can
  be generated in an extent window, inside polygon features, on point
  features, or along line features.

It has some licensing restrictions in that you need Advanced, Spatial Analyst or 3D Analyst licensing.  Basic or Standard with one of those extensions is fine.

A: You could do it in Qgis:

*

*Open your .shp file in Qgis

*Go to Toolbox and search for Random points inside polygons.

(excuse my Qgis version in Spanish)
There are two options: fixed (where the number of dots is the same for each polygon) or variable (where the number of dots is taken from an attribute, therefore can be different for each polygon).
Here is the explanation for variable, the option that I think that suits you better:
"This algorithm creates a new point layer with random points inside the polygons of a given layer. The number of points in each polygon can be defined as a fixed count or as a density value. The count/density value is taken from an attribute, so it can be different for each polygon in the input layer."
The outcome is a new point layer that can be saved as a .shp file that you could then open in ArcMap if you whish.


text:
Q: Error: First argument must be a data frame or shared data I want to create dynamic plots based selectorInput in shinydashboard, but when I want to create plot I get error:

First argument, data, must be a data frame or shared data.

Here is part of my code is Server part when I try to subset data and use them as plotly input:
data_sub = reactive({
data_sub_temp = df[df$market == input$market_selector,]
return(data_sub_temp)
  })

  output$market_plot <- renderPlotly({
  plot_ly(
  data = data_sub,
  x = ~ created,
  y = ~ pax,
  group_by = ~ type,
  color = ~ type,
  type = "scatter",
  mode = "lines+markers",
  hoverinfo = 'text',
  text = ~ paste('Year:', created,
                 '

 Clients: ', pax)
  )
  })

Dataset is loaded and pre-processed before UI&Server code part. When I use dataset subsetted before UI&Server part this code works, I am unable to maket it work when data_sub part is added. Any suggestion? Thanks

A: I think that the problem is that the dataframe part is reactive, but not the plot. You can try using an eventHandler instead. In this case, you need to add an actionButton in the ui (possibly in the sidebarPanel) and add the eventHandler in the server, without the reactive part.
Code below.
ui
 actionButton(
      inputId = "submit_loc",
      label = "Submit")

server
observeEvent(
    eventExpr = input[["submit_loc"]],
    handlerExpr = {

data_sub <- df[df$market == input$market_selector,]

output$market_plot <- renderPlotly({
  plot_ly(
  data = data_sub,
  x = ~ created,
  y = ~ pax,
  group_by = ~ type,
  color = ~ type,
  type = "scatter",
  mode = "lines+markers",
  hoverinfo = 'text',
  text = ~ paste('Year:', created,
                 '

 Clients: ', pax)
  )
  })

})

Try and let me know whether this works.

A: Reactive is used to limit what gets re-run during a reaction. The reactive({}) expression creates reactions similar to input$... expressions.
I.e in your example pulling data_sub out of the renderPlotly() expression would prevent renderPlotly from running when df$market or input$market_selector change unless you tell shiny that data_sub must be reactive as you have done above. There is little point in isolating data_sub from your renderPlotly() expression unless other input$... expressions were causing renderPlotly() to redraw.  See Reactive Tutorial for a better understanding.
If you wish to keep data_sub reactive you need to call it using the bracket notation in your plot. I.e data = data_sub()
It may also be useful to get a grip on assignment operators in R as you are using the = operator incorrectly. Your code will still run however it is better to use the <- operator for data_sub. See Difference between assignment operators in R.
The final code should look something like:
Server
data_sub <- reactive({df[df$market == input$market_selector,]})

output$market_plot <- renderPlotly({
  plot_ly(
  data = data_sub(),
  x = ~ created,
  y = ~ pax,
  group_by = ~ type,
  color = ~ type,
  type = "scatter",
  mode = "lines+markers",
  hoverinfo = 'text',
  text = ~ paste('Year:', created,
                 '

 Clients: ', pax)
  )
})

A: try to use data = data_sub() instead of data = data_sub
output$market_plot <- renderPlotly({
  plot_ly(
  data = data_sub(),
  x = ~ created,
  y = ~ pax,
  group_by = ~ type,
  color = ~ type,
  type = "scatter",
  mode = "lines+markers",
  hoverinfo = 'text',
  text = ~ paste('Year:', created,
                 '

 Clients: ', pax)
  )
  })


text:
Q: webkitgtk webkit_web_view_get_dom_document doesn't return I'm importing the method in C# mono (since dom_document isn't implemented in webkit-sharp), like this:
class ExtendedWebView : WebKit.WebView {
    [DllImport ("webkit-1.0")]
    private static extern IntPtr webkit_web_view_get_dom_document (IntPtr raw);

    public DOMDocument get_dom_document()
    {
        return new DOMDocument(webkit_web_view_get_dom_document(base.Handle));
    }
}

base.Handle is an IntPtr to the WebView object. The webkit_web_view_get_dom_document never returns. I'm calling this in a separate thread. The thread just hangs indefinitely.
I also tried isolating the method call, to be sure that was what was hanging. I passed in an IntPtr and assigned the return value to an IntPtr. It's definitely webkit_web_view_get_dom_document that isn't returning.
Anybody know why this is happening? Maybe I'm using the wrong version of webkit? Does that method not exist?

A: Webkit 1.0 doesn't include the DOMDocument stuff. I ended up having to use a newer version of webkit-sharp (which hasn't actually been released yet) which already has the DOMDocument implementation.


text:
Q: Fullcalendar scoping fields I have a web-application with ruby on rails back-end and javascript / jquery fullcalendar.
On the weekView / monthView I would like to scope events (that are coming from a backend) and display them in the following manner:

How would you put display only two (one is also OK) with button more and pluck all others events details for the particular day? I have a look at eventRender and afterEventRender methods. However it seems they get only one event event.
PS. Data is prepared by ruby on rails function:

group_by(&:service_start_date_time).each do |service_start_date_time, events|
  events.first.visible = true
  events.first.save
  return events
end


text:
Q: PHP OOP and MySQLi connection = Fatal error: Call to undefined method mysqli::arrayQuery() Please tell me what I've done wrong? And how to work with base better? Connection works, but I can not see information from base. I just get:

Fatal error: Call to undefined method mysqli::arrayQuery()

I can't understand how to fix it, Google didn't help either.
<?php
class Proc{
    protected $DB;
    function __construct(){
        $this->DB=new mysqli('localhost', 'user', 'password', 'basename');
        $this->DB->query("set names utf8");}
    function __destruct(){unset($this->DB);}
    function GetAll(){
        $sql="SELECT * FROM users";
        $result = $this->DB->arrayQuery($sql, SQLITE_ASSOC);
        return $result;}
}

$Yo = new Proc();

$users = $Yo->GetAll();
echo "All users: ".count($users);
foreach ($users as $user){
    $id = $user["ID"];
    $n = $user["Name"];
    echo "{$id} - {$n}
";}
?>

A little fix and all work perfect! Thanks to all!
<?php
class Proc{
    protected $DB;
    function __construct(){
        $this->DB=new PDO("mysql:host=localhost;dbname=basename", user, password);
        $this->DB->query("set names utf8");}
    function __destruct(){unset($this->DB);}
    function GetAll(){
        $sql="SELECT * FROM users";
        $result = $this->DB->query($sql);
        return $result;}
}
$Yo = new Proc();
$users = $Yo->GetAll();
foreach ($users as $user){
    $id = $user["ID"];
    $n = $user["Name"];
    echo "{$id} - {$n}
";}
?>

A: What database are you using? SQLite or mysql ?
Because as per the PHP DOCS, I guess the function arrayQuery can be used only for SQLite databases


text:
Q: How will SOPA affect stack overflow users outside the US? If SOPA is passed, it is obviously going to cause a lot of trouble for sites such as those part of the Stack Exchange network.
Being a European resident, I'm thinking that, if SOPA becomes a law, moving your business out of the US and stop using .com/.net/.org/etc. addresses for your site should make it available for internet users outside the US, even if it becomes censored in the US.
Am I right in this? Or are there technical implications of SOPA that I don't understand? Obviously I realize that US based internet companies would like to remain US based and that there are economical elements to SOPA, but if you were to consider this question from a purely technical viewpoint, will SOPA affect non-US users of sites based outside the US not using .com/.net/.org/etc. addresses?


text:
Q: What does error occurred while evaluating nil.dependencies mean? I'm running ruby on rails v2.2.2 and when I run rake gems I get this error.

$ rake gems --trace
  - [I] settingslogic
  rake aborted!
  You have a nil object when you didn't expect it!
  The error occured while evaluating nil.dependencies
  /vendor/rails/railities/lib/rails/gem_dependency.rb:77:in `dependencies'

A: I figured out what was going on. There is a bug in the core rake gems function where it assumed there were specifications for the gem and would error out when it didn't exist for that gem.
Here is the ticket for this issue with a working patch
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1464

A: Could be a problem with a gem it's trying to load, or your setup of required gems. Check config/environment.rb for any odd-looking config.gem lines, and do an update of all your gems (sudo gem update).

A: There is a bit more detail here with two alternate workarounds
-add one line to the dependency code in rails
or
-specify gem dependencies before the gem


text:
Q: Grouping XML data into category headers based on field that contain multiple values I am trying to format some data that's being inputted into the Form and List module on a DotNetNuke install. It's basically a business directory - the client will fill out a form with Company Name, Address, etc. and then the data needs to be displayed within category headers. For each company, there will be a list of available categories that the client can select - and they CAN select more than one category.
I've searched for a while now and can't seem to get anything to work. I have experience editing the portion of the XSL file that outputs to HTML. Other than that, I leave the rest of the file alone because I don't have much knowledge at all about how to setup the templates, etc.
Below is the XML that is generated from the module (I only have 3 test entries added at the moment) as well as the current XSL file and how the result should be displayed on the page. Any help would be greatly appreciated!
XML:
<UserDefinedTable xmlns="DotNetNuke/UserDefinedTable">
  <Data>
    <UserDefinedRowId>9</UserDefinedRowId>
    <Company_x0020_Name>test 3</Company_x0020_Name>
    <Company_x0020_Line_x0020_2/>
    <Address>123</Address>
    <Address_x0020_Line_x0020_2/>
    <City-State-Zip/>
    <Phone_x0020_1>308.425.6039</Phone_x0020_1>
    <Phone_x0020_2/>
    <Email>info@test.com</Email>
    <Website_x0020__x0028_FULL_x0020_URL_x0029_>http://www.google.com/</Website_x0020__x0028_FULL_x0020_URL_x0029_>
    <Category>Advertising</Category>
    <Created_x0020_by>SuperUser Account</Created_x0020_by>
    <Created_x0020_at>2015-12-23T11:03:14-06:00</Created_x0020_at>
    <Changed_x0020_by>SuperUser Account</Changed_x0020_by>
    <Changed_x0020_at>2015-12-23T15:28:39-06:00</Changed_x0020_at>
    <Created_x0020_by_UDT_Original>host</Created_x0020_by_UDT_Original>
    <Created_x0020_by_UDT_Caption>SuperUser Account</Created_x0020_by_UDT_Caption>
    <Created_x0020_at_UDT_Value><!--063586465394-->12/23/2015 11:03 AM</Created_x0020_at_UDT_Value>
    <Created_x0020_at_UDT_Ticks>635864653940000000</Created_x0020_at_UDT_Ticks>
    <Changed_x0020_by_UDT_Original>host</Changed_x0020_by_UDT_Original>
    <Changed_x0020_by_UDT_Caption>SuperUser Account</Changed_x0020_by_UDT_Caption>
    <Changed_x0020_at_UDT_Value><!--063586481319-->12/23/2015 3:28 PM</Changed_x0020_at_UDT_Value>
    <Changed_x0020_at_UDT_Ticks>635864813190000000</Changed_x0020_at_UDT_Ticks>
  </Data>
  <Data>
    <UserDefinedRowId>10</UserDefinedRowId>
    <Company_x0020_Name>test 2</Company_x0020_Name>
    <Company_x0020_Line_x0020_2/>
    <Address/>
    <Address_x0020_Line_x0020_2/>
    <City-State-Zip/>
    <Phone_x0020_1>308.425.3654</Phone_x0020_1>
    <Phone_x0020_2/>
    <Email/>
    <Website_x0020__x0028_FULL_x0020_URL_x0029_/>
    <Category>Abstractor</Category>
    <Created_x0020_by>SuperUser Account</Created_x0020_by>
    <Created_x0020_at>2015-12-23T11:08:19-06:00</Created_x0020_at>
    <Changed_x0020_by>SuperUser Account</Changed_x0020_by>
    <Changed_x0020_at>2015-12-23T15:28:19-06:00</Changed_x0020_at>
    <Created_x0020_by_UDT_Original>host</Created_x0020_by_UDT_Original>
    <Created_x0020_by_UDT_Caption>SuperUser Account</Created_x0020_by_UDT_Caption>
    <Created_x0020_at_UDT_Value><!--063586465699-->12/23/2015 11:08 AM</Created_x0020_at_UDT_Value>
    <Created_x0020_at_UDT_Ticks>635864656990000000</Created_x0020_at_UDT_Ticks>
    <Changed_x0020_by_UDT_Original>host</Changed_x0020_by_UDT_Original>
    <Changed_x0020_by_UDT_Caption>SuperUser Account</Changed_x0020_by_UDT_Caption>
    <Changed_x0020_at_UDT_Value><!--063586481299-->12/23/2015 3:28 PM</Changed_x0020_at_UDT_Value>
    <Changed_x0020_at_UDT_Ticks>635864812990000000</Changed_x0020_at_UDT_Ticks>
  </Data>
  <Data>
    <UserDefinedRowId>11</UserDefinedRowId>
    <Company_x0020_Name>test</Company_x0020_Name>
    <Company_x0020_Line_x0020_2/>
    <Address/>
    <Address_x0020_Line_x0020_2/>
    <City-State-Zip/>
    <Phone_x0020_1/>
    <Phone_x0020_2/>
    <Email/>
    <Website_x0020__x0028_FULL_x0020_URL_x0029_/>
    <Category>Abstractor;Antiques & Collectibles</Category>
    <Created_x0020_by>SuperUser Account</Created_x0020_by>
    <Created_x0020_at>2015-12-23T14:20:21-06:00</Created_x0020_at>
    <Changed_x0020_by>SuperUser Account</Changed_x0020_by>
    <Changed_x0020_at>2015-12-23T14:20:21-06:00</Changed_x0020_at>
    <Created_x0020_by_UDT_Original>host</Created_x0020_by_UDT_Original>
    <Created_x0020_by_UDT_Caption>SuperUser Account</Created_x0020_by_UDT_Caption>
    <Created_x0020_at_UDT_Value><!--063586477221-->12/23/2015 2:20 PM</Created_x0020_at_UDT_Value>
    <Created_x0020_at_UDT_Ticks>635864772210000000</Created_x0020_at_UDT_Ticks>
    <Changed_x0020_by_UDT_Original>host</Changed_x0020_by_UDT_Original>
    <Changed_x0020_by_UDT_Caption>SuperUser Account</Changed_x0020_by_UDT_Caption>
    <Changed_x0020_at_UDT_Value><!--063586477221-->12/23/2015 2:20 PM</Changed_x0020_at_UDT_Value>
    <Changed_x0020_at_UDT_Ticks>635864772210000000</Changed_x0020_at_UDT_Ticks>
  </Data>
  <Fields>
    <UserDefinedFieldId>22</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Company Name</FieldTitle>
    <Required>true</Required>
    <FieldOrder>0</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>true</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Company_x0020_Name</ValueColumn>
    <SortColumn>Company_x0020_Name</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>23</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Company Line 2</FieldTitle>
    <Required>false</Required>
    <FieldOrder>1</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>true</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Company_x0020_Line_x0020_2</ValueColumn>
    <SortColumn>Company_x0020_Line_x0020_2</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>24</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Address</FieldTitle>
    <Required>false</Required>
    <FieldOrder>2</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Address</ValueColumn>
    <SortColumn>Address</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>25</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Address Line 2</FieldTitle>
    <Required>false</Required>
    <FieldOrder>3</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Address_x0020_Line_x0020_2</ValueColumn>
    <SortColumn>Address_x0020_Line_x0020_2</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>26</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>City-State-Zip</FieldTitle>
    <Required>false</Required>
    <FieldOrder>4</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>City-State-Zip</ValueColumn>
    <SortColumn>City-State-Zip</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>27</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Phone 1</FieldTitle>
    <Required>false</Required>
    <FieldOrder>5</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Phone_x0020_1</ValueColumn>
    <SortColumn>Phone_x0020_1</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>28</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Phone 2</FieldTitle>
    <Required>false</Required>
    <FieldOrder>6</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Phone_x0020_2</ValueColumn>
    <SortColumn>Phone_x0020_2</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>29</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Email</FieldTitle>
    <Required>false</Required>
    <FieldOrder>7</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Email</ValueColumn>
    <SortColumn>Email</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>30</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Website (FULL URL)</FieldTitle>
    <Required>false</Required>
    <FieldOrder>8</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Website_x0020__x0028_FULL_x0020_URL_x0029_</ValueColumn>
    <SortColumn>Website_x0020__x0028_FULL_x0020_URL_x0029_</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>21</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Category</FieldTitle>
    <Required>true</Required>
    <FieldOrder>9</FieldOrder>
    <FieldType>String</FieldType>
    <Visible>true</Visible>
    <ShowOnEdit>true</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>true</MultipleValues>
    <InputSettings>Abstractor;Advertising;Agricultural;Antiques & Collectibles;Apparel;Appliances;Attorneys;Auctioneers;Auto;Bakeries;Banks;Beauty Shops;Bulldozing, Road Construction, Heavy Equipment;Business & Computer Services;Cable and Internet;Carpentry;Carpet, Flooring and Installation;Carwash;Cellular Phone;Certified Public Accountants;Chiropractor;Churches;Community Services;Convenience Stores;Crafts;Day Care;Dental;Drug Store;Dry Cleaners & Laundry;Education;Electrical;Farm & Ranch Supply;Fast Food & Take Out;Fertilizer, Feed, Seed & Chemicals;Firearms;Flower Shop;Furniture;Gift Shops;Graphic Design;Grocery;Handyman/General Repair;Hardware;Health, Home & Beauty Products;Heating;Hunting Outfitters;Insurance;Karaoke Services;Lawn Care;Lawn Equipment;Lodging;Lumber Yards;Manicures & Pedicures;Massage;Meat;Medical;Mini-Storage;Mortuary;Newspaper;Nurseries & Greenhouses;Optometrist;Pet Supplies;Pharmacy;Photographer;Physical Therapy;Plumbing;Preschools;Printing;Property Maintenance;Public Schools;Quilting;Recreation;Restaurants;Senior Services;Sewing & Quilt Making;T-Shirts;Taverns;Theaters;Thrift Shop;Tires;Toys;Truck and Trailer Repair;Trucking;Utilities;Variety Stores;Veterinarians;Well Drilling-[[vRBL]]</InputSettings>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Category</ValueColumn>
    <SortColumn>Category</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>20</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Created by</FieldTitle>
    <Required>true</Required>
    <FieldOrder>10</FieldOrder>
    <FieldType>CreatedBy</FieldType>
    <Visible>false</Visible>
    <ShowOnEdit>false</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Created_x0020_by</ValueColumn>
    <SortColumn>Created_x0020_by</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>19</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Created at</FieldTitle>
    <Required>true</Required>
    <FieldOrder>11</FieldOrder>
    <FieldType>CreatedAt</FieldType>
    <Visible>false</Visible>
    <ShowOnEdit>false</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Created_x0020_at_UDT_Value</ValueColumn>
    <SortColumn>Created_x0020_at</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>18</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Changed by</FieldTitle>
    <Required>true</Required>
    <FieldOrder>12</FieldOrder>
    <FieldType>ChangedBy</FieldType>
    <Visible>false</Visible>
    <ShowOnEdit>false</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Changed_x0020_by</ValueColumn>
    <SortColumn>Changed_x0020_by</SortColumn>
  </Fields>
  <Fields>
    <UserDefinedFieldId>17</UserDefinedFieldId>
    <ModuleID>447</ModuleID>
    <FieldTitle>Changed at</FieldTitle>
    <Required>true</Required>
    <FieldOrder>13</FieldOrder>
    <FieldType>ChangedAt</FieldType>
    <Visible>false</Visible>
    <ShowOnEdit>false</ShowOnEdit>
    <Searchable>false</Searchable>
    <PrivateField>false</PrivateField>
    <MultipleValues>false</MultipleValues>
    <NormalizeFlag>false</NormalizeFlag>
    <ValueColumn>Changed_x0020_at_UDT_Value</ValueColumn>
    <SortColumn>Changed_x0020_at</SortColumn>
  </Fields>
  <FieldSettings>
    <FieldId>30</FieldId>
    <SettingName>Abbreviate</SettingName>
    <SettingValue>False</SettingValue>
  </FieldSettings>
  <FieldSettings>
    <FieldId>30</FieldId>
    <SettingName>EnforceDownload</SettingName>
    <SettingValue>False</SettingValue>
  </FieldSettings>
  <FieldSettings>
    <FieldId>30</FieldId>
    <SettingName>ShowOpenInNewWindow</SettingName>
    <SettingValue>False</SettingValue>
  </FieldSettings>
  <FieldSettings>
    <FieldId>30</FieldId>
    <SettingName>TrackDownloads</SettingName>
    <SettingValue>False</SettingValue>
  </FieldSettings>
  <Context>
    <ModuleId>447</ModuleId>
    <TabId>100</TabId>
    <TabName>Merchants</TabName>
    <PortalId>0</PortalId>
    <UserName>host</UserName>
    <BestUserName>SuperUser Account</BestUserName>
    <DisplayName>SuperUser Account</DisplayName>
    <ApplicationPath/>
    <HomePath>/Portals/0/</HomePath>
    <UserRoles>||All Users|Administrators|</UserRoles>
    <IsAdministratorRole>true</IsAdministratorRole>
    <Parameter/>
    <OrderBy>UserDefinedRowId</OrderBy>
    <OrderDirection>ascending</OrderDirection>
    <CurrentCulture>en-US</CurrentCulture>
    <LocalizedString_Search>Search</LocalizedString_Search>
    <LocalizedString_Page>Page</LocalizedString_Page>
    <LocalizedString_Of> of </LocalizedString_Of>
    <LocalizedString_First>First</LocalizedString_First>
    <LocalizedString_Previous>Previous</LocalizedString_Previous>
    <LocalizedString_Next>Next</LocalizedString_Next>
    <LocalizedString_Last>Last</LocalizedString_Last>
    <NowInTicks>635864813985230000</NowInTicks>
    <TodayInTicks>635864256000000000</TodayInTicks>
    <TicksPerDay>864000000000</TicksPerDay>
    <LocalizedDate>12/23/2015 3:29 PM</LocalizedDate>
    <Now>2015-12-23T15:29:58.523-06:00</Now>
  </Context>
</UserDefinedTable>

XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:udt="DotNetNuke/UserDefinedTable" exclude-result-prefixes="udt">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />

  <xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>
  <xsl:param name="param_orderby" select="//udt:Fields[udt:UserDefinedFieldId=//udt:Context/udt:OrderBy]/udt:SortColumn" />
  <xsl:param name="param_direction" select="//udt:Context/udt:OrderDirection" />

  <xsl:variable name="orderDirection">
    <xsl:choose>
      <xsl:when test="$param_direction='descending'">
        <xsl:text>descending</xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>ascending</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="orderType">
    <xsl:variable name="DataType" select="//udt:Fields[udt:SortColumn=$param_orderby]/udt:FieldType" />
    <xsl:choose>
      <xsl:when test="$DataType='Int32' or $DataType='Decimal' or $DataType='Currency'">number</xsl:when>
      <xsl:otherwise>text</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <xsl:template match="udt:Data" mode="list">

      <xsl:call-template name="EditLink" />;
      <xsl:value-of select="udt:Company_x0020_Name" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Company_x0020_Line_x0020_2" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Address" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Address_x0020_Line_x0020_2" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:City-State-Zip" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Phone_x0020_1" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Phone_x0020_2" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Email" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Website_x0020__x0028_FULL_x0020_URL_x0029_" disable-output-escaping="yes" />;
      <xsl:value-of select="udt:Category" disable-output-escaping="yes" />

  </xsl:template>

  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <xsl:if test="$currentData">

      <xsl:apply-templates select="$currentData" mode="list">
        <xsl:sort select="*[name()=$param_orderby]" order="{$orderDirection}" data-type="{$orderType}" />
      </xsl:apply-templates>
    </xsl:if>
  </xsl:template>

  <xsl:template match="udt:Fields" name="SortingHeader">
    <xsl:param name="header" select="udt:FieldTitle" />
    <xsl:if test="udt:Visible='true' or udt:Visible='True'">

        <xsl:attribute name="href">
          <xsl:choose>
            <xsl:when test="udt:ValueColumn=$param_orderby">
              <xsl:variable name="flippedDirection">
                <xsl:choose>
                  <xsl:when test="$orderDirection='ascending'">
                    <xsl:text>descending</xsl:text>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:text>ascending</xsl:text>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
      ?<xsl:value-of select="$prefix_param" />_orderby=<xsl:value-of select="udt:ValueColumn" />&<xsl:value-of select="$prefix_param" />_direction=<xsl:value-of select="$flippedDirection" /></xsl:when>
            <xsl:otherwise>
              ?<xsl:value-of select="$prefix_param" />_orderby=<xsl:value-of select="udt:ValueColumn" />&<xsl:value-of select="$prefix_param" />_direction=<xsl:value-of select="$orderDirection" /></xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>

        <xsl:value-of select="$header" />
        <xsl:if test="udt:ValueColumn=$param_orderby">

        </xsl:if>

    </xsl:if>
  </xsl:template>

  <xsl:template name="EditLink">
    <xsl:if test="udt:EditLink">

    </xsl:if>
  </xsl:template>
<udt:template listType="div" delimiter=";" listView="<div class="dnnGridItem">[UDT:EditLink];
[Company Name];
[Company Line 2];
[Address];
[Address Line 2];
[City-State-Zip];
[Phone 1];
[Phone 2];
[Email];
[Website (FULL URL)];
[Category]</div>" headerView="" detailView="[UDT:ListView][UDT:EditLink]
<table>
  <tr>
    <td class="normalBold">Company Name</td>
    <td class="Normal">[Company Name]</td>
  </tr>
  <tr>
    <td class="normalBold">Company Line 2</td>
    <td class="Normal">[Company Line 2]</td>
  </tr>
  <tr>
    <td class="normalBold">Address</td>
    <td class="Normal">[Address]</td>
  </tr>
  <tr>
    <td class="normalBold">Address Line 2</td>
    <td class="Normal">[Address Line 2]</td>
  </tr>
  <tr>
    <td class="normalBold">City-State-Zip</td>
    <td class="Normal">[City-State-Zip]</td>
  </tr>
  <tr>
    <td class="normalBold">Phone 1</td>
    <td class="Normal">[Phone 1]</td>
  </tr>
  <tr>
    <td class="normalBold">Phone 2</td>
    <td class="Normal">[Phone 2]</td>
  </tr>
  <tr>
    <td class="normalBold">Email</td>
    <td class="Normal">[Email]</td>
  </tr>
  <tr>
    <td class="normalBold">Website</td>
    <td class="Normal">[Website]</td>
  </tr>
  <tr>
    <td class="normalBold">Category</td>
    <td class="Normal">[Category]</td>
  </tr>
  <tr>
    <td class="normalBold">Created by</td>
    <td class="Normal">[Created by]</td>
  </tr>
  <tr>
    <td class="normalBold">Created at</td>
    <td class="Normal">[Created at_UDT_Value]</td>
  </tr>
  <tr>
    <td class="normalBold">Changed by</td>
    <td class="Normal">[Changed by]</td>
  </tr>
  <tr>
    <td class="normalBold">Changed at</td>
    <td class="Normal">[Changed at_UDT_Value]</td>
  </tr>
</table>" trackingEmail="" sorting="true" />
</xsl:stylesheet>

Result:
CATEGORY 1

*

*Business 1, Address, Phone...

*Business 2, Address, Phone...

*Business 3, Address, Phone...

*Business 4, Address, Phone...
-
CATEGORY 2

*

*Business 2, Address, Phone...

*Business 5, Address, Phone...

*Business 6, Address, Phone...
-
CATEGORY 3

*

*Business 1, Address, Phone...

*Business 4, Address, Phone...

*Business 7, Address, Phone...

A: As a rule, grouping in XSLT 1.0 is achieved using a method known as Muenchian grouping. The basics of the method are explained here: http://www.jenitennison.com/xslt/grouping/muenchian.html
In your case, the problem is complicated first by companies having multiple categories, and further by having the categories listed in a semicolon-separated list (instead of individual elements, as would be the norm for a well-designed XML document).
This means you need to process the input in two passes:

*

*First, each company needs to be tokenized to create a separately
addressable node for each one of its categories;

*Next, we'll apply Muenchian grouping to the result of the first pass,
creating a group for each distinct category and list the companies
in that category.
For demonstrating the process, I will be using the following minimized input:
XML
<UserDefinedTable xmlns="DotNetNuke/UserDefinedTable">
   <Data>
      <Company_Name>Alpha</Company_Name>
      <Address>123</Address>
      <Phone>308.425.6031</Phone>
      <Category>Red;Green</Category>
   </Data>
   <Data>
      <Company_Name>Bravo</Company_Name>
      <Address>45</Address>
      <Phone>308.425.3652</Phone>
      <Category>Green;Blue</Category>
   </Data>
   <Data>
      <Company_Name>Charlie</Company_Name>
      <Address>678</Address>
      <Phone>308.425.7293</Phone>
      <Category>Blue;Red</Category>
   </Data>
</UserDefinedTable>

Applying the folowing stylesheet:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:udt="DotNetNuke/UserDefinedTable"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="udt exsl">
<xsl:output method="xml" omit-xml-declaration="yes" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:key name="company-by-category" match="company" use="category" />

<xsl:template match="/">

    <xsl:variable name="first-pass">
        <xsl:for-each select="udt:UserDefinedTable/udt:Data">
            <xsl:call-template name="tokenize"/>
        </xsl:for-each>
    </xsl:variable>
    <xsl:variable name="first-pass-set" select="exsl:node-set($first-pass)" />

            <xsl:apply-templates select="$first-pass-set/company[count(. | key('company-by-category', category)[1]) = 1]"/>

</xsl:template>

<xsl:template match="company">

<xsl:value-of select="category"/>

        <xsl:apply-templates select="key('company-by-category', category)" mode="list"/>

</xsl:template>

<xsl:template match="company" mode="list">

        <xsl:value-of select="name"/>

        <xsl:value-of select="address"/>

        <xsl:value-of select="phone"/>

</xsl:template>

<xsl:template name="tokenize">
    <xsl:param name="text" select="udt:Category"/>
    <xsl:param name="delimiter" select="';'"/>
    <company>
        <name><xsl:value-of select="udt:Company_Name"/></name>
        <address><xsl:value-of select="udt:Address"/></address>
        <phone><xsl:value-of select="udt:Phone"/></phone>
        <category><xsl:value-of select="substring-before(concat($text, $delimiter), $delimiter)"/></category>
    </company>

     <xsl:if test="contains($text, $delimiter)">
        <xsl:call-template name="tokenize">
            <xsl:with-param name="text" select="substring-after($text, $delimiter)"/>
        </xsl:call-template>
    </xsl:if>
</xsl:template>

</xsl:stylesheet>

will produce the following result:

Red

Alpha
123
308.425.6031

Charlie
678
308.425.7293

Green

Alpha
123
308.425.6031

Bravo
45
308.425.3652

Blue

Bravo
45
308.425.3652

Charlie
678
308.425.7293

rendered as:


text:
Q: Kyocera Taskalfa 2200 photocopier not working on archlinux I can't print with Kyocera Taskalfa 2200 on my archlinux, it has worked before but now its showing "idle rendering complete" and on localhost its saying "stopped filter failed".
I have deleted and added the printer again multiple times and reinstalled the drivers using yay as well.
any suggestions???
I get this warning when trying to add the printer

In local host it says filter has failed

in queue it says stopped


text:
Q: Can someone prove that the $\tilde{E}$ and $\tilde{H}$ fields in a waveguide looks as pictured?
Hi,
I'm trying to use the solution to the wave's equation in a rectangular waveguide for $\tilde{E}$ and $\tilde{H}$ to show how I can get the above picture. For example, why is the magnetic field looping around? Why is the electric field diverging towards the walls?
Can someone show me how I can get the above picture based on the following set of equations? (taken from here)

Thank you!

A:
For example, why is the magnetic field looping around?

Yours is nothing more (nor less) than the intuitive statement of $\nabla\cdot B=0$. Flux lines of a divergenceless field cannot "begin" or "end"; they must loop if $\nabla\cdot B=0$ holds at all points. Otherwise, a nonzero divergence betokens charge density, as with the electric field lines which are described by $\nabla\cdot E=\rho/\epsilon_0$.

Why is the electric field diverging towards the walls?

The walls are assumed to be perfect conductors. That means that, if there were a tangential component of the electric field at the walls, charge would instantly shift, thus giving rise to a cancellation field. Equilibrium is reached when the electric field lines pierce the walls at right angles. You assume equilibrium because you must assume a good enough conductivity that the charge shifting is a great deal faster than the wave's frequency. The field lines end on the wall, in keeping with $\nabla\cdot E=\rho/\epsilon_0$: there is a time varying charge density in the walls.
You may even want to try graphing some of those field lines: for the magnetic field for example, the last two equations tell you that $\frac{H_y}{H_x} = \frac{m\,b}{n\,a}\, \tan\left(\frac{m\,\pi\,x}{a}\right)\,\cot\left(\frac{n\,\pi\,y}{b}\right)$. $\frac{H_y}{H_x}$ defines the direction of the tangent to the field line, so you have a differential equation:
$$\frac{\mathrm{d}\,y}{\mathrm{d}\,x}=\frac{m\,b}{n\,a}\, \tan\left(\frac{m\,\pi\,x}{a}\right)\,\cot\left(\frac{n\,\pi\,y}{b}\right)$$
which is readily integrable and which you can plot in something like Mathematica.