Modifying Google Calendar API to accept environment variables rather than a JSON file for Heroku

Question: I'm pushing a Django site (python 2.7) to Heroku, however I'm getting the error:
raise InvalidClientSecretsError('File not found: "%s"' % filename)
oauth2client.clientsecrets.InvalidClientSecretsError: File not found: "calendar_secret.json"

When running a cron job, and that's because my file calendar_secret.json isn't in my repo. I purposefully didn't push it so that the data isn't known for security reasons.
My question is about how to modify Google's default code found here: https://developers.google.com/google-apps/calendar/quickstart/python, specifically the get_credentials method in order to use environment variables in either JSON or in the method directly so that I don't have to upload my calendar secrets.
Here's Google's code:
def get_credentials(self):
 """Gets valid user credentials from storage.

 If nothing has been stored, or if the stored credentials are invalid,
 the OAuth2 flow is completed to obtain the new credentials.

 Returns:
    Credentials, the obtained credential.
 """
 home_dir = os.path.expanduser('~')
 credential_dir = os.path.join(home_dir, '.credentials')
 if not os.path.exists(credential_dir):
    os.makedirs(credential_dir)
 credential_path = os.path.join(credential_dir, 'json-file.json')

 store = Storage(credential_path)
 credentials = store.get()
 if not credentials or credentials.invalid:
     flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)
     flow.user_agent = APPLICATION_NAME
     if flags:
         credentials = tools.run_flow(flow, store, flags)
     else:  # Needed only for compatibility with Python 2.6
         credentials = tools.run(flow, store)
     print('Storing credentials to ' + credential_path)
 return credentials

Which works great. But I'd love to either modify this method to use environment variables in JSON.
This is another take on the question: Environment Variables in Json file, however the answer isn't something that makes sense here.
Thanks in advance!
Answer: Figured it out! All you'll have to do is replace the flow code to the following:
flow = client.OAuth2WebServerFlow(client_id=YOUR-SAVED-ENV-ID-HERE,
                                  client_secret=YOUR-SAVED-ENV-SECRET-HERE,
                                  scope='https://www.googleapis.com/auth/calendar',
                                  redirect_uris='YOUR-URIS-HERE')

More information here: https://developers.google.com/api-client-library/python/guide/aaa_oauth


QField Sync original project path missing

Question: I have a project in QGis, configured for QField. I moved that original project and all the files to a different folder. Now when i want to sync data back from my tablet using the QField-sync plugin, it says the Original path was not found - which is true, the path does not exist anymore. I do not understand why it matters though, i have set the project to relative paths so the data on the tablet should be synced to the new project folder without problems! How can i change the "original path" within Qfield, QGis, QField Sync etc?
Answer: Thing is, the imported data does get written to the correct gpkg file. When running 'synchronize from qfield' I get the following message:

QFieldSync : The data has been synchronized successfully but the original project (//original project location) could not be opened.

When you close the project after syncing and re-open the project, it will read the data from the modified gpkg and the newly added data should be there.
Saving the project in qgis and rerun 'Package for qfield' and using the new package should help, untill you relocate the project again.
Answer: In our case, our server name changes on the top level every now and then (xxx-1 to xxx-2).
I realized that I need to export the qfield-project from the tablet and save it in some location. There, I open the "..._qfield.qgs"-file with a text editor and replace all file path with the correct one. Only replacing the project path is not sufficient (but helps to remove the error message about the lacking project file).
I need to correct all path to sync the data and the project.
I don't think this is well solved.


How to stop numbers converting to date format on copy paste in Excel?

Question: When I copy data from a site and paste in Excel,
some numbers / numeric strings are converting to date format.
For example: "2-1" converting to "1-Feb".
How can I prevent this?
I have too many records to do manually.
Is there any quick process?
Comment: Select the empty fields (or the entire column), set them to a string format instead of the default value, and do a special paste (available on right-click) with "values only" to prevent a date format from being auto-applies...
Comment: @Victor: Please repost your comment as an answer (that's what it is!) so we can upvote it and the asker can "accept" it.
Answer: Select the empty fields (or the entire column), set them to a string format instead of the default value, and do a special paste (available on right-click) with "values only" to prevent a date format from being auto-applied.
(Moving Victor's comment to an answer, as per MSO, as OP and Victor haven't done so in a week)
Answer: Before pasting, select column that will hold the non-date value. Right click. Select 'format cells'. Then select 'text' as the format and click OK.
Now, go ahead and paste, but paste using the 'match the destination formatting' option.
Answer: There are few ways to resolve that, the most common and simple one would be to format the cells prior pasting the data as text (select range, right click, format cells, double click on text).
What I have done was to simply change the decimal separator:
File -> options -> advanced -> untick "use system separators" and set the decimal separator to a dot "." (default in my case was the comma).
Check http://cloudishvps.com/windows/stop-excel-2013-auto-converting-numeric-values-dates/ for screenshots if needed.
Answer: The problem you have is that the field or the whole column is set to contain the data in a DATE FORMAT.
To overcome this, a simple way is to select the field or the entire column, 'Right click' > Format Cells > Click Number (Select sub-options according to your requirement) > Press OK.
Hope this helps.
Answer:
Paste data
Set problematic cell type to text
Paste data over again without deleting
Answer: convert field with number format into float format in your query and paste the result.
If amount is a number then,
select
cast (amount as float) as amount
from table;
Answer: 1.) try to add this sing (') in you number in source data then past it into excel the replace (') with same (') because when you add this sing it will be shown in your data in excel but when replace it with it will be hidden.
2.) If your typing then simply add this sign (') before your number then excel will not convert it into date and this sign will not be shown in your


BackgroundWorker and Threads

Question: What are the pros and cons in using the either for achieving a given task.
The million dollar question is which one to use and when?
Many Thanks.
Answer: If by "Threads"  you mean explicitly using the System.Threading.Thread class to create, configure and kick off your own threads, then the answer is that doing this is more work on your part, involves more cpu cycles than just pulling a thread from the thread pool, (wjhich is what the other techniques do), but it gives you more flexibility, as it allows you to specify thread priority, and several other characteristics that using Thread Pool threads does not afford you.
The "Thread Pool" approach is more appropriate when the number of threads required is not known at design time.  The pool initially contains a small number of threads, "ready" for you to call upon them.  It can dynamically create new threads on demand, and it manages creation, coordination, and deletion of unused threads for you. There are three mechanisms you can use to access and use threads from the pool.

Using  Delegate.BeginInvoke()  (the most common technique)
Using timers (several variations)
System.Threading.ThreadPool provides several other features (BackGroundWorker class, QueueUserWorkItem(), etc.).
Answer: Have a look at this great threading overview:

[The BackgroundWorker] provides the following features:

A "cancel" flag for signaling a worker to end without using Abort
A standard protocol for reporting progress, completion and cancellation
An implementation of IComponent allowing it be sited in the Visual Studio Designer
  Exception handling on the worker thread
The ability to update Windows Forms and WPF controls in response to worker progress or completion.

The last two features are particularly useful – it means you don't have to include a try/catch block in your worker method, and can update Windows Forms and WPF controls without needing to call Control.Invoke.
Answer: Threads only when you don't have to work with a UI (WinForms or WPF) and background workers when you do have to deal with a UI.
You avoid a lot of problems with UIs and background workers.
Answer: I use to associate BackgroundWorker as a wrapper for what Threads would do. So I use BackgroundWorker on GUI works, and Threads on more specialized or dirty jobs (Windows Services, etc)
Answer: The BackgroundWorker class is an easy way to add a thread to a Form to perform some heavy operation without blocking the UI.  You could do the same with a thread but with slightly more coding.
Answer: The BackgroundWorker class simply provides events that are switched to the context of the UI thread for you, but don't be confused; the DoWork event (which is where you actually, well, do the work) is still executed in the context of another thread (as that's the point of the whole thing) and performing any kind of UI interaction or update there will throw an exception at best, and crash at worst. The BackgroundWorker should be used on forms when you're trying to do something that requires a UI update and whose scope doesn't extend beyond that of the form. For other background operations, consider either using the ThreadPool (for short-lived operations) or creating your own Thread.
The BackgroundWorker provides convenience with the ProgressChanged event, but don't get too comfortable and start doing UI updates in DoWork.

BackgroundWorker and Threads


How to show the fraction line as a slash instead of horizontal bar in plot tick labels?

Question: Is there any option to show the fraction numbers in the tick labels of a plot in the format of 2/3 instead of using a horizontal bar as the fraction line?
Comment: Possible duplicate: http://mathematica.stackexchange.com/questions/33655/how-to-write-beveled-fractions
Answer: ClearAll[fractionToRow]
fractionToRow = RawBoxes @*
   ReplaceAll[FractionBox -> (RowBox[{#, "/", #2}] &)] @* ToBoxes @* TraditionalForm

plt1 = Plot[Sin@x, {x, 0, 2 Pi}, ImageSize -> 300,
   Ticks -> {Range[0, 2 Pi, Pi/2], Automatic}];

plt2 = Plot[Sin@x, {x, 0, 2 Pi}, ImageSize -> 300,
   Ticks -> {{#, fractionToRow @ #} & /@ Range[0, 2 Pi, Pi/2], Automatic}];

Row[{plt1, plt2}, Spacer[10]]

This approach works for simple inputs (as is usually the case for tick labeling).
Another example:
TraditionalForm[Style[Pi^(I/2)/ (I + E/Pi), 24]]

fractionToRow @ Style[Pi^(I/2)/(I + E/Pi), 24]

For more complicated inputs more work may be needed for appropriate parsing.
Comment: @Szabolcs, thank you for the generous bounty.
Answer: You could specify a custom label for each tick, programmatically generated using the InputForm of the fraction, which uses the horizontal dash. For instance:
Plot[
 x, {x, 0, 3},
 Ticks -> {{#, InputForm[#]} & /@ Range[0, 3, 1/3], Automatic}
]

To address your comment regarding the dropped labels, you may be better off using a Frame and FrameLabels instead:
Plot[
 x, {x, 0, 3},
 Frame -> {{True, False}, {True, False}},
 FrameTicks -> {{#, InputForm[#]} & /@ Range[0, 3, 1/3], Automatic}
]

Comment: @nanjun It drops that $0$ label because, when axes are present, it would be positioned at the axis intersection point, and it would be awkwardly placed. I don't know of a simple way of forcing its placement. Additionally, the amount of padding on each axis (i.e. the amount of "extra space" you were referring to) should be exactly the same whether you are using axes or frames, and is controlled by `PlotRangePadding` which for `Plot` is set as 2% by default (i.e. `Scaled[0.02]`), if I remember correctly.
Comment: Thank you. I noticed that Mathematica sometimes omits some tick labels, which is also the case in your plot above. Is there a way of letting it not omit any tick labels if they are given in a list, e.g. the 0 in your list `Range[0, 3, 1/3]`?
Comment: @nanjun Yes, but perhaps a frame would be easier to use in that case; see my updated answer.
Comment: I wonder what is the criterion that Mathematica drops labels? Using frame is a way around but it shows a little bit more before 0. Is it possible to disable it from dropping labels?
Answer: If one is allowed to use a package, here is another possibility. First load MaTeX then
SetOptions[MaTeX, "Preamble" -> {"\\usepackage{nicefrac}"}];
makeFrac[n_] := If[Denominator[n] == 1, MaTeX[n, Magnification -> 1.5],
   MaTeX["\\nicefrac{" <> ToString[Numerator[n]] <> "}{" <>
     ToString[Denominator[n]] <> "}", Magnification -> 1.5]];

texStyle = {FontFamily -> "Latin Modern Roman", FontSize -> 14};

Plot[x, {x, 0, 3},
 Ticks -> {{#, makeFrac[#]} & /@ Range[0, 3, 1/3], Automatic},
 BaseStyle -> texStyle]

I would do both axes using Latex myself and not one to make it look better. And I think the fractions look better than using Mathematica's own typesetting ;)


Set or change vertical position of the cursor

Question: As far as I know, it is possible to move the cursor to the left using the backspace sequence in an echo. But is there any possibility to change the vertical position of the cursor, using an echo?
Comment: See: http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html
Answer: This section describes the ANSI escape sequences:

http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html

Examples:
echo -en "\033[s\033[7B\033[1;34m 7 lines down violet \033[u\033[0m"
echo -en "\033[s\033[7A\033[1;32m 7 lines up green \033[u\033[0m"

And this section describes the tput utility:

http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html

For a demonstration, see The floating clock in your terminal:

http://tldp.org/HOWTO/Bash-Prompt-HOWTO/clockt.html

An example script taken from http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html:
#!/bin/bash

tput clear      # clear the screen

tput cup 3 15   # Move cursor to screen location X,Y (top left is 0,0)

tput setaf 3    # Set a foreground colour using ANSI escape
echo "XYX Corp LTD."
tput sgr0

tput cup 5 17
tput rev        # Set reverse video mode
echo "M A I N - M E N U"
tput sgr0

tput cup 7 15; echo "1. User Management"
tput cup 8 15; echo "2. Service Management"
tput cup 9 15; echo "3. Process Management"
tput cup 10 15; echo "4. Backup"

tput bold       # Set bold mode
tput cup 12 15
read -p "Enter your choice [1-4] " choice

tput clear
tput sgr0
tput rc

Answer: Using echo will restrict you to a specific terminal type. It is better to use tput.
tput cup 10 4; echo there

will put cursor on row 10 column 4 and print "there" at that position.
For more elementary movements you have tput cub1 to move left, tput cuf1 to move right, tput cuu1 to move up and tput cud1 to move the cursor down.
Comment: …and another demonstration of tldp having incomplete answers.
Answer: Yes, as noted by miku, ANSI terminal escapes, or a little cleaner is tput which should work on any terminal:
tput cuu 1             # move cursor up 1 position
nudgeup=`tput cuu 2`   # save it for later
nudgeleft=`tput cub 2`
echo -n $nudgeup $nudgeleft

See a couple of sections after the ANSI section in the BASH prompt howto.
tput also returns an exit code that tells you if something is not supported.


Best Practice for Adding an Entity with Multiple Subentities (Entity Framework)

Question: I currently have an object Report. This report object has multiple subentities, such as WorkOrder and ReleaseQuestions. I just wanted to ask the best practice for adding WorkOrder's and ReleaseQuestions's to the database. Currently, when a report is created, I add new blank objects to my report object, then add that to the database. This is because eventually these components will be filled out by the user, so having the blank rows sitting in the database doesn't do much harm, but I'm not sure this is the best practice. Would it be better if I added the new components separately? Or is what I'm doing not too far off?
Code, for people who are more visual:
public async Task<ReportModel> AddReport(ReportModel reportModel)
{
    // CapacityPlanReport report = _mapper.Map<ReportModel, CapacityPlanReport>(reportModel);

    var report = new CapacityPlanReport
    {
        AddedYear = DateTime.Now.ToString(),
        Type = reportModel.Type,
        Eta = reportModel.Eta
    };

    // Create the corresponding pieces of the report in the database.
    report.ReleaseQuestion = new CapacityPlanReleaseQuestion();
    report.WorkOrder = new CapacityPlanWorkOrder();

    _context.CapacityPlanReport.Add(report);
    await _context.SaveChangesAsync();

    var result = await GetReport(report.CapacityPlanReportId);
    return result;
}

Comment: Can you provide your entity objects?
Comment: Please explain what do you mean by `subentities`. If you mean something like: `Employee` and then subentity `Manager`, then what you are doing is not correct because every Employee is not a Manager so it will never be filled out.
Comment: Better how? If the code works, it works. Otherwise, it's just opinions on how it should work, and opinions don't really work on Stack Overflow.
Answer: If the components are going to be filled out by the user later, then just don't fill them at all when inserting the Report only and use nulls. When the user provides you with appropriate data, create the entity, assign it to the report and SaveChanges - EF will  update your existing Report and insert the subentity into the db along with all necessary FK references.
It's probably more natural for something that does not exist yet to be null rather than an empty instance. An empty instance is something after all.


Folder/File Structure Conventions?

Question: I'm trying to find a guide on PHP file/folder structure conventions.
I'm using GitHub and want to ensure I'm following a standard convention as to not confuse users.
Any help would be appreciated.
Comment: Structure conventions for what? An MVC application? A simple website?
Answer: As speshak said PHP has no standards and no conventions (including its own standard library).
However:

In public directory (usually public_html) store only static resources (images/JS/CSS) and one PHP file index.php which is limited to something like this:
<?php

require '/path/to/app/outside/public/html/start.php';
$app = new App();
$app->run();

Application itself should be stored outside public directory.
File structure might reflect classes names, so: Project\Util\XML\Parser will be stored within /path/to/the/project/Project/Util/XML/Parser.php file.
Of course 3rd-party-code might be stored in separated folder, let's say vendor - that's quite common convention.
Answer: There is this:
https://github.com/php-pds/skeleton
Based on data collected from various open-source projects, this document proposes a naming convention for a number of root-level directories designated for various common purposes, as well as naming conventions for root-level documentation files.
I didn't find that this covers every imaginable scenario, but it's nice to be able to point at this and indicate you're making an effort to achieve some consistency across projects :-)
Answer: You are free to choose any directory structure. But if you would like to know about best practices, take a look at how it is done in frameworks, for example, symphony.
Take a look: http://www.flickr.com/photos/deia/402335716/
Here's few of them:

All the code that is included, should be put outside of the document root.
HTML templates should be in a separate directory.
Libraries and classes should be in 'lib' directory.

Mostly it's just a reasonable solutions, not strict conventions.
Answer: I think the most obvious one is your libraries. You should name your classes like YourCompany_Module_Class, if you want to be compatible. Using this standard, your libraries can be used along with any other similarly named libraries without clashes and problems. The new namespacing in PHP 5.3+ helps more in achieving this. You can have some guidelines for this at Zend Coding Standards - File Naming and at PSR-0 Standard Proposal.
Other than that, you'd better constantly keep the future in your mind and plan your folder structure accordingly. For example, let's say you are uploading images into user_images. Ok. But what happens when the project catches or gets bigger and now you have tens of thousands of files in a single folder. You must build some scheme that enables you to store ~1k images per directory at most like 12/56/154.jpg.
You will see many such problems and opportunities over time. But you can look at the current projects and learn from them for free :)
Answer: PHP really has no standard.  If you are making use of some framework (eg CakePHP, Zend Framework, etc) it may impose some standard on you.
If you aren't using a third party library that forces a structure, just use common sense. (Put images in a images directory, included files in an includes directory, etc)  People that download and install PHP apps will already be used to each app doing things differently. The fact that you're giving it some thought puts you a head of lots of the competition :)

Folder/File Structure Conventions?


The Sun's composition is based on the currently assumed composition of the giant planets

Question: I posit that the giant planets comprise methane gas hydrate (CH4)8(H2O)46). If so, would not the Sun have to have a large composition of oxygen?
Comment: You state "The Sun's composition is based on the currently assumed composition of the giant planets".  This is not correct.  The abundances of different elements in the sun is estimated from a variety of data sources. I'm not an expert in this topic, but I don't think that the composition of the gas giants is a significant factor used to determine solar abundances.
Comment: Its not really clear what you are asking. Can you explain your assertion that the giant planets comprise of methane hydrate. Then explain how this links to the sun, and what you mean by "large". The composition of the sun is quite well known from spectroscopic and modelling data, and it is mostly H and He with small amounts of other elements.
Answer: Oxygen is the third most abundant element in the Sun, hydrogen and helium being first and second.
Most sources estimate solar oxygen abundance between 0.6% and 1.0% by mass.
The astronomical literature expresses element abundance as a logarithm of atom count relative to hydrogen:
$$A(x) = \log{n(x)\over{n(\mathrm{H})}} + 12$$
Lodders 2010, based on several contemporary studies, recommends a photospheric oxygen abundance value $A(\mathrm{O})$ = 8.73 $\pm$ 0.07, or 0.046% to 0.063% as many oxygen atoms as hydrogen atoms.
Comment: FWIW, 0.6% to 1% may not sound like much, but that's around 2000 to 3300 Earth masses.
Comment: Papers on Jupiter and Venus are available at http://firmament-chaos.com/pdf/Juno%20-%20Evidence%20of%20a%20Solid%20Jupiter.pdf and http://firmament-chaos.com/pdf/Venus%20Paper.pdf
Answer: Although the Sun and planets were born from the same cloud of gas and dust, it does not follow that the chemical abundance mixture in the Sun and planets will be the same. That is trivially obvious if you consider the case of the Earth, which contains comparatively little of the lightest elements - hydrogen and helium - which actually make up the bulk of the Sun.
The same is true to a lesser extent with the giant planets Jupiter and Saturn. Their bulk abundances are reasonably close to that of the Sun but not exactly the same. The reasons behind this are complex but are to do with the formation mechanism of the planets (which took some time after the Sun was formed) and chemical fractionation and condensation within the disc of gas and dust from which the planets came.
The chemical abundance mixture of the Sun is not derived from the abundances of chemical elements in the giant planets (which are more uncertain), but from a combination of analysis of the Sun's spectrum, which tells you about the composition of the photosphere, and by a detailed study of the composition of meteorites, which are thought to have formed very early in the life of the solar system and contain a pristine record of the abundances bar the absence of volatiles like hydrogen and helium.
Your reference to methane hydrates (also known as clathrates) is puzzling. These clathrates are well known to exist in the ices of the satellites of Jupiter and Saturn. Clathrates can form early in the life of the solar system and were probably incorporated into many of the icy and rocky bodies of the outer solar system. I'm not aware of any particular evidence that they occur in great abundances in the atmospheres of Jupiter and Saturn (the outer atmospheres are all we can see) and they certainly would not survive the temperatures and pressure in the interiors of these planets.
Comment: In the case of the planets the wisdom of many men is defined by the papers which are accepted for publication, disallowing other ideas. Therefore the existing 'consensus science'  cannot be challenged. I have written consistent papers on Jupiter  and Venus if you want to take the time to read beyond this.
Comment: @Angiras and why would that be worthwhile when it is clear from your question that you have not taken the time to read about the science you claim to challenge.


Is it ok to ask such a question?

Question: I have a question in my mind, I want convert a problem to logic order 2 representation, but I can't, Also I don't know is it good to ask it in cstheory or not? I don't know can I say it's research level or not (problem is pretty hard but converting to logic 2 I can't say is hard or not), no one around me is expert in logic to help me, and I need to read some book, but If someone expert answer me my works will be done very faster, because main part of my problem is not related to logic.
Comment: Depending on the problem, it could well be relevant.
Comment: @Kaveh understanding my problem is not easy for mathematical people but good suggestion. It doesn't have such a rule like CS?
Comment: @Saeed, no, they don't restrict the scope to research level, but read their FAQ for more information (in fact it was created after MO which is research level only).
Answer: You can try Math.SE if you are not sure.
If it doesn't get answered there and based on the comments then you can decide whether it is suitable for cstheory or not.

Is it ok to ask such a question?


symmetric movement of 2 objects

Question: how can I move 2 objects always symmetrical? I want to move a right and left wheel of an object symmetrical outward/inward. Icould do it by putting the exact y values on each but I was wondering if there is a faster way to do it.
Comment: You could check 'Manipulate Center Points' (next to the pivot point button in Object Mode)  with the pivot set to 'Median', and scale the wheels outwards on their axle-axis.
Answer: You can use a copy location constraint:
Answer: Also if you have 2 or more objects selected, you can change the pivot point to individual origins, and apply transformation.  My previous answer was wrong about parenting.
Answer: Depending on your setup you could parent one wheel to another. Or parent both wheels to an empty and manipulate the empty.  First select the child object, then select the object to be the parent and then press ctrl + p. The menu will pop up and select object
Answer: Unfortunately, I couldn't get this to run infinitely, I tried Asyncio, and I tried the threading module but didn't get it to work as I'd have desired, however it will set your wheels to be symmetrical, just run the script every time you move the original wheel object.
<code>import bpy
original = bpy.data.objects["Wheel"] #rename your objects, to what you have on screen.
changed = bpy.data.objects["Wheel.001"]

changed.location = (-original.location.x,-original.location.y,-original.location.z) #reversal of rotation and location for symmetry.
changed.rotation_euler = (-original.rotation_euler.x,-original.rotation_euler.y,-original.rotation_euler.z)
```
</code>

symmetric movement of 2 objects


Could randomisation make for a better book cipher?

Question: Suppose that the file linux.words is used as the "book".  This is a publicly available list of just shy of half a million words.  And suppose that this book is used, not in its native alphabetic order, but in some randomised order.  The number of possible random arrangements is a decimal which is over two million decimal digits long. The cipher text will be a stream of numbers which index into the chosen random arrangement of the "book".  Does this approach make for an improved book cipher?
Answer: From the Wikipedia page on Book ciphers:

Essentially, the code version of a "book cipher" is just like any
  other code, but one in which the trouble of preparing and distributing
  the codebook has been eliminated by using an existing text. However
  this means, as well as being attacked by all the usual means employed
  against other codes or ciphers, partial solutions may help the
  cryptanalyst to guess other codewords, or even to break the code
  completely by identifying the key text. This is, however, not the only
  way a book cipher may be broken. It is still susceptible to other
  methods of cryptanalysis, and as such is quite easily broken, even
  without sophisticated means, without the cryptanalyst having any idea
  what book the cipher is keyed to.

So you would effectively have a very weird book that would be unknown to the attacker, but that isn't enough to make it secure.  In particular, (link)

If you know 1,000 words, you will be between a functional beginner and
  conversational level in English.  In most of the world's languages,
  500 words will be more than enough to get you through any tourist
  situations and everyday introductions.

Randomizing the word order wouldn't change the frequency clues.  Not being able to guess the book would add a small amount of additional security, but not enough to give it any meaningful improvement over a traditional book cipher.
Comment: Eugene: Thanks for that.  One point you missed, and one that I missed.  You missed my observation that there are a HUGE number of random sequences.  How would an attacker know which sequence of the "book" to use?  On the subject of frequency analysis, I forgot to mention that an adequate implementation would take care to ensure that repeated items in the plain text are never represented by the same item in the cipher text...making frequency analysis useless.  I'm still not convinced of the futility of book ciphers!
Comment: Having a lot of keys helps, but not if the attacker can eliminate large numbers of them quickly. For example, mono-alphabetic substitution has the equivalent of a 88-bit key, but is much easier to solve than DES, with its 56-bit key.  This is due to the use of frequency analysis - I don't have to determine the value for every word, getting the common ones is enough to partially understand the message.
Comment: Response part 2 - Adding duplicates of common words can make frequency analysis harder, but at the cost of making your "book" (i.e., key) larger.  Also you haven't said what you plan to do about proper names, numbers, punctuation, and words that don't appear in your book.  Finally, what happens if the user wants to encrypt a picture?
Comment: Eugene: Someone else has had these questions about book ciphers and the potential problems with punctuation, numbers etc.  Whoever they are, they've published a spec and code on Google Drive.  Interesting.  See: https://drive.google.com/drive/folders/1MfK8-Fv5Y7rcRz1Cp_swsZhJcgcILmyd?usp=sharing


How can I graphically mount ISOs?

Question: I want a graphical (GUI) method to mount an ISO, is there any way to do so?
Answer: Right-click on the file and choose "Open With Archive Mounter".

The ISO is mounted at .gvfs folder under your Home directory.

You can either access it from the mount location as shown above or from the side-panel in your File Manager.

Credit goes to Ubuntu Forums member, tgm4883.
Comment: ... or just double-click the ISO ;-)
Comment: @MestreLion, by default double-clicking opens in Archive Manager unlike the image in the screen shots I provided.
Comment: you are correct. I forgot that ages ago I changed the default opener of ISO files from the Archive Manager to Archive Mounter.
Comment: where is archive mounter putting the image files in Lubuntu 12.04? they are not in `home/user/.cvfs`
Answer: There is Furius ISO Mount
for example.

Select the ISO you want to mount by clicking on Browse...

Click on Mount

Win

In some cases (using certain file browsers or desktop environments) the mounted image is not opened automatically, so it is useful to know the mount point

To unmount, select that line to see the mount point clearly visible beside the "Unmount" button that has now become active.
Answer: There is Gmount-iso :Click to install

Gmount-iso is a small tool written using PyGTK and Glade. It allows you to easily mount your cd images. This is a frontend to the 'mount -o loop -t iso9660 foo.iso /mountpoint' command.
Answer: acetoneiso
makes it possible to easily use various kinds of CD and DVD images on your computer as if they were burned to real CDs. You can use the application to mount and manage CD and DVD images. Supported disc-image formats are ISO, BIN, NRG, MDF and IMG.
These are AcetoneISO's Features:

Mount automatically ISO, MDF, NRG, BIN, NRG without the need to insert admin password!
Only single-track images are supported for the moment.
burn ISO/TOC/CUE to CD-R/RW optical discs
burn ISO images to DVD-+R/RW (including DL)
a native utility to blank your CD-RW, DVD-RW and DVD-RW discs
A nice display which shows current images mounted and possibility to click on it to quickly
reopen mounted image
Convert 2 ISO all image types:
*.bin *.mdf *.nrg *.img *.daa *.dmg *.cdi *.b5i *.bwi *.pdi and much more
Extract images content to a folder:
*.bin *.mdf *.nrg *.img *.daa *.dmg *.cdi *.b5i *.bwi *.pdi and much more
Play a DVD Movie Image with Kaffeine / VLC / SMplayer with auto-cover download from Amazon
Generate an ISO from a Folder or CD/DVD
Check MD5 file of an image and/or generate it to a text file
Calculate ShaSums of images in 128, 256 and 384 bit
Encrypt / Decrypt an image
Split / Merge image in X megabyte
Compress with High Ratio an image in 7z format
Rip a PSX cd to *.bin to make it work with epsxe/psx emulators
Restore a lost CUE file of *.bin *.img
Convert Mac OS *.dmg to a mountable image
Mount an image in a specified folder from the user
Create a database of images to manage big collections
Extract the Boot Image file of a CD/DVD or ISO
Backup a CD-Audio to a *.bin image (can also be burnt once made)
Complete localization for English, Italian, French, Spanish, Polish and much more!
Quick and simple utility to Rip a DVD to Xvid AVI
Quick and simple utility to convert a generic video (avi, mpeg, mov, wmv, asf) to Xvid AVI
Quick and simple utility to convert a FLV video to AVI
Utility to download videos from Youtube and Metacafe!
Extract Audio from a video file
Extract a *.rar archive that has a password
Quick and simple utility to convert any video for Sony PSP Playstation Portable
Display History that shows all images you mount in time

Project Page
Edit: when not using Nautilus, or are using Lubuntu etc, you may not have the mounted iso readily visible: it is in fact in  /home/user/virtual-drives/number.
In this cases, some settings can be made to ensure the image file is opened in the file browser: go to File/Options/General options/File manager and select file browser (e.g., Thunar or Nautilus, after having installed them: in Lubuntu/LXDE I do not recommend Nautilus, but Thunar; selecting LXDE in that list seems useless).
Comment: +1 for AcetoneISO... because "double-click ISO in Nautilus" works for 90% of ISO images... and Acetone covers the other 10% ;)
Answer: I use cdemu, which mounts the iso as if it were an actual disc. This means that any software expectign an actual CD will work. For the GUI part, I use gcdemu, which resides in the GNOME panel. I don't know of any GUI for Unity.
Answer: Disks (gnome-disk-utilily) is a drive and partition manager that, among other capabilities, creates a context menu entry in the file manager for the given purpose.
sudo apt-get install gnome-disk-utility

Testing in KDE, it creates a file manager panel entry called 'Loop device'. The default path to the mounted iso is /media/username/unknown.
If, after unmounting the loop device(s) from file manager the panel entries still remain there even after restarting the file manager: to remove them, run gnome-disks (the application can be searched and launched as 'Disks' too), select and close the 'Looping device', enable the "Auto-clear" option, then restart the file manager.

How can I graphically mount ISOs?


Lightweight Wallets Communication with Blockchain

Question: I understand how the Bitcoin core wallet communicates with the blockchain, but how do the lightweight wallets like Multibits, Electrum, etc, communicate with the blockchain?
Answer: You should have a look at the SPV (https://en.bitcoin.it/wiki/Thin_Client_Security#Simplified_Payment_Verification_.28SPV.29_Clients).
It was also mentioned by Satoshi in his paper at page 5 point 8:
https://bitcoin.org/bitcoin.pdf


Maintaining superscript from word to inDesign

Question: Is there a way to maintain superscript when copy/pasting from word to inDesign?
Comment: Placing? No, you can place documents that are hundreds of pages long. As long as your InDesign text frames are primary and linked, and you have Smart Text Reflow enabled, you just place the document into an empty text frame and InDesign will automatically reflow the text, adding pages as required. It will import the **whole** document, though, not just parts of it, and it will keep styles and overrides intact unless you tell it not to.
Comment: Not when copy-pasting, no. At least it used to be that copy-pasting from Word kept no formatting at all—you have to place the file to maintain formatting. I haven't actually copy-pasted anything from Word into InDesign for years and years, though; this may have changed in the meantime.
Comment: If I wasn't working from a 30+ page document, I would be doing this, but i don't think it will work unless I have each page of text as it's own file, correct?
Answer: Here's an answer you don't want....
In my experience, maintaining styles from Word can be problematic. What if you use a document font that doesn't contain a specific setting? i.e. Word uses "italic" but you use a font that uses "oblique". Or what if the Word document is using smart quotes and you want dumb quotes, or vice versa?
For a solid, well crafted text document I always save the Word file, whatever it is, to a plain text format. Thus stripping away all Word styling. I then use File > Place to place that text document into InDesign and then go through reapplying character and/or paragraph styles as needed. I open the Word document on my left monitor for visual reference then work in InDesign on my primary monitor. In *many, many, many instances you may find that Word document had some odd "box" or callout that caused odd line breaks or issues with the import. So side-by-side comparison allows you to refine layouts as needed.
Why go to all this trouble? Well, it's not "trouble" in the grand scheme of things. By reworking the text in InDesign, you are somewhat obligated to pay closer attention to widows, orphans, page breaks, style application, special characters etc. Basically it kind of forces you to do a better job then you would if you copy/paste or slap some Word file into an InDesign document.
It doesn't take any extra time to use this method of reformatting than it does to hunt and seek for import errors and correct them. The only difference is a more confident, solid, final piece.
Comment: I agree. I have often wasted valuable time trying to "fix" a Word document where I should have just done as Scott describes. I wish customers would stop using Word - the texts delivered to designers should be completely cleansed for styling. The writer should only care about the content and the hierarchy of the text. My dream would be for writers to use a simple markup language like Markdown. Word documents exported from a markdown program like [Typora](https://typora.io/) seems to work without problems in InDesign and doesn't have all that extra trash that Word adds to its files.
Answer: All you have to do is to make sure that Preferences > Clipboard Handling Preferences > All Information is selected, instead of Text only
Comment: I did this before I posted here thinking it would be the answer. Thanks tho!
Answer: The best way to handle text import from Word to InDesign is to work up a WordBASIC macro which maps all formatting which one wishes to retain to suitable character and paragraph style and strips off all other formatting.
That way, the text imports cleanly and can be used w/o worrying about errant local formatting.
Comment: WordBASIC? That was replaced by VBA when Word 97 was released, twenty years ago. Did you mean VBA? Also, in my experience, no matter how hard you try to remove local formatting in a Word document, there's still tons of it there. I always format everything as styles and never locally override anything, and still about 40% of the text has local overrides applied once I import into InDesign. Selecting the entire imported text and removing all local overrides in one fell swoop is an indispensable part of my work flow.
Comment: The way I did this was to have a macro which tagged all the formatting, removed all the formatting, then re-applied the formatting as character and paragraph styles stripping out the tags. Sorry, started w/ WordBASIC back w/ Word 1.0 and it persisted on a Mac for rather a bit longer (through Word for Mac 2004 at least).


I have read many times that bitcoin is a public blockchain. Why is that?

Question: Is there some special reason that Satoshi made bitcoin like this. Wouldn't in a private blockchain, transfer of currency would be more secure?
Also, is it possible to create a separate blockchain to transfer bitcoin in that circle.
Answer: The whole point of bitcoin is that anyone can verify it, it's supposed to be trustless. If transactions were private, how could you trust anyone claiming to have BTC? How could you trust that BTC being sent to you in fact exists, instead of the sender just making up a transaction spending outputs which never existed? That's why all full nodes verify all transactions since the genesis block, to ensure all bitcoin being sent are legitimate.
A separate blockchain is possible but perhaps not in the way you think. It's possible to use sidechains or second layer networks like Lightning, but to make a separate blockchain itself would be to create a new currency completely, it would be an altcoin not bitcoin


if (a) {b();c();d();} else {c();} - prevent duplicate code c();

Question: I've got the following scenario:
bool bWantToWait = getRandomBool();

if (bWantToWait){
    std::future<bool> bSuccesfullWait = this->doStartWait();
}

//lots of lines of code
//even more lines of code
//doExecuteSomethingWithAsyncCallback

if (bWantToWait){
    return bSuccessfullWait.get();
}
return true;

Now of course bSuccesfullWait is out of scope in the second if statement, so this won't compile. But basically what I want is that doStartWait() "initializes" a wait. I don't want to initialize this wait if I don't have to, as it's relatively resource intensive.
An example application for this would be networking. this->doStartWait(); would open up a port, and return a future that returns when a message comes in. this->doExecuteSomethingWithAsyncCallback(); would send something to a different PC, which would then return a message on the port opened in this->doStartWait();. You'd want to make sure that the port is opened before sending a message, so you don't miss the reply.
What I've resorted to is the following:
bool bWantToWait = getRandomBool();

auto fnExec = [&]()->void{
    //lots of lines of code
    //even more lines of code
    //doExecuteSomethingWithAsyncCallback
};

if (bWantToWait){
    std::future<bool> bSuccesfullWait = this->doStartWait();
    fnExec();
    return bSuccessfullWait.get();
}
fnExec();
return true;

The downside of this approach is that the code is not in chronological order any more, and that ideally I'd like to prevent the overhead of function calls. An alternative would be to make a std::future<bool>*, or std::unique_ptr<std::future<bool>>, but that also adds overhead. The least overhead method would be raw pointers, but that still uses the heap instead of just the stack.
Am I missing an obvious solution to having a variable "stay in scope" over two if statements?
Comment: The "overhead" you are referring to is insignificant. You are not in a tight loop, you have "lots of lines of code" to execute.
Answer: Aren't you just over-complicating things? If I understand you correctly your problem is that bSuccesfullWait is out of scope near the end of your code.
Just shift the variable declaration before the (conditional) initialization:
    std::future<bool> bSuccesfullWait;  // now in scope.
    if (bWantToWait){
        bSuccesfullWait = this->doStartWait();
    }
    //lots of lines of code

    if (bWantToWait){
        return bSuccessfullWait.get();
    }
    return true;


Why doesn't copying the Ubuntu ISO to a USB or hard drive work?

Question: Sorry if the question sounds stupid in some way, I'm completly new to Ubuntu, never even actually installed it and that's the problem.
I just downloaded the installer, not the wubi, but the one named 'ubuntu-12.04-desktop-i386', I understood that I'm supposed to save the installer to a CD or flash-pen. Since I have no CD's I copied the file to the pen. I restarted the PC pressed F8 for the booting screen and I select the USB, and I don't recall what was the error, but it simply said that there was no data to boot from the pen and that I should press any key to reboot. I tried again some more times and still nothing. Since I have two hard disks I copied the installer to on that is empty, where I actually want to install Ubuntu. So I copied, restarted the PC, boot menu, select the hard drive where the file was on and it says that it's missing 'bootmgr', my question is what I'm doing wrong?
Answer: Copying the ISO file to a USB or hard drive won't work. To create a USB installer, I highly recommend using Unetbootin. Select Ubuntu and 12.04_Live, the letter for your USB drive, and let it download the ISO and "burn" it to the USB on its own. Alternately, as the below screenshot shows, choose the "Diskimage" option to use a pre-downloaded ISO:
Comment: Oh, by the way, does a 1GB pen do the trick? Since the installer only takes about 800MB memory?
Comment: Yes, 1GB works just fine (but everything else on it will be wiped out, so back up if needed). If this answer works out, please remember to come back and accept it (click on the tick/check mark) to "close" the question.
Comment: After everything was done in Unetbootin I clicked to restar, pressed F8 for booting, selected he pen, I could only choose to boot "Default", no Unbutu option to select from. I selected it and I got "invalid or corrupt kernel image". :|
Comment: I installed again and this time worked. :) It was just a corrupted file probably. I'm having some issues connecting to internet since I need to install software before I can connect. Is that bad if I skip the updates and do them later?
Comment: @Pyrodistic: no, updating it later is absolutely okay. Install away!
Comment: One last thing, I hope. I have an hard disk only for Unbutu, should the partition be of the size of the disk then? Or should be less?
Comment: @Pyrodistic: if it's only for Ubuntu, the partition can occupy all of it.


Android - Running a background task every 15 minutes, even when application is not running

Question: I need to build a background task that runs every 10/15 minutes (doesn't really matter, either is good), even when the application is not running.
How can I accomplish this? I can't seem the wrap my head around this.
I read I could use some sort of runnable() functionality or use a background services or AlarmManager. I was thinking of a background service, since it also must be done when the application itself is not running.
What is a better way of doing this and how could I do it?
Answer: You have have detemined the amount of time (interval) to execute a snippet of code, its better to use AlarmManager because its more energy effient. If your app needs to listen to some sort of a event , then Service is what you need.
public static void registerAlarm(Context context) {
    Intent i = new Intent(context, YOURBROADCASTRECIEVER.class);

    PendingIntent sender = PendingIntent.getBroadcast(context,REQUEST_CODE, i, 0);

    // We want the alarm to go off 3 seconds from now.
    long firstTime = SystemClock.elapsedRealtime();
    firstTime += 3 * 1000;//start 3 seconds after first register.

    // Schedule the alarm!
    AlarmManager am = (AlarmManager) context
            .getSystemService(ALARM_SERVICE);
    am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime,
            600000, sender);//10min interval

}

Comment: Yes. Alarm Manager is like, you(the app) tells the OS you wanna do somthing in X millseconds later. Then the system executes that code in the BroadcastReciever.onRecieve(), its the code that you want to execute in the background after x milliseconds.
Comment: But does this allow me to execute code even when the application itself is not running?
Comment: It works, really nice, but, what about stop the service? am.cancel()? or.. thank you @wtsang02
Comment: What if I need to run the background task every 100 milliseconds?
Comment: replace '600000' into 100, that is the interval in milliseconds.
Comment: I am testing in redminote3 (android 5.1.1), the alarmmanager not working after activity die
Answer: Alarm Manager (system service) vs  Remote Service with inner alarm implementation (separate process)?
Alarm Manager is your choice, because it already has what you need, you just have to set alarm intervals
Answer: You can also achieve this via a SyncAdapter
Here's a sample for your to look at and get inspired
SyncAdapter sample
Answer: Work manager is actually the best thing to do with periodically repeat, their default is 15 minutes which exactly like you need.
Here is an example:
        final PeriodicWorkRequest periodicWorkRequest
                = new PeriodicWorkRequest.Builder(ApiWorker.class, 15, TimeUnit.MINUTES)
                .build();
        WorkManager.getInstance().enqueue(periodicWorkRequest);

Where ApiWorker is just the following class:
public class ApiWorker extends Worker implements iOnApiRequestSuccessful {

public ApiWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) {
    super(context, workerParams);
}

@NonNull
@Override
public Result doWork() {
    return Result.success();
}
}

And fill whatever work you want to be done in the doWork() function before the return with success.
Return.success() makes it inserted to the queue again so it will be repeated every 15 minutes.
Answer: The best approach was introduced at Google I/O 2018 - WorkManager.
You can find documentation here.


What is the meaning of "there goes my day"?

Question: What is the meaning of "there goes my day"?
My friend message me with a youtube video followed by "there goes my day"
Answer: There goes my day means that something has just come up that will occupy that person for the rest of the day, and they won't be able to get anything else done. It's always used as a negative, that is the person would rather be doing something other than what they are having to do.
It's an exclamation of disappointment in this state of affairs.
In the case of your friend, I suspect it is being used humorously - the video is so entertaining that they'll have to keep watching it all day and won't get anything else done.
Answer: It means he is going to spend all the rest of his day watching that videos and others related.
Generally, the expression "There goes..." means it has come to an end, in this case because he is not going to get anything done, instead he is going to watch YouTube videos all day. With YouTube videos, of course it is to be intended figuratively and not literally.
You can look at some examples with other objects and situations in this WordReference thread.


does the memory space of windows and linux overlap for some folders when both operating systems are installed?

Question: I have both linux and windows installed on my pc.  when I make some programs in lex and yacc (when working on linux)and store all the files  in a folder ,they are corrupted If I use windows for some time. for example 3 days back after storing all the files( xyz.l , a.out ) I switched to windows for some other work after rebooting my pc. after 3 days when I again open that folder(while using linux) a.out was converted into an image and when I double clicked on it, an image opened. the image was same which I downloaded 2 days back while working on windows but I stored in some other folder. so does the memory space used for storage for linux and windows overlap? if not what could be the reasons? It has happened 2 times. and really I have to recode all my programs . I am not able to understand why?
Answer: It is not supposed to overlap.This sounds like a configuration problem , where windows and linux are configured to mount the same partition.
Check the file /etc/fstab (under linux) and find out whether this is true.You can try making files in various places and observe if they can be found on the other os.
Answer: I don't know how your partitioning looks like, but I guess that it is set up in a way that both OS have read/write access to all partitions, or at least windows has read/write access to the Linux partition.
Is your linux partition a FAT32 partition? You should set it to read only in windows, but I'm not sure how to do this.
Do you use hibernate on the windows side? Windows can get confused if data changes while it is asleep, and this might be the cause of the problems.


Can I join a Minecraft world of my friend's, if my friend does not have Live gold?

Question: I wanna play with my friend, and he is in the same house as me to visit. I want to join his single-player Minecraft world, or he joins mine. It doesn't matter for us. I have a PC with Minecraft Windows 10 Edition, and he had an Xbox with Live Gold. It worked just fine when he had the Xbox Live gold, but now I want to know if I join HIS world, can I play with him, when he doesn't have Xbox Live gold?
Answer: Yes, you can play without him having live gold.
Answer: From the Official Minecraft Support Site:

Playing on a Local Area Network (LAN):
This requires opening your home or local area network (LAN) to others who are also connected to that network. Here is how to connect for Minecraft for mobile devices, Nintendo Switch, PlayStation, Windows or Xbox.
Before you start

Each player that wants to join must be connected to the same network.
The selected host device must be capable of running a server of the chosen world.
Everyone joining must run the same version of the game as the host.

Start a LAN game

Create a new world or click the pencil icon to edit a current world.
Go to Multiplayer and make sure that Visible to LAN Players is enabled.
Choose Create or Play to start the world.

Join a LAN game

Go to the Play
Click the Friends tab and look for available LAN Games.


How to configure Apache to run on multiple network interfaces?

Question: I have a Linux system that has two Ethernet ports, one GPRS modem interface and Wifi.  How can I configure Apache to run on all or a subset of those interfaces?  Wifi & GPRS modem IP addresses will prob. be dynamic, ethernet addresses fixed.
Answer: The Apache Listen directive handles that.
All interfaces:
Listen 80

Specific IP only:
Listen 192.0.2.1:80

Comment: Those addresses are usually more static than you'd think.  At least, as long as your host is perpetually online.  In the worst case, write some shell script to check the output of ifconfig/ip for the interface you want and then stuff that into your apache config and restart.
Comment: How could I specify it to listen say only on the Wifi interface, where the address is assigned by DHCP?  Is there any way to specify an inteface, e.g. "wlan0"?
Comment: Another idea: listen on all and firewall ones you don't want connections on.
Answer: By default apache will listen on all available interfaces
# cat /etc/httpd/conf/httpd.conf | grep ^Listen
Listen 80

So there is no need in any specific configuration at all


Tense when speaking of someone you knew in your past

Question: Is it acceptable to use the past tense when talking about someone that is still alive but you no longer have any interaction with? "His name was Alex" I always correct myself and use present tense but it feels very weird.
Comment: If you no longer have any interactions with Alex, how do you know the name remains unchanged? She might be Alexa now.
Comment: In fact, if you did say "I had a friend, his name is Alex", his name might have been Alexa when you knew her. Just because his name *was* Alex doesn't imply that it no longer is. (Yes, I know people joke about it, but that doesn't make it wrong) So if you are talking about your friend in the past tense, there is no reason to change to the present, when referring to his name.
Comment: @user159858, I agree. I've often noticed, when talking with friends about someone we no longer see but is probably still alive, that we might say, "He was an odd character".  And I think, he probably still *is*, but the past tense seems right.
Answer: There is a very useful rule which I found in one of video lessons on the Internet, and it turned to be very useful. If you start speaking in present, keep to the present, if you start speaking in the past, keep to the past.It really helps while making sentences. So if you began your story in the past, it would be right to continue in the past. Thus you will avoid a mistake.
Comment: That's an interesting observation and probably good advice, but it doesn't answer the question, or even address it.


If I moved abroad, what happens to the U.S. apartment lease I'd be breaking? Would a debt follow?

Question: I'm moving to the United Kingdom.  What will happened to my apartment lease here in the United States? Will that debt follow me?
Comment: Does your question mean that you are leaving before your lease contract ends?
Answer: It sounds like you intend to stop paying rent and vacate an apartment before your lease expires. Technically I don't believe this is a debt, as you have not borrowed any money. Rather, this is a breach of contract. You should probably seek legal advice on what you may be liable for and how likely that judgement is to be enforced overseas -- not financial advice.
Regardless, you might also find it preferable to sublease the apartment or come to an arrangement with the landlord to modify or terminate the lease gracefully. This is especially the case if you are a US citizen or if you intend to return to the US in the future.
Answer: Alternatively, you may be able to pay a fee to get out of your lease early.  It is typically a lot less painful by paying the fee then dealing with any consequences.
It depends on who you are renting from really.  If you are one of these corporate run complexes expected a negative report on your credit.  If you are renting from just a regular dude, I would talk to him and ask him if he would let you out of the contract.
Answer: Will the debt follow you? What the landlord might do will depend on how likely it is they will be able to collect on a judgement, the cost of legal time in a given locale, and monthly rent. State laws vary but in general it is unlikely a judge would award more than 2 months rent in damages for a broken lease contract. A court filing and attorney fees to get a judgement in a large east coast city will run roughly $1000. If you have no assets or income in the US collecting on a judgement would be infeasible. You do the math and weigh the risks...


How to get HFS+ filesystem blocksize

Question: How can I find out the HFS+ filesystem blocksize for a local volume on a MacbookPro5,4. I think its 4k. I need to confirm this. Diskutil reports that the disk blocksize is 512 bytes.
Answer: You could try "stat" with the "%k" format option.  According to the man page this is the "Optimal file system I/O operation block size".  Command line is:
stat -f "%k" FILE

Where "FILE" is any regular file on your system (e.g. "~/.profile"). It should say "4096" or something like that.  I cannot 100% guarantee this is what you're looking for, but it seems close.
Comment: Hm, This looks pretty good. I'm not exactly sure if it reads the filesystem header or not but it seems to be giving a reasonable value.
Answer: If you want to verify the block size, you can modify the answer given by neuroburn to include the file size and the number of 512-byte blocks allocated:
stat -f "%k, %z, %b" FILE

The number of allocated 512-byte blocks will be a multiple of the number of 512-byte blocks in one file system block.  For example, a 4096-byte file system block contains 8 512-byte blocks:
MacBook-Pro:~ ian$ echo foo > foo.txt
MacBook-Pro:~ ian$ ls -l foo.txt
-rw-r--r--  1 ian  staff  4 12 Jul 00:21 foo.txt
MacBook-Pro:~ ian$ stat -f "%k, %z, %b" foo.txt
4096, 4, 8

Doing this a few times will give more confidence in the simpler command proposed by neuroburn. (Please note this answer has been edited to correct the command parameters… former parameters "%k, %z, %" caused the command to fail.)
Answer: That's a fair enough measurement, but the right way to do it would be to query the filesystem itself, which you can do programmatically by statfs(). Alternatively, you can read directly from the HFS volume header - a free tool called HFSleuth, at http://www.newosxbook.com/ - allows you to do just that.

How to get HFS+ filesystem blocksize


"So many weapons and armor!" What is wrong with this sentence? And how would one fix it?

Question: The sentence rings false in my head. Clearly this is because "weapons" is a countable noun, and "armor" is an uncountable noun. So one could fix this sentence by breaking it up into two clauses (e.g. "So many weapons, and so much armor!"), or by replacing a countable noun with an uncountable one (e.g. "So much armor and weaponry!"). But barring those two types of drastic changes, can anything be done to fix this sentence? Is there any way to properly modify a sentence with an uncountable noun and a countable noun appended together?
Comment: Well, here are dozens of instances of [abundant armor](https://www.google.com/search?q=%22abundant+armor%22+-%22armor+plate%22&btnG=Search+Books&tbm=bks&tbo=1) (there are as many more with the UK spelling), and hundreds of [abundant weapons](https://www.google.com/search?q=%22abundant+weapons%22&btnG=Search+Books&tbm=bks&tbo=1), so even though no-one seems to have actually *written* it, there's no reason why you can't have ***abundant** weapons and armor* - or *abundant weapons and armour* if your computer "medieval RPG game" company happened to be British. (I think we have some! :).
Comment: So few weapons? Yeah, and she's wearing less armor!
Comment: You mean like a lot of weapons and armor?
Comment: Any actual *answers* will just be subjectively-chosen forms of expression, with no obvious way to identify a "best, most correct" approach. And since OP already *knows* what's wrong, and has explained it, that half of the Question Title doesn't apply. So I think this is POB.
Comment: @Lobato could you please repost your answer. Unfortunately it has been deleted just when I was pondering whether to upvote it or not. It lacked references and an explanation but I thought it offered a good solution.
Comment: *In panoply of ancient kings, / in chainéd rings he armoured him; / his shining shield was scored with runes / to ward all wounds and harm from him.*
Answer: How to join a countable noun with an uncountable one in one sentence, while expressing that one is "so many" while the other is "so much"?
The easiest solution would be to use the conjunction, and, to connect the two clauses together; however, the OP believes this would drastically change the sentiment of the original sentence. So I would like to suggest a few possible alternatives; my first is to use the adjective more, which can be used with both mass and count nouns.

We have more weapons and armour than we could dream of.
The forge chimneys billowed smoke day and night as the weapon smiths
  forged more armour and weapons, fed by a steady stream of ore now
  coming from the Midean Mountains and the peaks coldwards of Parmia.
Then they mustered full-size armies under consular commanders only to
  have these just as thoroughly trounced by Spartacus, who with each
  victory captured more weapons and armour to equip his forces

My second suggestion is to use quantities of or amount of.  Quantity can be used for both singular and plural nouns but preferably for inanimate ones. The standard rule says to reserve amount for nouns that can be measured in bulk and are uncountable. But I found instances where this "rule" was not always followed.

Vast quantities of armour and weapons were also obtained, including
  hundreds of two-handed and heavy swords...
...18,300 lb of silver in bullion and in coin, a large number of silver vases and
  quantities of copper and iron, besides a vast amount of munitions,
  armour and weapons
But while the central armouries produced a considerable amount of
  weapons and armour
A tremendous amount of armour and weapons had been sent into the
  region to strengthen the military that were doing battle against the
  invading army.
However, on most occasions armies went into battle with large
  quantities of traditional weapons and armour.
... where staggering quantities of armour and weapons were buried, probably
  representing hundreds of warriors either killed or captured.
Answer: There's always the simpler fix: since one is a countable and the other is not, qualify them separately:

So many weapons and so much armor!
Comment: The OP knows that 'fix'. He stated it in his post.
Answer: One approach is to use a noun modified by the countable and uncountable nouns. Consider plethora

a large or excessive amount of (something)

as in A plethora of weapons and armor!
If you want to further emphasize the excess, you could try surfeit

too great an amount or supply; excess


Two different symbols on Autumn Leaves sheet

Question:
Source
I rectangled these two notations on score.
What does these two notations mean?
Answer: The first two are repeat brackets. The bracketed section is played twice (at least). The third is a hand-written quarter-rest (not an easy symbol to draw; some hand-written scores even draw a mirror-image eighth rest for a quarter rest; usually causes a double-take during sightreading.)
Comment: The mirror image eighth rest was, I believe, the original glyph, so it is found even in printed scores from the 16th and 17th centuries.  It is also found in certain styles of engraved scores from the 19th and early 20th centuries.  (I am not sure about the 18th, but I would not be surprised if some examples exist.)
Answer: The first two are winged repeat barlines.  The 'wings' are common in commercial and jazz  copying styles, making it easier to see the repeats when sight-reading.   I've been known to emphasise them further with a red pen!
You haven't questioned previous appearances of the rather scruffy hand-written quarter rests, so I guess it's the opening parenthesis before it that's confusing you?  Note there's a closing one too.  The whole measure is in parentheses to indicate that the notes are to be played when making the repeat, but not when ending at the (somewhat mis-placed)  'Fine'.
Answer: The top ones are repeat brackets. Usually, they don't protrude beyond the five lines. Whenever I have a new sheet to read, the first thing I do is make them look like the ones from the Real Book, with a highlighter. Any further ones get adapted likewise, but with a different colour. Just makes reading so much easier.
The last sign is a crotchet (quarter) note rest. Easy to work out, when there are three more crotchet (notes) in that bar! Not so easy to write! Although often any old squiggle works - just do the sums.


Monero fiat on-ramps and off-ramps in Australia?

Question: What are the options for buying and selling Monero in Australia?
Comment: No matter what address I am given to send my Monero to by Binance, Changelly or localmonero.co my monero-wallet-gui is labelling each and every one of them invalid. ? Can anybody help me please? Thank you
Answer: First of all, there is no legislation prohibiting the buying, selling or owning of Monero in Australia. Monero is treated the same as Bitcoin and there are Capital Gains Tax (CGT) obligations associated with the disposal of Monero. I.e. whenever you send XMR to a wallet that you cannot prove you own.
Now, here is a breakdown of your options on obtaining or selling Monero in Australia.
Option A
localmonero.co is an escrow service that facilitates peer-to-peer trades for Monero against fiat or other currencies. Australia is supported and you will find many vendors there who are willing to buy or sell Monero. Here are some tips for this method:

Sign up with a non-disposable email address. Many vendors (people who list ads for buying/selling) will tick a box that only permits interaction from accounts that have a confirmed, email address. This is because there are scammers/griefers who will create throwaway accounts and initiate fake trades in the hopes of tricking a vendor who is not careful with managing the escrowed funds. This is very inconvenient, because the funds are time-locked and may need admin intervention to unlock in worst case scenarios.
Be aware that many vendors will have special requirements like asking for proof of ID, etc. Some do not, so just look through the list carefully.
The best price is not always shown on top. Vendors with more long-standing reputations will be favoured over new vendors. Scroll further down and press "show more..." to find the best price.
An array of different payment options are offered, including bank transfer, paypal, vouchers and even cash. Sort by your payment option of choice to make it easier to find the best price. Cash can be in person or by mail and is of course the most perilous option. Not recommended if you haven't already committed a crime. Crime is also not recommended in general.
If you are buying, initiation of a trade will lock a vendor's XMR into the service's escrow. You will have about an hour to send the AUD, before they are able to cancel the trade. Make sure you do so and click "I have paid" before this time expires. This will keep the XMR locked for you until the vendor confirms receipt. Keep evidence of payment in case of dispute. This is easy for bank transfers.
Break larger amounts into discrete transactions with the same vendor. If the first goes smooth, it is likely that subsequent transactions will also go as smooth, if not better. Risk is mitigated.

Option B
Some centralised exchanges do offer Monero in Australia, though none are straightforward unfortunately. Here is a recommeded course of action:

Sign up to Binance, verify ID fully (you'll need license or passport) , and add AUD to your balance using a credit/debit card. You could also buy BTC or BUSD directly with your card, to save time. NOTE: DO NOT LINK A BANK ACCOUNT OR USE DIRECT BANK TRANSFER. THIS WILL PERMANENTLY LOCK YOUR BINANCE ACCOUNT OUT OF TRADING PRIVACY COINS LIKE MONERO.
Exchange BTC or BUSD for XMR. You can now withdraw this to your private wallet.
To sell your XMR, you can deposit it to your Binance account. Now swap it for another, more widely supported coin. I prefer low-fee coins. LTC, NANO or XLM are solid options, with LTC probably being the most convenient of all.
Since you cannot withdraw AUD from Binance, you will now have to create an account at another exchange. Coinbase or Coinspot are viable options. I prefer Coinspot as it is Aus based and has good customer service. You can link your bank account to this exchange.
Move your LTC to the second exchange (let's say Coinspot). You could withdraw to your private wallet first, or transfer directly between exchanges.
Sell LTC for AUD at Coinspot and withdraw to your bank account.

BONUS NOTES: If you've already locked yourself out of XMR on Binance, you can create an account either on Mandala or Poloniex. These service Australia, but do not offer AUD onramps/offramps of any kind. So, similar to the steps above, you can use Binance to acquire LTC or BUSD, send to these secondary exchanges and trade Monero there. Poloniex has the advantage of offering margin trading, if that's your thing.
Option C
Buy Monero on a direct exchange. The only one I am aware of is changenow.io. You can just buy it directly to your private wallet using your credit/debit card. This is the most expensive option as they take about 11% on top of market price. It is also the fastest. Note also that they will likely ask for proof of ID, which can slow you down. They are not upfront with this, unfortunately.


How to block telnet access for one particular network from all networks except one using Extended ACL

Question: Scenerio is given in the picture.  I want to block all the networks except 192.168.5.128/25 from doing telnet of 192.168.5.0/25.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
Answer: On Switch0, you permit the single source subnet for telnet you want, deny all other telnet connections and then permit everything else.
<code>1000 permit tcp 192.168.5.128/25 192.168.5.0/25 eq 23
1010 deny tcp any 192.168.5.0/25 eq 23
9999 permit ip any any
</code>
Comment: Unless the switch is layer 3, that ACL has to go on Router 0.
Comment: The 2960 should support extended ACLs. Putting it on the router doesn't prevent telnet from within 192.168.5.0/25.


Grand Central Dispatch versus Cilk++

Question: Anybody have any thoughts on Grand Central Dispatch (which has now been open-sourced by Apple) and Cilk++? Comparisons/contrasts? Is Cilk more Windows-only?
Answer: The big innovation with GCD is that it includes kernel-level parallelism. There are a lot of parallelism libraries and parallel programming languages, but that is all application-level support. Rather than sticking a bunch of threads in a process into a pool and splitting them up among the processors, GCD has a shared pool of threads from throughout the entire system.
Answer: An ancillary benefit, aside from the task-level parallelism, which I use in all sorts of *NIXes is the blocks runtime, which I use extensively in ObjC and straight C code. C is such a nice language anyways; to give it higher-order functions is like a gift from god ;)

Grand Central Dispatch versus Cilk++


InstallShield to WIX

Question: I have an .MSI that was created using InstallShield 2008. and now I need to use WIX to create a patch. Is this possible using WIX directly or do I need to convert my Installshield .ism source to a WIX project
Answer: You can create patches using the WiX toolset as long as you have the base MSI and the updated MSI. See http://blogs.msdn.com/pmarcu/archive/2008/05/30/Patching-something-you-didnt-build-with-WiX-using-WiX-.aspx for more information.
Answer: Provided your Installshield MSI is a standard MSI and not an MSI with custom dialog boxes (generally referred to as an Installscript MSI), it should be possible to create the update with WIX. That's not to say this will be easy. You would need to match up all component GUIDs and preferably keep the directory table structure identical among other things. Could be serious trouble.
If you still want to try this I would decompile the Installshield MSI with dark.exe, eliminate unnecessary sections such as the Installshield GUI dialogs (unless you have custom logic in your dialogs) and in general try to simplify things as much as possible. Wix has ways to insert the necessary "default elements" of an MSI (such as the GUI) if you omit code for it in your WIX source file and include defaults.
All in all I wouldn't recommend this unless you have prior WIX and Installshield experience. I have both, and I think it would take me a fair time to complete this successfully, but it all depends on the complexity of the setup itself.

InstallShield to WIX


Discrepancies regarding the story of Safi Ibn Sayyad

Question: I have some questions regarding the story of Safi Ibn Sayyad. It is narrated in: https://sunnah.com/bukhari:1354, we understand that this young boy named Safi ibn Sayyad was accused of possibly being the Dajjal. The rasool (swl) considered this as a mere possibility, yet, I find many discrepancies with this. For starters, at this current time, this boy was from Medina, yet, the rasool (swl) had stated that one of the criteria of the Dajjal's character, is that he cannot enter Mecca or Medina.
Secondly, in the following narration: https://sunnah.com/muslim:2920a, we find that the Dajjal will not emerge until the conquering of Constantinople, yet, the rasool (swl) had considered the possibility that Safi ibn Sayyad could have been the Dajjal? Even though he was from Medina, despite the fact Constantinople had not been conquered, wouldn't such criteria immediately disprove the fact that he is the Dajjal?
Thirdly, in the following narration: https://sunnah.com/muslim:2942a, we find that a group of former Christians had seen the Dajjal chained down on another island far from Arabia, yet, suspicions were cast on Safi Ibn Sayyad of being the Dajjal? We know that for example, Umar RA and his family swore by Allah that Safi Ibn Sayyad was the Dajjal and Umar RA swore in front of the rasool (swl) and he had remained silent, showing that the rasool (swl) felt it may be possible too. Yet, all these findings and signs about the Dajjal completely point out the contrary to Safi ibn Sayyad being the Dajjal. How could it even be possible that the great companions, let alone, the rasool (swl) would even consider this a possibility? Lastly, we have the following narration: https://sunnah.com/muslim:2927c that shows that even after the death of the rasool (swl), the companions had considered this to be a possibility.
How is this even possible? So many signs, prophecies, and so fourth completely pointed in an opposite direction towards Safi Ibn Sayyad being the Dajjal, yet, why and how could the rasool (swl) even consider such a possibility?
I would appreciate it if someone was able to give a detailed response to all of the questions that have been aroused. This to me feels like an extremely compelling theological problem and I would like to be able to dismiss it somehow.
Comment: Salam and welcome to IslamSE the Q&A site about Islam. To learn more about our site and model consider taking the  [tour] and checking our [help].
Answer: There is disagreement among the scholars on whether or not Ibn Sayyad is the Dajjal. The reports can be explained to support either stance.
The ahadith about Dajjal being unable to enter Makkah or Medinah apply after his 'emergence' meaning after he declares himself and begins his activities. It is possible that before that he could enter Makkah and Medinah:

وفيه دلالة على أن قوله صلى الله عليه وسلم إن الدجال لا يدخل المدينة ولا مكة أي في زمن خروجه ولم يرد بذلك نفي دخوله في الزمن الماضي والله أعلم
This hadith (about the vision of Dajjal circumambulating the Ka'bah ) is evidence that the saying of the Prophet ﷺ that Dajjal would not enter Medinah nor Makkah means at the time of his emergence and it does not negate his entrance in the past, and Allah knows best.
— Fath al-Bari

وأما احتجاجه هو بأنه مسلم والدجال كافر ، وبأنه لا يولد للدجال وقد ولد له هو ، وأن لا يدخل مكة والمدينة وأن ابن صياد دخل المدينة ، وهو متوجه إلى مكة ، فلا دلالة له فيه لأن النبي صلى الله عليه وسلم إنما أخبر عن صفاته وقت فتنته وخروجه في الأرض
As for Ibn Sayyad's argument that he is not the Dajjal since he is a Muslim and the Dajjal is a disbeliever, and that he has children unlike the Dajjal, and that Dajjal will not enter Makkah and Medinah and he entered Medinah and was heading to Makkah - then there is no evidence in this argument for him because the Prophet ﷺ only told about his characteristics at the time of his fitnah and going out in the land.
— Sharah Nawawi

The Dajjal's emergence after the conquest of Constantinople is also not contrary to him being Ibn Sayyad. The Dajjal can be born and exist before the conquest, it is only his fitnah that comes after the conquest.
As for the hadith of Tamim al-Daari about seeing the Dajjal chained on an island then again it is possible to reconcile this report, for example:

وما يبعد أن يكون بالجزيرة ذلك الوقت، ويكون بين أظهر الصحابة في وقت آخر
It is possible for him to be on the island at that time and to be present in the midst the Sahaba at a different time
— Al-Tadhkirah

وأقرب ما يجمع به بين ما تضمنه حديث تميم وكون ابن صياد هو الدجال، أن الدجال بعينه هو الذي شاهده تميم موثقا، وأن ابن صياد شيطان تبدى في صورة الدجال في تلك المدة إلى أن توجه إلى أصبهان، فاستتر مع قرينه إلى أن تجيء المدة التي قدر الله تعالى خروجه فيها
The hadith of Tamim and what is reported about Ibn Sayyad can be combined: the one who Tamim saw was the Dajjal himself, and Ibn Sayyad was a devil who took on the shape of the Dajjal for a period of time, until he went to Isfahan and disappeared with his companion (the Dajjal) until Allah brings about the time of his emergence
— Fath al-Bari

The Sahaba could have held that the reports are reconcilable and that despite them Ibn Sayyad would become the Dajjal in the end of times. For example this hadith (if it is authentic) implies that Jabir was aware of he hadith of the Jassasah and believed that Ibn Sayyad was the Dajjal even if he had accepted Islam, entered Medinah and died.

Those who claim that Ibn Sayyad was not the Dajjal claim that initially the Prophet ﷺ was unsure about Dajjal's identity as the details were not revealed to him at that time. He was suspicious of Ibn Sayyad because some of the known characteristics of the Dajjal were present in him. Later he was given more detailed description about the Dajjal through revelation.

ويحتمل أنه - عليه السلام - كان كالمتوقف في بابه، ثم جاءه الثبت من الله، أنه غيره، فقال في حديث تميم الداري
It is possible that the Prophet remained silent regarding the matter and later he was informed by Allah that the Dajjal is a different person, such as in the hadith of Tamim al-Daari
— al-Ba'th wa'n-Nushoor

ويحتمل أن يكون هذا قبل أن يوحى إلى النبي ﷺ في أمر الدجال، وتعيينه
It is possible that this happened before the revelation to the Prophet  ﷺ regarding the affairs of the Dajjal and his identity
— al-Bidaya wa'l-Nihaya

Similarly, the Sahaba who continued to say that Ibn Sayyad was the Dajjal might have been unaware of the incident of Tamim al-Daari which clarified that Ibn Sayyad was not Dajjal. There are several other examples of where some sahaba were unaware of some ahadith since they did not accompany the Prophet ﷺ at all times.
Ibn Sayyad was a Dajjal, meaning a charlatan who made false claims for a period of time. But this group holds that he was not the greater Dajjal who would be killed by Jesus  عليه السلام  at the end of times.
Comment: So what is meant by emerging in all these hadiths refers to an official emerging, ie, he announces himself and starts fitnah across the land, and once this happens, he is no longer allowed to do so and so such as entering mecca and medina? Could you provide some sources for that as well as a proper chronology of when the following narrations were made and the event it's correspondent too? Likewise, could you give a  detailed response to my other questions regarding the companions as well? I know it's not necessary for any1 to do this, but I'd appreciate it if possible. Thank you.
Comment: Also, is it possible these narrations regarding Safi ibn Sayyad may refer to "a dajjal" rather than "the dajjal"? would appreciate a detailed response on that too and some sources to help claim it if such a theory is possible. Thank you.


Can I get Claptastic Voyage for The Handsome Collection on the ps4?

Question: I bought the disc but can't locate any DLC for claptastic voyage. Is it not available on the ps4?
Comment: What do you mean you can't locate it? You can't get the DLC to start or you can't see it as an available DLC to download?
Comment: I can't find it to download in the playstation store.
Answer: Claptastic Voyage should be included with the Handsome Collection.
Simply take the Quick Travel system to Deck 13 1/2.
Answer: The downloadable content "Claptastic Voyage" is included with purchase of Borderlands: The Handsome Collection, but is not on the physical disc. It will need to be downloaded from PlayStation Network / Xbox LIVE. You will need to make sure you have the latest update for Borderlands: The Handsome Collection. - gearbox swoftware
Source : Post on Gearbox Software Zendesk
Comment: Do you have a source? This conflicts with the accepted answer.
Comment: This answer is not correct (at least for the ps4 version). I did not realize when I asked the question that there was a Quick Travel to Deck 13 1/2 (I remember feeling silly for playing through the whole game twice and never noticing it)


How to manually install Ubuntu Server

Question: I'm interested in buying Raspberry Pi 4. I'd like to create simple server for testing my applications and storing data (home cloud). I wonder if I can manually install Ubuntu Server like on standard computer. Can I boot from USB and install OS on SD card / external disk instead of burning preinstalled Raspbian / Ubuntu?
Comment: USB booting is not generally available on an RPi4, it's still in early beta testing. https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=196778 is the best way to boot a RPi4 from a USB device right now.
Answer: The simplest way is to visit the download site and
select your version.  I would go for the 64bit 20.04 for your proposed Pi 4B and drop it onto an SD card for now.
Play around for a few weeks till the USB SSD/HDD boot is a bit more complete or help out and test the beta software.
I have one 20.04 Intel box running with around 8Tb of data so far as a temporary NAS and not broken it yet :)
Comment: Thanks. But is there an option install Ubuntu manually (preferably expert mode) going this way? I don't really need to boot from USB if only I can install "custom" version.

How to manually install Ubuntu Server


internet connection sharing after restart

Question: at wits end.   my comp uses wifi to connect to modem, I share this connection using ethernet to another router with several devices hooked to it. When i restart the system, i have to go to wifi properties to uncheck share and then recheck it in order to get the share working again. Is there a way to have this done automatically after a restart?> is there also a way to have a stable bridge between these units so the primary router gives IP instead of the standard 192.168,137.1. would love for it to pass along the connection so all my devices here will see the primary network. I have a nas hooked to the seconday network but want the primary to see it for backups. cant bridge my secondary to comcast modem as it freezes the modem after some use. Thx.
Answer: Hate to say it like this, but
You're using the wrong tool for the job. You would be better using a router that is designed to do that than use your PC.
https://www.amazon.com/D-Link-Wireless-App-Enabled-Dual-Band-DIR-850L/dp/B00BYRPPAS/ref=sr_1_5?s=electronics&ie=UTF8&qid=1495662144&sr=1-5&keywords=dlink+ac
Something like this would work for you application.


zener diode with op amp

Question:
hei Guys, im not sure about but i think is the input Vin<0 the Output Voltage will remain 0,7 and when the input higher than Vin>3 the output Voltage will stay -3 ....
and in case we remove the resistance R2 and the vin <0 than the Vout=0,7 and the if Vin>0  than it will stay  -3V ? thank you for ur help ...
Answer: Opamp circuit with negative feedback (=usually resistors or diodes or both between output and inverting input, capacitors are also possible) can be often solved with the following principle:
Uout settles to a value which produces to the inverting input the same voltage which is feeded to the non-inverting input.
The principle works if there's a way for the input currents (nanoampere), no allowed voltage nor loading limits are exceeded and the signal changes so slowly that the limited speed of the opamp is no problem. In addition the feedback circuit must not cause too much phase lag in the usable frequency range of the opamp. Your circuit obviously fulfills all these basic conditions.
So with negative Ui voltage Uo must rise high enough to lift the inverting input to GND. With usual diodes that's about 0,7V. With positive Ui voltage Uo must fall until it's able to pull the inverting input to GND and that happens when the zenerdiode starts to conduct to reverse direction.
If you make R2 small enough this behaviour becomes difficult to notice because the available Vin range becomes to narrow. As long as the diode doesn't conduct to either direction the output voltage Uo=-(R2/R1)Ui.
Your circuit is the common inverting amplifier with level clipping, the clipping is asymmetric because different polarities get different treatment. When R2 is removed the gain is high, you'll get only 0,7V or -3V output depending on the polarity of the input voltage.

zener diode with op amp


"In review" or "under review"

Question: What is the difference between the year in review and the year under review?
Answer: One uses in review when the purpose is simply to recollect or remember events.
One uses under review when the purpose is to critically scrutinize events- for example to find fault or establish innocence.
Answer: In review is going through the past in a flash. Under review is to assess something.

European crisis under review.  this means assessing European crisis
Last year in review. This means reviewing the major things that happened in the course of last year.

"In review" or "under review"


How does a race condition work?

Question: When two threads try to access the same resources at exactly the same time how does the computer decide which one gets the resource, or is it just decided at random?
Answer: On a single-processor system, it is impossible for two threads to access the same location simultaneously. Rather, if the threads access the same data outside of a critical section, it's possible for their execution to become interleaved, in which case the access order is undefined. Execution is concurrent and you might call the result "random", in that nothing obvious affects the choice of one thread's code over another's. Of course, the scheduler is making the choice somehow, but it's fairly opaque in terms of ordering for access to thread-shared memory.
In multiprocessor/multicore/distributed applications, the notion of ordering is a little hazier. We can define the happens-before partial relation based on causation of signals and use this to define time stamps that can be used for coordinating events across sites. Unrelated events are called concurrent, and any processes which care about the order of concurrent events need to agree amongst themselves.  Consistency is a well-studied problem in shared-memory distributed systems. If sites request access to shared memory over some medium (bus, interconnect, etc.) then the medium access protocol will, in an opaque fashion, determine which thread gets access first. Like scheduling, the result here may appear "random", since different decisions can be made on different executions.
Answer: a "race condition" is actually a more technical/specialized term than the sense you are using in a generic way, it does not really simply mean that two threads are accessing the same resource at the same time. it is in general used to refer to subtle programming defects where the results of parallel thread processing can unintentionally vary based on thread execution order, when the intention is that there is not a variation. in other words imagine two threads A, B that do some same "operation". and the results of that "operation" are "different" when thread A runs before thread B versus when thread B runs before thread A.
in a multithreaded system one cannot assume a particular thread execution order unless it is fixed by thread ordering mechanisms (eg say a multithreading synchronization system like a semaphore etcetera).
the general study of how threads are scheduled is in scheduling theory. the basic strategies are known as scheduling disciplines. eg a simple strategy is FIFO or "first come first served".

How does a race condition work?


How to implement stress/strain mechanics in voxel terrain?

Question: I am in the process of developing a Minecraft-like world where the terrain is divided into voxels. However, I would also like for unstable configurations of landscapes to collapse predictably. For example, an overhang that is too heavy would fracture and break off at 'high stress' voxels, as would a pillar formation with an asymmetrically eroded base. I was thinking about adding a 'stress vector' field to each voxel in the terrain, and doing the following (pseudocode):
<code>foreach voxel in terrain
    foreach neighbor in voxel.neighbor_voxels()
        if magnitude(voxel.stress - neighbor.stress) > stressThreshold
            detach_voxels(voxel, neighbor)
</code>
But the problem is that I don't know how I would go about calculating these individual stresses. Is there some kind of FEA-based algorithm specialized for voxel discretizations that I can use to calculate the stresses on a per-voxel basis? Or am I approaching this all wrong and there's some other way to do this?
Answer: You may consider a DFS search of all of the connected voxels and determine the voxel that is the single most depended on or "branched" from. And then run your nice little pseudo code. :)


Can somebody from the EU get an Australian business number to register a COM.AU domain?

Question: I need a help with .com.au domain registration. I live in EU, so I'm not a citizen of Australia. In case to register this address, I need an Australian business number (ABN). I'm going to develop a simple website (without any kind of sales) and monetize it with Google Adsense. So, is it possible to get an ABN for a website like that and register .com.au address?
Answer: To get an ABN without having an Australian tax file number (TFN), you must provide:

proof of identity documents and a statement of your business activities in Australia.
ABN for businesses outside Australia - Australian Business Register

So if you are not living in Australia, not an Australian citizen and not running a business in Australia, you are out of luck in getting a .com.au domain.
Comment: Then maybe you know is there is a possibility of third party service for registration?
Comment: @MykolasK I don't know of any personally. There may or may not be a viable loophole.
Comment: They are very strict on the .com.au registration. I'm from Australian and my sister had one for her shop, and it was still a pita for her to get it sorted out.
Answer: A foreign company can register a .com.au in Australia if it has eligibility. One way to obtain the right to apply for a .com.au is to obtain a trade mark. Once you file for the trade mark application you can apply for the domain name.
Answer: No, you are basically trying to get around registry policies as you are not eligible plain and simple.
The registry website at https://www.auda.org.au/industry-information/au-domains/ states for com.au:

For commercial entities, such as companies (with ACN as registered
  through ASIC), and businesses (registered with state governments).

You are neither a commercial entity nor a business based on your description, so you are not eligible to get a com.au.
If you really want it, you will need to ask someone else, that is eligible, to register it on your behalf. With a lot of caveats on that operation, besides the cost. This is basically called a "proxy" service and is allowed or not, depending on the TLD. Many registrars provide this service, so contact your trusted one and ask him what he offers for .com.au domains. Any question like yours should start at a registrar. Or you can also ask the registry directly and state your case. But most of the time any competent registrar should be able to give you a tailored answer based on your specific situation.