Difficult Co-worker

Question: How can I deal with a difficult co-worker? She always feel that she needs to be the center of attention. Not to mention she believes that she is always right. She snapped at me regarding my "attitude" our boss turned around and told her to stop the nonsense because in fact I did not give her a attitude. Needless to say.. every time I have something to say in causal conversation she has to put in her two cents and make me feel lower than her. Do I just ignore her? Or say something. The boss knows the situation and already said she was on thin ice.. but I'm at the end of my insanity.. what should I do?
Comment: Don't take it personally as the boss clearly recognizes she is out of bounds. Every time she says something, just mentally roll your eyes and think, "What an idiot" and then move on to more productive thoughts..
Comment: I'll second @HLGEM and will add that I'm a fan of just saying "Wow." and walking away whenever someone like that says something rude or abusive.
Comment: In your situation I would attempt to ignore her. Giving her the attention she wants will only encourage her combativeness towards you. Remain professional at all times, your boss will appreciate you for it.
Comment: Have you gone the route of going to HR with this issue?
Comment: Not sure if there's anything actionable by HR in this.  Rudeness and ego aren't their purview.  First, do you trust your boss to take care of this?  Sounds like there is good reason to do so.  If you continue to look like the "reasonable" one to your boss eventually will deal with her.  Just concentrate on what you can control, ie, your own reputation and your deep breathing exercises.
Answer: Be professional,  even when she's not. Focus your conversation  on the work, on facts, and on your own expert opinion.
I tend not to be able to hear unprofessional statements, unless they cross the line between being an unpleasant, insecure person and bigotry or truly abusive or threatening behavior.
I have had success dealing with excitable coworkers by simply not responding to anything that isn't related to the task at hand. If I say " this isn't the right time/place  to talk about that, let's schedule some time later" and they keep talking,  I just look at them without saying anything until they get back on point. Either they run out of gas because no one is arguing with them, or they escalate and become obviously unprofessional. Either way my reputation and credibility remain intact.
Refusing to dignify something with a response is a very viable strategy. You just have to practice having  selective hearing so that it's more difficult for someone to push your buttons.
Comment: This is the strategy that I would recommend (and employ myself) :)
Answer: Write down every problematic occurrence - what she said literally.

Monday, 9am. I said we need to downgrade the software. xyz
  replied:"This is the most stupid thing I've ever heard since I was
  born."

When the journal contains enough information, hand it to your boss, tell him that it seriously affects your work performance and ask him "to please find a solution".
HR and managers always have the problem that they need to justify the termination. People will sue and play their "I was just fired because I'm" card, even if you caught them stealing, but didn't have it recorded on cam. She will be questioned and deny one half and downplay the other half and it ends up in a "he said/she said" situation. Nobody magically knows that your complaints are justified and that you aren't just overly sensitive. A reasonable documentation helps people assessing the situation.
The benefit of starting this way is that this approach can be done in parallel to other strategies - you can choose how many other strategies, like ignoring her, talking to her in private, etc., you want to try before finally giving up and handing in the journal. The important thing is that when it's enough and you really can't stand it anymore and are about to get sick, you don't have to endure it then for more months in order to to collect material.
Avoid getting other co-workers involved. Mobbing is popular and so are complaints about mobbing. If you become the head of a movement to get her removed, there is a fair chance that this will actually backfire. If other people think the same way you do, they will have their own talks with your boss.
Comment: @Riorank If you want to write an answer, you should do this. If you are asking me about my opinion about your suggestion: Teaming up against one co-worker is close to mobbing, which means _she_ will end up as the problem...creating unrest to get her agenda through.
Comment: Sounds like a hot potato. My question is, OP mentioned that she is already on thin ice. Chances are, there are many more like you are are irked by this individual. Why not make it a group effort instead?
Comment: Sounds like "xyz" could have been Donald Trump in your example.
Comment: @LarsFriedrich Should've been more clear in my comment. I was in fact, asking your opinion whether or not OP should consider making the disagreement a group effort. As for the mobbing, OP has stated that the boss is knowledgeable of the problem. Inferring that there were complains before. However, given the fact that the troublesome individual is still employed, bothering OP, it would imply that the previous complaints were not enough to 'poke a whole in the ice'. Hence, would the ice will actually 'break' with more people this time.
Comment: +1: First it allows you to anticipate the remark to write it down, so instead of thinking "Oh no, not again" you can think "Another one for the book". Second it gives an objective estimation how serious the problem is, humans are often notoriously bad to recognize how often occurences happen.
Answer: People get hired for their specialties and skills and some of them turn out to have major issues.
Below are some strategies that might help you:

Accept. To fully accept what is happening in the present moment means letting go of the wish that it will change by itself. It means a
  commitment to rise above. It means disciplining yourself not to take
  bait. It can be the hardest step of all, but it also brings a lot of
  potential for growth.
Anticipate. If you can look ahead to where trouble is likely to happen, it's often possible to avoid or at least mitigate it. Be
  prepared and be vigilant.
Adjust. If there are frequent misunderstandings or conflicts, make sure that you're doing everything you can on your side. Are you
  practicing good listening, empathy, and openness? It may not solve the
  problem, but it can help minimize conflict--and give you a chance to
  model good responses.
Attune. Is there anything you can appreciate about this person? Even a little edge of positivity gives you something to build on. And
  look within yourself, too. Remember, we're usually most bothered by
  the things in others that we dislike in ourselves.
Avoid. If the trouble remains, focus on minimizing crossed paths. Find ways to avoid direct contact, whether that means going through
  another person or by communicating via e-mail and other technologies.
  If you have the freedom to work at home, take advantage of that when
  you can. (But don't subvert other workplace relationships or become a
  recluse.)
Apply. If you've exhausted all other strategies and you're still miserable, maybe it's time for Plan B--whether it's a change of
  departments, a transfer to another city, or a different company
  altogether. Change can be challenging, but it's what keeps careers
  moving forward.
There will always be annoying, angry, chagrined, cross, irritating,
  and difficult people in our lives. We may not be able to fix them, but
  we can always care for and protect ourselves.

(Source)

Difficult Co-worker


Why default settings are generally weaker than optimal ones?

Question: In nearly all software (that I've used so far) that allows to set the encryption settings, default settings are kind of weak. There is always something that you should tweak to achieve better protection. It applies to regularly updated software as well. Why is it so? If a main task of a software is to protect your data via encryption, why does it allow to set potentially insecure options?
Comment: What exactly do you see as "weak encryption"? Would you say that AES with 128 bit key is weak and that a program should better use AES 256, or something like triple encryption (AES, Serpent, Twofisch, as Truecrypt has the option for as far as I know)?
Comment: I agree with @Nova that this question makes a claim of *"default settings are generally weaker than optimal ones"* without actually proving this claim and explaining what this _weaker than optimal_ really means for the OP. In my opinion a setting is optimal if it provides enough security for the specific purpose without needing too much resources (CPU, memory, time, usability). I don't consider stronger encryption optimal if it uses more resources without actually improving the real security in the specific use case.
Comment: Can't say in general.  Sometimes it is for hysterical raisins: older versions of the software were made with bad choices and newer ones have to stick with them.  Sometimes it is for performance reasons, if the security level of the faster option is adequate.  Generally user-visible knobs controlling crypto are a bad idea, because most users are not competent to make decisions about that.
Comment: I guess I forgot to mention that I was under the impression of dm-crypt/truecrypt and similar, that require you to be somewhat competent.
Comment: To say something is optimal, you need to define the optimization goal. The default setting in your encryption software is likely optimal for the goal that the software developers had in mind, however the developer's goal may not necessarily be the same as yours.
Comment: dm-crypt isn't really intended to be end user interface. It's an underlying component that can be used to setup LUKS or other encryption setups, but the end user interface is usually either cryptsetup or cryptomount or some other partition tool GUI.
Answer: One reason is that older algorithms are likely to have wider support. Such defaults probably ensure that the software runs on a wide variety of platforms out of the box. The software itself might also be old.
It may be assumed by the developers that you will configure the software to meet your expectations after installation. It may be arguable that this is not an ideal assumption to make.
However, if the alternative is that the user must configure the software just to install it at all, then non-technical users may balk or may not be proficient enough to understand the installation/configuration process. Which  means that the software won't be installed or used properly, which is worse then being stuck with Triple-DES as the default cipher.
Comment: "Security at the expense of usability, comes at the expense of security." ~ AviD's rule.


Are emulator questions on topic?

Question: I am having trouble with getting the PDP-8 emulator to work properly via simh on my Ubuntu 18.04 machine. Are emulator questions on topic for Retrocomputing?
Comment: Possible duplicate of [Is emulation on topic?](https://retrocomputing.meta.stackexchange.com/q/14/278)
Comment: Actually I've solved my specific emulator problem, but the question still stands for meta.
Answer: If it's about an emulator simulating an on-topic machine (generally, not a Wintel PC) and the question is not generic enough to apply to other software running on the same OS, yes, it's appropriate here.
In particular, mentioning the host OS is not always a good guide to whether or not the question is on-topic for RCSE. We often may need to know the version of the simulation software you're running, and "I installed the SIMH package on Debian 9" at least lets people look that up, though it would be better to say the version explicitly, in this case "3.8.1-5 from the Debian 9 package." And on something like a Raspberry PI running a (physical) front panel replica, the OS may be relevant to how it's using (and even if it can use) things like the GPIOs for the front panel.
I feel perfectly comfortable saying things like, "Run apt-get install simh" to cover the software install (rather than going into the details of how to build SIMH from source) if I know the OP's OS and version and it lets me get past those details to get to the meat of the question.
Answer:
Are emulator questions on topic?

Yes, if the question is about the emulated item, then of course.
No, if it's about the emulator or its modern environment

I am having trouble with getting the PDP-8 emulator to work properly via simh on my Ubuntu 18.04 machine.

This case offers a nice slope to ski down :)

If it is about the PDP-8 programming, or any hardware variation, then it's quite welcome, as it's about the real thing as well.
If it is about setting up a specific PDP-8 within SIMH, then it usually is on topic. Like before, configuring a setup in SIMH is much like plugging boards.
If it's about some quirks in SIMH's implementation of a PDP-8 then it might be on topic. But usually better directed at a SIMH user/maintenance forum than here, as it's about the product SIMH, not the emulated machine.
If it's about setting up SIMH as a software for a specific OS, then it's clearly off-topic, as it's about the workings within a certain OS.
If it's about setting up an OS to host an emulator it as well is clearly off-topic. Like before.

Personally I find it a good criterion to look if naming OS and it's version is considered necessary. If yes, then chances are good it's off-topic. Similar for the version of an emulator or any scripting, inbetween.

Are emulator questions on topic?


Password length versus hash length?

Question: If a system hashes passwords with a 256-bit long hash, are passwords (which are not necessarily alphanumeric, can be any value per byte (0-255)) longer than 32 bytes useless under the context in which an attacker with a VERY fast machine brute forces passwords?
Comment: Hash functions are always functions from an unlimited domain into a fixed range. But that doesn't mean that longer inputs can't be matched, or that it is useless to have longer inputs. All it says is that at least one hash value has an infinite number of preimages. And in real constructions it is very likely that all hash values have an infinite number of preimages. When talking about cryptographic hash functions, that still doesn't mean it is easy to find preimages or even collisions. Considering very fast machines: Brute force is not a thread for any serious cryptosystem per se.
Answer: The entropy of passwords is not universally distributed. So hashing can be used to concentrate the input of a hash.
The concentration of entropy from another source is called extraction by HKDF, which is a key based key derivation function (which should not be used for passwords). This is from the introduction of RFC 5869, which defined HKDF:

Thus, the goal of the "extract"
     stage is to "concentrate" the possibly dispersed entropy of the input
     keying material into a short, but cryptographically strong,
     pseudorandom key.

Now the problem with passwords it that they usually does not contain enough entropy or randomness. The size of a password is an important part of estimating the strength of a password. If a password has enough entropy then you could even use a KBKDF such as HKDF or a hash directly. But the table on the same Wikipedia page shows that you would need 20 fully random printable ASCII characters to accomplish a 128 bit security level.
Instead what is used is a Password Based Key Derivation Function or PBKDF. The usage of such a function is often called password hashing to distinguish it from directly applying a hash over the password. Common implementations are PBKDF2, bcrypt and scrypt. The PBKDF uses password stretching to accomplish password strengthening. It adds at least two input variables besides the password: a salt and a work factor.

So to get back to your question:

don't use a normal hash for password hashing, use a password hash/PBKDF;
the more randomness in the password, the better - this usually means longer hashes not shorter ones;
the size of the password is not in any way limited by the (password) hash function.

A human will never - in real life scenarios - remember a password or care to type in a password that contains enough randomness to reach the security level provided by even the least of the hash functions (MD5).
In the end it doesn't really make sense to limit the size of passwords unless for backwards compatibility reasons. The minimum size should be controlled however, and as many possible additional measures should be taken to protect the password as passwords are inherently weak.
Answer: If the passwords are uniformly randomly generated among all possible byte sequences of the chosen length, then there is no point in having a password that's longer than min(hash length, brute force resistance) where brute force resistance is the number of brute force attempts that you want to resist. Picking a 32-byte password gives you a huge safety margin on the brute force length — all the computers in the world today (~1 billion) running for the lifetime of the universe (~1 billion billion seconds, ~1 billion attempts per second) amount to about 15 bytes ($2^{120}$) of entropy.
Sometimes you may want to have a safety margin, if the setting in which the password is used leaks some information, but not the whole password, through a limited-bandwidth side channel. In this case, it can make sense for the password to be longer than the hash. However this is usually not a concern with a purely random password if implemented at all correctly.
If the password is something that can be remembered and typed by a human being, this is a whole different matter. Human passwords are limited to printable characters, but that's only the tip of the iceberg. Human passwords have very low entropy per byte, because humans are not good at memorizing purely random data. Humans are better at remembering a string of dictionary words (let's say 12 bits per word) than a string of arbitrary characters (let's say 6 bits per byte if you stick to ASCII alphanumerics and two punctuation signs), but it takes more byte to write out a 12-bit-entropy word than a 12-bit-entropy alphanumeric sequence.
For a human password, the length does not give a good indication of the entropy. There is no reason to limit the password to 32 characters, though hardly anyone will pick such a long password if they have to remember it. If the password is automatically generated, it's better to encode it using printable characters that are easy to tell apart (such as base32, making it longer for the same entropy.
Don't forget to use a password hash a.k.a. salted key stretching function (e.g. PBKDF2, bcrypt, scrypt), as opposed to an ordinary cryptographic hash like SHA-2, for human passwords.
Answer: No, since passwords are usually far from uniformly distributed.
Comment: I ran some tests with the most common 100K passwords and they seem to hash to random hash values with SHA256 and Argon2.
Answer: I did not quite understand the question. Specially the part that says under the context.
The answer is no. because,
The output of a hash is a fixed value, for any given input of any length (If the length of the input is shorter than the block size, depending on the HASH algorithm being used, an appropriate padding scheme is present).
So whether the passwords were 32 bytes, or more, or even less. It makes no difference. Although it is much better to use longer passwords as the short and common ones can be retrieved using a pre-calculated look-up hash table.
One point worth mentioning is, as long as a developer is storing passwords in the database as the hashes of the passwords rather than the plain passwords themselves, it is of no value to limit the maximum length of the password. In fact, the longer, the better. BUT, in the end, they all wind up (in your case) to a 256 bit chunk.
Comment: Thanks for your feedback @MaartenBodewes. I think if we really want to make this community stronger, we should be more communicative rather than blunt. I appreciate your time dropping those 2 lines and your remarks are duly noted.
Comment: why is the downvotes ? can you elaborate please?
Comment: In this case it's probably less the content than the way it is written up. Currently I have trouble understanding it. And starting with "I did not quite understand the question" is never a good plan. Finally, you didn't distinguish between hashes and password hashes, but as that wasn't part of the question it should not be a reason to downvote. PS I did not downvote.

Password length versus hash length?


need a live cd to boot to ram

Question: I created a live cd using uck and want it to boot to ram by default.  How can I do this?  I know I can hit f6 while booting and insert toram=yes, but like I mentioned I want this to be setup by default.  Thanks in advance.  Also I am a rookie when it comes to setting up ubuntu so more detailed instructions are needed.
Comment: He may be wanting to decompress the sqaushfs and other components to RAM so you can remove the boot media. This can be extremely helpful when USB booting a computer with limited USB ports. I wish the feature was not removed and would be added again to the Live CDs.
Comment: Chris is correct.  I want to be able to remove the boot media.  This will be performed on laptops that have no internal CD Rom drive.  I would like to be able to remove the connection to the drive once the boot process is complete.
Comment: Live CDs using file storage in RAM anyway.  What specific needs do you have that can't be satisfied by the normal way live CDs mount their filesystems?  Wouldn't "toram=yes" make boot incredibly slow and use more memory than the usual approach of aufs, etc?
Answer: I've done this before, add the toram option to the grub/grub.cfg file, turning the
linux ... noeject noprompt --
boot line into
linux ... noeject noprompt toram --

If you've got the live iso on a usb drive with a FS that's writable it's a lot easier, just mount & edit the grub file.
If you're using a cd/dvd or just dd'ing the iso straight to a usb then you'll have to edit the iso file before writing it, changing the grub file first and then write to cd/usb. I once found a nice little gui program that could do that, could've been isomaster but not sure. Or extract files -> edit -> make new iso with anything like mkisofs, k3b, brasero, etc.

(FYI, I can't recommend dd'ing an iso to usb, less than optimal and shreds the usb's MBR/fat)
Using the toram option is different from the regular overlayfs (formerly aufs?) that all Ubuntu (all Debian too?) live iso's use. This option copies all the needed data from the cd/dvd/usb into ram, so you can remove or edit the cd/usb, and generally run with ram FS read/write speeds (+2GB/sec) instead of cd/usb speeds (1-10MB/sec). But the expense is using up about a GB of ram.
Answer: All live CDs "boot to RAM".
That is, for any volatile storage they use RAM.
This is technically achieved using a union filesystem such as aufs which allows you to mount a read-only filesystem (eg, the CD) and combine it with free RAM to enable writes, but the writes are gone when the computer is rebooted.  This may also be combined with a compressed filesystem (such as squashfs) so that the read-only filesystem can be compressed and thus fit more data.
If you have any specific needs in terms of how you want to mount the filesystem, you'll have to be more specific.

need a live cd to boot to ram


Paste text when option not offered by the app?

Question: Is there a way to paste message if an app doesn't offer the paste option when you hold down in the text area?  (Specifically Clash of Clans.)  Alternate keyboard for storing text or something like that?  Or with iOS 8, a keyboard with a paste button?
Answer: With new keyboards, one option to accomplish this turned out the be Paste It!  It's a keyboard app that lets you type into the main app, and then find any one of a number of messages to paste later.  Nice!
I think there are other keyboards out there providing similar functionality, but this was the first free option I found.
Answer: Use shortcuts --- settings/keyboard
Comment: We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
Answer: Clash of Clans? No, it uses its own non-standard text fields, so you can't do anything at all in them. In general though, a double tap in most apps will allow a paste even if they don't normally. This works in password fields that are blocked from pasting as well, usually.
Comment: Yeah, but there could be a work around.  the 6 plus has a paste button on the keyboard.  And some of the new keyboards will paste in the words it suggested just fine.  So theoretically the keyboard could paste in a whole sentence for me.  Maybe I will just have to write that keyboard myself....
Comment: You can't even move the insertion point in Clash of Clans to go back and fix typos. In my clans we have many typos enshrined. glod, for example.


ElementaryOS on Pentium D

Question: I recently got my hands on a 3.2 Ghz Pentium D with 4 Gigs of Ram.(3.25 allocated in windows for some reason) Has anyone had any success running Elementary OS loki on and older computer. I find my self always going back to Lubuntu and not really enjoying it. I am going to install it this weekend because I will have to make a bootable DVD because for some reason its super hard to boot from a USB on old Sony Vaios. I much rather run ElementaryOS that Lubuntu and I believe im board with LinuxMint. Any Opinions would be much appreciated.
Answer: You should be fine! The minimum system specs are:

Intel i3 or comparable dual-core 64-bit processor
1 GB of system memory (RAM)
15 GB of disk space
Internet access

The Pentium D is 64-bit, which is the only hard processor limitation. 4GB of RAM is of course way over the minimum specs. You can always boot into the live DVD to be sure, but you should be fine.
YouTube has a video of someone installing elementary OS Loki on a Sony Vaio, and everything seemed to go pretty smoothly.

ElementaryOS on Pentium D


How does S.P.E.C.I.A.L. affect exploring in Fallout Shelter?

Question: How does a dweller's S.P.E.C.I.A.L. values affect the results of sending them into the wasteland, and which ones should I focus on for the best result?
Answer: It depends on what you want the explorer to do. Strength lets them kill things faster. Perception helps them find opportunities for caps, XP, and loot. Endurance and level provide more HP, allowing them to survive longer on the same number of stims. Charisma makes it more likely they will resolve situations with strangers in a more positive light (gain more XP or caps, lose fewer HP). Intelligence makes them run away from combat faster, losing less HP. Agility lowers the damage they take in combat. Luck helps them find better loot and more caps.
As far as which to prioritize, Endurance, Luck, and Perception are most likely to get you better gear and more caps, but eventually having an explorer with straight 10s is good. Also note that while dwellers can be trained up to a 10 in each SPECIAL stat, the bonuses from outfits stack and provide benefits beyond a 10. For example, having 11 or more Endurance makes the explorer practically immune to radiation. (There is speculation that the radiation immunity may not have been intended and could be nerfed in a future patch)
Comment: Do you have a source for that information? I've seen these things suggested a number of times, but I haven't yet seen any data on how stats affect anything in the Wasteland beyond Endurance and Luck. (I don't disbelieve it, I'd just like to see the data.)
Answer: While this thread is quite old and the game itself has been ported to other platform, (PC which I recently started playing on), I've been trying to compile a complete and accurate list as to what the stats actually do. From the in-game help guide, we are told what P, E, A, and L do for exploring and combat.

S - ???
P - Slows the arrows down during Crits. (Page 29 Help)
E - Increases the amount of HP gained when leveling up. (Page 9 Help)
C - ???
I - ???
A - Increases the speed at which you will attack. (Page 29 Help)
L - Increases how fast you will build up Crit attacks. (Page 29 Help) (L also increases chance of gaining caps while collecting resources in your vault. Page 2 Help)

The game does say in a loading screen tip that all SPECIAL stats are beneficial in combat/wasteland. I just haven't been able to find what exactly the last 3 are for. While this is going to be a long shot, I would greatly appreciate if anyone knows what S,C, and I actually do. I prefer proof and not guessing from what seems logical or how it seems to work based on sending dwellers into the wasteland.
Answer: I thought S is for the amount of stuff they can carry while exploring...
Somewhere in the help it says they will automatically return as soon as they reach their carrying capacity.
Edit: I found a good place with info:
https://www.gameskinny.com/5qs4s/fallout-shelter-which-stats-are-best-for-exploring-the-wasteland
Comment: If you could quote some of the relevant info from the link, this answer would be better. Links tend to be subject to link-rot, so someone in the future might not be able to visit that site.


nodejs: nedb filename path causing problems; how to fix?

Question: I'm an experienced programmer, but relatively new to nodejs, nedb, Mocha.
nedb is a nodejs npm module for small data usages, that replicates some of the interface used in Mongodb.  I chose it because I'm building an app to run on a Beaglebone Black or Raspberry Pi and didn't want the overhead for Mongodb for my small data needs.
However, I'm having a problem with the path portion of the filename for nedb.  It works fine if the myapp.js I'm working on is invoked local to the current path, but if I invoke it from a different directory, like my Mocha test directory, then nedb won't work with the same path.  It won't work with relative path either; I have to specify the full path, starting with /home before I can get it to work from the Mocha test directory.  Needless to say, this is both inconvenient, and prohibitave for production, as it's not running with a base of /home in production.
In the code that follows, myapp.js is the application I'm developing and testing.  useMyapp.js is a utility test to use myapp.js for simplicity.  These are all in the same directory, and work properly when I invoke useMyapp.js.
myapp.js is located in /home/geek/project/public/javascripts/
Here is the code for myapp.js:
var Datastore = require("nedb");
var db = new Datastore({filename: "./calEvents.db", autoload: true});

function Myapp(year, month) {
    console.log('myapp: year: ' + year + ', month: ' + month);
    this.year = year;
    this.month = month;
}

Myapp.prototype.getAllData = function() {
    db.find({}, function(err, docs) {
        if(err) {
            console.error('error: ', err);
        } else {
            console.log(" docs found: ", docs);
        }
    });
};

module.exports = Myapp;

useMyapp.js is located in the same directory at /home/geek/project/public/javascripts/
Here is the code for useMyapp.js, which works correctly, outputing the expected nedb records.
var Myapp = require("./myapp");

var myapp = new Myapp(2016, "Mar");

myapp.getAllData();

I copied useMyapp.js to my Mocha test directory, renamed it to be TestUseMyapp.js, into /home/geek/project/test/
I adjusted the require statment for relative path to myapp.js
Here's the contents of TestUseMyapp.js in /home/geek/project/test/
var Myapp = require("../public/javascripts/myapp");

var myapp = new Myapp(2016, "Mar");

myapp.getAllData();

The output from running this via nodejs is an empty data set:
    docs found: []
THE PROBLEM:
TestUseMyapp.js is able to find and load myapp.js per the 'require' statement, but the filename parameter for nedb is not working when myapp.js is invoked from a different directory.  This is causing me problems between development, Mocha testing, and running in production, as the file path are all different.
I created a duplicate of myapp.js, named it myapp2.js, and kept it in the same directory as myapp.js at /home/geek/project/public/javascripts.  In this, I changed the path for the nedb filename parameter.
Here's the code in myapp2.js PLEASE NOTE THE ONLY CHANGE IS TO THE filename PARAMATER PATH:
var Datastore = require("nedb");
var db = new Datastore({filename: "/home/geek/project/public/javascripts/calEvents.db", autoload: true});

function Myapp(year, month) {
    console.log('myapp: year: ' + year + ', month: ' + month);
    this.year = year;
    this.month = month;
}

Myapp.prototype.getAllData = function() {
    db.find({}, function(err, docs) {
        if(err) {
            console.error('error: ', err);
        } else {
            console.log(" docs found: ", docs);
        }
    });
};

module.exports = Myapp;

This works as expected when I invoked the test against myapp2.js with the full path.
THE QUESTION:
How do I resolve the filename path issue with nedb so that I don't have to change it between development, Mocha testing, and deployment to production?
Thanks!
Answer: I was able to solve this problem by inserting __dirname as part of the filename parameter.


What do we want to do about "How do I program" questions?

Question: A lot of people move into test automation from a manual testing background and, as such, get stuck on Programming 101-type questions, like "How do I use conditionals". Do they belong here? I believe they are SO questions, but I suspect they'd be closed if we migrated them for being too basic...
Comment: Do you think they'd be closed because they're too easy, or because OP appears to be lazy?
Comment: Either or both. It's been a while since I frequented SO but IIRC they don't take kindly do "How do I use conditionals" type questions
Comment: Relevant: http://meta.stackoverflow.com/questions/265565/downvoting-stupid-simple-questions
Comment: They're also almost certainly duplicates, so if nothing else, that'd get them closed and thus the migration rejected.
Comment: http://chat.stackexchange.com/rooms/22957/sqa-cleanup
Answer: I think this is the answer. We check SO for a duplicate answer, and if we find one, we mark the SQA question as a dup with a reference to that SO answer.  If we don't find a dup, we migrate them to SO and hope that it's answered there.
Comment: If we know it's going to be closed as a dupe on SO then we should not migrate. We should simply link and close from here. There's already over 8000 questions on SO that need close-vote attention, we don't need to add fuel to the fire. We've talked about this in TL before, it's poor etiquette to send something you think has a high chance of being closed.
Comment: @Yamikuronue I will catch a lot of hell in TL (the mod chat) if I migrate questions they just have to close anyway. They'll probably say something like "You have 50k SO rep and can't tell when a question needed to just be closed? GTFO."
Comment: I would close as Off Topic, with a custom reason of "low quality programming problem" or something similarly appropriate.
Comment: Thanks.  I updated my answer to reflect your comment.
Comment: I don't think we can mark them as cross-site duplicates? But we can migrate and let them close, it doesn't count as a failed migration if the close reason is "duplicate". It's not the most polite thing, but I don't see much other option in the tooling.
Comment: That's true, but as @corsiKa pointed out, SO is already overwhelmed with questions that need close-vote attention, so we need to find a different approach.
Comment: @corsiKa So how do we close as a duplicate of a question on another site? Last I checked, it's not technically possible.


How to add DRM to a Live-Streaming URL?

Question: I want to add DRM to a Live-Streaming URL. I have setup a Live Streaming with NGINX in a EC2 instance. So is it possible to add DRM to the Live Streaming ? If anyone have any suggestion please suggest.
Answer: You will find a detailed description in the article
Building a live video streaming website - Part 3 - DRM.
You may also find as interesting the other parts of this series.
I will not copy-paste here all the scripts contained in the article.
I will only remark that:

You'll need to install the modules: ngx_devel_kit, set-misc-nginx-module,
ngx_http_substitutions_filter_module
nginx-rtmp will encrypt MPEG-TS segments
The scripts will produce 10 second segments and encrypt every 6 segments
with a new encryption key, so every 1 minute of video requires re-authorization to view
Only logged-in, authorized viewers will be able to watch the video streams.

How to add DRM to a Live-Streaming URL?


Are there any advantages to regularly running Eclipse as Administrator?

Question: Sometimes I have to run Eclipse as admin in order to install certain (Android) SDKs, but is there any advantage (or disadvantages) to simply always running Eclipse as admin? If there are advantages, is there a way to set it up to do this without having to select "run as admin" from the context menu each time?
Answer: There is no need to run ever Eclipse as Administrator, it is only needed when you need to write protected files or install some additional SDK that require elevated privileges .
However if you want to run as admin each time that you launch it, you can right click on its icon and then Properties then Compatibility tab and check Run This Program As An Administrator check box, and then click OK .
Answer: At least on Indigo there are reports of certain modules/plugins being properly functional only when Eclipse has admin rights. It is mostly a UAC issue (and perhaps with the help of bad programming) that Windows users have to grapple with from time to time.
As a side note, I don't run Eclipse regularly, I simply keep it running for a long time since it takes so long to start it up.


How to track if user has inputted any text on the Salesforce Chatter Email Publisher

Question: How do we know when user has made any inputs on the Email Publisher? When user made any changes to this field, and accidentally closes the tab on the Service Console, there will be no pop up message that displays - user has any unsaved messages. Other fields have this functionality already but somehow for email publisher, or post to chatter or comments - this does not trigger at all. Now I want to know when user has put any inputs to these fields and trigger some actions before user can confirm and actually closes the tab. Does someone know some hackish Javascript or something? Thank you for your help.
Answer: Rye, as far as I know, warning message will only pop up when you edit case fields and tried to close the tab without saving the case. This message does not apply to chatter posts and emails.
However, you can save your chatter posts and emails as drafts.

Draft posts save automatically as you type a post. Once you've added text or a rich text item to your post, Saving... appears next to Share and then changes to Saved. When your draft is saved, you can access it from My Drafts.
  See full documentation here.

Same goes with the Emails, but it will not be saved to My Drafts. The text inputted in the Email Editor will instead remain in the editor even if you close the tab of the case.
See full documentation here.
Comment: Oh gosh you're a savior! I feel silly not able to do research on 'save as draft' functionality first. This is what really bugs me, as to why these fields can't have the same warning pop up messages like other field has. But this option also rocks. Thanks a lot Loregge!


How to determine uniqueness of clients from http requests?

Question: I notice that when http requests are made from clients through a proxy server, then the IP address of the requests is always that of the proxy.  So if many clients from a huge corporation with a proxy server access a web site, I cannot tell if the requests are from unique clients or not.  Is there any way to determine uniqueness of clients if the http requests are through a proxy?  I know that the mac address is not included in the http request, so I have just about ruled that out.
Answer: The simplest way would be to set a cookie on the response, and check it in the request. If it's there, then you've seen that client before (and you could include some identification in the cookie). Of course, this relies on the clients being cookie-aware and the user not having disabled cookies (or clearing them manually).
There's also the issue of some clients which may be cookie-aware, but will effectively start from scratch each time - for instance, if someone's running a program to scrape your site, it will probably start with a fresh cookie jar each time, no matter how you set the cookie.
Answer: Provide a cookie to each new user with a GUID.  You can track that and even include the GUID in your server logs.
We do this with our public web server to track "unique paths" through our site.


Can X-ray diffraction be applied to liquids, gasses or non-crystalline materials?

Question: I learned that X-ray diffraction happens due to the periodic arrangement of atoms in a crystalline material, so can X-ray diffraction studies be done on liquids and non-crystalline materials?
Comment: see https://en.wikipedia.org/wiki/Powder_diffraction
Comment: More broadly, yes, one can measure the average radial distribution function and average number of nearest neighbors.
Comment: https://iopscience.iop.org/article/10.1088/0034-4885/69/1/R05 - "Neutron and x-ray diffraction studies of liquids and glasses" might be of interest to you.
Answer: (I'm going to focus on protein crystallography here)
Yes, in fact Small-angle X-ray Scattering, in which (usually) proteins are not in the crystalline state, is used extensively in biochemistry, molecular biology, etc. to determine the size and shape of biomolecules, and to capture large structural changes for which the atomic-scale picture is not necessary.

Additionally, depending on your definition of "liquid", normal X-ray protein crystallography might still interest you, as the scattering of X-rays through imperfect crystals and amorphous solids is an incredibly ripe field for study (it's the field I study).
Protein crystals are by no means actually periodic, they are dynamic systems that are not-identical from unit cell to unit cell, and experience correlated motions that are by no means captured by small, independent, Gaussian (B-factor/thermal factor) motion.
The fact that proteins in the crystalline state are dynamic, and exhibit correlations within and across unit-cell boundaries leads to "continuous" or "diffuse" scattering, which is the cloudy, loosely structured background radiation that accompanies the Bragg peaks in studies which use detectors sensitive enough to measure it.
(Shameless plug of a truly stunning paper on ALL OF THIS here before you get bored)
This diffuse scattering can (in principle) be analyzed to capture information about the dynamics of the protein under study (rather than just the average electron density). In fact, small-molecule X-ray crystallography has developed a robust understanding of diffuse scattering.
One of the most commonly used models to try to understand diffuse scattering in protein crystallography is called the "Liquid-like motions model", proposed by Caspar and Clarage in 1988, which assumed that correlations in electron density fluctuations decay exponentially with distance (think water molecules -- close water molecules move together, water molecules far apart don't really have any relationship to each other at all). This model does remarkably well for how simple it is, but it is definitely not the full story.
Our understanding of diffuse scattering is still very much in its nascency.
Comment: great answer! much more detail than mine. +1
Answer: Yes. Even single molecule imaging is possible and will be practical in the near future.
More precisely: at modern x-ray free electron laser facilities it is possible to image single particles such as molecules without the need to crystalize them. Currently, there are still many technical limitations, but rapid progress is being made.
See for example HN Chapman, Annual review of biochemistry 88, 35-58 (2019) for a review. From the abstract (emphasis mine):

X-ray free-electron lasers provide femtosecond-duration pulses of hard X-rays with a peak brightness approximately one billion times greater than is available at synchrotron radiation facilities. One motivation for the development of such X-ray sources was the proposal to obtain structures of macromolecules, macromolecular complexes, and virus particles, without the need for crystallization, through diffraction measurements of single noncrystalline objects. Initial explorations of this idea and of outrunning radiation damage with femtosecond pulses led to the development of serial crystallography and the ability to obtain high-resolution structures of small crystals without the need for cryogenic cooling. This technique allows the understanding of conformational dynamics and enzymatics and the resolution of intermediate states in reactions over timescales of 100 fs to minutes. The promise of more photons per atom recorded in a diffraction pattern than electrons per atom contributing to an electron micrograph may enable diffraction measurements of single molecules, although challenges remain.


Should people delete not very useful questions?

Question: I have noticed that I have a number of questions that aren't answered and probably won't be answered, and so even though they have upvotes, they aren't very useful or productive questions. This is one of them. Is there any merit to keeping questions like these or should I just delete it?
Answer: I would not advise you to delete it just because it's unanswered.
There is some merit to keeping some unanswered questions on the site. These serve to illustrate what areas our community may be lacking in expertise, and if a new user comes who is an expert in these topics and answers them they'll likely be rewarded for that. Deleting the questions, by contrast, puts the emphasis on things which we are already experts in, which is fairly limiting. We should be trying to expand that, but deleting the questions will have the opposite effect. Having your questions unanswered isn't a big problem if they are answerable. The question you linked to seems answerable to me, though I don't know the answer.
If you find the answer to your question yourself, feel free to answer it yourself. If you're still interested in the question, but it's been unanswered for some time, try editing it to make it more clear. If you think the question is already clear, consider putting a bounty on it.
That being said, there's nothing wrong with deleting the question if you really don't care about it anymore. That's up to you, and I don't think it's reasonable to try to enforce any sort of global policy with regards to self-deletions. However, I personally would not do so just because the question is unanswered, but only in cases where I think the question is probably unanswerable.
Answer: You may delete your question if you no longer wish to have it be answered, but as long as it meets the guidelines discussed in the FAQ, you are welcomed to ask this on the main site.
You may add a bounty to you question, to attract users, if you feel that the question has not received enough attention.
Sometimes questions maybe unclear and therefore users might not be understand what you are trying to ask. Adding some examples or picture can help convey to other users the context of the question that you are trying to ask.
Answer: would it not make more sense to 'close' the question rather than delete it outright? Suppose it's determined that the question is unanswerable - that's information for someone who's googling the same question.
Comment: Yes, in principle. However, the asker can't close a question unilaterally. They can, however, delete it so long as it doesn't have any upvoted answers. The benefit of doing this for the site is that it's one fewer unanswered question, which helps our statistics and looks better overall. However, if the asker is certain that the question is unanswerable, and has evidence to prove that, the best thing to do is to leave a self-answer explaining that. It's perfectly fine to answer your own questions, even if it's just to say that there's no real answer based on canonical sources.


Sub links invisible in quick-launch menu of a custom master page

Question: I am using a Quick-launch menu with structural navigation in SharePoint 2013.
Sublinks are visible in the Seattle master page but they
don't show up in my master page.
What could be wrong?
Answer: I see I had to increase StaticDisplayLevels value to more than 1.
<code><SharePoint:AspMenu id="V4QuickLaunchMenu" StaticDisplayLevels="3"
</code>


2D Tiled Map - Small tiles or big tiles with pixel-precise movement

Question: I am using Java - LWJGL - Slick2D . I have tried to do a proper collision detection with 32 x 32 tile size but failed three times. I just cant get it to work! I found a youtube video that was using ligbdx (but the code was understandable) that used small tiles and achieved something like pixel-precise movement , so here is the question , NOT opinion based. Keep trying to make a legit collision system or use small tiles? Also , please give me some info related to your answer like "tiles need to have X times Y size" or "a good resource is X Site for pixel-precise movement".
Answer: You probably had some problem in your code, because basically collision detection can always be resolution independent, so it won't matter whether your tiles are 8x8 or 1024x1024.
The following would be just one possible workflow to achieve this. Note that I didn't care for strict casting etc. so there might be cases where you'd have to cast an int to float go get the needed precision or where you'd have to cast a float to int to get the modulo operator to work.
Determine the tile where to check for a collision. How you'll have to do this really depends on your coordinate system. It could be as easy as rounding down your coordinates:
int tile_x = (int)(x / tile_width_in_world);
int tile_y = (int)(y / tile_height_in_world);

These coordinates can be used to get a first estimate, whether there's more work to be done, i.e. whether there's just sky, some ground (i.e. pixel testing needed) or only ground.
If you need pixel perfect testing, the next step should involve determining the position within the tile you'd be looking at:
float check_x = (x % tile_width_in_world) / tile_width_in_world;
float check_y = (x % tile_height_in_world) / tile_height_in_world;

This would result in two values, each ranging from 0 to 1 based on where in the tile your position is. This can then be converted to pixel coordinates within the actual tile texture:
float real_check_x = tile_offset_x + check_x * tile_width;
float real_check_y = tile_offset_y + check_y * tile_height;

Comment: Ι will study these stuff , can you please take a look at what I have already tried to do? [link](http://www.java-gaming.org/topics/bug-with-collision-detection-with-tiled-lwjgl-slick2d/31587/view.html) Ι Have already done the first snippet you posted , but I think I have implemented the second snippet's logig differently.
Comment: You're  doing it similar, just without the scaling I added. Also note that you're rounding to the next bigger number (`Math.ceil()`) and then round again (`Math.round()`; which won't do anything anymore). You can skip the whole scaling if your tile size in your game world is the same as your tile/texture dimensions.
Comment: The whole problem is that it does not work properly
Comment: Think the problem might be your basic collision detection approach. First of all, determine "vertices" where you'll check for collisions, e.g. one for the feet. Then try to always highlight the tile this vertex is on (without doing any real collision checking). Once that's working fine, you can do the next step and try to lookup the actual texture contents.


UIButton: calculate height of UIButton based on titleLabel Text

Question: I have a custom UIButton in a custom UITableViewCell. I want to set the height of the UIButton in the custom table cell based on the variable textual content of the titleLabel of the button.
I tried the following method to calculate the height
[NSString sizeWithFont:constrainedToSize:lineBreakMode:];

but I could not successfully change the button height as per the titleLabel.
Further, as this button is part of a custom UITableViewCell, I also need to change the height of the cell as per the height of the custom UIButton.
In the ViewController implementing the delegate and the datasource methods of the UITableView, I tried to determine the height in the following method
- (CGFloat) tableView: (UITableView *) tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath

but was not successful.
What could be the best solution or approach to solve this?
Comment: See my answer here - http://stackoverflow.com/questions/12506313/dynamic-size-of-uitablecell-hight/12506358#12506358
Answer: Assume the width of your button is 145.0f:
CGSize constraintSize;

constraintSize.width = 145.0f;

constraintSize.height = MAXFLOAT;

CGSize size = [Label.text sizeWithFont:Label.font constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];

Then you can set the frame:
frame = CGRectMake(0, 0, 145, size.height);

Answer: It seems like you do it right, but remember:
heightForRowAtIndexPath must return CGFloat
sizeWithFont gives you height of text, you need to add padding of your button, and cell
use constrainedToSize:CGSizeMake(###,MAXFLOAT) where ### is your text width
lineBreakMode:UILineBreakModeWordWrap of course
Answer: You can also use [buttonInstance sizeToFit].
 UIButton *lineButton = [[UIButton alloc] initWithFrame:CGRectZero];
 // If padding equals "yes, please"
 [lineButton setContentEdgeInsets:UIEdgeInsetsMake(0.0f, 5.0f, 0.0f, 3.0f)];
 [lineButton setTitle:@"Title" forState:UIControlStateNormal];
 [lineButton sizeToFit];


Endpoint is getting ARP response but not able to ping it/ connect it

Question: I have a endpoint which is on vlan x and a SNTP server on vlan Y of same cisco switch. I am trying to synchronize my time from SNTP server. endpoint is able to resolve ARP  and get the mac of SNTP server but not able to ping/connect to SNTP server. I don't understand why the endpoint is not able to synchronize time from SNTP server, i could not see NTP packets from endpoint.
Comment: something is wrong here, if endpoint and SNTP server are in separate VLAN, endpoint should not get SNTP server MacAddress , but the router MAC. How are your vlan interconnected?
Comment: You are going to need to provide more information. For example, a better description of the network, and the network device models and configurations. If you can ARP from one VLAN to another, something is terribly wrong with your topology and/or configurations.
Comment: @RonMaupin MY SNTP server is tagged in both the VLAN, so endpoint is able to get MAC address of the NSTP server, but not able to communicate over layer 3.
Comment: You have a trunk to the server, and the server has an address in both VLANs? That is not what the question says: "_a SNTP server on vlan Y_." You should post a diagram and network device configurations. I think you may have a misunderstanding of how this works. When a host need to communicate via layer-3 to another host on a different layer-3 network, it must go through its configured gateway.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: If the addresses are on different vlans it means that you have a router between them, therefore MAC address is the gateway address, not the destination.
Answer: You need to verify the MAC address of the ARP response you get for the SNTP server. Determine if it's the MAC of the server, or the MAC of the default gateway.
Also check the IP configuration settings on both hosts, and both the vlans. The symptoms are similar to an IP configuration issue.
Answer: Since you have refused to provide the requested information that we need to correctly answer your question, and based on your comment, it sounds like you are leaking both layer-2 LANs to the SNTP server, but that doesn't help you with the layer-3 network.
Your host (endpoint), with an address on VLAN X, is trying to communicate with another host (the server), with an address on VLAN Y. The addresses are on different layer-3 networks. A host will use ARP to resolve a layer-3 address to a layer-2 address if both host addresses are on the same layer-3 network. If the destination host is on a different layer-3 network, the source host will use the layer-2 address of its configured gateway. Traffic between different layer-3 addresses must go through a router (the host's configured gateway).
That applies to both hosts in a bidirectional protocol.
If you want a server to be directly connected to both VLANs, you need the switch to trunk both VLANs to the server, and the server interface must be configured as a trunk, and the server must have an address in each VLAN. How you configure the server for that is off-topic here.


Are there lists for magic spells where I can base my spells on?

Question: Are there lists for magic spells where I can base my spells on? I found a site long ago but I can't find it anymore when I was about to use it on my story. Is there anything you can recommend where I can base any kinds of magic spell chants?
Comment: Welcome to WorldBuilding.SE *rekt*! Good to see you made your way here. I added the [tag:worldbuilding-resources] tag as you are looking for an external list, which is fine with this tag, but not without it (yes, we can be weird at first, but long lists could get endlessly expanded, which makes it basically impossible to define a "best" answer). I'd *recommend* to remove the *recommend* part from your question (that invites opinions without any basis) and instead write what the magic spells need as characteristics. Do you need rituals, words, gestures, ... that fit your humans, orcs, ...?
Comment: You can base your magic spells on almost any list if you want any kinds. Take this wikpeida article: https://en.wikipedia.org/wiki/List_of_lists_of_lists . You will find the entry "Lists of academic journals". You can now create a spell that gives you a list of academic journals if you so desire
Comment: You can [edit] your question with the little hyperlink at the end of your post that says "edit". It would also be nice to point out whether you are looking for books or online sources. For example the game *Dungeons and Dragons* has extensive lists of spells - most of which do not explicitly mention which kind of words are needed if any words are needed at all. But it would give you an idea of how such lists could be composed. Do you need a description of magical effects, of components needed, of words that are used, of rituals that must be performed, of participants that must be present, ...
Comment: https://www.dndbeyond.com/spells
Answer: A lot of places really, here is a spell list of the DnD 5e spells for example:
https://donjon.bin.sh/5e/spells/
Here is a list with the spells and charms and what not from Harry Potter:
http://harrypotter.wikia.com/wiki/List_of_spells
The thing is, you will be able to find dozens upon dozens of these lists online. If you are worried by copyright infringements and the like, look for more occult works. And read through them, many of them go on about spells, rituals and the like.
Answer: Dictionaries, with slight modifications to root words.
Most of the strategies for generating your own magic words involve manipulating root words into a similar style. Harry Potter for instance:. Lumos = light spell like luminosity. Leviosa for levitate/levity.
So the only list you really need is a dictionary if you want to go that route. A couple linguistic texts might help you manipulate the roots in a common way. Shifting a romance language towards Slavic phoneme structure, for instance.
You don't need to use standard dictionaries either. You could use scientific jargon or common slang (Urban dictionary) to find your words of power.
It's all make believe, so there isn't a right answer, but this is a strategy that tends to work and doesn't run afoul of ip law.


Making dual power supply from single for opamp?

Question: For the circuit of opamp 741. we have to supply the dual power for it. How can I make a dual power supply from single. For example, make a (+9V)-GND-(-9V) from single 9V battery ?
Comment: An op amp doesn't need a dual supply to work. But, your target circuit might so show the circuit and be prepared to be advised against using the 741.
Comment: What's wrong with using two batteries, like everyone else does?
Answer: You can use the ICL7660.  It takes a positive voltage (up to 12v) and generates the inverse:

Very easy to use, I've used it in several commercial products.
If the ICL7660 chip is difficult to find, you can also roll your own" charge pump inverter" using a 555 timer, which should be available anywhere, and a few extra components:

There are lots of variations on this circuit, not just for generating negative voltages but also voltage doublers and triplers too.  Just do a Google search for "555 charge pump images".
Comment: LT1054 is a pin compatible replacement for the ICL7660. Might be easier to find.
Comment: what is the value for C1, D1 and D2?
Comment: The diodes will be general purpose signal diodes, 1N4148.  There is a value shown for C1, 3n3.  I'm going to take that to be 3.3 nF, which is the same as 3300 pF and 0.0033 µF.  Those are all the same value, just different suffixes.  This is going to be setting the switching frequency, so it is not too critical.  Having said that, it seems sort of low to me.  If the circuit doesn't work as expected, you should try larger values.  Not going to hurt anything.  Remember, there are also plenty of other 555 positive to negative circuit in that search I mentioned.
Answer: You could use an isolated DC-DC power supply module. They only require an unipolar voltage source to generated the two voltages rails (-9 V, 0 V and +9 V for your application). These module are small enough and are usually in a friendly SIP or DIP format. Except for decoupling capacitors, they do not need any external component to work.
However, be sure to use the good decoupling capacitors that are recommended on the datasheet and be sure to choose the module that can provide enough power. The module operates at a fix output voltage so be careful to select the correct output voltage for your application!
These modules are sold by differents manufacturers like XP Power, Cui and Recom power.
If you use Digi-Key to source your components, these modules are found in the Power Supplies board mount section and then select the isolated module type.


jquery UI - datepicker - setting a second one based on selection from first

Question: Using jQuery 1.9.1 & jQuery-ui 1.10.3.  I have a page that will have 2 datepickers on it.  They will be used as a filter in selecting from a SQL table.  I'm reading a table row that has in it the min and max dates on the table.
datepicker1 is the start date, datepicker2 is the end date.  Using the min and max above, the calendar should begin in datepicker1 with that date as the default, and datepicker2 should have max as the most recent selectable date.  Those 2 dates serve as a hard beginning & end to the selectable dates on my calendar.  No date though has been set in the input box for either date.
What I need to do is that once the user makes a selection (in either of the datepicker controls), to enforce rules on the other datepicker based on that selection, but only if the other datepicker hasn't already been selected.
Once a date has been selected from one, the other (unselected) datepicker would have a pre-determined window of 14 days from the selected one (>= if datepicker1 was selected first, <= if datepicker2 was selected first) as its max (or min) date.  For example:

Page loads, and minDate of 2012-12-10 & maxDate of 2013-10-22 is
  returned from query. datepicker1 has the 12/10 date as it's
  "beginning" (farthest day back that can be selected). datepicker2
  has 10/22/2013 date as its "end" (newest day that can be selected).
User clicks on calendar control in datepicker1 and selects
  2013-02-14.
Now, datepicker2 would re-calculate its new maxDate, to
  be 14 days after 2013-02-14.
User then can select any date >= 2013-02-14 through 2013-02-28 as
  an end date.
Process would be reversed if datepicker2 was selected first.

The options on each datepicker are pretty much the same for both:
    $(function(){
      $("#datepicker1").datepicker({
        dateFormat: "yy-mm-dd",
        dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
        changeMonth: true,
        changeYear: true,
        buttonImage: "calendar-blue.png",
        buttonImageOnly: true,
        buttonText: "Choose Start Date",
        showOn: "both",
        numberOfMonths: 1,
        beforeShow: function(input, inst) {
                $(".ui-datepicker").addClass("resizeDP");
                },
        onClose: function(selectedDate) {
                $(".ui-datepicker").removeClass("resizeDP");
                }
  });
});

I can enforce the max and min dates on the calendars when the page is loaded, but can't make the "new" 14 day one apply when it is selected.  I've tried several different ways (mostly in the onClose) but can't make any of them work.
Answer: Have you tried something like this?
 $("#datepicker2").click(function(){
     if($("#datepicker1").val() != ""){
       $(this).datepicker("destroy");
       $(this).datepicker({
         //initialize datepicker2 based on datepicker1 value
       });
       $(this).datepicker("show");
    }
 });

And vice versa.
Note i'm not sure if the date picker opens up before the on click event.  But you could always do it on the mouse down or even blur event of Datepicker1 to set Datepicker2 etc..
Comment: @steve_o please mark this answer as accepted if it answered your question, otherwise give feedback on what is not resolved. Thanks


Number of people chatting

Question: I know it's a small thing but to suggest there's 24 people chatting in the Ask Ubuntu rooms is misleading.
Comment: Since the move to chat.se it reports the number of people chatting on the chat.se server. Not sure if that's going to change because of how the Chat API works
Answer: This is by design, as we want natural cross-pollination between all "family" websites.
So when you see 24 people chatting, it means 24 people chatting at http://chat.stackexchange.com and you might find interesting people or topics you wouldn't otherwise have found.
And of course the chat house ad does show how many people are in just the site-specific rooms as well, so it's accurate in both dimensions.
Comment: Since this is by design, I'll take the opportunity to do something I've always wanted to do as a mod for soooo long: use the `status-bydesign` tag!

Number of people chatting


Problems with Radeon VII and Ubuntu

Question: I'm experiencing problems with UEFI and BIOS installations of Kubuntu 18.04 that popped up after installing a new Radeon VII vega.
1) Kubuntu installation in UEFI mode - the only available screen resolution during installation, and in the desktop, is 1024x768, which looks horrible on a 2560x1440 monitor. On the other hand, a BIOS mode installation can find all monitor resolutions. I think the Radeon VII firmware UEFI support is broken for Linux, and the installer defaults to a safe screen resolution.
Note that the Radeon VII shipped with no UEFI support, but bios 105 fixed it for Windows.
2) Minecraft in Kubuntu (in both UEFI and BIOS mode installation) runs extremely slow, only 2FPS. CPU usage is around 50%, with Ryzen 1800x. It's as though the CPU is doing all the work.
Dual boot with Win10 and Kubuntu UEFI mode installations seems to work, but there were some random problems with not booting.  Right now I'm running both OSs in BIOS mode and dual boot works ok.
So far I have done the following, with no results.

flashed the Radeon vbios to 106 (latest as of 2-11-19)
Installed Padoka stable ppa

I also tried ubuntu upstream kernels 4.20 and 5.0. Both caused black screens during bootup, so I reverted to 4.18.
System: Gigabyte AB350 Gaming 3 mobo, 16 GB RAM, Ryzen 1800x, Radeon vega VII. The Kubuntu 18.04 installer was burned to USB drive using Rufus. It has a hybrid BIOS/UEFI mode which lets you select which to install.
I'm not expecting an immediate solution. Probably AMD is working on this. Has anyone has run into similar problems? I can't find anything on the net. Thanks!
Answer: I'm currently running a Radeon VII on ubuntu 18.04.
Using kernel 4.15.0-47-generic and amdgpu-pro-18.50-725072.
Try this:
Install kernel 4.15.0-47-generic
sudo apt-get install \
linux-image-4.15.0-47-generic \
linux-modules-4.15.0-47-generic\
linux-modules-extra-4.15.0-47-generic \
linux-headers-4.15.0-47-generic
sudo update-grub

Then download amdgpu-pro 18.50 from http://amd.com
wget --referer support.amd.com \
https://drivers.amd.com/drivers/linux/amdgpu-pro-18.50-725072-ubuntu-18.04.tar.xz
tar xf amdgpu-pro-18.50-725072-ubuntu-18.04.tar.xz
cd amdgpu-pro-18.50-725072-ubuntu-18.04
./amdgpu-pro-install

Add amdgpu.dc=1 to GRUB_CMDLINE_LINUX in /etc/default/grub
run sudo update-grub and reboot into kernel 4.15.0-47-generic.
And Voilà
Cheers

Problems with Radeon VII and Ubuntu


What is an average header height for mobile websites?

Question: What is recommended/average header height for mobile websites.
Browsers such as Chrome and Safari have an address bar at the top which takes space so in terms of UX how big the header (eg bootstrap navigation header) should be?
Comment: I guess these days, mobile browser address bars are overlays and are not persistent.
Comment: It depends on your site and your header, really. There is no one answer to this question.
Answer: The correct answer is:  it depends on your app.
But here are some important considerations for mobile websites to help you make the decision:

OS guidelines.  Mobile OS's publish guidelines around header heights.  IOS has guidelines for menu and nav bar layouts (for example, see this).  Google also publishes guidelines for Material Design sites (here).
Ergonomics.  Whether or not you decide to follow guidelines, minimum bar height should be design so that it's touch friendly.  This article has some excellent guidelines on touch-friendly heights based on specifications from Apple, Microsoft, Nokia and others.  Although it's a bit dated, it notes:

Apple's iPhone Human Interface Guidelines recommend 44px minimum dimension.  Microsoft recommends 34px, and Nokia has a minimum of 28px.

Hope that helps.


Which format in office libre writer to choose in order to omit problems when opening in word on windows ?

Question: I have written a document in Libre Office Writer,
it is crucial to me to keep the documents format.
Now I am clueless in which format to save it, since there is
a plethora of options, even different formats for windows.
Comment: I'm not sure you can guarantee it, from my experience. But .doc and .docx would be the closest, definitely not rtf. However, a pdf would be guaranteed to be consistent, use that if you can
Answer: If your MS Word is version 2007 or above then choose .docx type. If not, then choose .doc type.


Was throw part of DAO (attacked) code?

Question: I have attached a picture related to DAO attack. I got the image from the following link A Survey on Ethereum Systems Security: Vulnerabilities, Attacks and Defenses
. The image shows a code containing 'throw'. I have a confusion about throw because it causes reversal. Had the DOA attack used 'throw'? Some body please guide me was throw used in the DAO attack and why it did not cause reversal of all transactions (and refunding)?
Answer: No.
If I understand the graph correctly, it is simply showing the contract checking the msg.sender.call.value(reward) result to make sure it worked and it intended to throw if the transfer was rejected, which was the right thing to do.
It didn't fail. It invoked the Attacker (success) and that gave the Attacker an opportunity to consider re-entering. The Attacker needed to watch the remaining gas to make sure it didn't run out from looping around, or everything would unwind.
When it decided to stop re-entering and just return, then the threads would drop through the Y path and subtract from balances[msg.sender]. That has no underflow protection, so the statement, as shown cannot fail. At worst, the msg.sender ends up with a gigantic balance which would be an opening for more mischief.
After that, no path to throw even though the diagram sorta makes it look like that there might be. The "missing" arrow is not an oversight. It might be more clear if they added an "end" block.
Hope it helps.
Comment: Thanks. I was trying to compare it with the historical DAO attack.

Was throw part of DAO (attacked) code?


How to edit products page of wp ecommerce plugin?

Question: The one problem that is always finds me again is that I cant find particular pages. Lets say I created a product from the admin panel. I have a link to the page, but now I need to edit the look of that page. Where I can find this page physicaly?
Answer: WordPress uses a template system- content is stored in a database and gets inserted into a template when a page is served, so pages and products don't exist as separate, physical things.
To edit the templates Wp E-Commerce uses, go to Settings > Store and click on the presentation tab. There will be an advanced Theme Settings box which will allow you to select which templates you want to move into your active theme directory. Once you've moved them you can then edit those templates without losing changes in a plugin update.
Note that, much like WordPress posts and pages, your single product pages all share the same template, so you'll need some additional code in your template to determine what the current product is if you want to style specific products differently than others.
Comment: Thanks! Maybe, you will know this:

I updated my checkout page by updating the file which was in ....wp-ecommerce/wpsc-theme/wpsc-shopping_cart_page.php

It worked fine for a while, but now some of the changed states reverted to the previous state. Actually, I can even delete the file that I mentioned above, so it means wordpress is loading this file from somewhere else. Any ideas from where and what had happened? Thanks for your help.
Comment: @user385917 - If you've moved the theme files as I noted above, it's now pulling the theme files from your active theme in the `wp-content/themes/` directory. You shouldn't edit the ones in the plugin's folder, as those will get overwritten if you ever update the plugin.


Can I create a feed out of all of the Stack Exchange sites which I want to simultaneously follow?

Question: I would actually like to be active on many sites on SE, but Id like to just have one feed, one place where I can go to check on things that I follow or am interested in. Is this possible?
Answer: Yes! You can use the Stack Exchange filter system to filter out questions from specific sites (and from specific tags if you want!)

Then, you can get the feed (the link is located at the bottom of the page).
Comment: just curious to know how inbox will looks when you have feed with php tag .... thousand of mail in single day :P
Comment: @NullPonyPointer: I'm betting he'll follow some of the lower volume sites? :P
Comment: Im really new here. Does it not make sense to follow large volume sites because they will overload the feed? I guess Im just very used to the feed model--its just way more comfortable for me that to jump between site to site. Am I right?
Comment: also, is it possible to create filters for certain tags of a stack exchange website? for example, i would like to have CSS in my feed but I would not like to have the entire stack overflow website on my feed.
Comment: @user11920: Stack overflow gets about 13 questions a minute, do the math. And yes, it's possible to filter by tag (refer to the link and my image for more information, I trust that you find it :P)


How did we come up with the formula of the work done by a force?

Question: I don't understand why the work represent the change in energy of a system. I understand the work energy theorem but where did we get the formula of the work from in the first place.
Also when I search for a derivation of the kinetic energy the only thing I find is a derivation using the work formula. Isn't there any other way to derive it?
I know that work and kinetic energy can be derived from one another but which formula came first and how??
Sorry for my bad English.
Comment: [This](https://physics.stackexchange.com/questions/129150/work-and-kinetic-energy-rely-on-each-other-which-came-first) is a similar question.
Answer: What we want to show here is that the work done on the object, as given by the equation F*s is equivalent to the change in kinetic energy of the object.
Consider an object of mass M. Suppose we push the object with a constant force, F for duration T seconds.
v1: Initial velocity
dv: Change in velocity after time T
The displacement of the object is given by: v1 * t + 0.5(f*t^2/m).
Hence, according to our definition of work, work done is: f * (v1 * t + 0.5(f * t^2/m))
Now we express the work done using the work energy theorem:
Final KE = 0.5 *m * (v1 + dv)^2 = 0.5 * m * (v1 + ft/m)^2 = 0.5 * m * (v1^2 + 2(v1 * f * t)/m + (f^2 * t^2)/m^2) = 0.5 * m * v1^2 + (v1 * f * t) +  0.5 * (f^2 *  t^2)/m
Initial KE = 0.5 * m * v1^2
Change in KE (Work done) = Final KE - Initial KE = (v1 * f * t)/m + 0.5 * (f^2 *  t^2)/m = f * (v1 * t + 0.5 * (f * t^2/m)).
Hence, we can see that the work equation and work energy theorem are equivalent expressions.
We can use a 3D curve to visualise this relationship: https://www.geogebra.org/3d?lang=en. Let the y axis be T, x axis be displacement and z axis be KE. Plot in the equations: x=a * y + 0.5(f * y^2/m) (Displacement against time) and z= a * f * y + 0.5(f^2 * y^2/m) (KE against time). a, f and m are constants that you can assign. If you look at the projection of the curve on the xy plane, it is probably linear. This is the graph of F*s, as derived using the relationship between displacement and time and KE and time.
Answer: Here is one example of how to go from a kinematic equation to kinetic energy:
An object that is dropped from rest, accelerates under the influence of gravity, and gains velocity as it loses height.  This means that gravity is applying a force to that object, and since the object's displacement is parallel to the force of gravity, gravity is doing work on the object.  This leads to the following kinematic equation:
$v_f^2 = v_i^2 + 2g\Delta y$          (1)
where "g" is the acceleration due to gravity, delta-y indicates displacement in the vertical direction, and "down" is taken as the positive direction.  Since the initial velocity is zero (the object was dropped from rest),
$v_f^2 = 2g\Delta y$                  (2)
$v_f^2/2 = g\Delta y$                 (3)
Multiplication of both sides of the above equation by the object's mass yields
$mv_f^2/2 = mg\Delta y$               (4)
The left hand side of equation (4) is the kinetic energy of the falling object (energy of motion), and the right hand side of equation (4) is the gravitational potential energy of the falling object.  Equation (4) states that as energy is conserved, the falling object loses gravitational potential energy, and it gains an equal amount of kinetic energy as it does so.
Answer: The relation between energy $E$ and work $W$ is:
$$W=\int dE=\int\frac{dE}{dt}\,dt=\int F\,dx=\int F\,\frac{dx}{dt}\,dt$$
so if you know the enegry you can calculate the work.
for example:
$E=\frac{1}{2} m\,v^2\quad\,\frac{dE}{dt}=m\,v\,\frac{dv}{dt}$
$W=\int m\,v\,\frac{dv}{dt}\,dt=\int m\,a\,\frac{dx}{dt}\,dt=ma\,\int_{x_1}^{x_2}\,dx=ma\,\Delta x$
Answer: Energy of the system is the quantity that is conserved as a result of invariance with respect to translations in time, i.e. the laws that govern your system are the same irrespective of the time (the actual behaviour may depend on time, given suitable initial conditions). I like this definition since it focuses on what is important, not some magic formula, but the general (usually desired) property of the system.
What follows relies on Lagrangian mechanics. In case you are lost, I suggest looking into Goldstein's "Classical Mechanics"
Kinetic energy is the type of energy that a 'free' particle would have. So let's look at the Lagrangian for a free (non-relativistic) particle with mass $m$: $L=\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2$, where $\mathbf{r}$ is the position of the particle, and $t$ is time.
For a general Lagrangian $L=L\left(t,\,\mathbf{r},\,\frac{d\mathbf{r}}{dt}\right)$:
$\left(\frac{\partial L}{\partial t}\right)_{\mathbf{r},\,\frac{d\mathbf{r}}{dt}}=\frac{dL}{dt}-\frac{d\mathbf{r}}{dt}.\left(\frac{\partial L}{\partial \mathbf{r}}\right)_{t,\frac{d\mathbf{r}}{dt}}-\frac{d^2\mathbf{r}}{dt^2}.\left(\frac{\partial L}{\partial\left( d\mathbf{r}/dt\right)}\right)_{t,\mathbf{r}}=\frac{d}{dt}\left(L-\frac{d \mathbf{r}}{dt}.\left(\frac{\partial L}{\partial \left(d\mathbf{r}/dt\right)}\right)_{t,\mathbf{r}}\right)$
The second step requires use of E-L equations. Thus quantity in the brackets on the right is conserved if $\left(\frac{\partial L}{\partial t}\right)_{\mathbf{r},\,\frac{d\mathbf{r}}{dt}}=0$, i.e. if system does not explicitly depend on the time (and is thus invariant under time-translations).
This is true for the free-particle Lagrangian, where the conserved quantity is:
$L-\frac{d \mathbf{r}}{dt}.\left(\frac{\partial L}{\partial \left(d\mathbf{r}/dt\right)}\right)_{t,\mathbf{r}}=\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2-\frac{d\mathbf{r}}{dt}.m\frac{d\mathbf{r}}{dt}=-\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2$
which is the energy of the system (the sign is due to convention). So let the energy of the free-particle be $U=\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2$. If the energy is changing the change in energy (work) is given by
$\Delta U=\int^{t_2}_{t_1}\frac{dU}{dt} dt=\int^{t_2}_{t_1} \frac{d\mathbf{r}}{dt}.m\frac{d^2\mathbf{r}}{dt^2} dt= \int^{\mathbf{r}_2}_{\mathbf{r}_1} m\frac{d^2\mathbf{r}}{dt^2}.d\mathbf{r}=\int^{\mathbf{r}_2}_{\mathbf{r}_1} \mathbf{F}.d\mathbf{r} $
where $\mathbf{F}$ is the force defined as the rate of change of momentum, which for a free particle is $\mathbf{F}=m\frac{d^2\mathbf{r}}{dt^2}$


Taking care of grape vines

Question: I have a few grape vines that are growing out of control. I would like to prune them back but don't want to sacrifice fruit for this season. Any ideas of what I should do?
Answer: Cut any green shoots with no grapes, flowers or buds. New bunches won't appear at this stage.
Pluck all leaves growing below the bunches.
Do not cut woody branches until winter dormancy, as water loss from the wounds could kill the plant.
Comment: And when winter dormancy comes, cut a LOT. Fruit forms on new shoots, and proper grapevine pruning looks incredibly severe if you are not familiar with it. There are many available books on the subject.
Comment: Between the fruit and the roots, that's how I learnt it, but I can see commercial vineyards are a lot more conservative. http://articles.extension.org/pages/59399/leaf-removal-on-grapevines . Basically you only remove a few leaves around the bunches. You should still leave the tips beyond the grapes alone.
Comment: @jbcreix what is the rationale for plucking leaves below the bunches and if I do that the grape vine won't have too many leaves right?
Comment: Maintenance to optimize grape production. They don't feed the grapes and they do block ventilation which can encourage fungi and pests. New leaves should be appearing past the bunches. If they aren't there now, it can probably wait until the plant has recovered from the thinning.
Comment: @jbcreix what do you mean by pluck all leaves growing below the bunches?  I thought you meant leaves between the fruit and the roots.  Or did you mean leaves beyond the fruit that grew after the fruit appeared?
Answer: Just cut long branches, e.g. to the 7 or eight leaves. This is a usual summer pruning work on commercial vineyards.
Only leaves near a grape will help the grape, and the flowers/grapes after the first series (sort dependent, usually after the fourth leaf) will not ripen (and the grapes are usually small).

Taking care of grape vines


I don't need 'view' page for my custom taxonomy

Question: I have a custom post type with a custom taxonomy. I don't link to the taxonomy on the page but from the admin anyone can visit the taxonomy/term url and the unstyled list page will be visible. How can I force wp to not use the default layout (index.php) for that listing? What's the best method? For example I creat a taxonomy template and I redirect it to the front page?
Answer: If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.
Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.
<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

You can also disable pretty permalinks by setting the rewrite argument to false (props otto).
<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'rewrite'   => false,
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's  different story.
Comment: This. Also, set the `rewrite` arg to false as well to disable the permalinks for them too.
Comment: setting `query_var` to false only works when pretty permalinks aren't enabled, you need the `rewrite` argument as well to cover all bases. deleting my answer and upvoting yours :)
Answer: Check out the Template Hierarchy. If your custom taxonomy is called custom_taxonomy, you should be able to create a template file called taxonomy-custom_taxonomy.php, and it could contain, for instance:
<?php
    wp_redirect( home_url() );
    exit;  // stop processing since we're redirecting
?>

(See the Codex page for wp_redirect() for more on redirecting in WordPress.)
Comment: Yes it was my idea too, what to you think is it the best method?
Comment: I'd say go with @chrisguitarguy's method -- set the `rewrite` and `query_var` to false.  My way will work, but his way looks like it's the proper WordPress way to do it.


Huber M-Estimator calculation

Question: I found out that we can calculate some estimator depends on the objective function. Where if we want to minimize the least square $\sum (x_i - \theta)^2$ the best estimator is the mean. And if we want to minimize the absolute difference $\sum |x_i - \theta|$ the best estimator is the median. I was wondering, how about if I want to minimize M-estimator $\sum \rho (x_i - \theta)$, where this objective value usually called as Huber Estimator. How can I compute the estimator for this objective value?
Thank you
Comment: It won't necessarily exist in closed form -- it depends on your choice of $\rho$. For most situations you can only minimize the loss function iteratively; for a few an explicit closed form may exist.
Comment: Thanks for the response. I found that we need to compute an algorithm to get the huber estimator, but do you know some reference that I could follow easily? Because I read from a book written by Casella, that huber estimator can estimate value between mean and median, which is this is good because we can implement both properties (sensitivity to outliers data and robustness). But I don't know how to compute the Huber estimator
Comment: Off the top of my head I don't have an easy reference, no. It might be a good question in its own right. However, if I get some time I'll try to either outline an approach or point to something that does.
Answer: A solution won't necessarily exist in closed form -- it depends on your choice of $ρ$.
For most situations you can only minimize the loss function iteratively; for a few $\rho$ functions an explicit closed form may exist.
There are a variety of suitable univariate optimization techniques. Any of the standard optimization methods can be used (e.g. the univariate optimizer optimize in R uses Brent's method), but it's fairly common to use iterative reweighted least squares starting from a good robust estimate (often, but not always the median).
In the case of the Huber $M$-estimator a well-chosen trimmed mean may provide an excellent starting point.
Comment: Thank you for the response. I found the reference of Huber estimator, where the $\rho (t) = \frac{1}{2} t^2$ when $|t|< k$ and $\rho (t) = k|t| - \frac{1}{2} k^2$ when $|t| \geq k$. I read from https://projecteuclid.org/download/pdf_1/euclid.aoms/1177703732 . But I don't understand yet

Huber M-Estimator calculation


I have toilet water disappearing after neighbor flushes toilet

Question: I come home and have maybe 1" of water in bottom of stem in base of bowl.  This happens when neighbor flushes her toilet.  I have had a plumber here, he has reset the toilet & new wax ring, gone on roof to vent from the top, routed in toilet out to sewer system to find NO blockages, he has even been over to check neighbors feed to sewer & found no blockages. He has no answers any more to help.  This started 1 year ago water started being removed after neighbor flushing just a little now 1 year later all my bowl water is now gone.  Neighbor has been there 8 years with no problems prior, I have no animals and the only thing that I have seen is the utilities dug up shallow wires and fixed it in the front area. Any thoughts?
Comment: they checked your vents but what about neighbors? If their drain is connected downstream of yours could that cause enough vacuum to cause the problem?
Comment: This sounds like a question for your 'association'; you'll need all parties involved.
Answer: I agree with Ed Beal, the plumber should actually route/snake/auger both of your vents from the roof...it seems like the neighbor's vent is clogged. There should also be vents by the street & those should be cleared as well. Either way it should be a venting clog problem, typically from crazy birds loading your first bend from the roof.
Answer: I've had a similar problem with 2 toilets connected to the same septic tank.  There was no problem with the vents but water kept being sucked out of 2nd toilet.
solution was to have the tank emptied, somehow negative pressure was created by the upper layer of dirt moving up and down in the tank at the level of the connection of the 2nd toilet.


Did Google Hangouts cease operating for free, as of late March 2017?

Question: My uncle could always dial any North American telephone number gratis with Google Hangouts, while he was in Canada, US, and England. But suddenly starting from late March 2017, every time that he tried, he could not and would encounter the following message:

Answer: The answer is no.  I currently use it and have just tested that it is still available.
However there may have been changes to the specific numbers or areas he is calling to or from that fall under the following exception (directly from the help page Hangouts Help Page: Make a phone call with Hangouts)

Almost all calls to the U.S. and Canada are free from all countries >where Hangouts calling is available. A few U.S. and Canadian >destinations will cost 1 cent per minute (USD), or the listed rate for >your local currency. Calls to destinations outside of the U.S. are at low >rates, but calling isn't available to all locations.
Comment: Thanks. Did you test with a private #, or the one in my screenshot (for one of my uncle's favourite restaurants in Manhattan)? If so, then can you please test with another public number, to allow me to try to reproduce the result?


Weird spiky shadows around the edges of my walls

Question: I am new to blender and was trying to model an interior of a room. I used an Irradiance volume around the entire house and an environmental lighting. In the render properties, I have enabled ambient occlusion and screen space reflections with default settings. After baking the indirect lighting, I am getting these spiky shadows around the edges of the walls.
Comment: It is quite hard to see what we are looking at (in this kind of detail). It looks like a forest on horizon in a fogy weather behinde a glass :) OK Would be better to post simplified blend via https://blend-exchange.giantcowfilms.com Do you have a lights in corners or is it penetrated from outside?
Comment: yes there are area lights on the edges of the ceiling. And yes behind the window i have an environmental lighting.
Comment: I cant reproduce the issue, please share your simplified file as suggested in my comment. Try remove all objects that doesn't contribute on the issue. Thanks
Answer: Something like that generates Sun light.

You can try to get rid of by Shadow - Cascade Shadow Map - Max Distance, but seems to be a tricky solution.

This effect is such visible when Lamp light is switched to Sun where Strenght of light is too high (1000). Lower value to 3 is ussually fine in most cases.

Edit
Later I noticed - light still penetrates the corners

Enable Contact Shadow subpanel and play a bit with values

... or, instead all of this, use another type of light :)
Comment: @marcellothearcane answer edited
Comment: How do you fix it?


iterm2 first tab transparency differs from default

Question: I set up iTerm2 colours/backgrounds, however the first tab is always "lighter" (i.e. more transparent) than all the other tabs. When I set transparency in the profiles, I can see every tab except the first one adjusting. Is it some bug or some setting I'm missing?
Comment: Do you mean the tab itself or the whole window associated to that tab?  When I adjust the transparency with the slider in Preferences/Profiles/Window all my tab screens change with the slider. Including the 1st.
Comment: Do you have a background image?
Comment: no background image. i'm using it as visor, so there is only one window, and it's only the first tab, if i open a new tab, it has proper opacity. if i close that first tab, everything is fine, all new tabs are ok
Answer: In my case this was due to HotKey windows was created after pressing hotkey, but after CMD+T new tab was created with Default profile. So you can either set HotKey as default or rework your shortcuts. You can experience with this by clicking right mouse button -> New Window/New Tab and then Default /HotKey Window profile. After you will define what you would expect here it should be easier to configure
Answer: Just sorted this myself. The trick is in "Preferences > Profiles > Hotkey Window * > Window", uncheck the box for "Open in a new window, never in a tab"
* Note that "Hotkey Window" is just how profile is called for me (using a dropdown terminal), if might be "default" or something else. Try each profile until the one you want is affected.


How to encode & scale IP addresses as input for ML models

Question: Im currently working on an anomaly detection while making a transaction. As a part of the data that I extracted, I have the IP addresses of the indivduals who made the transaction. Since the IP Address doesn't have a coherent meaning behind it and it is arbitrary but it indeed acts as a good indicator for user activity. So my question is how can I convert these IP addresses into input which can be used as input for machine learning purposes (which is suitable for data preprocessing such as encoding and PCA). I know tools like OneHot encoding can do the trick however OneHotEncoder can create multi dimensional data and it gets complex if the dataset is huge + standardizing/normalizing it, is painful. So I'm looking for a better way to encode IP addresses.
Answer: The domain of all possible random IP addresses is astronomically large, and they have no relation to each other. So any given IP address only provides information about that specific IP address, making it a useless feature for the model when trying to generalize to unseen data with different IP addresses.
However, there might be relevant meta-features derived using the IP address, like location or the number and frequency of an individual's past transactions.


How to get identity element of ECCurve with bouncycastle?

Question: How do I get the identity ECPoint element (I think it is infinity) of a given ECCurve in the Bouncycastle library.
Thanks
Comment: It seems to be infinity indeed, so `ECCurve.getInfinity()` would be the major contestant I presume.
Comment: Thanks it looks like this works as both the identity for addition and multiplication. (If you want to post as answer then I can accept it).
Answer: It seems to be infinity indeed, so ECCurve.getInfinity() would be the major contestant. It's easy to see in the code that it is treated as identity element.
Comment: Code pointed to is a bit old, but I presume that the EC calculations don't change that often. The method is still valid in Bouncy 1.51.