The notion of PAC in approximation algorithms

Question: In computational machine learning, the notion of Probably Approximately Correct means that (generally speaking) we can find (or "learn") with a high probability a function which has "low error".
Is there a way to generalize this idea for approximation algorithms? What I thought of:
Given a language $L \subseteq \{0,1\}^*$, a confidence parameter $\delta\in[0,1]$, an error parameter $\epsilon > 0$, and a distribution $D$ over $L$, the algorithm $A$ is a PAC algorithm for $L$ if with probability at least 1 - $\delta$ it holds that $\text{ERR}(A,D)\leq \epsilon$, where $\text{ERR}(A,D) := \Pr_{x\text{~}D}(A \text{ answers wrong on } x)$.
One drawback of this definition is the following: suppose $L$ is a countable infinite set, and let $l_1, l_2,...,l_k,...$ be some enumeration of the elements of $L$. Since $D$ is a probability distribution over $L$, $\sum_{i}D(l_i) = 1$, and hence there must be some index $k$ such that $\sum_{j>k} D(l_j) <\epsilon$.
The algorithm $A$ can be defined as: remember the answers of the first $k$ words. When receiving $w \in \{0,1\}^*$ check if $w$ is saved (and if so answer correctly). Otherwise, answer "0".
Clearly this algorithm is a PAC by the above definition, but not a clever one.
Is there a way to define PAC algorithm for a formal language? Or: can we use the theory of machine learning in the theory of approximation algorithms?
Comment: Welcome to CS.SE!  What kind of generalization did you have in mind, and what did you mean by "approximation algorithms"?  Also in your proposed definition, when you say "with probability at least $1-\delta$", what is that taken over?  What is the random variable there?  The condition $ERR(A,D) \le \epsilon$ is either true or false; I don't see anything random about that -- it doesn't look like an event that you can attach a probability to.
Comment: My intuition is the following:  an approximation algorithm $A$ is an algorithm such that for every input $x$, $A(x)$ is "close to the real answer" - if this is an optimization problem, for example, then $A$ will return an answer which is close to optimum. I want to relax this definition and say something like "$A(x)$ may return an answer which is far away from the optimum, only if $x$ is a rare input". Trying to formalize this as I suggested leads to absurd: for any problem $L$ and distribution $D$, keep a table of "non-rare events". Is there a better way to formalize it?
Answer: Approximation algorithms don't make sense here, because here the output of the algorithm is 0 or 1.  (0 represents "the input is not in $L$", 1 represents "the input is in $L$".)  Approximation algorithms are useful when the output is a continuous variable, as then we can ask for the algorithm to output something that is close to the correct answer, but the concept is not useful when talking about algorithms that output a boolean.
Also, in your proposed definition, once you have fixed an algorithm $A$ and a distribution $D$ over $L$, the condition $ERR(A,D) \le \epsilon$ is either true or false.  It's not an event that you can assign a probability to.  So, it doesn't make sense to ask it to hold with probability at least $1-\delta$.


What information do IOTA nodes store?

Question: I considering IOTA for some nodes with very limited resources. In terms of storage and connection to the internet, what is the minimum necessary to have IOTA working in these nodes?
Comment: Are you talking about full nodes (store Tangle) or light nodes (ask full nodes to give them infos about the Tangle)?
Comment: I am asking about both types, in order to be able to discern when it is worth it to use one and when the other when resources are limited and unreliable.
Answer: The way I understand it, full nodes store every transaction that they and their neighbors are aware of. From, to, amount, message, tag, trunk/branch transactions, etc. They also store information about wallet addresses, such as balances.
Light nodes don't store much at all. Instead, they use API calls to the full node they are connected to, to get the information you requested. Things like balance, history, addresses.
Comment: Can you add any references that back up your information?

What information do IOTA nodes store?


What is the recommended Temperature setting for dual zone homes when not at home?

Question: Our home is a 2 story house(about 2200sq ft + basement) after reading some posts here I have set 75F on first floor and 77F on second floor which are both comfortable settings for us. But, i'm thinking to save some energy bill during the hours me and my wife are working. So the settings would be around 78F on first and 80F on second floor between 8AM and 4PM. My concern is, would the AC have to work hard at 4PM to bring he temperatures from 78 to 75 and utilize more energy than keeping the temperatures same through out the day? which is preferable? Temperatures around in this area during summer are between 80-100F.
Comment: Be honest with yourself.  "It saves energy to keep the house cool all day" is really just an excuse to keep the house cool for comfort.  If it were actually true, then it would be wise to leave your oven at 300F at all times so you don't have to "spend all that energy preheating it".
Comment: @Harper makes sense. Bought a new house, having a little bit of learning curve. Thanks for the tip
Answer: tl;dr Trial-and-error is your best bet. There's no standard answer.
There's really no such thing as "working hard". Efficiency is mostly a matter of minimizing total system runtime needed to keep you comfortable during a given 24-hour period.
Since every home and every HVAC system is different, you have a few considerations:

How quickly your HVAC system can recover X number of degrees
Whether the humidity that accumulates during the day is a concern

A couple tips:

Discontinue cooling up to an hour before you leave, but keep the fan running at least periodically. Your home won't probably start warming up enough to be uncomfortable.
Gradually increase the "away" temperatures until you find that recovery isn't happening in a timely manner or humidity becomes a problem.

Your climate and mine are similar, and I find that I don't need to maintain cooling at all during the day for all but a few days out of the year. Again, keep the fan on a periodic cycle to prevent stagnation and hotspots due to solar gain.
Answer: Here is the deal. It's all about temperature differential multiplied by time.
Imagine you have a tire with a small hole in it (the heat loss of your house) and you are trying to keep it pumped up (your HVAC). Would it be harder to keep it pumped to 100 psi or 50 psi for 8 hours?
Bringing the temperature down after it has been allowed to rise is actually cheaper than keeping low all day while you are not there. Many people believe it is cheaper to keep it low all day but if you do the math it is cheaper to set-back and then adjust the temperature when you are home.
Set back and save!


What is the characteristic of spoofed ARP packets?

Question: Hi what is the characteristic of spoofed ARP packets? I want to know how to detect it but before that I have to know how can I call a packet a spoofed packet. I hope you can help me thank you.
Comment: If there was really a difference between a legitimate ARP reply and an illegitimate ARP reply, then OS vendors would have something to detect that. You cannot tell the difference unless you already know the MAC address of the destination, and then you would not need to use ARP.
Answer: If you look at the packet, there is absolutely no difference in the format of a spoofed ARP reply and a real ARP reply: they look identical.
What makes a real ARP reply real?  It came from the computer which legitimately has the queried IP address.
What makes a fake ARP reply fake?  It came from a different computer than the one which really has that IP address.
Additionally there might be proxy ARP servers, although these are rather uncommon.  These reply to ARP on behalf of the computer with the IP address, but are legitimate in that they are set up for this purpose by the network adminstrators.
As you can see, the only difference is whether they are legitimate or not.
If you monitor ARP on a network, it can be very hard to differentiate between

a computer changing its network card: a given IP address reponds to ARP with one MAC address and then a different one
an IP address being given from one computer to another by DHCP lease change or manual reconfiguration
two proxy ARP servers
ARP spoof replies

You'll need extra information in order to know which is which.
Answer: In addition to jonathanjo's fine answer, there are ways to validate ARP reponses. Some switches allow you to configure DHCP snooping so that

only authorized DHCP servers work (rogue DHCP offers are dropped)
the snooped IP-MAC combination is constantly monitored on the switch, other combinations are dropped (known as Dynamic ARP Inspection or Dynamic ARP Protection)

Of course, MAC addresses can be spoofed, too but that is another question.
However, the very best defense against ARP-based attacks is to render them useless. Separate attacker and targets (move servers into a subnet and VLAN of their own) and don't rely on IP addresses for security.
Comment: Right, there is Dynamic ARP Inspection that works with DHCP Snooping.
Comment: But DHCP snooping only work on Cisco swith, right?
Comment: No. There are many vendors offering DHCP snooping and dynamic ARP inspection in their products.
Answer: In addition to the answers given, by my own experience ARP spoofing typically uses gratitious ARP and sends comparatively many packets, in order to drown out the actual host. I've used this strategy in HA cluster failover scenarios (when the host dies above the network stack level).
The first thing I'd look for if I suspect an ARP spoofer is an unusually high frequency of ARP packages. In a trivial implementation, they might even come at regular intervals.
Comment: Sorry sir,  may i know how did you know the frequency of arp packet? Did you monitor the arp packet on the network?


What are "verbos de transferencia" and how do they work?

Question: I came across a term that is new to me, "verbos de transferencia," in a recent comment.  Is this an esoteric term from grammar, linguistics or some more narrow field?  What sort of sorting of verbs is going on here, and what are the other possibilities?  What are the practical benefits, if any, to learning this way of sorting verbs?
Answer: It appears that the expression verbos de transferencia is indeed a thing in Spanish linguistics. The term appears, for example, in a paper about the semantics of the Spanish dative, or a classification of verbs, and surely in many other places. It doesn't seem to be an exotic or even interesting concept, but merely a useful label for a class of verbs that includes dar and its counterpart recibir.
In the first paper I cited the verbs of transference are restricted to those that refer to material (physical) transference (examples: confiar, devolver, enviar, infligir, otorgar, proporcionar, regalar, transferir, transmitir) , but in other places there's talk also of verbos de transferencia de información.
In the second paper I cited a project is explained that consists on the classification of Spanish verbs into a few classes of this kind. I would guess that such a classification would be useful to some students, or rather, to some teachers, or to the ones who design textbooks. By grouping verbs along syntactic and semantic lines, you can show the student how the same logic applies to many verbs.
Comment: Yes, I did. I'd never tried to find out about them because as I said, I don't think it's a very interesting concept in itself.
Comment: Thanks, Pablod76.  I have the impression you are familiar with all the standard stuff in linguistics as related to Spanish.  But you wrote, "It appears that."  I'm not sure -- did you mean you just learned about this now in response to my question?


Front brake cable loose from barrel adjuster

Question: The cable for the front brake on a rim brake has come loose, and I can't get it to squeeze into the barrel adjuster screw properly.
Comment: The problem is that the cable is loose.  If it were tight it would draw the ferrule into the barrel adjuster with little difficulty.  Did the cable come loose somewhere else on the bike?
Comment: ah, yes, I didn't realize the cable was so dependent on tension to remain in position
Answer: I'd guess that what happened is the other end of the cable slipped (at the anchor bolt on the brake). It probably wasn't tight enough and when the brakes were applied the cable pulled through the anchor bolt. Now the cable seems too loose at the barrel adjuster, but really it is too loose at the brake.
All you probably need to do is to loosen up the anchor bolt so that you can pull the cable back through and then tighten it down again. When you do this inspect the cable to make sure that it isn't starting to fray. If the brakes had been solid and this is a sudden change the cable fraying is one of the more likely reasons that I can think of for the cable suddenly becoming loose.
Answer: I had a very similar problem, I took it to a bike shop and they told me I was missing a brake pad.  Cost me $40 to get a new one and to get the brake tuned up.  Take it to a shop and they'll tell you what the problem is!
Comment: *boggle*   How do you not notice a missing brake pad while riding ?
Comment: @Criggie Maybe it's a rear one. The bike stops with the front one just fine; rider ignores the malfunction in the rear one for a while.
Comment: Welcome to [bicycles.se] @Kaden. Since you're new here, I recommend that you take our [tour], and also browse the [help]. In this case [answer] could be helpful. I'm going to recommend this post be deleted because it doesn't address the question asked. As you'll see by reading those links, we're not a discussion site.
Comment: An answer saying "take it to a bike" shop, when there's an accepted answer describing how to fix the problem, isn't useful. Almost any  question here can be answered that way, but people are almost always looking for how to fix the problem themselves.


Is asking about how to cite Ubuntu in a investigation on topic?

Question: I'm umming and aahing about this question. Does it belong on Ask Ubuntu? I would like to bring it to moderators attention without flagging it because I don't want to flag something not wrong.
Answer: In my opinion, no it does not belong on Ask Ubuntu. It has nothing to do with Ubuntu itself and less to do with any services provided by Canonical. This is a well-meaning but confused student who thinks that each and every tool used in their works should be cited.
Ubuntu is not a bioinformatics tool and Canonical hasn't provided any services relevant here. Citing your OS in your thesis is like citing the company that made your pencils. In any case, the question itself just might be on topic on Academia.SE but it really isn't on topic here.
Answer: From the help centre

Questions that you may ask:

Using and administering official Ubuntu flavors including: Edubuntu, Ubuntu GNOME, Kubuntu, Ubuntu Kylin, Lubuntu, Mythbuntu, Ubuntu Studio, Xubuntu, Ubuntu MATE, Ubuntu Touch, and Ubuntu "Snappy" Core.

Running third-party applications on Ubuntu.

Development on Ubuntu.

Services provided by Ubuntu and Canonical.

Any question not mentioned below or here are great!

It seems like a valid question. But I don't know the answer at all - let's get searching!
My pronouns are He / Him
Comment: Sure, but the question isn't about the OS or about any services (like Launchpad, or UbuntuOne) offered by Canonical. It's about whether the OS should be cited in an Academic paper and, if it should, what format the citation should take. Both questions would be better served on Academia.SE.
Comment: I am going to accept you... When I can!
Comment: And where did you get that from?
Comment: edited. The [help]
Comment: But this isn't a "service provided by Canonical" at all! This is about whether one should cite the OS they happened to use in an academic paper. It has absolutely nothing to do with Ubuntu (and the answer is o, of course you shouldn't cite it).
Comment: @terdon Yes, it is a service provided by Ubuntu. The OS is a pretty big service.
Comment: If it is about entire OS, the right citation would be "Canonical et al,  Ubuntu GNU/Linux, Isle of Man, 2004-2016" . Do not forget to also cite GNU and Linux.


Displaying User Relationships Module Blocks

Question: I'm unable to display any of the User Relationships' auto-created blocks in any of my sidebars. I have tried enabling all modules and permissions I can think of, with no success. The block I'm most interested in is the block that would allow users to be invited to an existing relationship (e.g. Friend), but as I say this nor any of the other blocks display. Other Drupal blocks and custom blocks display just fine. The blocks do show up in the blocks listing, and I've tried different ways of configuring them. Any help, or even confirmation that someone has been able to do this with the latest stable versions of Drupal and the User Relationships module, would be appreciated. Thank you.
Answer: Sorry to trouble you, but I think I found the problem: me! I had the incorrect notion (actually hope) that the "add someone to a relationship" block would display without allowing users access to the overall user list. It turns out that the block does display if a user can select another user from the list of users. I'm sure I'm missing something, but this seems to me like a weakness of the User Relationships module. Would anyone know if the Friendslist module works similarly? Thanks again.


Is it reasonable to refer another test case within a test case

Question: To avoid creating unnecessary/redundant steps within a test case, is it reasonable to mention or reference another test case to avoid redundancy?
Answer: It depends.
To decide whether you are going to reference other test cases to avoid writing the same sets of steps multiple times, you need to consider:

the audience - If your test cases are written for unskilled manual testers who are expected to execute them without much if any thought, you may be better off with redundancy.
usage - if testers are working with printouts, then you may be better with redundancy. If they're working with a tool and can simply click to open the referenced test case, you may be better referencing.
test case management tool - some tools make cross-referencing test cases much easier than others, for instance Microsoft's Team Services/TFS test management has the concept of shared steps which can be linked in and will be listed in full during test execution.
reporting needs - if you need to provide your customer with a copy of all test cases and your tool doesn't have the capacity to expand the linked test cases, you may need to list them all.

My preference is to avoid redundancy and repetition wherever possible, but there are circumstances where it may not be possible to have a more maintainable and DRY test case repository.
Answer: Generally No, particularly for automated testing.
Ideally each test case should have no external dependencies.  When you find the need to reference information from another test case you should consider refactoring to remove the redundancy and include the steps as setup for the test in question.
Ideally you want to be able to run any test on its own and any set of tests in any order.  Tests that have dependencies on other tests are a test code smell because we have learned over time that such dependencies lead to brittle fragile tests.
One option to address these issues is to ensure that you have a system for setup and teardown (often by using a test framework that does it for you).  Within this it will be common for sets of tests to have common setup tasks that are defined once and then done for each case in that group.  The data is NOT shared, it is still destroyed between each individual tests, the different being that the definition of the data is only done once.  This is often done in a tree like fashion so that as you traverse down the branches the setup for each test will be  combination of all the setups that are defined at the start of each branch that led you to the current test.
Answer: Yes this is totally acceptable in Software Quality Assurance Industry.
Thats why MS Test Manager contain a section named "Shared Steps" when we are on the test case writing section.
Comment: "in a proper way".  in the real world this breaks down and it is not a long-term sustainable stratgey. been there. seen that.
Comment: Because tools have options doesn't mean its a good idea by default. I would always challenge if you really want to create test step dependencies. Not saying you never should do it, but always wonder the long term consequences.
Comment: mmmm...acceptable. But Long term consequences will not occur if user manage the test cases in a proper way.So we always give the priority to test case management which is a main attribute in software QA.
Answer: it depends on what your purpose is to avoid the redundancy.
if your work and other people's work are more convenient and efficient after this improve, then it is a good improve. but if the result is the opposite, then it is not a good improve.
based on my experience, to avoid the redundancy is just to save the time when you create those cases. but it does not have benefits when executing them. on the contrary, it is inconvenient for testers to execute.because testers need to go back to the referenced case to see the steps,then go back again to the executed case. this is more inconvenient when there are many cases especially with EXCEL tool. even you use the test management tools to do this, it is also inconvenient to switch back and forth when reading those cases.
and for automated cases,it depends on the framework. but i think it is more complete not to avoid the redundancy. if one case has dependencies on other cases, it is better to comment on the case in case that someone does not know and only wants to execute one test case not test suites.


Residence Permit for retired economically inactive American long term stay in the Netherlands

Question: I am a retired self-sufficent American female who wishes to move to the Netherlands.  Can I apply for a Residence Permit without having to live with a relative in the Netherlands?  If so, which Residence Permit do I need to submit?
Comment: I suggest you begin your research by visiting this English-language Netherlands government page: https://www.netherlandsandyou.nl/travel-and-residence/visas-for-the-netherlands, which contains a link for "Staying in the Netherlands for longer than 90 days (long-stay visa)."
Answer: Going through the Visas for the Netherlands link provided by @David, I could not find a condition that fits your situation

retired self-sufficent

The nearest is independent entrepreneur, which does not apply in your case.

Assuming that a retired self-sufficent category also exists, you would have to apply here:

Applying for a long-stay visa (MVV) for residents of the United States | United States | netherlandsandyou.nl

If you want to stay in the Netherlands for longer than 90 days, you may need a residence permit. In many cases you will also have to apply for a long-stay visa before you travel to the Netherlands. This visa is also called an authorisation for temporary stay (MVV).
In the United States, you can apply for this visa at the Netherlands embassy in Washington or at the consulates-general in Miami, New York or San Francisco.
  ...
in person at a Dutch embassy or consulate.
  - independent entrepreneur [assumption retired self-sufficent is also possible]

You should apply to the Dutch embassy or consulate in person. You should make the appointment yourself. Below you can read how to do this in your country.

For such an interview, I would advise you to be prepared to be able to supply the following information:

where in the Netherlands you wish to live

for a cost of living estimate

regular monthly income

documented in a varifiable way

a realistic monthly cost of a mandatory health insurance

Health insurance and residence permit | Health insurance | Government.nl

Since a private health insurance can be very costly, the resulting sum will probably the desiding factor. This assumption is based on my personal experience with a Canadian friend who retired to Berlin.


Do I kill my main character?

Question: One of the main themes of my book is death and sacrifice. There's a lot of necromancy, ghosts, etc. The main character has already been brought back to life once before without her consent, which was at the start of the story. I was thinking of concluding the story with her dying in a final act of self sacrifice to kind of bookend the whole narrative and tie into the themes of self sacrifice and death. Problem is I love her too much, I'm too attached to her and I'm too invested in her romantic subplot. Do I bite the bullet and just do it?
Comment: We can't really make that decision for you, but you might want to check out [How to detach yourself from a character you're going to kill](https://writing.stackexchange.com/questions/45506/how-to-detach-yourself-from-a-character-youre-going-to-kill)
Comment: One thing to keep in mind is that you're reaching the end of the book. Unless you're planning to write a sequel, you'll have to leave your character behind anyway. I don't know if that helps. :)
Comment: You can resurrect her again, right?
Comment: @Llewellyn And even if you *are* writing a sequel, it doesn't have to have the same protagonist.  Just look at the Chronicles of Narnia, or The Hobbit & The Lord of the Rings.  A sequel could follow the Love Interest instead, and use "the 5 Stages of Grief" as a main theme...
Answer: Possibly, it depends on your overall themes of the story. There's a general trend in fiction for undead characters to be killed off by the end of a particular novel or series, but that's less because of the nature of the characters and more because it's hard to come up with a satisfying happy ending for them and the state of undeath is kind of...awkward. So the characters either get turned back to human or killed off under the assumption that the afterlife is a "better place" (it is frequently never shown to be that way. It's more of a way to awkwardly shuffle the undead character off-stage to avoid discussing the thorny moral implications of someone coming back from the dead.
If self-sacrifice is a major theme of your plot, you have a good reason for killing her off. This doesn't mean you have to, only that it is an acceptable outcome looking at the narrative from a solely thematic perspective. This is also only from the details you have given, associated details may make it more problematic.
It also depends on the setting. One major issue with any kind of resurrection in media is it erodes verisimillitude (because we can't resurrect the dead in real life) and raises the question of "if you can bring back one person, why morally shouldn't we bring back all of them". But if necromancy is already a part of the setting that is going to affect the tone of the story. That said, using a resurrection as an inciting incident is a good "one-time use get out of jail free card" because your readers expect something weird to trigger your plot. The Courier's miraculous near-miss with death at the beginning of Fallout: New Vegas is a good example of this. Resurrection in this case is handled like a miraculous second chance that isn't going to get repeated. If they get fully resurrected as the inciting incident there are no expectations for the hero to die (though having a heroic sacrifice at the end of the story won't be unexpected by the audience in general).
The big issue I see is unless you play it very carefully, your character's death comes off less like a heroic sacrifice and more like a subconscious desire to commit suicide. Especially if they've been brought back once before. See: Buffy the Vampire Slayer. A heroic sacrifice is about a character valuing someone or something else more than they value their own life. They still want to live, they just don't see saving both as an option. Dying because they want to die and saving someone else as a bonus isn't a sacrifice. An exception might be made for "they were dying of a terminal illness anyway", but that's become recently criticized as a cop-out and a cliche for writers to blunt the senselessness of a character's death because "oh, they were dying anyway".
It also depends on the other themes of your novel. I had an issue similar to yours once where I had a character that was expected to die but I couldn't bring myself to do it. It was only after a great deal of introspection that I realized the reason I couldn't do it was that the character's death conflicted with numerous other subplots in the novel and their death left the readers with a great sense of unease and despair rather than one of catharsis. Having them die in that manner would have violated the themes of the novel and made the message of the story hypocritical. Yours may be a similar issue.
Write what makes you happy as a writer. Maybe that does mean killing off a character for the sake of your long-term happiness, but don't include something simply because you feel you have to.

Do I kill my main character?


Does Cognito Forms support data collection and printing of long forms?

Question: I am trying to create a medical questionnaire for new clients to fill out at a healthcare practice. The information is quite long and detailed and once the form is filled out at the patients home it needs to be sent back to the practice via email and it then needs to be able to be printed on 2-3 normal portrait A4 pages. Does Cognito Forms support this functionality?
Answer: Cognito Forms can be used for small, two question forms, to long 50-page forms with hundreds of fields.  You can print entries via administration, which print in a read-only format in the same layout as the form.  You can also use this capability to Save as PDF (in Chrome) or print to PDF in other browsers.
You can configure Cognito Forms to send email notifications and confirmations when a form is submitted.  The notifications would go back to the practice in this case, alerting them of a new entry, and confirmations can be sent to the patient, letting them know their information has been safely delivered.
However, at least in the US, email notifications and confirmations should NOT be configured to include patient information, as email transmission is not secure.  Instead, the confirmation (if configured) should politely thank the patient for their submission (without details) and the notification should simply alert the practice of the new entry, with a link to review the information in Cognito Forms.  In the US, sending patient information via email is a major HIPAA violation, and I suspect that similar laws apply in most other countries.


Python TA-Lib abstract API usage

Question: I've had a look at the module documentation for TA-Lib as well as the abstract-specific guide, yet I am still unclear as to what exactly the abstract API can do for me (and how). Specifically, I would like to see a Python code example that instantiates a custom indicator which maintains indicator value state and periodically calculates, say, RSI from an individual input value, as opposed to an array of input values.
What I envision is the ability to pass values to an indicator sequentially (as they become available), so for example, instead of maintaining a numpy array of 700 items to calculate RSI on 5 minute candles - every 5 minutes - I wonder if it is possible to pass an abstract indicator function the candle close price, once every 5 minutes, and for it to output the 14-period RSI value calculated from state. This would be better suited to my application which keeps track of 9 different indicator values for 5 different timeframes indefinitely and around the clock.
Whilst numpy arrays are convenient for generating once-off indicator value arrays, a live system with ongoing indicator calculations would be more easily maintained and more memory efficient were the TA-Lib object to maintain indicator state somehow. Is this something the abstract API can do?
If not, I see an alternative in having a rotating deque (of 14 items - the RSI period) which can serve as input to the abstract indicator. A code example of custom data type implementation via TA-Lib abstract would be appreciated.
Answer: If anyone is interested, an answer with example code is provided at GitHub

Python TA-Lib abstract API usage


Why did Madara suddenly turn into Kaguya?

Question: In chapter 678, why did Madara suddenly turn into Kaguya? Was this all planned from beginning?
Answer: Spoilers ahead!

 When Black Zetsu impaled Madara, he transfered Kaguya's will into Madara. By this process, Kaguya was revived by using Madara's body as the host vessel. And yes, it was planned from beginning by Zetsu.

Black Zetsu's history:

 He was created by Kaguya and served only her. He acted as if he was Madara's creation, so he could facilitate the revival of his "mother", aka Kaguya. To do this, he planned the activation of Infinite Tsukuyomi by influencing Madara and the Akatsuki.

Further reading: Kaguya Ōtsutsuki
Answer: Black Zetsu is a shapeless manifestation of Kaguya's will, created before she was sealed by Hagoromo and Hamura. It planned to manipulate Indra Otsutsuki and his descendants to one day wield the Rinnegan and activate the Infinite Tsukuyomi.
Once Madara activated the Infinite Tsukuyomi and trapped everyones chakra inside the God Tree, Black Zetsu then stabbed Madara while he was sapped of his chakra, and uses his Ten Tail Jinchuriki body and combined his will to create a pseudo Kaguya.
Answer: Madara was used as a middle for Kaguya's revival as black Zetsu was an creation of Kaguya  then sought revenge after Hagoromo And Hamura Sealed Kaguya.
Black Zetsu Manipulated Indra into fighting his own brother and then there was a clan created called the Uchiha's and Madara was an Uchiha therefore he was an perfect suiting for Zetsu's plan and was tricked into believing that black Zetsu was helping him but found out when he had absorbed the victim Shinobi's chakra who were affected by the Infinite Tsukuyomi
And then was tricked by Zetsu by getting pierced by black zetsu and then being used as a middle for Kaguya's Revival.


Simple way/techniques of arranging all the ideas and scenes in a plot?

Question: Sometimes, I get confused as I add more and more ideas and scenes in a plot, is there any way of arranging these?
Comment: Do you mean like a program that will allow you to add and rearrange scenes as you work on your novel?
Comment: @Ralph Gallagher maybe writing techniques may work too.
Answer: Buy a bunch of 3x5 cards and write plot elements on them, then organize them into a line or a tree or some other visual representation that makes sense to you.  Play around with orders: put everything chronologically, then put it how you intend to tell it.  When doing this, you can also decide what not to tell by removing cards and seeing if the action still makes sense.  You can use highlighters to color-code different cards: either by character or by importance or by storyline, or whatever criteria you feel is necessary.
Keep in mind, not everything that happens needs to be known to the reader.  It might make things easier to write if you can figure out how to decide what they won't see.  Certainly make cards for every event that happens, but remember that just because you made a card does not mean you have to write about it in the story.
Comment: Totally agree with this. I use Scrivener too, but sometimes it's nice to have it physically there (and a wall generally has much more real estate than a computer screen!). I admit, I'm probably biased because I have a few walls filled with index cards planning out my plot and the world, but it *works*.
Answer: I highly recommend using Scrivener. It's an amazing Mac program that now has a Windows beta version. It takes Turnips' flash card idea and lets you do that in the program. You can also write the scenes and rearrange and add scenes as you need to.
Comment: beat me to it! :) Scrivener has a "cork board" screen which lets you move around virtual note cards so you can rearrange bits to your heart's content. You can write each chapter, section, or scene as an individual document and rearrange them.
Answer: You could try using a simple spreadsheet. Use the rows to represent characters or events and the columns to represent time frames or locations. You can put each of the elements into place to get a visual representation of your story flow. This will not only help you to develop a consistent timeline, but also to make sure that you don't have any characters showing up in two locations at the same time.
Answer: I've used various methods. Right now I'm using the "Windows" based POST-IT notes and have created a "story board" using their memoboard. I also copy the data to a flash drive to use on others PCs.


Taxis at Tokyo Haneda Airport

Question: I'll be flying into Tokyo Haneda at 10:25pm on a Sunday and rather than try to figure out the public transit system that late in the day when I'm already probably going to be exhausted I was thinking I'd prefer to just take a taxi to the hotel. My question is...  do taxis loiter around at the airport, waiting for passengers, as they do in the USA?
Answer: Yes, of course there are.  Depending on where you're going, it may cost you up to ¥10,000 (~US$100) if you board after midnight.
Answer: If you're wanting to save a little money on extortionate Tokyo taxi fees there is a direct monorail service from Haneda Airport to Hamamatsucho, cutting the distance required by taxi significantly. Outside Hamamatsucho (the main 'departing to Haneda' station) are a huge fleet of taxis. The monorail is fast and the station is inside the terminal.
Comment: Just beware that the last weekday service departs at 0:10, although clearing Customs etc in an hour and half should not be a problem.  Also, depending on where you're going, the Keikyu railway (also within terminal) might get you closer to your destination.  It's nowhere near as fun though ;)
Comment: True, I arrived around 11pm on an Emirates flight recently and made it with about 10 minutes to spare. Just make sure to not dawdle as you leave :)
Comment: I had considered that option for a flight but decided I wouldn't be able to get to suburban Tokyo so chose another flight. Good call on taking the monorail to central Tokyo and then a taxi though... that way even if trains shutdown you can still get place, but save the cost of the trip into Tokyo.

Taxis at Tokyo Haneda Airport


Using "Find a Manager" action in SP Designer 2013

Question: I have created a 2010 list workflow using the following actions:

Find Manager of (Current Item: Reviewer 1) (output to (Variable: manager))
  If (Variable: manager is (not empty)
  Update item in (Current Item)

I published this workflow and went into my SP 2013 list workflow and did the following:

Start a List Workflow with (no parameters) on (Current Item)
  Go to (End of Workflow)

Both workflows are set to start automatically with a new item.
I tested by adding a new item to the list. I can see that both workflows were successfully completed, but there is nothing that appears in the Manager column that I assigned the workflow to update.
Please help!
Answer: I found this article that was of great help to me:
Lookup Manager of a User
In the 2010 workflow, Find Manager action, for the user you are looking at, make sure to set the "Return Field as" dropdown to "Login Name".
This fix, along with my steps above seemed to work.


Capitals Always Appearing in Heading

Question: Can someone let me know why my heading alway appear as Capitals, even the configuration in Joomla is lowercase?
See images
Comment: Most likely it's in your css. if you share a link to the page with those headings we could give the exact answer.
Comment: Thanks for responding here you go http://www.keylooplabs.com/index.php/workbooks-2/pan-edu-201/module-1-platforms-and-architecture/single-pass-architecture
Answer: The link you posted requires login to display the content, however I checked other pages and found that your h1 headings are set to be shown as uppercase in your template's css, line 63:
<code>/templates/gk_news2/css/template.css
</code>
In order to change this styling, unless there is a backend setting in your template's options, you will need a css override. Following this link: How do I override the CSS styles in my template?, you will find extended info on the proper way to create a custom css file for many well-know commercial Joomla templates (you are using a gavick template) - Johanpw's answer has covered this template provider as well.
But here is the bit of information you need:

Gavick Pro templates ship with an empty overrides.css file in the /css/ subdirectory. But note that this file is not loaded by default,
  you have to activate Override CSS in the Advanced Settings tab in the
  template settings.

Gavick website provides more info here: https://www.gavick.com/documentation/joomla/templates/customization/custom-template-css
After you have created your override css file, you need to write your css that will override the uppercase for h1.
So something like this should work:
<code>h1 {
    text-transform: initial;
}
</code>
If you don't see a change, make sure you have cleared caches both browser's and Joomla's and that your css override files is loading.

Capitals Always Appearing in Heading


Function overloading vs. default parameters in VB.NET?

Question: In VB.NET, which is better to use: function overloading or default parameters?
Answer: if the parameters are optional (i.e. the overloads are a subset of the parameters that the full procedure signature accepts) then default or optional parameters would make more sense.
If the overload is allowing a different type for the parameter or is a semantically different parameter that will be interpreted differently by the routine then overloads would make more sense.
Answer: Is the code going to be used by other languages? If so, that swings the balance towards overloads while still bearing Hamish's answer in mind. In particular, C# doesn't support optional parameters - yet...
Admittedly this wouldn't actually prevent someone using your code from C#, it just might be a pain for them.
If there are a lot of parameters and they logically represent something, you might want to consider encapsulating them together, in the same way that Process works with ProcessStartInfo. That's particularly nice from C# due to object initializers.
If this is for construction, you might also consider the builder pattern as a variant of this. For instance, in Protocol Buffers I can do something like:
Person jon = new Person.Builder { Name="Jon", Age=32,
                                  Spouse="Holly", Kids=3 }.Build();

which ends up being very readable while still creating a person in one go (in one expression, and without having to mutate the person itself - indeed the message type is immutable; it's only the builder which isn't).
Comment: Another "Pro" of overloads is that you can see how many references each overload has. Somenthing you cannot do with optional parameters.
Answer: FYI
If you want to add a parameter to a function or method that is called from other assemblies, then:
You can overload by making an additional function with the extra parameter.
Or you can add an optional parameter, BUT: You have to recompile all of the assemblies that call this function, even if they don't need to use the new optional parameter!  This is not usually what people expect (expecially those used to how VB6 works).  Basically, you can't slip in a new optional parameter to a function and expect it to be totally backwards compatible.  Also, as I understand it, if you change what the default value is, you need to rebuild all calling assemblies for the change to work.


Does department receive funding for each PhD candidate

Question: The reason I'm asking is because my PhD supervisor "collects" - for lack of a better word - PhD candidates. She has at least 15 PhD candidates. None of them is being hired, except for one - as her private secretary. She also does not mind stringing out PhD duration by giving no input whatsoever but insisting that the research is still "weak" (without explaining how), and would let them go only after >5 years have passed. This makes me wonder whether the department receives money for each PhD candidate to finance the department, so that the PhD candidates' number and years spent there are of essence. I'm in Germany. We find the situation not ideal, but we are afraid to take this matters higher up, as we don't know if this might backfire. Is there anything to be done to get out of such situation?
Comment: What OP describes is common in the humanities in Germany (well, maybe not always to the extreme of having 15 candidates) -- not so much in STEM fields.
Comment: What do you mean by "She has at least 15 PhD candidates. None of them is being hired"? If she has PhD candidates, surely they were hired? Or are they working on their own dime? — And what do you mean by "private secretary"?
Comment:  Who does this voluntarily?!
Comment: Is this PhD supervisor the same as in your previous post: https://academia.stackexchange.com/questions/107485/can-i-tell-my-phd-supervisor-honestly-why-i-want-to-leave-him?
Comment: @KonradRudolph They are working on their own dime. Moreover, the professor herself doesn't have any research, so there is nothing to be done in the department. The only PhD candidate hired as (officially) "research assistant" is given the task of typing the professor's attendance lists and such.
Comment: No. I'm rather unlucky with supervisors. My first one was really bad. My second one - the one I met in a conference - retired from academia for personal reasons, and this one took over from the second, because she's the only other professor in the department.
Comment: Wait, your department consists of one professor? You're sure they're not gonna shut it down?
Answer:
This makes me wonder whether the department receives money for each PhD candidate to finance the department, so that the PhD candidates number and years spent there are of essence.

(Context: I'm familiar and have first-hand experience with the German system.) There is no direct flow of money for each PhD candidate. However, the number of graduated PhD students is seen as a performance metric for both departments and professors, and professors might receive a certain salary bonus for scoring well on that metric.
A rational reason for keeping around the candidates longer than necessary might be that she wants to squeeze more work out of them, including papers. There might also be other, non-rational reasons.

Is there anything to be done to get out of such situation?

Walk away. The advisor seems to have little to offer except for the dangling carrot of an eventual PhD degree; however, for a person that values their time as an asset that could be used for other things, that's probably not worth it.
Comment: @Yellow In principles yes, but in Germany things tend to be a bit different. To my knowledge, processes for switching supervisors mostly do not exist -- the departments don't play a role in the "supervisor to PI" matching. PhD students might still be able to switch, but they usually need to find new supervisors on their own (which can be tricky, especially if a supervisor at the same department is desired).
Comment: @Yellow I estimate that a complaints about this professor would be unlikely to have any positive effect. Professors in German enjoy a great deal of freedom in managing their PhD students. Unless they clearly violate some laws or ethical standards, there would normally not be much the department can do.
Comment: If you are already to a reasonable point of graduation anyway, it _might_ be possible to get out by convincing the advisor that you will (have to) quit without graduating if you don't gradate in a specific time frame. Since you will be gone from the advisor either way and having a graduated student is usually preferable to a non-graduated student. This is more likely to work if the advisor's motivation is, say, free labor, rather than if she sincerely believes that you aren't ready yet.
Comment: @Yellow Traditionally there is no *official* such notion as "having a supervisor" - you need to have someone who acts as a supervisor when you hand in the thesis, but how you get to that point is up to you. So "switching supervisors" means basically that you have to find someone who is willing to act as the official supervisor for the purpose of the defense. Depending on the department (topics, but also social aspects) this might be tricky. Things are different if there is a graduate school structure, but this seems not so likely given the circumstances.
Comment: Just a small addition to the "Walk away" part: most universities have processes for switching supervisor or even filing official complaints (shouldn't be your first option). You have very little to lose and a lot to gain from doing this. As to "as we don't know if this might backfire" - I appreciate this is a concern, but the you have to weigh the benefits too. If as you say there are 15 PhDs in the same boat, it stands to reason you collectively bring this up as a problem which is unlikely to incur personal repercussions.
Answer: There is nothing wrong with asking the question in a neutral manner to your administration or student representative.
I am not sure about Germany, but in France for instance, having doctoral students graduate on time (3 years) is considered a positive indicator for the department/university, and it is complicated for students to be funded beyond that - which has its own drawbacks.  Some information can be found in HCERES reports, eg p7 of https://www.hceres.fr/sites/default/files/media/downloads/e2020-ev-0772710c-def-ped200021039-rd.pdf.
Answer: This is something that happens everywhere, and the extent of this depends goes beyond the funding model to cultural differences across disciplines and the personal style of the supervisor.  Getting additional data points - is this a generic features in other groups around you or something specific to this supervisor ? - is important.
Beyond metrics valuable to the supervisor mentioned in another post, good students should be able to finish early and - if they have a constructive relation with their supervisor - will likely continue to work with the supervisor (at least in the short term) to finish papers.  As a result, my experience is that it is rarely sign of a healthy group when students routinely overextend their degree.
Comment: "good students should be able to finish early" Indeed, but from the perspective of a formal assessment of the professor/department, the trouble is that there might not be any information about the actual time taken to finish. At many departments, it's possible to register the PhD candidate just in time before they hand in their thesis.
Comment: @ZeroTheHero It is not playing the system, in Germany you do not always need to be enrolled/registered as a Doctoral student, in many Unis you can just hand your thesis (if supervisor approves), defend, and get your degree, without being enrolled at all. It is very different compared to other educational systems.
Comment: @lighthousekeeper agreed it's often possible to play the system.  In North America it is harder to do what you suggest as universities collect tuition and there is usually a residency period to avoid precisely the situation you describe.
Comment: @Dr.Snoopy Exactly. Fourteen out of the 15 PhD candidates she has are the so-called external PhD candidates. They can't be hired, as the professor isn't doing any research, i.e. there's nothing to do in the department. They would come for consultations, told to improve the grammar and such, and it would go on and on for years. PhD candidates are in a weak position and are often trapped in a situation like this.
Comment: "good students should be able to finish early" - I think this is a very simplistic view. Unless you strictly define "good" as "being the winner in a race for time" (which IMHO a PhD is not), good students may easily finish *later* exactly *because* they are good. They may become involved in more endeavours, dig into their questions in greater depth and in more aspects, play a key role in more projects, and overall may also feel more "at home" in their academia environment than "not so good" students who may strictly follow the easiest/quickest path to their degree.
Comment: @O.R.Mapper I'm not sure I agree with some of your statements.  A PhD should not open-ended (timewise). Of course some students could take an extra year but a good thesis director will recognize when a student has done enough good work to stop, write the thesis and move on, this without being a race or compromising the quality of the work.  I agree that racing a student to the finish is rarely desirable, but knowing when a student should stop, and making sure this is roughly on time, is a mark of a good advisor.
Comment: @ZeroTheHero: (having 14 external and only 1 normal PhD student is definitively unusual) In my field, chemistry, external PhD students work (are employed) e.g. in industry and do their thesis as a side line to their every-day work. "On time" isn't very meaningful in this situation. Note that the German system is very different in this respect e.g. from the Italian where a PhD student must be hired for a prescribed number of years to do their PhD.
Answer: I work at a German university and I assure you that profs do not get money for every PhD candidate. And to be honest, I have never heard of a prof having 14 PhD students doing unpaid work for them.
Where I work, a prof usually gets the money for one or two young researchers - either a PhD student or a postdoc, or both. (This is why she is able to pay one of you.) If they want to have more, they themselves have to apply for third-party funded projects, e.g. from the Deutsche Forschungsgemeinschaft.
As competition is very high here, getting a third-party funded project is always a success, so profs that have a lot of PhD students are considered successful.
I think your prof does this to push her own career. If she has many PhD candidates, she can publish a lot with her name on it without having to do too much herself, and at the same time she at least pretends to be successful in getting funds. This is why she does not want to let you go.
If I were you, I would leave this prof as soon as possible.
Answer: Although I am not familiar with German system, I suppose this is the same as the other countries. Usually, not the departments nor the professors receive straight money per the time the Ph.D. candidates are there. (Although based on the rule of some universities the candidates are penalized after passing a certain time, this money usually is not paid to departments, it is mostly paid as university private revenue).
Anyway, Ph.D. candidates may have different indirect benefits: If they write more papers or receive more research grants from organizations it is beneficial; additionally, they may assist the professors to help other students; their longer education may show the professors' colleagues their seriousness and hardwork.
Another important reason can be the score that professors receive after educating each Ph.D. candidate. He may want to save this working score for his next year.
Or some professors just pass the times to get retired. They don't like to have more students and don't like to spend more time for their job. If their older students got educated, they might have to struggle with a new student.


What is the overall procedure to upgrade a kitchen to kosher service?

Question: If a Jewish family buys a house from Gentiles, naturally the kitchen would not be left in a kosher state.  What is the list of special decontamination or other upgrade procedures necessary to convert a gentile kitchen to kosher use?
Comment: The process you're asking about is called "[kashering](http://www.myjewishlearning.com/article/kashering-making-kosher/)." To determine how to apply it in your own kitchen, you should consult a local rabbi. As I understand it, many rabbis have a great deal of experience helping people kasher their kitchens, as congregants choose to upgrade their observance of kosher laws. I wish you much success!
Answer: This is a very fundamental question that deserves a serious answer. I am attempting to provide one based on my own experience, and my knowledge that not everyone is prepared to consult an Orthodox rabbi about this (although they really should, and it is standard for Jews to do so about such matters).
Basically, anything directly in contact with food during service or preparation needs to be formally "kashered," unless it is new. This includes appliances; dishes; utensils; surfaces (countertops, sinks, shelves or drawers) with which warm or liquid or piquant items may make contact; and all cleaning tools for the items above, such as sponges, dish brushes, and the dishwasher. Anything that cannot be kashered must be covered (preferably double-covered) with disposable material such as tinfoil or plastic for use. This is not always possible.
If the item is not new, kashered, or covered, it may not be used in a kosher kitchen. (If it is used, it may render not only the food, but also other parts of the kitchen non-kosher.) If something becomes non-kosher, it then has to be re-kashered, covered for use, or replaced with a new item.
Instructions for kashering various items can be found here. (If you learn that something "cannot be kashered," that does not mean you can just use it in its current form; it means you must either buy a new one or cover it for use.)
Once your kitchen is kosher, going forward, every dish, appliance, or surface--except those that will only be used for cold AND dry AND non-piquant items, without direct contact (such as refrigerator or pantry shelves)--must be designated for either meat or dairy. Usually, people buy dishes and utensils of two colors (often red and blue) and designate one for meat and one for dairy, or else they store everything separately, with labels. It is generally best to store meat and milk things separately (in different drawers/on different shelves) anyway.
Foods that are parve--neither meat nor dairy--may be used on or with both categories. However, a single parve item may not be "transitioned" from one category to the next. (This is an oversimplification--actually the laws on this matter are quite subtle--but don't try it unless you know them.)   (Parve includes eggs and fish. Hechshers have various ways of indicating whether an item is truly parve; merely reading the ingredients list is not a reliable way to determine it.) (Some people have a third set of dishes for strictly parve food, because for complicated reasons this can be helpful at times--but it is not necessary.)
Once your kitchen is kosher (=everything listed above has been covered, kashered, or replaced with new), in order to keep it kosher, you must observe laws of kosher food preparation at all times within your kitchen. If non-kosher food (OR kosher food of the wrong category--meat versus milk) has contact with your items, the items become non-kosher and will have to be, once again, covered, kashered, or replaced.  ((There are some occasions for leniency with this, especially if the contact was between two cold AND dry AND non-piquant food and surfaces, but a rabbi must be consulted.))
Non-kosher food can enter your kitchen only if it is clearly identified, separated, and double-wrapped before being placed on any kosher surface. The same applies to food of the "wrong" type (meat or milk) being placed on a surface that is designated for the other type.
The laws of kosher food preparation are extensive, but, for the purposes of keeping your kitchen kosher, they essentially boil(!) down to (1) only using ingredients with a hechsher (some products, such as fruits and vegetables, do not need to have one), and (2) keeping meat and dairy cooking completely separate. "Meat" cooking includes any cooking that has a meat ingredient, or was cooked, or includes anything cooked, on meat surfaces or dishes. This includes any kosher product labeled "meat"/"fleishig," even if it does not appear to have meat in the ingredients. (It probably means it was cooked on meat dishes.) "Dairy," similarly, includes any product labeled "dairy"/D/milk/"milchig," or that has any dairy ingredients, or that was prepared on dairy equipment, or using dairy dishes. With regards to the last point--"prepared on [meat/dairy] dishes"--this is actually a complicated issue, but to be safe, consider something that was prepared on meat dishes to be a meat product, and vice versa. For a fuller overview of kosher cooking laws, see here.
--
There is one more point that is not technically related to kashrus, but that is very important if the kitchen is Jewish-owned. Anything made of metal or glass in your kitchen that it is possible to remove from the kitchen must, in that case, be "toveled" before use. This means bringing it to a mikvah (a ritual pool of water intended for this purpose)--or a natural body of water that has the status of a spring--and dipping it in, often after saying a blessing. Metal and glass things that can't be removed from the kitchen have alternate procedures for tevila. (A discussion of some possibilities is here, but best to consult a rabbi.) Tevila is done after kashering (or after buying a new item) and must be completed before the item is used. Disposable items may be used, even multiple times, without tevila, if they are bought with the intention of being disposed.
If something was given to you by a Jew, or purchased from a Jewish-owned company, you probably do not need to tovel it--see here or ask a rabbi.
Good luck!
Comment: Instead of double-covering surfaces on countertops, fridges, and freezers with thing layers of plastic or foil, may I use a single thick layer of Lexan (plexiglass)  on every surface instead ?
Comment: @eternalsquire I don't see why not; people do similar things for Pesach kashering. But, in general, I would really advise asking an Orthodox rabbi about anything practical
Comment: @eternalsquire Sometimes when you consult a rabbi you will learn that it is acceptable to be more lenient than you thought. For example, when I kashered my last kitchen, I learned that I didn't have to do anything about the fridge. That was in my case, though; YMMV


What is DC level in white gaussian noise?

Question: Am studying unbiased estimators and keep seeing this term "DC Level". What is the expansion of DC and what is a DC Level? Even the Wikipedia page on WGN says nothing about it.
Answer: DC level in signal processing refers to the average or the mean value of a signal. So a zero-mean signal will have an average value of zero over its domain of definition.
When this concept is extended to the stochastic processes, we shall distinguish between time average and ensemble averages. A stochastic process can be viewed as an ensemble of time functions and a sequence of random variables. When a stochastic process is assumed to be ergodic, then its time averages over a sample function equal its ensemble averages over the random variables. In such a case the zero-mean random process creates time functions which have zero averages, hence zero DC levels.
Answer: Ok found out myself from a book. DC refers to Direct Current which is equivalent to a constant function. So when saying DC level A in noise, we say we are observing a pattern that resembles direct current of certain constant value plus white gaussian noise.


Are there any pre-20th century examples of an augmented 6th chord with a leading tone?

Question: In a discussion about blues music, a friend described the presence of both minor and major thirds in a dominant-seventh tonality as a blues innovation.  I wondered if there were examples of dissonant non-chord tones in pre-20th century music that give this effect?  The context that popped into my head was an augmented 6th chord (enharmonically equivalent to a dominant seventh) with a leading tone in the melody resolving to the tonic.  The leading tone would function as the minor third, against the major third in the augmented 6th.  But I couldn't think of any specific examples in pre-20th century music where this actually happens.  Can anyone think of such an example?
Comment: The usual German augmented 6th (enharmonically equivalent to a dominant 7th harmony) contains scale degrees 6, 1, 3, and ♯4 of the minor key. It typically resolves to V, with the 6 and ♯4 expanding to the octave. It does not include scale degree (♯)7, the leading tone of the key. What do you mean by "the leading tone would function as the minor third"?
Comment: Agreed with Remy here, you're notes don't add up. Also, augmented 6th chords usually lead us somewhere, serving more as a pivot. It sounds like you and your friend were more discussing modal mixture.
Answer: I think OP's question makes sense; they're asking about a minor third (well, an augmented second) above the bass note of the augmented sixth.
In C, an augmented sixth is A♭, C, and F♯. This is shown below in the "A" example.

But along with the C, I think OP is asking about also including a B, an augmented second ("minor third") above the bass A♭; this is shown above in the "B" example.

Now, regarding the actual question, I can't think of any examples that include both of these scale degrees.
However, while most augmented sixth chords function as pre-dominants, there are augmented sixths chords that function as dominants. One is shown below; note that the asterisked chord includes the augmented sixth from D♭ to B, and the chord is equivalent to a French augmented sixth chord. But note that this chord resolves to a tonic of C, not a dominant in F.

Whether or not this is a bona fide augmented sixth is up for discussion. Often it's just a V43 that then changes to a lowered scale-degree 2 before moving to tonic, but the point here is that this augmented sixth chord does include the leading tone. This is exactly how Bruckner used it in the Adagio of his Seventh Symphony, written in the early 1880s (I start the video at the overall progression, but the chord is at 4:20):
Comment: I'm not sure how much luck you'll have looking for clashing thirds this early. But I'll keep thinking about it!
Comment: You're correct about my original intent - I was looking for something exactly like the 'B' example you described.  Or really, anything with the same intervallic relationships - a chord with a minor third (or augmented second) above the root clashing against a major third, with a minor seventh (or augmented sixth) also.  I see how your Bruckner example involves a leading tone in an augmented sixth chord, but it doesn't involve the "clashing thirds" that I am hoping to find.
Comment: [Clashing thirds](https://music.stackexchange.com/questions/3777/can-a-chord-contain-both-the-c-and-c%e2%99%af-notes-as-opposed-to-containing-c-and-d/65933) aren't all that hard to find. The combo of clashing thirds and an augmented 6th above the root is a taller order, I think.


Root Samsung Galaxy J Max ( SM-T285YD)

Question: How to root Samsung Galaxy J Max ( SM-T285YD) Tablet and install TWRP Recovery?
Till now i have already tried apps like KingRoot, Towellroot, RootGenius and all of failed rooting this device.
Comment: Rooting and installing TWRP are different things. You'd better start with latter.
Comment: Yeah I know that . I am asking  help for both issues.
Comment: So you should create different questions for each.
Comment: SM-T285YD is Galaxy Tab 2 (2016) ?
Comment: @esQmo Thinking of a similar thing... The T285(Y) model name is tied to Tab A 7.0 (2016), and these 2 devices look markedly similar (J Max does have a gold accent).
Comment: @esQmo No its Galaxy J Max (2016).
Answer: If your device is 5.0 and higher you will need to perform oem unlocking. Otherwise you will have a brick
YOUR WARRENTLY IS NOW VOID
Some Samsung devices doesnt work with rooting tools installed on the device so you will need to install KingoRoot/KingRoot.exe on your computer, open it and read instructions..
Rooting your device with kingo root is easier because hardly any setup it required but if you are into SuperSU, kingroot is recommended
Just press that root button and wait.. make sure you have a good amount of battery..
Now installing TWRP. Your device must support TWRP if theres no twrp for your device DO NOT FLASH TWRP THAT WASNT MEANT FOR YOUR DEVICE!!!
Download Samsung Drivers (Your device might install it for you, if not install it from the web)
Download Samsung ODIN v3
Download your twrp recovery in a format of TAR.MD5
Select AP and select your recovery
Put your tab into download mode (Power+VolDown+Home)
Connect it with Usb Cable
Once it said Added! Press START.
Before you do that just make sure F.Reset Time is ticked and reboot also because i dont think ur tab doesnt have a removable battery.
Once it said PASS your done just shut down your tab and boot into recovery (VolUp+Power+Home)
And here you go! You are running TWRP
Also for more help for your device go to this site XDA-DEVELOPERS.COM
Comment: This method won't work on Samsung Galaxy J Max. So far none of the apps available on the internet has able to root this phone both android and pc apps fail. Tried ODIN to but root failed and my phone stucked in downloading updates luckily i had an official firmware and i recovered from it. I think currently rooting is not possible for this phone till developer find it. Don't try to use any unofficial firmware either you can damage your phone i tried every suggestions and methods available in the internet but all have failed. I think we have to wait till developers find vulnerability in this de
Comment: @Risingmoon Still no Options?

Root Samsung Galaxy J Max ( SM-T285YD)


How does one find a project management related freelance project?

Question: I wonder if it is even possible to find a freelance request for proposals which is related to project management, a client seeking for a manager? Why is such a job so rare?
Answer: Usually you need a manager if you have many people in a project, so the ratio managers:developers is already low.
And then you have teams that have enough experience to manage themselves, means they don't need managers.
And then most people don't realize that they need a manager, just hire some developers, mostly unexperienced. When the project derails and they realize it, most of the time it is too late to get a manager on board or they don't realize how important it is, throw in more developers and go bankrupt even faster.
In the companies that realize how important managers are and that stay on the market as potential customers, usually there is already a manager or a team of them present, so they don't need a freelancer.
A good way might be to offer both management and consulting services, usually people are ready to pay for some consultation how to get the project running, and then you might have an in to convince them they need a project manager and that you would be a good fit.
If you charge differently for management and consulting, you should state this up front, not after you already have them convinced.
Comment: I like your conclusion. But I suppose consulting is more push than pull in terms of hiring, I mean consultant himself has to search for clients most of the time. Not a problem for an experienced freelancer, but I'd like someone to confirm or deny my thoughts.


Is the code freeze affecting mining?

Question: Is the code freeze preventing xmr-stak from running correctly? I have been away for a little bit and just tried to boot up my miner, but I keep getting "result rejected by the pool" displayed.
Answer: A code freeze wont prevent you from mining correctly. I suggest ensuring you are using a miner and pool that supports the current Monero hashing algorithm and ensure you have configured the miner correctly, as if you are getting shares rejected, this is the first place to look. But no, nothing to do with a code freeze would cause this.

Is the code freeze affecting mining?


Calculate the closest point to many hyperbolic paraboloids

Question: In this question I asked for a way to compute the closest projected point to a hyperbolic paraboloid using python.
Using the iterative approximation answer, I'm able to use the code below to calculate the closest point to multiple paraboloids.

import numpy as np
np.set_printoptions(suppress=True)

# This function calculate the closest projection on a hyperbolic paraboloid
# As Answered by @Jaime https://stackoverflow.com/questions/18858448/speeding-up-a-closest-point-on-a-hyperbolic-paraboloid-algorithm

def solve_uv(p0, p1, p2, p3, p, tol=1e-6, niter=100):
    a = p1 - p0
    b = p3 - p0
    c = p2 - p3 - p1 + p0
    p_ = p - p0
    u = 0.5
    v = 0.5
    error = None
    while niter and (error is None or error > tol):
        niter -= 1

        u_ = np.dot(p_ - v*b, a + v*c) / np.dot(a + v*c, a + v*c)
        v_ = np.dot(p_ - u*a, b + u*c) / np.dot(b + u*c, b + u*c)
        error = np.linalg.norm([u - u_, v - v_])
        u, v = u_, v_
    return np.array([u, v])

# Generate random hyperbolic paraboloids
COUNT = 1000
p0 = np.random.random_sample((COUNT,3))
p1 = np.random.random_sample((COUNT,3))
p2 = np.random.random_sample((COUNT,3))
p3 = np.random.random_sample((COUNT,3))
p = np.random.random_sample(3)

iterated = np.empty((COUNT,2))
for i in xrange(COUNT):
    iterated[i,:] = solve_uv(p0[i], p1[i], p2[i], p3[i], p)

This works fine, but obviously doesn't scale well and becomes very slow when dealing with large data sets.
To remedy this I made some changes to vectorize the function. It will stop iterating until all the given items pass the tolerance test or reach the maximum iteration count. I also use inner1d from numpy.core.umath_tests instead of np.dot and np.linalg.norm because in my tests inner1d performs better with large data sets.
import numpy as np
from numpy.core.umath_tests import inner1d

def solver_vectorized(p0, p1, p2, p3, p, tol=1e-6, niter=100):
    a = p1 - p0
    b = p3 - p0
    c = p2 - p3 - p1 + p0
    p_ = p - p0
    u  = 0.5 * np.ones((p0.shape[0],1))
    v  = 0.5 * np.ones((p0.shape[0],1))

    # Init index list of elements to update
    mask = np.arange(p0.shape[0])

    while niter and mask.shape[0]:
        niter -= 1

        avc = a[mask] + v[mask]*c[mask]
        buc = b[mask] + u[mask]*c[mask]
        u_ = (inner1d(p_[mask] - v[mask]*b[mask], avc) / inner1d(avc,avc))[:,np.newaxis]
        v_ = (inner1d(p_[mask] - u[mask]*a[mask], buc) / inner1d(buc,buc))[:,np.newaxis]

        # Calculate delta and update u,v
        delta = np.hstack([u[mask]-u_, v[mask]-v_])
        delta = inner1d(delta,delta)**0.5
        u[mask], v[mask] = u_, v_

        # Update the index list only with items which fail the tolerance test
        mask = mask[np.where(delta > tol)]

    # Return uv's
    return np.hstack([u, v])

vectorized = solver_vectorized(p0, p1, p2, p3, p)
print np.allclose(iterated,vectorized) #Returns: True

Question
On very large data sets (over 100,000 items) the vectorized version will solve in ~1.5 seconds. But I am sure there are some inefficiencies that could be improved. For example the square root could probably be dropped for a small performance increase. Or by using masks differently. How would you change the function to improve its performance?
Answer:
How would you change the function to improve its performance?

I agree that using masks differently could prove fruitful. Here is my suggestion. Currently the tolerance is a constant. Suppose we substitute it with cur_tol which starts out as e.g. 100 * tol, and change the loop exit criterion to (niter and mask.shape[0] AND cur_tol <= tol)? Then perform cur_tol /= 2 in each iteration. The idea is to have mask reference fewer elements during early updates, and for each iteration to simultaneously get closer to the answer AND include a potentially larger number of input values that will drive us closer to that answer. So we are lazy about evaluating a smaller number of points when we clearly are far from the answer, and cast a wider net as we approach closer to it.


How and when Android auto connects to a bluetooth device?

Question: I have a BLE device that I am currently programming, and I would like my Android to auto connect to this BLE device, if it is advertising and if it is already paired.
I know that it is possible, because I already have a bluetooth device that do such a thing.
Is it something that has to be set from the BLE peripheral ? Or from the phone itself ? I am really curious about that, thanks.
Comment: wouldn't the android device just detect it, recognise the BLE device's address in a scan, and issue a connect request?
Answer: AFAIK, Android Bluetooth API does not provide this feature.
I have tried to achieve auto reconnection using BluetoothDevice#connectGatt, with "autoConnect" set to true but it did not work at all.
Like Joe suggested in the comments, I would go for my own implementation, handling both the scanning process and the connection process.


Real and Imaginary data from Network Analyzer

Question: I'm having a hard time grasping what exactly ARE the real and imaginary numbers in my s-parameter data. Most of the time I just set the NA up in logmag/phase to find the loss though, say, a filter or cable. My understanding is you can pretty much derive anything from the real/imag, especially s11. But are these numbers kinda useless (for lack of better term) until converted into other units?
Comment: I'm wondering if you'll get better answers at the electronics SE site... have you looked over there?
Comment: Wasn't too sure where to post. I'll give it a shot if I can't find anything.
Comment: Welcome to SE.SP!  Please do not cross-post to another SE site. If you let me know I can migrate this question to the elec eng site. Please delete this question if you've already posted on EE.
Answer: The S paramater data are complex numbers that have magnitude and phase, or stated another way, real and imaginary components. The way we typically see the data presented on a network analyzer is with a Magnitude vs Frequency plot, and a Phase vs Frequency plot. If we capture the data we may see it listed as Real and Imaginary. The two are related as follows:
Given: Magnitude (K) and Phase ($\phi$)
$Sxx(\omega) = K(\omega)e^{j\phi(\omega)}$
(showing magnitude K vs frequency together with phase $\omega$ vs frequency since K at angle $\phi$ is $Ke^{j\phi}$ in compact exponential form.)
Has real and imaginary components that are also functions of frequency as follows:
$K(\omega)e^{j\phi(\omega)} = I(\omega) + jQ(\omega)$
Where I is often used for the real component (In- phase), and Q is often used for the imaginary component (Quadrature phase).
The relationship between the two is given by Euler's identity:
$K(\omega)e^{j\phi(\omega)} = K(\omega)cos(\theta(\omega)) + jK(\omega)sin(\theta(\omega))$
The real and imaginary numbers define the magnitude and phase versus frequency for the relevant S parameters. For example S11 defines the reflected signal with values between 0 and 1 (for passive devices) and phases anywhere from 0 to 360 degrees. An open circuit for example will reflect all incident power back toward the source in phase (so would be 1 (0 dB) at angle 0 degrees), while a short will reflect all the incident power back toward the source out of phase, 180 degrees (so would also be 1 but at angle 180 degrees).  S21 is the transmission from port 1 to port 2 of a 2 port network, and a simple cable is a good demonstration of phase: a lossless cable is just a delay, and a delay has a linear phase with frequency so would be magnitude 1 (0 dB) with a phase that increases linearly negative as frequency increases.
Thus to demonstrate the significance of the phase, you could predict the magnitude response of a comb filter that is created with two power dividers and a long length of cable between one leg and short on the other (split, go through the cables and then combine for a resulting two post network), by measuring S21 phase through each of the cables.

At certain frequencies the phase between the cables will be 180 degrees and thus S21 magnitude through the entire network will be nulled when the two signals combine, while other frequencies they will be in phase and the signal will be combined, thus resulting in a comb pattern in magnitude such as that shown in the normalized frequency plot below.

The phase of the reflected signal (S11) and transmitted signal (S21) is used often in many aspects of RF design including impedance matching and filtering design (since like in digital filter design filters can be constructed through the summation of weighted delays, and hence weighted phase shifts). Having a deep understanding of this is fundamental to RF design.
Comment: That's an interesting setup I'll try out here in a bit. But my question is still more basic than that. I think what I'm trying to clarify is real is not magnitude and imag is not phase, but that mag/phase can be derived from real/imag. Just as with S11 data, VSWR, Γ, and Z can be derived from real/imag. Is this a safe assumption. Are real/imag merely Cartesian coordinates in a sense?
Comment: Yes you are absolutely correct. It is just two ways to define a phasor: using magnitude and phase or using Real and Imaginary. One is I + jQ and the other is K at angle theta otherwise denoted as $Ke^{j\theta}$.  So $Ke^{j\theta}=I + jQ$
Comment: But I now understand how that relates to your question; I will add that as a first paragraph (I thought you were more questioning the significance of phase data itself).
Comment: I hope that was clearer and helpful!


"Practicable" versus "Feasible"

Question: For me, and based on dictionaries, both of the words "practicable" and "feasible" mean the same thing. I wonder if I'm mistaken, provide me with some examples where one of them is preferred over the other one so that I could recognize their correct equivalence in my own language or at least I could equalize them with a more fitting meaning.
Thank you.
Answer: They aren't the same.
"Feasible" means "you are able to do it". "Practicable" means "it makes sense to do it".
For example, "we'll build a bridge across the Atlantic as soon as it's feasible" would mean, as soon as we figure out the challenges in building the bridge, we're building it regardless of cost or potential use.
On the other hand, "we'll build a bridge across the Atlantic as soon as it's practicable" means we might be able to build that bridge now, but it costs too much and/or taking a plane/boat is still easier/faster/cheaper.
Answer: Practicable is "able to be done or put into practice successfully."
Feasible is "possible to do easily or conveniently."
They are listed as synonyms of each other.
So in an official sense they are interchangeable. From a native speaker I would think of practicable being applied to an action that is repeatable stemming from the word practice. Example- "Kicking a football through the upright is a practicable task". When utilizing the word feasible, my mind goes much towards a larger task, typically a one time activity that requires something to be achieved to make it happens. An example: "Raising ten thousand dollars makes this bridge feasible". Another example: "The timeline for this project is feasible."

"Practicable" versus "Feasible"


Documents with mandatory field filled in still left checked out

Question: H, using Sharepoint 2013. I have a library with a column that is required to have data. It does not have a default. When I upload one document, the document panel pops up. I fill in the metadata field, including the required. I ht "Save" but the document remains checked out. How can I get SP to check in the file when I do fill in everything needed.
Thanks
Answer: why don't you just check-in the document?  The act of checking in the document means that you have finished editing it.  If you don't check it in, it is still available for you to come back an hour later or a day or week later to edit it again, finalise your edits, then when you are ready, you check the document in.
Regarding the mandatory fields - these field need to be filled in before the document can be checked in.  Filling in mandatory fields is not the same thing as checking in a document.
Just do a search on check-in check-out and you'll find plenty of info about it's purpose.
Comment: Hi, I know how check in and checkout work. The problen is the upload form has  a button on the bottom that is "Save". This "saves" the information, but does not check in the document. To have a panel that pops up, asks for information , closes and you still have to go and find the document and preform a "checkin" from the rinbbon is very bad UX. Why can't the upload form check to see if the required field is filled in and then checkin ?


Mutual Funds(index fund) and IRA?

Question: I am a beginner investor(no prior experience) and I am interested in buying the Vanguard Total Stock Market Index fund(VTSMX) which has initial investment of $3,000 minimum. As I understand, you need to hold the investment in some kind of account like an IRA or a Roth. I understand the fundamental differences/benefits between traditional and roth but most articles suggest to put in the max $5500 every year. What I don't understand if the mutual fund I purchased is connected to the Roth, why do I need to keep putting money into the Roth every year? Basically what's the connection between the investment(index fund and the initial $3000) and money in Roth ? Would it be the same if I made no investment and just keep putting $5,500 every year to the Roth ? If someone can give me a complete overview of how retirement accounts and investments are connected, it would be helpful.
Comment: This fund is not limited to an IRA (Traditional or Roth).
Answer: I see no indication in Vanguard's description of the fund that requires that you hold it in an ordinary IRA or a Roth. I believe that you could decide to hold it in an ordinary after-tax personal account if you wish.
https://personal.vanguard.com/us/funds/snapshot?FundIntExt=INT&FundId=0085&funds_disable_redirect=true

most articles suggest to put in the max $5500 every year. What I don't
  understand if the mutual fund I purchased is connected to the Roth,
  why do I need to keep putting money into the Roth every year?

You don't need to keep putting in money every year to maintain an ordinary IRA or a Roth or even an ordinary after-tax personal account. If you think that your initial investment, just $3000, will be plenty to retire on, by all means stop. I am retired myself and $3000 wouldn't last for two weeks!
You are advised to invest the maximum every year so that you will have enough to retire on when the time comes. Since you are inexperienced, I assume that retirement is a long way away. There will be market recessions, inflation, Social Security may be higher or lower or discontinued by the time you are ready to retire. There are many unknowns.
The one thing that you do have control over is how much and how often you save. The sooner the better.
Answer: The "amount" in your investment account denotes the current value of its assets. If the account simply consists of cash and does not bear interest, its nominal value would not change (e.g. if you put in $3000, it would just stay at $3000).
However, you can choose to hold other assets in your account, such as mutual funds, bonds, stocks, etc. In this case, your account portfolio would consist of all of these assets, and its value would be the sum of the individual asset values.
When you transfer cash into your account, your cash is used to purchase the assets you've decided to include in your portfolio. Then, as the value of those assets change over time, you will see the value of your portfolio change accordingly.
Finally, when you decide to withdraw money from your account, some of the assets in your portfolio are sold, and the resulting cash from the sale is transferred to you.

The process for doing all of this varies depending on the investment company you use. In your example, if you would like to put $3000 in VTSMX, you might go into your investment account and say that you would like to transfer $3000 from your checking account, and purchase $3000 worth of VTSMX.
Or, you might be able to indicate asset allocations, in which any deposits are allocated according to your allocation. For example, if you deposit $1000 with the following allocations:
<code>40%: VTSMX
40%: VGTSX
20%: VTIP
</code>
then your $1000 would be broken up and used to purchase $400 of VTSMX, $400 of VGTSX, and $200 of VTIP. These assets would now be added to your portfolio.
Comment: The limit applies to the current tax year, so if you put in $3000 today for tax year 2018, you can only put in $2500 more for tax year 2018. You are able to make tax year 2018 contributions until the tax filing deadline of the following year (April 15, 2019).

Also note that these limits are different if you make over a certain amount of money, or if you are over age 50.
Comment: @Jenna Maiz: To explain the "why" of the limits, the government does not want high-income earners putting all their money in an account that's shielded from tax.  The limits are calculated so that typical middle-income people can accumulate a good retirement nest egg, but not a lot more than that.
Comment: Can you explain the $5,500 limit every year for Roth ? If I initially transfer 3000 to my roth account today, does that mean I only have $2500 remaining that I can put into the roth ?

Mutual Funds(index fund) and IRA?


Poker game notation PGN as in chess

Question: Is there a notation for poker hands, as in PGN for chess? If not can you suggest one.
Answer: To my knowledge, there is no official notation quite like PGN for chess that is used for poker hands. However, there is multiple ways of sharing hands. If you are looking to show a specific hand to other players, you can use replay services like sharemypair.com that create a replay of the hand for others to watch. There is also a notation that is used by poker tracking software and poker sites to save hands that have already been played to a database locally, but this notation can vary across different services.
I think a universal notation would be a great idea, but as of now I don't think there is one.

Poker game notation PGN as in chess


Can mashed bananas be bagged and then frozen?

Question: Our family goes in spirts in the banana department.  It seems the only time they want them is when there isn't any, leaving the ones in the fruit bowl very lonely.  Can they be mashed into recipe portions and then stored in the freezer in freezer bags? I know they will turn black and need to reduce the extra liquid, but will the quality suffer?  I know you can freeze them whole, but freezer bags take up less freezer space.
Comment: I'm not sure I understand... I peel and then freeze bananas and save them up to use in banana bread all the time. The banana doesn't turn black, though... If you leave them in the peel, the peel turns black and becomes very difficult to separate from the flesh... so I'm always sure to peel the banana before I freeze it.
Comment: spirts -> spurts?
Answer: It depends on the recipe.  Freezing and thawing bananas will result in a softer banana purée, significant separation of liquid, and browning. The longer they are in the freezer, the more pronounced each of these effects. For some uses (smoothies, banana bread), they should be fine for up to a few months, though the color will be affected if you care about that. You may want to just break them up into chunks rather than puréeing them before freezing, as chunks are much easier to separate than a big block of frozen purée, and much easier to portion out than full (peeled, of,course) bananas.


Additional folder where will Media Library look for files

Question: I have additional folder (images/) in wp-content/uploads/ directory to store theme images (I heard it is good practice to place them in upload directory) and I want Media Library to list this files because I might need to reuse them somewhere else. Is there a way to tell Media Library to look for files in whole uploads directory (or manually add directories to look in) maybe using functions.php?
Answer: The Media library doesn't directly pull from the uploads folder. It reads in Attachments, which place their attached media in the uploads folder. If you want to access them through WordPress, you will need to upload them as Attachments.
Comment: Great. I have actually found a plugin that can import files from any folder into database which is a great work around this problem. I wouldn't know about this without your answer. Thanks. And this is the plugin: https://wordpress.org/plugins/add-from-server/
Answer: You can customize the upload location in the wp-config.php file.
Just before the line that goes

require_once(ABSPATH.'wp-settings.php');

add define('UPLOADS', 'path/to/new/folder');.


Terminal tool under DOS

Question: I installed a FreeDOS at my embedded system. I need to verify the new touch panel which is connected to my target through RS-232 (which should be COM1). If it's a Windows system, it's very easy because lots of terminal tools can check binary codes from serial ports. But on DOS, it's old system. I don't know if there is any tools I can use to show binary data from the touch panel connecting to system through serial port.
Answer: SSHDOS, which is a terminal software for DOS built on the code of the popular Putty application, should be a good option for you.
You can download it free from their site

Terminal tool under DOS