Detect battery percentage applescript

Question: How would I detect what my computer's battery percentage is using applescript? All answers to similar questions say to install additional software, but I would like to do this with purely applescript. Is this possible? I've also tried searching through the  applescript library with no success.
Comment: How do You want to use the info? Because You can get the percentage using bash script like this: `pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';'`
Comment: I know that, but I want to set it to a variable in applescript. @MateuszSzlosek
Answer: Here is an example of setting the percent charged of the internal battery to a variable using AppleScript.
In the sample code below the batteryPercent variable holds the numeric percentage of battery charge and is shown in a message.
set batteryPercent to do shell script "pmset -g batt | awk '/InternalBattery/ { sub(/;/, \"\"); print $2 }'"

display dialog "Battery is " & batteryPercent & " charged." buttons {"OK"} default button "OK"

Comment: @ALX, Yes, this is what the `do shell script` _command_ in AppleScript is for. However depending on how complex the _command line_ portion is, it can be tricky.  As an example in the `awk` _substitute command_ `sub()` in AppleScript it's necessary to escape the double-quotes with a backslash, e.g. `sub(/;/, \"\")`.  If you did that on the `bash` _command line_ it would error with `awk: illegal statement at source line 1` and show where the error is. From the `bash` _command line_ it would it would be e.g. `sub(/;/, "")`. Continued in next comment...
Comment: Continued from previous comment... So you may run into similar situations where the _code_ run from the `bash` _command line_ will need to be escaped in places with a backslash to get it to work in the `do shell script` _command_ in AppleScript.
Comment: This is interesting! I never knew you could run shell commands in applescript.

Detect battery percentage applescript


Is there way to custom program an F key?

Question: I have an email address that is about 21 characters.  Is there way to program, say F15, to paste in the address?  This would be while in any app.
Answer: I would use Spark to program the F15 key to do what you want. It is free (although donations are accepted). The website for Spark says "Mac OS 10.9" but I find it works with 10.11.4 here.
Here is what Spark looks like on my Mac. You create a new hotkey from the File menu. In your case, you'll be making a new "Keyboard" type of hotkey. I am including a picture that shows what the new key would look like if your email address were the same as mine. You get to pick your own hotkey-- I picked Control-F12 because I don't have an F15 on my keyboard.
There are plenty of commercial hotkey apps that do more than Spark but "free" is nice and your needs will be met with it. See the link at the end of this answer.
Note: I am not affiliated with Spark or its developers in any way. I have used the product on multiple machines for many years with great results so I am speaking first-hand about how it works.

Link to shadowlab.org, where you can download Spark
Answer: This is a simple way to do similar it uses text expansion.
Go to System Preferences->Keyboard and choose the Text tab.
Then hit + and enter a short form and the full email address.
Then when you type the short form and a space Cocoa text spelling check will show you the full email address and replace the short form.


If hydrogen and helium are lighter than air, why won't liquid hydrogen and liquid helium defy gravity?

Question: Title says it all. If hydrogen and helium are lighter than air, why won't liquid hydrogen and liquid helium defy gravity?
Answer: Gaseous hydrogen and helium are lighter than air. Hydrogen, helium and air are close approximations to ideal gases, and for an ideal gas the volume of one mole of gas is about 22.4 litres. That means the density of an ideal gas is proportional to its molecular weight, so hydrogen ($M_w = 2$) and helium ($M_w = 4$) are lighter than air (average $M_w = 28.8$).
However you're asking about liquid hydrogen and helium, and liquids are much denser than gases because the molecules are much more tightly packed. For example the density of liquid hydrogen is around $68 \,\mathrm{kg/m}^3$ compared to air at about $1.3 \,\mathrm{kg/m^3}$. That's why liquid hydrogen doesn't float in air.
Incidentally, the density of liquid nitrogen (a close approximation to liquid air) is about $800 \,\mathrm{kg/m^3}$ so liquid hydrogen would float on liquid air.
Answer: Because liquid hydrogen and liquid helium are much heaver than air.
Comment: please explain why.
Comment: Well, this is an experimental fact - it is easy to look up their densities and the density of air. Or do you want some theoretical explanation why liquids typically have higher densities than gases?
Answer: you may as well ask why water wells on the earth, as the air we breathe is only basically water in a gaseous form  which means that any gas is lighter than the liquid it derives from. If you study the natural cycle of the atmosphere you will find that Temperature, Heat, Pressure, and molecule size determines the balance of any mater whether in solid, liquid or gas state.
Generally when in a gaseous state it is generally lighter than air depending on the density of the air.
Answer: First of all, no mass 'defies' gravity. Second, the normal state of these two is air so they cannot be 'lighter than air' which would in effect be lighter than themselves. If you were meaning to ask why the liquid forms of these elements won't float, the answer is simply because liquids don't float. This is one of the properties that defines a gas. The molecules must overcome the IMF's and have a high enough KE but liquids do not. The density of the liquid would have to be lower than that of the gas and no liquid has a lower density than a gas. Although hydrogen has a low gaseous density, it's liquid density is still considerably greater than any gas.
Comment: Actually, hydrogen and helium _are_ lighter than air. Air is made up of other gases as well, and H and He will sit at the top of a room filled with air.
Comment: I hope you aren't insinuating that [no liquid is ever lighter than any gas](http://physics.stackexchange.com/questions/45140/is-it-possible-to-have-a-gas-heavier-than-a-liquid)...


Semisimple group not split by an unramified extension?

Question: Let $F$ be a nonarchimedean local field. Does there exist a semisimple algebraic group over $F$ which is not split over a maximal unramified extension of $F$ ?
Comment: @Jim: You are probably remembering that for a connected semisimple group $G$ of *adjoint* type over a field $k$ with cd$(k)\le 1$, ${\rm{H}}^1(k,G)=1$ (since all $k$-forms of $G$ are quasi-split by Steinberg, so for a Borel $k$-subgroup $B$ of $G$ the map ${\rm{H}}^1(k,B)\rightarrow {\rm{H}}^1(k,G)$ is surjective, and ${\rm{H}}^1(k,B)=1$ because in the adjoint case maximal tori of $B$ are "induced", hence cohomologically trivial). Hence, for connected semisimple $G$ over $F$, ${\rm{H}}^1(F^{\rm{un}},G^{\rm{ad}})=1$. But for types A, D, and E$_6$ the Aut-scheme is disconnected!
Comment: Have you looked at the papers of Bruhat-Tits or the 1979 AMS lecture notes by Tits on structure and buildings?   To see more recent online resources, check MO questions with the tags local-fields and algebraic-groups (which should also be added tags for your question).    If I recall correctly, the answer to your question is no; but exact information can be found in the references I've mentioned.
Comment: @user36938: Yes, my remark overlooked the nature of the automorphisms.   Thanks for the reminders.
Comment: @user36938, isn't the vanishing of cohomology that you [mention](https://mathoverflow.net/questions/136993/semisimple-group-not-split-by-an-unramified-extension#comment353317_136993) true for *any* connected reductive group (maybe even connected group), by Steinberg?
Answer: The Galois group of $F$ maps onto $S_3$, the symmetric group on three letters. The group $S_3$ is also the group of diagram automorphisms of the Dynkin diagram of $SO(8)$. That means that there is a quasi-split group $G$ defined over $F$, which over an extension $E/F$ with Galois group $S_3$, becomes the split group  $SO(8)$ over $E$. The group $G$  cannot split over an unramified extension $L/F$, because its Galois group would be abelian, and cannot cover all the diagram automorphisms.
Comment: This example has a serious error, but there is a nice fix. The mistake is that automorphisms of the simply connected central cover might not preserve the kernel of the covering map, and so may not descend; equivalently, a diagram automorphism might not preserve the based root datum. In fact, for $m>1$, ${\rm{SO}}_{2m}$ *always* has outer automorphism group $\mathbf{Z}/(2)$, even if $m=4$! So use a ramified quadratic Galois $F'/F$ to make a quasi-split outer form $G$ of ${\rm{SO}}_{2m}$ arising from the ${\rm{Gal}}(F'/F)$-action through the standard diagram involution for ${\rm{D}}_m$.
Comment: Alternatively, one can fix the example by working with the spin group instead of the special orthogonal group to exploit triality.  But it seems simpler to use quadratic ramified extensions to make examples at the level of SO in every even rank $\ge 4$.
Comment: @Nicolas: It's not twisted by any old Aut-valued 1-cocycle: it is twisting by one whose projection into the *outer* automorphism scheme is a ramified cohomology class, so by canonicity of the outer automorphism scheme we can conclude -- the logic is literally identical to what is needed to justify that your Spin(8) construction doesn't split over an unramified extension. That is why the reasoning doesn't apply to inner forms of type A (as we know it cannot); see my comment to Jim Humphreys.
Comment: I understand the error you pointed out and that one can fix it by replacing $SO(8)$ by $Spin(8)$, but I don't understand why constructing non-split groups via totally ramified extensions is of any help. I mean a group arising as a twist by a nontrivial Galois cocycle of a ramified quadratic extension can (and in general will be) split by an unramified extension.
Comment: It is also true that for any simply connected absolutely almost simple group $G$ defined over $F$, there exists a finite unramified extension over which $G$ is quasi-split. So the obstruction to being split really comes from homomorphisms of $Gal(F)$ into the group of automorphisms of the Dynkin diagram.
Comment: I also just realized that splitting can't happen if you're constructing _outer_ forms. I was previously looking at forms of $SL_2$ where the canonical 'outer automorphism' is inner. Now that I realize that it's actually pretty easy to construct examples of the kind I was asking for. My bad.
Comment: Very nice example!
Comment: One can also similarly make examples of type A$_n$ for $n > 1$: quasi-split special unitary groups arising from quadratic ramified Galois extensions of $F$.


Which hook callback has priority if both plugin and theme use the same hook?

Question: If a theme and a plugin uses the same action hook, for example comment_form is used by both theme and plugin. Then , which one will be called first? the function associated with the theme's hook or the function associated with the plugin's hook.
Comment: See: http://wordpress.stackexchange.com/questions/103641/clarification-on-filters-and-hooks/
Answer: An action hook is simply a queue point that acts at a specific point in the PHP execution process: callbacks are queued via add_action() call, and everything in the queue gets processed in turn:
add_action( 'hook_name', 'callback_name', $priority, $number_of_args );

A filter hook is a similar queue point, only it acts on a specific bit of data - it could be a string, an array, an integer, or whatever. As with actions, callbacks are queued via add_filter() call, and everything in the queue gets processed in turn.
add_filter( 'hook_name', 'callback_name', $priority, $number_of_args );

If you need to ensure that one callback gets processed earlier or later than another, then you will need to ensure that the two callbacks have different priorities. The lower the number, the higher the priority, and the earlier the execution. The default priority is 10, so anything added with a priority of 11 will execute after the default, and anything added with a priority of 9 will execute before the default.
So, yes: both the Theme and Plugins can add action or filter callbacks to the same action/filter hook, without conflict.
Comment: Just a short note: In the absence of priority arguments, plugin callbacks should run before theme callbacks since unprioritized callbacks are added first-come-first-serve and plugin files are parsed first.
Comment: Another short note: When the two hooks have callbacks with the same priority, it's the "first-in, first-out" rule (fifo) as far as I understand the order in $GLOBAL['wp_filter']. Maybe you can elaborate on that case?
Comment: When it comes to the_content, shortcodes or appending/prepending html, you're boned if you need to control priority. Priority 11 runs do_shortcode, you CANNOT add a filter with shortcodes BEFORE this in priority 11 and priority 10 runs autop, so you CANNOT add html in priority 9, or your content will print without paragraph tags. Let's say a plugin adds some HTML to the end of the_content, the only way you'll be able to add some HTML above that, is by creating a plugin with a name that is alphanumerically ordered higher than it, and executing filter from there. It's an awful design.
Answer: Every action/filter hooks have a priority parameter(the third parameter). The default value of which is 10, the lesser the value the earlier it is called
Like
add_action( $tag, $function_to_add, $priority, $accepted_args );
add_filter( $tag, $function_to_add, $priority, $accepted_args );


Why did Harry Potter need a lamp when in the restricted section?

Question: We can see that the library is not too dark to search for books, so why did Harry Potter need a lamp here?
Comment: Remember that this is a film so the audience needs to be able to see what is going on as well
Comment: I dunno, I'd classify that as pretty dark. I'd wager that without that lamp illuminating the area, Harry wouldn't be able to see a thing.
Comment: I think another question might be. Why is he using a lamp when he has a perfectly good wand and Lumos is literally the first spell he/they were taught.
Comment: There's two competing goals in TV & movies, keeping the audience informed and engaged and realism - lighting usually errs more on the side of the audience, we need to be able to see what's going on even when the characters are not supposed to - It'd be a good rule of thumb to assume if it's dim light to us watching it's far dimmer for the character
Comment: Potter isn't an owl, and he needs to be able to read. The background light is probably just enough light so that he doesn't trip on his own feet.
Answer: The script indicates that the part of the library he's in is 'pitch black' without the lamp.

INT. LIBRARY – NIGHT
[Pitch black. A match STRIKES, floats by itself, in midair. It drifts forward, LIGHTS a LAMP.]
INT. LIBRARY - ROW OF BOOKS - MOMENTS LATER – NIGHT
[The lamp floats eerily among the books, then rises, illuminates a SIGN: RESTRICTED.]
INT. RESTRICTED ROOM - LIBRARY – NIGHT
[The lamp FLOATS into the room, the invisibility cloak drops and, bit by bit, HARRY appears.]

Obviously in movies you can't have pitch blackness (or the audience will think the projector is broken) so you have 'Hollywood darkness', where the audience can see perfectly well, but recognise that the actors can't.

This ties in very nicely with the description of the library (at night) from the source novel.

The library was pitch black and very eerie. Harry lit a lamp to see his way along the rows of books. The lamp looked as if it was floating along in mid-air, and even though Harry could feel his arm supporting it, the sight gave him the creeps.
Harry Potter and the Philosopher's Stone
Answer:
The Restricted Section was right at the back of the library. Stepping
carefully over the rope that separated these books from the rest of
the library, he held up his lamp to read the titles.
-Harry Potter and the Sorcerer's Stone, Chapter 12

Light enough to not bump into bookshelves and see the outlines of individual books is not the same as light enough to read worn and cracked titles on book bindings from a distance of two or three feet.
During the 1991-92 school year when Harry first entered the Restricted Section via his invisibility cloak during the Christmas holiday, he was in a huge hurry, given that no one but Madam Pince was allowed in that section without the written permission of a professor. Being able to see titles from a few feet away made for much easier (and thus quicker) searching for a book about Nicolas Flamel.
Answer: One possible explanation is in the mechanism of Scotopic (low light) Vision and how it impacts text. In low-light conditions, the human eye emphasizes the use of the rods, which are clustered more toward to edges of the eyes over cones, which are concentrated in the center. This is one of the reasons why it's easier to see things out of the corner of your eye when it's dark, and it unfortunately also means that the area where you best focus, the center of the eye, is relatively unused, which makes it that much harder to read text. Adding to that, Harry has poor vision to start with, and glasses, particularly cheap glasses that the Dursleys are likely to buy him, prioritize correcting the vision straight ahead, with vision toward the sides getting progressively more distorted. This can be heightened if he has some forms of astigmatism, which further tend to blur text. Thus, in a low-light situation, he's going to have more difficulty reading the books, even if he has enough light to navigate the room.
Answer: Reading in low light is hard.
It's been well-studied that lighting levels affect reading speed. Reading poorly illuminated text is more difficult, more time consuming, and more error-prone than reading text that is well-lit. If you're searching a library for particular text, you'll find it faster when using a lamp, rather than struggling to make out the titles in dim light. Even if it wouldn't have been impossible to read the titles without the lamp, it would have certainly been more difficult.


Two GPU's Freeze Issue Nvidia/AMD

Question: I have two GPU's installed in my system, I want to use a GT 710 for the Ubuntu host OS and an R9 390 to passthrough a Windows VM. I blacklisted the R9 390 and I have no driver installed for that card. When booting up with the GT 710 on the latest kernel the system starts freezing right after I login and eventually will stop responding. I tried booting on the R9 390 and switching from the open source drivers to Nvidia's but after reboot this caused the GT 710 to not output anything at all. But on the latest kernel and with the Nvidia drivers installed if I completely remove my R9 390 from my system Ubuntu boots perfectly fine and it is completely stable. I do not understand at all what's wrong, I feel like there shouldn't be any kind of graphic driver issues since I did not install any drivers for my R9 390, just for my GT 710.
Answer: Found out this wasn't due to any software issues and that it was because I was trying to passthrough the primary GPU in my system causing Ubuntu to freak out.

Two GPU's Freeze Issue Nvidia/AMD


Transferring Clash of Clans

Question: I originally started playing Clash of Clans on a first-generation iPad and connected it to my GameCenter.
I then got a third generation iPad, linked it to the first iPad's GameCenter account, and continued playing Clash of Clans on the new iPad 3.
My friend is giving me his GameCenter account, which is linked to HIS Clash of Clans village- is there any way I can transfer his village to my Game Center ?
Answer: If I understand your question correctly you can:

sign into your our Game Center on your iPad 3
delete the app from the original iPad (making a backup first)
sign into your friend's Game Center on your iPad
reload the game and verify the correct village loaded

Once that is done, you should have both villages intact.
Answer: You will only lose that village from the device, on your iPad 3 everything will be fine.
Jush log out in the game and from gamecenter and then let him log in.

Transferring Clash of Clans


Magento API to use to integrate ERP System

Question: An ERP company asks you for recommendations which Magento API to use to integrate a client
It is expected that at times large amount of product and category changes will need to be pushed from the ERP to Magento.
What is the appropriate Magento API for this?

1)The GraphQL API
2)The synchronous REST API
3)The asynchronous bulk API
4)The synchronous bulk API
Answer: According to latest and in feature,

1)The GraphQL API

This is the best options.
Comment: Why not asynchronous bulk API ?


How to recognize and delete Ubuntu partitions from Windows 8 Dual Boot Machine?

Question: About a year ago I installed Ubuntu 13.10 side-by-side with Windows 8.
A few weeks later I updated it to 14.04 (only so I could stop seeing the "available updates" message) and I updated my Windows 8 to 8.1 (because my laptop gave me no choice on the matter).
After I did all that, something weird happened which caused my laptop not to show me my operating systems when I powered it on, and instead it went straight to Windows 8 all the time. However this didn't mean I couldn't enter my Ubuntu system, but I had to follow these steps:

Turn on the machine by pressing the Assist system so I could get into the UEFI loader, and from there I could enter my BIOS.
Change my BIOS mode to legacy and restart and wait for a not-so-nice message saying it couldn't find any operating systems.
Power off, and repeat step 1, and change BIOS mode back to UEFI.
Restart and it would show me that screen, asking which OS I wanted to boot.

Now, at that time I was too busy to try and fix that. And then I stopped using Ubuntu altogether. One, because I got a Mac, and since they're both UNIX based systems I could do on the Mac everything I could do in Ubuntu; and two, because they now keep a Ubuntu machine in my office so I can store and test any new projects I develop.
So, at the moment I don't really need Ubuntu, so much as I'm starting to need the space it takes, and I want to delete it from my Hard Drive.
For this purpose I watched some Youtube videos, but they led me nowhere, since they show their Computer Management window in Windows 8, and it only shows 4 partitions. 2 for Linux and 2 for Windows, but in my case, for some reason, I have many more, and I don't want to delete anything if that could mean damaging my Windows partition... I can't uplad images yet so I will list my partitions here.
_________________________________________________________________________________________

Volume  Layout  Type  File_System  Status                   Capacity  Free_Space  %_Free

_________________________________________________________________________________________
        Simple  Basic              Healthy(OEM Partition)   260 MB    260 MB      100%
        Simple  Basic              Healthy(Recovery Part)   1.44 GB   1.44 GB     100%
        Simple  Basic              Healthy(EFI System Pa)   260 MB    260 MB      100%
        Simple  Basic              Healthy(Recovery Part)   450 MB    450 MB      100%
        Simple  Basic              Healthy(Primary Part)    1 MB      1 MB        100%
        Simple  Basic              Healthy(Primary Part)    32.11 GB  32.11 GB    100%
        Simple  Basic              Healthy(Primary Part)    7.88 GB   7.88 GB     100%
        Simple  Basic              Healthy(Recovery Part)   350 MB    350 MB      100%
        Simple  Basic              Healthy(Recovery Part)   30.09 GB  30.09 GB    100%
        Simple  Basic              Healthy(OEM Partition)   8,02 GB   8.02 GB     100%
        Simple  Basic              Healthy(Primary Part)    14.35 GB  14.35 GB    100%
(E:)    Simple  Basic  NTFS        Healthy(Primary Part)    250.00 GB 87.79 GB    35%
(C:)    Simple  Basic  NTFS        Healthy(*)               608.57 GB 350.50 GB   63%

*Boot, Page File, Crash Dump, Primary Partition.

I don't know why I have so many partitions... If I remember correctly I always had more partitions than normal. But this is ridiculous.
However the E partition is one that i created so I could share some specific filed between Windows and Linux (which backfired because I almost never could access them from Ubuntu).
So, that's it... As a question I'll just quote my title: "How to recognize and delete Ubuntu partitions from Windows 8 Dual Boot Machine?".
Or if possible, how to completely delete Ubuntu, by booting into it first.
Answer:
Boot Ubuntu Live from your CD/Pen Drive
Then use gParted / Disk Utility to identify the ubuntu partitions (Usually ext4 and swap space)
Then format those partitions

You can also use the gParted live to live boot and use the gParted application


ACAM PS09: Strain Gauge Stress Analysis

Question: I've been working on implementing strain gauge measurements at my company for some stress analysis. There's a chip that I think works the best for our application. It's the PS09 by ACAM. However, there are some problems I've run into concerning the on-board RAM and the consistency of its measurements.
For me, the appealing things about the device are its low-power, temperature
compensation, and SPI communication. These are all things I'm looking for.
So, I was hoping to run some ideas by anyone that has touched on this kind of device before.
There's a lack of talk about the PS09 online. I don't know if that's indicative of lack of usability and/or no one actually knows about it.
Has anyone worked with the PS09 chip?
Here's what I believe is the most recent datasheet: http://www.acam.de/fileadmin/Download/pdf/PICOSTRAIN/English/DB_PS09_Vol1_en.pdf
Please let me know if other details are needed, and I will try to provide them. (Is there, perhaps, another question that might be related to this?)
Answer: I have been able to successfully work on the PS09. If anyone sees this and would like to know about the PS09, I will respond when possible.
Comment: yes please, kindly elaborate your finding.
Comment: its 2022 and still not a lot of details are available.

ACAM PS09: Strain Gauge Stress Analysis


Invoking a CCK widget in a custom module

Question: I'm trying to find a good example or tutorial of how to include a content_taxonomy_autocomplete field within a custom Drupal module?  I haven't found anything like it... I've found some that show how to create one for a custom module, but as the field already exists, I just want to reuse it in my custom module, but can't seem to find anything on how to use that field in a custom module?  If someone can point me to something that would work, that'd be great...
Answer: It's possible to reuse CCK widgets in custom forms. But building an autocompleting taxonomy field yourself is really simple. You only need a textfield with #autocomplete_path in your $form, a callback for this path defined in hook_menu() and the callback itself.
http://drupal.org/node/42552 is oudated. Search for "Drupal 6 autocomplete". There are loads of tutorials like this.


Are people with a mental illness advised against pursuing a Masters degree in some difficult topic (such as computer engineering)?

Question: I have just graduated with a Bachelor degree in computer engineering. Most of the students who get a Bachelor degree at my university go furhter to pursue a Masters degree. However, I have a mental illness, a psychotic disorder (a mixture of Risperidone, Biperiden and Alprazolam appears to help). Many people on the Internet are advising people with mental illness not to pursue a PhD, because PhDs are tough on mental health. I am wondering, is pursuing a Masters degree in computer engineering also tough on mental health?
Comment: I don't think we can give an answer that's useful to you, because your issues are far from the most common mental health issues and hence the appropriate advice for you might be completely different.  Also, it matters what your alternatives are - for example I'm sure homelessness is much worse on mental health than grad school.  I would strongly suggest you consult your doctor(s) and or therapist(s) instead of strangers on the internet.
Answer: If you can manage your mental health issues, you should be fine in an MS. Usually, you just take a bunch of classes that are slightly  more interesting than the classes you already did.
Ph.D. are hard on mental health, because Ph.D. students have to deal with certain temptations, such as the impostor syndrome (a Ph.D. should make you the world's specialist in a very small subfield), the feelings of discouragements because Ph.D. students do not feel the progress they are making, and other challenges. Now, if you have access to a therapist, a lot of these problems are much more manageable. Having an understanding Ph.D. advisor also helps. So, I would not conclude a priori that you cannot do a Ph.D. The reason that it might be a good idea is because R&D tend to be more tolerant of personality quirks, which of course in your case are often a syndrome of you illness.
The MS is often very similar to two years of undergraduate studies, but with classes almost exclusively in your chosen major.
Individual factors are very important here. For example, if you have to worry about finances, you have a very high stress factor. The risks of trying out an MS are limited, because leaving after a semester does not cost you a lot. Finally, holding down a job might be equally challenging, unless you have an understanding employer. You might be surprised which big employers are actually good to people with mental illnesses, as long as they can be productive.
In summary, I would advise you to not exclude any options, to talk it through with a therapist (who is trained to elicit your feelings and helps you deal with them), and to minimize risks in your planning.
Answer: The overall stress level is only one factor, and something we can't help you determine because it will depend on your university and program of choice.
What is more important is to find out whether your mental condition precludes you from independent, self-directed work over a long period of time, which can be a specific sore point tied to specific disorders. Bachelor degrees often have a much higher level of hand-holding. The same tasks can feel entirely different in terms of stress if they are to be done in a supportive, restrictive, or free-form environment.
It's generally a good idea to take calculated risks in life. However, in this specific scenario, you really need to be asking your therapist about it so as to develop an understanding of your strengths and weaknesses and how your condition ties into that. Internet strangers like me cannot help you or if they do, it will purely be by accident. This is because we lack a clear and sufficient understanding of your circumstances and your disorder.


Setting the default calendar in iOS?

Question: In the calendar app (iCal?) in iOS, is it possible to set a default calendar?  Every time I go to add a scheduled event when I am at work, it picks the wrong calendar to add it to, and if I could just set a default I could save alot of time on that.
Comment: On naming - confusingly the iOS calendar is called 'Calendar' while OS X's calendar is called 'iCal'. Maybe it'll change in Mountain Lion?
Answer: Settings -> Mail Contacts Calendars - > Calender -> Defaultcalendar

Setting the default calendar in iOS?


Raspberry Pi Zero W, Pi camera with motion error

Question: I got Motion working on my Raspberry Pi Zero W Stretch. Everything was working fine untill I shut it down to take a break. After i turned it back on it doesn't suddenly work. This is the error I get.
<code>[0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file
/home/pi/.motion/motion.conf
[0:motion] [ALR] [ALL] conf_cmdparse: Unknown config option "
"
[0:motion] [NTC] [ALL] motion_startup: Logging to syslog
[0:motion] [NTC] [ALL] motion_startup: Motion 4.2.2 Started
[0:motion] [NTC] [ALL] motion_startup: Using default log type (ALL)
[0:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
[0:motion] [NTC] [STR] webu_start_strm: Starting all camera streams on port 8081
[0:motion] [NTC] [STR] webu_start_strm: Unable to start stream for camera 0
[0:motion] [NTC] [STR] webu_start_ctrl: Starting webcontrol on port 8080
[0:motion] [NTC] [STR] webu_start_ctrl: Unable to start MHD
[0:motion] [NTC] [ENC] ffmpeg_global_init: ffmpeg libavcodec version 57.64.101 libavformat version 57.56.101
[0:motion] [NTC] [ALL] translate_init: Language: English
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 0 is from /home/pi/.motion/motion.conf
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 0 Camera Name: (null) Device: /dev/video0
[0:motion] [NTC] [ALL] main: Waiting for threads to finish, pid: 687
[1:ml1] [NTC] [ALL] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] vid_start: Opening MMAL cam
[1:ml1] [NTC] [VID] mmalcam_start: MMAL Camera thread starting... for camera (vc.ril.camera) of 640 x 480 at 10 fps
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
[1:ml1] [ERR] [VID] create_camera_component: camera component couldn't be enabled
[1:ml1] [NTC] [VID] mmalcam_cleanup: MMAL Camera cleanup
[1:ml1] [ERR] [VID] vid_start: MMAL cam failed to open
[1:ml1] [WRN] [ALL] motion_init: Could not fetch initial image from camera
[1:ml1] [WRN] [ALL] motion_init: Motion continues using width and height from config file(s)
[1:ml1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 4 items```
</code>
Comment: The error message on the second line is important . Please show your `motion.conf`.
Answer: May be Ribbon cable connecting camera got loose. Also check camera is enabled in config(raspi-config)
if the red LED on the camera glowing, things should be fine. You can verify camera functionality with rpistill


Transit visa requirement for Iranian citizen at Incheon airport for transit time of less than 12 hours

Question: Please let me know whether Iranian needs any transit visa to stay for less than 12 hours at the Incheon airport transit area ?
Answer: As stated by Timatic, the database used by Airlines

Visa required, except for Holders of onward tickets transiting
  Seoul Incheon (ICN), for a max. transit time of
  24 hours.

So no, you do not need a visa


How do I play the online co-op campaign?

Question: My friend and I really enjoyed playing the co-op campaign together in Magic 2012.  However, we can't figure out how to play the co-op campaign in Magic 2013.  According to Cooptimus, the game supports 2-player online coop.  So, how do we play it?
Answer: The referred site says:

Two players can team up to play a Two-Headed Giant match versus the AI, either locally or online.

Are you sure you read somewhere that you can play Co-Op campaign?
Comment: ...I guess I just assumed, because it would be **insanely retarded** for them to have co-op campaign in Magic 2012 and not include one in 2013..


Setting random seed for neural network

Question: I'm training a neural network for a particular problem which can be predicted with 100% accuracy. However, the problem is that results tend to vary between 99% and 100% even if I train 10 different networks and take the average. I was reading around and found that it was due to random weights initialized every time the program ran. Is it okay to set the random seed to 1 and then train 10 different networks and take the average?
This will result in less variation and easy model selection.
Answer: You're trying to hide the problem under the rug. The variability is not a simple annoyance. If your model selection depends on the seed, then fixing the seed only hides the issue. Your models are not different enough for the sample you have, that's the bottom line.
Comment: I see your point. I read it somewhere and thought it was a viable solution. However, averaging did solve the problem on my previous neural net. I'll keep working on the model to get more consistent results. Thanks!
Comment: @HassanAbdulQayyum - if you want the neural network to act well on unknown data (generalize) then you need to pay attention here.  Picking a particular "set seed" is like weighing the dice - they are no longer random and so they will not do their job.  Look at making a hold-out set for this approach - train the 10 networks on 80% of the data, and then test on the held-out 20%.  This will tell you if you are 100% (doubtful) or if you are "hiding the problem under the rug".
Comment: @EngrStudent the training data is 891 examples and testing data is 418 examples.

Setting random seed for neural network


cvDecodeImage fail in a cgi program

Question: In a single application, the following code is ok
<code>CvMat src_image_mat;
cvInitMatHeader(&src_image_mat,1,src_image_data.size(), \
                CV_8U,(void *)src_image_data.c_str());
m_pSrcImage = cvDecodeImage(&src_image_mat, 0);
</code>
where src_image_data contains all the bytes in a given jpeg file,
after calling ,m_pSrcImage is not NULL.
but when this code is run in a cgi program, the value cvDecodeImage returns is NULL, and the src_image_data is the same as in the single application.
btw: when in cgi context, the picture is uploaded by some users.
Answer: assure file is already read into memory to pData with size nSize.
<code>    CvMat cm = cvMat(1, nSize, CV_8UC1, pData);
    pImage = cvDecodeImage(&cm);
</code>

cvDecodeImage fail in a cgi program


Failed to deploy Webservice into weblogic server

Question: I developed webservice and I want to deploy it into weblogic, so that I can integrate it with my portal application.
My webservice works well in integrated Weblogic server(10.3.5). But, when I try to deploy it into development server (10.3.6), Weblogic throw an exception.
I also try to deploy it into EAR file, and I got the same exception.
The error message is :
[02:16:01 PM] Caused by: java.lang.ClassCastException: com.sun.xml.bind.AccessorFactoryImpl cannot be cast to com.sun.xml.bind.InternalAccessorFactory
Does anyone know how to fix this issue? I'm still trying to deploy it into 10.3.6 version.
Answer: Please check versions in web.xml.
WebApp_ID version should be as javaee version you specified.
Answer: I reinstall the weblogic server using jrockit 1.6.0_33 then I able to deploy my webservice. Means that I downgrade jdk (not latest version).


How can I calibrate colors?

Question: In System Settings -> Colors there is color panel but "calibrate" button is grey and I am unable to calibrate it by myself.
Answer: This feature requires a supported color calibration device that looks similar to a webcamera and attaches to the screen to detect the colors
This comment on How do I reset an ICC profile in Ubuntu? states:

sensor device - Example devices - Note though that you MUST check
  which ones are supported by ArgyllCMS, the software behind "Color"
  above.

How can I calibrate colors?


404 on page 2 multisite

Question: I have a a multisite installation of wordpress. On my startpage (index.php) I show posts from all the sites that belongs to the network. The problem I'm experience is that when I go to /Page/2 I get a 404 message if my main blog doesn't have enough posts for a page 2. However on the whole network there are enough posts for 2 pages. If I add some more posts to my main blog, page 2 will be available again. My guess is that wordpress checks if any posts exists for the query before it includes index.php. I have tried to find where this could be done but have not found anything. Does anyone know if wordpress does this kind of check before index.php is included?
Comment: do you display any of the posts from the home page main query, are are you only showing the network posts?
Comment: I show the most recent posts from across the network which is made by a custom query. The thing is that I never reach this query since it it inside index.php which for some reason doesn't get included. Instead 404.php seems to be included
Answer: Every front end page request on a WordPress site produces a main query. The template that WordPress decides to load is based on the results of that main query (you can see the order that WordPress does these things by looking at the Action Reference page). Despite the fact that you never output the results of that query, it's still run, and in the case of paginated archives, this is an issue if you're trying to use that pagination for a different query.
The best case scenario is to modify the main query before it's run via the pre_get_posts action, however, this won't work for you because you're querying network posts, which, as far as I know, the WP_Query class can't do on its own.
The simplest solution to this is to make your landing page a static page instead of a posts archive. Create a new page under the Pages menu in admin, then visit Settings > Reading, and under Front page displays, select A static page, then choose that page from the dropdown menu. You'll now be able to paginate that page without it throwing a 404, because the main query will always contain just that single page's data and won't be potentially empty.
Comment: Brilliant answer! Made a new template for my start page and made a static page using this template. The pagination works like a charm now :)

404 on page 2 multisite


Does manually unsubscribing via All Subscribers import hurt deliverability?

Question: I'm going through IP warming of our dedicated SAP. We have bounces around 15% from house lists. I want to manually unsubscribe these bounces, but will those hurt my deliverability and sender reputation similar to a recipient unsubscribing?
Answer: The ISPs are not aware of those internal unsubscribes, so this will not have any negative impact on your reputation. Are you starting your warmup by sending to the most recently engaged subscribers? I would be surprised if you are seeing such high bounce rates with these. Did you check the reason for bounces? If these are block bounces (due to poor IP reputation), you should not unsubscribe these recipients, but keep sending to them. You can check the bounce reason under Email Studio > Tracking > Sends, and click on the corresponding number, like in this example:

Also, do familiarise yourself with how Marketing Cloud handles bounces, as these will in some cases be automatically prevented from receiving future sends, when they are marked as undeliverable. This flowchart gives a good explanation of this:
Answer: No. Reputation is a thing that is determined by an Email Service Provider like gmail / microsoft and can be aggregated (e.g. SenderScore), but really it is first and foremost something that each vendor handles themselves.
You have to understand what the purpose of all this is.
Email Service Providers do not want to "pay for" handling unnecessary traffic that clogs their servers, meaning unwanted emails sent by, say, spammers.
If you unsubscribe a gmail address manually, that means less traffic on gmail servers. First of all, following the logic above that's great for gmail, especially if you unsubscribe the recipient for a good reason. They really have no problem with that. If anything, they would probably RAISE your reputation for it. But alas, gmail is not informed. Anytime you'd press a button inside SFMC, a request would have to go out to tons of vendors like gmail, hotmail. That does not happen. The only effect that they would notice is: The gmail address gets no emails from you - in other words "nothing". On an individual level, that has zero effect on reputation.
Another point is: Do you have a source that tells you that unsubscription IS bad for reputation for some vendor? Unsubscription is not necessarily bad, it's actually a sign that people CAN unsubscribe from your messages, which is very much wanted by everyone in the industry.
If unsubscription DID hurt reputation, then vendors would pretty much incentivize every sender to remove all unsubscription options in order to not hurt reputation. That would be illogical and hurt themselves, because it would mean more unwanted traffic. Even having in mind that each vendor does their own thing here, I know no sources that say this is a thing, and I would argue, this does not happen.


Is it possible to estimate individual rate of inflation for a person as against the avg inflation rate for that country?

Question: Even though normally we all use a specified inflation rate per country for financial calculations (i.e real returns, salary increases, etc..) isn't it possible for the inflation rate to have different impact on different individuals? In that case, is it possible to estimate one's individual inflation rate as opposed to a population wide average inflation rate?
Answer: Inflation gets a lot of press but people rarely stop to think about how they would measure inflation.  Prices do not go up equally for all items in the market.  Market prices are ever changing in response to supply, consumer demand, and money devaluation.  New money printed by the Fed (in the US) may flow into one area of the economy and not affect other areas which would causes certain items to be more inflationary than others.
As you mention, different people will have varying levels of exposure to the items that are inflating more rapidly than others.  I may have a long commute to work so I'm more exposed to rising prices in gas.  You may live in a city and walk to work so gas prices do not affect you as much.  I may be a vegetarian so I'm not sensitive to meat, pork, and chicken prices.  There are also lots of items that I never purchase that are used to calculate the inflation rate.  Inflation is not as easy to measure as some think.
The only way I know to measure a personal inflation rate would be to track your expenses every month (by unit - $ per 16 oz of bread, $ per gallon of gas, etc.).  If you see your personal inflation rate rising faster than the government rate then you know you are more exposed to inflation (at least according to the government's way of measuring inflation - which uses hedonics, geometrically weighted averages, substitution, and other political magic).
In short, if your expenses do not match the CPI expense distribution (see chart) then you will not have the same level of exposure to the government reported inflation.
Comment: Great answer Muro.  Just to compliment it.  Inflation is calculated on a very specific basket of goods which are tracked on an ongoing basis.  It's a long list and is weighted in various ways intended to reflect the experiences of the average consumer.  Obviously this won't be exact for anyone. Calculate your own by selecting your own standardised basket of goods and tracking your expenditure on them every month.
Comment: Great answer. The best way would be to keep a track of expense and categorize the expenses as above. And track the increase. It could also be because of affordability, but in the end that's what your real increase is inflation + Lifestyle increase. This would give you a figure that you should use to calculate your expense at retirement.
Comment: Absolutely true. But the catch is: Unless you buy exactly the same collection of goods in the same quantity every month, it's not clear how you would calculate your "personal inflation rate". Like, last month I paid the rent and the electric bill and bought some groceries, my total expenses were $1000. This month I bought all that and I also bought a new car, total $25,000. Zounds, my personal inflation rate is 2400% per month! Okay, you'd presumably realize that's an extreme case. ...
Comment: ... But say I spend $300 on groceries in January and $330 in February. Is it because prices went up 10%, or because I bought somewhat larger quantities or bought some more expensive items? Even if I figured out exactly what caused the increase, how do I factor that into a calculation? The only way to get a meaningful number is to use a constant set of goods for every time period.
Answer: Inflation is the devaluation of currency based on the rising cost of goods or services. So unless the person is seeing prices rise for them alone, I don't think the concept of personal inflation makes any sense.
Comment: No, but the particular sets of goods a person buys could have a higher inflation rate than the "average". In this sense, a person could just keep track of prices changes in the goods they buy and obtain a "personal" inflation rate.
Comment: John - I think the question has merit. Say I live in a rent controlled apartment, work from home (zero transportation costs), but pay for my 2 kids to go to college. Higher education has been running much higher cost year after year that general inflation, no? Given this contrived scenario, I experience a different, higher rate than you. Each year an article publishes the "12 days of Christmas" inflation. Why not a Joe's inflation?


Cronolog vs logrotate

Question: Which log rotation tool do you prefer?
Answer: In my experience, logrotate is great. It's very flexible, and works well with most software.
However, there are some issues with it, and as cronolog is primarily a web log rotation facility, I'll write down my experience with logrotate + apache which was problematic:
When rotating logs , we must notify apache that a log is being rotated, as even if logrotate renames access.log to access.log.1, apache will continue writing to access.log.1, as it is writing to the inode, and renaming the file doesn't affect the inode number.
On debian etch (and probably many other distros), logrotate is being used to rotate apache logs. Now, apache has a graceful restart that advises the apache child processes to exit once they finish serving existing connections, apache then re-reads it's configuration, spawns new child processes, which start writing to a new log file (In case the previous one was rotated).
This sounds like a great solution, however graceful restart does not always work in certain conditions (like heavy load), so debian developers decided to use an apache restart instead of a graceful restart, in the apache logrotate configuration. Unfortunetly this causes all connections to be dropped at once, which is very bad for heavily loaded sites. In addition, apache restart can also cause problems like apache stopping and not starting (also in certain load situations), see bug links below for details.
The bottom line is, logrotate is great, but can lead to certain issues for certain programs. I don't have much experience with cronolog, but as it writes logs through a pipe, it doesn't require any apache reloads when it's rotating log files, which basically solves all that is described above.
Related logrotate/apache debian bugs:

Debian bug #301702
Debian bug #400455
Comment: the solution for the above is to use truncate ! what it does is to copy the contents of access.log to access.log.1 and then empty the access.log (as you see the inode remains of access_log remains the same). Usually you don't have logs larger than a few GB (in worst caase), so the whole process won't take a long time !
Answer: I prefer cronolog, but it isn't a really strong preference.
logrotate where is started by cron, and if a system is down for some reason when the rotate should have happened, then your log files won't be rotated.
I also like having log files have the date (%Y%m.combined.access.log) in the name because I keep those logs around for a long time.  On most systems, by default, apache logrotate will name the files access.log,access.log.1,etc.  It may be possible to use a date in the logfiles with logrotate, but I couldn't figure out how to do last time I looked.
Comment: The issue where logrotate doesn't work if it's passed the cron time can be fixed by installing the "anacron" package.
Comment: or even better you can save your logs in the desired format -this can be done with templates in rsyslog - (%year%-%month%-%day%_lala.log) . in this case, you don't even have to rotate the logs, because every day tha name is changed !
Answer: Only ever used logrotate. It's what Debian uses by default and I've never had any complaints with it.
Answer: I almost exclusively use cronolog over logrotate.
logrotate comes with Debian, and I allow it to keep working for the system services like the mail server logs. But for Apache and lighttpd log files, it's all cronolog.
One of of the reasons why I use cronolog is that all the configuration happens in the log-file line of the web server config
e.g. in a lighttpd config file, you could put :
accesslog.filename = "|/usr/bin/cronolog --symlink=/var/log/webs/access.log /var/log/webs/%Y/%W-access.log"

And all get a a new log file every week without any other configuration. Or you could get creative and do something like :
accesslog.filename = "|/usr/bin/cronolog --symlink=/var/log/webs/access.log /var/log/webs/%Y/%m/%a-access.log"

And get a log file that shows traffic by day of the week. e.g. all Sundays, all Tuesdays.
What's better is that even if the server is down for any amount of time, the correct log file will be used upon restart.
Comment: That looks a lot like svlogd (of runit and daemontools lineage).

Cronolog vs logrotate


Origins of "tie the knot"

Question: A common symbol in modern weddings it the image of knot. The phrase "tie the knot" as a euphemism for marriage that is also commonly recognized.  Where does this originate from?
Answer: The metaphor of a knot is one of binding, as two people are bound together in marriage.
Shakespeare uses the metaphor, but not the exact phrase:

Send for the county. Go tell him of this.
I'll have this knot knit up tomorrow morning.

But it's earlier still, in The Legend of Saint Katherine c 1225:

Swa wit beoð ifestnet & iteiet in an, & swa þe cnotte is icnut bituhhen unc tweien.

Or as a rough stab at a translation into modern English:

As we are fastened & tied together, so the knot is knitted between us two.*

It may relate to knot-tying as an actual part of wedding ceremonies (and sometimes betrothal ceremonies), as is found in rituals from throughout the world from ancient times until the present day.
Or it may just be a metaphor applied in the phrase alone.
Being so old, it's probably impossible to tell which.
Either way, with knot being in English for so long as a symbol of marriage, and tying being how one forms them, "tie the knot" was pretty inevitable from that starting point.

*Some notes on translation, since they might be of interest in their own way:
I'm tempted to have it "...us twain" rather than "...us two" but while twain is Modern English, it's not common in Contemporary Modern English. It would be a closer translation.
A little is lost in translating wit to we and unc to us as Modern English doesn't have pronouns that specifically refer to two people. "We two" and "us two" would be more accurate but more clumsy.
Knitted would be a rare choice for a knot today—not unheard of, but rarer than once was the case (e.g. see the Shakespeare quote as an example in Early Modern English). Tied or fastened would perhaps be a better translation for that reason, but it would introduce a repetition that scanned a bit silly to my eye.
I'm not happy about the translation of "in an" as "together". "In one" or "as one" would be a closer translation, and more poetic in allusion, but strange with the rest of the sentence in Modern English.
Similarly, swa is the root of the Modern English so but also used as we would use that, then (consider how Irish English still uses so where other dialects would only use then) and as. This mean that the form "as ... as ..." (e.g. "as white as snow") was more flexible in Old and Middle English than today. Translating sadly loses the poetry of the repetition.
Comment: Thank you; I appreciate you finding references from such an early stage of the english language. I don't understand what the excerpt from 1225 means, but I would vote up if I could.
Comment: @Mari-LouA Middle English thankfully; I am totally hopeless at Old English but can make a stab at translating Middle. You were correct on *bituhen* and *tweien*, but *beoð* is in fact *are*, as in the form of the verb "to be" for the first person plural.
Comment: Would it be rude to ask if you could rewrite the (Old English?) excerpt in contemporary English? I think I recognize *beoð* as being *both*, *bituhhen* as *between* and *tweien* as *twain*, the rest is a mystery.
Comment: I don't know if this is relevant; but in India all marriages happen by the couple tying a chain around each others necks...
Comment: @AravindSuresh one example of what I was thinking of when I said "It may relate to knot-tying as an actual part of wedding ceremonies (and sometimes betrothal ceremonies), as is found in rituals from throughout the world from ancient times until the present day." It's very common in modern Western paganism (where such marriage are indeed often called "handfasting"), some Christian denominations wrap (but don't actually tie) the couples hands together, and there are other examples
Answer: To tie the knot is a remnant of the ancient church's tradition to take the couple's hands and tie them with a piece of fabric during the wedding in the Church.  In the West, this tradition has fallen in disuse, but in an unchanged form, this is how it is still done in the Orthodox Church.
Comment: Did it originate as a church tradition? I thought it was pre-Christian.
Answer: The artwork Aztec Marriage Couple, from the Codex Mendoza (1434) depicts a man and a woman seated on a mat; the bride was powdered with yellow earth and adorned in red feathers. The formal vows took place in the groom's home, the marriage performed by tying together their wedding garments—tying the knot.
[Source: Margaret Lazzari & Dona Schlesier, Exploring Art: A Global and Thematic Approach (2011).]
Answer: In ancient Aztec marriages, after the ceremony the new couples clothing was literally tied together into a knot
See the image of a marriage ceremony in The Codex Mendoza (Berdan and Anawalt 1992:vol. 4 folio 61r)
Comment: Do you have any evidence/support you can include with your answer?
Comment: There's the image of a couple whose clothes are tied together in a knot on this page: http://www.mexicolore.co.uk/aztecs/artefacts/study-the-hearth
Answer: In Celtic tradition, they often would take "ribbons" of each family tartan and tie them around the wrists and then together in a knot symbolizing the joining of the two clans and thus "tying the knot", yet another example of how this phrase may have come to be.
Comment: Hi @Gwenn, welcome to EL&U, here we expect the people to cite the references to back up their claims. Could you include any support/evidence with your answer?
Answer: The uncontrollable nature of the sea has given way to many a nautical lore. It has Long been said amongst sailors that when the yearning for home and the woman you love takes over your soul, you must send her a length of rope from your vessel. If she returns that rope tied in a knot than she is you one true love who agrees to your [betrothal] and promises to spend the rest of her life with you upon your return.
Comment: References?  Sounds very doubtful.
Comment: Was there a helicopter or speed boat to deliver the length of rope from your vessel to her?
Comment: Hot air balloon, duh!
Comment: I've only come across 'lore' in this sense being licensed (eg Macmillan) for non-count usage. But the lack of references is the more serious problem.

Origins of "tie the knot"


Juniper MX: NTP broadcast on two VRFs with the same addressing

Question: In Juniper, NTP broadcast is set at system level, so two VRFs cannot use the same addressing and use NTP broadcast at the same time. Is there any alternative?
Comment: Do you have a specific use case that requires NTP in broadcast mode? The best alternative may be to not use ntp broadcast.
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 can post and accept your own answer.
Answer: I know that most of the type the same configuration you want in the default instance exists in the same config stanza within routing-instances, in this case it's the other way around.
Addressing shouldn't matter as routing instances are separate routing tables.
You can enable broadcast NTP in a VRF with:
set system ntp broadcast 10.1.0.0 routing-instance-name VRFA
set system ntp broadcast 10.2.0.0 routing-instance-name VRFB
set system ntp broadcast 10.3.0.0 routing-instance-name VRFC


The difference between "testament" and "will"

Question: From what I found out in legal correspondence and deeds, it appears that "will" is used far more often than "testament". Is one more formal than the other? If not, what is the difference between the two?
Answer: Many legal terms use a pair of synonyms, one of Germanic origin, the other of Latin origin. This dates back to the Middle Ages, when a majority of the English population used Old English but many educated people (such as lawyers) spoke Old French or Latin. This developed into a habit of using such pairs even after the original motivation of expressing the same concept in two languages was lost. Such pairs are called legal doublets.
Examples: aid and abet, cease and desist, kind and nature, will and testament, …
Will (in this sense) and testament are synonyms. They can be used interchangeably (at least in normal speech, and I'm not aware of any legal difference). Will (the Germanic term) is a lot more common than testament (the French term).
Comment: I do not have knowledge in this field to determine whether this is correct, so I would not qualify to upvote it. But I must say, this answer is very enlightening. Thanks for sharing!
Answer: The full name of the document is Last Will and Testament. One definition:

A document in which a person specifies the method to be applied in the management and distribution of his estate after his death.

Will is a common term to refer to this document. I wouldn't call it informal; I think it's what people use most of the time. In a legal context you're probably better off using the full name, though.
Answer: These days there is no distinction, but traditionally wills dealt with real estate, while testaments handled personal estate.  See, for example, this page from the University of Nottingham.
Answer: I'm under the understanding that a will is what's in your mind as to what and who you desire to be as beneficiaries of your estate upon death, and testament is when the will becomes a legal document enforced by the law.


I can't mount a USB device in a Virtual windows machine, despite trying the usual solutions

Question: I've looked through post upon post about possible solutions and I've tried them all (check VM settings / filters, download guest additions, installing Vbox extension pack, making sure my username is part of the group 'vboxusers', downloading the most recent version of VirtualBox NOT in Software Centre, making sure device is unmounted in host OS) and still had no luck. My Webcam for whatever reason is fully integrated but whenever I go to 'USB devices' there's nothing listed so it won't let me create any USB filters. Any suggestions would be appreciated.
P.S. I'm using ubuntu 15.10 and VirtualBox 5.0.10 and my guest OS is Windows 8.1 64-bit (not that I think it matters).
Answer: I had this issue several times with USB Devices and it was always a problem with the USB 2.0 Support in VirtualBox. Go to Settings -> USB and try the different compatibility options available there.
Hope it helps
Regards


Faculty position offer concerns

Question: Say a university is hiring a science faculty member.  Only the search committee interviews the job candidate online.  Then the candidate gives one research presentation online.  The candidate is then offered the job, but they are not invited to visit the campus first or given any kind of virtual campus visit. They are also not given any contact information to talk to any of the other faculty they will be working with.  Are these red flags, or is this how hiring faculty works post-COVID?
Comment: Hiring processes vary a lot between countries, so I don't think that there is a general answer here. Maybe add about which country you are asking? Maybe even more information about the type of institution is needed…
Comment: You are always free to contact any faculty member yourself -- just like you should feel free to contact people at any other university!
Comment: Have you asked whether it's possible to visit?
Comment: With "they are not given any contact information to..", do you mean that the search committee actively refused to give such contact information upon request, or that they did not proactively provide it?
Answer: You should really give your country or geographic region. I throw something out based on my perspective (I have tenure in the US and taught in Uruguay, El Salvador, and India) assuming that you need some feed-back quickly.
Ask yourself whether you would be confident to take a job as an accountant or software engineer under these circumstances in your country.
If the job is temporary such as for a year, this procedure makes sense. Your duties would be restricted to mainly teaching with maybe a small research / service component. The cost of bringing several candidates on campus would then exceed the benefits for the university. As a candidate, you get one year of teaching at a university out of it, but you would presumably start looking for another job as soon as you get there. Besides a job for a year, you would then have a source of reference letters and a track record for teaching at a university.
I got my first job in Mathematics in the US this way as a fresh Ph.D. from Germany. Apparently, it worked out well for both parties. They would have offered me a permanent job if they could and were helpful getting me another, tenure-track position.
Now, if this is for a full-time tenured or tenure-track position (in the US) or if this is expected to be a life-long position, then they did not scrutinize you well enough. But they are also not fair to you, because they do not allow you to gather enough information. It could be that they have no money allocated for a proper search (e.g. because someone left unexpectedly). In any case, if they offer you the position, you might ask to visit them before you make a decision. If you do not have the money, you might just talk to your future colleagues.
Comment: Wow. You are right, this is unusual. It is tenure-track?
Comment: Thanks for the input.  To answer your questions, it's a full time tenure-track position at a US institution.  I have applied to other positions like this before and I have never encountered an interview process like this one.

Faculty position offer concerns


How can I filter and label emails that are sent to a mailing list (which I am a part of)?

Question: My current Gmail e-mail address is a part of a bunch of mailing lists that I need to be a part of. The problem is that I don't know what they are and they are always changing. So, how can I have it set up so that any e-mail, regardless of which mailing list it originates, that comes to that one e-mail address, is applied the same label?
Answer: I've found the best option is to find a section of text in the email that is common to them all and filter based on that. For example, you might use:
to:<you>@gmail.com subject:<common text> (<Word #1> OR <Word #2> OR <Word #3>)
You would then add/remove the <Word #>'s/<Subject> depending on what commonality you find.
Answer: If the list of mailing list is large I would do the following.

Open an email
use the More/Filter Messages like these command
Attach the label to the filer
Also apply the filter to X matching conversations
After the filter is created then archive all the messages with that label
Repeat until you have created enough filters to capture all your mailing lists

Each time you create a new filter the number of unfiltered messages will be reduced.
If you see a new message come in that isn't caught by an existing filter, make a new one.


Determine colours used in psd file

Question: How can I easily determine which colours were used in a specific psd file without having to dig through every layer using the colour picker tool?
Answer: In your case, just upload the photo to Color Explorer and it will analyze it and tell you what colors are used.
It can't import PSD, but you can just save it as a PNG or whatever and upload it.
There's also adobe kuler (sorry forgot about it!), just click the camera icon (create from an image), import the image, it will show you the colors, hit save and it will show you the color code.
Comment: That'd require you to hover over every single pixel in every single layer in the document to get the colors. The OP even says *"without having to dig through every layer using the colour picker tool"*
Comment: @slhck true, i edited the answer
Comment: The online tool allows JPG and PNG up to 250 kB, so no PSDs unfortunately.
Comment: @slhck i think kuler is the best tool, it's made by adobe, if that's can't import psds, i think nothing can, because if adobe didn't do it, no one will, i might be wrong though
Comment: Thanks for your answers. I am just sure i read an article recently about a website someone created that lets you upload psds but cant remember where. Maymbe smashing magazine, codrops or some third site. Annoying

Determine colours used in psd file


Statistical Test for a Poisson Distribution

Question: I've done an experiment where I have several stochastic data which probably comes from a Poisson distribution (according to my peers). I have to test this, but I'm not sure which test to use or exactly how, in my statistics class I've only seen the type of tests that are used for the mean or standard deviation. Please help!
Also, side question, if the data where to have a Poisson distribution, would it be the same to acquire data continuously and then separate it into several parts to do statistics and acquire data by measuring, stopping, and then measuring again?
Answer: HINT
Do the Kolmogorov-Smirnov test.


How to effectively evaluate a model with highly imbalanced and limited dataset

Question: Most data imbalance questions on this stack have been asking How to learn a better model, but I tend to think one other problem is How do we define "better" (i.e. fairly evaluate the learned model) to ensure the evaluation performance on the limited test set does not suffer from high variance, since many of the imbalance classes also have limited number of samples.  I'll summarize my current understanding below.  First let's suppose we have 1000 samples, among which only 10 have positive labels.  Our task is binary classification.
One common practice is to do cross-validation.  In a typical cross-validation setting, one split the data to remaining-holdout first, and then conduct cross-validation on the remaining set to train-val folds for hyperparameter tuning.  Evaluation of the model is performed on the test set, by either using one of the trained fold models, ensemble of all folds, or re-trained model on the full remaining set.  However, the test set is still comprised of only two positive samples, which might very likely suffer from variance in the split.
Built upon such intuition, one natural thought is to do three-way cross-validation, which splits each fold to train-val-test sets.  The test performance would be the average of all test performances across folds.  However, it really confuses me because we are not even using one single model for evaluation, and it cannot really tell us how the one selected model would behave in the real world.
I understand that we have the assumption that test distribution should be the same as the general.  But two test positive samples are not able to capture a distribution.  In such scenario, what should we do?
Answer: I think that one way is using a out of bootstrap validation several times in order to estimate the distribution of your interest metric.
Comment: Thanks for sharing your insights.  Out-of-bootstrap validation certainly makes sense.  For now, this seems to be the most stable/fair validation setting I know of.


Hibernate Search vs Custom Search

Question: i have a page to search for users with some criterias (id,name,email,department,job)
and right now i am using Hibernate Criteria Queries for my search, and it works very fine.
i was wondering about the advantages of hibernate search with lucene queries that will make me use it, instead of using my current custom search.
Answer: For your situation I believe Criteria API is sufficient. Your Criteria API searches can perform good if repeatable are cached and if you perform them over indexed data.
This might be enough if you are having queries of the type:

Give me all the users of the "FooBar" department.

or

Give me all the users of the "FooBar" department with job "FooBarIst"

However, if you are operating over large sets of non indexed data, you might notice performance drop. For example, if your "name" attribute is not cached, you will notice that a query of the type:

Give me all the users with the name LIKE "Harr*"
  which should give you users by the name

<code>Harrold
Harrison
Harring
Harrelson
</code>
will perform very poorly.
My point is this query will be slow if you haven't indexed the "name" attribute in your database engine. So, if you plan to use such queries, it is already a good idea to start thinking of a full text search solution, which Hibernate Search/Lucene/Solr are.
They will give you a lot better performance when searching for email, or some other attrbiute and you are trying to make an auto-complete function, for example.
So, my recommendation to you is the following:
Depending on the scenarios involved, choose whether to use only Criteria API or Criteria API + Hibernate Search/Lucene. Using only Criteria API is fine as long as you know what its limitations are.
Here a common query for the first scenario (where Criteria API is sufficient and Hibernate Search + Lucene is a bit of an overkill):

All users in the FooBarDepartment

Here is a common query for the second scenario (where Criteria API can do it, but Hibernate Search + Lucene will be a better choice):

All users that have an email that starts with the letter "f"
  What about all users that have an email that starts with the letters "fOo" ?

The above query can be done, of course, with plain Criteria API, but if you have millions of users, when making such queries, you will start noticing a significant performance gain in the Hibernate Search/Lucene approach as compared to the plain Criteria approach.
So, in conclusion, whether you use plain Criteria or Criteria + Hibernte Search + Lucene is up to you and depends on the requirements, design and data.
Answer: Yes as baba suggested as well you get better performance, but above all it provides a huge boost of functionality and better user experience.
The order of returned matches will be (optionally) by relevance, and can deal with user typos, autosuggestions and do some smart processing of text (like word similarity) of the searched terms.
You can provide "google like" one field input texts which intelligently match different fields or even entity types; implementing such a feature with Criteria or SQL is a madness of complexity and won't get you as good results.
The best part of integrating your own custom engine based on Lucene is that you can customize pretty much everything for the specific needs of your application, declaratively; for example you define your domain specificy synonyms, and how acronyms are understood by your application.
On top of the generated indexes, it be comes a breeze to perform data mining, document similarity search, etc.. for example you can build tag clouds without needing your users to actually tag stuff by hand: you already have vectors of frequencies for all terms of your database.
An example? the column on the right on this very same website is showing "Related" questions. I don't know if they used Hibernate Search for that, but that's the kind of features it helps to implement.

Hibernate Search vs Custom Search


When installing a garbage disposal what kind of PVC pipe connects directly to the disposal?

Question: The PVC pipe connection from the garbage disposal is leaking. I have hand tightened the washer on the PVC and then did a 1/4 turn wrench tighten. Still leaking.  It looks like the PVC has a little lip on the end and butts up to the disposal outlet instead of fitting inside the opening.  What kind of connection should it have?
Answer: The common disposal unit drain pipe connection looks like the following picture:

There may be some variation in the design of the tail pipe assemblies from manufacturer to manufacturer but the ones for the above type connection generally follow the form shown here:

These tail pipe pieces are generally supplied with the disposer. It is possible to purchase manufacturer specific tail pipes at appliance parts outlet stores and from online sites. It may also be possible to purchase a generic replacement at some hardware and big box home stores. If you purchase a new one make sure to include a new rubber gasket.
It has been my experience that a common cause of leaks at the disposer outlet is the corrosion of the body housing of the unit around the drain hole. In the cases I have dealt with it was time to replace the disposer unit with a new one. One thing to check is if the lower part of the disposer housing is wet or showing signs of rust and corrosion separate from the drain pipe attachment. If so this is often an indication of the sealed bearing inside the disposer starting to leak and is another reason for replacement. On disposers that I have replaced I have noticed leaks from both the bearing and the drain pipe area.
Comment: Excellent answer, I would add that the washer is a special one specifically for disposers. It has an internal slot to slide over the flange on the tailpiece, and a shoulder that mates with the disposer outlet.
Comment: @JimmyFix-it - Indeed. The rubber gasket is designed to capture the end of the tail piece and then expand into the inside of the opening on the disposer housing as the bolt on metal bracket compresses the gasket into place. This type of connection allows for a very flexible joint that isolates vibration in the disposer from the rest of the drain pipes. Although it must be said that if there is a lot of disposer vibration whilst it is running it may very well due to a bad bearing brought on by a leaking bearing seal. Again time for a replacement.


exe file not opening after patching

Question: I hope everyone is well. I'm new here and I'm hope someone can help me with the problem I'm facing.
I've been trying to reverse engineer a program but everytime I change an instruction, not matter how small it is, I always get the same result which is after I patch the file it simply wont open and it looks like it saved properly and everything is fine but it just doesn't open. I suspect it's probably an Anti-debug feature because other program I've dealt with in the past don't give me this issue. I've the basic solutions provided on the internet but nothing works. I'm use x64dbg and if I try to run the file in the debugger I get a "A debbuger has been found running in your system. please unload it from memory and restart your program."
Any information would greatly appreciated. Thank you in advance.
Comment: It might have a checksum to prevent any modifications or it could be digitally signed and checking it's own signature
Comment: I've been trying to find the checksum but with no luck can you please advise me on how I would go about identifying it. Thank you for your response.
Answer:
after I patch the file it simply wont open

do your best and forget the rest

it looks like it saved properly and everything is fine but it just
doesn't open.

did you figure that out just by looking into the matrix, Neo?
Before debugging, hide the debugger using this option:
Comment: I've tried to hide the Debugger but I still get the same result.

exe file not opening after patching


2017 Macbook pro 13 inch 3 monitors help

Question: I have done quite a bit of searching and haven't found a solution to my issue. I have a 2017 macbook pro 13 inch with touchbar. I want to be able to use 3 monitors 1080p via apple usb c digital av hub so usb to hdmi for all 3 monitors plugged each into their own port. I can only get two to work including in clamshell mode. Is there a way to get this to work while using laptop as intended or would I have to use bootcamp or something? Thanks
Answer: The 13" 2017 MacBook Pro only supports up to two external monitors:

Video Support
Simultaneously supports full native resolution on the built-in display
  at millions of colors and:

One display with 5120-by-2880 resolution at 60Hz at over a billion colors
Up to two displays with 4096-by-2304 resolution at 60Hz at millions of colors
Up to two displays with 3840-by-2160 resolution at 60Hz at over a billion colors

If you want to get a third display going, you will need a USB to DVI/HDMI/VGA adapter.
Comment: Great thanks! I will give that a shot. I do have a usb to vga that I tried but the only thing that happened was it was showing as a removable disk and inside was a .exe file which obviously would not work. I'm assuming that it was only for PC as I wasn't able to find any drivers online.
Answer: There are two options that I am aware of to get three displays working on a Macbook Pro 2017 13 inch with 4 USB-C connectors (supports two external screens natively plus the internal screen).
option 1 - Use displaylink technology to connect three screens - I haven't tested this today but it looks like a valid solution, a DELL D6000 looks like it would work.
option 2 - buy a BENQ screen with displayport out example PD2700U. The BENQ manual says you need to have a second BENQ screen to daisychain to a second screen but I have this working using a usb-c to (not mini) displayport to the BENQ monitor displayport, then a daisy chain using the displayport out port to a second monitor, which in my case is a Philips PHL 276E8V. The third monitor is plugged into a mac USB-C port.

BENQ PD2700U - 3840 x 2160 30 Hz (plugged into Mac USB-C to BENQ displayport
Philips 276E8V - 3840 x 2160 30 Hz (Daisy chained to BENQ using DP to DP)
Philips 276E8V - 3840 x 2160 60 Hz (Plugged into Mac USB-C to HDMI input)

Does the job nicely.


where does the expression "not to worry" come from?

Question: I never heard the expression "not to worry" when I was young (I am 78 yrs old).  Now i seem to hear it all the time.  It sounds like a literal translation from some language where the infinitive is preceded by a negative.  Can you tell me if that is the case, and if so, which language it could be?  For example, in Italian one says non preoccuparti.  Which means do not worry (yourself).  so i guess it doesn't come from Italian...  Does anyone know where it does come from??
thanks
Penelope
Comment: @JustinGreer The answers in your linked question simply affirm that the phrase is common and accepted, which the OP does not seem to dispute, but say nothing about its origin or rise in popularity.
Comment: Possible duplicate of: http://english.stackexchange.com/questions/112373/not-to-worry-unknown-grammar-category.
Comment: Isn't it just a shortened form of a common construction? eg 'She said not to wait for her, she'd follow on later' or 'He said not to drive the car until he'd fixed the brakes'.
Comment: Could it have Eastern European roots? I always associate the phrase with an anecdote I heard in my youth. A Czech art historian teaching at an American university was in the unfinished attic of his rooming house, catching live flies for his little boy's chameleon, and accidentally stepped between joists so that his legs burst through and dangled from his landlady's bedroom ceiling. She was in bed and screamed, but he called down to her, "Not to worry! It is only Mojmir from downstairs!"
Comment: I think that German, for example, uses a verb's infinitive as an imperative: e.g. "Nicht Rauchen" ("not to smoke", whereas English would say "no smoking" or "don't smoke").
Answer: For what it's worth: OED (subscription on-line version) s.v. "not":

(c) colloq. not to ——: do not ——.
Webster's Dict. Eng. Usage (1989) 670–1 noted the uncommonness of the phrase not to worry in American English, and its disapproval by some commentators, but U.S. examples are not uncommon from the later 1980s onwards.
  In early use preceded by please.
  1790   T. Holcroft German Hotel ii. 17   Rum. So early! Will. In less than an hour; make haste. Rum. Please not to be in a hurry.
  1872   'G. Eliot' Middlemarch II. iv. xxxvii. 258   And he objects to a secretary: please not to mention that again.
  1958   Daily Mail 24 July 6/5   Not to worry. By the time he . . . had finished with me . . . I'd be doing long division.
  1965   L. Meynell Double Fault i. iii. 31   'We'll send it for you.' 'Not to bother. I'm going down to the country this evening.'
  1995   G. Drabinsky Closer to Sun xviii. 363   Vineberg said, 'Not to worry. It's a lead-pipe cinch.'
Answer: English is a Germanic language, and as such has many similarities with German and the Norse languages (Swedish, Norwegian and Danish mainly.) Some similarities may have disappeared over time, as English has spread across the globe and become influenced by totally different languages, and some may have appeared more recently. This specific expression sounds very much like the Swedish (my native language) expression "Ingen fara" or "Inget att oroa sig för". These are the exact same type of negation, however they are shortened forms of "Det är ingen fara" and "Det är ingenting att oroa sig för" respectively. Reasonable translations wold be "You needn't worry" or "There is nothing to worry about" respectively.
Answer: Eric Partridge, A Dictionary of Slang and Unconventional English, fifth edition (1961) has this entry for the expression:

not to worry! Don't worry; there's nothing to worry about: Services'; C. 20. Suddenly, in 1957–8, it began to be generally and widely used. The Services base it upon a Maltese analogy; Italian scholars (and others) on, e.g., Italian non tormentarsi; I suggest that it merely truncates 'You are not to worry' —You mustn't worry, or There's nothing to worry you.

The eighth edition of A Dictionary of Slang and Unconventional English (1984) offers this somewhat revised entry:

not to worry! Don't worry; there's nothing to worry about: Services' > gen[eral] coll[oquial]: since (?) ca. 1935. Prob. merely a truncated version of 'You are not to worry'—in spite of a number of other, more elab[orate] explanations; see esp. [Eric Partridge, A Dictionary of Catch Phrases, 1977]. In the decade around 1960 it was often qualified by unduly, as not to worry unduly, old boy!

Robert Chapman & Barbara Kipfer, Dictionary of American Slang, third edition (1995) indicates that as of that date the expression was still primarily British:

not to worry sentence by 1958 There is nothing to worry about | Still chiefly British: Not to worry: I brought plenty of food for everybody

The fourth edition of Dictionary of American Slang (2007), however, drops that characterization:

not to worry sentence There is nothing to worry about : Not to worry: I brought plenty of food for everybody (1958+)

And Christine Ammer, The American Heritage Dictionary of Idioms, second edition (2013) addresses the expression as part of a longer entry on "no problem":

no problem. Also, no sweat; not to worry. There's no difficulty about this, don't concern yourself. ... The third [of these colloquial terms, namely, "not to worry"], originating in Britain in the 1930s and using not to in the sense of "don't," crossed the Atlantic in the 1970s.

It seems, then, that "not to worry" as a standalone or complete-sentence expression emerged in British English by the middle 1930s, enjoyed a major upsurge in popular usage in the UK in 1957–1958, and caught on in Canada and the United States during the 1970s.
Answer: HERE it is claimed that "Not to worry" is from Yiddish "Nit gedeiget".
Answer: I have always heard this phrase referred to as an Irish expression. Mostly I have heard this phrase spoken - by family, friends and business associates. Sometimes I have read it. So I cannot offer any etymological references - just anecdotal. Being Irish-American, and somewhat familiar with the Irish temperament, this expression is a suitable patch in the soft and brilliant quilt of their culture.


What does Restorative Mist do?

Question: Restorative Mist is, apparently, the MEC version of a medkit. How does it compare to medkits, though? How many uses do you get? What's the radius? How many hitpoints are healed per use?
Comment: At the level at which you first get it, you get one use per mission and it has a radius of three squares. Can't answer the rest because my MEC was killed by a Mectoid before she got a chance to use it!
Answer: It is the same health restoration as using a medkit (4 or 6 depending on Foundry project), but it applies to every soldier in it's 3 tile range (including the MEC that uses the skill).  You cannot use it to revive/stabilize soldiers who are bleeding out.
When you first get it you may use it once per mission, if you pick up Expanded Storage as your Captain promotion you get an additional use.
Here is a screenshot of Restorative Mist in action.
It's a little hard to see the grid, but the lone soldier at the top of the stack on the left is 3 squares away in a straight line from the MEC using Mist.
Comment: Does it benefit from the Improved Medkit foundry improvement?
Comment: I would assume so, but I'll let you know when my MEC gets out of the infirmary.
Comment: How does the 3-tile range work on the 2d grid?
Comment: @kotekzot it's a circle that has a diameter of 3 tiles if aligned with the grid. Before you activate the ability you can see which characters it will and will not affect, as with grenades etc.
Comment: I understand how the game handles radii, I'm asking what tiles around the users this particular ability will affect.
Comment: @Flyto With Improved Medikit, it heals 6 hp per soldier.  I haven't ever used it without IM, but I'd have to guess that it'd be 4.

What does Restorative Mist do?


Do I save time using the h, j, k, l keys?

Question: I've tried using the h, j, k and l keys for a while in Vim, but did not get used to it and fell back to using the arrow keys. My question is: from your experience, is it worth switching to these keys? Did you achieve faster typing/navigating?
Comment: profile, profile, profile! I use both, but after ten years I find myself using hjkl more often than I used to do. Still eclectically use the cursor keys. Heck, I sometimes even use a mouse!
Comment: @sehe, to be fair, this is kind of hard to profile. To change something as basic as your cursor movement keys takes time and training, you won't fully appreciate the difference until you sink a noticeable amount of effort into it. Asking the community about their experience seems OK to me (if off-topic for this particular site).
Comment: @Blindy: no one can answer that. It's easy to profile: `:nnoremap  ` etc. If that is not accurate, it is way more relevant than anyone else's word for it
Answer: When I first used Vim, it seemed very difficult to stick to hjkl after years of maintining a habit of navigating with arrow keys.
Then I learned actual touch typing.
After that, not only did hjkl feel more natural than the arrow keys. Everything computer-related became faster. It's really worth the investment timewise (I'm assuming you're not a touch typer, otherwise you wouldn't have asked this question).
By the way, Vim is incredibly useful when learning to touch type. Just keep a keyboard diagram closer to the screen than to the actual keyboard when learning, ideally a keybord diagram with vim usage on it.
Comment: "I'm assuming you're not a touch typer, otherwise you wouldn't have asked this question" that sort of sums it up, it seems like such an obvious thing to me
Comment: You might not want to link to a page showing that your right hand should be on jkl; when touch typing if you're arguing that hjkl doesn't require you to move your hands.
Answer: IMHO, no, it's not worth the trouble.  I've tried it, and I couldn't get used to it either.
The whole point of those using those keys was that most keyboards, at the time of Vi's creation, did not have arrow keys.  I've yet to run across a modern keyboard without those keys.
I could be wrong.
Comment: yep you're mostly wrong. The whole point nowadays is that you shouldn't have to move your hands away from base position - that speeds up (touch) typing and reduces mis hits. Of course, it depends on your typing style/dexterity etc. The historical reason _is true_ but nobody is arguing that you should use ``1 for `F1` (erm... except sometimes on AIX consoles :))
Answer: I like it. Having discovered visual mode used with f/F and t/T could cut and replace so quickly, easy access to ; became necessary. And you can go straight to . with the 3rd finger too.
Comment: True! I just realized that I definitely started using the hjkl keys more often initially for (a) scrolling (U and D as well, also in pagers) (b) visual mode and (c) wincmd's (`^WH`, `^WJ`, `^WK`, `^WL`); only since then have they begun to come natural to me


Copy-paste to title from Linux

Question: Forced to use Linux more often now (thanks to llvm), I noticed that usual way of pasting there doesn't play well with gray text areas, such as 'Title' input box. Pasting by clicking middle button does not trigger deletion of gray text and what's pasted becomes part of it. Title is also considered empty, even if you delete all the gray text yourself.
Comment: The same is true if you use the mouse on Windows (the usual "right-click -> Paste" way). The deletion is triggered by key events only.
Answer: This has been resolved and will be in the next deployment - thanks for the feedback.
In addition to the keydown event, we are now binding
<code>bind("contextmenu", clearOverlay)
</code>

Copy-paste to title from Linux


posting scripts for the community

Question: I have a powershell script that is useful for interfacing VSO builds/releases with jenkins.  Is this something I can contribute to the community via a wiki or should I post this elsewhere?
Answer: If you really want to, you can expose the problem as a question and post your script as a self answer.
It's usually quite hard to write a good question once you have a solution for it, try to think as if you had asked it before writing the script to keep it open enough for someone else to add another answer tackling the same problem.
Quoting the help center about self answer:

If you have a question that you already know the answer to, and you
  would like to document that knowledge in public so that others
  (including yourself) can find it later, it's perfectly okay to ask and
  answer your own question on a Stack Exchange site.

So it's absolutely the way to go if you want to share your script. There's no reason to make the post community wiki for this kind of cases.
Comment: okay I'll do this then.  I just didn't know if we wanted to set a precedent of how the community can share scripts that would solve common problems

posting scripts for the community


Can we ask questions related to Programming?

Question: Can we ask questions about programming questions on Pytorch, TensorFlow, or any deep learning frameworks??
Answer: No.
General programming issues are off-topic here. For example, if you have an exception/bug/error in your source code or you don't know how to use a certain library/API, then that's off-topic. If you have this type of question, the most appropriate site is probably Stack Overflow (or Data Science SE).
However, if you want to understand how a certain concept/algorithm/model is implemented, then you can ask questions about that because that's more a conceptual question. Here is an example of such a question. (But, please, try to ask a specific and clear question that explains what you don't really understand, so that to facilitate the answerer's life).
Our on-topic page actually states these things explicitly, so I suggest that you read or at least skim through our on-topic page again.
Answer: I'm personally in favor of this, but the overall consensus is that we should focus on theory, as opposed to implementation.
(We haven't historically had good response to programming or implementation questions, so the argument for leaving those to overflow and other stacks is strong.)


Windows Phone Profiling and high memory

Question: I'm currently creating a Windows Phone app and I'm having issues limiting the amount of memory being used. I'm using the built-in tools for Windows Phone profiling.
The app does the following at the same time:
* An API call on the background (parse the result using the Newtonsoft JSON.NET library)
* Calculate the objects to be displayed and when the calculation is completed, bind it.
The problem is, the amount of memory is really high. It uses average about 80-90 MB with peeks over 90 MB (this app has to be in the store).
An App execution analysis shows the following notes: both a high memory usage by system threads and managed threads. It also says the memory is "Texture dominant".
So I did a memory analysis.
Album of profiling
The profiler notes a "high amount of texture allocations in the memory". Most of the time this is about 50%.
Question about this: are textures also custom user controls? I remember reading something that every user control is being saved as bitmap in memory
When I take a look at the Heap Summary, it shows a couple of high values.
How should I interpret this data? How should the numbers be compared to eachother?
Taking a look at the Types, String uses 13%. Does this mean String is using the most memory?
Does this mean Strings are using the most memory or not? Or am I looking at the wrong place where the most memory is being used? Should I look at, for example, the "Retained Visuals at the Start" in the Heap summary?
If I look there, some of the values are being caused by my own written user controls.
I'm using a Listbox (because it supports UI Virtualization), but I'm using my own controls as the ListboxItem. Should I replace them with a Listboxitem?
I can't find a clear tutorial on how to use profiling tools :-( And personally I find it hard to understand (for example, if you compare it to the Android profiling tools).
TL;DR: Help understanding profiling tools and trying to find what is using so much memory
Thanks in advance!
Answer: Do you have too many images in your app? most of the time high memory is caused by not properly adapted images or bad practices.
Comment: Thanks for answering!
There are no images used. I removed them to find out if that was the reason of the high memory usage.

Windows Phone Profiling and high memory