C++ Units Conversion Library

Question: I am looking for a library that can handle unit conversions. I came across boost::units and unitscpp, however they only seem to cover simple units -- like length and mass. And they also do not seem to have much support in the way of decimal prefixes -- milli (m), giga (G), etc. I am looking for something more comprehensive, like the Python library Pint, that has the extensive units list, decimal prefixes and easy parsing of strings containing the value and the units to some usable object.
Comment: I think you might get better answers on StackOverflow since this forum is more for software recommendations than for programming library recommendations.  It's a very fine line since what you are seeking is technically software!  OTOH, since Gilles has already provided an answer, perhaps this is a good place too!   :)
Comment: I was going to post on SO, however I feared that this topic would be flagged as off topic because it is pretty subjective, and not really about fixing a coding problem.
Comment: I'm glad you decided to post it here, because you got the answer you needed!  Overly aggressive 'off-topic' flagging is one of the problems with many StackExchange sites.  As you discovered, even when a question may be slightly more 'on-topic' on one site, you will often receive better answers on another site.
Answer: The Units program (now a GNU project) does just that, as a standalone program. It can do units conversion and simple arithmetic and understands SI prefixes (e.g. you can ask it how much 42 inches + 3 meters is in mli). The set of units and prefixes is defined via a simple text file read at runtime, which is convenient if you need to fine-tune it (e.g. to update currencies based on the current rates). It's portable C and should work just about anywhere.
You can call units as a standalone program and retrieve its output via popen and read with via Boost.Process. Pass the -t option, the original value and the target unit (omit that if you want to convert to the standard unit). This has a significant overhead; if you're going to do a lot of conversions, launch one instance of units, pass it conversion requests on its standard input, and read back the result from its standard output.
While the program doesn't come with a librar, you can tweak the code a little and link it into your program. Omit the main function, change the printf calls into sprintf, and call processunit, showdefinition and showanswer directly. That's a bit of maintenance work, but the code doesn't change often, and if you're lucky the upstream author will accept your patches to build a separate library. Do note that the code is licensed under the GNU GPL, so if you link it directly into your program, your code will have to be licensed under the GNU GPL as well (if you call units as an external program, there is no license constraint).
Comment: Thanks, this looks like exactly what I am looking for. It is just going to take a bit of work to work it into my existing code and add the ability to do unit comparison.
Comment: @einpoklum I will put a reminder in my calendar for this week to look at what I ended up developing and make a github repository (and post the link here) should it be something that others can use.
Comment: @AeroBuffalo: If you've made that into a usable library rather than just something which calls the binary, consider publishing the source and linking from here.
Answer: If all else fails you can always embed python and Pint into your C/C++ program and use them from within the C/C++ code.  If you do this you will have access to python and it's libraries from anywhere in your code.
See https://docs.python.org/2/extending/embedding.html for details.
Comment: I thought about doing that, given how well Pint performs and how capable it is. However, I am not the biggest fan of Python, and we are trying to minimize the necessary number of languages used in the project.
Comment: Then you could always port pint into C/C++ there are some tools that can help with that like Cython were you may be able to automate the generation of C from the pint source so as to be able to follow bugfixes/upgrades in pint.
Comment: Oh, I never knew that was possible. I'll definitely look into that, thanks.
Answer: I'm just looking for the same kind of units-conversion library as you, but I also have the additional requirement that the license cannot be copyleft. After some search, I found UDUNITS, which isn't copyleft and moreover even has an API to use it as a library. I also found that the original units program wasn't copylefted before the GNU Units implementation. The original version can still be found if you search, but however, I find the UDUNITS library very interesting and I feel it's just what I'm looking for.
Also of interest: The FreeBSD implementation of the units program. Reading at the commits comments in the source repository, it seems they try to get close to the GNU units behavior, while not being copylefted. You can browse the repository (the link points to the r11 FreeBSD release).

C++ Units Conversion Library


Override default content type

Question: I am trying to make it so that my users are forced to choose a document type, not given a default. I have made it such that the "new item" button has the functionality, but this doesn't account for those who drag and drop. The drag and drop items are given the default content type. Is there any way to make the user select a content type, that way they don't accidentally leave it as the default?
Answer: There's really no simple solution for this one.
If you are fine with defining the content type based on e.g. file extension, you could add an event receiver which determines the content type for the uploaded item.
Other than that, drag and drop is pretty limited. It's purpose could be described as

Drag and Drop is for only uploading the files into the documents library with minimal effort. It cannot help you to add meta data to the documents while doing so. You should be editing each file to add meta data to the document separately. Default content type will be applied while drag and drop.

Source: Drag and Drop document in a library with multiple content types associated
If drag and drop is mainly causing your problems, you could disable the whole function. There's an existing solution for disabling drag and drop here: How can I disable the Document Library drag and drop function?

Override default content type


Joomla media extra field without Alt tag

Question: I've created an additional media field to include in some articles, and I noticed that the ALT and Title attribute for the media field can not be set to the image.
I need suggestions for an override or how to implement these tags.
Answer: First, you'll need to create a separate field for the alt tag.  Make a note of this and the image field's ID.
You then need to override the article layout.  To do this, copy components\com_content\views\article\tmpl\default.php to templates\yourtemplate\html\com_content\article\default.php (where 'yourtemplate' is the name of the template you are using).
Where you want the image to appear, you should then add some code along the lines of:
echo JHTML::_('image', $this->item->jcfields[1]->rawvalue,$this->item->jcfields[2]->rawvalue, ["title"=>$this->item->jcfields[2]->rawvalue]);

This code assumes that your image field has an ID of 1, and your alt and title field has an ID of 2.  Just swap these numbers if not.
If this doesn't work, try adding
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');

above the code, though I think this helper should already be called on the article view.
Additional validation code may be required if it is not a required field, but the above should be the basics.
Comment: Hi Richard, your solution is very interesting, but I thought of a modification of the media.php file of the media fields plugin, especially on line 34: "  $buffer .= ''; "


Observing sensations during normal time.

Question: I observe very strong sensations even post meditation. They are strong at some time and some time subtle. I am alternating between apanana and vipasana. I would like to understand why they are so strong at times.
Answer: The experiences are based on the sum total of your past fabrications and what has surfaced in a given time.
In the different times the fabrications that has surfaced are different hence the diversity of the experience.
Dwelling on matters like this will inevitably make you crave or be averse to some types of sensation hence regress in your pratice. You should just be aware regardless of if it is strong or not.
Having said this some times the strong sensations can be due to rapture.
Answer: Vipassana meditation, if practiced correctly and consistently, will reveal the true nature of reality for the meditator.
What you are describing and have seen through your practice, is the impermanence of conditioned phenomena. The characteristic of impermanence is one of the Three Marks of Existence.
Bhikkhu Bodhi gives the example of a waterfall that from a distance looks solid but when taking a closer look one can see the flow constantly changing.
Vipassana meditation is when one is taking a closer look at reality, which reveals e.g. that sensations do not have a fixed intensity, but instead they change constantly - sometimes they are strong, sometimes subtle.
That is the nature of condition phenomena. They are not constant. They are subject to alteration, change and decay. They are dynamic processes and not stable entities.


What's the difference between "rapid" and non-rapid Feisol tripods?

Question: Currently, I've set my eyes on the Feisol 3442 tripod. But can someone tell me what the difference between the rapid and non-rapid is? The price difference of the two where I live is $100, and I want to know for sure whether I need that feature or not.
Comment: You can still order the non-rapid ones from Feisol.
Answer: The Rapid series has redesigned locks and non-rotating leg segments, which make them faster to set up, tear down and adjust. If you can lay your hands on one of the "classics", you won't be at all disappointed, but they've been discontinued (which probably explains the much lower price).


Can I log this as total time?

Question: I am a CFII who has a commercial multi-engine certificate. My friend was building time in a BE-58 Baron (multi-engine) for his MEI. He asked me to tag along (right seat)since he was going to file IFR and fly in some IMC.
Since he is logging the PIC, and all I did was tune in the freqs and programmed the avionics, can I log this as total time?
Also since we flew in IMC can I log the "Actual Inst" time?
Answer: The regulations regarding the logging of time are specified in FAR Part 61.51 (Pilot Logbooks):

(a) Training time and aeronautical experience. Each person must document and record the following time in a manner acceptable to the Administrator:
(1) Training and aeronautical experience used to meet the requirements for a certificate, rating, or flight review of this part.
(2) The aeronautical experience required for meeting the recent flight experience requirements of this part.

Time other than (1) and (2) above does not need to be logged as it can't be used other than as specified in (1) and (2) above.
That being said, you can put/log what ever you want in your logbook in order to record the flight for historical purposes.  But as for "Total Time" to satisfy the requirements for a certificate, rating, or flight review OR the aeronautical experience required for meeting the recent flight experience requirements of Part 61, the time you are with your friend (as a tag along, and not giving instruction) cannot be used for any purpose specified under 61.51.
Further, since you are not performing the duties of a safety pilot, a required crew member or in any required capacity as a pilot, you can't, for the purposes of meeting any requirements/conditions specified under FAR 61.51, log and receive benefit of the time as "Actual Instrument" time.

Can I log this as total time?


Does Ripple allow one to issue their own currency?

Question: Does Ripple allow one to issue their own currency, similar to how ripples (XRP) were created at the system's inception?
Answer: Currently, only three-letter currencies that exist as IOUs can be created as a custom currency. And if someone else uses that same three-letter identifier for something else, each account can only transact in one of those conflicting currencies. So you could use "XBR" to mean people owe each other beers and you could use the ripple system to track how many beers you owe people or they owe you. You could accept payment in beers.
There are plans to introduce more customized currencies. There are some things you can't do without some specialization. For example, charging a storage fee as some gold storage agents would like to do. This is still in the design stages.
You can, of course, create IOUs denominated in any currency, subject only the what other people are willing to take. But if you want to create two accounts and have one owe the other $1,000,000, you can.
Comment: That's kind of a big limitation.
Comment: @David: If you mean in the system, when one account extends trust to another, a node is created in the ledger for the triple of the two accounts and the currency. When we say "Jeff holds $50 in Jack IOUs", what happens in the system is the "Jeff/Jack/USD" node holds a balance of $50 in favor of Jeff. If you mean in the client, I don't think it does a good job yet of letting you easily work with IOUs from multiple issuers in the same currency. There's still a lot of "inherent complexity" that the client hides.
Comment: So long they both represent the same currency, there's no problem. The problem would be if someone else used `EUR` to represent grams of europium. ;) The issue is that all `EUR` IOUs that you personally issue are indistinguishable and you'd have no good way to handle the changing exchange rates between the two different metrics.
Comment: @David: If you can be more specific about what you see as a limitation and why, that might have an affect on the implementation schedule. One of the things holding up custom currencies is that lack of good use cases. (Currently, demurrage is about the only use case.)
Comment: I'd say the currency code should reflect who issued the IOU, because otherwise it's going to be confusing to have EUR in your account and have to open a second account to deal with EUR IOUs issued by a different gateway. Did I misunderstand something ?
Comment: I guess that would require a separate question, but how do you distinguish IOUs denominated in the same currency but issued by different gateways ?
Comment: By the issuing account public key/address


How do we choose a frequency range of interest for flutter prediction?

Question: I'm trying to perform some flutter and dynamical (gust etc.) calculations with Nastran. It has been told to use a range up to 30 Hz for an aircraft I'm working with, but why the upper limit is so choosen 30 Hz? Why for some aircraft the range is up 60 Hz and for another one even up to 100 Hz? I suppose it depends on matirials used in a particular structure and/or a frequency range of presumed loads. I would be grateful if someone can explain how the frequency range of interest is exactly chosen. Thanks!
Answer: You might want to try reviewing MIL-A-8870C  AIRPLANE STRENGTH AND RIGIDITY
VIBRATION, FLUTTER, AND DIVERGENCE.  The CRJs were certified to this standard.  Available here: http://everyspec.com/MIL-SPECS/MIL-SPECS-MIL-A/MIL-A-8870C_6746/  Just click the Download File button.
Comment: Yes MIL-SPEC, MIL-PERF and Standards are used across the industry for all sorts of things in the civilian world of aerospace, because traditionally there was always a lot of overlap.  Why reinvent the wheel?  The old AN standard for aircraft hardware stands for Army/Navy. In the case of MIL-A-8870C, a manufacturer may choose to develop their own analysis for flutter margins, but they can also just use 8870 if they want.
Comment: One interesting change in the aerospace industry was a gradual switch from MIL-SPEC to MIL-PERF.  MIL-SPEC components are built to a specific physical specification.  Under MIL-PERF, a component only has to meet a performance standard.  This allows commercial non-aerospace components to be used as long as they meet the PERF standard in performance.  Example: around the turn of the century microprocessor makers stopped producing processors made to the old MIL-SPEC.  Manufacturers started to use commercial components, allowable as long as they met MIL-PERF requirements.
Comment: Why would civilian aircraft be certified to military standards?
Comment: Ah, I always imagined MIL SPEC to be very different requirements (i.e. more or less stringent) than the commercial ones.


Semantics of Regex with boundary matchers

Question: The regex /^(abc)$/ matches abc but why not abcdabc, abcdabc also begins with abc and ends with abc.
I am not sure about the semantics of this regex. Any explanation is welcome.
Comment: Your question isn't very clear. `^` matches the start and `$` the end of the string, so it can only match whole strings.
Comment: Yes `^` matched beginning and `$` matches end so from that perspective `/^(abc)$/` should contain `abcdabc` because `abc` is prefix and suffix both, but it only matches `abc`. Why?
Comment: Using that argument `xy` should match `xSy`, because `x` matches `xSy` and `y` matches `xSy`. That's not how regular expressions work; you need to match the whole thing at once.
Comment: but `/xy/` will match any substring xy because there is no modifier like $, ^, {n} etc
Comment: but my question is does `/^abc$/` mean starting with abc and ending with abc and only containing abc, or just starting with abc and ending with abc
Answer: First of all, what we usually call Regex, for instance, in the context of programming languages, is not the same as pure regular expressions. That should not come as a surprise: all computational models have to be adapted to the real world to be made useful. In this case, besides being enriched by features that just enlarge the range of languages it can specify (such as numbered back references), Regex has other features that would require a completely different set of tools to be formalized properly.
What comes after ^ will not be matched to a prefix of the input string. What happens is that ^ is a reference to an event (as is $, they are called anchors). In abstract terms, you can think of the input of a Regex as continuous stream of symbols, unbounded, that is divided in units of limited size, separated from each other by a special symbol. Where should the matching process begin? This is where anchors come to the rescue.
In this context, ^ refers to the event of finding the special symbol, and forcing the Regex to match beginning with whatever comes right after, instead of $\unicode{x2013}$ for instance $\unicode{x2013}$ continuously trying to match a string starting with each symbol from the input, and backtracking to the next, in case of failure.
What the actual input unit is, pragmatically, depends on the context of application of the formalism. Usually we are talking about lines in a text file, separated by line break characters, or the successive contents of an input buffer.


What's the difference between Unit and Nothing?

Question: Both types Unit and Nothing indicate a function that does not return anything. What's the difference between them?
Answer: Unit is a type that has exactly one value ‒ see Unit type. On the other hand, Nothing has no possible value - see Bottom type.
A function that doesn't return anything must have the return type Unit. If it were Nothing then the function could not return a result. The only way to exit the function would be by an exception.

Nothing is used in a different way. It is characterized by two properties:

Nothing is a subtype of every other type (including Null).
There exist no instances of this type.

When is this useful? Consider None:
object None extends Option[Nothing]

Because Option is covariant in its type parameter and Nothing is a subtype of everything, Option[Nothing] is a subtype of Option[A] for every type A. So, we can make one object None which is a subtype of Option[A] for every A. This is reasonable, since Nothing cannot be instantiated so Option[Nothing] will always be without a value. Similarly
object Nil extends List[Nothing]

Unit corresponds to logical true and Nothing corresponds to logical false under the Curry-Howard isomorphism, where we view types as propositions and functions as proofs, .
Answer: Unit means that (a) function has side effects like input and output, (b) these side effects are the main goal of the function. Of course, a function can have side effects even if its type is different from Unit.
Nothing is a special type in Scala, because (a) it has no values (Unit has exactly one value - ()), so you cannot return a value of type Nothing, and (b) it is a subtype of every other type. That means that if something has the type Nothing, it can be used instead of any other type (via subtyping), but it won't produce any result. This is useful for dealing with exceptions - the throw expression has a type of Nothing, so it can be used everywhere in a program.
Simply, Nothing means that there was an error or termination of a program and nothing was returned, while Unit means there were side effects, but execution ended normally with no result.
Programming in Scala has a nice explanation of that.
Answer: To add one aspect to Petr's reply: Nothing plays an important role in the type hierarchy. It is a bottom type. That means that it is a subtype of every other type, which is like the opposite of Any, which is a supertype of everything. You can find a nice explanation here.
Comment: @downvoters: When I wrote this answer, Petr's reply did not mention the bottom type aspect at all. He only added it later.
Answer: Unit
Unit is same as void of Java. void in java is a keyword but Unit is an Object in Kotlin.
Now if a function returns Unit in Kotlin, it means that it doesn't return anything meaningful, that function just executes a bunch of code and gives back the execution flow.
Nothing
Nothing is a different kind altogether. You can't relate it with anything in Java. There is nothing as such as Nothing in java.
Nothing means the end of execution. If a function returns Nothing, means literally nothing it returns. Not even the execution flow.
Nothing is like a black hole, anything that goes in doesn't come out, Not even the light (light is "execution flow" here). In the case of Unit, least light comes out.
So, if a function returns Nothing, the flow of code ends there and anything written after that is Unreachable.
Now see the code below,
fun main() {
    unitFun()
    println("after unit")
    nothingFun()
    println("after nothing")   //you get warning here saying "unreachable code"
}

fun nothingFun(): Nothing {
    println("inside nothing")
    throw Exception()
}

fun unitFun(): Unit {
    println("inside unit")
}

Output will be
inside unit
after unit
inside nothing
Exception in thread "main" java.lang.Exception

NOTE: you get warning as soon as you write
println("after nothing")     UnReachable Code

And you know the reason, it's because nothingFun doesn't even send back the execution flow.
One more thing to complete this here is, any function that returns Nothing has to throw an exception of any kind.
REASON: If you write some general statement (and not throw an exception) then the function will match the return type and we don't have anything that returns Nothing, means we don't have anything that sucks the execution flow and never returns it back. Everything returns something, even Unit is something.
Now, one can say that Nothing is a class so we can make object of it and return that itself. Nohhhhhhh? A big nohhhh?
Nothing class has one constructor but it is private, so you can't even make an object of it.
Last Bit
Behind the scene, Unit is converted into void(small v) in the decompiled byte code while Nothing is converted into Void(capital V).
see the below code,
var user = null               //First
var user : User? =null        //Second

Here, the Second statement shows, user of Nullable-User type.
What is the type of user of the first statement?
any guess?
It's Nullable-Nothing type.
try to see the first statement as
var user : Nothing? = null

Now what's happening under the hood,
Void user = (Void)null;              //First
User user = (User)null;        //Second


minimalist compositions

Question: Thanks for all the responses. It struck me that the work of Reich and Glass was/is mathematical in arrangement. If LaMonte Young and Terry Riley started the movement on the coast then Reich and Glass brought it to the city. It reflected it's architecture. So therefore would it be possible to take the information contained within the written scores and generate a possible two  or three dimensional model. I was thinking using the rhythm and spaces time division within musical notation the hierarchy of notes within the scale attributing colour values to each and so on. It is perhaps difficult to get across because I'm working it out as I go. It'll be a collaborative process as I'm a non-musician but I like that idea as much as genuine non-pedigree architecture. That is why I have introduced the proposal here. It is merely a concept that I'd like to see fly and if it does I may then approach the composers for their thoughts.
Comment: @CarlWitthoft yes sorry, I was a bit wobbly with my language.... I meant that though it's possible to think of lots of measurable things that you could translate into dimensional information, it's not clear to me that simple mappings of any of those to 3D positions are going to create a useful structure. But then maybe a mapping of something more abstract (like hierarchical levels of organisation) might bear fruit.... hmm....
Comment: @MichaelCurtis there's a lot of possible directions this could go in and even if the question was clear there's a lot of ground to cover on the structure of minimalist pieces in general. The base unit tends to be very simple, but the nuances that come in the layering and transformation of that idea can have a lot of depth that is hard to cover in this format.
Comment: When you say "how it might translate 3-dimensionally", do you mean "how it might translate into an architectural form"? Music theory does deal with questions of form, but not in any way that would clearly translate into 3 dimensions as far as I am aware (though I stand to be schooled!)
Comment: @topomorto  well, I can think of many parameters that one could use to form 3D images.  Pitch, amplitude, and waveform, for example.  Not that I recommend this!
Comment: Even if there is not a _direct_ translation of music to 3-D there is something to explain about the structure of minimalism and relating it to architecture. Is the closing group really unaware of historic relationships such as Baroque music and the periods highly ornamental architecture, or the connection with Modernism and decorative elements in a 20th century skyscraper?
Comment: Great thanks for the responses I've now started the discussion I wanted. Iannis Xanakis published a book translating music to architecture. And we must remember that throughout history architecture has been considered frozen music. This is my point of departure.
Answer: There are a few features of Music in Fifths that could translate into 3d form design.

The basic structure is composed of patterns that while being repeated are slowly morphing. The beauty and true craft in this piece is how a small changes might have a dramatic impact. I'm sure something similar is achievable in visual arts or architecture, where subtle change in repeating patterns has a big visual impact. It could actually be reflected quite accurately with a patterns that have looped endings and the number of loops increases as pattern evolves.
The basic harmonic building block - the fifths - might be viewed as "a building block that is traditionally frowned upon" and I think that could be also translated into architectural form. It's not easy to "build stuff" out of parallel fifths.
IMO what this piece does to our heads is akin to optical illusion in visual arts - it tries to confuse us as to where the phrase begins or ends, constantly shifting and phasing the simple material.
General austerity of the form and content

But obviously it's all quite personal, and more of a creative endeavour that strict "translation". And I'm not an architect so might get certain things terribly wrong :)
Answer: There is a kind "code-ish" approach that could be taken where three musical parameters would be mapped to the 3 physical dimensions. The musical parameters could be pitch, amplitude, waveform, duration, etc. But such mapping will be arbitrary. I cannot imagine it will result in any 3-D form that would stand up like architecture. I put the word in air quotes, because I feel such effort don't actual reveal any true underlying connection between different media.
Of course music is a temporal art. Traditionally harmony is understood to have grammar/syntax qualities. Some music theory draws comparisons to language. Some of those comparisons are very direct like rhythm and poetry meters. Others less direct like musical phrasing and punctuation, or cadences and rhyme. This is an interesting comparison, but it doesn't take us into three dimensions.
Another temporal art closely aligned to music is dance. The interesting thing about comparing music and dance is that dance is a 3-D art. It many not seem to fit the current info-graphic, code-ish fads, but dance might offer some ideas for how to interpret music in a 3-D medium. Below is an illustration of choreography notation from Friedrich Albert Zorn matched to music notation. It stumbled upon this very recently looking for musical rhythm study approaches. I don't really know how that dance notation translates to 3-D, but my main point is to show some example of interpreting music into a 3-D art...

Two other thoughts:
Melodic contour is the technical term for the general shape of a notated line. I have read texts that describe one common contour as an "arch." That's obviously an architectural reference. That particular comparison seems appropriate for elevation or cross section drawings.
An "arch" contour:

Minimalism doesn't really work with grand melodic contours like you get in symphonies. Instead it's more about short rhythmic patterns. Visually it reminds me of Arabic tile patterns. From that perspective it might be more appropriate to make comparisons with decorative elements or perhaps floor plans.
When I say 'decorative' I don't mean strictly decorative like a pilaster, but perhaps things like brick work patterns or exploiting some kind of transparency effect where two patterns on two planes (posts, screens, windows, etc. or perhaps their shadows) combine. Such overlapped patterns would change as the viewer moved through the space. Kind of like moire patterns. That type of gradual pattern change would reflect pattern manipulation in minimalist music which uses a lot of composite rhythms and small changes to generate new patterns of accents and syncopation.
These are just a few of my thoughts. I hope some of it is interesting or helpful.
Comment: Hey Michael thanks for that. I don't know about the down vote I don't know how that happened cause it's all up for me. Some helpful ideas there let's keep the conversation going and how do I do this vote thing? I didn't do it the other kids did and ran away.
Comment: I appreciate hearing from you! Voting is done with up/down wedges at the top/left of each question or answer.
Comment: The damn thing keeps defaulting to minus one every time I click up. It's not me it's in the machine. Technology is fantastic when it works. Have you seen Brazil? you might want to change your name .....think on.

minimalist compositions


Teleport pad sometimes keeps teleporting me back onto the ship instead of down to the planet

Question: My teleport pad will sometimes keep teleporting me back onto the ship instead of down to the planet. Is there a solution for this issue?
Comment: We don't do well with questions like this.  Try to ask for a solution to the problem you're facing (presumably that you can't teleport down to a planet) rather than asking when a dev will implement a bug fix.
Comment: I've noticed when I try to engage the teleporter it gives me two (technically three) options to either teleport home or down to the planet (or cancel, the third).  Don't have the exact wording on me here at work, but are you clicking the Home one?  Does using the button on the right margin to teleport down bring you back to the ship ever?
Answer: The answer, unfortunately, is that there might not be anything you can do. Starbound is in early beta, so right now, it is going to have lots of bugs and is rather likely to crash.
What you can do is go to Starbound's forums to submit a bug report. Hopefully, the devs will address whatever is causing your problem soon.
Comment: I know from your edit history that you know this is a bug and to file it with the Starbound devs. Unfortunately, there isn't any way to know when (or if) they'll address your issue. I would guess, though, that either lots of people will have this issue, making it a high-priority bug, or that some wires got crossed in your save files, meaning the bug might go away the next time they wipe characters and maps.
Answer: In my experience this always happens if the target location has been removed (flag or teleporter was physically destroyed), but is still in bookmarks.
If that is the case, you'll have to walk to the location you want to visit.


What dialect or accent is Woishington?

Question: My mother uses the pronunciation woish or worsh for wash, feesh for fish, and deleecious for delicious.  What accent or dialect is this considered?  She has lived her entire life in central Illinois.
Comment: She's not alone there in Illinois: http://listserv.linguistlist.org/pipermail/ads-l/2006-November/065199.html
Comment: There are many parts of the US where presumably a small group of immigrants settled and kept to themselves to a certain degree such that they developed a fairly unique local dialect.  There is also a general "rural" dialect spoken in regions across the nation, though (based on the too-brief sample) the above description does not appear to fit that dialect.  (I do recall from my youth a family from Illinois who spoke as you describe, but others I've known from the suburban Chicago area did not.)
Answer: According to a map based on the Atlas of North American English, central Illinois is unevenly apportioned into areas dominated by two major American dialects: Inland North, which accounts for the northern third of the state plus a long finger of territory called the St. Louis Corridor that extends in a line from Chicago and Gary (Indiana) through Bloomington (Illinois) and Springfield (Illinois) all the way to St. Louis (Missouri); and Central Midland, which includes parts of west-central Illinois from Peoria to Quincy to Jacksonville, and east-central and southern Illinois from Champaign and Danville to Hillsboro, Bellville, and Murphysboro.
The map also shows (with a solid purple line) the split between areas where natives pronouns pen identically to pin (with a short i sound)—generally north of the line—and areas where the two words are pronounced differently; the demarcation line for that split is not the same as the one for Inland North versus Central Midland.
Researchers at the University of Pennsylvania have produced a somewhat different (and less detailed) map that divides Illinois into three regions—Inland North, North Midland, and South Midland—with the area near St. Louis treated as a unique fourth area.

As for the poster's question about what dialect uses woish or worsh for wash, Merriam Webster's Eleventh Collegiate Dictionary (2003) reports that the pronunciations 'worsh (with a dot over the o that my computer's special character set won't let me replicate) and 'wärsh for wash are "chiefly Midland." I have no information on the pronunciations feesh and deleecious.
For a highly anecdotal series of posts about the pronunciation "warsh" (or "woish") for wash, see the responses to the question "Warsh?" at alphaDicitionary.com. Among respondents who bothered to identify where they lived, areas cited as using the pronunciation "warsh" or "worsh" include West Virginia (two instances), northern West Virginia, southwestern Pennsylvania (two), eastern Kentucky, southeastern Tennessee, western North Carolina, Ohio River Valley (two), Missouri (three), Iowa (two), Wisconsin, south Texas (two), central Texas, east Texas (two), north Texas (two), "rural" Texas, "rural" Florida, Oregon, central Washington, Baltimore (Maryland) and New Orleans (Louisiana); areas cited as using "woish" include Iowa and Wisconsin.
By way of emphasizing the evidentiary limits of such anecdotal reports, I note (counter-anecdotally) that I spent many years of my life in cities in south, east, and central Texas, and very rarely heard anyone say "warsh" or "worsh."
Comment: This doesn't actually answer the question. The word *warsh* is very typical of a Midland accent, although some people with other accents use this pronunciation as well; I'm not aware that *feesh* and *deleecious* are typical of any accent nearby. The Midlands accent sounds typically American, while the Inland North accent is really odd, so if those are the most noticeable aspects of her accent, it's probably a Midlands accent.
Answer: My mother claims to have said 'warsh' when she was younger. After getting a degree for speech therapy, she lost her accent. She no longer speaks that way, although sometimes she still says 'feesh' for 'fish' and 'cooshion' for 'cushion'.
She was born and raised in Central Indiana. But a generation before that, her family was in Southern Indiana. And some generations further back they were in Kentucky, Tennessee, North Carolina, and West Virginia. I've assumed that this was a dialectical trace from the Upper South.
My brothers and I spent most of our early life in the Midwest. This included a factory town on the edge of Appalachian Ohio, in a Jewish suburb of Chicago, and in a college town in Central-Eastern Iowa.
None of us have ever said 'warsh'. Other than my mother's family, I've rarely heard it spoken that way in most of the Midwest. It's even more rare among young Midwesterners. I have some cousins in Indiana and not a single one of them would ever say 'warsh'.
Answer: My mother-in-law and sister-in-law pronounce wash as 'woish' (drives me bonkers). They were both born and raised in Joliet, IL., strong German ancestral background.
Answer: My mother (entire life in central Indiana, mostly rural) said "woish" and "boosh."  My cousin (entire life in small-town central Indiana) says "feesh." In general, I've heard a lot more examples of unusual dialects in rural/small-town areas than in big cities.

What dialect or accent is Woishington?


Will I definitely get food poisoning from unrefrigerated meat?

Question: I took a piece of beef steak out of the freezer yesterday at 4pm. I left it on the windowsill until 11am this morning. It stayed pretty chilled because the temperature here is below freezing, but it probably got above fridge temperatures. I then put it in the fridge before I cooked it tonight at 6pm and ate it. Will I definitely get sick?
Comment: Will you DEFINITELY get sick? no. Too many variables to tell you. Is that safe? NO. it worth the risk? NO This is not really a useful question. In the future, look at safer ways to defrost meat. Search or post a question if you don't know how.
Comment: Assuming you will live for another 60 years, your chances of getting sick are pretty much 100%, before you die.
Comment: Can you let us know whether you did get sick in let's say... 2 days???  **>:-)**
Comment: Maybe rephrase to "what to do to create reliable poison from a given cut of meat"? ;)
Comment: I agree with previous answers/comments about how this is not a safe practice. One other thing I would note is that different types of food poisoning can take different amounts of time to actually cause illness, which is probably a reason people don't realize which "unsafe" practice caused the illness (if any). In most cases, you'll probably get sick within a couple days, but there are some foodborne bacteria that could take a week (or even more) to make you sick.  Outside of testing the meat you ate and taking a culture when/if you get sick, it's hard to know when there's a connection.
Answer: Of course there's no guaranty that you will get sick - there almost never is - this doesn't mean you should ignore food safety.
There are three large factors that influence how "safe" your meat is:

How much harmfull microorganisms were in your meat to begin with?
How much did these microorganisms multiply and more importantly metabolize?
How "healthy" are you? / What amount of toxin/microorganisms can your body handle?

You only will get "food poisoning" when you have ingested a sufficient amount of microorganisms / poisons produced by microorganisms to overhelm your own immune system.

So why do we still clamour about food safety?
Because you can't controll the factors involved. In a normal kitchen environment you have no way of knowing how "contaminated" your food is, or how much your system can handle.
Stay on the safe side, assume the worst, and throw out food which might not be safe to eat.

On a side note. Extreme temperatures (e.g. freezing / cooking) do not "sanitize" food.
Answer: You most likely won't get sick if the temperature was below freezing close to your windowsill. However, it's generally safer to thaw and consume your meat in a reasonable time frame, and not leave meat out for extended amounts of time. If you cooked your meat to temperature, you're also reducing the amount of bacteria that may have formed on the steak.
Comment: There is no way in the average house even with crappy windows that temps even near the window are cold enough to move food out of the danger zone. Also cooking food doesn't save spoiled meat.


infinite/sustainable hosting of a web-interface to a research database

Question: I am a postdoc in the humanities and I am drafting a funding application for a project envisaging the development of a research database. The project will last no more than 2-3 years and as a postdoc I am not supposed to stay at the host institution for longer.
The question is how to preserve the results of this work for posterity.
Luckily these days there are institutional and independent repositories, which allow me to store my complete dataset as a set of CSV files and in RDF/XML format with a well-documented ontology. This sounds sustainable.
But I also would like to offer a web-interface to the researchers so that the database could be consulted online. (The structure of my data is quite unique, which does not allow me to simply submit all my data to the online database of any large project working in my field.) I see it as a standard MySQL/PHP application, which I am planning to develop.
The question is what is the most sustainable strategy for hosting it. I have seen a number online research databases in my field, some costing a great deal of money to the funding authorities, which went offline after some years and are no-longer available. This includes both commercially hosted database (the worst option in my view, for someone has to pay eternally for hosting and domain name) and university-hosted databases. I understand that after I leave the host university (and I am just a postdoc), no one can guarantee that they will host the project website forever.
Besides the technologies for web development are changing fast and the web interface designed with current tools will become obsolete after some years.
What are the best practices for securing a lasting time-span for a small online research database, which does not have a strong lasting project behind it?
Comment: No offense intended. The first word of the title 'Infinite" is impossible. Nothing is guaranteed to last forever. Short answer to the question _What are the best practices for securing a lasting time-span for a small online research database ... ?_ Your own web site or blog paid by yourself.
Comment: How large is the database?
Comment: For web development, I would recommend JAVA-JSP, Servlets, ... because of the high complexity and adaptability. The best option would be to have a paid domain and to mirrors on faculty servers.
Comment: My question implied that the problem with the privately paid domain/hosting is that it depends on one person (me) and it will just disappear after I (for whatever reason, we are all flesh) stop paying for it and supporting it.
Is JAVA-JSP really superior to PHP in terms of life-span?
Comment: _Is JAVA-JSP really superior to PHP in terms of life-span?_ is a technical question and is off-topic. To answer it, no one knows the answer. Maybe next year we're going to have KAVA-KSP (I just make it up) which will last longer than anything else. Who knows?
Comment: I think this is not the place to discuss which technology to use. Java, LAMP, NOSQL, node.js... it doesn't matter here.
Comment: Relatively small, 16 tables with about 35000 records in the largest table.
Answer: I have the impression that quite a few university libraries are very interested in preserving and making available other things than just books. So talking to your university librarian would be my first stop. Even if your university library does not have expertice in this field, they may know of such a project somewhere else that you can apply for.
As to someone else maintaining the web-interface for you, I would not count on that happening. That will cost someone time and money, and unless you are rich enough (and willing) to set up a fund to preserve your project, you cannot count on someone else doing it for you. Instead I would keep the interface as minimal as possible. It may not look pretty, but it is more likely to keep working.
Answer: Let me offer you several strategies. Firstly, you can consider, instead of or in addition to developing a LAMP-based Web application, to publish your research database as open data set with a clearly documented structure (schema, ontology, etc.). The benefits of that include much wider option of long-term preservation as well as opening various opportunities for other researchers to reproduce, enhance and build new knowledge on top of your results: open data => reproducible research => scientific innovation. For this option, you can consider using some solid free open data repositories, such as figshare, Zenodo, CKAN-based Datahub and GitHub (see examples).
Secondly, you can consider a hybrid approach, which is to combine an open data set, published as mentioned above, with a relevant open source code of Web application that anyone could download, install and use to interface with your data set. Considering the open source hosting aspect, from above-mentioned options, the GitHub one is especially attractive, as you could seamlessly host both data and relevant Web application code. If you (or someone who can help you) are technical enough, you could make access to your data set, using this approach, even easier, by providing a containerized (such as Docker) version of your data and application (if the data set if not too large, you can even push relevant public Docker image to DockerHub or other services that host public images for free). Similarly, you can publish a free software appliance - virtual machine (VM) - perhaps, some of the above-mentioned repositories (and/or maybe others) offer hosting open VMs for free.
Thirdly, you can propose developing and hosting Web application that would provide open access to your data set to (in addition to some universities) relevant non-profit organizations, working in your particular domain. If successful, the costs of developing and maintaining the database would be covered (at least, for some time) by relevant scholarships, grants or similar financial vehicles. For example, for social sciences, including humanities, you can review funding opportunities at Social Science Research Council, The Rockefeller Foundation, Carnegie Corporation, Ford Foundation, Russel Sage Foundation and many other non-profits.
Comment: Thank you. I planned to publish open data (based on an ontology from a neighboring field  with documented additions to it, necessary to accommodate my custom data). Yet for most users in the humanities working with a raw dataset is unpractical, when they just need to find some particular information in it (as they would do using a printed reference book); hence, a web interface is a must (some 20 years ago such db would be published as a desktop application, which is maybe worse in terms of longevity). So I like the idea of also sharing the sources and the db dump in a repository (hybrid).
Comment: @greenb You are welcome. I'm glad you found my answer helpful.
Answer: If you set up a non-profit, you can apply for free webhosting for the nonprofit with some webhosting companies, for example dreamhost.
Comment: Correction: if you set up a non-profit [**based in the US**](https://help.dreamhost.com/hc/en-us/articles/215769478-Non-profit-discount). Which might be tricky to do if you don't live there.
Comment: In some cases, academics are entitled to the same conditions as nonprofits (and many universities are nonprofits).
Comment: Thank you. Similar conditions are offered by hosting providers around the world. But eventually a hosting company is just a commercial enterprise, not dedicated to preserving the data in the long term (unlike the repositories). I know one such nonprofit site hosted for free for twelve years already. It would have died a couple of times already without the interventions by the owner requested by the hosting provider on the occasions of migrating to another server or the like.


Oil in Ramen broth

Question: Many recipes online suggest that at some point I should sauté some onions or scallions with vegetable oil and add them to the broth that is meant to go with the ramen. I know of toasted sesame oil and burnt garlic oil used as topping, but the sautéed onion sounds like some kind of culinary westernization to me. Is this practice proper Japanese cuisine or not?
Comment: Did you know that ramen is just a Japanese version of the Chinese 拉面 (Lā miàn)?
Comment: Ad much as i know that this culinary import happened centuries ago, and that ramen has since become a food on its own, separating from the Chinese version even in the type of noodles required.
Answer: I don't recall ever seeing regular onions in my ramen in southern Japan (but scallions, maybe--it was many years ago, so it's hard to remember).  As for topping oil, the only one I ever saw was "Chinese fire oil", which was usually provided on the side for addition at the customer's discretion.  I loved the heat from the fire oil but could only stand at most a few drops.  It's the hottest stuff I've ever tasted.  I brought home the bottle I had, and I still have it (though the wife and kids don't like anything anywhere near that hot, so I haven't used it in years and it's very likely rancid now).  In the two years I lived there I only managed to use a few ml.  I can't imagine that the 5 oz. bottles at the grocery store and on Amazon are the same stuff. Here it is:

Oil in Ramen broth


Lifting heavier weights with my right arm

Question: I have differently shaped shoulders through a disability so I purposely work my right arm with heavier dumbells.  What is the consequence of doing this to the left side of my body?  I mean is there corresponding muscles that could inadvertently be toning my left side whilst working my right?
I think my lower back on my left has more definition. Could that be due to more strength training on my right arm?  Thank you
Comment: Is your disability still with you? By that I mean, do you expect to have near-normal use at some point?
Answer: Everyone has a more dominant side than another, and after a few years of good living most people have picked up random injuries. My left hip adductor, as an example, has some damage in it so I can never really do as much on my left side as my right. Worse, I'm right handed so I end up using my right side more for pretty much everything.
Muscle imbalances can be a problem, and although the "go see a doctor" can be applied too widely you should have a firm understanding of what kind of use and mobility you can expect from your left side. A good physical therapist will be able to give you very targeted exercises that will strengthen surrounding musculature without causing any new problems.
There are some amputee athletes out there that are in phenomenal shape, and that's been primarily through physical therapy setting the direction and the disabled person themselves doing a boat load of work.
In short, muscle imbalances are common and universal. But when they border on or cross over into disability management, you need a plan that really works for you set up by someone who understands your situation.


Meterpreter reverse shell alternative

Question: What can you do if you are behind NAT but can't do port forwarding and don't want to pay for a virtual server with internet-facing IP? I read the answer to this question  which suggests some tunneling software (e.g. ionide, pwnat) but those have to be installed on the target machine too and you can't use them with Meterpreter. That question is four years old so are there better alternatives now?
Answer: I think Meterpreter Bind Shells are what you want. They typically bind and listen on a specific port on the remote target, so no port forwarding is needed on your side. However, the target must have the ports Meterpreter uses open to the Internet, not only Local Area Network. Read more about Bind Shells here.

Meterpreter reverse shell alternative


Reason to hedge a European call option

Question: Assume I write a call option on one share of the stock that I have. After selling the option I have an obligation to sell one share of the stock at some future time. I already have the stock, why would I want to hedge anything here? The idea of hedging is meaningless in this example. Is there any other set up where the party who sells the option has to hedge the risk it gets exposed to (that is, obligation to sell the underlying)?
Comment: How do you define hedging here? If you are short one option but long one unit if stock, then you're only well hedged when the option is deep in the money. The rest of the time you're long delta and short gamma and vega.
Comment: You would want to hedge because your instantaneous profit & loss is everything but null and your unrealized profit & loss is everything but secured (frozen).
Answer: I think you have a small misunderstanding.   The hedge for a call (or put) is rarely 1:1 with stock.   When you are selling this option you are actually selling the future movements of the stock and specifically the future price jumps that will happen.
To hedge an option you would enter into a position that will offset the movements in price of the option you sold.   In your case you are not (most likely) hedged.
Here's a simple example:

You buy 1 sh of stock for \$100.
You then sell a \$110 strike November call for \$1.
The price of the stock goes steadily down to \$90 by November expiry.

You made \$1 on the call you sold but then lost \$10 on the stock (less divs and + any borrow costs).   So you weren't hedged at all.
The right (or better) way to look at this is that when you sell an option you need to look at the exposure that your option's price has to moves in its underlying asset.   In the case above:

When you sell that November call, determine what is your exposure to a move up or down if the stock is to move the average of it's one day volatility.
Say that the average up/down daily move is 2%.  So then you need to
figure out what you expect the price move of the option to be if the
stock goes up or down two percent.
Hedge an amount of stock that will give you a matching gain or loss to the option's gain or loss.

So in your case you have way to much stock.  You are not hedged (as you can see by the simple example above).
Answer: First of all, option contracts normally specify 100 (or in some cases, 1000 contracts of the underlying instrument) to the one option contract, so you are unlikely to encounter the 1:1 scenario you mention.
Let's ignore the ratios for now, and look at the risk profile portfolio you described (1 long underlying and 1 short call).
The portfolio you have is a synthetic SHORT PUT
This is the profit profile of a short put:

Price of underlying > call strike : keep call premium collected + (potential) profit from selling underlying
Underling price purchase price > Price of underlying < call price : slightly positive
Price of underlying < Underling price purchase price : Potentially "unlimited" losses - well till price goes to zero

So your portfolio needs to be hedged, otherwise you have vulnerable to downward price movements of the underlying.

Reason to hedge a European call option


Rename the fanatic badge to something positive

Question: I'd like to suggest renaming the fanatic badge to something with a more positive connotation. I'm taking regular days off SO just to avoid it (which is hard, as I have to be careful about what Google hits I click). As I know badges are there to support a certain behavior (visiting SO in this case), I feel that at least for me, the naming of that badge has the opposite effect.
Comment: *fanatic* has a negative connotation?  really?  sounds like a personal problem.
Comment: @~quack: Let me quote from the Wikipedia article on fanaticism: *Philosopher George Santayana defines fanaticism as "redoubling your effort when you have forgotten your aim"; according to Winston Churchill, "A fanatic is one who can't change his mind and won't change the subject". By either description the fanatic displays very strict standards and little tolerance for contrary ideas or opinions.* - I don't see how that could or should have anything to do with visiting SO frequently.
Comment: @Fabian: The _dictionary_ defines fanatic as: "marked by excessive enthusiasm and often intense uncritical devotion ". I'd say that's spot on.
Comment: "have to be careful about what Google hits I click" -- why don't you just log out for a day when the 100th comes close?
Comment: @Fabian: i'm aware of the (many) negative connotations of *fanaticism* among *devotees of various ideologies*.  but here in the context of SOFU, it's not so much *negative* as *self-deprecating*.
Comment: @balpha: The problem is I have to remember to log out on all machines (home, office, bathroom, ...).
Comment: Just staying logged in isn't enough to count; you have to be active on the site in some way.  So, just remember to concentrate on not doing anything for a couple days every three months or so, and you'll be safe from the dreaded charge of fanaticism.
Comment: @Jonathan: Well that's exactly what I'm doing and what I described.
Comment: "A person motivated by irrational enthusiasm" - methinks that's more it
Comment: Bathroom machine? Wow
Comment: Lets not forget *cultural interpretation* of the word (English is one thing, then there are the other languages/cultures..). I'm not bothered by it, but IF it should get to a point of renaming it, how about **devoted** ?..
Answer: I guess this just goes to show that you can't please all of the people all of the time.
For me, 'fanatic' seems a perfectly accurate description of anyone who is present on 100 consecutive days on any of the StackOverflow sites (and yes, I have a Fanatic badge for StackOverflow; and yes, I'm proud of it; and no, I don't want it renamed; and yes I was livid when my vacation in obscure corners of darkest England meant that my sequence was broken at somewhere around day 90 and I had to start over).
Comment: I wonder if that was *more* or *less* livid than my good lady wife was when I suggested taking the mobile data dongle with us to Snowdon...
Answer: Wow. There's people here who actually cried on the 98th or 99th day if they missed logging in for this badge... I got mine on meta on 2010-01 (New Year's Eve still in my timezone) and thought it was a great present.
Still, you're right, the definitions of "fanatic" are largely negative.  How about "Connoisseur" as a replacement? It invokes the image of a person who is sophisticated and distinguished, rather than someone who might be a raving lunatic.
Comment: +1 for the 'people who cried' and -1 for the connoisseur suggestion; so I didn't vote.
Answer: Of course it is negative. You are spending 100 consecutive days on a geek-site. Get some holidays in!
Comment: Yeah, I'll do that - in fact, that's my current solution. However, I don't think this badge or badges in general are *intended* to keep people away.
Answer: It should just be shortened to "Fan" maybe? While Fan is just short for Fanatic, nowadays the words have two different meanings, with the former being associated with Supporters of Sports Teams and the latter being associated with Supporters of Explosives.
We already have a Supporter Badge, so that name is taken. Groupie would be another name for Die-Hard-Fans I guess, but it's not entirely positive either.
Answer: Websters:  marked by excessive enthusiasm and often intense uncritical devotion
MacMillan:  someone who has very strong religious or political beliefs that often make them behave in an unreasonable way
Collins:  a person whose enthusiasm or zeal for something is extreme or beyond normal limits
AHD: A person marked or motivated by an extreme, unreasoning enthusiasm, as for a cause.
Times change.  So does the language.
This proposal is in BAD need of revival!
Comment: I think both Websters, Collins and AHDs definitions are *spot on*.
Comment: Both? I count 3 in there!
Answer: To add a suggestion for an alternative name independently of the general suggestion of renaming the badge, I'd like to suggest hard-working here (both in the sense of working hard at SO and not always working hard at work, as discussed in Podcast #82).
Comment: i really don't see "hard-working" as synonymous with "visits the site often".  maybe it's just me.
Comment: @~quack Yeah perhaps the first meaning is a bit euphemistic and the second one pointlessly ironic, in particular without the discussion from the podcast (where Joel suggested that not getting sidetracked too easily during boring work is in a way the definition of working hard).


Leave and return to Canada from the US and stopover in the US

Question: I'm a German student and I will do a semester abroad in Canada (less than 6 months so I will not apply for a student permit, but only an eTA). I want to do weekend trips to the US (overland) at the beginning of the semester and at the end I will take a flight with a stop in the US. I know that I have to fill in a paper at the border to the US when I will enter for my first trip, but do I need something specific for my stopover at the end?
Will there be a problem because of a period longer than 90 days between my first (trips) and my last (flight) arrival in the US?
Comment: The "90 day rule" is interpreted to prevent visa runs, i.e. people attempting to live in the United States and making brief visits to Canada or another nearby country. Because you are not trying to do this, it will not affect you.
Answer: This should not be a problem.
While visting Canada does not reset the clock on a VWP visit to the US, if you reside in Canada it does. Each of your visits to the US will treated separately. Telling the immigration official each time you enter that you are studying in Canada should be enough. Having some evidence of that fact would be a good idea, but a record of only entering the US occasionally also means they won't be concerned.


Removing Vector Shapes From Underneath Text in Illustrator?

Question: I am trying to prepare a graphic for UV printing but it cant have any overlapping colors. The image I am trying to place the text on top of has a gradient in it which has caused multiple vector shapes to be generated. Is there a way to cut out the area immediately underneath the text? I've tried a number of things, minus front, minus back, merging etc. Nothing seems to work for multiple vector shapes at once. The text covers 15 or so vector shapes.
Comment: Hi. Welcome to GDSE. Why do you need to have no overlapping colours? Printers generally only print what is visible, not colours which are hidden by colours on top.  Also might be better if you could show us a screenshot, showing how it's constructed (showing layers, etc).
Comment: Outline any type. Select all. pathfinder > merge.
Answer: No idea what printer tries to place ink to the same place as well for text and the underlying colored shape. But one possibility exists. You can make a color separated print PDF where plates C, M, Y and K have all separate image. Making the print PDF can have option Overprint Black =ON an that's, of course a different case. A super-tricky printer driver can have the same option, but I have never met it.
But let's assume you want the colored shapes below the text have hole just at the same place where the text is:

The text object is selected and copied to the clipboard to keep it safe. The colored shapes are grouped.
Both the group and the text is selected and the Transparency panel menu function "Make Opacity Mask" is applied. The text vanishes and transparent holes appear on the colored shapes. Just to show there's a hole I insert an yellow background shape:

The text can be restored by pasting it in place from the clipboard. It will cover the hole exactly.
The text in the mask must be black. If it isn't, give to it black fill color after copying the original to the clipboard.
In case of error the opacity mask can be released which removes the holes. The black text appears in its original place. You can have 2 copies of the text in the same place after releasing the mask.
Answer: I've done spot UV before and you don't need to cut text from the shapes. Just leave the text (outlined) white. Printers will not print white so that is how you do it.
The next step is to duplicate the text you want as spot UV, colour it with a new spot colour (you can even rename the color as spot UV) and on the attributes panel set it to overprint. Printers will then be able to separate the colours and point the "spot uv" color to the SpotUV tray on their printers.
By separating the colours I mean, usually they separate CMYK colours, some even have a 5th tray for coating and the 6th tray will be for spotUV or foiling, etc.
This is MY experience, the printers usually tell you how they want the files to be set up.
Difference between images is the layer visibility. Let me know if this makes sense.


Secondary Dialogue

Question: When writing a novel how would one best represent background dialogue from a radio or television that is perhaps only half heard by the characters but still important for the reader?
Should I have the narrator state clearly that the conversation or broadcast is not being heard by the characters but sprinkle in key phrases and passages important for the reader and should they be written in italics?
Comment: Possible duplicate of [Background speech with foreground dialogue](https://writing.stackexchange.com/questions/7761/background-speech-with-foreground-dialogue)
Comment: Also worth noting, you may run into copyright issues if you want to quote actual lyrics...
Comment: So I'm confused.  Is this the news playing in the background and just a part of the noise (a family is eating breakfast, the morning news is on because it's always on.).  And how much do you want the news to be important to that scene vs. a forshadow that will be important later (i.e. Will the news story be a point of your scene NOW or will it be important down the road?).
Comment: Yeah, something like that. In this particular example it's going to be a propagandised daily news bulletin that plays throughout the dystopian city. Think a Soviet public announcement concerned with industrial output quotas, glory of the state, strength of the military and duty of the people to produce and to report on those who would promote sedition. In it the reader learns a few important details about the world I've created.
Answer: I would say this is highly dependent on just how important you want what is being said to be to the reader.  For the hypothetical, lets suggest that the important story is the famous quote and it was totally serious:

"My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever. We begin bombing in five minutes."    -Ronald Reagan

Scenario 1:  The scene is built around suggesting the period or routine, but bits will become important now.
You would write it with the narrative voice discussing the Radio reporting on legislation the President signed about outlawing Russia and his plans to enact those laws.   Later on the news story will be brought up and given contexts by the characters as it becomes more important to what the actual report is saying.  Since it's not important to the scene at the moment, it doesn't need to interrupt the action of the scene but does need to be shown.  Narrative writers are unique in that if it's unusual enough to mention, it's going to stand out in the readers mind... especially if you call back to it later in your story.
Scenario two:  It changes the topic of the scene.
If the scene is not initially about the subject of the report, but the report changes the narrative topic of the current scene, then you would basically write the same as above and then have some cue to the fact that an important news story has just started going on... perhaps one character announces that he or she wants to hear the story (the classic scene in the dinner where a patron yells "Hey, turn it up!" as it starts or an indication that the sound of the "BREAKING NEWS" jingle is interrupting the current fluff piece...).  This follows by the story... You should probably get a little artsy with the dialog as it needs to indicate that the speaker is not able to respond to the people in the scene, but how is up to you... just be consistent.  If it's from the TV, give a description of either the studio and  before the dialog or better yet, just go to the initial picture on the scene and have the anchor narrate over it or throw to a journalist on the scene... normally in breaking news events, the picture is limited to just a straight shot of the scene and a voice over (usually on phone, especially in modern times) talking about what is being seen... if radio, ignore this.  Either way, I prefer to write my news story dialog in a box quote (format to center justified and make the rows of text line up near equally where possible...  like a newspaper article, even if it's not news paper).  If you need to describe action, do a hard cut to the dialog with a dash (-) or an ellipse (...) and describe the event happening in regular text format and return to the box quote to continue the story...  This includes the studio anchor talking to the field reporter, but start them as regular dialog cuts.
As a bit of advice for realistic on the scene reporting of breaking news, I highly recommend watching some 9/11 as-it-happened-coverage (most major news networks have uploaded from initial report to collapse of the second tower on YouTube, in complete or in segment parts.  NBC's Today Show coverage is especially good for a study as Today Show Anchor Matt Laurer interrupts mid-interview of an author of a new book to announce that there is a major news update, but then is told they are going to commercial to get everyone in place and ready to do Breaking News.  After the one commercial is done, they are focused on the smoking tower.).  No matter which coverage you watch, all of them were focused on the burning North Tower when the second plane strikes the South Tower and captures the news crew's live reactions to the very sudden change in events.
Scenario 3:  Usual News story
If the report is on the President's well known by now statement, then you might want to do it a bit more like a narrative in a block text, but only for the obvious story piece (most news is anchor tossing to a reporter, who has a couple of words and then gives a prepared video report which is cut.  This is basically a dialoged news story and in fact, most local news organizations, which use this format, will usually have on their web site a word for word article of the audio component of the film segment that reads like a newspaper article, so use the block quote style for the news story.
Answer: I would set it off into its own lines and use italics.  Since it will happen multiple times, the reader will assume that it's background and characters may or may not hear what's said (or even notice it).
If you want to be clear who does and doesn't hear certain lines, you'll have to say so.

Luzia looked up with a start.  "Russia?  We're bombing Russia?"
"Mmmmmuh?" Geraldo put down his pen.  "What?"

Secondary Dialogue


Why do rich and poor countries trade in different goods and why do rich countries trade in similar goods with other rich countries?

Question: I think that differences in climate is one key factor but I think it could be explained by David Ricardo's theory on international trade differences???
Answer: The key is production capabilities, not relative specialization. In words of Hausmann and Rodrik (2006):

The idea that rich (poor) countries tend to export goods exported by other rich
  (poor) countries is quite obvious and is compatible with many possible theories. For
  example, in conventional trade theory a la Heckscher-Ohlin, countries export products
  that are more intensive in the factors of production that are relatively abundant at home.
  As development takes place, physical, human and institutional capital is accumulated and
  the products countries export become more intensive in these factors. ...
Labor-abundant countries trade with land- or capital-abundant countries in order to
  acquire more efficiently the goods that are intensive in the factors they don't have. The
  transition between goods is of little significance: they are the passive consequence of
  changing factor endowments.


Arduino over a Network

Question: I am new to arduino programming. I want to sense temperature and send it to a server in my college. I am using Arduino Uno R3 board which has ATmega 328P micro-controller. I am able to get serial output on my PC but is there a way in which I can send temperature data to the server in a packet format using Arduino Programmer and not using Ethernet Shield ? Please answer in a less complex way.
Answer: Without an ethernet shield or some kind of other internet connectivity shield/circuitry you cannot communicate directly with the internet through the arduino. However, if having a computer as the internet communicator isn't a problem you could try a setup like:
arduino->serial (usb)->processing->internet
This way you create the internet packet in processing using the temperature information received through serial from arduino.
see also https://processing.org/
Answer: Use an Arduino Yún: it's a Leonardo coupled with a CPU running GNU/Linux (a flavour of OpenWRT).
Using the Bridge library, your sketch can delegate tasks to the linux side.
HttpClient example (Examples > Bridge > HttpClient) GETs a page from the Arduino web site, but the HttpClient class may POST whatever data to a server of choice.
There is also a nice example called SendDataToGoogleSpreadsheet (Examples > Bridge > Temboo > SendDataToGoogleSpreadsheet): it accumulates sensor readings on a google spreadsheet. I've used something like that on a project of mine.

Arduino over a Network


How do I mount a sparsebundle to a folder rather than an image?

Question: I have a encrypted sparsebundle and I want to mount to to a folder in my home directory and not under /Volumes. How can I do that?
Answer: The hdiutil command-line utility gives you more flexibility, and is extensively documented in man hdiutil. Something like this should do:
hdiutil attach -mountpoint ~/myMountPoint mySparsebundle.dmg

Comment: can this be made persistent across reboots?
Comment: @ErikAllik yes - but why not ask a general unstinted how to run a shell script at boot time (before a user logs in) or after a user logs in.
Answer: You might also be interested in http://blog.marc-seeger.de/2011/02/06/encrypted-diskimages-in-osx/ which explains step by step how to set up auto-mount to the specified mount point:

run mount to identify the disk device (/dev/diskNsN usually)
run diskutil info /dev/diskNsn | grep UUID to get the UUID
use sudo vifs to add a line to /etc/fstab
UUID=whatever-you-noted-before /path/to/mountpoint hfs rw 1 0

Add your disk image to your login items to have it automatically mounted on /path/to/mountpoint at the next login
Answer: hdiutil attach /Volumes/ATimeMachine/Pictures/iPhoto\ Library.sparsebundle -mountpoint ~/iPho

If this command is successful you should see something like:
/dev/disk3              Apple_partition_scheme
/dev/disk3s1            Apple_partition_map
/dev/disk3s2            Apple_Driver43
/dev/disk3s3            Apple_Driver43
/dev/disk3s4            Apple_Driver_ATA
/dev/disk3s5            Apple_Driver_ATA
/dev/disk3s6            Apple_FWDriver
/dev/disk3s7            Apple_Driver_IOKit
/dev/disk3s8            Apple_Patches
/dev/disk3s9            Apple_HFS                       /Users/me/iPho

where iPhoto Library.sparsebundle is on a DroboFS (NAS) and is a 500G "hard disk" image formatted MacOS HFS journaled
Running the hdiutil command mounts the image under my home directory. I tired to mount it on top of the original iPhoto Library, but the original was still visible in there after mounting, so I changed the name of the mount point to iPho instead. Then I decided it didn't really matter where the mount point was, it would be fine under /Volumes as long as iPhoto.app knows where it is.
Option click iPhoto.app to launch it with a prompt to create a new library, and I did that in the mounted disk image. Then import all photos (previously managed with Picasa under a ~/Pictures directory tree) on my hard drive into iPhoto, which copies them into the mounted image, which resides on the NAS where it has some fault tolerance because of the DroboFS. This also frees up half the space on my small 500G SSD drive in the MacBook Air.
Answer: Just wanted to point out the -mountroot option:
hdiutil attach -mountroot ~ path/to/image.sparsebundle

In this case, it would be mounted to ~/image.
Also note that with the -mountroot option, if ~/image already exists, it would automatically append the mountpoint and instead mount the volume to, for example, ~/image\ 2.
A word of caution: be sure you do not confuse the -mountroot option with with the -mountpoint option. This would cause the volume to be mounted in place of your home directory!


What happened to the Boeing 737.X design?

Question: What happened to the B737.X design that depicted a downward nose much like the B787? It is not apparent in the B737 Max 8.
Comment: The answer is on the Wikipedia page for B737.X ... hmmm do I downvote for no research effort? Not sure how that works on this particular SE site.
Answer: Boeing was considering designing an all-new airplane to replace the 737 around 2020. Having been in production for over 40 years and through 3 major versions, it seemed like it was finally time to leave the 737 type behind.
However, Airbus decided to upgrade the main competition to the 737 to create the A320neo. The A320neo is more efficient than the 737NG and will be entering service in 2016. Boeing watched orders accumulate for the A320neo and felt that they would lose too much market share in the single aisle market if they waited until 2020 to introduce a new plane to compete with the A320neo.
The high number of orders for the A320neo convinced Boeing to scrap the new plane concept, and focus on just new engines for the 737, in order to get a plane on the market to compete with the A320neo. This allowed the 737MAX to be scheduled to enter service in 2017, less than 2 years after the A320neo. While the MAX does not have as many improvements as a new design would have, it has helped narrow the gap in orders to the A320 series. A new plane still 5 or 6 years away while the A320neo enters service would not have nearly as many orders, meaning the Airbus would be quickly increasing their market share with the A320neo.
A similar situation has happened with the 777, although it is still a much more recent design. The 777X is a more significant redesign than the 737MAX, but the update is needed to compete with the new A350 that is already in service.
Comment: @DavidRicherby Now that you mention it, it probably would be a good thing to not use relative terms like "next year" in answers in general. These are supposed to stay around in the web for several years, after all.
Comment: "The A320neo [...] will be entering service next year." I think you mean this year, right? (As of today.)


Is RPC Miner still the preferred BTC mining software for a Mac?

Question: I'd like to get a sense of how impossible it is to mine BTC as part of a pool on a MacBook Pro.  I figured there was some mining software out there but Uncle Google only showed some stuff from 2013.  I eventually clicked around to something called "RPC Miner", which led to this link (http://uploaded.net/file/49dw65r3), which I sure hope isn't a virus.  Is RPC Miner still the preferred mining software of choice for Mac?
Answer: Mining bitcoin with a CPU/GPU is now basically impossible, the network is secured by ASIC machines that are many orders of magnitude more efficient than a CPU/GPU miner could be. You could plug your Macbook pro into a mining pool, but you will literally just waste money on electricity, and get zero payout in return.
Not only that, Macbook Pros (or any other laptop for that matter) are not build to be run as hard as mining requires. You run a serious risk of damaging your computer, with basically no chance of reaping a reward.
You will literally have better odds buying a lottery ticket with the money you would spend on electricity.
Comment: I meant a literal lottery ticket, unrelated to cryptocurrency. There are probably no up-to-date mining clients built specifically for macbook pros, as using one to mine would be an outright waste of electricity.
Comment: Thahks but you didn't answer my question.  If I were to purchase the lottery ticket, would it be using a service like RPC Miner? Or is there another client for the Mac?
Answer: He didn't answer your question,  but he gave you more useful information.
I mine with Mac.  I use the Mac Pro (3,1 4,1 5,1).
Even with these machines which are orders of magnitude faster than your laptop, I don't use the cpus.  I use USB based ASICs (antminer) or GPU's (Nvidia 1060, etc.)
I like the Macminer software which is basically a GUI wrapper for the standard mining tools (CGminer, BFGminer).
Basically, I don't see much return this way either these days.  The MacPros in question are servers that are running anyhow,  and are in a cool ventilated location.  I have not tried RPC-miner on the Mac yet.


How To Reduce Dog Snoring

Question: We have a 10 months old, very active Boston Terrier. He exercises everyday at least 30 minutes and it's not a problem to get him to sleep at night.
The only issue we are having with him is that he snores a LOT and of course he sleeps in our bedroom. I can barely hear him snore (I'm a sound sleeper), but is keeping my husband awake and last night he had to sleep on the couch because of it.
We also have three cats that sleep in the bedroom, the dog obviously wants to sleep with the rest of the family, so making him sleep outside would be our last resource.
Anyone has any experience with reducing the loudness of snoring on dogs or training a human to sleep with a snoring dog?
Comment: @PsychOPhobiA and anyone else interested in how this story ended: Now the dog sleeps downstairs :( It wasn't easy but we couldn't take it anymore and I can say he's the same merry puppy he was before, I even think he's more respectful now. Thanks everyone for trying to help.
Comment: Is adding a sound like a TV or sound device to mask the snoring an option?
Comment: @JamesJenkins His snoring is so loud that if the TV volume was high enough to mask it then the TV wouldn't let you sleep. Picture a grown 80kg man snoring, really :)
Comment: @EliBud I have a Red Nose Pit bull and she snores a lot. If your dog is that loud then have your dog leave the room and sleep somewhere else in your house.
Comment: Another update to this story, the dog learned to stop snoring! After we spent some nights with him in a beach house that had only a thin wall dividing the bedroom and living room, we started waking him up by saying his name when he was snoring. Well guess what, he learnt to stop snoring when he's sleeping and you call his name and also he has reduced his snoring to a minimum when he's in the bedroom with us, so now he's back sleeping in the bedroom.
Answer: I have had experience with snoring dogs. When I exercise my dogs all day, especially right before bed, they tend to be so outrageously tired that they snore all night (but not too loudly that it keeps me up). My advice is to not exercise him extensively before bed, give him like an hour or so of rest. This way, when he sleeps, he isn't as tired when it is bed time. Then, hopefully, when he rests, he won't snore.
If your dog is on the heavier side, it could be due to excess tissue in their airway. One piece of advice given is to exercise them regularly, which will reduce weight and snoring. Check out this website: 6 ways to stop dog snoring.
Snoring could also be caused by a cold or allergens. If it is allergens, make sure the bedding he sleeps on is clean and dust free. It may also just be the breed. Some breeds are more susceptible to snoring (like pugs or Boston terriers). In which case, it may be difficult to stop them from snoring.
PART 2 (ADDED):
Ok, so I researched more on Boston Terriers and their snoring habits. It is due to their breed and you can't do much about it. Check out this website: Reduce Snoring. My advice after looking through this and other websites, is to change the position of how the dog sleeps. If the dog is laying on their back, then their snoring will be more noticeable. A recommendation is to get a round dog bed so they sleep in a ball -- which reduces snoring as there is less pressure on their throat in the night. However, I know you want the dog to sleep in the room with you, so I would make the dog move positions if the snoring is bothering you and attempt to train him to sleep on his side or stomach, etc.
Comment: Thanks for the answer, but he normally exercises early on the afternoon and he doesn't have any weight issues. Boston terriers are well known for their snoring but we never thought it could be so loud as to keep someone awake (he really snores like a big person).
Comment: @EliBud I researched more information on this breed and their snoring habits. I edited my answer and hopefully it helps you! If not, let me know and I can continue to research and help!
Answer: I don't know if thread still open, but if your Boston is sleeping on or near wool, try a fleece blanket instead. This made a huge difference.
Comment: Welcome to Pets Stack Exchange! It's OK to add new answers to old questions. It can always help other people with the same problem. Do you perhaps know the _reason_ why this might help?
Answer: I had a Boston Terrier who could snore so loud I could hear him in the living room from the bedroom.  Our vet suggested a children's antihistamine. He has passed away since and I have trouble sleeping without his snoring.  I thought of it as a white noise sound.
Comment: Did the antihistamine work?

How To Reduce Dog Snoring


How do neurons receive the ions needed for creating electrical pulses?

Question: I really wonder how ions are transported into the brain and the neurons for creating electrical potentials - how do ions get from our digestive system to the neurons? Or are the ions just freely released into the brain like hormones? Or are they transmitted during neural signalling somehow (via neurotransmitters maybe)?
Comment: There are voltage-gated ion channels in the cell's plasma membrane that controls the release of ions. https://en.wikipedia.org/wiki/Action_potential
Comment: I voted to close because the title asks for a cellular/molecular approached answer pitched to neurons, the body text asks for a tissue-level answer. It's unclear what you are after. Feel free to edit. It can be an interesting question.
Answer: Short answer
The sodium-potassium pump in the epithelial cells lining the brain capillaries pumps Na+ and K+ into the brain.
Background
The blood-brain-barrier is formed by the endothelial cells lining the capillaries in the brain. Not many compounds can pass this lining, especially not when they are hydrophilic, such as charged metal ions. However, as you rightfully state, somehow these metal ions, and especially Na+ and K+ need to get access to the brain because they are crucial for membrane potentials and action potentials, and hence for neuronal survival and function. And indeed they can, albeit the exchange between blood plasma and brain is slow compared with other tissues.
Intravenously administered K+, for example, exchanges with muscle K+ in 1 hr, but K+ exchange in brain is only half completed in 24 to 36 hr. Na+ exchange is somewhat faster, with half-exchange into brain occurring in 3 to 8 hr. Despite its relatively slow entry into the brain, Na+ exchange across the blood—brain barrier appears to occur by mediated transport. This occurs, in part, through brain capillary Na+,K+-ATPase (the sodium-potassium pump). The Na+,K+-ATPase in the brain also may mediate removal of interstitial fluid K+ from the brain and thereby aid in brain K+ homeostasis.
Reference
- Laterra et al. In: Siegel et al. eds. Basic Neurochemistry: Molecular, Cellular and Medical Aspects. 6th ed. Philadelphia: Lippincott-Raven; 1999
Answer: The cells/neurons themselves have Na+ and K+ channels in their cell membranes that allow for passive movement of these ions between the outside and inside of the cell. If you're wondering how the gradient gets established in the first place, simply put, these channels are built to open/close at the right amounts in their environments. Additionally, the cell uses a Na/K ATP-ase pumps in the cell membrane, which uses the chemical potential energy of ATP, to help regulate and establish that gradient.
Comment: So they all are pumped into our brains while we are in the uterus? I meant more like how do the neurons get it (the way of the ions from our digestive system to neurons) than how do they get into the correct place in the neuron.
Comment: We absorb ions through our GI tract. Those ions are then in the blood. The blood is separated from the brain by the blood-brain barrier, but the endothelial cells can regulate the flow of the necessary ions into the brain, specifically to the cerebral spinal fluid, which bathes the central nervous system with all its neurons.
Comment: @Biomed_guy And how does the ATP pump work?