Dual boot (old model) MacBookPro9,2 running new macOS (APFS) without rEFInd

Question: Is it even possible to dual boot macOS without using rEFInd? In my system, I have a EFI, APFS and Ext4 partitions storing ESP, macOS (either Mojave or Sierra) and Debian. I used to be able to dual-boot, but some grub update killed my setup. I can now successfully boot directly into grub2 then Debian. But grub2 does not detect the APFS partition so cannot boot it, neither does pressing Alt while powering on brings up macOS disk/drive. Without being able to boot into macOS, I cannot "bless" anything either.
Answer: If macOS does not appear as an option from the Mac Startup Manager (i.e. holding down the alt key at startup), then you have something wrong with the macOS installation. This problem would be independent the installation of Grub and Debian.
You have not specified which version of macOS is installed. With the latest versions of macOS, the bless command can not set a default startup unless SIP is disabled. So, most users execute the bless command from macOS Recovery. You have not indicated if the internal macOS Recovery is bootable on your Mac. If not, then your model Mac can access macOS Recovery over the internet.
It would be helpful if you could boot to macOS Recovery and post the output from the command diskutil list. Of course, you should choose a version of macOS Recovery that can support APFS.
Most versions of Linux can be booted from the Mac Startup Manager by default or by copying certain Grub files to the EFI/BOOT folder in an EFI partition. Here the boot file needs to be renamed to BOOTX64.EFI. The problem with copying files is when Grub is updated, then most likely the copied files will not be updated. This is why many users prefer to install rEFInd to the EFI/BOOT folder instead.
Comment: Does this [image](https://cdn.osxdaily.com/wp-content/uploads/2016/12/access-terminal-from-recovery-mode-mac-610x537.jpg) help you find the command line?
Comment: I couldn't boot into macOS for a while but I clearly recall having to disable SIP and bless so I could install Debian without refind by manually editing ESP. I'll look up macOS Recovery over the internet and post back more details.
Comment: I just tried booting into macOS network recovery but couldn't drop to the command line. Apple's Recovery Mode page doesn't mention it either. How do I get `diskutil list`? Also, with how limited Recovery Mode is, any recommendation on how to getting the output out to here?


Does parallel transport change the subspace?

Question: Let $M$ be a Riemannian manifold and $N$ be an immersed submanifold. Take $\gamma$ a geodesic starting at and perpendicularly to $N$. Let $X(t)$ be a vector field along $\gamma$ such that $X(0) \in T_{\gamma(0)}N$. Assume that $X(t)$ is not necessarily parallel along $\gamma$. Take an instant $t_0$ and consider $X(t_0)$. Denote by $E_X(t)$ the parallel transport of $X(t_0)$ along $\gamma$. Does $E_X(0) \in T_{\gamma(0)}N$?
Comment: I assume by the sentence, "Let $X(t)$ be a tangent vector field to $N$ at $t = 0$, you mean $X(0) \in T_{\gamma(0)}N$?  Is that right?  Cheers!
Comment: @RobertLewis, yes, I will rephrase.
Answer: Consider the plane $\{(x, y, 0)\mid x,y \in \Bbb R\}\subset\mathbb{R}^3$, the line $t\mapsto (0, 0, t)$ and the vector field $t\mapsto(1, 1, t)$ along it. Then the parallel transport of no vector in the field along the curve will be tangent to the plane.
Answer: Negative answer. Counter-example: $(M,g) = (\Bbb R^3, \langle\cdot, \cdot \rangle)$, $N = \Bbb R^2\times \{0\}$, $\gamma(t) = (0,0,t)$ and $X(t) = (0,0,\sin t)$. Then $X(0) = 0 \in T_{\gamma(0)}N$, but the parallel transport of $X(\pi/2) = (0,0,1)$ from $\gamma(\pi/2) = (0,0,\pi/2)$ to $\gamma(0) =0$ via $\gamma$ is $(0,0,1) \not\in T_{\gamma(0)}N$. The values $X(t)$ for $t\neq t_0$ should not influence the result of transporting $X(t_0)$, since a priori one transports vectors and not fields.
Comment: I really appreciate your comment about transporting vectors and not fields, this was very clarifying for some stuff I am working on, never had thought about it.
Answer: We of course understand that $\dot \gamma(0) \ne 0$, lest $\gamma(t)$ be a rather trivial geodesic.
We observe that, since $\dot \gamma(0)$ is "perpendicular" to $N$, the condition
$\langle \dot \gamma(0), X(0) \rangle = 0 \tag 0$
is necessary, but not sufficient, for
$X(0) \in T_{\gamma(0)}N, \tag 1$
for (0) says that $X(0)$ has no component along $\dot \gamma(0)$; in the event that $N$ is a hypersurface in $M$, that is,
$\dim N = \dim M - 1, \tag 2$
(0) is in fact also sufficient, for then $\dot \gamma(0)$ and $T_{\gamma(0)}N$ span $T_{\gamma}(0)N$; in fact, (2) implies
$T_{\gamma(0)}M = \langle \dot \gamma(0) \rangle \oplus T_{\gamma(0)}N, \tag 3$
where $\langle \dot \gamma(0) \rangle$ is the one-dimensional subspace of $T_{\gamma(0)}M$ generated by $\dot \gamma(0)$.
Now consider any vector field $X(t)$ along $\gamma(t)$; we have
$\nabla_{\dot \gamma} \langle \dot \gamma, X \rangle = \langle \nabla_{\dot \gamma} \dot \gamma, X \rangle + \langle \dot \gamma, \nabla_{\dot \gamma} X \rangle; \tag 4$
if $X(t)$ is parallel along $\gamma(t)$, then
$\nabla_{\dot \gamma}X = 0; \tag 5$
thus (4) becomes
$\nabla_{\dot \gamma} \langle \dot \gamma, X \rangle = \langle \nabla_{\dot \gamma} \dot \gamma, X \rangle; \tag 6$
now the general formulation of the geodesic equation as I understand it is
$\nabla_{\dot \gamma} \dot \gamma = f(t) \dot \gamma; \tag 7$
here $f(t)$ is determined by the choice of the running parameter $t$ of $\gamma(t)$; if we substitute this into (6), we obtain
$\nabla_{\dot \gamma} \langle \dot \gamma, X \rangle = f(t) \langle  \dot \gamma, X \rangle; \tag 8$
the solution to this linear, first order differential equation for $\langle \dot \gamma, X \rangle$ with $\langle \dot \gamma(t_0), X(t_0) \rangle = \langle \dot \gamma, X \rangle(t_0)$ is
$\langle \dot \gamma, X \rangle(t) = \exp \left (\displaystyle \int_{t_0}^t f(s) \; ds \right ) \langle \dot \gamma, X \rangle (t_0); \tag 9$
since
$\forall t \in \Bbb R, \;\exp \left (\displaystyle \int_{t_0}^t f(s) \; ds \right ) \ne 0, \tag{10}$
(9) shows that
$\langle \dot \gamma(t), X(t) \rangle = \langle \dot \gamma, X \rangle(t) = 0 \Longleftrightarrow  \langle \dot \gamma, X \rangle (t_0) = \langle \dot \gamma(t_0), X(t_0) \rangle = 0; \tag{11}$
of course, if $\gamma(t)$ is affinely parametrized then
$f(t) = 0, \tag{12}$
and we in fact have
$\langle \dot \gamma, X \rangle(t) = \langle \dot \gamma, X \rangle (t_0), \; \forall t \in \Bbb R; \tag{13}$
now taking $t_0 = 0$ yields
$\langle \dot \gamma(t), X(t) \rangle = 0 \Longleftrightarrow \langle \dot \gamma(0), X(0) \rangle = 0; \tag{14}$
if we now choose $X(t)$ such that
$\langle \dot \gamma(t), X(t) \rangle \ne 0, \tag{15}$
(14) together with (0) shows the parallel transport of $X(t)$ along $\gamma(t)$ cannot satisfy
$X(0) \in T_{\gamma(0)} N, \tag{15}$
since it has a component in the direction $\dot \gamma(0)$.


How would you list the available functions etc contained within a compiled library?

Question: How do I determine whether a function exists within a library, or list out the functions in a compiled library?
Answer: You can use the nm command to list the symbols in static libraries.
nm -g -C <libMylib.a>

Comment: `-g` - display only external symbols, `-C` - demangle symbol names.
Answer: For ELF binaries, you can use readelf:
readelf -sW a.out | awk '$4 == "FUNC"' | c++filt

-s: list symbols
-W: don't cut too long names
The awk command will then filter out all functions, and c++filt will unmangle them. That means it will convert them from an internal naming scheme so they are displayed in human readable form. It outputs names similar to this (taken from boost.filesystem lib):
285: 0000bef0    91 FUNC    WEAK   DEFAULT   11 boost::exception::~exception()

Without c++filt, the name is displayed as _ZN5boost9exceptionD0Ev
Answer: For Microsoft tools, "link /dump /symbols <filename>" will give you the gory details.  There are probably other  ways (or options) to give an easier to read listing.
Answer: use this command:
objdump -t "your-library"
It will print more than you want - not just function names, but the entire symbol table. Check the various attributes of the symbols you get, and you will be able to sort out the functions from variables and stuff.
Answer: Under Linux/Unix you can use objdump -T to list the exported symbols contained in a given object. Under Windows there's dumpbin (IIRC dumpbin /exports). Note that C++ function names are mangled in order to allow overloads.
EDIT: after seeing codelogic's anwser I remembered that objdump also understands -C to perform de-mangling.


Am I completely wrong in thinking this question was subjective?

Question: I recently posted this question to get the opinions of other programmers. To me there really isn't a definite answer so wouldn't that make it an appropriate question for this site?
Comment: Expecting casual S[OFUE] users to actually *read* questions where more than 50% of the text is code is... a bit naive.
Comment: @Mr. C - It was closed by non-casual users.
Comment: by "casual" I meant "people who don't care about answering it". I say this because there's no reason your question *couldn't* have been edited into a P.SE-appropriate form, provided someone actually cared enough to do so... This isn't meant as a knock against P.SE's ultra-zealous closers mind you - your question badly needs some clarity, and without it you're dependent on the goodwill/boredom of strangers.
Answer: You're kinda straddling the line between SO-appropriate and P.SE appropriate...
How to ask for a code review
There's nothing wrong with asking SO for feedback on some code, provided you've put some effort into it.
Bad

Is there anything wrong with this code?
???
<massive code dump>

Good

Are there problems with passing a callback to a constructor to allow for lazy initialization?
Description of technique used in code
Brief code snippet(s) illustrating only relevant techniques

You've managed to get about half-way on this: you're asking for feedback on the practicality of a specific technique, but rather than describing the technique and your motivations for using it, you've just dumped the code with a few hints as to what it does. Your question starts out sounding like it might be P.SE-appropriate ("what would you think upon seeing this signature?") but then delves into meatier implementation details (more of a SO thing).
Also, your title is unacceptably vague.
Decide what you want the answers to look like.
If you're questioning the readability/maintainability of the code (whether the implementation, or the client code) then ask about that - P.SE is a reasonable location.
If you're concerned that the implementation itself fails in some way (error handling, efficiency, unforeseen pitfalls involving the callback referencing disposed data) then be clear about why and how you're using it, and ask on SO. Note that you'll probably get comments on readability/maintainability as well, 'cause SO users are helpful like that.
Comment: I really don't want a definite answer in this case. I want to hear the opinions of others so I can relate them to what I already understand. So based off your answer if I were to change the title around *"What are your experiences using lazy initialization via callback?"* and add a bit more meat to the body of the question then theoretically it would be reopened?
Comment: @Chaos: maybe. I'd vote to re-open just for the hell of it, but frankly I think you're throwing away an opportunity for some targeted feedback in exchange for idle chatter.
Comment: C - OK, I am going to have to think about this. I appreciate you taking the time to answer this.


Rails mountable engine assets in production mode

Question: I built a mountable rails engine in rails 4. I used the engine in another app. In development mode everything runs fine, I can reach the engine without any troubles and all engine assets are displayed properly.
But when I deployed the host app to my server, my scss and js files are not included anymore. All the engine assets are compiled properly. Within the public/assets dir there exists a dir with the engines name and I can find the compiled css and js files plus the images.
But! When I open an engine page from within the host app (so the engine layout-file is rendered) the
<%= stylesheet_link_tag "backbone/application.css", media: "all" %>
<%= javascript_include_tag "backbone/application.js" %>

header tags from the engines layout file are translated into:
<link href="/stylesheets/backbone/backbone.css" media="all" rel="stylesheet" />
.

Obviously these tags don't refer to the assets folder. Furthermore application.js and application.css are renamed into backbone.js and backbone.css.
Can somebody tell me why the assets are compiled during deployment, but the stylesheet javascript tags who should pinpoint the assets are completely wrong?? Did I forget some configuration thing in the engine?
UPDATE
config/environment/development.rb:
Nad::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  # Do not eager load code on boot.
  config.eager_load = false

  # Show full error reports and disable caching.
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Don't care if the mailer can't send.
  config.action_mailer.raise_delivery_errors = false

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

  # Raise an error on page load if there are pending migrations
  config.active_record.migration_error = :page_load

  # Debug mode disables concatenation and preprocessing of assets.
  config.assets.debug = true

  config.action_mailer.default_url_options = { :host => 'localhost:3000' }

end

config/environment/production.rb:
Nad::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both thread web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Enable Rack::Cache to put a simple HTTP cache in front of your application
  # Add `rack-cache` to your Gemfile before enabling this.
  # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
  # config.action_dispatch.rack_cache = true

  # Disable Rails's static asset server (Apache or nginx will already do this).
  config.serve_static_assets = false

  # Compress JavaScripts and CSS.
  config.assets.js_compressor  = :uglifier
  # config.assets.css_compressor = :sass

  # Whether to fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = false

  # Generate digests for assets URLs.
  config.assets.digest = true

  # Version of your assets, change this if you want to expire all your assets.
  config.assets.version = '1.0'

  # Specifies the header that your server uses for sending files.
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # Set to :debug to see everything in the log.
  config.log_level = :info

  # Prepend all log lines with the following tags.
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups.
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

  # Use a different cache store in production.
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  # config.action_controller.asset_host = "http://assets.example.com"

  # Precompile additional assets.
  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
  # config.assets.precompile += %w( search.js )

  # Ignore bad email addresses and do not raise email delivery errors.
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
  # config.action_mailer.raise_delivery_errors = false

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found).
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners.
  config.active_support.deprecation = :notify

  # Disable automatic flushing of the log to improve performance.
  # config.autoflush_log = false

  # Use default logging formatter so that PID and timestamp are not suppressed.
  config.log_formatter = ::Logger::Formatter.new

  config.action_mailer.default_url_options = { :host => 'arbeidsconferentie.nl' }
end

Comment: try changing config.serve_static_assets = false to true.
Comment: show your production and development config files
Answer: Depending on the hosting provider you are using, you may have to set:
config.serve_static_assets = true

Heroku for example, does not provide nginx or apache to server static assets. Also, if you want to run your rails server in production mode on your locale machine, you need to set this config to true.


What are other ways to express "something becomes more and more important"?

Question: For example, if I would like to use the word "importance", how can I make the sentence?
Answer: The most obvious phrasing that comes to mind is to say that it is of increasing importance.
Answer: What comes to mind is "to gain in importance."

gain: to gradually get (something) or more of (something) as time passes.

South East Asia is gaining in importance as Japanese investors seek to balance risks...
Answer: Or something gets more importance.


What are benefits of fixing a Grothendieck universe?

Question: Let's assume the Tarski's axiom: For all set $u$, there is a Grothendieck universe $\mathbb U$ such that $u\in\mathbb U$. From now on I will drop "Grothendieck" and just write "universe." I think what one usually does when doing category theory is that one fixes a universe $\mathbb U$ and consider only categories whose set of morphisms is an element of $\mathbb U$. These categories are said to be $\mathbb U$-small. But I do not get why fixing a universe is necessary. Isn't it just fine to consider only small categories (categories whose set of morphisms is indeed a set under ZFC + Tarski's axiom)? Any $\mathbb U$-small category is also a small category (under ZFC + Tarski's axiom). So why do we need to fix a specific universe $\mathbb U$?
Comment: Other people know better than I, but I think it's because we need a starting-point, as opposed to no particular starting point. Yes, then, it's my impression that it's not magically clear, in general, that all outcomes are independent of choice of universe, but, obviously, we imagine that our "small" projects are independent... This may be incorrect, but, in any case, I am interested to hear what more expert people can say about this.
Answer: For example, the category of all small categories (or sets, or groups, etc.) is not small. But the category of $\mathbb{U}$-small categories (or sets, or groups, etc.) is small: in particular, it is $\mathbb{U}'$-small for some universe $\mathbb{U}'$ containing $\mathbb{U}$.


How on EARTH did I get a +11?

Question: This is really just out of curiosity, but it turns out that I had +189 reputation yesterday.  THEN I got a +11 for a vote on a question.  As a result I got the motarboard badge.  I'm not complaining by any means, just curious.  If someone did something to help me out - thanks.
Comment: I looked at your reputation history and it seems there was one question that you earned three upvotes for: http://i.imgur.com/ObjZg.png -- the first 2 upvotes gave you 10 points each (as they should!) but the third upvote only gave you 1 reputation point. Why only 1? Beofett answers this in his post below.
Answer: My guess is that you downvoted an answer that same day, which gives you -1 reputation (and the person whose answer you downvoted -2.
There is a daily limit of 200 reputation that you can earn (not including reputation for bounties and accepted answers).
Reputation you lose for downvoting an answer is not shown to other users (to reduce the chances of retaliatory voting), so I can't say for certain, but I suspect you earned over 200 points of reputation that day (nice job, btw!), but only 200 points + 1 extra point to compensate for what you lost by downvoting an answer counted due to the daily cap.
Example: if you get upvotes on 30 answers in one day, you'll only get 200 reputation due to the cap.  If you then downvote an answer, you'll be at 199 reputation earned for the day, but if someone upvotes another one of your answers that day, you'll only get 1 reputation, to bring you back up to the 200 reputation cap.
Comment: But the fact that there is a 200 point cap DOES explain it.  I just didn't get the other nine points? I think.  I have, in the past down-voted things so I didn't start at an even number.   Thanks for the help.
Comment: This makes sense and is a great explanation ... except that the user's reputation list does not show any negative rep for that entire day! So I'm not sure how that odd number really happened.
Comment: @TorbenGundtofte-Bruun As I understand it, downvotes that you make on someone else's answers or questions do not show up on the reputation list to anyone else.
Comment: @TorbenGundtofte-Bruun I found an answer that deserved a down-vote, that I hadn't previously voted on.  Please check if you can see a -1 reputation for me today.  I suspect you won't see it.
Comment: @Beofett you are right, I don't see a -1 in your rep list for today! That makes your answer complete - you rock!

How on EARTH did I get a +11?


Matrix report data via analytics API

Question: I am trying to write code for creating reports in pdf format. I could see example for traversing tabular report using analytics api. But I am not able to understand how to traverse for summary or matrix report using analytics api.
Answer: The only difference for traversing tabular, summary and matrix reports is factmap. You have to find groupingdown for summary report, groupingdown and groupingacross for matrix report. then iterate through them accordingly and can retrieve values by appropriate factmap.
Factmap for reports:
Tabular: !T
Summary : Gropingdown.key ! T
Matrix : Groupingdown.key ! Groupingacross.key

Matrix report data via analytics API


Linear equation for a great circle on a (multidimensional) sphere

Question: Can we introduce independent coordinates on a sphere such that any great circle could be represented as a linear equation (like line on the plane)? If yes, what is a generalization for higher dimensions?
Thank you in advance.
Comment: When you say "multidimensional" are you then talking about great hypercircles (or whatever they would be called)?  The intersection of a hyperplane with the sphere.
Answer: This can be done locally by projection from the center of the sphere. Great circles go to lines, so if you pull back the cartesian coordinates from the plane to a hemisphere, every great half-circle is described by a linear equation.
You cannot extend this beyond the hemisphere, because two great circles meet in two points, but a system of linear equations cannot have two solutions.


Should I "spanglish" a Mexican character's dialogue?

Question: I am working on a novel based in Mexico, and I am wondering if there are any strong opinions on whether or not I should put common phrases of speech in Spanish even though all characters are speaking mostly English (for the sake of the audience).  It feels natural to do, for example "dios mio" or "amigo", etc., but I am wondering if it's too inconsistent or possibly distracting from the narrative flow. Thanks!
Answer: It depends, and indeed there could argue that your question could only generate opinion based answers, and should be closed, but you are brushing against a core issue, which is how to show the differences between the world where the reader lives and the world in which the story is set while maintaining readability and understandability. This is particularly visible in science fiction and fantasy and translated works. The three most contentious sub-questions revolve around names, units of measure and bilingual characters. If you want to waste an afternoon, ask me about measuring the saturn rocket in cubits, or the ten gentile pateraks.
So lets step back and look at practical considerations. To simplify let us assume that you are writing in english and targeting an audience that has a five word spanish vocabulary. (and that three of those words your editor would reject) Now, that limits us to two major scenarios, your narrator's first language is spanish or it is not. If the narrator thinks spanish, look at all your dialog as translated using the rule transcribe names, translate everything else. If your narrator is bilingual or foreign you have the harder challenge but simpler question of what would the narrator's character do.
But then you ask, what if I am writing from the third person? This only means that you probably are the narrator. How well do you speak Spanish?
Comment: You answered my question as though I had asked a better one.  Much appreciated. In fact the narrator is 3rd person omni so I am thinking that very minimal spanish in the dialog will be appropriate and set tone much like a television character that speaks in english but then says "cabron." The other main character is from the U.S. so I feel like I really need the distinction to help organize the narratives in the reader's mind. I did worry that this was too much of an opinion-baiting question but I also felt there was a formal way to dissect the issue and you did that for me. Thanks!
Comment: You may consider having all your spanish speaking characters use standard english, and you english speaking character use regional dialect to show contrast. Y'all come back now, here.
Comment: Yes I will take a look at how that works. Thanks again.
Answer: I would advise against it as it's not natural and seems to force the language where it isn't forced.  I generally subscribe to translator chip theory of fiction, based on the concept used in Star Trek...  Basically most of the space fairing peoples have a device hidden in their ear that instantly translates a speaker's words into the listener's language... thus Picard, a French man, speaks in French, which is understood by Alaskan Ryker and Russian speaking Worf (he was raised there and learned Klingon seperatly).   The audience hears the entire exchange in English (or dubbed in another language where it's spoken).
There are some exceptions to this idea...  When refering to a specific word from a different language for some kind of discussion (for example, if your characters are offering a translation of the word OR the word/phrase is not a known concept... Siesta would be the best way to discuss the concept as Siesta as there isn't an English equivelent) or if the foreign language is a loan word (For example, Veni, Vidi, Vichi is a well understood Latin phrase in it's non-native English).
In real life, most people who speak two languages fluently to be conversational will not drop into their native language while speaking their second language, unless surprised enough (Most people swear in native languages... and foreign curse words are great work-arounds for English Language works to drop some cursing when you shouldn't).   The other time native language is spoken in a second language environment is that most bilingual people will do math in their native language, since Math is language dependent in the strictest sense.
If anything in your work, an English speaker in Mexico is more likely to drop into Spanish than the Spanish speaking character.   While they don't engage in much foerign travel, when they do, Americans do typically try to learn some local language skills in order to be polite.   English is commonly taught in many non-English speaking nations... between "The Sun Never Sets" era of the Bristish Empire, The Pax America period that followed and currently shows no signs of stopping, and the fact that the internet is very commonly in English... but again, since Americans don't travel outside of the States often, they do worry about not understanding the foreign languge they are going to vacation around and will try to pick up some curtsy phrases (please, Thank-You, I'm sorry, excuse me) basic counting numbers, quick ways to order food (Cause Americans are going to eat), the ability to ask for directions with a map (and to the Bathroom).  It's normally not going to be asked in the best way, but most people in tourist areas figure if they see someone asking questions in very bad local language skills, they're probably Americans and will ask if they can speak English.  And most countries find it endearing enough that they bothered to try rather than take offense.  In fact their are surveys out there that posit that this is one of the American Tourists' better qualities.
Answer: I think it can work very well, used judiciously.  It adds color and a sense of place.  I write many stories based in Mexico, and ultimately I took inspiration from Hemingway, who often included local-language (often Italian and Spanish) phrases in his works, such as A Farewell to Arms, For Whom the Bell Tolls, The Old Man and the Sea, and many short stories.
One example of this in my own work is my short story Cuervo, on my blog.
Answer: I recently completed my dissertation where the main character was German. The advice I was given was that if it was a common phrase people were likely to know, (for instance, 'Sì'), use it. If it's a less common phrase, put it into italics and translate it or explain in the next sentence. For instance if your character asks, '¿Que estas leyendo?' ('What are you reading?'), have the person they're asking reply, 'I'm reading Gone Girl,' and the audience will work out the rest.
Using the language from where your story is set helps the reader to picture the setting and can say a lot about the characters, too. You could have one character use more Spanish than the others, or one that doesn't speak any Spanish at all.
I'd say do it, but don't over do, because that can be distracting. However, it's better to use too much and cut it out than be conservative - follow your instincts on what fits, what doesn't, and what's right for your characters.


Help! Need a different logo on my main page from my other pages

Question: First off I am not a coder and its my first time creating a website and using word press.  I am having an issue with my Logo.  It is very large and only would like to use this logo and size on my main page.  All the other pages I would like to just use a very small logo.  Please help!  Like I said I am very new to this so I need very basic instructions.  Your help would be so appreciated - I am a new business and cant afford to hire a developer at this time.  Thanks in advance
Answer: In your header.php which you copied into your child theme, replace the logo request with this:
<code>If (is_front() || is_home) {
//Your logo for the front page
}Else {
// Your other logo
}
</code>
If your home page is static use is_front.  If your home page is blogs use is_home.
I looked up your theme "classify".  If it's the one from themeforest login to your themeforest and download the complete theme folder not just the WordPress install file.  In the file you downloaded you'll find the "classify-child.zip" install that as well into your WordPress theme.  this will make a copy of the theme that you can customize but won't be affected when you update the actual classify WordPress theme next time.
Now, from the classify folder, copy the header.php file into the classify-child folder in your wordpress install.  Make the changes in the new header.php file that is in your classify-child theme.
Comment: Ok so like I said I am a beginner.  I have one theme. Classify.  I found the theme editor and than I found header.php.  Is this where I should be going?
Comment: Amanda, that could work.  I added a bit more information into the answer above.  If you don't know how to get the child theme setup you can do a bit more research or if you plan on NEVER updating the theme you can make the changes right in that header.php file you found.  I strongly suggest child theme though.


Microservices of different resource type

Question: I am building a system composed of a few micro-services over AWS.
I encountered the need of a certain MS to do the same logical work but of a big range of work load.
for example, the same logical work could need 2vcpu and 4GB ram and another will need 4vcpu and 16GB ram.
What is the best practice here? have all the instances big enough to fit my needs? have 2 ECS services one of 2vcpu and one 4vcpu having different SQS deliver the work load?
or is there other rational idea here?
Comment: *why* are there so drastically different resource requirements for the same task? If it is so different is it really still the same task? How would the correct instance be selected? Would it be up to the user of your service, or would your service determine that internally?
Comment: Data processing, could be small amounts of data for a very small customer or a lot of data for very large customer. Different Qs for Different workloads.
QNormal for regular work loads
QXL for large work loads
Answer: Usually, the assumption for a microservice architecture is that we want to be able to scale horizontally. This only works well if there are no differences between instances of the microservice. In particular, sessions or workloads should not be pinned to a particular instance, and it should be irrelevant which instance handles a task.
However, that is not essential.
What is essential for a service-oriented architecture is that you offer some network-based API to users of your service (e.g. a REST API). How your service then handles tasks internally is an implementation detail. It is absolutely OK if your service internally uses different sub-services, as long as the user of your service doesn't have to deal with this. For example, your service could use a gateway that forwards tasks to appropriate servers.
Is this a good idea? Hard to tell. It depends so much on circumstances.

If simplicity of the overall system is more important, keep all instances of the service the same. Make sure that each instance is able to handle every task. Keeping the infrastructure simple is especially important when this service isn't your primary responsibility. There are still some opportunities for cost optimization here, e.g. shutting down unneeded cloud-based instances depending on the load.
Using a bunch of chonky servers can make sense even when a fleet of tiny servers would also work. If a large instance can either handle one big task or two small tasks at a time, then just running two large instances will be easier and far more flexible than a 1×large + 2×small configuration – possibly at the same price.
If you are able to focus only on this one service and if small improvements multiply to large cost savings across your entire organization, then using a more complex internal architecture may be worth it. This could include heterogeneous infrastructure. But you only have a good business case for such cleverness if the extra development costs are amortized within a reasonable time frame. Quite often, it will be cheaper to just throw more hardware at the problem.
Comment: thanks for the answer.
All those down votes I bet they never had to reduce Production costs.
you're second points seems more fitting, its obvious to me that I can't have all instances to fit the largest work load as the cost will be enormous and yes I can have a large instance load work on 2-3 jobs at a time if small and 1 if large but that introduces more complexity to the system as the instance will have to wait till free to run as 1 work unit.


Moonshine from freeze distillation?

Question: Just wondering is it possible to turn fermented sugar water with an abv of around 15% into moonshine by freeze distilling it. Also wondering if i would have to worry about methanol when using this technique
Answer: You are right to be concerned about methanol it is a very nasty poison. You are at a lower risk of building up a dangerous level of methanol from all grain fermentation as it produces roughly 1/10 the amount of methanol as grape or fruit fermentation. I don't know about sugar water fermentation but as it lacks any pectin or cellulose it should be cleaner regarding methanol than grain.
In whiskey production which is a grain fermentation they drop the heads, and tails from the distillation, as the heads contain methanol and the tails off flavour longer alcohols. You do not have this luxury in freeze distillation.
The level of methanol can be reduced by choosing a clean fermentor, the right yeast will ferment with lower methanol levels. Also good temperature control can also be used to reduce the levels.
Unfortunately testing for methanol is not easy or simple you can use Sodium Dichromate and Sulphuric Acid, or send a sample for Gas Chromatography or Mass Spectroscopy.
When thinking about brews like the famous Tactical Nuclear Penguin or Sink the Bismark, just remember that Brewdog will have sent these off for lab analysis before putting the product out for sale.
All of this said you should be OK, but it is right to be concerned about such things and to understand the dangers.
If you do go this route, you are probably best to stop after a couple of rounds of freezing as you get diminishing returns after that.
This topic of testing is discussed further here.
Comment: Simple sugar fermentation does not produce any appreciable methanol. Methanol production only become at all significant when fermenting fruits and in particular fruits with a stone (cherries and plums being the worst) when up to 1% methanol can be produced.
The increase of ABV by freezing seems to diminish after about 4 freeze/thaw cycles. However that should be enough to get to at least 30% ABV if not 40%.
Comment: @barking.pete - Do you have a reference for the methanol from sugar production?  Thanks.
Comment: No references for methanol from simple sugars. Methanol is produced by hydrolysis of methyl esters of galacturonic acid  that is the sugar acid monomer base of pectin. Fermenting pure sugars does not produce appreciable amounts of methanol. Fermenting fruit musts/juices than contain pectic does produce methanol, the amount depends on the amount of methylated pectin (as opposed to the unmethylated galacturonic acid ).As a guide fruit pectins are about 80% methylated. IIRC less methanol is produced when fermenting at lower  temperatures.
Answer: Short answer - no, you don't have to worry about it.
Long answer is:  Methanol exists in (I think) any brewing process.  The reason there was poisoning in the bad old days of prohibition is that it has a lower boiling point than ethanol, so when it was distilled, methanol came out first so when some moonshiner was distilling, the initial liquid that was recovered had high methanol concentrations.  If that was sold, it was poison.
On top of that, our good old Federal Government INTENTIONALLY poisoned alcohol to dissuade people from purchasing the illegal drug.  Yes, out dear old government intentionally poisoned the illegal hooch supply.  At least 100,000 are estimated to have died from that.
Moonshiners were brewing hundreds of gallons at a time, and when they distilled (with heat), methanol had a lower boiling point, so that came out first.  If THAT was drank, well, quite dangerous.
The rest of the distillation was ethanol (mostly) and water and dilute amounts of methanol.
You will always produce some level of methanol in home brewing, but it's negligible.  Beers you buy from a store contain some level of methanol, so do wines.  Distilled products (probably) take some care to remove it - although I have my doubts with the cheaper rums..
It's only with distilling when you are concentrating it you have to worry.  Distillation is illegal without a license, and you better darn well know what you're doing in order to do it safely because you're vaporizing a flammable gas.
With freeze "distillation", you're just concentrating anything that isn't water.  I don't recommend you do this regardless - brew a cider, it's pretty simple, you need to add sugar (white sugar CAN be used, but mix it up a bit), and use a cider yeast.  That's quite drinkable.  If you do not add sugar, it will be about 5-6% ABV, with sugar, you can get it up to 12%-16%.  I'd suggest "brown sugar" - which is really just white sugar plus a bit of molassis.
If you just want alcohol, I guess white sugar + yeast + 1 month + and freezing it will do but you better find a mixer which kind of destroys the point of distilling it.
Look up AppleJack, that's easy enough to make.  Trust me, I've made it, and I'm a freaking idiot.  You can screw up anything, but brewing cider is one of the easiest things to do.  It won't be carbonated, and if you're making AppleJack it certainly won't be carbonated.
Carbonation requires a bit of calculation, and if you want sweet cider that is carbonated, it requires calculation, time, and a way to kill the yeast at the right time.  Some people just brew cider wine, add additional sweetener, and then artificially carbonate it.  Other people go through all the math of how much CO2 will be produced by how much sugar - but be cautious with this, you're making a bomb if you screw up your calculations - if you want to carbonate, at least for the first time, put it in a box to ferment, and put that box in a box, and do it in a plastic bottle, not glass.  Old soda bottle is a bit ghetto but will work, and you can check to see how much pressure it is under.
Soda bottles are designed to handle 90PSI at least.  If you buy a coke, and shake it up, it DOES NOT increase the pressure of the bottle.  It's at equilibrium to begin with.  The tightness of the bottle will give you a good idea of how tight it should be before you pasteurize it - this is usually done by immersing it 140F water until it reaches 140F.  That will kill the yeast, but be damned certain you kill the yeast, otherwise, again, you have a bomb.
Comment: [Citations Acquired] https://slate.com/technology/2010/02/the-little-told-story-of-how-the-u-s-government-poisoned-alcohol-during-prohibition.html  and https://www.pastemagazine.com/drink/alcohol-history/prohibition-history-methanol-poisoning-bootlegging-alcohol/
Comment: I'd love to see references for the Federal Government (assuming the US?) poisoning alcohol... how would they poison moonshine anyway?
Comment: @Robert - they poisoned what we call (in Australia) Methylated Spirits, maybe it's also known as denatured alcohol,  rubbing alcohol, fuel alcohol, etc.  I read that the inclusion of this was at the insistence of the Prohibitionists.  But yes, *citation needed*.
Comment: Thanks @Kingsley, Wikipedia also has an [article](https://en.wikipedia.org/wiki/Denatured_alcohol) on it. I was missing the "denatured alcohol" context and was wondering how you can mess with something you don't have, or how you'd distribute messed up alcohol for drinking if drinking wasn't allowed.
Answer: Methanol comes from cellulose & pectin, which for homebrewers means fruit. So, you shouldn't have any problem there.
Freeze distilling should increase your alcohol concentration, but I don't know how that would taste. Moonshine in my country is still made more-or-less like whiskey (corn, grains, etc).  Fermented sugar is more of rum making thing.
Comment: Use the inner diaphragm of a walnut (the inner bit between the halves of the nut, that you don't eat) if you want to colour and flavour alcohol in the fashion of whiskey. It takes about 3 months to colour and flavour well. It does not make "true" whiskey as that would need some years of conditioning. if you want a Spanish Brandy type flavoured spiirit then soak the spirit in sultanas for a month or so (the sultanas taste great afterwards). There are a number of other tricks but none of this is about brewing, so....
Comment: I was just double checking the methanol thing because i already read that its mainly a problem with wine etc. Rum could be nice.
Comment: But rum without barrel aging would not really be rum I think.
Comment: Could i let it age in a bottle with like a piece of wood or walnut. I was reading on distilling whiskey before and i heard people do that to let it absorb more flavour
Answer: Q1) No. you won't achieve moonshine levels of alcohol with freeze concentrating without the ability to super freeze. Ethanol works like an antifreeze.
http://www.themadscienceblog.com/2014/01/chemistry-of-beer-part-ii-freezing.html?m=1
Q2) answers in other posts
Answer: If one were brewing with yeast and sugar then one would not have to worry about methanol. methanol production only gets problematic when using fruits, especially stoned fruits, as a source of sugar when fermenting
Freeze distilling can be performed multiple times on a standard mash brew to obtain a strong alcoholic drink (eg BrewDog's "Sink the Bismark" - 41%ABV). Whether that counts as "moonshine" is up to the consumer to determine.
However this question may be off topic for this particular brewing forum.

Moonshine from freeze distillation?


How to program for Windows in Ubuntu?

Question: Is there anyway to create (C++ or C#) windows console applications inside Ubuntu's IDE (e.g Anjuta) and compile it for Windows?
Comment: mingw is the obvious choice for cross-compiling, but i have no idea how to integrate it with Anjunta.  I did see a tutorial on integrating mingw and kdevelop here: http://forums.gentoo.org/viewtopic-t-292180.html  maybe one of the folks recommending mingw knows of an integration with Anjunta tutorial?
Answer: You want to do cross-compiling, which is a way to compile code for platforms other than the one your on, especially when the processor is completely different. Basically you need to install all the headers for your target (i.e. windows) and then tell the compiler it's cross-compiling so it won't do some of the system checks and instead will point to non-standard directories.
Depending on the language you might find it useful to do a search or question specifically, or if you're doing basic c you can use MinGW tools and the same sort of linux based compile tools that use gcc:
sudo apt-get install gcc-mingw32
There is a good guide for qt/win32 cross compiling using MinGW tools.
Answer: You should have a look at MingW. It provides a gcc-compatible compiler for windows.
There is a cross-platform version that you can use from Linux, to generate Windows binaries. You can install it with synaptic, or by running:
sudo apt-get install gcc-mingw32
Based on that, and with using the usual 'make' command, you can create programs for windows.
Then any IDE that allows you to use make and gcc can use this compiler.
 For instance, here is how to do that from the Code::Blocks IDE.
Comment: good enough for me +1
Answer: The other answers are correct for C/C++ code; you'll need to get a cross-compiler.
For C# code, you can just use Monodevelop , as Mono's compiler produces the same type of bytecode and executable format as the .NET compiler (and visa versa).  Apps you build with Mono will run unmodified on Windows machines as long as you stay within the standard .NET Base Class Libraries or bundle any extra library you use with your app.
Answer: Might want to give Qt with Qt Creator a try. Great framework for GUI and Console application you can the compile for Windows, Linux and OS X.
http://qt.nokia.com/
Answer: The most common way to program windows application linux (ubuntu) is using the mingw tools:
http://www.mingw.org/
There are ubuntu packages for mingw ready to install.
Answer: From this page:
sudo apt-get install wine mingw32 mingw32-binutils mingw32-runtime

This is all that is needed for basic cross-compilation. Let's try:
#include <windows.h>

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
  MessageBox(NULL,
    "Cette fenêtre prouve que le cross-compilateur est fonctionnel !",
    "Hello World", MB_OK);
  return 0;
}

Compile this using:
i586-mingw32msvc-g++ -o essai.exe essai.cpp

To execute, you need the mingw library: mingwm10.dll:
gunzip -c /usr/share/doc/mingw32-runtime/mingwm10.dll.gz > mingwm10.dll

Then you can launch it:
wine essai.exe

The text of the dialog box is in French language with an accent, to do it with gvim, convert the source to windows code page 1252: <ESC>:e ++enc=cp1252
Another solution, more powerful is to use UTF-8 but this requires changing the way strings are handled.

How to program for Windows in Ubuntu?


Strict Nat on Xbox One

Question: This is an older topic and shouldn't be questioned but I cannot fix the nat type on my xbox. I have done everything possible. I ain't a techy person... At all... mostly no clue what I am doing. But I did everything I could find on how to fix this problem. I have it wired to my Gateway Router which is a Arris DG1670. But in all seriousness. I have tried a lot. Wireless, Port Forwarding, Static IPs, DMZ, nothing works at all. Maybe it is the router, me, ethernet cable, idk. It is striaght up plugged into it. My router doesnt notice the xbox one when it is plugged in but notices it when wireless but it still stayed strict with portforwarding. Idk... I am a fool with this stuff.... pls help
Comment: a quick [google search](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=xbox%20one%20strict%20nat%20Arris%20DG1670) brought up many other common issues, so it could possible the router is just incompatible. Have you tried wiring the console directly to your internet modem?
Comment: Could you please elaborate on "My router doesnt notice the xbox one when it is plugged in[...]". Also, do you have any other devices using the same router? For example, the Xbox 360 uses mostly the exact same ports and routers, at least the affordable ones, are only able to forward one port to one device. If you have multiple devices that need to have the same port forwarded, the router will assign priorities which could mean your One, although you added the settings, might not have the ports forwarded, resulting in a strict NAT.
Answer: I have been successful with putting  my Xbox on DMZ with this router. At first I had trouble with the DMZ until I read somewhere that you have to make sure that you enable your firewall. So you go to the firewall tab and enable firewall with The DMZ settings and it should work. Remember though you can't have any other settings such as port forwarding or it may not work so clear out any other settings you may have tried.

Strict Nat on Xbox One


Test USBasp health

Question: I have just assembled a new USBasp which is a USB programmer for Atmel AVR microcontrollers. Is there any way under Linux to check its health without any other microcontrollers connected to it?
Comment: Any comment about the answer below, I find it more convenient to read a uC to check programmer.
Answer: You can only check if the PC can communicate to the programmer. You can't check if the programmer can interface with an (unconnected) microcontroller.
I don't have such a programmer to verify the exact workings, but the concept should be a bit like this:
Recipe
Execute this command:
avrdude -p attiny13 -c usbasp -P usb -v -U flash:r:/dev/null:i

It will try to read the flash memory from the connected microcontroller.
PC cannot connect to programmer
If it throws a:
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

then your programmer does not respond to the PC, for whatever reason.
PC can connect to programmer but not communicate to AVR
If it throws (similar to):
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

then the PC can interface with the programmer.
Without connecting to a microcontroller, you cannot be sure that the programmer. If you have access to an oscilloscope, you can check if the RESET line toggles, but you won't be able to fake the handshake without a smart piece of electronics.
Fully functional
If you connect an AVR to the controller, make sure you have the correct device set up in the commandline (attiny13 in my example). If all is set up correctly, avrdude will show a 100% progress bar.
Reading | ################################## | 100%

In this case the programmer proven is fully functional

Test USBasp health


What is the best way in letting a user set a default to an enabled function?

Question: Not really sure if this concept is better. By setting a default, it automatically switches to Enable and lock icon appears next to toggle switch to signify that it is not available for any action.
Comment: could you explain a little further what's the application about?
Comment: The question is difficult to interpret because the illustration seems to have conflicting information. The Lighten and Darken settings are both on. Four of the settings seem part of a continuum (Lighten More, Lighten, Darken, Darken More—should this be one slider rather than four toggles?). Turbo is seems unrelated to the idea of light and dark. Normal implies the other settings may be abnormal, or odd. Despite all this, I'll try to answer your question, below.
Comment: *"..lock icon appears next to toggle switch to signify that it is not available for any action"* - what do you mean by that, could you clarify?
Answer: This design is difficult to interpret, so the question is challenging to answer.
Here's my interpretation of the design:

The user can selects a default. Only an item that is switched On can be a
default.
You want to prevent users from switching the current default to Off.
If the user selects a default that is Off, the system forces it to switch On.

This third point leads me to a question. If a change in the default radio button can force a change to the corresponding switch from Off to ON), then what about the inverse? Perhaps a change to the switch's state (from On to Off) can force the default to a different radio button? If so, you don't need the lock icon.
Separate from this, please consider the comment I wrote under your question. The items in this list might be better in a slider, and the wording doesn't readily identify the items as a series of logical choices.
Finally, the word "Normal" is problematic. Microsoft Manual of Style for Technical Publications recommends against using this word because of its potential to offend. (What is normal? Whose default is normal? Is everyone else abnormal?)
Comment: Good point about the use of the term `normal`.
Answer: From what I understand a user can activate a item indirectly by selecting it as default. While there is no technical reason to prevent this, I think the UI would become a lot easier to understand in terms of it causalities if items that are not enabled have their radio button for making them default disabled (greyed out).
You have one UI action here (clicking the default option on a disabled item) that essentially does two things at once (enable it, then set it as default), but from looking at the UI it's unclear if this is indeed the outcome of clicking it. The contradiction here is that a disabled item might also be unavailable for setting as default.
Why? When looking at this UI, it is unclear if a item that is not enabled can be a default. By showing a correlation between being enabled and allowing to set it as default, the user has a logical path of how to set something as default, even if it is not enabled in the first place. They first have to enabled it, the radio button for making it default will become active, and then they can set it as default.
As per my comment above, I don't understand the lock icon. If it is merely a duplicate information about this item being currently selected as default, you should remove it because it prompts the user to search for the meaning it signifies but isn't there.


Efficiently generating a prime polynomial of a given degree

Question: I'm playing around with finite field arithmetic and implementing it in a little library. I'd like to be able to handle arbitrary finite fields given their size and characteristic. I don't want to write down a prime polynomial for every given possible finite field though. How can I generate a prime polynomial of a given degree for use in multiplication? To be clear I don't care which polynomial I get, and I don't want all of them. I just want any old one of a given degree. If this is an open research question what if we only try to solve it for $GF(2^n)$?
Answer: It suffices to construct an irreducible polynomial of degree $n$ over $GF(2)$ (as this immediately induces an explicit construction for $GF(2^n)$).  So, how do you generate an irreducible polynomial?
One approach is to repeatedly choose a random polynomial of degree $n$, then test whether it is irreducible.  You can test for irreducibility by factoring the polynomial over $GF(2)$.  There are standard algorithms for polynomial factorization; they run in polynomial time.  Moreover, about a $1/n$ fraction of all polynomials are irreducible (see here).  It follows that on average about $n$ iterations will suffice, and since each iteration can be done in polynomial time, the whole thing runs in (randomized) polynomial time.
Comment: Thinking about it, if you're working over $GF(2)$ and testing random polynomials you can easily improve the odds to $2/n$ by ensuring that you have an odd number of non-zero coefficients (i.e. don't select the constant coefficient randomly).
Comment: How do we know about 1/n are irreducible? I've read that in "fast construction of irreducible polynomials over finite fields" (well actually 1/2n but same difference). The reference hits a thick textbook though.
Comment: @Jake, the linked Wikipedia page gives a sketch of how to prove that 1/n of *monic* polynomials are irreducible. But multiplying by a constant doesn't change reducibility.
Comment: @PeterTaylor, indeed -- and moreover in this case, we are working over $GF(2)$, and all polynomials over $GF(2)$ are monic.
Answer: In a related question on MathOverflow, Igor Rivin provides a link to a 2009 pre-print of a paper of Couveignes and Lercier, Fast construction of irreducible polynomials over finite fields, which uses elliptic curves to provide a probabilistic quasi-linear algorithm. The paper was published in Israel Journal of Mathematics (2013) vol. 194, pp 77–105, DOI https://doi.org/10.1007/s11856-012-0070-8


Reduce the size of an odt file

Question: Sorry if this is not the right forum in the frame.
I reused a MS Word template to create a document with LibreOffice. The final output was a huge file, as lots of MS Windows fonts were integrated into the odt document. I unzipped to odt document, deleted the unused fonts. Now how can I compress the folder again to get my odt file back ?
Answer:
Now how can I compress the folder again to get my odt file back ?

Zip it. When you enter the unzipped directory you can do
zip -r ../{filename}.odt

where {filename} is the name you want it to be and it will recreate your .odt; hopefully with a smaller size.

Extra comment:
The "mimetype" file should be 1st in the archive (though OO does not care about it other software might). You can force that by doing
zip -r ../{filename}.odt mimetype .

Comment: Thanks. Here is what I typed and the error message I got:

root@m193530:/home/kalzi01/Documents/Projets/Sondage2017/PortraitLL_AdminPublique-V0.7.odt_FILES# zip -r ../Portraitv07Compresse.odt

zip error: Nothing to do! (../Portraitv07Compresse.odt)
Comment: Yes, all the unzipped folders and files, which is the result of the extraction of any odf file.  Actually, it turned to be a LibreOffice matter. Here is what I did (I ended up finding the solution"):

In LibreOffice Writer, I opened the file, went to file, properties, clicked on fonts tab and unchecked the box about fonts embedding. The size went from 9.3 MB down to 243K!
Thanks for your help!
Comment: Is there anything in the directory?
Comment: Oh big reduction :D Good you got it fixed.

Reduce the size of an odt file


Black screen while installing ubuntu 13.10 HELP!

Question: I just bought an alienware M17x R4 (NVIDIA® GeForce® GTX 765M  and Intel Haswell graphic cards), I am trying to install ubuntu 13.10, just after booting on the CD and choosing the installation option the screen goes black, i want to use the CLI option (F4 modes) but i have only 3 options :

Normal
User drive update disc
OEM install (only manfacturers)

Has anyone a similar problem before? Thank you for you help
Answer: I finally found a solution for the black screen of death, after booting from the CD i followed the steps bellow  :

Press shift
F6 different options --> nomodeset
Install ubuntu

It works just fine for me.


Why is it bad to exclusively rely on plot twists to create tension?

Question: Why is it bad to exclusively rely on plot twists to create tension? I was told that some novice writers often make that mistake, but I am not sure why it is considered a mistake. Why is that the case? What are other means to create tension other than plot twists in your story?
Comment: Unless it's a day-time soap opera. In that case, plot twists might dominate.
Answer: Plot twists are almost always part of 'the outer journey.' The plot is the sequence of events, after all, which is external to character. For something like an RPG, the outer journey is pretty much the whole story, and so a sequence of twists in order to build tension might be all right.
But in novels, there are also characters with inner journeys. The characters change, they evolve, they grow, they move. This is a balancing source of tension.
Outer tension and inner tension work well together.
Additionally, you can create external tension through other mechanisms besides plot twists, and doing so will elevate your writing by making it more complex. A quick example of adding tension would be to use a 'ticking time bomb.' This is not a plot twist at all, but a deadline that must be met. The audience is aware that the clock is ticking down, and the audience grows more tense wondering if the hero will beat the clock.
Good luck with your writing.
Answer: The problem is that poorly done (and even many well done) twists come across as a lazy solution.  The author works the characters into a bad spot, then - surprise! - saved by the twist.  It also works the other way, with the characters accomplishing some goal then - surprise! - crushed by the twist and forced to start over again.
Another problem with twists is that once you've read them there's no tension anymore - hence the modern obsession with "spoilers."  If all your story has going for it is that one moment of surprise, then any revelation about the story will ruin the twist and make the story boring.  It also makes it unlikely that anyone will read your story again - it has nothing but a twist, and once you know it there's no point in re-reading it.

A good story lives on a lot of things:

Interesting characters
Interesting places
Interesting events
Character development
World development
Interactions between characters, events, and  the world they take place in
Something the author wishes to express in the story

That last point is something that many authors seem to not understand.  It is not enough to tell stories about strange people and places.  World building alone is a boring read.
A good story includes things that the author wants you to think about.
Those may be things the author wants you to agree with - say, a science fiction novel depicting a post apocalypse world caused by man-made pollution as an argument for better control of waste and pollution.
It may be an argument for (or against) the death penalty in a story about a murder trial.
It may be nothing more than a presentation of contentment in a slice of life story.
Whatever it is, it has to be more than "hey, look at this wild world and the strange people I made up."  It has to be more than "I wrote a story for people to read because I want to be a famous author."
Any good story has points that it is trying to express.  A good author puts them in on purpose and works them into the narrative.  A lucky author weaves them in accidentally, then wonders why the story is so well liked.  A bad author pumps out pointless stories and wonders why they are poorly received despite having all the supposed earmarks of a good story.
Forget all the places and events and magic (or technology) in your story, and ask yourself what your story is about.  If you don't know then it is very unlikely that you will write a really good story.
All the events and people and places and things are a vehicle to carry some important thought from the author to the reader.  Without that one thing, all the other elements (including twists) are just pointless anecdotes scarcely worth the paper (or electrons) they are written on.


"Importance Sampling of Many Lights with Adaptive Tree Splitting" - paper: participating media

Question: I'm reading and implementing a paper about Importance Sampling of Many Lights with Adaptive Tree Splitting. In section 5.2 on cluster importance for participating media, there is a part that I don't understand: How do they compute the vectors o1, o2? I don't understand the paragraph explaining how to obtain this basis from v1, v2. Can anyone explain it?
Answer: Someone else feel free to correct me as I am not 100% certain, but from what I can gather:
They are describing all the normalized vectors v, which point at the ray between points v1 and v2.
They are doing this using one parameter angle φ.
They are essentially interpolating between two vectors o1 and o2, with the equation v = o1 cosφ + o2 sinφ
o1 is simply the normalized v1. o2 is a vector at right angles with the o1 along the plane of the ray. (I think this would be calculated by cross product of o1 and N from the paper).
Because this angle can sweep greater than the length of the ray defined by v1 and v2 they also define a limit Bmax so that φ always stays within the bounds of the ray.
I've tried to annotate the diagram below (but I think I made a mistake and o2 would have an angle create than v1).

They also discuss it briefly here: http://www.aconty.com/pdf/importance-sampling-lights-slides.pdf
Might be worth mesaging the orinal authors to see if this is correct.
Comment: Thanks for the detailed answer with diagram! It clears a few things up. But now I'm confused about bmax. They compute it with v0, v1, and those vectors could have any length, right? I don't understand how bmax can be a valid cos(angle) in that case.
Comment: Your right, it looks like I am completely wrong about bmax! Seems like bmax is cos(θmin) if the actually minimum falls out of the range between v0 and v1. So it is the cos of the angle between Axis and v0/v1 (whichever is shorter)? Then it is selecting bmax if v0 dot v1 is < cosφ (which is what I thought bmax was). You also seem to be correct about them needing to be normalized. Potentially a mistake in the paper?
Comment: I asked the author of the paper, and he was kind enough to clarify that v0, v1 should be normalized here.
Comment: Fantastic! Glad you were able to followup. Most people probably don't implement equangular sampling so I guess it must have slipped through.


Individual Document Permissions

Question: I've been assigned the task of building a new SharePoint site for the State of Maine Information Security Office. There are several subsites, each assigned to a different department. One of the supervisors wants their staff to be able to Edit any documents they add to the Doc Library, but to have only Read permissions to the other Documents in the Library. Is there a way to do that without me going in and setting Permissions on each document when they are added?
Answer: There is a definite "Maybe".
In a general List (not in Libraries), if you go to the List Settings, and choose "Versioning Settings", you can set exactly what you want in the user interface (see screenshot):

Unfortunately, if you navigate to the same "Versioning Settings" page in the settings for your document Library, you will see that those options are not available.
However, despite not being available in the Settings user interface, those settings are available to be set via script.  I can validate that this script runs without errors, but I do not have a quick or easy way to check with other users to see whether it works as intended on a Library.
Using PnP-PowerShell, you can run the following commands on your library to see if it works for Document Libraries:
<code>Connect-PnPOnline -Url https://yoursite.sharepoint.com -UseWebLogin
$DocLibrary = Get-PnPList -Identity Lists/Requests -Includes ReadSecurity, WriteSecurity

$DocLibrary.ReadSecurity = 2
$DocLibrary.WriteSecurity = 2
$DocLibrary.Update()

$DocLibrary.context.ExecuteQuery()

</code>
Comment: Thanks.  Unfortunately, my skill level doesn't include knowing anything about running scripts.  Also, I don't think my supervisors would take it well if I tried.
Comment: Unfortunately, I think you only other choice besides executing a script, is manually setting permissions through the interface.
Answer: I would not advise that you enable document-level granular permissions. This has a tendency to cause significant performance issues, particularly in on-premise environments.
A few years ago, I was working with a large retailer on their migration to SharePoint for their intranet and as an enterprise tool. After an 18 month pilot, they rolled out the new enterprise environment. Within a week, the entire environment slowed to nearly unusable. The cause? Less than 100 documents with individual permissions.
As a best practice, I do not allow permissions below the library or list level in my SharePoint environments.
Comment: Was someone going into the library and setting those permissions for each document or was there some other way they were doing it?

Individual Document Permissions


Is it possible for the government to recover data from a encrypted ssd (veracrypt) that was wiped

Question: Just as the title states I'm wondering if its possible for the government to recover data from a encrypted ssd that was wiped? Thanks in advance!
Comment: "The government" is very ambiguous in a world with hundreds of countries. Also, one could fairly assume that information about sensitive techniques won't be available, therefore this becomes an opinion based question. Consider removing "the government" to make this a generic question about data recovery from encrypted / wiped drives.
Comment: Unfortunately this entirely depends on what you mean by "wiped." Done correctly, no data will be available, as the SSD will have been encrypted, and the encryption key "lost" to wipe it. Incorrectly, and you could retrieve all sorts of data.
Comment: Need more info such as what government, the type of encryption used on the SSD, how bad they are going to want to recover said data, etc. Specify these and I'm sure the gatekeepers will let you stick around.
Answer: I would clearly say yes. To explain this let's take a look at the differences between HDDs and SSDs. On HDDs data is always written on free space in one order. So you definitely know when you have overwritten one block often enought the data is gone. (also depends on the HDD. On some there are spare parts to recover the data)
At SSDs is a big difference. To comply with wear levelling, the SSD must constantly move data around the drive to ensure all blocks are worn at an equal rate. So if one data block is more worn out than an other, you overwrite just that "good" block multiple times, but the data is still in the "bad" sector (your encrypted data). As you can see it won't work with normal eraser which just overwrite the space.
If you want to secure erase your data on a SSD you need to take a look at ATA Secure Erase. At this procedure the command instructs the drive to flush all stored electrons, forcing the drive to "forget" all stored data. But this is not the only way to delete it. On some drives you can delete the encryption key which is used at the SSD. It dependes on your SSD. Look at your manufacturer to get better information about it.
To answer you question more specific: If you use normal erasers it is possible that there are some datablocks left behind. But these blocks are encrypted anyway. Normally it should not be possible to decrypt them (only if you set the encryption correct up). Anyway, if you want to delete the whole data look at your manufacturer to get to know how to delete it safe.
Comment: This is *not* how secure erase works on many drives. It's very common for SSD based storage to transparently encrypt internal storage. Secure erase simply deletes the key, (hopefully) rendering the data unrecoverable. See: https://www.thomas-krenn.com/en/wiki/SSD_Secure_Erase
Comment: Also all modern magnetic hard drives have spare sectors to remap failed parts of the disk. This is not a new phenomenon.
Comment: @David thank you for your input. I forget about that. I added it in the answer


UniswapV3 Pool Liquidity

Question: function liquidity() external view returns (uint128)
Which side of the asset pair is referenced here, or is that value in ETH?
How do I scale it properly?
Answer: Sorry this answer is so long awaited. I'm trying to catch up the uniswap questons.
So liquidity is the virtual reserves of the √xy
The liquidity when you call a pool contract is the current in range liquidity. Keeping in mind that all liquidity can be stored in multiple active / initiated tick ranges.
For the current tick range you would need to call slot0() and retrieve the current tick, and then call tickSpacing() for the spacing of the pool. Then you would want to divide tick by tick spacing (currentTick / tickSpacing), take the floor of this (drop decimals) and multiply by the tickSpacing. This will give you the lower tick of the active / initiated tick range. Adding the tick spacing to this will give the Upper active / initiated tick range.
You would then use the liquidity from the pool, the current sqrtPriceX96 from slot0 of the pool, the upper and lower ticks of the range, and the decimals of the tokens in the math of this function
async function getTokenAmounts(liquidity,sqrtPriceX96,tickLow,tickHigh,token0Decimal,token1Decimal){
    let sqrtRatioBelow = Math.sqrt(1.0001**tickLow);
    let sqrtRatioAbove = Math.sqrt(1.0001**tickHigh);

    let currentTick = getTickAtSqrtRatio(sqrtPriceX96);
    let sqrtPrice = sqrtPriceX96 / Q96;

    let amount0wei = 0;
    let amount1wei = 0;
    if(currentTick <= tickLow){
        amount0wei = Math.floor(liquidity*((sqrtRatioAbove-sqrtRatioBelow)/(sqrtRatioBelow*sqrtRatioAbove)));
    }
    else if(currentTick > tickHigh){
        amount1wei = Math.floor(liquidity*(sqrtRatioAbove-sqrtRatioBelow));
    }
    else if(currentTick >= tickLow && currentTick < tickHigh){
        amount0wei = Math.floor(liquidity*((sqrtRatioAbove-sqrtPrice)/(sqrtPrice*sqrtRatioAbove)));
        amount1wei = Math.floor(liquidity*(sqrtPrice-sqrtRatioBelow));
    }

    let amount0Human = (amount0wei/(10**token0Decimal)).toFixed(token0Decimal);
    let amount1Human = (amount1wei/(10**token1Decimal)).toFixed(token1Decimal);

    console.log("Amount Token0 wei: "+amount0wei);
    console.log("Amount Token1 wei: "+amount1wei);
    console.log("Amount Token0 : "+amount0Human);
    console.log("Amount Token1 : "+amount1Human);
    return [amount0wei, amount1wei]
}

UniswapV3 Pool Liquidity


\usepackage{tikz} not working

Question: I'm using MikTex and am trying to import the TikZ package to draw some graphics in LaTeX. When the pdf builds however it doesn't recognise the package TikZ and fails. Every other package I am using works fine. Any ideas what I might be doing wrong? This could just be a dumb question like I haven't downloaded ... which you need to run it but in the online manual there doesn't seem to be any system requirements etc.
Comment: For your TeX distribution, are you using MikTeX or TeXlive or something else? Have you tried installing the PGF or PGF/TikZ package through your TeX distribution's package manager?
Answer: Install the pgf package as TikZ belongs to pgf, it's just the frontend. If you use MiKTeX, use the MiKTeX package manager aka mpm, with TeX Live use the TeX Live Manager aka tlmgr. You may find it in the start menu.

MiKTeX pgf package information
pgf on CTAN
Comment: Thanks - it was obviously something simple. I just typed mpm in the cmd line to get the package manager up.

\usepackage{tikz} not working


What do we call the areas with "1" in a binary image

Question: I am looking for possible professional terms. In a binary (1 or 0) image, normally, the areas with "1"s are where the information is. I wonder if there is any professional name for it in image processing. Thank you!
Comment: [Foreground and Background pixels](https://en.m.wikipedia.org/wiki/Binary_image) are the specific terms used. This is really fundamental terminology found in any textbook on the topic. I don't understand the motivation behind the question (?)
Comment: Why should we have a specific name for these? Also, the 0 pixels a priori have the same information content as the 1 pixels. So, I'm not even sure it makes sense what you're asking. If you're actually dealing with visual content, you can simply make an arbitrary color mapping, for example 1 = yellow, 0 = red, and call the "1 areas" simply "yellow areas", but that doesn't make it any less arbitrary.
Comment: @Marcus Müller. I new to image processing. Sorry for not making the question clear. What I am wondering is that in the binary image case, is there any way to refer to the 1 pixels without defining them (such as 1 = yellow, 0 = red)? This question arises in my study of morphological operations in binary image. For example, the dilation operation "expands" the 1 pixels in the binary images, but to express it this way seems a bit off. That is why I am searching a possible name of it in image processing.
Comment: I agree with A_A about the lack of motivation. Notice that there's no law that says "0 is always a background pixel"; it's just what often happens.
Answer: This problem born when you use pixel intensity as physical mass, for example to calculate mass center or inertia moments, in this case the background should be 0 and object should be 1.
Btw your question is not clear because in a binary image {0,1} have the same information content and generally there are not difference.
There is not a name for 1 pixel and 0 pixel, often in common convention 1 is white and 0 is black, but it's not a general rule. Maybe you can call 1 high value pixel and 0 low value pixel but I think that are not common names and they can make confusion in some contexts.
Comment: @Andrea is it? not in my world. Or, to be more precise: it is a common convention, yes, but I'd still be careful to point out that it's still arbitrary and to document that 0 is black and 1 is white.
Comment: Sorry for not being very clear. I am new to image processing. I am just wondering if there is any name referring to 1 pixels or 0 pixels in binary images.
Comment: Generally 0 is black 1 is white
Comment: Yes, in general it's false, I know but I meant as common convention ("generally" not ever)
Comment: @Cris Luengo how do you call them?
Comment: @cris luengo background doesn't need to be 0 in a picture, make a b&w photo of a black book on a white table. You can't call background 0 values pixels, not in general
Comment: With b&w I meant binary pixels not gray scale. If the concept is not general you can't give a general name to it, it's depends on the context. my answer says this
Answer: A binary image conventionally distinguishes "foreground" from "background", or "objects" from "background".
More often than not, the foreground pixels, which form the objects, have a value of 1, but some libraries will use a value of 255 (storing the binary image in a 8-bit unsigned integer array, OpenCV does this). Conversely, the background typically has a value of 0.
The reason to select 0 for background and a non-zero value for foreground is that (at least in every programming language I know) 0 is evaluated as false and non-zero as true. This makes subsequent logic more intuitive.
I have personally never come across a scientific paper on image processing or analysis that reverses this convention. Nonetheless, I'm sure there are programs out there that use 0 for foreground. It's not written in stone. It is simply the very common convention.
Regarding "black" and "white", referred to in the other answer, this is an arbitrary assignment that doesn't change the meaning. Yes, often 0 is shown in black, and 1 is often shown in white (or red or green), but I have seen plenty of papers that print background as white and foreground as black -- when most pixels are background, this makes the foreground stand out better in print.

Note that these terms and conventions go back to the beginnings of the field of digital image processing, and probably earlier too.
Azriel Rosenfeld was one of the pioneers of the field. In this book from 1976,
"Digital Picture Processing" (Ch. 8), he says

[...] the function which has the value 1 for points belonging to the object, and value 0 elsewhere.

And a little later

[...] deciding whether a given point of the picture belongs to an object or to the background.


Inheriting static methods in Java?

Question: So I know that in Java when you have a static method you are supposed to call it with the format ClassName.method() rather than use the same structure as you would for instance methods, namely:
ClassName myObject = new ClassName();
myObject.method();

However, if you were to do it this way it would still be valid code and would work.  Let's say I decide to do this where the method in question is static, and have the following setup:
public SuperClass {
    public static int foo(int x) {
        return x;
    }
}

public SubClass extends SuperClass {
    public static int foo(int x) { // Overriding foo() in SuperClass
        return x + 1;
    }
}

public MyDriver {
    public static void main(String[] args) {
        SuperClass myObject = new SubClass(); // Upcasting.
        System.out.println(myObject.foo(5));  // This should polymorphically print 6
    }
}

What prints out on the screen, however, is 5 rather than 6.  Why?
Answer: Static methods apply only to the class they are defined in, and they cannot be overridden.
When you call myObject.foo(5), you are calling SuperClass.foo(5) in reality, because you declared myObject as a SuperClass, regardless of whether you instantiated it as one.
The proper way to call a static method is to call it directly from the class it is declared in, so if you wanted to call SubClass.foo(), you must call it from an explicitly declared SubClass instance (meaning no upcasting), or you need to call SubClass.foo() like so.
The simple answer is that calling static methods from instances evaluates to calling those same methods from the declared type with no instance rather than the instance type.
I am not certain of this, but I would not be surprised if when the code is compiled into byte-code, that the instance static method call would actually be compiled into a direct call to the declared type.
Edit: An upvote brought my attention back to this and I cleaned up the explanation to make it more clear and fix some negligible grammatical mistakes on my part. I hope this helps future readers.
Answer: Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always.
   myObject.foo(5)

is only a shortcut, what you really are doing is
   SuperClass.foo(5)

Comment: +1 but depending on ClassLoader architecture it could even be more than one per JVM; OSGi for example.
Comment: It's not really only one instance, it's one per virtual machine if you have more than one virtual machine you may have more than one instance.
Answer: Using instances of a class to call that class's static methods is something you should avoid, since it can cause confusion. If you need to call any method polymorphically, make it an instance method. You cannot polymorphically call a static method.  The reason the SuperClass invocation is called is because that is the apparent class of myObject at compile-time.  This effect can also be seen in the following scenario:
public void doSomething(SuperClass param) {
    System.out.println("SuperClass");
}

public void doSomething(SubClass param) {
    System.out.println("SubClass");
}

public void test() {
    SuperClass myObject = new SubClass();
    doSomething(myObject);
}

If test() is called, SuperClass will be printed.
Answer: Static methods are treated as global by the JVM, they are not bound to an object instance at all. By the way, you can only overload static methods, but you can not override. So check for "Oracle Documentation for Overriding and Hiding Documents".
Defining a Method with the Same Signature as a Superclass's Method:
-----------------------------------------Superclass Instance MethodSuperclass Static Method
Subclass Instance Method      Overrides                                     Generates a compile-time error
Subclass Static Method            Generates a compile-time error   Hides

Inheriting static methods in Java?


Importing accounts and contacts from Salescloud into Marketing cloud via import activity

Question: When i am importing Accounts(standard account object) from Salescloud in marketing cloud via import activity it's getting saved under My Data extensions, however when i import contacts (standard account object) from Salescloud, its getting stored under salesforce data extension. Any specific reason behind this behavior?
Answer: With the Marketing Cloud Connector, Contacts and Leads are objects that can be sent to so a Salesforce Data Extension is created when imported so it could be used as the target for a send.  The Account object can not be the target for a send which is why it isn't created as a Salesforce Data Extension.


Using knife project method to make a shape into the mesh

Question: I'm practising some modelling methods, although I know knife project method is not the best because it can make a mess of the topology, I couldn't figure out another approach to achieve this particular shape modelled in the middle of the main mesh. I'd like some feedback what other way could I had approached to get that shape made within the main mesh.
Comment: Really curious why you are getting downvoted. Either way, Moonboots SUBD approach is probably the cleanest way to attack this problem. But you can probably also get away with boolean/bevel and cleanup as well.
Comment: Try to start with more simplified geometry  connected without n-gons. Use subsurface modifier to round curved parts and Edge Crease Shift+E 1 to keep corners sharp. Similar to this https://blender.stackexchange.com/a/185599/2214
Comment: I am giving it an attempt with the subdivision which is very clean topology, but takes more consideration and planning how to layout the vertices. https://ibb.co/rHnxnTQ
Comment: Still complicated :-) Planning? Sure, blender is not AI, but Limited Disolve with keeping quads operator could be helpful if exists :-) if none here I will try to answer in hour or two.
Comment: I managed to make some progress with the subdivision modifier. But i'd like ot see the limited dissolve and quads which you stated. The more techniques I see the more skills Ill learn, if you'd like to share a screen shot or quick video demo. This is what I got so far, but I wont rest here, I'm always looking for improvement. https://ibb.co/7Rw5KqJ
Answer: Try to start with more simplified geometry connected without n-gons.

Start with 10 sided Circle and continue extrude, scale, as needed)
Use Subdivision Surface modifier to round curved parts
and Edge Crease Shift+E 1 to keep corners sharp.

Similar to this.

Note: I probably used too low topology, when I would like to bevel edges now, I would have to add another loops (alternatively use bevelling on shader level).
Answer: You could do the other way around, beginning with the shape then extrude to get your rectangular object, at the end when you'll give it the Subdivision Surface modifier it will just need a bit of work to get the sharp angles:
Comment: thanks heaps guys, both ways we 1000 times better approach method then the mess I made. Moonboots methods was a bit more simpler for me to model, and didn't even think about starting from inside shape and then working my way out. the result: https://ibb.co/mFZdxM4


Do logistic drones and vessels carry goods roundtrip?

Question: Let's figure a transportation system where there are two Interstellar Logistic Station. Each one is demanding the other station good. When I'll put vessels in the towers, will they carry goods roundtrip? In other words, will they be assigned both for the "demand" and supply" requests?
Answer: No. Each Logistics station (planetary and interstellar) operates entirely independently, and are not smart enough to perform "round trips".
No matter the origin or destination, drones are empty for half the journey.
In fact, it's even worse than that! Drones incoming from other logistics stations don't reserve their target resources! If you have an IPS with a hot commodity (silicon, say), and are also shipping it out via belts, it's entirely possible for the drone to be dispatched, arrive at the now-empty logistics station, and turn around carrying absolutely nothing!
Comment: I'm pretty sure it will be patched in the future since it makes no sense with the optimization/planification nature of this game. However, for now, I'll take this in consideration while building my systems. Thanks!


No comma preceding quote from a document?

Question: I am a court reporter, and I was recently informed that I should not put a comma before a quote from a document.  E.g., in the sentence: John said, "We need to clear this item," the comma after "said" is appropriate, but in the sentence: Paragraph 2 says "We need to clear this item," a comma after "says" would be inappropriate.  Anybody else ever hear of that rule?  It's new to me.
Comment: Your [stenotype](http://www.long-live-pitmans-shorthand.org.uk/vocabulary-punctuation.htm) has a comma?
Answer: I've never heard of this distinction, though it may be upheld in some very specialized style guide for court reporters. For general purposes, the advice in Chicago Manual of Style, 15th Edition (2003) is sensible and sufficiently detailed to cover most situations:

6.53 Comma with quoted material. Quoted material, if brief, is usually introduced by a comma; if longer or more formal, by a colon [citations omitted]. If a quotation is introduced by that, whether, or a similar conjunction, no comma is needed. [Examples omitted.]
11.20 Use of the colon [with introductory phrases]. A formal introductory phrase, such as thus or the following, is usually followed by a colon. [Example omitted.] Such perfunctory phrases as "Jacqueline Jones writes:" or "The defendant stated:" are often awkward, and sensitive writers avoid them.
11.21 Use of the comma [with introductory phrases]. A comma, rather than a colon is often used after said, replied, asked, and similar verbs. [Examples omitted.]

The crucial point here is that Chicago bases its advice about when to use a colon, when to use a comma, and when to use neither on the relationship between the introductory wording and the following quotation, not on whether the source of the quotation is a person or a document.
Answer: There is nothing inherently wrong with using a comma, colon, or other mark to introduce the quote.
The argument could be made, however, that the paragraph is not itself saying anything. As such, "say" there is not a speech tag, and the quotation is not direct speech. Rather, the quote in that instance is part of the sentence itself. Consider

Paragraph 2 says (that) "We need to clear this item."

or

Paragraph 2 outlines the "need to clear this item".

So it could be seen as "inappropriate" to suggest that the paragraph is speaking. It might pay to check whether they would accept a colon instead, eg,

Paragraph 2 says: "We need to clear this item."

But note that many instances of punctuation are a matter of stylistic preference, so you should go with whatever your employer has deemed right.


Unable to connect with SSH externally

Question: I have a CentOS vm at work where I can SSH to it locally with it's local IP address, but when I am outside the office, I'm unable to SSH using it's external IP address. It is using OpenSSH. I have a feeling this is getting blocked at the network level because I get a connection refused message when trying to telnet to port 22 of the external IP. I wasn't the one who originally setup the vm. Could there be something else on the server that is causing this? Is there anything else I can test?
Comment: Can you access any other service on this VM using its external IP? Companies typically don't make their internal systems accessible from the public Internet. Usually you'd have to go through a VPN or some other gateway.
Answer: If you can use it locally then SSHd is running and that is OK.
Most probably thing you need to do is to put a redirection of the port 22 (or some other port not used) from the router/gateway that is serving your office network to port 22 of the VM you want to connect to. This is most probably missing. (so a redirection from external IP:22, or even another port, to VM_IP:22)
Answer: The likely issue is a port forwarding rule either incorrectly specified or not in place. Ensure the following is accurate:

sudo vi /etc/ssh/sshd_config - Specify whichever port you wish to use in here
Enter your router and direct your specified port to the internal IP of your system. You can get this IP via ifconfig.

If this isn't the issue your network security could be blocking this as part of their standard rules, in which case speak to your system administrator.

Unable to connect with SSH externally


SQL Server 2005 Change Auditing

Question: Is there a built in way in SQL Server 2005 to audit things specifically like deleting a stored procedure? Is there a history table that I can query? We have a mystery sproc that has disappeared a few times now.
Answer: You can build this using DDL triggers:
http://msdn.microsoft.com/en-us/library/ms190989.aspx
Answer: Only if you use DDL triggers or use profiler to trace text "%DROP%PROC%procname%"
Answer: Note that in SQL Server 2008 they also now have AUDIT to replace Profiler Traces for auding activities. It is similar but has its own configuration UI and UI to view results
Answer: You can setup a profiler trace to capture the Audit Schema Object Management event and filter based on the database name you care about. Any time an object in the schema is created, dropped, edited it will fire an event in profiler that includes the person who did the change and the name of the stored procedure.
You will want at least these profiler columns:
ApplicationName - name of app user was running when they made change
DatabaseName - Databse containing the object changed
EventSubClass - Type of action shows Alter, Modify, Drop, Create etc
LoginName - user making change
ObjectName - object affected
Answer: [late one but adds details on how to see who made the change even before auditing system is put into place]
Others have already covered different ways you can start auditing data in order to monitor future changes but if you originally didn't have any auditing system in place then it's very difficult to find out who did what and when historically.
Only option is to try reading transaction log assuming database is in full recovery mode.  Problem is that this is not supported by default. Options are:

Third party tools such as ApexSQL Log or Quest Toad
Undocumented functions such as DBCC LOG or fn_dblog

See these topics for more details:
How to view transaction log in SQL Server 2008
SQL Server Transaction Log Explorer/Analyzer
How to see query history in SQL Server Management Studio
Answer: I agree. It can be the SQL Server profiler with filters. The DDL triggers existed in SQL Server.
You could create something like this:
<code> CREATE TRIGGER ddl_drop_procedure
    ON DATABASE
    FOR DROP_PROCEDURE
   AS
     RAISERROR ('You deleted a stored procedure',10, 1)

   GO
</code>
The other option is to use third party tools like Auto Audit from codeplex, or apexSQL trigger.

SQL Server 2005 Change Auditing


Can any weapons in Civilization III hurt all units on a square?

Question: Are there any weapons (except nukes) that can deal damage to all enemy units placed on the same map square?
Answer: The cruise missile and artillery units (catapult cannon, artillery and radar artillery) can do damage to multiple units and softening them up so it will be easier for your ground forces to take the city. However it's by far not as powerful as the ICBM. Still if you use artillery properly it can save you a lot of time, headache and recruits.
Comment: I have read the help for cruise missile and didn't see this explicitly specified, that's why I asked for help here. The biggest problem with nukes is getting many AIs angry, which I want to avoid :D Thank you!
Comment: Thats ok, just use artillery it's made for the same purpose as a ICBM. Or i should say a ICBM is made for the same purpose of artillery with a extra kick :D.