Bond curve fitting, practical question

Question: when fitting gov bond curves, What are different logic's used by traders to set the weight for the different bonds ?
Answer: Let's define the problem as follows: Given a set of $N$ bonds, we wish to create a discount curve, composed of $M$ degrees of freedom, so as to minimize the weighted price errors:
$$ \min_{m_1...m_M} \sum_{i}^N w_i(P_i - \hat{P}_i(m_1..m_M))^2, $$
where $P_i$ is the quoted price of bond $i$, $\hat{P}_i$ is the theoretical price of bond $i$ using the fitted discount curve, and $w_i$ is the weight assigned to bond $i$, and $m_j$ is the value taken by one of the degrees of freedom. You are specifically asking about how to choose $w_i$.
There are many options, depending on preferences and markets:

The easiest is $w_i = 1$ so all the prices are weighted equally. This is actually a good option if you don't care about the short end of the yield curve that much (e.g., you are a long bond trader).

The most popular choice is $w_i = 1 / \text{DV01}_i^2$. This roughly translates the minimization problem into minimizing yield errors. This would generate much better fit at the front end of the curve, while sacrificing the long end.

The next option is to use a blended approach, setting $w_i = \lambda + (1 - \lambda) / \text{DV01}_i^2$. By choosing $\lambda\in[0,1]$, you effectively can control the relative importance of price errors and yield errors.

More exotic schemes based on market segmentation are used as well; e.g., I've seen folks use duration-weighting for <1-year issues, uniform low weights for 1-10 year issues, and uniform high weights for 10-30 year bonds.

On top of the more systematic weighting schemes above, you can also multiply $w_i$ by an additional ad-hoc adjustment factor to scale it up and down for specific bonds:

While traders in the US typically exclude on-the-run issues from curve fitting, JGB traders there fitted curves to closely mirror on-the-run issues. So in those cases, you simply multiply $w_i$ of benchmark bonds by a number greater than 1 (say 10).
Some prefer to lower the weights of seasoned, less liquid bonds. You can define liquidity in many ways, but the easiest method is to simply treat bonds that have rolled out of their original maturity bucket as illiquid (e.g., a 30-year Treasury bond with less than 10-years to maturity), in which case you may assign a very low weight to these bonds. I've also seen people set different weight factors depending on the distance to the original maturity.

There's no rule that fits all scenarios. It depends on the market generally, the market conditions in real-time, and how you plan to use the curve.
Comment: Thanks @Attack68. It'll be be great if you elaborate on these points in an answer as well =D
Comment: Whilst the question asks directly about weights and this is an excellent response, there are also other factors with subjectivity, such as interpolation style(s) of the curve, whether to account for the convexity element of the coupon level, how many degrees of freedom the curve has etc. It may well be that some of these additional factors out weigh (pun intended?) the effect of how to choose the weights.
Answer: @Helin provided a great answer for the specific question.
I would note that when curve building your framework always falls under one of three regimes:

Completely specified: the number of degrees of freedom of the curve matches the number of (sufficient) instruments.

Overspecified: the number of degrees of freedom is less than the number of (sufficient) instruments.

Underspecified: the number of degrees of freedom is more than the number of (sufficient) instruments.

When completely specified, weights are essentially (to machine tolerance) irrelevant because the minimum solver solution is attained at zero.
When underspecified, the solver is chaotic. It is practical to add information (usually pseudo-instruments) to convert to the completely specified case (or overspecified).
Only in the overspecified case do weights have an impact.
But there are other subjective choices besides weights that influence the shape of resultant curves. Below are three example factors. Suppose calculating a matrix of curves from the following set of combinations:

Weights: [(1,1,1), ($1/3^2, 1/6^2, 1/10^2$)] (2 combinations)
Position of degrees of freedom: [(5y, 10y)] (1 combination)
Interpolation [(log linear), (log cubic)] (2 combinations)

Here is a numerical example of the first of those combinations, in an overspecified regime with 3 bonds: apprx 3y, 6y and 10y:
# PYTHON
from rateslib import *

b1 = FixedRateBond(dt(1999, 2, 4), "3y", fixed_rate=2.0, spec="ust", curves="curve")
b2 = FixedRateBond(dt(1999, 5, 10), "6y", fixed_rate=2.0, spec="ust", curves="curve")
b3 = FixedRateBond(dt(1999, 7, 4), "10y", fixed_rate=2.0, spec="ust", curves="curve")

curve = Curve(
    nodes={
        dt(2000, 1, 1): 1.0,  # 0y
        dt(2005, 1, 1): 1.0,  # 5y
        dt(2010, 1, 1): 1.0,  # 10y
    },
    id="curve",
)

solver = Solver(
    curves=[curve],
    instruments=[
        (b1, (), {"metric": "clean_price"}),
        (b2, (), {"metric": "clean_price"}),
        (b3, (), {"metric": "clean_price"}),
    ],
    s=[101.0243, 101.27159, 101.301937],
    weights=[1., 1., 1.]
)
SUCCESS: `conv_tol` reached after 5 iterations (levenberg_marquardt), `f_val`: 0.19429355288961916, `time`: 0.0296s

Constructing all these combinations and plotting curve.plot("1b", comparators=[curve2, curve3, curve4])
Comment: How is the vector $s$ specified?
Comment: s= observed (clean) prices of the bonds at close of day.

Bond curve fitting, practical question


Balancing earphone sound

Question: I'm using Moto G3 unrooted nd using Sony earphones of MDR series. Suddenly the left side of my earphone started producing lesser sound than the right one.How to balance them???
Comment: Possible duplicate of [Altering left-right sound balance on Android 6.0.1](http://android.stackexchange.com/questions/151421/altering-left-right-sound-balance-on-android-6-0-1)
Answer: Android itself has a.f.a.i.k. no balance setting (which is a shame!).
But you can try in Googles Appstore "Bass Booster and Equalizer" - which installs itself as MusicPlayer and allows - amongst many other audio settings - to adjust the balance.
The only disadvantage is that the settings are limited to the application itself (the music player), and not system-wide effective.

Balancing earphone sound


Are there still meals in airliners?

Question: Just curious, since you currently have to wear masks the entire flight. Are there no meals because of that or are there still meals on long-distance flights and you can put your mask off then? Or if there's a long-distance flight without meals, how does one deal with it?
Comment: For comparison, on UK trains (my commute uses a short section of a long route), it's common to hear *Masks are compulsory and must cover your nose and mouth for the entire journey unless you're exempt.  The refreshment trolley will shortly be passing through the train*.  It's clearly permitted to remove the mask when actually eating.  This is abused by some - I'll call them "individuals" - who sit with a nearly empty cup of cold coffee in front of them for the entire journey as an excuse to not wear a mask.
Comment: @ChrisH exactly what my son & DIL did when the airlines expected a 3-year-old to wear a mask for a 12 hour flight. Every time a crew member came by, they popped a Cheerio into his hands. Same thing I'd do, too.
Comment: @FreeMan a 12 hour flight with a 3-year-old is hard enough at the best of times.
Comment: Virus doesn't care if you find precautions inconvenient.  Clever people are its favorite kind.  Every "I spread COVID to my loved ones" tragedy includes a whole bunch of "clever" at the start.
Comment: This varies dramatically by region and even different airlines in the same region. Specifying where (and ideally which airline) you're asking about would be helpful. As far as I know, though, most long-haul flights are still offering meal services, though many short-haul and medium-haul routes aren't.
Answer: Yes. On flights when meals are normally served, they are still served just with different protocols. When doing a transatlantic flight during covid-19, there are two meals, one dinner and one breakfast.
Each meal was served entirely packaged and we were instructed to remove our masks only after the service crew cleared our aisle. Beverage service was the same and  only sealed bottles were served, just water and soft drinks on my flights. Upon boarding, we were also given a care package including a water bottle and sanitizer in liquid and wipe form to clean our area to ensure we don't accidentally pickup the virus when we have our mask off later.
Comment: The silver lining is that now you can actually get the **whole** can of soda... and not just a half or third ? ;-)
Comment: @Jeffrey You always could
Comment: @Jeffrey Obligatory [The Oatmeal](https://theoatmeal.com/comics/airplane_heard).
Comment: @Jeffrey Where did yo get less than a full can? I usually got those mini cans or rarely a cup filled from a bottle
Comment: To add; I had to fly briefly in September to Spain from the UK (3hr) and on the flight there was the full menu as normal (as far as I remember). Masks where permitted to be removed while drinking or eating and put back on immediately when you're not drinking or eating. (I had a coffee and was asked to put my mask back on essentially between sips). We also were lucky to have maybe 3 rows to a person so I wasn't too concerned about the flight itself but it was nice/refreshing to see the airline staff enforcing the new rules and being able to serve from the menu.
Comment: @Rsf That was actually fairly common practice on many (though not all) US-based airlines from my experience.  (Mind you the last time I was flew was in the before-times.  Things have evidently changed on some flights?)  You could sometimes get the full can if you asked nicely, or if you were seated near the back and they knew it was unlikely they'd be able to use the rest of the can on someone else.
Comment: @DarrelHoffman - You also got the full can if you ask for something they rarely servie like 'diet ginger ale' otherwise, both US and Canadian airlines served half-a-can before covid by default
Comment: @DarrelHoffman I've always been given a full can if I asked for it.
Answer: As suggested in other answers, it depends. In Europe, EASA Health and Safety protocol published June 30th, 2020, recommends reduced service:

Aircraft operators should  reduce in-flight services to the minimum necessary to ensure passenger comfort and well-being and limit contact between cabin crew members and passengers, giving proper consideration to the duration of the flight. Among these measures, the following should be considered:

No duty free or other non-essential product sales on board.
Reduced food and beverage service. Alcoholic drinks should be avoided.
Preference for pre-packed and sealed food and drink products, such as canned drinks.
Wherever possible, payment involving touch or contact, such as cash payments, should be avoided to mitigate the potential transmission risk between cabin crew members and passengers

As far as I'm aware, similar advice is given in other parts of the world. Indeed, ICAO recommends to

Limit or suspend food and beverage service. Food and beverage service should be limited or suspended on short-haul flights or should be considered to be dispensed in sealed, pre-packaged containers.
Answer: I flew recently on a US domestic flight of four hours or so where it was announced that there would be no food service in the aisles, but there would be snacks and beverages available on request.  We were also instructed to remove our masks only for each bite or sip, replacing them in between.
Since the flight was completely full, this was the most time I'd spent in close proximity to a stranger in nearly a year, so keeping people from being maskless for minutes at a time seemed prudent, and everyone complied as far as I could see.
Answer:
Are there still meals in airliners?

That depends on the flight. Some countries do/did impose meal restrictions for domestic flights, e.g. at some point Thailand banned inflight catering on domestic flights (mirror) (December 31, 2020). But I'm not aware of such bans for long-haul flights: all long-haul flights I've seen did allow meals.
Answer: Yes. You take off your mask. I know this from a short haul flight, so logic says longer ones are more likely to have food.
Comment: I'm not the downvoter, but perhaps it's because this answer is based upon an assumption rather than verified information, sources, and/or direct experience which most of the other answers include. Stack Exchange generally holds answers to a higher standard than what might be found on an average forum. Anyone can post an answer along the lines of "logically it seems to me that..." - the best answers backup that up with facts and elaboration.
Comment: Logic says a lot of things that are ignored by a great many people, especially when it comes to masks.
Comment: Wait how did I get a downvotr?

Are there still meals in airliners?


Allow list views based on getting a users group via a Get User

Question: Is there away to hide views based on a usergroup using JavaScript?  At first we had one List and created views for each section.  Now we only want the individual views shown only if a visitor belongs to a certain group.  I understand that if we use a GetUserId method we can get their id.  Is there away to get the group then make certain views display based on Group?
Answer: You could create a blank Page and then add a a list view web part to display a specific view of your list. Make this web part only visible for a certain group using Advanced-->Target Audiences from the web part properties. Repeat these steps for all views.


Why aren't HTTP Headers passed from AWS API Gateway to Step functions

Question: I have an api gateway set up with integration to a step function - the integration is working well and my function is executed. However I have a need to access the headers on the initial request to the api gateway (as they need to be passed on to an API call made by one of the steps in the step function) I've added the http headers to the API Gateway Method Request and also done this in the HTTP Headers section of the Integration Request, then in the mapping template I have
#set($inputbody = $input.json('$'))
{
   "method": "$context.httpMethod",
   "input": "$util.escapeJavaScript($inputbody)",
   "stateMachineArn": "MyStateMachineARN",
   "headers": {
        #foreach($param in $input.params().header.keySet())
        "$param": "$util.escapeJavaScript($input.params().header.get($param))"
        #if($foreach.hasNext),#end
        #end
    }
}

When I test this I see the headers after the request body has been transformed - before it executes the step function
Thu Dec 23 09:35:28 UTC 2021 : Endpoint request body after transformations: {
   "method": "POST",
   "input": "{\"surname\":\"TESTSURNAME\"}",
   "stateMachineArn": "MyStateMachineARN",
   "headers": {
                "HeaderA": "ValueA"
        ,                "HeaderB": "ValueB"
                    }
}

But in the step functions I am struggling to see the headers - the input I can see at the start of the execution is only
{
   "surname::"TESTSURNAME"
}

I have inputPath set to $ and the same for the payload.
All the suggestions I've found online point to the mapping template but I can not get it to work - any ideas what I'm doing wrong?
Answer: The API Gateway -> Step Function integration uses StartExecution as the action for the integration. Checking the documentation for StartExecution request syntax, it turns out that headers is unfortunately not one of the allowable fields that can be passed. To pass the headers in it looks like you would need to add them onto the input.


Free up space in Mail & Messaging after deleting mail accounts

Question: I am using a Lumia 730 Windows Phone which I recently updated to Windows 10. The update is installed and the very next day it gives a message for more updates. When I try to install, my phone is out of phone storage. Now in order to free up some space I deleted my email accounts (all other than Microsoft). But I still can't see the space available and under Storage Mail & Messaging is still showing 800 MB. Any ideas how can I free up some more space from there?
Comment: 800mb for mail app is pretty weird! try this once ! remove all ur email accounts from outlook mail app, restart ur phone and check once in storage sense! if still, 800mb is intact, u gotta reset ur phone buddy!
Comment: Coudn't find anything else, had to reset the phone in the end which did the trick. Thanks. :)
Comment: Same issue here. I couldn't figure out how to free my 600Mb occupied by the email app.
Answer: I recommend some steps to reduce your storage consumed by Mail & Messaging app.

Backup your SMS & MMS into SD card by using Transfer My Data
app by Microsoft. Delete the SMS and MMS on your phone. You can restore it using
the same Transfer My Data app after update.
Unlink Skype from Messaging app. Use Skype app instead. It can be moved to SD card if needed.
Change your mail settings so that the Mail app will download only the email from last 3 days.
Restart your phone.
Answer: I also have Lumia 730. You probably upgraded your phone from Windows 8.1. Go to storage app & see what is consuming more storage. Delete or uninstall some unwanted apps. Try moving some low duty apps (which you do not use every time or simply like a dictionary app) to SD card. Try moving songs, videos and photos to SD card. If you have upgraded to Windows 10 using Windows Insider production ring method. Try resetting your phone or wait for Redstone 1 update. It will probably have solution for this.
Comment: Rohit clearly said that Mail & Messaging is consuming 800MB. He wants to free up that space. Your answer clearly does not provide solution to his problem. Please read the question fully.
Comment: Thanks for your Guidance. I will take care about these things in future.
Comment: I think there is not any way to clear cached data of apps in Windows 10 Mobile. I said wait for Redstone 1 update. Also I said to reset phone. This is temporary solution. Main thing is clearing of cached data of apps. If you know any way to do this please tell. However I faced similar problem with Instagram (Beta) new app, which reached about 600 MB. I've  to uninstall it & again install it. Mail is system app it can't be uninstalled. So my is answer to wait for next update. If you know something else which is appropriate solution for this, then please tell.
Comment: `Free up space in Mail & Messaging after deleting mail accounts` is the question. The answer you provided does seem to be a general step in freeing up storage in phone. Please try to provide direct answer to the question before suggesting alternate workarounds. At least you could mention that there is no way and the only option is to reset your phone. But you mentioned `Go to storage app & see what is consuming more storage....` which was already told by the author that he did that.
Comment: `If you know something else which is appropriate solution for this, then please tell.` Don't take things too personal. I appreciate your contribution towards the community, its just that I want to correct you here so that you can contribute more to the community. This is a QA community where people ask questions about actual problems they face. It's important that we contributors understand the problem fully before answering it. Also relying your answer on chances of future update is not a good thing as well.


Why does storage's performance change at various queue depths?

Question: I'm in the market for a storage upgrade for our servers.
I'm looking at benchmarks of various PCIe SSD devices and in comparisons I see that IOPS change at various queue depths.
How can that be and why is that happening?
The way I understand things is: I have a device with maximum (theoretical) of 100k IOPS. If my workload consistently produces 100,001 IOPS, I'll have a queue depth of 1, am I correct?
However, from what I see in benchmarks some devices run slower at lower queue depths, then speedup at depth of 4-64 and then slow down again at even larger depths.
Isn't queue depths a property of OS(or perhaps storage controller), so why would that affect IOPS?
Comment: Doesn't it take a little effort to maintain these queues, maybe optimize the order, or perform other request optimizations?
Answer: The short answer is that harddrives optimizes retrieval of data if there are more than one IO request outstanding, which usually increases throughput at the expense of latency.
NCQ does this, reorders IO requests to optimize throughput.
SSD:s work differently from mechanical drives since they have parallell flash chips to store data on. Ie if you issue one IO request at a time the latency (search + read time) decides IOPS. But if you issue 4 requests at once the ssd disk might be able to retrieve them in parallell or another optimized way and you might get 4 times the throughput.
The higher the queue depth gets the more possibilities to optimize the disk gets, to a point. Since IOPS is a function of throughput this increases IOPS at higher queue depths.
EDIT:
The true queue resides in the OS which is issuing all requests. That said I would conjecture the controller driver passes on a certain amount of the queue to the controller and disk so they can work at their optimized queue depths. The disk must have it's own queue to be able to optimize.
Comment: To simplify things, let's talk only about SSD. Then how come IOPS decrease over certain queue depth? Shouldn't it reach its peak and remain flat beyond that? Where dose that "queue depth" reside? In OS, chipset controller or ssd itself?
Comment: Management overhead on a limited resource (the controller)?
Comment: What TomTom said, congestion. But most disks IOPS queue depth profiles sort of flat out when they max out.
Comment: @Molotch, And what happens when you get an incoming request but the queue depth is already full?
Comment: @Pacerier when you exceed the queue depth on target, you should expect performance degradation. When too many concurrent I/Os are sent to a storage device, the device responds with an I/O failure message of queue full (`qfull`). This message is intended to cause the host to try the I/O again a short time later.
Answer: Old question, but deserves more info due to the number of times it gets seen.  This answer is based on SSDs, since that's what the original question is about.
Queue depth and the variation of IOPS based on queue depth.  Consider a queue depth of 1.  In this case, the spec given is not based on a drive falling behind a number of requests that the system is generating, but instead means, the system generates 1 request to the SSD.  There is a transaction time for a request, so if only 1 request is sent at a time, the SSD can only process 1 request.  This should make sense.  Because of the transaction time, sending 1 request at a time is slower than sending 32 requests all at once, which is what a spec like QD32 means.
Also, as another comment pointed out, you may be able to do some reading/writing in parallel with an SSD, on PCIe, not SATA.
In the case of the Samsung 970 Pro for instance, QD1 = 55,000, and QD32 = 500,000 IOPS.  This is basically because you are sending one request, vs. 32 at once.  The transaction time is lessened, so you are mostly dealing with the data transmission.  So, minus out a lot of transaction processing, and the actual function of data transmission increases.
So, the spec that's given for the disks is not exactly the same as the definition of queue depth.  Queue depth in regards to the system is basically the number of requests that haven't been processed.  The spec is based on transactions the system sends the drive at a time.  However, if you're dealing with a SAN, the queue depth is basically the number of requests in-flight.  So, I'm not quite sure on an exact definition for that term.  To me it seems to vary depending on the particular part of the system you're referring to.
As far as the transactions between the OS and the device, the device is going to buffer a certain amount of transactions, and after that, the OS won't send more transactions.  There HAS to be a form of handshaking that allows for orderly processing, which means an OS can't send more requests to a drive than it can physically hold.  Otherwise you have chaos, and a poorly designed system.
A question like "what happens when you get an incoming request but the queue depth is full" in other words, should never happen in regards to the disk, and the disk doesn't have a "queue depth" to hold the requests, it has a "queue". The physical number of requests that a drive will hold is going to vary based on the type of drive.  It can't be too small or the disk can't optimize the read/writes very well, and it can't be too large for many reasons, cost being one, inability to optimize after a certain number of requests are in the queue would probably be another.


How can I show line numbers in Eclipse?

Question: How can I show line numbers by default in Eclipse?
Comment: @Uri: Ehm, so that when you get an error message thrown at you by the compiler you can quickly find the line by scanning the document with your eyes.
Comment: Still I find it much faster when using a tool like lint to scroll to each line when there are multiple errors and having a way to show line numbers is invaluable. Also when taking screenshots it can be nice to see the original line numbers for discussion purposes.
Comment: @X-lstence ctrl-l will bring up a pop up box where you can enter a line number to jump to
Comment: Big News! (reported by Lars VOGEL): starting 4.4M4, line numbers are activated *by default*! See [my (edited) answer below](http://stackoverflow.com/a/641540/6309)
Comment: What do you mean, "by default"?  For each new workspace?  For each new install of eclipse?  I'm confused.
Answer: Window → Preferences → General → Editors → Text Editors → Show line numbers.

Edit: I wrote this long ago but as @ArtOfWarfar and @voidstate mentioned you can now simply:
Right click the gutter and select "Show Line Numbers":
Comment: Thanks! I'm using the Juno release and eventually found it under eclipse -> preference -> general -> editors -> text editors -> show line numbers.
Comment: In Eclipse for Mac, it's not in Window->Preferences but in Eclipse->Preferences
Comment: @CJDennis Or you can just type "line" or even "line number" in the search bar of the preferences. That's something they did do right. Besides that it *is* in a logical location.
Answer: If this doesn't work it may be overridden by your current settings. You can right-click in the bar to the left of the code where line numbers would normally appear and turn them on with the context menu.
Answer: Update November 2015:
In Eclipse Mars 4.5.1, line numbers are (annoyingly) turned off by default again. Follow the below instructions to enable it.

Update December 2013:
Lars Vogel just published on his blog:
Line numbers are default in Eclipse SDK Luna (4.4) as of today
(December 10, 2013)

We conducted a user survey if users want to have line numbers activated in text editors in the Eclipse IDE by default.
The response was very clear:

YES : 80.07% (1852 responses)
NO  : 19.93% (461 responses)
Total  : 2313
Skipped:   15

With Bug 421313, Review - Line number should be activated by default, we enabled it for the Eclipse SDK build, I assume other Eclipse packages will follow.

Update August 2014
Line number default length is now 120 (instead of 80) for Eclipse Mars 4.5M1.
See "How to customize Eclipse's text editor code formating".

Original answer (March 2009)
To really have it by default, you can write a script which ensure, before launching eclipse, that:
[workspace]\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefs does contain:
lineNumberRuler=true

(with [workspace] being the root directory of your eclipse workspace)
Then eclipse will be opened with "line numbers shown 'by default' "

Otherwise, you can also type 'CTRL+1' and then "line", which will give you access to the command "Show line numbers"
(that will switch to option "show line numbers" in the text editors part of the option.
Or you can just type "numb" in Windows Preferences to access to the Text Editor part:

Picture from "How to display line numbers in Eclipse" of blog "Mkyong.com"
Comment: On the current Eclipse Mars version (4.5.1), line numbers are not enabled by default (annoyingly).
Comment: How can I set left indent spacing, to add some space between line number and the first character of each line?
Comment: @Ωmega 10 years later, I don't know. that would be space or padding between the gutter and the code editor.
Answer: As simple as that.
Ctrl+F10, then N, to Show or hide line numbers.
Reference : http://www.shortcutworld.com/en/win/Eclipse.html
Comment: One need to have focus in the Editor for that shortcut to work, but that is pretty obvious if one reads the section title in the referred article. :-)
Answer: Slight variation on Mac OSX:
Eclipse → Preferences → General → Editors → Text Editors → Show line numbers
Answer: Windows → Preferences → General → Text Editors → Show numberlines
Answer: in this file
[workspace].metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.ui.editors.prefs
make sure the parameter
lineNumberColor=0,0,0
is NOT 255,255, 255, which is white
Comment: Does that mean you can have different colors of line numbers? Interesting. I will try that sometime soon.
Answer: Go to Windows → Preferences → General → Text Editors → Show numberlines. Click OK, then Apply changes. Then it will show the line count automatically.
Answer: one of the easy way is using shortcuts like : Ctrl+F10, then press n "it show line number and hide line numbers.
Answer: The top answer is good but you can also bind it to a key ( shorcut ) to toggle it..
Window > Preferences > Keys then enter "Line Numbers" in filter and bind it to a key.
I use CTRL + S + L.
Answer: Open Eclipse
goto -> Windows -> Preferences -> Editor -> Text Editors -> Show Line No
Tick the Show Line No checkbox
Answer: click on window tab and click on preferences

do this and check show line number
Answer: the eclipse changes the perferences's position
to eclipse -> perferences
Answer: On a Mac do this:
cmd + , or ADT -> Preferences

Expand General -> Editors ->Text Editors
Check box: Show line numbers

Answer: Eclipse has a search feature in the top left box of the Preferences.
Type in 'line numbers' in that search box, and presto...
In case you're tired of googling each time you forget...
Answer: this will be the appropriate solution for asked question:
String lineNumbers =
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER;
EditorsUI.getPreferenceStore().setValue(lineNumbers, true);

How can I show line numbers in Eclipse?


Big-endian systems and the smallest memory address

Question: I read on en.Wikipedia that "Big-endian systems store the most significant byte of a word at the smallest memory address and the least significant byte at the largest. A little-endian system, in contrast, stores the least-significant byte at the smallest address."
But I don't know what is "the smallest memory address", and how does "Big-endianness is the dominant ordering in networking protocols, such as in the internet protocol suite, where it is referred to as network order, transmitting the most significant byte first", in those type of protocols, the first is accessed the smallest memory address and in little-endian system is accessed the memory address?
Comment: The part starting with `and how ` and ending in `memory address?` is one awfully long subordinate clause - I can't understand it.
Comment: Memory addresses are numbers. 38 is a smaller number than 62
Answer: If the map of memory bytes were arranged from left to right in incremental address order, the smallest address is on the left.  The largest address is on the right.
Let's say you are storing the 32-bit value, 19088743, which is 0x01234567 in hex, at address 0x1000.  Hence, the 4-byte value will span over the 4 bytes at memory address 0x1000, 0x1001, 0x1002, and 0x1003
In big endian, the 01 is stored at 0x1000 (the smallest address) and the 67 is stored at 0x1003 (the largest address).  Exactly how you would think of it if you had never heard of little endian.
In little endian, the 01 is stored at 0x1003 (the largest address) and the 67 is stored at 0x01000 (the smallest address).
Big Endian and Network Byte Order generally mean the same thing.
Big Endian
|===================================|
| 0x1000 | 0x1001 | 0x1002 | 0x1003 |
|-----------------------------------|
|  0x01  |  0x23  |  0x45  |  0x67  |
|===================================|

Little Endian
|===================================|
| 0x1000 | 0x1001 | 0x1002 | 0x1003 |
|-----------------------------------|
|  0x67  |  0x45  |  0x23  |  0x01  |
|===================================|

Answer: Say you have a computer with one GiB of memory, that is with $2^{30}$ bytes. You will have some mental image how this memory is arranged, from left to right, from right to left (People who are used to writing from left to right usually don't do that), from top to bottom, or from bottom to top. That's purely in your mind (or a drawing on paper), but whatever mental image you have, there's a first and a last byte.
Usually you have a mapping from integer to memory bytes. In that case, you would likely associate the lowest number wit the first byte. Note that the lowest number is often not 0.


Question About Tab Notation

Question: Maybe an obvious question, but I ran across notation in the tabs for a song that I wasn't exactly familiar with. I'm fairly familiar with a lot of guitar notation, even though I primarily play drums, but this notation is confusing to me. It's a slur mark, but it isn't indicated a hammer-on or a pull off because there's no other note being indicated on the tab. It's  just the first note, then slurs of varying lengths. I mean after the harm on 7 with the full bend, it just goes off into nothing. Is it some odd notation for let ring?
Answer: Those aren't slurs, those are ties. So yes, it's notation for "let ring". Honestly, similar ties are used so often in the excerpt in your picture (in fact, such ties start getting used in Bar 8) that the note stems in the tab look close to outright deceiving to me: they do help you keep the rhythm, but the music won't sound like you play a new note on every stem in practice.

Question About Tab Notation


Problem in r.resample

Question: When I run r.resample to crop a map by using a vector and a mask, the resulting map has the same shape as the vector that I used but does not replicate (exactly) the portion of the raster map that I used as input in the r.resample. It produced a map with altered elevation values that is different from the raster map I used as input. I read that r.resample just "crops" the raster that is its input and does not alter it. I do not know why r.resample alters the output map
Comment: This question (although it doesn't seem to) actually asks the same thing as the answered one at http://gis.stackexchange.com/q/6736/664 .  The answer is to avoid resampling by making sure the output and input grids are precisely registered.
Comment: How can it be done in GRASS? r.resample just crops a given input map and produces a new map containing the selection of the mask. I cannot see how to make sure that the output and input grids are precisely registered
Answer: You can change the region resolution with g.region rast=inputmap so the region will have the same resolution as inputmap. Then r.resample will output a map with that resolution. If that does not work you can try r.mapcalc outputmap=inputmap instead of r.resample.
After that copy the colortable from one map to another: r.colors map=croppedmap rast=originalmap.
Comment: ok, maybe that's a problem with the colortable, try to copy the colortable from one map to another and see if it works: r.colors map=croppedmap rast=originalmap
Comment: I tried changing the region and setting it with the inputmap.I also tried using r.mapcalc. Both still produced a map with altered values. I noticed that it had altered values because the colors in the output raster map are different from the inputmap.
Comment: Nice, I'am editing the answer with that information.

Problem in r.resample


Should featured (bountied) questions be required to give out the bounty?

Question: Should featured (bountied) questions be required to give out the bounty for those who try their hardest in answering a question?
I think that the person with the highest ranking score after the seven days should AUTOMATICALLY get the bounty unless the asker gives it manually beforehand.
The asker doesn't have to say that was the answer by hitting the check mark but the people that work hard in finding the answers and have the highest POSITIVE score should get it.
Answer: What you've described is how it works already.
When the asker doesn't manually award the bounty, it goes to the highest up-voted answer posted since the start of the bounty. If no new answers have been posted (or none have received upvotes), the bounty fades away into the ether.
Comment: Only half the bounty is awarded automatically, though, if the user doesn't assign it manually.
Comment: @StrixVaria Ah, well, there's still *a* reward.


Prove that every simple graph $G$ contains a spanning subgraph, which is bipartite and $\deg(v') \geq \frac{1}{2}\deg(v)$.

Question:
(i) Prove that every finite simple graph $G$ contains a spanning subgraph $H$ (i.e., $V (G) =
V (H)$) such that $H$ is a bipartite graph, and for every vertex $x \in V(G)$, the degree of $x$ in $H$
  is at least half of the degree of $x$ in $G$, i.e.,$$\deg_{H}(x)\geq\frac{1}{2}\deg_{G}(x).$$
(ii) Conclude from part (i) that every finite simple graph contains a bipartite subgraph with at least half of the edges.
Comment: Part (i) is well-known in the form "any set of $n$ politicians can be split into two parties such that each politician has at least as many enemies in the opposite party as in their own".
Answer: Start with any partition $V_1, V_2$ of the vertices of $G$.
Move every vertex $v$ of $V_1$ that has more neighbours in $V_1$ than in $V_2$ to $V_2$ and do the same the vertices of $V_2$. The resulting bipartite graph with parts $V_1,V_2$ has the desired property.


Comparing the nature of ionic compounds

Question: I want to know how to compare the strength or stability of ionic compounds.
Example : $\ce{Mg(HCO3)2}$ and $\ce{NaHCO3}$
I know that polarity and polarizability affect the ionic and covalent nature.
Answer: "Strength". Hmm, what firstly comes to mind is you want a comparison of lattice energies (or more precisely, lattice enthalpies)
Lattice energy is a [crude] way of estimating how strong the electrostatic attractions are between ions in an ionic compound. Let's take the formation of $\ce{NaCl}$ into account, as I see it's the most common "ionic" compound that teachers start teaching the lesson with.
According to Born-Haber cycle this is the reaction that results in the formation of pure table salt:
$$\ce{Na+(g) + Cl- (g) \rightarrow NaCl(s)}$$
Forming the salt crystals is exothermic and this is called the lattice enthalpy of formation.

Note that some textbooks mean to define lattice energy as the energy that is obtained by the thermodynamic system in the process of turning the solid compound to its gaseous ions.

To make a long story short, the more the lattice enthalpy is, the stronger "bonds" you get.
There are two main factors that affect the lattice formation enthalpy:

Charge of the ions
Radius of the ions

Charge of the ions:

Source
Look at the diagram above. $\ce{NaCl}$ is known to release approximately 822 kilojoules upon formation, while $\ce{MgO}$ releases 3890 KJ. And what does that mean? It means that Magnesium Oxide is way more "stable" than Sodium Chloride. So, complete the rest:

The more the charge of the ions is in an ionic compound, the _____ is its lattice enthalpy and the ______ its stability.

Radius of the ions:

Source
As you see, and could've imagined if you were on the right track, bigger ions (literally) mean weaker attraction. I wanted the answer to be fairly complete, so I did an addition to the main point that answers your question. Thus, there's no need of expanding this.
In your case:
You might as well have reached a conclusion. Mg ion has a 2+ charge, while Na has only a single electron missing. The anion is pretty much the same, $\ce{HCO3-}$ (hydrogen carbonate), and its priorly covalent nature shouldn't mislead you in doubting your answer. There is a case of comparison of the charge of the ions, and I would say Magnesium ion wins.
In case of additional study, you can visit:
http://www.chemguide.co.uk/physical/energetics/lattice.html
http://www.knockhardy.org.uk/sci_htm_files/08le.pdf
http://www.rsc.org/learn-chemistry/resources/gridlocks/downloads/answers/Born%20Haber%20NaCl%20ans.pdf

Addendum:
The charge and the radius of ions are by no means the only factors that affect the lattice enthalpy. It's just that the other factors are considered "trivial" by current textbooks.
The lattice enthalpy and lattice energy aren't the same. They do have close meanings, though.
Answer: The strength of an ionic bond is determined by two factors:
The size of the ions (the smaller the ions the stronger the bond) NaF stronger than NaCl because F- is smaller than Cl-
The charge of the ions (the higher the charge the stronger the bond) Na2O stronger than NaCl, because O is a double negatively charged ion

Comparing the nature of ionic compounds


Algebraic Surfaces

Question: Is there any example of a smooth, projective surface $S$ over $\mathbb{C}$,  with Picard group $\mathbb{Z}$ and such that $H^1(S, L)$ is not zero for some ample line bundle $L$ ?
Answer: Edit. My original exact sequences were wrong.  I straightened them out now.
Let $X$ be a smooth, projective hyper-Kähler fourfold with $\text{Pic}(X)$ isomorphic to $\mathbb{Z}$, e.g., a sufficiently general deformation of the pair $(\text{Hilb}^2_{M/\mathbb{C}},\mathcal{O}(1))$ for $M$ a polarized K3 surface and $\mathcal{O}(1)$ the natural Plücker invertible sheaf.  Let $Y\subset X$ be a smooth ample hypersurface such that $h^r(X,\mathcal{O}_X(\underline{Y}))$ vanishes for $r=1,2$.  Let $Z\subset X$ be a very general hypersurface that is "sufficiently" ample.  In particular, assume that $h^r(X,\mathcal{O}_X(\underline{Z}))$ vanishes for $r=1,2$ and $h^2(X,\mathcal{O}_X(\underline{Z}-\underline{Y}))$ vanishes. Let $i:S\hookrightarrow X$ be $Y\cap Z$, and denote by $\mathcal{I}$ the ideal sheaf of $S$ in $X$. Let $L$ be  $\mathcal{O}_X(\underline{Y})|_S$.
There are short exact sequences,
$$ 0 \to \mathcal{I}(\underline{Y}) \to \mathcal{O}_X(\underline{Y}) \to i_* L \to 0,$$
$$
0 \to \mathcal{O}_X(-\underline{Z}) \to \mathcal{O}_X\oplus \mathcal{O}_X(\underline{Y}-\underline{Z}) \to \mathcal{I}(\underline{Y}) \to 0.$$
By hypothesis, $h^r(X,\mathcal{O}_X(\underline{Y})) = 0$ for $r= 1,2$.  Thus, via the long exact sequence of cohomology, the following connecting map is an isomorphism, $$\delta_\Sigma^1:H^1(S,L)\xrightarrow{\cong} H^2(X,\mathcal{I}(\underline{Y})).$$  By Serre duality, $h^{2+r}(X,\mathcal{O}_X(-\underline{Z}))$ equals  $h^{2-r}(X,\mathcal{O}_X(\underline{Z}))$.  Thus, for $r=0,1$, both of these vanish.  Finally, by Serre duality, $h^2(X,\mathcal{O}_X(\underline{Y}-\underline{Z})))$ equals $h^2(X,\mathcal{O}_X(\underline{Z}-\underline{Y}))$, so both of these vanish.  Thus, the long exact sequence of the second short exact sequence gives an isomorphism,
$$
H^2(X,\mathcal{O}_X)\to H^2(X,\mathcal{I}(\underline{Y})),
$$
so also $H^1(S,L)$ is isomorphic to $H^2(X,\mathcal{O}_X)$.
Of course for the hyper-Kähler fourfold $X$, $H^2(X,\mathcal{O}_X)$ is a $1$-dimensional vector space.
By the Lefschetz hyperplane theorem, the restriction map $\text{Pic}(X)\to \text{Pic}(Y)$ is an isomorphism (and the same holds for $Z$).  By the generalized Noether-Lefschetz theorem (as in SGA7), for $Z$ sufficiently ample and very general, the restriction map $\text{Pic}(Y)\to \text{Pic}(S)$ is also an isomorphism.  Thus $\text{Pic}(S)$ is isomorphic to $\mathbb{Z}$.
Edit. I was misremembering what is proved in SGA 7_2.  The generalized Noether-Lefschetz theorem was not proved there.  The generalized Noether-Lefschetz was proved by Kirti Joshi.
MR1299006 (96f:14005)
Joshi, Kirti(6-TIFR-SM)
A Noether-Lefschetz theorem and applications.
J. Algebraic Geom. 4 (1995), no. 1, 105–135.
https://arxiv.org/pdf/alg-geom/9305001v2.pdf
Comment: Dear Jason, many many thanks for this :)
Answer: For example, for an irregular surface of general type of Picard number one, $H^1(K_X)\neq0$. See Kovacs' answer here Smooth projective varieties of Picard number one.
Edit: As pointed out by @abx, in this case the picard group could not be $\mathbb{Z}$, as the surface is irregular.
Maybe the way of construct such example is to look at certain surface with $K_X=2L$ and try to show $H^1(L)\neq 0$.
Comment: For such a surface the Picard group is far from being $\mathbb{Z}$ — it contains a nontrivial abelian variety.
Comment: @abx, you are right...
Comment: @ChenJiang.  I made the same mistake that you made (and then I deleted my solution).  I read "Picard group" as "Neron-Severi group".

Algebraic Surfaces


Can relativistic kinetic energy be derived from Newtonian kinetic energy?

Question: Relativistic kinetic energy is usually derived by assuming a scalar quantity is conserved in an elastic collision thought experiment, and deriving the expression for this quantity. To me, it looks bodged because it assumes this conserved quantitiy exists in the first place, whereas I'd like a derivation based upon using KE $= \frac12 mv^2$ in one frame, and then summing it in another frame say to get the total kinetic energy. Can this or a similar prodecure be done to get the relativistic kinetic energy?
Comment: Newtonian and Einsteinian physics obey fundamentally different symmetry conditions, so it is not clear to me why you would expect to be able to do this. As for the existence of a conserved quantity looking funny to you, we can appeal to Noether's theorem. Both theories have a time translation symmetry, so both should have a conserved quantity related to it. Just not he same quantity.
Answer: Assuming energy conservation isn't "bodged" because at the most fundamental level, energy is defined as the quantity that is conserved as the result of the time-translational symmetry. All specific formulae for energy, such as $mv^2/2$ in nonrelativistic mechanics, are just solutions to the problem "find a conserved quantity linked to that symmetry".
Still, you can try to achieve what you have defined. First, you must realize that $K=mv^2/2$ only holds if $v\ll c$: it's just not a valid formula in relativity for large velocities. It seems that you believe that $E=mv^2/2$ is correct in some frames even in relativity but it's not. Your formula is just an approximation, via Taylor expansions,
$$ \frac{mc^2}{\sqrt{1-v^2/c^2}} = mc^2 + \frac{mv^2}{2} + \frac{3mv^4}{8c^2} + \dots $$
If you want to use $E=mv^2$ for small $v$ and deduce what is $E$ for an arbitrary $v$ comparable to the speed of light $c$, you must use infinitely many interpolating inertial systems.
In this SE question

How to derive addition of velocities without the Lorentz transformation?

Ron Maimon explained how velocities add. So if you want to switch to an inertial system moving by velocity $v$, you may calculate a rapidity from
$$\tanh a = \frac vc$$
These rapidities behave as angles so if you're boosting by some incremental speeds many times, the rapidities just add up (much like angles for rotations). The total energy is then $mc^2\cdot \cosh a$ which is equal to the usual relativistic formula but the derivation of this fact will have to use some conservation of energy argument similar to one you know. The relativistic formula is the only one that reduces to $mv^2/2$ for infinitesimal $v$ and that conserves the energy while the object is boosted.
Comment: @Physikslover: There is a problem with this idea, because the KE is not frame invariant, so the first infinitesimal increment is Newtonian, but the increments near relativistic speed are not given by Newtonian energy increments, only in the rest frame, and then you need to know how to boost an energy increment. If you know how to boost an energy increment, you know how to boost energy, and you get the relativitic energy. Lubos is right (and links to an answer of mine, hey, thanks) +1.
Comment: apologies for not making it clear that I'm looking for a derivation of relativistic kinetic energy. I'm thinking of relativistic kinetic energy of a particle as consisting of an infinite number of infinitesimal Newtonian kinetic energies, and this total must be conserved, but I don't know how to get at it for a derivation.
Comment: Thanks for the agreement, Ron. I was trying to fill in the gaps so that it would make more sense and resemble what Physiks lover wants - but it's so redundant. The resulting derivation is just a differential version of normal derivations; the beef has to be relativistic and it may be repulsive for the OP, anyway.


Missing required modules, SOMETIMES

Question: I have created a Swift framework that includes several other modules inside of it.
When I deployed the framework for others in our company to use, some people were seeing the following message:
Missing required modules: 'Alamofire', 'AlamofireObjectMapper','ObjectMapper'
This message comes up as soon as I put the
<code>import ASMCL
</code>
into my AppDelegate.swift file
Now, for the strange/confusing parts.
I have tried this on 4 different computers, all running the same version of Xcode (8.2.1).  On 3 of them, the framework worked without any errors.  On the 4th computer, I got the error described above.
On my coworkers system, he got the errors.  But, if he zips up his project and I try it on one of the machines that was working for me - it works just fine.
I checked the build settings and could not find any differences between ours.
Even stranger (to me at least), when using this same framework on an Objective-C project, NONE of the users are seeing these errors and the framework works exactly as expected!
As part of my build process, I have a small shell script that re-signs each of the included modules, but don't think that this has anything to do with the issue because I have re-signed the framework and all modules included in it, cleaned my project, and the error still persists.
I have also tried using my personal AppleID, instead of my work one.  On my home computer, I got no errors in my project.  On one of our work Macs, using my same personal AppleID, I got the errors.
Oh, the way I have been importing the framework into my files is by dragging the framework to the "Embedded Binaries" section, and NOT choosing "copy if needed", but putting the path to the location of the framework in the "Framework Search Paths".  I've tried with and without the "recursive" option.  On the computers where things work, I don't need "recursive".
I have also tried to "copy if needed" the framework, but that did not change anything.
I really don't know what else to try!  I can reproduce the issue, but I have yet to find a common reason on the projects where the framework works, and where it has these errror.
Even if some of you could throw some theories/crumbs at me, that would be awesome!  I just don't know what else to check.
Thanks for any/all help given!
Answer: I think I found my answer...
I don't think it is currently possible with Swift.
https://forums.developer.apple.com/message/134265

Missing required modules, SOMETIMES


KPSS test for large samples

Question: I am trying to interpret some KPSS results for a large sample (n=1800  - http://data.is/TB2z5b). In general the KPSS test can be used for samples with time series with more than 100 observations? Is there a reference I can consult?
Answer: The KPSS test will work with large samples. However, it will almost always be significant, as with all hypothesis tests, when applied to large samples. The null hypothesis of stationarity is only really true in exceptional circumstances (e.g., when the data are simulated). When there is enough data, there is sufficient evidence that the null hypothesis is incorrect.
Comment: I searched on google scholar and i was not able to find any good reference on this issue, could you suggest a paper i could consult ? In the case of large samples how could someone address this limitation ?

KPSS test for large samples


How to import a DBF file in SQL Server

Question: How can you import a foxpro DBF file in SQL Server?
Answer: Use a linked server or use openrowset, example
SELECT * into SomeTable
FROM OPENROWSET('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;
SourceDB=\\SomeServer\SomePath\;
SourceType=DBF',
'SELECT * FROM SomeDBF')

Comment: i used it , but this error occurs----OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Driver does not support this function".

Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".
Comment: @sqlchild: I had to install this to get things working for me. http://msdn.microsoft.com/en-us/vfoxpro/bb190233
Comment: @JoshBaltzell: I get the following error when I try to install that ODBC driver: "Error 1918: Error installing ODBC driver: Microsoft Visual FoxPro Diver, ODBC error 13.  The setup routines for the Microsoft Visual FoxPro Diver ODBC Driver could not be loaded due to system error code 1114: a dynamic link library (DLL) initialization routine failed. (C:\Windows\system32\vfpodbc.dll).. Verify that the file Microsoft Visual FoxPro Driver exists and that you can access it."
Comment: What happens with deleted records from dbf file?!
How can make the select command to work with two tables (dbf files) from different locations on the same PC?
These are my problems with those dbf files.
Regards, Vali
Answer: I was able to use the answer from jnovation but since there was something wrong with my fields, I simply selected specific fields instead of all, like:
select * into CERTDATA
from  openrowset('VFPOLEDB','C:\SomePath\CERTDATA.DBF';'';
    '','SELECT ACTUAL, CERTID,  FROM CERTDATA')

Very exciting to finally have a workable answer thanks to everyone here!
Comment: This worked for me.  However I would get an "Access denied" error until I went to Server Objects -> Linked Servers -> Providers -> VFPOLEDB, clicked on Properties and checked "Allow inprocesss"
Answer: What finally worked for us was to use the FoxPro OLEDB Driver and use the following syntax.  In our case we are using SQL 2008.
select * from
    openrowset('VFPOLEDB','\\VM-GIS\E\Projects\mymap.dbf';'';
    '','SELECT * FROM mymap')

Substitute the \\VM-GIS... with the location of your DBF file, either UNC or drive path.  Also, substitute mymap after the FROM with the name of the DBF file without the .dbf extension.
Comment: Yes you definitely want to be using OLEDB over ODBC in this.
Answer: http://elphsoft.com/dbfcommander.html can export from DBF to SQL Server and vice versa
Answer: This tools allows you to import to and from SQL Server.

http://www.download3000.com/download_17933.html

How to import a DBF file in SQL Server


Blood On The Clocktower - Mayor / Travelers

Question: Trouble Brewing Almanac:
Travelers count toward the three living players for a Mayor win.
So why do living Travelers need to be exiled before the final day with a living Mayor? This is what the almanac says, but I don't know why. I don't understand the difference between 3 normal characters and 2 normal / 1 traveler, on the final day. Yes, the Traveler means that the demon is one of the other two, changing the odds to 50% for the good players to win by execution, but the Mayor win seems to be unchanged.
Answer: Good can't win in that scenario, because Evil has already won.  With only two non-Traveler players alive, Evil wins because Travelers (who cannot be the Demon) don't count against Evil's win condition, per the rulebook:

Travelers do not count toward the evil team winning when
just two players remain alive. For example, if five players
are still alive, but three of them are Travelers, then evil wins.

So if Good wants to attempt a Mayor win, they'll need to exile the living Travelers at "final three" before refusing to execute.
Comment: That excerpt makes it clear, thanks. I may have downloaded an earlier version of the almanac. I'm waiting for my copy of BOTC to be shipped to the retailer.
Comment: @Bafs that excerpt is from the main rulebook, not the script-specific almanac :) hope you enjoy the game when it arrives.


Ubuntu mail server worth it?

Question: Currently i have 3 domains on a vps from digital ocean (running 14.04). Ive installed a lamp stack by following tutorials. Now I looked for an own mail server but most forums said it wasn't easy and is alot of work to maintain and advice to pay for one https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-server . how hard is it to install and to maintain compared to a lamp stack.  I have basic knolwedge of ubuntu. Is it adviced to just buy one ?
Comment: This is really a question of opinion - my stance: only set up a public-facing mail-server if you really know  what you are doing.
Answer: It's easy to host a mail server in Ubuntu... But it's really hard to do it well.
It's almost impossible for a novice to do it as well as a professional company can.
You can boil the arguments down to:

Uptime. Professional mail hosts can have multiple MX machines reading your email into a load-balaced cluster database. They'll be up 99.999999999% of the time. If your one server goes down, people sending email to you will see bounces. It won't look very good and you'll lose incoming email.
Spam. It takes billions of incoming emails to accurately detect which messages are really spam. That's why players like Gmail are so good at it. Tools like Spam Assassin rely on numbers and accurate training (which Gmail et al generate through crowd-sourcing all their users' input).
Security. Mail delivery, processing and access —including webmail— has so many attack vectors. It isn't like a webserver that you can do request analysis and frame limits on. Many processes interact with this foreign, possibly unsafe data and there are so many emerging attacks on every part of that stack. You have to stay on top of it all the time.
Blacklists and whitelists. The abundance of spammers has made many spam filtering systems work at least partially on lists of known spammers. If your provider gets a bad reputation for allowing spam, your IP could be caught up in a blacklist of their entire IP range. This will result in your outgoing emails simply being dropped.
There are many "certified" whitelist programmes around too where companies can pay to be included. These are typically expensive to join but this is what you need if you plan on sending a lot of email.

Hosted email is cheap (it can even be free) and there are some great options out there. If this is worth nothing to you, feel free to host it yourself, but honestly, a smart person lets somebody else deal with the headache.

That is not to say that either basic server or LAMP security are walks in the park. Ubuntu will handle the basic security —as long as you keep up to date with package updates— but you have to manage unpackaged things like Wordpress and Drupal installs, as well as making sane decisions to firewall away non-essential services, and not making any configuration faux pas.
Even things like basic SSH hardening (disclosure: mine) can take a while.
Comment: I started pushing people towards Zoho after Google made Gmail for domains more expensive. They're fairly good. I still prefer Gmail. I can't weigh up the price points for you though. Handling email well is hard work; I don't know how we've come to expect to get it for free.
Comment: Thanks for the afvice! Can you give some options. Currently i have gmail for business works great but pretty expensive .
Comment: I dont expect it for free but gmail is around 1000$ a year for 30 adresses. I used a simple webserver before i had a vps for 3$ a month and then i could create unlimited adresses for free.
Comment: 30 *users* might cost that but do you need more than one user? A single account can have many email aliases (on many domains too IIRC, but check that). If you have 30 *people*, then yes, it's expensive.

Ubuntu mail server worth it?


How Can I Display Categories Description

Question: I need to Display Categories Description.
I create a new file category.php with archives.php template.
i try this function but its not working.
 <?php echo category_description( $category_id ); ?>

Answer: From the category_description( $category_id ) parameters description:

Category ID. Will use global category ID by default.

This means that if you are intending to use the global id, you don't need to insert the variable $category_id which may be undefined in your use of the function. I'm assuming it is undefined because it is not listed in the global variables. This is the default use of the function which will use the ID of 0:
echo category_description();
Otherwise, if you want the description of a specific category, pass the ID of that category as an argument, such as:
echo category_description( 3 ); //gets the description for category with the ID of 3


Cellular homology of torus: cellular boundary homomorphism $d_2$ is abelianization of the attaching word.

Question: The torus $T$ has a CW decomposition given by one $1$-cell $p$, two $2$ cells $a,b$, and one $2$-cell $D$ being attached to the $1$-skeleton by the word $aba^{-1}b^{-1}$. I'm struggling to compute the cellular boundary homomorphism $d_2\colon\mathbb{Z}\{D\}\to\mathbb{Z}\{a,b\}$. I read elsewhere that $d_2$ is the abelianization of the word, so $d_2=a+b-a-b=0$. Could someone explain why this is true? I know the cellular boundary formula.
Comment: I think you mean a zero-cell $p$ and then two one-cells $a$ and $b$ (and finally one two-cell $D$).
Answer: Let's use the cellular boundary formula to compute $d_2(D)$. Let $\varphi : S^1 \to T^1$ (where $T^1$ is the $1$-skeleton of $T$) be the attaching map of the $2$-cell $D$. Note that $T^1$ is just a wedge sum of the two circles corresponding to $a, b$, and $\varphi$ is just the loop given by $aba^{-1}b^{-1}$. To find the coefficient of $a$ in $d_2(D)$, we want to compute the degree of the map
$$
S^1 \xrightarrow{\varphi} T^1 \xrightarrow{q} S^1,
$$
where $q$ is the quotient map that collapses the circle corresponding to $b$ to a single point. Note that $q\varphi$ is just the loop given by $aca^{-1}c^{-1}$, where $c$ is a constant path. In particular, $q\varphi$ is nullhomotopic, so its degree is $0$. By the cellular boundary formula, it follows that the coefficient of $a$ in $d_2(D)$ is $0$. Similarly, the coefficient of $b$ in $d_2(D)$ is also $0$, which proves $d_2 = 0$.

Edit: Here is an explanation of how $d_2(D)$ can be interpreted as the "abelianization" of the word $aba^{-1}b^{-1}$. Here's how to see it intuitively. You can view the CW structure of $T$ as a square whose opposite edges are identified:

You can see that the "boundary" of the $2$-cell is the word $aba^{-1}b^{-1}$. Since the cellular boundary map $d_2$ maps into the free abelian group $\mathbb{Z}\{a, b\}$, the boundary $d_2(D)$ is the abelianization $a + b - a - b$ of this word. That is, $d_2(D)$ is just the boundary of $D$ in the obvious sense, and everything is abelian since that's how we've defined things. Though this is just intuition, this is really how you should be thinking about the cellular boundary map.
A way to rigorously justify this (aside from what is above) is to define the cellular chain groups $C_n(T)$ as the relative homology groups $H_n(T^n, T^{n - 1})$ (again, $T^n$ is the $n$-skeleton), and each boundary map $d_n : H_n(T^n, T^{n - 1}) \to H_{n - 1}(T^{n - 1}, T^{n - 2})$ as the boundary map from the long exact sequence of the triple $(T^n, T^{n - 1}, T^{n - 2})$. This is how Hatcher defines cellular homology. In our case, we have $C_2(T) = H_2(T^2, T^1) \cong \mathbb{Z}$, which is generated by a $2$-chain whose image is $D$. If you work through the proof of the snake lemma, you'll find that the boundary map $d_2 : H_2(T^2, T^1) \to H_1(T^1, T^0)$ just takes the boundary of this $2$-chain, which is the $1$-chain $a + b - a - b$ (or at least homologous to it).
Comment: Thanks, this does help a lot. Though, I still am curious how this is related to "abelianization" of the word.
Comment: @Rough_Manifolds I edited my answer with an explanation.
Comment: This is wonderful, thanks a ton!


Compress large number of pictures to be packaged with app

Question: I want to package large number of pictures, almost 90 mb with my app.My initial implementation was to download the image whenever required but then it was causing unnecessary wait and is spoiling the experience.Is there any way to compress the app with the apk? Otherwise any suggestions from experience how to handle this situation? Also is if i ask user to download image set on sd card on first run, will i face any issues if i want to update image(i.e change some images).
Answer: First of all, you may find this Android blog post useful. You can assign huge expansion files (up to 2 GB) to you .apk, so you might as well put those images there. However, I'd certainly be upset as a user if I had to download that 90 MB again when you decide to update those images.
As an alternative, you could just .zip those images up, and if you can crank the overall app. size below the 50 MB limit, you could store it as a project asset. And you could unzip those images onto the SD card on the first run. But then again, updating the images is problematic.
Why do you consider on-demand downloading a bad approach? Your app could download those images as needed, and cache them on the SD card. You could also limit the cache size. I'd definitely go that way. Updating the images is straightforward opposed to the static way of embedding huge .zip files in your project's assets, or using expansion files.
Comment: I am fairly new to the android.I am caching images but the problem is the image is the key ingredient of the app.I want to show it as fast as possible when the user need to see it.I thought there might be some other way that i don't know.


What is the value of powdered onion as a fertilizer or soil amendment?

Question: Hypothetically speaking, if I have a whole bunch of onions that I powdered, what value might that powder have as a fertilizer or soil amendment for plants like tomatoes, peppers and cucurbits (just burying a few to several spoonfuls in the soil at transplanting time)? If you know the NPK values for the powder, that would also be very helpful. Also, levels of the following nutrients would be nice, if you know them: calcium, magnesium, manganese, iron, zinc, copper, silica and sulfur.
Comment: Be careful with onions, they can be growth suppressive to some plants. They do help cucumbers by suppressing mildew.
Comment: @Stephie I was just thinking of cheap food sources that *might* have valuable nutrients. It came down to potatoes and onions. I ruled out potatoes since they absorb more pesticides and herbicides than onions, I've heard. And potatoes might spread more diseases to tomatoes and peppers. I'm still thinking about giant squash, though. I'm just thinking about ways to make more kinds of organic fertilizer and such.
Answer: No value at all, frankly, particularly not in the way you suggest using the powder, regardless of any possible nutrient value. I'm not 100% sure what you mean when you say you 'powdered' them, that sort of suggests you ground them up and dried them.
Onions are acidic as they decompose, and drive away worms and other bio organisms in the ground, which would reduce fertility in the immediate area. They're not even great on an open compost heap, though the odd chopped up few here and there won't hurt, but an absolute no no in vermicomposting. In their fresh state, they contain reasonable levels of magnesium, phosphorus, calcium, and higher levels of potassium, traces only of other elements such as selenium, not sure what happens when they're dried or powdered. It's a bit late to say it now, but you'd have been best off chopping the onions up and freezing them for use in cooking whenever you needed them.


Webpack Resolve all Files in the src folder

Question: I have not used webpack much so this could be a simple or complex issue I'm not sure.
History
In the past my team has been using a simple and yet power method of flattening the src folder structure into a single folder with all our files to resolve the JS and HTML template imports. Once we came to the terms with the fact that folder structures are for humans only this made sense.
The Benefit is we can change the entire folder structure all at once without changing any code. So we can keep things as flat as possible until it made sense and when the time came to break things up we just did it and without changing a single line of code.
How we did this
We pulled this method off with Gulp and gulp-flatten and making sure all files had a verbose and unique name then resolved the files from the output. It has worked out great for us.
Problem
We are trying to replicate this same pattern with Webpack but we just can't figure it out. We have been looking into alias but we have yet to find something that flattens or just resolves all file in the src directory.
Answer: If you just want to copy all files and flatten them like gulp-flatten, you can use copy-webpack-plugin with the flatten option.
<code>[
    new CopyWebpackPlugin([
        { from: 'src/**/*', to: 'dest/', flatten: true }
    ], options)
]
</code>
But this won't resolve anything in the files.
You can also define every file as an entry point for webpack, this will flatten them as well and will use normal loaders.
<code>const glob = require('glob');

module.exports = () => {

    return {
        mode: 'development',
        entry: () => {
            return glob.sync('./src/*.js').reduce((pre, cur) => {
                pre[cur.replace(/^.*[\\\/]/, '').split('.')[0]] = cur;
                return pre;
            }, {});
        },
        output: {
            path: __dirname + '/dist',
            filename: '[name].js',
        },
    };
};
</code>


Clip an interpolated raster using points or create an extent polygon from points using ArcGIS for Desktop

Question: I have a point feature class that I have imported from lat longs in an Excel spreadsheet. I have created a raster image from these points however areas outside of the point set extent are interpolated. I would either like to find a way to only interpolate within the points extent or clip the raster using the points / create an extent polygon from the points and use that to clip the raster.
Comment: Could you specify how did you do that?. I'm trying to clip a raster by a shp (poligon) and interpolate those lacking cells to have a raster that cover completely the poligon extension. Update: I need to do so in R.
Answer: In order to clip raster by points:

Create a boundary polygon using "Toolboxes\System Toolboxes\Data Management Tools.tbx\Features\Minimum Bounding Geometry" tool
Using "Toolboxes\System Toolboxes\Data Management Tools.tbx\Raster\Raster Processing\Clip" tool with the created boundary

Alternatively, try using Convex Hull option in the first tool (Minimum Bounding Geometry).
Comment: Hi, thanks but unfortunately step 1 doesn't give the desiered outcome. I have however discovered a work around by converting the points to raster and adjusting the cell size. Then, using a custom tool to create a polygon of the raster extent, then use the clip tool.
Comment: Have you tried using Convex Hull option in the first tool (Minimum Bounding Geometry)?

Or there is another problem with that?
Comment: It doesn't give the desired results unfortunately but the work around method did the job.


Ruby: Default values for define?

Question: I have a question about define my main issue is I am a bit confused on how the parameters work for it.
This is my Methods
<code> def repeat(repeated_word)
    @repeated_word = repeated_word
    "#@repeated_word #@repeated_word"
    end
</code>
This is my rspec test to make sure my method works.
<code> describe "repeat" do
    it "should repeat" do
      repeat("hello").should == "hello hello"
    end

    # Wait a second! How can you make the "repeat" method
    # take one *or* two arguments?
    #
    # Hint: *default values*
    it "should repeat a number of times" do
      repeat("hello", 3).should == "hello hello hello"
    end
   end
</code>
it passes the first test but fails the second. My confusion is if i add a second parameter meaning def repeat(repeat_word, times_repeated)
the first test then fails because it has the wrong number of arguments. Not sure how to set up default values?
Answer: <code>def repeat(repeated_word, repeats=2)
  repeats.times.map { repeated_word }.join(' ')
end
</code>

Ruby: Default values for define?


Can i use old ecu on replacement enigine with same model number

Question: so basically head gasket went in my zafira, engine number z16xep.  After all the damage to pistons and cylinder etc it is cheaper to get replacement engine.. that's what I did. Its the same 1.6 twin port ecotec engine with same model number z16xep.. now my question is can I just use my old ecu on the new engine (plug and paly) without programming? Thanks
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: If it's the same exact model engine then you can use the ECU without any changes or re-programming. Mechanically it's the same, and the ECU has no way of knowing that it's a different engine as it only sees what is electrically connected to it, as in sensors and data inputs.
Comment: Happy days, that's a relief .. would I need to use old wiring loom? Thanks for your answer though buddy


Are percentage bonuses one off or on going?

Question: When I build a wonder that gives a percentage bonus, for example Hagia Sophia gives +33% generation of great people, is that percentage bonus applied once to the current base generation rate or it is on-going? i.e. if the base great person generation rate increases, is this bonus re-applyed to this rate?
Answer: All percentage bonuses are live and recalculated whenever the affected value changes, which is to say they are always based on the current base value, and not any historical value.
Since it's the given example, lets look at the +33% bonus to great person generation from the Hagia Sohpia.
Let's say that initially you have a city producing +3 great engineer points, with no other percentage effects currently in place.
You then build the Hagia Sohpia.
The +33% from the wonder will be applied to +3, boosting the output to +4.
Then, a few turns later, you adjust the citizen allocations for this city so that the base rate is now +6.
The +33% from the wonder will be applied to +6 (the current value), boosting the output to +8.
Comment: I just want to add that percentage bonuses are rounded not in your favour. That is 4+33%=5 and even 5+33%=6.
Answer: Most percentage based bonuses in the game are applied last. This means that if you are currently generating 3 great engineer points per turn and you build the Hagia Sophia, your new "gpp" looks like this
<code>Engineer 4 (3 + 1: 3 base, 1 +33% Hagia Sophia)
Artist 0 (0 + 0: 0 base, 0 +33% Hagia Sophia)
Merchant 0 (0 + 0: 0 base, 0 +33% Hagia Sophia)
Scientist 0 (0 + 0: 0 base, 0 +33% Hagia Sophia)
</code>
This works the same way for any other city % modifier, such as the forge, workshop, windmills, etc. Percentage bonuses are applied last.


Using a session variable in the where clause of a LINQ statement

Question: Good afternoon all.
I have a page that displays data in a gridview based upon what the user selects for a material in a radiobutton list and how many they wish to see, a text box.
Upon logging into this page, a session variable for MemberID is created, MemberKey.
What I would like to do is pass this session variable into the LINQ statement so that only the specific member that has logged in sees their data:

<code>        ContextTypeName="VDSWeightsReportingService.CompleteWeightsDataContext" EnableInsert="True"
            EnableUpdate="True" TableName="tblOnlineReportingCOMPLETEWEIGHTSFINALDEMOs"

        Where="MaterialText == @MaterialText && Productpriority <= @Productpriority && MemberId == @MemberId">
            <WhereParameters>
                <asp:ControlParameter ControlID="radMaterial" Name="MaterialText"
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="tbxHowMany" Name="Productpriority"
                    PropertyName="Text" Type="Int32" />
               <asp:SessionParameter Name="MemberId" SessionField="MemberKey"
                    Type="String" />
            </WhereParameters>
        </asp:LinqDataSource>
</code>
I have tried to insert the session variable as above but without the LINQ no longer seems to go through the motions.
Can someone point out to me where I am going wrong?
If this doesn't work, or is not possible, can someone advise of a way around this? i.e. using this session variable in the LINQ where clause.
Answer: Make sure you select the correct session variable!!!!


Can two wizards read the same spell from one scroll at the same time?

Question: I was asked this question from one of my group and I am wondering if two wizards
 can read the same spell say fireball from the same scroll at the same time and in effect have two fireballs created?
Answer: Yes...
Two wizards can recite a scroll together. Mechanically, this is done by one of them using the Help action, followed by the other using the Use an Object action.
...but No.
This does not cast Fireball twice.  It grants advantage on the DC 13 Intelligence check required to use the scroll if the (second) wizard is below 5th level.
Comment: A pair of low-level wizards struggling to harness power beyond their ken, chanting "The power of phlogiston compels you!" would be pretty cool, too.
Comment: I never considered Helping to read a scroll before. Definitely a good idea there.
Answer: No.
You can think of the scroll as a battery: A scroll contains the stored energy of a single spell. Thus, casting/releasing a spell from a scroll can only result in the same amount of magical energy as the scroll was loaded up with when written.
Answer: No.  The scroll is consumed as it's cast so there's no effective way to share it.


how to trace or get evidence you've been hacked

Question: my devices and my network have been compromised. I foolishly left my router unprotected
and they were able to gain access to all my apple devices and then install some sort of software that will take pictures and record audio and store them in their metadata so it remains hidden on my computer. This person has then set up a page and has leaked my personal pics & is spreading terrible rumors about me .......can anyone help me out...with the specifics on how this is done. So I can build a case against this person .....its gotten so bad that there saying I'm some sort of child predator and diseased pervert.
Answer: Your first priority: repression. Make sure that your security is tight and no more information is leaked.
Second priority: repair. Don't try to fight the criminal yourself. Go to the police and report a crime. Most police forces have a digital forensic team that can do the things needed. Let's just hope that they have the time/resources/priority to look into your case.


Measuring overlap of two quantum states

Question: I have a qubit state $|\psi\rangle = a|0\rangle + b|1\rangle$, and another qubit state $|\psi'\rangle = a'|0\rangle + b'| 1 \rangle$. I want, through quantum gates, to measure the overlap $|\langle \psi | \psi'\rangle|^2$ which is given by a projective measurement $\text{tr}\left[|\psi\rangle\langle \psi||\psi'\rangle\langle\psi'|\right]$. I want to know how to implement this measurement using quantum gates. Also, how would one generalise the measurement to a multi qubit state?
Comment: @MahathiVempati what I mean is how to introduce ancillary qubits or how to control the two qubit states to produce a new state that can be measured, and from which the overlap $|aa'+bb'|^2$ can be deduced.
Comment: [Quantum gates](https://en.wikipedia.org/wiki/Quantum_logic_gate) are necessarily reversible, and measurements are not - so this would not be possible.
Answer: You are looking for the SWAP test.
The basic idea is the following: First, the overlap $\omega=\mathrm{tr}[\rho\sigma]$ of two quantum states (e.g. the pure states in your question) is equal to
$$
\omega=\mathrm{tr}[(\rho\otimes\sigma)\mathbb F]\ ,
$$
with $\mathbb F$ the SWAP gate.
On the other hand, the expectation value of any unitary gate $U$ in a state $\rho$, $\mathrm{tr}[\rho U]$,  can be estimated using phase estimation.  The simplest version is to apply a controlled-U gate, where the control qubit is initialized in $|+\rangle$ and subsequently measured in the $|\pm\rangle$ basis.  It is an easy exercise to see that the probabilities of the two measurement outcomes are directly related to $\omega$.
Comment: Thanks Norbert, I searched on the Internet the generalised SWAP test and found figure 9 of this paper: https://arxiv.org/pdf/1303.6814.pdf. I leave it for someone that could have the same question as me in the future
Comment: I confirm that Garcia and Chamorro is the paper that describe the best swap test. However keep in mind that there are some limitations to Swap test especially error : I suggest reading also this paper in details https://iopscience.iop.org/article/10.1088/2058-9565/abe458/pdf

Measuring overlap of two quantum states


ubuntu 20.04 boot: black screen & AE_NOT_FOUND error + freezing

Question: my system is set up like this:

GIGABYTE AORUS GAMING 5 Z370 mobo

GTX 1660 Ti connected to 4K monitor

250GB NVMe: Windows 10

500GB NVMe: NTFS

120GB SSD: empty

120GB SSD: might be dead? should have ubuntu 20.04 installed on it, can't see it in BIOS or windows disk management

275GB SSD: empty

I have been trying to install ubuntu 20.04 from a USB drive (set up with RUFUS) to either of the empty SSDs, and having a hell of a time.
Originally, the issue appeared to be that (after selecting the USB drive for boot and arriving at the USB's grub2 menu) If I selected "Install Ubuntu", I would get kicked to a screen showing my mobo's logo, a "disk checking" progress bar, and a "ubuntu" wordmark at the bottom. Once the disk check finished, the progress bar disappears, and nothing further seems to happen -- I've left it like this overnight and nothing changes.
Next, I found that I could progress past the disk check freeze If I selected "Install Ubuntu (safe graphics)", and I would boot into the USB's OS and be able to install ubuntu. however, the installer would always crash when attempting to install third-party software, so I disabled that option and continued through a successful install.
However, now I cannot boot into my ubuntu installation at all. If I select the ubuntu drive from BIOS boot menu, The screen turns black immediately, everything freezes, and eventually my monitor goes to sleep.
I've tried:

installing on both of the SSDs, with similar results
creating the live USB stick on different computers with fresh .iso downloads
BIOS update + complete BIOS reset
Turning CSM support on and off in BIOS
CSM=OFF allows me to access secure boot settings, where I always set secure boot to OFF. With these settings set, I am able to reach the GRUB2 screen when booting into my ubuntu drive, but immediately I get the AE_NOT_FOUND error.
Here's a link to a picture of the error -- you can also notice some graphical glitching.
CSM=ON: Black screen/freezing as described before

Could this be because of my graphics card? Do I need to somehow update the ubuntu nvidia drivers before ubuntu crashes?
Thanks in advance for looking at my problem!

UPDATE:
I tried booting with CSM=ON, but this time I got into the TTY terminal using Ctrl+Alt+F2 (I kept pressing those buttons repeatedly after the initial BIOS screen disappeared). I was able to log in through this terminal. I then installed an Nvidia driver for my card using this command:
sudo apt-get install nvidia-driver-450
(As of the time of this question's posting, 450 is a relatively recent driver for my card)
I rebooted, and then I was able to get into ubuntu! so problem solved.. I guess? The only problem is that there's no GRUB menu at boot for me to switch between ubuntu and windows 10, so I guess this is my next issue to figure out...
Answer: The AE_NOT_FOUND error is relatively easy to fix and may be the cause of most of your problems so tackle that first. At the grub menu, select Edit, and where the text says quiet splash, change it to quiet splash pci=noaer
That should allow you to boot. If that fixes the error, you will need to sudo nano /etc/default/grub and add the same option to the default command line.
Let me know if you need better step-by-step instructions.
Comment: see my recent edits to my question. Thanks!
Comment: I advise that you check the output of `dmesg` to make sure that the log isn't being spammed with `AE_NOT_FOUND` messages.


How do you store numbers in a Rec Room circuit?

Question: I'm trying to save data in various places in my circuit but it's not clear what my options are. How can I store numbers in my circuit?
Answer: The Circuit Diagrams page on the community wiki (https://rec-room.fandom.com/wiki/Circuit_Diagrams) includes a couple of options (usually best for data that is not specific to individual players):

Pulse to Steady (for storing the last non-zero value): https://rec-room.fandom.com/wiki/Circuit_Diagrams#Pulse_to_Steady
Copy Value (ring based and RND based): https://rec-room.fandom.com/wiki/Circuit_Diagrams#Copy_Value
RS Latch (for storing Booleans) https://rec-room.fandom.com/wiki/Circuit_Diagrams#RS_Latch

If you want to store per-player data that you need only while a player is in the room, you can use the Set Player Stat and Get Player Stat chips (https://rec-room.fandom.com/wiki/Chips#Set_Player_Stat )
If you want to store per-player data that you want to keep after a player leaves the room, you should use the Set Leaderboard and Get Leaderboard chips (https://rec-room.fandom.com/wiki/Chips#Set_Leaderboard )
Answer: There are many ways to store data in rec room circuits. You should first put some thought into what exactly you're storing, what you're trying to achieve with that data, and any associations needed.
Basic storage can be done through flag, ring, and rand stores. That data is useful for tracking some event has occurred, but has no "indexing" capability. Indexing means you can provide some input such as a player or team id and get a different result based on the input provided. We won't talk about that here, I'm just making the distinction so you understand the many data storage options that exist. Also out of scope is leaderboard stats which are allow you to persist dynamic data between room instances.
Here is a link to some examples of storage circuits created in the Rec Room Circuit Simulator Tool: RRCS Circuit Examples. You can see these circuits in action and play with them. The Send Data button chips just alternate between the numbers 1 and 2 so you can see the values being replaced.
Let's discuss each one:

RandStore: Wire all three pins of a random chip to your input. It effectively picks a random number between your number and ... your number so it can only ever be what the input was. This is great for quickly and cheaply storing data. You use this if you want the data to stay the same until a new input is available and you want overwrite the current value. Downside is you cannot reset this store.

RingStore: Wire the output of a combinator back to one of its own inputs. This will remember whatever value was passed to it until reset. If it gets a new value instead of overwriting like the RandStore it adds to the existing value. This is useful for counting how many times an event occurred.

FlagStore: Wire the output of an OR chip back to one of its own inputs. This is a boolean store meaning it doesn't store the actual data, it just remembers that something has happened at least once. Flag stores aren't used very often because the RingStore pretty much does everything a flag store does without keeping track of count or the actual data. They can be used when you want to provide clarity in your design. A common use case would be pairing this with a game state chip to keep track of if the game is running or not. This could be used to control a lobby system for example.

ResetableRandStore: The addition of an OR chip before the Rand Chip allows you to set the value, and wire in a reset condition. The only caveat is it is slightly different from most RR circuits in that if the reset condition and input occur on the same tick this circuit will store the data where a RingStore for example will not.

NonCountingRingStore: This is essentially an anti-pattern in circuitry. It's just here to show you that you can approach problems in different ways, but be careful when it feels like you're trying to force a chip to do something it's just not the best tool for. Compare this to the ResetableRandStore. Yes you can force a combinator to reset each time by resetting the store first then sending input on the next tick. Adding delay to your circuits is almost never advisable unless you have a very specific use case. This means any circuits downstream from this circuit would not resolve in the same tick as the upstream circuits. It also costs more for no benefit.
Comment: I would appreciate if we could not promote anti-patterns (delay-store), new names (all of them), half-correct ("resetable rand") or incorrect solutions ("non-counting ring") here. There is a reason those are not in the wiki (anymore). The store-related sections of the wiki page are a result of many months (years?) of of collaborative research and selection. Yes other stores exist, but the likelihood that you come up with better ones on the spot is low (e.g. see above). If you happen to do, please discuss them in the community and afterwards add them to the wiki.


How to instance objects including particle system?

Question: I've searched high and low and couldn't find any answer to a seemingly simple problem. I have a sphere with a particle hair modifier applied and I'd like to instance this multiple times using geometry nodes. The particle hair somehow gets ignored on the instanced objects when rendered with Cycles. How do I do this? Thanks!
Answer: I can't tell you the reason that your particle system doesn't show up in rendered mode (but does in solid mode). Your approach also seems to work in Evee.
However, it does work if you do it the other way around; rather than adding a Geometry node modifier to the instanced object (PomPom), instead create the mesh (Cylinder) you want to use for distributing the objects and add the Geometry node set-up to that:


How to get detergent smell out of silicone utensils

Question: I've bought a squeezy silicone toy and some kitchen utensils in a chemical store and didn't notice they smell a LOT under 2 masks (2 cause I'm allergic and sharp chem smells irritate my pharynx quite bad). I've washed it like 5 times with dish soap, regular soap, shampoo, soaked in baking soda and vinegar for an hour, nothing helps, the smell is as strong as before... Idk if they keep all their stuff piled up under broken detergent bags or smth, but it's melting my breather even from an arm's length...
Comment: Hi CupOfRedTea, Welcome to Lifehacks. Don't forget to review the  [Tour] and [Help] to find out more about our site. That said, your two most viable options are to return the 'defective' goods for refund, or to 'gift' them to someone with less sensitivity to the odour. Certain kinds of plastics acquire a detergent-like odour as they age. There is no 'fix' for the deterioration. Good luck.
Comment: Leave it outdoors (under cover) for a week, where air circulates?
Answer: Something that works for me is to soak the item in a solution of Borax and white vinegar. I use it to remove the smell from empty glass jars that had very potent smelling items in them like pasta sauce, pickles and Caesar dressing. Like yourself, I tired all the other solutions I found online and none worked very well until I used Borax/vinegar combo.
It works so well, that even after my jars have been deodorized, I store the leftover solution in a separate large glass jar and can reuse it multiple times for deodorizing other jars or small objects.
You can purchase some from many big box stores and it's usually in the Laundry aisle. Since I'm in Canada, I get mine from Canadian Tire. This is the most popular brand of Borax:
Comment: Looks like something that'll be hard to find where I live, but I'll look around, thanks!
Comment: Apparently you can also purchase it online if that's easier. The company's page lists all the other retailers near your location that sell it. Hopefully, there's a store near you that does carry it. https://www.20muleteamlaundry.com/where-to-buy/
Answer: If chemicals haven't worked you could try heat. Heat oven to 350 and flip them every 20 minutes  until the smell is out.
https://youtu.be/iIGb6dkvhvQ
Answer: If none of the suggestions you get work, might I suggest a new brand?
I have oxo-branded silicone utensils that have never smelled at all.
https://www.oxo.com/categories/cooking-and-baking/utensils.html
I don't have a link for the toy as I don't know what kind of toy it is.
Answer: Use colorless technical alcohol.  Fill a receptacle fit for your utensils,
put your utensils in the receptacle, fill with alcohol until you cover them and wait 2 hours and then evaluate.
Also try with vinegar but alcohol when it dries out will leave no or negligible smell.
Comment: What do you mean by 'technical' alcohol?  In most jurisdictions you would need a licence to posess pure alcohols, especially in sufficient volumes to do what you suggest.
Comment: Isopropyl alcohol, i was talking about, its a strong alcohol that i used to clean metalic scisors at work.,,                        if not then find a strong alcohol that has not been colored. use a enclosed recipient


Minimum force required to make an object slipping

Question: Let's say we have a when and I exert some force on the center of mass of the wheel. The wheel starts rolling without slipping.At the contact point the static friction force is opposite to the force I am exerting. To find the the minimum force required to make the wheel slip I have to find the torque of the maximum static friction, then find the angular acceleration produced by that torque and then since it will slip the translational acceleration must be greater than that angular acceleration*radius of wheel and solve the equation correct?
Answer: Yes, it is correct. The maximum static friction is $F_A^{max}=\mu_S Mg$, being $M$ the mass of the wheel, and its torque is $\tau_A^{max}=R\mu_S Mg$, so the maximum angular acceleration without slipping is
$$
\alpha^{max}=\frac{\tau_A^{max}}{I}=\frac{R\mu_S Mg}{I}
$$
Let $F$ be the exerted force, which produces an acceleration
$$
a_{CM}=\frac{F}{M}
$$
so
$$
\frac{F}{M}=a_{CM}=R\alpha^{max}=\frac{R^2\mu_S Mg}{I}\quad\Longrightarrow\quad F^{min}=\frac{R^2\mu_S M^2g}{I}
$$